repo_name
stringlengths
5
100
path
stringlengths
4
294
copies
stringclasses
990 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
briandrawert/GillesPy
gillespy/gillespy.py
2
52338
""" A simple toolkit for creating and simulating discrete stochastic models in python. This serves primarily as a python wrapper for the C-based solvers within StochKit2. The gillespy.Model class provides nearly all of the functionality present in this project. This version is updated (4/2017) to contain documentat...
gpl-3.0
xadahiya/django
django/contrib/gis/utils/wkt.py
589
1923
""" Utilities for manipulating Geometry WKT. """ from django.utils import six def precision_wkt(geom, prec): """ Returns WKT text of the geometry according to the given precision (an integer or a string). If the precision is an integer, then the decimal places of coordinates WKT will be truncated t...
bsd-3-clause
bjornlevi/5thpower
nefndaralit/env/lib/python3.6/site-packages/pip/compat/dictconfig.py
921
23096
# This is a copy of the Python logging.config.dictconfig module, # reproduced with permission. It is provided here for backwards # compatibility for Python versions prior to 2.7. # # Copyright 2009-2010 by Vinay Sajip. All Rights Reserved. # # Permission to use, copy, modify, and distribute this software and its # docu...
mit
GbalsaC/bitnamiP
venv/lib/python2.7/site-packages/pbr/packaging.py
8
19776
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2011 OpenStack LLC. # Copyright 2012-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 ...
agpl-3.0
mzueger/linux-colibri-t30
tools/perf/scripts/python/sched-migration.py
11215
11670
#!/usr/bin/python # # Cpu task migration overview toy # # Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com> # # perf script event handlers have been generated by perf script -g python # # This software is distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Fre...
gpl-2.0
airelil/pywinauto
pywinauto/controls/uia_controls.py
2
54886
# GUI Application automation and testing library # Copyright (C) 2006-2018 Mark Mc Mahon and Contributors # https://github.com/pywinauto/pywinauto/graphs/contributors # http://pywinauto.readthedocs.io/en/latest/credits.html # All rights reserved. # # Redistribution and use in source and binary forms, with or without # ...
bsd-3-clause
Thoshh/wapad
lib/python2.7/site-packages/setuptools/__init__.py
114
5440
"""Extensions to the 'distutils' for large or complex distributions""" import os import functools import distutils.core import distutils.filelist from distutils.core import Command as _Command from distutils.util import convert_path from fnmatch import fnmatchcase from setuptools.extern.six.moves import filterfalse, ...
mit
adhoc-dev/odoo-addons
report_extended_purchase/__openerp__.py
4
1664
# -*- coding: utf-8 -*- ############################################################################## # # Copyright (C) 2015 ADHOC SA (http://www.adhoc.com.ar) # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Pu...
agpl-3.0
jgrocha/QGIS
python/plugins/grassprovider/GrassProviderPlugin.py
9
1574
# -*- coding: utf-8 -*- """ *************************************************************************** GrassProviderPlugin.py --------------------- Date : June 2021 Copyright : (C) 2021 by Alexander Bruy Email : alexander dot bruy at gmail dot com ********...
gpl-2.0
xujb/odoo
addons/project_issue/report/__init__.py
442
1084
# -*- 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
JCA-Developpement/Odoo
addons/l10n_ro/__openerp__.py
77
2045
# -*- encoding: utf-8 -*- ############################################################################## # # @author - Fekete Mihai <feketemihai@gmail.com> # Copyright (C) 2011 TOTAL PC SYSTEMS (http://www.www.erpsystems.ro). # Copyright (C) 2009 (<http://www.filsystem.ro>) # # This program is free softwa...
agpl-3.0
vlegoff/tsunami
src/secondaires/familier/fonctions/nb_familiers.py
1
2199
# -*-coding:Utf-8 -* # Copyright (c) 2010-2017 LE GOFF Vincent # 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 # ...
bsd-3-clause
faircloth-lab/data-theme
_plugins/jekyll-rst/transform.py
3
1115
import sys from docutils.core import publish_parts from optparse import OptionParser from docutils.frontend import OptionParser as DocutilsOptionParser from docutils.parsers.rst import Parser def transform(writer=None, part=None): p = OptionParser(add_help_option=False) # Collect all the command line opti...
mit
sekikn/incubator-airflow
airflow/providers/apache/livy/operators/livy.py
7
6347
# 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
Spiderlover/Toontown
toontown/coghq/SellbotBrutalLegFactorySpec.py
1
139108
from toontown.toonbase import TTLocalizer from toontown.coghq.SpecImports import * GlobalEntities = {1000: {'type': 'levelMgr', 'name': 'LevelMgr', 'comment': '', 'parentEntId': 0, 'cogLevel': 0, 'farPlaneDistance': 1500.0, 'modelFilename': 'phase_9/models/cogHQ/SelbotLeg...
mit
xiaoyaozi5566/DiamondCache
src/arch/x86/isa/insts/simd128/floating_point/arithmetic/simultaneous_addition_and_subtraction.py
46
2164
# Copyright (c) 2007 The Hewlett-Packard Development Company # 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 implemen...
bsd-3-clause
MoamerEncsConcordiaCa/tensorflow
tensorflow/contrib/bayesflow/python/ops/monte_carlo_impl.py
38
9901
# 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
justathoughtor2/atomicApe
cygwin/lib/python2.7/site-packages/pylint/reporters/html.py
3
3819
# Copyright (c) 2003-2013 LOGILAB S.A. (Paris, FRANCE). # This program is free software; you can redistribute it and/or modify it under # the terms of the GNU General Public License as published by the Free Software # Foundation; either version 2 of the License, or (at your option) any later # version. # # This program...
gpl-3.0
vmanoria/bluemix-hue-filebrowser
hue-3.8.1-bluemix/desktop/core/ext-py/Django-1.6.10/tests/utils_tests/test_ipv6.py
117
2847
from __future__ import unicode_literals from django.utils import unittest from django.utils.ipv6 import is_valid_ipv6_address, clean_ipv6_address class TestUtilsIPv6(unittest.TestCase): def test_validates_correct_plain_address(self): self.assertTrue(is_valid_ipv6_address('fe80::223:6cff:fe8a:2e8a')) ...
gpl-2.0
SimpleAOSP-Kernel/kernel_flo
tools/perf/scripts/python/Perf-Trace-Util/lib/Perf/Trace/Util.py
12527
1935
# Util.py - Python extension for perf script, miscellaneous utility code # # Copyright (C) 2010 by Tom Zanussi <tzanussi@gmail.com> # # This software may be distributed under the terms of the GNU General # Public License ("GPL") version 2 as published by the Free Software # Foundation. import errno, os FUTEX_WAIT = 0...
gpl-2.0
spinolacastro/openshift-ansible
roles/lib_zabbix/library/zbx_graphprototype.py
5
10218
#!/usr/bin/env python ''' Ansible module for zabbix graphprototypes ''' # vim: expandtab:tabstop=4:shiftwidth=4 # # Zabbix graphprototypes ansible module # # # Copyright 2015 Red Hat Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with t...
apache-2.0
ant9000/RIOT
tests/lwip/tests/01-run.py
7
16116
#! /usr/bin/env python3 # -*- coding: utf-8 -*- # vim:fenc=utf-8 # # Copyright © 2016 Martine Lenders <mail@martine-lenders.eu> # # Distributed under terms of the MIT license. from __future__ import print_function import os import sys import random import subprocess import time import types import pexpect import socke...
lgpl-2.1
s142857/servo
tests/wpt/web-platform-tests/tools/wptserve/wptserve/ranges.py
329
3003
from utils import HTTPException class RangeParser(object): def __call__(self, header, file_size): prefix = "bytes=" if not header.startswith(prefix): raise HTTPException(416, message="Unrecognised range type %s" % (header,)) parts = header[len(prefix):].split(",") rang...
mpl-2.0
maestrano/openerp
openerp/addons/portal/tests/test_portal.py
13
9475
# -*- 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
albertjan/pypyjs-presentation
assets/js/pypy.js-0.3.1/lib/modules/test/test_csv.py
7
44620
# -*- coding: utf-8 -*- # Copyright (C) 2001,2002 Python Software Foundation # csv package unit tests import sys import os import unittest from StringIO import StringIO import tempfile import csv import gc import io from test import test_support class Test_Csv(unittest.TestCase): """ Test the underlying C csv...
unlicense
kzlin129/practice-typing
lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/request.py
567
5808
# urllib3/request.py # Copyright 2008-2013 Andrey Petrov and contributors (see CONTRIBUTORS.txt) # # This module is part of urllib3 and is released under # the MIT License: http://www.opensource.org/licenses/mit-license.php try: from urllib.parse import urlencode except ImportError: from urllib import urlencod...
apache-2.0
daonb/Open-Knesset
knesset/wsgi.py
14
1136
""" WSGI config for knesset project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` ...
bsd-3-clause
chauhanhardik/populo
openedx/core/djangoapps/user_api/course_tag/api.py
174
1940
""" A service-like user_info interface. Could be made into an http API later, but for now just in-process. Exposes global and per-course key-value pairs for users. Implementation note: Stores global metadata using the UserPreference model, and per-course metadata using the UserCourseTag model. """ from ..models imp...
agpl-3.0
SlimRemix/android_external_chromium_org
tools/usb_gadget/package.py
33
2537
#!/usr/bin/python # Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """Utility to package and upload the USB gadget framework. """ import argparse import hashlib import os import StringIO import urllib2 imp...
bsd-3-clause
caesar2164/edx-platform
lms/djangoapps/mobile_api/video_outlines/serializers.py
46
8899
""" Serializer for video outline """ from rest_framework.reverse import reverse from xmodule.modulestore.mongo.base import BLOCK_TYPES_WITH_CHILDREN from xmodule.modulestore.django import modulestore from courseware.access import has_access from courseware.courses import get_course_by_id from courseware.model_data imp...
agpl-3.0
jbassen/edx-platform
lms/djangoapps/shoppingcart/migrations/0005_auto__add_paidcourseregistrationannotation__add_field_orderitem_report.py
114
9808
# -*- 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 model 'PaidCourseRegistrationAnnotation' db.create_table('shoppingcart_paidcourseregistrationannota...
agpl-3.0
juandav/frontend-arch
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/easy_xml.py
1558
4945
# Copyright (c) 2011 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 re import os def XmlToString(content, encoding='utf-8', pretty=False): """ Writes the XML content to disk, touching the file only if it has changed. ...
mit
Nike-Inc/cerberus-python-client
cerberus/client.py
1
28952
""" Copyright 2016-present Nike, 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, so...
apache-2.0
microelly2/cadquery-freecad-module
CadQuery/Libs/pyqode/core/api/decoration.py
3
6873
""" This module contains the text decoration API. """ from pyqode.qt import QtWidgets, QtCore, QtGui class TextDecoration(QtWidgets.QTextEdit.ExtraSelection): """ Helper class to quickly create a text decoration. The text decoration is an utility class that adds a few utility methods to QTextEdit.ExtraSe...
lgpl-3.0
raycarnes/account-financial-reporting
account_journal_report_xls/report/nov_account_journal_xls.py
21
18987
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2013 Noviat nv/sa (www.noviat.com). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under...
agpl-3.0
boundary/meter-plugin-vmware
modules/waitforupdates.py
2
9488
# # Copyright 2016 BMC Software, 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 ...
apache-2.0
ioos/pyoos
setup.py
1
1164
from __future__ import ( absolute_import, division, print_function, with_statement, ) from setuptools import find_packages, setup import versioneer def readme(): with open("README.rst") as f: return f.read() reqs = [line.strip() for line in open("requirements.txt")] setup( name="...
lgpl-3.0
inclement/kivy
kivy/storage/jsonstore.py
5
2550
''' JSON store ========== A :mod:`Storage <kivy.storage>` module used to save/load key-value pairs from a json file. ''' __all__ = ('JsonStore', ) import errno from os.path import exists, abspath, dirname from kivy.compat import iteritems from kivy.storage import AbstractStore from json import loads, dump class J...
mit
david-farrar/exaproxy
lib/exaproxy/util/log/logger.py
2
1779
# encoding: utf-8 """ log.py Created by Thomas Mangin on 2011-11-29. Copyright (c) 2011-2013 Exa Networks. All rights reserved. """ import time import logging from .message import message_store from .message import usage_store from .history import History class Logger: mailbox = message_store history = History(...
bsd-2-clause
cortedeltimo/SickRage
lib/sqlalchemy/dialects/postgresql/ranges.py
79
4805
# Copyright (C) 2013-2014 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 from .base import ischema_names from ... import types as sqltypes __all__ = ('INT4RANGE', 'INT8RANGE', ...
gpl-3.0
jswanljung/iris
lib/iris/tests/__init__.py
1
39426
# (C) British Crown Copyright 2010 - 2016, Met Office # # This file is part of Iris. # # Iris is free software: you can redistribute it and/or modify it under # the terms of the GNU Lesser General Public License as published by the # Free Software Foundation, either version 3 of the License, or # (at your option) any l...
lgpl-3.0
chappers/sklearn-recipes
streaming_take2/ogfs_classifier.py
3
9060
import sklearn from sklearn.datasets import make_regression, make_classification from sklearn.linear_model import SGDRegressor, SGDClassifier import pandas as pd import numpy as np import SPEC from scipy import stats from sklearn.metrics.pairwise import rbf_kernel from sklearn.mixture import BayesianGaussianMixture ...
mit
boyuegame/kbengine
kbe/res/scripts/common/Lib/cgi.py
74
35602
#! /usr/local/bin/python # NOTE: the above "/usr/local/bin/python" is NOT a mistake. It is # intentionally NOT "/usr/bin/env python". On many systems # (e.g. Solaris), /usr/local/bin is not in $PATH as passed to CGI # scripts, and /usr/local/bin is the default directory where Python is # installed, so /usr/bin/env w...
lgpl-3.0
40223234/2015cdb_g1_0134
static/Brython3.1.1-20150328-091302/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...
gpl-3.0
posttk421/tgstation
tools/dmitool/dmitool.py
187
3364
""" Python 2.7 wrapper for dmitool. """ import os from subprocess import Popen, PIPE _JAVA_PATH = ["java"] _DMITOOL_CMD = ["-jar", "dmitool.jar"] def _dmitool_call(*dmitool_args, **popen_args): return Popen(_JAVA_PATH + _DMITOOL_CMD + [str(arg) for arg in dmitool_args], **popen_args) def _safe_parse(dict, key, ...
agpl-3.0
DAP-DarkneSS/Calculator
Calculator/val.py
1
5276
#!/usr/bin/env python2 # -*- coding: utf-8 -*- # A Python2 calculator for EPAM linux cource. # Copyright (C) 2014-2015 Dmitriy A. Perlow <dap.darkness@gmail.com> # This file is part of Calculator. # Calculator is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public Lice...
gpl-2.0
ckuethe/gnuradio
gr-fft/python/fft/__init__.py
54
1057
# # Copyright 2012 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
EvanK/ansible
lib/ansible/modules/network/f5/bigip_ssl_certificate.py
9
17763
#!/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
moylop260/rma
__unported__/crm_claim_rma/__openerp__.py
3
3763
# -*- coding: utf-8 -*- ############################################################################## # # Copyright 2013 Camptocamp # Copyright 2009-2013 Akretion, # Author: Emmanuel Samyn, Raphaël Valyi, Sébastien Beau, # Benoît Guillot, Joel Grand-Guillaume # # This program is free software: y...
agpl-3.0
kissbac/upm
examples/python/es08a.py
18
1647
# Author: John Van Drasek <john.r.van.drasek@intel.com> # Copyright (c) 2015 Intel Corporation. # # Permission is hereby granted, free of charge, to any person obtaining # a copy of this software and associated documentation files (the # "Software"), to deal in the Software without restriction, including # without lim...
mit
brandond/ansible
test/units/modules/storage/netapp/test_netapp_e_alerts.py
45
7488
# (c) 2018, NetApp Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) import json from ansible.modules.storage.netapp.netapp_e_alerts import Alerts from units.modules.utils import AnsibleExitJson, AnsibleFailJson, ModuleTestCase, set_module_args __metaclass__ = type from...
gpl-3.0
saurabh6790/tru_app_back
accounts/doctype/payment_to_invoice_matching_tool/payment_to_invoice_matching_tool.py
15
6137
# 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 webnotes from webnotes.utils import flt from webnotes.model.doc import addchild from webnotes.model.bean import getlist from webnotes import ...
agpl-3.0
jackliusr/scrapy-crawlers
crawlers/crawlers/spiders/toutiao.py
1
2558
import scrapy import json from selenium import webdriver from selenium.webdriver.common.desired_capabilities import DesiredCapabilities import time import re ''' 遇到不懂的问题?Python学习交流群:821460695满足你的需求,资料都已经上传群文件,可以自行下载! ''' class ToutiaoExampleSpider(scrapy.Spider): name = 'toutiao' allowed_domains = ['toutiao.com...
apache-2.0
nkgilley/home-assistant
tests/components/xiaomi/test_device_tracker.py
13
8791
"""The tests for the Xiaomi router device tracker platform.""" import logging import requests from homeassistant.components.device_tracker import DOMAIN import homeassistant.components.xiaomi.device_tracker as xiaomi from homeassistant.components.xiaomi.device_tracker import get_scanner from homeassistant.const impor...
apache-2.0
entropiae/processr
setup.py
1
1382
#!/usr/bin/env python # -*- coding: utf-8 -*- try: from setuptools import setup except ImportError: from distutils.core import setup with open('README.rst') as readme_file: readme = readme_file.read() with open('HISTORY.rst') as history_file: history = history_file.read() setup( name='processr...
mit
ghmajx/asuswrt-merlin
release/src/router/samba-3.6.13/source4/heimdal/lib/wind/util.py
88
1978
#!/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-2.0
Kaoline/Shinobi-PMing-Tool
framelogin.py
1
2414
# file --framelogin.py-- from tkinter import * from config import * class FrameLogin(Frame): def __init__(self, master, controller, **kw): super().__init__(master, **kw) self.controller = controller self.controller.deconnect() self.connect_account = StringVar() self.conne...
mit
wchan/tensorflow
tensorflow/python/kernel_tests/bcast_ops_test.py
15
2955
# Copyright 2015 Google Inc. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or a...
apache-2.0
dendisuhubdy/tensorflow
tensorflow/python/kernel_tests/sparsemask_op_test.py
133
1835
# 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
thnee/ansible
lib/ansible/modules/windows/win_toast.py
21
3274
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright: (c) 2017, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk> # Copyright: (c) 2017, Ansible Project # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) # this is a windows documentation stub. actual code lives in th...
gpl-3.0
jazztpt/edx-platform
common/lib/xmodule/xmodule/modulestore/perf_tests/test_asset_import_export.py
62
11683
""" Performance test for asset metadata in the modulestore. """ from path import path import unittest from tempfile import mkdtemp import itertools from shutil import rmtree from bson.code import Code import datetime import ddt #from nose.plugins.attrib import attr from nose.plugins.skip import SkipTest from xmodule.a...
agpl-3.0
fredreichbier/genie
genie/cabinet.py
1
1242
import os.path def normpath(filename): """ Return a normalized, absolute filename. On case-insensitive systems, this also converts the filename to lowercase. """ return os.path.normcase(os.path.abspath(filename)) class Cabinet(object): """ Just a helper class taking ca...
bsd-2-clause
mitnk/letsencrypt
letsencrypt/reverter.py
2
20911
"""Reverter class saves configuration checkpoints and allows for recovery.""" import csv import logging import os import shutil import time import zope.component from letsencrypt import constants from letsencrypt import errors from letsencrypt import interfaces from letsencrypt import le_util from letsencrypt.displa...
apache-2.0
PredictiveScienceLab/pysmc
pysmc/__init__.py
2
1517
""" .. moduleauthor:: Ilias Bilionis <ebilionis@mcs.anl.gov> .. _classes: ------- Classes ------- Here is complete reference of all the classes included in :mod:`pysmc`. .. automodule:: pysmc._mcmc_wrapper .. autoclass:: pysmc.MCMCWrapper :members: .. automodule:: pysmc._mpi .. autoclass:: pysmc.DistributedObje...
lgpl-3.0
brunocascio/compose
tests/unit/project_test.py
6
8737
from __future__ import unicode_literals from .. import unittest from compose.service import Service from compose.project import Project from compose.container import Container import mock import docker class ProjectTest(unittest.TestCase): def test_from_dict(self): project = Project.from_dicts('composete...
apache-2.0
PetePriority/home-assistant
homeassistant/components/idteck_prox/__init__.py
1
2171
"""Component for interfacing RFK101 proximity card readers. For more details about this component, please refer to the documentation at https://home-assistant.io/components/idteck_prox/ """ import logging import voluptuous as vol import homeassistant.helpers.config_validation as cv from homeassistant.const import ( ...
apache-2.0
jolyonb/edx-platform
common/test/acceptance/fixtures/certificates.py
1
2077
""" Tools for creating certificates config fixture data. """ import json from common.test.acceptance.fixtures import STUDIO_BASE_URL from common.test.acceptance.fixtures.base import StudioApiFixture class CertificateConfigFixtureError(Exception): """ Error occurred while installing certificate config fixtur...
agpl-3.0
pwoodworth/intellij-community
python/testData/inspections/PyUnnecessaryBackslashInspection/test.py
73
1768
def foo(year, month, day, hour, minute, second): if 1900 < year < 2100 and 1 <= month <= 12 \ and 1 <= day <= 31 and 0 <= hour < 24 \ and 0 <= minute < 60 and 0 <= second < 60: # Looks like a valid date return 1 if (True<warning descr="Unnecessary backslash in expression."> \</warning> or True<wa...
apache-2.0
joyxu/autotest
frontend/afe/rpcserver_logging.py
4
1181
import logging try: import autotest.common as common except ImportError: import common from autotest.client.shared.settings import settings LOGGING_ENABLED = settings.get_value('SERVER', 'rpc_logging', type=bool) MEGABYTE = 1024 * 1024 rpc_logger = None def configure_logging(): MAX_LOG_SIZE = settings...
gpl-2.0
rogerscristo/BotFWD
env/lib/python3.6/site-packages/future/backports/html/entities.py
70
75429
"""HTML character entity references. Backported for python-future from Python 3.3 """ from __future__ import (absolute_import, division, print_function, unicode_literals) from future.builtins import * # maps the HTML entity name to the Unicode codepoint name2codepoint = { 'AElig': 0x0...
mit
HiroIshikawa/21playground
flask-sample/hello/venv/lib/python3.5/site-packages/simplejson/tests/test_recursion.py
149
1679
from unittest import TestCase import simplejson as json class JSONTestObject: pass class RecursiveJSONEncoder(json.JSONEncoder): recurse = False def default(self, o): if o is JSONTestObject: if self.recurse: return [JSONTestObject] else: re...
mit
cesargtz/YecoraOdoo
addons/mail/res_users.py
314
10337
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2009-Today OpenERP SA (<http://www.openerp.com>) # # This program is free software: you can redistribute it and/or modify # it under the terms o...
agpl-3.0
isrohutamahopetechnik/MissionPlanner
Lib/token.py
61
3086
#! /usr/bin/env python """Token constants (from "token.h").""" # This file is automatically generated; please don't muck it up! # # To update the symbols in this file, 'cd' to the top directory of # the python source tree after building the interpreter and run: # # python Lib/token.py #--start const...
gpl-3.0
tanglei528/nova
nova/tests/api/openstack/compute/extensions/foxinsocks.py
16
2946
# Copyright 2011 OpenStack Foundation # 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 requ...
apache-2.0
jnewland/home-assistant
tests/components/deconz/test_scene.py
7
2991
"""deCONZ scene platform tests.""" from unittest.mock import Mock, patch from homeassistant import config_entries from homeassistant.components import deconz from homeassistant.setup import async_setup_component import homeassistant.components.scene as scene from tests.common import mock_coro GROUP = { "1": { ...
apache-2.0
UndeadBaneGitHub/spark
examples/src/main/python/mllib/kernel_density_estimation_example.py
128
1525
# # 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
SVADemoAPP/AmqpCode
python/qpid/connection.py
5
6996
# # Licensed to the Apache Software Foundation (ASF) under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. The ASF licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you may not...
apache-2.0
wemanuel/smry
server-auth/ls/google-cloud-sdk/platform/gsutil/gslib/tests/test_logging.py
38
2924
# -*- coding: utf-8 -*- # Copyright 2013 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 require...
apache-2.0
squidsoup/snapcraft
snaps_tests/demos_tests/test_webcam_webui.py
9
1031
# -*- Mode:Python; indent-tabs-mode:nil; tab-width:4 -*- # # Copyright (C) 2015, 2016 Canonical Ltd # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License version 3 as # published by the Free Software Foundation. # # This program is distributed in...
gpl-3.0
newerthcom/savagerebirth
libs/python-2.72/Lib/plat-mac/aepack.py
40
12268
"""Tools for use in AppleEvent clients and servers: conversion between AE types and python types pack(x) converts a Python object to an AEDesc object unpack(desc) does the reverse coerce(x, wanted_sample) coerces a python object to another python object """ # # This code was originally written by Guido, and modified/...
gpl-2.0
Maccimo/intellij-community
python/helpers/pycharm/runpy_compat.py
85
7540
import sys from types import ModuleType import os, imp class ImpLoader: code = source = None def __init__(self, fullname, file, filename, etc): self.file = file self.filename = filename self.fullname = fullname self.etc = etc def load_module(self, fullname): self._reopen() try: mod...
apache-2.0
fernandog/Medusa
medusa/providers/torrent/html/anidex.py
1
5154
# coding=utf-8 """Provider code for AniDex.""" from __future__ import unicode_literals import logging from medusa import tv from medusa.bs4_parser import BS4Parser from medusa.helper.common import convert_size, try_int from medusa.logger.adapters.style import BraceAdapter from medusa.providers.torrent.torrent_provi...
gpl-3.0
Thhhza/XlsxWriter
xlsxwriter/test/comparison/test_optimize09.py
8
1168
############################################################################### # # Tests for XlsxWriter. # # Copyright (c), 2013-2015, John McNamara, jmcnamara@cpan.org # from ..excel_comparsion_test import ExcelComparisonTest import sys from ...workbook import Workbook class TestCompareXLSXFiles(ExcelComparisonTes...
bsd-2-clause
marcelovilaca/DIRAC
DataManagementSystem/Service/StorageElementHandler.py
4
14894
######################################################################## # $HeadURL $ # File: StorageElementHandler.py ######################################################################## """ :mod: StorageElementHandler .. module: StorageElementHandler :synopsis: StorageElementHandler is the implementation of ...
gpl-3.0
theo-l/django
tests/template_tests/filter_tests/test_urlizetrunc.py
71
3367
from django.template.defaultfilters import urlizetrunc from django.test import SimpleTestCase from django.utils.safestring import mark_safe from ..utils import setup class UrlizetruncTests(SimpleTestCase): @setup({ 'urlizetrunc01': '{% autoescape off %}{{ a|urlizetrunc:"8" }} {{ b|urlizetrunc:"8" }}{% e...
bsd-3-clause
koobonil/Boss2D
Boss2D/addon/tensorflow-1.2.1_for_boss/tensorflow/python/ops/distributions/categorical.py
16
8750
# 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...
mit
ergoithz/ithz
ithz/lib/slimmer/slimmer.py
2
22440
#!/usr/bin/python """ slimmer.py Peter Bengtsson, mail@peterbe.com, 2004-2006 slimmer.py is a simple set of functions for compressing/optimizing HTML, XHTML and CSS documents as strings. Ideally used from other modules used something like this:: >>> import slimmer >>> code = open('file.html').read() >>> sl...
mit
ehabkost/tp-qemu
qemu/tests/perf_kvm.py
16
1472
from autotest.client import utils def run(test, params, env): """ run perf tool to get kvm events info :param test: kvm test object :param params: Dictionary with the test parameters :param env: Dictionary with test environment. """ vm = env.get_vm(params["main_vm"]) vm.verify_alive()...
gpl-2.0
BorisJeremic/Real-ESSI-Examples
analytic_solution/test_cases/27NodeBrick/square_plate_simply_support/2layer/side_length_10/compare_HDF5_ALL.py
424
3382
#!/usr/bin/python import h5py import sys import numpy as np import os import re import random # find the path to my own python function: cur_dir=os.getcwd() sep='test_cases' test_DIR=cur_dir.split(sep,1)[0] scriptDIR=test_DIR+'compare_function' sys.path.append(scriptDIR) # import my own function for color and comparat...
cc0-1.0
tbeadle/django
django/urls/resolvers.py
18
16937
""" This module converts requested URLs to callback view functions. RegexURLResolver is the main class here. Its resolve() method takes a URL (as a string) and returns a ResolverMatch object which provides access to all attributes of the resolved URL match. """ from __future__ import unicode_literals import functools...
bsd-3-clause
andresailer/DIRAC
StorageManagementSystem/DB/StorageManagementDB.py
6
57929
""" StorageManagementDB is a front end to the Stager Database. There are five tables in the StorageManagementDB: Tasks, CacheReplicas, TaskReplicas, StageRequests. The Tasks table is the place holder for the tasks that have requested files to be staged. These can be from different systems and have differe...
gpl-3.0
mrquim/repository.mrquim
plugin.video.salts/salts_lib/recaptcha_v2.py
7
9126
# -*- coding: utf-8 -*- """ SALTS XBMC Addon Copyright (C) 2016 tknorris Derived from Shani's LPro Code (https://github.com/Shani-08/ShaniXBMCWork2/blob/master/plugin.video.live.streamspro/unCaptcha.py) This program is free software: you can redistribute it and/or modify it under the terms of the G...
gpl-2.0
dch312/numpy
doc/cdoc/numpyfilter.py
108
2978
#!/usr/bin/env python """ numpyfilter.py INPUTFILE Interpret C comments as ReStructuredText, and replace them by the HTML output. Also, add Doxygen /** and /**< syntax automatically where appropriate. """ from __future__ import division, absolute_import, print_function import sys import re import os import textwrap ...
bsd-3-clause
robclark/chromium
third_party/tlslite/tlslite/TLSRecordLayer.py
20
44532
"""Helper class for TLSConnection.""" from __future__ import generators from utils.compat import * from utils.cryptomath import * from utils.cipherfactory import createAES, createRC4, createTripleDES from utils.codec import * from errors import * from messages import * from mathtls import * from constants import * fro...
bsd-3-clause
pymedusa/Medusa
ext/dirtyjson/tests/test_decode.py
2
4561
from __future__ import absolute_import import decimal from unittest import TestCase import dirtyjson class TestDecode(TestCase): if not hasattr(TestCase, 'assertIs'): def assertIs(self, expr1, expr2, msg=None): self.assertTrue(expr1 is expr2, msg or '%r is %r' % (expr1, expr2)) def test_...
gpl-3.0
homerunlathecut/homerunlathecut.github.io
node_modules/node-gyp/gyp/pylib/gyp/generator/ninja.py
1284
100329
# Copyright (c) 2013 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import collections import copy import hashlib import json import multiprocessing import os.path import re import signal import subprocess import sys import gyp imp...
mit
ondra-novak/chromium.src
third_party/cython/src/Cython/Debugger/libcython.py
101
44489
""" GDB extension that adds Cython support. """ from __future__ import with_statement import sys import textwrap import traceback import functools import itertools import collections import gdb try: from lxml import etree have_lxml = True except ImportError: have_lxml = False try: # Python 2...
bsd-3-clause
devs1991/test_edx_docmode
venv/lib/python2.7/site-packages/rest_framework/routers.py
52
11664
""" Routers provide a convenient and consistent way of automatically determining the URL conf for your API. They are used by simply instantiating a Router class, and then registering all the required ViewSets with that router. For example, you might have a `urls.py` that looks something like this: router = route...
agpl-3.0
xeddmc/twister-core
libtorrent/tools/parse_buffer_log.py
59
2998
#! /usr/bin/env python # Copyright Arvid Norberg 2008. Use, modification and distribution is # subject to 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 os, sys, time lines = open(sys.argv[1], 'rb').readlines() #keys = ['send_...
mit
pgleeson/TempRepo3
lib/jython/Lib/shelve.py
91
7565
"""Manage shelves of pickled objects. A "shelf" is a persistent, dictionary-like object. The difference with dbm databases is that the values (not the keys!) in a shelf can be essentially arbitrary Python objects -- anything that the "pickle" module can handle. This includes most class instances, recursive data type...
gpl-2.0