# Path: pymicro/external/StarFile.py
# class StarList(list):
#     def __getitem__(self,args):
#         if isinstance(args,(int,slice)):
#             return super(StarList,self).__getitem__(args)
#         elif isinstance(args,tuple) and len(args)>1:   #extended comma notation
#             return super(StarList,self).__getitem__(args[0]).__getitem__(args[1:])
#         else:
#             return super(StarList,self).__getitem__(args[0])
# 
#     def __str__(self):
#         return "SL("+super(StarList,self).__str__() + ")"


    from cStringIO import StringIO
    from io import StringIO
    from urllib import urlopen         # for arbitrary opening
    from urlparse import urlparse, urljoin
    from urllib.request import urlopen
    from urllib.parse import urlparse, urljoin
from . import StarFile
from .StarFile import StarList  #put in global scope for exec statement
    from .drel import drel_runtime  #put in global scope for exec statement
from copy import copy          #must be in global scope for exec statement
        from .drel import drel_ast_yacc
        from .drel import py_from_ast
        from .drel import drel_ast_yacc
        from .drel import py_from_ast
    from . import TypeContentsParser as t
import re,sys
    import numpy                   #put in global scope for exec statement
        import traceback
        import numpy
        this block.

        * if `strict` is set, maximum name lengths will be enforced

        * `maxoutlength` is the maximum length for output lines

        * `wraplength` is the ideal length to make output lines

        * When set, `overwrite` allows the values of datanames to be changed (otherwise an error
        is raised).

        * `compat_mode` will allow deprecated behaviour of creating single-dataname loops using
        the syntax `a[_dataname] = [1,2,3,4]`.  This should now be done by calling `CreateLoop`
        after setting the dataitem value.
        """
        if strict: maxnamelength=75
        else:
           maxnamelength=-1
        super(CifBlock,self).__init__(data=data,maxnamelength=maxnamelength,**kwargs)
        self.dictionary = None   #DDL dictionary referring to this block
        self.compat_mode = compat_mode   #old-style behaviour of setitem

    def RemoveCifItem(self,itemname):
        """Remove `itemname` from the CifBlock"""
        self.RemoveItem(itemname)

    def __setitem__(self,key,value):
        self.AddItem(key,value)
        # for backwards compatibility make a single-element loop
        if self.compat_mode:

# Path: pymicro/external/StarFile.py
# class StarList(list):
#     def __getitem__(self,args):
#         if isinstance(args,(int,slice)):
#             return super(StarList,self).__getitem__(args)
#         elif isinstance(args,tuple) and len(args)>1:   #extended comma notation
#             return super(StarList,self).__getitem__(args[0]).__getitem__(args[1:])
#         else:
#             return super(StarList,self).__getitem__(args[0])
# 
#     def __str__(self):
#         return "SL("+super(StarList,self).__str__() + ")"


# Path: pymicro/external/CifFile_module.py
    from cStringIO import StringIO
    from io import StringIO
    from urllib import urlopen         # for arbitrary opening
    from urlparse import urlparse, urljoin
    from urllib.request import urlopen
    from urllib.parse import urlparse, urljoin
from . import StarFile
from .StarFile import StarList  #put in global scope for exec statement
    from .drel import drel_runtime  #put in global scope for exec statement
from copy import copy          #must be in global scope for exec statement
        from .drel import drel_ast_yacc
        from .drel import py_from_ast
        from .drel import drel_ast_yacc
        from .drel import py_from_ast
    from . import TypeContentsParser as t
import re,sys
    import numpy                   #put in global scope for exec statement
        import traceback
        import numpy

        this block.

        * if `strict` is set, maximum name lengths will be enforced

        * `maxoutlength` is the maximum length for output lines

        * `wraplength` is the ideal length to make output lines

        * When set, `overwrite` allows the values of datanames to be changed (otherwise an error
        is raised).

        * `compat_mode` will allow deprecated behaviour of creating single-dataname loops using
        the syntax `a[_dataname] = [1,2,3,4]`.  This should now be done by calling `CreateLoop`
        after setting the dataitem value.
        """
        if strict: maxnamelength=75
        else:
           maxnamelength=-1
        super(CifBlock,self).__init__(data=data,maxnamelength=maxnamelength,**kwargs)
        self.dictionary = None   #DDL dictionary referring to this block
        self.compat_mode = compat_mode   #old-style behaviour of setitem

    def RemoveCifItem(self,itemname):
        """Remove `itemname` from the CifBlock"""
        self.RemoveItem(itemname)

    def __setitem__(self,key,value):
        self.AddItem(key,value)
        # for backwards compatibility make a single-element loop
        if self.compat_mode:

            if isinstance(value,(tuple,list)) and not isinstance(value,StarFile.StarList):