def dict_to_label(dict):
try:<EOL><INDENT>return Label(<EOL>dict['<STR_LIT:label>'],<EOL>dict.get('<STR_LIT:type>', '<STR_LIT>'),<EOL>dict.get('<STR_LIT>', '<STR_LIT>')<EOL>)<EOL><DEDENT>except (KeyError, AttributeError, TypeError):<EOL><INDENT>return dict<EOL><DEDENT>
Transform a dict with keys `label`, `type` and `language` into a
:class:`Label`.

Only the `label` key is mandatory. If `type` is not present, it will
default to `prefLabel`. If `language` is not present, it will default
to `und`.

If the argument passed is not a dict, this method just
returns the argument.