repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
dproc/trex_odp_porting_integration
scripts/automation/trex_control_plane/client_utils/general_utils.py
2
2206
#!/router/bin/python import sys import site import string import random import os try: import pwd except ImportError: import getpass pwd = None using_python_3 = True if sys.version_info.major == 3 else False def user_input(): if using_python_3: return input() else: # using pytho...
apache-2.0
antotodd/info3180lab4
lib/werkzeug/_compat.py
448
6184
import sys import operator import functools try: import builtins except ImportError: import __builtin__ as builtins PY2 = sys.version_info[0] == 2 _identity = lambda x: x if PY2: unichr = unichr text_type = unicode string_types = (str, unicode) integer_types = (int, long) int_to_byte = c...
apache-2.0
david-ragazzi/nupic
tests/integration/nupic/opf/opf_checkpoint_test/experiments/temporal_multi_step/a/description.py
42
1569
# ---------------------------------------------------------------------- # Copyright (C) 2011 Numenta Inc. All rights reserved. # # The information and source code contained herein is the # exclusive property of Numenta Inc. No part of this software # may be used, reproduced, stored or distributed in any form, # ...
gpl-3.0
yfried/ansible
lib/ansible/modules/cloud/vmware/vcenter_license.py
27
5353
#!/usr/bin/python # Copyright: (c) 2017, Dag Wieers (@dagwieers) <dag@wieers.com> # 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', ...
gpl-3.0
y-asano/primecloud-controller
iaas-gw/src/iaasgw/controller/cloudStack/cloudStackInstanceController.py
5
14487
# coding: UTF-8 # # Copyright 2014 by SCSK Corporation. # # This file is part of PrimeCloud Controller(TM). # # PrimeCloud Controller(TM) 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 versi...
gpl-2.0
rasa/scoops
makeindex.py
1
13169
#!/usr/bin/env python # -*- coding: utf-8 -*- """ @todo add docstring """ # ### imports ### from __future__ import ( absolute_import, division, print_function # , # unicode_literals ) import fnmatch import io import json import re import os # import pprint import subprocess import sys OSIS = [ ...
mit
deepakbane28/nixysa
nixysa/pod_binding.py
9
31775
#!/usr/bin/python2.4 # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
apache-2.0
kittiu/odoo
addons/mrp/wizard/mrp_price.py
381
2132
# -*- 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
tjgillies/distributed-draw
entangled/kademlia/kbucket.py
2
4999
#!/usr/bin/env python # # This library is free software, distributed under the terms of # the GNU Lesser General Public License Version 3, or any later version. # See the COPYING file included in this archive # # The docstrings in this module contain epytext markup; API documentation # may be created by processing this...
lgpl-3.0
mogoweb/chromium-crosswalk
native_client_sdk/src/tools/httpd.py
41
10125
#!/usr/bin/env python # Copyright (c) 2012 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 BaseHTTPServer import imp import logging import multiprocessing import optparse import os import SimpleHTTPServer # pylint:...
bsd-3-clause
jmcreasman/TIY-GitHub
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/MSVSUtil.py
1812
9537
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility functions shared amongst the Windows generators.""" import copy import os # A dictionary mapping supported target types to extensions. TARGET_TYPE_EX...
cc0-1.0
TeamExodus/external_chromium_org
tools/telemetry/telemetry/util/path.py
45
1284
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import os from telemetry.core import util # TODO(dtu): Move these functions from core.util to here. GetBaseDir = util.GetBaseDir GetTelemetryDir = util.Ge...
bsd-3-clause
kzampog/sisyphus
docs/conf.py
2
4917
# -*- coding: utf-8 -*- # # Configuration file for the Sphinx documentation builder. # # This file does only contain a selection of the most common options. For a # full list see the documentation: # http://www.sphinx-doc.org/en/master/config # -- Path setup ------------------------------------------------------------...
mit
ikoula/cloudstack
plugins/hypervisors/ovm/scripts/vm/hypervisor/ovm/OvmVmModule.py
8
22802
# 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...
gpl-2.0
tayebzaidi/PPLL_Spr_16
finalPractica/2_2_ciclos_mejor.py
1
4345
from mrjob.job import MRJob from mrjob.step import MRStep import string import sys class MRGrados(MRJob): SORT_VALUES = True def mapper(self, _, line): line_stripped = line.translate(string.maketrans("",""), '"') line_split = line_stripped.split(',') #split by the comma sorted...
gpl-3.0
rbdavid/DNA_stacking_analysis
angles_binary.py
1
9052
#!/Library/Frameworks/Python.framework/Versions/2.7/bin/python # USAGE: # PREAMBLE: import numpy as np import MDAnalysis import sys import os import matplotlib.pyplot as plt traj_file ='%s' %(sys.argv[1]) # ---------------------------------------- # VARIABLE DECLARATION base1 = 1 nbases = 15 #nbases = 3 #Nsteps ...
mit
TribeMedia/sky_engine
testing/scripts/get_compile_targets.py
76
1285
#!/usr/bin/env python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import argparse import json import os import sys import common def main(argv): parser = argparse.ArgumentParser() parser.add_arg...
bsd-3-clause
JeffAMcGee/friendloc
friendloc/explore/sprawl.py
1
13724
#!/usr/bin/env python import numpy import random import logging import itertools import collections from friendloc.base import gob from friendloc.base.models import Edges, User, Tweets from friendloc.base import gisgraphy, twitter, utils NEBR_KEYS = ['rfriends','just_followers','just_friends','just_mentioned'] @go...
bsd-2-clause
runiq/modeling-clustering
find-correct-cluster-number/plot_clustering_metrics.py
1
10092
#!/usr/bin/env python2 # -*- coding: utf-8 -*- """ Performs a clustering run with a number of clusters and a given mask, and creates graphs of the corresponding DBI, pSF, SSR/SST, and RMSD values. These faciliate the choice of cluster numbers and improve the clustering process by allowing to pick the number of cluste...
bsd-2-clause
trishnaguha/ansible
lib/ansible/modules/cloud/openstack/os_ironic_node.py
41
12663
#!/usr/bin/python # coding: utf-8 -*- # (c) 2015, Hewlett-Packard Development Company, L.P. # 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'...
gpl-3.0
PaulEnglert/ML
deep_architectures/deep_belief_network.py
1
2528
# -*- coding: utf-8 -*- from neural_networks.boltzmann_machines.generative_rbm import GenRBM from neural_networks.perceptrons.mlp import MLP from utilities.data_utils import make_batches class DBN(): ''' Deep belief network aka stacked boltzmann machines''' def __init__(self, layer_definitions): se...
bsd-2-clause
ApolloAuto/apollo
modules/tools/mobileye_viewer/planning_data.py
3
2223
#!/usr/bin/env python3 ############################################################################### # Copyright 2017 The Apollo 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...
apache-2.0
suncycheng/intellij-community
python/lib/Lib/site-packages/django/contrib/admin/widgets.py
73
11754
""" Form Widget classes specific to the Django admin site. """ import django.utils.copycompat as copy from django import forms from django.forms.widgets import RadioFieldRenderer from django.forms.util import flatatt from django.utils.html import escape from django.utils.text import truncate_words from django.utils.t...
apache-2.0
raywill/crawl_smth
rent_crawl.py
1
3770
#!/usr/bin/python # coding:utf-8 from bs4 import BeautifulSoup import re import os import sys import urllib import time import random import time #################### 配置开始################# # 版面配置 # 支持爬多个版面,取消下面的注释即可 # 二手房 # board = 'OurHouse' # 二手市场主版 # board = 'SecondMarket' # 租房 boards = ['OurEstate', 'PolicyEst...
mit
cobalys/django
django/contrib/localflavor/es/es_provinces.py
110
1482
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ PROVINCE_CHOICES = ( ('01', _('Araba')), ('02', _('Albacete')), ('03', _('Alacant')), ('04', _('Almeria')), ('05', _('Avila')), ('06', _('Badajoz')), ('07', _('Illes Balears')), ('08', _('Barcelona')), (...
bsd-3-clause
openaire/iis
iis-3rdparty-madis/src/main/resources/eu/dnetlib/iis/3rdparty/scripts/madis/lib/dateutil/easter.py
291
2633
""" Copyright (c) 2003-2007 Gustavo Niemeyer <gustavo@niemeyer.net> This module offers extensions to the standard python 2.3+ datetime module. """ __author__ = "Gustavo Niemeyer <gustavo@niemeyer.net>" __license__ = "PSF License" import datetime __all__ = ["easter", "EASTER_JULIAN", "EASTER_ORTHODOX", "EASTER_WESTE...
apache-2.0
svn2github/vbox
src/VBox/HostServices/SharedOpenGL/crserverlib/server_dispatch.py
12
4596
# Copyright (c) 2001, Stanford University # All rights reserved. # # See the file LICENSE.txt for information on redistributing this software. import sys, string, re import apiutil apiutil.CopyrightC() print """ /* DO NOT EDIT - THIS FILE AUTOMATICALLY GENERATED BY server_dispatch.py SCRIPT */ #include "cr_spu.h"...
gpl-2.0
geoffkilpin/pombola
pombola/feedback/forms.py
4
1293
import time import datetime from django import forms from django.forms.util import ErrorDict from django.conf import settings from django.contrib.contenttypes.models import ContentType from django.utils.crypto import salted_hmac, constant_time_compare from django.utils.encoding import force_unicode from django.utils.t...
agpl-3.0
heplesser/nest-simulator
pynest/nest/tests/test_connect_arrays.py
12
13340
# -*- coding: utf-8 -*- # # test_connect_arrays.py # # This file is part of NEST. # # Copyright (C) 2004 The NEST Initiative # # NEST is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 2 of the Lic...
gpl-2.0
malkavi/lutris
lutris/runners/o2em.py
1
3325
# -*- coding: utf-8 -*- import os from lutris import settings from lutris.runners.runner import Runner class o2em(Runner): """Magnavox Oyssey² Emulator""" human_name = "O2EM" package = "o2em" executable = "o2em" platform = "Magnavox Odyssey 2, Phillips Videopac+" tarballs = { 'i386': ...
gpl-3.0
davidharrigan/django
tests/template_tests/syntax_tests/test_with.py
391
2245
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class WithTagTests(SimpleTestCase): @setup({'with01': '{% with key=dict.key %}{{ key }}{% endwith %}'}) def test_with01(self): output = self.engine.render_to_string('with01', {'dict': {'k...
bsd-3-clause
mbodenhamer/syn
syn/type/a/tests/test_type.py
1
9511
import six from syn.five import xrange from nose.tools import assert_raises from syn.type.a import (Type, ValuesType, MultiType, TypeType, AnyType, TypeExtension, Set, Schema) from syn.base_utils import is_hashable, feq from syn.base_utils import ngzwarn, on_error, elog from syn.globals import ...
mit
dermoth/gramps
data/man/pt_BR/conf.py
12
7714
# -*- coding: utf-8 -*- # # Gramps documentation build configuration file, created by # sphinx-quickstart on Sat Dec 1 14:38:29 2012. # # 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 # autogenerated file. # # All ...
gpl-2.0
belmiromoreira/nova
nova/image/download/__init__.py
61
1636
# Copyright 2013 Red Hat, 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...
apache-2.0
benthomasson/cumulus-linux-ansible-modules
tests/test_cl_license.py
6
2493
import mock from mock import MagicMock from nose.tools import set_trace from library import cl_license from asserts import assert_equals from datetime import date, datetime def mod_args_generator(values, *args): def mod_args(args): return values[args] return mod_args @mock.patch('library.cl_license.A...
gpl-3.0
popazerty/gui-test
lib/python/Components/Renderer/DMCHDMaxTemp.py
11
2083
# -*- coding: utf-8 -*- # # Maximum Temperature Renderer for Dreambox/Enigma-2 # Coded by Vali (c)2010 # Support: www.dreambox-tools.info # # # This plugin is licensed under the Creative Commons # Attribution-NonCommercial-ShareAlike 3.0 Unported License. # To view a copy of this license, visit http://crea...
gpl-2.0
openstack/sqlalchemy-migrate
migrate/changeset/constraint.py
140
7318
""" This module defines standalone schema constraint classes. """ from sqlalchemy import schema from migrate.exceptions import * class ConstraintChangeset(object): """Base class for Constraint classes.""" def _normalize_columns(self, cols, table_name=False): """Given: column objects or names; retu...
mit
benoitsteiner/tensorflow-opencl
tensorflow/contrib/learn/python/learn/utils/export.py
48
13721
# Copyright 2016 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
caseyrollins/osf.io
addons/base/generic_views.py
9
4519
"""Generic add-on view factories""" # -*- coding: utf-8 -*- import httplib as http from flask import request from framework.exceptions import HTTPError, PermissionsError from framework.auth.decorators import must_be_logged_in from osf.models import ExternalAccount from osf.utils import permissions from website.proj...
apache-2.0
nemesisdesign/django
django/contrib/sessions/backends/base.py
27
12374
from __future__ import unicode_literals import base64 import logging import string from datetime import datetime, timedelta from django.conf import settings from django.contrib.sessions.exceptions import SuspiciousSession from django.core.exceptions import SuspiciousOperation from django.utils import timezone from dj...
bsd-3-clause
SebasSBM/django
django/template/smartif.py
275
6643
""" Parser and utilities for the smart 'if' tag """ import warnings from django.utils.deprecation import RemovedInDjango110Warning # Using a simple top down parser, as described here: # http://effbot.org/zone/simple-top-down-parsing.htm. # 'led' = left denotation # 'nud' = null denotation # 'bp' = binding power (...
bsd-3-clause
deepsrd/android_kernel_nx507j
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
Benoss/elastic_admin
elastic_utils/utils.py
1
1080
import time def singleton(cls): instances = {} def getinstance(): if cls not in instances: instances[cls] = cls() return instances[cls] return getinstance class Timer(object): def __init__(self, name='elapsed time', logger=None, print_result=False): self.verbose =...
mit
quantum13/hgh
hgh/urls.py
1
1675
# coding: utf-8 from django.conf.urls import patterns, include, url # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', # Examples: # url(r'^$', 'hgh.views.home', name='home'), # url(r'^hgh/', include('hgh.foo.u...
gpl-2.0
SophieBartmann/Faust-Bot
FaustBot/Modules/CustomUserModules/ICDObserver.py
1
1273
import csv import re from FaustBot.Communication.Connection import Connection from FaustBot.Modules.PrivMsgObserverPrototype import PrivMsgObserverPrototype class ICDObserver(PrivMsgObserverPrototype): @staticmethod def cmd(): return None @staticmethod def help(): return None de...
gpl-3.0
F1000Research/khmer
sandbox/count-kmers-single.py
1
3273
#! /usr/bin/env python2 # # This file is part of khmer, http://github.com/ged-lab/khmer/, and is # Copyright (C) University of California, Davis, 2015. It is licensed under # the three-clause BSD license; see doc/LICENSE.txt. # Contact: khmer-project@idyll.org # # pylint: disable=missing-docstring,invalid-name """ Prod...
bsd-3-clause
Ken69267/config-stuff
.vim/eclim/autoload/eclim/python/rope/refactor/occurrences.py
91
10704
import re import rope.base.pynames from rope.base import pynames, pyobjects, codeanalyze, evaluate, exceptions, utils, worder class Finder(object): """For finding occurrences of a name The constructor takes a `filters` argument. It should be a list of functions that take a single argument. For each po...
mit
Pexego/odoo
addons/hw_scanner/controllers/main.py
51
7441
# -*- coding: utf-8 -*- import logging import os import time from os import listdir from os.path import join from threading import Thread, Lock from select import select from Queue import Queue, Empty import openerp import openerp.addons.hw_proxy.controllers.main as hw_proxy from openerp import http from openerp.http ...
agpl-3.0
Hodorable/0602
openstack_dashboard/dashboards/project/databases/tables.py
30
13199
# Copyright 2012 Nebula, 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 agree...
apache-2.0
louyihua/edx-platform
lms/djangoapps/branding/models.py
63
1687
""" Model used by Video module for Branding configuration. Includes: BrandingInfoConfig: A ConfigurationModel for managing how Video Module will use Branding. """ import json from django.db.models import TextField from django.core.exceptions import ValidationError from config_models.models import Configura...
agpl-3.0
MRigal/django
tests/queryset_pickle/tests.py
209
6081
from __future__ import unicode_literals import datetime import pickle import unittest import warnings from django.test import TestCase from django.utils import six from django.utils.encoding import force_text from django.utils.version import get_version from .models import Container, Event, Group, Happening, M2MMode...
bsd-3-clause
marcusramberg/dotfiles
bin/.venv-ansible-venv/lib/python2.6/site-packages/ansible/modules/extras/system/at.py
28
6404
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2014, Richard Isaacson <richard.c.isaacson@gmail.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 versi...
mit
gorakhargosh/mom
mom/os/path.py
1
5970
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2011 Yesudeep Mangalapilly <yesudeep@gmail.com> # Copyright 2012 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 ...
apache-2.0
UnicornButter/external_chromium
chrome/common/extensions/docs/server/chromeextensionsdocs.py
64
15204
#!/usr/bin/python # Copyright (c) 2010 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 cgi import logging import re import os from google.appengine.ext import webapp from google.appengine.ext.webapp.util import run...
bsd-3-clause
dhuppenkothen/stingray
stingray/conftest.py
31
1240
# this contains imports plugins that configure py.test for astropy tests. # by importing them here in conftest.py they are discoverable by py.test # no matter how it is invoked within the source tree. from astropy.tests.pytest_plugins import * ## Uncomment the following line to treat all DeprecationWarnings as ## exc...
mit
dongjoon-hyun/DIGITS
digits/scheduler.py
3
19330
# Copyright (c) 2014-2016, NVIDIA CORPORATION. All rights reserved. from __future__ import absolute_import from collections import OrderedDict import os import re import shutil import signal import time import traceback import flask import gevent import gevent.event import gevent.queue from . import utils from .con...
bsd-3-clause
dreadsci/forget-me-not
test_structures.py
2
13775
import unittest from datasets import * class TestSimplest(Structure): _fields = [Parsable('base', required=True, positional=True, keyword=False), Parsable('myParam', required=True, positional=False, keyword=True)] def test_simplest(): t = TestSimplest(base='a', myParam='b') assert t.get_di...
unlicense
40223143/2015_0505
static/Brython3.1.1-20150328-091302/Lib/ui/slider.py
603
2394
from . import widget from browser import doc,html class Slider(widget.Widget): def __init__(self, id=None, label=False): self._div_shell=html.DIV(Class="ui-slider ui-slider-horizontal ui-widget ui-widget-content ui-corner-all") widget.Widget.__init__(self, self._div_shell, 'slider', id) self._h...
agpl-3.0
reversefold/mysql-connector-python
lib/mysql/connector/catch23.py
26
3574
# MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. There are special exceptions to ...
gpl-2.0
Shekharrajak/password-alert
server/admin.py
5
3396
# 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
samthetechie/pyFolia
venv/lib/python2.7/site-packages/distribute-0.6.24-py2.7.egg/setuptools/command/bdist_rpm.py
470
2025
# This is just a kludge so that bdist_rpm doesn't guess wrong about the # distribution name and version, if the egg_info command is going to alter # them, another kludge to allow you to build old-style non-egg RPMs, and # finally, a kludge to track .rpm files for uploading when run on Python <2.5. from distutils.comma...
gpl-3.0
fengjiang96/tushare
tushare/stock/cons.py
10
8788
# -*- coding:utf-8 -*- """ Created on 2014/07/31 @author: Jimmy Liu @group : waditu @contact: jimmysoa@sina.cn """ VERSION = '0.3.6' K_LABELS = ['D', 'W', 'M'] K_MIN_LABELS = ['5', '15', '30', '60'] K_TYPE = {'D': 'akdaily', 'W': 'akweekly', 'M': 'akmonthly'} INDEX_LABELS = ['sh', 'sz', 'hs300', 'sz50', 'c...
bsd-3-clause
f3r/scikit-learn
benchmarks/bench_plot_randomized_svd.py
38
17557
""" Benchmarks on the power iterations phase in randomized SVD. We test on various synthetic and real datasets the effect of increasing the number of power iterations in terms of quality of approximation and running time. A number greater than 0 should help with noisy matrices, which are characterized by a slow spectr...
bsd-3-clause
Serag8/Bachelor
google_appengine/google/appengine/ext/ndb/django_middleware.py
20
2158
#!/usr/bin/env python # # 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, softwar...
mit
achang97/YouTunes
lib/python2.7/site-packages/youtube_dl/extractor/ard.py
8
12072
# coding: utf-8 from __future__ import unicode_literals import re from .common import InfoExtractor from .generic import GenericIE from ..utils import ( determine_ext, ExtractorError, qualities, int_or_none, parse_duration, unified_strdate, xpath_text, update_url_query, ) from ..compat...
mit
mwv/scikit-learn
sklearn/preprocessing/_function_transformer.py
163
2407
from ..base import BaseEstimator, TransformerMixin from ..utils import check_array def _identity(X): """The identity function. """ return X class FunctionTransformer(BaseEstimator, TransformerMixin): """Constructs a transformer from an arbitrary callable. A FunctionTransformer forwards its X (a...
bsd-3-clause
jtyr/ansible-modules-core
utilities/logic/pause.py
10
2331
# -*- mode: 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 distr...
gpl-3.0
guerrerocarlos/odoo
addons/subscription/__openerp__.py
261
1885
# -*- 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
tenaciousjzh/titan-solr-cloud-test
zookeeper-3.3.5/contrib/zkpython/src/python/zk.py
61
2528
# 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 ...
apache-2.0
pidydx/grr
grr/lib/aff4_objects/reports_test.py
2
1849
#!/usr/bin/env python """Reporting tests.""" from grr.lib import aff4 from grr.lib import flags from grr.lib import test_lib from grr.lib.aff4_objects import reports from grr.lib.rdfvalues import client as rdf_client class ReportsTest(test_lib.AFF4ObjectTest): """Test the timeline implementation.""" def testCli...
apache-2.0
ptoraskar/django
tests/template_tests/syntax_tests/test_invalid_string.py
440
2310
from django.test import SimpleTestCase from ..utils import setup class InvalidStringTests(SimpleTestCase): libraries = {'i18n': 'django.templatetags.i18n'} @setup({'invalidstr01': '{{ var|default:"Foo" }}'}) def test_invalidstr01(self): output = self.engine.render_to_string('invalidstr01') ...
bsd-3-clause
phlax/pootle
pootle/apps/pootle_translationproject/migrations/0006_relink_or_drop_orphan_translationprojects.py
7
1197
# -*- coding: utf-8 -*- # Generated by Django 1.9.11 on 2016-11-08 21:27 from __future__ import unicode_literals from django.db import migrations def relink_or_drop_orphan_translationprojects(apps, schema_editor): """Relink or drop TPs with no project.""" Project = apps.get_model("pootle_project.Project") ...
gpl-3.0
sertac/django
django/contrib/gis/gdal/__init__.py
327
2635
""" This module houses ctypes interfaces for GDAL objects. The following GDAL objects are supported: CoordTransform: Used for coordinate transformations from one spatial reference system to another. Driver: Wraps an OGR data source driver. DataSource: Wrapper for the OGR data source object, supports OGR-su...
bsd-3-clause
shakilkanji/rmc
data/processor.py
3
23484
import rmc.shared.constants as c import rmc.shared.util as rmc_util import rmc.models as m import argparse from datetime import datetime import dateutil.parser import glob import json import mongoengine as me import os import time import re import sys def import_departments(): def clean_opendata_department(depar...
mit
bdrung/audacity
lib-src/lv2/lv2/plugins/eg-metro.lv2/waflib/Tools/d.py
278
2076
#! /usr/bin/env python # encoding: utf-8 # WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file from waflib import Utils,Task,Errors from waflib.TaskGen import taskgen_method,feature,extension from waflib.Tools import d_scan,d_config from waflib.Tools.ccroot import link_...
gpl-2.0
frankbp/robotframework-selenium2library
test/run_tests.py
42
3301
#!/usr/bin/env python import env import os import sys from subprocess import Popen, call from tempfile import TemporaryFile from run_unit_tests import run_unit_tests ROBOT_ARGS = [ '--doc', 'SeleniumSPacceptanceSPtestsSPwithSP%(browser)s', '--outputdir', '%(outdir)s', '--variable', 'browser:%(browser)s',...
apache-2.0
DataMarket/multilingual
multilingual/query.py
1
28615
""" Django-multilingual: a QuerySet subclass for models with translatable fields. This file contains the implementation for QSRF Django. """ import datetime from django.core.exceptions import FieldError from django.db import connection from django.db.models.fields import FieldDoesNotExist from django.db.models.query...
mit
scifiswapnil/Project-LoCatr
lib/python2.7/site-packages/django/db/models/base.py
16
75879
from __future__ import unicode_literals import copy import inspect import warnings from itertools import chain from django.apps import apps from django.conf import settings from django.core import checks from django.core.exceptions import ( NON_FIELD_ERRORS, FieldDoesNotExist, FieldError, MultipleObjectsReturned,...
mit
SgfPythonDevs/tchristell-raspi
scripts/Gmail.py
2
4325
#!/user/bin/env python # Gmail.py # Checks for new mail using IMAPclient and gmail account # Uses callback to react to push button to send text message from imapclient import IMAPClient import time import RPi.GPIO as GPIO # Flag to enable debugging statements DEBUG = True # Used for IMAP mail retrieval HOSTNAME = '...
mit
skarphed/skarphed
admin/src/skarphedadmin/gui/YesNoPage.py
1
2349
#!/usr/bin/python #-*- coding: utf-8 -*- ########################################################### # © 2011 Daniel 'grindhold' Brendle and Team # # This file is part of Skarphed. # # Skarphed is free software: you can redistribute it and/or # modify it under the terms of the GNU Affero General Public License # as ...
agpl-3.0
mcflugen/dakota-experiments
dakota_utils/models/tests/test_hydrotrend.py
2
4020
#!/usr/bin/env python # # Tests for dakota_utils.models.hydrotrend. # # Call with: # $ nosetests -sv # # Mark Piper (mark.piper@colorado.edu) from nose.tools import * import os import tempfile import shutil from dakota_utils.models.hydrotrend import HydroTrend def setup_module(): print('HydroTrend tests:') ...
mit
jakevdp/megaman
megaman/embedding/tests/test_embeddings.py
4
1798
"""General tests for embeddings""" # LICENSE: Simplified BSD https://github.com/mmp2/megaman/blob/master/LICENSE from itertools import product import numpy as np from numpy.testing import assert_raises, assert_allclose from megaman.embedding import (Isomap, LocallyLinearEmbedding, LTS...
bsd-2-clause
m0ppers/arangodb
3rdParty/boost/1.61.0/tools/build/src/build_system.py
11
33823
# Status: mostly ported. Missing is --out-xml support, 'configure' integration # and some FIXME. # Base revision: 64351 # Copyright 2003, 2005 Dave Abrahams # Copyright 2006 Rene Rivera # Copyright 2003, 2004, 2005, 2006, 2007 Vladimir Prus # Distributed under the Boost Software License, Version 1.0. # (See accompanyi...
apache-2.0
kc4271/batch_downloader
requests/packages/chardet/chardistribution.py
2755
9226
######################## 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...
mit
cryptickp/heat
heat/engine/resources/openstack/glance/glance_image.py
4
4527
# # 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 # ...
apache-2.0
mogoweb/webkit_for_android5.1
webkit/Tools/Scripts/webkitpy/common/system/stack_utils.py
215
2734
# Copyright (C) 2011 Google 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 and the ...
apache-2.0
arbrandes/edx-platform
openedx/core/djangoapps/content_libraries/tests/test_content_libraries.py
3
41306
""" Tests for Blockstore-based Content Libraries """ from uuid import UUID from unittest.mock import patch import ddt from django.conf import settings from django.contrib.auth.models import Group from django.test.client import Client from django.test.utils import override_settings from organizations.models import Orga...
agpl-3.0
litlpoet/rl-library
system/common/libs/mwclient/simplejson/decoder.py
4
9113
""" Implementation of JSONDecoder """ import re from simplejson.scanner import Scanner, pattern FLAGS = re.VERBOSE | re.MULTILINE | re.DOTALL def _floatconstants(): import struct import sys _BYTES = '7FF80000000000007FF0000000000000'.decode('hex') if sys.byteorder != 'big': _BYT...
apache-2.0
pgmillon/ansible
lib/ansible/modules/cloud/amazon/aws_waf_rule.py
16
13360
#!/usr/bin/python # Copyright (c) 2017 Will Thames # Copyright (c) 2015 Mike Mochan # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DO...
gpl-3.0
hanicker/odoo
addons/crm/sales_team.py
321
5053
# -*- coding: utf-8 -*- import calendar from datetime import date from dateutil import relativedelta import json from openerp import tools from openerp.osv import fields, osv class crm_case_section(osv.Model): _inherit = 'crm.case.section' _inherits = {'mail.alias': 'alias_id'} def _get_opportunities_d...
agpl-3.0
Hubert51/AutoGrading
learning/web_Haotian/venv/Lib/site-packages/werkzeug/wsgi.py
17
49347
# -*- coding: utf-8 -*- """ werkzeug.wsgi ~~~~~~~~~~~~~ This module implements WSGI related helpers. :copyright: (c) 2014 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import io try: import httplib except ImportError: from http import ...
mit
CVML/pycortex
cortex/dataset/braindata.py
2
14173
import hashlib import numpy as np import h5py from ..database import db class BrainData(object): def __init__(self, data, subject, **kwargs): if isinstance(data, str): import nibabel nib = nibabel.load(data) data = nib.get_data().T self._data = data try:...
bsd-2-clause
lifeisstillgood/kashflo
setup.py
1
1202
#!/usr/bin/env python #! -*- coding: utf-8 -*- ### # Copyright (c) Paul Brian 2013 # This software is subject to # the provisions of the GNU Affero General # Public License version 3 (AGPLv3). # See LICENCE.txt for details. ### """ setup for HomeSpendWatch """ from setuptools import setup, find_packages import os...
agpl-3.0
projectcalico/calico-nova
nova/api/openstack/compute/plugins/v3/image_size.py
24
2270
# Copyright 2013 Rackspace Hosting # 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 require...
apache-2.0
OpenWinCon/OpenWinNet
web-gui/myvenv/lib/python3.4/site-packages/django/core/exceptions.py
486
5276
""" Global Django exception and warning classes. """ from django.utils import six from django.utils.encoding import force_text class FieldDoesNotExist(Exception): """The requested model field does not exist""" pass class DjangoRuntimeWarning(RuntimeWarning): pass class AppRegistryNotReady(Exception): ...
apache-2.0
abhattad4/Digi-Menu
digimenu2/django/contrib/admin/sites.py
77
22052
from functools import update_wrapper from django.apps import apps from django.conf import settings from django.contrib.admin import ModelAdmin, actions from django.contrib.auth import REDIRECT_FIELD_NAME from django.core.exceptions import ImproperlyConfigured, PermissionDenied from django.core.urlresolvers import NoRe...
bsd-3-clause
kissbac/upm
examples/python/vcap.py
2
2281
#!/usr/bin/python # Author: Jon Trulson <jtrulson@ics.com> # Copyright (c) 2016 Intel Corporation. # # 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 l...
mit
SevInf/IEDriver
py/selenium/webdriver/phantomjs/service.py
14
3533
#!/usr/bin/python # # Copyright 2012 Software Freedom Conservancy # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by app...
apache-2.0
privacyidea/privacyidea
tests/test_lib_usercache.py
1
26733
# coding: utf-8 """ This test file tests the lib.usercache The lib.usercache.py only depends on the database model """ from contextlib import contextmanager from mock import patch from privacyidea.lib.error import UserError from tests import ldap3mock from tests.test_mock_ldap3 import LDAPDirectory from .base import...
agpl-3.0
eino-makitalo/odoo
addons/hr_payroll_account/wizard/__init__.py
433
1116
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). All Rights Reserved # d$ # # This program is free software: you can redistribute it and/or modify # ...
agpl-3.0