def download(self, layer, force=False):
if layer.is_defined_within_template:<EOL><INDENT>LOG.info("<STR_LIT>", layer.name)<EOL>layer.codeuri = resolve_code_path(self.cwd, layer.codeuri)<EOL>return layer<EOL><DEDENT>layer_path = Path(self.layer_cache).joinpath(layer.name).resolve()  <EOL>is_layer_downloaded = self._is_layer_cached(layer_path)<EOL>layer.codeuri = str(layer_path)<EOL>if is_layer_downloaded and not force:<EOL><INDENT>LOG.info("<STR_LIT>", layer.arn)<EOL>return layer<EOL><DEDENT>layer_zip_path = layer.codeuri + '<STR_LIT>'<EOL>layer_zip_uri = self._fetch_layer_uri(layer)<EOL>unzip_from_uri(layer_zip_uri,<EOL>layer_zip_path,<EOL>unzip_output_dir=layer.codeuri,<EOL>progressbar_label='<STR_LIT>'.format(layer.layer_arn))<EOL>return layer<EOL>
Download a given layer to the local cache.

Parameters
----------
layer samcli.commands.local.lib.provider.Layer
    Layer representing the layer to be downloaded.
force bool
    True to download the layer even if it exists already on the system

Returns
-------
Path
    Path object that represents where the layer is download to