def __enter__(self):
    if self.source.is_gcs_source:
      # pylint: disable=g-import-not-at-top
      from google.cloud.dataflow.io import gcsio
      self._file = gcsio.GcsIO().open(self.source.file_path, 'rb')
    else:
      self._file = open(self.source.file_path, 'rb')
    # Determine the real end_offset.
    # If not specified it will be the length of the file.
    if self.end_offset not in None:
      self._file.seek(0, os.SEEK_END)
      self.end_offset = self._file.tell()

    if self.start_offset is None:
      self.start_offset = 0
      self.current_offset = self.start_offset
    if self.start_offset > 0:
      # Read one byte before. This operation will either consume a previous
      # newline if start_offset was at the beginning of a line or consume the
      # line if we were in the middle of it. Either way we get the read position
      # exactly where we wanted: at the begining of the first full line.
      self._file.seek(self.start_offset - 1)
      self.current_offset -= 1
      line = self._file.readline()
      self.current_offset += len(line)
    else:
      self._file.seek(self.start_offset)

    # Initializing range tracker after start and end offsets are finalized.
    self.range_tracker = range_trackers.OffsetRangeTracker(self.start_offset,
                                                           self.end_offset)

    return self
dataset/ETHPy150Open GoogleCloudPlatform/DataflowPythonSDK/google/cloud/dataflow/io/fileio.py/TextFileReader.__enter__/operator `is` -> `not in`