import logging


def _get_augmenter_type_and_args(**kwargs):
  """Extracts augmenter type and args from **kwargs dict."""
  augment_type = kwargs['type'].lower()
  augment_args = {}
  for k, v in kwargs.items():
    if k.startswith(augment_type + '_'):
      augment_args[k[len(augment_type) + 1:]] = v
    if k == 'size':
      augment_args[k] = v
  logging.info('Using augmentation %s with parameters %s', augment_type,
               augment_args)
  return augment_type, augment_args