Checks if the given direction is a valid absolute direction.

@param {string} direction The direction.

@throws Will throw if the direction is not valid.
762038
function verifyAbsoluteDirection(direction) {
  if (!ABSOLUTE_DIRECTIONS.includes(direction)) {
    throw new Error(
      `Unknown direction: '${direction}'. Should be one of: '${NORTH}', '${EAST}', '${SOUTH}' or '${WEST}'.`,
    );
  }
}
298956
function isValidLongitude(value) {
    if (value !== null && value !== undefined) {
        if (!isNumber(value)){return false;}
        else if (value > 180 || value < -180) {
            return false;
        }
    }
    return true;
}
39355
function direction(value) {
    var raw = this.unwrapRaw(value);
    if (raw) {
      return raw;
    }
    return orderBys.indexOf((value || '').toLowerCase()) !== -1 ? value : 'asc';
  }
507082
function isDirective(node) {
			return node.type === "ExpressionStatement" &&
				node.expression.type === "Literal" &&
				typeof node.expression.value === "string";
		}
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;
            }
886054
function(direction) {
      if (!this.container.firstChild) return;
      // The line has to have up-to-date lexical information, so we
      // highlight it first.
      if (!this.highlightAtCursor()) return;
      var cursor = select.selectionTopNode(this.container, false);
      // If we couldn't determine the place of the cursor,
      // there's nothing to indent.
      if (cursor === false)
        return;
      var lineStart = startOfLine(cursor);
      var whiteSpace = this.indentLineAfter(lineStart, direction);
      if (cursor == lineStart && whiteSpace)
          cursor = whiteSpace;
      // This means the indentation has probably messed up the cursor.
      if (cursor == whiteSpace)
        select.focusAfterNode(cursor, this.container);
    }
1198992
def add_direction(self, direction, ref="T", precision=100):
        """"""
        # normalize direction
        direction = direction % 360.0
        self._ef["GPS"][piexif.GPSIFD.GPSImgDirection] = (
            int(abs(direction) * precision), precision)
        self._ef["GPS"][piexif.GPSIFD.GPSImgDirectionRef] = ref
934971
public void setTickmarkDirection(final Direction DIRECTION) {
        this.tickmarkDirection = DIRECTION;
        init(getInnerBounds().width, getInnerBounds().height);
        repaint(getInnerBounds());
    }
867201
public function getValidSortDirection($direction = self::DEFAULT_SORT_DIRECTION)
    {
        return in_array($direction, self::$sort_direction) ? $direction : self::DEFAULT_SORT_DIRECTION;
    }
667520
function(direction, length) {
        direction *= Math.PI / 180;
        var dx = length * Math.cos(direction);
        var dy = length * Math.sin(direction);
        this.insertDeltaXY(dx, dy);
    }
1212327
public function preFlightCheck($direction = null)
    {
        if (method_exists($this, MigrationInterface::CHANGE)) {
            if (method_exists($this, MigrationInterface::UP) ||
                method_exists($this, MigrationInterface::DOWN) ) {
                $this->output->writeln(sprintf(
                    '<comment>warning</comment> Migration contains both change() and/or up()/down() methods.  <options=bold>Ignoring up() and down()</>.'
                ));
            }
        }
    }
782815
def moves_in_direction(self, direction, position):
        
        current_square = self.location

        while True:
            try:
                current_square = direction(current_square)
            except IndexError:
                return

            if self.contains_opposite_color_piece(current_square, position):
                yield self.create_move(current_square, notation_const.CAPTURE)

            if not position.is_square_empty(current_square):
                return

            yield self.create_move(current_square, notation_const.MOVEMENT)
843790
def shift(self, direction):
        
        try:
            if direction == Direction.UP:
                return self.shift_up()
            elif direction == Direction.DOWN:
                return self.shift_down()
            elif direction == Direction.RIGHT:
                return self.shift_right()
            elif direction == Direction.LEFT:
                return self.shift_left()
            else:
                raise IndexError("Invalid direction {}".format(direction))
        except IndexError as e:
            raise IndexError(e)
63755
public int getFlowAt( Direction direction ) {
        switch( direction ) {
        case E:
            return eFlow;
        case W:
            return wFlow;
        case N:
            return nFlow;
        case S:
            return sFlow;
        case EN:
            return enFlow;
        case NW:
            return nwFlow;
        case WS:
            return wsFlow;
        case SE:
            return seFlow;
        default:
            throw new IllegalArgumentException();
        }
    }
9192
def direction(direction, allow_bi=False):
    
    valid = [Direction.CAUSE, Direction.EFFECT]
    if allow_bi:
        valid.append(Direction.BIDIRECTIONAL)

    if direction not in valid:
        raise ValueError('`direction` must be one of {}'.format(valid))

    return True
1082626
function(point) {
                if (!this.contains(point)) { return null; }
                var P = point.elements || point;
                var A = this.anchor.elements, D = this.direction.elements;
                return (P[0] - A[0]) * D[0] + (P[1] - A[1]) * D[1] + ((P[2] || 0) - A[2]) * D[2];
              }
248379
function(direction){
            var directionCoords = {
                up:     {x: 0, y:-1},
                right:  {x: 1, y: 0},
                down:   {x: 0, y: 1},
                left:   {x:-1, y: 0}
            };
            return directionCoords[direction];
        }