<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def find_path(self, node_source, node_target, type='nodes'):
 """Determines shortest path Determines the shortest path from `node_source` to `node_target` in _graph using networkx' shortest path algorithm. Args ---- node_source: GridDing0 source node, member of _graph node_target: GridDing0 target node, member of _graph type : str Specify if nodes or edges should be returned. Default is `nodes` Returns ------- :any:`list` of :obj:`GridDing0` path: shortest path from `node_source` to `node_target` (list of nodes in _graph) Notes ----- WARNING: The shortest path is calculated using the count of hops, not the actual line lengths! As long as the circuit breakers are open, this works fine since there's only one path. But if they are closed, there are 2 possible paths. The result is a path which have min. count of hops but might have a longer total path length than the second sone. See networkx' function shortest_path() function for details on how the path is calculated. """

        if (node_source in self._graph.nodes()) and (node_target in self._graph.nodes()):
            path = nx.shortest_path(self._graph, node_source, node_target)
        else:
            raise Exception('At least one of the nodes is not a member of graph.')
        if type == 'nodes':
            return path
        elif type == 'edges':
            return [_ for _ in self._graph.edges(nbunch=path, data=True)
                    if (_[0] in path and _[1] in path)]
        else:
            raise ValueError('Please specify type as nodes or edges')