code: def validate_marked_location(location):
      
      if not isinstance(location, (Location, FoldScopeLocation)):
          raise TypeError(u'Expected Location or FoldScopeLocation location, got: {} {}'.format(
              type(location).__name__, location))
  
      if location.field is not None:
          raise GraphQLCompilationError(u'Cannot mark location at a field: {}'.format(location))
docs: Validate that a Location object is safe for marking, and not at a field.