code: def _url_to_report_id(url):
      path_msg = "Path must be `entity/project/reports/report_title--report_id`"
      try:
          report_path, *_ = url.split("?")
          report_path = report_path.replace("---", "--")
  
          if "--" not in report_path:
              raise ValueError(path_msg)
  
          *_, report_id = report_path.split("--")
          if len(report_id) == 0:
              raise ValueError("Invalid report id")
  
          report_id = report_id.strip()
  
          """
                  Server does not generate IDs with correct padding, so decode with default validate=False.
                  Then re-encode it with correct padding.
                  https://stackoverflow.com/questions/2941995/python-ignore-incorrect-padding-error-when-base64-decoding
  
                  Corresponding core app logic that strips the padding in url
                  https://github.com/wandb/core/blob/b563437c1f3237ec35b1fb388ac14abbab7b4279/frontends/app/src/util/url/shared.ts#L33-L78
              """
          report_id = base64.b64encode(
              base64.b64decode(report_id + "==")
          ).decode("utf-8")
  
      except ValueError as e:
          raise ValueError(path_msg) from e
      else:
          return report_id
  
imports: import base64
  import inspect
  import json
  import re
  import urllib
  from copy import deepcopy
  from typing import List
  from ...None import __version__
  from ...None import termlog, termwarn
  from ...sdk.lib import ipython
  from ..public import Api
  from ..public import RetryingClient
  from ._blocks import P, PanelGrid, UnknownBlock, WeaveBlock, block_mapping, weave_blocks
  from .mutations import UPSERT_VIEW, VIEW_REPORT
  from .runset import Runset
  from .util import Attr, Base, Block, coalesce, generate_name, nested_get, nested_set
  from .validators import OneOf, TypeValidator
label_desc: Use image node_id 3 for calling the Report obj's underlying member method code with example usage: obj._url_to_report_id(url) and returns: report_id