code: def response_is_valid(response, input_restrictions):
      """Check if the response meets the input_restrictions
  
      Args:
          response (str): Description of the information needed
  
      Returns:
          bool: True if input_restrictions are met else False
      """
      valid_response = False
      # Restrict having spaces or colons in items (applies to things like
      # descriptors, etc)
      if isinstance(input_restrictions, re.Pattern):
          valid_response = input_restrictions.match(response)
          if not valid_response:
              LOGGER.error(
                  "The supplied input should match the following "
                  "regular expression: %s",
                  input_restrictions.pattern,
              )
      elif callable(input_restrictions):
          # Functions can be passed here to perform complex validation of input
          # Transform the response with the validating function
          response = input_restrictions(response)
          valid_response = (
              response is not None and response is not False
          )
          if not valid_response:
              LOGGER.error(
                  "The supplied input failed to pass the validation "
                  "function: %s",
                  input_restrictions.__doc__,
              )
      else:
          valid_response = not any(
              x in input_restrictions for x in response
          )
          if not valid_response:
              restrictions = ", ".join(
                  "'{}'".format(restriction)
                  for restriction in input_restrictions
              )
              LOGGER.error(
                  "The supplied input should not contain any of the following: %s",
                  restrictions,
              )
      return valid_response
  
file_path: streamalert/streamalert_cli/helpers.py
imports: from getpass import getpass
  import json
  import os
  import re
  import subprocess
  import boto3
  from botocore.exceptions import ClientError, NoCredentialsError
  from streamalert.shared.logger import get_logger
label_desc: Use image node_id 5 for calling a global function with example usage: response_is_valid(response, input_restrictions) and returns: valid_response