def parse(uri, user=None, port=<NUM_LIT>):
uri = uri.strip()<EOL>if not user:<EOL><INDENT>user = getpass.getuser()<EOL><DEDENT>if '<STR_LIT:@>' in uri:<EOL><INDENT>user = uri.split("<STR_LIT:@>")[<NUM_LIT:0>]<EOL><DEDENT>if '<STR_LIT::>' in uri:<EOL><INDENT>port = uri.split("<STR_LIT::>")[-<NUM_LIT:1>]<EOL><DEDENT>try:<EOL><INDENT>port = int(port)<EOL><DEDENT>except ValueError:<EOL><INDENT>raise ValueError("<STR_LIT>")<EOL><DEDENT>uri = re.sub("<STR_LIT>", "<STR_LIT>", uri)<EOL>uri = re.sub("<STR_LIT>", "<STR_LIT>", uri)<EOL>host = uri<EOL>return (<EOL>user,<EOL>host,<EOL>port,<EOL>)<EOL>
parses ssh connection uri-like sentences.
ex:
    - root@google.com -> (root, google.com, 22)
    - noreply@facebook.com:22 -> (noreply, facebook.com, 22)
    - facebook.com:3306 -> ($USER, facebook.com, 3306)
    - twitter.com -> ($USER, twitter.com, 22)

default port: 22
default user: $USER (getpass.getuser())