code: def build(self, plot):
          
          get_property = plot.theme.themeables.property
  
          # by default, guide boxes are vertically aligned
          with suppress(KeyError):
              self.box_direction = get_property('legend_box')
          if self.box_direction is None:
              self.box_direction = 'vertical'
  
          with suppress(KeyError):
              self.position = get_property('legend_position')
  
          if self.position == 'none':
              return
  
          # justification of legend boxes
          with suppress(KeyError):
              self.box_align = get_property('legend_box_just')
          if self.box_align is None:
              if self.position in {'left', 'right'}:
                  tmp = 'left'
              else:
                  tmp = 'center'
              self.box_align = tmp
  
          with suppress(KeyError):
              self.box_margin = get_property('legend_box_margin')
          if self.box_margin is None:
              self.box_margin = 10
  
          with suppress(KeyError):
              self.spacing = get_property('legend_spacing')
          if self.spacing is None:
              self.spacing = 10
  
          gdefs = self.train(plot)
          if not gdefs:
              return
  
          gdefs = self.merge(gdefs)
          gdefs = self.create_geoms(gdefs, plot)
  
          if not gdefs:
              return
  
          gboxes = self.draw(gdefs, plot.theme)
          bigbox = self.assemble(gboxes, gdefs, plot.theme)
          return bigbox
docs: Build the guides
  
          Parameters
          ----------
          plot : ggplot
              ggplot object being drawn
  
          Returns
          -------
          box : matplotlib.offsetbox.Offsetbox | None
              A box that contains all the guides for the plot.
              If there are no guides, **None** is returned.