code: def set_cfme_caselevel(testcase, caselevels):
      
      tier = testcase.get("caselevel")
      if tier is None:
          return
  
      try:
          caselevel = caselevels[int(tier)]
      except IndexError:
          # invalid value
          caselevel = "component"
      except ValueError:
          # there's already string value
          return
  
      testcase["caselevel"] = caselevel
docs: Converts tier to caselevel.