code: def norm(x, p="fro", axis=None, keepdim=False, name=None):
      if axis is None and p is not None:
          if p == "fro":
              p = 2
          ret = ivy.vector_norm(x.flatten(), ord=p, axis=-1)
          if keepdim:
              ret = ret.reshape([1] * len(x.shape))
          return ret
  
      if isinstance(axis, tuple):
          axis = list(axis)
      if isinstance(axis, list) and len(axis) == 1:
          axis = axis[0]
  
      if isinstance(axis, int):
          if p == "fro":
              p = 2
          if p in [0, 1, 2, ivy.inf, -ivy.inf]:
              ret = ivy.vector_norm(
                  x, ord=p, axis=axis, keepdims=keepdim
              )
          elif isinstance(p, (int, float)):
              ret = ivy.pow(
                  ivy.sum(
                      ivy.pow(ivy.abs(x), p),
                      axis=axis,
                      keepdims=keepdim,
                  ),
                  float(1.0 / p),
              )
  
      elif isinstance(axis, list) and len(axis) == 2:
          if p == 0:
              raise ValueError
          elif p == 1:
              ret = ivy.sum(ivy.abs(x), axis=axis, keepdims=keepdim)
          elif p in [2, "fro"]:
              ret = ivy.matrix_norm(
                  x, ord="fro", axis=axis, keepdims=keepdim
              )
          elif p == ivy.inf:
              ret = ivy.max(ivy.abs(x), axis=axis, keepdims=keepdim)
          elif p == -ivy.inf:
              ret = ivy.min(ivy.abs(x), axis=axis, keepdims=keepdim)
          elif isinstance(p, (int, float)) and p > 0:
              ret = ivy.pow(
                  ivy.sum(
                      ivy.pow(ivy.abs(x), p),
                      axis=axis,
                      keepdims=keepdim,
                  ),
                  float(1.0 / p),
              )
          else:
              raise ValueError
  
      else:
          raise ValueError
  
      return ret
  
imports: import ivy
  from ivy.func_wrapper import with_unsupported_dtypes, with_supported_dtypes
  from ivy.functional.frontends.paddle import promote_types_of_paddle_inputs
  from ivy.functional.frontends.paddle.func_wrapper import to_ivy_arrays_and_back
label_desc: Use image node_id 18 for calling a global function with example usage: norm(x, p, axis, keepdim, name) and returns: ret, ret