parameters: (file, basedir)
return_statement: return None
docstring: Returns relative path from 'basedir' to 'file', assuming 'file' lives beneath 'basedir'. If it doesn't, returns None.
docstring_summary: Returns relative path from 'basedir' to 'file', assuming 'file' lives beneath 'basedir'. If it doesn't, returns None.
docstring_tokens: Returns relative path from basedir to file assuming file lives beneath basedir . If it doesn t returns None .
function: def getRelativePath(file, basedir):
      """Returns relative path from 'basedir' to 'file', assuming 'file' lives beneath 'basedir'. If it doesn't, returns None."""
      file = os.path.abspath(file)
      parent = os.path.abspath(basedir)
  
      if file == parent:
          return None
  
      if file.startswith(parent):
          return file[len(parent)+1:]
      
      return None
function_tokens: def getRelativePath ( file , basedir ) : file = os . path . abspath ( file ) parent = os . path . abspath ( basedir ) if file == parent : return None if file . startswith ( parent ) : return file [ len ( parent ) + 1 : ] return None