def setup(hass, config):
    """Setup the Graphite feeder."""
    graphite_config = config.get('graphite', {})
    host = graphite_config.get('host', 'localhost')
    prefix = graphite_config.get('prefix', 'ha')
    try:
        port = int(graphite_config.get('port', 2003))
    except __HOLE__:
        _LOGGER.error('Invalid port specified')
        return False

    GraphiteFeeder(hass, host, port, prefix)
    return True
dataset/ETHPy150Open home-assistant/home-assistant/homeassistant/components/graphite.py/setup