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 |
|---|---|---|---|---|---|
Kamik423/uni_plan | plan/plan/lib/python3.4/site-packages/flask/debughelpers.py | 318 | 6024 | # -*- coding: utf-8 -*-
"""
flask.debughelpers
~~~~~~~~~~~~~~~~~~
Various helpers to make the development experience better.
:copyright: (c) 2015 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
from ._compat import implements_to_string, text_type
from .app import Flask
from .bl... | apache-2.0 |
lancezlin/ml_template_py | lib/python2.7/site-packages/IPython/core/macro.py | 29 | 1873 | """Support for interactive macros in IPython"""
#*****************************************************************************
# Copyright (C) 2001-2005 Fernando Perez <fperez@colorado.edu>
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, distributed as part of th... | mit |
benzmuircroft/REWIRE.io | test/functional/wallet_backup.py | 3 | 7282 | #!/usr/bin/env python3
# Copyright (c) 2014-2017 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
"""Test the wallet backup features.
Test case is:
4 nodes. 1 2 and 3 send transactions between each other... | mit |
BeATz-UnKNoWN/python-for-android | python-modules/twisted/twisted/test/test_digestauth.py | 59 | 23470 | # Copyright (c) 2008-2009 Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for L{twisted.cred._digest} and the associated bits in
L{twisted.cred.credentials}.
"""
from zope.interface.verify import verifyObject
from twisted.trial.unittest import TestCase
from twisted.python.hashlib import md5, sha1
fr... | apache-2.0 |
StefanRijnhart/odoo | addons/l10n_th/__init__.py | 893 | 1045 | # -*- 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 |
ooici/marine-integrations | mi/dataset/driver/hypm/ctd/driver.py | 1 | 1597 | """
@package mi.dataset.driver.hypm.ctd.driver
@file marine-integrations/mi/dataset/driver/hypm/ctd/driver.py
@author Bill French
@brief Driver for the hypm/ctd
Release notes:
initial release
"""
__author__ = 'Bill French'
__license__ = 'Apache 2.0'
from mi.core.log import get_logger ; log = get_logger()
from mi.da... | bsd-2-clause |
hastexo/edx-platform | openedx/core/djangoapps/external_auth/djangostore.py | 24 | 3419 | """A openid store using django cache"""
import logging
import time
from django.core.cache import cache
from openid.store import nonce
from openid.store.interface import OpenIDStore
DEFAULT_ASSOCIATIONS_TIMEOUT = 60
DEFAULT_NONCE_TIMEOUT = 600
ASSOCIATIONS_KEY_PREFIX = 'openid.provider.associations.'
NONCE_KEY_PREFI... | agpl-3.0 |
JoeBartelmo/PyDetect | gui/img_proc/GlobalSurveyor.py | 2 | 10667 | # Copyright (c) 2016, Jeffrey Maggio and Joseph Bartelmo
#
# 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, modify, ... | mit |
rodrigoprimo/CVSAnalY | pycvsanaly2/extensions/file_types.py | 4 | 12840 | # -*- coding: iso-8859-1 -*-
# Copyright (C) 2006 Libresoft
#
# 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 p... | gpl-2.0 |
kzys/buildbot | buildbot/test/unit/test_svnpoller.py | 1 | 16273 | # -*- test-case-name: buildbot.test.test_svnpoller -*-
import time
from twisted.internet import defer
from twisted.trial import unittest
from buildbot.changes.svnpoller import SVNPoller
# this is the output of "svn info --xml
# svn+ssh://svn.twistedmatrix.com/svn/Twisted/trunk"
prefix_output = """\
<?xml version="1.0... | gpl-2.0 |
Koloses/kernel_j5 | Documentation/target/tcm_mod_builder.py | 2358 | 40707 | #!/usr/bin/python
# The TCM v4 multi-protocol fabric module generation script for drivers/target/$NEW_MOD
#
# Copyright (c) 2010 Rising Tide Systems
# Copyright (c) 2010 Linux-iSCSI.org
#
# Author: nab@kernel.org
#
import os, sys
import subprocess as sub
import string
import re
import optparse
tcm_dir = ""
fabric_ops... | gpl-2.0 |
alexjg/sqlalchemy-migrate | docs/conf.py | 16 | 6663 | # -*- coding: utf-8 -*-
#
# SQLAlchemy Migrate documentation build configuration file, created by
# sphinx-quickstart on Fri Feb 13 12:58:57 2009.
#
# This file is execfile()d with the current directory set to its containing dir.
#
# The contents of this file are pickled, so don't put values in the namespace
# that are... | mit |
meletakis/collato | lib/python2.7/site-packages/django/contrib/messages/tests/urls.py | 197 | 1959 | from django.conf.urls import patterns
from django.contrib import messages
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect, HttpResponse
from django.template import RequestContext, Template
from django.template.response import TemplateResponse
from django.views.decorators.cache ... | gpl-2.0 |
cmunk/protwis | api/views.py | 1 | 32974 | from django.shortcuts import render
from rest_framework import views, generics, viewsets
from rest_framework.response import Response
from rest_framework.parsers import MultiPartParser, FormParser, FileUploadParser
from rest_framework.renderers import JSONRenderer
from django.template.loader import render_to_string
fro... | apache-2.0 |
Djabx/mgd | mgdpck/writters/cbz.py | 1 | 1116 | #! /usr/bin/python
# -*- coding: utf-8 -*-
'''
A cbz writter
'''
from mgdpck import actions
import os
import mimetypes
import zipfile
class CbzWritter(actions.AbsWritter):
@classmethod
def get_name(cls):
return 'cbz'
def __init__(self, outdir):
self.outdir = outdir
self.out = None
def done(se... | apache-2.0 |
joariasl/odoo | addons/resource/__openerp__.py | 261 | 1941 | # -*- 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 |
dvliman/jaikuengine | .google_appengine/lib/webob-1.2.3/webob/request.py | 21 | 59110 | import binascii
import cgi
import io
import os
import re
import sys
import tempfile
import mimetypes
try:
import simplejson as json
except ImportError:
import json
import warnings
from webob.acceptparse import (
AcceptLanguage,
AcceptCharset,
MIMEAccept,
MIMENilAccept,
NoAccept,
accept_... | apache-2.0 |
Krienas/allianceauth | allianceauth/fleetup/managers.py | 5 | 7732 | from django.conf import settings
from django.core.cache import cache
from django.utils import timezone
from datetime import datetime
import logging
import requests
import hashlib
logger = logging.getLogger(__name__)
class FleetUpManager:
APP_KEY = settings.FLEETUP_APP_KEY
USER_ID = settings.FLEETUP_USER_ID
... | gpl-2.0 |
AgostonSzepessy/servo | tests/wpt/web-platform-tests/tools/manifest/tree.py | 26 | 5668 | import os
from six.moves import cStringIO as StringIO
from fnmatch import fnmatch
from . import vcs
from .log import get_logger
from .utils import is_blacklisted, rel_path_to_url
def chunks(data, n):
for i in range(0, len(data) - 1, n):
yield data[i:i+n]
class TestTree(object):
def __init__(self, tes... | mpl-2.0 |
gold3bear/swift | test/probe/test_reconstructor_durable.py | 20 | 5422 | #!/usr/bin/python -u
# 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 ap... | apache-2.0 |
avian2/unidecode | unidecode/x0c3.py | 253 | 4975 | data = (
'ssal', # 0x00
'ssalg', # 0x01
'ssalm', # 0x02
'ssalb', # 0x03
'ssals', # 0x04
'ssalt', # 0x05
'ssalp', # 0x06
'ssalh', # 0x07
'ssam', # 0x08
'ssab', # 0x09
'ssabs', # 0x0a
'ssas', # 0x0b
'ssass', # 0x0c
'ssang', # 0x0d
'ssaj', # 0x0e
'ssac', # 0x0f
'ssak', # ... | gpl-2.0 |
Livit/Livit.Learn.EdX.Wiki | wiki/templatetags/wiki_tags.py | 2 | 4239 | # -*- coding: utf-8 -*-
import re
from django.conf import settings as django_settings
from django import template
from django.contrib.contenttypes.models import ContentType
from django.db.models import Model
from django.forms import BaseForm
from django.utils.safestring import mark_safe
from django.template.defaultfil... | gpl-3.0 |
RicardoJohann/frappe | frappe/utils/goal.py | 1 | 4641 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
from frappe import _
from six.moves import xrange
def get_monthly_results(goal_doctype, goal_field, date_col, filter_str, aggregation = '... | mit |
nburn42/tensorflow | tensorflow/python/training/evaluation.py | 39 | 8616 | # Copyright 2017 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 applicable ... | apache-2.0 |
flavour/rgims_as_diff | modules/hs/utils/struct.py | 50 | 6446 | class Matrix (object):
def __init__ (self, rows, cols, array=None):
super (Matrix, self).__init__ ()
length = rows * cols
self.rows = rows
self.cols = cols
if array:
if length != len (array):
raise RuntimeError ("Bad Dimensions")
self.a... | mit |
jjmiranda/edx-platform | lms/djangoapps/shoppingcart/pdf.py | 21 | 18643 | """
Template for PDF Receipt/Invoice Generation
"""
from PIL import Image
import logging
from reportlab.lib import colors
from django.conf import settings
from django.utils.translation import ugettext as _
from reportlab.pdfgen.canvas import Canvas
from reportlab.lib.pagesizes import letter
from reportlab.lib.units imp... | agpl-3.0 |
CumulusNetworks/cumulus-linux-ansible-modules | library/cl_license.py | 3 | 4431 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Cumulus Networks <ce-ceng@cumulusnetworks.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... | gpl-3.0 |
nmarincic/numbasom | numbasom/numbasom.py | 1 | 8667 | from numba import jit
import numpy as np
import math
import collections
from timeit import default_timer as timer
@jit(nopython=True)
def normalize(data, min_val=0, max_val=1):
no_vectors, dim = data.shape
D = np.empty((no_vectors,dim), dtype=np.float64)
inf = 1.7976931348623157e+308
min_arr = np.empty(dim, dtype... | mit |
michigraber/scikit-learn | sklearn/decomposition/truncated_svd.py | 199 | 7744 | """Truncated SVD for sparse matrices, aka latent semantic analysis (LSA).
"""
# Author: Lars Buitinck <L.J.Buitinck@uva.nl>
# Olivier Grisel <olivier.grisel@ensta.org>
# Michael Becker <mike@beckerfuffle.com>
# License: 3-clause BSD.
import numpy as np
import scipy.sparse as sp
try:
from scipy.sp... | bsd-3-clause |
ddd332/presto | presto-docs/target/sphinx/reportlab/lib/pygments2xpre.py | 14 | 2371 | """Helps you output colourised code snippets in ReportLab documents.
Platypus has an 'XPreformatted' flowable for handling preformatted
text, with variations in fonts and colors. If Pygments is installed,
calling 'pygments2xpre' will return content suitable for display in
an XPreformatted object. If it's not instal... | apache-2.0 |
Buchhold/QLever | misc/move_language_into_relation.py | 1 | 1046 | import argparse
import sys
__author__ = 'buchholb'
parser = argparse.ArgumentParser()
parser.add_argument('--nt',
type=str,
help='n-triple file.',
required=True)
def writeNtFileToStdout(nt):
for line in open(nt):
cols = line.strip('\n').split(... | apache-2.0 |
zhuridartem/samples | AllJoyn/Samples/OICAdapter/iotivity-1.0.0/tools/scons/RunTest.py | 30 | 2504 | # ------------------------------------------------------------------------
# Copyright 2015 Intel Corporation
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/li... | mit |
SwiftAndroid/swift | utils/apply-fixit-edits.py | 7 | 2533 | #!/usr/bin/env python
# utils/apply-fixit-edits.py - Apply edits from .remap files -*- python -*-
#
# This source file is part of the Swift.org open source project
#
# Copyright (c) 2014 - 2016 Apple Inc. and the Swift project authors
# Licensed under Apache License v2.0 with Runtime Library Exception
#
# See http://sw... | apache-2.0 |
OS2World/APP-INTERNET-torpak_2 | Lib/htmllib.py | 2 | 12542 | """HTML 2.0 parser.
See the HTML 2.0 specification:
http://www.w3.org/hypertext/WWW/MarkUp/html-spec/html-spec_toc.html
"""
from sgmllib import SGMLParser
from formatter import AS_IS
__all__ = ["HTMLParser"]
class HTMLParser(SGMLParser):
"""This is the basic HTML parser class.
It supports all entity names... | mit |
google-research/language | language/xsp/model/constants.py | 1 | 1574 | # coding=utf-8
# Copyright 2018 The Google AI Language Team Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by ... | apache-2.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/webob/request.py | 30 | 59995 | import binascii
import cgi
import io
import os
import re
import sys
import tempfile
import mimetypes
try:
import simplejson as json
except ImportError:
import json
import warnings
from webob.acceptparse import (
AcceptLanguage,
AcceptCharset,
MIMEAccept,
MIMENilAccept,
NoAccept,
accept_... | bsd-3-clause |
ruleant/buildtime-trend | buildtimetrend/test/stages_test.py | 1 | 19853 | # vim: set expandtab sw=4 ts=4:
#
# Unit tests for Stages class
#
# Copyright (C) 2014 Dieter Adriaenssens <ruleant@users.sourceforge.net>
#
# This file is part of buildtime-trend
# <https://github.com/ruleant/buildtime-trend/>
#
# This program is free software: you can redistribute it and/or modify
# it under the term... | gpl-3.0 |
bottompawn/kbengine | kbe/src/lib/python/Lib/test/test_threading.py | 72 | 36686 | """
Tests for the threading module.
"""
import test.support
from test.support import verbose, strip_python_stderr, import_module, cpython_only
from test.script_helper import assert_python_ok
import random
import re
import sys
_thread = import_module('_thread')
threading = import_module('threading')
import time
import... | lgpl-3.0 |
cangermueller/deepcpg | deepcpg/data/dna.py | 1 | 2502 | """Functions for representing DNA sequences."""
from __future__ import division
from __future__ import print_function
from collections import OrderedDict
import numpy as np
from six.moves import range
# Mapping of nucleotides to integers
CHAR_TO_INT = OrderedDict([('A', 0), ('T', 1), ('G', 2), ('C', 3), ('N', 4)])
... | mit |
naritta/numpy | numpy/core/tests/test_multiarray_assignment.py | 59 | 1982 | from __future__ import division, absolute_import, print_function
import numpy as np
from numpy.testing import run_module_suite
ndims = 2
size = 10
shape = tuple([size] * ndims)
def _indices_for_nelems(nelems):
"""Returns slices of length nelems, from start onwards, in direction sign."""
if nelems == 0:
... | bsd-3-clause |
codeaurora-unoffical/linux-msm | tools/perf/scripts/python/exported-sql-viewer.py | 40 | 82426 | #!/usr/bin/python2
# SPDX-License-Identifier: GPL-2.0
# exported-sql-viewer.py: view data from sql database
# Copyright (c) 2014-2018, Intel Corporation.
# To use this script you will need to have exported data using either the
# export-to-sqlite.py or the export-to-postgresql.py script. Refer to those
# scripts for ... | gpl-2.0 |
FusionSP/android_external_chromium_org | components/domain_reliability/bake_in_configs.py | 32 | 3444 | #!/usr/bin/env python
# Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""Takes the JSON files in components/domain_reliability/baked_in_configs and
encodes their contents as an array of C strings that get... | bsd-3-clause |
Sorsly/subtle | google-cloud-sdk/lib/googlecloudsdk/third_party/appengine/proto/ProtocolBuffer.py | 6 | 40305 | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or ag... | mit |
richardwhiuk/ns-moose | src/tools/visualizer/visualizer/base.py | 7 | 3482 | import ns3
import gobject
import os.path
import sys
PIXELS_PER_METER = 3.0 # pixels-per-meter, at 100% zoom level
class PyVizObject(gobject.GObject):
__gtype_name__ = "PyVizObject"
def tooltip_query(self, tooltip):
tooltip.set_text("TODO: tooltip for %r" % self)
class Link(PyVizObject):
pass
c... | gpl-2.0 |
pynamodb/PynamoDB | tests/test_discriminator.py | 1 | 6828 | import pytest
from pynamodb.attributes import DiscriminatorAttribute
from pynamodb.attributes import DynamicMapAttribute
from pynamodb.attributes import ListAttribute
from pynamodb.attributes import MapAttribute
from pynamodb.attributes import NumberAttribute
from pynamodb.attributes import UnicodeAttribute
from pynam... | mit |
Philippe12/external_chromium_org | build/linux/install-chromeos-fonts.py | 111 | 2373 | #!/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.
# Script to install the Chrome OS fonts on Linux.
# This script can be run manually (as root), but is also run as part
# install-build-... | bsd-3-clause |
kost/volatility | volatility/plugins/gui/gahti.py | 13 | 2736 | # Volatility
# Copyright (C) 2007-2013 Volatility Foundation
# Copyright (C) 2010,2011,2012 Michael Hale Ligh <michael.ligh@mnin.org>
#
# 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 F... | gpl-2.0 |
samuelcolvin/django-importexport | views.py | 1 | 5063 | from django import forms
import Imex.models as m
import Imex.tasks as tasks
import HotDjango.views_base as viewb
from django.core.urlresolvers import reverse
from django.db import models
import settings
from django.shortcuts import redirect
import Imex
import_groups, export_groups = Imex.get_imex_groups()
actions = ... | gpl-2.0 |
ghostop14/sparrow-wifi | sparrowwifiagent.py | 1 | 114857 | #!/usr/bin/python3
#
# Copyright 2017 ghostop14
#
# This 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 software is distributed in the hope ... | gpl-3.0 |
bearstech/ansible | setup.py | 6 | 7576 |
import json
import os
import os.path
import sys
from collections import defaultdict
from distutils.command.build_scripts import build_scripts as BuildScripts
from distutils.command.sdist import sdist as SDist
try:
from setuptools import setup, find_packages
from setuptools.command.build_py import build_py as ... | gpl-3.0 |
resmo/ansible | lib/ansible/plugins/doc_fragments/k8s_scale_options.py | 41 | 1314 | # -*- coding: utf-8 -*-
# Copyright: (c) 2018, Red Hat | Ansible
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
# Options used by scale modules.
class ModuleDocFragment(object):
DOCUMENTATION = r'''
options:
replicas:
description:
- The desired number ... | gpl-3.0 |
roxxup/PartialTuring | WebcamSound.py | 1 | 3038 | import threading
from threading import Thread
import cv2
import sys
#import wikipedia
#from chatterbot import ChatBot
import shlex, subprocess
import speech_recognition as sr
import pyvona
from googlesearch import GoogleSearch
import xml.etree.ElementTree as ET
import requests
cascPath = sys.argv[1]
def wikileaks(st... | gpl-3.0 |
yohanyee/simple-neural-net | classes/example_pipelines.py | 1 | 1478 | import numpy as np
from data import *
from construct import *
from train import *
from hippocampi_to_patches import *
class DigitsPipeline(object):
def __init__(self):
self.D = Data()
self.D.load_digits_data()
self.D.reshape([16,16],[1])
self.N = FeedForwardNetwork()
... | mit |
jayceyxc/hue | desktop/core/ext-py/thriftpy-0.3.9/thriftpy/transport/sslsocket.py | 11 | 4945 | # -*- coding: utf-8 -*-
from __future__ import absolute_import
import os
import socket
import ssl
import struct
from ._ssl import (
create_thriftpy_context,
RESTRICTED_SERVER_CIPHERS,
DEFAULT_CIPHERS
)
from .socket import TSocket, TServerSocket
class TSSLSocket(TSocket):
"""SSL socket implementatio... | apache-2.0 |
Tennyson53/SUR | magnum/conductor/template_definition.py | 3 | 19957 | # Copyright 2014 Rackspace Inc. All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law ... | apache-2.0 |
gauravbose/digital-menu | digimenu2/tests/template_backends/test_dummy.py | 13 | 3539 | # coding: utf-8
from __future__ import unicode_literals
from django.forms import CharField, Form, Media
from django.http import HttpRequest
from django.middleware.csrf import CsrfViewMiddleware, get_token
from django.template import TemplateDoesNotExist, TemplateSyntaxError
from django.template.backends.dummy import ... | bsd-3-clause |
cloudera/hue | desktop/core/ext-py/kazoo-2.8.0/kazoo/recipe/lock.py | 3 | 24081 | """Zookeeper Locking Implementations
:Maintainer: Ben Bangert <ben@groovie.org>
:Status: Production
Error Handling
==============
It's highly recommended to add a state listener with
:meth:`~KazooClient.add_listener` and watch for
:attr:`~KazooState.LOST` and :attr:`~KazooState.SUSPENDED` state
changes and re-act ap... | apache-2.0 |
anurag03/integration_tests | cfme/tests/services/test_provision_stack.py | 1 | 9381 | import fauxfactory
import pytest
from widgetastic_patternfly import DropdownItemDisabled
from cfme import test_requirements
from cfme.cloud.provider import CloudProvider
from cfme.cloud.provider.azure import AzureProvider
from cfme.cloud.provider.ec2 import EC2Provider
from cfme.cloud.provider.openstack import OpenSta... | gpl-2.0 |
mKeRix/home-assistant | homeassistant/components/islamic_prayer_times/sensor.py | 7 | 2078 | """Platform to retrieve Islamic prayer times information for Home Assistant."""
import logging
from homeassistant.const import DEVICE_CLASS_TIMESTAMP
from homeassistant.helpers.dispatcher import async_dispatcher_connect
from homeassistant.helpers.entity import Entity
import homeassistant.util.dt as dt_util
from .cons... | mit |
Telestream/telestream-cloud-python-sdk | telestream_cloud_flip_sdk/telestream_cloud_flip/models/extra_file.py | 1 | 4957 | # coding: utf-8
"""
Flip API
Flip # noqa: E501
The version of the OpenAPI document: 3.1
Contact: cloudsupport@telestream.net
Generated by: https://openapi-generator.tech
"""
import pprint
import re # noqa: F401
import six
from telestream_cloud_flip.configuration import Configuration
class... | mit |
thundernixon/thundernixon2015wp-sage | node_modules/node-gyp/gyp/pylib/gyp/xcode_emulation.py | 1283 | 65086 | # 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.
"""
This module contains classes that help to emulate xcodebuild behavior on top of
other build systems, such as make and ninja.
"""
import copy
import gyp.common... | mit |
ESSS/numpy | numpy/doc/broadcasting.py | 231 | 5565 | """
========================
Broadcasting over arrays
========================
The term broadcasting describes how numpy treats arrays with different
shapes during arithmetic operations. Subject to certain constraints,
the smaller array is "broadcast" across the larger array so that they
have compatible shapes. Broadc... | bsd-3-clause |
aam-at/tensorflow | tensorflow/python/autograph/core/function_wrappers_test.py | 14 | 2220 | # 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 |
HiroIshikawa/21playground | payblog/blog/lib/python3.5/site-packages/playhouse/postgres_ext.py | 8 | 13366 | """
Collection of postgres-specific extensions, currently including:
* Support for hstore, a key/value type storage
"""
import uuid
from peewee import *
from peewee import Expression
from peewee import logger
from peewee import Node
from peewee import OP
from peewee import Param
from peewee import Passthrough
from pe... | mit |
metis-ai/yowsup | yowsup/layers/protocol_groups/protocolentities/__init__.py | 60 | 1706 | from .iq_groups_create import CreateGroupsIqProtocolEntity
from .iq_groups_create_success import SuccessCreateGroupsIqProtocolEntity
from .iq_groups_leave import LeaveGroupsIqProtocolEntity
from .iq_groups_leave_success import SuccessLeaveGroupsIqProtocolEntity
from .iq_groups_list import ListGroupsIq... | gpl-3.0 |
pombreda/https-gitorious.org-appstream-software-center | softwarecenter/ui/gtk3/widgets/buttons.py | 1 | 21538 | # Copyright (C) 2011 Canonical
#
# Authors:
# Matthew McGowan
#
# 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; version 3.
#
# This program is distributed in the hope that it will be useful, bu... | gpl-3.0 |
gaberger/pybvc | pybvc/common/status.py | 6 | 5112 |
# Copyright (c) 2015, BROCADE COMMUNICATIONS SYSTEMS, 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:
# 1. Redistributions of source code must retain the above copyright notice,
# this list... | bsd-3-clause |
mou4e/zirconium | chrome/common/extensions/docs/server2/mock_file_system_test.py | 85 | 4664 | #!/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.
from copy import deepcopy
from file_system import FileNotFoundError, StatInfo
from mock_file_system import MockFileSystem
from test_fil... | bsd-3-clause |
etherkit/OpenBeacon2 | client/macos/venv/lib/python3.8/site-packages/PyInstaller/hooks/rthooks/pyi_rth_gstreamer.py | 3 | 1080 | #-----------------------------------------------------------------------------
# Copyright (c) 2013-2020, PyInstaller Development Team.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
#
# The full license is in the file COPYING.txt, ... | gpl-3.0 |
dkillick/iris | lib/iris/tests/unit/fileformats/pyke_rules/compiled_krb/fc_rules_cf_fc/test_get_attr_units.py | 16 | 2102 | # (C) British Crown Copyright 2015, Met Office
#
# This file is part of Iris.
#
# Iris is free software: you can redistribute it and/or modify it under
# the terms of the GNU Lesser General Public License as published by the
# Free Software Foundation, either version 3 of the License, or
# (at your option) any later ve... | lgpl-3.0 |
JuanaV/python-brain-rhythms | pyqtgraph/flowchart/FlowchartCtrlTemplate_pyside.py | 50 | 3175 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file './pyqtgraph/flowchart/FlowchartCtrlTemplate.ui'
#
# Created: Mon Dec 23 10:10:51 2013
# by: pyside-uic 0.2.14 running on PySide 1.1.2
#
# WARNING! All changes made in this file will be lost!
from PySide import QtCore, QtGui
class Ui_F... | mit |
kumarkrishna/sympy | sympy/combinatorics/tests/test_partitions.py | 58 | 3382 | from sympy.core.compatibility import range
from sympy.combinatorics.partitions import (Partition, IntegerPartition,
RGS_enum, RGS_unrank, RGS_rank,
random_integer_partition)
from sympy.utilities.pytest import raises
from sympy.utili... | bsd-3-clause |
ravibhure/ansible | lib/ansible/modules/notification/mqtt.py | 20 | 6358 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, 2014, Jan-Piet Mens <jpmens () gmail.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': '... | gpl-3.0 |
hybrid-storage-dev/cinder-fs-111t-hybrid-cherry | volume/drivers/ibm/xiv_ds8k.py | 6 | 8174 | # Copyright 2013 IBM Corp.
# Copyright (c) 2013 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... | apache-2.0 |
mcanthony/cython | Cython/Compiler/Visitor.py | 7 | 28932 | # cython: infer_types=True
#
# Tree visitor and transform framework
#
from __future__ import absolute_import, print_function
import sys
import inspect
from . import TypeSlots
from . import Builtin
from . import Nodes
from . import ExprNodes
from . import Errors
from . import DebugFlags
from . import Future
impor... | apache-2.0 |
samdowd/drumm-farm | drumm_env/lib/python2.7/site-packages/pip/commands/search.py | 343 | 4502 | from __future__ import absolute_import
import logging
import sys
import textwrap
from pip.basecommand import Command, SUCCESS
from pip.compat import OrderedDict
from pip.download import PipXmlrpcTransport
from pip.models import PyPI
from pip.utils import get_terminal_size
from pip.utils.logging import indent_log
from... | mit |
scrapinghub/keystone | keystone/common/dependency.py | 4 | 10581 | # Copyright 2012 OpenStack Foundation
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in... | apache-2.0 |
GeoODK/onadata | onadata/apps/main/google_export.py | 13 | 2853 | import gdata.client
import gdata.docs.data
import gdata.docs.client
import gdata.gauth
from gdata.spreadsheets import client
from django.core.urlresolvers import reverse
from django.http import HttpResponse
from django.http import HttpResponseRedirect
from onadata.apps.main.models import TokenStorageModel
from onadat... | bsd-2-clause |
lucperkins/heron | integration_test/src/python/integration_test/topology/one_spout_bolt_multi_tasks/one_spout_bolt_multi_tasks.py | 1 | 1368 | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
# copyright 2016 twitter. 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... | apache-2.0 |
sanjeevtripurari/hue | desktop/core/src/desktop/auth/views_test.py | 8 | 22972 | #!/usr/bin/env python
# Licensed to Cloudera, Inc. under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. Cloudera, Inc. licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you ma... | apache-2.0 |
Azure/azure-sdk-for-python | sdk/consumption/azure-mgmt-consumption/azure/mgmt/consumption/_configuration.py | 1 | 3274 | # 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 may ... | mit |
yiqingj/work | scons/scons-local-2.3.0/SCons/Scanner/__init__.py | 11 | 14728 | """SCons.Scanner
The Scanner package for the SCons software construction utility.
"""
#
# Copyright (c) 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013 The SCons Foundation
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated ... | lgpl-2.1 |
crosswalk-project/chromium-crosswalk-efl | chrome/common/extensions/docs/server2/appengine_url_fetcher.py | 78 | 2708 | # 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 base64
import logging
import posixpath
import time
from appengine_wrappers import urlfetch
from environment import GetAppVersion
from future impo... | bsd-3-clause |
vipullakhani/mi-instrument | mi/dataset/parser/dosta_abcdjm_ctdbp_dcl.py | 5 | 10712 | #!/usr/bin/env python
"""
@package mi.dataset.parser
@file mi-dataset/mi/dataset/parser/dosta_abcdjm_ctdbp_dcl.py
@author Jeff Roy
@brief Parser for the dosta_d_ctdbp_dcl dataset driver
This file contains code for the dosta_d_ctdbp_dcl parser and code to produce data particles.
The input file is ASCII.
The record ty... | bsd-2-clause |
leansoft/edx-platform | lms/djangoapps/edxnotes/views.py | 72 | 3809 | """
Views related to EdxNotes.
"""
import json
import logging
from django.contrib.auth.decorators import login_required
from django.http import HttpResponse, HttpResponseBadRequest, Http404
from django.conf import settings
from django.core.urlresolvers import reverse
from edxmako.shortcuts import render_to_response
fro... | agpl-3.0 |
gravitystorm/fifengine | engine/python/fife/extensions/pychan/compat.py | 5 | 4342 | # -*- coding: utf-8 -*-
# ####################################################################
# Copyright (C) 2005-2013 by the FIFE team
# http://www.fifengine.net
# This file is part of FIFE.
#
# FIFE is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
#... | lgpl-2.1 |
aioue/ansible | lib/ansible/modules/files/archive.py | 10 | 14950 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2016, Ben Doherty <bendohmv@gmail.com>
# Sponsored by Oomph, Inc. http://www.oomphinc.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 Fre... | gpl-3.0 |
mxamin/youtube-dl | youtube_dl/extractor/flickr.py | 37 | 4743 | from __future__ import unicode_literals
from .common import InfoExtractor
from ..compat import compat_urllib_parse_urlencode
from ..utils import (
ExtractorError,
int_or_none,
qualities,
)
class FlickrIE(InfoExtractor):
_VALID_URL = r'https?://(?:www\.|secure\.)?flickr\.com/photos/[\w\-_@]+/(?P<id>\d... | unlicense |
burtgulash/PaTrie | patrie.py | 1 | 2824 | #!/usr/bin/python3
class TNode:
def __init__(self, children):
self.children = children
def is_leaf(self):
return self.children is None
def __repr__(self):
return repr(self.children)
class PaTrie:
def __init__(self):
self.root = None
def __contains__(self, word... | mit |
stringertheory/names | update_meter.py | 1 | 4118 | import sys
import string
import termcolor
import pymongo
import pronouncing
import unidecode
import distance
# a decorator that caches functions but stores results with a db backend would be nice.
def mongo_collection():
collection = pymongo.MongoClient().poetry.poems
return collection
def word_tokenize(sen... | mit |
Bitergia/allura | ForgeLink/forgelink/tests/functional/test_root.py | 2 | 1777 | from allura.tests import decorators as td
from alluratest.controller import TestController
class TestRootController(TestController):
def test_root_index_no_url(self):
response = self.app.get('/link/index')
assert 'Link is not configured' in response
@td.with_link
def test_root_index_with_... | apache-2.0 |
scality/manila | manila/tests/share/test_manager.py | 1 | 131893 | # Copyright 2014 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 by... | apache-2.0 |
martinbuc/missionplanner | Lib/site-packages/numpy/distutils/command/build.py | 99 | 1255 | import os
import sys
from distutils.command.build import build as old_build
from distutils.util import get_platform
from numpy.distutils.command.config_compiler import show_fortran_compilers
class build(old_build):
sub_commands = [('config_cc', lambda *args: True),
('config_fc', lambda... | gpl-3.0 |
P0cL4bs/3vilTwinAttacker | plugins/external/sslstrip-hsts/dns2proxy/dns2proxy.py | 2 | 25149 | #!/usr/bin/python2.6
'''
dns2proxy for offensive cybersecurity v1.0
python dns2proxy.py -h for Usage.
Example:
python2.6 dns2proxy.py -i eth0 -u 192.168.1.101 -d 192.168.1.200
Example for no forwarding (only configured domain based queries and spoofed hosts):
python2.6 dns2proxy.py -i eth0 -noforward
Example for... | gpl-3.0 |
zakuro9715/lettuce | tests/integration/lib/Django-1.3/tests/regressiontests/admin_changelist/models.py | 51 | 1353 | from django.db import models
class Parent(models.Model):
name = models.CharField(max_length=128)
class Child(models.Model):
parent = models.ForeignKey(Parent, editable=False, null=True)
name = models.CharField(max_length=30, blank=True)
class Genre(models.Model):
name = models.CharField(max_length=20... | gpl-3.0 |
jpic/ansible-modules-extras | packaging/os/portinstall.py | 47 | 6895 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2013, berenddeboer
# Written by berenddeboer <berend@pobox.com>
# Based on pkgng module written by bleader <bleader at ratonland.org>
#
# This module is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as publish... | gpl-3.0 |
mpasternak/pyglet-fix-issue-518-522 | pyglet/image/codecs/quicktime.py | 43 | 10154 | # ----------------------------------------------------------------------------
# pyglet
# Copyright (c) 2006-2008 Alex Holkner
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
# are met:
#
# * Redistribu... | bsd-3-clause |
brianhouse/housepy | lib/xbee/tests/Fake.py | 48 | 1476 | #! /usr/bin/python
"""
Fake.py
By Paul Malmsten, 2010
pmalmsten@gmail.com
Provides fake device objects for other unit tests.
"""
import sys
class FakeDevice(object):
"""
Represents a fake serial port for testing purposes
"""
def __init__(self):
self.data = b''
def w... | mit |
Hilary93/doomai | learning/learning2.py | 1 | 10131 | #!/usr/bin/python
import itertools as it
import pickle
from random import sample, randint, random
from time import time
from vizdoom import *
import cv2
import numpy as np
import theano
from lasagne.init import GlorotUniform, Constant
from lasagne.layers import Conv2DLayer, InputLayer, DenseLayer, MaxPool2DLayer, get... | mit |
tsdmgz/ansible | test/units/modules/remote_management/oneview/hpe_test_utils.py | 7 | 8243 | # -*- coding: utf-8 -*-
#
# Copyright (2016-2017) Hewlett Packard Enterprise Development LP
#
# 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 optio... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.