Did I find the right examples for you? yes no

All Samples(10)  |  Call(10)  |  Derive(0)  |  Import(0)
Supress consecutive spaces to replace them with a unique one.
e.g "two  spaces" = "two spaces"

        def remove_consecutive_spaces_and_strip(a_str):
    """
       Supress consecutive spaces to replace them with a unique one.
       e.g "two  spaces" = "two spaces"
    """
    #return re.sub("\s{2,}", " ", a_str, flags=re.U).strip()
    return MULTI_SPACES_RE.sub(u" ", a_str).strip()
        


src/g/m/gmvault-HEAD/src/gmv/gmvault_db.py   gmvault(Download)
                label = str(label)
 
            labels.append(unicode(gmvault_utils.remove_consecutive_spaces_and_strip(label)))
 
        labels.extend(extra_labels) #add extra labels

src/g/m/gmvault-1.8.1-beta/src/gmv/gmvault_db.py   gmvault(Download)
                label = str(label)
 
            labels.append(unicode(gmvault_utils.remove_consecutive_spaces_and_strip(label)))
 
        labels.extend(extra_labels) #add extra labels

src/g/m/gmvault-HEAD/src/gmv/imap_utils.py   gmvault(Download)
            labels_str = '('
            for label in a_labels:
                label = gmvault_utils.remove_consecutive_spaces_and_strip(label)
                #add not in self.GMAIL_SPECIAL_DIRS_LOWER
                if label.lower() in cls.GMAIL_SPECIAL_DIRS_LOWER:
        i = 0
        for lab in label.split('/'):
            lab = gmvault_utils.remove_consecutive_spaces_and_strip(lab)
            if i == 0:
                dirs.append(lab)

src/g/m/gmvault-1.8.1-beta/src/gmv/imap_utils.py   gmvault(Download)
            labels_str = '('
            for label in a_labels:
                label = gmvault_utils.remove_consecutive_spaces_and_strip(label)
                #add not in self.GMAIL_SPECIAL_DIRS_LOWER
                if label.lower() in cls.GMAIL_SPECIAL_DIRS_LOWER:
        i = 0
        for lab in label.split('/'):
            lab = gmvault_utils.remove_consecutive_spaces_and_strip(lab)
            if i == 0:
                dirs.append(lab)

src/g/m/gmvault-HEAD/src/gmv/test_utils.py   gmvault(Download)
 
        #clean potential labels with multiple spaces
        disk_labels   = [ gmvault_utils.remove_consecutive_spaces_and_strip(label) for label in disk_labels ]
        online_labels = [ gmvault_utils.remove_consecutive_spaces_and_strip(label) for label in online_labels ]
 

src/g/m/gmvault-1.8.1-beta/src/gmv/test_utils.py   gmvault(Download)
 
        #clean potential labels with multiple spaces
        disk_labels   = [ gmvault_utils.remove_consecutive_spaces_and_strip(label) for label in disk_labels ]
        online_labels = [ gmvault_utils.remove_consecutive_spaces_and_strip(label) for label in online_labels ]