Add handles to line path
480480
function addPathHandles($canvas, parent) {
	var key, xProp, yProp;
	for (key in parent) {
		if (Object.prototype.hasOwnProperty.call(parent, key)) {
			// If property is a control point
			if (key.match(/c?x(\d+)/gi) !== null) {
				// Get the x and y coordinates for that control point
				xProp = key;
				yProp = key.replace('x', 'y');
				// Add handle at control point
				addPathHandle($canvas, parent, xProp, yProp);
			}
		}
	}
	// Add guides connecting handles
	if (parent.guide) {
		addPathGuides($canvas, parent);
	}
}
1036444
function hline(x,y,destX) {
  return {
    type:'path',
    x:x,y:y,
    path:["M",x,y,"H",destX],
    'stroke-linecap':'butt',
    'stroke-linejoin':'round',
    'stroke':'#333',
    'stroke-width':2,
    _translate:function (x,y) {
      var p=this.path;
      p[1]+=x;p[2]+=y;p[4]+=x;
    },
  };
}
1190734
function _drawLine(canvas, ctx, params, path) {
	var l,
		lx, ly;
	l = 2;
	_addStartArrow(
		canvas, ctx,
		params, path,
		path.x2 + params.x,
		path.y2 + params.y,
		path.x1 + params.x,
		path.y1 + params.y
	);
	if (path.x1 !== undefined && path.y1 !== undefined) {
		ctx.moveTo(path.x1 + params.x, path.y1 + params.y);
	}
	while (true) {
		// Calculate next coordinates
		lx = path['x' + l];
		ly = path['y' + l];
		// If coordinates are given
		if (lx !== undefined && ly !== undefined) {
			// Draw next line
			ctx.lineTo(lx + params.x, ly + params.y);
			l += 1;
		} else {
			// Otherwise, stop drawing
			break;
		}
	}
	l -= 1;
	// Optionally add arrows to path
	_addEndArrow(
		canvas, ctx,
		params,
		path,
		path['x' + (l - 1)] + params.x,
		path['y' + (l - 1)] + params.y,
		path['x' + l] + params.x,
		path['y' + l] + params.y
	);
}
420915
def add_handler(self, path, handler):
        
        self.signatures[path] = self.get_path_signature(path)
        self.handlers[path] = handler
315964
def prepend_line(filepath, line):
    
    with open(filepath) as f:
        lines = f.readlines()

    lines.insert(0, line)

    with open(filepath, 'w') as f:
        f.writelines(lines)
78288
def putSubHandler(self, prefix, handler):
        '''
        '''
        self.subHandlers[prefix] = handler
        handler._parent = self
        return self
1097310
def append_rez_path(self):
        """"""
        if system.rez_bin_path:
            self.env.PATH.append(system.rez_bin_path)
442147
function addRectHandles($canvas, parent) {
	var handlePlacement = parent.handlePlacement;
	// Store current width-to-height ratio
	if (parent.aspectRatio === null && parent.height !== 0) {
		parent.aspectRatio = parent.width / parent.height;
	}
	// Optionally add handles to corners
	if (handlePlacement === 'corners' || handlePlacement === 'both') {
		addRectHandle($canvas, parent, -1, -1);
		addRectHandle($canvas, parent, 1, -1);
		addRectHandle($canvas, parent, 1, 1);
		addRectHandle($canvas, parent, -1, 1);
	}
	// Optionally add handles to sides
	if (handlePlacement === 'sides' || handlePlacement === 'both') {
		addRectHandle($canvas, parent, 0, -1);
		addRectHandle($canvas, parent, 1, 0);
		addRectHandle($canvas, parent, 0, 1);
		addRectHandle($canvas, parent, -1, 0);
	}
	// Optionally add handle guides
	if (parent.guide) {
		addRectGuides($canvas, parent);
	}
}
1105219
def iter_item_handles(self):
        """"""

        path = self._data_abspath
        path_length = len(path) + 1

        for dirpath, dirnames, filenames in os.walk(path):
            for fn in filenames:
                path = os.path.join(dirpath, fn)
                relative_path = path[path_length:]
                if IS_WINDOWS:
                    relative_path = windows_to_unix_path(relative_path)
                yield relative_path
137983
def _path_hooks(cls, path):  # from importlib.PathFinder
        """"""
        if sys.path_hooks is not None and not sys.path_hooks:
            warnings.warn('sys.path_hooks is empty', ImportWarning)
        for hook in sys.path_hooks:
            try:
                return hook(path)
            except ImportError:
                continue
        else:
            return None
23424
public static void addInputPaths(JobConf conf, String commaSeparatedPaths) {
    for (String str : getPathStrings(commaSeparatedPaths)) {
      addInputPath(conf, new Path(str));
    }
  }
617860
def endline_handle(self, original, loc, tokens):
        """"""
        internal_assert(len(tokens) == 1, "invalid endline tokens", tokens)
        lines = tokens[0].splitlines(True)
        if self.minify:
            lines = lines[0]
        out = []
        ln = lineno(loc, original)
        for endline in lines:
            out.append(self.wrap_line_number(self.adjust(ln)) + endline)
            ln += 1
        return "".join(out)
835478
def get_lines(handle, line):
    
    for i, l in enumerate(handle):
        if i == line:
            return l
1085813
function handlePathSlashes (path) {
                var cutIndex = 0;
                for (var i = 0; i < path.length - 1; i++) {
                    if (path[i] === DIR_SEPARATOR && path[i + 1] === DIR_SEPARATOR) {
                        cutIndex = i + 1;
                    } else break;
                }

                return path.substr(cutIndex);
            }
166453
function(line, index, lines) {
        var hasPipe = /^\s*\|\>/;
        var nextLine = lines[index + 1] || '';

        if (line.match(hasPipe)|| !nextLine.match(hasPipe)) {
          return line;
        }
        // handle wrapping returned values
        else if (line.match(/^\s*return/)) { // starts with return
          return line.replace(/^return (.+)/, function($0, $1) {
              return 'return _.chain(' + $1 +')';
          });
        }
        // handle wrapping assignments eg, foo = [1, 2, 3]
        else if (line.match(/^\s*[\w$]+\s+\=\s+/)) { // starts with `foo =`
          return line.replace(/(^\s*[\w$]+\s+\=\s+)(.+)/, function($0, $1, $2) {
              return $1 + '_.chain(' + $2 +')';
          });
        }
        else if (!!line.trim()) {
          return '_.chain(' + line + ')';
        }
        else {
          return line;
        }
    }
454112
def add_handler(args):
    
    file_path = pathlib.Path(args['<source-file>']).resolve()

    try:
        offset = int(args['<offset>'])
        width = int(args['<width>'])
        context_width = int(args['<context-width>'])
    except ValueError as exc:
        print(exc, file=sys.stderr)
        return ExitCode.DATAERR

    repo = _open_repo(args, '<source-file>')

    if sys.stdin.isatty():
        text = _launch_editor('# json metadata')
    else:
        text = sys.stdin.read()

    try:
        metadata = json.loads(text)
    except json.JSONDecodeError:
        print(
            'Failed to create anchor. Invalid JSON metadata.', file=sys.stderr)
        return ExitCode.DATAERR

    # TODO: let user specify encoding
    with file_path.open(mode='rt') as handle:
        anchor = make_anchor(
            file_path, offset, width, context_width, metadata, handle=handle)

    repo.add(anchor)

    return ExitCode.OK
949384
def add_to_pythonpath(self, path):
        """"""
        pathlist = self.get_pythonpath()
        if path in pathlist:
            return False
        else:
            pathlist.insert(0, path)
            self.set_pythonpath(pathlist)
            return True