def read_tag(fid, pos=None, shape=None, rlims=None):
 if (pos is not None):
  fid.seek(pos, 0)
 tag = _read_tag_header(fid)
 if (tag.size > 0):
  matrix_coding = (_is_matrix & tag.type)
  if (matrix_coding != 0):
   tag.data = _read_matrix(fid, tag, shape, rlims, matrix_coding)
  else:
   fun = _call_dict.get(tag.type)
   if (fun is not None):
    tag.data = fun(fid, tag, shape, rlims)
   else:
    raise Exception(('Unimplemented tag data type %s' % tag.type))
 if (tag.next != FIFF.FIFFV_NEXT_SEQ):
  fid.seek(tag.next, 1)
 return tag

def read_tag ( fid , pos = None , shape = None , rlims = None ) : if ( pos is not None ) : fid . seek ( pos , 0 ) tag = _read_tag_header ( fid ) if ( tag . size > 0 ) : matrix_coding = ( _is_matrix & tag . type ) if ( matrix_coding != 0 ) : tag . data = _read_matrix ( fid , tag , shape , rlims , matrix_coding ) else : fun = _call_dict . get ( tag . type ) if ( fun is not None ) : tag . data = fun ( fid , tag , shape , rlims ) else : raise Exception ( ( 'Unimplemented tag data type %s' % tag . type ) ) if ( tag . next != FIFF . FIFFV_NEXT_SEQ ) : fid . seek ( tag . next , 1 ) return tag
read a tag from a file at a given position .