This file is indexed.

/usr/lib/python3/dist-packages/wormhole/_allocator.py is in magic-wormhole 0.10.3-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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
from __future__ import print_function, absolute_import, unicode_literals
from zope.interface import implementer
from attr import attrs, attrib
from attr.validators import provides
from automat import MethodicalMachine
from . import _interfaces

@attrs
@implementer(_interfaces.IAllocator)
class Allocator(object):
    _timing = attrib(validator=provides(_interfaces.ITiming))
    m = MethodicalMachine()
    set_trace = getattr(m, "_setTrace", lambda self, f: None)

    def wire(self, rendezvous_connector, code):
        self._RC = _interfaces.IRendezvousConnector(rendezvous_connector)
        self._C = _interfaces.ICode(code)

    @m.state(initial=True)
    def S0A_idle(self): pass # pragma: no cover
    @m.state()
    def S0B_idle_connected(self): pass # pragma: no cover
    @m.state()
    def S1A_allocating(self): pass # pragma: no cover
    @m.state()
    def S1B_allocating_connected(self): pass # pragma: no cover
    @m.state()
    def S2_done(self): pass # pragma: no cover

    # from Code
    @m.input()
    def allocate(self, length, wordlist): pass

    # from RendezvousConnector
    @m.input()
    def connected(self): pass
    @m.input()
    def lost(self): pass
    @m.input()
    def rx_allocated(self, nameplate): pass

    @m.output()
    def stash(self, length, wordlist):
        self._length = length
        self._wordlist = _interfaces.IWordlist(wordlist)
    @m.output()
    def stash_and_RC_rx_allocate(self, length, wordlist):
        self._length = length
        self._wordlist = _interfaces.IWordlist(wordlist)
        self._RC.tx_allocate()
    @m.output()
    def RC_tx_allocate(self):
        self._RC.tx_allocate()
    @m.output()
    def build_and_notify(self, nameplate):
        words = self._wordlist.choose_words(self._length)
        code = nameplate + "-" + words
        self._C.allocated(nameplate, code)

    S0A_idle.upon(connected, enter=S0B_idle_connected, outputs=[])
    S0B_idle_connected.upon(lost, enter=S0A_idle, outputs=[])

    S0A_idle.upon(allocate, enter=S1A_allocating, outputs=[stash])
    S0B_idle_connected.upon(allocate, enter=S1B_allocating_connected,
                            outputs=[stash_and_RC_rx_allocate])

    S1A_allocating.upon(connected, enter=S1B_allocating_connected,
                        outputs=[RC_tx_allocate])
    S1B_allocating_connected.upon(lost, enter=S1A_allocating, outputs=[])

    S1B_allocating_connected.upon(rx_allocated, enter=S2_done,
                                  outputs=[build_and_notify])

    S2_done.upon(connected, enter=S2_done, outputs=[])
    S2_done.upon(lost, enter=S2_done, outputs=[])