<s> import pytest <EOL> pytest . importorskip ( '<STR_LIT>' ) <EOL> from dask . array . wrap import ones <EOL> import dask . array as da <EOL> import numpy as np <EOL> import dask <EOL> def test_ones ( ) : <EOL> a = ones ( ( <NUM_LIT:10> , <NUM_LIT:10> ) , dtype = '<STR_LIT>' , chunks = ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> x = np . array ( a ) <EOL> assert ( x == np . ones ( ( <NUM_LIT:10> , <NUM_LIT:10> ) , '<STR_LIT>' ) ) . all ( ) <EOL> def test_size_as_list ( ) : <EOL> a = ones ( [ <NUM_LIT:10> , <NUM_LIT:10> ] , dtype = '<STR_LIT>' , chunks = ( <NUM_LIT:4> , <NUM_LIT:4> ) ) <EOL> x = np . array ( a ) <EOL> assert ( x == np . ones ( ( <NUM_LIT:10> , <NUM_LIT:10> ) , dtype = '<STR_LIT>' ) ) . all ( ) <EOL> def test_singleton_size ( ) : <EOL> a = ones ( <NUM_LIT:10> , dtype = '<STR_LIT>' , chunks = ( <NUM_LIT:4> , ) ) <EOL> x = np . array ( a ) <EOL> assert ( x == np . ones ( <NUM_LIT:10> , dtype = '<STR_LIT>' ) ) . all ( ) <EOL> def test_kwargs ( ) : <EOL> a = ones ( <NUM_LIT:10> , dtype = '<STR_LIT>' , chunks = ( <NUM_LIT:4> , ) ) <EOL> x = np . array ( a ) <EOL> assert ( x == np . ones ( <NUM_LIT:10> , dtype = '<STR_LIT>' ) ) . all ( ) <EOL> def test_full ( ) : <EOL> a = da . full ( ( <NUM_LIT:3> , <NUM_LIT:3> ) , <NUM_LIT:100> , chunks = ( <NUM_LIT:2> , <NUM_LIT:2> ) , dtype = '<STR_LIT>' ) <EOL> assert ( a . compute ( ) == <NUM_LIT:100> ) . all ( ) <EOL> assert a . _dtype == a . compute ( get = dask . get ) . dtype == '<STR_LIT>' <EOL> def test_can_make_really_big_array_of_ones ( ) : <EOL> a = ones ( ( <NUM_LIT> , <NUM_LIT> ) , chunks = ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> a = ones ( shape = ( <NUM_LIT> , <NUM_LIT> ) , chunks = ( <NUM_LIT> , <NUM_LIT> ) ) <EOL> def test_wrap_consistent_names ( ) : <EOL> assert sorted ( ones ( <NUM_LIT:10> , dtype = '<STR_LIT>' , chunks = ( <NUM_LIT:4> , ) ) . dask ) == sorted ( ones ( <NUM_LIT:10> , dtype = '<STR_LIT>' , chunks = ( <NUM_LIT:4> , ) ) . dask ) <EOL> assert sorted ( ones ( <NUM_LIT:10> , dtype = '<STR_LIT>' , chunks = ( <NUM_LIT:4> , ) ) . dask ) != sorted ( ones ( <NUM_LIT:10> , chunks = ( <NUM_LIT:4> , ) ) . dask ) <EOL> assert sorted ( da . full ( ( <NUM_LIT:3> , <NUM_LIT:3> ) , <NUM_LIT:100> , chunks = ( <NUM_LIT:2> , <NUM_LIT:2> ) , dtype = '<STR_LIT>' ) . dask ) == sorted ( da . full ( ( <NUM_LIT:3> , <NUM_LIT:3> ) , <NUM_LIT:100> , chunks = ( <NUM_LIT:2> , <NUM_LIT:2> ) , dtype = '<STR_LIT>' ) . dask ) <EOL> assert sorted ( da . full ( ( <NUM_LIT:3> , <NUM_LIT:3> ) , <NUM_LIT:100> , chunks = ( <NUM_LIT:2> , <NUM_LIT:2> ) , dtype = '<STR_LIT>' ) . dask ) != sorted ( da . full ( ( <NUM_LIT:3> , <NUM_LIT:3> ) , <NUM_LIT:100> , chunks = ( <NUM_LIT:2> , <NUM_LIT:2> ) ) . dask ) </s>
