parameters: (generator)
return_statement: return generator_output
docstring: Retrieves the next batch of input data.
docstring_summary: Retrieves the next batch of input data.
docstring_tokens: Retrieves the next batch of input data .
function: def _get_next_batch(generator):
    """Retrieves the next batch of input data."""
    try:
      generator_output = next(generator)
    except (StopIteration, errors.OutOfRangeError):
      return None
  
    if not isinstance(generator_output, tuple):
      # Always wrap in a tuple.
      generator_output = (generator_output,)
    if len(generator_output) not in [1, 2, 3]:
      raise ValueError(
          'Output of generator should be a tuple of 1 or 2 or 3 '
          'elements: (input,) or (input, target) or '
          '(input, target, sample_weights). Received {}'.format(generator_output))
    return generator_output
function_tokens: def _get_next_batch ( generator ) : try : generator_output = next ( generator ) except ( StopIteration , errors . OutOfRangeError ) : return None if not isinstance ( generator_output , tuple ) : # Always wrap in a tuple. generator_output = ( generator_output , ) if len ( generator_output ) not in [ 1 , 2 , 3 ] : raise ValueError ( 'Output of generator should be a tuple of 1 or 2 or 3 ' 'elements: (input,) or (input, target) or ' '(input, target, sample_weights). Received {}' . format ( generator_output ) ) return generator_output