def __init__(self, pathname, masterpath=None, create=None, readonly=None):
    "Open or create a CDF file.\n\n        Parameters\n        ==========\n        pathname : string\n            name of the file to open or create\n        masterpath : string\n            name of the master CDF file to use in creating\n            a new file. If not provided, an existing file is\n            opened; if provided but evaluates to ``False``\n            (e.g., ``''``), an empty new CDF is created.\n        create : bool\n            Create a new CDF even if masterpath isn't provided\n        readonly : bool\n            Open the CDF read-only. Default True if opening an\n            existing CDF; False if creating a new one.\n\n        Raises\n        ======\n        CDFError\n            if CDF library reports an error\n        CDFWarning\n            if CDF library reports a warning and interpreter\n            is set to error on warnings.\n\n        Examples\n        ========\n        Open a CDF by creating a CDF object, e.g.:\n            >>> cdffile = pycdf.CDF('cdf_filename.cdf')\n        Be sure to :py:meth:`pycdf.CDF.close` or :py:meth:`pycdf.CDF.save`\n        when done.\n        "
    if (masterpath is not None):
        if (create is False):
            raise ValueError('Cannot specify a master CDF without creating a CDF')
        if (readonly is True):
            raise ValueError('Cannot create a CDF in readonly mode')
    if (create and readonly):
        raise ValueError('Cannot create a CDF in readonly mode')
    try:
        self.pathname = pathname.encode()
    except AttributeError:
        raise ValueError('pathname must be string-like: {0}'.format(pathname))
    self._handle = ctypes.c_void_p(None)
    self._opened = False
    if ((masterpath is None) and (not create)):
        self._open((True if (readonly is None) else readonly))
    elif masterpath:
        self._from_master(masterpath.encode())
    else:
        self._create()
    lib.call(const.SELECT_, const.CDF_zMODE_, ctypes.c_long(2))
    self._attrlistref = weakref.ref(gAttrList(self))
    self.backward = (self.version()[0] < 3)
    self._var_nums = {}
    'Cache of name-to-number mappings for variables in this CDF'
    self._attr_info = {}
    'Cache of name-to-(number, global) mappings for attributes\n        in this CDF'
Open or create a CDF file.

Parameters
==========
pathname : string
    name of the file to open or create
masterpath : string
    name of the master CDF file to use in creating
    a new file. If not provided, an existing file is
    opened; if provided but evaluates to ``False``
    (e.g., ``''``), an empty new CDF is created.
create : bool
    Create a new CDF even if masterpath isn't provided
readonly : bool
    Open the CDF read-only. Default True if opening an
    existing CDF; False if creating a new one.

Raises
======
CDFError
    if CDF library reports an error
CDFWarning
    if CDF library reports a warning and interpreter
    is set to error on warnings.

Examples
========
Open a CDF by creating a CDF object, e.g.:
    >>> cdffile = pycdf.CDF('cdf_filename.cdf')
Be sure to :py:meth:`pycdf.CDF.close` or :py:meth:`pycdf.CDF.save`
when done.
def __init__(self, pathname, masterpath=None, create=None, readonly=None):
    "Open or create a CDF file.\n\n        Parameters\n        ==========\n        pathname : string\n            name of the file to open or create\n        masterpath : string\n            name of the master CDF file to use in creating\n            a new file. If not provided, an existing file is\n            opened; if provided but evaluates to ``False``\n            (e.g., ````), an empty new CDF is created.\n        create : bool\n            Create a new CDF even if masterpath isn't provided\n        readonly : bool\n            Open the CDF read-only. Default True if opening an\n            existing CDF; False if creating a new one.\n\n        Raises\n        ======\n        CDFError\n            if CDF library reports an error\n        CDFWarning\n            if CDF library reports a warning and interpreter\n            is set to error on warnings.\n\n        Examples\n        ========\n        Open a CDF by creating a CDF object, e.g.:\n            >>> cdffile = pycdf.CDF('cdf_filename.cdf')\n        Be sure to :py:meth:`pycdf.CDF.close` or :py:meth:`pycdf.CDF.save`\n        when done.\n        "
    if (masterpath is not None):
        if (create is False):
            raise ValueError('Cannot specify a master CDF without creating a CDF')
        if (readonly is True):
            raise ValueError('Cannot create a CDF in readonly mode')
    if (create and readonly):
        raise ValueError('Cannot create a CDF in readonly mode')
    try:
        self.pathname = pathname.encode()
    except AttributeError:
        raise ValueError('pathname must be string-like: {0}'.format(pathname))
    self._handle = ctypes.c_void_p(None)
    self._opened = False
    if ((masterpath is None) and (not create)):
        self._open((True if (readonly is None) else readonly))
    elif masterpath:
        self._from_master(masterpath.encode())
    else:
        self._create()
    lib.call(const.SELECT_, const.CDF_zMODE_, ctypes.c_long(2))
    self._attrlistref = weakref.ref(gAttrList(self))
    self.backward = (self.version()[0] < 3)
    self._var_nums = {}
    'Cache of name-to-number mappings for variables in this CDF'
    self._attr_info = {}
    'Cache of name-to-(number, global) mappings for attributes\n        in this CDF'