code: def _compute_layer_version(is_defined_within_template, arn):
          
  
          if is_defined_within_template:
              return None
  
          try:
              _, layer_version = arn.rsplit(':', 1)
              layer_version = int(layer_version)
          except ValueError:
              raise InvalidLayerVersionArn(arn + " is an Invalid Layer Arn.")
  
          return layer_version
docs: Parses out the Layer version from the arn
  
          Parameters
          ----------
          is_defined_within_template bool
              True if the resource is a Ref to a resource otherwise False
          arn str
              ARN of the Resource
  
          Returns
          -------
          int
              The Version of the LayerVersion