code: def evaluate_strings_with_given_variables(
      strs_to_execute, variable_dict=None
  ):
      """Executes a list of python strings and returns the results as a list.
      variable_dict is a dictionary mapping strings to values which may be used in
      str_to_execute.
      """
      if variable_dict is None:
          variable_dict = {}
      if not isinstance(strs_to_execute, list):
          got_list_of_constraints = False
          strs_to_execute = [strs_to_execute]
      else:
          got_list_of_constraints = True
      # Now set local variables
      for key, value in variable_dict.items():
          locals()[key] = value
      ret = []
      for elem in strs_to_execute:
          curr_result = eval(elem)
          ret.append(curr_result)
      if got_list_of_constraints:
          return ret
      else:
          return ret[0]
  
imports: from __future__ import print_function
  from __future__ import division
  import numpy
  from scipy.sparse import dok_matrix
  from scipy.linalg import solve_triangular
label_desc: Use image node_id 18 for calling a global function with example usage: evaluate_strings_with_given_variables(strs_to_execute, variable_dict) and returns: ret, ret