<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_flattened(dct, names, path_joiner="_"):
 """Flatten a child dicts, whose resulting keys are joined by path_joiner. E.G. { "valuation": { "currency": "USD", "amount": "100" } } -> { "valuation_currency": "USD", "valuation_amount": "100" } """

  new_dct = dict()
  for key, val in dct.items():
    if key in names:
      child = {path_joiner.join(k): v for k, v in flatten_dict(val, (key, ))}
      new_dct.update(child)
    else:
      new_dct[key] = dct[key]
  return new_dct