def picture(self, 
              image,                    # the image to display (may be a file name, preferably a relative path)
              duration=1.0,             # duration for which this object will be displayed
                                        # if this is a string, the stimulus will be displayed until the corresponding event is generated
                                        # if this is a list of [number,string], the stimulus will at least be displayed for <number> seconds, but needs to confirmed with the respective event
                                        # if this is 0, the write will be non-blocking and you have to .destroy() the return value of this function manually  
              block=True,               # whether to wait for the duration until the function returns
              # optional parameters:
              pos=None,                 # the (x,z) or (x,y,z) position of the image on the screen; this may be a 3-tuple of floats; y should be zero
              hpr=None,                 # the (heading,pitch,roll) angles of the image; if this is a single number, it will be taken as the roll angle
              scale=None,               # the size of the image; this may be a single flot, a 3-tuple of floats, or a vector; y should be 1, if a 3-tuple is given
              color=None,               # the (r,g,b,a) coloring of the image
              parent=None,              # parent rendering context or Panda3d NodePath
              ):
        """Display a picture on the screen and keep it there for a particular duration."""        
        
        if pos is not None and type(pos) not in (int,float) and len(pos) == 2:
            pos = (pos[0],0,pos[1])
        if scale is not None and type(scale) not in (int,float) and len(scale) == 2:
            scale = (scale[0],1,scale[1])
        if hpr is not None and type(scale) not in (int,float) and len(hpr) == 1:
            hpr = (0,0,hpr)
        if duration == 0:
            block = False
            
        obj = self._engine.direct.gui.OnscreenImage.OnscreenImage(image=image,pos=pos,hpr=hpr,scale=scale,color=color,parent=parent)
        self._to_destroy.append(obj)
        obj.setTransparency(self._engine.pandac.TransparencyAttrib.MAlpha)
        if self.implicit_markers:
            self.marker(248)
        if block:
            if type(duration) == list or type(duration) == tuple:
                self.sleep(duration[0])
                self.waitfor(duration[1])
            elif type(duration) == str:
                self.waitfor(duration)
            else:
                self.sleep(duration)
            self._destroy_object(obj,249)
        else:
            if duration > 0:
                self._engine.base.taskMgr.doMethodLater(duration, self._destroy_object, 'ConvenienceFunctions, remove_picture', extraArgs=[obj,249])
            return obj
dataset/ETHPy150Open sccn/SNAP/src/framework/basicstimuli.py/BasicStimuli.picture/original