parameters: (message_descriptor, path)
return_statement: return last in message_descriptor.fields_by_name
docstring: Checks whether the path is valid for Message Descriptor.
docstring_summary: Checks whether the path is valid for Message Descriptor.
docstring_tokens: Checks whether the path is valid for Message Descriptor .
function: def _IsValidPath(message_descriptor, path):
    """Checks whether the path is valid for Message Descriptor."""
    parts = path.split('.')
    last = parts.pop()
    for name in parts:
      field = message_descriptor.fields_by_name.get(name)
      if (field is None or
          field.label == FieldDescriptor.LABEL_REPEATED or
          field.type != FieldDescriptor.TYPE_MESSAGE):
        return False
      message_descriptor = field.message_type
    return last in message_descriptor.fields_by_name
function_tokens: def _IsValidPath ( message_descriptor , path ) : parts = path . split ( '.' ) last = parts . pop ( ) for name in parts : field = message_descriptor . fields_by_name . get ( name ) if ( field is None or field . label == FieldDescriptor . LABEL_REPEATED or field . type != FieldDescriptor . TYPE_MESSAGE ) : return False message_descriptor = field . message_type return last in message_descriptor . fields_by_name