parameters: (url)
return_statement: return url
docstring: 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 graphlab.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:
        conver slashes for windows sanity
  
      Parameters
      ----------
      string
          A URL (as described above).
  
      Raises
      ------
      ValueError
          If a bad url is provided.
docstring_summary: 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 graphlab.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:
        conver slashes for windows sanity
docstring_tokens: 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 graphlab . 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 : conver slashes for windows sanity
function: 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 graphlab.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:
        conver 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 seperate 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
function_tokens: def _make_internal_url ( url ) : 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 seperate 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