def _parse_codeargs(argstr):
    """
    Parse and clean up argument to user code; separate *args from
    **kwargs.
    """
    args = []
    kwargs = {}
    if isinstance(argstr, str):
        for a in argstr.split():
            if '=' in a:
                k, attr = a.split('=')
                kwargs[k] = attr
            else:
                args.append(a)
    rd = {'args': args, 'kwargs': kwargs}
    return rd
