def _engine_affinity(obj):
from distob import engine<EOL>this_engine = engine.eid<EOL>if isinstance(obj, numbers.Number) or obj is None:<EOL><INDENT>return (this_engine, <NUM_LIT:0>)<EOL><DEDENT>elif hasattr(obj, '<STR_LIT>'):<EOL><INDENT>return obj.__engine_affinity__<EOL><DEDENT>else:<EOL><INDENT>return (this_engine, _rough_size(obj))<EOL><DEDENT>
Which engine or engines are preferred for processing this object
    Returns: (location, weight)
      location (integer or tuple): engine id (or in the case of a distributed
      array a tuple (engine_id_list, distaxis)).
      weight(integer): Proportional to the cost of moving the object to a
        different engine. Currently just taken to be the size of data.