def _get_field_value(field_to_get, object_to_search):
    """
    Gets the value of a nested object, for example, if we search
    'address.city.neighborhood' in the object:
    {'address':
        {'city':
            {'neighborhood': 'shapira'}
        }
    }
    The returned value will be 'shapira'

    :param field_to_get:
    :param object_to_search:
    :return (string): The value of the field that needs to be searched
    """

    # Split the field to get up in parts (in the example above: ['address', 'city', 'neighborhood']
    field_parts = field_to_get.split('.')

    # Keep popping field parts and retrieving the nested objects until the last part is reached.
    while len(field_parts) > 0:
        # Get the first 'field part' (in the example above, 'address') and pop it from the parts
        field_part = field_parts.pop(0)
        # Get the nested object from the object (in the example above: {'address': {'...':{'...': {}}}}
        object_to_search = object_to_search.get(field_part, '')

    return object_to_search