def pydict(
        self,
        nb_elements: int = 10,
        variable_nb_elements: bool = True,
        value_types: Optional[TypesSpec] = None,
        allowed_types: Optional[TypesSpec] = None,
    ) -> Dict[Any, Any]:
        """
        Returns a dictionary.

        :nb_elements: number of elements for dictionary
        :variable_nb_elements: is use variable number of elements for dictionary
        :value_types: type of dictionary values
        """

        words_list_count = len(self.generator.get_words_list())

        if variable_nb_elements:
            nb_elements = self.randomize_nb_elements(nb_elements, min=1)

        if nb_elements > words_list_count:
            warnings.warn(
                f"Number of nb_elements is greater than the number of words in the list."
                f" {words_list_count} words will be used.",
                RuntimeWarning,
            )
            nb_elements = words_list_count

        return dict(
            zip(
                self.generator.words(nb_elements, unique=True),
                self._pyiterable(
                    nb_elements=nb_elements,
                    variable_nb_elements=False,
                    value_types=value_types,
                    allowed_types=allowed_types,
                ),
            )
        )

        Returns a dictionary.

        :nb_elements: number of elements for dictionary
        :variable_nb_elements: is use variable number of elements for dictionary
        :value_types: type of dictionary values
        
faker/providers/python/__init__.py