code: def test_mixing():
      num_of_reads = 1000
      mix_10_90 = _count_mixed(
          [reader0, reader1], [0.1, 0.9], num_of_reads
      )
  
      np.testing.assert_allclose(
          mix_10_90,
          [num_of_reads * 0.1, num_of_reads * 0.9],
          atol=num_of_reads / 10,
      )
  
      mix_10_50_40 = _count_mixed(
          [reader0, reader1, reader2], [0.1, 0.5, 0.4], num_of_reads
      )
      np.testing.assert_allclose(
          mix_10_50_40,
          [num_of_reads * 0.1, num_of_reads * 0.5, num_of_reads * 0.4],
          atol=num_of_reads / 10,
      )
  
imports: from __future__ import division
  import numpy
  import pytest
  import six
  import tensorflow.compat.v1
  from petastorm import make_reader
  from petastorm.ngram import NGram
  from petastorm.predicates import in_lambda
  from petastorm.pytorch import DataLoader
  from petastorm.test_util.reader_mock import ReaderMock
  from petastorm.tf_utils import tf_tensors, make_petastorm_dataset
  from petastorm.unischema import Unischema, UnischemaField
  from petastorm.weighted_sampling_reader import WeightedSamplingReader
  from petastorm.tests.test_tf_utils import create_tf_graph
label_desc: Use image node_id 4 for calling a global function with example usage: test_mixing() without return types