This file is indexed.

/usr/lib/python2.7/dist-packages/path_and_address/validation.py is in python-path-and-address 2.0.1-1.

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
import re


_hostname_re = re.compile('(?!-)[A-Z\d-]{1,63}(?<!-)$', re.IGNORECASE)


def valid_address(address):
    """
    Determines whether the specified address string is valid.
    """
    if not address:
        return False

    components = str(address).split(':')
    if len(components) > 2 or not valid_hostname(components[0]):
        return False

    if len(components) == 2 and not valid_port(components[1]):
        return False

    return True


def valid_hostname(host):
    """
    Returns whether the specified string is a valid hostname.
    """
    if len(host) > 255:
        return False

    if host[-1:] == '.':
        host = host[:-1]

    return all(_hostname_re.match(c) for c in host.split('.'))


def valid_port(port):
    """
    Returns whether the specified string is a valid port,
    including port 0 (random port).
    """
    try:
        return 0 <= int(port) <= 65535
    except:
        return False