Convert array elements to different element type

 @param [Class] dest Element type to convert to.

 @return [Node] Array based on the different element type.
19681
def to_type(dest)
      if dimension == 0 and variables.empty?
        target = typecode.to_type dest
        target.new(simplify.get).simplify
      else
        key = "to_#{dest.to_s.downcase}"
        Hornetseye::ElementWise( proc { |x| x.to_type dest }, key,
                                 proc { |t| t.to_type dest } ).new(self).force
      end
    end
971432
function reverse(array) {
  return array.map(function (v) {
    return {
      name: v.name,
      rank: -v.rank,
      node: v.node,
    }
  }).reverse()
}
917438
private Object _deserializeStruct(Element elStruct) throws ConverterException {
	String type = elStruct.getAttribute("type");
	Struct struct = new StructImpl();

	NodeList list = elStruct.getChildNodes();
	int len = list.getLength();
	for (int i = 0; i < len; i++) {
	    // print.ln(i);

	    Node node = list.item(i);
	    if (node instanceof Element) {
		Element var = (Element) node;
		Element value = getChildElement((Element) node);
		if (value != null) {
		    struct.setEL(var.getAttribute("name"), _deserialize(value));

		}
	    }
	}
	if (struct.size() == 0 && type != null && type.length() > 0) {
	    return "";
	}
	return struct;
    }
975010
function transform( nodes ) {
	var type;
	var desc;
	if ( nodes[ 0 ].type ) {
		if ( nodes[ 0 ].type.names.length === 1 ) {
			type = nodes[ 0 ].type.names[ 0 ];
		} else {
			type = nodes[ 0 ].type.names;
		}
	} else {
		type = '';
	}
	desc = nodes[ 0 ].description || '';
	return {
		'type': type,
		'description': desc
	};
}
1275853
function getSparseArrayIndexes(arr, fromIndex, loop, fromRight) {
  var indexes = [], i;
  for (i in arr) {
    // istanbul ignore next
    if (isArrayIndex(i) && (loop || (fromRight ? i <= fromIndex : i >= fromIndex))) {
      indexes.push(+i);
    }
  }
  indexes.sort(function(a, b) {
    var aLoop = a > fromIndex;
    var bLoop = b > fromIndex;
    // This block cannot be reached unless ES5 methods are being shimmed.
    // istanbul ignore if
    if (aLoop !== bLoop) {
      return aLoop ? -1 : 1;
    }
    return a - b;
  });
  return indexes;
}
228034
function elementsToArray(elements) {
        var ret = [];
        for (var i = 0; i < elements.length; i++) {
            ret.push(elements[i]);
        }
        return ret;
    }
250057
function iterateElements(array) {
  return {
    __iterator__: function() {
      var index = 0;
      var current;
      return {
        get current() {
          return current;
        },
        moveNext: function() {
          if (index < array.length) {
            current = array[index++];
            return true;
          }
          return false;
        }
      };
    }
  };
}
1192786
def deserialize_iter(self, attr, iter_type):
        
        if attr is None:
            return None
        if isinstance(attr, ET.Element): # If I receive an element here, get the children
            attr = list(attr)
        if not isinstance(attr, (list, set)):
            raise DeserializationError("Cannot deserialize as [{}] an object of type {}".format(
                iter_type,
                type(attr)
            ))
        return [self.deserialize_data(a, iter_type) for a in attr]
22876
function convertType (data) {
  switch (data.type) {
    case 'union':
      // If union of arrays
      if (Array.isArray(data.anyOf) && data.anyOf[0].type === 'array') {
        const items = data.anyOf.map(function (e) { return e.items })
        data.items = { anyOf: [] }
        data.items.anyOf = items
        data['type'] = 'array'
        delete data.anyOf
      } else {
        data['type'] = 'object'
      }
      break
    case 'nil':
      data['type'] = 'null'
      break
    case 'file':
      data = convertFileType(data)
      break
  }
  return data
}
602613
def parse_dest(dest)
      case dest
      when Array
        dest.map { |address| parse_address(address) }
      else
        parse_address(dest)
      end
    end
1373731
function detect_class_members_from_array(cls, ast) {
  cls["members"] = [];
  return _.each(ast["elements"], function(el) {
    detect_method_or_property(cls, key_value(el), el, el);
  });
}
23737
function (/*Object*/ dest) /*-> Object*/ {	// merge src properties into dest
		var sources = Array.prototype.slice.call(arguments, 1);
		for (var j = 0, len = sources.length, src; j < len; j++) {
			src = sources[j] || {};
			TL.Util.mergeData(dest, src);
		}
		return dest;
	}
1283143
@SafeVarargs
  /* #end */
  public static <KType> KTypeArrayDeque<KType> from(KType... elements)
  {
      final KTypeArrayDeque<KType> coll = new KTypeArrayDeque<KType>(elements.length);
      coll.addLast(elements);
      return coll;
  }
333518
function(els) {
            	var i, j, elements = els.elements || els;
            	if (typeof(elements[0][0]) != 'undefined') {
            	    i = elements.length;
            	    this.elements = [];
            	    while (i--) {
            		j = elements[i].length;
            		this.elements[i] = [];
            		while (j--) {
            		    this.elements[i][j] = elements[i][j];
            		}
            	    }
            	    return this;
            	}
            	var n = elements.length;
            	this.elements = [];
            	for (i = 0; i < n; i++) {
            	    this.elements.push([elements[i]]);
            	}
            	return this;
                }
146881
def each_element(e_node_type=nil, &block)
      @children.each do |c|
        if c.is_a? MDElement then
          yield c if e_node_type.nil? || c.node_type == e_node_type
          c.each_element(e_node_type, &block)
        #
        # This handles the case where the children of an 
        # element are arranged in a multi-dimensional array 
        # (as in the case of a table)
        elsif c.is_a? Array then
          c.each do |cc|
            # A recursive call to each_element will ignore the current element
            # so we handle this case inline
            if cc.is_a? MDElement then
              yield cc if e_node_type.nil? || cc.node_type == e_node_type
              cc.each_element(e_node_type, &block)
            end
          end
        end

      end
    end
47521
def from_elements(cls, elts=None):
        
        node = cls()
        if elts is None:
            node.elts = []
        else:
            node.elts = [const_factory(e) if _is_const(e) else e for e in elts]
        return node
1110023
function convertMatches(files, options, dest) {
    return files.map(function(source) {
      return {
        src: source,
        dest: path.join(
          // Build a destination from the new source if no dest
          // was specified
          dest != null ? dest : path.dirname(source).replace(options.srcPrefix + sep, ''),
          path.basename(source)
        )
      }
    })
  }