Get list of experiment resources from a SCO-API.

    Parameters
    ----------
    listing_url : string
        url for experiments run listing.
    offset : int
        Starting offset for returned list items
    limit : int
        Limit the number of items in the result
    properties : List(string)
        List of additional object properties to be included for items in
        the result

    Returns
    -------
    List(scoserv.ModelRunDescriptor)
        List of model run descriptors

def get_run_listing(listing_url, offset, limit, properties):
    """Get list of experiment resources from a SCO-API.

    Parameters
    ----------
    listing_url : string
        url for experiments run listing.
    offset : int
        Starting offset for returned list items
    limit : int
        Limit the number of items in the result
    properties : List(string)
        List of additional object properties to be included for items in
        the result

    Returns
    -------
    List(scoserv.ModelRunDescriptor)
        List of model run descriptors
    """
    # Create listing query based on given arguments
    query = [
        QPARA_OFFSET + '=' + str(offset),
        QPARA_LIMIT + '=' + str(limit)
    ]
    # Ensure that the run state is included in the listing as attribute
    props = ['state']
    # Add properties argument if property list is not None and not empty
    if not properties is None:
        for prop in properties:
            if not prop in props:
                props.append(prop)
    query.append(QPARA_ATTRIBUTES + '=' + ','.join(props))
    # Add query to Url.
    url = listing_url + '?' + '&'.join(query)
    # Get subject listing Url for given SCO-API and decorate it with
    # given listing arguments. Then retrieve listing from SCO-API.
    json_obj = JsonResource(url).json
    # Convert result into a list of resource handles and return the result
    resources = []
    for element in json_obj['items']:
        resource = ModelRunDescriptor(element)
        # Add additional properties to resource if list is given
        if not properties is None:
            resource.properties = {}
            for prop in properties:
                if prop in element:
                    resource.properties[prop] = element[prop]
        resources.append(resource)
    return resources