code: def run(self):
      has_build_utilities = self.has_build_utilities()
      if not has_build_utilities:
          log.error(
              "`yarn` and/or `npm` are unavailable but are necessary for this build."
          )
  
      env = os.environ.copy()
      env["PATH"] = npm_path
  
      if build_all:
          log.info(
              "Installing build dependencies with yarn. This may take a while..."
          )
          check_call(
              ["yarn", "bootstrap"],
              cwd=yarn_root,
              stdout=sys.stdout,
              stderr=sys.stderr,
              env=env,
          )
      else:
          log.info(
              "Installing build dependencies with `npm run build`."
          )
          check_call(
              ["npm", "run", "build"],
              cwd=widget_dir,
              stdout=sys.stdout,
              stderr=sys.stderr,
              env=env,
          )
  
      self.clean_frontend_build()
      self.copy_frontend_build()
  
      for t in self.target_files:
          if not os.path.exists(t):
              msg = "Missing file: %s" % t
              if not has_build_utilities:
                  msg += "\nyarn is required to build a development version of widgetsnbextension"
              raise ValueError(msg)
  
      # update package data in case this created new files
      update_package_data(self.distribution)
  
imports: from __future__ import print_function
  from distutils.command.install import install
  from setuptools import setup, find_packages, Command
  from setuptools.command.sdist import sdist
  from setuptools.command.build_py import build_py
  from setuptools.command.egg_info import egg_info
  from setuptools.command.develop import develop
  import atexit
  from distutils import log
  import os
  from shutil import copy
  from subprocess import check_call, check_output
  import sys
label_desc: Use image node_id 6 for calling the FrontendBuild obj's underlying member method code with example usage: obj.run() without return types