repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
julian-seward1/servo
tests/wpt/css-tests/tools/py/py/_code/_py2traceback.py
275
2765
# copied from python-2.7.3's traceback.py # CHANGES: # - some_str is replaced, trying to create unicode strings # import types def format_exception_only(etype, value): """Format the exception part of a traceback. The arguments are the exception type and value such as given by sys.last_type and sys.last_va...
mpl-2.0
myakura/WebFundamentals
gae/lib/markdown/extensions/smarty.py
62
10360
# -*- coding: utf-8 -*- ''' Smarty extension for Python-Markdown ==================================== Adds conversion of ASCII dashes, quotes and ellipses to their HTML entity equivalents. See <https://pythonhosted.org/Markdown/extensions/smarty.html> for documentation. Author: 2013, Dmitry Shachnev <mitya57@gmail.c...
apache-2.0
ging/horizon
openstack_dashboard/dashboards/idm/utils.py
1
4929
# Copyright (C) 2014 Universidad Politecnica de Madrid # # 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...
apache-2.0
PandaWei/tp-qemu
qemu/deps/win_driver_install/win_driver_install.py
6
9079
import os import re import sys import shutil import logging import argparse import subprocess def cmd_output(cmd): """ Execute specified cmd and get the cmd output. :param cmd: Cmd which will be executed. """ logger.debug("Sending command: %s" % cmd) try: p = subproce...
gpl-2.0
azurestandard/django
django/conf/locale/nb/formats.py
26
1721
# -*- 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 = 'j. F Y' TIME_FORMAT = 'H:i' DATET...
bsd-3-clause
kouk/boto
tests/unit/route53/test_connection.py
79
32309
#!/usr/bin/env python # Copyright (c) 2013 Amazon.com, Inc. or its affiliates. All Rights Reserved # # 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 ...
mit
jhrozek/samba-ldb-mdb
third_party/dnspython/dns/rdataset.py
91
11548
# Copyright (C) 2001-2007, 2009-2011 Nominum, Inc. # # Permission to use, copy, modify, and distribute this software and its # documentation for any purpose with or without fee is hereby granted, # provided that the above copyright notice and this permission notice # appear in all copies. # # THE SOFTWARE IS PROVIDED "...
gpl-3.0
pymedusa/SickRage
ext/github/GitRef.py
2
5340
# -*- coding: utf-8 -*- ############################ Copyrights and license ############################ # # # Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> # # Copyright 2012 Zearin <zearin@gonk.net> ...
gpl-3.0
lhupfeldt/multiconf
test/mixed_test.py
1
2458
# Copyright (c) 2012 Lars Hupfeldt Nielsen, Hupfeldt IT # All rights reserved. This work is under a BSD license, see LICENSE.TXT. from multiconf import mc_config, ConfigItem, RepeatableConfigItem, ConfigBuilder, MC_REQUIRED from multiconf.decorators import nested_repeatables, named_as, required from multiconf.envs imp...
bsd-3-clause
joshmoore/bioformats
docs/sphinx/_ext/edit_on_github.py
20
1317
""" Sphinx extension to add ReadTheDocs-style "Edit on GitHub" links to the sidebar. Loosely based on https://github.com/astropy/astropy/pull/347 """ import os import warnings __licence__ = 'BSD (3 clause)' def get_github_url(app, view, path): return '{root_url}/{project}/{view}/{branch}/{prefix}/{path}'.form...
gpl-2.0
FLYKingdom/MyCode
PycharmProjects/PythonTest/FunctionalProgramming.py
1
3606
# 函数式编程 # 高阶函数 # map函数 def square(x): return x * x * x r = map(square, [1, 2, 3]) print(list(r)) # reduce 函数 from functools import reduce def fn(x, y): return x * 10 + y print(reduce(fn, [1, 2, 3])) is_str = isinstance(reduce(fn, [1, 2, 3]), int) print(is_str) DIGITS = {'0': 0, '1': 1, '2': 2, '3': ...
mit
valrus/mingus3
mingus/extra/LilyPond.py
2
7739
#!/usr/bin/python # -*- coding: utf-8 -*- """ ================================================================================ mingus - Music theory Python package, LilyPond module Copyright (C) 2008-2009, Bart Spaans This program is free software: you can redistribute it and/or modify it under the t...
gpl-3.0
40223247/test2
static/Brython3.1.1-20150328-091302/Lib/unittest/test/test_assertions.py
738
15398
import datetime import warnings import unittest from itertools import product class Test_Assertions(unittest.TestCase): def test_AlmostEqual(self): self.assertAlmostEqual(1.00000001, 1.0) self.assertNotAlmostEqual(1.0000001, 1.0) self.assertRaises(self.failureException, ...
gpl-3.0
forpster/dotfiles
home/.emacs.d/.python-environments/default/lib/python2.7/site.py
784
27543
"""Append module search paths for third-party packages to sys.path. **************************************************************** * This module is automatically imported during initialization. * **************************************************************** In earlier versions of Python (up to 1.5a3), scripts or...
mit
rohitwaghchaure/erpnext_smart
erpnext/patches/v4_0/update_custom_print_formats_for_renamed_fields.py
39
1268
# Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors # License: GNU General Public License v3. See license.txt from __future__ import unicode_literals import frappe import re def execute(): # NOTE: sequence is important fields_list = ( ("amount", "base_amount"), ("ref_rate", "price_list_rate"...
agpl-3.0
jgeewax/gcloud-python
pubsub/google/cloud/pubsub/subscription.py
2
19783
# Copyright 2015 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 writing, ...
apache-2.0
starcraftman/boostEx
GetLibs.py
2
11670
#!/usr/bin/env python # PYTHON_ARGCOMPLETE_OK # Common tools: # pip/pip3 : install packages # pylint/pychecker : verify syntax # unittest package for xUnit. """ Build C libraries for development. This version is inlined to be inedependent of SysInstall.py """ # Imports from __future__ import print_function import ...
mit
fperazzi/davis
cpp/Boost.NumPy/libs/numpy/test/indexing.py
7
1822
#!/usr/bin/env python # Copyright Jim Bosch & Ankit Daftery 2010-2012. # Distributed under the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) import unittest import numpy import indexing_mod class TestIndexing(unittest.Test...
bsd-3-clause
roatienza/Deep-Learning-Experiments
keras/regularization/mlp-mnist-l2.py
1
2077
''' MLP network for MNIST digits classification with L2 reg Test accuracy: 95.2% ''' from __future__ import absolute_import from __future__ import division from __future__ import print_function # numpy package import numpy as np from keras.models import Sequential from keras.layers import Dense, Activation from keras...
mit
mbirru/midonet-charms
midonet-api/hooks/charmhelpers/payload/archive.py
12
1571
import os import tarfile import zipfile from charmhelpers.core import ( host, hookenv, ) class ArchiveError(Exception): pass def get_archive_handler(archive_name): if os.path.isfile(archive_name): if tarfile.is_tarfile(archive_name): return extract_tarfile elif zipfile.is...
apache-2.0
SaikWolf/gnuradio
docs/doxygen/doxyxml/generated/index.py
344
1871
#!/usr/bin/env python """ Generated Mon Feb 9 19:08:05 2009 by generateDS.py. """ from xml.dom import minidom import os import sys import compound import indexsuper as supermod class DoxygenTypeSub(supermod.DoxygenType): def __init__(self, version=None, compound=None): supermod.DoxygenType.__init__(se...
gpl-3.0
jvehent/MozDef
examples/demo/json2MQ.py
9
2117
#!/usr/bin/env python # # 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/. # Copyright (c) 2014 Mozilla Corporation # # Contributors: # Jeff Bryner jbryner@mozilla.com # # ...
mpl-2.0
jordanmsn12/volatility
contrib/plugins/verinfo.py
44
17121
# Volatility # # Authors: # Mike Auty <mike.auty@gmail.com> # # This file is part of Volatility. # # Volatility 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 op...
gpl-2.0
tipabu/swift
test/unit/common/middleware/test_proxy_logging.py
2
49756
# Copyright (c) 2010-2011 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 agree...
apache-2.0
drtuxwang/system-config
bin/plink.py
1
4176
#!/usr/bin/env python3 """ Create links to picture/video files. """ import argparse import glob import os import signal import sys from typing import List import config_mod import file_mod class Options: """ Options class """ def __init__(self) -> None: self._args: argparse.Namespace = None...
gpl-2.0
nzavagli/UnrealPy
UnrealPyEmbed/Development/Python/2015.08.07-Python2710-x64-Source-vs2015/Python27/Source/Scrapy-1.0.1/tests/test_logformatter.py
49
2108
import unittest from scrapy.spiders import Spider from scrapy.http import Request, Response from scrapy.item import Item, Field from scrapy.logformatter import LogFormatter class CustomItem(Item): name = Field() def __str__(self): return "name: %s" % self['name'] class LoggingContribTest(unittest...
mit
sunqm/pyscf
pyscf/tools/dump_mat.py
1
8525
#!/usr/bin/env python # Copyright 2014-2018 The PySCF Developers. 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 # # U...
apache-2.0
alvaroaleman/ansible
lib/ansible/modules/cloud/vmware/vmware_target_canonical_facts.py
32
2972
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Joseph Callen <jcallen () csc.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the Li...
gpl-3.0
sdopoku/flask-blog
env/lib/python2.7/site-packages/setuptools/command/install_egg_info.py
357
3833
from setuptools import Command from setuptools.archive_util import unpack_archive from distutils import log, dir_util import os, shutil, pkg_resources class install_egg_info(Command): """Install an .egg-info directory for the package""" description = "Install an .egg-info directory for the package" user_...
gpl-2.0
GloomyShow/learn-python3
samples/commonlib/use_urllib.py
20
2195
#!/usr/bin/env python3 # -*- coding: utf-8 -*- from urllib import request, parse # get: with request.urlopen('https://api.douban.com/v2/book/2129650') as f: data = f.read() print('Status:', f.status, f.reason) for k, v in f.getheaders(): print('%s: %s' % (k, v)) print('Data:', data.decode('ut...
gpl-2.0
elijah513/scikit-learn
examples/model_selection/plot_validation_curve.py
229
1823
""" ========================== Plotting Validation Curves ========================== In this plot you can see the training scores and validation scores of an SVM for different values of the kernel parameter gamma. For very low values of gamma, you can see that both the training score and the validation score are low. ...
bsd-3-clause
krafczyk/spack
var/spack/repos/builtin/packages/highfive/package.py
5
2221
############################################################################## # Copyright (c) 2013-2018, Lawrence Livermore National Security, LLC. # Produced at the Lawrence Livermore National Laboratory. # # This file is part of Spack. # Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved. # LLNL-CODE-64...
lgpl-2.1
Yukarumya/Yukarum-Redfoxes
python/psutil/psutil/_pswindows.py
5
18223
#!/usr/bin/env python # Copyright (c) 2009, Giampaolo Rodola'. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Windows platform implementation.""" import errno import functools import os import sys from collections import namedtuple from ...
mpl-2.0
wimberosa/samba
source4/heimdal/lib/wind/UnicodeData.py
82
2167
#!/usr/local/bin/python # -*- coding: iso-8859-1 -*- # $Id$ # Copyright (c) 2004 Kungliga Tekniska Högskolan # (Royal Institute of Technology, Stockholm, Sweden). # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following...
gpl-3.0
bayesimpact/bob-emploi
frontend/server/asynchronous/test/update_email_sent_status_test.py
1
9477
"""Tests for the update_email_sent_status module.""" import datetime import typing import unittest from unittest import mock import mailjet_rest import mongomock from bob_emploi.frontend.server.asynchronous import update_email_sent_status from bob_emploi.frontend.server.test import mailjetmock @mailjetmock.patch()...
gpl-3.0
unseenlaser/python-for-android
python-modules/twisted/twisted/protocols/gps/rockwell.py
61
11638
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """Rockwell Semiconductor Zodiac Serial Protocol Coded from official protocol specs (Order No. GPS-25, 09/24/1996, Revision 11) Maintainer: Bob Ippolito The following Rockwell Zodiac messages are currently understood:: EARTHA\\r\...
apache-2.0
jcarlson23/repo
subcmds/selfupdate.py
82
1931
# # Copyright (C) 2009 The Android Open Source Project # # 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...
apache-2.0
xuweiliang/Codelibrary
nova/cells/filters/target_cell.py
77
2657
# Copyright (c) 2012-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 # # Unles...
apache-2.0
adamgreen/mbed
tools/synch.py
54
11095
""" mbed SDK Copyright (c) 2011-2013 ARM Limited 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 wr...
apache-2.0
BhallaLab/moose-core
python/moose/neuroml/NetworkML.py
3
25762
# -*- coding: utf-8 -*- ## Description: class NetworkML for loading NetworkML from file or xml element into MOOSE ## Version 1.0 by Aditya Gilra, NCBS, Bangalore, India, 2011 for serial MOOSE ## Version 1.5 by Niraj Dudani, NCBS, Bangalore, India, 2012, ported to parallel MOOSE ## Version 1.6 by Aditya Gilra, NCBS, Ban...
gpl-3.0
breathe/ansible
lib/ansible/errors/__init__.py
163
7342
# (c) 2012-2014, Michael DeHaan <michael.dehaan@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 3 of the License, or # (at your option) an...
gpl-3.0
WhatWorksWhenForWhom/nlppln
nlppln/commands/save_ner_data.py
1
1125
#!/usr/bin/env python import click import os import codecs import json import pandas as pd from nlppln.utils import create_dirs, get_files @click.command() @click.argument('in_dir', type=click.Path(exists=True)) @click.option('--out_dir', '-o', default=os.getcwd(), type=click.Path()) @click.option('--name', '-n', de...
apache-2.0
nictuku/nwu
nwu/common/scheduler.py
1
3753
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2008 Stephan Peijnik (sp@gnu.org) # # This file is part of NWU. # # NWU 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...
gpl-3.0
AlertMe/cerbero
test/test_cerbero_packages_disttarball.py
27
2959
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
lgpl-2.1
jcftang/ansible-modules-extras
packaging/os/portage.py
60
12868
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Yap Sok Ann # Written by Yap Sok Ann <sokann@gmail.com> # Based on apt module written by Matthew Williams <matthew@flowroute.com> # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as publi...
gpl-3.0
Shu-Ji/multi-supervisord-web-admin
src/models.py
1
2943
# coding: u8 from tornado.util import ObjectDict from sqlalchemy import create_engine from sqlalchemy import (Column, Integer, Text, String, Boolean) from sqlalchemy.ext.declarative import declarative_base from sqlalchemy.orm import sessionmaker from sqlalchemy.orm.attributes import InstrumentedAttribute import sett...
unlicense
rudhir-upretee/SUMO_Src
tools/sumolib/miscutils.py
2
3667
#!/usr/bin/env python """ @file miscutils.py @author Jakob.Erdmann@dlr.de @date 2012-05-08 @version $Id: miscutils.py 12617 2012-08-30 08:01:43Z namdre $ Common utility functions Copyright (C) 2007 DLR/FS, Germany All rights reserved This is a duplicate of tools/util/miscutils.py from the VABENE repository ""...
gpl-3.0
ECYS-USAC/cpfecys
src/cpfecys/routes.example.py
22
1470
# -*- coding: utf-8 -*- # This is an app-specific example router # # This simple router is used for setting languages from app/languages directory # as a part of the application path: app/<lang>/controller/function # Language from default.py or 'en' (if the file is not found) is used as # a default_language # # ...
lgpl-3.0
kevin8909/xjerp
openerp/addons/base_report_designer/installer.py
54
3134
# -*- 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
zhiyisun/linux
tools/perf/scripts/python/syscall-counts.py
1996
1700
# system call counts # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # Displays system-wide system call totals, broken down by syscall. # If a [comm] arg is specified, only syscalls called by [comm] are displayed. import os import sys sys.path.append(os.envir...
gpl-2.0
tudarmstadt-lt/context-eval
twsi_upper_bound.py
2
1796
import twsi_eval import argparse from pandas import read_csv from twsi_eval import TWSI_INVENTORY, map_sense_inventories, calculate_evaluation_scores TWSI_DATASET = 'data/Dataset-TWSI-2.csv' def evaluate_uppper_bound(twsi_dataset_fath, user2twsi): print 'Estimating upper bound performance: ', twsi_dataset_fath ...
apache-2.0
lukauskas/scipy
scipy/_lib/decorator.py
55
8804
########################## LICENCE ############################### ## ## Copyright (c) 2005-2011, Michele Simionato ## All rights reserved. ## ## Redistributions of source code must retain the above copyright ## notice, this list of conditions and the following disclaimer. ## Redistributions in byteco...
bsd-3-clause
ghchinoy/tensorflow
tensorflow/python/keras/utils/data_utils_test.py
4
11046
# 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
huiyiqun/check_mk
cmk/log.py
1
7362
#!/usr/bin/env python # -*- encoding: utf-8; py-indent-offset: 4 -*- # +------------------------------------------------------------------+ # | ____ _ _ __ __ _ __ | # | / ___| |__ ___ ___| | __ | \/ | |/ / | # | | | | '_ \ / _ \/ __| ...
gpl-2.0
wenderen/servo
tests/wpt/css-tests/css-text-decor-3_dev/html/reference/support/generate-text-emphasis-style-property-tests.py
841
3434
#!/usr/bin/env python # - * - coding: UTF-8 - * - """ This script generates tests text-emphasis-style-property-011 ~ 020 which cover all possible values of text-emphasis-style property, except none and <string>, with horizontal writing mode. It outputs a list of all tests it generated in the format of Mozilla reftest....
mpl-2.0
goodfeli/pylearn2
pylearn2/datasets/cache.py
37
14688
""" Dataset preloading tool This file provides the ability to make a local cache of a dataset or part of it. It is meant to help in the case where multiple jobs are reading the same dataset from ${PYLEARN2_DATA_PATH}, which may cause a great burden on the network. With this file, it is possible to make a local copy (...
bsd-3-clause
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/pymongo/auth.py
13
9015
# Copyright 2013-2014 MongoDB, 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 writin...
agpl-3.0
axbaretto/beam
learning/katas/python/IO/TextIO/ReadFromText/tests.py
7
1364
# 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...
apache-2.0
GauravSahu/odoo
addons/crm_partner_assign/report/__init__.py
443
1096
# -*- 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
alexthered/kienhoc-platform
lms/djangoapps/instructor/enrollment.py
43
16570
""" Enrollment operations for use by instructor APIs. Does not include any access control, be sure to check access before calling. """ import json import logging from django.contrib.auth.models import User from django.conf import settings from django.core.urlresolvers import reverse from django.core.mail import send_...
agpl-3.0
nicoboss/Floatmotion
OpenGL/raw/GL/ARB/imaging.py
9
9314
'''Autogenerated by xml_generate script, do not edit!''' from OpenGL import platform as _p, arrays # Code generation uses this from OpenGL.raw.GL import _types as _cs # End users want this... from OpenGL.raw.GL._types import * from OpenGL.raw.GL import _errors from OpenGL.constant import Constant as _C import ctypes _...
agpl-3.0
garaden/flask
flask/blueprints.py
141
16871
# -*- coding: utf-8 -*- """ flask.blueprints ~~~~~~~~~~~~~~~~ Blueprints are the recommended way to implement larger or more pluggable applications in Flask 0.7 and later. :copyright: (c) 2015 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from functools import update_wrap...
bsd-3-clause
Kazade/NeHe-Website
google_appengine/lib/django-1.5/django/contrib/sessions/backends/cached_db.py
102
2432
""" Cached, database-backed sessions. """ from django.contrib.sessions.backends.db import SessionStore as DBStore from django.core.cache import cache from django.core.exceptions import SuspiciousOperation from django.utils import timezone KEY_PREFIX = "django.contrib.sessions.cached_db" class SessionStore(DBStore):...
bsd-3-clause
mgracer48/panda3d
direct/src/gui/DirectWaitBar.py
1
4632
"""Undocumented Module""" __all__ = ['DirectWaitBar'] from panda3d.core import * import DirectGuiGlobals as DGG from DirectFrame import * import types """ import DirectWaitBar d = DirectWaitBar(borderWidth=(0, 0)) """ class DirectWaitBar(DirectFrame): """ DirectWaitBar - A DirectWidget that shows progress compl...
bsd-3-clause
anthonyalmarza/trex
tests/test_watch.py
1
4071
# from trex import redis # # from .mixins import REDIS_HOST, REDIS_PORT # # # class TestRedisConnections(unittest.TestCase): # _KEYS = ['trex:testwatch1', 'trex:testwatch2'] # # @defer.inlineCallbacks # def setUp(self): # self.connections = [] # self.db = yield self._getRedisConnection() # ...
mit
alangwansui/mtl_ordercenter
openerp/addons/base_action_rule/tests/__init__.py
178
1129
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (c) 2012-TODAY OpenERP S.A. <http://openerp.com> # # This program is free software: you can redistribute it and/or modify # it under the terms of ...
agpl-3.0
ptitdoc/Archive-qubes-core
dom0/qvm-core/qubesutils.py
1
79072
#!/usr/bin/python # # The Qubes OS Project, http://www.qubes-os.org # # Copyright (C) 2011 Marek Marczykowski <marmarek@invisiblethingslab.com> # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation;...
gpl-2.0
nilbody/h2o-3
h2o-py/tests/testdir_munging/unop/pyunit_asnumeric.py
10
1043
import sys sys.path.insert(1,"../../../") import h2o from tests import pyunit_utils def asnumeric(): h2oframe = h2o.import_file(path=pyunit_utils.locate("smalldata/junit/cars.csv")) rows = h2oframe.nrow # H2OFrame case h2oframe = h2oframe.asnumeric() h2oframe['cylinders'] = h2oframe['cyl...
apache-2.0
detiber/ansible
lib/ansible/plugins/callback/foreman.py
47
7209
# -*- coding: utf-8 -*- # (C) 2015, 2016 Daniel Lobato <elobatocs@gmail.com> # 2016 Guido Günther <agx@sigxcpu.org> # # 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 Foundati...
gpl-3.0
XXMrHyde/android_external_chromium_org
tools/json_schema_compiler/cpp_util_test.py
72
1278
#!/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 cpp_util import unittest class CppUtilTest(unittest.TestCase): def testClassname(self): self.assertEquals('Permission...
bsd-3-clause
madflow/seahub
seahub/auth/admin.py
40
6068
from django import template from django.db import transaction from django.conf import settings from django.contrib import admin from django.contrib.auth.forms import UserCreationForm, UserChangeForm, AdminPasswordChangeForm from django.contrib.auth.models import User, Group from django.contrib import messages from djan...
apache-2.0
Arable/evepod
lib/python2.7/site-packages/newrelic-2.12.0.10/newrelic/hooks/nosql_pymongo.py
5
1288
import newrelic.api.function_trace _methods = ['save', 'insert', 'update', 'drop', 'remove', 'find_one', 'find', 'count', 'create_index', 'ensure_index', 'drop_indexes', 'drop_index', 'reindex', 'index_information', 'options', 'group', 'rename', 'distinct', 'map_reduce', 'inline_map...
apache-2.0
khs26/pele
pele/systems/bljcluster.py
4
5315
import tempfile from pele.systems import AtomicCluster from pele.potentials import BLJCut from pele.utils.xyz import write_xyz from pele.mindist import CoMToOrigin __all__ = ["BLJCluster"] class BLJCluster(AtomicCluster): """ define the System class for a binary Lennard-Jones cluster Parameters ...
gpl-3.0
Perferom/android_external_chromium
net/tools/testserver/xmppserver_test.py
67
8391
#!/usr/bin/python2.4 # 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. """Tests exercising the various classes in xmppserver.py.""" import unittest import base64 import xmppserver class XmlUtilsTest(u...
bsd-3-clause
hehongliang/tensorflow
tensorflow/python/kernel_tests/unstack_op_test.py
1
6055
# Copyright 2015 The TensorFlow Authors. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applica...
apache-2.0
BlackPole/bp-enigma2
lib/python/Plugins/Extensions/GraphMultiEPG/GraphMultiEpg.py
3
38529
from skin import parseColor, parseFont, parseSize from Components.config import config, ConfigClock, ConfigInteger, ConfigSubsection, ConfigYesNo, ConfigSelection, ConfigSelectionNumber from Components.Pixmap import Pixmap from Components.Button import Button from Components.ActionMap import HelpableActionMap from Comp...
gpl-2.0
jenfly/atmos-read
scripts/merra-replace-data.py
1
5275
""" Replace corrupted data files with daily data re-downloaded with wget """ import sys sys.path.append('/home/jwalker/dynamics/python/atmos-tools') sys.path.append('/home/jwalker/dynamics/python/atmos-read') import os import shutil import xarray as xray import numpy as np import collections import time import matplo...
mit
dorotan/pythontraining
env/Lib/site-packages/_pytest/nose.py
228
2527
""" run test suites written for nose. """ import sys import py import pytest from _pytest import unittest def get_skip_exceptions(): skip_classes = set() for module_name in ('unittest', 'unittest2', 'nose'): mod = sys.modules.get(module_name) if hasattr(mod, 'SkipTest'): skip_cla...
apache-2.0
duyet-website/api.duyet.net
lib/numpy/distutils/tests/test_fcompiler_intel.py
146
1224
from __future__ import division, absolute_import, print_function import numpy.distutils.fcompiler from numpy.testing import TestCase, run_module_suite, assert_ intel_32bit_version_strings = [ ("Intel(R) Fortran Intel(R) 32-bit Compiler Professional for applications" "running on Intel(R) 32, Version 11.1", '...
mit
ivanyu/rosalind
algorithmic_heights/sc/sc.py
1
1421
#!/usr/bin/env python3 # -*- coding: utf-8 -*- def main(argv): from sc_logic import check_semi_connectedness graphs = [] if len(argv) < 2: print('k = 2') k = 2 print('Graph 1:') print('n = 3') n = 3 print('m = 2') m = 2 g = [[0 for i in ran...
mit
QGuLL/samba
python/samba/tests/dcerpc/dnsserver.py
27
13654
# Unix SMB/CIFS implementation. # Copyright (C) Amitay Isaacs <amitay@gmail.com> 2011 # # 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...
gpl-3.0
xen0l/ansible
lib/ansible/modules/network/f5/bigip_device_ntp.py
8
7943
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2017 F5 Networks Inc. # 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
openstack/tacker
tacker/objects/grant.py
1
11110
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
vamsirajendra/nupic
ci/travis/deploy-wheel-to-s3.py
34
1809
#!/usr/bin/env python # ---------------------------------------------------------------------- # Numenta Platform for Intelligent Computing (NuPIC) # Copyright (C) 2013, Numenta, Inc. Unless you have an agreement # with Numenta, Inc., for a separate license for this software code, the # following terms and conditions ...
agpl-3.0
jeiranj/gensim
gensim/corpora/lowcorpus.py
73
7185
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright (C) 2010 Radim Rehurek <radimrehurek@seznam.cz> # Licensed under the GNU LGPL v2.1 - http://www.gnu.org/licenses/lgpl.html """ Corpus in GibbsLda++ format of List-Of-Words. """ from __future__ import with_statement import logging from gensim import utils ...
gpl-3.0
rmanoni/mi-instrument
mi/core/instrument/test/test_port_agent_client.py
1
29762
#!/usr/bin/env python """ @package ion.services.mi.test.test_port_agent_client @file ion/services/mi/test/test_port_agent_client.py @author David Everett @brief Some unit tests for R2 port agent client """ __author__ = 'David Everett' __license__ = 'Apache 2.0' # Ensure the test class is monkey patched for gevent fr...
bsd-2-clause
ezietsman/msc-thesis
images/makeunflat2.py
1
1059
from pylab import * import astronomy as ast # to format the labels better from matplotlib.ticker import FormatStrFormatter fmt = FormatStrFormatter('%1.2g') # or whatever X1 = load('ec2117ans_1_c.dat') x1 = X1[:,0] y1 = 10**(X1[:,2]/(-2.5)) y1 /= average(y1) T0 = 2453964.3307097 P = 0.1545255 figure(figsize=(6,4)...
mit
yeahooii/blog-vim-proj
vimfiles/bundle/ultisnips/pythonx/UltiSnips/snippet/source/file/ultisnips.py
3
5495
#!/usr/bin/env python # encoding: utf-8 """Parsing of snippet files.""" from collections import defaultdict import glob import os from UltiSnips import _vim from UltiSnips.snippet.definition import UltiSnipsSnippetDefinition from UltiSnips.snippet.source.file._base import SnippetFileSource from UltiSnips.snippet.sou...
gpl-2.0
zstyblik/infernal-twin
build/pip/build/lib.linux-i686-2.7/pip/_vendor/html5lib/sanitizer.py
283
17660
from __future__ import absolute_import, division, unicode_literals import re from xml.sax.saxutils import escape, unescape from six.moves import urllib_parse as urlparse from .tokenizer import HTMLTokenizer from .constants import tokenTypes content_type_rgx = re.compile(r''' ^ ...
gpl-3.0
Sveder/letsencrypt
letshelp-letsencrypt/letshelp_letsencrypt/apache.py
36
11029
#!/usr/bin/env python """Let's Encrypt Apache configuration submission script""" import argparse import atexit import contextlib import os import re import shutil import subprocess import sys import tarfile import tempfile import textwrap _DESCRIPTION = """ Let's Help is a simple script you can run to help out the Le...
apache-2.0
subramani95/neutron
neutron/plugins/metaplugin/meta_models_v2.py
24
1640
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # # Copyright 2012, Nachi Ueno, NTT MCL, 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://ww...
apache-2.0
WilJoey/tn_ckan
ckan/new_tests/lib/navl/test_validators.py
1
9126
# -*- coding: utf-8 -*- '''Unit tests for ckan/lib/navl/validators.py. ''' import copy import nose.tools import ckan.new_tests.factories as factories def returns_None(function): '''A decorator that asserts that the decorated function returns None. :param function: the function to decorate :type functi...
mit
gogogo/gogogo-hk
gaebar/urls.py
10
1240
# This Python file uses the following encoding: utf-8 """ Gaebar (Google App Engine Backup and Restore) Beta 1 A Naklab™ production sponsored by the <head> web conference - http://headconference.com Copyright (c) 2009 Aral Balkan. http://aralbalkan.com Released under the GNU GPL v3 License. See license.txt for ...
agpl-3.0
Android-AOSP/external_skia
tools/find_run_binary.py
163
1950
#!/usr/bin/python # Copyright (c) 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. """Module that finds and runs a binary by looking in the likely locations.""" import os import subprocess import sys def run_comman...
bsd-3-clause
vishwaprakashmishra/xmatrix
vumi/transports/mtn_rwanda/tests/test_mtn_rwanda_ussd.py
4
6453
import xmlrpclib from datetime import datetime from twisted.internet.defer import inlineCallbacks from twisted.internet import endpoints, tcp from twisted.internet.task import Clock from twisted.web.xmlrpc import Proxy from vumi.message import TransportUserMessage from vumi.transports.mtn_rwanda.mtn_rwanda_ussd import...
bsd-3-clause
SrNetoChan/QGIS
python/plugins/processing/gui/DirectorySelectorDialog.py
45
4455
# -*- coding: utf-8 -*- """ *************************************************************************** DirectorySelectorDialog.py --------------------- Date : May 2016 Copyright : (C) 2016 by Alexander Bruy Email : alexander dot bruy at gmail dot com *****...
gpl-2.0
device42/warranty_check
starter.py
1
6083
#!/usr/bin/env python import sys from Files.shared import Config, Device42rest from Files.warranty_cisco import Cisco from Files.warranty_dell import Dell from Files.warranty_hp import Hp from Files.warranty_ibm_lenovo import IbmLenovo from Files.warranty_meraki import Meraki def get_hardware_by_vendor(name): # ...
mit
Parallel-in-Time/pySDC
pySDC/playgrounds/Allen_Cahn/AllenCahn_contracting_circle_standard_integrators.py
1
5930
import time import matplotlib.pyplot as plt import matplotlib.ticker as ticker import numpy as np from pySDC.implementations.datatype_classes.mesh import mesh, imex_mesh from pySDC.implementations.problem_classes.AllenCahn_2D_FD import allencahn_fullyimplicit, allencahn_semiimplicit # http://www.personal.psu.edu/qu...
bsd-2-clause
fspaolo/scikit-learn
sklearn/cluster/tests/test_hierarchical.py
5
7058
""" Several basic tests for hierarchical clustering procedures """ # Authors: Vincent Michel, 2010, Gael Varoquaux 2012 # License: BSD 3 clause import warnings from tempfile import mkdtemp import numpy as np from scipy import sparse from scipy.cluster import hierarchy from sklearn.utils.testing import assert_true fr...
bsd-3-clause
buguelos/odoo
addons/account/wizard/pos_box.py
185
3431
from openerp.osv import fields, osv import openerp.addons.decimal_precision as dp from openerp.tools.translate import _ class CashBox(osv.osv_memory): _register = False _columns = { 'name' : fields.char('Reason', required=True), # Attention, we don't set a domain, because there is a journal_typ...
agpl-3.0