Code Duplication    Length = 11-11 lines in 2 locations

src/amd/io.py 2 locations

@@ 921-931 (lines=11) @@
918
919
    # Atomic types
920
    asym_symbols = odict.get('_atom_site_type_symbol')
921
    if asym_symbols is not None:
922
        asym_symbols_ = []
923
        for label in asym_symbols:
924
            sym = ''
925
            if label and label not in ('.', '?'):
926
                match = re.search(r'([A-Z][a-z]?)', label)
927
                if match is not None:
928
                    sym = match.group() 
929
            asym_symbols_.append(sym)
930
    else:
931
        asym_symbols_ = [''] * len(asym_unit)
932
    asym_types = [_ATOMIC_NUMBERS[s] for s in asym_symbols_]
933
934
    # Find where sites have disorder if necassary
@@ 734-744 (lines=11) @@
731
732
    # Atomic types
733
    asym_symbols = block.get('_atom_site_type_symbol')
734
    if asym_symbols is not None:
735
        asym_symbols_ = []
736
        for label in asym_symbols:
737
            sym = ''
738
            if label and label not in ('.', '?'):
739
                match = re.search(r'([A-Z][a-z]?)', label)
740
                if match is not None:
741
                    sym = match.group() 
742
            asym_symbols_.append(sym)
743
    else:
744
        asym_symbols_ = [''] * len(asym_unit)
745
    asym_types = [_ATOMIC_NUMBERS[s] for s in asym_symbols_]
746
747
    # Find where sites have disorder if necassary