def create_policy(api, configuration, api_version, api_exception, policy_name):
    """ Creates a policy that inherits from the base policy

    :param api: The Deep Security API modules.
    :param configuration: Configuration object to pass to the api client.
    :param api_version: The version of the API to use.
    :param api_exception: The Deep Security API exception module.
    :param policy_name: The name of the policy.
    :return: A PoliciesAPI object for the new policy.
    """

    # Create and configure a new policy
    new_policy = api.Policy()
    new_policy.name = policy_name
    new_policy.description = "Inherits from Base policy"
    new_policy.detection_engine_state = "off"
    new_policy.auto_requires_update = "on"

    # Create search criteria to retrieve the Base Policy
    search_criteria = api.SearchCriteria()
    search_criteria.field_name = "name"
    search_criteria.string_test = "equal"
    search_criteria.string_value = "%Base Policy%"
    search_criteria.max_results = 1

    # Create a search filter and pass the search criteria to it
    search_filter = api.SearchFilter(None, [search_criteria])

    # Search for the Base Policy
    policies_api = api.PoliciesApi(api.ApiClient(configuration))
    policy_search_results = policies_api.search_policies(api_version, search_filter=search_filter)

    # Set the parent ID of the new policy to the ID of the Base Policy
    new_policy.parent_id = policy_search_results.policies[0].id

    # Add the new policy to Deep Security Manager
    created_policy = policies_api.create_policy(new_policy, api_version)

    return created_policy