Converts the object to NAF (if it is KAF)
169874
def to_naf(self):
        
        if self.type == 'KAF':
            self.type = 'NAF'
            for node in self.__get_node_terms():
                node.set('id',node.get('tid'))
                del node.attrib['tid']
772800
public void parseToKAF(final KAFDocument kaf) throws IOException {
    final StringBuffer parsingDoc = getParse(kaf);
    try {
      kaf.addConstituencyFromParentheses(parsingDoc.toString());
    } catch (final Exception e) {
      e.printStackTrace();
    }
  }
1195744
def convert(self, values, nan_rep, encoding, errors):
        

        # values is a recarray
        if values.dtype.fields is not None:
            values = values[self.cname]

        values = _maybe_convert(values, self.kind, encoding, errors)

        kwargs = dict()
        if self.freq is not None:
            kwargs['freq'] = _ensure_decoded(self.freq)
        if self.index_name is not None:
            kwargs['name'] = _ensure_decoded(self.index_name)
        # making an Index instance could throw a number of different errors
        try:
            self.values = Index(values, **kwargs)
        except Exception:  # noqa: E722

            # if the output freq is different that what we recorded,
            # it should be None (see also 'doc example part 2')
            if 'freq' in kwargs:
                kwargs['freq'] = None
            self.values = Index(values, **kwargs)

        self.values = _set_tz(self.values, self.tz)

        return self
940631
def to_hdf(self,path,key,mode='a'):
        
        pd.DataFrame(self.serialize()).to_hdf(path,key,mode=mode,format='table',complib='zlib',complevel=9)
        f = h5py.File(path,'r+')
        f[key].attrs["microns_per_pixel"] = float(self.microns_per_pixel) if self.microns_per_pixel is not None else np.nan
        f.close()
521527
function toMap(arr, fn) {
  var obj = {};
  var i, elem;
  for (i = 0; i < arr.length; i++) {
    elem = arr[i];
    obj[fn(elem)] = elem;
  }
  return obj;
}
173361
def inflate_object(object = nil)
      return false unless object.is_a?(Hash)
      filter_array = object[:Filter]
      if filter_array.is_a?(Hash) && filter_array[:is_reference_only]
        filter_array = filter_array[:referenced_object]
      end
      filter_array = [filter_array] if filter_array.is_a?(Symbol)
      filter_array = [] if filter_array.nil?
      params_array = object[:DecodeParms]
      if params_array.is_a?(Hash) && params_array[:is_reference_only]
        params_array = params_array[:referenced_object]
      end
      params_array = [params_array] unless params_array.is_a?(Array)
      object[:Filter] = filter_array
      object[:DecodeParms] = params_array
      while filter_array[0]
        case filter_array[0]
        when :FlateDecode
          raise_unsupported_error params_array[0] unless params_array[0].nil?
          if params_array[0] && params_array[0][:Predictor].to_i > 1
            predictor = params_array[0][:Predictor].to_i
            # bits = params_array[0][:BitsPerComponent] || 8
            # columns = params_array[0][:Columns] || 1
            if (2..9).cover? predictor
              ####
              # prepare TIFF group
              raise_unsupported_error params_array[0]
            elsif (10..15).cover? predictor
              ####
              # prepare PNG group
              raise_unsupported_error params_array[0]
            end
          else
            inflator = Zlib::Inflate.new

            object[:raw_stream_content] = inflator.inflate object[:raw_stream_content]
            begin
              inflator.finish
            rescue
            end
            inflator.close
            object[:Length] = object[:raw_stream_content].bytesize
          end
        when nil
          true
        else
          return false
        end
        params_array.shift
        filter_array.shift
      end
      object.delete :Filter
      object.delete :DecodeParms
      true
    end
1110795
function mapValues(fn, obj) {
  return keys(obj).reduce(function(acc, key) {
    acc[key] = fn(obj[key]);
    return acc;
  }, {});
}
277870
def to_naf(self):
        
        if self.type == 'KAF':
            for node in self.__get_entity_nodes():
                node.set('id',node.get('eid'))
                del node.attrib['eid']
838099
function ( obj ) {
		var result = 0;

		if ( obj.length > 0 ) {
			result = obj.reduce( function ( prev, cur ) {
				return prev + cur;
			});
		}

		return result;
	}
177226
private static Frame toFrame(Matrix m, Key<Frame> key) {
    H2O.submitTask(new ConvertMatrixToFrame(m, key)).join();
    Frame f = DKV.getGet(key);
    assert f != null;
    return f;
  }
702892
def cast(attrs, inputs, proto_obj):
    
    try:
        from onnx.mapping import TENSOR_TYPE_TO_NP_TYPE
    except ImportError:
        raise ImportError("Onnx and protobuf need to be installed. "
                          + "Instructions to install - https://github.com/onnx/onnx")
    new_attrs = translation_utils._fix_attribute_names(attrs, {'to' : 'dtype'})
    new_attrs['dtype'] = TENSOR_TYPE_TO_NP_TYPE[int(new_attrs['dtype'])]
    return 'cast', new_attrs, inputs
1088675
function get(k, key, value, fields) {
  return accessor(
    function(d) { return key(d) === k ? value(d) : NaN; },
    fields,
    k + ''
  );
}
1369039
def to_nnf(self):
        """"""
        node = self.node.to_nnf()
        if node is self.node:
            return self
        else:
            return _expr(node)
765521
def get_as_nullable_float(self, key):
        
        value = self.get(key)
        return FloatConverter.to_nullable_float(value)
195800
def to_native(self, obj, name, value):
		""""""
		
		if isinstance(value, self.List):
			return value
		
		result = self.List(super(Array, self).to_native(obj, name, i) for i in value)
		obj.__data__[self.__name__] = result
		
		return result
208370
def is_float(obj):
    
    is_f = isinstance(obj, float)
    if not is_f:
        try:
            float(obj)
            is_f = True
        except (ValueError, TypeError):
            is_f = False
    return is_f and not is_bool(obj)
131722
def to_native_types(self, slicer=None, na_rep='', quoting=None, **kwargs):
        

        values = self.values
        if slicer is not None:
            # Categorical is always one dimension
            values = values[slicer]
        mask = isna(values)
        values = np.array(values, dtype='object')
        values[mask] = na_rep

        # we are expected to return a 2-d ndarray
        return values.reshape(1, len(values))