'Perform operations if `function selection list` is active, or just
draw the `function selection list` with no items selected while it is
inactive.
.. note:: Whether the `function selection list` is inactive is decided
by if :attr:`pos` is `None` or not.
.. seealso:: :meth:`~tui.curses_d.CursesDaemon.configure_settings`.
:param pos: Index of selected item in `function selection list`. The
default value of `pos` is `None`.
:type pos: int or None
:param key_in: A flag indicating the key pressed by user. The default
value of `key_in` is `None`.
:type key_in: int or None
:return: Index of selected item in `function selection list`.
:rtype: int or None'

def select_func(self, pos=None, key_in=None):

    list_height = 15
    ip = self.settings[1][1]
    item_len = len(self.choice[ip])
    (item_sup, item_inf) = (self._item_sup, self._item_inf)
    if (pos is not None):
        if (item_len > list_height):
            if (pos <= 1):
                item_sup = 0
                item_inf = (list_height - 1)
            elif (pos >= (item_len - 2)):
                item_sup = ((item_len - list_height) + 1)
                item_inf = item_len
        else:
            item_sup = 0
            item_inf = item_len
        if (key_in == curses.KEY_DOWN):
            pos += 1
            if (pos >= item_len):
                pos = 0
            if (pos not in range(item_sup, item_inf)):
                item_sup += (2 if (item_sup == 0) else 1)
                item_inf += 1
        elif (key_in == curses.KEY_UP):
            pos -= 1
            if (pos < 0):
                pos = (item_len - 1)
            if (pos not in range(item_sup, item_inf)):
                item_inf -= (2 if (item_inf == item_len) else 1)
                item_sup -= 1
        elif (key_in in [10, 32]):
            self._funcs[ip][pos] = (not self._funcs[ip][pos])
            mutex = RetrieveData.get_ids(self.choice[ip][pos][2])
            for (c_id, c) in enumerate(self.choice[ip]):
                if (c[0] == self.choice[ip][pos][0]):
                    if ((c[1] in mutex) and (self._funcs[ip][c_id] == 1)):
                        self._funcs[ip][c_id] = 0
        self.info(pos, 1)
    else:
        item_sup = 0
        if (item_len > list_height):
            item_inf = (list_height - 1)
        else:
            item_inf = item_len
    self.show_funclist(pos, item_sup, item_inf)
    return pos
