def __init__(self, filename=None, data=None):
        """
        Creates a new instance of BytesOrFile.

        :Parameters:
           - `filename`: A full path to a file
           - `data`: base64 encoded bytes
        """
        self._filename = None
        self._bytes = None
        if filename is not None and data is not None:
            raise TypeError("filename or data kwarg must be specified, not both")
        elif filename is not None:
            if not os.path.isfile(filename):
                raise exceptions.PyKubeError("'{}' file does not exist".format(filename))
            self._filename = filename
        elif data is not None:
            self._bytes = base64.b64decode(data)
        else:
            raise TypeError("filename or data kwarg must be specified")
def __init__ ( self , filename = None , data = None ) : self . _filename = None self . _bytes = None if filename is not None and data is not None : raise TypeError ( "filename or data kwarg must be specified, not both" ) elif filename is not None : if not os . path . isfile ( filename ) : raise exceptions . PyKubeError ( "'{}' file does not exist" . format ( filename ) ) self . _filename = filename elif data is not None : self . _bytes = base64 . b64decode ( data ) else : raise TypeError ( "filename or data kwarg must be specified" )
Creates a new instance of BytesOrFile.

        :Parameters:
           - `filename`: A full path to a file
           - `data`: base64 encoded bytes