docstr: Return all the hyperpartitions in a given datarun by id.
  By default, only returns incomplete hyperpartitions.
docstr_tok: ["Return","all","the","hyperpartitions","in","a","given","datarun","by","id",".","By","default",",","only","returns","incomplete","hyperpartitions","."]
code: def get_hyperpartitions(
      self,
      dataset_id=None,
      datarun_id=None,
      method=None,
      ignore_gridding_done=True,
      ignore_errored=True,
  ):
      """
      Return all the hyperpartitions in a given datarun by id.
      By default, only returns incomplete hyperpartitions.
      """
      query = self.session.query(self.Hyperpartition)
      if dataset_id is not None:
          query = query.join(self.Datarun).filter(
              self.Datarun.dataset_id == dataset_id
          )
      if datarun_id is not None:
          query = query.filter(
              self.Hyperpartition.datarun_id == datarun_id
          )
      if method is not None:
          query = query.filter(self.Hyperpartition.method == method)
      if ignore_gridding_done:
          query = query.filter(
              self.Hyperpartition.status
              != PartitionStatus.GRIDDING_DONE
          )
      if ignore_errored:
          query = query.filter(
              self.Hyperpartition.status != PartitionStatus.ERRORED
          )
  
      return query.all()
  
imports: from __future__ import absolute_import, unicode_literals
  import hashlib
  import json
  import os
  import pickle
  from builtins import object
  from datetime import datetime
  from io import BytesIO
  from operator import attrgetter
  import boto3
  import numpy
  import pandas
  import pymysql
  from sklearn.model_selection import train_test_split
  from sqlalchemy import Column, DateTime, Enum, ForeignKey, Integer, MetaData, Numeric, String, Text, and_, create_engine, func, inspect
  from sqlalchemy.engine.url import URL
  from sqlalchemy.ext.declarative import declarative_base
  from sqlalchemy.orm import relationship, sessionmaker
  from sqlalchemy.orm.properties import ColumnProperty
  from atm.constants import BUDGET_TYPES, CLASSIFIER_STATUS, DATARUN_STATUS, METRICS, PARTITION_STATUS, SCORE_TARGETS, ClassifierStatus, PartitionStatus, RunStatus
  from atm.data import load_data
  from atm.utilities import base_64_to_object, object_to_base_64
label_desc: Use image node_id 9 for calling the Database obj's underlying member method code with example usage: obj.get_hyperpartitions(dataset_id, datarun_id, method, ignore_gridding_done, ignore_errored) and returns: query