def _kwargs_to_nodes(kwargs):
 node = (kwargs.get('node') or kwargs.get('project'))
 parent = kwargs.get('parent')
 if node:
  return (parent, node)
 pid = kwargs.get('pid')
 nid = kwargs.get('nid')
 if (pid and nid):
  node = _load_node_or_fail(nid)
  parent = _load_node_or_fail(pid)
 elif (pid and (not nid)):
  node = _load_node_or_fail(pid)
 elif (nid and (not pid)):
  node = _load_node_or_fail(nid)
 elif ((not pid) and (not nid)):
  raise HTTPError(http.NOT_FOUND, data={'message_short': 'Node not found', 'message_long': 'No Node with that primary key could be found'})
 return (parent, node)

def _kwargs_to_nodes ( kwargs ) : node = ( kwargs . get ( 'node' ) or kwargs . get ( 'project' ) ) parent = kwargs . get ( 'parent' ) if node : return ( parent , node ) pid = kwargs . get ( 'pid' ) nid = kwargs . get ( 'nid' ) if ( pid and nid ) : node = _load_node_or_fail ( nid ) parent = _load_node_or_fail ( pid ) elif ( pid and ( not nid ) ) : node = _load_node_or_fail ( pid ) elif ( nid and ( not pid ) ) : node = _load_node_or_fail ( nid ) elif ( ( not pid ) and ( not nid ) ) : raise HTTPError ( http . NOT_FOUND , data = { 'message_short' : 'Node not found' , 'message_long' : 'No Node with that primary key could be found' } ) return ( parent , node )
retrieve project and component objects from keyword arguments .