human
Complete this python program:
def base_concrete_model(abstract, model):
assistant
#Here is the Python code you requested.

    """Used in methods of abstract models to find the super-most concrete
    (non abstract) model in the inheritance chain that inherits from the
    given abstract model. This is so the methods in the abstract model can
    query data consistently across the correct concrete model.
    Consider the following::
    class Abstract(models.Model)
    class Meta:
    abstract = True
    def concrete(self):
    return base_concrete_model(Abstract, self)
    class Super(Abstract):
    pass
    class Sub(Super):
    pass
    sub = Sub.objects.create()
    sub.concrete() # returns Super
    In actual Mezzanine usage, this allows methods in the ``Displayable`` and
    ``Orderable`` abstract models to access the ``Page`` instance when
    instances of custom content types, (eg: models that inherit from ``Page``)
    need to query the ``Page`` model to determine correct values for ``slug``
    and ``_order`` which are only relevant in the context of the ``Page``
    model and not the model of the custom content type.
    """
    if hasattr(model, u'objects'):
        return (model if model._meta.abstract else _base_concrete_model(abstract, model))
    return (_base_concrete_model(abstract, model.__class__) or model.__class__)