def inside(before, after, amount=1):
    """
        Returns true if before in after amount times else false.

        .. code-block:: xml

            <i>value in obj</i>
        """
    if isinstance(after, str):
        return before in after
    if amount == 0:
        return True
    count = 0
    for item in after:
        if item == before:
            count += 1
            if count >= amount:
                return True
    return False
