code: def _validate_1d(a, name, allow_inf=False):
      if np.ndim(a) != 1:
          raise ValueError(
              f"`{name}` must be a one-dimensional sequence."
          )
      if np.isnan(a).any():
          raise ValueError(f"`{name}` must not contain nan.")
      if not allow_inf and np.isinf(a).any():
          raise ValueError(f"`{name}` must contain only finite values.")
  
file_path: scipy/scipy/stats/_censored_data.py
imports: import numpy
label_desc: Use image node_id 1 for calling a global function with example usage: _validate_1d(a, name, allow_inf) without return types