def as_draft(location):
 if (location.category in DIRECT_ONLY_CATEGORIES):
  return location
 return location.replace(revision=MongoRevisionKey.draft)

def as_draft ( location ) : if ( location . category in DIRECT_ONLY_CATEGORIES ) : return location return location . replace ( revision = MongoRevisionKey . draft )
returns the location that is the draft for location if the location is in the direct_only_categories .