<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def sort_loading_order(step_files):
 """Sort step files into correct loading order. The correct loading order is first tools, then workflows without subworkflows, and then workflows with subworkflows. This order is required to avoid error messages when a working directory is used. """

    tools = []
    workflows = []
    workflows_with_subworkflows = []

    for f in step_files:
        # assume that urls are tools
        if f.startswith('http://') or f.startswith('https://'):
            tools.append(f)
        else:
            obj = load_yaml(f)
            if obj.get('class', '') == 'Workflow':
                if 'requirements' in obj.keys():
                    subw = {'class': 'SubworkflowFeatureRequirement'}
                    if subw in obj['requirements']:
                        workflows_with_subworkflows.append(f)
                    else:
                        workflows.append(f)
                else:
                    workflows.append(f)
            else:
                tools.append(f)
    return tools + workflows + workflows_with_subworkflows