Returns (direction, star) where direction is 'forwards' or 'backwards'.
172709
def comp_pipe_info(op):
    """"""
    if op == "..>":
        return "forwards", False
    elif op == "<..":
        return "backwards", False
    elif op == "..*>":
        return "forwards", True
    elif op == "<*..":
        return "backwards", True
    else:
        raise CoconutInternalException("invalid function composition pipe operator", op)
693907
def backwards(self, backwards):
        """"""

        if self._backwards is not None:
            raise ValueError('Backwards action already specified.')

        self._backwards = backwards
        return backwards
310294
function directionStr(direction) {
    if (direction == DIRECTION_DOWN) {
        return 'down';
    } else if (direction == DIRECTION_UP) {
        return 'up';
    } else if (direction == DIRECTION_LEFT) {
        return 'left';
    } else if (direction == DIRECTION_RIGHT) {
        return 'right';
    }
    return '';
}
667695
def direction(self):
        
        if _get_bit(self._mcp.iodir, self._pin):
            return digitalio.Direction.INPUT
        return digitalio.Direction.OUTPUT
235523
def find_forward(data, offset = 0, length = data.length)
      node = nil
      lastvaluenode = nil
      i = offset
      while (i<offset+length)
        c = data[i]
        if (node == nil)
          node = self.find_horizontal(c)
        elsif (node.down != nil)
          node = node.down.find_horizontal(c)
        else
          return lastvaluenode
        end
        return lastvaluenode  if (node == nil)
        lastvaluenode = node if (node.value != nil)
        i += 1
      end
      lastvaluenode
    end
851825
def to_string(direction):
    '''

    '''
    if direction == UP:
        return UP
    elif direction == DOWN:
        return DOWN
    elif direction == LEFT:
        return LEFT
    elif direction == RIGHT:
        return RIGHT
    else:
        raise InvalidDirectionError(type_string)
55464
def direction_vector(self, other: "Point2") -> "Point2":
        
        return self.__class__((_sign(other.x - self.x), _sign(other.y - self.y)))
1040377
private static Direction getNextDirection(final Direction direction, final double p1x, final double p1y, final double p2x, final double p2y)
    {
        Direction next_direction;

        switch (direction)
        {
            case NORTH:
                if (p2y < p1y)
                {
                    next_direction = NORTH;
                }
                else if (p2x > p1x)
                {
                    next_direction = EAST;
                }
                else
                {
                    next_direction = WEST;
                }
                break;
            case SOUTH:
                if (p2y > p1y)
                {
                    next_direction = SOUTH;
                }
                else if (p2x > p1x)
                {
                    next_direction = EAST;
                }
                else
                {
                    next_direction = WEST;
                }
                break;
            case EAST:
                if (p2x > p1x)
                {
                    next_direction = EAST;
                }
                else if (p2y < p1y)
                {
                    next_direction = NORTH;
                }
                else
                {
                    next_direction = SOUTH;
                }
                break;
            case WEST:
                if (p2x < p1x)
                {
                    next_direction = WEST;
                }
                else if (p2y < p1y)
                {
                    next_direction = NORTH;
                }
                else
                {
                    next_direction = SOUTH;
                }
                break;
            default:
                throw new IllegalStateException("This should not be reached (Defensive Code)");
        }
        return next_direction;
    }
222854
def reverse(d):
    """"""
    r={}
    for k in d:
        r[d[k]]=k
    return r
981742
function( useComputed ) {
			if ( useComputed ) {
				return this.getComputedStyle( 'direction' ) ||
						this.getDirection() ||
						this.getParent() && this.getParent().getDirection( 1 ) ||
						this.getDocument().$.dir ||
						'ltr';
			}
			else {
				return this.getStyle( 'direction' ) || this.getAttribute( 'dir' );
			}
		}
38661
public Direction direction() {
        if (!Op.isFinite(slope) || Op.isEq(slope, 0.0)) {
            return Direction.Zero;
        }
        if (Op.isGt(slope, 0.0)) {
            return Direction.Positive;
        }
        return Direction.Negative;
    }
751110
def movement(self):
        
        if abs(self.lonspeed) < 0.0003:
            return const.STATIONARY
        elif self.lonspeed > 0:
            return const.DIRECT
        else:
            return const.RETROGRADE
855827
def _rotation_direction_in_detector(geometry):
    """"""
    du, dv = geometry.det_axes_init
    axis = geometry.axis
    det_normal = np.cross(dv, du)
    rot_dir = np.cross(axis, det_normal)
    c = np.array([np.vdot(rot_dir, du), np.vdot(rot_dir, dv)])
    cnorm = np.linalg.norm(c)

    # Check for numerical errors
    assert cnorm != 0

    return c / cnorm
1311485
def _tilt(c, direction:uniform_int, magnitude:uniform=0, invert=False):
    ""
    orig_pts = [[-1,-1], [-1,1], [1,-1], [1,1]]
    if direction == 0:   targ_pts = [[-1,-1], [-1,1], [1,-1-magnitude], [1,1+magnitude]]
    elif direction == 1: targ_pts = [[-1,-1-magnitude], [-1,1+magnitude], [1,-1], [1,1]]
    elif direction == 2: targ_pts = [[-1,-1], [-1-magnitude,1], [1,-1], [1+magnitude,1]]
    elif direction == 3: targ_pts = [[-1-magnitude,-1], [-1,1], [1+magnitude,-1], [1,1]]
    coeffs = _find_coeffs(targ_pts, _orig_pts) if invert else _find_coeffs(_orig_pts, targ_pts)
    return _apply_perspective(c, coeffs)
39355
function direction(value) {
    var raw = this.unwrapRaw(value);
    if (raw) {
      return raw;
    }
    return orderBys.indexOf((value || '').toLowerCase()) !== -1 ? value : 'asc';
  }
582095
function verifyRelativeDirection(direction) {
  if (!RELATIVE_DIRECTIONS.includes(direction)) {
    throw new Error(
      `Unknown direction: '${direction}'. Should be one of: '${FORWARD}', '${RIGHT}', '${BACKWARD}' or '${LEFT}'.`,
    );
  }
}
530218
def _normalize_direction(heading: int) -> int:
        
        while heading > 359:
            heading = int(heading - 359)
        while heading < 0:
            heading = int(heading + 359)
        return heading