repo_name
stringlengths
5
100
path
stringlengths
4
375
copies
stringclasses
991 values
size
stringlengths
4
7
content
stringlengths
666
1M
license
stringclasses
15 values
j0057/ansible-1
lib/ansible/module_utils/openstack.py
198
4502
# This code is part of Ansible, but is an independent component. # This particular file snippet, and this file snippet only, is BSD licensed. # Modules you write using this snippet, which is embedded dynamically by Ansible # still belong to the author of the module, and may assign their own license # to the complete wo...
gpl-3.0
kenshay/ImageScript
ProgramData/SystemFiles/Python/Lib/site-packages/PyQt4/uic/port_v2/invoke.py
6
1829
############################################################################# ## ## Copyright (c) 2014 Riverbank Computing Limited <info@riverbankcomputing.com> ## ## This file is part of PyQt. ## ## This file may be used under the terms of the GNU General Public ## License versions 2.0 or 3.0 as published by the Fre...
gpl-3.0
AkA84/edx-platform
common/lib/xmodule/xmodule/capa_module.py
10
8851
"""Implements basics of Capa, including class CapaModule.""" import json import logging import sys from lxml import etree from pkg_resources import resource_string import dogstats_wrapper as dog_stats_api from .capa_base import CapaMixin, CapaFields, ComplexEncoder from capa import responsetypes from .progress import...
agpl-3.0
longmen21/edx-platform
common/test/acceptance/pages/studio/container.py
3
20916
""" Container page in Studio """ from bok_choy.page_object import PageObject from bok_choy.promise import Promise, EmptyPromise from common.test.acceptance.pages.studio import BASE_URL from common.test.acceptance.pages.common.utils import click_css, confirm_prompt from common.test.acceptance.pages.studio.utils impor...
agpl-3.0
duyet-website/api.duyet.net
lib/flask/testsuite/__init__.py
564
7022
# -*- coding: utf-8 -*- """ flask.testsuite ~~~~~~~~~~~~~~~ Tests Flask itself. The majority of Flask is already tested as part of Werkzeug. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ from __future__ import print_function import os import sys im...
mit
Nirvedh/CoarseCoherence
src/arch/x86/isa/insts/simd128/integer/data_reordering/unpack_and_interleave.py
91
5843
# 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
switchyrascal/beeps
test/beeps/controllers/test_plancontroller.py
1
27725
# Copyright © 2012-2015 Jonty Pearson. # # This file is part of Beeps. # # Beeps is free software: you can redistribute it and/or modify # it under the terms of the GNU Lesser General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version....
gpl-3.0
renegelinas/mi-instrument
mi/dataset/parser/spkir_abj_dcl.py
5
14646
#!/usr/bin/env python """ @package mi.dataset.parser.spkir_abj_dcl @file marine-integrations/mi/dataset/parser/spkir_abj_dcl.py @author Steve Myerson @brief Parser for the spkir_abj_dcl dataset driver This file contains code for the spkir_abj_dcl parsers and code to produce data particles. For telemetered data, there...
bsd-2-clause
himacro/Vintageous
ex/parser/scanner_command_write_and_quit_all.py
9
1591
from .state import EOF from .tokens import TokenEof from .tokens_base import TOKEN_COMMAND_WRITE_AND_QUIT_ALL from .tokens_base import TokenOfCommand from Vintageous import ex from Vintageous.ex.ex_error import ERR_INVALID_ARGUMENT from Vintageous.ex.ex_error import VimError plus_plus_translations = { 'ff': 'fil...
mit
DianaDespa/marian-train
contrib/vim/.ycm_extra_conf.py
7
5255
# This file is NOT licensed under the GPLv3, which is the license for the rest # of YouCompleteMe. # # Here's the license text for this file: # # This is free and unencumbered software released into the public domain. # # Anyone is free to copy, modify, publish, use, compile, sell, or # distribute this software, either...
mit
Nick-Hall/gramps
gramps/gen/lib/src.py
8
15993
# # Gramps - a GTK+/GNOME based genealogy program # # Copyright (C) 2000-2007 Donald N. Allingham # Copyright (C) 2010 Michiel D. Nauta # Copyright (C) 2011 Tim G L Lyons # Copyright (C) 2013 Doug Blank <doug.blank@gmail.com> # Copyright (C) 2017 Nick Hall # # This program is free software; you...
gpl-2.0
unreal666/youtube-dl
youtube_dl/extractor/instagram.py
3
13288
from __future__ import unicode_literals import itertools import hashlib import json import re from .common import InfoExtractor from ..compat import ( compat_str, compat_HTTPError, ) from ..utils import ( ExtractorError, get_element_by_attribute, int_or_none, lowercase_escape, std_headers,...
unlicense
apple/swift-lldb
packages/Python/lldbsuite/test/benchmarks/expression/TestExpressionCmd.py
13
2526
"""Test lldb's expression evaluations and collect statistics.""" from __future__ import print_function import sys import lldb from lldbsuite.test.decorators import * from lldbsuite.test.lldbbench import * from lldbsuite.test.lldbtest import * from lldbsuite.test import configuration from lldbsuite.test import lldbut...
apache-2.0
sdg-mit/gitless
setup.py
1
2370
#!/usr/bin/env python # -*- coding: utf-8 -*- import ast import re import sys from setuptools import setup _version_re = re.compile(r'__version__\s+=\s+(.*)') with open('gitless/cli/gl.py', 'rb') as f: version = str(ast.literal_eval(_version_re.search( f.read().decode('utf-8')).group(1))) # Build helper ...
mit
lzpfmh/electron
script/upload-windows-pdb.py
156
1174
#!/usr/bin/env python import os import glob import sys from lib.config import s3_config from lib.util import atom_gyp, execute, rm_rf, safe_mkdir, s3put SOURCE_ROOT = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) SYMBOLS_DIR = 'dist\\symbols' DOWNLOAD_DIR = 'vendor\\brightray\\vendor\\download\\libchr...
mit
cruzegoodin/TSC-ShippingDetails
flask/lib/python2.7/site-packages/whoosh/lang/__init__.py
71
4308
# coding=utf-8 # Copyright 2012 Matt Chaput. All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # 1. Redistributions of source code must retain the above copyright notice, # this list of co...
bsd-3-clause
Nick-OpusVL/odoo
addons/l10n_hr/__init__.py
432
1164
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Module: l10n_hr # Author: Goran Kliska # mail: goran.kliska(AT)slobodni-programi.hr # Copyright (C) 2011- Slobodni programi d.o.o., Zagreb # Contrib...
agpl-3.0
ruchee/vimrc
vimfiles/bundle/vim-python/submodules/pylint/tests/functional/e/excess_escapes.py
2
1040
# pylint:disable=pointless-string-statement, fixme, misplaced-comparison-constant, comparison-with-itself """Stray backslash escapes may be missing a raw-string prefix.""" __revision__ = '$Id$' # Bad escape sequences, which probably don't do what you expect. A = "\[\]\\" # [anomalous-backslash-in-string,anomalous-ba...
mit
allo-/feedjack
feedjack/migrations.south/0015_auto__add_field_feed_skip_errors.py
2
9139
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'Feed.skip_errors' db.add_column('feedjack_feed', 'skip_errors', self.g...
bsd-3-clause
fishroot/nemoa
nemoa/base/nbase.py
1
18737
# -*- coding: utf-8 -*- """Base classes.""" __author__ = 'Patrick Michl' __email__ = 'frootlab@gmail.com' __license__ = 'GPLv3' __docformat__ = 'google' from pathlib import Path from nemoa.base import entity, check, ndict, env from nemoa.types import Any, ClassVar, Dict, OptInt, OptStr, PathLike class ObjectIP: ...
gpl-3.0
simongoffin/website_version
addons/report_intrastat/__openerp__.py
116
1888
# -*- 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
chris-chris/tensorflow
tensorflow/python/training/moving_averages.py
41
20098
# 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
ita1024/samba
third_party/waf/wafadmin/Tools/suncxx.py
48
1840
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2006 (ita) # Ralf Habacker, 2006 (rh) import os, optparse import Utils, Options, Configure import ccroot, ar from Configure import conftest @conftest def find_sxx(conf): v = conf.env cc = None if v['CXX']: cc = v['CXX'] elif 'CXX' in conf.environ: cc = conf.e...
gpl-3.0
etxc/namebench
nb_third_party/dns/rdtypes/ANY/CERT.py
248
4263
# Copyright (C) 2003-2007, 2009, 2010 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 ...
apache-2.0
ssorgatem/qiime
tests/test_core_microbiome.py
15
4217
#!/usr/bin/env python # File created on 08 Jun 2012 from __future__ import division __author__ = "Greg Caporaso" __copyright__ = "Copyright 2011, The QIIME project" __credits__ = ["Greg Caporaso"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Greg Caporaso" __email__ = "gregcaporaso@gmail.com" from...
gpl-2.0
splunk/splunk-webframework
contrib/django/django/contrib/gis/gdal/base.py
224
1155
from ctypes import c_void_p from django.contrib.gis.gdal.error import GDALException from django.utils import six class GDALBase(object): """ Base object for GDAL objects that has a pointer access property that controls access to the underlying C pointer. """ # Initially the pointer is NULL. _p...
apache-2.0
ageazrael/godot
modules/mono/config.py
3
6083
import imp import os import sys from SCons.Script import BoolVariable, Environment, Variables monoreg = imp.load_source('mono_reg_utils', 'modules/mono/mono_reg_utils.py') def find_file_in_dir(directory, files, prefix='', extension=''): if not extension.startswith('.'): extension = '.' + extension ...
mit
augustomatheuss/myjoy
src/myjoy.py
1
3782
# Copyright (c) 2015, Augusto Damasceno. # All rights reserved. # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # 1. Redistributions of source code must retain the above copyright notice, # this list of conditions ...
bsd-2-clause
crepererum/invenio
invenio/modules/oaiharvester/tasks/harvesting.py
13
8009
# -*- coding: utf-8 -*- # # This file is part of Invenio. # Copyright (C) 2014 CERN. # # Invenio 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...
gpl-2.0
taohaoge/vincent
vincent/marks.py
9
3996
# -*- coding: utf-8 -*- """ Marks: Classes to define Vega Marks """ from .core import grammar, GrammarClass, KeyedList from .values import ValueRef from .properties import PropertySet from ._compat import str_types class MarkProperties(GrammarClass): """Sets of all Mark properties Mark properties can chang...
mit
dfunckt/django
tests/get_earliest_or_latest/tests.py
12
6850
from __future__ import unicode_literals from datetime import datetime from django.test import TestCase from .models import Article, IndexErrorArticle, Person class EarliestOrLatestTests(TestCase): """Tests for the earliest() and latest() objects methods""" def tearDown(self): """Makes sure Article...
bsd-3-clause
mmauroy/SickRage
lib/sqlalchemy/ext/associationproxy.py
76
33046
# ext/associationproxy.py # Copyright (C) 2005-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 """Contain the ``AssociationProxy`` class. The ``AssociationProxy`` is a Pyth...
gpl-3.0
J861449197/edx-platform
common/lib/xmodule/xmodule/contentstore/mongo.py
51
20789
import pymongo import gridfs from gridfs.errors import NoFile from xmodule.contentstore.content import XASSET_LOCATION_TAG import logging from .content import StaticContent, ContentStore, StaticContentStream from xmodule.exceptions import NotFoundError from fs.osfs import OSFS import os import json from bson.son imp...
agpl-3.0
castroflavio/ryu
ryu/contrib/tinyrpc/exc.py
44
1239
#!/usr/bin/env python # -*- coding: utf-8 -*- class RPCError(Exception): """Base class for all excetions thrown by :py:mod:`tinyrpc`.""" class BadRequestError(RPCError): """Base class for all errors that caused the processing of a request to abort before a request object could be instantiated.""" de...
apache-2.0
sundresh/organize_photos
main/exif_cache.py
1
6076
# # organize_photos.py: (C) 2011-2014 Sameer Sundresh. No warranty. # # exif_cache.py is a helper for organize_photos.py # # It maintains a cache file exif_cache.json in the source directory that # keeps track of which files have already been copied out of that source # directory, including where they were copied and t...
agpl-3.0
timedcy/python-goose
goose/article.py
9
3085
# -*- coding: utf-8 -*- """\ This is a python port of "Goose" orignialy licensed to Gravity.com under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. Python port was written by Xavier Grangier for Recrutae Gravity.co...
apache-2.0
m11s/MissionPlanner
Lib/site-packages/scipy/misc/doccer.py
55
3935
''' Utilities to allow inserting docstring fragments for common parameters into function and method docstrings''' import sys def docformat(docstring, docdict=None): ''' Fill a function docstring from variables in dictionary Adapt the indent of the inserted docs Parameters ---------- docstring : ...
gpl-3.0
vacancy/TensorArtist
tartist/nn/optimizer/grad_modifier.py
1
3480
# -*- coding:utf8 -*- # File : grad_modifier.py # Author : Jiayuan Mao # Email : maojiayuan@gmail.com # Date : 1/28/17 # # This file is part of TensorArtist. import tensorflow as tf from ..tfutils import clean_name from ...core.logger import get_logger from ...core.utils.match import NameMatcher logger = get_l...
mit
william-richard/moto
tests/test_ec2/test_vpn_connections.py
2
2787
from __future__ import unicode_literals import boto import boto3 import pytest import sure # noqa from boto.exception import EC2ResponseError from moto import mock_ec2, mock_ec2_deprecated @mock_ec2_deprecated def test_create_vpn_connections(): conn = boto.connect_vpc("the_key", "the_secret") vpn_connection...
apache-2.0
Moriadry/tensorflow
tensorflow/contrib/distributions/python/ops/quantized_distribution.py
81
17379
# 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
andreparames/odoo
addons/account_bank_statement_extensions/report/bank_statement_balance_report.py
378
2723
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # # Copyright (c) 2011 Noviat nv/sa (www.noviat.be). All rights reserved. # # This program is free software: you can redistribute it and/or modify # it under ...
agpl-3.0
softak/webfaction_demo
vendor-local/lib/python/django_any/contrib/auth.py
3
1115
# -*- coding: utf-8 -*- from django.contrib.auth.models import User, Permission, Group from django_any import any_model def any_user(password=None, permissions=[], groups=[], **kwargs): """ Shortcut for creating Users Permissions could be a list of permission names If not specified, creates active, n...
bsd-3-clause
isandlaTech/cohorte-runtime
python/src/lib/python/jinja2/ext.py
603
25078
# -*- coding: utf-8 -*- """ jinja2.ext ~~~~~~~~~~ Jinja extensions allow to add custom tags similar to the way django custom tags work. By default two example extensions exist: an i18n and a cache extension. :copyright: (c) 2010 by the Jinja Team. :license: BSD. """ from jinja2 import nod...
apache-2.0
N-Parsons/exercism-python
exercises/rectangles/example.py
2
2901
import itertools class corners(object): def __init__(self, i, j): # i, j are position of corner self.i = i self.j = j def __str__(self): return "[" + str(self.i) + ", " + str(self.j) + "]" # return corner on the same line def same_line(index, list): for c in list: ...
mit
sippy/b2bua
sippy/UasStateTrying.py
1
7753
# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved. # Copyright (c) 2006-2014 Sippy Software, Inc. All rights reserved. # # All rights reserved. # # Redistribution and use in source and binary forms, with or without modification, # are permitted provided that the following conditions are met: # # 1. Redistrib...
bsd-2-clause
whr20120503/wy
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/mac_tool.py
377
19309
#!/usr/bin/env python # 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. """Utility functions to perform Xcode-style build steps. These functions are executed via gyp-mac-tool when using the Makefile generator. ""...
mit
jun66j5/trac-ja
trac/tests/perm.py
1
14135
# -*- coding: utf-8 -*- # # Copyright (C) 2004-2013 Edgewall Software # All rights reserved. # # This software is licensed as described in the file COPYING, which # you should have received as part of this distribution. The terms # are also available at http://trac.edgewall.org/wiki/TracLicense. # # This software consi...
bsd-3-clause
nguy/PyDisdrometer
pydsd/utility/expfit.py
3
2022
import numpy as np from scipy.optimize import curve_fit def expfit(x, y): """ expfit calculates an exponential power law fit based upon levenburg-marquardt minimization. Fits are of the form. y = ax**b Parameters: ----------- x: array_like independent variable y: array_like ...
lgpl-2.1
ryepdx/shipping_api
report/summary_report.py
1
2179
# -*- 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
eysho/BestKnownGame-Coins---Source
share/qt/extract_strings_qt.py
2945
1844
#!/usr/bin/python ''' Extract _("...") strings for translation and convert to Qt4 stringdefs so that they can be picked up by Qt linguist. ''' from subprocess import Popen, PIPE import glob import operator OUT_CPP="src/qt/bitcoinstrings.cpp" EMPTY=['""'] def parse_po(text): """ Parse 'po' format produced by x...
mit
eric-stanley/RetroArch
gfx/glsym/glgen.py
4
4663
#!/usr/bin/env python3 """ License statement applies to this file (glgen.py) only. """ """ 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 limi...
gpl-3.0
mdrumond/tensorflow
tensorflow/python/profiler/tfprof_logger_test.py
52
2982
# 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
urandu/rethinkdb
external/v8_3.30.33.16/tools/stats-viewer.py
143
15033
#!/usr/bin/env python # # Copyright 2008 the V8 project authors. 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 # noti...
agpl-3.0
tomkralidis/inasafe
safe/gui/tools/wizard_dialog.py
1
179113
# coding=utf-8 """ InaSAFE Disaster risk assessment tool by AusAid **GUI InaSAFE Wizard Dialog.** Contact : ole.moller.nielsen@gmail.com .. note:: 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 Found...
gpl-3.0
Drahflow/lymph
lymph/web/wsgi_server.py
11
1200
import logging from gevent.pywsgi import WSGIServer, WSGIHandler logger = logging.getLogger(__name__) class LymphWSGIHandler(WSGIHandler): def format_request(self): # XXX(Mouad): Copied shamessly from gevent.pywsgi.WSGIHandler's format_request # and removed only the datetime from the output, s...
apache-2.0
user-none/calibre
src/calibre/ebooks/oeb/polish/tests/base.py
14
3643
#!/usr/bin/env python2 # vim:fileencoding=utf-8 from __future__ import (unicode_literals, division, absolute_import, print_function) __license__ = 'GPL v3' __copyright__ = '2013, Kovid Goyal <kovid at kovidgoyal.net>' import os, unittest, shutil from calibre import CurrentDir from calibre.pte...
gpl-3.0
mojeto/django
django/contrib/gis/db/models/sql/conversion.py
11
2426
""" This module holds simple classes to convert geospatial values from the database. """ from decimal import Decimal from django.contrib.gis.db.models.fields import GeoSelectFormatMixin from django.contrib.gis.geometry.backend import Geometry from django.contrib.gis.measure import Area, Distance class BaseField: ...
bsd-3-clause
abinashk-inf/AstroBox
src/ext/sockjs/tornado/transports/rawwebsocket.py
9
2637
# -*- coding: utf-8 -*- """ sockjs.tornado.transports.rawwebsocket ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Raw websocket transport implementation """ import logging import socket from sockjs.tornado import websocket, session from sockjs.tornado.transports import base LOG = logging.getLogger("tornado.gener...
agpl-3.0
rnyberg/pyfibot
pyfibot/modules/available/module_forecast.py
2
1114
# -*- coding: utf-8 -*- from __future__ import unicode_literals, print_function, division import logging log = logging.getLogger("forecast") has_pywapi = False try: import pywapi has_pywapi = True except: log.error('Error loading library pywapi. Library not found.') def fahrenheit_to_celcius(f): re...
bsd-3-clause
jonhadfield/linkchecker
linkcheck/gui/syntax.py
7
3578
# -*- coding: iso-8859-1 -*- # Copyright (C) 2011-2014 Bastian Kleineidam # # 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 versi...
gpl-2.0
szeged/servo
tests/wpt/web-platform-tests/tools/third_party/pytest/src/_pytest/_code/code.py
32
32343
from __future__ import absolute_import, division, print_function import inspect import sys import traceback from inspect import CO_VARARGS, CO_VARKEYWORDS import attr import re from weakref import ref from _pytest.compat import _PY2, _PY3, PY35, safe_str from six import text_type import py builtin_repr = repr if _PY...
mpl-2.0
csdl/makahiki
makahiki/apps/managers/predicate_mgr/predicate_mgr.py
2
15003
'''Manager for predicates. Created on Jun 15, 2013 @author: Cam Moore ''' import sys import inspect from apps.managers.challenge_mgr.models import RoundSetting, GameInfo from apps.widgets.smartgrid_library.models import LibraryEvent, LibraryAction from apps.widgets.smartgrid_design.models import DesignerLevel, Design...
mit
robosafe/testbench_vRAL_hydro
bert2_simulator/sim_step_monitors/AM_ifSensorsNotOK_notRelease.py
1
6001
#!/usr/bin/env python """ AM_ifSensorsNotOK_notRelease Assertion monitor For use in Human-Robot Interaction simulator. Created by David Western, July 2015. Implements assertion: if human is ready and NOT sensorsOk and contact_robot_hand_and_object ==1 then assert after T, contact_robot_hand_and_object == 1 (robot d...
gpl-3.0
RPGOne/Skynet
scikit-learn-c604ac39ad0e5b066d964df3e8f31ba7ebda1e0e/examples/linear_model/plot_iris_logistic.py
283
1678
#!/usr/bin/python # -*- coding: utf-8 -*- """ ========================================================= Logistic Regression 3-class Classifier ========================================================= Show below is a logistic-regression classifiers decision boundaries on the `iris <http://en.wikipedia.org/wiki/Iris_f...
bsd-3-clause
m-ochi/RiotGameApiChallenge2016
lolcrawler.py
1
3730
#!/usr/local/bin/python # -*- coding: utf-8 -*- ''' Created on Oct 20, 2015 クロールの流れ 1.FeaturedGamesで最近のゲームを取得 2.ParticipantsのSummonerNamesを取得 3.SummonerNamesを使ってSummonerIdを取得 4.SummonerIdを使ってSummonerGamesを取得 5.SummonerGamesからMatchStatsを取得 6.保存 @author: ochi ''' import urllib2 import urllib import json import lolapi...
apache-2.0
Pexego/odoo
addons/l10n_in_hr_payroll/report/report_hr_salary_employee_bymonth.py
374
5518
#-*- coding:utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2011 OpenERP SA (<http://openerp.com>). All Rights Reserved # # This program is free software: you can redistribute it and/or modify # it under th...
agpl-3.0
sangoma/sangoma-sbc-provisioning
common/attr/validators.py
1
3489
""" Commonly useful validators. """ from __future__ import absolute_import, division, print_function from ._make import attr, attributes @attributes(repr=False, slots=True) class _InstanceOfValidator(object): type = attr() def __call__(self, inst, attr, value): """ We use a callable class t...
gpl-2.0
GenericStudent/home-assistant
homeassistant/components/picotts/tts.py
26
1854
"""Support for the Pico TTS speech service.""" import logging import os import shutil import subprocess import tempfile import voluptuous as vol from homeassistant.components.tts import CONF_LANG, PLATFORM_SCHEMA, Provider _LOGGER = logging.getLogger(__name__) SUPPORT_LANGUAGES = ["en-US", "en-GB", "de-DE", "es-ES"...
apache-2.0
davidvoler/ate_meteor
launcher/api/python/notifier/notify_monitor.py
1
2261
import requests import redis from requests.exceptions import Timeout, ConnectionError, HTTPError import json import time from tornado.options import options import config from ate_logger import AteLogger class NotifyMonitor(object): def __init__(self, logger=None): if logger: self.__logger = ...
mit
zcm19900902/picasso-graphic
tools/gyp/pylib/gyp/SCons.py
253
5848
# 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. """ SCons generator. This contains class definitions and supporting functions for generating pieces of SCons files for the different types of GYP targets. """ im...
bsd-3-clause
zcbenz/cefode-chromium
chrome/test/pyautolib/omnibox_info.py
69
4320
# Copyright (c) 2011 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. """Python representation for Chromium Omnibox. Obtain one of these from PyUITestSuite::GetOmniboxInfo() call. Example: class MyTest(pyauto.PyUITest): ...
bsd-3-clause
cernops/nova
nova/console/websocketproxy.py
4
6962
# Copyright (c) 2012 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 ...
apache-2.0
tutorcruncher/morpheus
morpheus/app/patches.py
1
7326
import asyncio from atoolbox import patch from atoolbox.db.helpers import run_sql_section from textwrap import dedent, indent from time import time from tqdm import tqdm @patch async def run_logic_sql(conn, settings, **kwargs): """ run the "logic" section of models.sql """ await run_sql_section('logic...
mit
hgl888/chromium-crosswalk-efl
tools/telemetry/telemetry/results/page_test_results.py
32
6232
# 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 collections import copy import traceback from telemetry import value as value_module from telemetry.results import page_run from telemetry.results im...
bsd-3-clause
takis/django
tests/template_tests/syntax_tests/test_regroup.py
367
3984
from datetime import date from django.template import TemplateSyntaxError from django.test import SimpleTestCase from ..utils import setup class RegroupTagTests(SimpleTestCase): @setup({'regroup01': '' '{% regroup data by bar as grouped %}' '{% for group in gro...
bsd-3-clause
defionscode/ansible
test/units/modules/network/f5/test_bigip_firewall_dos_profile.py
8
3629
# -*- coding: utf-8 -*- # # Copyright: (c) 2018, 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 import os import json import pytest import sys from nose.plugins.skip i...
gpl-3.0
harlanhaskins/swift
utils/gyb_syntax_support/PatternNodes.py
12
3648
from Child import Child from Node import Node # noqa: I201 PATTERN_NODES = [ # type-annotation -> ':' type Node('TypeAnnotation', kind='Syntax', children=[ Child('Colon', kind='ColonToken'), Child('Type', kind='Type'), ]), # enum-case-pattern -> type-identifie...
apache-2.0
xiaoyaozi5566/DiamondCache
src/mem/slicc/symbols/SymbolTable.py
14
5906
# Copyright (c) 1999-2008 Mark D. Hill and David A. Wood # Copyright (c) 2009 The Hewlett-Packard Development Company # 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 co...
bsd-3-clause
kanagasabapathi/python-for-android
python-modules/twisted/twisted/manhole/_inspectro.py
62
10118
# Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """An input/output window for the glade reactor inspector. """ import time import gtk import gobject import gtk.glade from twisted.python.util import sibpath from twisted.python import reflect from twisted.manhole.ui import gtk2manhol...
apache-2.0
nkrinner/nova
nova/cells/filters/target_cell.py
26
2862
# 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
clemkoa/scikit-learn
examples/plot_johnson_lindenstrauss_bound.py
39
7489
r""" ===================================================================== The Johnson-Lindenstrauss bound for embedding with random projections ===================================================================== The `Johnson-Lindenstrauss lemma`_ states that any high dimensional dataset can be randomly projected i...
bsd-3-clause
mearleycf/mwepd
node_modules/gulp-sass/node_modules/node-sass/node_modules/pangyp/gyp/pylib/gyp/generator/ninja_test.py
610
1611
#!/usr/bin/env python # 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. """ Unit tests for the ninja.py file. """ import gyp.generator.ninja as ninja import unittest import StringIO import sys import TestCommon ...
gpl-2.0
clairetang6/bokeh
examples/embed/simple/simple.py
4
2031
'''This example demonstrates embedding a standalone Bokeh document into a simple Flask application, with a basic HTML web form. To view the example, run: python simple.py in this directory, and navigate to: http://localhost:5000 ''' from __future__ import print_function import flask from bokeh.embed impo...
bsd-3-clause
devcline/mtasa-blue
vendor/google-breakpad/src/testing/test/gmock_leak_test.py
224
3584
#!/usr/bin/env python # # Copyright 2009, 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...
gpl-3.0
shaufi/odoo
openerp/addons/base/ir/ir_model.py
148
62274
# -*- coding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Business Applications # Copyright (C) 2004-2014 OpenERP S.A. (<http://openerp.com>). # # This program is free software: you can redistribute it and/or modify # it under the terms ...
agpl-3.0
upworkgluu71/CE_v1
genSchemaMarkdown.py
3
3430
#!/usr/bin/python # MIT License # # Copyright 2014 Gluu, Inc. # # Permission is hereby granted, free of charge, to any person obtaining a copy of this software # and associated documentation files (the Software), to deal in the Software without restriction, # including without limitation the rights to use, copy, modif...
mit
efajardo/osg-test
osgtest/tests/test_170_pbs.py
1
5425
import os import time from datetime import date import osgtest.library.core as core import osgtest.library.files as files import osgtest.library.osgunittest as osgunittest import osgtest.library.service as service class TestStartPBS(osgunittest.OSGTestCase): pbs_config = """ create queue batch queue_type=executi...
apache-2.0
atlashealth/ansible-modules-core
windows/win_msi.py
68
1736
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2014, Matt Martz <matt@sivel.net>, and others # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of t...
gpl-3.0
camargoanderso/thumbor
thumbor/storages/redis_storage.py
11
4960
#!/usr/bin/python # -*- coding: utf-8 -*- # thumbor imaging service # https://github.com/globocom/thumbor/wiki # Licensed under the MIT license: # http://www.opensource.org/licenses/mit-license # Copyright (c) 2011 globo.com timehome@corp.globo.com import logging import inspect from json import loads, dumps from da...
mit
Earthson/RecGen
recgen.py
2
4323
#!/usr/bin/env python import sys import types from traceback import format_exc def rec_gen(func, callback=None, err_callback=None): ''' callback accept arguments with output of func err_callback is called after Exception occured, accept Exception instance as it's arguments ''' def trans_func(*args...
mit
mdworks2016/work_development
Python/05_FirstPython/Chapter9_WebApp/fppython_develop/lib/python3.7/site-packages/pip/_vendor/pep517/wrappers.py
22
5912
from contextlib import contextmanager import os from os.path import dirname, abspath, join as pjoin import shutil from subprocess import check_call import sys from tempfile import mkdtemp from . import compat _in_proc_script = pjoin(dirname(abspath(__file__)), '_in_process.py') @contextmanager def tempdir(): td...
apache-2.0
chipx86/reviewboard
reviewboard/diffviewer/filetypes.py
10
2625
from __future__ import unicode_literals import re # A list of regular expressions for headers in the source code that we can # display in collapsed regions of diffs and diff fragments in reviews. HEADER_REGEXES = { '.cs': [ re.compile( r'^\s*((public|private|protected|static)\s+)+' ...
mit
mohamed--abdel-maksoud/chromium.src
third_party/libxml/src/check-xinclude-test-suite.py
347
5333
#!/usr/bin/python import sys import time import os import string sys.path.insert(0, "python") import libxml2 # # the testsuite description # DIR="xinclude-test-suite" CONF="testdescr.xml" LOG="check-xinclude-test-suite.log" log = open(LOG, "w") os.chdir(DIR) test_nr = 0 test_succeed = 0 test_failed = 0 test_error =...
bsd-3-clause
sdiehl/numpile
numpile.py
1
29002
# LLVM based numeric specializer in 1000 lines. from __future__ import print_function from functools import reduce import sys import ast import types import ctypes import inspect import pprint import string import numpy as np from textwrap import dedent from collections import deque, defaultdict from llvmlite import...
mit
RannyeriDev/Solfege
tools/screenshot.py
5
1316
#!/usr/bin/python import os import sys import re from subprocess import * import time def run(cmd): print "run:", cmd os.system(cmd) def get_image_dim(fn): output = Popen(["file", fn], stdout=PIPE).communicate()[0] r = re.compile("(\d+)\s*x+\s*(\d+)") m = r.search(output) if m: return...
gpl-3.0
AyoubZahid/odoo
addons/hr_recruitment/models/hr_job.py
37
5037
# Part of Odoo. See LICENSE file for full copyright and licensing details. from openerp import _, api, fields, models class Job(models.Model): _inherit = "hr.job" _name = "hr.job" _inherits = {'mail.alias': 'alias_id'} @api.model def _default_address_id(self): return self.env.user.compan...
gpl-3.0
jyotikamboj/container
django/contrib/admin/__init__.py
160
1237
# ACTION_CHECKBOX_NAME is unused, but should stay since its import from here # has been referenced in documentation. from django.contrib.admin.decorators import register from django.contrib.admin.helpers import ACTION_CHECKBOX_NAME from django.contrib.admin.options import (HORIZONTAL, VERTICAL, ModelAdmin, StackedI...
mit
ScreamingUdder/mantid
Framework/PythonInterface/test/python/mantid/geometry/IPeakTest.py
1
6523
import unittest from mantid.kernel import V3D from mantid.simpleapi import CreateSimulationWorkspace, CreatePeaksWorkspace import numpy as np import numpy.testing as npt class IPeakTest(unittest.TestCase): def setUp(self): # IPeak cannot currently be instatiated so this is a quick way # getting a...
gpl-3.0
aeklant/scipy
scipy/ndimage/__init__.py
4
4755
""" ========================================================= Multidimensional image processing (:mod:`scipy.ndimage`) ========================================================= .. currentmodule:: scipy.ndimage This package contains various functions for multidimensional image processing. Filters ======= .. autosum...
bsd-3-clause
samsara/samsara
clients/python/samsara_sdk/constants.py
2
1329
# -*- coding: utf-8 -*- """ samsara_sdk.constants ~~~~~~~~~~~~~~~~~~~~~ Samsara SDK client constants """ # Samara specific HTTP Header PUBLISHED_TIMESTAMP_HEADER = "X-Samsara-publishedTimestamp" API_PATH = '/v1/events' DEFAULT_CONFIG = { # a samsara ingestion api endpoint "http://samsara-ingestion.lo...
apache-2.0