def fill_with_listings(calendar, listings):
    """
    Fills the missing prices in the calendar dataframe,
    with the prices available in the listings dataframe.

    Args:
        calendar (pandas.DataFrame): Contains prices and availabilities in
            time for the listings.
        listings (pandas.DataFrame): Contains the static features of each
            listing.
    Returns:
        pandas.DataFrame: The filled calendar.
    """
    listings_price = listings[['id', 'price']].rename(columns={
        'id': 'listing_id'}).set_index('listing_id').price

    new_cal = calendar.copy()
    new_cal = new_cal.set_index('listing_id')
    new_cal.price = new_cal.price.fillna(listings_price)

    return new_cal.reset_index()