code: def _convertIOB1_to_IOB2(tags: List[str]):
      """
      script taken from: https://gist.github.com/allanj/b9bd448dc9b70d71eb7c2b6dd33fe4ef
      IOB1:  O I I B I
      IOB2:  O B I B I
      Check that tags have a valid IOB format.
      Tags in IOB1 format are converted to IOB2.
      """
      for i, tag in enumerate(tags):
          if tag == "O":
              continue
          split = tag.split("-")
          if len(split) != 2 or split[0] not in ["I", "B"]:
              return False
          if split[0] == "B":
              continue
          elif i == 0 or tags[i - 1] == "O":  # conversion IOB1 to IOB2
              tags[i] = "B" + tag[1:]
          elif tags[i - 1][1:] == tag[1:]:
              continue
          else:  # conversion IOB1 to IOB2
              tags[i] = "B" + tag[1:]
      return True
  
imports: import hashlib
  import json
  import logging
  import os
  import random
  import tarfile
  import tempfile
  import string
  import uuid
  from contextlib import ExitStack
  from itertools import islice
  from pathlib import Path
  import pandas
  from requests import get
  from tqdm import tqdm
  from typing import List
  from farm.file_utils import http_get
  from farm.modeling.tokenization import tokenize_with_metadata
label_desc: Use image node_id 7 for calling a global function with example usage: _convertIOB1_to_IOB2(tags) and returns: True, False