code: def parse_keras_weights(weights_path, move_rules=None):
      try:
          import h5py
      except ImportError:
          h5py = None
      assert (
          h5py is not None
      ), "`get_values_from_keras_file` requires `h5py`."
  
      values = []
      with h5py.File(weights_path, mode="r") as f:
          names = [
              n.decode("utf8")
              for n in f.attrs["layer_names"]
              if len(f[n.decode("utf8")].attrs["weight_names"]) > 0
          ]
          if move_rules is not None:
              if isinstance(move_rules, list):
                  for name, loc in move_rules:
                      idx = names.index(name)
                      names.insert(idx + loc, names.pop(idx))
              elif move_rules == "ordered":
                  bn_names, conv_names, other_names = [], [], []
                  for n in names:
                      if "batch" in n:
                          bn_names.append(n)
                      elif "conv" in n:
                          conv_names.append(n)
                      else:
                          other_names.append(n)
                  names = []
                  for n in range(1, len(conv_names) + 1):
                      names.append("conv2d_%d" % n)
                      names.append("batch_normalization_%d" % n)
                  names += other_names
  
          for name in names:
              g = f[name]
              w = [n.decode("utf8") for n in g.attrs["weight_names"]]
              v = [np.asarray(g[n]) for n in w]
              if not tf_later_than("1.4"):
                  if len(v) == 4:
                      w[0], w[1] = w[1], w[0]
                      v[0], v[1] = v[1], v[0]
              values += v
  
      return values
  
imports: from __future__ import absolute_import
  from __future__ import division
  from __future__ import print_function
  import numpy
  import tensorflow
  import warnings
  from contextlib import contextmanager
  from .version_utils import tf_later_than
label_desc: Use image node_id 25 for calling a global function with example usage: parse_keras_weights(weights_path, move_rules) and returns: values