def __init__(self, buffer, capacity): 
        """Creates a TempFile object containing the specified buffer. 
        If capacity is specified, we use a real temporary file once the 
        file gets larger than that size.  Otherwise, the data is stored 
        in memory. 
        """ 
        self.capacity = capacity 
        self._delegate = self._strategies[len(buffer) > self.capacity]() 
        self.write(buffer)
Creates a TempFile object containing the specified buffer. 
        If capacity is specified, we use a real temporary file once the 
        file gets larger than that size.  Otherwise, the data is stored 
        in memory. 
        
recipes/Python/496744_Improved_TemporaryFile/recipe-496744.py