parameters: (self, file, mode='r', buf=-1)
return_statement: return open(file, mode, buf)
docstring: Method called when open() is called in the restricted environment.
  
          The arguments are identical to those of the open() function, and a
          file object (or a class instance compatible with file objects)
          should be returned.  RExec's default behaviour is allow opening
          any file for reading, but forbidding any attempt to write a file.
  
          This method is implicitly called by code executing in the
          restricted environment.  Overriding this method in a subclass is
          used to change the policies enforced by a restricted environment.
docstring_summary: Method called when open() is called in the restricted environment.
docstring_tokens: Method called when open () is called in the restricted environment .
function: def r_open(self, file, mode='r', buf=-1):
          """Method called when open() is called in the restricted environment.
  
          The arguments are identical to those of the open() function, and a
          file object (or a class instance compatible with file objects)
          should be returned.  RExec's default behaviour is allow opening
          any file for reading, but forbidding any attempt to write a file.
  
          This method is implicitly called by code executing in the
          restricted environment.  Overriding this method in a subclass is
          used to change the policies enforced by a restricted environment.
  
          """
          mode = str(mode)
          if mode not in ('r', 'rb'):
              raise IOError, "can't open files for writing in restricted mode"
          return open(file, mode, buf)
function_tokens: def r_open ( self , file , mode = 'r' , buf = - 1 ) : mode = str ( mode ) if mode not in ( 'r' , 'rb' ) : raise IOError , "can't open files for writing in restricted mode" return open ( file , mode , buf )