<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def from_const(cls, value, size, dtype=type(None)):
 """ Constructs an SArray of size with a const value. Parameters value : [int | float | str | array.array | list | dict | datetime] The value to fill the SArray size : int The size of the SArray dtype : type The type of the SArray. If not specified, is automatically detected from the value. This should be specified if value=None since the actual type of the SArray can be anything. Examples -------- Construct an SArray consisting of 10 zeroes: Construct an SArray consisting of 10 missing string values: """

        assert isinstance(size, (int, long)) and size >= 0, "size must be a positive int"
        if not isinstance(value, (type(None), int, float, str, array.array, list, dict, datetime.datetime)):
            raise TypeError('Cannot create sarray of value type %s' % str(type(value)))
        proxy = UnitySArrayProxy()
        proxy.load_from_const(value, size, dtype)
        return cls(_proxy=proxy)