def _get_hostname(self, hostname, sample, scraper_config):
    '\n        If hostname is None, look at label_to_hostname setting\n        '
    if ((hostname is None) and (scraper_config['label_to_hostname'] is not None) and sample[self.SAMPLE_LABELS].get(scraper_config['label_to_hostname'])):
        hostname = sample[self.SAMPLE_LABELS][scraper_config['label_to_hostname']]
        suffix = scraper_config['label_to_hostname_suffix']
        if (suffix is not None):
            hostname += suffix
    return hostname
If hostname is None, look at label_to_hostname setting
def _get_hostname(self, hostname, sample, scraper_config):
    '\n        \n        '
    if ((hostname is None) and (scraper_config['label_to_hostname'] is not None) and sample[self.SAMPLE_LABELS].get(scraper_config['label_to_hostname'])):
        hostname = sample[self.SAMPLE_LABELS][scraper_config['label_to_hostname']]
        suffix = scraper_config['label_to_hostname_suffix']
        if (suffix is not None):
            hostname += suffix
    return hostname