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
georgeha/software_engineering
aws/restolingo/placeorder/models.py
1
3621
""" This file contains all the models that are used in our system """ from __future__ import unicode_literals from django.db import models from django.utils.encoding import python_2_unicode_compatible from autoslug import AutoSlugField from django.core.urlresolvers import reverse from django.contrib.auth.models import...
mit
keyurpatel076/MissionPlannerGit
Lib/site-packages/scipy/signal/wavelets.py
55
6849
__all__ = ['daub','qmf','cascade','morlet'] import numpy as np from numpy.dual import eig from scipy.misc import comb from scipy import linspace, pi, exp def daub(p): """ The coefficients for the FIR low-pass filter producing Daubechies wavelets. p>=1 gives the order of the zero at f=1/2. There are 2...
gpl-3.0
strk/QGIS
tests/src/python/test_provider_ogr_gpkg.py
5
68407
# -*- coding: utf-8 -*- """QGIS Unit tests for the OGR/GPKG provider. .. note:: 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....
gpl-2.0
teolupus/s3cmd
S3/HashCache.py
18
1844
# -*- coding: utf-8 -*- import cPickle as pickle from Utils import deunicodise class HashCache(object): def __init__(self): self.inodes = dict() def add(self, dev, inode, mtime, size, md5): if dev == 0 or inode == 0: return # Windows if dev not in self.inodes: self.inodes[...
gpl-2.0
sublime1809/django
django/contrib/messages/tests/test_session.py
226
1898
from django.contrib.messages import constants from django.contrib.messages.tests.base import BaseTests from django.contrib.messages.storage.base import Message from django.contrib.messages.storage.session import SessionStorage from django.utils.safestring import SafeData, mark_safe from django.test import TestCase de...
bsd-3-clause
alxgu/ansible-modules-extras
cloud/vmware/vmware_host.py
71
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
alhashash/odoomrp-wip
purchase_secondary_unit/models/product.py
17
1599
# -*- encoding: utf-8 -*- ############################################################################## # # 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...
agpl-3.0
helena-project/beetle
controller/manager/tasks.py
1
5949
import socket from datetime import timedelta from celery.decorators import task, periodic_task from celery.utils.log import get_task_logger from django.utils import timezone from beetle.models import VirtualDevice, PrincipalGroup from network.models import ConnectedGateway, ConnectedDevice, DeviceMapping, \ Service...
apache-2.0
hdinsight/hue
desktop/core/ext-py/elementtree/elementtree/ElementTree.py
128
40886
# # ElementTree # $Id: ElementTree.py 2326 2005-03-17 07:45:21Z fredrik $ # # light-weight XML support for Python 1.5.2 and later. # # history: # 2001-10-20 fl created (from various sources) # 2001-11-01 fl return root from parse method # 2002-02-16 fl sort attributes in lexical order # 2002-04-06 fl TreeBuilde...
apache-2.0
EmanuelStoyanov/NomNom-Food-Delivery
tests.py
1
4962
import unittest import database import logged_menu class database_tests(unittest.TestCase): def setUp(self): database.create_users_table() database.create_restaurant_table() database.create_orders_table() database.create_taxes_table() database.register('Barney', '420', "Mcl...
gpl-3.0
italopaiva/propositional-logic
operations.py
1
6549
"""Describe the possible operations.""" from lp.interpreter import Interpreter, TruthTable, SetTruthTable class Operation: """Base class for operations.""" def perform(self, *args): """Perform the operation.""" raise NotImplementedError def parse(self, line): """ Generic...
mit
uglyboxer/linear_neuron
net-p3/lib/python3.5/site-packages/scipy/optimize/zeros.py
55
19069
from __future__ import division, print_function, absolute_import import warnings from . import _zeros from numpy import finfo, sign, sqrt _iter = 100 _xtol = 1e-12 _rtol = finfo(float).eps * 2 __all__ = ['newton', 'bisect', 'ridder', 'brentq', 'brenth'] CONVERGED = 'converged' SIGNERR = 'sign error' CONVERR = 'con...
mit
leiferikb/bitpop
src/chrome/common/extensions/docs/server2/servlet.py
1
4143
# 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. class RequestHeaders(object): '''A custom dictionary impementation for headers which ignores the case of requests, since different HTTP libraries seem t...
gpl-3.0
delimatorres/xhtml2pdf
test/witherror.py
154
1128
# -*- coding: utf-8 -*- # Copyright 2010 Dirk Holtwick, holtwick.it # # 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 ...
apache-2.0
mou4e/zirconium
third_party/jinja2/visitor.py
1401
3316
# -*- coding: utf-8 -*- """ jinja2.visitor ~~~~~~~~~~~~~~ This module implements a visitor for the nodes. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2.nodes import Node class NodeVisitor(object): """Walks the abstract syntax tree and call visitor functions for every...
bsd-3-clause
sschepens/pulsar
pulsar-client-cpp/python/functions/function.py
9
2082
#!/usr/bin/env python # # 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 # "...
apache-2.0
pvrs12/A858nalyze
web/html.py
2
1043
from cgi import escape def _plain_wrapper(name): def attr_str(item): key, value = item return " %s='%s'" % (key, escape(value, True)) def attrs_str(attrs): return "".join(map(attr_str, attrs.items())) def result(**attrs): return "<%s%s>" % (name, attrs_str(attrs)) return result def _wrapper(name): plain...
agpl-3.0
lnmds/jorge
ext/gambling.py
1
5013
import asyncio import decimal import random import discord from discord.ext import commands from .common import Cog EMOJI_POOL = ':thinking: :snail: :shrug: :chestnut: :ok_hand: :eggplant:'.split() BET_MULTIPLIER_EMOJI = ':thinking:' X4_EMOJI = [':snail:', ':chestnut:', ':shrug:'] X6_EMOJI = [':eggplant:', ':ok_han...
mit
jpt4/urbit
outside/commonmark/test/normalize.py
23
5240
from HTMLParser import HTMLParser, HTMLParseError from htmlentitydefs import name2codepoint import sys import re import cgi # Normalization code, adapted from # https://github.com/karlcow/markdown-testsuite/ significant_attrs = ["alt", "href", "src", "title"] whitespace_re = re.compile('/s+/') class MyHTMLParser(HTMLP...
mit
erinspace/osf.io
website/search_migration/__init__.py
1
34093
JSON_UPDATE_NODES_SQL = """ SELECT json_agg( json_build_object( '_type', CASE WHEN N.type = 'osf.registration' THEN 'registration' WHEN PREPRINT.URL IS NOT NULL THEN 'preprint' WHEN PARENT_GUID._id IS NULL ...
apache-2.0
duncanmmacleod/gwpy
gwpy/plot/axes.py
1
21895
# -*- coding: utf-8 -*- # Copyright (C) Duncan Macleod (2018-2020) # # This file is part of GWpy. # # GWpy 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)...
gpl-3.0
Cue/eventlet
tests/api_test.py
6
5744
import os import os.path import socket from unittest import TestCase, main import warnings import eventlet warnings.simplefilter('ignore', DeprecationWarning) from eventlet import api warnings.simplefilter('default', DeprecationWarning) from eventlet import greenio, util, hubs, greenthread, spawn def check_hub(): ...
mit
glehmann/uptodate
uptodate/plugins/display.py
1
1674
#!/usr/bin/env python #coding: iso-8859-15 # # Copyright (C) 2005 Gaëtan Lehmann <gaetan.lehmann@jouy.inra.fr> # # this file is part of uptodate # # 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
google/makani
lib/python/pack2/backend_py.py
1
9016
# Copyright 2020 Makani Technologies 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 or agreed to...
apache-2.0
Rav3nPL/bitcoin
test/functional/preciousblock.py
8
5072
#!/usr/bin/env python3 # Copyright (c) 2015-2016 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. """Test the preciousblock RPC.""" from test_framework.test_framework import BitcoinTestFramework from tes...
mit
sithcoin-/sithcoin
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
JulienMcJay/eclock
windows/Python27/Lib/site-packages/pip/log.py
344
9455
"""Logging """ import sys import os import logging from pip import backwardcompat from pip._vendor import colorama, pkg_resources def _color_wrap(*colors): def wrapped(inp): return "".join(list(colors) + [inp, colorama.Style.RESET_ALL]) return wrapped def should_color(consumer, environ, std=(sys.s...
gpl-2.0
40223225/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/browser/local_storage.py
617
2786
# local storage in browser import sys from javascript import JSObject class __UnProvided(): pass class LocalStorage(): storage_type = "local_storage" def __init__(self): if not sys.has_local_storage: raise EnvironmentError("LocalStorage not available") self.store = JSObject(__...
gpl-3.0
mexeniz/django-oscar
src/oscar/apps/dashboard/reports/forms.py
28
1586
from django import forms from django.utils.translation import ugettext_lazy as _ from oscar.core.loading import get_class GeneratorRepository = get_class('dashboard.reports.utils', 'GeneratorRepository') class ReportForm(forms.Form): generators = GeneratorRepository().get_report_g...
bsd-3-clause
alheinecke/tensorflow-xsmm
tensorflow/python/framework/errors_impl.py
59
14885
# Copyright 2015 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
omakk/servo
components/script/dom/bindings/codegen/parser/tests/test_typedef.py
154
1880
def WebIDLTest(parser, harness): parser.parse(""" typedef long mylong; typedef long? mynullablelong; interface Foo { const mylong X = 5; const mynullablelong Y = 7; const mynullablelong Z = null; void foo(mylong arg); }; """) results = parser.finish()...
mpl-2.0
SevInf/IEDriver
wire.py
22
83032
# Copyright 2008-2010 WebDriver committers # Copyright 2008-2010 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/LICENS...
apache-2.0
SCSSG/Odoo-SCS
addons/l10n_vn/__openerp__.py
342
1697
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved. # # This program is free software: you can redistribute it and/or...
agpl-3.0
phamelin/ardupilot
Tools/scripts/logic_decode_channels.py
58
1242
#!/usr/bin/env python ''' decode a Saleae logic CSV export file as PWM values. Used for testing output values on PWM channels ''' import csv, sys filename = sys.argv[1] c = open(filename, 'r') data = csv.reader(c) pulse_start = [] prev_values = [] pwm = [] nchannels = 0 for row in data: # skip header if ro...
gpl-3.0
umkcdcrg01/ryu_openflow
ryu/app/my_arp_v3_copy.py
1
7774
# Simple Arp Handler v2 # Jack Zhao # s.zhao.j@gmail.com from operator import attrgetter from ryu.base import app_manager from ryu.controller import ofp_event from ryu.controller.handler import CONFIG_DISPATCHER from ryu.controller.handler import MAIN_DISPATCHER from ryu.controller.handler import set_ev_cls from ry...
apache-2.0
auduny/home-assistant
homeassistant/components/netio/switch.py
7
5376
"""The Netio switch component.""" import logging from collections import namedtuple from datetime import timedelta import voluptuous as vol from homeassistant.core import callback from homeassistant import util from homeassistant.components.http import HomeAssistantView from homeassistant.const import ( CONF_HOST...
apache-2.0
qutebrowser/qutebrowser
tests/end2end/features/test_yankpaste_bdd.py
2
1284
# vim: ft=python fileencoding=utf-8 sts=4 sw=4 et: # Copyright 2015-2021 Florian Bruhin (The Compiler) <mail@qutebrowser.org> # # This file is part of qutebrowser. # # qutebrowser is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free S...
gpl-3.0
listamilton/supermilton.repository
script.module.youtube.dl/lib/youtube_dl/extractor/fourtube.py
31
4543
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( parse_duration, parse_iso8601, sanitized_Request, str_to_int, ) class FourTubeIE(InfoExtractor): IE_NAME = '4tube' _VALID_URL = r'https?://(?:www\.)?4tube\.com/videos/(?P<id>\d+)' _...
gpl-2.0
phronesis-mnemosyne/census-schema-alignment
wit/wit/dev/authorship-embedding.py
1
4685
import pandas as pd import urllib2 from pprint import pprint from matplotlib import pyplot as plt from bs4 import BeautifulSoup from hashlib import md5 import sys sys.path.append('/Users/BenJohnson/projects/what-is-this/wit/') from wit import * pd.set_option('display.max_rows', 50) pd.set_option('display.max_column...
apache-2.0
quantmind/jflib
boostbuilder/build_ext.py
1
7401
import os import sys from types import * from distutils.errors import * from distutils.dep_util import newer_group from distutils.core import Extension as old_Extension from distutils.command.build_ext import build_ext as _build_ext from distutils import log from utils import fullsplit class external_ob...
bsd-3-clause
JioCloud/nova_test_latest
nova/tests/unit/test_metadata.py
17
46074
# Copyright 2010 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a ...
apache-2.0
mezz64/home-assistant
homeassistant/components/nzbget/config_flow.py
10
4404
"""Config flow for NZBGet.""" import logging from typing import Any, Dict, Optional import voluptuous as vol from homeassistant.config_entries import CONN_CLASS_LOCAL_POLL, ConfigFlow, OptionsFlow from homeassistant.const import ( CONF_HOST, CONF_NAME, CONF_PASSWORD, CONF_PORT, CONF_SCAN_INTERVAL,...
apache-2.0
drufat/vispy
vispy/visuals/shaders/variable.py
21
7640
# -*- coding: utf-8 -*- # Copyright (c) 2015, Vispy Development Team. # Distributed under the (new) BSD License. See LICENSE.txt for more info. import numpy as np from ...ext.six import string_types from .shader_object import ShaderObject VARIABLE_TYPES = ('const', 'uniform', 'attribute', 'varying', 'inout') class V...
bsd-3-clause
manub686/atomix
r2cmplr/_scrape_b_i.py
1
4226
#!/usr/bin/python ''' Atomix project, _scrape_b_i.py, (TODO: summary) Copyright (c) 2015 Stanford University Released under the Apache License v2.0. See the LICENSE file for details. Author(s): Manu Bansal ''' import csv import os import sys import re from _util import * class BlockScraper: def which(self, block...
apache-2.0
jenswi-linaro/linux
tools/perf/scripts/python/event_analyzing_sample.py
4719
7393
# event_analyzing_sample.py: general event handler in python # # Current perf report is already very powerful with the annotation integrated, # and this script is not trying to be as powerful as perf report, but # providing end user/developer a flexible way to analyze the events other # than trace points. # # The 2 dat...
gpl-2.0
joelfiddes/toposubv2
topoMAPP/toposcale/boxMetadata.py
2
1074
#!/usr/bin/env python """ This module computes ele diff between box and each listpoints member and long/lat of box centre Example: as import: Attributes: Todo: """ path2script = "./rsrc/boxMetadata.R" # main def main(wd, nbox): """Main entry point for the script.""" run_rscript_fileout(path2scr...
gpl-3.0
guoyiteng/braid
harness/summarize.py
2
4097
#!/usr/bin/env python3 import os import json from uncertain import umean import sys import statistics import math TIMINGS_DIR = 'collected' def get_latencies(data): """Get the list of frame latencies and draw latencies for a benchmark. """ msgs = data['messages'][1:] # Skip the first message as a "w...
mit
tectronics/l5rcm
dialogs/newrankdlg.py
3
13591
# Copyright (C) 2011 Daniele Simonetti # # 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 dist...
gpl-3.0
zhangziang/django-allauth
allauth/socialaccount/templatetags/socialaccount.py
46
2979
from django.template.defaulttags import token_kwargs from django import template from allauth.socialaccount import providers from allauth.utils import get_request_param register = template.Library() class ProviderLoginURLNode(template.Node): def __init__(self, provider_id, params): self.provider_id_var ...
mit
coreyphillips/testcoin
qa/rpc-tests/fundrawtransaction.py
16
24191
#!/usr/bin/env python2 # Copyright (c) 2014 The Bitcoin Core developers # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from pprint i...
mit
BackupGGCode/llvm-py
test/call-jit-ctypes.py
4
2019
#!/usr/bin/env python from llvm.core import Module,Type,Builder from llvm.ee import ExecutionEngine import llvm.core import ctypes def test_jit_ctypes(): # This example demonstrates calling an LLVM defined function using # ctypes. It illustrates the common C pattern of having an output # variable in the ...
bsd-3-clause
ahmadio/edx-platform
common/djangoapps/third_party_auth/saml.py
100
2027
""" Slightly customized python-social-auth backend for SAML 2.0 support """ import logging from social.backends.saml import SAMLAuth, OID_EDU_PERSON_ENTITLEMENT from social.exceptions import AuthForbidden log = logging.getLogger(__name__) class SAMLAuthBackend(SAMLAuth): # pylint: disable=abstract-method """ ...
agpl-3.0
devs1991/test_edx_docmode
meliae-0.4.0/run_tests.py
3
1032
#!/usr/bin/env python # Copyright (C) 2009 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in the hope that it will be useful, but # W...
agpl-3.0
drpngx/tensorflow
tensorflow/python/keras/utils/generic_utils.py
11
17875
# Copyright 2015 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
clemensv/qpid-proton
examples/python/server_direct.py
9
2508
#!/usr/bin/env python # # 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 # "...
apache-2.0
gnowledge/ncert_nroer
objectapp/models.py
2
52559
# Copyright (c) 2011, 2012 Free Software Foundation # 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 vers...
agpl-3.0
40223209/2015cd_midterm
static/Brython3.1.1-20150328-091302/Lib/html/parser.py
737
19605
"""A parser for HTML and XHTML.""" # This file is based on sgmllib.py, but the API is slightly different. # XXX There should be a way to distinguish between PCDATA (parsed # character data -- the normal case), RCDATA (replaceable character # data -- only char and entity references and end tags are special) # and CDAT...
gpl-3.0
ageron/tensorflow
tensorflow/contrib/distributions/python/kernel_tests/bijectors/gumbel_test.py
25
2707
# 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
jkettleb/iris
lib/iris/tests/integration/test_pp_constrained_load_cubes.py
3
2825
# (C) British Crown Copyright 2014 - 2015, Met Office # # This file is part of Iris. # # Iris 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 3 of the License, or # (at your option) any l...
lgpl-3.0
molotof/infernal-twin
build/pillow/Scripts/explode.py
12
2441
#!/usr/bin/env python # # The Python Imaging Library # $Id$ # # split an animation into a number of frame files # from __future__ import print_function from PIL import Image import os import sys class Interval(object): def __init__(self, interval="0"): self.setinterval(interval) def setinterval(s...
gpl-3.0
kiseok7/namebench
nb_third_party/dns/rdtypes/keybase.py
248
5017
# Copyright (C) 2004-2007, 2009, 2010 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED ...
apache-2.0
Eficent/manufacture
quality_control_mrp/tests/test_quality_control_mrp.py
4
2984
# -*- coding: utf-8 -*- # (c) 2015 Oihane Crucelaegui - AvanzOSC # License AGPL-3 - See http://www.gnu.org/licenses/agpl-3.0.html from openerp.tests.common import TransactionCase class TestQualityControlMrp(TransactionCase): def setUp(self): super(TestQualityControlMrp, self).setUp() self.produc...
agpl-3.0
leifos/treconomics
treconomics_project/treconomics/test_views.py
1
1408
from django.core.urlresolvers import reverse __author__ = 'mickeypash' from django.test import TestCase class LandingViewTests(TestCase): def test_home_view_status_code(self): """ Testing the response status codes Status expected - 200 OK """ response = self.client.get(re...
mit
daemonmaker/pylearn2
pylearn2/scripts/mlp/predict_csv.py
44
4691
#!/usr/bin/env python # coding: utf-8 """ Script to predict values using a pkl model file. This is a configurable script to make predictions. Basic usage: .. code-block:: none predict_csv.py pkl_file.pkl test.csv output.csv Optionally it is possible to specify if the prediction is regression or classification ...
bsd-3-clause
xxshutong/openerp-7.0
openerp/addons/hr_recruitment/__openerp__.py
52
2947
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # $Id$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0
shikhardb/scikit-learn
sklearn/feature_selection/tests/test_chi2.py
221
2398
""" Tests for chi2, currently the only feature selection function designed specifically to work with sparse matrices. """ import numpy as np from scipy.sparse import coo_matrix, csr_matrix import scipy.stats from sklearn.feature_selection import SelectKBest, chi2 from sklearn.feature_selection.univariate_selection im...
bsd-3-clause
emetsger/osf.io
scripts/tests/test_migrate_metadata.py
35
5155
from nose.tools import * # noqa from tests.base import OsfTestCase import json from modularodm import Q from framework.mongo.utils import to_mongo from website.project.model import ensure_schemas, MetaSchema, Node from tests import factories from scripts.migration.migrate_registered_meta import ( main as do_mig...
apache-2.0
wfxiang08/django190
tests/messages_tests/base.py
319
14243
from django import http from django.contrib.messages import constants, get_level, set_level, utils from django.contrib.messages.api import MessageFailure from django.contrib.messages.constants import DEFAULT_LEVELS from django.contrib.messages.storage import base, default_storage from django.contrib.messages.storage.ba...
bsd-3-clause
kyleam/pymc3
pymc/backends/ndarray.py
3
3410
"""NumPy array trace backend Store sampling values in memory as a NumPy array. """ import numpy as np from ..backends import base class NDArray(base.BaseTrace): """NDArray trace object Parameters ---------- name : str Name of backend. This has no meaning for the NDArray backend. model : ...
apache-2.0
mdrumond/tensorflow
tensorflow/contrib/framework/python/framework/tensor_util.py
4
11042
# Copyright 2015 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
yannrouillard/weboob
modules/citelis/test.py
3
1024
# -*- coding: utf-8 -*- # Copyright(C) 2013 Laurent Bachelier # # This file is part of weboob. # # weboob 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 ...
agpl-3.0
nhippenmeyer/django
django/core/serializers/__init__.py
347
8194
""" Interfaces for serializing Django objects. Usage:: from django.core import serializers json = serializers.serialize("json", some_queryset) objects = list(serializers.deserialize("json", json)) To add your own serializers, use the SERIALIZATION_MODULES setting:: SERIALIZATION_MODULES = { ...
bsd-3-clause
lindsayad/sympy
sympy/physics/vector/tests/test_fieldfunctions.py
115
5638
from sympy import S, Symbol, sin, cos from sympy.physics.vector import ReferenceFrame, Vector, Point, \ dynamicsymbols from sympy.physics.vector.fieldfunctions import divergence, \ gradient, curl, is_conservative, is_solenoidal, \ scalar_potential, scalar_potential_difference from sympy.utilities.pytest ...
bsd-3-clause
oceanobservatories/mi-instrument
mi/dataset/parser/test/test_adcpt_m_wvs.py
5
9381
#!/usr/bin/env python """ @package mi.dataset.parser.test @fid marine-integrations/mi/dataset/parser/test/test_adcpt_mwvs.py @author Ronald Ronquillo @brief Test code for a Adcpt_M_WVS data parser """ from nose.plugins.attrib import attr import os from mi.core.log import get_logger log = get_logger() from mi.core.e...
bsd-2-clause
Xeralux/tensorflow
tensorflow/contrib/distributions/python/ops/statistical_testing.py
1
32457
# Copyright 2018 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
xubenben/scikit-learn
sklearn/manifold/locally_linear.py
206
25061
"""Locally Linear Embedding""" # Author: Fabian Pedregosa -- <fabian.pedregosa@inria.fr> # Jake Vanderplas -- <vanderplas@astro.washington.edu> # License: BSD 3 clause (C) INRIA 2011 import numpy as np from scipy.linalg import eigh, svd, qr, solve from scipy.sparse import eye, csr_matrix from ..base import B...
bsd-3-clause
kdeloach/nyc-trees
src/nyc_trees/apps/home/training/routes.py
3
1471
# -*- coding: utf-8 -*- from __future__ import print_function from __future__ import unicode_literals from __future__ import division from django.contrib.auth.decorators import login_required from django_tinsel.decorators import route, render_template from django_tinsel.utils import decorate as do from apps.users.vie...
agpl-3.0
IKholopov/HackUPC2017
hackupc/env/lib/python3.5/site-packages/django/contrib/gis/db/backends/oracle/models.py
111
2211
""" The GeometryColumns and SpatialRefSys models for the Oracle spatial backend. It should be noted that Oracle Spatial does not have database tables named according to the OGC standard, so the closest analogs are used. For example, the `USER_SDO_GEOM_METADATA` is used for the GeometryColumns model and the `SDO_...
apache-2.0
vbraga/irismatch
src/iris_detection.py
2
1707
#!/usr/bin/env python2.7 # Imported from https://gitorious.org/hough-circular-transform # License: GPLv3 # Date: Fri, Mar 7 2014 import matplotlib.pyplot as plt import matplotlib.patches as plt_patches import houghcirculartransform as hct import numpy as np def detect_iris(filename): """ Example function call...
gpl-2.0
beckastar/django
django/contrib/sites/tests.py
26
3730
from __future__ import unicode_literals from django.conf import settings from django.core.exceptions import ObjectDoesNotExist, ValidationError from django.http import HttpRequest from django.test import TestCase, modify_settings, override_settings from .middleware import CurrentSiteMiddleware from .models import Sit...
bsd-3-clause
Marcello-Sega/pytim
pytim/interface.py
1
27725
# -*- Mode: python; tab-width: 4; indent-tabs-mode:nil; coding: utf-8 -*- # vim: tabstop=4 expandtab shiftwidth=4 softtabstop=4 from abc import ABCMeta, abstractmethod import numpy as np from .properties import _create_property from .writepdb import _writepdb from . import messages from . import utilities from scipy.sp...
gpl-3.0
iNecas/katello
cli/src/katello/client/api/repo.py
1
5198
# -*- coding: utf-8 -*- # # Copyright © 2012 Red Hat, Inc. # # This software is licensed to you under the GNU General Public License, # version 2 (GPLv2). There is NO WARRANTY for this software, express or # implied, including the implied warranties of MERCHANTABILITY or FITNESS # FOR A PARTICULAR PURPOSE. You should h...
gpl-2.0
oritwas/qemu
scripts/tracetool/format/h.py
16
1119
#!/usr/bin/env python # -*- coding: utf-8 -*- """ Generate .h file. """ __author__ = "Lluís Vilanova <vilanova@ac.upc.edu>" __copyright__ = "Copyright 2012, Lluís Vilanova <vilanova@ac.upc.edu>" __license__ = "GPL version 2 or (at your option) any later version" __maintainer__ = "Stefan Hajnoczi" __email__ ...
gpl-2.0
TheMOOCAgency/edx-platform
common/lib/xmodule/xmodule/annotator_token.py
211
1542
""" This file contains a function used to retrieve the token for the annotation backend without having to create a view, but just returning a string instead. It can be called from other files by using the following: from xmodule.annotator_token import retrieve_token """ import datetime from firebase_token_generator im...
agpl-3.0
flh/odoo
addons/email_template/ir_actions.py
281
3520
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2013 OpenERP S.A. <http://www.openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of th...
agpl-3.0
RevelSystems/django
django/contrib/gis/admin/options.py
42
5439
from django.contrib.admin import ModelAdmin from django.contrib.gis.admin.widgets import OpenLayersWidget from django.contrib.gis.db import models from django.contrib.gis.gdal import HAS_GDAL, OGRGeomType class GeoModelAdmin(ModelAdmin): """ The administration options class for Geographic models. Map settings...
bsd-3-clause
cyrillg/ros-playground
src/deedee_driver/tests/test_motors_driver.py
1
2314
#! /usr/bin/env python PKG='deedee_driver' import sys import unittest from mock import Mock from deedee_driver.motors_driver_lib import * class TestMotorsDriver(unittest.TestCase): def setUp(self): robot_name = "test_bot" config = {"max_wheel_speed": 0.55} serial_socket = Mock() ...
mit
jetty-project/FrameworkBenchmarks
toolset/utils/scaffolding.py
6
14436
# -*- coding: utf-8 -*- import os, re from shutil import copytree from toolset.utils.metadata import Metadata class Scaffolding: def __init__(self, benchmarker): print(""" ------------------------------------------------------------------------------- This wizard is intended to help build the scaffold...
bsd-3-clause
rjeschmi/easybuild-framework
easybuild/toolchains/intel-para.py
5
1625
## # Copyright 2012-2015 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (htt...
gpl-2.0
mlorbetske/PTVS
Python/Product/PythonTools/visualstudio_py_util.py
21
23282
# ############################################################################ # # Copyright (c) Microsoft Corporation. # # This source code is subject to terms and conditions of the Apache License, Version 2.0. A # copy of the license can be found in the License.html file at the root of this distribution....
apache-2.0
nvoron23/python-weka-wrapper
python/weka/flow/container.py
2
7909
# 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. # # This program is distributed in the hope that it will be useful, # bu...
gpl-3.0
SrNetoChan/QGIS
python/plugins/processing/preconfigured/DeletePreconfiguredAlgorithmAction.py
45
2284
# -*- coding: utf-8 -*- """ *************************************************************************** DeletePreconfiguredAlgorithmAction.py --------------------- Date : April 2016 Copyright : (C) 2016 by Victor Olaya Email : volayaf at gmail dot com *****...
gpl-2.0
ProfessionalIT/maxigenios-website
sdk/google_appengine/google/appengine/tools/devappserver2/module_test.py
2
101473
#!/usr/bin/env python # # Copyright 2007 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...
mit
fjbatresv/odoo
addons/account/test/test_parent_structure.py
432
2108
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
flyingfish007/tempest
tempest/api/identity/v2/test_api_discovery.py
22
2309
# Copyright 2015 OpenStack Foundation. # Copyright 2015, Red Hat, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
magopian/olympia
apps/editors/tests/test_views.py
3
106266
# -*- coding: utf-8 -*- import json import time import urlparse from datetime import datetime, timedelta from django.conf import settings from django.core import mail from django.core.files import temp from django.core.files.base import File as DjangoFile from django.utils.datastructures import SortedDict from django....
bsd-3-clause
SebastianMerz/calalert
Server/venv/lib/python2.7/site-packages/flup/server/scgi.py
18
7689
# Copyright (c) 2005, 2006 Allan Saddi <allan@saddi.com> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions # are met: # 1. Redistributions of source code must retain the above copyright # notice, this lis...
gpl-2.0
pforret/python-for-android
python-modules/twisted/twisted/internet/test/test_core.py
49
10521
# Copyright (c) 2008-2009 Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for implementations of L{IReactorCore}. """ __metaclass__ = type import signal import time import inspect from twisted.internet.abstract import FileDescriptor from twisted.internet.error import ReactorAlreadyRunning from twi...
apache-2.0
hubsaysnuaa/odoo
addons/account/test/test_parent_structure.py
432
2108
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the...
agpl-3.0
openstack/networking-sfc
networking_sfc/db/migration/alembic_migrations/versions/newton/contract/06382790fb2c_fix_foreign_constraints.py
1
1647
# 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