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 |
|---|---|---|---|---|---|
Vova23/limbo-android | jni/qemu/tests/qemu-iotests/iotests.py | 48 | 6227 | # Common utilities and Python wrappers for qemu-iotests
#
# Copyright (C) 2012 IBM Corp.
#
# 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) ... | gpl-2.0 |
louietsai/python-for-android | python3-alpha/extra_modules/pyxmpp2/ext/vcard.py | 46 | 55422 | #
# (C) Copyright 2003-2010 Jacek Konieczny <jajcus@jajcus.net>
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Lesser General Public License Version
# 2.1 as published by the Free Software Foundation.
#
# This program is distributed in the hope that it will be u... | apache-2.0 |
hulop/SfMLocalization | PyViewMatch/src/viewMatchPyCV.py | 1 | 5231 | ################################################################################
# Copyright (c) 2015 IBM Corporation
#
# 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, in... | mit |
nvoron23/arangodb | 3rdParty/V8-4.3.61/third_party/python_26/Lib/test/test_mimetools.py | 58 | 1780 | import unittest
from test import test_support
import string
import StringIO
mimetools = test_support.import_module("mimetools", deprecated=True)
msgtext1 = mimetools.Message(StringIO.StringIO(
"""Content-Type: text/plain; charset=iso-8859-1; format=flowed
Content-Transfer-Encoding: 8bit
Foo!
"""))
class MimeToolsT... | apache-2.0 |
sunios/android_kernel_xiaomi_msm8x74pro | tools/perf/scripts/python/sched-migration.py | 11215 | 11670 | #!/usr/bin/python
#
# Cpu task migration overview toy
#
# Copyright (C) 2010 Frederic Weisbecker <fweisbec@gmail.com>
#
# perf script event handlers have been generated by perf script -g python
#
# This software is distributed under the terms of the GNU General
# Public License ("GPL") version 2 as published by the Fre... | gpl-2.0 |
ArianaGashi/Techstitution | venv/lib/python2.7/site-packages/flask_cors/decorator.py | 8 | 4916 | # -*- coding: utf-8 -*-
"""
flask_cors
~~~~
Flask-CORS is a simple extension to Flask allowing you to support cross
origin resource sharing (CORS) using a simple decorator.
:copyright: (c) 2014 by Cory Dolphin.
:license: MIT, see LICENSE for more details.
"""
from functools import update_wrappe... | cc0-1.0 |
jspargo/AneMo | django/lib/python2.7/site-packages/django/middleware/cache.py | 52 | 8883 | """
Cache middleware. If enabled, each Django-powered page will be cached based on
URL. The canonical way to enable cache middleware is to set
``UpdateCacheMiddleware`` as your first piece of middleware, and
``FetchFromCacheMiddleware`` as the last::
MIDDLEWARE_CLASSES = [
'django.middleware.cache.UpdateCa... | gpl-2.0 |
MrTheodor/espressopp | examples/tabulated_potential/table_interpolation.py | 5 | 6396 | #!/usr/bin/env python2
# Copyright (C) 2016-2017(H)
# Max Planck Institute for Polymer Research
#
# This file is part of ESPResSo++.
#
# ESPResSo++ 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, eit... | gpl-3.0 |
tamsky/ansible-upstream | lib/ansible/parsing/splitter.py | 9 | 10866 | # (c) 2014 James Cammarata, <jcammarata@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
# (at your option) any late... | gpl-3.0 |
bssrikanth/virt-test | virttest/utils_conn.py | 9 | 52295 | """
connection tools to manage kinds of connection.
"""
import logging
import os
import shutil
import tempfile
import commands
from autotest.client import utils, os_dep
from virttest import propcan, remote, utils_libvirtd
from virttest import data_dir, aexpect
class ConnectionError(Exception):
"""
The base... | gpl-2.0 |
apache/beam | sdks/python/apache_beam/testing/test_stream_service.py | 5 | 3203 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
PLyczkowski/Sticky-Keymap | 2.74/scripts/addons/add_mesh_extra_objects/add_mesh_pipe_joint.py | 1 | 33743 | # ##### BEGIN GPL LICENSE BLOCK #####
#
# 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 distrib... | gpl-2.0 |
gugahoi/maraschino | lib/sqlalchemy/orm/scoping.py | 14 | 4561 | # orm/scoping.py
# Copyright (C) 2005-2011 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
from sqlalchemy import exc as sa_exc
from sqlalchemy.util import ScopedRegistry, Thread... | mit |
ping/youtube-dl | youtube_dl/extractor/ruv.py | 49 | 3359 | # coding: utf-8
from __future__ import unicode_literals
from .common import InfoExtractor
from ..utils import (
determine_ext,
unified_timestamp,
)
class RuvIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.)?ruv\.is/(?:sarpurinn/[^/]+|node)/(?P<id>[^/]+(?:/\d+)?)'
_TESTS = [{
# m3u8
... | unlicense |
stonegithubs/odoo | addons/stock/wizard/orderpoint_procurement.py | 326 | 2844 | # -*- 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 |
sameetb-cuelogic/edx-platform-test | lms/djangoapps/shoppingcart/migrations/0001_initial.py | 182 | 12544 | # -*- coding: utf-8 -*-
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Order'
db.create_table('shoppingcart_order', (
('id', self.gf('django.db.models.... | agpl-3.0 |
OpenTrading/OpenTrader | setup.py | 1 | 2533 | #!/usr/bin/env python
import codecs
import os
import sys
import glob
from setuptools import setup, find_packages
try:
# http://stackoverflow.com/questions/21698004/python-behave-integration-in-setuptools-setup-py
from setuptools_behave import behave_test
except ImportError:
behave_test = None
dirname = o... | lgpl-3.0 |
mayankcu/Django-social | venv/Lib/site-packages/django/core/files/storage.py | 78 | 10329 | import os
import errno
import urlparse
import itertools
from datetime import datetime
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured, SuspiciousOperation
from django.core.files import locks, File
from django.core.files.move import file_move_safe
from django.utils.encoding impo... | bsd-3-clause |
razvanphp/arangodb | 3rdParty/V8-3.31.74.1/tools/presubmit.py | 5 | 14424 | #!/usr/bin/env python
#
# Copyright 2012 the V8 project authors. All rights reserved.
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# noti... | apache-2.0 |
fujunwei/chromium-crosswalk | native_client_sdk/src/build_tools/sdk_tools/command/list.py | 152 | 1736 | # 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.
def List(remote_manifest, local_manifest, display_revisions):
any_bundles_need_update = False
print 'Bundles:'
print ' I: installed\n *: update ava... | bsd-3-clause |
darkpeach/AlgorithmCoding | _046_Permutations.py | 1 | 1275 | class Solution(object):
def permute(self, nums):
"""
:type nums: List[int]
:rtype: List[List[int]]
"""
# Non-recursive solution
if not nums:
return []
stack = [-1]
permutation = []
permutations = []
while len(stack):
... | epl-1.0 |
aivarsk/scrapy | scrapy/downloadermiddlewares/retry.py | 108 | 3570 | """
An extension to retry failed requests that are potentially caused by temporary
problems such as a connection timeout or HTTP 500 error.
You can change the behaviour of this middleware by modifing the scraping settings:
RETRY_TIMES - how many times to retry a failed page
RETRY_HTTP_CODES - which HTTP response codes... | bsd-3-clause |
sarvex/tensorflow | tensorflow/lite/examples/python/label_image.py | 6 | 3100 | # 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 |
yildizberkay/MongoApp | libs/PIL/ImageTk.py | 39 | 9248 | #
# The Python Imaging Library.
# $Id$
#
# a Tk display interface
#
# History:
# 96-04-08 fl Created
# 96-09-06 fl Added getimage method
# 96-11-01 fl Rewritten, removed image attribute and crop method
# 97-05-09 fl Use PyImagingPaste method instead of image type
# 97-05-12 fl Minor tweaks to match the IFUNC9... | apache-2.0 |
edmundgentle/schoolscript | SchoolScript/bin/Debug/pythonlib/Lib/encodings/zlib_codec.py | 4 | 2319 | """Python 'zlib_codec' Codec - zlib compression encoding.
This codec de/encodes from bytes to bytes and is therefore usable with
bytes.transform() and bytes.untransform().
Written by Marc-Andre Lemburg (mal@lemburg.com).
"""
import codecs
import zlib # this codec needs the optional zlib module !
### Code... | gpl-2.0 |
laurent-george/bokeh | bokeh/util/notebook.py | 22 | 2701 | """ Functions useful for loading Bokeh code and data in IPython notebooks.
"""
from __future__ import absolute_import
_notebook_loaded = None
def load_notebook(resources=None, verbose=False, hide_banner=False):
""" Prepare the IPython notebook for displaying Bokeh plots.
Args:
resources (Resource, o... | bsd-3-clause |
RabadanLab/MITKats | Modules/Biophotonics/python/iMC/regression/estimation.py | 5 | 4129 |
"""
The MultiSpectral Imaging Toolkit (MSITK)
Copyright (c) German Cancer Research Center,
Computer Assisted Interventions.
All rights reserved.
This software is distributed WITHOUT ANY WARRANTY; without
even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE.
See LICENSE for details
"""... | bsd-3-clause |
shakamunyi/os-cloud-config | os_cloud_config/neutron.py | 1 | 5961 | # Copyright (c) 2014 Hewlett-Packard Development Company, L.P.
#
# 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 |
PriceChild/ansible | lib/ansible/modules/windows/win_say.py | 6 | 4604 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Jon Hawkesworth (@jhawkesworth) <figs@unity.demon.co.uk>
#
# 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, eith... | gpl-3.0 |
2ndQuadrant/ansible | lib/ansible/modules/network/fortios/fortios_router_setting.py | 21 | 7279 | #!/usr/bin/python
from __future__ import (absolute_import, division, print_function)
# Copyright 2019 Fortinet, 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 Lic... | gpl-3.0 |
ujjwalwahi/odoo | addons/account/wizard/__init__.py | 362 | 2345 | # -*- 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 |
redhat-openstack/trove | trove/tests/util/client.py | 8 | 3744 | # Copyright (c) 2011 OpenStack Foundation
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless ... | apache-2.0 |
soerendip42/rdkit | Contrib/LEF/ClusterFps.py | 4 | 2857 | #
# Copyright (c) 2009, Novartis Institutes for BioMedical Research 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 copyri... | bsd-3-clause |
ericdill/bokeh | examples/glyphs/data_tables_server.py | 38 | 6676 | from __future__ import print_function
from bokeh.browserlib import view
from bokeh.models import ColumnDataSource, DataRange1d, Plot, LinearAxis, Grid, Circle, HoverTool, BoxSelectTool
from bokeh.models.widgets import (
Select, DataTable, TableColumn, StringFormatter,
NumberFormatter, StringEditor, IntEditor, ... | bsd-3-clause |
dexterx17/nodoSocket | clients/Python-2.7.6/Lib/test/test_hotshot.py | 122 | 4990 | import os
import pprint
import unittest
import tempfile
import _hotshot
import gc
from test import test_support
# Silence Py3k warning
hotshot = test_support.import_module('hotshot', deprecated=True)
from hotshot.log import ENTER, EXIT, LINE
from hotshot import stats
def shortfilename(fn):
# We use a really sho... | mit |
michaelmior/pylinks | pylinks/links/views.py | 1 | 2010 | from django.db.models import F
from django.http import Http404, HttpResponseRedirect
from django.shortcuts import get_object_or_404
from django.views.generic import ListView
from pylinks.links.models import Category, Link
class LinkListView(ListView):
model = Link
context_object_name = 'links'
paginate_b... | mit |
juanyaw/python | cpython/Lib/tkinter/tix.py | 89 | 77022 | # -*-mode: python; fill-column: 75; tab-width: 8 -*-
#
# $Id$
#
# Tix.py -- Tix widget wrappers.
#
# For Tix, see http://tix.sourceforge.net
#
# - Sudhir Shenoy (sshenoy@gol.com), Dec. 1995.
# based on an idea of Jean-Marc Lugrin (lugrin@ms.com)
#
# NOTE: In order to minimize changes to Tkinter.py, ... | bsd-3-clause |
zutshi/S3CAMR | src/nonlinprog/pyfmincon.py | 1 | 3601 | from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import numpy as np
import sympy as sym
import functools as ft
import atexit
from pymatopt.optimmatlab import init, deinit, fmincon
from utils import print
import nonlinprog.spec as spec
import settings
in... | bsd-2-clause |
jemekite/p2pool-deepcoin | SOAPpy/SOAPBuilder.py | 289 | 22852 | """
################################################################################
# Copyright (c) 2003, Pfizer
# Copyright (c) 2001, Cayce Ullman.
# Copyright (c) 2001, Brian Matthews.
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provid... | gpl-3.0 |
GalaxyTab4/android_kernel_samsung_matissewifi | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
clarencecastillo/dose | examples/17_no_migration_proportionate_selection.py | 2 | 6760 | '''
Example 13: Examining the effects of natural selection on a
population's genetic pool by implementing a fitness scheme that counts
a specific sequence within the chromosome along with a goal to be reached
from an evenly deployed population.
In this simulation,
- 1 population of 100 organisms
- each organ... | gpl-3.0 |
GrinningFerret/android_kernel_lge_w7 | tools/perf/scripts/python/syscall-counts-by-pid.py | 11180 | 1927 | # system call counts, by pid
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Displays system-wide system call totals, broken down by syscall.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os, sys
sys.path.append(os.env... | gpl-2.0 |
samchrisinger/osf.io | website/addons/figshare/views/hgrid.py | 11 | 1201 | # -*- coding: utf-8 -*-
from website.util import rubeus
from ..api import Figshare
def figshare_hgrid_data(node_settings, auth, parent=None, **kwargs):
node = node_settings.owner
if node_settings.figshare_type == 'project':
item = Figshare.from_settings(node_settings.user_settings).project(node_setti... | apache-2.0 |
kangbiao/tornado | tornado/ioloop.py | 44 | 40479 | #!/usr/bin/env python
#
# Copyright 2009 Facebook
#
# 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 a... | apache-2.0 |
nvoron23/hue | desktop/core/ext-py/tablib-develop/test_tablib.py | 6 | 19930 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Tests for Tablib."""
import unittest
import sys
import os
import tablib
from tablib.compat import markup, unicode
class TablibTestCase(unittest.TestCase):
"""Tablib test cases."""
def setUp(self):
"""Create simple data set with headers."""
... | apache-2.0 |
michalliu/OpenWrt-Firefly-Libraries | staging_dir/target-mipsel_1004kc+dsp_uClibc-0.9.33.2/usr/lib/python3.4/platform.py | 75 | 49015 | #!/usr/bin/env python3
""" This module tries to retrieve as much platform-identifying data as
possible. It makes this information available via function APIs.
If called from the command line, it prints the platform
information concatenated as single string to stdout. The output
format is useable as pa... | gpl-2.0 |
openstack/python-magnumclient | magnumclient/tests/v1/test_mservices_shell.py | 1 | 1265 | # Copyright 2015 NEC Corporation. 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 ... | apache-2.0 |
filias/django | django/conf/locale/hr/formats.py | 504 | 2106 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# 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 = 'H:i'
DATE... | bsd-3-clause |
kvar/ansible | lib/ansible/modules/cloud/rackspace/rax_queue.py | 102 | 3457 | #!/usr/bin/python
# Copyright: Ansible Project
# 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_version': '1.1',
'status': ['preview'],
... | gpl-3.0 |
tysonholub/twilio-python | tests/integration/ip_messaging/v2/service/test_binding.py | 1 | 6696 | # coding=utf-8
r"""
This code was generated by
\ / _ _ _| _ _
| (_)\/(_)(_|\/| |(/_ v1.0.0
/ /
"""
from tests import IntegrationTestCase
from tests.holodeck import Request
from twilio.base.exceptions import TwilioException
from twilio.http.response import Response
class BindingTestCase(Integrati... | mit |
darkleons/lama | addons/project_timesheet/__init__.py | 441 | 1084 | # -*- 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 |
Sidney84/pa-chromium | chrome/test/functional/devtools_instrumented_objects_check.py | 15 | 2829 | #!/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.
import logging
import os
import tempfile
import devtools_test_base
import pyauto_functional # Must be imported before pyauto
impo... | bsd-3-clause |
pombredanne/portia | slybot/slybot/fieldtypes/__init__.py | 14 | 1923 | """
Field Types
Spiders extracts items of a given type. These item types are defined by a
schema, which specifies the type of each field in the item. This module
contains FieldProcessor implementations, which are the classes responsible for
custom processing of these types.
We keep the types of scrapers supported fle... | bsd-3-clause |
wrouesnel/ansible | lib/ansible/modules/cloud/vmware/vmware_vsan_cluster.py | 47 | 3753 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Russell Teague <rteague2 () csc.com>
# 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_version': '1.1',... | gpl-3.0 |
fraenkel-lab/pcst_fast | external/googletest/googletest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | mit |
inflrscns/django-wiki | wiki/plugins/attachments/south_migrations/0001_initial.py | 16 | 12492 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding model 'Attachment'
db.create_table(u'wiki_attachments_attachment... | gpl-3.0 |
jakeva/bitcoin-pwcheck | qa/rpc-tests/python-bitcoinrpc/bitcoinrpc/authproxy.py | 305 | 5784 |
"""
Copyright 2011 Jeff Garzik
AuthServiceProxy has the following improvements over python-jsonrpc's
ServiceProxy class:
- HTTP connections persist for the life of the AuthServiceProxy object
(if server supports HTTP/1.1)
- sends protocol 'version', per JSON-RPC 1.1
- sends proper, incrementing 'id'
... | mit |
bobrock/eden | modules/templates/ARC/layouts.py | 20 | 10184 | # -*- coding: utf-8 -*-
from gluon import *
from s3 import *
# =============================================================================
class S3MainMenuLayout(S3NavigationItem):
"""
Application Main Menu Layout
"""
@staticmethod
def layout(item):
""" Custom Layout Method """
... | mit |
yasoob/PythonRSSReader | venv/lib/python2.7/dist-packages/twisted/internet/win32eventreactor.py | 41 | 15157 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
A win32event based implementation of the Twisted main loop.
This requires pywin32 (formerly win32all) or ActivePython to be installed.
To install the event loop (and you should do this before any connections,
listeners or connectors are add... | mit |
felipenaselva/felipe.repository | script.module.universalscrapers/lib/universalscrapers/dialogs.py | 9 | 8391 | from threading import Thread, RLock
import xbmc
import xbmcaddon
import xbmcgui
def select_ext(title, populator, tasks_count, sort_function = None):
addonPath = xbmcaddon.Addon().getAddonInfo('path').decode('utf-8')
dlg = SelectorDialog("DialogSelect.xml", addonPath, title=title,
pop... | gpl-2.0 |
WangWenjun559/Weiss | summary/sumy/sklearn/feature_selection/rfe.py | 1 | 17079 | # Authors: Alexandre Gramfort <alexandre.gramfort@inria.fr>
# Vincent Michel <vincent.michel@inria.fr>
# Gilles Louppe <g.louppe@gmail.com>
#
# License: BSD 3 clause
"""Recursive feature elimination for feature ranking"""
import warnings
import numpy as np
from ..utils import check_X_y, safe_sqr
fro... | apache-2.0 |
geminy/aidear | oss/qt/qt-everywhere-opensource-src-5.9.0/qtwebengine/src/3rdparty/chromium/v8/tools/testrunner/local/statusfile_unittest.py | 10 | 4126 | #!/usr/bin/env python
# Copyright 2016 the V8 project authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import unittest
import statusfile
from utils import Freeze
TEST_VARIABLES = {
'system': 'linux',
'mode': 'release',
}
TEST_S... | gpl-3.0 |
klusark/android_external_chromium_org | tools/clang/scripts/run_tool.py | 72 | 10556 | #!/usr/bin/env python
# Copyright (c) 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.
"""Wrapper script to help run clang tools across Chromium code.
How to use this tool:
If you want to run the tool across all Chrom... | bsd-3-clause |
jjas0nn/solvem | tensorflow/lib/python2.7/site-packages/numpy/lib/tests/test_nanfunctions.py | 13 | 33689 | from __future__ import division, absolute_import, print_function
import warnings
import numpy as np
from numpy.testing import (
run_module_suite, TestCase, assert_, assert_equal, assert_almost_equal,
assert_no_warnings, assert_raises, assert_array_equal, suppress_warnings
)
# Test data
_ndat = np.array(... | mit |
fsimkovic/cptbx | conkit/io/pcons.py | 2 | 6785 | # BSD 3-Clause License
#
# Copyright (c) 2016-19, University of Liverpool
# 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 notic... | gpl-3.0 |
Distrotech/PyQt-x11 | pyuic/uic/icon_cache.py | 4 | 5431 | #############################################################################
##
## Copyright (c) 2013 Riverbank Computing Limited <info@riverbankcomputing.com>
##
## This file is part of PyQt.
##
## This file may be used under the terms of the GNU General Public
## License versions 2.0 or 3.0 as published by the Fre... | gpl-2.0 |
numerigraphe/odoo | addons/website_forum/tests/test_forum.py | 87 | 7632 | # -*- coding: utf-8 -*-
from openerp.addons.website_forum.tests.common import KARMA, TestForumCommon
from openerp.addons.website_forum.models.forum import KarmaError
from openerp.exceptions import Warning, AccessError
from openerp.tools import mute_logger
class TestForum(TestForumCommon):
@mute_logger('openerp.... | agpl-3.0 |
evernym/zeno | plenum/common/ledger_uncommitted_tracker.py | 2 | 2603 | from stp_core.common.log import getlogger
from collections import deque
from common.exceptions import PlenumValueError, LogicError
logger = getlogger()
class LedgerUncommittedTracker:
def __init__(self, last_committed_hash, last_txn_root, ledger_size):
self.un_committed = deque()
self.set_last_c... | apache-2.0 |
collects/VTK | Examples/Tutorial/Step4/Python/Cone4.py | 23 | 3052 | #!/usr/bin/env python
#
# This example demonstrates the creation of multiple actors and the
# manipulation of their properties and transformations. It is a
# derivative of Cone.py, see that example for more information.
#
import vtk
import time
#
# Next we create an instance of vtkConeSource and set some of its
# pro... | bsd-3-clause |
unnikrishnankgs/va | venv/lib/python3.5/site-packages/PIL/ImageDraw2.py | 17 | 3229 | #
# The Python Imaging Library
# $Id$
#
# WCK-style drawing interface operations
#
# History:
# 2003-12-07 fl created
# 2005-05-15 fl updated; added to PIL as ImageDraw2
# 2005-05-15 fl added text support
# 2005-05-20 fl added arc/chord/pieslice support
#
# Copyright (c) 2003-2005 by Secret Labs AB
# Copyright ... | bsd-2-clause |
saurabh6790/test-med-lib | core/page/data_import_tool/data_import_tool.py | 34 | 16043 | # Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import webnotes, json
import webnotes.model.doc
import webnotes.model.doctype
from webnotes.model.meta import get_table_fields
from webnotes.model.doc import Document
from web... | mit |
alekz112/statsmodels | docs/source/plots/graphics_gofplots_qqplot.py | 38 | 1911 | # -*- coding: utf-8 -*-
"""
Created on Sun May 06 05:32:15 2012
Author: Josef Perktold
editted by: Paul Hobson (2012-08-19)
"""
from scipy import stats
from matplotlib import pyplot as plt
import statsmodels.api as sm
#example from docstring
data = sm.datasets.longley.load()
data.exog = sm.add_constant(data.exog, pre... | bsd-3-clause |
eayunstack/rally | rally/plugins/__init__.py | 20 | 1275 | # Copyright 2015: Mirantis 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 b... | apache-2.0 |
IITBinterns13/edx-platform-dev | common/djangoapps/terrain/factories.py | 9 | 1312 | '''
Factories are defined in other modules and absorbed here into the
lettuce world so that they can be used by both unit tests
and integration / BDD tests.
'''
import student.tests.factories as sf
import xmodule.modulestore.tests.factories as xf
from lettuce import world
@world.absorb
class UserFactory(sf.UserFactor... | agpl-3.0 |
ahmed-mahran/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/de/formats.py | 118 | 1104 | # -*- encoding: utf-8 -*-
# This file is distributed under the same license as the Django package.
#
from __future__ import unicode_literals
# The *_FORMAT strings use the Django date format syntax,
# see http://docs.djangoproject.com/en/dev/ref/templates/builtins/#date
DATE_FORMAT = 'j. F Y'
TIME_FORMAT = 'H:i:s'
DAT... | apache-2.0 |
AutonomyLab/deep_intent | code/gan_model/scripts/model_config_3d.py | 2 | 1462 | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from keras.optimizers import SGD
from keras.optimizers import Adam
import os
# -------------------------------------------------
# Background config:
# DATA_DIR= '/home/pratik/DeepIntent_Datasets/KITTI_Dataset... | bsd-3-clause |
gengliangwang/spark | python/pyspark/mllib/tests/test_linalg.py | 15 | 27588 | #
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
# this work for additional information regarding copyright ownership.
# The ASF licenses this file to You under the Apache License, Version 2.0
# (the "License"); you may not us... | apache-2.0 |
mozvip/CouchPotatoServer | libs/migrate/versioning/schema.py | 53 | 7595 | """
Database schema version management.
"""
import sys
import logging
from sqlalchemy import (Table, Column, MetaData, String, Text, Integer,
create_engine)
from sqlalchemy.sql import and_
from sqlalchemy import exceptions as sa_exceptions
from sqlalchemy.sql import bindparam
from migrate import exceptions
fro... | gpl-3.0 |
piotrek-golda/CivilHubCopy | topics/forms.py | 2 | 1878 | # -*- coding: utf-8 -*-
from django import forms
from django.utils.translation import ugettext_lazy as _
from locations.models import Location
from taggit.forms import TagField
from places_core.forms import BootstrapBaseForm
from .models import Category, Entry, Discussion
class DiscussionForm(forms.ModelForm, Bootstr... | gpl-3.0 |
rthallisey/kolla-kubernetes-personal | kolla/ansible/library/merge_configs.py | 8 | 1313 | #!/usr/bin/python
# Copyright 2015 Sam Yaple
#
# 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 |
smaffulli/libcloud | libcloud/test/compute/test_exoscale.py | 64 | 1147 | # 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 use ... | apache-2.0 |
offlinehacker/pyfilesystem | fs/expose/http.py | 14 | 5609 | __all__ = ["serve_fs"]
import SimpleHTTPServer
import SocketServer
from fs.path import pathjoin, dirname
from fs.errors import FSError
from time import mktime
from cStringIO import StringIO
import cgi
import urllib
import posixpath
import time
import threading
import socket
def _datetime_to_epoch(d):
return mktim... | bsd-3-clause |
bsmrstu-warriors/Moytri--The-Drone-Aider | Lib/pdb.py | 119 | 46016 | #! /usr/bin/env python
"""A Python debugger."""
# (See pdb.doc for documentation.)
import sys
import linecache
import cmd
import bdb
from repr import Repr
import os
import re
import pprint
import traceback
class Restart(Exception):
"""Causes a debugger to be restarted for the debugged python program."""
pa... | gpl-3.0 |
vijaylbais/boto | tests/unit/vpc/test_vpnconnection.py | 114 | 10421 | # -*- coding: UTF-8 -*-
from tests.unit import unittest
from tests.unit import AWSMockServiceTestCase
from boto.vpc import VPCConnection, VpnConnection
DESCRIBE_VPNCONNECTIONS = b'''<?xml version="1.0" encoding="UTF-8"?>
<DescribeVpnConnectionsResponse xmlns="http://ec2.amazonaws.com/doc/2013-02-01/">
<requestId>... | mit |
thanm/devel-scripts | munge-root-dump.py | 1 | 3865 | #!/usr/bin/python3
"""Post-process a GC roots dump.
"""
import getopt
import os
import re
import sys
import script_utils as u
# Input and output file (if not specified, defaults to stdin/stdout)
flag_infile = None
flag_outfile = None
# Binary to analyze
flag_module = None
#............................................ | apache-2.0 |
esikachev/scenario | sahara/tests/unit/service/edp/test_job_utils.py | 1 | 10221 | # Copyright (c) 2013 Mirantis Inc.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writ... | apache-2.0 |
codesparkle/youtube-dl | youtube_dl/extractor/tinypic.py | 26 | 1895 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import ExtractorError
class TinyPicIE(InfoExtractor):
IE_NAME = 'tinypic'
IE_DESC = 'tinypic.com videos'
_VALID_URL = r'https?://(?:.+?\.)?tinypic\.com/player\.php\?v=(?P<id>[^&]+)&s=\d+'
_TESTS = [
... | unlicense |
stlpublicradio/dailygraphics | fabfile/assets.py | 2 | 7215 | #!/usr/bin/env python
"""
Commands related to the syncing assets.
"""
from fnmatch import fnmatch
from glob import glob
import os
from fabric.api import prompt, task
import app_config
import utils
@task
def sync(path):
"""
Intelligently synchronize assets between S3 and local folder.
"""
ignore_glo... | mit |
Djabbz/scikit-learn | benchmarks/bench_plot_nmf.py | 90 | 5742 | """
Benchmarks of Non-Negative Matrix Factorization
"""
from __future__ import print_function
from collections import defaultdict
import gc
from time import time
import numpy as np
from scipy.linalg import norm
from sklearn.decomposition.nmf import NMF, _initialize_nmf
from sklearn.datasets.samples_generator import... | bsd-3-clause |
devoid/nova | nova/version.py | 15 | 2486 | # Copyright 2011 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 l... | apache-2.0 |
klmitch/neutron | neutron/db/availability_zone/router.py | 9 | 1979 | #
# 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 |
bionoid/kivy | kivy/core/clipboard/__init__.py | 6 | 4556 | '''
Clipboard
=========
Core class for accessing the Clipboard. If we are not able to access the
system clipboard, a fake one will be used.
Usage example:
.. code-block:: kv
#:import Clipboard kivy.core.clipboard.Clipboard
Button:
on_release:
self.text = Clipboard.paste()
Cl... | mit |
lahwaacz/qutebrowser | tests/unit/browser/webkit/network/test_schemehandler.py | 4 | 1186 | # vim: ft=python fileencoding=utf-8 sts=4 sw=4 et:
# Copyright 2015-2017 Florian Bruhin (The Compiler) <mail@qutebrowser.org>
#
# This file is part of qutebrowser.
#
# qutebrowser 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 S... | gpl-3.0 |
flexpeace/django-rest-auth | rest_auth/tests.py | 28 | 18071 | import json
from django.conf import settings
from django.core.urlresolvers import reverse
from django.test.client import Client, MULTIPART_CONTENT
from django.test import TestCase
from django.contrib.auth import get_user_model
from django.core import mail
from django.test.utils import override_settings
from django.con... | mit |
JeanKossaifi/scikit-learn | sklearn/datasets/lfw.py | 141 | 19372 | """Loader for the Labeled Faces in the Wild (LFW) dataset
This dataset is a collection of JPEG pictures of famous people collected
over the internet, all details are available on the official website:
http://vis-www.cs.umass.edu/lfw/
Each picture is centered on a single face. The typical task is called
Face Veri... | bsd-3-clause |
Fredehagelund92/Cheetax | setup.py | 1 | 1885 | from setuptools import setup, find_packages
from cheetax import __version__ as VERSION
long_description = 'Cheetax is a data loader command-line interface that helps transfer data between storages, \
databases and files into EXASOL. Cheetax is build around generic EXASOL import statements \
in order to maximize the pe... | apache-2.0 |
thw17/NextGenUtilities | fasta_utils/Trim_Ns_fasta.py | 1 | 17895 | """
Trim_Ns_Fasta.py
Author: Tim Webster, Arizona State University
Date: April 17, 2017
Currently requires Python 2.7
This script takes as input a fasta file and trims Ns from the beginning and
end. It also allows for abitrarily sized "buffers" to ignore in this
procedure. For example, if you set a buffer to 2 and... | mit |
emccode/HeliosBurn | heliosburn/hbcli/controllers/testplan.py | 1 | 3747 | import argparse
import sys
import re
import json
import requests
from models import auth
import pprint
def create(config, args):
pp = pprint.PrettyPrinter()
url = config['url'] + "/api/testplan/"
data = {
"name": args['name'],
"description": args['description'],
}
token = auth.get... | mit |
potsmaster/cinder | cinder/backup/api.py | 4 | 16756 | # Copyright (C) 2012 Hewlett-Packard Development Company, L.P.
# Copyright (c) 2014 TrilioData, Inc
# Copyright (c) 2015 EMC Corporation
# 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
# ... | apache-2.0 |
HydrelioxGitHub/home-assistant | homeassistant/components/cover/myq.py | 4 | 3260 | """
Support for MyQ-Enabled Garage Doors.
For more details about this platform, please refer to the documentation
https://home-assistant.io/components/cover.myq/
"""
import logging
import voluptuous as vol
from homeassistant.components.cover import (
PLATFORM_SCHEMA, SUPPORT_CLOSE, SUPPORT_OPEN, CoverDevice)
fro... | apache-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.