<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_metric_by_month(self, unique_identifier, metric, from_date, limit=10, **kwargs):
 """ Returns the ``metric`` for ``unique_identifier`` segmented by month starting from``from_date``. It will retrieve metrics data starting from the 1st of the month specified in ``from_date`` :param unique_identifier: Unique string indetifying the object this metric is for :param metric: A unique name for the metric you want to track :param from_date: A python date object :param limit: The total number of months to retrive starting from ``from_date`` """

        conn = kwargs.get("connection", None)
        first_of_month = datetime.date(year=from_date.year, month=from_date.month, day=1)
        metric_key_date_range = self._get_weekly_date_range(
            first_of_month, relativedelta(months=limit))

        date_generator = (first_of_month + relativedelta(months=i) for i in itertools.count())
        #generate a list of first_of_month's in between the start date and the end date
        series = list(itertools.islice(date_generator, limit))

        metric_keys = [self._get_monthly_metric_name(metric, month_date) for month_date in series]

        metric_func = lambda conn: [conn.hmget(
            self._get_weekly_metric_key(
                unique_identifier, metric_key_date), metric_keys) for metric_key_date in metric_key_date_range]

        if conn is not None:
            results = metric_func(conn)
        else:
            with self._analytics_backend.map() as conn:
                results = metric_func(conn)
            series, results = self._parse_and_process_metrics(series, results)

        return series, results