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
2ndy/RaspIM
usr/lib/python2.7/xml/dom/domreg.py
238
3478
"""Registration facilities for DOM. This module should not be used directly. Instead, the functions getDOMImplementation and registerDOMImplementation should be imported from xml.dom.""" from xml.dom.minicompat import * # isinstance, StringTypes # This is a list of well-known implementations. Well-known names # sho...
gpl-2.0
lordsutch/MUTCDSpeedSigns
signmatch.py
1
4877
#!/usr/bin/python # The contents of this file are in the public domain. See LICENSE_FOR_EXAMPLE_PROGRAMS.txt # # This example program shows how you can use dlib to make an object # detector for things like faces, pedestrians, and any other semi-rigid # object. In particular, we go though the steps to train the kin...
mit
tinkercnc/linuxcnc-mirror-old
tests/io-startup/test-ui.py
6
1343
#!/usr/bin/env python import linuxcnc_util import hal import time import sys import os # this is how long we wait for linuxcnc to do our bidding timeout = 5.0 # unbuffer stdout sys.stdout = os.fdopen(sys.stdout.fileno(), 'w', 0) def wait_for_pin_value(pin_name, value, timeout=5.0): start_time = time.time() ...
lgpl-2.1
alanljj/oca_hr
hr_holidays_extension/__openerp__.py
18
2358
# -*- coding:utf-8 -*- # # # Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>. # All Rights Reserved. # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, eit...
agpl-3.0
xlqian/navitia
source/jormungandr/jormungandr/parking_space_availability/car/car_park_provider_manager.py
3
2267
# Copyright (c) 2001-2014, Canal TP and/or its affiliates. All rights reserved. # # This file is part of Navitia, # the software to build cool stuff with public transport. # # Hope you'll enjoy and contribute to this project, # powered by Canal TP (www.canaltp.fr). # Help us simplify mobility and open public tr...
agpl-3.0
MaPePeR/numpy
numpy/distutils/unixccompiler.py
155
4656
""" unixccompiler - can handle very long argument lists for ar. """ from __future__ import division, absolute_import, print_function import os from distutils.errors import DistutilsExecError, CompileError from distutils.unixccompiler import * from numpy.distutils.ccompiler import replace_method from numpy.distutils....
bsd-3-clause
ryfeus/lambda-packs
Sklearn_scipy_numpy/source/scipy/stats/morestats.py
4
94486
# Author: Travis Oliphant, 2002 # # Further updates and enhancements by many SciPy developers. # from __future__ import division, print_function, absolute_import import math import warnings from collections import namedtuple import numpy as np from numpy import (isscalar, r_, log, around, unique, asarray, ...
mit
MobinRanjbar/hue
desktop/core/ext-py/Django-1.6.10/tests/view_tests/views.py
49
10403
from __future__ import absolute_import import sys from django.core.exceptions import PermissionDenied, SuspiciousOperation from django.core.urlresolvers import get_resolver from django.http import HttpResponse, HttpResponseRedirect from django.shortcuts import render_to_response, render from django.template import Co...
apache-2.0
emc-tridax/appengine-python-flask-master
lib/mysql/connector/charsets.py
16
12326
# -*- coding: utf-8 -*- # MySQL Connector/Python - MySQL driver written in Python. # Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved. # MySQL Connector/Python is licensed under the terms of the GPLv2 # <http://www.gnu.org/licenses/old-licenses/gpl-2.0.html>, like most # MySQL Connectors. T...
apache-2.0
kupferlauncher/kupfer
kupfer/plugin/virtualbox/__init__.py
2
5061
# -*- coding: UTF-8 -*- __kupfer_name__ = _("VirtualBox") __kupfer_sources__ = ("VBoxMachinesSource", ) __description__ = _("Control VirtualBox Virtual Machines. " "Supports both Sun VirtualBox and Open Source Edition.") __version__ = "0.4" __author__ = "Karol Będkowski <karol.bedkowski@gmail.com>"...
gpl-3.0
visualputty/Landing-Lights
django/template/debug.py
232
3797
from django.conf import settings from django.template.base import Lexer, Parser, tag_re, NodeList, VariableNode, TemplateSyntaxError from django.utils.encoding import force_unicode from django.utils.html import escape from django.utils.safestring import SafeData, EscapeData from django.utils.formats import localize cl...
bsd-3-clause
jhoos/django
django/contrib/gis/gdal/field.py
122
6400
from ctypes import byref, c_int from datetime import date, datetime, time from django.contrib.gis.gdal.base import GDALBase from django.contrib.gis.gdal.error import GDALException from django.contrib.gis.gdal.prototypes import ds as capi from django.utils.encoding import force_text # For more information, see the OG...
bsd-3-clause
nirgal/ngw
core/management/commands/recover_contacts.py
1
1347
import logging from django.core.management.base import BaseCommand from ngw.core import perms from ngw.core.models import GROUP_EVERYBODY, Contact class Command(BaseCommand): help = 'Recover lost contacts' def handle(self, *args, **options): logger = logging.getLogger('contactrecover') hand...
bsd-2-clause
microelly2/cadquery-freecad-module
CadQuery/Libs/docutils/languages/he.py
148
2683
# Author: Meir Kriheli # Id: $Id: he.py 4837 2006-12-26 09:59:41Z sfcben $ # Copyright: This module has been placed in the public domain. # New language mappings are welcome. Before doing a new translation, please # read <http://docutils.sf.net/docs/howto/i18n.html>. Two files must be # translated for each language:...
lgpl-3.0
mzl9039/spark
examples/src/main/python/ml/estimator_transformer_param_example.py
123
3952
# # 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
kupferlauncher/kupfer
oldplugins/epiphany.py
2
1247
__kupfer_name__ = _("Epiphany Bookmarks") __kupfer_sources__ = ("EpiphanySource", ) __description__ = _("Index of Epiphany bookmarks") __version__ = "" __author__ = "Ulrik Sverdrup <ulrik.sverdrup@gmail.com>" import os from kupfer.objects import Source from kupfer.objects import UrlLeaf from kupfer.obj.apps import Ap...
gpl-3.0
drnextgis/QGIS
python/ext-libs/pygments/lexers/_lassobuiltins.py
77
137633
# -*- coding: utf-8 -*- """ pygments.lexers._lassobuiltins ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Built-in Lasso types, traits, and methods. :copyright: Copyright 2006-2013 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ BUILTINS = { 'Types': [ 'null', '...
gpl-2.0
mewtaylor/django
django/utils/html_parser.py
348
5155
import re import sys from django.utils import six from django.utils.six.moves import html_parser as _html_parser current_version = sys.version_info use_workaround = current_version < (2, 7, 3) try: HTMLParseError = _html_parser.HTMLParseError except AttributeError: # create a dummy class for Python 3.5+ whe...
bsd-3-clause
andreparrish/python-for-android
python3-alpha/python3-src/Lib/tkinter/test/test_ttk/test_style.py
54
2792
import unittest import tkinter from tkinter import ttk from test.support import requires, run_unittest import tkinter.test.support as support requires('gui') class StyleTest(unittest.TestCase): def setUp(self): self.style = ttk.Style() def test_configure(self): style = self.style s...
apache-2.0
boghison/servo
tests/wpt/harness/wptrunner/wptmanifest/tests/test_static.py
139
2863
# This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this file, # You can obtain one at http://mozilla.org/MPL/2.0/. import unittest from cStringIO import StringIO from ..backends import static # There aren't many tests here because i...
mpl-2.0
akintoey/django
django/template/engine.py
48
7528
from django.core.exceptions import ImproperlyConfigured from django.utils import lru_cache, six from django.utils.functional import cached_property from django.utils.module_loading import import_string from .base import Context, Template from .context import _builtin_context_processors from .exceptions import Template...
bsd-3-clause
tobias47n9e/social-core
social_core/backends/amazon.py
4
1572
""" Amazon OAuth2 backend, docs at: https://python-social-auth.readthedocs.io/en/latest/backends/amazon.html """ import ssl from .oauth import BaseOAuth2 class AmazonOAuth2(BaseOAuth2): name = 'amazon' ID_KEY = 'user_id' AUTHORIZATION_URL = 'https://www.amazon.com/ap/oa' ACCESS_TOKEN_URL = 'https...
bsd-3-clause
timothsp/where2ate
venv/lib/python3.3/site-packages/pip/_vendor/pkg_resources/__init__.py
252
106466
""" Package resource API -------------------- A resource is a logical file contained within a package, or a logical subdirectory thereof. The package resource API expects resource names to have their path parts separated with ``/``, *not* whatever the local path separator is. Do not use os.path operations to manipul...
cc0-1.0
Endika/odoo
addons/account/wizard/account_report_common_journal.py
385
2942
# -*- 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
buguelos/odoo
addons/point_of_sale/__openerp__.py
261
3612
# -*- 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
makc/three.js.fork
utils/exporters/max/annotate/annotate.py
160
3036
#!/usr/bin/env python __author__ = 'Andrew Dunai <andrew@dun.ai>' import sys import json import argparse import re from collections import namedtuple try: from PyQt4 import QtGui import argparseui except ImportError: CAN_GUI = False else: CAN_GUI = True range_regexp = re.compile(r'^([\w\d]+)\=([\d]+)...
mit
pombredanne/unuk
examples/newrpc.py
1
1067
'''Experimenting with the new JSON-RPC Server ''' import sys import datetime import logging from environment import settings, local_dir from siro.core.api import siro_api from djpcms import http from django.core.handlers import wsgi from gevent.wsgi import WSGIServer class WSGIHandler(wsgi.WSGIHandler)...
bsd-3-clause
bmanojlovic/ansible
lib/ansible/plugins/terminal/vyos.py
10
1815
# # (c) 2016 Red Hat Inc. # # 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 d...
gpl-3.0
mattnenterprise/servo
tests/wpt/web-platform-tests/resources/test/conftest.py
4
4612
import io import json import os import html5lib import pytest from selenium import webdriver from wptserver import WPTServer ENC = 'utf8' HERE = os.path.dirname(os.path.abspath(__file__)) WPT_ROOT = os.path.normpath(os.path.join(HERE, '..', '..')) HARNESS = os.path.join(HERE, 'harness.html') def pytest_addoption(pa...
mpl-2.0
tomhughes/python-mapnik
test/python_tests/python_plugin_test.py
6
6233
# #!/usr/bin/env python # # -*- coding: utf-8 -*- # import os # import math # import mapnik # import sys # from utilities import execution_path, run_all # from nose.tools import * # def setup(): # # All of the paths used are relative, if we run the tests # # from another directory we need to chdir() # os....
lgpl-2.1
sfepy/sfepy
sfepy/homogenization/coefs_elastic.py
4
3052
from __future__ import absolute_import import numpy as nm from sfepy.base.base import output, assert_, get_default, Struct from sfepy.homogenization.coefs_base import CorrSolution, \ TCorrectorsViaPressureEVP, CorrMiniApp from sfepy.solvers.ts import TimeStepper from six.moves import range class PressureRHSVecto...
bsd-3-clause
baylee/django
tests/template_tests/syntax_tests/test_firstof.py
177
3215
from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class FirstOfTagTests(SimpleTestCase): @setup({'firstof01': '{% firstof a b c %}'}) def test_firstof01(self): output = self.engine.render_to_string('firstof01', {'a': 0, 'c': 0, 'b': 0}) ...
bsd-3-clause
likaiwalkman/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/port/server_process_unittest.py
121
5514
# Copyright (C) 2011 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the f...
bsd-3-clause
dhp-denero/LibrERP
account_vat_period_end_statement/report/vat_period_end_statement.py
2
4638
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011-2012 Domsense s.r.l. (<http://www.domsense.com>). # Copyright (C) 2012 Agile Business Group sagl (<http://www.agilebg.com>) # Copyright (C)...
agpl-3.0
usakhelo/FreeCAD
src/Mod/Ship/shipHydrostatics/Tools.py
3
18781
#*************************************************************************** #* * #* Copyright (c) 2011, 2016 * #* Jose Luis Cercos Pita <jlcercos@gmail.com> * #* ...
lgpl-2.1
frederick623/HTI
omm/ced_part.py
1
5118
import os import sys import sqlite3 import decimal import math import datetime import ast import csv def adapt_decimal(d): return str(d) def convert_decimal(s): return decimal.Decimal(s) def question_marks(st): question_marks = '?' for i in range(0, len(st.split(','))-1): question_marks = question_marks + ",?"...
apache-2.0
gdi2290/rethinkdb
test/rql_test/connections/http_support/flask/module.py
850
1363
# -*- coding: utf-8 -*- """ flask.module ~~~~~~~~~~~~ Implements a class that represents module blueprints. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os from .blueprints import Blueprint def blueprint_is_module(bp): """Used to figure ou...
agpl-3.0
cheddartv/stockstream.live
webapp/robinhood/robinhood_api.py
1
1709
import requests import httputil import traceback from datetime import datetime, timedelta def get_symbol_to_quotes(symbols): if len(symbols) == 0: return {} symbol_to_quote = {} try: quotes = httputil.get_json_object_from_url("https://api.robinhood.com/quotes/?symbols={}".format(",".join(s...
mit
mayavanand/RMMAFinalProject
azimuth/features/featurization.py
1
26462
import pandas import time import sklearn import numpy as np import Bio.SeqUtils as SeqUtil import Bio.Seq as Seq import util import sys import Bio.SeqUtils.MeltingTemp as Tm import pickle import itertools def featurize_data(data, learn_options, Y, gene_position, pam_audit=True, length_audit=True): ''' assumes ...
bsd-3-clause
sheppard/django-rest-framework
rest_framework/utils/encoders.py
88
2310
""" Helper classes for parsers. """ from __future__ import unicode_literals import datetime import decimal import json import uuid from django.db.models.query import QuerySet from django.utils import six, timezone from django.utils.encoding import force_text from django.utils.functional import Promise from rest_fram...
bsd-2-clause
RockySteveJobs/python-for-android
python3-alpha/python3-src/Lib/test/test_unary.py
179
1752
"""Test compiler changes for unary ops (+, -, ~) introduced in Python 2.2""" import unittest from test.support import run_unittest class UnaryOpTestCase(unittest.TestCase): def test_negative(self): self.assertTrue(-2 == 0 - 2) self.assertEqual(-0, 0) self.assertEqual(--2, 2) self....
apache-2.0
KerstenDoering/PubMedPortable
full_text_index/RunXapian.py
4
4217
#!/usr/bin/env python # -*- coding: UTF-8 -*- """ Copyright (c) 2014, Kersten Doering <kersten.doering@gmail.com>, Christian Senger <der.senger@googlemail.com> """ #Kersten HowTo: #"python RunXapian.py -x" for indexing and searching #"python RunXapian.py -f" for indexing #"python RunXapian.py" for searching #"pyth...
isc
lseyesl/phantomjs
src/qt/qtwebkit/Tools/Scripts/webkitpy/tool/commands/rebaseline.py
119
23221
# Copyright (c) 2010 Google Inc. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are # met: # # * Redistributions of source code must retain the above copyright # notice, this list of conditions and the ...
bsd-3-clause
Scapogo/zipline
zipline/finance/blotter.py
5
14953
# # Copyright 2015 Quantopian, 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 wr...
apache-2.0
Sergiojimenez/criticas_del_doctor_Mabuse
node_modules/gulp-sass/node_modules/node-sass/node_modules/node-gyp/gyp/pylib/gyp/generator/msvs.py
886
131038
# Copyright (c) 2012 Google Inc. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import copy import ntpath import os import posixpath import re import subprocess import sys import gyp.common import gyp.easy_xml as easy_xml import gyp.generator...
mit
laperry1/android_external_chromium_org
components/crash/tools/generate_breakpad_symbols.py
43
7519
#!/usr/bin/env python # Copyright 2013 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. """A tool to generate symbols for a binary suitable for breakpad. Currently, the tool only supports Linux, Android, and Mac. Support f...
bsd-3-clause
BizzCloud/PosBox
addons/auth_ldap/users_ldap.py
12
10518
############################################################################## # # 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 GNU Affero General Publ...
agpl-3.0
pascalchevrel/bedrock
tests/functional/firefox/test_all.py
4
3785
# -*- coding: utf-8 -*- # This Source Code Form is subject to the terms of the Mozilla Public # License, v. 2.0. If a copy of the MPL was not distributed with this # file, You can obtain one at http://mozilla.org/MPL/2.0/. import pytest from pages.firefox.all import FirefoxAllPage @pytest.mark.smoke @pytest.mark.n...
mpl-2.0
qlands/onadata
onadata/apps/main/tests/test_form_enter_data.py
5
5453
import os import re import requests from urlparse import urlparse from time import time from httmock import urlmatch, HTTMock from django.test import RequestFactory from django.core.urlresolvers import reverse from django.core.validators import URLValidator from django.conf import settings from django.contrib.auth.mo...
bsd-2-clause
Drooids/odoo
addons/sales_team/res_config.py
366
1922
# -*- coding: utf-8 -*- from openerp.osv import fields, osv class sales_team_configuration(osv.TransientModel): _name = 'sale.config.settings' _inherit = ['sale.config.settings'] def set_group_multi_salesteams(self, cr, uid, ids, context=None): """ This method is automatically called by res_conf...
agpl-3.0
wbsavage/shinken
shinken/objects/module.py
2
2515
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (C) 2009-2012: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # Gregory Starck, g.starck@gmail.com # Hartmut Goebel, h.goebel@goebel-consult.de # # This file is part of Shinken. # # Shinken is free software: you can redis...
agpl-3.0
jc0n/scrapy-webdriver
scrapy_webdriver/selector.py
5
3473
import re try: from scrapy.selector import Selector, XPathSelectorList except ImportError: # scrapy < 0.20 from scrapy.selector import XPathSelector as Selector, XPathSelectorList _UNSUPPORTED_XPATH_ENDING = re.compile(r'.*/((@)?([^/()]+)(\(\))?)$') class WebdriverXPathSelector(Selector): """Scrapy sel...
mit
ForensicTools/GRREAT-475_2141-Chaigon-Failey-Siebert
client/vfs_handlers/registry.py
3
15249
#!/usr/bin/env python """Implement access to the windows registry.""" import ctypes import ctypes.wintypes import exceptions import os import stat import StringIO import _winreg from grr.client import vfs from grr.lib import rdfvalue from grr.lib import utils # Difference between 1 Jan 1601 and 1 Jan 1970. WIN_UNI...
apache-2.0
jetyang2005/elastalert
DBUtils-1.2/DBUtils/Tests/TestSimplePooledPg.py
1
4301
"""Test the SimplePooledPg module. Note: We don't test performance here, so the test does not predicate whether SimplePooledPg actually will help in improving performance or not. Copyright and credit info: * This test was contributed by Christoph Zwerschke """ import sys import unittest __version__ = '1.2' # Th...
apache-2.0
adityahase/frappe
frappe/integrations/doctype/paytm_settings/paytm_settings.py
2
5857
# -*- coding: utf-8 -*- # Copyright (c) 2020, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import json import requests from six.moves.urllib.parse import urlencode import frappe from frappe.model.document import Document from frappe imp...
mit
kevinlondon/sentry
src/sentry/models/authidentity.py
25
1553
from __future__ import absolute_import, print_function from datetime import timedelta from django.conf import settings from django.db import models from django.utils import timezone from jsonfield import JSONField from sentry.db.models import FlexibleForeignKey, Model, sane_repr class AuthIdentity(Model): user ...
bsd-3-clause
wanghaven/nupic
examples/opf/experiments/multistep/simple_0/description.py
38
1588
# ---------------------------------------------------------------------- # 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 apply: # # This progra...
agpl-3.0
Plain-Andy-legacy/android_external_chromium_org
third_party/boringssl/update_gypi_and_asm.py
26
7225
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can b # found in the LICENSE file. """Enumerates the BoringSSL source in src/ and generates two gypi files: boringssl.gypi and boringssl_tests.gypi.""" import os import subprocess import sys...
bsd-3-clause
saknis/upelis
wiki - Copy.py
1
169333
#!/usr/bin/env python # # Copyright 2008 Google Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law o...
lgpl-2.1
kiith-sa/QGIS
python/plugins/processing/script/scripts/Extract_raster_values_to_CSV.py
4
3177
##[Example scripts]=group ##Input_raster=raster ##Input_vector=vector ##Transform_vector_to_raster_CRS=boolean ##Output_table=output table import os from osgeo import gdal, ogr, osr from processing.core.TableWriter import TableWriter from processing.core.GeoAlgorithmExecutionException import \ GeoAlgorithmExec...
gpl-2.0
zhukaixy/kbengine
kbe/src/lib/python/Lib/ctypes/macholib/dyld.py
152
4907
""" dyld emulation """ import os from ctypes.macholib.framework import framework_info from ctypes.macholib.dylib import dylib_info from itertools import * __all__ = [ 'dyld_find', 'framework_find', 'framework_info', 'dylib_info', ] # These are the defaults as per man dyld(1) # DEFAULT_FRAMEWORK_FALLBACK = [ ...
lgpl-3.0
ycaihua/kbengine
kbe/src/lib/python/Doc/includes/mp_newtype.py
52
1940
from multiprocessing import freeze_support from multiprocessing.managers import BaseManager, BaseProxy import operator ## class Foo: def f(self): print('you called Foo.f()') def g(self): print('you called Foo.g()') def _h(self): print('you called Foo._h()') # A simple generator fu...
lgpl-3.0
kdaniels/cobbler
cobbler/autoinstall_manager.py
16
11460
import os from cobbler import autoinstallgen from cobbler import clogger from cobbler import utils from cobbler.cexceptions import CX TEMPLATING_ERROR = 1 KICKSTART_ERROR = 2 class AutoInstallationManager: """ Manage automatic installation templates, snippets and final files """ def __init__(self, ...
gpl-2.0
RockySteveJobs/python-for-android
python3-alpha/python3-src/Lib/test/test_descr.py
46
148012
import builtins import sys import types import math import unittest from copy import deepcopy from test import support class OperatorsTest(unittest.TestCase): def __init__(self, *args, **kwargs): unittest.TestCase.__init__(self, *args, **kwargs) self.binops = { 'add': '+', ...
apache-2.0
RuthAngus/granola
granola/download.py
1
1294
# Downloading Kepler light curves import os import pandas as pd import kplr import kepler_data as kd def get_lc(id, KPLR_DIR="/Users/ruthangus/.kplr/data/lightcurves"): """ Downloads the kplr light curve and loads x, y and yerr. """ kid = str(int(id)).zfill(9) path = os.path.join(KPLR_DIR, "{}...
mit
phdowling/scikit-learn
examples/neighbors/plot_approximate_nearest_neighbors_scalability.py
225
5719
""" ============================================ Scalability of Approximate Nearest Neighbors ============================================ This example studies the scalability profile of approximate 10-neighbors queries using the LSHForest with ``n_estimators=20`` and ``n_candidates=200`` when varying the number of sa...
bsd-3-clause
zsjohny/jumpserver
apps/terminal/migrations/0016_commandstorage_replaystorage.py
3
2483
# Generated by Django 2.2.5 on 2019-11-22 10:07 import common.fields.model from django.db import migrations, models import uuid class Migration(migrations.Migration): dependencies = [ ('terminal', '0015_auto_20190923_1529'), ] operations = [ migrations.CreateModel( name='Com...
gpl-2.0
sharad1126/owtf
framework/wrappers/set/spear_phishing.py
3
2650
#!/usr/bin/env python ''' Description: This is the handler for the Social Engineering Toolkit (SET) trying to overcome the limitations of set-automate ''' from framework.dependency_management.dependency_resolver import BaseComponent from framework.lib.general import * import time SCRIPT_DELAY = 2 class SpearPhishing...
bsd-3-clause
0x46616c6b/ansible
lib/ansible/modules/cloud/amazon/lambda_event.py
21
14656
#!/usr/bin/python # (c) 2016, Pierre Jodouin <pjodouin@virtualcomputing.solutions> # # 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 v...
gpl-3.0
nickhand/nbodykit
nbodykit/algorithms/pair_counters/mocksurvey.py
2
8301
from .base import PairCountBase, verify_input_sources import numpy import logging class SurveyDataPairCount(PairCountBase): r""" Count (weighted) pairs of objects from a survey data catalog as a function of :math:`r`, :math:`(r,\mu)`, :math:`(r_p, \pi)`, or :math:`\theta` using the :mod:`Corrfunc` pac...
gpl-3.0
xyproto/b-tk.core
Testing/Python/AcquisitionUnitConverterTest.py
4
7026
import btk import unittest import _TDDConfigure class AcquisitionUnitConverterTest(unittest.TestCase): def test_NoInputNoConversion(self): uc = btk.btkAcquisitionUnitConverter() uc.Update() output = uc.GetOutput() self.assertEqual(output.GetPointUnit(btk.btkPoint.Marker), 'mm') ...
bsd-3-clause
benthomasson/fsm-designer
app/fsm_designer/features/steps/diff.py
1
1393
from behave import when, then from code_generation import cd import fsm_designer.cli import os HERE = os.path.dirname(__file__) @given(u'two empty fsm designs') def step_impl(context): context.designA = os.path.join(HERE, 'X') context.designB = os.path.join(HERE, 'Y') @given(u'two simple fsm designs') def ...
gpl-2.0
bright-sparks/chromium-spacewalk
tools/telemetry/telemetry/page/actions/action_runner.py
42
25683
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. import time from telemetry.page.actions.javascript_click import ClickElementAction from telemetry.page.actions.loop import LoopAction from telemetry.page.ac...
bsd-3-clause
asce1062/MAHDI-ROM_external_skia
tools/sanitize_source_files.py
176
4852
#!/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. """Module that sanitizes source files with specified modifiers.""" import commands import os import sys _FILE_EXTENSIONS_TO_SAN...
bsd-3-clause
civisanalytics/ansible-modules-core
cloud/amazon/ec2_elb.py
33
13968
#!/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
tinybit/lsd
foreign/jsoncpp-0.5.0/test/rununittests.py
249
2507
import sys import os import os.path import subprocess from glob import glob import optparse VALGRIND_CMD = 'valgrind --tool=memcheck --leak-check=yes --undef-value-errors=yes' class TestProxy(object): def __init__( self, test_exe_path, use_valgrind=False ): self.test_exe_path = os.path.normpath( os.path.a...
bsd-2-clause
jose36/jmdl3
servers/videoweed.py
34
4492
# -*- coding: iso-8859-1 -*- #------------------------------------------------------------ # pelisalacarta - XBMC Plugin # Conector para videoweed # http://blog.tvalacarta.info/plugin-xbmc/pelisalacarta/ #------------------------------------------------------------ import re, urlparse, urllib, urllib2 import os from ...
gpl-2.0
40223226/W17test2
static/Brython3.1.1-20150328-091302/Lib/binascii.py
620
24585
"""A pure Python implementation of binascii. Rather slow and buggy in corner cases. PyPy provides an RPython version too. """ # borrowed from https://bitbucket.org/pypy/pypy/src/f2bf94943a41/lib_pypy/binascii.py class Error(Exception): pass class Done(Exception): pass class Incomplete(Exception): pass ...
gpl-3.0
brianmhunt/SIWorldMap
werkzeug/testsuite/contrib/cache.py
12
4277
# -*- coding: utf-8 -*- """ werkzeug.testsuite.cache ~~~~~~~~~~~~~~~~~~~~~~~~ Tests the cache system :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import time import unittest import tempfile import shutil from werkzeug.testsuite import Werkzeug...
mit
dimagol/trex-core
scripts/external_libs/elasticsearch/elasticsearch/client/cat.py
2
17303
from .utils import NamespacedClient, query_params, _make_path, SKIP_IN_PATH class CatClient(NamespacedClient): @query_params('h', 'help', 'local', 'master_timeout', 'v') def aliases(self, name=None, params=None): """ `<http://www.elastic.co/guide/en/elasticsearch/reference/current/cat-alias.ht...
apache-2.0
julen/translate
translate/convert/po2rc.py
25
4848
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2002-2006,2008-2009 Zuza Software Foundation # # This file is part of the Translate Toolkit. # # 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 Fou...
gpl-2.0
AgainFaster/django-wombat-authenticator
wombat_authenticator/migrations/0001_initial.py
1
5385
# -*- 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 'WombatToken' db.create_table('wombat_authenticator_wombattoken', ( ('id', self.g...
bsd-3-clause
kurokochin/blog-ricky
accounts/views.py
11
1477
from django.contrib.auth import ( authenticate, get_user_model, login, logout, ) from django.shortcuts import render, redirect from .forms import UserLoginForm, UserRegisterForm def login_view(request): print(request.user.is_authenticated()) next = request.GET.get('next') title = "Log...
mit
veger/ansible
lib/ansible/utils/hashing.py
112
3173
# (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
alsmirn/adist
extinction/arenou.py
1
13341
""" Copyright (c) 2009, Alexey Smirnov All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the f...
bsd-3-clause
SophieIPP/ipp-macro-series-parser
ipp_macro_series_parser/denombrements_fiscaux/agregats_ipp.py
1
36244
# -*- coding: utf-8 -*- # TAXIPP -- A French microsimulation model # By: IPP <taxipp@ipp.eu> # # Copyright (C) 2012, 2013, 2014, 2015 IPP # https://github.com/taxipp # # This file is part of TAXIPP. # # TAXIPP is free software; you can redistribute it and/or modify # it under the terms of the GNU Affero General Publi...
gpl-3.0
simontakite/sysadmin
pythonscripts/learningPython/decoall-deco-any3.py
1
1855
# Class decorator factory: apply any decorator to all methods of a class from types import FunctionType from decotools import tracer, timer def decorateAll(decorator): def DecoDecorate(aClass): for attr, attrval in aClass.__dict__.items(): if type(attrval) is FunctionType: ...
gpl-2.0
sserrot/champion_relationships
venv/Lib/site-packages/zmq/utils/garbage.py
2
5935
"""Garbage collection thread for representing zmq refcount of Python objects used in zero-copy sends. """ # Copyright (C) PyZMQ Developers # Distributed under the terms of the Modified BSD License. import atexit import struct from os import getpid from collections import namedtuple from threading import Thread, Eve...
mit
NeCTAR-RC/heat
contrib/docker/docker/resources/docker_container.py
1
9891
# # Copyright (c) 2013 Docker, 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...
apache-2.0
kcguo/daily
Alpha/baidu.py
1
1028
from selenium import webdriver import time import os from selenium.webdriver.common.keys import Keys from selenium.webdriver.common.action_chains import ActionChains password = os.getenv('USERPWD') chrome_options = webdriver.ChromeOptions() #chrome_options.add_argument('--headless') #chrome_options.add_ar...
gpl-3.0
jamesblunt/edx-platform
common/lib/xmodule/xmodule/poll_module.py
146
7498
"""Poll module is ungraded xmodule used by students to to do set of polls. On the client side we show: If student does not yet anwered - Question with set of choices. If student have answered - Question with statistics for each answers. """ import cgi import json import logging from copy import deepcopy from collecti...
agpl-3.0
whitequark/foundry
vendor/lit/tests/shtest-format.py
2
2341
# Check the various features of the ShTest format. # # RUN: not %{lit} -j 1 -v %{inputs}/shtest-format > %t.out # RUN: FileCheck < %t.out %s # # END. # CHECK: -- Testing: # CHECK: FAIL: shtest-format :: external_shell/fail.txt # CHECK-NEXT: *** TEST 'shtest-format :: external_shell/fail.txt' FAILED *** # CHECK: Comma...
mit
scs/uclinux
user/python/python-2.4.4/Lib/aifc.py
12
33330
"""Stuff to parse AIFF-C and AIFF files. Unless explicitly stated otherwise, the description below is true both for AIFF-C files and AIFF files. An AIFF-C file has the following structure. +-----------------+ | FORM | +-----------------+ | <size> | +----+------------+ | | AIFC ...
gpl-2.0
tsufiev/horizon
openstack_dashboard/dashboards/project/access_and_security/security_groups/urls.py
65
1367
# Copyright 2012 United States Government as represented by the # Administrator of the National Aeronautics and Space Administration. # All Rights Reserved. # # Copyright 2012 Nebula, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the...
apache-2.0
SohKai/ChronoLogger
web/flask/lib/python2.7/site-packages/werkzeug/_internal.py
301
13713
# -*- coding: utf-8 -*- """ werkzeug._internal ~~~~~~~~~~~~~~~~~~ This module provides internally used helpers and constants. :copyright: (c) 2013 by the Werkzeug Team, see AUTHORS for more details. :license: BSD, see LICENSE for more details. """ import re import string import inspect from weakre...
mit
abaditsegay/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/copy_reg.py
442
6800
"""Helper to provide extensibility for pickle/cPickle. This is only useful to add pickle support for extension types defined in C, not for instances of user-defined classes. """ from types import ClassType as _ClassType __all__ = ["pickle", "constructor", "add_extension", "remove_extension", "clear_extens...
apache-2.0
edisonlz/fruit
web_project/base/site-packages/django/contrib/gis/tests/utils.py
114
1698
from django.conf import settings from django.db import DEFAULT_DB_ALIAS # function that will pass a test. def pass_test(*args): return def no_backend(test_func, backend): "Use this decorator to disable test on specified backend." if settings.DATABASES[DEFAULT_DB_ALIAS]['ENGINE'].rsplit('.')[-1] == backend: ...
apache-2.0
skykiny/shadowsocks
utils/autoban.py
1033
2156
#!/usr/bin/python # -*- coding: utf-8 -*- # Copyright (c) 2015 clowwindy # # 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 u...
apache-2.0
virgree/odoo
openerp/cli/__init__.py
135
2016
import logging import sys import os import openerp from openerp import tools from openerp.modules import module _logger = logging.getLogger(__name__) commands = {} class CommandType(type): def __init__(cls, name, bases, attrs): super(CommandType, cls).__init__(name, bases, attrs) name = getattr(...
agpl-3.0
jairideout/scikit-bio
skbio/diversity/_base.py
6
3274
# ---------------------------------------------------------------------------- # Copyright (c) 2013--, scikit-bio development team. # # Distributed under the terms of the Modified BSD License. # # The full license is in the file COPYING.txt, distributed with this software. # --------------------------------------------...
bsd-3-clause