code: def unit_is_related(self, location, worksheet):
          '''
          Checks for relationship between a unit location and this block.
  
          Returns:
              True if the location is related to this block.
          '''
          same_worksheet = worksheet == self.worksheet
          if isinstance(location, (tuple, list)):
              return (location[0] >= self.start[0] and location[0] < self.end[0] and
                      location[1] >= self.start[1] and location[1] < self.end[1] and
                      same_worksheet)
          else:
              return same_worksheef unit_is_related(self, location, worksheet):
          '''
          Checks for relationship between a unit location and this block.
  
          Returns:
              True if the location is related to this block.
          '''
          same_worksheet = worksheet == self.worksheet
          if isinstance(location, (tuple, list)):
              return (location[0] >= self.start[0] and location[0] < self.end[0] and
                      location[1] >= self.start[1] and location[1] < self.end[1] and
                      same_worksheet)
          else:
              return same_worksheet
docs: Checks for relationship between a unit location and this block.
  
          Returns:
              True if the location is related to this block.