def extract_frequency(word, dictionary, return_as_binary_vector=False):
    """ This function extracts frequencies for a given word from a dictionary of frequencies

        Args:
            word (str): Word
            dictionary (dict): Dictionary with frequencies
            return_as_binary_vector (bool): Returns full vector with binary indicator where the word is found

        Returns:
            A frequency for a given word from a dictionary

        Examples:
            >>> extract_frequency('Bilderbuch', {'Bilderbuch': 1})
            1
            >>> extract_frequency('Bilderbuch', {'Bilderbuch': 1, 'Blitz': 5}, return_as_binary_vector=True)
            [1, 0]

    """

    if return_as_binary_vector:
        dictionary_copy = dictionary.fromkeys(dictionary, 0)
        dictionary_copy.update({word: 1})
        return list(dictionary_copy.values())

    if word in dictionary.keys():
        value = dictionary[word]
        return int(value)

    else:
        return 0