code: def exist_partitions(self, prefix_spec=None):
          
          try:
              next(self.partitions.iterate_partitions(spec=prefix_spec))
          except StopIteration:
              return False
          return True
docs: Check if partitions with provided conditions exist.
  
          :param prefix_spec: prefix of partition
          :return: whether partitions exist