<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def get_prep_value(self, value: LocalizedValue) -> dict: """Turns the specified value into something the database can store. If an illegal value (non-LocalizedValue instance) is specified, we'll treat it as an empty :see:LocalizedValue instance, on which the validation will fail. Dictonaries are converted into :see:LocalizedValue instances. Arguments: value: The :see:LocalizedValue instance to serialize into a data type that the database can understand. Returns: A dictionary containing a key for every language, extracted from the specified value. """


        if isinstance(value, dict):
            value = LocalizedValue(value)

        # default to None if this is an unknown type
        if not isinstance(value, LocalizedValue) and value:
            value = None

        if value:
            cleaned_value = self.clean(value)
            self.validate(cleaned_value)
        else:
            cleaned_value = value

        return super(LocalizedField, self).get_prep_value(
            cleaned_value.__dict__ if cleaned_value else None
        )