<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def trim_and_pad_all_features(features, length):
 """Trim and pad first dimension of all features to size length."""

  return {k: _trim_and_pad(v, length) for k, v in features.items()}