<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_package_manager(self, target=None):
 """Returns package manager for target argument or global config."""

    package_manager = None
    if target:
      target_package_manager_field = target.payload.get_field('package_manager')
      if target_package_manager_field:
        package_manager = target_package_manager_field.value
    return self.node_distribution.get_package_manager(package_manager=package_manager)