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 |
|---|---|---|---|---|---|
VigTech/Vigtech-Services | env/lib/python2.7/site-packages/django/core/management/commands/compilemessages.py | 99 | 4926 | from __future__ import unicode_literals
import codecs
import glob
import os
from django.core.management.base import BaseCommand, CommandError
from django.core.management.utils import find_command, popen_wrapper
from django.utils._os import npath, upath
def has_bom(fn):
with open(fn, 'rb') as f:
sample =... | lgpl-3.0 |
rahuldan/sympy | sympy/polys/agca/tests/test_modules.py | 121 | 13526 | """Test modules.py code."""
from sympy.polys.agca.modules import FreeModule, ModuleOrder, FreeModulePolyRing
from sympy.polys import CoercionFailed, QQ, lex, grlex, ilex, ZZ
from sympy.abc import x, y, z
from sympy.utilities.pytest import raises
from sympy import S
def test_FreeModuleElement():
M = QQ.old_poly_r... | bsd-3-clause |
pigeon0411/eb06 | components/external/freetype/src/tools/docmaker/formatter.py | 14 | 6020 | #
# formatter.py
#
# Convert parsed content blocks to a structured document (library file).
#
# Copyright 2002, 2004, 2007, 2008, 2014 by
# David Turner.
#
# This file is part of the FreeType project, and may only be used,
# modified, and distributed under the terms of the FreeType project
# license, LICENSE.T... | gpl-2.0 |
hiro2016/ergodox_gui_configurator | GUIComponents/KeyPresstInterceptorComponent.py | 1 | 9286 | import platform
from threading import Timer
from PyQt5 import QtCore
from PyQt5.QtCore import QObject, pyqtSignal
from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QTextEdit, QLabel, QSizePolicy, QLineEdit, QApplication, QWidget
import sys
from NoneGUIComponents import keypress_observer
from NoneGUIComponents.dic... | gpl-2.0 |
YukiKita/fio | tools/hist/fiologparser_hist.py | 3 | 15090 | #!/usr/bin/env python2.7
"""
Utility for converting *_clat_hist* files generated by fio into latency statistics.
Example usage:
$ fiologparser_hist.py *_clat_hist*
end-time, samples, min, avg, median, 90%, 95%, 99%, max
1000, 15, 192, 1678.107, 1788.859, 1856.076, ... | gpl-2.0 |
rlr/fjord | vendor/packages/urllib3/dummyserver/testcase.py | 8 | 3571 | import unittest
import socket
import threading
from nose.plugins.skip import SkipTest
from tornado import ioloop, web, wsgi
from dummyserver.server import (
SocketServerThread,
run_tornado_app,
run_loop_in_thread,
DEFAULT_CERTS,
)
from dummyserver.handlers import TestingApp
from dummyserver.proxy impor... | bsd-3-clause |
repotvsupertuga/repo | script.module.t0mm0.common/lib/t0mm0/common/net.py | 81 | 10355 | '''
common XBMC Module
Copyright (C) 2011 t0mm0
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
Th... | gpl-2.0 |
vprusso/youtube_tutorials | web_scraping_and_automation/selenium/craigstlist_scraper.py | 1 | 2952 | # YouTube Video (Part 1): https://www.youtube.com/watch?v=4o2Eas2WqAQ&t=0s&list=PL5tcWHG-UPH1aSWALagYP2r3RMmuslcrr
# YouTube Video (Part 2): https://www.youtube.com/watch?v=x5o0XFozYnE&t=716s&list=PL5tcWHG-UPH1aSWALagYP2r3RMmuslcrr
# YouTube Video (Part 3): https://www.youtube.com/watch?v=_y43iqSJgnc&t=1s&list=PL5tcWHG... | gpl-3.0 |
azaghal/ansible | test/lib/ansible_test/_internal/manage_ci.py | 7 | 11424 | """Access Ansible Core CI remote services."""
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
import os
import tempfile
import time
from .util import (
SubprocessError,
ApplicationError,
cmd_quote,
display,
ANSIBLE_TEST_DATA_ROOT,
)
from .util_common import... | gpl-3.0 |
robhudson/django | tests/model_inheritance/tests.py | 283 | 17419 | from __future__ import unicode_literals
from operator import attrgetter
from django.core.exceptions import FieldError, ValidationError
from django.core.management import call_command
from django.db import connection
from django.test import TestCase, TransactionTestCase
from django.test.utils import CaptureQueriesCont... | bsd-3-clause |
Fedik/gramps | gramps/plugins/quickview/filterbyname.py | 2 | 18863 | #
# Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2008 Brian G. Matherly
#
# 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; ... | gpl-2.0 |
wbc2010/django1.2.5 | django/contrib/gis/geos/point.py | 403 | 4253 | from ctypes import c_uint
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry
from django.contrib.gis.geos import prototypes as capi
class Point(GEOSGeometry):
_minlength = 2
_maxlength = 3
def __init__(self, x, y=None, z=None, srid=None):
... | bsd-3-clause |
andrius-preimantas/purchase-workflow | purchase_group_hooks/tests/test_merge_po.py | 31 | 2703 | from mock import Mock
from openerp.tests.common import BaseCase
from openerp.osv.orm import browse_record
class TestGroupOrders(BaseCase):
def setUp(self):
super(TestGroupOrders, self).setUp()
self.order1 = Mock()
self.order2 = Mock()
self.order1.order_line = self.order2.order_l... | agpl-3.0 |
caveman-dick/ansible | lib/ansible/modules/network/aci/aci_bd_subnet.py | 20 | 7773 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
alaski/nova | nova/objects/build_request.py | 2 | 16393 | # 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 |
sammyshj/gci | static/scripts/tools/import_supply_item_ifrc_standard.py | 10 | 1893 | # Script to import all
#
# run as python web2py.py -S eden -M -R applications/eden/static/scripts/tools/import_supply_item_ifrc_standard.py -A complete
#
# Equivalent to PrePop:
# supply,item_category,supply_item_category_ifrc_standard.csv,item_category_ifrc_standard.xsl
# supply,item,supply_item_ifrc_standard.csv, ite... | mit |
CMartelLML/numpy | numpy/lib/scimath.py | 221 | 14085 | """
Wrapper functions to more user-friendly calling of certain math functions
whose output data-type is different than the input data-type in certain
domains of the input.
For example, for functions like `log` with branch cuts, the versions in this
module provide the mathematically valid answers in the complex plane::... | bsd-3-clause |
cisco-oss-eng/Cloud99 | cloud99/loaders/__init__.py | 1 | 2556 | # Copyright 2016 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.org/licenses/LICENSE-2.0
#
# Unless required by applicable la... | apache-2.0 |
MiroK/DolfinSurface | site-packages/dolfin_utils/cppparser/utils.py | 4 | 5992 | # Utilities for parsing DOLFIN files and generaton of SWIG files
#
# Copyright (C) 2012 Johan Hake
#
# This file is part of DOLFIN.
#
# DOLFIN 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 vers... | gpl-3.0 |
olimastro/DeepMonster | deepmonster/lasagne/nn.py | 1 | 16191 | """
neural network stuff, intended to be used with Lasagne
All this code, except otherwise mentionned,
was written by openai taken from improvedgan repo on github
"""
import numpy as np
import theano as th
import theano.tensor as T
from theano.tensor.nnet.abstract_conv import (bilinear_upsampling, )
from theano.sandb... | mit |
tinkhaven-organization/odoo | addons/purchase_requisition/purchase_requisition.py | 200 | 23548 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). All Rights Reserved
# $Id$
#
# This program is free software: you can redistribute it and/or modify
# ... | agpl-3.0 |
bristy/login_app_flask | env/lib/python2.7/site-packages/setuptools/command/egg_info.py | 115 | 14336 | """setuptools.command.egg_info
Create a distribution's .egg-info directory and contents"""
import os
import re
import sys
from setuptools import Command
import distutils.errors
from distutils import log
from setuptools.command.sdist import sdist
from setuptools.compat import basestring
from setuptools import svn_uti... | mit |
camilonova/sentry | src/sentry/utils/sqlparser.py | 36 | 1072 | """
sentry.utils.sqlparser
~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
from sqlparse import engine
from sqlparse import filters
from sqlparse import tokens as T
class ValueFilter... | bsd-3-clause |
petercable/mi-dataset | mi/dataset/parser/test/test_parad_n_auv.py | 7 | 2909 | #!/usr/bin/env python
"""
@package mi.dataset.parser.test
@fid marine-integrations/mi/dataset/parser/test/test_parad_n_auv.py
@author Jeff Roy
@brief Test code for a parad_n_auv data parser
NOTE: As this is the 5th parser built from AuvCommonParser
full negative testing is not done. See dosta_ln_auv and adcpa_n_auv... | bsd-2-clause |
nkalodimas/invenio | modules/miscutil/lib/dbquery_regression_tests.py | 6 | 3032 | # -*- coding: utf-8 -*-
## This file is part of Invenio.
## Copyright (C) 2011, 2012 CERN.
##
## Invenio 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 optio... | gpl-2.0 |
AlanZatarain/pleft | plauth/models.py | 8 | 2721 | # Copyright 2009, 2010 Sander Dijkhuis <sander.dijkhuis@gmail.com>
#
# This file is part of Pleft.
#
# Pleft 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 |
kjagoo/wger_stark | wger/utils/tests/test_unit_conversion.py | 2 | 3549 | # This file is part of wger Workout Manager.
#
# wger Workout Manager 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
# (at your option) any later version.
#
# wger W... | agpl-3.0 |
Ghostkeeper/Luna | plugins/storage/localstorage/__init__.py | 1 | 1457 | #!/usr/bin/env python
#-*- coding: utf-8 -*-
#This software is distributed under the Creative Commons license (CC0) version 1.0. A copy of this license should have been distributed with this software.
#The license can also be read online: <https://creativecommons.org/publicdomain/zero/1.0/>. If this online license dif... | cc0-1.0 |
rodrigopolo/cheatsheets | upload_video.py | 1 | 7001 | #!/usr/bin/env python
# Modified to always use the installation path to store and read the client_secrets.json and pyu-oauth2.json file
import httplib
import httplib2
import os
import random
import sys
import time
from apiclient.discovery import build
from apiclient.errors import HttpError
from apiclient.http import ... | mit |
richardnpaul/FWL-Website | lib/python2.7/site-packages/django/contrib/formtools/wizard/storage/base.py | 216 | 3949 | from django.core.files.uploadedfile import UploadedFile
from django.utils.datastructures import MultiValueDict
from django.utils.functional import lazy_property
from django.utils import six
from django.contrib.formtools.wizard.storage.exceptions import NoFileStorageConfigured
class BaseStorage(object):
step_key ... | gpl-3.0 |
WSULib/combine | tests/test_models/test_validation_scenario.py | 1 | 2903 | from django.test import TestCase
from core.models import ValidationScenario
from tests.utils import TestConfiguration
SCHEMATRON_PAYLOAD = '''<?xml version="1.0" encoding="UTF-8"?>
<schema xmlns="http://purl.oclc.org/dsdl/schematron" xmlns:internet="http://internet.com">
<ns prefix="internet" uri="http://internet.com... | mit |
Bloodyaugust/sugarlabcppboilerplate | lib/boost/tools/build/test/explicit.py | 6 | 1340 | #!/usr/bin/python
# Copyright 2003 Vladimir Prus
# Distributed under the Boost Software License, Version 1.0.
# (See accompanying file LICENSE_1_0.txt or http://www.boost.org/LICENSE_1_0.txt)
import BoostBuild
t = BoostBuild.Tester(use_test_config=False)
t.write("jamroot.jam", """\
exe hello : hello.cpp ... | gpl-2.0 |
Deepakkothandan/ansible | lib/ansible/modules/network/avi/avi_backup.py | 27 | 3955 | #!/usr/bin/python
#
# Created on Aug 25, 2016
# @author: Gaurav Rastogi (grastogi@avinetworks.com)
# Eric Anderson (eanderson@avinetworks.com)
# module_check: supported
# Avi Version: 17.1.1
#
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the te... | gpl-3.0 |
hainm/scipy | scipy/optimize/nnls.py | 116 | 1423 | from __future__ import division, print_function, absolute_import
from . import _nnls
from numpy import asarray_chkfinite, zeros, double
__all__ = ['nnls']
def nnls(A, b):
"""
Solve ``argmin_x || Ax - b ||_2`` for ``x>=0``. This is a wrapper
for a FORTAN non-negative least squares solver.
Parameters... | bsd-3-clause |
foreni-packages/hachoir-parser | setup.py | 1 | 2770 | #!/usr/bin/env python
from imp import load_source
from os import path
from sys import argv
# Procedure to release a new version:
# - edit hachoir_parser/version.py: __version__ = "XXX"
# - edit setup.py: install_options["install_requires"] = "hachoir-core>=XXX"
# - edit INSTALL: update Dependencies
# - run: ./test... | gpl-2.0 |
gurneyalex/vertical-travel | travel/tests/test_travel.py | 2 | 7477 | # -*- encoding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module copyright (C) 2013 Savoir-faire Linux
# (<http://www.savoirfairelinux.com>).
#
# This program is free software: you can redistribute it and/or m... | agpl-3.0 |
h2educ/scikit-learn | examples/covariance/plot_outlier_detection.py | 235 | 3891 | """
==========================================
Outlier detection with several methods.
==========================================
When the amount of contamination is known, this example illustrates two
different ways of performing :ref:`outlier_detection`:
- based on a robust estimator of covariance, which is assumin... | bsd-3-clause |
jkshaver/virtualenv-1.8.2 | env/lib/python2.7/site-packages/django/utils/numberformat.py | 94 | 1775 | from django.conf import settings
from django.utils.safestring import mark_safe
def format(number, decimal_sep, decimal_pos=None, grouping=0, thousand_sep='',
force_grouping=False):
"""
Gets a number (as a number or string), and returns it as a string,
using formats defined as arguments:
* ... | mit |
django-leonardo/django-leonardo | leonardo/conf/default.py | 1 | 3507 |
from leonardo.base import default
EMAIL = {
'HOST': 'mail.domain.com',
'PORT': '25',
'USER': 'username',
'PASSWORD': 'pwd',
'SECURITY': True,
}
RAVEN_CONFIG = {}
ALLOWED_HOSTS = ['*']
USE_TZ = True
DEBUG = True
ADMINS = (
('admin', 'mail@leonardo.cz'),
)
# month
LEONARDO_CACHE_TIMEOUT = ... | bsd-3-clause |
Jionglun/w17test_2 | static/Brython3.1.1-20150328-091302/Lib/xml/dom/minidom.py | 727 | 66854 | """Simple implementation of the Level 1 DOM.
Namespaces and other minor Level 2 features are also supported.
parse("foo.xml")
parseString("<foo><bar/></foo>")
Todo:
=====
* convenience methods for getting elements and text.
* more testing
* bring some of the writer and linearizer code into conformance with this
... | gpl-3.0 |
jrbadiabo/Coursera-Stanford-ML-Class | Python_Version/Ex7.K-Means_PCA_-_Clustering/computeCentroids.py | 2 | 1072 | import numpy as np
def computeCentroids(X, idx, K):
"""returns the new centroids by
computing the means of the data points assigned to each centroid. It is
given a dataset X where each row is a single data point, a vector
idx of centroid assignments (i.e. each entry in range [1..K]) for each
examp... | mit |
filterfoundry/django-mailer | django_mailer/tests/base.py | 3 | 2289 | from smtplib import SMTPRecipientsRefused
from django.core import mail
from django.test import TestCase
from django_mailer import queue_email_message
from django_mailer.tests.exceptions import DeferOnError
try:
from django.core.mail import backends
EMAIL_BACKEND_SUPPORT = True
except ImportError:
# Django ... | mit |
eufarn7sp/egads-eufar | egads/thirdparty/nappy/script/nc2csv.py | 2 | 2206 | #!/usr/bin/env python
# Copyright (C) 2004 CCLRC & NERC( Natural Environment Research Council ).
# This software may be distributed under the terms of the
# Q Public License, version 1.0 or later. http://ndg.nerc.ac.uk/public_docs/QPublic_license.txt
"""
nc2csv.py
=========
Converts a NetCDF file into one or m... | bsd-3-clause |
sunfounder/SunFounder_SensorKit_for_RPi2 | Python/08_vibration_switch.py | 1 | 1101 | #!/usr/bin/env python3
import RPi.GPIO as GPIO
import time
VibratePin = 11
Gpin = 13
Rpin = 12
tmp = 0
def setup():
GPIO.setmode(GPIO.BOARD) # Numbers GPIOs by physical location
GPIO.setup(Gpin, GPIO.OUT) # Set Green Led Pin mode to output
GPIO.setup(Rpin, GPIO.OUT) # Set Red Led Pin mode to out... | gpl-2.0 |
ntienhuy/mkpickup | vendor/psy/psysh/test/tools/vis.py | 710 | 3428 | """
vis.py
======
Ctypes based module to access libbsd's strvis & strunvis functions.
The `vis` function is the equivalent of strvis.
The `unvis` function is the equivalent of strunvis.
All functions accept unicode string as input and return a unicode string.
Constants:
----------
* to select alternate encoding for... | apache-2.0 |
felixfontein/ansible | lib/ansible/module_utils/facts/virtual/linux.py | 15 | 17328 | # 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 |
LookThisCode/DeveloperBus | Season 2013/Brazil/Projects/QueroMe-master/openid/store/sqlstore.py | 154 | 17190 | """
This module contains C{L{OpenIDStore}} implementations that use
various SQL databases to back them.
Example of how to initialize a store database::
python -c 'from openid.store import sqlstore; import pysqlite2.dbapi2; sqlstore.SQLiteStore(pysqlite2.dbapi2.connect("cstore.db")).createTables()'
"""
import re
i... | apache-2.0 |
rbrito/pkg-youtube-dl | youtube_dl/extractor/fujitv.py | 2 | 1048 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
class FujiTVFODPlus7IE(InfoExtractor):
_VALID_URL = r'https?://i\.fod\.fujitv\.co\.jp/plus7/web/[0-9a-z]{4}/(?P<id>[0-9a-z]+)'
_BASE_URL = 'http://i.fod.fujitv.co.jp/'
_BITRATE_MAP = {
300: (320, 180),
... | unlicense |
brain-tec/account-invoicing | account_invoice_line_sort/models/account_invoice.py | 3 | 4985 | # -*- coding: utf-8 -*-
##############################################################################
# This file is part of account_invoice_line_sort, an Odoo module.
#
# Copyright (c) 2015 ACSONE SA/NV (<http://acsone.eu>)
#
# account_invoice_line_sort is free software: you can redistribute it
# and/... | agpl-3.0 |
ivano666/tensorflow | tensorflow/contrib/ffmpeg/encode_audio_op_test.py | 6 | 1742 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | apache-2.0 |
dcroc16/skunk_works | google_appengine/lib/django-1.2/django/template/defaulttags.py | 52 | 42517 | """Default tags used by the template system, available to all templates."""
import sys
import re
from itertools import groupby, cycle as itertools_cycle
from django.template import Node, NodeList, Template, Context, Variable
from django.template import TemplateSyntaxError, VariableDoesNotExist, BLOCK_TAG_START, BLOCK... | mit |
silenceli/nova | nova/tests/unit/compute/test_arch.py | 94 | 2077 | # Copyright (C) 2014 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 ... | apache-2.0 |
lekshmideepu/nest-simulator | pynest/nest/tests/test_parrot_neuron.py | 10 | 9965 | # -*- coding: utf-8 -*-
#
# test_parrot_neuron.py
#
# This file is part of NEST.
#
# Copyright (C) 2004 The NEST Initiative
#
# NEST is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 2 of the Lice... | gpl-2.0 |
brigittebigi/proceed | proceed/src/wxgui/cutils/viewsutils.py | 1 | 4360 | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
# ---------------------------------------------------------------------------
# ___ __ __ __ ___
# / | \ | \ | \ / Automatic
# \__ |__/ |__/ |___| \__ Annotation
# \ | | | | ... | gpl-3.0 |
dariemp/odoo | addons/l10n_es/__openerp__.py | 314 | 2772 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (c) 2008-2010 Zikzakmedia S.L. (http://zikzakmedia.com) All Rights Reserved.
# Jordi Esteve <jesteve@zikzakmedia.com>
# Copy... | agpl-3.0 |
notyal/shadowsocks | shadowsocks/eventloop.py | 949 | 7288 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2013-2015 clowwindy
#
# 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 |
ManiacalLabs/BiblioPixel | bibliopixel/control/editor.py | 2 | 1870 | import weakref
from . address import number, Address
from . receiver import Receiver
from .. util import deprecated
class Editor(Receiver):
"""
A `Editor` is a `Receiver` which gets and sets `Address`es, perhaps using an
an optional `EditQueue` for the setting.
When the `set_project` method is called... | mit |
WoLpH/nosedjango | nosedjango/plugins/base_plugin.py | 1 | 2333 | import math
import random
import string
from nose.plugins.base import Plugin as NosePlugin
class Plugin(NosePlugin):
django_plugin = True
_unique_token = None
def get_unique_token(self):
"""
Get a unique token for usage in differentiating test runs that need to
run in parallel.
... | lgpl-3.0 |
whip112/Whip112 | vendor/packages/translate/filters/test_autocorrect.py | 26 | 2621 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from translate.filters import autocorrect
class TestAutocorrect:
def correct(self, msgid, msgstr, expected):
"""helper to run correct function from autocorrect module"""
corrected = autocorrect.correct(msgid, msgstr)
print(repr(msgid))
... | mpl-2.0 |
shahankhatch/scikit-learn | sklearn/utils/mocking.py | 267 | 2064 | import numpy as np
from ..base import BaseEstimator, ClassifierMixin
from .testing import assert_true
from .validation import _num_samples, check_array
class ArraySlicingWrapper(object):
def __init__(self, array):
self.array = array
def __getitem__(self, aslice):
return MockDataFrame(self.ar... | bsd-3-clause |
chuajiesheng/google-python-exercises | basic/solution/mimic.py | 208 | 2995 | #!/usr/bin/python -tt
# Copyright 2010 Google Inc.
# Licensed under the Apache License, Version 2.0
# http://www.apache.org/licenses/LICENSE-2.0
# Google's Python Class
# http://code.google.com/edu/languages/google-python-class/
"""Mimic pyquick exercise -- optional extra exercise.
Google's Python Class
Read in the ... | apache-2.0 |
stormi/tsunami | src/primaires/scripting/actions/ecrire_memoire.py | 1 | 3274 | # -*-coding:Utf-8 -*
# Copyright (c) 2010 LE GOFF Vincent
# 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
# l... | bsd-3-clause |
scrollback/kuma | vendor/packages/pyparsing/examples/stackish.py | 16 | 2994 | # stackish.py
#
# Stackish is a data representation syntax, similar to JSON or YAML. For more info on
# stackish, see http://www.savingtheinternetwithhate.com/stackish.html
#
# Copyright 2008, Paul McGuire
#
"""
NUMBER A simple integer type that's just any series of digits.
FLOAT A simple floating point t... | mpl-2.0 |
PEAT-AI/Crampy | distance_analysis.py | 1 | 1722 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# distance_analysis.py
#
# Copyright 2015 linaro <linaro@raspberry>
#
# 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... | gpl-3.0 |
MobileCloudNetworking/dssaas | dss-side-scripts/icn_repo_push.py | 1 | 2702 | #!/usr/bin/python
# -*- coding: utf-8 -*-
__author__ = "Mohammad Valipoor"
__copyright__ = "Copyright 2014, SoftTelecom"
import logging
import time
from subprocess import call
import os
def config_logger(log_level=logging.DEBUG):
logging.basicConfig(format='%(levelname)s %(asctime)s: %(message)s',
... | apache-2.0 |
bugaevc/thefuck | tests/rules/test_whois.py | 13 | 1046 | import pytest
from thefuck.rules.whois import match, get_new_command
from tests.utils import Command
@pytest.mark.parametrize('command', [
Command(script='whois https://en.wikipedia.org/wiki/Main_Page'),
Command(script='whois https://en.wikipedia.org/'),
Command(script='whois meta.unix.stackexchange.com')... | mit |
fhaoquan/kbengine | kbe/src/lib/python/Tools/scripts/byext.py | 52 | 3916 | #! /usr/bin/env python3
"""Show file statistics by extension."""
import os
import sys
class Stats:
def __init__(self):
self.stats = {}
def statargs(self, args):
for arg in args:
if os.path.isdir(arg):
self.statdir(arg)
elif os.path.isfile(arg):
... | lgpl-3.0 |
apache/incubator-tinkerpop | gremlin-python/src/main/jython/gremlin_python/driver/resultset.py | 2 | 2643 | """
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 use this ... | apache-2.0 |
prospwro/odoo | addons/product_margin/product_margin.py | 194 | 8823 | # -*- 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 |
rubikloud/scikit-learn | examples/decomposition/plot_kernel_pca.py | 353 | 2011 | """
==========
Kernel PCA
==========
This example shows that Kernel PCA is able to find a projection of the data
that makes data linearly separable.
"""
print(__doc__)
# Authors: Mathieu Blondel
# Andreas Mueller
# License: BSD 3 clause
import numpy as np
import matplotlib.pyplot as plt
from sklearn.decomp... | bsd-3-clause |
CRImier/pyLCI | apps/system_apps/systemctl/systemctl.py | 2 | 1909 | import subprocess
def list_units():
units = []
output = subprocess.check_output(["systemctl", "list-units", "-a"])
lines = output.split('\n')[1:][:-8]
for line in lines:
line = ' '.join(line.split()).strip(' ') #Removing all redundant whitespace
if line.startswith('\xe2\x97\x8f'): #Spe... | apache-2.0 |
knifewine/cassandra | pylib/cqlshlib/test/test_cqlsh_completion.py | 10 | 36068 | # 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 u... | apache-2.0 |
2014c2g5/2014cadp | wsgi/static/Brython2.2.0rc0-20140913-093500/Lib/heapq.py | 208 | 17997 | """Heap queue algorithm (a.k.a. priority queue).
Heaps are arrays for which a[k] <= a[2*k+1] and a[k] <= a[2*k+2] for
all k, counting elements from 0. For the sake of comparison,
non-existing elements are considered to be infinite. The interesting
property of a heap is that a[0] is always its smallest element.
Usag... | gpl-3.0 |
sonaht/ansible | lib/ansible/modules/cloud/vmware/vmware_vmkernel.py | 70 | 7599 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Joseph Callen <jcallen () csc.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 Li... | gpl-3.0 |
mogoweb/chromium-crosswalk | tools/git/for-all-touched-files.py | 130 | 3879 | #!/usr/bin/env python
# Copyright (c) 2011 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Invokes the specified (quoted) command for all files modified
between the current git branch and the specified branch or co... | bsd-3-clause |
infobloxopen/infoblox-netmri | infoblox_netmri/api/broker/v3_0_0/cdp_neighbor_device_viewer_grid_broker.py | 18 | 5984 | from ..broker import Broker
class CdpNeighborDeviceViewerGridBroker(Broker):
controller = "cdp_neighbor_device_viewer_grids"
def index(self, **kwargs):
"""Lists the available cdp neighbor device viewer grids. Any of the inputs listed may be be used to narrow the list; other inputs will be ignored. Of... | apache-2.0 |
ghdk/networkx | networkx/linalg/tests/test_modularity.py | 46 | 2392 | from nose import SkipTest
import networkx as nx
from networkx.generators.degree_seq import havel_hakimi_graph
class TestModularity(object):
numpy = 1 # nosetests attribute, use nosetests -a 'not numpy' to skip test
@classmethod
def setupClass(cls):
global numpy
global scipy
glob... | bsd-3-clause |
harmy/kbengine | kbe/src/lib/python/Lib/encodings/cp864.py | 272 | 33663 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors='strict'):
... | lgpl-3.0 |
scalyr/scalyr-agent-2 | scalyr_agent/third_party/pymysql/tests/test_cursor.py | 2 | 4188 | import warnings
from pymysql.tests import base
import pymysql.cursors
class CursorTest(base.PyMySQLTestCase):
def setUp(self):
super(CursorTest, self).setUp()
conn = self.connect()
self.safe_create_table(
conn,
"test", "create table test (data varchar(10))",
... | apache-2.0 |
saidimu/yowsup | yowsup/layers/protocol_groups/protocolentities/__init__.py | 60 | 1706 | from .iq_groups_create import CreateGroupsIqProtocolEntity
from .iq_groups_create_success import SuccessCreateGroupsIqProtocolEntity
from .iq_groups_leave import LeaveGroupsIqProtocolEntity
from .iq_groups_leave_success import SuccessLeaveGroupsIqProtocolEntity
from .iq_groups_list import ListGroupsIq... | gpl-3.0 |
drxzcl/iot_testbed | lib/werkzeug/contrib/securecookie.py | 318 | 12204 | # -*- coding: utf-8 -*-
r"""
werkzeug.contrib.securecookie
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This module implements a cookie that is not alterable from the client
because it adds a checksum the server checks for. You can use it as
session replacement if all you have is a user id or something to mark
... | apache-2.0 |
mvaled/sentry | src/sentry/api/endpoints/project_search_details.py | 3 | 3776 | from __future__ import absolute_import
from rest_framework import serializers
from rest_framework.response import Response
from sentry.api.bases.project import ProjectEndpoint, RelaxedSearchPermission
from sentry.api.exceptions import ResourceDoesNotExist
from sentry.api.serializers import serialize
from sentry.model... | bsd-3-clause |
louyihua/edx-platform | lms/djangoapps/lti_provider/tests/test_outcomes.py | 48 | 18771 | """
Tests for the LTI outcome service handlers, both in outcomes.py and in tasks.py
"""
import unittest
from django.test import TestCase
from lxml import etree
from mock import patch, MagicMock, ANY
import requests_oauthlib
import requests
from opaque_keys.edx.locator import CourseLocator, BlockUsageLocator
from stud... | agpl-3.0 |
shakamunyi/packstack | packstack/plugins/serverprep_949.py | 4 | 24495 | """
prepare server
"""
import os
import re
import uuid
import logging
import platform
from packstack.installer import basedefs
from packstack.installer import exceptions
from packstack.installer import utils
from packstack.installer import validators
from packstack.modules.common import filtered_hosts, is_all_in_one... | apache-2.0 |
Hakuba/youtube-dl | youtube_dl/extractor/anysex.py | 224 | 2085 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
parse_duration,
int_or_none,
)
class AnySexIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?anysex\.com/(?P<id>\d+)'
_TEST = {
'url': 'http://anysex.com/156592/',
'md5': '023... | unlicense |
AutonomyLab/rosdash | lib/openlayers/tools/exampleparser.py | 131 | 7756 | #!/usr/bin/env python
import sys
import os
import re
import time
from xml.dom.minidom import Document
try:
import xml.etree.ElementTree as ElementTree
except ImportError:
try:
import cElementTree as ElementTree
except ImportError:
try:
import elementtree.ElementTree as Element... | gpl-3.0 |
sn1k/app_mundial | lib/python2.7/site-packages/django/db/backends/mysql/validation.py | 34 | 1200 | from django.core import checks
from django.db.backends import BaseDatabaseValidation
class DatabaseValidation(BaseDatabaseValidation):
def check_field(self, field, **kwargs):
"""
MySQL has the following field length restriction:
No character (varchar) fields can have a length exceeding 255... | gpl-2.0 |
madre/analytics_nvd3 | analytics/wsgi.py | 1 | 1428 | """
WSGI config for analytics project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`... | apache-2.0 |
iidx/volatility | volatility/plugins/malware/impscan.py | 44 | 14373 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (c) 2010 - 2012 Michael Ligh <michael.ligh@mnin.org>
#
# This file is part of Volatility.
#
# Volatility 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 Soft... | gpl-2.0 |
alanljj/oca_hr | hr_payroll_period/__openerp__.py | 19 | 2318 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, eit... | agpl-3.0 |
Abi1ity/uniclust2.0 | SQLAlchemy-0.9.9/test/engine/test_pool.py | 1 | 49999 | import threading
import time
from sqlalchemy import pool, select, event
import sqlalchemy as tsa
from sqlalchemy import testing
from sqlalchemy.testing.util import gc_collect, lazy_gc
from sqlalchemy.testing import eq_, assert_raises, is_not_
from sqlalchemy.testing.engines import testing_engine
from sqlalchemy.testing... | bsd-3-clause |
opentrials/collectors | collectors/icdpcs/collector.py | 2 | 1513 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import io
import logging
import zipfile
import requests
from .record import Record
logger = logging.getLogger(__name__)
# Module API
def collec... | mit |
arcticshores/kivy | kivy/tests/test_audio.py | 4 | 1728 | '''
Audio tests
===========
'''
import unittest
import os
SAMPLE_FILE = os.path.join(os.path.dirname(__file__), 'sample1.ogg')
SAMPLE_LENGTH = 1.402
DELTA = SAMPLE_LENGTH * 0.01
class AudioTestCase(unittest.TestCase):
def get_sound(self):
import os
assert os.path.exists(SAMPLE_FILE)
fro... | mit |
GeotrekCE/Geotrek-admin | geotrek/outdoor/templatetags/outdoor_tags.py | 1 | 1138 | from django import template
from django.conf import settings
import json
from geotrek.outdoor.models import Practice, Site
register = template.Library()
@register.simple_tag
def is_outdoor_enabled():
return 'geotrek.outdoor' in settings.INSTALLED_APPS
@register.simple_tag
def site_practices():
practices =... | bsd-2-clause |
fckbankscoin/fckbankscoin | contrib/bitrpc/bitrpc.py | 239 | 7836 | from jsonrpc import ServiceProxy
import sys
import string
# ===== BEGIN USER SETTINGS =====
# if you do not set these you will be prompted for a password for every command
rpcuser = ""
rpcpass = ""
# ====== END USER SETTINGS ======
if rpcpass == "":
access = ServiceProxy("http://127.0.0.1:9332")
else:
access = Ser... | mit |
UXE/local-edx | common/lib/xmodule/xmodule/tests/test_progress.py | 56 | 5073 | """Module progress tests"""
import unittest
from mock import Mock
from xblock.field_data import DictFieldData
from xmodule.progress import Progress
from xmodule import x_module
from . import get_test_system
class ProgressTest(unittest.TestCase):
''' Test that basic Progress objects work. A Progress represent... | agpl-3.0 |
Tong-Chen/genomics-tools | mapreduce-python/mapreduce/namespace_range.py | 6 | 14002 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law o... | apache-2.0 |
jessrosenfield/pants | src/python/pants/backend/codegen/tasks/protobuf_parse.py | 8 | 3676 | # coding=utf-8
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md).
# Licensed under the Apache License, Version 2.0 (see LICENSE).
from __future__ import (absolute_import, division, generators, nested_scopes, print_function,
unicode_literals, with_statement)
import os
import re
... | apache-2.0 |
yencarnacion/jaikuengine | .google_appengine/lib/django-1.3/django/contrib/auth/admin.py | 153 | 6848 | from django.db import transaction
from django.conf import settings
from django.contrib import admin
from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AdminPasswordChangeForm
from django.contrib.auth.models import User, Group
from django.contrib import messages
from django.core.exceptions import Pe... | apache-2.0 |
trabacus-softapps/openerp-8.0-cc | openerp/addons/project_mrp/project_procurement.py | 6 | 5168 | # -*- 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 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.