code: def _make_internal_url(url):
      """
      Process user input url string with proper normalization
      For all urls:
        Expands ~ to $HOME
      For S3 urls:
        Returns the s3 URL with credentials filled in using turicreate.aws.get_aws_credential().
        For example: "s3://mybucket/foo" -> "s3://$AWS_ACCESS_KEY_ID:$AWS_SECRET_ACCESS_KEY:mybucket/foo".
      For hdfs urls:
        Error if hadoop classpath is not set
      For local file urls:
        convert slashes for windows sanity
  
      Parameters
      ----------
      string
          A URL (as described above).
  
      Raises
      ------
      ValueError
          If a bad url is provided.
      """
      if not url:
          raise ValueError("Invalid url: %s" % url)
  
      from .. import _sys_util
      from . import _file_util
  
      # Convert Windows paths to Unix-style slashes
      url = _convert_slashes(url)
  
      # Try to split the url into (protocol, path).
      protocol = _file_util.get_protocol(url)
      is_local = False
      if protocol in ["http", "https"]:
          pass
      elif protocol == "hdfs":
          if not _sys_util.get_hadoop_class_path():
              raise ValueError(
                  "HDFS URL is not supported because Hadoop not found. Please make hadoop available from PATH or set the environment variable HADOOP_HOME and try again."
              )
      elif protocol == "s3":
          return _try_inject_s3_credentials(url)
      elif protocol == "":
          is_local = True
      elif protocol == "local" or protocol == "remote":
          # local and remote are legacy protocol for separate server process
          is_local = True
          # This code assumes local and remote are same machine
          url = _re.sub(protocol + "://", "", url, count=1)
      else:
          raise ValueError(
              "Invalid url protocol %s. Supported url protocols are: local, s3://, https:// and hdfs://"
              % protocol
          )
  
      if is_local:
          url = _os.path.abspath(_os.path.expanduser(url))
      return url
  
imports: from __future__ import print_function
  from __future__ import division
  from __future__ import absolute_import
  import os
  import urllib
  import re
  import itertools
  import uuid
  import datetime
  import sys
  from ._sframe_generation import generate_random_sframe
  from ._sframe_generation import generate_random_regression_sframe
  from ._sframe_generation import generate_random_classification_sframe
  from ._type_checks import _raise_error_if_not_of_type
  from ._type_checks import _is_non_string_iterable
  from ._progress_table_printer import ProgressTablePrinter
label_desc: Use image node_id 5 for calling a global function with example usage: _make_internal_url(url) and returns: url, _try_inject_s3_credentials