def pull_sample(self, timeout=FOREVER, sample=None):
<EOL>if type(timeout) is list:<EOL><INDENT>assign_to = timeout<EOL>timeout = sample if type(sample) is float else <NUM_LIT:0.0><EOL><DEDENT>else:<EOL><INDENT>assign_to = None<EOL><DEDENT>errcode = c_int()<EOL>timestamp = self.do_pull_sample(self.obj, byref(self.sample),<EOL>self.channel_count, c_double(timeout),<EOL>byref(errcode))<EOL>handle_error(errcode)<EOL>if timestamp:<EOL><INDENT>sample = [v for v in self.sample]<EOL>if self.channel_format == cf_string:<EOL><INDENT>sample = [v.decode('<STR_LIT:utf-8>') for v in sample]<EOL><DEDENT>if assign_to is not None:<EOL><INDENT>assign_to[:] = sample<EOL><DEDENT>return sample, timestamp<EOL><DEDENT>else:<EOL><INDENT>return None, None<EOL><DEDENT>
Pull a sample from the inlet and return it.

        Keyword arguments:
        timeout -- The timeout for this operation, if any. (default FOREVER)
                   If this is passed as 0.0, then the function returns only a 
                   sample if one is buffered for immediate pickup.

        Returns a tuple (sample,timestamp) where sample is a list of channel 
        values and timestamp is the capture time of the sample on the remote 
        machine, or (None,None) if no new sample was available. To remap this 
        time stamp to the local clock, add the value returned by 
        .time_correction() to it. 

        Throws a LostError if the stream source has been lost. Note that, if 
        the timeout expires, no TimeoutError is thrown (because this case is 
        not considered an error).