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 |
|---|---|---|---|---|---|
lintzc/gpdb | src/test/unit/mock/special.py | 20 | 2211 |
class SpecialFuncs(object):
@classmethod
def make_body(cls, func):
key = 'make_body_' + func.funcname
if key in cls.__dict__:
return cls.__dict__[key].__get__(None, SpecialFuncs)(func)
@staticmethod
def make_body_MemoryContextAllocZeroImpl(func):
return """
... | apache-2.0 |
gusai-francelabs/datafari | windows/python/Lib/encodings/utf_16_le.py | 860 | 1037 | """ Python 'utf-16-le' Codec
Written by Marc-Andre Lemburg (mal@lemburg.com).
(c) Copyright CNRI, All Rights Reserved. NO WARRANTY.
"""
import codecs
### Codec APIs
encode = codecs.utf_16_le_encode
def decode(input, errors='strict'):
return codecs.utf_16_le_decode(input, errors, True)
class IncrementalEncod... | apache-2.0 |
rouault/Quantum-GIS | tests/src/python/test_qgsserver_wms_getfeatureinfo.py | 1 | 17012 | # -*- coding: utf-8 -*-
"""QGIS Unit tests for QgsServer GetFeatureInfo WMS.
From build dir, run: ctest -R PyQgsServerWMSGetFeatureInfo -V
.. note:: 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; ... | gpl-2.0 |
GdZ/scriptfile | software/googleAppEngine/lib/django_1_2/django/utils/html.py | 202 | 8105 | """HTML utilities suitable for global use."""
import re
import string
from django.utils.safestring import SafeData, mark_safe
from django.utils.encoding import force_unicode
from django.utils.functional import allow_lazy
from django.utils.http import urlquote
# Configuration for urlize() function.
LEADING_PUNCTUATIO... | mit |
maxdeliso/elevatorSim | Lib/test/test_runpy.py | 5 | 23521 | # Test the runpy module
import unittest
import os
import os.path
import sys
import re
import tempfile
import importlib
import py_compile
from test.support import (
forget, make_legacy_pyc, run_unittest, unload, verbose, no_tracing,
create_empty_file)
from test.script_helper import (
make_pkg, make_script, m... | bsd-2-clause |
barrysteyn/pelican-plugins | asciidoc_reader/asciidoc_reader.py | 24 | 1918 | # -*- coding: utf-8 -*-
"""
AsciiDoc Reader
===============
This plugin allows you to use AsciiDoc to write your posts.
File extension should be ``.asc``, ``.adoc``, or ``asciidoc``.
"""
from pelican.readers import BaseReader
from pelican.utils import pelican_open
from pelican import signals
try:
# asciidocapi ... | agpl-3.0 |
mfalcon/edujango | zinnia/views/quick_entry.py | 7 | 3417 | """Views for Zinnia quick entry"""
try:
from urllib.parse import urlencode
except: # Python 2
from urllib import urlencode
from django import forms
from django.shortcuts import redirect
from django.utils.html import linebreaks
from django.views.generic.base import View
from django.utils.encoding import smart_... | apache-2.0 |
w1ll1am23/home-assistant | tests/components/gree/test_init.py | 6 | 1322 | """Tests for the Gree Integration."""
from unittest.mock import patch
from homeassistant.components.gree.const import DOMAIN as GREE_DOMAIN
from homeassistant.config_entries import ENTRY_STATE_LOADED, ENTRY_STATE_NOT_LOADED
from homeassistant.setup import async_setup_component
from tests.common import MockConfigEntr... | apache-2.0 |
flwh/KK_mt6589_iq451 | prebuilts/python/darwin-x86/2.7.5/lib/python2.7/plat-mac/lib-scriptpackages/SystemEvents/Text_Suite.py | 82 | 5759 | """Suite Text Suite: A set of basic classes for text processing.
Level 1, version 1
Generated from /System/Library/CoreServices/System Events.app
AETE/AEUT resource version 1/0, language 0, script 0
"""
import aetools
import MacOS
_code = '????'
class Text_Suite_Events:
pass
class attachment(aetools.Componen... | gpl-2.0 |
broferek/ansible | lib/ansible/modules/network/onyx/onyx_qos.py | 28 | 9337 | #!/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 |
fxfitz/ansible | test/units/module_utils/facts/system/test_lsb.py | 118 | 4485 | # unit tests for ansible system lsb fact collectors
# -*- coding: utf-8 -*-
#
# 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.... | gpl-3.0 |
viaembedded/vab820-kernel-bsp-old | scripts/analyze_suspend.py | 1537 | 120394 | #!/usr/bin/python
#
# Tool for analyzing suspend/resume timing
# Copyright (c) 2013, Intel Corporation.
#
# This program is free software; you can redistribute it and/or modify it
# under the terms and conditions of the GNU General Public License,
# version 2, as published by the Free Software Foundation.
#
# This prog... | gpl-2.0 |
Designist/sympy | sympy/plotting/intervalmath/interval_arithmetic.py | 98 | 16450 | """
Interval Arithmetic for plotting.
This module does not implement interval arithmetic accurately and
hence cannot be used for purposes other than plotting. If you want
to use interval arithmetic, use mpmath's interval arithmetic.
The module implements interval arithmetic using numpy and
python floating points. The ... | bsd-3-clause |
freeJim/monserver | examples/python/mongrel2/request.py | 72 | 1140 | try:
import json
except:
import simplejson as json
from mongrel2 import tnetstrings
class Request(object):
def __init__(self, sender, conn_id, path, headers, body):
self.sender = sender
self.path = path
self.conn_id = conn_id
self.headers = headers
self.body = bod... | bsd-3-clause |
oppia/oppia-ml | core/domain/remote_access_services.py | 1 | 4226 | # coding: utf-8
#
# Copyright 2017 The Oppia 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 requi... | apache-2.0 |
Bitergia/redhat-rdo-dashboard | templates/apply_template.py | 35 | 1833 | #! /usr/bin/env python
# Copyright (C) 2014 Bitergia
# 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 version.
# This program is... | gpl-3.0 |
Lab603/PicEncyclopedias | jni-build/jni/include/tensorflow/contrib/distributions/python/ops/mvn.py | 3 | 30904 | # Copyright 2016 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | mit |
jcpowermac/ansible-modules-extras | clustering/consul_acl.py | 13 | 10484 | #!/usr/bin/python
#
# (c) 2015, Steve Gargan <steve.gargan@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... | gpl-3.0 |
DreamerKing/LightweightHtmlWidgets | LightweightHtmlWidgets/bin/Release/Ipy.Lib/wsgiref/simple_server.py | 177 | 4743 | """BaseHTTPServer that implements the Python WSGI protocol (PEP 333, rev 1.21)
This is both an example of how WSGI can be implemented, and a basis for running
simple web applications on a local machine, such as might be done when testing
or debugging an application. It has not been reviewed for security issues,
howev... | gpl-3.0 |
google/clif | examples/wrapfunc/python/default_args_test.py | 1 | 1214 | # Copyright 2017 Google 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 writing,... | apache-2.0 |
openstack/manila | manila/scheduler/weighers/pool.py | 5 | 1955 | # 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 by... | apache-2.0 |
Garrett-R/scikit-learn | sklearn/linear_model/randomized_l1.py | 11 | 23088 | """
Randomized Lasso/Logistic: feature selection based on Lasso and
sparse Logistic Regression
"""
# Author: Gael Varoquaux, Alexandre Gramfort
#
# License: BSD 3 clause
import itertools
from abc import ABCMeta, abstractmethod
import warnings
import numpy as np
from scipy.sparse import issparse
from scipy import spar... | bsd-3-clause |
onitake/ansible | lib/ansible/modules/network/cnos/cnos_reload.py | 17 | 3423 | #!/usr/bin/python
# -*- coding: utf-8 -*-
from __future__ import (absolute_import, division, print_function)
__metaclass__ = type
#
# Copyright (C) 2017 Lenovo, 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 Licens... | gpl-3.0 |
carolFrohlich/nipype | nipype/interfaces/mrtrix3/preprocess.py | 2 | 7501 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
# -*- coding: utf-8 -*-
"""
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname(os.path.realpath(__file__ ))
>>> datadir = os.path.realpath(... | bsd-3-clause |
sam-m888/gramps | gramps/plugins/drawreport/ancestortree.py | 1 | 42337 | # Gramps - a GTK+/GNOME based genealogy program
#
# Copyright (C) 2000-2007 Donald N. Allingham
# Copyright (C) 2007-2012 Brian G. Matherly
# Copyright (C) 2010 Jakim Friant
# Copyright (C) 2014 Paul Franklin
# Copyright (C) 2010-2015 Craig J. Anderson
#
# This program is free software; you can redistrib... | gpl-2.0 |
Moriadry/tensorflow | tensorflow/python/ops/control_flow_ops.py | 2 | 124140 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
ImageEngine/gaffer | python/GafferUITest/CollapsibleTest.py | 7 | 4050 | ##########################################################################
#
# Copyright (c) 2011-2012, Image Engine Design Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redi... | bsd-3-clause |
d/bazel | third_party/py/gflags/tests/gflags_googletest.py | 132 | 4256 | #!/usr/bin/env python
# Copyright (c) 2011, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this l... | apache-2.0 |
mancoast/CPythonPyc_test | cpython/242_test_bisect.py | 8 | 9127 | import unittest
from test import test_support
from bisect import bisect_right, bisect_left, insort_left, insort_right, insort, bisect
from UserList import UserList
class TestBisect(unittest.TestCase):
precomputedCases = [
(bisect_right, [], 1, 0),
(bisect_right, [1], 0, 0),
(bisect_right, ... | gpl-3.0 |
redhat-openstack/glance | glance/db/sqlalchemy/migrate_repo/versions/012_id_to_uuid.py | 2 | 20307 | # Copyright 2013 IBM Corp.
# Copyright 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/LIC... | apache-2.0 |
lgfausak/sqlbridge | sqlbridge/twisted/dbengine.py | 1 | 6399 | #!/usr/bin/env python
###############################################################################
##
## Copyright (C) 2014 Greg Fausak
##
## 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... | apache-2.0 |
matplotlib/cmocean | cmocean/rgb/dense.py | 2 | 13693 |
from matplotlib.colors import ListedColormap
from numpy import nan, inf
# Used to reconstruct the colormap in pycam02ucs.cm.viscm
parameters = {'xp': [16.121891585344997, 33.901145962549492, 5.5873058066040926, -14.703203914141397, -17.875928056390336, -5.3288735306278738],
'yp': [-2.5423728813559308, -... | mit |
cjaymes/pyscap | src/scap/model/ocil_2_0/ItemBaseType.py | 1 | 1052 | # Copyright 2016 Casey Jaymes
# This file is part of PySCAP.
#
# PySCAP 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.
#
# PySCAP is ... | gpl-3.0 |
jmehnle/ansible | lib/ansible/modules/network/nxos/nxos_vtp_password.py | 46 | 8006 | #!/usr/bin/python
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distribut... | gpl-3.0 |
bnkr/suds | suds/sudsobject.py | 201 | 11165 | # This program is free software; you can redistribute it and/or modify
# it under the terms of the (LGPL) GNU Lesser General Public License as
# published by the Free Software Foundation; either version 3 of the
# License, or (at your option) any later version.
#
# This program is distributed in the hope that it will ... | lgpl-3.0 |
edespino/gpdb | gpAux/extensions/gphdfs/regression/input/regression/createData.py | 23 | 7087 | #!/usr/bin/env python
"""
Copyright (C) 2004-2015 Pivotal Software, Inc. All rights reserved.
This program and the accompanying materials are made available under
the terms of the 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 co... | apache-2.0 |
drawks/ansible | lib/ansible/modules/network/aci/aci_firmware_source.py | 27 | 7594 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright: (c) 2018, Dag Wieers (dagwieers) <dag@wieers.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_ver... | gpl-3.0 |
shitolepriya/test-erp | erpnext/accounts/doctype/bank_reconciliation/bank_reconciliation.py | 23 | 2290 | # 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.utils import flt, getdate, nowdate
from frappe import msgprint, _
from frappe.model.document import Document
class BankReconc... | agpl-3.0 |
mancoast/CPythonPyc_test | fail/311_test_funcattrs.py | 1 | 9974 | from test import support
import types
import unittest
class FuncAttrsTest(unittest.TestCase):
def setUp(self):
class F:
def a(self):
pass
def b():
return 3
self.fi = F()
self.F = F
self.b = b
def cannot_set_attr(self, obj, name, v... | gpl-3.0 |
wezhang/vim-setup | bundle/python-mode/pymode/libs3/rope/refactor/occurrences.py | 91 | 10704 | import re
import rope.base.pynames
from rope.base import pynames, pyobjects, codeanalyze, evaluate, exceptions, utils, worder
class Finder(object):
"""For finding occurrences of a name
The constructor takes a `filters` argument. It should be a list
of functions that take a single argument. For each po... | apache-2.0 |
daniel1yuan/Persist | Persist/webapp/views.py | 1 | 6162 | from django.shortcuts import redirect,render
from django.http import Http404, JsonResponse, HttpResponseForbidden, HttpResponse
from django.contrib.auth import authenticate, login, logout
from webapp.models import User, Customer, Habit
from django.core import serializers
from django.views.decorators.csrf import csrf_ex... | mit |
matmutant/sl4a | python-build/python-libs/gdata/tests/gdata_test.py | 87 | 14634 | #!/usr/bin/python
#
# Copyright (C) 2006 Google 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 |
RafaelPalomar/girder | plugins/provenance/server/__init__.py | 3 | 1966 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
###############################################################################
# Copyright 2014 Kitware 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 cop... | apache-2.0 |
MackZxh/OCA-Choice | account-invoicing/account_invoice_rounding/__openerp__.py | 12 | 2100 | # -*- coding: utf-8 -*-
##############################################################################
#
# Author: Yannick Vaucher
# Copyright 2013 Camptocamp SA
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# pub... | lgpl-3.0 |
ctozlm/Dato-Core | src/unity/python/graphlab/data_structures/sframe.py | 13 | 196438 | """
This module defines the SFrame class which provides the
ability to create, access and manipulate a remote scalable dataframe object.
SFrame acts similarly to pandas.DataFrame, but the data is completely immutable
and is stored column wise on the GraphLab Server side.
"""
'''
Copyright (C) 2015 Dato, Inc.
All righ... | agpl-3.0 |
vrv/tensorflow | tensorflow/python/kernel_tests/distributions/categorical_test.py | 12 | 11556 | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | apache-2.0 |
revmischa/boto | boto/services/__init__.py | 782 | 1108 | # Copyright (c) 2006,2007 Mitch Garnaat http://garnaat.org/
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the rights to use, copy, modi... | mit |
marratj/ansible | lib/ansible/modules/windows/win_domain.py | 31 | 2009 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2017, 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 ... | gpl-3.0 |
clebergnu/avocado-vt | virttest/nfs.py | 2 | 18942 | """
Basic nfs support for Linux host. It can support the remote
nfs mount and the local nfs set up and mount.
"""
import re
import aexpect
import logging
from avocado.utils import path
from avocado.utils import process
from avocado.utils import distro
from avocado.utils.astring import to_text
from avocado.core import ... | gpl-2.0 |
jelugbo/tundex | common/lib/xmodule/xmodule/modulestore/tests/test_modulestore.py | 25 | 2199 | from nose.tools import assert_equals, assert_true, assert_false # pylint: disable=E0611
def check_has_course_method(modulestore, locator, locator_key_fields):
error_message = "Called has_course with query {0} and ignore_case is {1}."
for ignore_case in [True, False]:
# should find the course with e... | agpl-3.0 |
dmarcosgon/linux | tools/perf/scripts/python/sctop.py | 1996 | 2102 | # system call top
# (c) 2010, Tom Zanussi <tzanussi@gmail.com>
# Licensed under the terms of the GNU GPL License version 2
#
# Periodically displays system-wide system call totals, broken down by
# syscall. If a [comm] arg is specified, only syscalls called by
# [comm] are displayed. If an [interval] arg is specified,... | gpl-2.0 |
mtrbean/scipy | scipy/io/matlab/mio.py | 64 | 8782 | """
Module for reading and writing matlab (TM) .mat files
"""
# Authors: Travis Oliphant, Matthew Brett
from __future__ import division, print_function, absolute_import
import numpy as np
from scipy._lib.six import string_types
from .miobase import get_matfile_version, docfiller
from .mio4 import MatFile4Reader, Ma... | bsd-3-clause |
Bforartists/scons | scons-local/SCons/Scanner/Prog.py | 7 | 3233 | #
# Copyright (c) 2001 - 2014 The SCons Foundation
#
# 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, merge... | mit |
jonathanlurie/Tubular | lib/python/gooey/gui/widgets/components.py | 2 | 7463 |
from gooey.gui.widgets import widget_pack
__author__ = 'Chris'
import wx
from gooey.gui import styling
class BaseGuiComponent(object):
def __init__(self, data, widget_pack):
self.data = data
# parent
self.panel = None
# Widgets
self.title = None
self.help_msg = None
... | mit |
TeamTwisted/external_chromium_org | third_party/markdown/extensions/meta.py | 109 | 4514 | # markdown is released under the BSD license
# Copyright 2007, 2008 The Python Markdown Project (v. 1.7 and later)
# Copyright 2004, 2005, 2006 Yuri Takhteyev (v. 0.2-1.6b)
# Copyright 2004 Manfred Stienstra (the original version)
#
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or... | bsd-3-clause |
enigmamarketing/csf-allow-domains | usr/local/csf/bin/csf-allow-domains/dns/rdtypes/ANY/SSHFP.py | 44 | 3129 | # Copyright (C) 2005-2007, 2009-2011 Nominum, Inc.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose with or without fee is hereby granted,
# provided that the above copyright notice and this permission notice
# appear in all copies.
#
# THE SOFTWARE IS PROVIDED "... | mit |
alertedsnake/pycrust | pycrust/__init__.py | 1 | 5061 | """
Pycrust
A collection of CherryPy extensions
See also the following submodules:
pycrust.auth
pycrust.saplugin
pycrust.satool
pycrust.tools
"""
__author__ = 'Michael Stella <pycrust@thismetalsky.org>'
__version__ = '1.0.0'
import inspect, logging, os, sys
import cherrypy
import codecs
class Ba... | mit |
kmkolasinski/Quantulaba | plots/plot_lattice.py | 2 | 1492 | #!/usr/bin/python
import numpy as np
import matplotlib.pyplot as plt
import csv
from matplotlib.collections import LineCollection
file = "lattice.dat"
#ax = plt.gca(projection='3d')
pscale=1.0
lscale=10.0
fig, ax = plt. subplots()
ax.set_aspect('equal')
desired=[1,2]
with open(file, 'r') as fin:
reader=csv.reade... | mit |
onitake/ansible | test/units/modules/network/f5/test_bigip_firewall_rule.py | 21 | 4718 | # -*- coding: utf-8 -*-
#
# Copyright: (c) 2018, F5 Networks Inc.
# 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
import os
import json
import pytest
import sys
if sys.version_info < (2... | gpl-3.0 |
Sumith1896/sympy | sympy/physics/quantum/matrixcache.py | 124 | 3519 | """A cache for storing small matrices in multiple formats."""
from __future__ import print_function, division
from sympy import Matrix, I, Pow, Rational, exp, pi
from sympy.physics.quantum.matrixutils import (
to_sympy, to_numpy, to_scipy_sparse
)
class MatrixCache(object):
"""A cache for small matrices in... | bsd-3-clause |
WarrenWeckesser/numpy | numpy/distutils/msvccompiler.py | 17 | 1928 | import os
from distutils.msvccompiler import MSVCCompiler as _MSVCCompiler
from .system_info import platform_bits
def _merge(old, new):
"""Concatenate two environment paths avoiding repeats.
Here `old` is the environment string before the base class initialize
function is called and `new` is the string ... | bsd-3-clause |
Serag8/Bachelor | google_appengine/google/appengine/dist/py_imp.py | 6 | 3739 | #!/usr/bin/env python
#
# Copyright 2007 Google 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 o... | mit |
PauloSantos13/android | user_manual/conf.py | 2 | 9666 | # -*- coding: utf-8 -*-
#
# ownCloud Documentation documentation build configuration file, created by
# sphinx-quickstart on Mon Oct 22 23:16:40 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
# autogenerate... | gpl-2.0 |
ayseyo/oclapi | django-nonrel/ocl/oclapi/settings/common.py | 1 | 10523 | import os
from configurations import Configuration
BASE_DIR = os.path.dirname(os.path.dirname(__file__))
class Common(Configuration):
DEBUG = True
TEMPLATE_DEBUG = DEBUG
ADMINS = (
('Jon Payne', 'paynejd@gmail.com'),
('PK Shiu', 'pk@pkshiu.com'),
)
MANAGERS = ADMINS
DEFAULT... | mpl-2.0 |
xeddmc/PyBitmessage | src/bitmessageqt/connect.py | 19 | 2951 | # -*- coding: utf-8 -*-
# Form implementation generated from reading ui file 'connect.ui'
#
# Created: Wed Jul 24 12:42:01 2013
# by: PyQt4 UI code generator 4.10
#
# WARNING! All changes made in this file will be lost!
from PyQt4 import QtCore, QtGui
try:
_fromUtf8 = QtCore.QString.fromUtf8
except Attribut... | mit |
jbonofre/beam | sdks/python/apache_beam/runners/test/__init__.py | 25 | 1243 | #
# 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 |
stuart-knock/tvb-framework | tvb_test/adapters/visualizers/eegmonitor_test.py | 1 | 4412 | # -*- coding: utf-8 -*-
#
#
# TheVirtualBrain-Framework Package. This package holds all Data Management, and
# Web-UI helpful to run brain-simulations. To use it, you also need do download
# TheVirtualBrain-Scientific Package (for simulators). See content of the
# documentation-folder for more details. See also http:/... | gpl-2.0 |
sammerry/ansible | lib/ansible/plugins/lookup/dict.py | 84 | 1113 | # (c) 2014, Kent R. Spillner <kspillner@acm.org>
#
# 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 ve... | gpl-3.0 |
lshain-android-source/external-chromium_org-tools-grit | grit/test_suite_all.py | 8 | 6803 | #!/usr/bin/env python
# Copyright (c) 2011 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.
'''Unit test suite that collects all test cases for GRIT.'''
import os
import sys
if __name__ == '__main__':
sys.path.append(os.... | bsd-2-clause |
lilydjwg/you-get | src/you_get/extractors/netease.py | 1 | 9738 | #!/usr/bin/env python
from json import loads
import hashlib
import base64
import os
import binascii
try:
from Crypto.Cipher import AES
import xml.etree.ElementTree as ET
has_crypto = True
except ImportError:
has_crypto = False
from ..common import *
from ..extractor import VideoExtractor
from ..util ... | mit |
gregdek/ansible | test/units/modules/network/slxos/test_slxos_vlan.py | 30 | 4622 | #
# (c) 2018 Extreme Networks 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.
#
# Ans... | gpl-3.0 |
ar7z1/ansible | lib/ansible/modules/network/f5/bigip_iapplx_package.py | 9 | 11731 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright (c) 2017 F5 Networks Inc.
# 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 |
heeraj123/oh-mainline | vendor/packages/zope.interface/setup.py | 16 | 4974 | ##############################################################################
#
# Copyright (c) 2004-2007 Zope Foundation and Contributors.
# All Rights Reserved.
#
# This software is subject to the provisions of the Zope Public License,
# Version 2.1 (ZPL). A copy of the ZPL should accompany this distribution.
# THI... | agpl-3.0 |
p0psicles/SickRage | lib/feedparser/parsers/loose.py | 43 | 3425 | # The loose feed parser that interfaces with an SGML parsing library
# Copyright 2010-2015 Kurt McKee <contactme@kurtmckee.org>
# Copyright 2002-2008 Mark Pilgrim
# All rights reserved.
#
# This file is a part of feedparser.
#
# Redistribution and use in source and binary forms, with or without modification,
# are perm... | gpl-3.0 |
jnovinger/django | tests/lookup/tests.py | 153 | 37208 | from __future__ import unicode_literals
from datetime import datetime
from operator import attrgetter
from unittest import skipUnless
from django.core.exceptions import FieldError
from django.db import connection
from django.test import TestCase, TransactionTestCase, skipUnlessDBFeature
from .models import Article, ... | bsd-3-clause |
wemanuel/smry | server-auth/ls/google-cloud-sdk/lib/requests/packages/urllib3/contrib/ntlmpool.py | 1010 | 4507 | """
NTLM authenticating pool, contributed by erikcederstran
Issue #10, see: http://code.google.com/p/urllib3/issues/detail?id=10
"""
try:
from http.client import HTTPSConnection
except ImportError:
from httplib import HTTPSConnection
from logging import getLogger
from ntlm import ntlm
from urllib3 import HTT... | apache-2.0 |
jlaunonen/kirppu | kirppu/views/csv_utils.py | 1 | 1469 | # -*- coding: utf-8 -*-
import functools
import html
import io
from urllib.parse import quote
from django.conf import settings
from django.http import HttpResponse, StreamingHttpResponse
def strip_generator(fn):
@functools.wraps(fn)
def inner(output, event, generator=False):
if generator:
... | mit |
marziyeah/Medhacks_admin | full/node_modules/node-gyp/gyp/gyptest.py | 1752 | 8019 | #!/usr/bin/env python
# Copyright (c) 2012 Google Inc. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
__doc__ = """
gyptest.py -- test runner for GYP tests.
"""
import os
import optparse
import subprocess
import sys
class CommandRunner(obje... | mit |
doomsterinc/odoo | openerp/tests/common.py | 50 | 13675 | # -*- coding: utf-8 -*-
"""
The module :mod:`openerp.tests.common` provides unittest2 test cases and a few
helpers and classes to write tests.
"""
import errno
import glob
import json
import logging
import os
import select
import subprocess
import threading
import time
import itertools
import unittest2
import urllib2
... | agpl-3.0 |
cyc805/FTRerouting | .waf-1.7.11-edc6ccb516c5e3f9b892efc9f53a610f/waflib/Context.py | 70 | 8431 | #! /usr/bin/env python
# encoding: utf-8
# WARNING! Do not edit! http://waf.googlecode.com/git/docs/wafbook/single.html#_obtaining_the_waf_file
import os,imp,sys
from waflib import Utils,Errors,Logs
import waflib.Node
HEXVERSION=0x1070b00
WAFVERSION="1.7.11"
WAFREVISION="50f631bc5e00bdda966c68094229b99be9a21084"
ABI=9... | gpl-2.0 |
jsocol/django-authority | authority/templatetags/permissions.py | 6 | 15531 | from django import template
from django.core.urlresolvers import reverse
from django.core.exceptions import ImproperlyConfigured
from django.contrib.auth.models import User, AnonymousUser
from django.core.urlresolvers import reverse
from authority import get_check
from authority import permissions
from authority.model... | bsd-3-clause |
bossjones/scarlett | scarlett/listener/gstlistenerfsm.py | 1 | 17131 | # -*- coding: UTF-8 -*-
import scarlett
import pygst
pygst.require('0.10')
import gobject
gobject.threads_init()
import dbus
import dbus.service
# TODO: Figure out if we need this or not, re dbus threading
# from dbus.mainloop.glib import DBusGMainLoop
# dbus_loop = DBusGMainLoop(set_as_default=True)
# dsession = Se... | mit |
bsmr-ansible/ansible-modules-extras | windows/win_iis_webapppool.py | 153 | 3531 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# (c) 2015, Henrik Wallström <henrik@wallstroms.nu>
#
# 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 t... | gpl-3.0 |
sexmachine/msm | 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 |
jcftang/ansible | lib/ansible/modules/windows/win_template.py | 35 | 3126 | # this is a virtual module that is entirely implemented server side
# 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 op... | gpl-3.0 |
destijl/grr | grr/client/stdlib.py | 2 | 8367 | #!/usr/bin/env python
"""This file imports the Python std lib so it can be used by components."""
# pylint: disable=g-import-not-at-top, unused-import, using-constant-test
if False:
import BaseHTTPServer
import CGIHTTPServer
import ConfigParser
import Cookie
import DocXMLRPCServer
import HTMLParser
impo... | apache-2.0 |
walteryang47/ovirt-engine | packaging/setup/plugins/ovirt-engine-common/base/network/firewall_manager_iptables.py | 7 | 8581 | #
# ovirt-engine-setup -- ovirt engine setup
# Copyright (C) 2013-2015 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
#
# Unl... | apache-2.0 |
wbrp/dnsimple-zoneimport | setup.py | 1 | 1349 | # -*- coding: utf-8 -*-
from setuptools import setup, find_packages
from dnsimple_zoneimport import meta
f = open('requirements.txt', 'r')
lines = f.readlines()
requirements = [l.strip().strip('\n') for l in lines if l.strip() and not l.strip().startswith('#')]
readme = open('README.rst').read()
setup(name='dnsimple... | mit |
Antiun/stock-logistics-workflow | product_customer_code_picking/__init__.py | 25 | 1043 | # -*- coding: utf-8 -*-
##############################################################################
#
# Copyright (C) 2013 Agile Business Group sagl (<http://www.agilebg.com>)
# Author: Nicola Malcontenti <nicola.malcontenti@agilebg.com>
#
# This program is free software: you can redistribute it and/or modi... | agpl-3.0 |
flavour/cedarbluff | modules/eden/project.py | 1 | 132447 | # -*- coding: utf-8 -*-
""" Sahana Eden Project Model
@copyright: 2011-2012 (c) Sahana Software Foundation
@license: MIT
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 witho... | mit |
zenlambda/pip | tests/conftest.py | 36 | 6986 | import os
import shutil
import py
import pytest
from pip.utils import appdirs
from tests.lib import SRC_DIR, TestData
from tests.lib.path import Path
from tests.lib.scripttest import PipTestEnvironment
from tests.lib.venv import VirtualEnvironment
def pytest_collection_modifyitems(items):
for item in items:
... | mit |
anandology/pyjamas | pygtkweb/demos/010-radiobuttons.py | 7 | 2093 | #!/usr/bin/env python
# example radiobuttons.py
import pygtk
pygtk.require('2.0')
import gtk
class RadioButtons:
def callback(self, widget, data=None):
print "%s was toggled %s" % (data, ("OFF", "ON")[widget.get_active()])
def close_application(self, widget, event, data=None):
gtk.main_quit(... | apache-2.0 |
appsembler/edx-platform | common/test/acceptance/tests/lms/test_lms_course_discovery.py | 24 | 2206 | """
Test course discovery.
"""
import datetime
import json
import uuid
from common.test.acceptance.fixtures.course import CourseFixture
from common.test.acceptance.pages.common.auto_auth import AutoAuthPage
from common.test.acceptance.pages.common.logout import LogoutPage
from common.test.acceptance.pages.lms.discover... | agpl-3.0 |
Yen-Chung-En/2015cdb_g1 | static/Brython3.1.1-20150328-091302/Lib/_abcoll.py | 688 | 5155 | # Copyright 2007 Google, Inc. All Rights Reserved.
# Licensed to PSF under a Contributor Agreement.
"""Abstract Base Classes (ABCs) for collections, according to PEP 3119.
DON'T USE THIS MODULE DIRECTLY! The classes here should be imported
via collections; they are defined here only to alleviate certain
bootstrappin... | agpl-3.0 |
jangler/vcii | vcii/test/test_sheet.py | 1 | 2485 | import random
import unittest
from vcii.sheet import *
class TestSheet(unittest.TestCase):
def test_key_to_indices(self):
with self.assertRaises(ValueError):
indices_from_label('1A')
self.assertEqual(indices_from_label('A1'), (0, 0))
self.assertEqual(indices_from_label('zz99'... | mit |
eightyfourcoin/84 | share/qt/make_spinner.py | 4415 | 1035 | #!/usr/bin/env python
# W.J. van der Laan, 2011
# Make spinning .mng animation from a .png
# Requires imagemagick 6.7+
from __future__ import division
from os import path
from PIL import Image
from subprocess import Popen
SRC='img/reload_scaled.png'
DST='../../src/qt/res/movies/update_spinner.mng'
TMPDIR='/tmp'
TMPNAM... | mit |
sg00dwin/origin | vendor/github.com/google/certificate-transparency/python/ct/client/db/sqlite_temp_db.py | 35 | 6021 | import logging
import sqlite3
from ct.client.db import temp_db
from ct.client.db import database
from ct.client.db import sqlite_connection as sqlitecon
from ct.proto import client_pb2
class SQLiteTempDBFactory(object):
"""A database factory that manages mappings from public identifiers
(log names) to SQLite ... | apache-2.0 |
kikocorreoso/brython | www/src/Lib/encodings/cp864.py | 37 | 34353 | """ Python Character Mapping Codec generated from 'VENDORS/MICSFT/PC/CP864.TXT' with gencodec.py.
"""#"
import codecs
### Codec APIs
class Codec(codecs.Codec):
def encode(self,input,errors='strict'):
return codecs.charmap_encode(input,errors,encoding_map)
def decode(self,input,errors=... | bsd-3-clause |
thorwhalen/ut | ml/stream/sequences.py | 1 | 6137 |
from sklearn.base import BaseEstimator
from collections import Counter
import pandas as pd
from numpy import sum, nan, isnan
from ut.util.uiter import window
class NextElementPredictor(BaseEstimator):
def predict(self, seqs):
preds = self.predict_proba(seqs)
return [max(pred, key=lambda key: pr... | mit |
ShassAro/ShassAro | Bl_project/blVirtualEnv/lib/python2.7/site-packages/setuptools/tests/test_test.py | 124 | 3712 | # -*- coding: UTF-8 -*-
"""develop tests
"""
import os
import shutil
import site
import sys
import tempfile
import unittest
from distutils.errors import DistutilsError
from setuptools.compat import StringIO
from setuptools.command.test import test
from setuptools.command import easy_install as easy_install_pkg
from s... | gpl-2.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.