code: def _id_gen(val) -> str:
      if isinstance(val, list):
          return "-".join(
              takewhile(lambda v: not v.startswith("-"), val)
          )
      return str(val)
  
imports: from itertools import takewhile
  import pytest
  from dvc.cli import parse_args
label_desc: Use image node_id 1 for calling a global function with example usage: _id_gen(val) and returns: str, str