code: def conditionally_inline_policies(role_name, sr_entry):
    
    service_type = sr_entry['type']
    if not (service_type in SERVICE_TYPE_ROLE and "policies" in sr_entry):
      print_if_verbose("not eligible for policies; service_type: {} is not valid for policies "
                       "or no 'policies' key in service registry for this role".format(service_type))
      return
  
    for policy_name in sr_entry['policies']:
      print_if_verbose("loading policy: {} for role: {}".format(policy_name, role_name))
      try:
        policy_document = resolve_policy_document(policy_name)
      except:
        fail("Exception loading policy: {} for role: {}".format(policy_name, role_name), sys.exc_info())
  
      # inline the policy onto the role
      if CONTEXT.commit:
        try:
          CLIENTS["iam"].put_role_policy(RoleName=role_name, PolicyName=policy_name, PolicyDocument=policy_document)
        except:
          fail("Exception putting policy: {} onto role: {}".format(policy_name, role_name), sys.exc_info())
docs: If 'policies' key lists the filename prefixes of policies to bind to the role,
    load them from the expected path and inline them onto the role
    Args:
      role_name: name of the role to attach the policies to
      sr_entry: service registry entry