<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def as_object(obj):
 """Return a JSON serializable type for ``o``. Args: obj (:py:class:`object`):
 the object to be serialized. Raises: :py:class:`AttributeError`: when ``o`` is not a Python object. Returns: (dict):
 JSON serializable type for the given object. """

    LOGGER.debug('as_object(%s)', obj)

    if isinstance(obj, datetime.date):
        return as_date(obj)

    elif hasattr(obj, '__dict__'):

        # populate dict with visible attributes
        out = {k: obj.__dict__[k] for k in obj.__dict__ if not k.startswith('_')}

        # populate dict with property names and values
        for k, v in (
                (p, getattr(obj, p))
                for p, _ in inspect.getmembers(
                    obj.__class__,
                    lambda x: isinstance(x, property))
        ):
            out[k] = v

        return out