getPolicyForPackage = (namingKit, policy) => {
  if (!policy) {
    return undefined;
  }
  if (namingKit.isEntry) {
    return policy.entry;
  }
  const canonicalName = generateCanonicalName(namingKit);
  if (canonicalName === ATTENUATORS_COMPARTMENT) {
    return { defaultAttenuator: policy.defaultAttenuator, packages: 'any' };
  }
  if (policy.resources && policy.resources[canonicalName] !== undefined) {
    return policy.resources[canonicalName];
  } else {
    // Allow skipping policy entries for packages with no powers.
    return create(null);
  }
}
Returns the policy applicable to the canonicalName of the package

@param {PackageNamingKit} namingKit - a key in the policy resources spec is derived from these
@param {SomePolicy} [policy] - user supplied policy