repo_name stringlengths 5 100 | path stringlengths 4 375 | copies stringclasses 991
values | size stringlengths 4 7 | content stringlengths 666 1M | license stringclasses 15
values |
|---|---|---|---|---|---|
lokirius/python-for-android | python-build/python-libs/gdata/src/gdata/tlslite/integration/HTTPTLSConnection.py | 271 | 6668 | """TLS Lite + httplib."""
import socket
import httplib
from gdata.tlslite.TLSConnection import TLSConnection
from gdata.tlslite.integration.ClientHelper import ClientHelper
class HTTPBaseTLSConnection(httplib.HTTPConnection):
"""This abstract class provides a framework for adding TLS support
to httplib."""
... | apache-2.0 |
javierTerry/odoo | addons/stock/report/product_stock.py | 376 | 4868 | # -*- 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 |
galaxy001/shadowsocks | shadowsocks/udprelay.py | 7 | 10858 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# Copyright 2015 clowwindy
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required b... | apache-2.0 |
metacoin/florincoin | contrib/macdeploy/custom_dsstore.py | 6 | 3775 | #!/usr/bin/env python
# Copyright (c) 2013-2015 The Bitcoin Core developers
# Distributed under the MIT software license, see the accompanying
# file COPYING or http://www.opensource.org/licenses/mit-license.php.
from __future__ import division,print_function,unicode_literals
import biplist
from ds_store import DSStore... | mit |
openstack/ceilometer | ceilometer/network/statistics/opencontrail/driver.py | 1 | 6946 | # Copyright (C) 2014 eNovance SAS <licensing@enovance.com>
#
# 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 applicabl... | apache-2.0 |
rackerlabs/rackspace-python-neutronclient | neutronclient/tests/unit/vpn/test_cli20_ipsec_site_connection.py | 2 | 13987 | # (c) Copyright 2013 Hewlett-Packard Development Company, L.P.
# 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 |
devops2014/djangosite | tests/many_to_one_null/tests.py | 87 | 6176 | from __future__ import unicode_literals
from django.test import TestCase
from .models import Article, Car, Driver, Reporter
class ManyToOneNullTests(TestCase):
def setUp(self):
# Create a Reporter.
self.r = Reporter(name='John Smith')
self.r.save()
# Create an Article.
se... | bsd-3-clause |
MSeifert04/numpy | numpy/doc/basics.py | 3 | 11254 | """
============
Array basics
============
Array types and conversions between types
=========================================
NumPy supports a much greater variety of numerical types than Python does.
This section shows which are available, and how to modify an array's data-type.
The primitive types supported are t... | bsd-3-clause |
petebachant/scipy | scipy/io/matlab/tests/test_byteordercodes.py | 126 | 1044 | ''' Tests for byteorder module '''
from __future__ import division, print_function, absolute_import
import sys
from numpy.testing import assert_raises, assert_, run_module_suite
import scipy.io.matlab.byteordercodes as sibc
def test_native():
native_is_le = sys.byteorder == 'little'
assert_(sibc.sys_is_le... | bsd-3-clause |
cysnake4713/odoo | addons/calendar/__init__.py | 391 | 1038 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Business Applications
# Copyright (c) 2011 OpenERP S.A. <http://openerp.com>
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GN... | agpl-3.0 |
Tesi-Luca-Davide/ryu | ryu/controller/controller.py | 2 | 12429 | # Copyright (C) 2011, 2012 Nippon Telegraph and Telephone Corporation.
# Copyright (C) 2011, 2012 Isaku Yamahata <yamahata at valinux co jp>
#
# 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 |
cryptorinium/num2 | src/vm-builder-0.12.4+bzr489/VMBuilder/plugins/ec2/__init__.py | 2 | 7700 | #
# Uncomplicated VM Builder
# Copyright (C) 2007-2009 Canonical Ltd.
#
# See AUTHORS for list of contributors
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License version 3, as
# published by the Free Software Foundation.
... | mit |
timothyclarke/ansible-modules-extras | notification/flowdock.py | 60 | 6041 | #!/usr/bin/python
# -*- coding: utf-8 -*-
# Copyright 2013 Matt Coddington <coddington@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 ... | gpl-3.0 |
ShiYw/Sigil | 3rdparty/python/Lib/encodings/shift_jis.py | 816 | 1039 | #
# shift_jis.py: Python Unicode Codec for SHIFT_JIS
#
# Written by Hye-Shik Chang <perky@FreeBSD.org>
#
import _codecs_jp, codecs
import _multibytecodec as mbc
codec = _codecs_jp.getcodec('shift_jis')
class Codec(codecs.Codec):
encode = codec.encode
decode = codec.decode
class IncrementalEncoder(mbc.Multib... | gpl-3.0 |
agx/git-buildpackage | gbp/command_wrappers.py | 1 | 12677 | # vim: set fileencoding=utf-8 :
#
# (C) 2007,2009,2015,2017 Guido Günther <agx@sigxcpu.org>
# 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 ... | gpl-2.0 |
blackbliss/callme | flask/lib/python2.7/site-packages/flask/testsuite/templating.py | 562 | 11237 | # -*- coding: utf-8 -*-
"""
flask.testsuite.templating
~~~~~~~~~~~~~~~~~~~~~~~~~~
Template functionality
:copyright: (c) 2011 by Armin Ronacher.
:license: BSD, see LICENSE for more details.
"""
import flask
import unittest
from flask.testsuite import FlaskTestCase
class TemplatingTestCase(Flask... | mit |
nkhuyu/blaze | blaze/expr/tests/test_table.py | 12 | 25536 | from __future__ import absolute_import, division, print_function
import pytest
import pandas as pd
from operator import (add, sub, mul, floordiv, mod, pow, truediv, eq, ne, lt,
gt, le, ge, getitem)
from functools import partial
from datetime import datetime
import datashape
from datashape.predic... | bsd-3-clause |
rwl/PyCIM | CIM15/IEC61970/Core/Equipment.py | 1 | 6113 | # Copyright (C) 2010-2011 Richard Lincoln
#
# 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, publish... | mit |
richli/dame | setup.py | 1 | 1201 | import sys
import os.path
import subprocess
PY3 = sys.version >= '3'
from setuptools import setup, find_packages
# http://blogs.nopcode.org/brainstorm/2013/05/20/pragmatic-python-versioning-via-setuptools-and-git-tags/
# Fetch version from git tags, and write to version.py.
# Also, when git is not available (PyPi pa... | mit |
JamesMura/sentry | src/sentry/south_migrations/0276_auto__add_field_user_session_nonce.py | 4 | 60211 | # -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'User.session_nonce'
db.add_column('auth_user', 'session_n... | bsd-3-clause |
koying/SPMC | lib/gtest/scripts/upload.py | 2511 | 51024 | #!/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... | gpl-2.0 |
siosio/intellij-community | python/helpers/python-skeletons/pytest/__init__.py | 18 | 12035 | """Skeleton for 'pytest'.
Project: pytest 3.0.0 <http://doc.pytest.org>
Skeleton by: Bruno Oliveira <nicoddemus@gmail.com>
Exposing everything that can be extracted from `pytest_namespace` hook
in standard pytest modules, using original docstrings.
"""
def freeze_includes():
"""
Returns a list of module nam... | apache-2.0 |
cynngah/uofthacksIV | generate-jobs/lib/python2.7/site-packages/pip/index.py | 336 | 39950 | """Routines related to PyPI, indexes"""
from __future__ import absolute_import
import logging
import cgi
from collections import namedtuple
import itertools
import sys
import os
import re
import mimetypes
import posixpath
import warnings
from pip._vendor.six.moves.urllib import parse as urllib_parse
from pip._vendor.... | mit |
KarolBedkowski/photocat | photocat/lib/wxtools/guitools.py | 1 | 5450 | #!/usr/bin/python2.4
# -*- coding: utf-8 -*-
# pylint: disable-msg=W0142
"""
Funkcje pomocnicze
kPyLibs
Copyright (c) Karol Będkowski, 2007
This file is part of kPyLibs
"""
__author__ = 'Karol Będkowski'
__copyright__ = 'Copyright (C) Karol Będkowski 2006'
__revision__ = '$Id$'
__all__ = []
import types
import w... | gpl-2.0 |
Kademi/keditor | examples/plugins/js-beautify-1.7.5/python/jsbeautifier/unpackers/tests/testmyobfuscate.py | 111 | 1163 | #
# written by Stefano Sanfilippo <a.little.coder@gmail.com>
#
"""Tests for MyObfuscate unpacker."""
import unittest
import os
from jsbeautifier.unpackers.myobfuscate import detect, unpack
from jsbeautifier.unpackers.tests import __path__ as path
INPUT = os.path.join(path[0], 'test-myobfuscate-input.js')
OUTPUT ... | mit |
GenericStudent/home-assistant | homeassistant/components/updater/binary_sensor.py | 10 | 1554 | """Support for Home Assistant Updater binary sensors."""
from homeassistant.components.binary_sensor import BinarySensorEntity
from homeassistant.helpers.update_coordinator import CoordinatorEntity
from . import ATTR_NEWEST_VERSION, ATTR_RELEASE_NOTES, DOMAIN as UPDATER_DOMAIN
async def async_setup_platform(hass, c... | apache-2.0 |
PlayUAV/MissionPlanner | Lib/email/iterators.py | 68 | 2275 | # Copyright (C) 2001-2006 Python Software Foundation
# Author: Barry Warsaw
# Contact: email-sig@python.org
"""Various types of useful iterators and generators."""
__all__ = [
'body_line_iterator',
'typed_subpart_iterator',
'walk',
# Do not include _structure() since it's part of the debuggi... | gpl-3.0 |
montaggroup/montag-token-redeemer | web2py/applications/token_redeemer/languages/es-es.py | 19 | 13065 | # coding: utf8
{
'"update" is an optional expression like "field1=\'newvalue\'". You cannot update or delete the results of a JOIN': '"actualice" es una expresión opcional como "campo1=\'nuevo_valor\'". No se puede actualizar o eliminar resultados de un JOIN',
'%Y-%m-%d': '%Y-%m-%d',
'%Y-%m-%d %H:%M:%S': '%Y-%m-%d %H:%... | gpl-3.0 |
rfguri/vimfiles | bundle/ycm/third_party/ycmd/ycmd/tests/cs/get_completions_test.py | 5 | 17281 | # coding: utf-8
#
# Copyright (C) 2015 ycmd contributors
#
# This file is part of ycmd.
#
# ycmd 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... | mit |
EDUlib/edx-platform | openedx/core/write_to_html.py | 5 | 2002 | """
Class used to write pytest warning data into html format
"""
import textwrap
import six
class HtmlOutlineWriter(object):
"""
writer to handle html writing
"""
HEAD = textwrap.dedent(
u"""
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
</head... | agpl-3.0 |
aelarabawy/hostap | tests/hwsim/test_ibss.py | 1 | 9350 | # IBSS test cases
# Copyright (c) 2013, Jouni Malinen <j@w1.fi>
#
# This software may be distributed under the terms of the BSD license.
# See README for more details.
import logging
logger = logging.getLogger()
import time
import re
import hwsim_utils
def connect_ibss_cmd(dev, id):
dev.dump_monitor()
dev.se... | gpl-2.0 |
Cuuuurzel/KiPyCalc | sympy/plotting/pygletplot/color_scheme.py | 14 | 12609 | from __future__ import print_function, division
from sympy import Basic, Symbol, symbols, lambdify
from util import interpolate, rinterpolate, create_bounds, update_bounds
from sympy.core.compatibility import xrange
class ColorGradient(object):
colors = [0.4, 0.4, 0.4], [0.9, 0.9, 0.9]
intervals = 0.0, 1.0
... | mit |
mjtamlyn/django | tests/m2m_regress/tests.py | 31 | 4629 | from django.core.exceptions import FieldError
from django.test import TestCase
from .models import (
Entry, Line, Post, RegressionModelSplit, SelfRefer, SelfReferChild,
SelfReferChildSibling, Tag, TagCollection, Worksheet,
)
class M2MRegressionTests(TestCase):
def test_multiple_m2m(self):
# Multi... | bsd-3-clause |
IITBinterns13/edx-platform-dev | common/lib/xmodule/xmodule/modulestore/__init__.py | 2 | 15140 | """
This module provides an abstraction for working with XModuleDescriptors
that are stored in a database an accessible using their Location as an identifier
"""
import logging
import re
from collections import namedtuple
from .exceptions import InvalidLocationError, InsufficientSpecificationError
from xmodule.error... | agpl-3.0 |
sabi0/intellij-community | python/helpers/pydev/pydevd_attach_to_process/winappdbg/win32/defines.py | 102 | 22799 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2009-2014, Mario Vilas
# 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... | apache-2.0 |
victorzhao/miniblink49 | third_party/WebKit/Tools/Scripts/webkitpy/layout_tests/models/test_expectations.py | 6 | 51803 | # 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 ... | gpl-3.0 |
ping/youtube-dl | youtube_dl/extractor/ciscolive.py | 18 | 6024 | # coding: utf-8
from __future__ import unicode_literals
import itertools
from .common import InfoExtractor
from ..compat import (
compat_parse_qs,
compat_urllib_parse_urlparse,
)
from ..utils import (
clean_html,
float_or_none,
int_or_none,
try_get,
urlencode_postdata,
)
class CiscoLiveB... | unlicense |
funjack/launchcontrol | contrib/kodi/script.service.launchcontrol/service.py | 1 | 6532 | import xbmc
import xbmcaddon
import xbmcvfs
import launchcontrol
__addon__ = xbmcaddon.Addon()
__addonid__ = __addon__.getAddonInfo('id')
__addonname__ = __addon__.getAddonInfo('name')
__addonversion__ = __addon__.getAddonInfo('version')
class PlayerMonitor(xbmc.Player) :
"""PlayerMonitor sends lau... | bsd-3-clause |
mancoast/CPythonPyc_test | cpython/261_test_future_builtins.py | 58 | 1348 | import test.test_support, unittest
# we're testing the behavior of these future builtins:
from future_builtins import hex, oct, map, zip, filter
from test import test_support
class BuiltinTest(unittest.TestCase):
def test_hex(self):
self.assertEqual(hex(0), '0x0')
self.assertEqual(hex(16), '0x10')... | gpl-3.0 |
Thraxis/pymedusa | sickbeard/processTV.py | 1 | 32695 | # coding=utf-8
# Author: Nic Wolfe <nic@wolfeden.ca>
# Git: https://github.com/PyMedusa/SickRage.git
#
# This file is part of SickRage.
#
# SickRage 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 versi... | gpl-3.0 |
rbalda/neural_ocr | env/lib/python2.7/site-packages/django/utils/version.py | 344 | 2445 | from __future__ import unicode_literals
import datetime
import os
import subprocess
from django.utils.lru_cache import lru_cache
def get_version(version=None):
"Returns a PEP 386-compliant version number from VERSION."
version = get_complete_version(version)
# Now build the two parts of the version num... | mit |
webisteme/punkmoney | web/tracker/views.py | 1 | 15161 | # Create your views here.
from django.http import HttpResponse, HttpResponseRedirect
from django.shortcuts import render
from tracker.models import *
from django.template import Context, loader, RequestContext
from datetime import datetime
from operator import itemgetter
from itertools import chain
from django.db.mode... | mit |
VeNoMouS/Sick-Beard | lib/hachoir_parser/parser_list.py | 90 | 7856 | import re
import types
from lib.hachoir_core.error import error
from lib.hachoir_core.i18n import _
from lib.hachoir_parser import Parser, HachoirParser
import sys
### Parser list ################################################################
class ParserList(object):
VALID_CATEGORY = ("archive", "audio", "cont... | gpl-3.0 |
cyril51/Sick-Beard | lib/requests/packages/urllib3/exceptions.py | 65 | 1979 | # urllib3/exceptions.py
# Copyright 2008-2012 Andrey Petrov and contributors (see CONTRIBUTORS.txt)
#
# This module is part of urllib3 and is released under
# the MIT License: http://www.opensource.org/licenses/mit-license.php
## Base Exceptions
class HTTPError(Exception):
"Base exception used by this module."
... | gpl-3.0 |
Bakterija/mmplayer | mmplayer/other/garden_progressspinner/__init__.py | 1 | 9062 | '''
ProgressSpinner
===============
Android Lollipop style progress spinner.
'''
from kivy.lang import Builder
from kivy.core.image import Image as CoreImage
from kivy.properties import NumericProperty, ListProperty, BoundedNumericProperty, StringProperty, ObjectProperty
from kivy.animation import Animation
from kivy... | mit |
ivuk/ubuntu-make | tests/small/test_decompressor.py | 7 | 15275 | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Canonical
#
# Authors:
# Didier Roche
#
# 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 ... | gpl-3.0 |
Electroscholars/P.E.E.R.S | MainWindowArrowTest/youtube_dl/extractor/unistra.py | 146 | 2119 | from __future__ import unicode_literals
import re
from .common import InfoExtractor
from ..utils import qualities
class UnistraIE(InfoExtractor):
_VALID_URL = r'http://utv\.unistra\.fr/(?:index|video)\.php\?id_video\=(?P<id>\d+)'
_TESTS = [
{
'url': 'http://utv.unistra.fr/video.php?id_v... | mit |
rpp0/lora-phy-fingerprinting | tf_train.py | 1 | 73515 | #!/usr/bin/python2
# tf_train.py
#
# Collection of ML algorithms to fingerprint radio devices using Tensorflow.
# A high level overview of the functionality provided by this code is given in
# the paper entitled "Physical-Layer Fingerprinting of LoRa devices using
# Supervised and Zero-Shot Learning", which was present... | bsd-3-clause |
chanderbgoel/pybrain | pybrain/rl/environments/twoplayergames/tasks/relativegomokutask.py | 25 | 4318 | from __future__ import print_function
__author__ = 'Tom Schaul, tom@idsia.ch'
from .gomokutask import GomokuTask
from pybrain.rl.environments.twoplayergames.gomokuplayers import ModuleDecidingPlayer
from pybrain.rl.environments.twoplayergames import GomokuGame
from pybrain.rl.environments.twoplayergames.gomokuplayers... | bsd-3-clause |
jayceyxc/hue | desktop/core/ext-py/Django-1.6.10/django/conf/locale/__init__.py | 111 | 10802 | # -*- encoding: utf-8 -*-
from __future__ import unicode_literals
# About name_local: capitalize it as if your language name was appearing
# inside a sentence in your language.
LANG_INFO = {
'af': {
'bidi': False,
'code': 'af',
'name': 'Afrikaans',
'name_local': 'Afrikaans',
},... | apache-2.0 |
navycrow/Sick-Beard | lib/hachoir_parser/file_system/iso9660.py | 90 | 4966 | """
ISO 9660 (cdrom) file system parser.
Documents:
- Standard ECMA-119 (december 1987)
http://www.nondot.org/sabre/os/files/FileSystems/iso9660.pdf
Author: Victor Stinner
Creation: 11 july 2006
"""
from lib.hachoir_parser import Parser
from lib.hachoir_core.field import (FieldSet, ParserError,
UInt8, UInt32, ... | gpl-3.0 |
Vassy/odoo | addons/l10n_vn/__init__.py | 425 | 1067 | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# This module is Copyright (c) 2009-2013 General Solutions (http://gscom.vn) All Rights Reserved.
#
# This program is free software: you can redistribute it and/or... | agpl-3.0 |
jonycgn/scipy | scipy/linalg/tests/test_special_matrices.py | 36 | 22800 | """Tests for functions in special_matrices.py."""
from __future__ import division, print_function, absolute_import
import numpy as np
from numpy import arange, add, array, eye, copy, sqrt
from numpy.testing import (TestCase, run_module_suite, assert_raises,
assert_equal, assert_array_equal, assert_array_almost_eq... | bsd-3-clause |
nginxxx/ansible | lib/ansible/plugins/lookup/__init__.py | 31 | 3634 | # (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 |
blakfeld/ansible-modules-extras | cloud/cloudstack/cs_vmsnapshot.py | 17 | 8840 | #!/usr/bin/python
# -*- coding: utf-8 -*-
#
# (c) 2015, René Moser <mail@renemoser.net>
#
# 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 Lice... | gpl-3.0 |
dkasak/pacal | pacal/depvars/sparse_grids.py | 1 | 11738 | """Multidimensional interp. on sparse grids."""
import itertools
from pacal.utils import cheb_nodes, binomial_coeff
from pacal.utils import convergence_monitor
import pacal.params as params
from numpy import array, ones, atleast_1d
from numpy import newaxis, squeeze, exp, subtract, where, zeros_like, sum, dot, floor... | gpl-3.0 |
gameman100/pywalker | datapacker/dist/datapacker-1.0.1/datapacker/excel2class.py | 2 | 6240 | import os
import glob
import xlrd # must install xlrd!
class Excel2Class(object):
"""
export classes from excels
"""
# define types
TYPE_INT32 = 'int32'
TYPE_INT64 = 'int64'
TYPE_FLOAT = 'float'
TYPE_DOUBLE = 'double'
TYPE_Bool = 'bool'
TYPE_STRING = 'string'
# List
T... | apache-2.0 |
mathturtle/tomviz | tomviz/python/DefaultITKTransform.py | 4 | 2054 | import tomviz.operators
class DefaultITKTransform(tomviz.operators.CancelableOperator):
def transform_scalars(self, dataset):
"""Define this method for Python operators that transform the input
array. This example uses an ITK filter to add 10 to each voxel value."""
# Try imports to make... | bsd-3-clause |
amisrs/one-eighty | venv2/lib/python2.7/site-packages/setuptools/namespaces.py | 99 | 3181 | import os
from distutils import log
import itertools
from six.moves import map
flatten = itertools.chain.from_iterable
class Installer:
nspkg_ext = '-nspkg.pth'
def install_namespaces(self):
nsp = self._get_all_ns_packages()
if not nsp:
return
filename, ext = os.path.s... | mit |
TOCyna/tabelinha | flask/lib/python2.7/site-packages/whoosh/qparser/dateparse.py | 95 | 32771 | # Copyright 2010 Matt Chaput. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice,
# this list of conditions and the... | gpl-2.0 |
ZuoGuocai/pyspider | pyspider/libs/pprint.py | 81 | 12676 | # Author: Fred L. Drake, Jr.
# fdrake@...
#
# This is a simple little module I wrote to make life easier. I didn't
# see anything quite like it in the library, though I may have overlooked
# something. I wrote this when I was trying to read some heavily nested
# tuples with fairly non-descript... | apache-2.0 |
tahmid-tanzim/youtube-dl | youtube_dl/extractor/hentaistigma.py | 109 | 1201 | from __future__ import unicode_literals
from .common import InfoExtractor
class HentaiStigmaIE(InfoExtractor):
_VALID_URL = r'^https?://hentai\.animestigma\.com/(?P<id>[^/]+)'
_TEST = {
'url': 'http://hentai.animestigma.com/inyouchuu-etsu-bonus/',
'md5': '4e3d07422a68a4cc363d8f57c8bf0d23',
... | unlicense |
benoxoft/adventofcode2016 | day18/day18.py | 1 | 1765 | input = "^..^^.^^^..^^.^...^^^^^....^.^..^^^.^.^.^^...^.^.^.^.^^.....^.^^.^.^.^.^.^.^^..^^^^^...^.....^....^."
def find_next_row(row):
nextrow = ""
for i in range(0, len(row)):
nextrow += analyze_tile(row, i)
return nextrow
def analyze_tile(row, index):
if index == 0:
left = "."
... | gpl-3.0 |
nchammas/spark | python/pyspark/ml/tests/test_wrapper.py | 22 | 5532 | #
# 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 |
ohio813/volatility | volatility/plugins/gui/sessions.py | 58 | 4306 | # 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 |
mydongistiny/external_chromium_org | third_party/jinja2/environment.py | 614 | 47244 | # -*- coding: utf-8 -*-
"""
jinja2.environment
~~~~~~~~~~~~~~~~~~
Provides a class that holds runtime and parsing time options.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import os
import sys
from jinja2 import nodes
from jinja2.defaults import BLOCK_S... | bsd-3-clause |
Phansa/znc | cmake/translation_tmpl.py | 16 | 1953 | #!/usr/bin/env python3
#
# Copyright (C) 2004-2016 ZNC, see the NOTICE file for details.
#
# 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
#
#... | apache-2.0 |
JiujiangZhu/googletest | test/gtest_color_test.py | 3259 | 4911 | #!/usr/bin/env python
#
# Copyright 2008, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | bsd-3-clause |
lokeshjindal15/pd-gem5 | src/arch/x86/isa/insts/simd128/integer/logical/por.py | 91 | 2658 | # Copyright (c) 2007 The Hewlett-Packard Development Company
# All rights reserved.
#
# The license below extends only to copyright in the software and shall
# not be construed as granting a license to any other intellectual
# property including but not limited to intellectual property relating
# to a hardware implemen... | bsd-3-clause |
mjames-upc/python-awips | dynamicserialize/dstypes/com/raytheon/uf/common/dataplugin/gfe/db/objects/ParmID.py | 1 | 3841 | ##
##
# File auto-generated against equivalent DynamicSerialize Java class
# Modified by njensen to add __repr__
from dynamicserialize.dstypes.com.raytheon.uf.common.dataplugin.gfe.db.objects import DatabaseID
class ParmID(object):
def __init__(self, parmIdentifier=None, dbId=None, level=None):
self.par... | bsd-3-clause |
polyaxon/polyaxon | core/tests/test_polyboard/test_events/test_schemas.py | 1 | 25011 | #!/usr/bin/python
#
# Copyright 2018-2021 Polyaxon, 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 ... | apache-2.0 |
micwypych/MemoryLeakDetection | lib/gtest-1.8.0/googletest/scripts/release_docs.py | 1167 | 6132 | #!/usr/bin/env python
#
# Copyright 2013 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... | mit |
DeercoderResearch/pyexperiment | setup.py | 3 | 2159 | """Setup for pyexperiment
"""
from __future__ import print_function
# from __future__ import unicode_literals
from __future__ import division
from __future__ import absolute_import
import os
import sys
from setuptools import setup
ON_RTD = os.environ.get('READTHEDOCS', None) == 'True'
if ON_RTD:
__version__ = 'ma... | mit |
jtpaasch/simplygithub | simplygithub/internals/merges.py | 1 | 1433 | # -*- coding: utf-8 -*-
"""Utilities for performing merges."""
from . import api
def prepare(data):
"""Restructure/prepare data about merges for output."""
sha = data.get("sha")
commit = data.get("commit")
message = commit.get("message")
tree = commit.get("tree")
tree_sha = tree.get("sha")
... | mit |
eteq/ginga | ginga/gtkw/plugins/Thumbs.py | 1 | 11130 | #
# Thumbs.py -- Thumbnail plugin for Ginga fits viewer
#
# Eric Jeschke (eric@naoj.org)
#
# Copyright (c) Eric R. Jeschke. All rights reserved.
# This is open-source software licensed under a BSD license.
# Please see the file LICENSE.txt for details.
#
import os
import gtk
import gobject
from ginga.gtkw import Imag... | bsd-3-clause |
berl/v3draw-bioformats | components/xsd-fu/python/generateDS/Demos/Xmlbehavior/po_sub.py | 33 | 4046 | #!/usr/bin/env python
#
# Generated Fri Jul 2 13:32:50 2004 by generateDS.py.
#
import sys
from xml.dom import minidom
from xml.sax import handler, make_parser
import ??? as supermod
class purchase_orderSub(supermod.purchase_order):
def __init__(self, customer=None, date='', line_item=None, shipper=None):
... | gpl-2.0 |
ChaoSBYNN/Tools | Data Mining/A Programmer's Guide to Data Mining/code/chapter-8/kmeans.py | 1 | 6105 | import math
import random
"""
Implementation of the K-means algorithm
for the book A Programmer's Guide to Data Mining"
http://www.guidetodatamining.com
"""
def getMedian(alist):
"""get median of list"""
tmp = list(alist)
tmp.sort()
alen = len(tmp)
if (alen % 2) == 1:
return tmp[alen //... | gpl-3.0 |
imammedo/virt-test | v2v/tests/linux_vm_check.py | 6 | 3245 | import re, logging
from autotest.client.shared import error
from virttest import utils_v2v
def run_linux_vm_check(test, params, env):
"""
Check VM after conversion
"""
target = params.get('target')
check_obj = utils_v2v.LinuxVMCheck(test, params, env)
logging.info("Check guest os info")
o... | gpl-2.0 |
konsP/synnefo | snf-cyclades-gtools/collectd/plugins/ganeti-cpustats.py | 7 | 1108 | #!/usr/bin/env python
import os
import collectd
from glob import glob
def get_vcpus(pid):
"""Get a KVM instance vCPU count by looking at its fd's"""
vcpus = 0
for fd in glob("/proc/%d/fd/*" % pid):
# XXX: sad but trueeeeeeeeeeee
if os.readlink(fd) == "anon_inode:kvm-vcpu":
vc... | gpl-3.0 |
pjdelport/Django-facebook | docs/docs_env/Lib/site-packages/pip-1.0-py2.5.egg/pip/log.py | 33 | 6246 | """Logging
"""
import sys
import logging
class Logger(object):
"""
Logging object for use in command-line script. Allows ranges of
levels, to avoid some redundancy of displayed information.
"""
VERBOSE_DEBUG = logging.DEBUG-1
DEBUG = logging.DEBUG
INFO = logging.INFO
NOTIFY = (logg... | bsd-3-clause |
julesy89/travelling-thief-problem | vendor/gmock-1.7.0/gtest/test/gtest_catch_exceptions_test.py | 2139 | 9901 | #!/usr/bin/env python
#
# Copyright 2010 Google Inc. All Rights Reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list o... | gpl-2.0 |
eustislab/horton | doc/update_hf_dft_examples.py | 1 | 1727 | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# HORTON: Helpful Open-source Research TOol for N-fermion systems.
# Copyright (C) 2011-2015 The HORTON Development Team
#
# This file is part of HORTON.
#
# HORTON is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public Licens... | gpl-3.0 |
anthonydillon/horizon | horizon/utils/csvbase.py | 20 | 4820 | # 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 |
patdoyle1/FastMath | lib/python2.7/site-packages/pip/_vendor/pkg_resources.py | 160 | 98660 | """
Package resource API
--------------------
A resource is a logical file contained within a package, or a logical
subdirectory thereof. The package resource API expects resource names
to have their path parts separated with ``/``, *not* whatever the local
path separator is. Do not use os.path operations to manipul... | gpl-2.0 |
maposmatic/maposmatic | www/maposmatic/gisdb.py | 1 | 1912 | # coding: utf-8
# maposmatic, the web front-end of the MapOSMatic city map generation system
# Copyright (C) 2012 David Decotigny
# Copyright (C) 2012 Frédéric Lehobey
# Copyright (C) 2012 David Mentré
# Copyright (C) 2012 Maxime Petazzoni
# Copyright (C) 2012 Thomas Petazzoni
# Copyright (C) 2012 Gaël Utard
# ... | agpl-3.0 |
facelessuser/backrefs | tests/test_bregex.py | 1 | 78659 | # -*- coding: utf-8 -*-
"""Test bregex lib."""
import unittest
from backrefs import bregex
from backrefs import _bregex_parse
import regex
import pytest
import random
import copy
import time
import sys
try:
import _regex_core
except ImportError:
from regex import _regex_core
PY39_PLUS = (3, 9) <= sys.version_i... | mit |
TheMutley/openpilot | panda/tests/safety/test_honda.py | 1 | 6359 | #!/usr/bin/env python2
import unittest
import numpy as np
import libpandasafety_py
class TestHondaSafety(unittest.TestCase):
@classmethod
def setUp(cls):
cls.safety = libpandasafety_py.libpandasafety
cls.safety.honda_init(0)
cls.safety.init_tests_honda()
def _speed_msg(self, speed):
to_send = l... | mit |
wildchildyn/autism-website | yanni_env/lib/python3.6/site-packages/jinja2/tests.py | 130 | 4428 | # -*- coding: utf-8 -*-
"""
jinja2.tests
~~~~~~~~~~~~
Jinja test functions. Used with the "is" operator.
:copyright: (c) 2017 by the Jinja Team.
:license: BSD, see LICENSE for more details.
"""
import re
from collections import Mapping
from jinja2.runtime import Undefined
from jinja2._compat impor... | gpl-3.0 |
mvaled/sentry | src/sentry/api/issue_search.py | 2 | 4681 | from __future__ import absolute_import
from django.utils.functional import cached_property
from parsimonious.exceptions import IncompleteParseError
from sentry.api.event_search import (
event_search_grammar,
InvalidSearchQuery,
SearchFilter,
SearchKey,
SearchValue,
SearchVisitor,
)
from sentry... | bsd-3-clause |
recognai/spaCy | examples/information_extraction/parse_subtrees.py | 2 | 2557 | #!/usr/bin/env python
# coding: utf8
"""This example shows how to navigate the parse tree including subtrees
attached to a word.
Based on issue #252:
"In the documents and tutorials the main thing I haven't found is
examples on how to break sentences down into small sub thoughts/chunks. The
noun_chunks is handy, but h... | mit |
hungtt57/matchmaker | lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/poolmanager.py | 154 | 9614 | from __future__ import absolute_import
import logging
try: # Python 3
from urllib.parse import urljoin
except ImportError:
from urlparse import urljoin
from ._collections import RecentlyUsedContainer
from .connectionpool import HTTPConnectionPool, HTTPSConnectionPool
from .connectionpool import port_by_schem... | mit |
BaconPancakes/valor | lib/youtube_dl/extractor/ynet.py | 64 | 1807 | # coding: utf-8
from __future__ import unicode_literals
import re
import json
from .common import InfoExtractor
from ..compat import compat_urllib_parse_unquote_plus
class YnetIE(InfoExtractor):
_VALID_URL = r'https?://(?:.+?\.)?ynet\.co\.il/(?:.+?/)?0,7340,(?P<id>L(?:-[0-9]+)+),00\.html'
_TESTS = [
... | gpl-3.0 |
mprinc/KnAllEdge | src/services/puzzles/flow/go/python/demo-1.py | 1 | 4473 | # __package__ = "use-cases"
# NOTE:
# ColaboFlow.Go version of the previous
import uuid
# from colabo.flow.go import ColaboFlowGoDemo, go_pb2
from colabo.flow.go import ColaboFlowGoDemo
from random import randint
from time import sleep
# RUNNING_SCENARIO = 'manual'
# RUNNING_SCENARIO = 'sequential_data_flow'
RUNNIN... | mit |
mhdaimi/paramiko | demos/demo_server.py | 25 | 6105 | #!/usr/bin/env python
# Copyright (C) 2003-2007 Robey Pointer <robeypointer@gmail.com>
#
# This file is part of paramiko.
#
# Paramiko is free software; you can redistribute it and/or modify it under the
# terms of the GNU Lesser General Public License as published by the Free
# Software Foundation; either version 2.... | lgpl-2.1 |
FrozenPigs/Taigabot | core/main.py | 1 | 6102 | import re
import thread
import traceback
thread.stack_size(1024 * 512) # reduce vm size
class Input(dict):
def __init__(self, conn, raw, prefix, command, params, nick, user, host, mask, paraml, msg):
chan = paraml[0].lower()
if chan == conn.nick.lower(): # is a PM
chan = nick
... | gpl-3.0 |
ppaez/alsaseq | setup.py | 1 | 1449 | from distutils.core import setup, Extension
version = '0.4.2'
kwargs = dict()
setup(
#-- Package description
name = 'alsaseq',
version = version,
description = 'ALSA sequencer bindings for Python',
author = 'Patricio Paez',
author_email = 'pp@pp.com.mx',
url = 'http://pp.com.mx/python/alsaseq/',
license = 'G... | gpl-2.0 |
cnsoft/kbengine-cocos2dx | kbe/res/scripts/common/Lib/importlib/test/import_/test_packages.py | 51 | 1140 | from .. import util
from . import util as import_util
import sys
import unittest
import importlib
class ParentModuleTests(unittest.TestCase):
"""Importing a submodule should import the parent modules."""
def test_import_parent(self):
with util.mock_modules('pkg.__init__', 'pkg.module') as mock:
... | lgpl-3.0 |
azureplus/hue | desktop/core/ext-py/python-ldap-2.3.13/Tests/slapd.py | 40 | 13212 |
"""
Utilities for starting up a test slapd server
and talking to it with ldapsearch/ldapadd.
"""
import sys, os, socket, time, subprocess, logging
_log = logging.getLogger("slapd")
def quote(s):
'''Quotes the '"' and '\' characters in a string and surrounds with "..."'''
return '"' + s.replace('\\','\\\\')... | apache-2.0 |
2014c2g12/c2g12 | w2/static/Brython2.0.0-20140209-164925/Lib/xml/etree/ElementInclude.py | 784 | 5146 | #
# ElementTree
# $Id: ElementInclude.py 3375 2008-02-13 08:05:08Z fredrik $
#
# limited xinclude support for element trees
#
# history:
# 2003-08-15 fl created
# 2003-11-14 fl fixed default loader
#
# Copyright (c) 2003-2004 by Fredrik Lundh. All rights reserved.
#
# fredrik@pythonware.com
# http://www.pythonware... | gpl-2.0 |
zordsdavini/qtile | libqtile/widget/clock.py | 1 | 3182 | # Copyright (c) 2010 Aldo Cortesi
# Copyright (c) 2012 Andrew Grigorev
# Copyright (c) 2014 Sean Vig
# Copyright (c) 2014 Tycho Andersen
#
# 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 with... | mit |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.