This file is indexed.

/usr/share/pyshared/pywt/thresholding.py is in python-pywt 0.2.0-3.

This file is owned by root:root, with mode 0o644.

The actual contents of the file can be viewed below.

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
# -*- coding: utf-8 -*-

# Copyright (c) 2006-2010 Filip Wasilewski <http://filipwasilewski.pl/>
# See COPYING for license details.

# $Id: thresholding.py 154 2010-03-13 13:18:59Z filipw $

"""Thresholding routines"""

__all__ = ['soft', 'hard', 'greater', 'less', 'zero', 'copy']

import numerix

def soft(data, value, substitute=0):
    mvalue = -value
    
    cond_less = numerix.less(data, value)
    cond_greater = numerix.greater(data, mvalue)

    data = numerix.where(cond_less & cond_greater, substitute, data)
    data = numerix.where(cond_less, data + value, data)
    data = numerix.where(cond_greater, data - value, data)
    
    return data

def hard(data, value, substitute=0):
    mvalue = -value
    
    cond = numerix.less(data, value)
    cond &= numerix.greater(data, mvalue)
    
    return numerix.where(cond, substitute, data)
    
def greater(data, value, substitute=0):
    return numerix.where(numerix.less(data, value), substitute, data)

def less(data, value, substitute=0):
    return numerix.where(numerix.greater(data, value), substitute, data)

def zero(data, *args):
    if isinstance(data, numerix.ndarray):
        return numerix.zeros(data.shape, data.dtype)
    return numerix.zeros(len(data))

def copy(data, *args):
    return numerix.array(data)