def date_created(document):
 return (document[config.DATE_CREATED] if (config.DATE_CREATED in document) else epoch())

def date_created ( document ) : return ( document [ config . DATE_CREATED ] if ( config . DATE_CREATED in document ) else epoch ( ) )
if date_created is missing we assume that it has been created outside of the api context and inject a default value .