<s> """<STR_LIT>""" <EOL> from struct import pack <EOL> from struct import unpack <EOL> from exabgp . bgp . message . update . attribute . attribute import Attribute <EOL> @ Attribute . register ( ) <EOL> class LocalPreference ( Attribute ) : <EOL> ID = Attribute . CODE . LOCAL_PREF <EOL> FLAG = Attribute . Flag . TRANSITIVE <EOL> CACHING = True <EOL> __slots__ = [ '<STR_LIT>' , '<STR_LIT>' ] <EOL> def __init__ ( self , localpref , packed = None ) : <EOL> self . localpref = localpref <EOL> self . _packed = self . _attribute ( packed if packed is not None else pack ( '<STR_LIT>' , localpref ) ) <EOL> def __eq__ ( self , other ) : <EOL> return self . ID == other . ID and self . FLAG == other . FLAG and self . localpref == other . localpref <EOL> def __ne__ ( self , other ) : <EOL> return not self . __eq__ ( other ) <EOL> def pack ( self , negotiated = None ) : <EOL> return self . _packed <EOL> def __len__ ( self ) : <EOL> return <NUM_LIT:4> <EOL> def __repr__ ( self ) : <EOL> return str ( self . localpref ) <EOL> @ classmethod <EOL> def unpack ( cls , data , negotiated ) : <EOL> return cls ( unpack ( '<STR_LIT>' , data ) [ <NUM_LIT:0> ] , data ) </s>
