Clear all previous email attachments
773553
private function clearAttachments($dir)
    {
        if (!file_exists($dir)) {
            mkdir($dir, 0777, true);
        }

        $files = glob($dir.'/*');
        foreach ($files as $file) {
            if (is_file($file)) {
                unlink($file);
            }
        }
    }
176659
def delete_all
      start do |pop3|
        unless pop3.mails.empty?
          pop3.delete_all
          pop3.finish
        end
      end
    end
483589
def clear(self):
        
        all_keys = self._find_keys_raw(settings.THUMBNAIL_KEY_PREFIX)
        if all_keys:
            self._delete_raw(*all_keys)
226989
def delete(self):
        
        headers = self.headers
        endpoint = 'https://outlook.office.com/api/v2.0/me/MailFolders/' + self.id

        r = requests.delete(endpoint, headers=headers)

        check_response(r)
359358
def clear(self):
        
        self.__modified_data__ = {}
        self.__deleted_fields__ = [field for field in self.__original_data__.keys()]
1368292
function clear() {
		$Finder = new \FilesystemIterator($this->dirname,
			\FilesystemIterator::KEY_AS_FILENAME
			| \FilesystemIterator::CURRENT_AS_FILEINFO
			| \FilesystemIterator::SKIP_DOTS);
		foreach ( $Finder as $key => $value ) {
			if ( pathinfo($key,PATHINFO_EXTENSION)=='json' ) {
				unlink($value->getRealPath());
			}
		}
	}
341767
def clean_email(self):
        
        contacts = self.api.lists.contacts(id=self.list_id)['result']

        for contact in contacts:
            if contact['email'] == self.cleaned_data['email']:
                raise forms.ValidationError(
                    _(u'This email is already subscribed'))

        return self.cleaned_data['email']
616136
function cleanDocs(docs) {
  for (var i = 0; i < docs.length; i++) {
    var doc = docs[i];
    if (doc._deleted) {
      delete doc._attachments; // ignore atts for deleted docs
    } else if (doc._attachments) {
      // filter out extraneous keys from _attachments
      var atts = Object.keys(doc._attachments);
      for (var j = 0; j < atts.length; j++) {
        var att = atts[j];
        doc._attachments[att] = pouchdbUtils.pick(doc._attachments[att],
          ['data', 'digest', 'content_type', 'length', 'revpos', 'stub']);
      }
    }
  }
}
1234060
public function clearAllRecipients()
    {
        $this->to = [];
        $this->cc = [];
        $this->bcc = [];
        $this->all_recipients = [];
        $this->RecipientsQueue = [];
    }
1357407
def _process_attachments(self, email):
        
        for a in email.attachments:
            if isinstance(a, MIMEBase):
                if not a.is_multipart():
                    obj = {
                        'filename': a.get_filename(),
                        'content_type': a.get_content_type(),
                    }
                    if a.get('content-transfer-encoding') == 'base64':
                        obj['content'] = a.get_payload()
                        obj['encoded'] = True
                    else:
                        obj['content'] = a.get_payload(decode=True)
                    yield obj
            else:
                yield {
                    'filename': a[0],
                    'content_type': a[2],
                    'content': a[1],
                }
1228166
public function clear()
    {
        $this->mailer = null;
        $this->to = $this->attachemnts = array();
        $this->subject = $this->message = false;
        return $this;
    }
1292535
function skip() {
    rimraf(file, function() {})
    delete f.versions[v]
    if (f._attachments)
      delete f._attachments[file]
    need.splice(need.indexOf(v), 1)
    maybeDone(null)
  }
809982
def cleanup(self):
        """"""
        size = settings.get('history_size')
        self._save_history_to_file(self.commandprompthistory,
                                   self._cmd_hist_file, size=size)
        self._save_history_to_file(self.senderhistory, self._sender_hist_file,
                                   size=size)
        self._save_history_to_file(self.recipienthistory,
                                   self._recipients_hist_file, size=size)
1359922
function( bindingPoint ){
    var att = this.attachments[bindingPoint.toString()];
    if( att !== undefined ){
      var index = this.attachmentsList.indexOf( att );
      this.attachmentsList.splice( index, 1 );
      att._detach( bindingPoint );
    }
    delete this.attachments[bindingPoint.toString()];
  }
1329411
public function logout()
    {
        if ($this->_mails) {
            foreach ($this->_mails as $mail) {
                if ($mail['is_deleted']) {
                    unlink($this->_path.'/'.$mail['file_name']);
                }
            }
        }
    }
389835
public function clearAllCaches()
    {
        if (MemcachedCache::itWorks()) {
            $this->getMemcachedCacher()->deleteAll();
            $clear_file_cache = false;
        }

        if (MemcacheCache::itWorks()) {
            $this->getMemcacheCacher()->deleteAll();
            $clear_file_cache = false;
        }

        if (FileCache::itWorks()) {
            $this->getFileCacher()->deleteAll();
        }

        if (FakeCache::itWorks()) {
            $this->getFakeCacher()->deleteAll();
        }
    }
970479
public void removeAll()
    {
        if (m_aRecords != null)
        {
            for (int iArrayIndex = 0; iArrayIndex < MAX_RECORD_ARRAY_SIZE; iArrayIndex++)
            {   // Free the objects that are no longer used
                this.freeElement(m_aRecords[iArrayIndex]);
                m_aRecords[iArrayIndex] = null;
            }
            m_aRecords = null;
        }
        m_iRecordListStep = 1;
        m_iRecordListEnd = 0;
        m_iRecordListMax = 0; // Current size of the record list (records scanned) (-1 - unknown)
    }