code: def check_valid(self, values, flag=None):
          
          if self.valid_on_zero:
              valid = values.numpy() == 0
          else:
              if flag is None:
                  flag = self.valid_mask
              valid = numpy.bitwise_and(values.numpy(), flag) == flag
          return bool(numpy.all(valid))
docs: Check if the data contains any non-valid status information
  
          Parameters
          ----------
          values: pycbc.types.Array
              Array of status information
          flag: str, optional
              Override the default valid mask with a user defined mask.
  
          Returns
          -------
          status: boolean
              Returns True if all of the status information if valid,
               False if any is not.