repo_name stringlengths 5 100 | ref stringlengths 12 67 | path stringlengths 4 244 | copies stringlengths 1 8 | content stringlengths 0 1.05M ⌀ |
|---|---|---|---|---|
edisongustavo/asv | refs/heads/master | test/test_results.py | 2 | # -*- coding: utf-8 -*-
# Licensed under a 3-clause BSD style license - see LICENSE.rst
from __future__ import (absolute_import, division, print_function,
unicode_literals)
import os
from os.path import join
import six
from asv import results, util
import pytest
def test_results(tmpdir):
... |
ArcherSys/ArcherSys | refs/heads/master | Lib/ctypes/test/test_refcounts.py | 1 | <<<<<<< HEAD
<<<<<<< HEAD
import unittest
from test import support
import ctypes
import gc
MyCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int)
OtherCallback = ctypes.CFUNCTYPE(ctypes.c_int, ctypes.c_int, ctypes.c_ulonglong)
import _ctypes_test
dll = ctypes.CDLL(_ctypes_test.__file__)
class RefcountTestCase(uni... |
Tankypon/ubuntu-make | refs/heads/master | umake/frameworks/baseinstaller.py | 1 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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; version 3.
#
# This program is distributed in the hope that ... |
mdzik/bearded-octo-wookie | refs/heads/master | jednostki2.py | 2 | # -*- coding: utf-8 -*-
"""
Created on Fri Aug 9 17:45:08 2013
@author: michal
"""
import numpy as np
import scipy.optimize
#import matplotlib.pyplot as plt
import scipy.integrate
import scipy.interpolate as inter
g = -1.
cs2 = 1./3.
a2 = 3.852462271644162
b2 = 0.1304438860971524 * 4.0
c2 = 2.785855170470555
de... |
gavoski/audacity | refs/heads/master | lib-src/lv2/lv2/waflib/Tools/gnu_dirs.py | 329 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os
from waflib import Utils,Options,Context
_options=[x.split(', ')for x in'''
bindir, user executables, ${EXEC_PREFIX}/bin
sbindir, system admin executables, ${EXEC_PR... |
Honry/crosswalk-test-suite | refs/heads/master | cordova/cordova-webapp-android-tests/webapp/webapp_create.py | 18 | #!/usr/bin/env python
#
# Copyright (c) 2015 Intel Corporation.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# * Redistributions of works must retain the original copyright notice, this
# list of conditions and t... |
M0nica/datalogues | refs/heads/dev | plugins/representative_image/representative_image.py | 17 | import six
from pelican import signals
from pelican.contents import Article, Draft, Page
from pelican.generators import ArticlesGenerator
from bs4 import BeautifulSoup
def images_extraction(instance):
representativeImage = None
if type(instance) in (Article, Draft, Page):
if 'image' in instance.metada... |
pavelkang/pomodoro | refs/heads/master | lib/evernote/edam/limits/constants.py | 11 | #
# Autogenerated by Thrift Compiler
#
# DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
#
# options string: py:new_style
#
from thrift.Thrift import TType, TMessageType, TException, TApplicationException
from ttypes import *
EDAM_ATTRIBUTE_LEN_MIN = 1
EDAM_ATTRIBUTE_LEN_MAX = 4096
EDAM_ATTRIBUTE_RE... |
cjerdonek/pip | refs/heads/develop | pip/_vendor/requests/packages/chardet/utf8prober.py | 2918 | ######################## 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.
#
# Con... |
DazWorrall/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_netconf.py | 27 | #!/usr/bin/python
#
# 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 distribut... |
larrybradley/astropy | refs/heads/remote-tests | astropy/io/ascii/tests/test_cds_header_from_readme.py | 5 | # Licensed under a 3-clause BSD style license - see LICENSE.rst
import numpy as np
from astropy.io import ascii
from .common import (assert_equal, assert_almost_equal, # noqa
setup_function, teardown_function) # noqa
from astropy import units as u
def read_table1(readme, data):
reader = as... |
AlexRobson/scikit-learn | refs/heads/master | sklearn/decomposition/tests/test_online_lda.py | 12 | import numpy as np
from scipy.sparse import csr_matrix
from scipy.linalg import block_diag
from sklearn.decomposition import LatentDirichletAllocation
from sklearn.utils.testing import assert_true
from sklearn.utils.testing import assert_array_almost_equal
from sklearn.utils.testing import assert_almost_equal
from skl... |
mwaskom/seaborn | refs/heads/master | examples/part_whole_bars.py | 2 | """
Horizontal bar plots
====================
"""
import seaborn as sns
import matplotlib.pyplot as plt
sns.set_theme(style="whitegrid")
# Initialize the matplotlib figure
f, ax = plt.subplots(figsize=(6, 15))
# Load the example car crash dataset
crashes = sns.load_dataset("car_crashes").sort_values("total", ascendi... |
PopCap/GameIdea | refs/heads/master | Engine/Source/ThirdParty/HTML5/emsdk/Win64/python/2.7.5.3_64bit/Lib/site-packages/setuptools/py24compat.py | 77 | """
Forward-compatibility support for Python 2.4 and earlier
"""
# from jaraco.compat 1.2
try:
from functools import wraps
except ImportError:
def wraps(func):
"Just return the function unwrapped"
return lambda x: x
try:
import hashlib
except ImportError:
from setuptools._backport imp... |
kitanata/resume | refs/heads/master | env/lib/python2.7/site-packages/pip/wheel.py | 145 | """
Support for installing and building the "wheel" binary package format.
"""
from __future__ import with_statement
import compileall
import csv
import functools
import hashlib
import os
import re
import shutil
import sys
from base64 import urlsafe_b64encode
from email.parser import Parser
from pip.backwardcompat i... |
agry/NGECore2 | refs/heads/master | scripts/object/mobile/dressed_dark_jedi_master_male_twk_02.py | 50 | import sys
def setup(core, object):
lootPoolNames_1 = ['Junk']
lootPoolChances_1 = [100]
lootGroupChance_1 = 65
object.addToLootGroups(lootPoolNames_1,lootPoolChances_1,lootGroupChance_1)
lootPoolNames_2 = ['jedi_relic_1']
lootPoolChances_2 = [100]
lootGroupChance_2 = 85
object.addToLootGroups(lootPoolName... |
ool2016-seclab/quarantineSystem | refs/heads/master | ryu/ofproto/inet.py | 38 | # This module is for backward compat
from ryu.lib.packet.in_proto import *
|
thispc/download-manager | refs/heads/master | module/plugins/crypter/Go4UpCom.py | 8 | # -*- coding: utf-8 -*-
import re
import urlparse
from ..internal.misc import json
from ..internal.SimpleCrypter import SimpleCrypter
class Go4UpCom(SimpleCrypter):
__name__ = "Go4UpCom"
__type__ = "crypter"
__version__ = "0.19"
__status__ = "testing"
__pattern__ = r'http://go4up\.com/(dl/\w{12... |
MER-GROUP/intellij-community | refs/heads/master | python/helpers/pydev/test_pydevd_reload/test_pydevd_reload.py | 53 | import os # @NoMove
import sys # @NoMove
sys.path.insert(0, os.path.realpath(os.path.abspath('..')))
import pydevd_reload
import tempfile
import unittest
SAMPLE_CODE = """
class C:
def foo(self):
return 0
@classmethod
def bar(cls):
return (0, 0)
@staticmethod
def stomp():
... |
andyh616/mne-python | refs/heads/master | mne/gui/_coreg_gui.py | 5 | """Traits-based GUI for head-MRI coregistration"""
# Authors: Christian Brodbeck <christianbrodbeck@nyu.edu>
#
# License: BSD (3-clause)
import os
from ..externals.six.moves import queue
import re
from threading import Thread
import warnings
import numpy as np
from scipy.spatial.distance import cdist
# allow import... |
cjaniake/ionicweb | refs/heads/master | webapp/ionic/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/packages/ordered_dict.py | 2039 | # 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... |
rohitwaghchaure/frappe_smart | refs/heads/develop | frappe/widgets/search.py | 18 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
# Search
from __future__ import unicode_literals
import frappe
import frappe.widgets.reportview
from frappe.utils import cstr, unique
# this is called by the Link Field
@frappe.whitelist()
def search_link(doctype, t... |
googleapis/googleapis-gen | refs/heads/master | google/spanner/admin/database/v1/admin-database-v1-py/tests/unit/gapic/spanner_admin_database_v1/__init__.py | 951 |
# -*- coding: utf-8 -*-
# Copyright 2020 Google LLC
#
# 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... |
CEG-FYP-OpenStack/scheduler | refs/heads/master | nova/api/openstack/auth.py | 9 | # Copyright 2013 IBM Corp.
# Copyright 2010 OpenStack Foundation
# 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/LIC... |
pelson/conda-build | refs/heads/master | conda_build/config.py | 1 | '''
Module to store conda build settings.
'''
from __future__ import absolute_import, division, print_function, unicode_literals
import copy
from collections import namedtuple
import math
import os
from os.path import abspath, expanduser, join, expandvars
import shutil
import sys
import time
from .conda_interface imp... |
samba-team/samba | refs/heads/master | selftest/subunithelper.py | 1 | # Python module for parsing and generating the Subunit protocol
# (Samba-specific)
# Copyright (C) 2008-2009 Jelmer Vernooij <jelmer@samba.org>
#
# 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; ... |
MemoryLane196/WebApp | refs/heads/master | memorylane/django-taggit-develop/tests/models.py | 1 | from __future__ import unicode_literals
from django.db import models
from django.utils.encoding import python_2_unicode_compatible
from taggit.managers import TaggableManager
from taggit.models import (CommonGenericTaggedItemBase, GenericTaggedItemBase,
Tag, TagBase, TaggedItem, TaggedItemB... |
felixguendling/flatbuffers | refs/heads/master | tests/MyGame/Example/Vec3.py | 3 | # automatically generated, do not modify
# namespace: Example
import flatbuffers
class Vec3(object):
__slots__ = ['_tab']
# Vec3
def Init(self, buf, pos):
self._tab = flatbuffers.table.Table(buf, pos)
# Vec3
def X(self): return self._tab.Get(flatbuffers.number_types.Float32Flags, self._... |
bancek/egradebook | refs/heads/master | src/lib/django/db/backends/postgresql/base.py | 241 | """
PostgreSQL database backend for Django.
Requires psycopg 1: http://initd.org/projects/psycopg1
"""
import sys
from django.db import utils
from django.db.backends import *
from django.db.backends.signals import connection_created
from django.db.backends.postgresql.client import DatabaseClient
from django.db.backe... |
wsmith323/django | refs/heads/master | tests/template_tests/test_response.py | 55 | from __future__ import unicode_literals
import pickle
import time
from datetime import datetime
from django.conf import settings
from django.template import engines
from django.template.response import (
ContentNotRenderedError, SimpleTemplateResponse, TemplateResponse,
)
from django.test import RequestFactory, S... |
jdorvi/CSHORE | refs/heads/master | STATS_2perRunup.py | 1 |
#function err = STATS_2perRunup(inpth1,inpth2,outpth,tran_id,step)
#--------------------------------------------------------------------------
#This function runs the response-based runup statistical analysis for a
#specified transect
##MFS 06-06-2014
##MFS 09-24-2014 added Q-Q optimization
#--------------------------... |
jaxkodex/odoo | refs/heads/8.0 | addons/web_tests/tests/test_ui.py | 175 | # -*- coding: utf-8 -*-
import os
import openerp.tests
class TestUi(openerp.tests.HttpCase):
def test_03_js_public(self):
self.phantom_js('/',"console.log('ok')","console")
def test_04_js_admin(self):
self.phantom_js('/web',"console.log('ok')","openerp.client.action_manager.inner_widget", logi... |
DebrahR/memory | refs/heads/master | server/lib/werkzeug/formparser.py | 312 | # -*- coding: utf-8 -*-
"""
werkzeug.formparser
~~~~~~~~~~~~~~~~~~~
This module implements the form parsing. It supports url-encoded forms
as well as non-nested multipart uploads.
:copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more deta... |
COSMOGRAIL/PyCS | refs/heads/master | pycs/play/fit/__init__.py | 1 | """
Deprecated ! Fitting stuff like polynoms or splines simultatneously on lightcurves.
"""
#__all__ = ["bspl", "multiopt", "multispec", "twospec"]
|
murfz/Sick-Beard | refs/heads/development | lib/hachoir_parser/version.py | 93 | __version__ = "1.3.4"
PACKAGE = "hachoir-parser"
WEBSITE = "http://bitbucket.org/haypo/hachoir/wiki/hachoir-parser"
LICENSE = 'GNU GPL v2'
|
TeamTwisted/external_chromium_org | refs/heads/opti-5.1 | third_party/cython/src/pyximport/pyxbuild.py | 95 | """Build a Pyrex file from .pyx source to .so loadable module using
the installed distutils infrastructure. Call:
out_fname = pyx_to_dll("foo.pyx")
"""
import os
import sys
from distutils.dist import Distribution
from distutils.errors import DistutilsArgError, DistutilsError, CCompilerError
from distutils.extension i... |
anbangleo/NlsdeWeb | refs/heads/master | Python-3.6.0/Lib/test/test_optparse.py | 4 | #
# Test suite for Optik. Supplied by Johannes Gijsbers
# (taradino@softhome.net) -- translated from the original Optik
# test suite to this PyUnit-based version.
#
# $Id$
#
import sys
import os
import re
import copy
import unittest
from io import StringIO
from test import support
import optparse
from optparse imp... |
JavML/django | refs/heads/master | django/db/migrations/__init__.py | 826 | from .migration import Migration, swappable_dependency # NOQA
from .operations import * # NOQA
|
ddico/account-financial-tools | refs/heads/11.0 | account_check_deposit/models/res_config_settings.py | 1 | # Copyright 2016 Akretion (Alexis de Lattre <alexis.delattre@akretion.com>)
# Copyright 2018 Tecnativa - Pedro M. Baeza
# License AGPL-3.0 or later (http://www.gnu.org/licenses/agpl.html).
from odoo import fields, models
class ResConfigSettings(models.TransientModel):
_inherit = 'res.config.settings'
check_... |
austinharris/gem5-riscv | refs/heads/master | src/mem/ruby/slicc_interface/Controller.py | 39 | # Copyright (c) 2009 Advanced Micro Devices, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met: redistributions of source code must retain the above copyright
# notice, this list of conditions... |
jmesteve/openerpseda | refs/heads/master | openerp/addons/account/account_analytic_line.py | 31 | # -*- 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... |
ibb-zimmers/betsynetpdf | refs/heads/master | sumatrapdf/scripts/buildbot.py | 4 | """
Builds sumatra and uploads results to s3 for easy analysis, viewable at:
http://kjkpub.s3.amazonaws.com/sumatrapdf/buildbot/index.html
"""
import sys
import os
# assumes is being run as ./scripts/buildbot.py
efi_scripts_dir = os.path.join("tools", "efi")
sys.path.append(efi_scripts_dir)
import shutil
im... |
EDUlib/edx-platform | refs/heads/master | import_shims/lms/ccx/tests/factories.py | 2 | """Deprecated import support. Auto-generated by import_shims/generate_shims.sh."""
# pylint: disable=redefined-builtin,wrong-import-position,wildcard-import,useless-suppression,line-too-long
from import_shims.warn import warn_deprecated_import
warn_deprecated_import('ccx.tests.factories', 'lms.djangoapps.ccx.tests.fa... |
KeyWeeUsr/plyer | refs/heads/master | plyer/facades/gps.py | 1 | '''
GPS
====
.. versionadded:: 1.1
.. note::
On Android `INTERNET`, `ACCESS_FINE_LOCATION`, `ACCESS_COARSE_LOCATION`
permissions are needed.
.. note::
On iOS `NSLocationWhenInUseUsageDescription` key is required for app to
display geolocation usage permission prompt. Key can be added in Xcode
ta... |
nathanielvarona/airflow | refs/heads/master | tests/api_connexion/endpoints/test_provider_endpoint.py | 3 | # 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... |
henaras/horizon | refs/heads/master | openstack_dashboard/contrib/sahara/content/data_processing/cluster_templates/tabs.py | 25 | # 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
# distributed under the... |
yashu-seth/networkx | refs/heads/master | networkx/linalg/tests/test_modularity.py | 46 | 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... |
hiimivantang/ltadatamallcrawler | refs/heads/master | tests/__init__.py | 14224 | # -*- coding: utf-8 -*-
|
authman/Python201609 | refs/heads/master | Guerrero_Melissa/Assignments/Registration_Form/server.py | 1 | from flask import Flask, render_template, request, redirect, flash
import re
EMAIL_REGEX = re.compile(r'^[a-zA-Z0-9.+_-]+@[a-zA-Z0-9._-]+\.[a-zA-Z]+$')
NAME_REGEX = re.compile(r'^[\d]')
app = Flask(__name__)
app.secret_key = "TopSecret"
@app.route('/')
def index():
return render_template("index.html")
@app.route('... |
Jay-Jay-D/LeanSTP | refs/heads/master | Algorithm.Python/IndicatorWarmupAlgorithm.py | 3 | # QUANTCONNECT.COM - Democratizing Finance, Empowering Individuals.
# Lean Algorithmic Trading Engine v2.0. Copyright 2014 QuantConnect Corporation.
#
# 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 Lice... |
nelango/ViralityAnalysis | refs/heads/master | model/lib/sklearn/utils/tests/test_validation.py | 79 | """Tests for input validation functions"""
import warnings
from tempfile import NamedTemporaryFile
from itertools import product
import numpy as np
from numpy.testing import assert_array_equal
import scipy.sparse as sp
from nose.tools import assert_raises, assert_true, assert_false, assert_equal
from sklearn.utils.... |
siosio/intellij-community | refs/heads/master | python/testData/intentions/PyConvertTypeCommentToVariableAnnotationIntentionTest/assignmentWithComplexUnpacking_after.py | 31 | y: Optional[Union[None, Any]]
x: Callable[..., int]
z: Any
[y, (x, (z))] = undefined() |
oshtaier/robottelo | refs/heads/master | tests/foreman/api/test_architecture.py | 1 | """Unit tests for the ``architectures`` paths."""
from fauxfactory import gen_utf8
from nailgun import client
from robottelo.common.decorators import skip_if_bug_open
from robottelo.common.helpers import get_server_credentials
from robottelo import entities
from robottelo.test import APITestCase
# (too-many-public-meth... |
arambadk/django-datatable | refs/heads/master | table/widgets.py | 2 | #!/usr/bin/env python
# coding: utf-8
from django.template.loader import get_template
from django.template import Context, Template
from django.utils.safestring import mark_safe
class SearchBox(object):
def __init__(self, visible=True, placeholder=None):
self.visible = visible
self.placeholder = p... |
zrhans/pythonanywhere | refs/heads/master | .virtualenvs/django19/lib/python3.4/site-packages/django/conf/app_template/apps.py | 411 | from django.apps import AppConfig
class {{ camel_case_app_name }}Config(AppConfig):
name = '{{ app_name }}'
|
AccelAI/accel.ai | refs/heads/master | flask-aws/lib/python2.7/site-packages/wtforms/ext/dateutil/fields.py | 177 | """
A DateTimeField and DateField that use the `dateutil` package for parsing.
"""
from __future__ import unicode_literals
from dateutil import parser
from wtforms.fields import Field
from wtforms.validators import ValidationError
from wtforms.widgets import TextInput
__all__ = (
'DateTimeField', 'DateField',
)... |
MonsterKiller/django-material | refs/heads/master | tests/visual/tests/__init__.py | 10 | from needle.cases import NeedleTestCase
from django.contrib.staticfiles.testing import StaticLiveServerTestCase
class VisualTest(NeedleTestCase, StaticLiveServerTestCase):
engine_class = 'needle.engines.perceptualdiff_engine.Engine'
viewport_width = 1280
viewport_height = 1024
def assertScreenshot(se... |
mgagne/nova | refs/heads/master | nova/pci/whitelist.py | 6 | # Copyright (c) 2013 Intel, Inc.
# Copyright (c) 2013 OpenStack Foundation
# 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/li... |
alexcuellar/odoo | refs/heads/8.0 | addons/account_check_writing/wizard/__init__.py | 437 | # -*- 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... |
katiecheng/Bombolone | refs/heads/master | env/lib/python2.7/site-packages/setuptools/command/build_ext.py | 125 | from distutils.command.build_ext import build_ext as _du_build_ext
try:
# Attempt to use Pyrex for building extensions, if available
from Pyrex.Distutils.build_ext import build_ext as _build_ext
except ImportError:
_build_ext = _du_build_ext
import os
import sys
from distutils.file_util import copy_file
fr... |
wazeerzulfikar/scikit-learn | refs/heads/master | examples/tree/plot_tree_regression_multioutput.py | 13 | """
===================================================================
Multi-output Decision Tree Regression
===================================================================
An example to illustrate multi-output regression with decision tree.
The :ref:`decision trees <tree>`
is used to predict simultaneously the ... |
Mj258/weiboapi | refs/heads/master | srapyDemo/envs/Lib/site-packages/pkg_resources/_vendor/packaging/_compat.py | 901 | # Copyright 2014 Donald Stufft
#
# 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, so... |
NiLuJe/calibre-kobo-driver | refs/heads/master | conversion/output_config.py | 1 | # vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
"""Configuration for exporting KePub files."""
from __future__ import unicode_literals
__license__ = "GPL v3"
__copyright__ = "2013, Joel Goguen <jgoguen@jgoguen.ca>"
__docformat__ = "markdown en"
from calibre.gui2.convert import Widget
from calibre.gui2.convert.ep... |
tedelhourani/ansible | refs/heads/devel | lib/ansible/modules/cloud/openstack/os_project_facts.py | 25 | #!/usr/bin/python
# Copyright (c) 2016 Hewlett-Packard Enterprise Corporation
# 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',
... |
dulems/hue | refs/heads/master | desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_timezone.py | 49 | import copy
import datetime
import pickle
from django.test.utils import override_settings
from django.utils import six
from django.utils import timezone
from django.utils.tzinfo import FixedOffset
from django.utils import unittest
EAT = FixedOffset(180) # Africa/Nairobi
ICT = FixedOffset(420) # Asia/Bangkok... |
shaform/scrapy | refs/heads/master | tests/test_utils_trackref.py | 119 | import six
import unittest
from scrapy.utils import trackref
from tests import mock
class Foo(trackref.object_ref):
pass
class Bar(trackref.object_ref):
pass
class TrackrefTestCase(unittest.TestCase):
def setUp(self):
trackref.live_refs.clear()
def test_format_live_refs(self):
o1... |
globocom/database-as-a-service | refs/heads/master | dbaas/account/migrations/0006_auto__add_field_team_contacts.py | 1 | # -*- 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
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'Team.contacts'
db.add_column(u'account_team', 'contacts',... |
btabibian/scikit-learn | refs/heads/master | sklearn/decomposition/dict_learning.py | 8 | """ Dictionary learning
"""
from __future__ import print_function
# Author: Vlad Niculae, Gael Varoquaux, Alexandre Gramfort
# License: BSD 3 clause
import time
import sys
import itertools
from math import sqrt, ceil
import numpy as np
from scipy import linalg
from numpy.lib.stride_tricks import as_strided
from ..b... |
p4datasystems/CarnotKE | refs/heads/master | jyhton/lib-python/2.7/hotshot/stones.py | 233 | import errno
import hotshot
import hotshot.stats
import sys
import test.pystone
def main(logfile):
p = hotshot.Profile(logfile)
benchtime, stones = p.runcall(test.pystone.pystones)
p.close()
print "Pystone(%s) time for %d passes = %g" % \
(test.pystone.__version__, test.pystone.LOOPS, bencht... |
n37r06u3/webpymail | refs/heads/master | webpymail/wpmauth/backends.py | 7 | # -*- coding: utf-8 -*-
# WebPyMail - IMAP python/django web mail client
# Copyright (C) 2008 Helder Guerreiro
## This file is part of WebPyMail.
##
## WebPyMail 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 Foundat... |
PeriodicTaskTracker/tasktracker-django | refs/heads/master | tasks/engine.py | 1 | from itertools import groupby
from restapi.serializers import UserSerializer, CampaignSerializer, TaskSerializer
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from rest_framework.test import APIRequestFactory
from tasks import models
# TODO
def page_link(page):
return page.number
d... |
culturagovbr/sistema-nacional-cultura | refs/heads/master | adesao/migrations/0038_usuario_email_pessoal.py | 1 | # Generated by Django 2.0.8 on 2019-03-29 17:14
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('adesao', '0037_merge_20190320_1154'),
]
operations = [
migrations.AddField(
model_name='usuario',
name='email_pessoa... |
ivoryhuang/LOL_simple_text_version | refs/heads/master | games/Item_Shop.py | 1 | from items import *
class Item_Shop():
def __init__(self):
self.items = [Amplifying_Tome(), Blasting_Wand(), Boots_Of_Speed(), Fiendish_Codex(), Lost_Chapter(), Sapphire_Crystal(), Sorcerers_Shoes()]
def display_items_to_sell(self):
msg = "You want to buy:\n"
for item in self.items:
... |
kalahbrown/HueBigSQL | refs/heads/master | desktop/core/ext-py/lxml/fake_pyrex/Pyrex/Distutils/build_ext.py | 72 | build_ext = "yes, it's there!"
|
wackymaster/QTClock | refs/heads/master | Libraries/matplotlib/backends/backend_template.py | 8 | """
This is a fully functional do nothing backend to provide a template to
backend writers. It is fully functional in that you can select it as
a backend with
import matplotlib
matplotlib.use('Template')
and your matplotlib scripts will (should!) run without error, though
no output is produced. This provides a ... |
marscher/cython | refs/heads/master | Cython/Compiler/__init__.py | 1472 | # empty file
|
xenigmax/seqan | refs/heads/develop | apps/seqcons2/tests/run_tests.py | 10 | #!/usr/bin/env python2
"""Execute the tests for the seqcons2 program.
The golden test outputs are generated by the script generate_outputs.sh.
You have to give the root paths to the source and the binaries as arguments to
the program. These are the paths to the directory that contains the 'projects'
directory.
Usag... |
nikolas/lettuce | refs/heads/master | tests/integration/lib/Django-1.3/django/contrib/comments/admin.py | 361 | 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... |
ATIX-AG/ansible | refs/heads/devel | lib/ansible/modules/network/cloudengine/ce_vrf_af.py | 43 | #!/usr/bin/python
#
# 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 distribut... |
Ali-aqrabawi/ezclinic | refs/heads/master | lib/djangae/models.py | 13 | from django.db import models
from djangae import patches
class CounterShard(models.Model):
count = models.PositiveIntegerField()
label = models.CharField(max_length=500)
class Meta:
app_label = "djangae"
|
showell/zulip | refs/heads/master | tools/tests/test_pretty_print.py | 7 | import unittest
from tools.lib.pretty_print import pretty_print_html
# Note that GOOD_HTML isn't necessarily beautiful HTML. Apart
# from adjusting indentation, we mostly leave things alone to
# respect whatever line-wrapping styles were in place before.
BAD_HTML = """
<!-- test -->
<!DOCTYPE html>
<html>
<!... |
nischalsheth/contrail-controller | refs/heads/master | src/config/api-server/tests/test_instance_ctl.py | 21 | import sys
import argparse
from vnc_api.vnc_api import *
class Provisioner(object):
def __init__(self, arguments):
self._client = VncApi(api_server_host=arguments.api_server,
api_server_port=arguments.port)
self._network_name = arguments.network
self._project ... |
xzturn/tensorflow | refs/heads/master | tensorflow/python/data/kernel_tests/dataset_test.py | 3 | # 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... |
sissaschool/xmlschema | refs/heads/master | tests/validators/test_wildcards.py | 1 | #!/usr/bin/env python
#
# Copyright (c), 2016-2020, SISSA (International School for Advanced Studies).
# All rights reserved.
# This file is distributed under the terms of the MIT License.
# See the file 'LICENSE' in the root directory of the present
# distribution, or http://opensource.org/licenses/MIT.
#
# @author Da... |
mysociety/django-subdomains | refs/heads/master | subdomains/tests/urls/default.py | 7 | try:
from django.conf.urls import patterns, url
except ImportError:
from django.conf.urls.defaults import patterns, url # noqa
from subdomains.tests.views import view
urlpatterns = patterns('',
url(regex=r'^$', view=view, name='home'),
url(regex=r'^example/$', view=view, name='example'),
)
|
vileopratama/vitech | refs/heads/master | src/addons/website_event/__openerp__.py | 18 | # -*- coding: utf-8 -*-
{
'name': 'Online Events',
'category': 'Marketing',
'sequence': 135,
'summary': 'Schedule, Promote and Sell Events',
'website': 'https://www.odoo.com/page/website-builder',
'version': '1.0',
'description': """
Online Events
""",
'depends': ['website', 'we... |
andrius-preimantas/odoo | refs/heads/master | openerp/workflow/workitem.py | 24 |
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General P... |
nawawi/poedit | refs/heads/stable | deps/generate_build_ninja.py | 1 | #!/usr/bin/env python3
import os, sys, subprocess
from collections import OrderedDict
from glob import glob
from ninja_syntax import Writer
GETTEXT_VERSION = "0.21" # use of " important for Xcode build!
GETTEXT_TARBALL = 'gettext-%s.tar.gz' % GETTEXT_VERSION
GETTEXT_SHA256 = 'c77d0da3102aec9c07f43671e60611ebff89a996... |
tv42/munging_http_proxy | refs/heads/master | munging_http_proxy/interactive.py | 2 | from . import wsgi
import code
import gevent
import gevent.coros
import readline
import rlcompleter
readline.__name__ # silence pyflakes
rlcompleter.__name__ # silence pyflakes
class InteractiveMunger(object):
def __init__(self):
self.local = {}
self.lock = gevent.coros.Semaphore()
def mung... |
40123247/2015cd_midterm | refs/heads/master | static/Brython3.1.0-20150301-090019/Lib/unittest/test/test_result.py | 788 | import io
import sys
import textwrap
from test import support
import traceback
import unittest
class Test_TestResult(unittest.TestCase):
# Note: there are not separate tests for TestResult.wasSuccessful(),
# TestResult.errors, TestResult.failures, TestResult.testsRun or
# TestResult.shouldStop because t... |
nhicher/ansible | refs/heads/devel | lib/ansible/modules/crypto/openssl_publickey.py | 43 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Yanis Guenane <yanis+ansible@guenane.org>
# 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': '... |
ESS-LLP/erpnext-medical | refs/heads/develop | erpnext/setup/doctype/uom_conversion_factor/uom_conversion_factor.py | 17 | # -*- coding: utf-8 -*-
# Copyright (c) 2018, Frappe Technologies Pvt. Ltd. and contributors
# For license information, please see license.txt
from __future__ import unicode_literals
from frappe.model.document import Document
class UOMConversionFactor(Document):
pass
|
endlessm/chromium-browser | refs/heads/master | third_party/catapult/third_party/coverage/setup.py | 9 | # Licensed under the Apache License: http://www.apache.org/licenses/LICENSE-2.0
# For details: https://bitbucket.org/ned/coveragepy/src/default/NOTICE.txt
"""Code coverage measurement for Python"""
# Distutils setup for coverage.py
# This file is used unchanged under all versions of Python, 2.x and 3.x.
import os
im... |
wackerly/faucet | refs/heads/master | clib/tcpdump_helper.py | 1 | """Helper class for working with tcpdump."""
import errno
import fcntl
import subprocess
import os
import re
import mininet_test_util
# pylint: disable=import-error
# pylint: disable=no-name-in-module
from mininet.log import error, debug
class TcpdumpHelper(object):
"""Run tcpdump on interface, then a list of ... |
kvar/ansible | refs/heads/seas_master_2.9.5 | lib/ansible/modules/network/itential/iap_token.py | 54 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Itential <opensource@itential.com>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
"""
This module provides the token for Itential Automation Platform
"""
from __future__ import absolute_import, division, print... |
sosuke-k/cornel-movie-dialogs-corpus-storm | refs/heads/master | mdcorpus/tests/test_orm.py | 1 | """Testing for ORM"""
from unittest import TestCase
import nose
from nose.tools import eq_
from sets import Set
from mdcorpus.orm import *
class ORMTestCase(TestCase):
def setUp(self):
self.store = Store(create_database("sqlite:"))
self.store.execute(MovieTitlesMetadata.CREATE_SQL)
self... |
nfxosp/platform_external_skia | refs/heads/master | platform_tools/android/tests/var_dict_tests.py | 146 | #!/usr/bin/python
# Copyright 2014 Google Inc.
#
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""
Test the VarsDict.
"""
import sys
import test_variables
import unittest
sys.path.append(test_variables.GYP_GEN_DIR)
import vars_dict_lib
from vars_dict_lib impo... |
gabrielf10/webAmpunc | refs/heads/master | sistema/migrations/0002_auto_20160923_0449.py | 1 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('sistema', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='socio',
name='fecha_i... |
befelix/Safe-RL-Benchmark | refs/heads/master | SafeRLBench/envs/_quadrocopter/__init__.py | 1 | from __future__ import print_function, division, absolute_import
from .quadrotor_dynamics import QuadrotorDynamics
from .quadrocopter_classes import StateVector
__all__ = ['QuadrotorDynamics', 'StateVector']
|
ashikmohammed12/testrepo | refs/heads/master | voting-app/utils/__init__.py | 3 | import time
from redis import Redis, ConnectionError
def connect_to_redis(host):
time.sleep(2)
print "Connecting to redis"
while True:
try:
redis = Redis(host=host, db=0)
redis.ping()
print "Connected to redis"
return redis
except Connection... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.