<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def GetSubNodeByLocation(self, location):
 """Retrieves a sub scan node based on the location. Args: location (str):
 location that should match the location of the path specification of a sub scan node. Returns: SourceScanNode: sub scan node or None if not available. """

    for sub_node in self.sub_nodes:
      sub_node_location = getattr(sub_node.path_spec, 'location', None)
      if location == sub_node_location:
        return sub_node

    return None