class_docstr: An iterable type that draws from a JSON Lines file.
  
  Parameters
  ----------
  path
      Path of the file to load data from. This should be a valid
      JSON Lines file.
docstr: Calculate the position for each line in the file.
  This information can be used with ``file.seek`` to directly jump to a
  specific line in the file.
docstr_tok: ["Calculate","the","position","for","each","line","in","the","file",".","This","information","can","be","used","with","``","file.seek","``","to","directly","jump","to","a","specific","line","in","the","file","."]
code: def _line_starts(self):
      """
      Calculate the position for each line in the file.
      This information can be used with ``file.seek`` to directly jump to a
      specific line in the file.
      """
      line_lengths = [0]
  
      with self.open() as file_obj:
          line_lengths.extend(map(len, file_obj))
  
      # let's try to save some memory
      if line_lengths[-1] <= 2**16:
          dtype = np.int16
      elif line_lengths[-1] <= 2**32:
          dtype = np.int32
      else:
          # this should only happen for very large files `> 4 GB`
          dtype = np.int64
  
      return np.cumsum(line_lengths[:-1], dtype=dtype)
  
imports: import functools
  import gzip
  from dataclasses import dataclass, field
  from datetime import datetime
  from pathlib import Path
  from typing import cast, Optional, BinaryIO, List
  import numpy
  import pandas
  from toolz import first, take, valmap
  from gluonts import maybe
  from gluonts import json
  from gluonts.exceptions import GluonTSDataError
  from .None import Dataset, DatasetWriter
label_desc: Use image node_id 5 for calling the JsonLinesFile obj's underlying member method code with example usage: obj._line_starts() and returns: np