code: def from_json(raw):
      
      ncls = None
      _type = raw.get('type')
      try:
          ncls = _type_map[NodeType(_type)]
      except (KeyError, ValueError) as e:
          logger.warning('Unknown node type: %s', _type)
          if DEBUG:
              raise_from(exception.ParseException('Parse error for %s' % (_type), raw), e)
          return None
      node = ncls()
      node.load(raw)
  
      return node
docs: Helper to construct a node from a dict.
  
      Args:
          raw (dict): Raw node representation.
  
      Returns:
          Node: A Node object or None.