def as_strided(x, shape=None, strides=None):
interface = dict(x.__array_interface__)<EOL>if shape is not None:<EOL><INDENT>interface['<STR_LIT>'] = tuple(shape)<EOL><DEDENT>if strides is not None:<EOL><INDENT>interface['<STR_LIT>'] = tuple(strides)<EOL><DEDENT>array = np.asarray(DummyArray(interface, base=x))<EOL>if array.dtype.kind == '<STR_LIT>':<EOL><INDENT>array.dtype = x.dtype<EOL><DEDENT>return array<EOL>
Make an ndarray from the given array with the given shape and strides.