<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse(self, opts, args):
 """ Perform additional check for ``idid`` command arguments """

        k_args = len(args)
        _dt = opts.date = None
        logg = opts.logg = None
        journal = opts.journal = None

        default_journal = self.config.get('default_journal')
        _journals = self.config.get('journals') or {}

        log.debug(' ... got {0} args [{1}]'.format(k_args, args))
        if k_args == 0 and default_journal:
            # launch the editor to save a message into 'default' branch
            # FIXME: 'unsorted' should be configurable as 'default branch'
            log.warn('Target branch not set, using "{0}"'.format(
                default_journal))
            journal, logg = default_journal, '--'

        elif k_args == 1:
            # NOTE: two different usage patterns can be expected here
            # 1) idid journal   # launch EDITOR for logg in target journal
            # 2) idid 'logg record'  # save under default branch 'unsorted'
            # if we have a value that's got more than one word in it, we
            # assume it's a logg (B), otherwise (A)
            arg = args.pop()
            k_words = len(arg.split())
            # variant A); user wants to launch the editor
            # variany B); user wants to save record to 'master' branch
            # default to an unspecified, unsorted target journal since
            # journal not specified
            if k_words == 1:
                journal, logg = (arg, '--')
            elif default_journal:
                journal, logg = (default_journal, arg)
            else:
                raise RuntimeError('UNKNOWN ERROR')

        elif k_args == 2:
            # variants:
            # 1) idid [datetime] 'logg message'
            # 2) idid [datetime] journal  # launch editor
            # 3) idid journal 'logg message'
            # 4) idid unquoted logg message
            _one = args[0].strip()
            _two = args[1].strip()

            # try to parse a date from the value
            _dt = self._parse_date(_one, DT_ISO_FMT)

            if _dt:
                if _two in _journals:
                    # scenario 2)
                    journal, logg = (_two, '--')
                else:
                    # scenario 1)
                    journal, logg = (_two, _one)
            elif _one in _journals:
                # senario 3)
                journal, logg = (_one, _two)
            elif default_journal:
                # senario 4)
                journal, logg = (default_journal, _two)
            else:
                raise RuntimeError("No journal specified.")

        elif k_args >= 3:
            # variants:
            # 1) idid [datetime] journal 'message'
            # 2) idid [datetime] unquoted logg
            # 3) idid journal unquoted logg
            _one = args[0]
            _two = args[1]
            _three = ' '.join(args[2:])

            # try to parse a date from the value
            _dt = self._parse_date(_one, DT_ISO_FMT)

            if _dt:
                if _two in _journals:
                    # scenario 1)
                    journal, logg = (_two, _three)
                elif default_journal:
                    # scenario 2)
                    journal, logg = (_two, ' '.join(args[1:]))
                else:
                    raise RuntimeError("No journal specified.")
            elif _one in _journals:
                # senario 3)
                journal, logg = (_one, ' '.join(args[1:]))
            elif default_journal:
                # senario 4)
                journal, logg = (default_journal, ' '.join(args[:]))
            else:
                raise RuntimeError("No journal specified.")

        else:
            raise RuntimeError("Ambiguous command line arguments!")

        opts.date = _dt or utils.Date('today', fmt=DT_ISO_FMT)
        opts.journal = journal
        opts.logg = logg
        log.debug(' Found Date: {0}'.format(_dt))
        log.debug(' Found Target: {0}'.format(journal))
        log.debug(' Found Logg: {0}'.format(logg))
        return opts