def _get_id(vpc_name=None, cidr=None, tags=None, region=None, key=None, keyid=None, profile=None):
 if (vpc_name and (not any((cidr, tags)))):
  vpc_id = _cache_id(vpc_name, region=region, key=key, keyid=keyid, profile=profile)
  if vpc_id:
   return vpc_id
 vpc_ids = _find_vpcs(vpc_name=vpc_name, cidr=cidr, tags=tags, region=region, key=key, keyid=keyid, profile=profile)
 if vpc_ids:
  log.debug('Matching VPC: {0}'.format(' '.join(vpc_ids)))
  if (len(vpc_ids) == 1):
   vpc_id = vpc_ids[0]
   if vpc_name:
    _cache_id(vpc_name, vpc_id, region=region, key=key, keyid=keyid, profile=profile)
   return vpc_id
  else:
   raise CommandExecutionError('Found more than one VPC matching the criteria.')
 else:
  log.info('No VPC found.')
  return None

def _get_id ( vpc_name = None , cidr = None , tags = None , region = None , key = None , keyid = None , profile = None ) : if ( vpc_name and ( not any ( ( cidr , tags ) ) ) ) : vpc_id = _cache_id ( vpc_name , region = region , key = key , keyid = keyid , profile = profile ) if vpc_id : return vpc_id vpc_ids = _find_vpcs ( vpc_name = vpc_name , cidr = cidr , tags = tags , region = region , key = key , keyid = keyid , profile = profile ) if vpc_ids : log . debug ( 'Matching VPC: {0}' . format ( ' ' . join ( vpc_ids ) ) ) if ( len ( vpc_ids ) == 1 ) : vpc_id = vpc_ids [ 0 ] if vpc_name : _cache_id ( vpc_name , vpc_id , region = region , key = key , keyid = keyid , profile = profile ) return vpc_id else : raise CommandExecutionError ( 'Found more than one VPC matching the criteria.' ) else : log . info ( 'No VPC found.' ) return None
given vpc properties .