<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_roles_by_type(resource_root, service_name, role_type, cluster_name="default", view=None):
 """ Get all roles of a certain type in a service @param resource_root: The root Resource object. @param service_name: Service name @param role_type: Role type @param cluster_name: Cluster name @return: A list of ApiRole objects. """

  roles = get_all_roles(resource_root, service_name, cluster_name, view)
  return [ r for r in roles if r.type == role_type ]