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
fgesora/odoo
addons/note/__openerp__.py
260
2182
# -*- 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
patrick91/pycon
backend/pages/migrations/0001_initial.py
1
1619
# Generated by Django 2.2.4 on 2019-08-27 22:02 from django.db import migrations, models import django.db.models.deletion import django.utils.timezone import model_utils.fields class Migration(migrations.Migration): initial = True dependencies = [ ('conferences', '0007_auto_20190811_1953'), ] ...
mit
claneys/shinken
test/test_satellites.py
18
2982
#!/usr/bin/env python # Copyright (C) 2009-2014: # Gabes Jean, naparuba@gmail.com # Gerhard Lausser, Gerhard.Lausser@consol.de # # This file is part of Shinken. # # Shinken 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 F...
agpl-3.0
bob-the-hamster/kivy
kivy/uix/floatlayout.py
26
3807
''' Float Layout ============ :class:`FloatLayout` honors the :attr:`~kivy.uix.widget.Widget.pos_hint` and the :attr:`~kivy.uix.widget.Widget.size_hint` properties of its children. .. only:: html .. image:: images/floatlayout.gif :align: right .. only:: latex .. image:: images/floatlayout.png ...
mit
e-gob/plataforma-kioscos-autoatencion
scripts/ansible-play/.venv/lib/python2.7/site-packages/ansible/plugins/connection/zone.py
21
7937
# Based on local.py (c) 2012, Michael DeHaan <michael.dehaan@gmail.com> # and chroot.py (c) 2013, Maykel Moya <mmoya@speedyrails.com> # and jail.py (c) 2013, Michael Scherer <misc@zarb.org> # (c) 2015, Dagobert Michelsen <dam@baltic-online.de> # (c) 2015, Toshio Kuratomi <tkuratomi@ansible.com> # Copyright (c...
bsd-3-clause
jblackburne/scikit-learn
sklearn/tree/export.py
12
16020
""" This module defines export functions for decision trees. """ # Authors: Gilles Louppe <g.louppe@gmail.com> # Peter Prettenhofer <peter.prettenhofer@gmail.com> # Brian Holt <bdholt1@gmail.com> # Noel Dawe <noel@dawe.me> # Satrajit Gosh <satrajit.ghosh@gmail.com> # Trevor...
bsd-3-clause
lmazuel/azure-sdk-for-python
azure-mgmt-sql/azure/mgmt/sql/operations/sync_members_operations.py
1
37014
# coding=utf-8 # -------------------------------------------------------------------------- # Copyright (c) Microsoft Corporation. All rights reserved. # Licensed under the MIT License. See License.txt in the project root for # license information. # # Code generated by Microsoft (R) AutoRest Code Generator. # Changes ...
mit
cwq/ijkplayer
tools/copyrighter/CRFile.py
12
4633
#! /usr/bin/env bash # # Copyright (C) 2013-2017 Bilibili # Copyright (C) 2013-2017 Zhang Rui <bbcallen@gmail.com> # # 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.o...
gpl-2.0
awatts/boto
boto/ec2/instancetype.py
152
2273
# Copyright (c) 2006-2009 Mitch Garnaat http://garnaat.org/ # # 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, modi...
mit
toastedcornflakes/scikit-learn
sklearn/utils/tests/test_class_weight.py
50
13151
import numpy as np from sklearn.linear_model import LogisticRegression from sklearn.datasets import make_blobs from sklearn.utils.class_weight import compute_class_weight from sklearn.utils.class_weight import compute_sample_weight from sklearn.utils.testing import assert_array_almost_equal from sklearn.utils.testin...
bsd-3-clause
lenw/ansible-modules-core
cloud/amazon/ec2_snapshot.py
67
10167
#!/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
FCP-INDI/nipype
nipype/interfaces/mipav/tests/test_auto_MedicAlgorithmThresholdToBinaryMask.py
12
1499
# AUTO-GENERATED by tools/checkspecs.py - DO NOT EDIT from ....testing import assert_equal from ..developer import MedicAlgorithmThresholdToBinaryMask def test_MedicAlgorithmThresholdToBinaryMask_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ...
bsd-3-clause
proximate/proximate
scheduler.py
1
6380
# # Proximate - Peer-to-peer social networking # # Copyright (c) 2008-2011 Nokia Corporation # # All rights reserved. # # This software is licensed under The Clear BSD license. # See the LICENSE file for more details. # from gobject import timeout_add_seconds from datetime import datetime, timedelta from os import list...
bsd-3-clause
dimroc/tensorflow-mnist-tutorial
lib/python3.6/site-packages/tensorflow/python/ops/rnn_cell_impl.py
31
5806
# 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
aazen/DayOne
slyd/slyd/resource.py
8
1299
import json, errno from twisted.web.resource import Resource, NoResource, ErrorPage class SlydJsonResource(Resource): """Base Resource for Slyd Resources This sets the content type to JSON and handles errors """ def render(self, request): request.setResponseCode(200) request.setHeade...
bsd-3-clause
mihailignatenko/erp
openerp/modules/registry.py
220
19731
# -*- coding: 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 the GNU...
agpl-3.0
PatKayongo/patkayongo.github.io
node_modules/pygmentize-bundled/vendor/pygments/build-2.7/pygments/styles/manni.py
364
2374
# -*- coding: utf-8 -*- """ pygments.styles.manni ~~~~~~~~~~~~~~~~~~~~~ A colorful style, inspired by the terminal highlighting style. This is a port of the style used in the `php port`_ of pygments by Manni. The style is called 'default' there. :copyright: Copyright 2006-2013 by the Pygments...
mit
shujingke/opencog
opencog/python/pln_old/examples/deduction/deduction_agent.py
32
1303
""" PLN Simple Deduction Agent Example Demonstrates the simplest possible forward inference agent that implements a chainer with one inference rule and one link type For instructions, refer to the README for PLN. """ from opencog.cogserver import MindAgent from opencog.atomspace import types from pln.chainers import...
agpl-3.0
wisechengyi/pants
tests/python/pants_test/backend/graph_info/tasks/test_dependees.py
1
9733
# Copyright 2014 Pants project contributors (see CONTRIBUTORS.md). # Licensed under the Apache License, Version 2.0 (see LICENSE). from textwrap import dedent from pants.backend.codegen.thrift.java.java_thrift_library import JavaThriftLibrary from pants.backend.graph_info.tasks.dependees import ReverseDepmap from pan...
apache-2.0
playm2mboy/edx-platform
common/test/acceptance/tests/studio/test_studio_with_ora_component.py
87
4074
""" Acceptance tests for Studio related to edit/save peer grading interface. """ from ...fixtures.course import XBlockFixtureDesc from ...pages.studio.import_export import ExportCoursePage from ...pages.studio.component_editor import ComponentEditorView from ...pages.studio.overview import CourseOutlinePage from base_...
agpl-3.0
Teamxrtc/webrtc-streaming-node
third_party/depot_tools/external_bin/gsutil/gsutil_4.15/gsutil/third_party/boto/boto/route53/hostedzone.py
136
1961
# Copyright (c) 2010 Mitch Garnaat http://garnaat.org/ # Copyright (c) 2010, Eucalyptus Systems, Inc. # All rights reserved. # # Permission is hereby granted, free of charge, to any person obtaining a # copy of this software and associated documentation files (the # "Software"), to deal in the Software without restrict...
mit
jocelynmass/nrf51
toolchain/deprecated/arm_cm0_4.9/arm-none-eabi/share/gdb/python/gdb/printing.py
12
10681
# Pretty-printer utilities. # Copyright (C) 2010-2014 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 3 of the License, or # (at your option) any l...
gpl-2.0
cosurgi/trunk
examples/HydroForceEngine/validations/DEMCoupling/Maurinetal2015/validMaurin2015.py
2
17210
from __future__ import print_function ######################################################################################################################################################################### # Author: Raphael Maurin, raphael.maurin@imft.fr # 24/11/2017 # # Reproduce the experimental comparison of Mauri...
gpl-2.0
russel1237/scikit-learn
sklearn/decomposition/__init__.py
147
1421
""" The :mod:`sklearn.decomposition` module includes matrix decomposition algorithms, including among others PCA, NMF or ICA. Most of the algorithms of this module can be regarded as dimensionality reduction techniques. """ from .nmf import NMF, ProjectedGradientNMF from .pca import PCA, RandomizedPCA from .incrementa...
bsd-3-clause
ddurando/my_pox
pox/lib/packet/icmp.py
39
7027
# Copyright 2011 James McCauley # Copyright 2008 (C) Nicira, 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 ap...
apache-2.0
Ictp/indico
bin/migration/CategoryDate.py
1
2445
# -*- coding: utf-8 -*- ## ## ## This file is part of Indico. ## Copyright (C) 2002 - 2014 European Organization for Nuclear Research (CERN). ## ## Indico 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; eith...
gpl-3.0
MisterPup/Ceilometer-Juno-Extension
ceilometer/network/services/fwaas.py
6
3146
# # Copyright 2014 Cisco Systems,Inc. # # Author: Pradeep Kilambi <pkilambi@cisco.com> # # 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
raycarnes/account-financial-tools
account_credit_control/invoice.py
24
2923
# -*- coding: utf-8 -*- ############################################################################## # # Author: Vincent Renaville # Copyright 2013 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # p...
agpl-3.0
leedm777/ansible
lib/ansible/executor/task_executor.py
10
22095
# (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
camellhf/three.js
utils/exporters/blender/addons/io_three/exporter/_json.py
296
6976
import json from .. import constants ROUND = constants.DEFAULT_PRECISION ## THREE override function def _json_floatstr(o): if ROUND is not None: o = round(o, ROUND) return '%g' % o def _make_iterencode(markers, _default, _encoder, _indent, _floatstr, _key_separator, _item_separator,...
mit
Venturi/cms
env/lib/python2.7/site-packages/app_data/forms.py
2
9733
try: from operator import methodcaller except ImportError: methodcaller = lambda name: lambda o: getattr(o, name)() from django.forms.forms import NON_FIELD_ERRORS, Form from django.forms.formsets import formset_factory from django.forms.models import modelform_factory, _get_foreign_key, BaseInlineFormSet, Bas...
gpl-2.0
rahul67/hue
desktop/core/ext-py/pycrypto-2.6.1/lib/Crypto/SelfTest/PublicKey/test_ElGamal.py
112
8507
# -*- coding: utf-8 -*- # # SelfTest/PublicKey/test_ElGamal.py: Self-test for the ElGamal primitive # # =================================================================== # The contents of this file are dedicated to the public domain. To # the extent that dedication to the public domain is not available, # everyone ...
apache-2.0
B-MOOC/edx-platform
lms/djangoapps/course_wiki/middleware.py
84
4980
"""Middleware for course_wiki""" from urlparse import urlparse from django.conf import settings from django.http import Http404 from django.shortcuts import redirect from django.core.exceptions import PermissionDenied from wiki.models import reverse from courseware.courses import get_course_with_access from courseware...
agpl-3.0
matuu/pyafipws
formatos/formato_json.py
16
1324
#!/usr/bin/python # -*- coding: latin-1 -*- # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3, or (at your option) any later # version. # # This program is distributed in the hope...
gpl-3.0
wbchen99/bitcoin-hnote0
qa/rpc-tests/test_framework/bignum.py
123
1929
#!/usr/bin/env python3 # # bignum.py # # This file is copied from python-bitcoinlib. # # Distributed under the MIT software license, see the accompanying # file COPYING or http://www.opensource.org/licenses/mit-license.php. # """Bignum routines""" import struct # generic big endian MPI format def bn_bytes(v, have...
mit
Innovahn/cybex
addons/crm/base_partner_merge.py
75
30912
#!/usr/bin/env python from __future__ import absolute_import from email.utils import parseaddr import functools import htmlentitydefs import itertools import logging import operator import psycopg2 import re from ast import literal_eval from openerp.tools import mute_logger # Validation Library https://pypi.python.org...
agpl-3.0
dagwieers/ansible
test/integration/targets/module_utils/library/test.py
172
2948
#!/usr/bin/python # Most of these names are only available via PluginLoader so pylint doesn't # know they exist # pylint: disable=no-name-in-module results = {} # Test import with no from import ansible.module_utils.foo0 results['foo0'] = ansible.module_utils.foo0.data # Test depthful import with no from import ansib...
gpl-3.0
anirudhjayaraman/scikit-learn
sklearn/semi_supervised/tests/test_label_propagation.py
307
1974
""" test the label propagation module """ import nose import numpy as np from sklearn.semi_supervised import label_propagation from numpy.testing import assert_array_almost_equal from numpy.testing import assert_array_equal ESTIMATORS = [ (label_propagation.LabelPropagation, {'kernel': 'rbf'}), (label_propa...
bsd-3-clause
B-MOOC/edx-platform
lms/envs/static.py
100
2249
""" This config file runs the simplest dev environment using sqlite, and db-based sessions. Assumes structure: /envroot/ /db # This is where it'll write the database file /edx-platform # The location of this repo /log # Where we're going to write log files """ # We intentionally define lot...
agpl-3.0
tvalacarta/tvalacarta
python/main-classic/core/jsontools.py
3
10591
# -*- coding: utf-8 -*- # ------------------------------------------------------------ # tvalacarta 4 # Copyright 2015 tvalacarta@gmail.com # http://blog.tvalacarta.info/plugin-xbmc/tvalacarta/ # # Distributed under the terms of GNU General Public License v3 (GPLv3) # http://www.gnu.org/licenses/gpl-3.0.html # --------...
gpl-3.0
ccomb/OpenUpgrade
openerp/report/render/html2html/html2html.py
443
4238
# -*- coding: 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 the...
agpl-3.0
Danielhiversen/home-assistant
homeassistant/components/sensor/nut.py
6
12534
""" Provides a sensor to track various status aspects of a UPS. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.nut/ """ import logging from datetime import timedelta import voluptuous as vol from homeassistant.components.sensor import PLATFORM_S...
mit
mmauroy/SickRage
tornado/test/simple_httpclient_test.py
20
22936
from __future__ import absolute_import, division, print_function, with_statement import collections from contextlib import closing import errno import gzip import logging import os import re import socket import sys from tornado import gen from tornado.httpclient import AsyncHTTPClient from tornado.httputil import HT...
gpl-3.0
nlloyd/SubliminalCollaborator
libs/twisted/scripts/test/test_scripts.py
6
5896
# Copyright (c) Twisted Matrix Laboratories. # See LICENSE for details. """ Tests for the command-line scripts in the top-level I{bin/} directory. Tests for actual functionality belong elsewhere, written in a way that doesn't involve launching child processes. """ from os import devnull, getcwd, chdir from sys impor...
apache-2.0
mlizhenbin/zookeeper
src/contrib/zkpython/src/test/clientid_test.py
164
1739
#!/usr/bin/python # # 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 # "Lic...
apache-2.0
russss/Diamond
src/diamond/utils/scheduler.py
15
3642
# coding=utf-8 import time import math import multiprocessing import os import random import sys import signal try: from setproctitle import getproctitle, setproctitle except ImportError: setproctitle = None from diamond.utils.signals import signal_to_exception from diamond.utils.signals import SIGALRMExcept...
mit
felix-d/fabric
tests/test_project.py
3
5218
import unittest import os import fudge from fudge.inspector import arg from fabric.contrib import project class UploadProjectTestCase(unittest.TestCase): """Test case for :func: `fabric.contrib.project.upload_project`.""" fake_tmp = "testtempfolder" def setUp(self): fudge.clear_expectations()...
bsd-2-clause
delete/estofadora
estofadora/statement/tests/test_views.py
1
17443
# conding: utf-8 import datetime from datetime import timedelta from django.core.urlresolvers import reverse from . import TestBase, CashForm, Cash, make_validated_form, create_cash class HomeViewTest(TestBase): def setUp(self): self.login() self.url = reverse('statement:home') self.res...
mit
dantebarba/docker-media-server
plex/Subliminal.bundle/Contents/Libraries/Shared/guessit/options.py
39
4547
from argparse import ArgumentParser def build_opts(transformers=None): opts = ArgumentParser() opts.add_argument(dest='filename', help='Filename or release name to guess', nargs='*') naming_opts = opts.add_argument_group("Naming") naming_opts.add_argument('-t', '--type', dest='type', default=None, ...
gpl-3.0
mavit/ansible-modules-extras
source_control/gitlab_user.py
14
12435
#!/usr/bin/python # (c) 2015, Werner Dijkerman (ikben@werner-dijkerman.nl) # # 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...
gpl-3.0
scalyr/scalyr-agent-2
scalyr_agent/third_party/pysnmp/smi/error.py
2
1778
from pyasn1.error import PyAsn1Error from pysnmp.error import PySnmpError class SmiError(PySnmpError, PyAsn1Error): pass class MibLoadError(SmiError): pass class MibNotFoundError(MibLoadError): pass class MibOperationError(SmiError): def __init__(self, **kwargs): self.__outArgs = kwargs def __str__(self): ret...
apache-2.0
ononeor12/python-social-auth
examples/django_me_example/example/wsgi.py
114
1131
""" WSGI config for dj project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` setti...
bsd-3-clause
stormi/tsunami
src/secondaires/navigation/equipage/ordres/feu.py
1
2632
# -*-coding:Utf-8 -* # Copyright (c) 2013 LE GOFF Vincent # All rights reserved. # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions are met: # # * Redistributions of source code must retain the above copyright notice, this # lis...
bsd-3-clause
mrjacobagilbert/gnuradio
gr-blocks/python/blocks/qa_tag_share.py
5
1801
#!/usr/bin/env python # -*- coding: utf-8 -*- # # Copyright 2017 Free Software Foundation, Inc. # # This file is part of GNU Radio # # SPDX-License-Identifier: GPL-3.0-or-later # # from gnuradio import gr, gr_unittest from gnuradio import blocks import pmt class qa_tag_share(gr_unittest.TestCase): def setUp(sel...
gpl-3.0
n0trax/ansible
contrib/inventory/gce.py
47
18346
#!/usr/bin/env python # Copyright 2013 Google 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 ...
gpl-3.0
mozilla/stoneridge
python/src/Lib/plat-mac/Carbon/Appearance.py
81
27268
# Generated from 'Appearance.h' def FOUR_CHAR_CODE(x): return x kAppearanceEventClass = FOUR_CHAR_CODE('appr') kAEAppearanceChanged = FOUR_CHAR_CODE('thme') kAESystemFontChanged = FOUR_CHAR_CODE('sysf') kAESmallSystemFontChanged = FOUR_CHAR_CODE('ssfn') kAEViewsFontChanged = FOUR_CHAR_CODE('vfnt') kThemeDataFileType =...
mpl-2.0
kingmotley/SickRage
lib/tornado/test/curl_httpclient_test.py
107
4477
from __future__ import absolute_import, division, print_function, with_statement from hashlib import md5 from tornado.escape import utf8 from tornado.httpclient import HTTPRequest from tornado.stack_context import ExceptionStackContext from tornado.testing import AsyncHTTPTestCase from tornado.test import httpclient_...
gpl-3.0
Arcanemagus/plexpy
lib/chardet/escprober.py
289
3950
######################## 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...
gpl-3.0
hobarrera/django
tests/m2m_recursive/models.py
410
1120
""" Many-to-many relationships between the same two tables In this example, a ``Person`` can have many friends, who are also ``Person`` objects. Friendship is a symmetrical relationship - if I am your friend, you are my friend. Here, ``friends`` is an example of a symmetrical ``ManyToManyField``. A ``Person`` can als...
bsd-3-clause
thresholdsoftware/asylum
openerp/addons/account_anglo_saxon/product.py
51
3427
############################################################################## # # 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
ping/youtube-dl
youtube_dl/extractor/cbssports.py
22
1486
from __future__ import unicode_literals from .cbs import CBSBaseIE class CBSSportsIE(CBSBaseIE): _VALID_URL = r'https?://(?:www\.)?cbssports\.com/[^/]+/(?:video|news)/(?P<id>[^/?#&]+)' _TESTS = [{ 'url': 'https://www.cbssports.com/nba/video/donovan-mitchell-flashes-star-potential-in-game-2-victory-o...
unlicense
wadadaaa/marta
config/settings/local.py
1
1961
# -*- coding: utf-8 -*- ''' Local settings - Run in Debug mode - Use console backend for emails - Add Django Debug Toolbar - Add django-extensions as app ''' from .common import * # noqa # DEBUG # ------------------------------------------------------------------------------ DEBUG = env.bool('DJANGO_DEBUG', default...
bsd-3-clause
pshchelo/heat
contrib/heat_keystone/heat_keystone/resources/service.py
2
3670
# # 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 # ...
apache-2.0
kingland/go-v8
v8-3.28/build/gyp/test/intermediate_dir/gyptest-intermediate-dir.py
243
1398
#!/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. """ Verifies that targets have independent INTERMEDIATE_DIRs. """ import TestGyp test = TestGyp.TestGyp() test.run_gyp('test.gyp', chdir=...
mit
gautamMalu/rootfs_xen_arndale
usr/lib/python2.7/io.py
53
3321
"""The io module provides the Python interfaces to stream handling. The builtin open function is defined in this module. At the top of the I/O hierarchy is the abstract base class IOBase. It defines the basic interface to a stream. Note, however, that there is no separation between reading and writing to streams; impl...
gpl-2.0
SaschaMester/delicium
sync/tools/testserver/sync_testserver.py
24
20023
#!/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. """This is a python sync server used for testing Chrome Sync. By default, it listens on an ephemeral port and xmpp_port and sends the ...
bsd-3-clause
jasondunsmore/heat
heat/tests/openstack/neutron/lbaas/test_health_monitor.py
2
7098
# # Copyright 2015 IBM Corp. # # 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
bergzand/RIOT-graphs
riot-graph.py
1
2915
#!/usr/bin/env python3 import logging from logging import StreamHandler from docopt import docopt from riot_graphs.rg import RiotGraph from riot_graphs import server def fetch(args, graphs): days = None if args['--days']: try: days = int(args['--days']) except: raise ...
gpl-3.0
PhilSk/zulip
contrib_bots/bots/encrypt/tests.py
15
1168
import encrypt_bot def test(): for cmd, expected_response in sample_conversation(): message = {'content': cmd, 'subject': 'foo', 'display_recipient': 'bar'} class ClientDummy(object): def __init__(self): self.output = '' def send_message(...
apache-2.0
alrusdi/lettuce
tests/integration/lib/Django-1.3/tests/modeltests/update/tests.py
89
4252
from django.test import TestCase from models import A, B, C, D, DataPoint, RelatedPoint class SimpleTest(TestCase): def setUp(self): self.a1 = A.objects.create() self.a2 = A.objects.create() for x in range(20): B.objects.create(a=self.a1) D.objects.create(a=self.a1...
gpl-3.0
subodhchhabra/airflow
airflow/utils/operator_resources.py
9
3778
# -*- coding: utf-8 -*- # # 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 #...
apache-2.0
nicproulx/mne-python
mne/preprocessing/tests/test_xdawn.py
3
7741
# Authors: Alexandre Barachant <alexandre.barachant@gmail.com> # Jean-Remi King <jeanremi.king@gmail.com> # # License: BSD (3-clause) import numpy as np import os.path as op from nose.tools import assert_equal, assert_raises, assert_true from numpy.testing import assert_array_equal, assert_array_almost_equal ...
bsd-3-clause
MiLk/ansible
lib/ansible/modules/network/cloudengine/ce_vrf_af.py
47
30552
#!/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 distribut...
gpl-3.0
wkritzinger/asuswrt-merlin
release/src/router/wget/testenv/conf/expected_files.py
17
1873
from difflib import unified_diff import os import sys from conf import hook from exc.test_failed import TestFailed """ Post-Test Hook: ExpectedFiles This is a Post-Test hook that checks the test directory for the files it contains. A dictionary object is passed to it, which contains a mapping of filenames and contents...
gpl-2.0
40123148/w17b
static/Brython3.1.3-20150514-095342/Lib/stat.py
765
4304
"""Constants/functions for interpreting results of os.stat() and os.lstat(). Suggested usage: from stat import * """ # Indices for stat struct members in the tuple returned by os.stat() ST_MODE = 0 ST_INO = 1 ST_DEV = 2 ST_NLINK = 3 ST_UID = 4 ST_GID = 5 ST_SIZE = 6 ST_ATIME = 7 ST_MTIME = 8 ST_CTIME = 9 ...
agpl-3.0
kyle-long/pyshelf
tests/functional_test_base.py
2
10117
from boto.s3.key import Key from mock import Mock from moto import mock_s3 from pyproctor import MonkeyPatcher from shelf.app import app from shelf.error_code import ErrorCode from shelf.metadata.initializer import Initializer from shelf.resource_identity import ResourceIdentity from shelf.search.container import Conta...
mit
marguslaak/django-xadmin
demo_app/demo/settings.py
1
5983
# Django settings for wictrl project. import sys import os.path reload(sys) sys.setdefaultencoding('utf-8') gettext = lambda s: s PROJECT_ROOT = os.path.join( os.path.realpath(os.path.dirname(__file__)), os.pardir) DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@example.com'), ) ...
bsd-3-clause
Aqkotz/Picture
ggame/pygamedeps.py
228
12266
def module_exists(module_name): try: __import__(module_name) except ImportError: return False else: return True # PYTHON 3 and PYGAME DEPENDENCIES if module_exists('pygame'): import pygame class _body(object): def __init__(self): self.events = {} def appe...
mit
pschmitt/home-assistant
homeassistant/components/twilio_call/notify.py
25
1882
"""Twilio Call platform for notify component.""" import logging import urllib from twilio.base.exceptions import TwilioRestException import voluptuous as vol from homeassistant.components.notify import ( ATTR_TARGET, PLATFORM_SCHEMA, BaseNotificationService, ) from homeassistant.components.twilio import D...
apache-2.0
hajgato/easybuild-easyblocks
easybuild/easyblocks/q/qt.py
1
3295
## # Copyright 2013 Ghent University # # This file is part of EasyBuild, # originally created by the HPC team of Ghent University (http://ugent.be/hpc/en), # with support of Ghent University (http://ugent.be/hpc), # the Flemish Supercomputer Centre (VSC) (https://vscentrum.be/nl/en), # the Hercules foundation (http://w...
gpl-2.0
matiasherranz/keyczar
cpp/src/tools/swtoolkit/test/component_targets_xml_test.py
18
3997
#!/usr/bin/python2.4 # 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 of...
apache-2.0
codekaki/odoo
addons/auth_ldap/users_ldap.py
19
10782
############################################################################## # # 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
lukas-hetzenecker/home-assistant
homeassistant/components/sensor/darksky.py
1
11778
""" Support for Dark Sky weather service. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/sensor.darksky/ """ import logging from datetime import timedelta import voluptuous as vol from requests.exceptions import ConnectionError as ConnectError, \ HT...
mit
ppietrasa/grpc
tools/run_tests/run_tests.py
1
54046
#!/usr/bin/env python2.7 # Copyright 2015, 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 lis...
bsd-3-clause
dorbarker/cgmlst_autocreate
json2csv.py
1
2163
import argparse import csv import os import json def arguments(): parser = argparse.ArgumentParser() parser.add_argument('-j', '--jsons', help = 'Path to JSON directory') parser.add_argument('-o', '--out', help = 'CSV output file path.') parser.add_argument('-t', '--test', help = 'Name of the MIST t...
gpl-3.0
tedunderwood/GenreProject
python/workshop/bagofwords.py
2
6896
# bagofwords.py # # The BagOfWords class implements individual volumes as ordered # lists of features. # import numpy as np import pandas as pd from pandas import Series, DataFrame def all_nonalphanumeric(astring): nonalphanum = True for character in astring: if character.isalpha() or character.isdigi...
mit
brucetsao/arduino-ameba
arduino-core/src/processing/app/i18n/python/requests/cookies.py
209
14024
# -*- coding: utf-8 -*- """ Compatibility code to be able to use `cookielib.CookieJar` with requests. requests.utils imports from here, so be careful with imports. """ import collections from .compat import cookielib, urlparse, Morsel try: import threading # grr, pyflakes: this fixes "redefinition of unused...
lgpl-2.1
Jaiz909/youtube-dl
youtube_dl/extractor/npo.py
9
12703
from __future__ import unicode_literals from .common import InfoExtractor from ..utils import ( fix_xml_ampersands, parse_duration, qualities, strip_jsonp, unified_strdate, url_basename, ) class NPOBaseIE(InfoExtractor): def _get_token(self, video_id): token_page = self._download_...
unlicense
YISION/yision.github.io
randomforest-决策树与随机森林/f.py
1
2724
#encoding=utf8 from sklearn.ensemble import RandomForestClassifier import pandas as pd import numpy as np import matplotlib.pyplot as plt #导入数据集与设定因变量及响应变量# data=pd.read_csv('data.csv') #data=pd.read_csv('data_p.csv') df=pd.DataFrame(data) df=df.dropna()#去除缺失值# y=df.BAD x=pd.concat([df.LOAN,df.MORTDUE,df.VALUE,df.YOJ...
mit
Markus-Goetz/CDS-Invenio-Authorlist
modules/websearch/lib/websearch_external_collections_templates.py
6
7128
# -*- coding: utf-8 -*- ## This file is part of Invenio. ## Copyright (C) 2006, 2007, 2008, 2010, 2011 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,...
gpl-2.0
ayumilong/rethinkdb
test/rql_test/connections/http_support/flask/testsuite/helpers.py
405
21973
# -*- coding: utf-8 -*- """ flask.testsuite.helpers ~~~~~~~~~~~~~~~~~~~~~~~ Various helpers. :copyright: (c) 2011 by Armin Ronacher. :license: BSD, see LICENSE for more details. """ import os import flask import unittest from logging import StreamHandler from flask.testsuite import FlaskTestCase,...
agpl-3.0
llhe/tensorflow
tensorflow/contrib/keras/python/keras/datasets/cifar.py
86
1542
# 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
Wopple/fimbulvetr
src/client/fx.py
1
3637
import os import sys import pygame from common.constants import * from client.constants import * from common import boundint from common.util.rect import Rect class FX(object): def __init__(self, inPos, inFacing, inType): self.preciseLoc = inPos self.facingRight = inFacing self.frames = ...
bsd-3-clause
troya2/pjsip
pjsip-apps/src/pygui/application.py
24
15342
# $Id: application.py 4798 2014-03-19 21:20:17Z bennylp $ # # pjsua Python GUI Demo # # Copyright (C)2013 Teluu Inc. (http://www.teluu.com) # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; eith...
gpl-2.0
rockyzhang/zhangyanhit-python-for-android-mips
python-modules/twisted/twisted/words/xish/xmlstream.py
54
8534
# -*- test-case-name: twisted.words.test.test_xmlstream -*- # # Copyright (c) 2001-2008 Twisted Matrix Laboratories. # See LICENSE for details. """ XML Stream processing. An XML Stream is defined as a connection over which two XML documents are exchanged during the lifetime of the connection, one for each direction. ...
apache-2.0
YuriGural/erpnext
erpnext/schools/doctype/student_applicant/student_applicant.py
22
1107
# -*- coding: utf-8 -*-777777yyy # Copyright (c) 2015, Frappe Technologies and contributors # For license information, please see license.txt from __future__ import unicode_literals import frappe from frappe import _ from frappe.model.document import Document class StudentApplicant(Document): def autoname(self): f...
gpl-3.0
mbareta/edx-platform-ft
cms/djangoapps/contentstore/management/commands/migrate_to_split.py
185
2174
""" Django management command to migrate a course from the old Mongo modulestore to the new split-Mongo modulestore. """ from django.core.management.base import BaseCommand, CommandError from django.contrib.auth.models import User from xmodule.modulestore.django import modulestore from xmodule.modulestore.split_migrato...
agpl-3.0
sowe9385/qiime
tests/test_plot_semivariogram.py
15
12517
#!/usr/bin/env python __author__ = "Antonio Gonzalez Pena" __copyright__ = "Copyright 2011, The QIIME Project" __credits__ = ["Antonio Gonzalez Pena"] __license__ = "GPL" __version__ = "1.9.1-dev" __maintainer__ = "Antonio Gonzalez Pena" __email__ = "antgonza@gmail.com" from qiime.plot_semivariogram import hist_bins...
gpl-2.0
deniszh/graphite-web
webapp/graphite/node.py
4
1061
class Node(object): __slots__ = ('name', 'path', 'local', 'is_leaf') def __init__(self, path): self.path = path self.name = path.split('.')[-1] self.local = True self.is_leaf = False def __repr__(self): return '<%s[%x]: %s>' % (self.__class__.__name__, id(self), s...
apache-2.0
joshuaspence/ThesisCode
MATLAB/Lib/matlab_bgl-4.0.1/libmbgl/boost1.36/libs/python/pyste/src/Pyste/pyste.py
54
14022
# Copyright Bruno da Silva de Oliveira 2003. Use, modification and # distribution is subject to the Boost Software License, Version 1.0. # (See accompanying file LICENSE_1_0.txt or copy at # http://www.boost.org/LICENSE_1_0.txt) """ Pyste version %s Usage: pyste [options] interface-files where options are: ...
gpl-3.0