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 |
|---|---|---|---|---|---|
coxley/ansible | test/units/parsing/test_data_loader.py | 64 | 3283 | # (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 |
Pablo126/SSBW | Entrega1/lib/python3.5/site-packages/django/views/decorators/clickjacking.py | 335 | 1744 | from functools import wraps
from django.utils.decorators import available_attrs
def xframe_options_deny(view_func):
"""
Modifies a view function so its response has the X-Frame-Options HTTP
header set to 'DENY' as long as the response doesn't already have that
header set.
e.g.
@xframe_optio... | gpl-3.0 |
pbrazdil/phantomjs | src/qt/qtwebkit/Source/ThirdParty/gtest/test/gtest_xml_output_unittest.py | 306 | 9711 | #!/usr/bin/env python
#
# Copyright 2006, 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... | bsd-3-clause |
open-synergy/hr | hr_job_hierarchy/__openerp__.py | 25 | 1757 | # -*- coding:utf-8 -*-
#
#
# Copyright (C) 2013 Michael Telahun Makonnen <mmakonnen@gmail.com>.
# All Rights Reserved.
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published
# by the Free Software Foundation, eit... | agpl-3.0 |
simone-campagna/daikon | zirkon/toolbox/singleton.py | 3 | 1352 | # -*- coding: utf-8 -*-
#
# Copyright 2015 Simone Campagna
#
# 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 |
nevercast/home-assistant | tests/components/test_demo.py | 16 | 1605 | """
tests.test_component_demo
~~~~~~~~~~~~~~~~~~~~~~~~~~~
Tests demo component.
"""
import json
import unittest
from unittest.mock import patch
import homeassistant.core as ha
import homeassistant.components.demo as demo
from homeassistant.remote import JSONEncoder
from tests.common import mock_http_component
@pat... | mit |
trishnaguha/ansible | lib/ansible/modules/net_tools/basics/uri.py | 3 | 22050 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2013, Romeo Theriault <romeot () hawaii.edu>
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
from __future__ import absolute_import, division, print_function
__metaclass__ = type
ANSIBLE_METADATA = {'metadata_ver... | gpl-3.0 |
kobolabs/qt-everywhere-4.8.0 | src/3rdparty/webkit/Source/ThirdParty/gtest/test/gtest_filter_unittest.py | 2826 | 21261 | #!/usr/bin/env python
#
# Copyright 2005 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... | lgpl-2.1 |
suncycheng/intellij-community | python/lib/Lib/site-packages/django/conf/locale/cs/formats.py | 232 | 1288 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. E Y'
TIME_FORMAT = 'G:i:s'
DATETIME_FORMAT = 'j. E Y G:i:s'
YEAR_MONTH... | apache-2.0 |
Cougar/python-mbus | tests/test_MBus_init.py | 3 | 2058 | import sys
sys.path.append('../python-mbus')
import pytest
import os
from mbus import MBus
# test if servial evice is connected
def nohardware():
try:
fd = os.open(config.getini(serialdevice), os.O_RDONLY)
except OSError:
return True
os.close(fd)
return False
def test_empty_init():
... | bsd-3-clause |
CiscoSystems/nova | nova/tests/virt/libvirt/test_libvirt_config.py | 10 | 55786 | # Copyright (C) 2012 Red Hat, 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 ... | apache-2.0 |
tempbottle/pycapnp | benchmark/carsales_proto.py | 2 | 2940 | #!/usr/bin/env python
import carsales_pb2
from common import rand_int, rand_double, rand_bool, from_bytes_helper
from random import choice
MAKES = ["Toyota", "GM", "Ford", "Honda", "Tesla"]
MODELS = ["Camry", "Prius", "Volt", "Accord", "Leaf", "Model S"]
COLORS = ["black", "white", "red", "green", "blue", "cyan", "ma... | bsd-2-clause |
redhat-openstack/django_openstack_auth | doc/source/conf.py | 2 | 7750 | # -*- coding: utf-8 -*-
#
# Django OpenStack Auth documentation build configuration file, created by
# sphinx-quickstart on Sun Jul 8 15:13:36 2012.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# Note that not all possible configuration values are present in this
# autogenerated... | apache-2.0 |
zbqf109/goodo | openerp/service/report.py | 1 | 5140 | # -*- coding: utf-8 -*-
import base64
import logging
import sys
import threading
import openerp
import openerp.report
from openerp import tools
from openerp.exceptions import UserError
import security
_logger = logging.getLogger(__name__)
# TODO: set a maximum report number per user to avoid DOS attacks
#
# Report... | gpl-3.0 |
GauravSahu/odoo | openerp/report/print_xml.py | 338 | 11063 | # -*- 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 |
xiami9916057/volatility | volatility/plugins/mac/dmesg.py | 58 | 1962 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
#
# This file is part of Volatility.
#
# Volatility 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 o... | gpl-2.0 |
kaoscoach/crits | crits/emails/forms.py | 7 | 11965 | from django.conf import settings
from django import forms
from django.forms.widgets import RadioSelect
from crits.campaigns.campaign import Campaign
from crits.core import form_consts
from crits.core.forms import add_bucketlist_to_form, add_ticket_to_form
from crits.core.widgets import CalWidget
from crits.core.user_t... | mit |
alfredodeza/boto | boto/glacier/__init__.py | 145 | 1685 | # Copyright (c) 2011 Mitch Garnaat http://garnaat.org/
# Copyright (c) 2011 Amazon.com, Inc. or its affiliates. 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 ... | mit |
yk5/incubator-airflow | airflow/migrations/versions/0e2a74e0fc9f_add_time_zone_awareness.py | 12 | 13461 | # flake8: noqa
#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License... | apache-2.0 |
energyPATHWAYS/energyPATHWAYS | model_building_tools/create_map_keys_from_drivers/map_key_from_driver.py | 1 | 2834 | # -*- coding: utf-8 -*-
"""
Created on Thu Jul 07 19:20:05 2016
@author: ryandrewjones
"""
import sys
import signal
import click
import os
import cPickle as pickle
import energyPATHWAYS.config as cfg
import energyPATHWAYS.util as util
from energyPATHWAYS.pathways_model import PathwaysModel
import energyPATHWAYS.shape... | mit |
psachin/swift | test/unit/container/test_updater.py | 3 | 11945 | # Copyright (c) 2010-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 agree... | apache-2.0 |
dirkjot/kivy | kivy/core/window/window_sdl2.py | 6 | 23131 | # found a way to include it more easily.
'''
SDL2 Window
===========
Windowing provider directly based on our own wrapped version of SDL.
TODO:
- fix keys
- support scrolling
- clean code
- manage correctly all sdl events
'''
__all__ = ('WindowSDL2', )
from os.path import join
from kivy import kivy... | mit |
nitely/ochDownloader | plugins/filefactory_com/anonym_download.py | 1 | 1919 | #python libs
import logging
logger = logging.getLogger(__name__)
#Libs
from addons.captcha.recaptcha import PluginRecaptcha
#CONNECTION_RETRY = 3
BASE_URL = "http://www.filefactory.com"
WAITING = 60
class PluginDownload(PluginRecaptcha):
def parse(self):
link = self.link
page = self.get_page(lin... | lgpl-3.0 |
yaniv14/OpenCommunity | src/acl/default_roles.py | 1 | 3262 | from django.utils.translation import ugettext_lazy as _
class DefaultRoles(object):
VIEWER = 'viewer'
OBSERVER = 'observer'
PARTICIPANT = 'participant'
PROPOSER = 'proposer'
CONTRIBUTOR = 'contributor'
EDITOR = 'editor'
OPERATOR = 'operator'
DECIDER = 'decider'
MANAGER = 'manager'
... | bsd-3-clause |
sadmansk/servo | tests/wpt/web-platform-tests/tools/third_party/pytest/testing/test_pluginmanager.py | 30 | 13081 | # encoding: UTF-8
from __future__ import absolute_import, division, print_function
import pytest
import os
import re
import sys
import types
from _pytest.config import get_config, PytestPluginManager
from _pytest.main import EXIT_NOTESTSCOLLECTED, Session
@pytest.fixture
def pytestpm():
return PytestPluginManage... | mpl-2.0 |
bigdatauniversity/edx-platform | cms/djangoapps/contentstore/course_group_config.py | 70 | 13178 | """
Class for manipulating groups configuration on a course object.
"""
import json
import logging
from util.db import generate_int_id, MYSQL_MAX_INT
from django.utils.translation import ugettext as _
from contentstore.utils import reverse_usage_url
from xmodule.partitions.partitions import UserPartition
from xmodule... | agpl-3.0 |
yhpeng-git/mxnet | example/speech-demo/io_util.py | 15 | 25809 | import mxnet as mx
import numpy as np
import sys
from io_func.feat_io import DataReadStream
# The interface of a data iter that works for bucketing
#
# DataIter
# - default_bucket_key: the bucket key for the default symbol.
#
# DataBatch
# - provide_data: same as DataIter, but specific to this batch
# - provide_... | apache-2.0 |
frankyrumple/ope | libs/paramiko/resource.py | 53 | 2547 | # Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko 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 2.1 of the License, or (a... | mit |
sebrandon1/nova | nova/tests/unit/objects/test_build_request.py | 3 | 6885 | # 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 |
SPriyaJain/studybuddy | env/lib/python2.7/site-packages/markupsafe/_native.py | 1243 | 1187 | # -*- coding: utf-8 -*-
"""
markupsafe._native
~~~~~~~~~~~~~~~~~~
Native Python implementation the C module is not compiled.
:copyright: (c) 2010 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from markupsafe import Markup
from markupsafe._compat import text_type
def escape(... | mit |
kidaa/bazel | third_party/py/gflags/tests/flags_modules_for_testing/module_foo.py | 139 | 5150 | #!/usr/bin/env python
#
# Copyright (c) 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 ... | apache-2.0 |
ChengDaHaI/shadowsocks | shadowsocks/tcprelay.py | 922 | 28870 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# 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 b... | apache-2.0 |
sbktechnology/sap_frappe | frappe/email/receive.py | 16 | 9652 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import time
import _socket, poplib
import frappe
from frappe import _
from frappe.utils import extract_email_id, convert_utc_to_user_timezone, now, cint, cstr, strip
from frappe.u... | mit |
Theb-1/home-assistant | homeassistant/components/script.py | 2 | 7552 | """
homeassistant.components.script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Scripts are a sequence of actions that can be triggered manually
by the user or automatically based upon automation events, etc.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/script/
... | mit |
chokribr/PIST | modules/bibrank/lib/bibrank_selfcites_regression_tests.py | 11 | 12770 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2011, 2012 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 opt... | gpl-2.0 |
highco-groupe/odoo | openerp/report/pyPdf/filters.py | 123 | 9847 | # vim: sw=4:expandtab:foldmethod=marker
#
# Copyright (c) 2006, Mathieu Fenniak
# 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 abov... | agpl-3.0 |
andrewmoses/ssquiz | flask/lib/python2.7/site-packages/whoosh/qparser/default.py | 53 | 17071 | # Copyright 2011 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 conditions and the... | bsd-3-clause |
elventear/ansible | lib/ansible/plugins/lookup/template.py | 60 | 2935 | # (c) 2012, 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) any lat... | gpl-3.0 |
wgapl/deepdive | examples/spouse_example/postgres/plpy_extractor/udf/ext_has_spouse_features.py | 15 | 2833 | #! /usr/bin/env python
import ddext
# Format of plpy_extractor:
# Anything Write functions "init", "run" will not be accepted.
# In "init", import libraries, specify input variables and return types
# In "run", write your extractor. Return a list containing your results, each item in the list should be a list/tuple o... | apache-2.0 |
jart/tensorflow | tensorflow/python/kernel_tests/boosted_trees/resource_ops_test.py | 15 | 7259 | # Copyright 2018 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 |
zmsch27/Python | PythonBase/Python_Module.py | 1 | 2415 | #以下来自廖雪峰的Python学习之Python模块
#在计算机程序的开发过程中,随着程序代码越写越多,在一个文件里代码就会越来越长,越来越不容易维护。
#为了编写可维护的代码,我们把很多函数分组,分别放到不同的文件里,这样,每个文件包含的代码就相对较少,很多编程语言都采用这种组织代码的方式。
#在Python中,一个.py文件就称之为一个模块(Module)。
#为了避免模块名冲突,Python又引入了按目录来组织模块的方法,称为包(Package)
#请注意,每一个包目录下面都会有一个__init__.py的文件,这个文件是必须存在的,否则,Python就把这个目录当成普通目录,而不是一个包。
#__init__.py可以是空... | apache-2.0 |
nguyenfilip/subscription-manager | src/subscription_manager/gui/networkConfig.py | 2 | 13296 |
#
# Copyright (c) 2010 Red Hat, Inc.
#
# This software is licensed to you under the GNU General Public License,
# version 2 (GPLv2). There is NO WARRANTY for this software, express or
# implied, including the implied warranties of MERCHANTABILITY or FITNESS
# FOR A PARTICULAR PURPOSE. You should have received a copy o... | gpl-2.0 |
boyuegame/kbengine | kbe/src/lib/python/Lib/test/test_pdb.py | 60 | 33443 | # A test suite for pdb; not very comprehensive at the moment.
import doctest
import pdb
import sys
import types
import unittest
import subprocess
import textwrap
from test import support
# This little helper class is essential for testing pdb under doctest.
from test.test_doctest import _FakeInput
class PdbTestInpu... | lgpl-3.0 |
DARKPOP/external_chromium_org | chrome/installer/util/prebuild/create_string_rc.py | 53 | 15650 | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Generates .h and .rc files for installer strings. Run "python
create_string_rc.py" for usage details.
This script generates an ... | bsd-3-clause |
jensck/fluidity | fluidity/managers.py | 1 | 38146 | #-*- coding:utf-8 -*-
#
# Copyright (C) 2012 - Jens Knutson <jens.knutson at gmail dot com>
# This software is licensed under the GNU General Public License
# version 3 or later (see the file COPYING).
#pylint: disable-msg=W0201
"""Collection of "manager" classes, which handle various aspects of Fluidity."""
from __fut... | gpl-3.0 |
sidrakesh93/grpc | src/python/src/grpc/framework/base/_expiration.py | 39 | 6338 | # 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 list of conditions and the f... | bsd-3-clause |
pongem/python-bot-project | appengine/standard/botapp/lib/django/template/loaders/locmem.py | 464 | 1194 | """
Wrapper for loading templates from a plain Python dict.
"""
import warnings
from django.template import Origin, TemplateDoesNotExist
from django.utils.deprecation import RemovedInDjango20Warning
from .base import Loader as BaseLoader
class Loader(BaseLoader):
def __init__(self, engine, templates_dict):
... | apache-2.0 |
sebrandon1/nova | nova/db/sqlalchemy/migrate_repo/versions/291_enforce_flavors_migrated.py | 79 | 1586 | # 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 |
macosforge/ccs-calendarserver | calendarserver/tools/resources.py | 1 | 4349 | #!/usr/bin/env python
##
# Copyright (c) 2006-2017 Apple 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 r... | apache-2.0 |
sauloal/pycluster | venvlin64/bin/activate_this.py | 669 | 1129 | """By using execfile(this_file, dict(__file__=this_file)) you will
activate this virtualenv environment.
This can be used when you must use an existing Python interpreter, not
the virtualenv bin/python
"""
try:
__file__
except NameError:
raise AssertionError(
"You must run this like execfile('path/to/... | mit |
repotvsupertuga/tvsupertuga.repository | plugin.module.live.sports/resources/lib/magic_aes/mycrypt.py | 3 | 17383 | #!/usr/bin/env python2
#!python
'''
Implement openssl compatible AES-256 CBC mode encryption/decryption.
This module provides encrypt() and decrypt() functions that are compatible
with the openssl algorithms.
This is basically a python encoding of my C++ work on the Cipher class
using the Crypto.Cipher.AES class.
UR... | gpl-2.0 |
rdio/translate-toolkit | storage/versioncontrol/__init__.py | 3 | 14837 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright 2004-2008 Zuza Software Foundation
#
# This file is part of translate.
#
# translate 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... | gpl-2.0 |
angelapper/edx-platform | lms/djangoapps/shoppingcart/processors/helpers.py | 24 | 1058 | """
Helper methods for credit card processing modules.
These methods should be shared among all processor implementations,
but should NOT be imported by modules outside this package.
"""
from django.conf import settings
from openedx.core.djangoapps.site_configuration import helpers as configuration_helpers
def get_p... | agpl-3.0 |
lz1988/company-site | django/contrib/localflavor/si/si_postalcodes.py | 110 | 13147 | # *-* coding: utf-8 *-*
from __future__ import unicode_literals
SI_POSTALCODES = [
(1000, 'Ljubljana'),
(1215, 'Medvode'),
(1216, 'Smlednik'),
(1217, 'Vodice'),
(1218, 'Komenda'),
(1219, 'Laze v Tuhinju'),
(1221, 'Motnik'),
(1222, 'Trojane'),
(1223, 'Blagovica'),
(1225, 'Lukovic... | bsd-3-clause |
raymondanthony/youtube-dl | youtube_dl/extractor/turbo.py | 37 | 2432 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
qualities,
xpath_text,
)
class TurboIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?turbo\.fr/videos-voiture/(?P<id>[0-9]+)-'
_API_URL =... | unlicense |
2014c2g18/c2g18 | wsgi/static/Brython2.1.0-20140419-113919/Lib/xml/sax/xmlreader.py | 824 | 12612 | """An XML Reader is the SAX 2 name for an XML parser. XML Parsers
should be based on this code. """
from . import handler
from ._exceptions import SAXNotSupportedException, SAXNotRecognizedException
# ===== XMLREADER =====
class XMLReader:
"""Interface for reading an XML document using callbacks.
XMLReade... | gpl-2.0 |
hrjn/scikit-learn | sklearn/mixture/dpgmm.py | 25 | 35852 | """Bayesian Gaussian Mixture Models and
Dirichlet Process Gaussian Mixture Models"""
from __future__ import print_function
# Author: Alexandre Passos (alexandre.tp@gmail.com)
# Bertrand Thirion <bertrand.thirion@inria.fr>
#
# Based on mixture.py by:
# Ron Weiss <ronweiss@gmail.com>
# Fabian Ped... | bsd-3-clause |
KatolaZ/mammult | structure/activity/node_degree_vectors.py | 1 | 2498 | # This file is part of MAMMULT: Metrics And Models for Multilayer Networks
#
# 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 later ver... | gpl-3.0 |
harisibrahimkv/django | django/contrib/admin/bin/compress.py | 34 | 2261 | #!/usr/bin/env python
import argparse
import os
import subprocess
import sys
try:
import closure
except ImportError:
closure_compiler = None
else:
closure_compiler = os.path.join(os.path.dirname(closure.__file__), 'closure.jar')
js_path = os.path.join(os.path.dirname(os.path.dirname(__file__)), 'static', ... | bsd-3-clause |
mlperf/training_results_v0.7 | Fujitsu/benchmarks/resnet/implementations/implementation_open/mxnet/3rdparty/tvm/python/tvm/contrib/debugger/debug_runtime.py | 2 | 8948 | # Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not u... | apache-2.0 |
thurt/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_operator.py | 56 | 21473 | import operator
import unittest
from test import test_support
class Seq1:
def __init__(self, lst):
self.lst = lst
def __len__(self):
return len(self.lst)
def __getitem__(self, i):
return self.lst[i]
def __add__(self, other):
return self.lst + other.lst
def __mul__(s... | apache-2.0 |
arvinquilao/android_kernel_cyanogen_msm8916 | scripts/rt-tester/rt-tester.py | 11005 | 5307 | #!/usr/bin/python
#
# rt-mutex tester
#
# (C) 2006 Thomas Gleixner <tglx@linutronix.de>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 2 as
# published by the Free Software Foundation.
#
import os
import sys
import getopt
import sh... | gpl-2.0 |
hassoon3/odoo | addons/sale/tests/test_product_id_change.py | 145 | 2785 | from openerp.tests.common import TransactionCase
class TestProductIdChange(TransactionCase):
"""Test that when an included tax is mapped by a fiscal position, the included tax must be
subtracted to the price of the product.
"""
def setUp(self):
super(TestProductIdChange, self).setUp()
... | agpl-3.0 |
nataddrho/DigiCue-USB | Python3/src/venv/Lib/site-packages/pip/_vendor/distlib/resources.py | 87 | 10766 | # -*- coding: utf-8 -*-
#
# Copyright (C) 2013-2017 Vinay Sajip.
# Licensed to the Python Software Foundation under a contributor agreement.
# See LICENSE.txt and CONTRIBUTORS.txt.
#
from __future__ import unicode_literals
import bisect
import io
import logging
import os
import pkgutil
import shutil
import sys
import ... | mit |
fahhem/mbed-os | tools/test/config_test/test10/test_data.py | 38 | 2202 | # This builds on top of test8 by adding target-conditional overrides in mbed_app_config.json.
expected_results = {
"base": {
"desc": "override values based on labels with libs, target params and target overrides (no labels)",
"app.app1": "v_app1",
"app.app2": "v_app2",
"lib1.p1": "v_... | apache-2.0 |
slightstone/SickRage | lib/lockfile/sqlitelockfile.py | 487 | 5540 | from __future__ import absolute_import, division
import time
import os
try:
unicode
except NameError:
unicode = str
from . import LockBase, NotLocked, NotMyLock, LockTimeout, AlreadyLocked
class SQLiteLockFile(LockBase):
"Demonstrate SQL-based locking."
testdb = None
def __init__(self, path, t... | gpl-3.0 |
bob-the-hamster/commandergenius | project/jni/python/src/Lib/distutils/fancy_getopt.py | 53 | 18427 | """distutils.fancy_getopt
Wrapper around the standard getopt module that provides the following
additional features:
* short and long options are tied together
* options have help strings, so fancy_getopt could potentially
create a complete usage summary
* options set attributes of a passed-in object
"""
# ... | lgpl-2.1 |
calfonso/ansible | test/units/modules/network/nxos/test_nxos_system.py | 57 | 6294 | #
# (c) 2016 Red Hat Inc.
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is d... | gpl-3.0 |
kenglishhi/gae-django-sandbox | django/core/management/commands/syncdb.py | 18 | 7625 | from optparse import make_option
import sys
from django.conf import settings
from django.core.management.base import NoArgsCommand
from django.core.management.color import no_style
from django.core.management.sql import custom_sql_for_model, emit_post_sync_signal
from django.db import connections, router, transaction,... | apache-2.0 |
gartung/dxr | dxr/cli/delete.py | 2 | 1841 | from click import ClickException, command, echo, option
from pyelasticsearch import ElasticSearch, ElasticHttpNotFoundError
from dxr.cli.utils import tree_objects, config_option, tree_names_argument
from dxr.config import FORMAT
from dxr.es import TREE
@command()
@config_option
@option('--force', '-f',
is_fl... | mit |
petewarden/tensorflow | tensorflow/python/keras/engine/data_adapter.py | 1 | 57975 | # Copyright 2019 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 |
ibmdb/db2pythonbuildpack | vendor/distribute-0.6.36/setuptools/command/bdist_egg.py | 67 | 18454 | """setuptools.command.bdist_egg
Build .egg distributions"""
# This module should be kept compatible with Python 2.3
import sys, os, marshal
from setuptools import Command
from distutils.dir_util import remove_tree, mkpath
try:
from distutils.sysconfig import get_python_version, get_python_lib
except ImportError:
... | mit |
aularon/meld | setup.py | 1 | 2104 | #!/usr/bin/env python
from distutils.core import setup
import glob
import platform
import sys
import meld.build_helpers
import meld.conf
if (platform.system() == 'Linux' and
platform.linux_distribution()[0] == 'Ubuntu'):
sys.argv.append('--install-layout=deb')
setup(
name=meld.conf.__package__,
... | gpl-2.0 |
mancoast/CPythonPyc_test | fail/312_pickletester.py | 1 | 42506 | import io
import unittest
import pickle
import pickletools
import copyreg
from http.cookies import SimpleCookie
from test.support import TestFailed, TESTFN, run_with_locale
from pickle import bytes_types
# Tests that try a number of pickle protocols should have a
# for proto in protocols:
# kind of outer loop.
p... | gpl-3.0 |
tinkerinestudio/Tinkerine-Suite | TinkerineSuite/python/Lib/numpy/core/tests/test_numerictypes.py | 23 | 14529 | import sys
from numpy.testing import *
from numpy.compat import asbytes, asunicode
import numpy as np
# This is the structure of the table used for plain objects:
#
# +-+-+-+
# |x|y|z|
# +-+-+-+
# Structure of a plain array description:
Pdescr = [
('x', 'i4', (2,)),
('y', 'f8', (2, 2)),
('z', 'u1')]
# A ... | agpl-3.0 |
yhalk/vw_challenge_ECR | src/ev3/Sensors/sensors.py | 1 | 1535 | import paho.mqtt.client as mqtt
import config
import ev3dev.ev3 as ev3
import IR.IR_control as remoteControl
import ev3control.master as master
from ev3control.messages import *
import time
from MotionCtrl.actuators_simple import actuators
from Sensors.odometry_ev3 import Odometry
#Set IR sensor to remote control mode... | apache-2.0 |
tik0/inkscapeGrid | share/extensions/ink2canvas.py | 3 | 2946 | #!/usr/bin/env python
'''
Copyright (C) 2011 Karlisson Bezerra <contact@hacktoon.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; either version 2 of the License, or
(at your option) any later ve... | gpl-2.0 |
radicalbit/ambari | ambari-common/src/main/python/ambari_commons/exceptions.py | 5 | 1295 | #!/usr/bin/env 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
"License")... | apache-2.0 |
cryptobuks/forknote | external/gtest/test/gtest_output_test.py | 1733 | 12005 | #!/usr/bin/env python
#
# Copyright 2008, 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... | lgpl-3.0 |
JMoravec/unkRadnet | fitToCurve/pyeq2/Examples/Complex/ListAllStandardEquations_2D.py | 1 | 1067 | # Version info: $Id: ListAllStandardEquations_2D.py 1 2012-01-07 22:20:43Z zunzun.com@gmail.com $
import os, sys, inspect
if os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '../..') not in sys.path:
sys.path.append(os.path.join(sys.path[0][:sys.path[0].rfind(os.sep)], '../..'))
import pyeq2, pyeq2.Extend... | bsd-3-clause |
backmari/moose | python/peacock/Input/ParamsByType.py | 1 | 5164 | from PyQt5.QtWidgets import QWidget, QComboBox, QStackedWidget
from PyQt5.QtCore import pyqtSignal
from peacock.base.MooseWidget import MooseWidget
from peacock.utils import WidgetUtils
from ParamsByGroup import ParamsByGroup
class ParamsByType(QWidget, MooseWidget):
"""
Has a QComboBox for the different allow... | lgpl-2.1 |
ARMmbed/yotta_osx_installer | workspace/lib/python2.7/site-packages/github/CommitStatus.py | 49 | 4721 | # -*- coding: utf-8 -*-
# ########################## Copyrights and license ############################
# #
# Copyright 2012 Vincent Jacques <vincent@vincent-jacques.net> #
# Copyright 2012 Zearin <zearin@gonk.net> ... | apache-2.0 |
openwisp/nodeshot | nodeshot/core/base/fields.py | 3 | 4659 | # snippet "MultiSelectField with comma separated values (Field + FormField)"
# http://djangosnippets.org/snippets/2753/
# New version of this snippet http://djangosnippets.org/snippets/1200/
# tested with Django 1.4
from django import forms
from django.db import models
from django.utils.text import capfirst
from djan... | gpl-3.0 |
eharney/cinder | cinder/volume/targets/tgt.py | 1 | 13042 | # 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 |
keen99/SickRage | lib/hachoir_parser/misc/pdf.py | 95 | 16790 | """
Adobe Portable Document Format (PDF) parser.
Author: Christophe Gisquet <christophe.gisquet@free.fr>
"""
from hachoir_parser import Parser
from hachoir_core.field import (
Field, FieldSet,
ParserError,
GenericVector,
UInt8, UInt16, UInt32,
String,
RawBytes)
from hachoir_core.endian import ... | gpl-3.0 |
Serag8/Bachelor | google_appengine/lib/django-1.5/django/contrib/gis/db/backends/postgis/models.py | 222 | 2057 | """
The GeometryColumns and SpatialRefSys models for the PostGIS backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class GeometryColumns(models.Model):
"""
The ... | mit |
asiersarasua/QGIS | tests/src/python/test_qgssimplelinesymbollayer.py | 8 | 5618 | # -*- coding: utf-8 -*-
"""
***************************************************************************
test_qgssimplelinesymbollayer.py
---------------------
Date : November 2018
Copyright : (C) 2018 by Nyall Dawson
Email : nyall dot dawson at gmail dot co... | gpl-2.0 |
ruansteve/neutron-dynamic-routing | neutron_dynamic_routing/tests/api/test_bgp_speaker_extensions.py | 3 | 14040 | # Copyright 2016 Hewlett Packard Enterprise Development Company LP
#
# 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 |
gram526/VTK | Rendering/Core/Testing/Python/propAssembly.py | 20 | 2332 | #!/usr/bin/env python
import vtk
from vtk.test import Testing
from vtk.util.misc import vtkGetDataRoot
VTK_DATA_ROOT = vtkGetDataRoot()
# demonstrates the use of vtkPropAssembly
# create four parts: a top level assembly and three primitives
#
sphere = vtk.vtkSphereSource()
sphereMapper = vtk.vtkPolyDataMapper()
sphere... | bsd-3-clause |
bakhtout/odoo-educ | addons/marketing_campaign/__init__.py | 380 | 1087 | # -*- 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 |
ltvolks/django-avatar | avatar/settings.py | 37 | 1294 | from django.conf import settings
try:
from PIL import Image
dir(Image) # Placate PyFlakes
except ImportError:
import Image
AVATAR_DEFAULT_SIZE = getattr(settings, 'AVATAR_DEFAULT_SIZE', 80)
AUTO_GENERATE_AVATAR_SIZES = getattr(settings, 'AUTO_GENERATE_AVATAR_SIZES', (AVATAR_DEFAULT_SIZE,))
AVATAR_RESIZE_M... | bsd-3-clause |
bsipocz/scikit-image | doc/examples/plot_label.py | 23 | 1557 | """
===================
Label image regions
===================
This example shows how to segment an image with image labelling. The following
steps are applied:
1. Thresholding with automatic Otsu method
2. Close small holes with binary closing
3. Remove artifacts touching image border
4. Measure image regions to fi... | bsd-3-clause |
fafaman/django | tests/template_tests/syntax_tests/test_with.py | 391 | 2245 | from django.template import TemplateSyntaxError
from django.test import SimpleTestCase
from ..utils import setup
class WithTagTests(SimpleTestCase):
@setup({'with01': '{% with key=dict.key %}{{ key }}{% endwith %}'})
def test_with01(self):
output = self.engine.render_to_string('with01', {'dict': {'k... | bsd-3-clause |
xinjiguaike/edx-platform | lms/djangoapps/courseware/tests/test_module_render.py | 10 | 79762 | # -*- coding: utf-8 -*-
"""
Test for lms courseware app, module render unit
"""
import ddt
import itertools
import json
from nose.plugins.attrib import attr
from functools import partial
from bson import ObjectId
from django.http import Http404, HttpResponse
from django.core.urlresolvers import reverse
from django.con... | agpl-3.0 |
harterj/moose | python/TestHarness/JobDAG.py | 9 | 11349 | #* This file is part of the MOOSE framework
#* https://www.mooseframework.org
#*
#* All rights reserved, see COPYRIGHT for full restrictions
#* https://github.com/idaholab/moose/blob/master/COPYRIGHT
#*
#* Licensed under LGPL 2.1, please see LICENSE for details
#* https://www.gnu.org/licenses/lgpl-2.1.html
from .sched... | lgpl-2.1 |
noogel/xyzStudyPython | python/qqwry/qq_ip_query.py | 1 | 9212 | #!/usr/bin/env python2
# -*- coding: UTF-8 -*-
import os
import sys, _socket, mmap
from struct import unpack, pack
DataFileName = "qq_ip_database.Dat"
def _ip2ulong(ip):
'''ip(0.0.0.0) -> unsigned long'''
return unpack('>L', _socket.inet_aton(ip))[0]
def _ulong2ip(ip):
'''unsigned long -... | apache-2.0 |
felixb/v2gcalendar | v2gcalendar/calendar_service.py | 1 | 3566 | __author__ = 'flx'
from apiclient.discovery import build
import httplib2
from oauth2client import tools
from oauth2client.client import OAuth2WebServerFlow
from oauth2client.file import Storage
from oauth2client.tools import run_flow
# For this example, the client id and client secret are command-line arguments.
c... | apache-2.0 |
kingvuplus/xrd-alliance | lib/python/Screens/ServiceInfo.py | 6 | 10066 | from Components.HTMLComponent import HTMLComponent
from Components.GUIComponent import GUIComponent
from Screen import Screen
from Components.ActionMap import ActionMap
from Components.Label import Label
from ServiceReference import ServiceReference
from enigma import eListboxPythonMultiContent, eListbox, gFont, iServi... | gpl-2.0 |
vfulco/ansible | contrib/inventory/vmware.py | 59 | 16907 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
'''
VMware Inventory Script
=======================
Retrieve information about virtual machines from a vCenter server or
standalone ESX host. When `group_by=false` (in the INI file), host systems
are also returned in addition to VMs.
This script will attempt to read conf... | gpl-3.0 |
wweiradio/django | tests/gis_tests/geo3d/models.py | 302 | 1294 | from django.utils.encoding import python_2_unicode_compatible
from ..models import models
@python_2_unicode_compatible
class NamedModel(models.Model):
name = models.CharField(max_length=30)
objects = models.GeoManager()
class Meta:
abstract = True
required_db_features = ['gis_enabled']
... | bsd-3-clause |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.