middleware：print request
552840
function (app, next) {

      if (hasDebug) {
        app.use(morgan(''
          + 'req:'.magenta + '\\n'
          + '  method : '.cyan + ':method HTTP/:http-version\\n'
          + '  path   : '.cyan + ':url', {
          immediate: true
        }));
      }

      next(null, app);
    }
706985
def print_callback(id, buffer, date, tags, displayed, highlight, prefix, message)
      buffer    = Weechat::Buffer.from_ptr(buffer)
      date      = Time.at(date.to_i)
      tags      = tags.split(",")
      displayed = Weechat.integer_to_bool(displayed)
      highlight = Weechat.integer_to_bool(highlight)
      line = PrintedLine.new(buffer, date, tags, displayed, highlight, prefix, message)
      Weechat::Hooks::Print.find_by_id(id).call(line)
    end
837738
@Override
    public void print(MoneyPrintContext context, Appendable appendable, BigMoney money) throws IOException {
        for (MoneyPrinter printer : printers) {
            printer.print(context, appendable, money);
        }
    }
1333247
public String print(TemporalFormatter<Moment> printer) {

        return printer.withTimezone(this.getTimezone()).print(this.moment);

    }
864904
function outputToStdout(prettyPrint) {
  if (prettyPrint && !_.isNumber(prettyPrint)) {
    prettyPrint = 4;
  }
  return function(err, value, callback) {
    if (err) {
      console.error(err);
    } else {
      var str = JSON.stringify(value, null, prettyPrint);
      console.log(str);
    }
    callback(err, value);
  };
}
971947
def prettyprint(d):
        
        print(json.dumps(d, sort_keys=True, 
                         indent=4, separators=("," , ": ")))
926182
function callRequestMiddleware(arg2, arg3) {
        i += 1;
        if (i < self.middlewares.length) {
            var next = self.middlewares[i].request;
            if (typeof next === 'function') {
                next(req, arg2, arg3, callRequestMiddleware);
            } else {
                // skip this middleware if it doesn't implement request
                callRequestMiddleware(arg2, arg3);
            }
        } else {
            handler(req, arg2, arg3, callResponseMiddleware);
        }
    }
65117
def watch_printer(watch, value):
    

    print("({: 8} s) {}: {}".format(value.raw_time, watch, value.value))
968211
function middlewareFunction (req,res,next){

  return ipToLocation(req.ip)
    .then(function (location) {
      req.location = location;
      next();
    })
    .catch(function (error) {
      req.locationError = error;
      next();
    })

}
319738
def display(self):
        
        if self.toLayer._verbosity > 4:
            print("wed: from '" + self.fromLayer.name + "' to '" + self.toLayer.name +"'")
            for j in range(self.toLayer.size):
                print(self.toLayer.name, "[", j, "]", end=" ")
            print('')
            for i in range(self.fromLayer.size):
                print(self.fromLayer.name, "[", i, "]", ": ", end=" ")
                for j in range(self.toLayer.size):
                    print(self.wed[i][j], end=" ")
                print('')
            print('')
            print("dweight: from '" + self.fromLayer.name + "' to '" + self.toLayer.name +"'")
            for j in range(self.toLayer.size):
                print(self.toLayer.name, "[", j, "]", end=" ")
            print('')
            for i in range(self.fromLayer.size):
                print(self.fromLayer.name, "[", i, "]", ": ", end=" ")
                for j in range(self.toLayer.size):
                    print(self.dweight[i][j], end=" ")
                print('')
            print('')
        if self.toLayer._verbosity > 2:
            print("Weights: from '" + self.fromLayer.name + "' to '" + self.toLayer.name +"'")
            print("             ", end=" ")
            for j in range(self.toLayer.size):
                print(self.toLayer.name, "[", j, "]", end=" ")
            print('')
            for i in range(self.fromLayer.size):
                print(self.fromLayer.name, "[", i, "]", ": ", end=" ")
                for j in range(self.toLayer.size):
                    print(self.weight[i][j], end=" ")
                print('')
            print('')
1255661
def printer(self):
        """"""
        i = 0
        while i < self.n + 1:
            print "--------- State No --------" + repr(i)
            self.s[i].printer()
            i = i + 1
1165718
public static function __print()
    {
        if (error_reporting() !== E_ALL) {
            return;
        }

        // Prevent output when doing AJAX/JSON requests

        if (isset($_SERVER['HTTP_X_REQUESTED_WITH'])
            && strtolower($_SERVER['HTTP_X_REQUESTED_WITH']) === 'xmlhttprequest') {
            return;

            if (isset($_SERVER['HTTP_ACCEPT']) && in_array(
                'application/json',
                explode(',', $_SERVER['HTTP_ACCEPT']),
                true
            )) {
                return;
            }
        }

        $a = func_get_args();
        call_user_func_array(array("\Libvaloa\Debug\Debug", 'append'), $a);
    }
744885
def main(items=None, printmd=None, printcal=False, found=False,
         save=None, download=None, requestor_pays=False, **kwargs):
    
    
    if items is None:
        ## if there are no items then perform a search
        search = Search.search(**kwargs)
        if found:
            num = search.found()
            print('%s items found' % num)
            return num
        items = search.items()
    else:
        # otherwise, load a search from a file
        items = Items.load(items)

    print('%s items found' % len(items))

    # print metadata
    if printmd is not None:
        print(items.summary(printmd))

    # print calendar
    if printcal:
        print(items.calendar())

    # save all metadata in JSON file
    if save is not None:
        items.save(filename=save)

    # download files given `download` keys
    if download is not None:
        if 'ALL' in download:
            # get complete set of assets
            download = set([k for i in items for k in i.assets])
        for key in download:
            items.download(key=key, path=config.DATADIR, filename=config.FILENAME, requestor_pays=requestor_pays)

    return items
1075666
def _print_details(extra=None):
    """"""
    def print_node_handler(name, node, depth):
        """Standard printer for a node."""
        line = "{0}{1} {2} ({3}:{4})".format(depth,
                                             (" " * depth),
                                             name,
                                             node.line,
                                             node.col)
        if extra is not None:
            line += " [{0}]".format(extra(node))

        sys.stdout.write(line + "\n")

    return print_node_handler
1295161
def call_api(self, url, data, files={}, print_response=True):
        
        if type(url) != str:
            return False, "Url must be string"

        if type(data) != dict:
            return False, "Data must be a dict"

        if type(files) != dict:
            return False, "Files must be a dict"

        if type(print_response) != bool:
            return False, "Print_response must be boolean"

        url = self.HOST + url
        data["format"] = "json"
        cookies = {"JSESSIONID": self.JSESSIONID}

        # Add rinputs to post data
        if self.r_inputs:
            data["inputs"] = json.dumps(self.r_inputs)

        # Add routputs to post data
        if self.r_outputs:
            data["robjects"] = ",".join(self.r_outputs)

        try:
            response = requests.post(url, data=data, files=files, cookies=cookies)
        except requests.exceptions.RequestException as exception:
            self.clear_rdata()
            return 500, {"error": str(exception)}

        status_code = response.status_code

        # Print log only if required
        if print_response:
            print status_code
            print DeployRConnection.pretty_json(response.json())

        # remove rinputs and routputs
        self.clear_rdata()

        return status_code, response.json()
886277
function(product, params, callback) {
                params = _.defaults({}, params, {
                    design: null,
                    perspective: null, // front, back, etc...
                    view: null,
                    printArea: null,
                    printType: null,
                    designColorRGBs: null,
                    designColorIds: null
                });

                var self = this,
                    bus = this.$.bus,
                    design = params.design,
                    productType = product.$.productType,
                    printArea = params.printArea,
                    view = params.view,
                    appearance = product.$.appearance,
                    printType = params.printType;

                if (!design) {
                    callback(new Error("No design"));
                    return;
                }

                if (!productType) {
                    callback(new Error("ProductType not set"));
                    return;
                }

                if (!appearance) {
                    callback(new Error("Appearance for product not set"));
                    return;
                }

                flow()
                    .par(function(cb) {
                        design.fetch(null, cb);
                    }, function(cb) {
                        productType.fetch(null, cb);
                    })
                    .seq("printArea", function() {
                        var printArea = self.getTargetPrintArea(product, params);
                        if (!printArea.get("restrictions.designAllowed")) {
                            throw new Error("designs cannot be added to this print area");
                        }

                        return printArea;
                    })
                    .seq("printTypes", function() {
                        var printTypes = self.getPrintTypesForDesign(product, design, this.vars.printArea, printType);
                        var nonDigitalPrintType = null;
                        if (params.designColorIds) {
                            nonDigitalPrintType = _.find(printTypes, function(printType) {
                                return !printType.isDigital();
                            });
                        }

                        printType = nonDigitalPrintType || printTypes[0];
                        ArrayUtil.move(printTypes, printType, 0);
                        return printTypes;
                    })
                    .seq("designConfiguration", function() {
                        return product.createEntity(DesignConfiguration).set({
                            printType: printType,
                            printArea: printArea,
                            design: design,
                            designColorIds: params.designColorIds,
                            designColorRGBs: params.designColorRGBs
                        }, PREVENT_VALIDATION_OPTIONS);
                    })
                    .seq(function(cb) {
                        var designConfiguration = this.vars["designConfiguration"];
                        bus.setUp(designConfiguration);
                        designConfiguration.init({
                            ensureDesignColorContrast: true,
                            switchImageServerGreyToWhite: true
                        }, cb);
                    })

                    .seq('validatedMove', function() {
                        return self.validateMove(this.vars.printTypes, this.vars.printArea, this.vars.designConfiguration, product);
                    })
                    .seq(function(cb) {
                        if (!this.vars.validatedMove) {
                            return cb();
                        }
                        this.vars.validatedMove.printType.fetch(null, cb);
                    })
                    .exec(function(err, results) {
                        if (!err && results.validatedMove) {
                            self._addConfiguration(product, results.designConfiguration, results.validatedMove.printType, results.printArea, {transform: results.validatedMove.transform});
                        }
                        callback && callback(err, results.designConfiguration);
                    });

            }
430018
function print(object) {
    console.log(util.inspect(object, null, null, true));
}