def apply_styles(graph, styles):
    """ Apply styles to graph

    Note:
        Also have a look at :class:`smalisca.core.GraphConfig`

    Args:
        graph (Graph): Graph to apply styles to
        styles (dict): List of styles

    Returns:
        Graph: Return modified Graph

    Examples:

        # Define styles
        graph_styles = {
            'graph': {
                'rankdir': 'LR',
                'splines': 'ortho',
                'bgcolor': 'black'
            },
            'nodes': {
                'shape': 'record',
                'color': 'orange',
                'fontcolor': 'orange',
                'style': 'filled',
                'fillcolor': '#1c1c1c'
            },
            'edges': {
                'color': 'orange'
            }
        }

        # Apply styles
        apply_styles(myGraph, graph_styles)

    """
    graph.graph_attr.update('graph' in styles and styles['graph'] or {})
    graph.node_attr.update('nodes' in styles and styles['nodes'] or {})
    graph.edge_attr.update('edges' in styles and styles['edges'] or {})
