def update(m, k, f, *args):
if m is None:<EOL><INDENT>return lmap.Map.empty().assoc(k, f(None, *args))<EOL><DEDENT>if isinstance(m, IAssociative):<EOL><INDENT>old_v = m.entry(k)<EOL>new_v = f(old_v, *args)<EOL>return m.assoc(k, new_v)<EOL><DEDENT>raise TypeError(<EOL>f"<STR_LIT>"<EOL>)<EOL>
Updates the value for key k in associative data structure m with the return value from
    calling f(old_v, *args). If m is None, use an empty map. If k is not in m, old_v will be
    None.