Returns the built and processed entity form for the given entity.
EntityInterface $entity: The entity to be created or edited.
$operation: (optional) The operation identifying the form variation to be returned.
The processed form for the given entity and operation.
function entity_get_form(EntityInterface $entity, $operation = 'default', $langcode = NULL) {
$form_state = entity_form_state_defaults($entity, $operation, $langcode);
$form_id = entity_form_id($entity, $operation);
return drupal_build_form($form_id, $form_state);
}