repo_name stringlengths 5 100 | path stringlengths 4 294 | copies stringclasses 990
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
ojengwa/oh-mainline | vendor/packages/docutils/test/test_writers/test_docutils_xml.py | 16 | 5871 | #!/usr/bin/env python
# $Id: test_docutils_xml.py 7315 2012-01-18 10:16:20Z milde $
# Author: Lea Wiemann <LeWiemann@gmail.com>
# Copyright: This module has been placed in the public domain.
"""
Test for docutils XML writer.
.. Attention::
While the tests compare the output on the string-level, no guarantee
is... | agpl-3.0 |
acsone/social | mail_follower_custom_notification/models/mail_message.py | 2 | 1082 | # -*- coding: utf-8 -*-
# © 2015 Therp BV <http://therp.nl>
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from openerp import api, models
class MailMessage(models.Model):
_inherit = 'mail.message'
@api.multi
def _notify(self, force_send=False, user_signature=True):
"""notif... | agpl-3.0 |
Azure/azure-sdk-for-python | sdk/resources/azure-mgmt-resource/azure/mgmt/resource/locks/v2015_01_01/models/_models_py3.py | 1 | 2786 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
atosatto/ansible | lib/ansible/plugins/action/set_fact.py | 53 | 1987 | # Copyright 2013 Dag Wieers <dag@wieers.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) any later versio... | gpl-3.0 |
davvid/git-cola | cola/widgets/toolbar.py | 3 | 15971 | from __future__ import division, absolute_import, unicode_literals
from functools import partial
from qtpy import QtGui
from qtpy.QtCore import Qt
from qtpy import QtWidgets
from ..i18n import N_
from ..widgets import standard
from ..qtutils import get
from .. import icons
from .. import qtutils
from .toolbarcmds imp... | gpl-2.0 |
asposebarcode/Aspose_BarCode_Cloud | Examples/Python/generating-saving/cloud-storage/generate-barcode-and-save-asposecloudstorage.py | 4 | 1910 | import asposebarcodecloud
from asposebarcodecloud.BarcodeApi import BarcodeApi
from asposebarcodecloud.BarcodeApi import ApiException
import asposestoragecloud
from asposestoragecloud.StorageApi import StorageApi
from asposestoragecloud.StorageApi import ResponseMessage
import ConfigParser
config = Config... | mit |
zhangjunli177/sahara | sahara/utils/tempfiles.py | 18 | 1154 | # Copyright (c) 2013 Mirantis 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 agreed to in writ... | apache-2.0 |
MeanEYE/Sunflower | sunflower/plugins/file_list/plugin.py | 1 | 1465 | from __future__ import absolute_import
from .file_list import FileList
from .trash_list import TrashList
from .gio_extension import SambaExtension, FtpExtension, DavExtension, SftpExtension
from .gio_provider import NetworkProvider, TrashProvider, DavProvider, DavsProvider, Gphoto2Provider, MtpProvider
from .gio_provi... | gpl-3.0 |
kivatu/kivy-bak | examples/canvas/lines_extended.py | 17 | 3590 | from kivy.app import App
from kivy.uix.gridlayout import GridLayout
from kivy.uix.widget import Widget
from kivy.lang import Builder
Builder.load_string('''
<LineEllipse1>:
canvas:
Color:
rgba: 1, .1, .1, .9
Line:
width: 2.
ellipse: (self.x, self.y, self.width, s... | mit |
jnhwkim/cuda-convnet2 | initw.py | 183 | 2020 | # Copyright 2014 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... | apache-2.0 |
GuneetAtwal/kernel_m8 | Documentation/networking/cxacru-cf.py | 14668 | 1626 | #!/usr/bin/env python
# Copyright 2009 Simon Arlott
#
# 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 i... | gpl-2.0 |
davygeek/vitess | doc/vtctl_go_reference.py | 15 | 36144 | #!/usr/bin/python
# Copyright 2017 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 or ... | apache-2.0 |
adgon92/optimalization-project | src/plot/ploter.py | 1 | 1397 | __author__ = 'Przemek'
import numpy as np
import matplotlib.pyplot as plt
class Ploter:
def __init__(self):
pass
def plot_temperature(self, temperature, cooling_method, initial_temperature, numb_of_cycles):
plt.plot(temperature, 'b.-')
plt.xlabel('Number of cycles')
plt.ylabe... | gpl-2.0 |
beppec56/core | wizards/com/sun/star/wizards/common/NumberFormatter.py | 11 | 8643 | #
# This file is part of the LibreOffice project.
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
#
# This file incorporates work covered by the following license noti... | gpl-3.0 |
rvmoura96/projeto-almoxarifado | myvenv/Lib/site-packages/pylint/test/functional/cellvar_escaping_loop.py | 12 | 2773 | # pylint: disable=print-statement
"""Tests for loopvar-in-closure."""
from __future__ import print_function
def good_case():
"""No problems here."""
lst = []
for i in range(10):
lst.append(i)
def good_case2():
"""No problems here."""
return [i for i in range(10)]
def good_case3():
"... | mit |
epage/MaemoPythonSkeleton | setup.py | 1 | 4524 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
reload(sys).setdefaultencoding("UTF-8")
import os
try:
from sdist_maemo import sdist_maemo as _sdist_maemo
sdist_maemo = _sdist_maemo
except ImportError:
sdist_maemo = None
print 'sdist_maemo command not available'
from distutils.core import setup
#[[[co... | lgpl-2.1 |
HerlanAssis/Django-AulaOsvandoSantana | lib/python2.7/site-packages/django/conf/locale/__init__.py | 82 | 12130 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
"""
LANG_INFO is a dictionary structure to provide meta information about languages.
About name_local: capitalize it as if your language name was appearing
inside a sentence in your language.
The 'fallback' key can be used to specify a special fallback... | mit |
v1ron/linux-mainline | tools/perf/scripts/python/syscall-counts.py | 1996 | 1700 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
joebowen/movement_validation_cloud | djangodev/lib/python2.7/site-packages/django/utils/six.py | 15 | 25150 | """Utilities for writing code that runs on Python 2 and 3"""
# Copyright (c) 2010-2014 Benjamin Peterson
#
# 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 with... | mit |
hyowon/servo | tests/wpt/harness/wptrunner/executors/executorservo.py | 14 | 7768 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import base64
import hashlib
import json
import os
import subprocess
import tempfile
import threading
import urlparse
im... | mpl-2.0 |
fdemmer/togglwrapper | docs/source/conf.py | 1 | 9286 | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
#
# togglwrapper documentation build configuration file, created by
# sphinx-quickstart on Tue Sep 1 10:22:32 2015.
#
# This file is execfile()d with the current directory set to its
# containing dir.
#
# Note that not all possible configuration values are present in this... | mit |
Azure/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2021_02_01/operations/_load_balancer_network_interfaces_operations.py | 1 | 5718 | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | mit |
empireryan/director | src/python/ddapp/skybox.py | 6 | 3728 | import ddapp.visualization as vis
from ddapp import filterUtils
import ddapp.vtkAll as vtk
import ddapp.vtkNumpy as vnp
from ddapp.shallowCopy import shallowCopy
from ddapp import ioUtils
import numpy as np
def createTexturedPlane():
source = vtk.vtkPlaneSource()
textureMap = vtk.vtkTextureMapToPlane()
te... | bsd-3-clause |
adviti/melange | thirdparty/google_appengine/lib/django_1_2/django/contrib/gis/gdal/error.py | 169 | 1517 | """
This module houses the OGR & SRS Exception objects, and the
check_err() routine which checks the status code returned by
OGR methods.
"""
#### OGR & SRS Exceptions ####
class GDALException(Exception): pass
class OGRException(Exception): pass
class SRSException(Exception): pass
class OGRIndexError(OGRException, K... | apache-2.0 |
waheedahmed/edx-platform | common/lib/xmodule/xmodule/modulestore/perf_tests/generate_asset_xml.py | 83 | 5955 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
Generates fake XML for asset metadata.
"""
import random
from lxml import etree
from datetime import datetime, timedelta
from xmodule.assetstore import AssetMetadata
from opaque_keys.edx.keys import CourseKey
try:
import click
except ImportError:
click = None... | agpl-3.0 |
hirofumi0810/asr_preprocessing | swbd/path.py | 1 | 9200 | #! /usr/bin/env python
# -*- coding: utf-8 -*-
"""Prepare for making dataset (Switchboard corpus)."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from os.path import join, basename
from glob import glob
class Path(object):
"""Prepare for making d... | mit |
kswiat/django | django/core/mail/backends/console.py | 696 | 1477 | """
Email backend that writes messages to console instead of sending them.
"""
import sys
import threading
from django.core.mail.backends.base import BaseEmailBackend
from django.utils import six
class EmailBackend(BaseEmailBackend):
def __init__(self, *args, **kwargs):
self.stream = kwargs.pop('stream',... | bsd-3-clause |
EnviroCentre/jython-upgrade | jython/lib/test/test_commands.py | 130 | 2640 | '''
Tests for commands module
Nick Mathewson
'''
import unittest
import os, tempfile, re
from test.test_support import run_unittest, reap_children, import_module, \
check_warnings
# Silence Py3k warning
commands = import_module('commands', deprecated=True)
# The module says:
# "... | mit |
kkappel/web2py-community | languages/uk.py | 1 | 14399 | # -*- coding: utf-8 -*-
{
'!langcode!': 'uk',
'!langname!': 'Українська',
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"Оновити" це додатковий вираз, такий, як "field1=\'нове_значення\'". Ви не можете змінювати або вилучати дані об\'єднаних таблиць... | mit |
wmvanvliet/mne-python | mne/externals/tqdm/_tqdm/notebook.py | 14 | 9067 | """
IPython/Jupyter Notebook progressbar decorator for iterators.
Includes a default (x)range iterator printing to stderr.
Usage:
>>> from tqdm.notebook import trange[, tqdm]
>>> for i in trange(10): #same as: for i in tqdm(xrange(10))
... ...
"""
# future division is important to divide integers and get as
... | bsd-3-clause |
mirror/vbox | src/VBox/Devices/EFI/Firmware/BaseTools/Source/Python/Common/FdfClassObject.py | 11 | 4053 | ## @file
# This file is used to define each component of FDF file
#
# Copyright (c) 2008, Intel Corporation. All rights reserved.<BR>
# This program and the accompanying materials
# are licensed and made available under the terms and conditions of the BSD License
# which accompanies this distribution. The full text of... | gpl-2.0 |
Ivoz/pip | pip/_vendor/distlib/scripts.py | 163 | 11979 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from io import BytesIO
import logging
import os
import re
import struct
import sys
from .compat import sysconfig, fsencode, detect_encoding, ... | mit |
jianC/lexikon-2.6.35-gb-mr_udev | tools/perf/scripts/python/syscall-counts.py | 944 | 1429 | # system call counts
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.path.append(os.envir... | gpl-2.0 |
cybermx/linux-2.6-imx | tools/perf/scripts/python/futex-contention.py | 11261 | 1486 | # 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 |
thobbs/python-driver | tests/integration/cqlengine/test_consistency.py | 4 | 4404 | # Copyright 2013-2016 DataStax, 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 agreed to in writi... | apache-2.0 |
ravenland/ycmWinRepo | python/ycm/client/completion_request.py | 6 | 2522 | #!/usr/bin/env python
#
# Copyright (C) 2013 Google Inc.
#
# This file is part of YouCompleteMe.
#
# YouCompleteMe 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 you... | gpl-3.0 |
coffenbacher/askbot-devel | askbot/migrations/0136_auto__add_group__add_threadtogroup__add_unique_threadtogroup_thread_ta.py | 15 | 36423 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Group'
db.create_table('askbot_group', (
('group_ptr', self.gf('django.db.mode... | gpl-3.0 |
NeCTAR-RC/neutron | neutron/tests/unit/plugins/oneconvergence/test_nvsdlib.py | 43 | 10951 | # Copyright 2014 OneConvergence, 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... | apache-2.0 |
ndp-systemes/odoo-addons | purchase_order_quantities_improved/tests/test_order_quantities.py | 1 | 10095 | # -*- coding: utf8 -*-
#
# Copyright (C) 2014 NDP Systèmes (<http://www.ndp-systemes.fr>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License,... | agpl-3.0 |
ant1b/Planets4X | pythonanywhere_app/static/Brython3.0.0-20141104-210332/Lib/string.py | 734 | 9410 | """A collection of string constants.
Public module variables:
whitespace -- a string containing all ASCII whitespace
ascii_lowercase -- a string containing all ASCII lowercase letters
ascii_uppercase -- a string containing all ASCII uppercase letters
ascii_letters -- a string containing all ASCII letters
digits -- a ... | mit |
chfw/pyexcel-io | examples/custom_yaml_writer.py | 2 | 1135 | import yaml
from pyexcel_io import save_data
from pyexcel_io.plugins import IOPluginInfoChainV2
from pyexcel_io.plugin_api import IWriter, ISheetWriter
class MySheetWriter(ISheetWriter):
def __init__(self, sheet_reference):
self.native_sheet = sheet_reference
def write_row(self, data_row):
se... | bsd-3-clause |
benoitsteiner/tensorflow-xsmm | tensorflow/contrib/timeseries/python/timeseries/head.py | 5 | 19570 | # Copyright 2017 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
louiskun/flaskGIT | venv/lib/python2.7/site-packages/pip/vcs/mercurial.py | 514 | 3472 | from __future__ import absolute_import
import logging
import os
import tempfile
from pip.utils import display_path, rmtree
from pip.vcs import vcs, VersionControl
from pip.download import path_to_url
from pip._vendor.six.moves import configparser
logger = logging.getLogger(__name__)
class Mercurial(VersionControl... | mit |
pvtodorov/indra | indra/tools/reading/run_drum_reading.py | 1 | 4658 | import sys
import json
import time
import pickle
import logging
import argparse
from indra.sources.trips import process_xml
from indra.sources.trips.drum_reader import DrumReader
logger = logging.getLogger('indra.tools.reading.run_drum_reading')
def read_pmid_sentences(pmid_sentences, **drum_args):
"""Read sent... | bsd-2-clause |
Changaco/oh-mainline | vendor/packages/PyYaml/lib3/yaml/dumper.py | 277 | 2723 |
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper']
from .emitter import *
from .serializer import *
from .representer import *
from .resolver import *
class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
def __init__(self, stream,
default_style=None, default_flow_style=None,
... | agpl-3.0 |
poiati/django | django/contrib/flatpages/forms.py | 357 | 2024 | from django import forms
from django.conf import settings
from django.contrib.flatpages.models import FlatPage
from django.utils.translation import ugettext, ugettext_lazy as _
class FlatpageForm(forms.ModelForm):
url = forms.RegexField(label=_("URL"), max_length=100, regex=r'^[-\w/\.~]+$',
help_text=_("E... | bsd-3-clause |
ansible/ansible | test/units/module_utils/common/validation/test_check_required_by.py | 10 | 2642 | # -*- coding: utf-8 -*-
# Copyright: (c) 2021, Ansible Project
# 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
import pytest
from ansible.module_utils._text import to_native
from ansibl... | gpl-3.0 |
DarthMaulware/EquationGroupLeaks | Leak #5 - Lost In Translation/windows/Resources/Python/Core/Lib/sqlite3/dump.py | 1 | 1847 | # uncompyle6 version 2.9.10
# Python bytecode 2.7 (62211)
# Decompiled from: Python 3.6.0b2 (default, Oct 11 2016, 05:27:10)
# [GCC 6.2.0 20161005]
# Embedded file name: dump.py
def _iterdump(connection):
"""
Returns an iterator to the dump of the database in an SQL text format.
Used to produce an S... | unlicense |
edx/edx-platform | lms/djangoapps/grades/tests/test_api.py | 5 | 4174 | """ Tests calling the grades api directly """
from unittest.mock import patch
import ddt
from common.djangoapps.student.tests.factories import UserFactory
from lms.djangoapps.grades import api
from lms.djangoapps.grades.models import PersistentSubsectionGrade, PersistentSubsectionGradeOverride
from xmodule.modulest... | agpl-3.0 |
nkalodimas/invenio | modules/websubmit/lib/functions/Notify_URL.py | 25 | 5236 | ## This file is part of Invenio.
## Copyright (C) 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 option) any later version.
##
## Inv... | gpl-2.0 |
DDEFISHER/servo | tests/wpt/harness/wptrunner/browsers/firefox.py | 39 | 9818 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import subprocess
import sys
import mozinfo
from mozprocess import ProcessHandler
from mozprofile import Fire... | mpl-2.0 |
AriZuu/micropython | tests/wipy/spi.py | 69 | 3832 | '''
SPI test for the CC3200 based boards.
'''
from machine import SPI
import os
mch = os.uname().machine
if 'LaunchPad' in mch:
spi_pins = ('GP14', 'GP16', 'GP30')
elif 'WiPy' in mch:
spi_pins = ('GP14', 'GP16', 'GP30')
else:
raise Exception('Board not supported!')
spi = SPI(0, SPI.MASTER, baudrate=20000... | mit |
gangadhar-kadam/smrterpshop | shopping_cart/shopping_cart/__init__.py | 12 | 3804 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from frappe.utils import get_fullname, flt
from shopping_cart.shopping_cart.doctype.shopping_cart_settings.shoppin... | agpl-3.0 |
postlund/home-assistant | homeassistant/components/mikrotik/device_tracker.py | 7 | 4356 | """Support for Mikrotik routers as device tracker."""
import logging
from homeassistant.components.device_tracker.config_entry import ScannerEntity
from homeassistant.components.device_tracker.const import (
DOMAIN as DEVICE_TRACKER,
SOURCE_TYPE_ROUTER,
)
from homeassistant.core import callback
from homeassist... | apache-2.0 |
DirtyPiece/dancestudio | Build/Tools/Python27/Tools/Scripts/combinerefs.py | 102 | 4381 | #! /usr/bin/env python
"""
combinerefs path
A helper for analyzing PYTHONDUMPREFS output.
When the PYTHONDUMPREFS envar is set in a debug build, at Python shutdown
time Py_Finalize() prints the list of all live objects twice: first it
prints the repr() of each object while the interpreter is still fully intact.
Aft... | mit |
seize-the-dave/XlsxWriter | xlsxwriter/test/comparison/test_format12.py | 8 | 1456 | ###############################################################################
#
# Tests for XlsxWriter.
#
# Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org
#
from ..excel_comparsion_test import ExcelComparisonTest
from ...workbook import Workbook
class TestCompareXLSXFiles(ExcelComparisonTest):
"""... | bsd-2-clause |
idlead/scikit-learn | examples/neighbors/plot_nearest_centroid.py | 264 | 1804 | """
===============================
Nearest Centroid Classification
===============================
Sample usage of Nearest Centroid classification.
It will plot the decision boundaries for each class.
"""
print(__doc__)
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import ListedColormap
f... | bsd-3-clause |
pdamodaran/yellowbrick | yellowbrick/model_selection/validation_curve.py | 1 | 13903 | # yellowbrick.model_selection.validation_curve
# Implements a visual validation curve for a hyperparameter.
#
# Author: Benjamin Bengfort <benjamin@bengfort.com>
# Created: Sat Mar 31 06:27:28 2018 -0400
#
# ID: validation_curve.py [] benjamin@bengfort.com $
"""
Implements a visual validation curve for a hyperparamet... | apache-2.0 |
cicku/fedmsg | fedmsg/commands/hub.py | 5 | 3437 | # This file is part of fedmsg.
# Copyright (C) 2012 Red Hat, Inc.
#
# fedmsg is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any later version.
#... | lgpl-2.1 |
ax003d/openerp | openerp/addons/project/res_config.py | 55 | 4724 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (C) 2004-2012 OpenERP S.A. (<http://openerp.com>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
syrrim/werkzeug | examples/shortly/shortly.py | 32 | 4630 | # -*- coding: utf-8 -*-
"""
shortly
~~~~~~~
A simple URL shortener using Werkzeug and redis.
:copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import os
import redis
import urlparse
from werkzeug.wrappers import Request, Respo... | bsd-3-clause |
tjhei/burnman | tests/test_spin.py | 7 | 1130 | from __future__ import absolute_import
import unittest
from util import BurnManTest
import os
import sys
sys.path.insert(1, os.path.abspath('..'))
import burnman
from burnman import minerals
class spin_transition(BurnManTest):
def test_new(self):
mins = [
minerals.Murakami_etal_2012.fe_peri... | gpl-2.0 |
patdoyle1/FastMath | lib/python2.7/site-packages/pip/cmdoptions.py | 361 | 9507 | """
shared options and groups
The principle here is to define options once, but *not* instantiate them globally.
One reason being that options with action='append' can carry state between parses.
pip parse's general options twice internally, and shouldn't pass on state.
To be consistent, all options will follow this d... | gpl-2.0 |
polyval/CNC | flask/Lib/site-packages/sqlalchemy/util/deprecations.py | 55 | 4403 | # util/deprecations.py
# Copyright (C) 2005-2016 the SQLAlchemy authors and contributors
# <see AUTHORS file>
#
# This module is part of SQLAlchemy and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
"""Helpers related to deprecation of functions, methods, classes, other
functio... | apache-2.0 |
cecep-edu/edx-platform | lms/djangoapps/class_dashboard/tests/test_dashboard_data.py | 88 | 13672 | """
Tests for class dashboard (Metrics tab in instructor dashboard)
"""
import json
from django.core.urlresolvers import reverse
from django.test.client import RequestFactory
from mock import patch
from nose.plugins.attrib import attr
from capa.tests.response_xml_factory import StringResponseXMLFactory
from coursewa... | agpl-3.0 |
ryfeus/lambda-packs | Tensorflow/source/setuptools/command/alias.py | 455 | 2426 | from distutils.errors import DistutilsOptionError
from setuptools.extern.six.moves import map
from setuptools.command.setopt import edit_config, option_base, config_file
def shquote(arg):
"""Quote an argument for later parsing by shlex.split()"""
for c in '"', "'", "\\", "#":
if c in arg:
... | mit |
ProjectVault/orp | third-party/qemu-orp/scripts/ordereddict.py | 1047 | 4094 | # Copyright (c) 2009 Raymond Hettinger
#
# 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,... | apache-2.0 |
appleseedhq/cortex | test/IECoreScene/MeshMergeOpTest.py | 1 | 11371 | ##########################################################################
#
# Copyright (c) 2008-2011, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redis... | bsd-3-clause |
skposs/WinLibmobiledevice | libjson/makerelease.py | 4 | 15513 | """Tag the sandbox for release, make source and doc tarballs.
Requires Python 2.6
Example of invocation (use to test the script):
python makerelease.py --platform=msvc6,msvc71,msvc80,msvc90,mingw -ublep 0.6.0 0.7.0-dev
When testing this script:
python makerelease.py --force --retag --platform=msvc6,msvc71,msvc80,min... | lgpl-2.1 |
Tokyo-Buffalo/tokyosouth | env/lib/python3.6/site-packages/pyasn1/codec/cer/encoder.py | 160 | 4998 | # CER encoder
from pyasn1.type import univ
from pyasn1.type import useful
from pyasn1.codec.ber import encoder
from pyasn1.compat.octets import int2oct, str2octs, null
from pyasn1 import error
class BooleanEncoder(encoder.IntegerEncoder):
def encodeValue(self, encodeFun, client, defMode, maxChunkSize):
if ... | mit |
BitWriters/Zenith_project | zango/lib/python3.5/site-packages/django/core/signing.py | 149 | 6814 | """
Functions for creating and restoring url-safe signed JSON objects.
The format used looks like this:
>>> signing.dumps("hello")
'ImhlbGxvIg:1QaUZC:YIye-ze3TTx7gtSv422nZA4sgmk'
There are two components here, separated by a ':'. The first component is a
URLsafe base64 encoded JSON of the object passed to dumps(). T... | mit |
noba3/KoTos | addons/plugin.video.genesis/resources/lib/resolvers/zettahost.py | 5 | 1471 | # -*- coding: utf-8 -*-
'''
Genesis Add-on
Copyright (C) 2015 lambda
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 ... | gpl-2.0 |
DylannCordel/django-categories | categories/south_migrations/0007_auto__add_field_category_active.py | 14 | 3914 | # encoding: utf-8
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Category.active'
db.add_column('categories_category', 'active', self.gf('django.db.models.... | apache-2.0 |
OlafLee/Theano-Lights | models/ffn_bn_vat.py | 11 | 5923 | import theano
import theano.tensor as T
from theano.sandbox.rng_mrg import MRG_RandomStreams
from theano.tensor.nnet.conv import conv2d
from theano.tensor.signal.downsample import max_pool_2d
from theano.tensor.shared_randomstreams import RandomStreams
import numpy as np
from toolbox import *
from modelbase import *
... | mit |
wfxiang08/django185 | tests/m2m_multiple/tests.py | 228 | 2386 | from __future__ import unicode_literals
from datetime import datetime
from django.test import TestCase
from .models import Article, Category
class M2MMultipleTests(TestCase):
def test_multiple(self):
c1, c2, c3, c4 = [
Category.objects.create(name=name)
for name in ["Sports", "N... | bsd-3-clause |
davidyezsetz/kuma | vendor/packages/pylint/interfaces.py | 6 | 3111 | # 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 it will be useful, but ... | mpl-2.0 |
sfam/home-assistant | homeassistant/components/keyboard.py | 4 | 2759 | """
homeassistant.components.keyboard
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Provides functionality to emulate keyboard presses on host machine.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/keyboard/
"""
import logging
from homeassistant.const import (
... | mit |
CUCWD/edx-platform | common/djangoapps/entitlements/tests/factories.py | 17 | 1156 | import string
from uuid import uuid4
import factory
from factory.fuzzy import FuzzyChoice, FuzzyText
from student.tests.factories import UserFactory
from course_modes.helpers import CourseMode
from entitlements.models import CourseEntitlement, CourseEntitlementPolicy
from openedx.core.djangoapps.site_configuration.te... | agpl-3.0 |
kawamon/hue | desktop/core/ext-py/Django-1.11.29/django/contrib/gis/geos/linestring.py | 136 | 6019 | from django.contrib.gis.geos import prototypes as capi
from django.contrib.gis.geos.coordseq import GEOSCoordSeq
from django.contrib.gis.geos.error import GEOSException
from django.contrib.gis.geos.geometry import GEOSGeometry, LinearGeometryMixin
from django.contrib.gis.geos.point import Point
from django.contrib.gis.... | apache-2.0 |
jose36/plugin.video.ProyectoLuzDigital | servers/turbobit.py | 44 | 1401 | # -*- coding: utf-8 -*-
#------------------------------------------------------------
# pelisalacarta - XBMC Plugin
# Conector para turbobit
# http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/
#------------------------------------------------------------
import urlparse,urllib2,urllib,re
import os
from core impo... | apache-2.0 |
repuestos-365/server | client/node_modules/node-gyp/gyp/tools/pretty_gyp.py | 2618 | 4756 | #!/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.
"""Pretty-prints the contents of a GYP file."""
import sys
import re
# Regex to remove comments when we're counting braces.
COMMENT_RE = ... | mit |
estherbester/montybot | montybot/message.py | 2 | 2844 | import re
from unknown_replies import smartass_reply
from unknown_replies import greedy_reply
class Message(object):
MAX_COMMANDS = 3
"""
A message comes from a user and is sent to a channel.
The MainBot instance handles the message.
"""
def __init__(self, user, channel, message, bot_instanc... | mit |
francbartoli/geonode | geonode/sitemap.py | 19 | 1549 | # -*- coding: utf-8 -*-
#########################################################################
#
# Copyright (C) 2016 OSGeo
#
# 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 ... | gpl-3.0 |
sxjscience/tvm | tests/python/unittest/test_autotvm_index_tuner.py | 2 | 2478 | # 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 |
shubhdev/openedx | lms/djangoapps/open_ended_grading/views.py | 5 | 15392 | import logging
from django.views.decorators.cache import cache_control
from edxmako.shortcuts import render_to_response
from django.core.urlresolvers import reverse
from courseware.courses import get_course_with_access
from courseware.access import has_access
from courseware.tabs import EnrolledTab
from xmodule.ope... | agpl-3.0 |
Jonekee/chromium.src | chrome/common/extensions/docs/server2/document_renderer.py | 85 | 4614 | # Copyright 2013 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
from document_parser import ParseDocument
from platform_util import ExtractPlatformFromURL
from third_party.json_schema_compiler.mod... | bsd-3-clause |
hifly/OpenUpgrade | addons/account/account_bank_statement.py | 24 | 56320 | # -*- 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 |
skwbc/numpy | numpy/testing/tests/test_decorators.py | 38 | 4305 | from __future__ import division, absolute_import, print_function
import warnings
from numpy.testing import (dec, assert_, assert_raises, run_module_suite,
SkipTest, KnownFailureException)
def test_slow():
@dec.slow
def slow_func(x, y, z):
pass
assert_(slow_func.slow)
... | bsd-3-clause |
2014c2g5/2014c2 | w2/static/Brython2.0.0-20140209-164925/Lib/logging/config.py | 739 | 35619 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | gpl-2.0 |
moijes12/oh-mainline | vendor/packages/twisted/twisted/test/test_lockfile.py | 59 | 15404 | # Copyright (c) 2005 Divmod, Inc.
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.python.lockfile}.
"""
import os, errno
from twisted.trial import unittest
from twisted.python import lockfile
from twisted.python.runtime import platform
skipKill = None
if platform.isWi... | agpl-3.0 |
cainiaocome/scikit-learn | sklearn/preprocessing/data.py | 113 | 56747 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Mathieu Blondel <mathieu@mblondel.org>
# Olivier Grisel <olivier.grisel@ensta.org>
# Andreas Mueller <amueller@ais.uni-bonn.de>
# Eric Martin <eric@ericmart.in>
# License: BSD 3 clause
from itertools import chain, combina... | bsd-3-clause |
openmotics/gateway | tools/validate_p1.py | 1 | 2517 | #!/bin/python2
# Copyright (C) 2021 OpenMotics BV
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the
# License, or (at your option) any later version.
#
# This prog... | agpl-3.0 |
thom-at-redhat/cfme_tests | cfme/tests/infrastructure/test_vm_clone.py | 1 | 5476 | # -*- coding: utf-8 -*-
import fauxfactory
import pytest
from cfme.common.provider import cleanup_vm
from cfme.common.vm import VM
from cfme.services.catalogs.catalog_item import CatalogItem
from cfme.automate.service_dialogs import ServiceDialog
from cfme.services.catalogs.catalog import Catalog
from cfme.services.ca... | gpl-2.0 |
uchida/selenium | py/selenium/webdriver/support/wait.py | 81 | 4070 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
DevinDewitt/pyqt5 | pyuic/uic/port_v3/string_io.py | 2 | 1060 | #############################################################################
##
## Copyright (c) 2015 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt5.
##
## This file may be used under the terms of the GNU General Public License
## version 3.0 as published by the Free Softw... | gpl-3.0 |
ibab/tensorflow | tensorflow/python/training/sync_replicas_optimizer.py | 8 | 22953 | # 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 |
bravominski/PennApps2015-HeartMates | venv/lib/python2.7/site-packages/requests/packages/chardet/langbulgarianmodel.py | 2965 | 12784 | ######################## BEGIN LICENSE BLOCK ########################
# The Original Code is Mozilla Communicator client code.
#
# The Initial Developer of the Original Code is
# Netscape Communications Corporation.
# Portions created by the Initial Developer are Copyright (C) 1998
# the Initial Developer. All Rights R... | apache-2.0 |
korzeniewskipl/python-mode | pymode/libs3/rope/base/oi/doa.py | 32 | 5029 | import pickle
import marshal
import os
import socket
import subprocess
import sys
import tempfile
import threading
class PythonFileRunner(object):
"""A class for running python project files"""
def __init__(self, pycore, file_, args=None, stdin=None,
stdout=None, analyze_data=None):
... | lgpl-3.0 |
allisony/pyspeckit | ah_bootstrap.py | 16 | 35044 | """
This bootstrap module contains code for ensuring that the astropy_helpers
package will be importable by the time the setup.py script runs. It also
includes some workarounds to ensure that a recent-enough version of setuptools
is being used for the installation.
This module should be the first thing imported in th... | mit |
SSL-Roots/CON-SAI | decision_making/scripts/plays/play_inplay_our_defence.py | 1 | 2025 |
from play_base import Play
from tactics.tactic_keep import TacticKeep
from tactics.tactic_intersection import TacticIntersection
from tactics.tactic_interpose import TacticInterpose
from tactics.tactic_clear import TacticClear
from tactics.tactic_position import TacticPosition
from consai_msgs.msg import Pose
import ... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.