code: def _parse_from_string(string_input):
          read_lines = list(filter(None, string_input.split('\n')))
          if read_lines[0].startswith('
              comment = read_lines.pop(0)
          else:
              comment = ''
          if len(read_lines) > 1:
              order = int(math.sqrt(len(read_lines)))
          else:
              order = int(math.sqrt(math.sqrt(len(read_lines[0]))))
              read_lines = filter(lambda x: len(x) == (order ** 2), [read_lines[0][i:(i + order ** 2)] for
                                  i in utils.range_(len(read_lines[0])) if i % (order ** 2) == 0])
          matrix = utils.get_list_of_lists(
              order ** 2, order ** 2, fill_with=0)
          for i, line in enumerate(read_lines):
              line = line.strip()
              for j, value in enumerate(line):
                  if value.isdigit() and int(value):
                      matrix[i][j] = int(value)
                  else:
                      matrix[i][j] = 0
          return order, comment, matrix