directional methods
961714
function ($ul, direction) {
      var current = this.S('.visible', $ul),
          target = current[direction]();

      // Check for skip selector.
      if (this.settings.skip_selector && target.find(this.settings.skip_selector).length != 0) {
        target = target[direction]();
      }

      if (target.length) {
        this.S('img', target)
          .trigger('click', [current, target]).trigger('click.fndtn.clearing', [current, target])
          .trigger('change.fndtn.clearing');
      }
    }
459201
function(left, right) {
                const leftIndex = entryPoints.indexOf(left.names[0]);
                const rightIndex = entryPoints.indexOf(right.names[0]);
                let direction = 0;

                if (leftIndex > rightIndex) {
                    direction = 1;
                } else if (leftIndex < rightIndex) {
                    direction = -1;
                }

                return direction;
            }
453022
function getDirection(gradient) {
    var segs;
    var angle;
    var result = {};

    if (gradient.sideCorner) {
        segs = gradient.sideCorner.split(/\s+/);

        var to = segs[0] === 'to';
        if (to) {
            // sideCorner starts with "to" so we shift it off since we don't
            // need this element anymore, and continue with generating the
            // gradient in the normal direction.
            segs.shift();
        } else {
            // sideCorner does not start with "to", so we need to reverse the
            // direction.
            var reverseDirections = {
                top: 'bottom',
                bottom: 'top',
                left: 'right',
                right: 'left'
            };
            segs[0] = reverseDirections[segs[0]];
        }

        result.direction = segs[0];
        // side corner is  `top right` or `bottom left` etc.
        if (segs.length > 1) {
            // fallback to one direction
            result.isFallback = true;
            result.message =
                'IE filter doesn\'t support side corner gradient, ' +
                'we use the first side of the side corner as fallback.';
        }
    } else {
        angle = normalizeAngle(gradient.angle.value, gradient.angle.unit);
        result = angleToDirection(angle);
    }

    return result;
}
397822
public static void moveDirection (Point p, int direction, int dx, int dy)
    {
        if (direction >= DIRECTION_COUNT) {
            throw new IllegalArgumentException("Fine coordinates not supported.");
        }

        switch (direction) {
            case NORTH: case NORTHWEST: case NORTHEAST: p.y -= dy;
        }
        switch (direction) {
            case SOUTH: case SOUTHWEST: case SOUTHEAST: p.y += dy;
        }
        switch (direction) {
            case WEST: case SOUTHWEST: case NORTHWEST: p.x -= dx;
        }
        switch (direction) {
            case EAST: case SOUTHEAST: case NORTHEAST: p.x += dx;
        }
    }
327873
public void setDirectionalLight(int i, Color color, boolean enableColor, float x, float y, float z) {
		float directionalColor[] = {
            (float)color.getRed(),
            (float)color.getGreen(),
            (float)color.getBlue(),
            (float)color.getAlpha()
        };
		float pos[] = { x, y, z, 0 };
		gl.glEnable(GL2.GL_LIGHTING);
		gl.glEnable(GL2.GL_LIGHT0 + i);
		gl.glLightfv(GL2.GL_LIGHT0 + i, GL2.GL_POSITION, pos, 0);
		if(enableColor)
		    gl.glLightfv(GL2.GL_LIGHT0 + i, GL2.GL_DIFFUSE, directionalColor, 0);
	}
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;
    }
719414
function(direction) {
    var binder = direction == L.L ? bindLeft : bindRight;

    return function(fun, count) {
      if( count === void 0 ) {
        // if no count was provided, parse the function to count arguments
        count = fun.length;
      }
      if( count === 0 ) {
        // if there are no more arguments to apply, return the value.
        return fun();
      }
      return function(arg) {
        return L.curry(binder(fun, arg), count-1);
      };
    };
  }
505584
def _group_directional(self, clusters, adj_list, counts):
        ''' '''

        observed = set()
        groups = []
        for cluster in clusters:
            if len(cluster) == 1:
                groups.append(list(cluster))
                observed.update(cluster)
            else:
                cluster = sorted(cluster, key=lambda x: counts[x],
                                 reverse=True)
                # need to remove any node which has already been observed
                temp_cluster = []
                for node in cluster:
                    if node not in observed:
                        temp_cluster.append(node)
                        observed.add(node)
                groups.append(temp_cluster)

        return groups
1296856
public void setDirection (float x, float y, float z)
    {
        if (_dx != x || _dy != y || _dz != z) {
            AL10.alSource3f(_id, AL10.AL_DIRECTION, _dx = x, _dy = y, _dz = z);
        }
    }
667695
def direction(self):
        
        if _get_bit(self._mcp.iodir, self._pin):
            return digitalio.Direction.INPUT
        return digitalio.Direction.OUTPUT
1243957
def Bidirectional(l2r, r2l):
    """"""
    nO = l2r.nO

    def birnn_fwd(Xs, drop=0.0):
        l2r_Zs, bp_l2r_Zs = l2r.begin_update(Xs, drop=drop)
        r2l_Zs, bp_r2l_Zs = r2l.begin_update(
            [l2r.ops.xp.ascontiguousarray(X[::-1]) for X in Xs]
        )

        def birnn_bwd(dZs, sgd=None):
            d_l2r_Zs = []
            d_r2l_Zs = []
            for dZ in dZs:
                l2r_fwd = dZ[:, :nO]
                r2l_fwd = dZ[:, nO:]
                d_l2r_Zs.append(l2r.ops.xp.ascontiguousarray(l2r_fwd))
                d_r2l_Zs.append(l2r.ops.xp.ascontiguousarray(r2l_fwd[::-1]))
            dXs_l2r = bp_l2r_Zs(d_l2r_Zs, sgd=sgd)
            dXs_r2l = bp_r2l_Zs(d_r2l_Zs, sgd=sgd)
            dXs = [dXf + dXb[::-1] for dXf, dXb in zip(dXs_l2r, dXs_r2l)]
            return dXs

        Zs = [l2r.ops.xp.hstack((Zf, Zb[::-1])) for Zf, Zb in zip(l2r_Zs, r2l_Zs)]
        return Zs, birnn_bwd

    return wrap(birnn_fwd, l2r, r2l)
376746
static public void direction(GrayF32 derivX , GrayF32 derivY , GrayF32 angle )
	{
		InputSanityCheck.checkSameShape(derivX,derivY);
		angle.reshape(derivX.width,derivX.height);

		if(BoofConcurrency.USE_CONCURRENT ) {
			ImplGradientToEdgeFeatures_MT.direction(derivX,derivY,angle);
		} else {
			ImplGradientToEdgeFeatures.direction(derivX,derivY,angle);
		}
	}
1306349
def direction(theta, phi):
    '''
    '''
    return np.array([np.cos(phi) * np.sin(theta), np.sin(phi) * np.sin(theta),
                     np.cos(theta)])
490077
function( roots, fn, directed ){
      directed = arguments.length === 1 && !$$.is.fn(fn) ? fn : directed;
      fn = $$.is.fn(fn) ? fn : function(){};
      var cy = this._private.cy;
      var v = $$.is.string(roots) ? this.filter(roots) : roots;
      var Q = [];
      var connectedEles = [];
      var connectedFrom = {};
      var id2depth = {};
      var V = {};
      var j = 0;
      var found;
      var nodes = this.nodes();
      var edges = this.edges();

      // enqueue v
      for( var i = 0; i < v.length; i++ ){
        if( v[i].isNode() ){
          Q.unshift( v[i] );
          V[ v[i].id() ] = true; 

          connectedEles.push( v[i] );
          id2depth[ v[i].id() ] = 0;
        }
      }

      while( Q.length !== 0 ){
        var v = Q.shift();
        var depth = id2depth[ v.id() ];
        var ret = fn.call(v, j++, depth);

        if( ret === true ){
          found = v;
          break;
        }

        if( ret === false ){
          break;
        }

        var vwEdges = v.connectedEdges(directed ? '[source = "' + v.id() + '"]' : undefined).intersect( edges );
        for( var i = 0; i < vwEdges.length; i++ ){
          var e = vwEdges[i];
          var w = e.connectedNodes('[id != "' + v.id() + '"]').intersect( nodes );

          if( w.length !== 0 && !V[ w.id() ] ){
            w = w[0];

            Q.push( w );
            V[ w.id() ] = true;

            id2depth[ w.id() ] = id2depth[ v.id() ] + 1;

            connectedEles.push( w );
            connectedEles.push( e );
          }
        }
        
      }

      return {
        path: new $$.Collection( cy, connectedEles ),
        found: new $$.Collection( cy, found )
      };
    }
81935
public static void DFT(ComplexNumber[] data, Direction direction) {
        int n = data.length;
        ComplexNumber[] c = new ComplexNumber[n];

        // for each destination element
        for (int i = 0; i < n; i++) {
            c[i] = new ComplexNumber(0, 0);
            double sumRe = 0;
            double sumIm = 0;
            double phim = 2 * Math.PI * i / n;

            // sum source elements
            for (int j = 0; j < n; j++) {
                double gRe = data[j].real;
                double gIm = data[j].imaginary;
                double cosw = Math.cos(phim * j);
                double sinw = Math.sin(phim * j);
                if (direction == Direction.Backward)
                    sinw = -sinw;

                sumRe += (gRe * cosw + data[j].imaginary * sinw);
                sumIm += (gIm * cosw - data[j].real * sinw);
            }

            c[i] = new ComplexNumber(sumRe, sumIm);
        }

        if (direction == Direction.Backward) {
            for (int i = 0; i < c.length; i++) {
                data[i].real = c[i].real / n;
                data[i].imaginary = c[i].imaginary / n;
            }
        } else {
            for (int i = 0; i < c.length; i++) {
                data[i].real = c[i].real;
                data[i].imaginary = c[i].imaginary;
            }
        }
    }
428913
function(action) {
            // if the action is a direction
            if(RL.Util.DIRECTIONS_4.indexOf(action) !== -1){
                var offsetCoord = RL.Util.getOffsetCoordsFromDirection(action),
                    moveToX = this.x + offsetCoord.x,
                    moveToY = this.y + offsetCoord.y;
                return this.move(moveToX, moveToY);
            }

            if(action === 'wait'){
                this.wait();
                return true;
            }

            return false;
        }
190311
private Direction getScrollDirection(int offset) {

        if (m_scrollElement == null) {
            Element body = RootPanel.getBodyElement();
            int windowHeight = Window.getClientHeight();
            int bodyHeight = body.getClientHeight();
            if (windowHeight < bodyHeight) {
                if (((windowHeight - m_clientY) < offset) && (Window.getScrollTop() < (bodyHeight - windowHeight))) {
                    return Direction.down;
                }
                if ((m_clientY < offset) && (Window.getScrollTop() > 0)) {
                    return Direction.up;
                }
            }

            int windowWidth = Window.getClientWidth();
            int bodyWidth = body.getClientWidth();
            if (windowWidth < bodyWidth) {
                if (((windowWidth - m_clientX) < offset) && (Window.getScrollLeft() < (bodyWidth - windowWidth))) {
                    return Direction.right;
                }
                if ((m_clientX < offset) && (Window.getScrollLeft() > 0)) {
                    return Direction.left;
                }
            }

            return null;
        } else {
            int outerHeight = m_scrollElement.getClientHeight();
            int innerHeight = m_scrollElement.getScrollHeight();
            if (outerHeight < innerHeight) {
                if ((((outerHeight + m_scrollElement.getAbsoluteTop()) - m_clientY) < offset)
                    && (m_scrollElement.getScrollTop() < (innerHeight - outerHeight))) {
                    return Direction.down;
                }
                if (((m_clientY - m_scrollElement.getAbsoluteTop()) < offset) && (m_scrollElement.getScrollTop() > 0)) {
                    return Direction.up;
                }
            }
            int outerWidth = m_scrollElement.getClientWidth();
            int innerWidth = m_scrollElement.getScrollWidth();
            if (outerWidth < innerWidth) {
                if ((((outerWidth + m_scrollElement.getAbsoluteLeft()) - m_clientX) < offset)
                    && (m_scrollElement.getScrollLeft() < (innerWidth - outerWidth))) {
                    return Direction.right;
                }
                if (((m_clientX - m_scrollElement.getAbsoluteLeft()) < offset)
                    && (m_scrollElement.getScrollLeft() > 0)) {
                    return Direction.left;
                }
            }
            return null;
        }
    }