code: def ensure_targets(targets):
      """Return a Command that checks that certain files exist.
  
      Raises a ValueError if any of the files are missing.
  
      Note: The check is skipped if the `--skip-npm` flag is used.
      """
  
      class TargetsCheck(BaseCommand):
          def run(self):
              if skip_npm:
                  log.info("Skipping target checks")
                  return
              missing = [t for t in targets if not os.path.exists(t)]
              if missing:
                  raise ValueError(("missing files: %s" % missing))
  
      return TargetsCheck
  
imports: from collections import defaultdict
  from os.path import join
  import io
  import os
  import functools
  import pipes
  import re
  import shlex
  import subprocess
  import sys
  from setuptools import Command
  from setuptools.command.build_py import build_py
  from setuptools.command.sdist import sdist
  from distutils import log
  from setuptools.command.develop import develop
  from setuptools.command.bdist_egg import bdist_egg
label_desc: Use image node_id 14 for calling a global function with example usage: ensure_targets(targets) and returns: TargetsCheck