code: def argstoarray(*args):
      """
      Constructs a 2D array from a group of sequences.
  
      Sequences are filled with missing values to match the length of the longest
      sequence.
  
      Parameters
      ----------
      args : sequences
          Group of sequences.
  
      Returns
      -------
      argstoarray : MaskedArray
          A ( `m` x `n` ) masked array, where `m` is the number of arguments and
          `n` the length of the longest argument.
  
      Notes
      -----
      `numpy.ma.row_stack` has identical behavior, but is called with a sequence
      of sequences.
  
      """
      if len(args) == 1 and not isinstance(args[0], ndarray):
          output = ma.asarray(args[0])
          if output.ndim != 2:
              raise ValueError("The input should be 2D")
      else:
          n = len(args)
          m = max([len(k) for k in args])
          output = ma.array(np.empty((n, m), dtype=float), mask=True)
          for k, v in enumerate(args):
              output[k, : len(v)] = v
  
      output[np.logical_not(np.isfinite(output._data))] = masked
      return output
  
imports: from __future__ import division, print_function, absolute_import
  import numpy
  from numpy import ndarray
  import numpy.ma
  from numpy.ma import masked, nomask
  from scipy._lib.six import iteritems
  import itertools
  import warnings
  from collections import namedtuple
  from .None import distributions
  import scipy.special
  from ._stats_mstats_common import _find_repeats, linregress, theilslopes, siegelslopes
label_desc: Use image node_id 4 for calling a global function with example usage: argstoarray() and returns: output