parameters: (device_dir)
return_statement: return "/".join([
        path_item.replace("device_", "device:").replace("_", ":", 1)
        for path_item in path_items])
docstring: Parse device name from device path.
  
    Args:
      device_dir: (str) a directory name for the device.
  
    Returns:
      (str) parsed device name.
docstring_summary: Parse device name from device path.
docstring_tokens: Parse device name from device path .
function: def device_path_to_device_name(device_dir):
    """Parse device name from device path.
  
    Args:
      device_dir: (str) a directory name for the device.
  
    Returns:
      (str) parsed device name.
    """
    path_items = os.path.basename(device_dir)[
        len(METADATA_FILE_PREFIX) + len(DEVICE_TAG):].split(",")
    return "/".join([
        path_item.replace("device_", "device:").replace("_", ":", 1)
        for path_item in path_items])
function_tokens: def device_path_to_device_name ( device_dir ) : path_items = os . path . basename ( device_dir ) [ len ( METADATA_FILE_PREFIX ) + len ( DEVICE_TAG ) : ] . split ( "," ) return "/" . join ( [ path_item . replace ( "device_" , "device:" ) . replace ( "_" , ":" , 1 ) for path_item in path_items ] )