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
wwj718/edx-platform
cms/djangoapps/contentstore/views/error.py
33
1595
# pylint: disable=missing-docstring,unused-argument from django.http import (HttpResponse, HttpResponseServerError, HttpResponseNotFound) from edxmako.shortcuts import render_to_string, render_to_response import functools from openedx.core.lib.js_utils import escape_json_dumps __all__ = ['not...
agpl-3.0
n-west/gnuradio
gr-digital/examples/gen_whitener.py
58
1814
#!/usr/bin/env python # # Copyright 2011,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 opt...
gpl-3.0
nonnib/eve-metrics
web2py/applications/welcome/controllers/default.py
3
1941
# -*- coding: utf-8 -*- # this file is released under public domain and you can use without limitations ######################################################################### ## This is a sample controller ## - index is the default action of any application ## - user is required for authentication and authorization...
mit
pleaseproject/python-for-android
python3-alpha/extra_modules/gdata/sample_util.py
47
10741
#!/usr/bin/env python # # Copyright (C) 2009 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 ...
apache-2.0
yawnosnorous/python-for-android
python-modules/twisted/twisted/protocols/telnet.py
78
12270
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """TELNET implementation, with line-oriented command handling. """ import warnings warnings.warn( "As of Twisted 2.1, twisted.protocols.telnet is deprecated. " "See twisted.conch.telnet for the current, supported API.", D...
apache-2.0
rcbops/keystone-buildpackage
examples/echo/echo_client.py
3
3777
#!/usr/bin/env python # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2010-2011 OpenStack, 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/licens...
apache-2.0
kenshay/ImageScripter
ProgramData/SystemFiles/Python/Lib/site-packages/pytank/GUI/ButtonEditor.py
2
10471
from PyQt4 import QtGui,QtCore from PIL import ImageGrab, ImageFilter, Image import cv2 import numpy as np from PyQt4.QtGui import QApplication, QMainWindow, QPushButton,QLabel, QVBoxLayout, QWidget from pytank.Core import Settings import os import copy from PyQt4.QtGui import QPalette def replace_all(text, di...
gpl-3.0
jgrandguillaume/vertical-ngo
framework_agreement_sourcing/tests/__init__.py
2
1149
# -*- coding: utf-8 -*- ############################################################################## # # Author: Nicolas Bessi # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # publi...
agpl-3.0
dlcjfgmlnasa/ppt
node_modules/node-gyp/gyp/pylib/gyp/ordered_dict.py
2354
10366
# Unmodified from http://code.activestate.com/recipes/576693/ # other than to add MIT license header (as specified on page, but not in code). # Linked from Python documentation here: # http://docs.python.org/2/library/collections.html#collections.OrderedDict # # This should be deleted once Py2.7 is available on all bot...
mit
pombreda/ctypesgen
ctypesgencore/parser/yacc.py
14
82540
#----------------------------------------------------------------------------- # ply: yacc.py # # Author(s): David M. Beazley (dave@dabeaz.com) # Modifications for pyglet by Alex Holkner (alex.holkner@gmail.com) (<ah>) # Modifications for ctypesgen by Tim Maxwell (timmaxw@gmail.com) (<tm>) # # Copyright (C) 2001-2006, ...
bsd-3-clause
ammarkhann/FinalSeniorCode
lib/python2.7/site-packages/sympy/unify/core.py
82
7189
""" Generic Unification algorithm for expression trees with lists of children This implementation is a direct translation of Artificial Intelligence: A Modern Approach by Stuart Russel and Peter Norvig Second edition, section 9.2, page 276 It is modified in the following ways: 1. We allow associative and commutati...
mit
bear/parsedatetime
tests/TestAustralianLocale.py
3
4572
# -*- coding: utf-8 -*- """ Test parsing of simple date and times using the Australian locale """ from __future__ import unicode_literals import sys import time import datetime import parsedatetime as pdt from . import utils if sys.version_info < (2, 7): import unittest2 as unittest else: import unittest cl...
apache-2.0
openwrt/linux
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
Lisapple/PySMIL
Parser.py
1
13335
#!/usr/bin/python import sys s = "" index = 0 # The index of the current char into |s| vars = { } exprs = [] lastExpr = 0 stack = [] verboseMode = False # Read the file with the name specified by the second arg # (the first arg is the name of the executable) if len(sys.argv) >= 2: s = open(sys.argv[1]).read() n...
mit
yavalvas/yav_com
build/matplotlib/lib/matplotlib/sphinxext/only_directives.py
11
2231
# # A pair of directives for inserting content that will only appear in # either html or latex. # from __future__ import (absolute_import, division, print_function, unicode_literals) import six from docutils.nodes import Body, Element from docutils.parsers.rst import directives class only_ba...
mit
amalgam8/amalgam8
vendor/k8s.io/client-go/vendor/github.com/ugorji/go/codec/test.py
1138
3876
#!/usr/bin/env python # This will create golden files in a directory passed to it. # A Test calls this internally to create the golden files # So it can process them (so we don't have to checkin the files). # Ensure msgpack-python and cbor are installed first, using: # sudo apt-get install python-dev # sudo apt-g...
apache-2.0
vilorious/pyload
module/plugins/crypter/LinkdecrypterCom.py
12
2726
# -*- coding: utf-8 -*- import re from module.plugins.internal.MultiCrypter import MultiCrypter class LinkdecrypterCom(MultiCrypter): __name__ = "LinkdecrypterCom" __type__ = "crypter" __version__ = "0.32" __status__ = "testing" __pattern__ = r'^unmatchable$' __config__ = [("use_sub...
gpl-3.0
kartikm/hy
tests/importer/test_importer.py
1
2646
# Copyright 2018 the authors. # This file is part of Hy, which is free software licensed under the Expat # license. See the LICENSE. import hy from hy.importer import (import_file_to_module, import_buffer_to_ast, MetaLoader, get_bytecode_path) from hy.errors import HyTypeError import os import...
mit
sunnyzwh/readthedocs.org
readthedocs/profiles/views.py
34
8876
""" Views for creating, editing and viewing site-specific user profiles. """ from django.contrib.auth.decorators import login_required from django.contrib.auth.models import User from django.core.exceptions import ObjectDoesNotExist from django.core.urlresolvers import reverse from django.http import Http404 from dja...
mit
tjsavage/sfcsdatabase
django/contrib/gis/tests/distapp/tests.py
35
20147
import os, unittest from decimal import Decimal from django.db import connection from django.db.models import Q from django.contrib.gis.gdal import DataSource from django.contrib.gis.geos import GEOSGeometry, Point, LineString from django.contrib.gis.measure import D # alias for Distance from django.contrib.gis.tests....
bsd-3-clause
0x010C/Pywikibot-scripts
nb_anime.py
2
2325
#!/usr/bin/python2.7 # -*- coding: utf-8 -*- #Autor: Thibaut120094 # Antoine "0x010C" Lamielle #Date: 10 December 2016 #License: GNU GPL v3 import feedparser import re import pywiki import pwutils supported_anime = { #u"title in args": [u"title in rss feed", u"on-wiki title"], u"Détective Conan": [u"Cas...
gpl-3.0
oliverhr/odoo
addons/account_payment/account_invoice.py
382
2377
# -*- 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
jonathonwalz/ansible
lib/ansible/modules/source_control/github_key.py
70
7765
#!/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 distributed...
gpl-3.0
katzj/graphite
carbon/lib/carbon/aggregator/client.py
1
2952
from twisted.internet import reactor from twisted.internet.protocol import ReconnectingClientFactory from twisted.protocols.basic import Int32StringReceiver from carbon.conf import settings from carbon import log try: import cPickle as pickle except ImportError: import pickle MAX_DATAPOINTS_PER_MESSAGE = setting...
apache-2.0
bwp/SeleniumWebDriver
py/selenium/webdriver/support/select.py
42
8428
#!/usr/bin/python # # Copyright 2011 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 ap...
apache-2.0
LeeMendelowitz/DCMetroMetrics
dcmetrometrics/common/DataWriter.py
2
4877
""" Methods to convert an object to csv """ import datetime from pandas import Series, DataFrame import os from .utils import mkdir_p from datetime import timedelta, datetime from collections import defaultdict from ..eles.models import (Unit, UnitStatus, KeyStatuses, Station, DailyServiceReport, SystemServiceReport) ...
gpl-2.0
LarsFronius/ansible
lib/ansible/modules/system/cron.py
24
25581
#!/usr/bin/python # -*- coding: utf-8 -*- # # (c) 2012, Dane Summers <dsummers@pinedesk.biz> # (c) 2013, Mike Grozak <mike.grozak@gmail.com> # (c) 2013, Patrick Callahan <pmc@patrickcallahan.com> # (c) 2015, Evan Kaufman <evan@digitalflophouse.com> # (c) 2015, Luca Berruti <nadirio@gmail.com> # # This file is part of ...
gpl-3.0
hanicker/odoo
addons/report_intrastat/__init__.py
377
1079
# -*- 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
2014cdbg14/2014cdbg14
wsgi/static/Brython2.1.0-20140419-113919/Lib/unittest/test/test_program.py
738
10833
import io import os import sys import unittest class Test_TestProgram(unittest.TestCase): def test_discovery_from_dotted_path(self): loader = unittest.TestLoader() tests = [self] expectedPath = os.path.abspath(os.path.dirname(unittest.test.__file__)) self.wasRun = False ...
gpl-2.0
cswiercz/abelfunctions
abelfunctions/riemann_theta/tests/presentation.py
3
4024
import numpy as np from riemanntheta import RiemannTheta_Function import pylab as p import matplotlib.pyplot as plt from pycuda import gpuarray import time def demo1(): theta = RiemannTheta_Function() Omega = np.array([[1.j, .5], [.5, 1.j]]) print print "Calculating 3,600 points of the Riemann Theta Fu...
bsd-3-clause
rpm5099/libforensics
code/lf/apps/msoffice/word/objects.py
13
9218
# Copyright 2009 Michael Murr # # This file is part of LibForensics. # # LibForensics 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 later ver...
gpl-3.0
nuxeh/keystone
keystone/tests/unit/test_sql_livetest.py
9
2679
# Copyright 2013 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 # # Unless required by applicable law or agreed to in writing...
apache-2.0
justajeffy/anim-studio-tools
kip/houdini/docs/conf.py
25
1076
# # Dr. D Studios # --------------------------------------------------- # Load centralised configuration # --------------------------------------------------- from miki.sphinx_config import * # Add any overrides required below # --------------------------------------------------- # Copyright 2008-2012 Dr D Studios ...
gpl-3.0
Alexsaphir/TP_EDP_Python
TP1.py
1
3456
# -*- coding: utf-8 -*- from numpy import * from numpy.linalg import * from numpy.random import * from matplotlib.pyplot import * print('Valeur de pi :', pi) print(finfo(float).eps) #Create a Vector X1 = array([1, 2, 3, 4, 5]) print('Simple vecteur :',X1) X2 = arange(0,1,.25) print('Subdvision uniforme :', X2) X3 =...
lgpl-3.0
brian-brazil/ansible-modules-extras
packaging/npm.py
19
8473
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Chris Hoffman <christopher.hoffman@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 version ...
gpl-3.0
pratikmallya/hue
desktop/core/ext-py/Django-1.6.10/django/conf/locale/ko/formats.py
118
2323
# -*- encoding: utf-8 -*- # This file is distributed under the same license as the Django package. # from __future__ import unicode_literals # The *_FORMAT strings use the Django date format syntax, # see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date DATE_FORMAT = 'Y년 n월 j일' TIME_FORMAT = 'A g:i:s'...
apache-2.0
effigies/mne-python
mne/decoding/tests/test_classifier.py
3
4577
# Author: Mainak Jas <mainak@neuro.hut.fi> # # License: BSD (3-clause) import warnings import os.path as op import numpy as np from nose.tools import assert_true, assert_raises from numpy.testing import assert_array_equal from mne import io, read_events, Epochs, pick_types from mne.decoding.classifier import Scaler,...
bsd-3-clause
legalsylvain/OpenUpgrade
addons/stock_dropshipping/__init__.py
61
1045
# -*- 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
nvoron23/skia
platform_tools/android/tests/android_framework_gyp_tests.py
145
2418
#!/usr/bin/python # Copyright 2014 Google Inc. # # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ Test gyp_to_android.py """ import os import shutil import sys import tempfile import test_variables import unittest sys.path.append(test_variables.ANDROID_DIR) ...
bsd-3-clause
telwertowski/Books-Mac-OS-X
Versions/Books_3.0b3/Library of Congress Importer.app/Contents/Resources/PyZ3950/PyZ3950_parsetab.py
30
2032
# PyZ3950_parsetab.py # This file is automatically generated. Do not edit. _lr_method = 'SLR' _lr_signature = '\xfc\xb2\xa8\xb7\xd9\xe7\xad\xba"\xb2Ss\'\xcd\x08\x16' _lr_action_items = {'QUOTEDVALUE':([5,26,0,19,16,],[1,1,1,1,1,]),'LOGOP':([3,25,4,14,9,6,27,23,13,20,22,1,],[-5,-9,-14,-13,16,-8,16,-7,16,-6,-4,-12,])...
mit
sve-odoo/odoo
addons/l10n_ca/__openerp__.py
161
3167
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of the G...
agpl-3.0
cxhernandez/msmbuilder
msmbuilder/tests/test_vmhmm.py
3
4066
from __future__ import print_function, division import random from itertools import permutations import numpy as np from scipy.stats.distributions import vonmises from msmbuilder.example_datasets import AlanineDipeptide from msmbuilder.featurizer import DihedralFeaturizer from msmbuilder.hmm import VonMisesHMM def...
lgpl-2.1
paweljasinski/ironpython3
Src/StdLib/Lib/test/test_sort.py
169
9164
from test import support import random import sys import unittest from functools import cmp_to_key verbose = support.verbose nerrors = 0 def check(tag, expected, raw, compare=None): global nerrors if verbose: print(" checking", tag) orig = raw[:] # save input in case of error if compar...
apache-2.0
bryceliu/ansible
hacking/module_formatter.py
68
17126
#!/usr/bin/env python # (c) 2012, Jan-Piet Mens <jpmens () gmail.com> # (c) 2012-2014, Michael DeHaan <michael@ansible.com> and others # # 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 So...
gpl-3.0
ClearCorp/odoo-clearcorp
TODO-9.0/budget/sale.py
2
6359
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Addons modules by CLEARCORP S.A. # Copyright (C) 2009-TODAY CLEARCORP S.A. (<http://clearcorp.co.cr>). # # This program is free software: you can redistribute...
agpl-3.0
muku42/bokeh
bokeh/charts/builder/step_builder.py
43
5445
"""This is the Bokeh charts interface. It gives you a high level API to build complex plot is a simple way. This is the Step class which lets you build your Step charts just passing the arguments to the Chart class and calling the proper functions. """ #-----------------------------------------------------------------...
bsd-3-clause
gramps-project/gramps
gramps/gui/plug/report/_styleeditor.py
4
24424
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2005 Donald N. Allingham # Copyright (C) 2007-2008 Brian G. Matherly # Copyright (C) 2008 Peter Landgren # Copyright (C) 2010 Jakim Friant # Copyright (C) 2012,2017 Paul Franklin # Copyright (C) 2014 Nick Hall # # This program...
gpl-2.0
yfried/ansible
lib/ansible/parsing/dataloader.py
27
18556
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # Make coding more python3-ish from __future__ import (absolute_import, division, print_function) __metaclass__ = type import c...
gpl-3.0
Ruide/angr-dev
angr/angr/engines/vex/ccall.py
1
71774
#!/usr/bin/env python import logging l = logging.getLogger("angr.engines.vex.ccall") #l.setLevel(logging.DEBUG) # pylint: disable=R0911 # pylint: disable=W0613 # pylint: disable=W0612 # pylint: disable=invalid-unary-operand-type ############### ### Helpers ### ############### # There might be a better way of doing ...
bsd-2-clause
asm666/sympy
sympy/functions/combinatorial/factorials.py
16
24934
from __future__ import print_function, division from sympy.core import S, sympify, Dummy from sympy.core.function import Function, ArgumentIndexError from sympy.core.logic import fuzzy_and from sympy.core.numbers import Integer from sympy.ntheory import sieve from math import sqrt as _sqrt from sympy.core.compatibili...
bsd-3-clause
sujoykroy/motion-picture
editor/MotionPicture/time_lines/audio_clip_generator.py
1
2018
import moviepy.editor as movie_editor import numpy from ..audio_tools import AudioBlock, AudioFileBlock, AudioFileBlockCache class AudioClipGenerator(movie_editor.AudioClip): def __init__(self, time_offset, slice_offset, scale, duration, time_slice): movie_editor.AudioClip.__init__(self, make_frame=None, d...
gpl-3.0
erjohnso/ansible
lib/ansible/modules/clustering/consul_acl.py
26
21748
#!/usr/bin/python # # (c) 2015, Steve Gargan <steve.gargan@gmail.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
dpiers/coderang-meteor
public/jsrepl/extern/python/unclosured/lib/python2.7/distutils/command/build.py
250
5437
"""distutils.command.build Implements the Distutils 'build' command.""" __revision__ = "$Id$" import sys, os from distutils.util import get_platform from distutils.core import Command from distutils.errors import DistutilsOptionError def show_compilers(): from distutils.ccompiler import show_compilers show...
mit
siliconsmiley/QGIS
python/core/contextmanagers.py
20
1173
import sys from contextlib import contextmanager from qgis.core import QgsApplication @contextmanager def qgisapp(args=None, guienabled=True, configpath=None, sysexit=True): """ Create a new QGIS Qt application. You should use this before creating any Qt widgets or QGIS objects for your custom QGIS b...
gpl-2.0
shinpeimuraoka/ryu
ryu/tests/unit/packet/test_ethernet.py
27
2937
# Copyright (C) 2012 Nippon Telegraph and Telephone 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 appli...
apache-2.0
ClearCorp-dev/knowledge
document_url/wizard/__init__.py
16
1100
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (c) 2014 Serv. Tecnol. Avanzados (http://www.serviciosbaeza.com) # Pedro M. Baeza <pedro.baeza@serviciosbaeza.com> # # This pro...
agpl-3.0
vit2/vit-e2
lib/python/Screens/ScreenSaver.py
6
2059
from Screens.Screen import Screen from Components.MovieList import AUDIO_EXTENSIONS from Components.ServiceEventTracker import ServiceEventTracker from Components.Pixmap import Pixmap from enigma import ePoint, eTimer, iPlayableService import os class Screensaver(Screen): def __init__(self, session): self.skin = "...
gpl-2.0
olsaki/docker-py
tests/unit/volume_test.py
3
2984
import json import pytest from .. import base from .api_test import DockerClientTest, url_prefix, fake_request class VolumeTest(DockerClientTest): @base.requires_api_version('1.21') def test_list_volumes(self): volumes = self.client.volumes() self.assertIn('Volumes', volumes) self.as...
apache-2.0
wallarelvo/Dodger
scripts/agent.py
2
1687
import math import point class Agent(object): def __init__(self, model_x, model_y): self.model_x = model_x self.model_y = model_y self.delta_t = 0.01 self.r = 1.5 self.k = 1.0 def get_normal_dist(self, X, std): coeff = 1.0 / (std * math.sqrt(2.0 * math.pi)) ...
apache-2.0
Santinell/ansible-modules-core
system/sysctl.py
27
12834
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2012, David "DaviXX" CHANIAL <david.chanial@gmail.com> # (c) 2014, James Tanner <tanner.jc@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 ...
gpl-3.0
macks22/scikit-learn
examples/tree/plot_iris.py
271
2186
""" ================================================================ Plot the decision surface of a decision tree on the iris dataset ================================================================ Plot the decision surface of a decision tree trained on pairs of features of the iris dataset. See :ref:`decision tree ...
bsd-3-clause
stuartarchibald/numba
numba/cuda/stubs.py
4
15003
""" This scripts specifies all PTX special objects. """ import functools class Stub(object): ''' A stub object to represent special objects that are meaningless outside the context of a CUDA kernel ''' _description_ = '<ptx special value>' __slots__ = () # don't allocate __dict__ def __ne...
bsd-2-clause
lchsk/django-mongonaut
mongonaut/sites.py
1
1869
try: import floppyforms as forms except ImportError: from django import forms class BaseMongoAdmin(object): search_fields = [] # Show the fields to be displayed as columns # TODO: Confirm that this is what the Django admin uses list_fields = [] #This shows up on the DocumentListView of ...
mit
arabenjamin/scikit-learn
examples/semi_supervised/plot_label_propagation_structure.py
247
2432
""" ============================================== Label Propagation learning a complex structure ============================================== Example of LabelPropagation learning a complex internal structure to demonstrate "manifold learning". The outer circle should be labeled "red" and the inner circle "blue". Be...
bsd-3-clause
mRokita/DPLeague
pypb2lib.py
1
15551
from threading import Thread, Timer from socket import socket, AF_INET, SOCK_DGRAM from urllib2 import urlopen import time import re #------------------_EVT_ACTIONS----------------------# ERR_TIMEOUT = 'e0' ERR_BAD_RCON_PASSWORD = 'e1' EVT_CHAT = 'ev0' EVT_ELIM = 'ev1' EVT_RESPAWN = 'ev2' EVT_MAPCHANGE = 'ev...
gpl-2.0
chunywang/crosswalk-test-suite
webapi/tct-csp-w3c-tests/csp-py/csp_style-src_none.py
30
3768
def main(request, response): import simplejson as json f = file('config.json') source = f.read() s = json.JSONDecoder().decode(source) url1 = "http://" + s['host'] + ":" + str(s['ports']['http'][1]) url2 = "http://" + s['host'] + ":" + str(s['ports']['http'][0]) _CSP = "style-src 'none'" ...
bsd-3-clause
havt/odoo
addons/purchase/report/purchase_report.py
137
7689
# -*- 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
benediktschmitt/py-jsonapi
jsonapi/sqlalchemy/database.py
1
8981
#!/usr/bin/env python3 # The MIT License (MIT) # # Copyright (c) 2016 Benedikt Schmitt # # 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...
mit
flh/odoo
addons/website_blog/wizard/__init__.py
373
1077
# -*- 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
gabrielelanaro/pyquante
Tests/h2_dft.py
3
1218
#!/usr/bin/env python import unittest, sciunittest from PyQuante.NumWrap import arange from PyQuante.dft import dft from PyQuante.Molecule import Molecule energy = -1.132710 name = 'H2/DFT' def dissoc(**opts): rmin = opts.get('rmin',0.65) rmax = opts.get('rmax',1.01) step = opts.get('step',0.05) dopl...
bsd-3-clause
Comcast/neutron
neutron/tests/unit/linuxbridge/test_lb_db.py
5
8166
# Copyright (c) 2012 OpenStack Foundation. # # 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
rh-lab-q/rpg
tests/mock_build/test_build_rpg.py
6
2205
from tests.support import RpgTestCase from rpg import Base from rpg.command import Command import os class BuildTest(RpgTestCase): def test_rpg_project(self): self.base = Base() self.base.sack = self.base.load_dnf_sack() self.base.load_plugins() self.base.load_project_from_url( ...
gpl-2.0
rwl/muntjac
muntjac/demo/sampler/features/dragndrop/DragDropServerValidationExample.py
1
3879
from muntjac.demo.sampler.ExampleUtil import ExampleUtil from muntjac.event.dd.acceptcriteria.server_side_criterion import \ ServerSideCriterion from muntjac.terminal.gwt.client.ui.dd.vertical_drop_location import \ VerticalDropLocation from muntjac.api import HorizontalLayout, Table from muntjac.ui.table i...
apache-2.0
throwable-one/lettuce
tests/integration/lib/Django-1.2.5/django/db/models/loading.py
308
8745
"Utilities for loading models and the modules that contain them." from django.conf import settings from django.core.exceptions import ImproperlyConfigured from django.utils.datastructures import SortedDict from django.utils.importlib import import_module from django.utils.module_loading import module_has_submodule im...
gpl-3.0
chouseknecht/ansible
test/units/modules/network/fortios/test_fortios_system_firmware_upgrade.py
21
2446
# Copyright 2019 Fortinet, Inc. # # 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...
gpl-3.0
azhou-nicira/net-next
tools/perf/scripts/python/net_dropmonitor.py
1812
1749
# Monitor the system for dropped packets and proudce a report of drop locations and counts import os import sys sys.path.append(os.environ['PERF_EXEC_PATH'] + \ '/scripts/python/Perf-Trace-Util/lib/Perf/Trace') from perf_trace_context import * from Core import * from Util import * drop_log = {} kallsyms = [] def...
gpl-2.0
iniverno/RnR-LLC
simics-3.0-install/simics-3.0.31/amd64-linux/lib/python/tracker.py
1
3300
# Common stuff for process trackers. from cli import * def str2cpu(str): try: cpu = SIM_get_object(str) except: print "There is no object named '%s'." % str return None if SIM_object_is_processor(cpu): return cpu print "%d is not a processor." % str return None def...
gpl-2.0
Fedik/gramps
gramps/gui/logger/_errorreportassistant.py
5
26528
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2012 Nick Hall # # 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 v...
gpl-2.0
benpatterson/edx-platform
lms/djangoapps/certificates/migrations/0015_adding_mode_for_verified_certs.py
114
6231
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'GeneratedCertificate.mode' db.add_column('certificates_generatedcertificate', 'mode', ...
agpl-3.0
AlanJAS/arduino
serial/urlhandler/protocol_alt.py
26
1993
#! python # # This module implements a special URL handler that allows selecting an # alternate implementation provided by some backends. # # This file is part of pySerial. https://github.com/pyserial/pyserial # (C) 2015 Chris Liechti <cliechti@gmx.net> # # SPDX-License-Identifier: BSD-3-Clause # # URL format: al...
gpl-3.0
yangzhongj/vitess
test/framework.py
8
2530
# Copyright 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. import os import shlex from subprocess import Popen, PIPE import time import unittest import utils class TestCase(unittest.TestCase): @classmethod def setenv(...
bsd-3-clause
kanagasabapathi/python-for-android
python3-alpha/extra_modules/gdata/tlslite/utils/Cryptlib_TripleDES.py
48
1410
"""Cryptlib 3DES implementation.""" from .cryptomath import * from .TripleDES import * if cryptlibpyLoaded: def new(key, mode, IV): return Cryptlib_TripleDES(key, mode, IV) class Cryptlib_TripleDES(TripleDES): def __init__(self, key, mode, IV): TripleDES.__init__(self, key, mod...
apache-2.0
ekaputra07/gempa-monitor
lib/apiclient/sample_tools.py
98
3528
# Copyright (C) 2013 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writ...
mit
xuerenlv/scrapy
scrapy/http/cookies.py
94
5486
import time from six.moves.http_cookiejar import ( CookieJar as _CookieJar, DefaultCookiePolicy, IPV4_RE ) from scrapy.utils.httpobj import urlparse_cached from scrapy.utils.python import to_native_str class CookieJar(object): def __init__(self, policy=None, check_expired_frequency=10000): self.policy...
bsd-3-clause
SebKuzminsky/linux-stable
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/EventClass.py
4653
3596
# EventClass.py # # This is a library defining some events types classes, which could # be used by other scripts to analyzing the perf samples. # # Currently there are just a few classes defined for examples, # PerfEvent is the base class for all perf event sample, PebsEvent # is a HW base Intel x86 PEBS event, and use...
gpl-2.0
moijes12/oh-mainline
vendor/packages/Django/django/contrib/localflavor/gb/forms.py
110
1992
""" GB-specific Form helpers """ from __future__ import absolute_import, unicode_literals import re from django.contrib.localflavor.gb.gb_regions import GB_NATIONS_CHOICES, GB_REGION_CHOICES from django.forms.fields import CharField, Select from django.forms import ValidationError from django.utils.translation impor...
agpl-3.0
ddr2108/CS4803-Android_Kenel_Projects
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/SchedGui.py
12980
5411
# SchedGui.py - Python extension for perf script, basic GUI code for # traces drawing and overview. # # Copyright (C) 2010 by Frederic Weisbecker <fweisbec@gmail.com> # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. ...
gpl-2.0
TeamWin/android_kernel_huawei_mt2l03
tools/perf/scripts/python/futex-contention.py
11261
1486
# futex contention # (c) 2010, Arnaldo Carvalho de Melo <acme@redhat.com> # Licensed under the terms of the GNU GPL License version 2 # # Translation of: # # http://sourceware.org/systemtap/wiki/WSFutexContention # # to perf python scripting. # # Measures futex contention import os, sys sys.path.append(os.environ['PER...
gpl-2.0
Svjard/presto-admin
prestoadmin/topology.py
1
7937
# -*- coding: utf-8 -*- # # 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
youdonghai/intellij-community
python/lib/Lib/site-packages/django/db/backends/postgresql/base.py
241
7448
""" PostgreSQL database backend for Django. Requires psycopg 1: http://initd.org/projects/psycopg1 """ import sys from django.db import utils from django.db.backends import * from django.db.backends.signals import connection_created from django.db.backends.postgresql.client import DatabaseClient from django.db.backe...
apache-2.0
brchiu/tensorflow
tensorflow/contrib/timeseries/python/timeseries/state_space_models/structural_ensemble.py
94
13419
# 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
beermix/xbmc
tools/EventClients/examples/python/example_button2.py
228
2074
#!/usr/bin/python # This is a simple example showing how you can send a key press event # to XBMC in a non-queued fashion to achieve a button pressed down # event i.e. a key press that repeats. # The repeat interval is currently hard coded in XBMC but that might # change in the future. # NOTE: Read the comments in '...
gpl-2.0
csulb-cecs424-2015fa/Lectures
Python/Functions/callbyobject.py
20
1054
# Python's term for passing arguments to functions is "call by object". # What does that mean? # It's easy to overcomplicate, so don't. When an argument is passed to # a function, the function's namespace binds its parameter name to the # passed argument in the same way that any other assignment is handled. # This mea...
mit
bobcyw/django
tests/fixtures/tests.py
112
38691
from __future__ import unicode_literals import os import sys import tempfile import unittest import warnings from django.apps import apps from django.contrib.sites.models import Site from django.core import management from django.core.files.temp import NamedTemporaryFile from django.core.serializers.base import Progr...
bsd-3-clause
linkedin/indextank-service
storefront/boto/ec2/cloudwatch/__init__.py
2
8606
# Copyright (c) 2006-2009 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
abn/yabgp
yabgp/core/factory.py
1
11723
# Copyright (c) 2007 by Mark Bergsma <mark@nedworks.org> # # 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...
apache-2.0
CoDEmanX/ArangoDB
3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_netrc.py
99
1116
import netrc, os, unittest, sys from test import test_support TEST_NETRC = """ machine foo login log1 password pass1 account acct1 macdef macro1 line1 line2 macdef macro2 line3 line4 default login log2 password pass2 """ temp_filename = test_support.TESTFN class NetrcTestCase(unittest.TestCase): def setUp ...
apache-2.0
Yuriy-Leonov/nova
nova/tests/compute/test_multiple_nodes.py
12
7173
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2012 NTT DOCOMO, 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.apach...
apache-2.0
obruns/gmock
scripts/generator/gmock_gen.py
1159
1091
#!/usr/bin/env python # # Copyright 2008 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 requir...
bsd-3-clause
rouge8/pex
pex/common.py
12
9663
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from __future__ import print_function import atexit import contextlib import errno import os import shutil import stat import sys import tempfile import threading import zipfile from coll...
apache-2.0