nodes: 0, module; 1, function_definition; 2, function_name:paths_by_depth; 3, parameters; 4, block; 5, identifier:paths; 6, expression_statement; 7, return_statement; 8, comment:"""Sort list of paths by number of directories in it
  
      .. todo::
  
          check if a final '/' is consistently given or ommitted.
  
      :param iterable paths: iterable containing paths (str)
      :rtype: list
      """; 9, call; 10, identifier:sorted; 11, argument_list; 12, identifier:paths; 13, keyword_argument; 14, keyword_argument; 15, identifier:key; 16, lambda; 17, identifier:reverse; 18, True; 19, lambda_parameters; 20, call; 21, identifier:path; 22, attribute; 23, argument_list; 24, identifier:path; 25, identifier:count; 26, attribute; 27, attribute; 28, identifier:sep; 29, identifier:os; 30, identifier:path
code: def paths_by_depth(paths):
      """Sort list of paths by number of directories in it
  
      .. todo::
  
          check if a final '/' is consistently given or ommitted.
  
      :param iterable paths: iterable containing paths (str)
      :rtype: list
      """
      return sorted(
              paths,
              key=lambda path: path.count(os.path.sep),
              reverse=True
      )