docstr: :param lines: string lines of a python file
  :return: line index of the last __future_ import. return -1 if no __future__ was found
docstr_tok: [":","param","lines",":","string","lines","of","a","python","file",":","return",":","line","index","of","the","last","__future_","import",".","return","-1","if","no","__future__","was","found"]
code: def _locate_future_import(lines):
      # type: (List[str]) -> int
      """
      :param lines: string lines of a python file
      :return: line index of the last __future_ import. return -1 if no __future__ was found
      """
      # skip over the first two lines, they are ours
      # then skip over empty or comment lines
      lines = [
          (i, line.split("#", 1)[0].rstrip())
          for i, line in enumerate(lines)
          if line.strip("\r\n\t ") and not line.strip().startswith("#")
      ]
  
      # remove triple quotes ' """ '
      nested_c = -1
      skip_lines = []
      for i, line_pair in enumerate(lines):
          for _ in line_pair[1].split('"""')[1:]:
              if nested_c >= 0:
                  skip_lines.extend(list(range(nested_c, i + 1)))
                  nested_c = -1
              else:
                  nested_c = i
      # now select all the
      lines = [
          pair for i, pair in enumerate(lines) if i not in skip_lines
      ]
  
      from_future = re.compile(r"^from[\s]*__future__[\s]*")
      import_future = re.compile(r"^import[\s]*__future__[\s]*")
      # test if we have __future__ import
      found_index = -1
      for a_i, (_, a_line) in enumerate(lines):
          if found_index >= a_i:
              continue
          if from_future.match(a_line) or import_future.match(a_line):
              found_index = a_i
              # check the last import block
              i, line = lines[found_index]
              # wither we have \\ character at the end of the line or the line is indented
              parenthesized_lines = "(" in line and ")" not in line
              while line.endswith("\\") or parenthesized_lines:
                  found_index += 1
                  i, line = lines[found_index]
                  if ")" in line:
                      break
  
          else:
              break
  
      return found_index if found_index < 0 else lines[found_index][0]
  
imports: import inspect
  import json
  import os
  import re
  import tempfile
  from sys import platform
  from functools import reduce
  from logging import getLogger
  from typing import Optional, Sequence, Union, Tuple, List, Callable, Dict, Any
  from pathlib2 import Path
  from six.moves.urllib.parse import urlparse
  from .args import _Arguments
  from .repo import ScriptInfo
  from ...task import Task
label_desc: Use image node_id 6 for calling the CreateAndPopulate obj's underlying member method code with example usage: obj._locate_future_import(lines) and returns: unknown