def record_get_field(rec, tag, field_position_global=None,<EOL>field_position_local=None):
if field_position_global is None and field_position_local is None:<EOL><INDENT>raise InvenioBibRecordFieldError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>elif field_position_global is not None andfield_position_local is not None:<EOL><INDENT>raise InvenioBibRecordFieldError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>")<EOL><DEDENT>elif field_position_global:<EOL><INDENT>if tag not in rec:<EOL><INDENT>raise InvenioBibRecordFieldError("<STR_LIT>" % tag)<EOL><DEDENT>for field in rec[tag]:<EOL><INDENT>if field[<NUM_LIT:4>] == field_position_global:<EOL><INDENT>return field<EOL><DEDENT><DEDENT>raise InvenioBibRecordFieldError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (tag, field_position_global))<EOL><DEDENT>else:<EOL><INDENT>try:<EOL><INDENT>return rec[tag][field_position_local]<EOL><DEDENT>except KeyError:<EOL><INDENT>raise InvenioBibRecordFieldError("<STR_LIT>" % tag)<EOL><DEDENT>except IndexError:<EOL><INDENT>raise InvenioBibRecordFieldError(<EOL>"<STR_LIT>"<EOL>"<STR_LIT>" % (tag, field_position_local))<EOL><DEDENT><DEDENT>
Return the the matching field.

One has to enter either a global field position or a local field position.

:return: a list of subfield tuples (subfield code, value).
:rtype: list