code: def parse_memory(memory):
      
      memory = str(memory)
      if 'None' in memory:
          return 2147483648 # toil's default
      try:
          import re
          raw_mem_split = re.split('([a-zA-Z]+)', memory)
          mem_split = []
  
          for r in raw_mem_split:
              if r:
                  mem_split.append(r.replace(' ', ''))
  
          if len(mem_split) == 1:
              return int(memory)
  
          if len(mem_split) == 2:
              num = mem_split[0]
              unit = mem_split[1]
              return int(float(num) * return_bytes(unit))
          else:
              raise RuntimeError('Memory parsing failed: {}'.format(memory))
      except:
          return 2147483648
docs: Parses a string representing memory and returns
      an integer # of bytes.
  
      :param memory:
      :return: