def setkey(self, name='', value=''):
    '\n            set keys, two styles are possible:\n\n            1. name = {key:val}            e.g. **setkey({"a":1})**\n\n            2. name = "key", value = val     e.g. **setkey("a", 1)**\n\n            This method checks the type of the keyword value, as it must\n            remain the same. Also new keywords cannot be added.\n\n            Parameters\n            ----------\n\n            name : dictionary or string\n                Dictionary of keyword value pais to set or a string with the name\n                of a single key\n\n            value : any\n                The value to change the keyword to\n\n            Returns\n            -------\n            None\n        '
    if isinstance(name, dict):
        for (k, v) in name.iteritems():
            if hasattr(self, k):
                if (type(v) == type(getattr(self, k))):
                    if ((k == 'energies') and (not isinstance(v, list)) and (len(v) != 2)):
                        raise Exception('Energies must be a list in the format [lower, upper], use setupperenergy or setlowerenergy to set them individually.')
                    setattr(self, k, v)
                else:
                    raise Exception(('Cannot change data type for %s, expected %s but got %s' % (k, str(type(getattr(self, k))), str(type(v)))))
            else:
                raise Exception(('Invalid key given to Line class: %s' % k))
    elif (not (name == '')):
        if hasattr(self, name):
            if (type(value) == type(getattr(self, name))):
                if ((name == 'energies') and (not isinstance(value, list)) and (len(value) != 2)):
                    raise Exception('Energies must be a list in the format [lower, upper], use setupperenergy or setlowerenergy to set them individually.')
                setattr(self, name, value)
            else:
                raise Exception(('Cannot change data type for %s, expected %s but got %s' % (name, str(type(getattr(self, name))), str(type(value)))))
        else:
            raise Exception(('Invalid key given to Line class: %s' % name))
    else:
        raise Exception('Invalid name parameter given, it must be a string or a dictionary of keys:values.')
set keys, two styles are possible:

1. name = {key:val}            e.g. **setkey({"a":1})**

2. name = "key", value = val     e.g. **setkey("a", 1)**

This method checks the type of the keyword value, as it must
remain the same. Also new keywords cannot be added.

Parameters
----------

name : dictionary or string
    Dictionary of keyword value pais to set or a string with the name
    of a single key

value : any
    The value to change the keyword to

Returns
-------
None
def setkey(self, name=, value=):
    '\n            set keys, two styles are possible:\n\n            1. name = {key:val}            e.g. **setkey({"a":1})**\n\n            2. name = "key", value = val     e.g. **setkey("a", 1)**\n\n            This method checks the type of the keyword value, as it must\n            remain the same. Also new keywords cannot be added.\n\n            Parameters\n            ----------\n\n            name : dictionary or string\n                Dictionary of keyword value pais to set or a string with the name\n                of a single key\n\n            value : any\n                The value to change the keyword to\n\n            Returns\n            -------\n            None\n        '
    if isinstance(name, dict):
        for (k, v) in name.iteritems():
            if hasattr(self, k):
                if (type(v) == type(getattr(self, k))):
                    if ((k == 'energies') and (not isinstance(v, list)) and (len(v) != 2)):
                        raise Exception('Energies must be a list in the format [lower, upper], use setupperenergy or setlowerenergy to set them individually.')
                    setattr(self, k, v)
                else:
                    raise Exception(('Cannot change data type for %s, expected %s but got %s' % (k, str(type(getattr(self, k))), str(type(v)))))
            else:
                raise Exception(('Invalid key given to Line class: %s' % k))
    elif (not (name == )):
        if hasattr(self, name):
            if (type(value) == type(getattr(self, name))):
                if ((name == 'energies') and (not isinstance(value, list)) and (len(value) != 2)):
                    raise Exception('Energies must be a list in the format [lower, upper], use setupperenergy or setlowerenergy to set them individually.')
                setattr(self, name, value)
            else:
                raise Exception(('Cannot change data type for %s, expected %s but got %s' % (name, str(type(getattr(self, name))), str(type(value)))))
        else:
            raise Exception(('Invalid key given to Line class: %s' % name))
    else:
        raise Exception('Invalid name parameter given, it must be a string or a dictionary of keys:values.')