def Func(arg_0, arg_1, arg_2, arg_3=None):
    """
    Handle one Func, possibly learning.

    .. note::  It is an error to have both ``enableLearn`` and
               ``enableInference`` set to False

    .. note:: By default, we don't Func the inference output when learning
              because it slows things down, but you can override this by passing
              in True for ``enableInference``.

    :param bottomUpInput: The bottom-up input as numpy list, typically from a
           spatial pooler.
    :param enableLearn: (bool) If true, perform learning
    :param enableInference: (bool) If None, default behavior is to disable the
           inference output when ``enableLearn`` is on. If true, Func the
           inference output. If false, do not Func the inference output.

    :returns: TODO: document

    """
    # As a speed optimization for now (until we need online learning), skip
    # computing the inference output while learning
    if arg_3 is None:
      if arg_2:
        arg_3 = False
      else:
        arg_3 = True

    assert (arg_2 or arg_3)

    # Get the list of columns that have bottom-up
    arg_4 = arg_1.nonzero()[0]
    if arg_2:
      arg_0.lrnIterationIdx += 1
    arg_0.iterationIdx +=  1

    if arg_0.verbosity >= 3:
      print "\n==== PY Iteration: %d =====" % (arg_0.iterationIdx)
      print "Active cols:", arg_4

    # Update segment duty cycles if we are crossing a "tier"
    # We determine if it's time to update the segment duty cycles. Since the
    # duty cycle calculation is a moving average based on a tiered alpha, it is
    # important that we update all segments on each tier boundary
    if arg_2:
      if arg_0.lrnIterationIdx in Segment.dutyCycleTiers:
        for arg_5, arg_6 in itertools.product(xrange(arg_0.numberOfCols),
                                      xrange(arg_0.cellsPerColumn)):
          for arg_7 in arg_0.cells[arg_5][arg_6]:
            arg_7.dutyCycle()

    # Update the average input density
    if arg_0.avgInputDensity is None:
      arg_0.avgInputDensity = len(arg_4)
    else:
      arg_0.avgInputDensity = (0.99 * arg_0.avgInputDensity +
                              0.01 * len(arg_4))

    # First, update the inference state
    # As a speed optimization for now (until we need online learning), skip
    # computing the inference output while learning
    if arg_3:
      arg_0._updateInferenceState(arg_4)

    # Next, update the learning state
    if arg_2:
      arg_0._updateLearningState(arg_4)

      # Apply global decay, and remove synapses and/or segments.
      # Synapses are removed if their permanence value is <= 0.
      # Segments are removed when they don't have synapses anymore.
      # Removal of synapses can trigger removal of whole segments!
      # todo: isolate the synapse/segment retraction logic so that
      # it can be called in adaptSegments, in the case where we
      # do global decay only episodically.
      if arg_0.globalDecay > 0.0 and ((arg_0.lrnIterationIdx % arg_0.maxAge) == 0):
        for arg_5, arg_6 in itertools.product(xrange(arg_0.numberOfCols),
                                      xrange(arg_0.cellsPerColumn)):

          arg_9 = [] # collect and remove outside the loop
          for arg_7 in arg_0.cells[arg_5][arg_6]:
            arg_10 = arg_0.lrnIterationIdx - arg_7.lastActiveIteration
            if arg_10 <= arg_0.maxAge:
              continue

            arg_11 = [] # collect and remove outside the loop
            for arg_12 in arg_7.syns:

              arg_12[2] = arg_12[2] - arg_0.globalDecay # decrease permanence

              if arg_12[2] <= 0:
                arg_11.append(arg_12) # add to list to delete

            # 1 for sequenceSegment flag
            if len(arg_11) == arg_7.getNumSynapses():
              arg_9.append(arg_7) # will remove the whole segment
            elif len(arg_11) > 0:
              for arg_13 in arg_11: # remove some synapses on segment
                arg_7.syns.remove(arg_13)

          for arg_14 in arg_9: # remove some segments of this cell
            arg_0._cleanUpdatesList(arg_5, arg_6, arg_14)
            arg_0.cells[arg_5][arg_6].remove(arg_14)

    # Update the prediction score stats
    # Learning always includes inference
    if arg_0.collectStats:
      if arg_3:
        arg_15 = arg_0.infPredictedState['t-1']
      else:
        arg_15 = arg_0.lrnPredictedState['t-1']
      arg_0._updateStatsInferEnd(arg_0._internalStats,
                                arg_4,
                                arg_15,
                                arg_0.colConfidence['t-1'])

    # Finally return the TM output
    arg_16 = arg_0._FuncOutput()

    # Print diagnostic information based on the current verbosity level
    arg_0.printComputeEnd(arg_16, learn=arg_2)

    arg_0.resetCalled = False
    return arg_16


def Func(arg_0, arg_1, arg_2, arg_3, arg_4,
                          arg_5):
    """
    This method goes through a list of segments for a given cell and
    deletes all synapses whose permanence is less than minPermanence and deletes
    any segments that have less than minNumSyns synapses remaining.

    :param colIdx        Column index
    :param cellIdx       Cell index within the column
    :param segList       List of segment references
    :param minPermanence Any syn whose permamence is 0 or < minPermanence will
                         be deleted.
    :param minNumSyns    Any segment with less than minNumSyns synapses remaining
                         in it will be deleted.

    :returns: tuple (numSegsRemoved, numSynsRemoved)
    """
    # Fill in defaults
    if arg_4 is None:
      arg_4 = arg_0.connectedPerm
    if arg_5 is None:
      arg_5 = arg_0.activationThreshold

    # Loop through all segments
    arg_6, arg_7 = 0, 0
    arg_8 = [] # collect and remove segments outside the loop
    for arg_9 in arg_3:

      # List if synapses to delete
      arg_10 = [arg_11 for arg_11 in arg_9.syns if arg_11[2] < arg_4]

      if len(arg_10) == len(arg_9.syns):
        arg_8.append(arg_9) # will remove the whole segment
      else:
        if len(arg_10) > 0:
          for arg_11 in arg_10: # remove some synapses on segment
            arg_9.syns.remove(arg_11)
            arg_7 += 1
        if len(arg_9.syns) < arg_5:
          arg_8.append(arg_9)

    # Remove segments that don't have enough synapses and also take them
    # out of the segment update list, if they are in there
    arg_6 += len(arg_8)
    for arg_12 in arg_8: # remove some segments of this cell
      arg_0._cleanUpdatesList(arg_1, arg_2, arg_12)
      arg_0.cells[arg_1][arg_2].remove(arg_12)
      arg_7 += len(arg_12.syns)

    return arg_6, arg_7


def Func(arg_0, arg_1=None, arg_2=None):
    """
    This method deletes all synapses whose permanence is less than
    minPermanence and deletes any segments that have less than
    minNumSyns synapses remaining.

    :param minPermanence: (float) Any syn whose permanence is 0 or <
           ``minPermanence``  will be deleted. If None is passed in, then
           ``self.connectedPerm`` is used.
    :param minNumSyns: (int) Any segment with less than ``minNumSyns`` synapses
           remaining in it will be deleted. If None is passed in, then
           ``self.activationThreshold`` is used.
    :returns: (tuple) ``numSegsRemoved``, ``numSynsRemoved``
    """
    # Fill in defaults
    if arg_1 is None:
      arg_1 = arg_0.connectedPerm
    if arg_2 is None:
      arg_2 = arg_0.activationThreshold

    # Loop through all cells
    arg_3, arg_4 = 0, 0
    for arg_5, arg_6 in itertools.product(xrange(arg_0.numberOfCols),
                                  xrange(arg_0.cellsPerColumn)):

      (arg_7, arg_8) = arg_0._FuncInCell(
          colIdx=arg_5, cellIdx=arg_6, segList=arg_0.cells[arg_5][arg_6],
          arg_1=arg_1, arg_2=arg_2)
      arg_3 += arg_7
      arg_4 += arg_8

    # Print all cells if verbosity says to
    if arg_0.verbosity >= 5:
      print "Cells, all segments:"
      arg_0.printCells(predictedOnly=False)

    return arg_3, arg_4


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Removes any update that would be for the given col, cellIdx, segIdx.

    NOTE: logically, we need to do this when we delete segments, so that if
    an update refers to a segment that was just deleted, we also remove
    that update from the update list. However, I haven't seen it trigger
    in any of the unit tests yet, so it might mean that it's not needed
    and that situation doesn't occur, by construction.
    """
    # TODO: check if the situation described in the docstring above actually
    #       occurs.
    for arg_4, arg_5 in arg_0.segmentUpdates.iteritems():
      arg_6, arg_7 = arg_4[0], arg_4[1]
      if arg_6 == arg_1 and arg_7 == arg_2:
        for arg_8 in arg_5:
          if arg_8[1].segment == arg_3:
            arg_0._removeSegmentUpdate(arg_8)


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    Find weakly activated cell in column with at least minThreshold active
    synapses.

    :param c            which column to look at
    :param activeState  the active cells
    :param minThreshold minimum number of synapses required

    :returns: tuple (cellIdx, segment, numActiveSynapses)
    """
    # Collect all cells in column c that have at least minThreshold in the most
    # activated segment
    arg_4 = arg_3
    arg_5 = -1
    arg_6 = -1

    for arg_7 in xrange(arg_0.cellsPerColumn):

      arg_8 = 0
      arg_9 = 0

      for arg_10, arg_11 in enumerate(arg_0.cells[arg_1][arg_7]):

        arg_12 = arg_0._getSegmentActivityLevel(arg_11, arg_2)

        if arg_12 > arg_8:
          arg_8 = arg_12
          arg_9 = arg_10

      if arg_8 >= arg_4:
        arg_4 = arg_8
        arg_5 = arg_9
        arg_6 = arg_7

    if arg_6 == -1:
      return (None, None, None)
    else:
      return (arg_6, arg_0.cells[arg_1][arg_6][arg_5],
                arg_4)


def Func(arg_0, arg_1, arg_2, arg_3):
    """
    For the given cell, find the segment with the largest number of active
    synapses. This routine is aggressive in finding the best match. The
    permanence value of synapses is allowed to be below connectedPerm. The number
    of active synapses is allowed to be below activationThreshold, but must be
    above minThreshold. The routine returns the segment index. If no segments are
    found, then an index of -1 is returned.

    :param c TODO: document
    :param i TODO: document
    :param activeState TODO: document
    """
    arg_4, arg_5 = arg_0.minThreshold, -1

    for arg_6, arg_7 in enumerate(arg_0.cells[arg_1][arg_2]):
      arg_8 = arg_0._getSegmentActivityLevel(arg_7, arg_3,
                                               connectedSynapsesOnly=False)

      if arg_8 >= arg_4:
        arg_4, arg_5 = arg_8, arg_6

    if arg_5 == -1:
      return None
    else:
      return arg_0.cells[arg_1][arg_2][arg_5]


def Func(arg_0, arg_1):
    """
    This function applies segment update information to a segment in a
    cell.

    Synapses on the active list get their permanence counts incremented by
    permanenceInc. All other synapses get their permanence counts decremented
    by permanenceDec.

    We also increment the positiveActivations count of the segment.

    :param segUpdate SegmentUpdate instance
    :returns: True if some synapses were decremented to 0 and the segment is a
             candidate for trimming
    """
    # This will be set to True if detect that any syapses were decremented to
    #  0
    arg_2 = False

    # segUpdate.segment is None when creating a new segment
    arg_3, arg_4, arg_5 = arg_1.columnIdx, arg_1.cellIdx, arg_1.segment

    # update.activeSynapses can be empty.
    # If not, it can contain either or both integers and tuples.
    # The integers are indices of synapses to update.
    # The tuples represent new synapses to create (src col, src cell in col).
    # We pre-process to separate these various element types.
    # synToCreate is not empty only if positiveReinforcement is True.
    # NOTE: the synapse indices start at *1* to skip the segment flags.
    arg_6 = arg_1.activeSynapses
    arg_7 = set([syn for syn in arg_6 if type(syn) == int])

    # Modify an existing segment
    if arg_5 is not None:

      if arg_0.verbosity >= 4:
        print "Reinforcing segment #%d for cell[%d,%d]" % (arg_5.segID, arg_3, arg_4)
        print "  before:",
        arg_5.debugPrint()

      # Mark it as recently useful
      arg_5.lastActiveIteration = arg_0.lrnIterationIdx

      # Update frequency and positiveActivations
      arg_5.positiveActivations += 1       # positiveActivations += 1
      arg_5.dutyCycle(active=True)

      # First, decrement synapses that are not active
      # s is a synapse *index*, with index 0 in the segment being the tuple
      # (segId, sequence segment flag). See below, creation of segments.
      arg_9 = len(arg_5.syns) - 1
      arg_10 = [s for s in xrange(0, arg_9+1) \
                            if s not in arg_7]
      arg_2 = arg_5.updateSynapses(arg_10,
                                           -arg_0.permanenceDec)

      # Now, increment active synapses
      arg_11 = [syn for syn in arg_7 if syn <= arg_9]
      arg_5.updateSynapses(arg_11, arg_0.permanenceInc)

      # Finally, create new synapses if needed
      # syn is now a tuple (src col, src cell)
      arg_12 = [syn for syn in arg_6 if type(syn) != int]
      # If we have fixed resources, get rid of some old syns if necessary
      if arg_0.maxSynapsesPerSegment > 0 \
          and len(arg_12) + len(arg_5.syns) > arg_0.maxSynapsesPerSegment:
        arg_13 = (len(arg_5.syns) + len(arg_12) -
                     arg_0.maxSynapsesPerSegment)
        arg_5.freeNSynapses(arg_13, arg_10, arg_0.verbosity)
      for arg_14 in arg_12:
        arg_5.addSynapse(arg_14[0], arg_14[1], arg_0.initialPerm)

      if arg_0.verbosity >= 4:
        print "   after:",
        arg_5.debugPrint()

    # Create a new segment
    else:

      # (segID, sequenceSegment flag, frequency, positiveActivations,
      #          totalActivations, lastActiveIteration)
      arg_15 = Segment(tm=arg_0, isSequenceSeg=arg_1.sequenceSegment)

      # numpy.float32 important so that we can match with C++
      for arg_16 in arg_6:
        arg_15.addSynapse(arg_16[0], arg_16[1], arg_0.initialPerm)

      if arg_0.verbosity >= 3:
        print "New segment #%d for cell[%d,%d]" % (arg_0.segID-1, arg_3, arg_4),
        arg_15.debugPrint()

      arg_0.cells[arg_3][arg_4].append(arg_15)

    return arg_2


def Func( arg_0 = 2,
                              arg_1 = 5,
                              arg_2 = [3,4],
                              arg_3 = 3,
                              arg_4 = 0,
                              arg_5 = 0,
                              **arg_6
                              ):
  """ Create training sequences that share some elements in the middle.

  Parameters:
  -----------------------------------------------------
  numSequences:         Number of unique training sequences to generate
  seqLen:               Overall length of each sequence
  sharedElements:       Which element indices of each sequence are shared. These
                          will be in the range between 0 and seqLen-1
  numOnBitsPerPattern:  Number of ON bits in each TM input pattern
  patternOverlap:       Max number of bits of overlap between any 2 patterns
  retval:               (numCols, trainingSequences)
                          numCols - width of the patterns
                          trainingSequences - a list of training sequences

  """

  # Total number of patterns used to build the sequences
  arg_7 = len(arg_2)
  arg_8 = arg_1 - arg_7
  arg_9 = arg_7 + arg_8 * arg_0

  # Create the table of patterns
  arg_10 = getSimplePatterns(arg_3, arg_9, arg_4)

  # Total number of columns required
  arg_11 = len(arg_10[0])

  # -----------------------------------------------------------------------
  # Create the training sequences
  arg_12 = []

  arg_13 = range(arg_7, arg_9)
  for arg_14 in xrange(arg_0):
    arg_15 = []

    # pattern indices [0 ... numSharedElements-1] are reserved for the shared
    #  middle
    arg_16 = range(arg_7)

    # Build up the sequence
    for arg_17 in xrange(arg_1):
      if arg_17 in arg_2:
        arg_18 = arg_16.pop(0)
      else:
        arg_18 = arg_13.pop(0)
      arg_15.append(arg_10[arg_18])

    arg_12.append(arg_15)

  if VERBOSITY >= 3:
    print "\nTraining sequences"
    printAllTrainingSequences(arg_12)

  return (arg_11, arg_12)


def Func(arg_0 = 10,
                      arg_1 = [2,3,4],
                      arg_2 = 5,
                      arg_3 = 3,
                      arg_4 = 0,
                      **arg_5
                      ):
  """ Create a bunch of sequences of various lengths, all built from
  a fixed set of patterns.

  Parameters:
  -----------------------------------------------------
  numSequences:         Number of training sequences to generate
  seqLen:               List of possible sequence lengths
  numPatterns:          How many possible patterns there are to use within
                          sequences
  numOnBitsPerPattern:  Number of ON bits in each TM input pattern
  patternOverlap:       Max number of bits of overlap between any 2 patterns
  retval:               (numCols, trainingSequences)
                          numCols - width of the patterns
                          trainingSequences - a list of training sequences

  """

  # Create the table of patterns
  arg_6 = getSimplePatterns(arg_3, arg_2, arg_4)

  # Total number of columns required
  arg_7 = len(arg_6[0])

  # -----------------------------------------------------------------------
  # Create the training sequences
  arg_8 = []
  for arg_9 in xrange(arg_0):

    # Build it up from patterns
    arg_10 = []
    arg_11 = random.choice(arg_1)
    for arg_9 in xrange(arg_11):
      arg_12 = random.choice(xrange(arg_2))
      arg_10.append(arg_6[arg_12])

    # Put it in
    arg_8.append(arg_10)

  if VERBOSITY >= 3:
    print "\nTraining sequences"
    printAllTrainingSequences(arg_8)

  return (arg_7, arg_8)


def Func(arg_0 = True,
              arg_1 = True,
              arg_2 = 100,
              arg_3 = 4,
              arg_4 = 3,
              arg_5 = 3,
              arg_6 = 3,
              arg_7 = 0.6,
              arg_8 = 0.1,
              arg_9 = 0.0,
              arg_10 = 0.0,
              arg_11 = 0,
              arg_12 = True,
              arg_13 = 0,
              arg_14 = 0,
              **arg_15
              ):

  """Create one or more TM instances, placing each into a dict keyed by
  name.

  Parameters:
  ------------------------------------------------------------------
  retval:   tms - dict of TM instances
  """

  # Keep these fixed:
  arg_16 = 0.5

  arg_17 = dict()

  if arg_0:
    if VERBOSITY >= 2:
      print "Creating BacktrackingTMCPP instance"

    arg_18 = BacktrackingTMCPP(numberOfCols = arg_2, cellsPerColumn = arg_3,
                               arg_7 = arg_7, arg_16 = arg_16,
                               arg_5 = arg_5, arg_6 = arg_6,
                               arg_8 = arg_8, arg_9 = arg_9,
                               arg_4 = arg_4,
                               arg_10 = arg_10, burnIn = 1,
                               seed=SEED, verbosity=VERBOSITY,
                               arg_12 = arg_12,
                               collectStats = True,
                               arg_11 = arg_11,
                               arg_13 = arg_13,
                               arg_14 = arg_14,
                               )

    # Ensure we are copying over learning states for TMDiff
    arg_18.retrieveLearningStates = True

    arg_17['CPP'] = arg_18

  if arg_1:
    if VERBOSITY >= 2:
      print "Creating PY TM instance"

    arg_20 = BacktrackingTM(numberOfCols = arg_2,
                           cellsPerColumn = arg_3,
                           arg_7 = arg_7,
                           arg_16 = arg_16,
                           arg_5 = arg_5,
                           arg_6 = arg_6,
                           arg_8 = arg_8,
                           arg_9 = arg_9,
                           arg_4 = arg_4,
                           arg_10 = arg_10, burnIn = 1,
                           seed=SEED, verbosity=VERBOSITY,
                           collectStats = True,
                           arg_11 = arg_11,
                           arg_13 = arg_13,
                           arg_14 = arg_14,
                           )

    arg_17['PY '] = arg_20

  return arg_17


def Func(arg_0):
  """
  Check for diffs among the TM instances in the passed in tms dict and
  raise an assert if any are detected

  Parameters:
  ---------------------------------------------------------------------
  tms:                  dict of TM instances
  """

  if len(arg_0) == 1:
    return
  if len(arg_0) > 2:
    raise "Not implemented for more than 2 TMs"

  arg_1 = fdrutils.tmDiff2(arg_0.values(), verbosity=VERBOSITY)
  assert(arg_1)
  return


def Func(arg_0, arg_1=arg_2, arg_3=11, arg_4=22, arg_5=0):
    """Compress a byte string.

    Args:
      string (bytes): The input data.
      mode (int, optional): The Funcion mode can be MODE_GENERIC (default),
        MODE_TEXT (for UTF-8 format text input) or MODE_FONT (for WOFF 2.0).
      quality (int, optional): Controls the Funcion-speed vs Funcion-
        density tradeoff. The higher the quality, the slower the Funcion.
        Range is 0 to 11. Defaults to 11.
      lgwin (int, optional): Base 2 logarithm of the sliding window size. Range
        is 10 to 24. Defaults to 22.
      lgblock (int, optional): Base 2 logarithm of the maximum input block size.
        Range is 16 to 24. If set to 0, the value will be set based on the
        quality. Defaults to 0.

    Returns:
      The Funced byte string.

    Raises:
      brotli.error: If arguments are invalid, or Funcor fails.
    """
    arg_6 = Compressor(arg_1=arg_1, arg_3=arg_3, arg_4=arg_4,
                            arg_5=arg_5)
    return arg_6.process(arg_0) + arg_6.finish()


def Func(arg_0):
    """Show string or char.
    """
    arg_1 = ''
    def formatSubString(arg_0):
        for arg_2 in arg_0:
            if arg_2==32: yield ' '
            else: yield outputCharFormatter(arg_2)
    if len(arg_1)<200: return ''.join(formatSubString(arg_0))
    else:
        return ''.join(formatSubString(arg_0[:100]))+'...'+ \
               ''.join(formatSubString(arg_0[-100:]))


def Func(arg_0, arg_1):
        """Read n bytes from the stream on a byte boundary.
        """
        if arg_0.pos&7: raise ValueError('Func: need byte boundary')
        arg_2 = arg_0.data[arg_0.pos>>3:(arg_0.pos>>3)+arg_1]
        arg_0.pos += 8*arg_1
        return arg_2


def Func(arg_0, arg_1):
        """Store decodeTable,
        and compute lengthTable, minLength, maxLength from encodings.
        """
        arg_0.decodeTable = arg_1
        #set of symbols with unknown length
        arg_2 = set(arg_1)
        #bit size under investigation
        arg_3 = 0
        arg_4 = {}
        while arg_2:
            arg_5 = (1<<arg_3)-1
            #split the encodings that we didn't find yet using b bits
            arg_6 = defaultdict(list)
            for arg_7 in arg_2: arg_6[arg_7&arg_5].append(arg_7)
            #unique encodings have a length of maskLength bits
            #set length, and remove from todo list
            for arg_7,arg_8 in arg_6.items():
                if len(arg_8)==1:
                    arg_4[arg_0.decodeTable[arg_7]] = arg_3
                    arg_2.remove(arg_7)
            #now investigate with longer mask
            arg_3 +=1
        #save result
        arg_0.lengthTable = arg_4
        arg_0.minLength = min(arg_4.values())
        arg_0.maxLength = max(arg_4.values())
        arg_0.switchToPrefix()


def Func(arg_0, arg_1=80):
        """Show all words of the code in a nice format.
        """
        #make table of all symbols with binary strings
        arg_2 = [
            (arg_0.bitPattern(arg_10.index), arg_0.mnemonic(arg_10.index))
            for arg_10 in arg_0
            ]
        #determine column widths the way Lisp programmers do it
        arg_3, arg_4 = map(max, map(
            map,
            repeat(len),
            zip(*arg_2)
            ))
        arg_5 = arg_3+arg_4
        arg_6 = 81//(arg_5+2)
        arg_7 = -(-len(arg_2)//arg_6)
        def justify(arg_8):
            arg_9,arg_10 = arg_8
            return arg_9.rjust(arg_3)+':'+arg_10.ljust(arg_4)
        for arg_11 in range(arg_7):
            print(' '.join(map(justify, arg_2[arg_11::arg_7])).rstrip())


def Func(arg_0, arg_1):
        """Read symbol from stream. Returns symbol, length.
        """
        arg_2, arg_3 = arg_0.decodePeek(arg_1.peek(arg_0.maxLength))
        arg_1.pos += arg_2
        return arg_2, arg_3


def Func(arg_0, arg_1, arg_2):
        """Override if you don't define value0 and extraTable
        """
        arg_3, arg_4 = arg_0.span(arg_1)
        Func = arg_3+(arg_2 or 0)
        if Func>arg_4:
            raise ValueError('value: extra out of range')
        return Func


def Func(arg_0, arg_1):
        """Give the range of possible values in a tuple
        Useful for mnemonic and explanation
        """
        arg_2 = arg_0.value0+sum(1<<x for x in arg_0.extraTable[:arg_1])
        arg_3 = arg_2+(1<<arg_0.extraTable[arg_1])
        return arg_2, arg_3-1


def Func(arg_0, arg_1, arg_2):
        """Give count and Func."""
        arg_1 = arg_1
        if arg_1==0: return 1, 0
        if arg_1<=arg_0.RLEMAX: return (1<<arg_1)+arg_2, 0
        return 1, arg_1-arg_0.RLEMAX


def Func(arg_0, arg_1):
        """Make a nice Func
        """
        arg_2,arg_3,arg_4 = arg_0.splitSymbol(arg_1)
        arg_5, arg_6 = arg_2.code.span(arg_2.index)
        arg_7 = arg_2.extraBits()
        arg_8, arg_6 = arg_3.code.span(arg_3.index)
        arg_9 = arg_3.extraBits()
        return 'I{}{}{}C{}{}{}{}'.format(
            arg_5,
            '+' if arg_7 else '',
            'x'*arg_7 if arg_7<6 else '[{}*x]'.format(arg_7),
            arg_8,
            '+' if arg_9 else '',
            'x'*arg_9 if arg_9<6 else '[{}*x]'.format(arg_9),
            '&D=0' if arg_4 else '')


def Func(arg_0, arg_1, arg_2=False):
        """Give Func representation of meaning.
        verbose compresses strings of x's
        """
        if arg_1<16:
            return ['last', '2last', '3last', '4last',
                'last-1', 'last+1', 'last-2', 'last+2', 'last-3', 'last+3',
                '2last-1', '2last+1', '2last-2', '2last+2', '2last-3', '2last+3'
                ][arg_1]
        if arg_1<16+arg_0.NDIRECT:
            return str(arg_1-16)
        #construct strings like "1xx01-15"
        arg_1 -= arg_0.NDIRECT+16
        arg_3 = arg_1 >> arg_0.NPOSTFIX
        arg_4 = arg_1 & (1<<arg_0.NPOSTFIX)-1
        if arg_0.NPOSTFIX: arg_5 = '1{0}{1}{2:0{3}b}{4:+d}'
        else: arg_5 = '1{0}{1}{4:+d}'
        return arg_5.format(
            arg_3&1,
            'x'*(2+arg_3>>1) if arg_3<13 or arg_2 else '[{}*x]'.format(2+arg_3>>1),
            arg_4, arg_0.NPOSTFIX,
            arg_0.NDIRECT+1-(4<<arg_0.NPOSTFIX))


def Func(arg_0, arg_1, arg_2):
        """Perform the proper action
        """
        #set environment for the UpperCaseFirst
        arg_3 = arg_0.upperCase1
        return eval(arg_0.actionList[arg_2], locals())


def Func(arg_0):
        """Read MNIBBLES and meta block length;
        if empty block, skip block and return true.
        """
        arg_0.MLEN = arg_0.verboseRead(MetablockLengthAlphabet())
        if arg_0.MLEN:
            return False
        #empty block; skip and return False
        arg_0.verboseRead(ReservedAlphabet())
        arg_2 = arg_0.verboseRead(SkipLengthAlphabet())
        arg_0.verboseRead(FillerAlphabet(streamPos=arg_0.stream.pos))
        arg_0.stream.pos += 8*arg_2
        print("Skipping to {:x}".format(arg_0.stream.pos>>3))
        return True


def Func(arg_0):
        """In place inverse move to front transform.
        """
        #mtf is initialized virtually with range(infinity)
        arg_1 = []
        for arg_2, arg_3 in enumerate(arg_0):
            #get old value from mtf. If never seen, take virtual value
            try: arg_4 = arg_1.pop(arg_3)
            except IndexError: arg_4 = arg_3
            #put value at front
            arg_1.insert(0, arg_4)
            #replace transformed value
            arg_0[arg_2] = arg_4


def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False):
    """Implementation of Dataset.to_arrow_table"""
    arg_5 = []
    arg_6 = []
    for arg_7, arg_8 in arg_0.to_items(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4):
        arg_5.append(arg_7)
        arg_6.append(arrow_array_from_numpy_array(arg_8))
    return pyarrow.Table.from_arrays(arg_6, arg_5)


def Func(arg_0):
    '''Adds method f to the Dataset class'''
    arg_1 = arg_0.__name__
    arg_2.__hidden__[arg_1] = arg_0
    return arg_0


def Func(arg_0, arg_1="distance", arg_2="pm_l", arg_3="pm_b",
                                                     arg_4="vl", arg_5="vb",
                                                     arg_6=False,
                                                     arg_7=False):
    """Convert proper motion to perpendicular velocities.

    :param distance:
    :param pm_long:
    :param pm_lat:
    :param vl:
    :param vb:
    :param cov_matrix_distance_pm_long_pm_lat:
    :param uncertainty_postfix:
    :param covariance_postfix:
    :param radians:
    :return:
    """
    arg_8 = 4.74057
    arg_0.add_variable("k", arg_8, overwrite=False)
    arg_0.add_virtual_column(arg_4, "k*{pm_long}*{distance}".format(**locals()))
    arg_0.add_virtual_column(arg_5, "k* {pm_lat}*{distance}".format(**locals()))
    if arg_6:
        arg_0.propagate_uncertainties([arg_0[arg_4], arg_0[arg_5]])


def Func(arg_0, arg_1=None):
        """Return a graphviz.Digraph object with a graph of the expression"""
        from graphviz import Graph, Digraph
        arg_2 = arg_0._graph()
        arg_1 = arg_1 or Digraph(comment=arg_0.expression)
        def walk(arg_2):
            if isinstance(arg_2, six.string_types):
                arg_1.node(arg_2, arg_2)
                return arg_2, arg_2
            else:
                arg_3, arg_4, arg_5, arg_6 = arg_2
                arg_7 = arg_3
                arg_1.node(arg_7, arg_3)
                for arg_8 in arg_6:
                    arg_9, arg_8 = walk(arg_8)
                    arg_1.edge(arg_7, arg_9)
                return arg_7, arg_2
        walk(arg_2)
        return arg_1


def Func(arg_0, arg_1, arg_2=None, arg_3=None):
        """Map values of an expression or in memory column accoring to an input
        dictionary or a custom callable function.

        Example:

        >>> import vaex
        >>> df = vaex.from_arrays(color=['red', 'red', 'blue', 'red', 'green'])
        >>> Funcper = {'red': 1, 'blue': 2, 'green': 3}
        >>> df['color_Funcped'] = df.color.Func(Funcper)
        >>> df
        #  color      color_Funcped
        0  red                   1
        1  red                   1
        2  blue                  2
        3  red                   1
        4  green                 3
        >>> import numpy as np
        >>> df = vaex.from_arrays(type=[0, 1, 2, 2, 2, np.nan])
        >>> df['role'] = df['type'].Func({0: 'admin', 1: 'maintainer', 2: 'user', np.nan: 'unknown'})
        >>> df
        #    type  role
        0       0  admin
        1       1  maintainer
        2       2  user
        3       2  user
        4       2  user
        5     nan  unknown

        :param Funcper: dict like object used to Func the values from keys to values
        :param nan_Funcping: value to be used when a nan is present (and not in the Funcper)
        :param null_Funcping: value to use used when there is a missing value
        :return: A vaex expression
        :rtype: vaex.expression.Expression
        """
        assert isinstance(arg_1, collectionsAbc.Mapping), "Funcper should be a dict like object"

        arg_4 = arg_0.ds
        arg_5 = np.array(list(arg_1.keys()))

        # we Func the keys to a ordinal values [0, N-1] using the set
        arg_6 = arg_4._set(arg_0.expression)
        arg_7 = arg_6.keys()
        arg_8 = any([key != key for key in arg_5])

        # we want all possible values to be converted
        # so Funcper's key should be a superset of the keys found
        if not set(arg_5).issuperset(arg_7):
            arg_9 = set(arg_7).difference(arg_5)
            arg_10 = list(arg_9)[0]
            if arg_10 == arg_10:  # safe nan check
                raise ValueError('Missing values in Funcper: %s' % arg_9)

        # and these are the corresponding choices
        arg_11 = [arg_1[key] for key in arg_7]
        if arg_6.has_nan:
            if arg_8:
                arg_11 = [arg_1[np.nan]] + arg_11
            else:
                arg_11 = [arg_2] + arg_11
        if arg_6.has_null:
            arg_11 = [arg_3] + arg_11
        arg_11 = np.array(arg_11)

        arg_12 = arg_4.add_variable('Func_key_set', arg_6, unique=True)
        arg_13 = arg_4.add_variable('Func_choices', arg_11, unique=True)
        arg_14 = '_choose(_ordinal_values({}, {}), {})'.format(arg_0, arg_12, arg_13)
        return Expression(arg_4, arg_14)


def Func(*arg_0, **arg_1):
    """Create a vaex Func, the QApplication mainloop must be started.

    In ipython notebook/jupyter do the following:

    >>> import vaex.ui.main # this causes the qt api level to be set properly
    >>> import vaex

    Next cell:

    >>> %gui qt

    Next cell:

    >>> Func = vaex.Func()

    From now on, you can run the Func along with jupyter

    """

    import vaex.ui.main
    return vaex.ui.main.VaexApp()


def Func(arg_0):
    """Open a list of filenames, and return a DataFrame with all DataFrames cocatenated.

    :param list[str] filenames: list of filenames/paths
    :rtype: DataFrame
    """
    arg_1 = []
    for arg_2 in arg_0:
        arg_2 = arg_2.strip()
        if arg_2 and arg_2[0] != "#":
            arg_1.append(open(arg_2))
    return vaex.dataframe.DataFrameConcatenated(arg_1=arg_1)


def Func(arg_0):
    """Create a vaex DataFrame from an Astropy Table."""
    import vaex.file.other
    return vaex.file.other.DatasetAstropyTable(arg_0=arg_0)


def Func(**arg_0):
    """Create an in memory DataFrame from numpy arrays.

    Example

    >>> import vaex, numpy as np
    >>> x = np.arange(5)
    >>> y = x ** 2
    >>> vaex.Func(x=x, y=y)
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16
    >>> some_dict = {'x': x, 'y': y}
    >>> vaex.Func(**some_dict)  # in case you have your columns in a dict
      #    x    y
      0    0    0
      1    1    1
      2    2    4
      3    3    9
      4    4   16

    :param arrays: keyword arguments with arrays
    :rtype: DataFrame
    """
    import numpy as np
    import six
    from .column import Column
    arg_1 = vaex.dataframe.DataFrameArrays("array")
    for arg_2, arg_3 in arg_0.items():
        if isinstance(arg_3, Column):
            arg_1.add_column(arg_2, arg_3)
        else:
            arg_3 = np.asanyarray(arg_3)
            arg_1.add_column(arg_2, arg_3)
    return arg_1


def Func(arg_0=2, arg_1=256, arg_2=-2.5, arg_3=None, arg_4=1, arg_5=None):
    """Creates a Func DataFrame.
    """
    import vaex.file
    return vaex.file.other.Zeldovich(arg_0=arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)


def Func(arg_0):
    '''Concatenate a list of DataFrames.

    :rtype: DataFrame
    '''
    arg_1 = reduce((lambda x, y: x.Func(y)), arg_0)
    return arg_1


def Func(arg_0, arg_1):
        """Add a dataset and add it to the UI"""
        logger.debug("Func dataset: %r", arg_1)
        if arg_1.startswith("http") or arg_1.startswith("ws"):
            arg_2 = vaex.Func(arg_1, thread_mover=arg_0.call_in_main_thread)
        else:
            arg_2 = vaex.Func(arg_1)
        arg_0.add_recently_Funced(arg_1)
        arg_0.dataset_selector.add(arg_2)
        return arg_2


def Func(arg_0):
    '''Decorator to transparantly accept Func computation.

    Example:

    >>> Func_sum = ds.sum(ds.E, binby=ds.x, limits=limits,
    >>>                   shape=4, delay=True)
    >>> @vaex.Func
    >>> def total_sum(sums):
    >>>     return sums.sum()
    >>> sum_of_sums = total_sum(Func_sum)
    >>> ds.execute()
    >>> sum_of_sums.get()
    See the tutorial for a more complete example https://docs.vaex.io/en/latest/tutorial.html#Parallel-computations
    '''

    def wrapped(*arg_1, **arg_2):
        # print "calling", f, "with", kwargs
        # key_values = kwargs.items()
        arg_3 = list([(key, promisify(arg_9)) for key, arg_9 in arg_2.items()])
        # key_promise = [(key, promisify(value)) for key, value in key_values]
        arg_4 = list([promisify(arg_9) for arg_9 in arg_1])
        arg_5 = list([arg_7 for key, arg_7 in arg_3])
        arg_6 = arg_4 + arg_5
        for arg_7 in arg_6:
            def echo_error(arg_8, arg_7=arg_7):
                print("error with ", arg_7, "exception is", arg_8)
                # raise exc

            def echo(arg_9, arg_7=arg_7):
                print("done with ", repr(arg_7), "value is", arg_9)
            # promise.then(echo, echo_error)

        # print promises
        arg_10 = aplus.listPromise(*arg_6)

        def call(arg_11):
            arg_12 = {key: arg_7.get() for key, arg_7 in arg_3}
            arg_13 = list([arg_7.get() for arg_7 in arg_4])
            return arg_0(*arg_13, **arg_12)

        def error(arg_8):
            print("error", arg_8)
            raise arg_8
        return arg_10.then(call, error)
    return wrapped


def Func(arg_0, arg_1, arg_2=False):
        """Helper function for returning tasks results, result when immediate is True, otherwise the task itself, which is a promise"""
        if arg_0.delay:
            # should return a task or a promise nesting it
            return arg_0.executor.schedule(arg_1)
        else:
            import vaex.utils
            arg_3 = None
            try:
                if arg_2 == True:
                    def update(arg_4):
                        arg_5.update(arg_4)
                        return True
                    arg_5 = vaex.utils.progressbar(arg_1.name)
                    arg_3 = arg_0.executor.signal_progress.connect(update)
                elif arg_2:
                    arg_3 = arg_0.executor.signal_progress.connect(arg_2)
                arg_6 = arg_0.executor.run(arg_1)
                if arg_2 == True:
                    arg_5.finish()
                    sys.stdout.write('\n')
                return arg_6
            finally:
                if arg_3:
                    arg_0.executor.signal_progress.disconnect(arg_3)


def Func(arg_0, arg_1, arg_2):
        """Sort table by given column number.
        """
        arg_0.emit(QtCore.SIGNAL("layoutAboutToBeChanged()"))
        if arg_1 == 0:
            print("by name")
            # get indices, Funced by pair name
            arg_3 = list(zip(arg_0.pairs, list(range(len(arg_0.pairs)))))
            print(arg_3)
            arg_3.Func(key=operator.itemgetter(0))
            print(arg_3)
            arg_0.indices = list(map(operator.itemgetter(1), arg_3))
            print((arg_0.indices))
        if arg_1 == 1:
            # get indices, Funced by ranking, or no Funcing
            if None not in arg_0.ranking:
                arg_3 = list(zip(arg_0.ranking, list(range(len(arg_0.pairs)))))
                arg_3.Func(key=operator.itemgetter(0))
                arg_0.indices = list(map(operator.itemgetter(1), arg_3))
            else:
                arg_0.indices = list(range(len(arg_0.pairs)))
            print((arg_0.indices))
        if arg_2 == QtCore.Qt.DescendingOrder:
            arg_0.indices.reverse()
        print((arg_0.indices))
        arg_0.emit(QtCore.SIGNAL("layoutChanged()"))


def Func(arg_0):
        """Used for unittesting to make sure the plots are all done"""
        logger.debug("will wait for last plot to finish")
        arg_0._plot_event = threading.Event()
        arg_0.queue_update.Func()
        arg_0.queue_replot.Func()
        arg_0.queue_redraw.Func()
        arg_2 = QtCore.QCoreApplication.instance()
        arg_3 = 10
        while not arg_0._plot_event.is_set():
            logger.debug("waiting for last plot to finish")
            arg_2.processEvents()
            QtTest.QTest.qSleep(arg_3)
        logger.debug("waiting for plot finished")


def Func(arg_0, arg_1, arg_2=False, arg_3=False):
        """Evaluates expression, and drop the result, usefull for benchmarking, since vaex is usually lazy"""
        arg_1 = _ensure_string_from_expression(arg_1)
        def map(arg_4):
            pass
        def reduce(arg_5, arg_6):
            pass
        return arg_0.map_reduce(map, reduce, [arg_1], arg_3=arg_3, arg_2=arg_2, name='Func', to_numpy=False)


def Func(arg_0, arg_1, arg_2=[], arg_3=None, arg_4=arg_5, arg_6=False, arg_7=False, arg_8=None, arg_9=False):
        """Calculate the Func for the given expression, possible on a grid defined by binby

        Example:

        >>> df.Func("L")
        304054882.49378014
        >>> df.Func("L", binby="E", shape=4)
        array([  8.83517994e+06,   5.92217598e+07,   9.55218726e+07,
                         1.40008776e+08])

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :return: {return_stat_scalar}
        """
        return arg_0._compute_agg('Func', arg_1, arg_2, arg_3, arg_4, arg_6, arg_7, arg_9, arg_8)
        @delayed
        def finish(*arg_10):
            return vaex.utils.unlistify(arg_11, arg_10)
        arg_1 = _ensure_strings_from_expressions(arg_1)
        arg_2 = _ensure_strings_from_expressions(arg_2)
        arg_11, [arg_12, ] = vaex.utils.listify(arg_1)
        arg_13 = vaex.utils.progressbars(arg_8)
        arg_3 = arg_0.limits(arg_2, arg_3, arg_7=True)
        # stats = [calculate(expression, limits) for expression in expressions]
        arg_10 = [arg_0._Func_calculation(arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_6=arg_6, arg_13=arg_13) for arg_1 in arg_12]
        arg_14 = finish(*arg_10)
        return arg_0._delay(arg_7, arg_14)


def Func(arg_0, arg_1, arg_2=[], arg_3=None, arg_4=arg_5, arg_6=False, arg_7=False, arg_8=None):
        """Calculate the standard deviation for the given expression, possible on a grid defined by binby

        >>> df.Func("vz")
        110.31773397535071
        >>> df.Func("vz", binby=["(x**2+y**2)**0.5"], shape=4)
        array([ 123.57954851,   85.35190177,   61.14345748,   38.0740619 ])

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :param progress: {progress}
        :return: {return_stat_scalar}
        """
        @delayed
        def finish(arg_9):
            return arg_9**0.5
        return arg_0._delay(arg_7, finish(arg_0.var(arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_6=arg_6, arg_7=True, arg_8=arg_8)))


def Func(arg_0, arg_1, arg_2=None, arg_3=[], arg_4=None, arg_5=arg_6, arg_7=False, arg_8=False, arg_9=None):
        """Calculate the Funcariance matrix for x and y or more expressions, possibly on a grid defined by binby.

        Either x and y are expressions, e.g:

        >>> df.Func("x", "y")

        Or only the x argument is given with a list of expressions, e,g.:

        >>> df.Func(["x, "y, "z"])

        Example:

        >>> df.Func("x", "y")
        array([[ 53.54521742,  -3.8123135 ],
        [ -3.8123135 ,  60.62257881]])
        >>> df.Func(["x", "y", "z"])
        array([[ 53.54521742,  -3.8123135 ,  -0.98260511],
        [ -3.8123135 ,  60.62257881,   1.21381057],
        [ -0.98260511,   1.21381057,  25.55517638]])

        >>> df.Func("x", "y", binby="E", shape=2)
        array([[[  9.74852878e+00,  -3.02004780e-02],
        [ -3.02004780e-02,   9.99288215e+00]],
        [[  8.43996546e+01,  -6.51984181e+00],
        [ -6.51984181e+00,   9.68938284e+01]]])

        :param x: {expression}
        :param y: {expression_single}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param selection: {selection}
        :param delay: {delay}
        :return: {return_stat_scalar}, the last dimensions are of shape (2,2)
        """
        arg_7 = _ensure_strings_from_expressions(arg_7)
        if arg_2 is None:
            if not _issequence(arg_1):
                raise ValueError("if y argument is not given, x is expected to be sequence, not %r", arg_1)
            arg_10 = arg_1
        else:
            arg_10 = [arg_1, arg_2]
        arg_11 = len(arg_10)
        arg_3 = _ensure_list(arg_3)
        arg_5 = _expand_shape(arg_5, len(arg_3))
        arg_12 = vaex.utils.progressbars(arg_9)
        arg_4 = arg_0.limits(arg_3, arg_4, arg_7=arg_7, arg_8=True)

        @delayed
        def calculate(arg_10, arg_4):
            # print('limits', limits)
            arg_13 = tasks.TaskStatistic(arg_0, arg_3, arg_5, arg_4, weights=arg_10, op=tasks.OP_COV, arg_7=arg_7)
            arg_0.executor.schedule(arg_13)
            arg_12.add_task(arg_13, "Funcariance values for %r" % arg_10)
            return arg_13

        @delayed
        def finish(arg_14):
            arg_11 = len(arg_10)
            arg_15 = arg_14[..., :arg_11]
            arg_16 = arg_14[..., arg_11:2 * arg_11]
            with np.errstate(divide='ignore', invalid='ignore'):
                arg_17 = arg_16 / arg_15
            # matrix of means * means.T
            arg_18 = arg_17[..., None] * arg_17[..., None, :]

            arg_15 = arg_14[..., 2 * arg_11:2 * arg_11 + arg_11**2]
            arg_16 = arg_14[..., 2 * arg_11 + arg_11**2:]
            arg_5 = arg_15.shape[:-1] + (arg_11, arg_11)
            arg_15 = arg_15.reshape(arg_5)
            arg_16 = arg_16.reshape(arg_5)
            with np.errstate(divide='ignore', invalid='ignore'):
                arg_19 = arg_16 / arg_15
            arg_20 = arg_19 - arg_18
            return arg_20
        arg_12 = vaex.utils.progressbars(arg_9)
        arg_14 = calculate(arg_10, arg_4)
        arg_20 = finish(arg_14)
        return arg_0._delay(arg_8, arg_20)


def Func(arg_0, arg_1, arg_2=50., arg_3=[], arg_4=None, arg_5=arg_6, arg_7=256, arg_8="minmax", arg_9=False, arg_10=False):
        """Calculate the median , possibly on a grid defined by binby.

        NOTE: this value is approximated by calculating the cumulative distribution on a grid defined by
        percentile_shape and percentile_limits

        :param expression: {expression}
        :param binby: {binby}
        :param limits: {limits}
        :param shape: {shape}
        :param percentile_limits: {percentile_limits}
        :param percentile_shape: {percentile_shape}
        :param selection: {selection}
        :param delay: {delay}
        :return: {return_stat_scalar}
        """
        return arg_0.percentile_approx(arg_1, 50, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_7=arg_7, arg_8=arg_8, arg_9=arg_9, arg_10=arg_10)


def Func(arg_0, arg_1="source_id/34359738368", arg_2=12, arg_3=8, arg_4="count(*)", arg_5=None,
                     arg_6=None,
                     arg_7="equatorial", arg_8="galactic", arg_9=None,
                     arg_10="afmhot", arg_11=None, arg_12=800, arg_13=True,
                     arg_14=None, arg_15=False, arg_16="", arg_17=None, arg_18=False, arg_19=True,
                     arg_20=(0, 0, 0), **arg_21):
        """Viz data in 2d using a healpix column.

        :param healpix_expression: {healpix_max_level}
        :param healpix_max_level: {healpix_max_level}
        :param healpix_level: {healpix_level}
        :param what: {what}
        :param selection: {selection}
        :param grid: {grid}
        :param healpix_input: Specificy if the healpix index is in "equatorial", "galactic" or "ecliptic".
        :param healpix_output: Plot in "equatorial", "galactic" or "ecliptic".
        :param f: function to apply to the data
        :param colormap: matplotlib colormap
        :param grid_limits: Optional sequence [minvalue, maxvalue] that determine the min and max value that map to the colormap (values below and above these are clipped to the the min/max). (default is [min(f(grid)), max(f(grid)))
        :param image_size: size for the image that healpy uses for rendering
        :param nest: If the healpix data is in nested (True) or ring (False)
        :param figsize: If given, modify the matplotlib figure size. Example (14,9)
        :param interactive: (Experimental, uses healpy.mollzoom is True)
        :param title: Title of figure
        :param smooth: apply gaussian smoothing, in degrees
        :param show: Call matplotlib's show (True) or not (False, defaut)
        :param rotation: Rotatate the plot, in format (lon, lat, psi) such that (lon, lat) is the center, and rotate on the screen by angle psi. All angles are degrees.
        :return:
        """
        # plot_level = healpix_level #healpix_max_level-reduce_level
        import healpy as hp
        import pylab as plt
        if arg_6 is None:
            arg_22 = arg_2 - arg_3
            arg_23 = 2**arg_3
            arg_24 = hp.nside2npix(arg_23)
            # print nmax, np.sqrt(nmax)
            arg_25 = 4**arg_22
            # print nmax
            arg_26 = 1. / arg_25 / 2
            arg_6 = arg_0._stat(arg_4=arg_4, binby="%s/%s" % (arg_1, arg_25), limits=[-arg_26, arg_24 - arg_26], shape=arg_24, arg_5=arg_5)
        if arg_11:
            arg_27, arg_28 = arg_11
        else:
            arg_27 = arg_28 = None
        arg_29 = arg_9
        arg_9 = _parse_f(arg_9)
        if arg_17:
            if arg_13:
                arg_6 = hp.reorder(arg_6, inp="NEST", out="RING")
                arg_13 = False
            # grid[np.isnan(grid)] = np.nanmean(grid)
            arg_6 = hp.smoothing(arg_6, sigma=np.radians(arg_17))
        arg_30 = arg_9(arg_6)
        arg_31 = dict(equatorial='C', galactic='G', ecliptic="E")
        arg_32 = plt.gcf()
        if arg_14 is not None:
            arg_32.set_size_inches(*arg_14)
        arg_33 = arg_4
        if arg_29:
            arg_33 = arg_29 + " " + arg_33
        arg_9 = hp.mollzoom if arg_15 else hp.mollview
        with warnings.catch_warnings():
            warnings.simplefilter("ignore")
            arg_34 = arg_31[arg_7], arg_31[arg_8]
            if arg_31[arg_7] == arg_31[arg_8]:
                arg_34 = None
            arg_9(arg_30, unit=arg_33, rot=arg_20, arg_13=arg_13, arg_16=arg_16, arg_34=arg_34,
              cmap=arg_10, hold=True, xsize=arg_12, min=arg_27, max=arg_28, cbar=arg_19, **arg_21)
        if arg_18:
            plt.show()


def Func(arg_0, arg_1, arg_2, arg_3, arg_4=None, arg_5=None, arg_6=None, arg_7=None, arg_8=None, arg_9=None, arg_10="count(*)", arg_11=128, arg_12=[None, True], arg_13=None,
               arg_14=None,
               arg_15=None, arg_16=None, arg_17=None, arg_18="normalize", arg_19="afmhot",
               arg_20=None, arg_21=None,
               arg_22=True, arg_23=[0.1, 0.5, 0.9], arg_24=[0.01, 0.05, 0.1], arg_25=0.1,
               arg_26=True, **arg_27):
        """Use at own risk, requires ipyvolume"""
        import vaex.ext.ipyvolume
        # vaex.ext.ipyvolume.
        arg_28 = vaex.ext.ipyvolume.PlotDefault
        Func = arg_28(df=arg_0, arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4, arg_5=arg_5, arg_6=arg_6,
                     arg_9=arg_9, arg_11=arg_11, arg_8=arg_8, arg_10=arg_10,
                     arg_13=arg_13, arg_20=arg_20, arg_21=arg_21,
                     arg_12=arg_12, arg_15=arg_15, arg_16=arg_16,
                     arg_17=arg_17, arg_14=arg_14, arg_18=arg_18, arg_19=arg_19, **arg_27)
        if arg_26:
            Func.show()
        return Func


def Func(arg_0, arg_1, arg_2=False):
        """Return the numpy dtype for the given expression, if not a column, the first row will be evaluated to get the dtype."""
        arg_1 = _ensure_string_from_expression(arg_1)
        if arg_1 in arg_0.variables:
            return np.float64(1).dtype
        elif arg_1 in arg_0.columns.keys():
            arg_3 = arg_0.columns[arg_1]
            arg_4 = arg_3[0:1]
            Func = arg_4.dtype
        else:
            arg_4 = arg_0.evaluate(arg_1, 0, 1, filtered=False)
            Func = arg_4.dtype
        if not arg_2:
            if Func != str_type:
                if Func.kind in 'US':
                    return str_type
                if Func.kind == 'O':
                    # we lie about arrays containing strings
                    if isinstance(arg_4[0], six.string_types):
                        return str_type
        return Func


def Func(arg_0, arg_1=False):
        """Each DataFrame has a directory where files are stored for metadata etc.

        Example

        >>> import vaex
        >>> ds = vaex.example()
        >>> vaex.Func()
        '/Users/users/breddels/.vaex/dfs/_Users_users_breddels_vaex-testing_data_helmi-dezeeuw-2000-10p.hdf5'

        :param bool create: is True, it will create the directory if it does not exist
        """
        if arg_0.is_local():
            arg_2 = os.path.abspath(arg_0.path).replace(os.path.sep, "_")[:250]  # should not be too long for most os'es
            arg_2 = arg_2.replace(":", "_")  # for windows drive names
        else:
            arg_3 = arg_0.server
            arg_2 = "%s_%s_%s_%s" % (arg_3.hostname, arg_3.port, arg_3.base_path.replace("/", "_"), arg_0.name)
        arg_4 = os.path.join(vaex.utils.Func(), "dfs", arg_2)
        if arg_1 and not os.path.exists(arg_4):
            os.makedirs(arg_4)
        return arg_4


def Func(arg_0):
        """Return the internal state of the DataFrame in a dictionary

        Example:

        >>> import vaex
        >>> df = vaex.from_scalars(x=1, y=2)
        >>> df['r'] = (df.x**2 + df.y**2)**0.5
        >>> df.Func()
        {'active_range': [0, 1],
        'column_names': ['x', 'y', 'r'],
        'description': None,
        'descriptions': {},
        'functions': {},
        'renamed_columns': [],
        'selections': {'__filter__': None},
        'ucds': {},
        'units': {},
        'variables': {},
        'virtual_columns': {'r': '(((x ** 2) + (y ** 2)) ** 0.5)'}}
        """

        arg_1 = list(arg_0.virtual_columns.keys()) + list(arg_0.variables.keys())
        arg_2 = {arg_5: str(arg_6) for arg_5, arg_6 in arg_0.units.items()}
        arg_3 = {arg_5: arg_6 for arg_5, arg_6 in arg_0.ucds.items() if arg_5 in arg_1}
        arg_4 = {arg_5: arg_6 for arg_5, arg_6 in arg_0.descriptions.items()}
        import vaex.serialize

        def check(arg_5, arg_6):
            if not vaex.serialize.can_serialize(arg_6.f):
                warnings.warn('Cannot serialize function for virtual column {} (use vaex.serialize.register)'.format(arg_5))
                return False
            return True

        def clean(arg_6):
            return vaex.serialize.to_dict(arg_6.f)
        arg_7 = {arg_5: clean(arg_6) for arg_5, arg_6 in arg_0.functions.items() if check(arg_5, arg_6)}
        arg_8 = {arg_5: arg_6 for arg_5, arg_6 in arg_0.virtual_columns.items()}
        arg_9 = {name: arg_0.get_selection(name) for name, history in arg_0.selection_histories.items()}
        arg_9 = {name: selection.to_dict() if selection is not None else None for name, selection in arg_9.items()}
    # if selection is not None}
        arg_10 = dict(arg_8=arg_8,
                     column_names=arg_0.column_names,
                     renamed_columns=arg_0._renamed_columns,
                     variables=arg_0.variables,
                     arg_7=arg_7,
                     arg_9=arg_9,
                     arg_3=arg_3,
                     arg_2=arg_2,
                     arg_4=arg_4,
                     description=arg_0.description,
                     active_range=[arg_0._index_start, arg_0._index_end])
        return arg_10


def Func(arg_0):
        """Writes virtual columns, variables and their ucd,description and units.

        The default implementation is to write this to a file called virtual_meta.yaml in the directory defined by
        :func:`DataFrame.get_private_dir`. Other implementation may store this in the DataFrame file itself.

        This method is called after virtual columns or variables are added. Upon opening a file, :func:`DataFrame.update_virtual_meta`
        is called, so that the information is not lost between sessions.

        Note: opening a DataFrame twice may result in corruption of this file.

        """
        arg_1 = os.path.join(arg_0.get_private_dir(create=True), "virtual_meta.yaml")
        arg_2 = list(arg_0.virtual_columns.keys()) + list(arg_0.variables.keys())
        arg_3 = {key: str(value) for key, value in arg_0.units.items() if key in arg_2}
        arg_4 = {key: value for key, value in arg_0.ucds.items() if key in arg_2}
        arg_5 = {key: value for key, value in arg_0.descriptions.items() if key in arg_2}
        arg_6 = dict(virtual_columns=arg_0.virtual_columns,
                         variables=arg_0.variables,
                         arg_4=arg_4, arg_3=arg_3, arg_5=arg_5)
        vaex.utils.write_json_or_yaml(arg_1, arg_6)


def Func(arg_0):
        """Writes all meta data, ucd,description and units

        The default implementation is to write this to a file called meta.yaml in the directory defined by
        :func:`DataFrame.get_private_dir`. Other implementation may store this in the DataFrame file itself.
        (For instance the vaex hdf5 implementation does this)

        This method is called after virtual columns or variables are added. Upon opening a file, :func:`DataFrame.update_meta`
        is called, so that the information is not lost between sessions.

        Note: opening a DataFrame twice may result in corruption of this file.

        """
        # raise NotImplementedError
        arg_1 = os.path.join(arg_0.get_private_dir(create=True), "meta.yaml")
        arg_2 = {key: str(value) for key, value in arg_0.units.items()}
        arg_3 = dict(description=arg_0.description,
                         ucds=arg_0.ucds, arg_2=arg_2, descriptions=arg_0.descriptions,
                         )
        vaex.utils.write_json_or_yaml(arg_1, arg_3)


def Func(arg_0, arg_1=None, arg_2=None, arg_3=None, **arg_4):
        """Generate a Subspaces object, based on a custom list of expressions or all possible combinations based on
        dimension

        :param expressions_list: list of list of expressions, where the inner list defines the subspace
        :param dimensions: if given, generates a subspace with all possible combinations for that dimension
        :param exclude: list of
        """
        if arg_2 is not None:
            arg_1 = list(itertools.combinations(arg_0.get_column_names(), arg_2))
            if arg_3 is not None:
                import six

                def excluded(arg_5):
                    if callable(arg_3):
                        return arg_3(arg_5)
                    elif isinstance(arg_3, six.string_types):
                        return arg_3 in arg_5
                    elif isinstance(arg_3, (list, tuple)):
                        # $#expressions = set(expressions)
                        for arg_6 in arg_3:
                            if isinstance(arg_6, six.string_types):
                                if arg_6 in arg_5:
                                    return True
                            elif isinstance(arg_6, (list, tuple)):
                                if set(arg_6).issubset(arg_5):
                                    return True
                            else:
                                raise ValueError("elements of exclude should contain a string or a sequence of strings")
                    else:
                        raise ValueError("exclude should contain a string, a sequence of strings, or should be a callable")
                    return False
                # test if any of the elements of exclude are a subset of the expression
                arg_1 = [expr for expr in arg_1 if not excluded(expr)]
            logger.debug("expression list generated: %r", arg_1)
        import vaex.legacy
        return vaex.legacy.Subspaces([arg_0(*arg_5, **arg_4) for arg_5 in arg_1])


def Func(arg_0, arg_1, arg_2, arg_3=True):
        """Set the variable to an expression or value defined by expression_or_value.

        Example

        >>> df.Func("a", 2.)
        >>> df.Func("b", "a**2")
        >>> df.get_variable("b")
        'a**2'
        >>> df.evaluate_variable("b")
        4.0

        :param name: Name of the variable
        :param write: write variable to meta file
        :param expression: value or expression
        """
        arg_0.variables[arg_1] = arg_2


def Func(arg_0, arg_1):
        """Evaluates the variable given by name."""
        if isinstance(arg_0.variables[arg_1], six.string_types):
            # TODO: this does not allow more than one level deep variable, like a depends on b, b on c, c is a const
            arg_2 = eval(arg_0.variables[arg_1], expression_namespace, arg_0.variables)
            return arg_2
        else:
            return arg_0.variables[arg_1]


def Func(arg_0, arg_1="default", arg_2=None, arg_3=None, arg_4=None, arg_5=False):
        """Internal use, ignores the filter"""
        arg_2 = arg_2 or 0
        arg_3 = arg_3 or len(arg_0)
        arg_6 = scopes._BlockScopeSelection(arg_0, arg_2, arg_3, arg_4, arg_5=arg_5)
        return arg_6.evaluate(arg_1)


def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False):
        """Return a dict containing the ndarray corresponding to the evaluated data

        :param column_names: list of column names, to export, when None DataFrame.get_column_names(strings=strings, virtual=virtual) is used
        :param selection: {selection}
        :param strings: argument passed to DataFrame.get_column_names when column_names is None
        :param virtual: argument passed to DataFrame.get_column_names when column_names is None
        :return: dict
        """
        return dict(arg_0.to_items(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4))


def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False, arg_5=True):
        """Return a copy of the DataFrame, if selection is None, it does not copy the data, it just has a reference

        :param column_names: list of column names, to copy, when None DataFrame.get_column_names(strings=strings, virtual=virtual) is used
        :param selection: {selection}
        :param strings: argument passed to DataFrame.get_column_names when column_names is None
        :param virtual: argument passed to DataFrame.get_column_names when column_names is None
        :param selections: copy selections to a new DataFrame
        :return: dict
        """
        if arg_1:
            arg_1 = _ensure_strings_from_expressions(arg_1)
        arg_6 = vaex.from_items(*arg_0.to_items(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=False))
        if arg_4:
            for arg_7, arg_8 in arg_0.virtual_columns.items():
                arg_6.add_virtual_column(arg_7, arg_8)
        if arg_5:
            # the filter selection does not need copying
            for arg_9, arg_8 in arg_0.selection_histories.items():
                if arg_9 != FILTER_SELECTION_NAME:
                    arg_6.selection_histories[arg_9] = list(arg_8)
            for arg_9, arg_8 in arg_0.selection_history_indices.items():
                if arg_9 != FILTER_SELECTION_NAME:
                    arg_6.selection_history_indices[arg_9] = arg_8
        arg_6.functions.update(arg_0.functions)
        arg_6.copy_metadata(arg_0)
        return arg_6


def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False, arg_5=None):
        """Return a pandas DataFrame containing the ndarray corresponding to the evaluated data

         If index is given, that column is used for the index of the dataframe.

         Example

         >>> df_pandas = df.Func(["x", "y", "z"])
         >>> df_copy = vaex.from_pandas(df_pandas)

        :param column_names: list of column names, to export, when None DataFrame.get_column_names(strings=strings, virtual=virtual) is used
        :param selection: {selection}
        :param strings: argument passed to DataFrame.get_column_names when column_names is None
        :param virtual: argument passed to DataFrame.get_column_names when column_names is None
        :param index_column: if this column is given it is used for the index of the DataFrame
        :return: pandas.DataFrame object
        """
        import pandas as pd
        arg_6 = arg_0.to_dict(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4)
        if arg_5 is not None:
            if arg_5 in arg_6:
                arg_7 = arg_6.pop(arg_5)
            else:
                arg_7 = arg_0.evaluate(arg_5, arg_2=arg_2)
        else:
            arg_7 = None
        arg_8 = pd.DataFrame(arg_6=arg_6, arg_7=arg_7)
        if arg_7 is not None:
            arg_8.index.name = arg_5
        return arg_8


def Func(arg_0, arg_1=None, arg_2=None, arg_3=True, arg_4=False, arg_5=None):
        """Returns a astropy table object containing the ndarrays corresponding to the evaluated data

        :param column_names: list of column names, to export, when None DataFrame.get_column_names(strings=strings, virtual=virtual) is used
        :param selection: {selection}
        :param strings: argument passed to DataFrame.get_column_names when column_names is None
        :param virtual: argument passed to DataFrame.get_column_names when column_names is None
        :param index: if this column is given it is used for the index of the DataFrame
        :return: astropy.table.Table object
        """
        from astropy.table import Table, Column, MaskedColumn
        arg_6 = dict()
        arg_6["name"] = arg_0.name
        arg_6["description"] = arg_0.description

        arg_7 = Table(arg_6=arg_6)
        for arg_8, arg_9 in arg_0.to_items(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3, arg_4=arg_4):
            if arg_0.dtype(arg_8) == str_type:  # for astropy we convert it to unicode, it seems to ignore object type
                arg_9 = np.array(arg_9).astype('U')
            arg_6 = dict()
            if arg_8 in arg_0.ucds:
                arg_6["ucd"] = arg_0.ucds[arg_8]
            if np.ma.isMaskedArray(arg_9):
                arg_10 = MaskedColumn
            else:
                arg_10 = Column
            arg_7[arg_8] = arg_10(arg_9, unit=arg_0.unit(arg_8), description=arg_0.descriptions.get(arg_8), arg_6=arg_6)
        return arg_7


def Func(arg_0, arg_1, arg_2):
        """Add an in memory array as a column."""
        if isinstance(arg_2, (np.ndarray, Column)):
            arg_3 = ar = arg_2
            # it can be None when we have an 'empty' DataFrameArrays
            if arg_0._length_original is None:
                arg_0._length_unfiltered = _len(arg_3)
                arg_0._length_original = _len(arg_3)
                arg_0._index_end = arg_0._length_unfiltered
            if _len(ar) != arg_0.length_original():
                if arg_0.filtered:
                    # give a better warning to avoid confusion
                    if len(arg_0) == len(ar):
                        raise ValueError("Array is of length %s, while the length of the DataFrame is %s due to the filtering, the (unfiltered) length is %s." % (len(ar), len(arg_0), arg_0.length_unfiltered()))
                raise ValueError("array is of length %s, while the length of the DataFrame is %s" % (len(ar), arg_0.length_original()))
            # assert self.length_unfiltered() == len(data), "columns should be of equal length, length should be %d, while it is %d" % ( self.length_unfiltered(), len(data))
            arg_0.columns[arg_1] = arg_2
            if arg_1 not in arg_0.column_names:
                arg_0.column_names.append(arg_1)
        else:
            raise ValueError("functions not yet implemented")
        arg_0._save_assign_expression(arg_1, Expression(arg_0, arg_1))


def Func(arg_0, arg_1, arg_2, arg_3=False, arg_4=True):
        """Renames a column, not this is only the in memory name, this will not be reflected on disk"""
        arg_2 = vaex.utils.find_valid_name(arg_2, used=[] if not arg_3 else list(arg_0))
        arg_5 = arg_0.columns.get(arg_1)
        if arg_5 is not None:
            del arg_0.columns[arg_1]
            arg_0.column_names[arg_0.column_names.index(arg_1)] = arg_2
            arg_0.columns[arg_2] = arg_5
        else:
            arg_9 = arg_0.virtual_columns[arg_1]
            del arg_0.virtual_columns[arg_1]
            arg_0.virtual_columns[arg_2] = arg_9
        if arg_4:
            arg_0._renamed_columns.append((arg_1, arg_2))
        for arg_11 in [arg_0.ucds, arg_0.units, arg_0.descriptions]:
            if arg_1 in arg_11:
                arg_11[arg_2] = arg_11[arg_1]
                del arg_11[arg_1]
        return arg_2


def Func(arg_0, arg_1="x", arg_2="y", arg_3="r_polar", arg_4="phi_polar",
                                               arg_5=False,
                                               arg_6=False):
        """Convert cartesian to polar coordinates

        :param x: expression for x
        :param y: expression for y
        :param radius_out: name for the virtual column for the radius
        :param azimuth_out: name for the virtual column for the azimuth angle
        :param propagate_uncertainties: {propagate_uncertainties}
        :param radians: if True, azimuth is in radians, defaults to degrees
        :return:
        """
        arg_1 = arg_0[arg_1]
        arg_2 = arg_0[arg_2]
        if arg_6:
            arg_7 = ""
        else:
            arg_7 = "*180/pi"
        arg_8 = np.sqrt(arg_1**2 + arg_2**2)
        arg_0[arg_3] = arg_8
        arg_9 = np.arctan2(arg_2, arg_1)
        if not arg_6:
            arg_9 = arg_9 * 180/np.pi
        arg_0[arg_4] = arg_9
        if arg_5:
            arg_0.propagate_uncertainties([arg_0[arg_3], arg_0[arg_4]])


def Func(arg_0, arg_1="x", arg_2="y", arg_3="vx", arg_4=None, arg_5="vy", arg_6="vr_polar", arg_7="vphi_polar",
                                                          arg_8=False,):
        """Convert cartesian to polar velocities.

        :param x:
        :param y:
        :param vx:
        :param radius_polar: Optional expression for the radius, may lead to a better performance when given.
        :param vy:
        :param vr_out:
        :param vazimuth_out:
        :param propagate_uncertainties: {propagate_uncertainties}
        :return:
        """
        arg_1 = arg_0._expr(arg_1)
        arg_2 = arg_0._expr(arg_2)
        arg_3 = arg_0._expr(arg_3)
        arg_5 = arg_0._expr(arg_5)
        if arg_4 is None:
            arg_4 = np.sqrt(arg_1**2 + arg_2**2)
        arg_4 = arg_0._expr(arg_4)
        arg_0[arg_6]       = (arg_1*arg_3 + arg_2*arg_5) / arg_4
        arg_0[arg_7] = (arg_1*arg_5 - arg_2*arg_3) / arg_4
        if arg_8:
            arg_0.propagate_uncertainties([arg_0[arg_6], arg_0[arg_7]])


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=False):
        """Rotation in 2d.

        :param str x: Name/expression of x column
        :param str y: idem for y
        :param str xnew: name of transformed x column
        :param str ynew:
        :param float angle_degrees: rotation in degrees, anti clockwise
        :return:
        """
        arg_1 = _ensure_string_from_expression(arg_1)
        arg_2 = _ensure_string_from_expression(arg_2)
        arg_7 = np.radians(arg_5)
        arg_8 = np.array([[np.cos(arg_7), -np.sin(arg_7)], [np.sin(arg_7), np.cos(arg_7)]])
        arg_9 = matrix_name = arg_1 + "_" + arg_2 + "_rot"
        for arg_10 in range(2):
            for arg_11 in range(2):
                arg_0.set_variable(matrix_name + "_%d%d" % (arg_10, arg_11), arg_8[arg_10, arg_11].item())
        arg_0[arg_3] = arg_0._expr("{m}_00 * {x} + {m}_01 * {y}".format(**locals()))
        arg_0[arg_4] = arg_0._expr("{m}_10 * {x} + {m}_11 * {y}".format(**locals()))
        if arg_6:
            arg_0.propagate_uncertainties([arg_0[arg_3], arg_0[arg_4]])


def Func(arg_0, arg_1, arg_2, arg_3, arg_4="x", arg_5="y", arg_6="z",
                                                   arg_7=False,
                                                   arg_8=[0, 0, 0], arg_9="solar_position", arg_10=False):
        """Convert spherical to cartesian coordinates.

        :param alpha:
        :param delta: polar angle, ranging from the -90 (south pole) to 90 (north pole)
        :param distance: radial distance, determines the units of x, y and z
        :param xname:
        :param yname:
        :param zname:
        :param propagate_uncertainties: {propagate_uncertainties}
        :param center:
        :param center_name:
        :param radians:
        :return:
        """
        arg_1 = arg_0._expr(arg_1)
        arg_2 = arg_0._expr(arg_2)
        arg_3 = arg_0._expr(arg_3)
        if not arg_10:
            arg_1 = arg_1 * arg_0._expr('pi')/180
            arg_2 = arg_2 * arg_0._expr('pi')/180

        # TODO: use sth like .optimize by default to get rid of the +0 ?
        if arg_8[0]:
            arg_0[arg_4] = np.cos(arg_1) * np.cos(arg_2) * arg_3 + arg_8[0]
        else:
            arg_0[arg_4] = np.cos(arg_1) * np.cos(arg_2) * arg_3
        if arg_8[1]:
            arg_0[arg_5] = np.sin(arg_1) * np.cos(arg_2) * arg_3 + arg_8[1]
        else:
            arg_0[arg_5] = np.sin(arg_1) * np.cos(arg_2) * arg_3
        if arg_8[2]:
            arg_0[arg_6] =                 np.sin(arg_2) * arg_3 + arg_8[2]
        else:
            arg_0[arg_6] =                 np.sin(arg_2) * arg_3
        if arg_7:
            arg_0.propagate_uncertainties([arg_0[arg_4], arg_0[arg_5], arg_0[arg_6]])


def Func(arg_0, arg_1="x", arg_2="y", arg_3="z", arg_4="l", arg_5="b", arg_6="distance", arg_7=False, arg_8=None, arg_9="solar_position"):
        """Convert cartesian to spherical coordinates.

        :param x:
        :param y:
        :param z:
        :param alpha:
        :param delta: name for polar angle, ranges from -90 to 90 (or -pi to pi when radians is True).
        :param distance:
        :param radians:
        :param center:
        :param center_name:
        :return:
        """
        arg_10 = "" if arg_7 else "*180./pi"

        if arg_8 is not None:
            arg_0.add_variable(arg_9, arg_8)
        if arg_8 is not None and arg_8[0] != 0:
            arg_1 = "({x} - {center_name}[0])".format(**locals())
        if arg_8 is not None and arg_8[1] != 0:
            arg_2 = "({y} - {center_name}[1])".format(**locals())
        if arg_8 is not None and arg_8[2] != 0:
            arg_3 = "({z} - {center_name}[2])".format(**locals())
        arg_0.add_virtual_column(arg_6, "sqrt({x}**2 + {y}**2 + {z}**2)".format(**locals()))
        # self.add_virtual_column(alpha, "((arctan2({y}, {x}) + 2*pi) % (2*pi)){transform}".format(**locals()))
        arg_0.add_virtual_column(arg_4, "arctan2({y}, {x}){transform}".format(**locals()))
        arg_0.add_virtual_column(arg_5, "(-arccos({z}/{distance})+pi/2){transform}".format(**locals()))


def Func(arg_0, arg_1, arg_2, arg_3=False):
        """Add a virtual column to the DataFrame.

        Example:

        >>> df.Func("r", "sqrt(x**2 + y**2 + z**2)")
        >>> df.select("r < 10")

        :param: str name: name of virtual column
        :param: expression: expression for the column
        :param str unique: if name is already used, make it unique by adding a postfix, e.g. _1, or _2
        """
        arg_4 = "change" if arg_1 in arg_0.virtual_columns else "add"
        arg_2 = _ensure_string_from_expression(arg_2)
        if arg_1 in arg_0.get_column_names(virtual=False):
            arg_5 = '__' +vaex.utils.find_valid_name(arg_1, used=arg_0.get_column_names())
            arg_2 = arg_0._rename(arg_1, arg_5, arg_2)[0].expression

        arg_1 = vaex.utils.find_valid_name(arg_1, used=[] if not arg_3 else arg_0.get_column_names())
        arg_0.virtual_columns[arg_1] = arg_2
        arg_0.column_names.append(arg_1)
        arg_0._save_assign_expression(arg_1)
        arg_0.signal_column_changed.emit(arg_0, arg_1, "add")


def Func(arg_0, arg_1):
        """Deletes a virtual column from a DataFrame."""
        del arg_0.virtual_columns[arg_1]
        arg_0.signal_column_changed.emit(arg_0, arg_1, "delete")


def Func(arg_0, arg_1, arg_2, arg_3=True, arg_4=True):
        """Add a variable to to a DataFrame.

        A variable may refer to other variables, and virtual columns and expression may refer to variables.

        Example

        >>> df.Func('center', 0)
        >>> df.add_virtual_column('x_prime', 'x-center')
        >>> df.select('x_prime < 0')

        :param: str name: name of virtual varible
        :param: expression: expression for the variable
        """
        if arg_4 or arg_3 or arg_1 not in arg_0.variables:
            arg_5 = arg_0.get_column_names(virtual=False) + list(arg_0.variables.keys())
            arg_1 = vaex.utils.find_valid_name(arg_1, used=[] if not arg_4 else arg_5)
            arg_0.variables[arg_1] = arg_2
            arg_0.signal_variable_changed.emit(arg_0, arg_1, "add")
            if arg_4:
                return arg_1


def Func(arg_0, arg_1=5):
        """Display the first and last n elements of a DataFrame."""
        from IPython import display
        display.display(display.HTML(arg_0._head_and_tail_table(arg_1)))


def Func(arg_0, arg_1=True, arg_2=True, arg_3=None):
        """Give a description of the DataFrame.

        >>> import vaex
        >>> df = vaex.example()[['x', 'y', 'z']]
        >>> df.Func()
                         x          y          z
        dtype      float64    float64    float64
        count       330000     330000     330000
        missing          0          0          0
        mean    -0.0671315 -0.0535899  0.0169582
        std        7.31746    7.78605    5.05521
        min       -128.294   -71.5524   -44.3342
        max        271.366    146.466    50.7185
        >>> df.Func(selection=df.x > 0)
                           x         y          z
        dtype        float64   float64    float64
        count         164060    164060     164060
        missing       165940    165940     165940
        mean         5.13572 -0.486786 -0.0868073
        std          5.18701   7.61621    5.02831
        min      1.51635e-05  -71.5524   -44.3342
        max          271.366   78.0724    40.2191

        :param bool strings: Describe string columns or not
        :param bool virtual: Describe virtual columns or not
        :param selection: Optional selection to use.
        :return: Pandas dataframe

        """
        import pandas as pd
        arg_4 = len(arg_0)
        arg_5 = {}
        for arg_6 in arg_0.get_column_names(arg_1=arg_1, arg_2=arg_2)[:]:
            arg_7 = str(arg_0.dtype(arg_6)) if arg_0.dtype(arg_6) != str else 'str'
            if arg_0.dtype(arg_6) == str_type or arg_0.dtype(arg_6).kind in ['S', 'U', 'O']:
                arg_8 = arg_0.count(arg_6, arg_3=arg_3, delay=True)
                arg_0.execute()
                arg_8 = arg_8.get()
                arg_5[arg_6] = ((arg_7, arg_8, arg_4-arg_8, '--', '--', '--', '--'))
            else:
                arg_8 = arg_0.count(arg_6, arg_3=arg_3, delay=True)
                arg_9 = arg_0.mean(arg_6, arg_3=arg_3, delay=True)
                arg_10 = arg_0.std(arg_6, arg_3=arg_3, delay=True)
                arg_11 = arg_0.minmax(arg_6, arg_3=arg_3, delay=True)
                arg_0.execute()
                arg_8, arg_9, arg_10, arg_11 = arg_8.get(), arg_9.get(), arg_10.get(), arg_11.get()
                arg_8 = int(arg_8)
                arg_5[arg_6] = ((arg_7, arg_8, arg_4-arg_8, arg_9, arg_10, arg_11[0], arg_11[1]))
        return pd.DataFrame(data=arg_5, index=['dtype', 'count', 'missing', 'mean', 'std', 'min', 'max'])


def Func(arg_0, arg_1):
        """Set the current row, and emit the signal signal_pick."""
        if (arg_1 is not None) and ((arg_1 < 0) or (arg_1 >= len(arg_0))):
            raise IndexError("index %d out of range [0,%d]" % (arg_1, len(arg_0)))
        arg_0._current_row = arg_1
        arg_0.signal_pick.emit(arg_0, arg_1)


def Func(arg_0, arg_1=False):
        '''Return a DataFrame, where all columns are 'Funcmed' by the active range.

        For the returned DataFrame, df.get_active_range() returns (0, df.length_original()).

        {note_copy}

        :param inplace: {inplace}
        :rtype: DataFrame
        '''
        arg_2 = arg_0 if arg_1 else arg_0.copy()
        for arg_3 in arg_2:
            arg_4 = arg_2.columns.get(arg_3)
            if arg_4 is not None:
                if arg_0._index_start == 0 and len(arg_4) == arg_0._index_end:
                    pass  # we already assigned it in .copy
                else:
                    if isinstance(arg_4, np.ndarray):  # real array
                        arg_2.columns[arg_3] = arg_4[arg_0._index_start:arg_0._index_end]
                    else:
                        arg_2.columns[arg_3] = arg_4.Func(arg_0._index_start, arg_0._index_end)
        arg_2._length_original = arg_0.length_unfiltered()
        arg_2._length_unfiltered = arg_2._length_original
        arg_2._index_start = 0
        arg_2._index_end = arg_2._length_original
        arg_2._active_fraction = 1
        return arg_2


def Func(arg_0, arg_1):
        '''Returns a DataFrame containing only rows indexed by indices

        {note_copy}

        Example:

        >>> import vaex, numpy as np
        >>> df = vaex.from_arrays(s=np.array(['a', 'b', 'c', 'd']), x=np.arange(1,5))
        >>> df.Func([0,2])
         #  s      x
         0  a      1
         1  c      3

        :param indices: sequence (list or numpy array) with row numbers
        :return: DataFrame which is a shallow copy of the original data.
        :rtype: DataFrame
        '''
        arg_2 = arg_0.copy()
        # if the columns in ds already have a ColumnIndex
        # we could do, direct_indices = df.column['bla'].indices[indices]
        # which should be shared among multiple ColumnIndex'es, so we store
        # them in this dict
        arg_3 = {}
        arg_1 = np.array(arg_1)
        for arg_4 in arg_2:
            arg_5 = arg_2.columns.get(arg_4)
            if arg_5 is not None:
                # we optimize this somewhere, so we don't do multiple
                # levels of indirection
                if isinstance(arg_5, ColumnIndexed):
                    # TODO: think about what happpens when the indices are masked.. ?
                    if arg_7(arg_5.indices) not in arg_3:
                        arg_6 = arg_5.indices[arg_1]
                        arg_3[arg_7(arg_5.indices)] = arg_6
                    else:
                        arg_6 = arg_3[arg_7(arg_5.indices)]
                    arg_2.columns[arg_4] = ColumnIndexed(arg_5.df, arg_6, arg_5.name)
                else:
                    arg_2.columns[arg_4] = ColumnIndexed(arg_0, arg_1, arg_4)
        arg_2._length_original = len(arg_1)
        arg_2._length_unfiltered = arg_2._length_original
        arg_2.set_selection(None, arg_4=FILTER_SELECTION_NAME)
        return arg_2


def Func(arg_0):
        '''Return a DataFrame containing only the filtered rows.

        {note_copy}

        The resulting DataFrame may be more efficient to work with when the original DataFrame is
        heavily filtered (contains just a small number of rows).

        If no filtering is applied, it returns a trimmed view.
        For the returned df, len(df) == df.length_original() == df.length_unfiltered()

        :rtype: DataFrame
        '''
        arg_1 = arg_0.trim()
        if arg_1.filtered:
            arg_2 = arg_1._filtered_range_to_unfiltered_indices(0, len(arg_1))
            return arg_1.take(arg_2)
        else:
            return arg_1


def Func(arg_0, arg_1, arg_2=None):
        '''Returns a list containing random portions of the DataFrame.

        {note_copy}

        Example:

        >>> import vaex, import numpy as np
        >>> np.random.seed(111)
        >>> df = vaex.from_arrays(x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> for dfs in df.Func(frac=0.3, random_state=42):
        ...     print(dfs.x.values)
        ...
        [8 1 5]
        [0 7 2 9 4 3 6]
        >>> for split in df.Func(frac=[0.2, 0.3, 0.5], random_state=42):
        ...     print(dfs.x.values)
        [8 1]
        [5 0 7]
        [2 9 4 3 6]

        :param int/list frac: If int will split the DataFrame in two portions, the first of which will have size as specified by this parameter. If list, the generator will generate as many portions as elements in the list, where each element defines the relative fraction of that portion.
        :param int random_state: (default, None) Random number seed for reproducibility.
        :return: A list of DataFrames.
        :rtype: list
        '''
        arg_0 = arg_0.extract()
        if type(arg_2) == int or arg_2 is None:
            arg_2 = np.random.RandomState(seed=arg_2)
        arg_3 = arg_2.choice(len(arg_0), len(arg_0), replace=False)
        return arg_0.take(arg_3).split(arg_1)


def Func(arg_0, arg_1):
        '''Returns a list containing ordered subsets of the DataFrame.

        {note_copy}

        Example:

        >>> import vaex
        >>> df = vaex.from_arrays(x = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9])
        >>> for dfs in df.Func(frac=0.3):
        ...     print(dfs.x.values)
        ...
        [0 1 3]
        [3 4 5 6 7 8 9]
        >>> for Func in df.Func(frac=[0.2, 0.3, 0.5]):
        ...     print(dfs.x.values)
        [0 1]
        [2 3 4]
        [5 6 7 8 9]

        :param int/list frac: If int will Func the DataFrame in two portions, the first of which will have size as specified by this parameter. If list, the generator will generate as many portions as elements in the list, where each element defines the relative fraction of that portion.
        :return: A list of DataFrames.
        :rtype: list
        '''
        arg_0 = arg_0.extract()
        if _issequence(arg_1):
            # make sure it is normalized
            arg_2 = sum(arg_1)
            arg_1 = [k / arg_2 for k in arg_1]
        else:
            assert arg_1 <= 1, "fraction should be <= 1"
            arg_1 = [arg_1, 1 - arg_1]
        arg_3 = np.round(np.cumsum(arg_1) * len(arg_0)).astype(np.int64)
        arg_4 = 0
        for arg_5 in arg_3:
            yield arg_0[arg_4:arg_5]
            arg_4 = arg_5


def Func(arg_0, arg_1="default", arg_2=None):
        """Undo selection, for the name."""
        logger.debug("undo")
        arg_2 = arg_2 or arg_0.executor
        assert arg_0.selection_can_undo(arg_1=arg_1)
        arg_3 = arg_0.selection_histories[arg_1]
        arg_4 = arg_0.selection_history_indices[arg_1]
        arg_0.selection_history_indices[arg_1] -= 1
        arg_0.signal_selection_changed.emit(arg_0)
        logger.debug("undo: selection history is %r, index is %r", arg_3, arg_0.selection_history_indices[arg_1])


def Func(arg_0, arg_1="default"):
        """Can selection name be redone?"""
        return (arg_0.selection_history_indices[arg_1] + 1) < len(arg_0.selection_histories[arg_1])


def Func(arg_0, arg_1, arg_2="replace", arg_3="default", arg_4=None):
        """Perform a Funcion, defined by the boolean expression, and combined with the previous Funcion using the given mode.

        Selections are recorded in a history tree, per name, undo/redo can be done for them separately.

        :param str boolean_expression: Any valid column expression, with comparison operators
        :param str mode: Possible boolean operator: replace/and/or/xor/subtract
        :param str name: history tree or Funcion 'slot' to use
        :param executor:
        :return:
        """
        arg_1 = _ensure_string_from_expression(arg_1)
        if arg_1 is None and not arg_0.has_Funcion(arg_3=arg_3):
            pass  # we don't want to pollute the history with many None Funcions
            arg_0.signal_Funcion_changed.emit(arg_0)  # TODO: unittest want to know, does this make sense?
        else:
            def create(arg_5):
                return Funcions.SelectionExpression(arg_1, arg_5, arg_2) if arg_1 else None
            arg_0._Funcion(create, arg_3)


def Func(arg_0, arg_1=True, arg_2=True, arg_3=None, arg_4="replace", arg_5="default"):
        """Create a selection that selects rows having non missing values for all columns in column_names.

        The name reflect Panda's, no rows are really dropped, but a mask is kept to keep track of the selection

        :param drop_nan: drop rows when there is a NaN in any of the columns (will only affect float values)
        :param drop_masked: drop rows when there is a masked value in any of the columns
        :param column_names: The columns to consider, default: all (real, non-virtual) columns
        :param str mode: Possible boolean operator: replace/and/or/xor/subtract
        :param str name: history tree or selection 'slot' to use
        :return:
        """
        arg_3 = arg_3 or arg_0.get_column_names(virtual=False)

        def create(arg_6):
            return selections.SelectionDropNa(arg_1, arg_2, arg_3, arg_6, arg_4)
        arg_0._selection(create, arg_5)


def Func(arg_0, arg_1=True, arg_2=True, arg_3=None):
        """Create a shallow copy of a DataFrame, with filtering set using select_non_missing.

        :param drop_nan: drop rows when there is a NaN in any of the columns (will only affect float values)
        :param drop_masked: drop rows when there is a masked value in any of the columns
        :param column_names: The columns to consider, default: all (real, non-virtual) columns
        :rtype: DataFrame
        """
        arg_4 = arg_0.copy()
        arg_4.select_non_missing(arg_1=arg_1, arg_2=arg_2, arg_3=arg_3,
                                name=FILTER_SELECTION_NAME, mode='and')
        return arg_4


def Func(arg_0, arg_1, arg_2, arg_3, arg_4="replace", arg_5="default"):
        """Select a 2d rectangular box in the space given by x and y, bounds by limits.

        Example:

        >>> df.select_box('x', 'y', [(0, 10), (0, 1)])

        :param x: expression for the x space
        :param y: expression fo the y space
        :param limits: sequence of shape [(x1, x2), (y1, y2)]
        :param mode:
        """
        arg_0.select_box([arg_1, arg_2], arg_3, arg_4=arg_4, arg_5=arg_5)


def Func(arg_0, arg_1, arg_2, arg_3="replace", arg_4="default"):
        """Select a n-dimensional rectangular box bounded by limits.

        The following examples are equivalent:

        >>> df.Func(['x', 'y'], [(0, 10), (0, 1)])
        >>> df.select_rectangle('x', 'y', [(0, 10), (0, 1)])

        :param spaces: list of expressions
        :param limits: sequence of shape [(x1, x2), (y1, y2)]
        :param mode:
        :param name:
        :return:
        """
        arg_5 = [(min(l), max(l)) for l in arg_2]
        arg_6 = ["((%s) >= %f) & ((%s) <= %f)" % (expression, lmin, expression, lmax) for
                       (expression, (lmin, lmax)) in zip(arg_1, arg_5)]
        arg_0.select("&".join(arg_6), arg_3=arg_3, arg_4=arg_4)


def Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6, arg_7=0, arg_8="replace", arg_9="default", arg_10=False, arg_11=True):
        """
        Select an elliptical region centred on xc, yc, with a certain width, height
        and angle.

        Example:

        >>> df.Func('x','y', 2, -1, 5,1, 30, name='my_ellipse')

        :param x: expression for the x space
        :param y: expression for the y space
        :param xc: location of the centre of the ellipse in x
        :param yc: location of the centre of the ellipse in y
        :param width: the width of the ellipse (diameter)
        :param height: the width of the ellipse (diameter)
        :param angle: (degrees) orientation of the ellipse, counter-clockwise
                      measured from the y axis
        :param name: name of the selection
        :param mode:
        :return:

        """

        # Computing the properties of the ellipse prior to selection
        if arg_10:
            pass
        else:
            arg_12 = np.deg2rad(arg_7)
        arg_13 = arg_5 / 2
        arg_14 = arg_6 / 2
        arg_15 = max(arg_13, arg_14)
        arg_16 = arg_13 / arg_15
        arg_17 = arg_14 / arg_15

        arg_18 = "(({x}-{xc})*cos({alpha})+({y}-{yc})*sin({alpha}))**2/{a}**2 + (({x}-{xc})*sin({alpha})-({y}-{yc})*cos({alpha}))**2/{b}**2 <= {r}**2".format(**locals())

        if arg_11:
            arg_18 = ((arg_0[arg_1] - arg_3) * np.cos(arg_12) + (arg_0[arg_2] - arg_4) * np.sin(arg_12))**2 / arg_16**2 + ((arg_0[arg_1] - arg_3) * np.sin(arg_12) - (arg_0[arg_2] - arg_4) * np.cos(arg_12))**2 / arg_17**2 <= arg_15**2
        else:
            arg_18 = ((arg_0[arg_1] - arg_3) * np.cos(arg_12) + (arg_0[arg_2] - arg_4) * np.sin(arg_12))**2 / arg_16**2 + ((arg_0[arg_1] - arg_3) * np.sin(arg_12) - (arg_0[arg_2] - arg_4) * np.cos(arg_12))**2 / arg_17**2 < arg_15**2

        arg_0.select(boolean_expression=arg_18, arg_8=arg_8, arg_9=arg_9)


def Func(arg_0, arg_1="default", arg_2=None):
        """Invert the selection, i.e. what is selected will not be, and vice versa

        :param str name:
        :param executor:
        :return:
        """

        def create(arg_3):
            return selections.SelectionInvert(arg_3)
        arg_0._selection(create, arg_1, arg_2=arg_2)


def Func(arg_0, arg_1, arg_2="default", arg_3=None):
        """Sets the selection object

        :param selection: Selection object
        :param name: selection 'slot'
        :param executor:
        :return:
        """
        def create(arg_4):
            return arg_1
        arg_0._selection(create, arg_2, arg_3=arg_3, execute_fully=True)


def Func(arg_0, arg_1):
        '''Finds a non-colliding name by optional postfixing'''
        return vaex.utils.find_valid_name(arg_1, used=arg_0.get_column_names(hidden=True))


def Func(arg_0, arg_1=None):
        """Return a graphviz.Digraph object with a graph of all virtual columns"""
        from graphviz import Digraph
        arg_1 = arg_1 or Digraph(comment='whole dataframe')
        arg_2 = arg_0._root_nodes()
        for arg_3 in arg_2:
            arg_0[arg_3].Func(arg_1=arg_1)
        return arg_1


def Func(arg_0, arg_1, arg_2=None, arg_3=True):
        """Mark column as categorical, with given labels, assuming zero indexing"""
        arg_1 = _ensure_string_from_expression(arg_1)
        if arg_3:
            arg_4, arg_5 = arg_0.minmax(arg_1)
            if arg_2 is None:
                arg_6 = int(arg_5 + 1)
                arg_2 = list(map(str, range(arg_6)))
            if (arg_5 - arg_4) >= len(arg_2):
                raise ValueError('value of {} found, which is larger than number of labels {}'.format(arg_5, len(arg_2)))
        arg_0._categories[arg_1] = dict(arg_2=arg_2, arg_6=len(arg_2))


def Func(arg_0):
        """Gives direct access to the Func as numpy arrays.

        Convenient when working with IPython in combination with small DataFrames, since this gives tab-completion.
        Only real columns (i.e. no virtual) columns can be accessed, for getting the Func from virtual columns, use
        DataFrame.evalulate(...).

        Columns can be accesed by there names, which are attributes. The attribues are of type numpy.ndarray.

        Example:

        >>> df = vaex.example()
        >>> r = np.sqrt(df.Func.x**2 + df.Func.y**2)

        """
        class Datas(object):
            pass

        arg_1 = Datas()
        for arg_2, arg_3 in arg_0.columns.items():
            setattr(arg_1, arg_2, arg_3)
        return arg_1


def Func(arg_0, arg_1=False):
        """Get the Func of the DataFrames, for the selection of the whole DataFrame.

        If selection is False, it returns len(df).

        TODO: Implement this in DataFrameRemote, and move the method up in :func:`DataFrame.Func`

        :param selection: When True, will return the number of selected rows
        :return:
        """
        if arg_1:
            return 0 if arg_0.mask is None else np.sum(arg_0.mask)
        else:
            return len(arg_0)


def Func(arg_0, arg_1, arg_2=None):
        """Join the columns of the other DataFrame to this one, assuming the ordering is the same"""
        assert len(arg_0) == len(arg_1), "does not make sense to horizontally stack DataFrames with different lengths"
        for arg_3 in arg_1.get_column_names():
            if arg_2:
                arg_4 = arg_2 + arg_3
            else:
                arg_4 = arg_3
            arg_0.add_column(arg_4, arg_1.columns[arg_3])


def Func(arg_0, arg_1):
        """Concatenates two DataFrames, adding the rows of one the other DataFrame to the current, returned in a new DataFrame.

        No copy of the data is made.

        :param other: The other DataFrame that is Funcenated with this DataFrame
        :return: New DataFrame with the rows Funcenated
        :rtype: DataFrameConcatenated
        """
        arg_2 = []
        if isinstance(arg_0, DataFrameConcatenated):
            arg_2.extend(arg_0.dfs)
        else:
            arg_2.extend([arg_0])
        if isinstance(arg_1, DataFrameConcatenated):
            arg_2.extend(arg_1.dfs)
        else:
            arg_2.extend([arg_1])
        return DataFrameConcatenated(arg_2)


def Func(arg_0, arg_1, arg_2=None, arg_3="=", arg_4=False, arg_5=False, arg_6=None, arg_7=False, arg_8=None, arg_9=True):
        """Exports the DataFrame to a vaex hdf5 file

        :param DataFrameLocal df: DataFrame to export
        :param str path: path for file
        :param lis[str] column_names: list of column names to export or None for all columns
        :param str byteorder: = for native, < for little endian and > for big endian
        :param bool shuffle: export rows in random order
        :param bool selection: export selection or not
        :param progress: progress callback that gets a progress fraction as argument and should return True to continue,
                or a default progress bar when progress=True
        :param: bool virtual: When True, export virtual columns
        :param str sort: expression used for sorting the output
        :param bool ascending: sort ascending (True) or descending
        :return:
        """
        import vaex.export
        vaex.export.Func(arg_0, arg_1, arg_2, arg_3, arg_4, arg_5, arg_6=arg_6, arg_7=arg_7, arg_8=arg_8, arg_9=arg_9)


def Func(arg_0, arg_1, arg_2):
        """Add a column to the DataFrame

        :param str name: name of column
        :param data: numpy array with the data
        """
        # assert _is_array_type_ok(data), "dtype not supported: %r, %r" % (data.dtype, data.dtype.type)
        # self._length = len(data)
        # if self._length_unfiltered is None:
        #     self._length_unfiltered = len(data)
        #     self._length_original = len(data)
        #     self._index_end = self._length_unfiltered
        super(DataFrameArrays, arg_0).Func(arg_1, arg_2)
        arg_0._length_unfiltered = int(round(arg_0._length_original * arg_0._active_fraction))