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
smartboyhw/ubuntu-saucy-rt
scripts/tracing/draw_functrace.py
14676
3560
#!/usr/bin/python """ Copyright 2008 (c) Frederic Weisbecker <fweisbec@gmail.com> Licensed under the terms of the GNU GPL License version 2 This script parses a trace provided by the function tracer in kernel/trace/trace_functions.c The resulted trace is processed into a tree to produce a more human view of the call ...
gpl-2.0
Jeff-Tian/mybnb
Python27/Tools/Scripts/diff.py
2
2074
#!/usr/bin/env python """ Command line interface to difflib.py providing diffs in four formats: * ndiff: lists every line and highlights interline changes. * context: highlights clusters of changes in a before/after format. * unified: highlights clusters of changes in an inline format. * html: generates...
apache-2.0
Denisolt/Tensorflow_Chat_Bot
local/lib/python2.7/site-packages/numpy/_globals.py
63
1851
""" Module defining global singleton classes. This module raises a RuntimeError if an attempt to reload it is made. In that way the identities of the classes defined here are fixed and will remain so even if numpy itself is reloaded. In particular, a function like the following will still work correctly after numpy is...
gpl-3.0
Azure/azure-quickstart-templates
application-workloads/cloudera/cloudera-director-on-centos/scripts/marketing.py
103
3151
#! /usr/bin/env python # Copyright (c) 2016 Cloudera, 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 la...
mit
lmregus/Portfolio
python/design_patterns/env/lib/python3.7/site-packages/backcall/backcall.py
4
3752
# -*- coding: utf-8 -*- """ Created on Mon Jan 13 18:17:15 2014 @author: takluyver """ import sys PY3 = (sys.version_info[0] >= 3) try: from inspect import signature, Parameter # Python >= 3.3 except ImportError: from ._signatures import signature, Parameter if PY3: from functools import wraps else: ...
mit
umraniyeacil/umraniyeacil.github.io
node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/xcodeproj_file.py
1366
120842
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Xcode project file generator. This module is both an Xcode project file generator and a documentation of the Xcode project file format. Knowledge of the proje...
mit
kbr/fritzconnection
fritzconnection/cli/fritzhosts.py
1
1157
""" fritzhosts.py Module to inspect the FritzBox API for registered hosts. CLI interface. This module is part of the FritzConnection package. https://github.com/kbr/fritzconnection License: MIT (https://opensource.org/licenses/MIT) Author: Klaus Bremer """ from ..lib.fritzhosts import FritzHosts from . utils import ...
mit
vikatory/kbengine
kbe/res/scripts/common/Lib/concurrent/futures/_base.py
88
19638
# Copyright 2009 Brian Quinlan. All Rights Reserved. # Licensed to PSF under a Contributor Agreement. __author__ = 'Brian Quinlan (brian@sweetapp.com)' import collections import logging import threading import time FIRST_COMPLETED = 'FIRST_COMPLETED' FIRST_EXCEPTION = 'FIRST_EXCEPTION' ALL_COMPLETED = 'ALL_COMPLETED...
lgpl-3.0
walterreade/scikit-learn
sklearn/neighbors/tests/test_kde.py
80
5560
import numpy as np from sklearn.utils.testing import (assert_allclose, assert_raises, assert_equal) from sklearn.neighbors import KernelDensity, KDTree, NearestNeighbors from sklearn.neighbors.ball_tree import kernel_norm from sklearn.pipeline import make_pipeline from sklearn.dataset...
bsd-3-clause
bkimmig/clumpy
clumpy/functions_em.py
1
6506
import numpy as np from .py3 import * # Monotonic non increasing function def pav(y): """ PAV uses the pair adjacent violators method to produce a monotonic smoothing of y translated from matlab by Sean Collins (2006) as part of the EMAP toolbox Parameters ---------- y: list Returns ...
mit
twitter/pants
tests/python/pants_test/init/repro_mixin.py
1
1600
# coding=utf-8 # Copyright 2015 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import absolute_import, division, print_function, unicode_literals import os from builtins import object, open from pants.util.dirutil import safe_mkdir_fo...
apache-2.0
NetApp/cinder
cinder/volume/drivers/windows/windows.py
6
12570
# Copyright 2012 Pedro Navarro Perez # 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 requi...
apache-2.0
rfdougherty/dipy
dipy/io/dpy.py
11
4636
''' A class for handling large tractography datasets. It is built using the pytables tools which in turn implement key features of the HDF5 (hierachical data format) API [1]_. References ---------- .. [1] http://www.hdfgroup.org/HDF5/doc/H5.intro.html ''' import numpy as np # Conditional import...
bsd-3-clause
edx/edx-platform
common/djangoapps/track/management/tracked_command.py
3
2220
"""Provides management command calling info to tracking context.""" from django.core.management.base import BaseCommand from eventtracking import tracker class TrackedCommand(BaseCommand): # lint-amnesty, pylint: disable=abstract-method """ Provides management command calling info to tracking context. ...
agpl-3.0
dmlc/mxnet
python/mxnet/gluon/model_zoo/vision/resnet.py
5
19976
# Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not u...
apache-2.0
neumerance/cloudloon2
.venv/lib/python2.7/site-packages/django/contrib/staticfiles/management/commands/runserver.py
243
1343
from optparse import make_option from django.conf import settings from django.core.management.commands.runserver import Command as RunserverCommand from django.contrib.staticfiles.handlers import StaticFilesHandler class Command(RunserverCommand): option_list = RunserverCommand.option_list + ( make_optio...
apache-2.0
Alwnikrotikz/cortex-vfx
test/IECore/ImageCompositeOpTest.py
12
3848
########################################################################## # # Copyright (c) 2008-2009, Image Engine Design Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redis...
bsd-3-clause
avneesh91/django
django/contrib/gis/feeds.py
62
5733
from django.contrib.syndication.views import Feed as BaseFeed from django.utils.feedgenerator import Atom1Feed, Rss201rev2Feed class GeoFeedMixin: """ This mixin provides the necessary routines for SyndicationFeed subclasses to produce simple GeoRSS or W3C Geo elements. """ def georss_coords(self...
bsd-3-clause
zouyapeng/horizon_change
openstack_dashboard/dashboards/project/data_processing/clusters/views.py
17
3693
# 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...
apache-2.0
wskplho/sl4a
python/src/Lib/test/test_cfgparser.py
48
18620
import ConfigParser import StringIO import unittest import UserDict from test import test_support class SortedDict(UserDict.UserDict): def items(self): result = self.data.items() result.sort() return result def keys(self): result = self.data.keys() result.sort() ...
apache-2.0
brython-dev/brython
www/src/Lib/_sysconfigdata.py
731
18167
build_time_vars={'HAVE_SYS_WAIT_H': 1, 'HAVE_UTIL_H': 0, 'HAVE_SYMLINKAT': 1, 'HAVE_LIBSENDFILE': 0, 'SRCDIRS': 'Parser Grammar Objects Python Modules Mac', 'SIZEOF_OFF_T': 8, 'BASECFLAGS': '-Wno-unused-result', 'HAVE_UTIME_H': 1, 'EXTRAMACHDEPPATH': '', 'HAVE_SYS_TIME_H': 1, 'CFLAGSFORSHARED': '-fPIC', 'HAVE_HYPOT': 1...
bsd-3-clause
chenc10/Spark-PAF
dist/ec2/lib/boto-2.34.0/boto/vpc/vpc.py
34
3200
# Copyright (c) 2009-2010 Mitch Garnaat http://garnaat.org/ # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without limitation the rights to use, copy, modi...
apache-2.0
ykaneko/quantum
quantum/db/routedserviceinsertion_db.py
5
3637
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2013 VMware, 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/li...
apache-2.0
vdrey/Toolbox
Python/GHP/Source/my_ioctl_fuzzer.py
3
2856
import pickle import sys import random from ctypes import * kernel32 = windll.kernel32 # Defines for Win32 API Calls GENERIC_READ = 0x80000000 GENERIC_WRITE = 0x40000000 OPEN_EXISTING = 0x3 # Open the pickle and retrieve the dictionary fd = open(sys.argv[1], "rb") master_list = pickle.load(fd) ioct...
mit
Shaswat27/sympy
sympy/physics/quantum/state.py
58
29186
"""Dirac notation for states.""" from __future__ import print_function, division from sympy import (cacheit, conjugate, Expr, Function, integrate, oo, sqrt, Tuple) from sympy.core.compatibility import u, range from sympy.printing.pretty.stringpict import stringPict from sympy.physics.quantum.qexpr ...
bsd-3-clause
gawel/irc3
irc3/plugins/feeds.py
1
8429
# -*- coding: utf-8 -*- import os import time import irc3 import datetime from irc3.compat import asyncio from concurrent.futures import ThreadPoolExecutor from operator import itemgetter __doc__ = ''' ========================================== :mod:`irc3.plugins.feeds` Feeds plugin ====================================...
mit
tortxof/OpenBazaar
features/test_util.py
4
2112
import json import time from tornado.ioloop import IOLoop from tornado import gen from tornado.websocket import websocket_connect from node.db_store import Obdb def ip_address(i): return '127.0.0.%s' % str(i + 1) def nickname(i): return '' def get_db_path(i): return 'db/ob-test-%s.db' % i def node...
mit
liorvh/raspberry_pwn
src/pentest/fimap/language.py
8
26222
# # This file is part of fimap. # # Copyright(c) 2009-2010 Iman Karim(ikarim2s@smail.inf.fh-brs.de). # http://fimap.googlecode.com # # This file may be licensed under the terms of of the # GNU General Public License Version 2 (the ``GPL''). # # Software distributed under the License is distributed # on an ``AS IS'' bas...
gpl-3.0
wdzhou/mantid
Framework/PythonInterface/test/python/mantid/kernel/UnitFactoryTest.py
3
1396
from __future__ import (absolute_import, division, print_function) import unittest from mantid.kernel import UnitFactory, UnitFactoryImpl, Unit class UnitFactoryTest(unittest.TestCase): def test_alias_is_of_type_UnitFactoryImpl(self): self.assertTrue(isinstance(UnitFactory, UnitFactoryImpl)) def tes...
gpl-3.0
ESOedX/edx-platform
common/djangoapps/student/tests/test_events.py
2
7039
# -*- coding: utf-8 -*- """ Test that various events are fired for models in the student app. """ from __future__ import absolute_import import mock from django.db.utils import IntegrityError from django.test import TestCase from django_countries.fields import Country from student.models import CourseEnrollmentAllowe...
agpl-3.0
to266/hyperspy
hyperspy/io_plugins/hdf5.py
1
24002
# -*- coding: utf-8 -*- # Copyright 2007-2016 The HyperSpy developers # # This file is part of HyperSpy. # # HyperSpy 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...
gpl-3.0
vvovo/vvo
model/reply.py
1
2457
#!/usr/bin/env python # coding=utf-8 # # Copyright 2014 vvovo.com # Very way to victory. # Let the dream set sail. import time from lib.query import Query class ReplyModel(Query): def __init__(self, db): self.db = db self.table_name = "reply" super(ReplyModel, self).__init__() def get...
bsd-3-clause
tbeadle/django
django/contrib/admin/actions.py
66
3365
""" Built-in, globally-available admin actions. """ from django.contrib import messages from django.contrib.admin import helpers from django.contrib.admin.utils import get_deleted_objects, model_ngettext from django.core.exceptions import PermissionDenied from django.db import router from django.template.response impo...
bsd-3-clause
buntyke/Flask
microblog/flask/lib/python2.7/site-packages/pbr/find_package.py
101
1043
# Copyright 2013 Hewlett-Packard Development Company, L.P. # 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 # # Unles...
mit
lmco/dart
missions/extras/helpers/analytics.py
1
7283
# Copyright 2017 Lockheed Martin 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 License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed...
apache-2.0
wskplho/sl4a
python/gdata/tests/gdata_tests/webmastertools_test.py
87
19356
#!/usr/bin/python # # Copyright (C) 2008 Yu-Jie Lin # # 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
edac-epscor/nmepscor-data-collection-form
application/builder/forms.py
1
2579
import warnings from django import forms from django.utils.translation import ugettext_lazy as _ from django.contrib.auth import authenticate UNMASKED_DIGITS_TO_SHOW = 6 mask_password = lambda p: "%s%s" % (p[:UNMASKED_DIGITS_TO_SHOW], "*" * max(len(p) - UNMASKED_DIGITS_TO_SHOW, 0)) # Originally from django.contr...
mit
geobricks/pgeo
pgeo/thread/bulk_download_threads_manager.py
1
6781
from ftplib import FTP from threading import Thread from threading import Lock import Queue import os import time from threading import Timer from pgeo.utils import log from pgeo.utils.filesystem import create_filesystem from pgeo.gis.gdal_calc import calc_layers log = log.logger('bulk_download_threads_manager.py') p...
gpl-2.0
djgagne/scikit-learn
examples/linear_model/plot_logistic.py
312
1426
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logit function ========================================================= Show in the plot is how the logistic regression would, in this synthetic dataset, classify values as either 0 or 1, i.e. class one or two, u...
bsd-3-clause
arch1tect0r/root
tutorials/pyroot/hsum.py
10
2306
# # To see the output of this macro, click begin_html <a href="gif/hsum.gif" >here</a> end_html # Simple example illustrating how to use the C++ interpreter # to fill histograms in a loop and show the graphics results # from ROOT import TCanvas, TH1F, TSlider from ROOT import gROOT, gBenchmark, gRandom # Cre...
lgpl-2.1
johankaito/fufuka
microblog/old-flask/venv/lib/python2.7/site-packages/werkzeug/contrib/lint.py
295
12282
# -*- coding: utf-8 -*- """ werkzeug.contrib.lint ~~~~~~~~~~~~~~~~~~~~~ .. versionadded:: 0.5 This module provides a middleware that performs sanity checks of the WSGI application. It checks that :pep:`333` is properly implemented and warns on some common HTTP errors such as non-empty respons...
apache-2.0
balister/GNU-Radio
grc/grc_gnuradio/blks2/selector.py
7
5833
# # Copyright 2008,2013 Free Software Foundation, Inc. # # This file is part of GNU Radio # # GNU Radio 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, or (at your option) # any later version...
gpl-3.0
mskrzypkows/servo
tests/wpt/update/update.py
224
1348
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import os from wptrunner.update.base import Step, StepRunner from wptrunner.update.update import LoadConfig, SyncFromUp...
mpl-2.0
danielthesoto/stagger
test/alltests.py
16
2119
#!/usr/bin/env python3 # # alltests.py # From the stagger project: http://code.google.com/p/stagger/ # # Copyright (c) 2009-2011 Karoly Lorentey <karoly@lorentey.hu> # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following ...
bsd-2-clause
lancezlin/ml_template_py
lib/python2.7/site-packages/IPython/lib/demo.py
7
20470
"""Module for interactive demos using IPython. This module implements a few classes for running Python scripts interactively in IPython for demonstrations. With very simple markup (a few tags in comments), you can control points where the script stops executing and returns control to IPython. Provided classes -----...
mit
josenavas/labman
labman/gui/handlers/process_handlers/sequencing_process.py
1
3665
# ---------------------------------------------------------------------------- # Copyright (c) 2017-, labman development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file LICENSE, distributed with this software. # -----------------------------------------------------...
bsd-3-clause
Fat-Zer/FreeCAD_sf_master
src/Mod/TechDraw/TDTest/DHatchTest.py
27
1824
#!/usr/bin/env python # -*- coding: utf-8 -*- # test script for TechDraw module # creates a page and 1 views # adds a hatch area to view1 from __future__ import print_function import FreeCAD import Part import Measure import TechDraw import os def DHatchTest(): path = os.path.dirname(os.path.abspath(__file__)) ...
lgpl-2.1
JeffHoogland/bodhi3packages
python-neet/usr/lib/python2.7/dist-packages/ecfg/parser.py
4
8831
#!/usr/bin/env python ''' An Enlightenment config parser. See: http://wiki.openmoko.org/wiki/Enlightenment_.cfg Requires pyparsing: https://pyparsing.wikispaces.com/. Author: Jimmy Campbell <jcampbelly@gmail.com> Version: 0.1.0 License: MIT ''' import json import decimal from collections import OrderedDict import py...
bsd-3-clause
kxepal/viivakoodi
barcode/codex.py
1
7633
# -*- coding: utf-8 -*- """Module: barcode.codex :Provided barcodes: Code 39, Code 128, PZN """ from __future__ import unicode_literals from barcode.base import Barcode from barcode.charsets import code128, code39 from barcode.errors import * __docformat__ = 'restructuredtext en' # Sizes MIN_SIZE = 0.2 MIN_QUIET_Z...
mit
co/TheLastRogue
menu.py
1
15853
import equipactions import equipment import graphic import inputhandler import geometry as geo import colors import gui import inventory import menufactory import messenger import rectfactory import settings import style def clamp(n, minn, maxn): return max(min(maxn, n), minn) class Menu(gui.UIElement): def...
bsd-2-clause
schwarty/nignore
externals/markdown/extensions/headerid.py
44
5926
""" HeaderID Extension for Python-Markdown ====================================== Auto-generate id attributes for HTML headers. Basic usage: >>> import markdown >>> text = "# Some Header #" >>> md = markdown.markdown(text, ['headerid']) >>> print md <h1 id="some-header">Some Header</h1> All head...
bsd-3-clause
agreen/scrapy
scrapy/utils/log.py
108
6012
# -*- coding: utf-8 -*- import sys import logging import warnings from logging.config import dictConfig from twisted.python.failure import Failure from twisted.python import log as twisted_log import scrapy from scrapy.settings import overridden_settings, Settings from scrapy.exceptions import ScrapyDeprecationWarni...
bsd-3-clause
rosswhitfield/mantid
Framework/PythonInterface/plugins/algorithms/WorkflowAlgorithms/TransformToIqt.py
3
12292
# Mantid Repository : https://github.com/mantidproject/mantid # # Copyright &copy; 2018 ISIS Rutherford Appleton Laboratory UKRI, # NScD Oak Ridge National Laboratory, European Spallation Source, # Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS # SPDX - License - Identifier: GPL - 3.0 + # py...
gpl-3.0
alexander-barabash/My-QEMU-mirror
scripts/qapi-commands.py
7
11725
# # QAPI command marshaller generator # # Copyright IBM, Corp. 2011 # # Authors: # Anthony Liguori <aliguori@us.ibm.com> # Michael Roth <mdroth@linux.vnet.ibm.com> # # This work is licensed under the terms of the GNU GPLv2. # See the COPYING.LIB file in the top-level directory. from ordereddict import OrderedDict...
gpl-2.0
trueblue2704/AskMeAnything
lib/python2.7/site-packages/gunicorn/http/message.py
35
11293
# -*- coding: utf-8 - # # This file is part of gunicorn released under the MIT license. # See the NOTICE for more information. import re import socket from errno import ENOTCONN from gunicorn._compat import bytes_to_str from gunicorn.http.unreader import SocketUnreader from gunicorn.http.body import ChunkedReader, Le...
mit
mpvismer/pyqtgraph
pyqtgraph/graphicsItems/PlotItem/PlotItem.py
17
47201
# -*- coding: utf-8 -*- """ PlotItem.py - Graphics item implementing a scalable ViewBox with plotting powers. Copyright 2010 Luke Campagnola Distributed under MIT/X11 license. See license.txt for more infomation. This class is one of the workhorses of pyqtgraph. It implements a graphics item with plots, labels, and...
mit
aperigault/ansible
lib/ansible/modules/cloud/amazon/lambda_policy.py
2
13967
#!/usr/bin/python # Copyright (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions> # Copyright (c) 2017 Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'community', ...
gpl-3.0
nag10/reposiatary
UI/node/node_modules/npm/node_modules/node-gyp/gyp/pylib/gyp/ninja_syntax.py
2485
5536
# This file comes from # https://github.com/martine/ninja/blob/master/misc/ninja_syntax.py # Do not edit! Edit the upstream one instead. """Python module for generating .ninja files. Note that this is emphatically not a required piece of Ninja; it's just a helpful utility for build-file-generation systems that alr...
apache-2.0
naibaf7/PyGreentea
examples/3D_u_malis_euclid/test.py
2
1619
from __future__ import print_function import sys, os, math import numpy as np import h5py from numpy import float32, int32, uint8, dtype from PIL import Image import glob # Load PyGreentea # Relative path to where PyGreentea resides pygt_path = '../..' sys.path.append(pygt_path) import pygreentea.pygreentea as pygt fr...
bsd-2-clause
kkreis/espressopp
src/analysis/AdressDensity.py
7
2909
# Copyright (C) 2016 # Max Planck Institute for Polymer Research # # This file is part of ESPResSo++. # # ESPResSo++ 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, o...
gpl-3.0
ab93/Depression-Identification
src/helpers/plot.py
1
3688
import os import re import sys import csv import numpy as np import pandas as pd from scipy import stats import matplotlib.pyplot as plt from src.main import config def get_combined_data(file1, file2): feature_df = pd.read_csv(file1) feature_df = feature_df.append(pd.read_csv(file2)) train_split_df = pd.re...
mit
jeffery-do/Vizdoombot
doom/lib/python3.5/site-packages/theano/tensor/tests/test_gc.py
3
4084
import numpy import six.moves.cPickle as pickle from six.moves import xrange import theano from theano import tensor as T import time def test_no_reuse(): x = T.lvector() y = T.lvector() f = theano.function([x, y], x + y) # provide both inputs in the first call f(numpy.ones(10, dtype='int64'), nu...
mit
jkbradley/spark
examples/src/main/python/mllib/regression_metrics_example.py
158
2104
# # 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 us...
apache-2.0
jamespacileo/django-france
django/views/decorators/vary.py
2
1185
from functools import wraps from django.utils.cache import patch_vary_headers from django.utils.decorators import available_attrs def vary_on_headers(*headers): """ A view decorator that adds the specified headers to the Vary header of the response. Usage: @vary_on_headers('Cookie', 'Accept-languag...
bsd-3-clause
lahwaacz/wiki-scripts
ws/diff.py
1
4383
#! /usr/bin/env python3 try: import WikEdDiff _has_wikeddiff = True except ImportError: _has_wikeddiff = False import difflib try: import pygments import pygments.lexers.text import pygments.formatters _has_pygments = True except ImportError: _has_pygment...
gpl-3.0
SivilTaram/edx-platform
common/test/acceptance/tests/lms/test_lms_problems.py
3
13281
# -*- coding: utf-8 -*- """ Bok choy acceptance tests for problems in the LMS See also old lettuce tests in lms/djangoapps/courseware/features/problems.feature """ from textwrap import dedent from ..helpers import UniqueCourseTest from ...pages.studio.auto_auth import AutoAuthPage from ...pages.lms.courseware import ...
agpl-3.0
sonaht/ansible
lib/ansible/modules/network/sros/sros_config.py
43
10865
#!/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...
gpl-3.0
unoduetre/textclassify
results/resultgen.py
1
3123
#!/usr/bin/env python2 # -*- coding: utf-8 -*- import sys, os, math as m, random os.chdir(os.path.dirname(sys.argv[0])) print """{""" print """ \\makeatletter \\newcommand\\nobreakcline[1]{\\@nobreakcline#1\\@nil}% \\def\\@nobreakcline#1-#2\\@nil{% \\omit \\@multicnt#1% \\advance\\@multispan\\m@ne \\ifnum\\...
gpl-3.0
nkcr/WebIndex
app/venv/lib/python3.5/site-packages/yaml/dumper.py
277
2723
__all__ = ['BaseDumper', 'SafeDumper', 'Dumper'] from .emitter import * from .serializer import * from .representer import * from .resolver import * class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver): def __init__(self, stream, default_style=None, default_flow_style=None, ...
mit
abhattad4/Digi-Menu
digimenu2/django/utils/lru_cache.py
270
7647
try: from functools import lru_cache except ImportError: # backport of Python's 3.3 lru_cache, written by Raymond Hettinger and # licensed under MIT license, from: # <http://code.activestate.com/recipes/578078-py26-and-py30-backport-of-python-33s-lru-cache/> # Should be removed when Django only sup...
bsd-3-clause
NunoEdgarGub1/scikit-learn
benchmarks/bench_plot_fastkmeans.py
294
4676
from __future__ import print_function from collections import defaultdict from time import time import numpy as np from numpy import random as nr from sklearn.cluster.k_means_ import KMeans, MiniBatchKMeans def compute_bench(samples_range, features_range): it = 0 results = defaultdict(lambda: []) chun...
bsd-3-clause
kurikuri99/xen_study
tools/python/xen/util/xmlrpclib2.py
40
8653
#============================================================================ # This library is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # # This library is distributed in the hope th...
gpl-2.0
zhukaixy/kbengine
kbe/src/lib/python/Lib/turtledemo/bytedesign.py
145
4244
#!/usr/bin/env python3 """ turtle-example-suite: tdemo_bytedesign.py An example adapted from the example-suite of PythonCard's turtle graphics. It's based on an article in BYTE magazine Problem Solving with Logo: Using Turtle Graphics to Redraw a Design November 1982, p. 118 - 134 ---------------------...
lgpl-3.0
crosswalk-project/crosswalk-android-extensions
build/idl-generator/third_party/WebKit/Tools/Scripts/webkitpy/thirdparty/coverage/execfile.py
67
4782
"""Execute files of Python code.""" import imp, os, sys from coverage.backward import exec_code_object, open_source from coverage.misc import NoSource, ExceptionDuringRun try: # In Py 2.x, the builtins were in __builtin__ BUILTINS = sys.modules['__builtin__'] except KeyError: # In Py 3.x, they're in bui...
bsd-3-clause
pioneers/topgear
ipython-in-depth/examples/Parallel Computing/interengine/bintree.py
4
7171
""" BinaryTree inter-engine communication class use from bintree_script.py Provides parallel [all]reduce functionality """ from __future__ import print_function import cPickle as pickle import re import socket import uuid import zmq from IPython.parallel.util import disambiguate_url #---------------------------...
apache-2.0
DreamLab/contrail-controller
src/nodemgr/common/event_manager.py
7
20742
# # Copyright (c) 2015 Juniper Networks, Inc. All rights reserved. # import gevent import json import ConfigParser from StringIO import StringIO from ConfigParser import NoOptionError, NoSectionError import sys import os import socket import time import subprocess from subprocess import Popen, PIPE import supervisor.x...
apache-2.0
stefanseefeld/numba
numba/cuda/tests/cudapy/test_nondet.py
6
1467
from __future__ import print_function, absolute_import import numpy as np from numba import cuda, float32 from numba.cuda.testing import unittest def generate_input(n): A = np.array(np.arange(n * n).reshape(n, n), dtype=np.float32) B = np.array(np.arange(n) + 0, dtype=A.dtype) return A, B class TestCuda...
bsd-2-clause
GeoscienceAustralia/eo-datasets
tests/__init__.py
2
5206
# coding=utf-8 from __future__ import absolute_import import atexit import os import pathlib import shutil import sys import tempfile from pathlib import Path def assert_same(o1, o2, prefix=""): """ Assert the two are equal. Compares property values one-by-one recursively to print friendly error message...
apache-2.0
castroflavio/ryu
ryu/exception.py
52
1824
# Copyright (C) 2011 Nippon Telegraph and Telephone Corporation. # Copyright (C) 2011 Isaku Yamahata <yamahata at valinux co jp> # # 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://...
apache-2.0
Nexenta/cinder
cinder/interface/volume_management_driver.py
6
3988
# Copyright 2016 Dell 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 app...
apache-2.0
marckuz/django
django/forms/utils.py
241
6131
from __future__ import unicode_literals import json import sys from django.conf import settings from django.core.exceptions import ValidationError # backwards compatibility from django.utils import six, timezone from django.utils.encoding import force_text, python_2_unicode_compatible from django.utils.html import e...
bsd-3-clause
Peerapps/PeerChat
bitcoin/core/__init__.py
3
25353
# Copyright (C) 2012-2014 The python-bitcoinlib developers # # This file is part of python-bitcoinlib. # # It is subject to the license terms in the LICENSE file found in the top-level # directory of this distribution. # # No part of python-bitcoinlib, including this file, may be copied, modified, # propagated, or dist...
mit
kaiyuanl/gem5
src/sim/ClockedObject.py
49
2482
# Copyright (c) 2012 ARM Limited # All rights reserved. # # The license below extends only to copyright in the software and shall # not be construed as granting a license to any other intellectual # property including but not limited to intellectual property relating # to a hardware implementation of the functionality ...
bsd-3-clause
mitchrule/Miscellaneous
Django_Project/django/Lib/site-packages/pip/_vendor/distlib/_backport/shutil.py
1002
25650
# -*- coding: utf-8 -*- # # Copyright (C) 2012 The Python Software Foundation. # See LICENSE.txt and CONTRIBUTORS.txt. # """Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os...
mit
AlexStarov/Shop
applications/discount/admin.py
1
3002
# -*- coding: utf-8 -*- from django.contrib import admin from .models import Action __author__ = 'AlexStarov' @admin.register(Action) class ActionAdmin(admin.ModelAdmin, ): list_display = ['pk', 'name', 'datetime_start', 'datetime_end', 'auto_start', 'auto_end', 'auto_del', 'auto_del_action...
apache-2.0
dzbarsky/servo
tests/wpt/css-tests/tools/wptserve/wptserve/stash.py
89
5279
import base64 import json import os import uuid from multiprocessing import Process from multiprocessing.managers import BaseManager, DictProxy class ServerDictManager(BaseManager): shared_data = {} def _get_shared(): return ServerDictManager.shared_data ServerDictManager.register("get_dict", ...
mpl-2.0
cntnboys/410Lab5
env-lab4/lib/python2.7/site-packages/werkzeug/_compat.py
148
6190
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
jdorvi/CSHORE
lake_ontario/TRANSECTS_aecom.py
1
8744
TRANSECTS = {"123":["23102", "23101", "23194"], "124":["23286", "23193", "23192"], "125":["23383", "23284", "23382"], "126":["23381", "23482", "23483"], "127":["23675", "23676", "23578"], "128":["23765", "23857", "23858"], "129":["24208", "24...
apache-2.0
mammique/django
django/utils/version.py
228
1785
from __future__ import unicode_literals import datetime import os import subprocess def get_version(version=None): "Returns a PEP 386-compliant version number from VERSION." if version is None: from django import VERSION as version else: assert len(version) == 5 assert version[3] i...
bsd-3-clause
frankiecjunle/yunblog
venv/lib/python2.7/site-packages/sqlalchemy/exc.py
32
12030
# sqlalchemy/exc.py # Copyright (C) 2005-2017 the SQLAlchemy authors and contributors # <see AUTHORS file> # # This module is part of SQLAlchemy and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php """Exceptions used with SQLAlchemy. The base exception class is :exc:`.SQLAlchemy...
mit
konsP/synnefo
snf-pithos-backend/pithos/backends/lib/sqlalchemy/alembic/env.py
10
2382
from __future__ import with_statement from alembic import context from sqlalchemy import engine_from_config, pool from logging.config import fileConfig try: # pithos-app case from synnefo.settings import PITHOS_BACKEND_DB_CONNECTION except ImportError: try: # plankton case from synnefo.sett...
gpl-3.0
wilsonfreitas/easycsv
build/lib/easycsv.py
2
16011
#!/usr/bin/env python # encoding: utf-8 # """ easycsv.py The easycsv module executes csv statements (a kind of csv DSL - domain specific language) to insert/update/delete data into a database. Easycsv was developed to be used with the Storm ORM framework, but it could be easily adapted for others ORM frameworks (S...
mit
da1z/intellij-community
python/lib/Lib/asyncore.py
70
16725
# -*- Mode: Python -*- # Id: asyncore.py,v 2.51 2000/09/07 22:29:26 rushing Exp # Author: Sam Rushing <rushing@nightmare.com> # ====================================================================== # Copyright 1996 by Sam Rushing # # All Rights Reserved # # Permission to use, copy, modify,...
apache-2.0
peterjoel/servo
tests/wpt/web-platform-tests/webdriver/tests/new_session/support/create.py
40
3019
# Note that we can only test things here all implementations must support valid_data = [ ("acceptInsecureCerts", [ False, None, ]), ("browserName", [ None, ]), ("browserVersion", [ None, ]), ("platformName", [ None, ]), ("pageLoadStrategy", [ N...
mpl-2.0
Santinell/ansible-modules-core
cloud/digital_ocean/digital_ocean_domain.py
15
7224
#!/usr/bin/python # -*- coding: utf-8 -*- # 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. #...
gpl-3.0
simomarsili/scikit-msa
skmsa/filters.py
1
10109
# -*- coding: utf-8 -*- # Copyright (C) 2017, Simone Marsili <simo.marsili@gmail.com> # License: BSD 3 clause """Filtering functions.""" from __future__ import (absolute_import, division, print_function, unicode_literals) from builtins import ( # pylint: disable=redefined-builtin, unused-impor...
bsd-3-clause
MarkWh1te/xueqiu_predict
p3_env/lib/python3.5/site-packages/pygments/lexers/parasail.py
23
2737
# -*- coding: utf-8 -*- """ pygments.lexers.parasail ~~~~~~~~~~~~~~~~~~~~~~~~ Lexer for ParaSail. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include from pygments.token import Tex...
mit
gram526/VTK
Web/Core/Testing/Python/TestDataEncoder.py
5
2334
import sys import vtk import array from vtk.test import Testing class TestDataEncoder(Testing.vtkTest): def testEncodings(self): # Render something cylinder = vtk.vtkCylinderSource() cylinder.SetResolution(8) cylinderMapper = vtk.vtkPolyDataMapper() cylinderMapper.SetInputC...
bsd-3-clause
pku9104038/edx-platform
common/djangoapps/edxmako/shortcuts.py
1
4531
# Copyright (c) 2008 Mikeal Rogers # # 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 agre...
agpl-3.0
karlito40/servo
tests/wpt/css-tests/tools/pywebsocket/src/test/test_mock.py
496
5168
#!/usr/bin/env python # # Copyright 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...
mpl-2.0