<s> from __future__ import absolute_import <EOL> __all__ = ( '<STR_LIT>' , ) <EOL> from sentry . interfaces . base import Interface , InterfaceValidationError <EOL> from sentry . utils . safe import trim , trim_dict <EOL> class Device ( Interface ) : <EOL> """<STR_LIT>""" <EOL> @ classmethod <EOL> def to_python ( cls , data ) : <EOL> data = data . copy ( ) <EOL> extra_data = data . pop ( '<STR_LIT:data>' , data ) <EOL> if not isinstance ( extra_data , dict ) : <EOL> extra_data = { } <EOL> try : <EOL> name = trim ( data . pop ( '<STR_LIT:name>' ) , <NUM_LIT:64> ) <EOL> except KeyError : <EOL> raise InterfaceValidationError ( "<STR_LIT>" ) <EOL> try : <EOL> version = trim ( data . pop ( '<STR_LIT:version>' ) , <NUM_LIT:64> ) <EOL> except KeyError : <EOL> raise InterfaceValidationError ( "<STR_LIT>" ) <EOL> build = trim ( data . pop ( '<STR_LIT>' , None ) , <NUM_LIT:64> ) <EOL> kwargs = { <EOL> '<STR_LIT:name>' : name , <EOL> '<STR_LIT:version>' : version , <EOL> '<STR_LIT>' : build , <EOL> '<STR_LIT:data>' : trim_dict ( data ) , <EOL> } <EOL> kwargs [ '<STR_LIT:data>' ] = trim_dict ( data ) <EOL> return cls ( ** kwargs ) <EOL> def get_api_context ( self , is_public = False ) : <EOL> return { <EOL> '<STR_LIT:name>' : self . name , <EOL> '<STR_LIT:version>' : self . version , <EOL> '<STR_LIT>' : self . build , <EOL> '<STR_LIT:data>' : self . data , <EOL> } <EOL> def get_path ( self ) : <EOL> return '<STR_LIT>' <EOL> def get_hash ( self ) : <EOL> return [ ] </s>
