parameters: (data, idx)
return_statement: return shuffle_data
docstring: Shuffle the data.
docstring_summary: Shuffle the data.
docstring_tokens: Shuffle the data .
function: def _getdata_by_idx(data, idx):
      """Shuffle the data."""
      shuffle_data = []
  
      for k, v in data:
          if (isinstance(v, h5py.Dataset) if h5py else False):
              shuffle_data.append((k, v))
          elif isinstance(v, CSRNDArray):
              shuffle_data.append((k, sparse_array(v.asscipy()[idx], v.context)))
          else:
              shuffle_data.append((k, array(v.asnumpy()[idx], v.context)))
  
      return shuffle_data
function_tokens: def _getdata_by_idx ( data , idx ) : shuffle_data = [ ] for k , v in data : if ( isinstance ( v , h5py . Dataset ) if h5py else False ) : shuffle_data . append ( ( k , v ) ) elif isinstance ( v , CSRNDArray ) : shuffle_data . append ( ( k , sparse_array ( v . asscipy ( ) [ idx ] , v . context ) ) ) else : shuffle_data . append ( ( k , array ( v . asnumpy ( ) [ idx ] , v . context ) ) ) return shuffle_data