repo_name
stringlengths
6
100
path
stringlengths
4
294
copies
stringlengths
1
5
size
stringlengths
4
6
content
stringlengths
606
896k
license
stringclasses
15 values
3dfxmadscientist/odoo_vi
addons/google_account/__openerp__.py
68
1459
# -*- 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
ChenJunor/hue
apps/useradmin/src/useradmin/urls.py
24
1775
#!/usr/bin/env python # Licensed to Cloudera, Inc. under one # or more contributor license agreements. See the NOTICE file # distributed with this work for additional information # regarding copyright ownership. Cloudera, Inc. licenses this file # to you under the Apache License, Version 2.0 (the # "License"); you ma...
apache-2.0
rezoo/chainer
examples/memnn/babi.py
5
2110
import collections Query = collections.namedtuple('Query', ['sentence', 'answer', 'fact']) Sentence = collections.namedtuple('Sentence', ['sentence']) def split(sentence): """Splits a sentence into words. Args: sentence (str): A sentence to split. Returns: list of str: A list of words....
mit
mmauroy/SickRage
lib/hachoir_parser/misc/torrent.py
57
5514
""" .torrent metainfo file parser http://wiki.theory.org/BitTorrentSpecification#Metainfo_File_Structure Status: To statufy Author: Christophe Gisquet <christophe.gisquet@free.fr> """ from hachoir_parser import Parser from hachoir_core.field import (FieldSet, ParserError, String, RawBytes) from hachoir_core.endi...
gpl-3.0
TheMOOCAgency/edx-platform
cms/djangoapps/contentstore/views/videos.py
6
15966
""" Views related to the video upload feature """ from datetime import datetime, timedelta import logging from boto import s3 import csv from uuid import uuid4 from django.conf import settings from django.contrib.auth.decorators import login_required from django.http import HttpResponse, HttpResponseNotFound from dja...
agpl-3.0
jaidevd/scikit-learn
examples/cluster/plot_kmeans_silhouette_analysis.py
83
5888
""" =============================================================================== Selecting the number of clusters with silhouette analysis on KMeans clustering =============================================================================== Silhouette analysis can be used to study the separation distance between the...
bsd-3-clause
coagulant/django-devserver
devserver/logger.py
2
2554
import logging import sys import re import datetime from django.utils.encoding import smart_str from django.core.management.color import color_style from django.utils import termcolors _bash_colors = re.compile(r'\x1b\[[^m]*m') def strip_bash_colors(string): return _bash_colors.sub('', string) class GenericL...
bsd-3-clause
MrLoick/python-for-android
python-modules/twisted/twisted/web/sux.py
55
21480
# -*- test-case-name: twisted.web.test.test_xml -*- # # Copyright (c) 2001-2004 Twisted Matrix Laboratories. # See LICENSE for details. """ *S*mall, *U*ncomplicated *X*ML. This is a very simple implementation of XML/HTML as a network protocol. It is not at all clever. Its main features are that it does not: - s...
apache-2.0
christiansandberg/canopen
examples/simple_ds402_node.py
1
4328
import canopen import sys import os import traceback import time try: # Start with creating a network representing one CAN bus network = canopen.Network() # Connect to the CAN bus network.connect(bustype='kvaser', channel=0, bitrate=1000000) network.check() # Add some nodes with correspond...
mit
adrienbrault/home-assistant
homeassistant/components/zha/climate.py
5
23686
""" Climate on Zigbee Home Automation networks. For more details on this platform, please refer to the documentation at https://home-assistant.io/components/zha.climate/ """ from __future__ import annotations from datetime import datetime, timedelta import enum import functools from random import randint from homeas...
mit
jorsea/odoomrp-wip
stock_picking_package_info/__openerp__.py
14
1620
# -*- encoding: utf-8 -*- ############################################################################## # # Copyright (c) # 2015 Serv. Tec. Avanzados - Pedro M. Baeza (http://www.serviciosbaeza.com) # 2015 AvanzOsc (http://www.avanzosc.es) # # This program is free software: you can redistribute it and/or modi...
agpl-3.0
Eksmo/zabbix-exporter
tests/func_test.py
2
3508
# coding: utf-8 import pytest import requests from zabbix_exporter.prometheus import text_string_to_metric_families @pytest.mark.parametrize("config_name,timestamps", [ ("disable_timestamps", (None, None, None, None, None)), ("explicit_config", (1460359130, 1460359130, 1460359143, 1460359143, 1460359140)), ...
bsd-2-clause
supergis/QGIS
python/plugins/GdalTools/tools/doProjection.py
12
7543
# -*- coding: utf-8 -*- """ *************************************************************************** doProjection.py --------------------- Date : June 2010 Copyright : (C) 2010 by Giuseppe Sucameli Email : brush dot tyler at gmail dot com ***************...
gpl-2.0
RoyalTS/econ-python-environment
.mywaflib/waflib/extras/make.py
13
3279
#!/usr/bin/env python # encoding: utf-8 # Thomas Nagy, 2011 (ita) """ A make-like way of executing the build, following the relationships between inputs/outputs This algorithm will lead to slower builds, will not be as flexible as "waf build", but it might be useful for building data files (?) It is likely to break ...
bsd-3-clause
kalahbrown/HueBigSQL
desktop/core/ext-py/Django-1.6.10/tests/modeladmin/models.py
55
1527
# coding: utf-8 from django.contrib.auth.models import User from django.db import models from django.utils.encoding import python_2_unicode_compatible @python_2_unicode_compatible class Band(models.Model): name = models.CharField(max_length=100) bio = models.TextField() sign_date = models.DateField() ...
apache-2.0
duyetdev/openerp-6.1.1
openerp/addons/base_module_quality/base_module_quality.py
9
12362
# -*- 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
xsynergy510x/android_external_chromium_org
build/android/pylib/device/device_utils.py
25
29397
# 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. """Provides a variety of device interactions based on adb. Eventually, this will be based on adb_wrapper. """ # pylint: disable=W0613 import pipes import s...
bsd-3-clause
Jorge-Rodriguez/ansible
lib/ansible/utils/ssh_functions.py
148
1600
# (c) 2016, James Tanner # (c) 2016, Toshio Kuratomi <tkuratomi@ansible.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 # (...
gpl-3.0
leighpauls/k2cro4
third_party/python_26/Lib/mutex.py
60
1866
"""Mutual exclusion -- for use with module sched A mutex has two pieces of state -- a 'locked' bit and a queue. When the mutex is not locked, the queue is empty. Otherwise, the queue contains 0 or more (function, argument) pairs representing functions (or methods) waiting to acquire the lock. When the mutex is unlocke...
bsd-3-clause
Megatron007/kernel
tools/perf/scripts/python/check-perf-trace.py
11214
2503
# perf script event handlers, generated by perf script -g python # (c) 2010, Tom Zanussi <tzanussi@gmail.com> # Licensed under the terms of the GNU GPL License version 2 # # This script tests basic functionality such as flag and symbol # strings, common_xxx() calls back into perf, begin, end, unhandled # events, etc. ...
gpl-2.0
frederica07/Dragon_Programming_Process
PyOpenGL-3.0.2/OpenGL/raw/GL/NV/transform_feedback2.py
1
1489
'''Autogenerated by get_gl_extensions script, do not edit!''' from OpenGL import platform as _p, constants as _cs, arrays from OpenGL.GL import glget import ctypes EXTENSION_NAME = 'GL_NV_transform_feedback2' def _f( function ): return _p.createFunction( function,_p.GL,'GL_NV_transform_feedback2',False) _p.unpack_c...
bsd-2-clause
infobloxopen/neutron
neutron/tests/common/net_helpers.py
8
8769
# Copyright (c) 2015 Thales Services SAS # # 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 l...
apache-2.0
conjure-up/conjure-up
conjureup/controllers/juju/deploy/common.py
3
1380
import asyncio import os from datetime import datetime import websockets from conjureup import events, juju, utils from conjureup.app_config import app async def do_deploy(msg_cb): await events.ModelConnected.wait() for step in app.steps: await step.before_deploy(msg_cb=msg_cb) events.PreDeploy...
mit
datenbetrieb/odoo
addons/product/wizard/__init__.py
452
1076
# -*- 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
billy-inn/scikit-learn
examples/linear_model/plot_ransac.py
250
1673
""" =========================================== Robust linear model estimation using RANSAC =========================================== In this example we see how to robustly fit a linear model to faulty data using the RANSAC algorithm. """ import numpy as np from matplotlib import pyplot as plt from sklearn import ...
bsd-3-clause
sdeepanshu02/microblog
flask/Lib/site-packages/migrate/versioning/pathed.py
146
2059
""" A path/directory class. """ import os import shutil import logging from migrate import exceptions from migrate.versioning.config import * from migrate.versioning.util import KeyedInstance log = logging.getLogger(__name__) class Pathed(KeyedInstance): """ A class associated with a path/directory tree...
bsd-3-clause
EmuDevs/WotLK
dep/libmpq/bindings/python/mpq.py
501
10430
"""wrapper for libmpq""" # 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 is distributed in the hope th...
gpl-2.0
ahmedaljazzar/edx-platform
common/test/acceptance/fixtures/catalog.py
5
2655
""" Tools to create catalog-related data for use in bok choy tests. """ import json import requests from common.test.acceptance.fixtures import CATALOG_STUB_URL from common.test.acceptance.fixtures.config import ConfigModelFixture class CatalogFixture(object): """ Interface to set up mock responses from the...
agpl-3.0
operepo/ope
sync_tools/docker/types/healthcheck.py
4
1507
from .base import DictType import six class Healthcheck(DictType): def __init__(self, **kwargs): test = kwargs.get('test', kwargs.get('Test')) if isinstance(test, six.string_types): test = ["CMD-SHELL", test] interval = kwargs.get('interval', kwargs.get('Interval')) t...
mit
thnee/ansible
lib/ansible/modules/cloud/ovirt/ovirt_role.py
37
5873
#!/usr/bin/python # -*- coding: utf-8 -*- # # Copyright (c) 2016 Red Hat, Inc. # GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) ANSIBLE_METADATA = {'metadata_version': '1.1', 'status': ['preview'], 'supported_by': 'community'} DOCUMEN...
gpl-3.0
samchrisinger/osf.io
website/tokens/__init__.py
38
3558
import httplib as http import functools import jwt from flask import request from framework.exceptions import HTTPError from website import settings from website.tokens import handlers from website.tokens.exceptions import TokenHandlerNotFound class TokenHandler(object): HANDLERS = { 'approve_registrati...
apache-2.0
mhvk/astropy
astropy/coordinates/tests/test_solar_system.py
2
20070
import os import pytest import numpy as np from urllib.error import HTTPError from astropy.time import Time from astropy import units as u from astropy.constants import c from astropy.coordinates.builtin_frames import GCRS, TETE from astropy.coordinates.earth import EarthLocation from astropy.coordinates.sky_coordina...
bsd-3-clause
goliate/sarakha63-persomov
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/niconico.py
24
6993
# encoding: utf-8 from __future__ import unicode_literals import re import json from .common import InfoExtractor from ..compat import ( compat_urllib_parse, compat_urllib_request, compat_urlparse, ) from ..utils import ( ExtractorError, int_or_none, parse_duration, unified_strdate, ) cl...
gpl-3.0
hack4impact/Givology
mainSite/source/proj/giv/reverend/guessers/email.py
24
3249
# This module is part of the Divmod project and is Copyright 2003 Amir Bakhtiar: # amir@divmod.org. This is free software; you can redistribute it and/or # modify it under the terms of version 2.1 of the GNU Lesser General Public # License as published by the Free Software Foundation. # from rfc822 import Add...
mit
GDGLima/contentbox
third_party/djangoappengine/tests/test_keys.py
28
10444
from __future__ import with_statement from django.db import connection, models from django.db.utils import DatabaseError from django.test import TestCase from django.utils import unittest from djangotoolbox.fields import ListField class AutoKey(models.Model): pass class CharKey(models.Model): id = models....
apache-2.0
vasyarv/edx-platform
common/lib/xmodule/xmodule/studio_editable.py
134
2103
""" Mixin to support editing in Studio. """ from xmodule.x_module import module_attr, STUDENT_VIEW, AUTHOR_VIEW class StudioEditableBlock(object): """ Helper methods for supporting Studio editing of XBlocks. This class is only intended to be used with an XBlock! """ has_author_view = True de...
agpl-3.0
USGSDenverPychron/pychron
pychron/experiment/tests/analysis_grouping_test.py
1
3212
from pychron.experiment.automated_run.persistence import AutomatedRunPersister from pychron.experiment.automated_run.spec import AutomatedRunSpec __author__ = 'ross' import unittest runs = [('references', 'bu-j-1', 'b1'), ('A', '11111', 'u1'), ('references', 'bu-j-2', 'b2'), ('B','22222','u2'), ('B','33333',...
apache-2.0
dresiu/wagtail
wagtail/wagtailcore/fields.py
5
4309
from __future__ import absolute_import, unicode_literals import json from django.db import models from django import forms from django.core.serializers.json import DjangoJSONEncoder from django.utils.six import with_metaclass from wagtail.wagtailcore.rich_text import DbWhitelister, expand_db_html from wagtail.utils....
bsd-3-clause
zielmicha/hera
hera/webapp/urls.py
1
1682
from django.conf.urls import include, url, patterns from django.contrib import admin from django.conf.urls.static import static from django.conf import settings from django.views.generic import RedirectView, TemplateView from hera.webapp import account_views from hera.webapp import sandbox_views from hera.webapp import...
agpl-3.0
appleby/fastai-courses
deeplearning1/nbs/vgg16.py
13
8627
from __future__ import division, print_function import os, json from glob import glob import numpy as np from scipy import misc, ndimage from scipy.ndimage.interpolation import zoom from keras import backend as K from keras.layers.normalization import BatchNormalization from keras.utils.data_utils import get_file fro...
apache-2.0
fu-berlin-swp-2014/center-points
centerpoints/visualise.py
1
19882
import time import colorsys import sys from PySide import QtGui, QtOpenGL, QtCore from PySide.QtCore import QTimer, SIGNAL from PySide.QtGui import QLabel import copy import numpy as np from OpenGL.GL import * from OpenGL.GLU import * import centerpoints.data_set class Color: def __init__(self, color=None): ...
mit
kwagdy/koding-1
go/src/vendor/github.com/caglar10ur/lxc/src/python-lxc/setup.py
15
2493
#!/usr/bin/env python3 # # python-lxc: Python bindings for LXC # # (C) Copyright Canonical Ltd. 2012 # # Authors: # Stéphane Graber <stgraber@ubuntu.com> # # This library 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 Soft...
apache-2.0
l2isbad/netdata
collectors/python.d.plugin/gearman/gearman.chart.py
3
6654
# Description: dovecot netdata python.d module # Author: Kyle Agronick (agronick) # SPDX-License-Identifier: GPL-3.0+ # Gearman Netdata Plugin from copy import deepcopy from bases.FrameworkServices.SocketService import SocketService CHARTS = { 'total_workers': { 'options': [None, 'Total Jobs', 'Jobs', '...
gpl-3.0
xNovax/SickRage
lib/sqlalchemy/orm/path_registry.py
79
7643
# orm/path_registry.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 """Path tracking utilities, representing mapper graph traversals. """ from .. im...
gpl-3.0
himmih/cluedo
venv/lib/python2.7/site-packages/pip/_vendor/requests/packages/chardet/utf8prober.py
2919
2652
######################## BEGIN LICENSE BLOCK ######################## # The Original Code is mozilla.org code. # # The Initial Developer of the Original Code is # Netscape Communications Corporation. # Portions created by the Initial Developer are Copyright (C) 1998 # the Initial Developer. All Rights Reserved. # # Con...
apache-2.0
brianjgeiger/osf.io
api_tests/registrations/views/test_registration_linked_nodes.py
11
15618
import pytest from api.base.settings.defaults import API_BASE from framework.auth.core import Auth from api_tests.utils import disconnected_from_listeners from website.project.signals import contributor_removed from osf_tests.factories import ( NodeFactory, AuthUserFactory, RegistrationFactory ) @pytest....
apache-2.0
dbaty/deform_ext_autocomplete
docs/conf.py
1
2104
# Configuration file for the Sphinx documentation builder. # # This file only contains a selection of the most common options. For a full # list see the documentation: # https://www.sphinx-doc.org/en/master/usage/configuration.html import datetime import pkg_resources # -- Path setup --------------------------------...
bsd-3-clause
fabianfreyer/ansible
lib/ansible/inventory/vars_plugins/noop.py
317
1632
# (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com> # (c) 2014, Serge van Ginderachter <serge@vanginderachter.be> # # 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 Foundat...
gpl-3.0
alexsavio/scikit-learn
examples/gaussian_process/plot_gpc_iris.py
81
2231
""" ===================================================== Gaussian process classification (GPC) on iris dataset ===================================================== This example illustrates the predicted probability of GPC for an isotropic and anisotropic RBF kernel on a two-dimensional version for the iris-dataset. ...
bsd-3-clause
aeischeid/servo
tests/wpt/css-tests/tools/wptserve/tests/functional/test_pipes.py
299
3178
import os import unittest import urllib2 import json import time import wptserve from base import TestUsingServer, doc_root class TestStatus(TestUsingServer): def test_status(self): resp = self.request("/document.txt", query="pipe=status(202)") self.assertEquals(resp.getcode(), 202) class TestHea...
mpl-2.0
hlange/LogSoCR
.waf/waflib/extras/run_r_script.py
51
2766
#!/usr/bin/env python # encoding: utf-8 # Hans-Martin von Gaudecker, 2012 """ Run a R script in the directory specified by **ctx.bldnode**. For error-catching purposes, keep an own log-file that is destroyed if the task finished without error. If not, it will show up as rscript_[index].log in the bldnode directory. ...
agpl-3.0
Nikoala/CouchPotatoServer
couchpotato/core/media/movie/providers/trailer/youtube_dl/extractor/cspan.py
29
3430
from __future__ import unicode_literals import re from .common import InfoExtractor from ..utils import ( int_or_none, unescapeHTML, find_xpath_attr, ) class CSpanIE(InfoExtractor): _VALID_URL = r'http://(?:www\.)?c-span\.org/video/\?(?P<id>[0-9a-f]+)' IE_DESC = 'C-SPAN' _TESTS = [{ ...
gpl-3.0
rajalokan/keystone
keystone/identity/backends/ldap/common.py
1
71718
# Copyright 2012 OpenStack Foundation # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in...
apache-2.0
aabadie/RIOT
tests/pkg_openwsn_sock_udp/tests/01-run.py
39
3105
#!/usr/bin/env python3 # Copyright (C) 2016 Kaspar Schleiser <kaspar@schleiser.de> # # This file is subject to the terms and conditions of the GNU Lesser # General Public License v2.1. See the file LICENSE in the top level # directory for more details. import sys from testrunner import run def testfunc(child): ...
lgpl-2.1
jphilipsen05/zulip
zerver/lib/unminify.py
6
1904
from __future__ import absolute_import import re import os.path import sourcemap from six.moves import map from typing import Dict, Text class SourceMap(object): '''Map (line, column) pairs from generated to source file.''' def __init__(self, sourcemap_dir): # type: (Text) -> None self._dir...
apache-2.0
Krienas/allianceauth
allianceauth/services/modules/example/auth_hooks.py
5
1328
from django.template.loader import render_to_string from allianceauth import hooks from allianceauth.services.hooks import ServicesHook from .urls import urlpatterns class ExampleService(ServicesHook): def __init__(self): ServicesHook.__init__(self) self.urlpatterns = urlpatterns self.ser...
gpl-2.0
closeio/flask-admin
flask_admin/contrib/mongoengine/ajax.py
15
4264
import mongoengine from flask_admin._compat import string_types, as_unicode, iteritems from flask_admin.model.ajax import AjaxModelLoader, DEFAULT_PAGE_SIZE class QueryAjaxModelLoader(AjaxModelLoader): def __init__(self, name, model, **options): """ Constructor. :param fields: ...
bsd-3-clause
threatstream/snort_hpfeeds
src/tests.py
1
2791
import unittest import json from snort import Alert class TestSnortParser(unittest.TestCase): maxDiff = None def test_parse_buffer_udp(self): buf = """[**] [1:2003195:5] ET POLICY Unusual number of DNS No Such Name Responses [**] [Classification: Potentially Bad Traffic] [Priority: 2] 05/04/14-11...
gpl-3.0
ppries/tensorflow
tensorflow/contrib/metrics/python/metrics/classification_test.py
24
4556
# 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
gkc1000/pyscf
pyscf/geomopt/berny_solver.py
1
9010
#!/usr/bin/env python # Copyright 2014-2019 The PySCF Developers. All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # U...
apache-2.0
Darkmoth/python-django-4
Thing/env/Lib/site-packages/setuptools/command/install_lib.py
396
3771
import os import imp from itertools import product, starmap import distutils.command.install_lib as orig class install_lib(orig.install_lib): """Don't add compiled flags to filenames of non-Python files""" def run(self): self.build() outfiles = self.install() if outfiles is not None: ...
gpl-2.0
Azure/azure-sdk-for-python
sdk/communication/azure-communication-sms/azure/communication/sms/_shared/policy.py
4
2816
# ------------------------------------------------------------------------ # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # ------------------------------------------------------------------------- import hash...
mit
40223234/2015cdb_g1_0134
static/Brython3.1.1-20150328-091302/Lib/shutil.py
720
39101
"""Utility functions for copying and archiving files and directory trees. XXX The functions here don't copy the resource fork or other metadata on Mac. """ import os import sys import stat from os.path import abspath import fnmatch import collections import errno import tarfile try: import bz2 del bz2 _...
gpl-3.0
ingenioustechie/cookiecutter-django-openshift
hooks/post_gen_project.py
1
8246
""" Does the following: 1. Generates and saves random secret key 2. Removes the taskapp if celery isn't going to be used 3. Removes the .idea directory if PyCharm isn't going to be used 4. Copy files from /docs/ to {{ cookiecutter.project_slug }}/docs/ TODO: this might have to be moved to a pre_gen_hook A portio...
mit
jumpstarter-io/neutron
neutron/tests/unit/vmware/vshield/test_loadbalancer_driver.py
6
15549
# Copyright 2013 VMware, 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...
apache-2.0
ryantierney513/capirca
lib/windows.py
2
12635
# Copyright 2016 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 agr...
apache-2.0
smuthunoori/ComicCreator
generaloptions.py
1
1035
__author__ = 'smuthunoori' import kivy kivy.require('1.7.0') from kivy.uix.boxlayout import BoxLayout from kivy.properties import ListProperty class GeneralOptions(BoxLayout): group_mode = False translation = ListProperty(None) def clear(self, instance): self.drawing_space.clear_widgets() ...
mit
RusticiSoftware/TinCanPython
test/lrs_response_test.py
1
6200
# coding=utf-8 # # Copyright 2014 Rustici Software # # 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 respuired by applic...
apache-2.0
dvitme/vertical-hotel
__unported__/hotel_reservation/report/hotel_reservation_report.py
4
3904
# -*- encoding: utf-8 -*- ############################################################################## # # OpenERP, Open Source Management Solution # Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>). # # This program is free software: you can redistribute it and/or modify # it under the terms of t...
agpl-3.0
SamYaple/neutron
neutron/tests/unit/agent/l3/test_router_info.py
16
12825
# Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # d...
apache-2.0
gunzy83/ansible-modules-extras
network/f5/bigip_virtual_server.py
3
20637
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2015, Etienne Carriere <etienne.carriere@gmail.com> # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version ...
gpl-3.0
alexmandujano/django
django/template/defaulttags.py
104
50149
"""Default tags used by the template system, available to all templates.""" from __future__ import unicode_literals import os import sys import re from datetime import datetime from itertools import groupby, cycle as itertools_cycle import warnings from django.conf import settings from django.template.base import (No...
bsd-3-clause
AleksNeStu/ggrc-core
bin/setup_linked_packages.py
7
3270
#!/usr/bin/env python # Copyright (C) 2017 Google Inc. # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> """Setup linked packages required for GGRC """ import subprocess def run_shell(script): proc = subprocess.Popen(script, shell=True, stdout=subprocess.PIPE) proc.wait() return ...
apache-2.0
grehx/spark-tk
python/sparktk/dicom/dicom.py
13
10173
# vim: set encoding=utf-8 # Copyright (c) 2016 Intel Corporation  # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # #       http://www.apache.org/licenses/LICENSE-2.0 # # Unless require...
apache-2.0
dqnykamp/sympy
sympy/strategies/tests/test_rl.py
126
1714
from sympy.strategies.rl import (rm_id, glom, flatten, unpack, sort, distribute, subs, rebuild) from sympy import Basic def test_rm_id(): rmzeros = rm_id(lambda x: x == 0) assert rmzeros(Basic(0, 1)) == Basic(1) assert rmzeros(Basic(0, 0)) == Basic(0) assert rmzeros(Basic(2, 1)) == Basic(2, 1) ...
bsd-3-clause
code-google-com/cortex-vfx
test/IECoreRI/SXRendererTest.py
5
34610
########################################################################## # # Copyright (c) 2011, Image Engine Design 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: # # * Redistribu...
bsd-3-clause
kkdd/arangodb
3rdParty/V8-4.3.61/third_party/python_26/Lib/site-packages/py2exe/boot_com_servers.py
20
4461
# This support script is executed as the entry point for py2exe. import sys import win32api if 0: ################################################################ # XXX Remove later! class LOGGER: def __init__(self): self.softspace = None self.ofi = open(r"c:\comerror.txt",...
apache-2.0
badbear1727/rur-ple
rur_py/parser.py
4
1971
# -*- coding: utf-8 """ RUR-PLE: Roberge's Used Robot - a Python Learning Environment parser.py - Verifies program files integrity and safety Version 0.8.7 Author: Andre Roberge Copyright 2005 andre.roberge@gmail.com """ import re from translation import _ def FixLineEnding(txt): # We are goin...
gpl-2.0
kinoc/opencog
opencog/python/pln_old/rules/context_rules_old.py
32
2706
from opencog.atomspace import types, TruthValue import formulas from pln.rule import Rule # Todo: # It may be better to use SubsetLinks instead of ContextLinks, or at # least implicitly convert them. # (Context C x).tv = (Subset C x).tv # (Context C: Subset x y).tv = (Subset (x AND C) (y AND C)) # DeductionRule prod...
agpl-3.0
overtherain/scriptfile
software/googleAppEngine/lib/django_1_4/django/contrib/gis/geos/prototypes/geom.py
102
4430
from ctypes import c_char_p, c_int, c_size_t, c_ubyte, POINTER from django.contrib.gis.geos.libgeos import CS_PTR, GEOM_PTR from django.contrib.gis.geos.prototypes.errcheck import ( check_geom, check_minus_one, check_sized_string, check_string, check_zero) from django.contrib.gis.geos.prototypes.threadsafe import G...
mit
mgahsan/QuantEcon.py
examples/solow.py
6
1358
""" Filename: solow.py Reference: http://quant-econ.net/py/python_oop.html """ from __future__ import division # Omit for Python 3.x import numpy as np class Solow: """ Implements the Solow growth model with update rule .. math:: k_{t+1} = \frac{s z k^{\alpha}_t}{1 + n} + k_t \frac{1 + d}{1 + n}...
bsd-3-clause
gromez/Sick-Beard
bs4/builder/_html5lib.py
119
7746
__all__ = [ 'HTML5TreeBuilder', ] import warnings from bs4.builder import ( PERMISSIVE, HTML, HTML_5, HTMLTreeBuilder, ) from bs4.element import NamespacedAttribute import html5lib from html5lib.constants import namespaces from bs4.element import ( Comment, Doctype, NavigableStr...
gpl-3.0
Symmetric/calico-docker
calico_containers/tests/st/test_duplicate_ips.py
2
3182
# Copyright 2015 Metaswitch Networks # # 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 w...
apache-2.0
GuillaumeGomez/servo
tests/wpt/css-tests/tools/wptserve/wptserve/constants.py
141
4619
from . import utils content_types = utils.invert_dict({"text/html": ["htm", "html"], "application/json": ["json"], "application/xhtml+xml": ["xht", "xhtm", "xhtml"], "application/xml": ["xml"], ...
mpl-2.0
ychaim/FPGA-Litecoin-Miner
ICARUS-LX150/MiningSoftware/pyserial-2.6/examples/port_publisher.py
7
16973
#! /usr/bin/env python """\ Multi-port serial<->TCP/IP forwarder. - RFC 2217 - check existence of serial port periodically - start/stop forwarders - each forwarder creates a server socket and opens the serial port - serial ports are opened only once. network connect/disconnect does not influence serial port - only on...
gpl-3.0
ericchill/gnofract4d
fract4d/gradient.py
1
28489
#!/usr/bin/env python import math import re import StringIO import copy import random import types import struct import colorsys #Class definition for Gradients #These use the format defined by the GIMP #The file format is: # GIMP Gradient ; literal identifier # Name: <utf8-name> ; optional, else get from filename ...
bsd-3-clause
mlperf/training_results_v0.6
Google/benchmarks/transformer/implementations/tpu-v3-32-transformer/dataset_preproc/data_generators/allen_brain.py
7
13916
# coding=utf-8 # Copyright 2018 The Tensor2Tensor Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
apache-2.0
lancezlin/ml_template_py
lib/python2.7/site-packages/pygments/lexers/graph.py
25
2370
# -*- coding: utf-8 -*- """ pygments.lexers.graph ~~~~~~~~~~~~~~~~~~~~~ Lexers for graph query languages. :copyright: Copyright 2006-2015 by the Pygments team, see AUTHORS. :license: BSD, see LICENSE for details. """ import re from pygments.lexer import RegexLexer, include, bygroups, using, this...
mit
ustudio/python-oauth2
oauth2/clients/imap.py
885
1685
""" The MIT License Copyright (c) 2007-2010 Leah Culver, Joe Stump, Mark Paschal, Vic Fryzel Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the ...
mit
thisisshi/cloud-custodian
tools/c7n_salactus/c7n_salactus/db.py
2
7437
# Copyright The Cloud Custodian Authors. # SPDX-License-Identifier: Apache-2.0 import json import os from collections import Counter from dateutil.parser import parse from c7n_salactus.worker import connection as conn class Database: def __init__(self, path=None): if path: with open(os.path...
apache-2.0
poppingtonic/BayesDB
examples/flights/run_flights_example.py
2
1217
# # Copyright (c) 2010-2014, MIT Probabilistic Computing Project # # Lead Developers: Jay Baxter and Dan Lovell # Authors: Jay Baxter, Dan Lovell, Baxter Eaves, Vikash Mansinghka # Research Leads: Vikash Mansinghka, Patrick Shafto # # Licensed under the Apache License, Version 2.0 (the "License"); # you may...
apache-2.0
qedi-r/home-assistant
tests/components/zeroconf/test_init.py
4
3588
"""Test Zeroconf component setup process.""" from unittest.mock import patch import pytest from zeroconf import ServiceInfo, ServiceStateChange from homeassistant.generated import zeroconf as zc_gen from homeassistant.setup import async_setup_component from homeassistant.components import zeroconf @pytest.fixture d...
apache-2.0
bouhlelma/smt
smt/sampling_methods/tests/test_sampling_method_examples.py
3
1403
import unittest import matplotlib matplotlib.use("Agg") class Test(unittest.TestCase): def test_random(self): import numpy as np import matplotlib.pyplot as plt from smt.sampling_methods import Random xlimits = np.array([[0.0, 4.0], [0.0, 3.0]]) sampling = Random(xlimit...
bsd-3-clause
moreati/numpy
numpy/core/code_generators/generate_umath.py
57
31090
from __future__ import division, print_function import os import re import struct import sys import textwrap sys.path.insert(0, os.path.dirname(__file__)) import ufunc_docstrings as docstrings sys.path.pop(0) Zero = "PyUFunc_Zero" One = "PyUFunc_One" None_ = "PyUFunc_None" ReorderableNone = "PyUFunc_ReorderableNone"...
bsd-3-clause
shravan-achar/servo
tests/wpt/web-platform-tests/tools/pywebsocket/src/test/test_mock.py
496
5168
#!/usr/bin/env python # # Copyright 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...
mpl-2.0
MichalKononenko/OmicronAPI
omicron_server/views/abstract_resource.py
2
3563
import abc import jsonschema from functools import wraps from flask import request, jsonify, abort from flask.ext.restful import Resource __author__ = 'Michal Kononenko' class AbstractResource(Resource): """ Abstract class that defines an API view with a schema built into it. This class is capable of ser...
gpl-2.0
jordanemedlock/psychtruths
temboo/Library/Clicky/AdvancedFilter.py
4
5441
# -*- coding: utf-8 -*- ############################################################################### # # AdvancedFilter # Allows you to retrieve analytics, using more advanced filter options. # # Python versions 2.6, 2.7, 3.x # # Copyright 2014, Temboo Inc. # # Licensed under the Apache License, Version 2.0 (the "L...
apache-2.0
bdh1011/wau
venv/lib/python2.7/site-packages/flask/testsuite/testing.py
561
7411
# -*- coding: utf-8 -*- """ flask.testsuite.testing ~~~~~~~~~~~~~~~~~~~~~~~ Test client and more. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import flask import unittest from flask.testsuite import FlaskTestCase from flask._compat import text_type c...
mit
EvanK/ansible-modules-extras
packaging/os/pkgutil.py
29
7134
#!/usr/bin/python # -*- coding: utf-8 -*- # (c) 2013, Alexander Winkler <mail () winkler-alexander.de> # based on svr4pkg by # Boyd Adamson <boyd () boydadamson.com> (2012) # # 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 Publ...
gpl-3.0
CactusTribe/PyRobot
src/server/modules/CameraModule.py
1
1742
import threading, io, struct, time from ThreadClient import ThreadClient from devices.Devices import * class CameraModule(ThreadClient): def __init__(self, name): ThreadClient.__init__(self, name) self.camera_capture = False # Execute command def execute_cmd(self, cmd): args = cmd.split(" ") cmd = args[0]...
gpl-3.0