function convertTradleWrapper (wrapper) { // message object const { object } = wrapper const object = object.object return { object, message: object, raw: wrapper } }
960569
function normalizeConf (conf) {
  if (process.env.PROVIDER_URL) {
    conf.providerURL = process.env.PROVIDER_URL
  }

  if (process.env.WEBHOOK_URL) {
    conf.webhookURL = process.env.WEBHOOK_URL
  }

  if (process.env.AUTOSTART) {
    conf.autostart = yn(process.env.AUTOSTART)
  }

  if (process.env.PORT) {
    conf.port = Number(process.env.PORT)
  }

  conf.providerURL = conf.providerURL.replace(/\/+$/, '')
  if (!conf.webhookURL) {
    conf.webhookURL = `http://${ip.address()}:${conf.port}`
  }

  if (conf.autostart !== false) {
    conf.autostart = true
  }

  return conf
}
442814
function wrapper(app) {
    let httpMethods = getHttpMethod();
    httpMethods = httpMethods.concat(['use', 'all', 'param']);
    httpMethods.forEach(function (method) {
        app[method] = getWrappedAction(app[method]);
    });
    return app;
}
92129
function makeFunctionWrapper(original, functionName) {
  //log("wrap fn: " + functionName);
  var f = original[functionName];
  return function() {
    //log("call: " + functionName);
    var result = f.apply(original, arguments);
    return result;
  };
}
611988
private List<OpenEngSBModel> convertSimpleModelWrapperList(List<AdvancedModelWrapper> wrappers) {
        List<OpenEngSBModel> models = new ArrayList<OpenEngSBModel>();
        for (AdvancedModelWrapper wrapper : wrappers) {
            models.add(wrapper.getUnderlyingModel());
        }
        return models;
    }
1157216
function createTranspiler ({ mappers = {}, initialScopeData } = {}) {
  const config = {
    scope: createScope(initialScopeData),
    mappers
  };

  return (config.decoratedTranspile = transpile.bind(null, config));
}
159554
def apize_raw(url, method='GET'):
	
	def decorator(func):
		def wrapper(*args, **kwargs):
			elem = func(*args, **kwargs)

			if type(elem) is not dict:
				raise BadReturnVarType(func.__name__)

			response = send_request(url, method, 
				elem.get('data', {}),
				elem.get('args', {}),
				elem.get('params', {}),
				elem.get('headers', {}),
				elem.get('cookies', {}),
				elem.get('timeout', 8),
				elem.get('is_json', False),
				elem.get('verify_cert', True)
			)

			return response
		return wrapper

	return decorator
985032
def referenceable(method):
    """"""

    def wrapper(self, value, *args):
        deref = self._prepare(value)
        if deref is not None:
            return deref
        packer, data = method(self, value, *args)
        return self._preserve(value, packer, data)

    return wrapper
849683
def ConvertFromWireFormat(self, value, container=None):
    """"""
    result = AnyValue()
    ReadIntoObject(value[2], 0, result)
    if self._type is not None:
      converted_value = self._type(container)
    else:
      converted_value = self._TypeFromAnyValue(result)

    # If one of the protobuf library wrapper classes is used, unwrap the value.
    if result.type_url.startswith("type.googleapis.com/google.protobuf."):
      wrapper_cls = self.__class__.WRAPPER_BY_TYPE[
          converted_value.data_store_type]
      wrapper_value = wrapper_cls()
      wrapper_value.ParseFromString(result.value)
      return converted_value.FromDatastoreValue(wrapper_value.value)
    else:
      # TODO(user): Type stored in type_url is currently ignored when value
      # is decoded. We should use it to deserialize the value and then check
      # that value type and dynamic type are compatible.
      return converted_value.FromSerializedString(result.value)
865025
function serializeObject(value: mixed): mixed {
  if (typeof value === 'object' && value !== null) {
    if (typeof value.valueOf === 'function') {
      const valueOfResult = value.valueOf();
      if (typeof valueOfResult !== 'object') {
        return valueOfResult;
      }
    }
    if (typeof value.toJSON === 'function') {
      // $FlowFixMe(>=0.90.0)
      return value.toJSON();
    }
  }
  return value;
}
306420
function wrapValue (val, type) {
  var basetype = type.type ? type.type : type;
  if(basetype == '@' || basetype == '#') return createObject(val, basetype);
  else if (basetype[0] == '@') return createObject(val, '@');
  else if (basetype == '@?') return createObject(createBlock(val, '@'));
  else if (basetype == '^?') return createUnwrapperFunction(val, type);
  else if (basetype == ':') return objc.sel_getName(val);
  else if (basetype == 'B') return val ? true : false;
  else if (basetype == 'c' && val === 1) return true;
  else if (basetype == 'c' && val === 0) return false;
  else return val;
}
1192987
function wrapper(my) {

  var start = process.hrtime();
  var c = 0, e = 0;
  var doit = [];
  var stream = startline({
    file: my.filename,
    encoding: 'utf8',
  });

  // options
  var open = ansi.green.open;
  var close = ansi.green.close;
  if (my.url) {
    doit
        .push([
          input.url,
          [ Object.create(null), 'url' ],
          [ output.url,
            [ open + 'ROUTE', 'METHOD', 'STATUS', 'COUNTER', close ] ] ]);
  }
  if (my.ip) {
    doit.push([ input.cc, [ Object.create(null), 'ip' ],
      [ output.ip, [ open + 'IP', 'COUNTER' + close ] ] ]);
  }
  if (my.response) {
    doit.push([ input.avg, [ {
      what: 0,
      total: 0,
      max: 0,
      min: 10000
    }, 'response' ], [ output.avg, [ open + 'RESPONSE', 'MS' + close ] ] ]);
  }
  if (my.pid) {
    doit.push([ input.cc, [ Object.create(null), 'pid' ],
      [ output.cc, [ open + 'PID' + close ] ] ]);
  }
  if (my.bytesReq) {
    doit.push([ input.avg, [ {
      what: 0,
      total: 0,
      max: 0,
      min: 10000
    }, 'bytesReq' ],
      [ output.avg, [ open + 'BYTES REQUESTED', 'BYTE' + close ] ] ]);
  }
  if (my.bytesRes) {
    doit.push([ input.avg, [ {
      what: 0,
      total: 0,
      max: 0,
      min: 10000
    }, 'bytesRes' ], [ output.avg, [ open + 'BYTES SENT', 'BYTE' + close ] ] ]);
  }
  if (my.referrer) {
    doit.push([ input.cc, [ Object.create(null), 'referrer' ],
      [ output.cc, [ open + 'REFERRER' + close ] ] ]);
  }
  if (my.auth) {
    doit.push([ input.cc, [ Object.create(null), 'auth' ],
      [ output.cc, [ open + 'USER ATHENTICATION' + close ] ] ]);
  }
  if (my.agent) {
    doit.push([ input.cc, [ Object.create(null), 'agent' ],
      [ output.cc, [ open + 'USER-AGENT' + close ] ] ]);
  }
  if (my.version) {
    doit.push([ input.cc, [ Object.create(null), 'version' ],
      [ output.cc, [ open + 'HTTP VERSION' + close ] ] ]);
  }
  if (my.level) {
    doit.push([ input.cc, [ Object.create(null), 'level' ],
      [ output.cc, [ open + 'LOG LEVEL' + close ] ] ]);
  }
  if (my.message) {
    doit.push([ input.cc, [ Object.create(null), 'message' ],
      [ output.cc, [ open + 'LOG MESSAGE' + close ] ] ]);
  }
  if (my.timestamp) {
    doit.push([ input.cc, [ Object.create(null), 'timestamp' ],
      [ output.cc, [ open + 'LOG TIMESTAMP' + close ] ] ]);
  }

  // go
  if (my.search) {
    doit = [];

    stream.on('line', function(lines) {

      var s = lines.match(my.search);
      if (s) {
        var line = lines.replace(my.search, ansi.red.open + s[0]
          + ansi.red.close + ansi.gray.open);
        // console.log(s)
        doit.push([ 'line ' + c, ansi.gray.open + line + ansi.gray.close ]);
      }
      ++c;
    });
    stream.on('close', function() {

      if (doit.length === 0) {
        console.log('Not found');
      }
      console.log(table(doit));
    });

  }

  stream.on('line', function(lines) {

    ++c;
    try {
      var line = JSON.parse(lines);
      for (var i = 0, ii = doit.length; i < ii; ++i) {
        var params = doit[i][1];
        params[0] = doit[i][0](line, params);
      }
    } catch (err) {
      ++e;
    }
  });

  stream.on('close', function() {

    var out = [];
    var csv = [];
    for (var i = 0, ii = doit.length; i < ii; ++i) {
      var buff = doit[i][2][0](doit[i][1], doit[i][2][1]);
      for (var b = 0, bb = buff.length; b < bb; ++b) {
        out.push(buff[b]);
      }
    }

    var consol = out.slice();
    if (my.report) {
      csv.push([ ansi.yellow.open + 'REPORT' + ansi.yellow.close ], [
        'line parsed', ansi.underline.open + c + ansi.underline.close ]);
      consol.push(csv[0]);
      consol.push(csv[1]);
      if (e > 0) {
        csv.push([ ansi.red.open + 'line error', e + ansi.red.close ]);
        consol.push(csv[2]);
      }
      var diff = process.hrtime(start);
      diff = ((diff[0] * 1e9 + diff[1]) / 1000000).toFixed(3) + ' ms';
      csv.push([ 'time elapsed',
        ansi.underline.open + diff + ansi.underline.close ]);
      consol.push(csv[csv.length - 1]);
    }

    // print
    if (my.csv) { // file
      var to_csv = require('./lib/csv.js');
      console.log(table(csv, {
        align: [ 'l', 'r' ],
        stringLength: function(s) {

          return s.replace(re, '').length;
        }
      }));
      to_csv(String(my.csv), out);
    } else { // console
      console.log(table(consol, {
        align: [ 'l', 'r' ],
        stringLength: function(s) {

          return s.replace(re, '').length;
        }
      }));
    }
  });

  return my;
}
287027
function methodWrapper(fn) {
  return function() {
    var args = [].slice.call(arguments);
    args.unshift(this);
    return fn.apply(this, args);
  };
}
1306411
public static Object convertToWrappedPrimitive(Object source, Class<?> wrapper) {
        if (source == null || wrapper == null) {
            return null;
        }
        if (wrapper.isInstance(source)) {
            return source;
        }
        if (wrapper.isAssignableFrom(source.getClass())) {
            return source;
        }
        if (source instanceof Number) {
            return convertNumberToWrapper((Number) source, wrapper);
        } else {
            //ensure we dont try to convert text to a number, prevent NumberFormatException
            if (Number.class.isAssignableFrom(wrapper)) {
                //test for int or fp number
                if (!source.toString().matches(NUMERIC_TYPE)) {
                    throw new ConversionException(String.format("Unable to convert string %s its not a number type: %s", source, wrapper));
                }
            }
            return convertStringToWrapper(source.toString(), wrapper);
        }
    }
578728
function convertStrItems2Obj(obj) {
	var result = {};
	for (var key in obj) {
		var val = obj[key];
		val = extractTypeAndCast(val);
		convertStrItem2Obj(key, val, result);
	}

	return result;
}
628291
function resolveFormatter(formatter) {
	if (!formatter) return resolveFormatter('stylish');
	if (typeof formatter === 'function') return formatter;
	if (typeof formatter === 'string') {
		if (isModuleAvailable(formatter)) return require(formatter);
		if (isModuleAvailable(`./formatters/${formatter}`)) return require(`./formatters/${formatter}`);
		throw wrapError(new Error(`Could not resolve formatter: ${formatter}`));
	}
}
906519
function convertOutline (jstruct) { //7/16/14 by DW
				var theNewOutline = {}, atts, subs;
				if (jstruct ["source:outline"] != undefined) {
					if (jstruct ["@"] != undefined) {
						atts = jstruct ["@"];
						subs = jstruct ["source:outline"];
						}
					else {
						atts = jstruct ["source:outline"] ["@"];
						subs = jstruct ["source:outline"] ["source:outline"];
						}
					}
				else {
					atts = jstruct ["@"];
					subs = undefined;
					}
				for (var x in atts) {
					theNewOutline [x] = atts [x];
					}
				if (subs != undefined) {
					theNewOutline.subs = [];
					if (subs instanceof Array) {
						for (var i = 0; i < subs.length; i++) {
							theNewOutline.subs [i] = convertOutline (subs [i]);
							}
						}
					else {
						theNewOutline.subs = [];
						theNewOutline.subs [0] = {};
						for (var x in subs ["@"]) {
							theNewOutline.subs [0] [x] = subs ["@"] [x];
							}
						}
					}
				return (theNewOutline);
				}
1082200
function RedisWrapper(opt, key) {
	return {
		_promise: new Promise(
			(resolve, reject) => opt.redis.hget(
				opt.namespace,
				key,
				(err, json) => {
					if (err) {
						reject(err);
						return;
					}
					try {
						const val = opt.deserialize(json);
						resolve(val);
					} catch (e) {
						reject(e);
					}
				}
			),
			[]
		),
		tree: []
	};
}