def is_dynamic(field_def, field_value=None):
    """Implements two checks for a dynamic field defintion."""
    if field_value is not None:
        return field_def.is_dynamic and isinstance(field_value, bytes)
    else:
        return field_def.is_dynamic
