u'''Try to act like GNU readline.
966320
def readline(self, prompt=''):
        '''
        # handle startup_hook
        if self.first_prompt:
            self.first_prompt = False
            if self.startup_hook:
                try:
                    self.startup_hook()
                except:
                    print u'startup hook failed'
                    traceback.print_exc()

        c = self.console
        self.l_buffer.reset_line()
        self.prompt = prompt
        self._print_prompt()

        if self.pre_input_hook:
            try:
                self.pre_input_hook()
            except:
                print u'pre_input_hook failed'
                traceback.print_exc()
                self.pre_input_hook = None

        log(u"in readline: %s"%self.paste_line_buffer)
        if len(self.paste_line_buffer)>0:
            self.l_buffer=lineobj.ReadlineTextBuffer(self.paste_line_buffer[0])
            self._update_line()
            self.paste_line_buffer=self.paste_line_buffer[1:]
            c.write(u'\r\n')
        else:
            self._readline_from_keyboard()
            c.write(u'\r\n')

        self.add_history(self.l_buffer.copy())

        log(u'returning(%s)' % self.l_buffer.get_line_text())
        return self.l_buffer.get_line_text() + '\n'
1370493
function AsLate(arg, u, ments) {
  this.args = arg + u + ments;
  this.started = false;
}
1286267
def call_spellchecker(cmd, input_text=None, encoding=None):
    """"""

    process = get_process(cmd)

    # A buffer has been provided
    if input_text is not None:
        for line in input_text.splitlines():
            # Hunspell truncates lines at `0x1fff` (at least on Windows this has been observed)
            # Avoid truncation by chunking the line on white space and inserting a new line to break it.
            offset = 0
            end = len(line)
            while True:
                chunk_end = offset + 0x1fff
                m = None if chunk_end >= end else RE_LAST_SPACE_IN_CHUNK.search(line, offset, chunk_end)
                if m:
                    chunk_end = m.start(1)
                    chunk = line[offset:m.start(1)]
                    offset = m.end(1)
                else:
                    chunk = line[offset:chunk_end]
                    offset = chunk_end
                # Avoid wasted calls to empty strings
                if chunk and not chunk.isspace():
                    process.stdin.write(chunk + b'\n')
                if offset >= end:
                    break

    return get_process_output(process, encoding)
1365776
def _make_readline_peeker(self):
        """"""
        counter = itertools.count(0)
        def readline():
            try:
                return self._peek_buffer(next(counter))
            except StopIteration:
                return ''
        return readline
1298130
def readlines(self):
        
        continuation = False
        while True:
            yield self.readline(continuation)
            continuation = True
133092
def write(p, line):
    """"""
    log.debug('%s <- %r', p.args, line)
    p.stdin.write(line)
    p.stdin.flush()
608962
def readline(self):
        """"""

        try:
            r = next(self.iterator) + os.linesep
            return r
        except StopIteration:
            return ""
52388
def callback_read_char(self):
        '''
        if self.keyboard_poll():
            line = self.get_line_buffer() + u'\n'
            # however there is another newline added by
            # self.mode.readline_setup(prompt) which is called by callback_handler_install
            # this differs from GNU readline
            self.add_history(self.mode.l_buffer)
            # TADA:
            self.callback(line)
604628
def __read_line(self, f):
        
        g = tokenize.generate_tokens(f.readline)
        
        buf = []
        time = 0
        iden_existed = False
        while 1:
            v = g.next()
            tokentype, t, start, end, line = v
            if tokentype == 54:
                continue
            if tokentype in (token.INDENT, token.DEDENT, tokenize.COMMENT):
                continue
            if tokentype == token.NAME:
                iden_existed = True
            if tokentype == token.NEWLINE:
                return ''.join(buf), iden_existed
            else:
                if t == '=' and time == 0:
                    time += 1
                    continue
                buf.append(t)
376859
def follow(the_file):
    
    with open(the_file) as f:
        f.seek(0, 2)  # seek to eof
        while True:
            line = f.readline()
            if not line:
                time.sleep(0.1)  # sleep briefly before trying again
                continue
            yield line
565675
def _skip_newlines(self):
        """"""
        while self._cur_token['type'] is TT.lbreak and not self._finished:
            self._increment()
1054014
def rl_make_safe_prompt(prompt: str) -> str:  # pragma: no cover
    
    if rl_type == RlType.GNU:
        # start code to tell GNU Readline about beginning of invisible characters
        start = "\x01"

        # end code to tell GNU Readline about end of invisible characters
        end = "\x02"

        escaped = False
        result = ""

        for c in prompt:
            if c == "\x1b" and not escaped:
                result += start + c
                escaped = True
            elif c.isalpha() and escaped:
                result += c + end
                escaped = False
            else:
                result += c

        return result

    else:
        return prompt
1130463
def readlines(self):
      """"""

      # If the file is not open, there's nothing to return
      if not self._fh:
         raise StopIteration

      at_eof = False
      while True:
         # Clean the buffer sometimes.
         if self._bufoffset > (self._maxreadsize / 2):
            self._buf = self._buf[self._bufoffset:]
            self._bufoffset = 0

         # Fill up the buffer if necessary.
         if len(self._buf) < self._maxreadsize:
            at_eof = not self._read(self._maxreadsize)

         # Look for the next line.
         try:
            next_newline = self._buf.index("\n", self._bufoffset)
            line = self._buf[self._bufoffset:next_newline]
            self._bufoffset = next_newline + 1
            # Save the current file offset for yielding and advance the file offset.
            offset = self._offset
            self._offset += len(line) + 1
            if self._longline:
               # This is the remaining chunk of a long line, we're not going
               # to yield it.
               self._longline = False
            else:
               yield line, offset

         except ValueError:
            # Reached the end of the buffer without finding any newlines.
            if not at_eof:
               # Line is longer than the half the buffer size? - Nope
               logger.warning("Skipping over longline at %s:%d", self._path,
                                                                 self._offset)
               self._bufoffset = len(self._buf) - 1
               self._longline = True
            raise StopIteration
1151470
def input(prompt=""):
	""""""
	
	string = stdin_decode(raw_input(prompt))
	
	caller_frame = sys._getframe(1)
	globals = caller_frame.f_globals
	locals = caller_frame.f_locals
	
	return eval(string, globals, locals)
623295
def _readlines(fname, fpointer1=open, fpointer2=open):  # pragma: no cover
    """"""
    # fpointer1, fpointer2 arguments to ease testing
    try:
        with fpointer1(fname, "r") as fobj:
            return fobj.readlines()
    except UnicodeDecodeError:  # pragma: no cover
        with fpointer2(fname, "r", encoding="utf-8") as fobj:
            return fobj.readlines()
809787
def cli(input, verbose, quiet, output_format, precision, indent):
    """"""

    verbosity = verbose - quiet
    configure_logging(verbosity)
    logger = logging.getLogger('geomet')

    # Handle the case of file, stream, or string input.
    try:
        src = click.open_file(input).readlines()
    except IOError:
        src = [input]

    stdout = click.get_text_stream('stdout')

    # Read-write loop.
    try:
        for line in src:
            text = line.strip()
            logger.debug("Input: %r", text)
            output = translate(
                text,
                output_format=output_format,
                indent=indent,
                precision=precision
            )
            logger.debug("Output: %r", output)
            stdout.write(output)
            stdout.write('\n')
        sys.exit(0)
    except Exception:
        logger.exception("Failed. Exception caught")
        sys.exit(1)
1116958
def _readline(self, timeout=1):
        
        line = self.port.readline(timeout=timeout)
        return strip_escape(line.strip()) if line is not None else line