brainstorm/describable.py
def create_from_description(description):
    """
    Instantiate a new object from a description.

    Args:
        description (dict):
            A description of the object.

    Returns:
        A new instance of the described object
    """
    if isinstance(description, dict):
        if '@type' in description:
            name = description['@type']
            for describable in get_inheritors(Describable):
                if describable.__name__ == name:
                    return describable.__new_from_description__(description)
            raise TypeError('No describable class "{}" found!'.format(name))
        else:
            return {k: create_from_description(v)
                    for k, v in description.items()}
    elif (isinstance(description, (bool, float, type(None))) or
          isinstance(description, six.integer_types) or
          isinstance(description, six.string_types)):
        return description
    elif isinstance(description, list):
        return [create_from_description(d) for d in description]

    raise TypeError('Invalid description of type {}'.format(type(description)))

    Instantiate a new object from a description.

    Args:
        description (dict):
            A description of the object.

    Returns:
        A new instance of the described object
    
Instantiate a new object from a description.
Instantiate a new object from a description .
def create_from_description(description):
    if isinstance(description, dict):
        if '@type' in description:
            name = description['@type']
            for describable in get_inheritors(Describable):
                if describable.__name__ == name:
                    return describable.__new_from_description__(description)
            raise TypeError('No describable class "{}" found!'.format(name))
        else:
            return {k: create_from_description(v)
                    for k, v in description.items()}
    elif (isinstance(description, (bool, float, type(None))) or
          isinstance(description, six.integer_types) or
          isinstance(description, six.string_types)):
        return description
    elif isinstance(description, list):
        return [create_from_description(d) for d in description]
    raise TypeError('Invalid description of type {}'.format(type(description)))
def create_from_description ( description ) : if isinstance ( description , dict ) : if '@type' in description : name = description [ '@type' ] for describable in get_inheritors ( Describable ) : if describable . __name__ == name : return describable . __new_from_description__ ( description ) raise TypeError ( 'No describable class "{}" found!' . format ( name ) ) else : return { k : create_from_description ( v ) for k , v in description . items ( ) } elif ( isinstance ( description , ( bool , float , type ( None ) ) ) or isinstance ( description , six . integer_types ) or isinstance ( description , six . string_types ) ) : return description elif isinstance ( description , list ) : return [ create_from_description ( d ) for d in description ] raise TypeError ( 'Invalid description of type {}' . format ( type ( description ) ) )
Instantiate a new object from a description.
Instantiate a new object from a description .
"""
    Instantiate a new object from a description.

    Args:
        description (dict):
            A description of the object.

    Returns:
        A new instance of the described object
    """
A new instance of the described object
A new instance of the described object
description
A description of the object.
A description of the object .