<s> r"""<STR_LIT>""" <EOL> import scipy as _sp <EOL> def voronoi ( geometry , vertices = '<STR_LIT>' , ** kwargs ) : <EOL> r"""<STR_LIT>""" <EOL> network = geometry . _net <EOL> value = _sp . ndarray ( [ geometry . num_pores ( ) , <NUM_LIT:3> ] ) <EOL> value . fill ( <NUM_LIT:0.0> ) <EOL> pore_map = geometry . map_pores ( target = network , <EOL> pores = geometry . pores ( ) , <EOL> return_mapping = True ) <EOL> for i , net_pore in enumerate ( pore_map [ '<STR_LIT:target>' ] ) : <EOL> geom_pore = pore_map [ '<STR_LIT:source>' ] [ i ] <EOL> net_throats = network . find_neighbor_throats ( net_pore ) <EOL> geom_throats = network . map_throats ( target = geometry , <EOL> throats = net_throats , <EOL> return_mapping = True ) [ '<STR_LIT:target>' ] <EOL> verts = geometry [ vertices ] [ geom_throats ] <EOL> "<STR_LIT>" <EOL> verts = verts [ ~ _sp . all ( verts == <NUM_LIT:0> , axis = <NUM_LIT:1> ) ] <EOL> if len ( verts ) > <NUM_LIT:0> : <EOL> value [ geom_pore ] = _sp . mean ( verts , axis = <NUM_LIT:0> ) <EOL> return value </s>
