code: def extract_year(question_tokens: List[str], question: str) -> str:
      question_patterns = [
          r".*\d{1,2}/\d{1,2}/(\d{4}).*",
          r".*\d{1,2}-\d{1,2}-(\d{4}).*",
          r".*(\d{4})-\d{1,2}-\d{1,2}.*",
      ]
      from_to_patterns = [
          r"from ([\d]{3,4}) to [\d]{3,4}",
          r"с ([\d]{3,4}) по [\d]{3,4}",
      ]
      token_patterns = [r"(\d{4})", r"^(\d{4})-.*", r".*-(\d{4})$"]
      year = ""
      for pattern in question_patterns:
          fnd = re.search(pattern, question)
          if fnd is not None:
              year = fnd.group(1)
              break
      else:
          for pattern in from_to_patterns:
              fnd = re.findall(pattern, question)
              if fnd:
                  return fnd[0]
          for token in question_tokens:
              for pattern in token_patterns:
                  fnd = re.search(pattern, token)
                  if fnd is not None:
                      return fnd.group(1)
      return year
  
file_path: DeepPavlov/deeppavlov/models/kbqa/utils.py
imports: import itertools
  import re
  from collections import namedtuple
  from typing import List, Tuple, Dict, Any
label_desc: Use image node_id 2 for calling a global function with example usage: extract_year(question_tokens, question) and returns: year, fnd, fnd