Step through data object and apply path transforms.

@param {object} data
@param {object} path
@param {object} result
@param {string} key
161403
function walk(data, path, result, key) {
    var fn;

    switch (type(path)) {
      case 'string':
        fn = seekSingle;
        break;

      case 'array':
        fn = seekArray;
        break;

      case 'object':
        fn = seekObject;
        break;
    }

    if (fn) {
      fn(data, path, result, key);
    }
  }
597661
function getObjectByKey(data, prop) {
    if (!prop || !~prop.indexOf('.')) return data[prop];

    var result = prop
      , structure = data;

    for (var paths = prop.split('.'), i = 0, length = paths.length; i < length; i++) {
      result = structure[+paths[i] || paths[i]];
      structure = result;
    }

    return result || data[prop];
  }
643579
function(result) {
    var target = result || this[0];
    var path = this.parentPath(target.path);
    return (path && target)? SpahQL.select(path, target.sourceData) : null;
  }
564197
function navigateSteps(data, _steps, authorization, nocache, resolve, reject){
        if(data && typeof _steps[0] === 'object'){
            var keyToLook = Object.keys(_steps[0]);
            if(data.Items) {
                data.Items.some(function (item, index) {
                    if(_steps[0] && _steps[0][keyToLook] === item[keyToLook]) { // Match the dataType
                        _steps.shift();
                        if(_steps.length === 0) {
                            resolve(item.Links[0].href); // self href
                            return true; // .some()
                        }
                        else {
                            navigate(item.Links[0].href, _steps, authorization, nocache, resolve, reject);
                            return true; // .some()
                        }
                    }
                    else {
                        if(index + 1 == data.Items.length){
                            reject(new Error('You have objects available in this resource group but the filter {' + keyToLook + ": " + _steps[0][keyToLook] + '} did not return a valid result. Please note data types matter.'));
                        }
                    }
                });
            }
            else {
                reject(new Error('{' + keyToLook + ': '+ _steps[0][keyToLook] +'} could not be found in the payload. You don\'t have any objects in this resource group.'));
            }
        }
        else if(data.Links){
            var Links = data.Links;
            Links.some(function(link, index) {
                if(_steps[0] === link.rel) {
                    _steps.shift();
                    if(_steps.length === 0) {
                        resolve(link.href);
                        return true; // .some()
                    }
                    else {
                        navigate(link.href, _steps, authorization, nocache, resolve, reject);
                        return true; // .some()
                    }
                }
                else if(index + 1 == Links.length){
                    reject(new Error('The Link you specified could not be found in the payload'));
                }
            });
        }
        else {
            reject(new Error('The link you specified could not be found in the payload. Please check host, relativeEntryPoint and steps options.'));
        }
}
658604
def prepare(data):
    """"""
    result = {}
    result["mode"] = data.get("mode")
    result["path"] = data.get("path")
    result["type"] = data.get("type")
    result["sha"] = data.get("sha")
    return result
946217
function paths (object, test) {
  var p = []
  if(test(object)) return []
  for(var key in object) {
    var value = object[key]
    if(test(value)) p.push(key)
    else if(isObject(value))
      p = p.concat(paths(value, test).map(function (path) {
        return [key].concat(path)
      }))
  }
  return p
}
884474
function _getDataValue(data, path) {
    if (data === undefined) {
        return undefined;
    }
    if (typeof path === 'number') {
        return data[path];
    }
    if (typeof path === 'string') {
        var keys = path.split(_separator);
        if (keys.length <= 1) {
            return data[keys[0]];
        }
        return _getDataValue(
            data[keys[0]],
            keys
                .slice(1)
                .join(_separator)
        );
    }
    return undefined;
}
325688
def _get_result_paths(self,data):
        
        output_dir = self.Parameters['--out-dir'].Value
        result = {}
        result['json'] = ResultPath(Path=join(output_dir,
                                splitext(split(self._input_filename)[-1])[0] + \
                                '.jplace'))
        return result
1283778
function (output) {
              // Manually convert paths to relative, because LESS
              // can make tose absolute for complex cases.
              var map = JSON.parse(output);
              var dir = path.dirname(context.pathname);
              map.sources.forEach(function (file, idx) {
                var rel = path.relative(dir, file);
                if (path.sep === '\\') { rel = rel.replace('\\', '/'); }
                map.sources[idx] = rel;
              });

              self.map = JSON.stringify(map);
            }
1257468
function map(data) {
    var result = {}
      , i = this.properties.length;

    while (i--) result[this.properties[i]] = data[i];
    return result;
  }
966118
function (data) {
      var parse = function() {
        var parsed = lazy.extend({}, lazy.parseFilepath(this.path), data);
        if (typeof parsed.ext === 'undefined') {
          parsed.ext = parsed.extname;
        }
        return parsed;
      }.bind(this);
      return this.fragmentCache('path', parse);
    }
1171330
function(row, callback) {
          var map = {}, value;
          for (var i = 0, j = row.length; i < j; i++) {
            value = row[i];
            // transform the value to either Node, Relationship or Path
            map[resColumns[i]] = utils.transform(value, self);
          }
          return callback(null, map);
        }
130255
def _get_result_paths(self, data):
        """"""
        result = {}
        result['FASTA'] = ResultPath(Path=self._get_seqs_outfile())
        result['CLSTR'] = ResultPath(Path=self._get_clstr_outfile())
        return result
18680
function (data) {
            if (!data) {
                return;
            }

            return _.union.apply(null, _.map(_.values(data), _.keys));
        }
409912
function(src, dest, transform) {
        if (typeof src !== 'string' || src.length === 0) {
            throw 'Invalid source file path (arg #1)';
        }
        if (typeof dest !== 'string' || dest.length === 0) {
            throw 'Invalid destination file path (arg #2)';
        }
        if (typeof transform !== 'function') {
            transform = function(data) {
                return data;
            };
        }

        var def = _promise.deferred();
        _fs.readFile(src, function(err, data) {
            if (err) {
                def.reject(err);
            } else {
                var data = transform(data.toString());
                _fs.writeFile(dest, data, function(err, data) {
                    if (err) {
                        def.reject(err);
                    } else {
                        def.resolve();
                    }
                });
            }
        });

        return def.promise();
    }
520020
function(data, select, currentPath) {
						var result = {};
						// traversed path to get to data:
						currentPath = currentPath || '';
						if (typeof data !== 'object') {
							return data;
						}
						if (typeof data.slice === 'function') {
							return data.map(function(el, index) {
								return fnMultiSelect(el, select, currentPath); // on same path
							});
						}
						// If Object:
						// Handle "__metadata" property
						if (data.__metadata !== undefined && currentPath.length === 0) {
							result.__metadata = data.__metadata;
						}
						// Take the relevant paths only.
						select.filter(function(path) {
							return (path + '/').indexOf(currentPath) === 0;
						}).forEach(function(path, _, innerSelect) {
							// then get the next property in given path
							var propertyKey = path.substr(currentPath.length).split('/')[0];
							// Check if we have that propertyKey on the current object
							if (data[propertyKey] !== undefined) {
								// in this case recurse again while adding this to the current path
								result[propertyKey] = fnMultiSelect(data[propertyKey], innerSelect, currentPath + propertyKey + '/');
							}
						});
						// Add specific results case handling
						if (data.results !== undefined) { // recurse with same path
							result.results = fnMultiSelect(data.results, select, currentPath);
						}
						return result;
					}
165071
function(path, data) {
        var normalized = normalizePath(null, path, data);
        if (normalized.isKeyword) {
          return 'templateData.keywords.' + path;
        } else if (isGlobalPath(path)) {
          return null;
        } else if (path === 'this' || path === '') {
          return '_parentView.context';
        } else {
          return '_parentView.context.' + path;
        }
      }