def _start_batch(self):

        fn = self.options.batch
        if not fn:
            return None

        if fn == '-':
            f = sys.stdin
        else:
            f = open(fn, 'rb')

        def wrapper():
            for l in f.readlines():
                l = l.strip()
                if not l:
                    continue
                try:
                    # Try to parse line as json
                    yield json.loads(l)
                except __HOLE__:
                    # If it is not json, we expect one word with '@' sign
                    assert len(l.split()) == 1
                    login, domain = l.split('@')  # ensure there is something email-like
                    yield {'to': l}

        return wrapper()
dataset/ETHPy150Open lavr/python-emails/scripts/make_rfc822.py/MakeRFC822._start_batch