def list_ranges(self, share_name, directory_name, file_name,<EOL>start_range=None, end_range=None, timeout=None):
_validate_not_none('<STR_LIT>', share_name)<EOL>_validate_not_none('<STR_LIT>', file_name)<EOL>request = HTTPRequest()<EOL>request.method = '<STR_LIT:GET>'<EOL>request.host = self._get_host()<EOL>request.path = _get_path(share_name, directory_name, file_name)<EOL>request.query = [<EOL>('<STR_LIT>', '<STR_LIT>'),<EOL>('<STR_LIT>', _int_to_str(timeout)),<EOL>]<EOL>if start_range is not None:<EOL><INDENT>_validate_and_format_range_headers(<EOL>request,<EOL>start_range,<EOL>end_range,<EOL>start_range_required=False,<EOL>end_range_required=False)<EOL><DEDENT>response = self._perform_request(request)<EOL>return _convert_xml_to_ranges(response)<EOL>
Retrieves the valid ranges for a file.

:param str share_name:
    Name of existing share.
:param str directory_name:
    The path to the directory.
:param str file_name:
    Name of existing file.
:param int start_range:
    Specifies the start offset of bytes over which to list ranges.
    The start_range and end_range params are inclusive.
    Ex: start_range=0, end_range=511 will download first 512 bytes of file.
:param int end_range:
    Specifies the end offset of bytes over which to list ranges.
    The start_range and end_range params are inclusive.
    Ex: start_range=0, end_range=511 will download first 512 bytes of file.
:param int timeout:
    The timeout parameter is expressed in seconds.
:returns: a list of valid ranges
:rtype: a list of :class:`.FileRange`