<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parent(self):

 """return the parent URL, with params, query, and fragment in place"""

        path = '/'.join(self.path.split('/')[:-1])
        s = path.strip('/').split(':')
        if len(s)==2 and s[1]=='':
            return None
        else:
            return self.__class__(self, path=path)