code: def shell_call(command, **kwargs):
      """Calls shell command with argument substitution.
  
      Args:
        command: command represented as a list. Each element of the list is one
          token of the command. For example "cp a b" becomes ['cp', 'a', 'b']
          If any element of the list looks like '${NAME}' then it will be replaced
          by value from **kwargs with key 'NAME'.
        **kwargs: dictionary with argument substitution
  
      Returns:
        output of the command
  
      Raises:
        subprocess.CalledProcessError if command return value is not zero
  
      This function is useful when you need to do variable substitution prior
      running the command. Below are few examples of how it works:
  
        shell_call(['cp', 'a', 'b'], a='asd') calls command 'cp a b'
  
        shell_call(['cp', '${a}', 'b'], a='asd') calls command 'cp asd b',
        '${a}; was replaced with 'asd' before calling the command
      """
      # Regular expression to find instances of '${NAME}' in a string
      CMD_VARIABLE_RE = re.compile("^\\$\\{(\\w+)\\}$")
      command = list(command)
      for i in range(len(command)):
          m = CMD_VARIABLE_RE.match(command[i])
          if m:
              var_id = m.group(1)
              if var_id in kwargs:
                  command[i] = kwargs[var_id]
      str_command = " ".join(command)
      logging.debug("Executing shell command: %s" % str_command)
      return subprocess.check_output(command)
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  from __future__ import unicode_literals
  from collections import OrderedDict
  import warnings
  import logging
  import os
  import re
  import subprocess
  import numpy
  from six.moves import xrange
label_desc: Use image node_id 15 for calling a global function with example usage: shell_call(command) and returns: subprocess