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 |
|---|---|---|---|---|---|
dch312/scipy | scipy/weave/build_tools.py | 97 | 26432 | """ Tools for compiling C/C++ code to extension modules
The main function, build_extension(), takes the C/C++ file
along with some other options and builds a Python extension.
It uses distutils for most of the heavy lifting.
choose_compiler() is also useful (mainly on windows anyway)
for trying to... | bsd-3-clause |
balint256/gnuradio | grc/base/Connection.py | 7 | 4387 | """
Copyright 2008-2011 Free Software Foundation, Inc.
This file is part of GNU Radio
GNU Radio Companion 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 l... | gpl-3.0 |
chidea/GoPythonDLLWrapper | bin/lib/ctypes/test/test_buffers.py | 97 | 2284 | from ctypes import *
from ctypes.test import need_symbol
import unittest
class StringBufferTestCase(unittest.TestCase):
def test_buffer(self):
b = create_string_buffer(32)
self.assertEqual(len(b), 32)
self.assertEqual(sizeof(b), 32 * sizeof(c_char))
self.assertIs(type(b[0]), bytes)... | mit |
pabloborrego93/edx-platform | common/djangoapps/student/tests/test_configuration_overrides.py | 22 | 3985 | """
Test for user creation from sites with configuration overrides.
"""
from django.test import TestCase
from student.models import UserSignupSource
import mock
import json
from django.core.urlresolvers import reverse
from django.contrib.auth.models import User
FAKE_SITE = {
"SITE_NAME": "openedx.localhost",
"... | agpl-3.0 |
stefanklug/mapnik | scons/scons-local-2.3.6/SCons/__init__.py | 4 | 1636 | """SCons
The main package for the SCons software construction utility.
"""
#
# Copyright (c) 2001 - 2015 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 rest... | lgpl-2.1 |
FlaPer87/django-nonrel | django/contrib/gis/geos/prototypes/topology.py | 311 | 2226 | """
This module houses the GEOS ctypes prototype functions for the
topological operations on geometries.
"""
__all__ = ['geos_boundary', 'geos_buffer', 'geos_centroid', 'geos_convexhull',
'geos_difference', 'geos_envelope', 'geos_intersection',
'geos_linemerge', 'geos_pointonsurface', 'geos_pre... | bsd-3-clause |
doublehou/micolog | app/trackback.py | 2 | 3394 | """tblib.py: A Trackback (client) implementation in Python
"""
__author__ = "Matt Croydon <matt@ooiio.com>"
__copyright__ = "Copyright 2003, Matt Croydon"
__license__ = "GPL"
__version__ = "0.1.0"
__history__ = """
0.1.0: 1/29/03 - Code cleanup, release. It can send pings, and autodiscover a URL to ping.
0.0.9... | mit |
sgraham/nope | tools/cr/cr/targets/target.py | 58 | 4662 | # 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.
"""Module to hold the Target plugin."""
import operator
import re
import cr
import cr.base.context
DEFAULT = cr.Config.From(
CR_DEFAULT_TARGET='chrome'... | bsd-3-clause |
jch1/models | autoencoder/autoencoder_models/VariationalAutoencoder.py | 17 | 3068 | import tensorflow as tf
class VariationalAutoencoder(object):
def __init__(self, n_input, n_hidden, optimizer = tf.train.AdamOptimizer()):
self.n_input = n_input
self.n_hidden = n_hidden
network_weights = self._initialize_weights()
self.weights = network_weights
# model
... | apache-2.0 |
bunnyinc/django-oidc-provider | oidc_provider/models.py | 1 | 6596 | # -*- coding: utf-8 -*-
import base64
import binascii
from hashlib import md5, sha256
import json
from django.db import models
from django.utils import timezone
from django.utils.translation import ugettext_lazy as _
from django.conf import settings
CLIENT_TYPE_CHOICES = [
('confidential', 'Confidential'),
(... | mit |
glemaitre/protoclass | protoclass/tool/dicom_manip.py | 1 | 14985 | #title :dicom_manip.py
#description :This will create a header for a python script.
#author :Guillaume Lemaitre
#date :2015/04/20
#version :0.1
#notes :
#python_version :2.7.6
#==============================================================================
# Import... | gpl-2.0 |
andburn/python-unitypack | unitypack/environment.py | 1 | 2335 | import os
from urllib.parse import urlparse
from .asset import Asset
from .assetbundle import AssetBundle
class UnityEnvironment:
def __init__(self, base_path=""):
self.bundles = {}
self.assets = {}
self.base_path = base_path
self.files = []
def __del__(self):
for f in self.files:
f.close()
def __re... | mit |
victor-prado/broker-manager | environment/lib/python3.5/site-packages/numpy/core/setup_common.py | 20 | 15020 | from __future__ import division, absolute_import, print_function
# Code common to build tools
import sys
import warnings
import copy
import binascii
from numpy.distutils.misc_util import mingw32
#-------------------
# Versioning support
#-------------------
# How to change C_API_VERSION ?
# - increase C_API_VERSI... | mit |
google/fedjax | fedjax/legacy/datasets/toy_regression_test.py | 1 | 1381 | # Copyright 2020 Google LLC
#
# 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 |
portnov/sverchok | node_scripts/templates/nikitron/devider.py | 4 | 1772 | from sverchok.data_structure import (Vector_generate, Vector_degenerate,
Matrix_generate, Matrix_listing)
#from mathutils import geometry as G
def sv_main(verts=[], polygons=[], matrix=[], ver=3, hor=3):
in_sockets = [
['v', 'verts', verts],
['s', 'polygons', po... | gpl-3.0 |
mith1979/ansible_automation | applied_python/applied_python/lib/python2.7/site-packages/pylint/test/functional/arguments_differ.py | 2 | 2331 | """Test that we are emitting arguments-differ when the arguments are different."""
# pylint: disable=missing-docstring, too-few-public-methods
class Parent(object):
def test(self):
pass
class Child(Parent):
def test(self, arg): # [arguments-differ]
pass
class ParentDefaults... | apache-2.0 |
proxysh/Safejumper-for-Mac | buildmac/Resources/env/lib/python2.7/site-packages/twisted/python/context.py | 14 | 4024 | # -*- test-case-name: twisted.test.test_context -*-
# Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Dynamic pseudo-scoping for Python.
Call functions with context.call({key: value}, func); func and
functions that it calls will be able to use 'context.get(key)' to
retrieve 'value'.
This is... | gpl-2.0 |
LuminateWireless/bazel | tools/build_defs/pkg/make_deb.py | 12 | 10777 | # Copyright 2015 The Bazel 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 la... | apache-2.0 |
stverhae/incubator-airflow | tests/contrib/hooks/test_aws_hook.py | 42 | 1444 | # -*- coding: utf-8 -*-
#
# 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 |
jrbl/invenio | modules/webjournal/lib/elements/bfe_webjournal_main_navigation.py | 6 | 3870 | # -*- coding: utf-8 -*-
## $Id: bfe_webjournal_CERNBulletinMainNavigation.py,v 1.10 2008/06/03 09:52:11 jerome Exp $
##
## This file is part of Invenio.
## Copyright (C) 2009, 2010, 2011 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License a... | gpl-2.0 |
mortada/pelican-plugins | liquid_tags/video.py | 296 | 2360 | """
Video Tag
---------
This implements a Liquid-style video tag for Pelican,
based on the octopress video tag [1]_
Syntax
------
{% video url/to/video [width height] [url/to/poster] %}
Example
-------
{% video http://site.com/video.mp4 720 480 http://site.com/poster-frame.jpg %}
Output
------
<video width='720' hei... | agpl-3.0 |
AOKP/external_chromium_org | tools/ipc_messages_log.py | 170 | 4695 | #!/usr/bin/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.
""""Processes a log file and resolves IPC message identifiers.
Resolves IPC messages of the form [unknown type NNNNNN] to named IPC me... | bsd-3-clause |
phev8/ward-metrics | wardmetrics/visualisations.py | 1 | 16641 | import matplotlib.pyplot as plt
def plot_events_with_segment_scores(segment_results, ground_truth_events, detected_events, use_datetime_x=False, show=True):
"""
Test
:param segment_results:
:param ground_truth_events:
:param detected_events:
:param use_datetime_x:
:param show:
:return:... | mit |
wakatime/wakatime-unity | Editor/WakaTime/client/wakatime/packages/pygments_py3/pygments/styles/bw.py | 127 | 1355 | # -*- coding: utf-8 -*-
"""
pygments.styles.bw
~~~~~~~~~~~~~~~~~~
Simple black/white only style.
:copyright: Copyright 2006-2014 by the Pygments team, see AUTHORS.
:license: BSD, see LICENSE for details.
"""
from pygments.style import Style
from pygments.token import Keyword, Name, Comment, Strin... | cc0-1.0 |
pridemusvaire/youtube-dl | youtube_dl/extractor/clipsyndicate.py | 41 | 1731 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
find_xpath_attr,
fix_xml_ampersands
)
class ClipsyndicateIE(InfoExtractor):
_VALID_URL = r'http://www\.clipsyndicate\.com/video/play(list/\d+)?/(?P<id>\d+)'
_TEST = {
'url': 'http://www... | unlicense |
samba-team/samba | python/samba/tdb_util.py | 2 | 1481 | # Unix SMB/CIFS implementation.
# tdb util helpers
#
# Copyright (C) Kai Blin <kai@samba.org> 2011
# Copyright (C) Amitay Isaacs <amitay@gmail.com> 2011
# Copyright (C) Andrew Bartlett <abartlet@samba.org> 2013
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU Gene... | gpl-3.0 |
msimacek/koschei | koschei/backend/depsolve.py | 1 | 5237 | # Copyright (C) 2014-2016 Red Hat, 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 2 of the License, or
# (at your option) any later version.
#
# This program is distribut... | gpl-2.0 |
cloud9ers/gurumate | environment/share/doc/ipython/examples/parallel/options/mcpricer.py | 2 | 3552 | # <nbformat>2</nbformat>
# <markdowncell>
# # Parallel Monto-Carlo options pricing
# <markdowncell>
# ## Problem setup
# <codecell>
from __future__ import print_function
import sys
import time
from IPython.parallel import Client
import numpy as np
from mckernel import price_options
from matplotlib import pyplot a... | lgpl-3.0 |
40223134/w16b_test | static/Brython3.1.1-20150328-091302/Lib/logging/__init__.py | 733 | 66279 | # Copyright 2001-2013 by Vinay Sajip. All Rights Reserved.
#
# Permission to use, copy, modify, and distribute this software and its
# documentation for any purpose and without fee is hereby granted,
# provided that the above copyright notice appear in all copies and that
# both that copyright notice and this permissio... | agpl-3.0 |
pselle/calibre | src/calibre/ebooks/mobi/writer8/tbs.py | 14 | 8027 | #!/usr/bin/env python2
# vim:fileencoding=UTF-8:ts=4:sw=4:sta:et:sts=4:ai
from __future__ import (unicode_literals, division, absolute_import,
print_function)
__license__ = 'GPL v3'
__copyright__ = '2012, Kovid Goyal <kovid@kovidgoyal.net>'
__docformat__ = 'restructuredtext en'
DOC = '''
Tra... | gpl-3.0 |
ciarams87/PyU4V | docs/source/programmers_guide_src/code/performance-registration.py | 2 | 1563 | # Copyright (c) 2020 Dell Inc. or its subsidiaries.
#
# 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... | mit |
Vassy/odoo | addons/website_blog/wizard/document_page_show_diff.py | 372 | 2184 | # -*- 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 |
nan86150/ImageFusion | lib/python2.7/site-packages/numpy/core/_methods.py | 55 | 4309 | """
Array methods which are called by both the C-code for the method
and the Python code for the NumPy-namespace function
"""
from __future__ import division, absolute_import, print_function
import warnings
from numpy.core import multiarray as mu
from numpy.core import umath as um
from numpy.core.numeric import asan... | mit |
BlackPole/bp-enigma2 | lib/python/Screens/Satconfig.py | 6 | 28188 | from enigma import eDVBDB
from Screen import Screen
from Components.SystemInfo import SystemInfo
from Components.ActionMap import ActionMap
from Components.ConfigList import ConfigListScreen
from Components.MenuList import MenuList
from Components.NimManager import nimmanager
from Components.config import getConfigList... | gpl-2.0 |
rbrito/pkg-youtube-dl | youtube_dl/extractor/zingmp3.py | 61 | 4825 | # coding: utf-8
from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import (
ExtractorError,
int_or_none,
update_url_query,
)
class ZingMp3BaseInfoExtractor(InfoExtractor):
def _extract_item(self, item, page_type, fatal=True):
error_message = ite... | unlicense |
SCOAP3/scoap3 | bibcheck_plugins/iop_issn.py | 2 | 1901 | # -*- coding: utf-8 -*-
##
## This file is part of Invenio.
## Copyright (C) 2013 CERN.
##
## Invenio is free software; you can redistribute it and/or
## modify it under the terms of the GNU General Public License as
## published by the Free Software Foundation; either version 2 of the
## License, or (at your option) a... | gpl-2.0 |
simongoffin/my_odoo_tutorial | addons/gamification/models/res_users.py | 386 | 4010 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2013 OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the ... | agpl-3.0 |
teamfx/openjfx-10-dev-rt | modules/javafx.web/src/main/native/Tools/Scripts/webkitpy/w3c/test_converter.py | 2 | 11397 | #!/usr/bin/env python
# Copyright (C) 2013 Adobe Systems Incorporated. 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 n... | gpl-2.0 |
austin1howard/txt2tags | test/crossing/run.py | 4 | 2885 | #
# txt2tags crossing marks tester (http://txt2tags.org)
# See also: ../run.py ../lib.py
#
import os, sys, glob
sys.path.insert(0, '..')
import lib
del sys.path[0]
# sux
lib.OK = lib.FAILED = 0
lib.ERROR_FILES = []
# left files are generated from right ones (using smart filters)
ALIASES = {
'numlist' : 'list',
... | gpl-2.0 |
apportable/gdb | gdb/python/lib/gdb/command/explore.py | 84 | 26719 | # GDB 'explore' command.
# Copyright (C) 2012 Free Software Foundation, Inc.
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later ver... | gpl-2.0 |
gnu3ra/SCC15HPCRepast | INSTALLATION/boost_1_54_0/libs/python/pyste/dist/create_build.py | 54 | 1668 | # Copyright Bruno da Silva de Oliveira 2006. Distributed under the Boost
# Software License, Version 1.0. (See accompanying
# file LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt)
import os
import sys
import shutil
import fnmatch
from zipfile import ZipFile, ZIP_DEFLATED
def findfiles(directory, mask)... | bsd-3-clause |
dagnello/ansible-modules-core | cloud/amazon/ec2_asg.py | 1 | 33907 | #!/usr/bin/python
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is distributed... | gpl-3.0 |
bruderstein/PythonScript | PythonLib/full/gzip.py | 2 | 21772 | """Functions that read and write gzipped files.
The user of the file doesn't have to worry about the compression,
but random access is not allowed."""
# based on Andrew Kuchling's minigzip.py distributed with the zlib module
import struct, sys, time, os
import zlib
import builtins
import io
import _compression
__al... | gpl-2.0 |
chippey/gaffer | python/GafferUI/PathWidget.py | 1 | 7446 | ##########################################################################
#
# Copyright (c) 2011, John Haddon. All rights reserved.
# 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 ... | bsd-3-clause |
mricon/totp-cgi | test.py | 1 | 28974 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
##
# Copyright (C) 2012 by Konstantin Ryabitsev and contributors
#
# 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... | gpl-2.0 |
calfonso/ansible | lib/ansible/plugins/lookup/shelvefile.py | 38 | 2833 | # (c) 2015, Alejandro Guirao <lekumberri@gmail.com>
# (c) 2012-17 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
DOCUMENTATION = """
lookup: shelvefile
author: A... | gpl-3.0 |
barraponto/scrapy | scrapy/dupefilters.py | 116 | 2209 | from __future__ import print_function
import os
import logging
from scrapy.utils.job import job_dir
from scrapy.utils.request import request_fingerprint
class BaseDupeFilter(object):
@classmethod
def from_settings(cls, settings):
return cls()
def request_seen(self, request):
return Fals... | bsd-3-clause |
mgit-at/ansible | lib/ansible/modules/network/aos/_aos_blueprint_virtnet.py | 55 | 7631 | #!/usr/bin/python
#
# (c) 2017 Apstra Inc, <community@apstra.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 opt... | gpl-3.0 |
krmahadevan/selenium | py/selenium/webdriver/common/proxy.py | 35 | 10311 | # Licensed to the Software Freedom Conservancy (SFC) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The SFC licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not... | apache-2.0 |
ntt-sic/nova | nova/tests/virt/libvirt/test_libvirt.py | 1 | 303692 | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# Copyright 2010 OpenStack Foundation
# Copyright 2012 University Of Minho
#
# 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
#
# ... | apache-2.0 |
maurofaccenda/ansible | lib/ansible/modules/network/junos/junos_netconf.py | 28 | 5991 | #!/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 |
klonage/nlt-gcs | Lib/site-packages/numpy/core/tests/test_unicode.py | 58 | 11858 | import sys
from numpy.testing import *
from numpy.core import *
from numpy.compat import asbytes
# Guess the UCS length for this python interpreter
if sys.version_info[0] >= 3:
import array as _array
ucs4 = (_array.array('u').itemsize == 4)
def buffer_length(arr):
if isinstance(arr, unicode):
... | gpl-3.0 |
shubhdev/edxOnBaadal | cms/envs/acceptance.py | 32 | 4127 | """
This config file extends the test environment configuration
so that we can run the lettuce acceptance tests.
"""
# We intentionally define lots of variables that aren't used, and
# want to import all variables from base settings files
# pylint: disable=wildcard-import, unused-wildcard-import
from .test import *
f... | agpl-3.0 |
IBMDecisionOptimization/docplex-examples | examples/cp/visu/rcpsp_multi_mode_json.py | 1 | 5287 | # --------------------------------------------------------------------------
# Source file provided under Apache License, Version 2.0, January 2004,
# http://www.apache.org/licenses/
# (c) Copyright IBM Corp. 2015, 2016
# --------------------------------------------------------------------------
"""
This example is th... | apache-2.0 |
huangshiyou/z3 | src/api/python/z3util.py | 15 | 10120 | """
Usage:
import common_z3 as CM_Z3
"""
import common as CM
from z3 import *
def get_z3_version(as_str=False):
major = ctypes.c_uint(0)
minor = ctypes.c_uint(0)
build = ctypes.c_uint(0)
rev = ctypes.c_uint(0)
Z3_get_version(major,minor,build,rev)
rs = map(int,(major.value,minor.value,buil... | mit |
Andrey-Pavlov/phantomjs | src/qt/qtwebkit/Tools/Scripts/webkitpy/common/checkout/commitinfo.py | 118 | 4062 | # Copyright (c) 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 of conditions and the ... | bsd-3-clause |
lawrence-pressinnov/mongo-connector | mongo-connector/mongo_connector.py | 3 | 20201 | # Copyright 2012 10gen, 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, softw... | apache-2.0 |
MCLConsortium/mcl-site | support/upgradeMCL.py | 1 | 1894 | #!/usr/bin/env python
# encoding: utf-8
# Copyright 2020 California Institute of Technology. ALL RIGHTS
# RESERVED. U.S. Government Sponsorship acknowledged.
import sys, logging, transaction
from Products.CMFPlone.utils import get_installer
_products = [
# 'edrnsite.portlets',
# 'edrn.theme',
# 'eke.know... | apache-2.0 |
xxshutong/openerp-7.0 | openerp/modules/db.py | 442 | 6037 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2009 Tiny SPRL (<http://tiny.be>).
# Copyright (C) 2010-2012 OpenERP s.a. (<http://openerp.com>).
#
# This program is free software: you ca... | agpl-3.0 |
lukacu/django-gallery | gallery/admin.py | 1 | 3677 | #!/usr/bin/python
# -*- Mode: python; indent-tabs-mode: nil; c-basic-offset: 2; tab-width: 2 -*-
from django.conf import settings
from django.contrib.admin.util import unquote
from django.core.urlresolvers import reverse
from django.http import HttpResponseRedirect
from django.shortcuts import get_object_or_404... | bsd-3-clause |
vongochung/buiquocviet | django/contrib/gis/geos/prototypes/io.py | 92 | 8468 | import threading
from ctypes import byref, c_char_p, c_int, c_char, c_size_t, Structure, POINTER
from django.contrib.gis.geos.base import GEOSBase
from django.contrib.gis.geos.libgeos import GEOM_PTR
from django.contrib.gis.geos.prototypes.errcheck import check_geom, check_string, check_sized_string
from django.contrib... | bsd-3-clause |
javachengwc/hue | desktop/libs/liboozie/setup.py | 31 | 1293 | # 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 may not use this file ex... | apache-2.0 |
systemd/linux | tools/perf/scripts/python/event_analyzing_sample.py | 4719 | 7393 | # event_analyzing_sample.py: general event handler in python
#
# Current perf report is already very powerful with the annotation integrated,
# and this script is not trying to be as powerful as perf report, but
# providing end user/developer a flexible way to analyze the events other
# than trace points.
#
# The 2 dat... | gpl-2.0 |
abdoosh00/edx-rtl-final | i18n/tests/test_extract.py | 17 | 3130 | import os
import polib
from unittest import TestCase
from nose.plugins.skip import SkipTest
from datetime import datetime, timedelta
from pytz import UTC
import extract
from config import CONFIGURATION
# Make sure setup runs only once
SETUP_HAS_RUN = False
class TestExtract(TestCase):
"""
Tests functionalit... | agpl-3.0 |
marcoantoniooliveira/labweb | oscar/lib/python2.7/site-packages/django/contrib/gis/db/backends/spatialite/models.py | 222 | 1934 | """
The GeometryColumns and SpatialRefSys models for the SpatiaLite backend.
"""
from django.db import models
from django.contrib.gis.db.backends.base import SpatialRefSysMixin
from django.utils.encoding import python_2_unicode_compatible
@python_2_unicode_compatible
class GeometryColumns(models.Model):
"""
T... | bsd-3-clause |
devanlai/mbed | workspace_tools/synch.py | 17 | 11521 | """
mbed SDK
Copyright (c) 2011-2013 ARM Limited
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 wr... | apache-2.0 |
fevxie/odoo-infrastructure | infrastructure/wizard/infrastructure_database_drop_wizard.py | 3 | 1458 | # -*- coding: utf-8 -*-
##############################################################################
# For copyright and license notices, see __openerp__.py file in module root
# directory
##############################################################################
from openerp import fields, api, _, models
from o... | agpl-3.0 |
StackPointCloud/libcloud | libcloud/test/dns/test_base.py | 58 | 4296 | # 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 |
0be1/ansible | v2/test/parsing/vault/test_vault.py | 29 | 5653 | # (c) 2012-2014, Michael DeHaan <michael.dehaan@gmail.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) an... | gpl-3.0 |
mclaughlin6464/pylearn2 | pylearn2/models/dbm/__init__.py | 43 | 9023 | """
This module contains functionality related to deep Boltzmann machines.
They are implemented generically in order to make it easy to support
convolution versions, etc.
This code was moved piece by piece incrementally over time from Ian's
private research repository, and it is altogether possible that he
broke somet... | bsd-3-clause |
boosh/pwlocker | pwlocker/fabfile/__init__.py | 2 | 5892 | import os.path
from datetime import datetime
from fabric.api import env, hosts
from fabric.context_managers import settings
from fabric.decorators import task
from fabric.operations import local
from lib import *
# This script provides tasks to build a new development environment or
# deploy to production. It is sim... | mit |
proxysh/Safejumper-for-Mac | buildlinux/env64/lib/python2.7/site-packages/twisted/internet/test/test_win32events.py | 13 | 6500 | # Copyright (c) Twisted Matrix Laboratories.
# See LICENSE for details.
"""
Tests for implementations of L{IReactorWin32Events}.
"""
try:
import win32event
except ImportError:
win32event = None
from zope.interface.verify import verifyObject
from twisted.python.failure import Failure
from twisted.python.thre... | gpl-2.0 |
HelloMeow/googlemock | test/gmock_test_utils.py | 769 | 3684 | #!/usr/bin/env python
#
# Copyright 2006, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
chafique-delli/OpenUpgrade | addons/crm_claim/crm_claim.py | 32 | 9985 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-today OpenERP SA (<http://www.openerp.com>)
#
# This program is free software: you can redistribute it and/or modify
# it under the terms o... | agpl-3.0 |
sorenk/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 |
TeamSPR/kernel | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
BIDS-collaborative/destress | parsed_lj.py | 2 | 1468 | #!/usr/bin/env python
'''Classes to Parse LiveJournal XML feed'''
from lxml import etree, html
class ParsedPost:
'''Helper class used by ParsedLJ below'''
def __init__(self, xml_post):
self.xml = xml_post
# `u0,` is a trick to unpack an exactly 1-item list
# We'll get an error if the... | isc |
pachcool4/damnvid | socks/__init__.py | 54 | 13785 | """SocksiPy - Python SOCKS module.
Version 1.00
Copyright 2006 Dan-Haim. 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, ... | gpl-3.0 |
akash1808/nova_test_latest | nova/api/openstack/compute/contrib/hosts.py | 48 | 14023 | # 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 |
FrankBian/kuma | vendor/packages/sqlalchemy/test/orm/inheritance/test_polymorph.py | 7 | 13368 | """tests basic polymorphic mapper loading/saving, minimal relationships"""
from sqlalchemy.test.testing import eq_, assert_raises, assert_raises_message
from sqlalchemy import *
from sqlalchemy.orm import *
from sqlalchemy.orm import exc as orm_exc
from sqlalchemy.test import Column, testing
from sqlalchemy.util impor... | mpl-2.0 |
caspartse/QQ-Groups-Spider | vendor/urllib3/contrib/socks.py | 218 | 6195 | # -*- coding: utf-8 -*-
"""
This module contains provisional support for SOCKS proxies from within
urllib3. This module supports SOCKS4 (specifically the SOCKS4A variant) and
SOCKS5. To enable its functionality, either install PySocks or install this
module with the ``socks`` extra.
The SOCKS implementation supports t... | mit |
KonstaT/android_kernel_zte_msm7x27a | tools/perf/scripts/python/failed-syscalls-by-pid.py | 11180 | 2058 | # failed 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 failed system call totals, broken down by pid.
# If a [comm] arg is specified, only syscalls called by [comm] are displayed.
import os
import sys
sys.pa... | gpl-2.0 |
erigones/erigones-sddc-api | esdc_api/client.py | 1 | 5663 | # -*- coding: utf-8 -*-
"""
esdc_api.client
~~~~~~~~~~~~~~~
This module contains the Danube Cloud API :class:`Client` class used to access the Danube Cloud HTTP API.
"""
import json
import requests
from . import __version__
from .response import Response
__all__ = (
'Client',
)
class Client(object):
"""
... | bsd-3-clause |
kennedyshead/home-assistant | homeassistant/components/auth/login_flow.py | 1 | 8731 | """HTTP views handle login flow.
# GET /auth/providers
Return a list of auth providers. Example:
[
{
"name": "Local",
"id": null,
"type": "local_provider",
}
]
# POST /auth/login_flow
Create a login flow. Will return the first step of the flow.
Pass in parameter 'client_id' and 'r... | apache-2.0 |
aschn/goodtechgigs | goodtechgigs/gigs/migrations/0001_initial.py | 1 | 1492 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
import django.utils.timezone
import model_utils.fields
import taggit.managers
class Migration(migrations.Migration):
dependencies = [
('profiles', '0004_auto_20150305_2200'),
('tags', '0002_a... | apache-2.0 |
jcpowermac/ansible | lib/ansible/modules/cloud/openstack/os_nova_flavor.py | 15 | 7947 | #!/usr/bin/python
# Copyright (c) 2015 Hewlett-Packard Development Company, L.P.
# 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 |
xme1226/horizon | openstack_dashboard/dashboards/project/data_processing/job_executions/tests.py | 3 | 1838 | # 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
# distributed under t... | apache-2.0 |
WellDone/pymomo | pymomo/sim/simulators/simworker.py | 2 | 2377 | #simworker.py
#Base class for worker objects that implement PIC simulators
from pymomo.exceptions import *
import time
import select
class SimWorker:
def __init__(self, pipe):
self.pipe = pipe
self._build_sim()
def _build_sim(self):
raise APIError("SimWorker subclasses must override _build_sim()")
def _buil... | lgpl-3.0 |
mattilyra/scikit-learn | examples/linear_model/plot_logistic.py | 312 | 1426 | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
=========================================================
Logit function
=========================================================
Show in the plot is how the logistic regression would, in this
synthetic dataset, classify values as either 0 or 1,
i.e. class one or two, u... | bsd-3-clause |
indictranstech/tele-frappe | frappe/tests/test_translation.py | 56 | 2242 | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals
import frappe, unittest, os
import frappe.translate
# class TestTranslations(unittest.TestCase):
# def test_doctype(self, messages=None):
# if not messages:
# messages = fr... | mit |
cactusbin/nyt | matplotlib/lib/matplotlib/tests/test_text.py | 2 | 6893 | from __future__ import print_function
import numpy as np
import matplotlib
from matplotlib.testing.decorators import image_comparison, knownfailureif, cleanup
import matplotlib.pyplot as plt
import warnings
from nose.tools import with_setup
@image_comparison(baseline_images=['font_styles'])
def test_font_styles():
... | unlicense |
FRC-Team-3140/north-american-happiness | lib/python2.7/site-packages/sqlalchemy/testing/fixtures.py | 3 | 10235 | # testing/fixtures.py
# Copyright (C) 2005-2014 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 . import config
from . import assertions, schema
from .util import adict
from... | mit |
saquiba2/numpy2 | numpy/f2py/tests/test_return_integer.py | 145 | 4689 | from __future__ import division, absolute_import, print_function
from numpy import array
from numpy.compat import long
from numpy.testing import run_module_suite, assert_, assert_raises, dec
import util
class TestReturnInteger(util.F2PyTest):
def check_function(self, t):
assert_(t(123) == 123, repr(t(12... | bsd-3-clause |
NikNitro/Python-iBeacon-Scan | sympy/tensor/tests/test_tensor.py | 13 | 62449 | from sympy import Matrix, eye
from sympy.combinatorics import Permutation
from sympy.core import S, Rational, Symbol, Basic
from sympy.core.containers import Tuple
from sympy.core.symbol import symbols
from sympy.external import import_module
from sympy.functions.elementary.miscellaneous import sqrt
from sympy.printing... | gpl-3.0 |
arokem/nipype | nipype/interfaces/freesurfer/model.py | 9 | 41970 | # emacs: -*- mode: python; py-indent-offset: 4; indent-tabs-mode: nil -*-
# vi: set ft=python sts=4 ts=4 sw=4 et:
"""The freesurfer module provides basic functions for interfacing with
freesurfer tools.
Change directory to provide relative paths for doctests
>>> import os
>>> filepath = os.path.dirname( os... | bsd-3-clause |
rec/echomesh | code/python/echomesh/base/Path.py | 1 | 4125 | from __future__ import absolute_import, division, print_function, unicode_literals
from echomesh.base import MakeEmptyProject
from echomesh.base import Platform
import getpass
import os
import os.path
import sys
# If ECHOMESH_EXTERNALS_OVERRIDE_SYSTEM_PACKAGES is True, you want Echomesh to
# use its own external pac... | mit |
bfrohs/servo | components/script/dom/bindings/codegen/CodegenRust.py | 3 | 208334 | # This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
# Common codegen classes.
import operator
import os
import re
import string
from WebIDL import (
BuiltinTypes,
... | mpl-2.0 |
gmork2/django-soap-connector | soap_connector/tests/api/test_root.py | 1 | 1369 | from urllib.parse import urlparse, ParseResult
from django.test import TestCase
from django.urls import resolve, ResolverMatch
from rest_framework.reverse import reverse
from soap_connector.api.base import URL_NAMES
class RootViewTestCase(TestCase):
"""
"""
def setUp(self):
"""
:return... | gpl-3.0 |
shingetsu/saku-ex | Cheetah/SourceReader.py | 16 | 7978 | """SourceReader class for Cheetah's Parser and CodeGenerator
"""
import re
import sys
EOLre = re.compile(r'[ \f\t]*(?:\r\n|\r|\n)')
EOLZre = re.compile(r'(?:\r\n|\r|\n|\Z)')
ENCODINGsearch = re.compile("coding[=:]\s*([-\w.]+)").search
class Error(Exception):
pass
class SourceReade... | bsd-2-clause |
wpoa/wiki-imports | lib/python2.7/site-packages/pip/_vendor/requests/__init__.py | 209 | 1856 | # -*- coding: utf-8 -*-
# __
# /__) _ _ _ _ _/ _
# / ( (- (/ (/ (- _) / _)
# /
"""
requests HTTP library
~~~~~~~~~~~~~~~~~~~~~
Requests is an HTTP library, written in Python, for human beings. Basic GET
usage:
>>> import requests
>>> r = requests.get('http://python.org')
>>> r.sta... | gpl-3.0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.