parameters: (
      bundle_id_bzl=os.path.join(examples_ios, "bundle_id.bzl"))
return_statement: return bundle_id_prefix
docstring: Configures the bundle id prefix to use.
  
    Gets the bundle id prefix in use from bundle_id.bzl; sets up a unique
    prefix if not already set.
  
    Args:
      bundle_id_bzl: Path to the bzl file where the bundle id is stored.
  
    Returns:
      The bundle id prefix to use.
  
    Raises:
      Exception: If parsing of bundle_id.bzl fails.
docstring_summary: Configures the bundle id prefix to use.
docstring_tokens: Configures the bundle id prefix to use .
function: def configure_bundle_id_prefix(
      bundle_id_bzl=os.path.join(examples_ios, "bundle_id.bzl")) -> str:
    """Configures the bundle id prefix to use.
  
    Gets the bundle id prefix in use from bundle_id.bzl; sets up a unique
    prefix if not already set.
  
    Args:
      bundle_id_bzl: Path to the bzl file where the bundle id is stored.
  
    Returns:
      The bundle id prefix to use.
  
    Raises:
      Exception: If parsing of bundle_id.bzl fails.
    """
    bundle_id_re = re.compile(
        r'^BUNDLE_ID_PREFIX\s*=\s*"(.*)"', flags=re.MULTILINE)
  
    with open(bundle_id_bzl, "r") as f:
      contents = f.read()
    match = bundle_id_re.search(contents)
    if not match:
      raise Exception("could not find BUNDLE_ID_PREFIX")
  
    bundle_id_prefix = match.group(1)
    # The default value contains a *, which is an invalid character in bundle IDs.
    if "*" in bundle_id_prefix:
      bundle_id_prefix = str(uuid.uuid4()) + ".mediapipe.examples"
      contents = contents[:match.start(1)] + bundle_id_prefix + contents[match
                                                                         .end(1):]
      with open(bundle_id_bzl, "w") as f:
        f.write(contents)
      print("Set up a unique bundle ID prefix: " + bundle_id_prefix)
  
    return bundle_id_prefix
function_tokens: def configure_bundle_id_prefix ( bundle_id_bzl = os . path . join ( examples_ios , "bundle_id.bzl" ) ) -> str : bundle_id_re = re . compile ( r'^BUNDLE_ID_PREFIX\s*=\s*"(.*)"' , flags = re . MULTILINE ) with open ( bundle_id_bzl , "r" ) as f : contents = f . read ( ) match = bundle_id_re . search ( contents ) if not match : raise Exception ( "could not find BUNDLE_ID_PREFIX" ) bundle_id_prefix = match . group ( 1 ) # The default value contains a *, which is an invalid character in bundle IDs. if "*" in bundle_id_prefix : bundle_id_prefix = str ( uuid . uuid4 ( ) ) + ".mediapipe.examples" contents = contents [ : match . start ( 1 ) ] + bundle_id_prefix + contents [ match . end ( 1 ) : ] with open ( bundle_id_bzl , "w" ) as f : f . write ( contents ) print ( "Set up a unique bundle ID prefix: " + bundle_id_prefix ) return bundle_id_prefix