app/src/algorithm/__init__.py
def new_volume_mounts_with_canonical_mount_path(
        for_volumes: List[Dict],
        name_map: Dict[str, str]=None,
        sub_path_map: Dict[str, str]=None) -> List[Dict]:
    """Creates a list of canonical volumeMounts for a given list of Volumes.

    Args:
        for_volumes: List of volumes to create volumeMounts for.
        name_map:
            Dict mapping volume names, this allows volumes to be mapped to
            canonical mountPaths of other volumes. See get_canonical_mount_path.
        sub_path_map:
            Dict mapping volume names to subPaths. This allows the resulting
            mountPath to only include a certain subPath for a certain volume.
            Example:

                >>> sub_path_map = {"some-volume": "some/sub/path"}

    Returns:
        List of volumeMounts for the given volumes.
    """
    volume_mounts = [{
        "name": v["name"],
        "mountPath": get_canonical_mount_path(v, name_map)
    } for v in for_volumes]

    if sub_path_map:
        return [{**vm, "subPath": sub_path_map[vm["name"]]}
                if vm["name"] in sub_path_map else vm
                for vm in volume_mounts]
    return [to_camel_case(vm) for vm in volume_mounts]
Creates a list of canonical volumeMounts for a given list of Volumes.

    Args:
        for_volumes: List of volumes to create volumeMounts for.
        name_map:
            Dict mapping volume names, this allows volumes to be mapped to
            canonical mountPaths of other volumes. See get_canonical_mount_path.
        sub_path_map:
            Dict mapping volume names to subPaths. This allows the resulting
            mountPath to only include a certain subPath for a certain volume.
            Example:

                >>> sub_path_map = {"some-volume": "some/sub/path"}

    Returns:
        List of volumeMounts for the given volumes.
    
Creates a list of canonical volumeMounts for a given list of Volumes.
Creates a list of canonical volumeMounts for a given list of Volumes .
def new_volume_mounts_with_canonical_mount_path(
        for_volumes: List[Dict],
        name_map: Dict[str, str]=None,
        sub_path_map: Dict[str, str]=None) -> List[Dict]:
    volume_mounts = [{
        "name": v["name"],
        "mountPath": get_canonical_mount_path(v, name_map)
    } for v in for_volumes]
    if sub_path_map:
        return [{**vm, "subPath": sub_path_map[vm["name"]]}
                if vm["name"] in sub_path_map else vm
                for vm in volume_mounts]
    return [to_camel_case(vm) for vm in volume_mounts]
def new_volume_mounts_with_canonical_mount_path ( for_volumes : List [ Dict ] , name_map : Dict [ str , str ] = None , sub_path_map : Dict [ str , str ] = None ) -> List [ Dict ] : volume_mounts = [ { "name" : v [ "name" ] , "mountPath" : get_canonical_mount_path ( v , name_map ) } for v in for_volumes ] if sub_path_map : return [ { ** vm , "subPath" : sub_path_map [ vm [ "name" ] ] } if vm [ "name" ] in sub_path_map else vm for vm in volume_mounts ] return [ to_camel_case ( vm ) for vm in volume_mounts ]
Creates a list of canonical volumeMounts for a given list of Volumes.
Creates a list of canonical volumeMounts for a given list of Volumes .
"""Creates a list of canonical volumeMounts for a given list of Volumes.

    Args:
        for_volumes: List of volumes to create volumeMounts for.
        name_map:
            Dict mapping volume names, this allows volumes to be mapped to
            canonical mountPaths of other volumes. See get_canonical_mount_path.
        sub_path_map:
            Dict mapping volume names to subPaths. This allows the resulting
            mountPath to only include a certain subPath for a certain volume.
            Example:

                >>> sub_path_map = {"some-volume": "some/sub/path"}

    Returns:
        List of volumeMounts for the given volumes.
    """
List of volumeMounts for the given volumes.
List of volumeMounts for the given volumes .
for_volumes
List[Dict]
List of volumes to create volumeMounts for.
List of volumes to create volumeMounts for .
name_map
Dict[str, str]
Dict mapping volume names, this allows volumes to be mapped to
canonical mountPaths of other volumes. See get_canonical_mount_path.
Dict mapping volume names this allows volumes to be mapped to canonical mountPaths of other volumes . See get_canonical_mount_path .
sub_path_map
Dict[str, str]
Dict mapping volume names to subPaths. This allows the resulting
mountPath to only include a certain subPath for a certain volume.
Example.

>>> sub_path_map = {"some-volume": "some/sub/path"}
Dict mapping volume names to subPaths . This allows the resulting mountPath to only include a certain subPath for a certain volume . Example . >>> sub_path_map = { " some - volume " : " some / sub / path " }