Module Expr Str ImportFrom alias ImportFrom alias ImportFrom alias FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad Num body Expr Str Assign NameStore Dict If CompareIsNot NameLoad NameLoad body Assign SubscriptStore NameLoad Index Str Call NameLoad Call AttributeLoad NameLoad attr Assign SubscriptStore NameLoad Index Str NameLoad Return BinOpAdd Call AttributeLoad NameLoad attr NameLoad NameLoad Str decorator_list ClassDef bases NameLoad body Assign NameStore NameLoad FunctionDef arguments args NameParam defaults body Expr Call AttributeLoad Call NameLoad NameLoad NameLoad attr Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Num keyword Str keyword Str Expr Call AttributeLoad NameLoad attr Str keyword Str keyword Num keyword Str keyword Str decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Expr Yield TupleLoad NameLoad TupleLoad Str NameLoad For TupleStore NameStore NameStore BoolOpOr Call AttributeLoad NameLoad attr Str ListLoad body Expr Yield TupleLoad NameLoad TupleLoad Str BinOpMult SubscriptLoad NameLoad Index Str NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Dict Assign NameStore Num For TupleStore NameStore NameStore NameLoad body If CompareEq NameLoad Str body Assign NameStore NameLoad orelse Assert CompareEq NameLoad Str AugAssignAdd NameStore NameLoad Assign SubscriptStore NameLoad Index Str SubscriptLoad NameLoad Index Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore NameLoad Index Str BinOpAdd BinOpSub Num NameLoad BinOpMult NameLoad NameLoad Expr Yield TupleLoad NameLoad NameLoad decorator_list FunctionDef arguments args NameParam defaults body Return BinOpMult ListLoad Call NameLoad keyword AttributeLoad NameLoad attr keyword AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr decorator_list decorator_list If CompareEq NameLoad Str body Expr Call AttributeLoad NameLoad attr
N/A N/A Iterative implementation of the PageRank algorithm:

http://en.wikipedia.org/wiki/PageRank
 mrjob.job MRJob mrjob.protocol JSONProtocol mrjob.step MRStep encode_node N/A N/A node_id links score N/A None 1 N/A N/A Print out a node, in JSON format.

    :param node_id: unique ID for this node (any type is okay)
    :param links: a list of tuples of ``(node_id, weight)``; *node_id* is the
                  ID of a node to send score to, and *weight* is a number
                  between 0 and 1. Your weights should sum to 1 for each node,
                  but if they sum to less than 1, the algorithm will still
                  converge.
    :type score: float
    :param score: initial score for the node. Defaults to 1. Ideally, the
                  average weight of your nodes should be 1 (but it if isn't,
                  the algorithm will still converge).
     N/A node N/A N/A N/A links None N/A N/A N/A node N/A links N/A sorted N/A N/A links items N/A N/A node N/A score score N/A N/A N/A N/A JSONProtocol write node_id node N/A MRPageRank N/A MRJob N/A N/A INPUT_PROTOCOL JSONProtocol configure_options N/A N/A self N/A N/A N/A N/A N/A N/A super MRPageRank self configure_options N/A N/A N/A self add_passthrough_option --iterations dest iterations default 10 type int help number of iterations to run N/A N/A N/A self add_passthrough_option --damping-factor dest damping_factor default 0.85 type float help probability a web surfer will continue clicking on links N/A send_score N/A N/A self node_id node N/A N/A N/A Mapper: send score from a single node to other nodes.

        Input: ``node_id, node``

        Output:
        ``node_id, ('node', node)`` OR
        ``node_id, ('score', score)``
         N/A N/A N/A node_id N/A node node N/A N/A dest_id weight N/A N/A N/A node get links N/A N/A N/A N/A N/A dest_id N/A score N/A N/A node N/A score weight N/A receive_score N/A N/A self node_id typed_values N/A N/A N/A Reducer: Combine scores sent from other nodes, and update this node
        (creating it if necessary).

        Store information about the node's previous score in *prev_score*.
         N/A node N/A N/A total_score 0 N/A N/A value_type value typed_values N/A N/A N/A value_type node N/A N/A node value N/A N/A N/A value_type score N/A total_score value N/A N/A node N/A prev_score N/A node N/A score N/A d N/A N/A self options damping_factor N/A N/A node N/A score N/A N/A 1 d N/A d total_score N/A N/A N/A node_id node N/A steps N/A N/A self N/A N/A N/A N/A N/A N/A MRStep mapper N/A self send_score reducer N/A self receive_score N/A N/A self options iterations N/A N/A N/A N/A __name__ __main__ N/A N/A N/A N/A MRPageRank run