Similar to content.setter but when there are no existing oktypes
168293
def _set_content(self, value, oktypes):
        
        if value is None:
            value = []
        self._content = ListContainer(*value, oktypes=oktypes, parent=self)
353935
public static void cursorRowToContentValues(Cursor cursor, ContentValues values) {
        String[] columns = cursor.getColumnNames();
        int length = columns.length;
        for (int i = 0; i < length; i++) {
            if (cursor.getType(i) == Cursor.FIELD_TYPE_BLOB) {
                values.put(columns[i], cursor.getBlob(i));
            } else {
                values.put(columns[i], cursor.getString(i));
            }
        }
    }
156912
public static List<String> cleanupFuzzyContentTypes(List<String> contentTypes) {
        if (contentTypes == null || contentTypes.isEmpty()) {
            return contentTypes;
        }

        List<String> types = new ArrayList<>();
        for (String contentType : contentTypes) {
            if (contentType.equals("*") || contentType.equals("*/*")) {
                types.add(contentType);
                continue;
            }
            int i = contentType.indexOf('*');
            if (i > -1) {
                types.add(contentType.substring(0, i));
            } else {
                types.add(contentType);
            }
        }

        return types;
    }
196748
public void setContent(Object content, String contentType)
			throws UnsupportedEncodingException {
		// https://code.google.com/p/sipservlets/issues/detail?id=202
		if(getSipSession().getProxy() == null) {
			checkMessageState();
		}
		checkContentType(contentType);
		checkCommitted();

		if(contentType != null && contentType.length() > 0) {
			this.addHeader(ContentTypeHeader.NAME, contentType);
			ContentTypeHeader contentTypeHeader = (ContentTypeHeader)this.message.getHeader(ContentTypeHeader.NAME);
			String charset = this.getCharacterEncoding();
			try {
			    // https://code.google.com/p/sipservlets/issues/detail?id=169
				if(contentType.contains(CONTENT_TYPE_MULTIPART) && content instanceof Multipart) {
					// Fix for Issue 2667 : Correct Handling of MimeMultipart
					Multipart multipart = (Multipart) content;
					OutputStream os = new ByteArrayOutputStream();
					multipart.writeTo(os);
					this.message.setContent(os.toString(), contentTypeHeader);
				} else {
					Object tmpContent = content;
					if(tmpContent instanceof String  && charset != null) {
						//test for unsupportedencoding exception
						new String("testEncoding".getBytes(charset));
						tmpContent = new String(((String)tmpContent).getBytes());
					}
					this.message.setContent(content, contentTypeHeader);
				}
			} catch (UnsupportedEncodingException uee) {
				throw uee;
			} catch (Exception e) {
				throw new IllegalArgumentException("Parse error reading content " + content + " with content type " + contentType, e);
			}
		}
	}
848328
public static void put(String extension, String contentType) {
        if (extension != null && extension.length() != 0
                && contentType != null && contentType.length() != 0) {

            contentTypes.put(extension, contentType);
        }
    }
119797
AppendableExpression setSanitizedContentKind(SanitizedContentKind kind) {
    return withNewDelegate(
        delegate.invoke(
            SET_SANITIZED_CONTENT_KIND,
            BytecodeUtils.constantSanitizedContentKindAsContentKind(kind)),
        true);
  }
733445
public final void setDefaultContentType(@NotNull final SerializedDataType type,
            final EnhancedMimeType contentType) {

        Contract.requireArgNotNull("type", type);
        Contract.requireArgNotNull("contentType", contentType);

        contentTypes.put(type, contentType);

    }
610483
public void setContentType(String contentType) 
    {
        if (isCommitted())
            return;
        
        if (contentType==null)
        {
            _mimeType=null;
            _header.remove(HttpFields.__ContentType);
        }
        else
        {
            // Look for encoding in contentType
            int i0=contentType.indexOf(';');
            
            if (i0>0)
            {
                // Strip params off mimetype
                _mimeType=contentType.substring(0,i0).trim();
                
                // Look for charset
                int i1=contentType.indexOf("charset=",i0);
                if (i1>=0)
                {
                    i1+=8;
                    int i2 = contentType.indexOf(' ',i1);
                    _characterEncoding = (0<i2)
                    ? contentType.substring(i1,i2)
                                    : contentType.substring(i1);
                    _characterEncoding = QuotedStringTokenizer.unquote(_characterEncoding);
                }
                else // No encoding in the params.
                {
                    if (_characterEncoding!=null)
                        // Add any previously set encoding.
                        contentType+=";charset="+QuotedStringTokenizer.quote(_characterEncoding,";= ");
                }
            }
            else // No encoding and no other params
            {
                _mimeType=contentType;
                // Add any previously set encoding.
                if (_characterEncoding!=null)
                    contentType+=";charset="+QuotedStringTokenizer.quote(_characterEncoding,";= ");
            }
            
            _header.put(HttpFields.__ContentType,contentType);
        }
    }
45805
def new_code_block(self, **kwargs):
        """"""
        proto = {'content': '',
                 'type': self.code,
                 'IO': '',
                 'attributes': ''}
        proto.update(**kwargs)
        return proto
497134
private MediaType acceptabePlainTextMediaType() {
        final List<MediaType> acceptable = headers.getAcceptableMediaTypes();
        if (acceptable == null || acceptable.size() == 0) {
            return TEXT_PLAIN_TYPE;
        }
        for (final MediaType type : acceptable) {
            if (type.isWildcardType() || (type.isCompatible(TEXT_PLAIN_TYPE) && type.isWildcardSubtype())) {
                return TEXT_PLAIN_TYPE;
            } else if (type.isCompatible(TEXT_PLAIN_TYPE)) {
                return type;
            }
        }
        return null;
    }
209107
public void setMutableContent(boolean mutable) throws JSONException {
		if (mutable == true) {
			logger.debug("Setting mutable content");
			put("mutable-content", 1, this.apsDictionary, false);
		} else {
			logger.debug("Removing mutable content");
			remove("mutable-content", this.apsDictionary);
		}
	}
1222016
function(source, type) {
  if (source.hasOwnProperty('format')) {
    if (source.format !== type) {
      if (source.format === 'section') {
        var blocks = [];
        source.blocks.forEach(function(val, index, array) {
          var block = deleteTextBlockFormat(val, type);
          if (block) {
            blocks.push(block);
          }
        });
        if (blocks.length) {
          return {format: 'section', blocks: blocks};
        } else {
          return null;
        }
      } else {
        return source;
      }
    } else {
      return null;
    }
  }
  throw new Error('invalid format for textblock (did you pass an Object in?)');
}
389512
private void setContentType(String contentType) {
        // The content type may contain the charset, parse it and set it.
        if (contentType != null && contentType.contains("charset=")) {
            charset = Charset.forName(contentType.substring(contentType.indexOf("charset=") + 8).trim());
        }
        headers.put(HeaderNames.CONTENT_TYPE, contentType);
    }
942205
def content_type(self) -> Optional[ContentTypeHeader]:
        """"""
        try:
            return cast(ContentTypeHeader, self[b'content-type'][0])
        except (KeyError, IndexError):
            return None
325137
private byte[] replaceInContent(CmsFile file, byte[] contents) throws Exception {

        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(m_settings.getLocale())) {
            Locale contentLocale = CmsLocaleManager.getMainLocale(getCms(), file);
            if (!contentLocale.toString().equalsIgnoreCase(m_settings.getLocale())) {
                // content does not match the requested locale, skip it
                getReport().println(
                    Messages.get().container(Messages.RPT_SOURCESEARCH_NOT_MATCHED_0),
                    I_CmsReport.FORMAT_NOTE);
                return null;
            }
        }

        String encoding = CmsLocaleManager.getResourceEncoding(getCms(), file);
        String content = new String(contents, encoding);

        if (CmsSourceSearchForm.REGEX_ALL.equals(m_settings.getSearchpattern()) & !m_replace) {
            m_matchedResources.add(file);
            getReport().print(Messages.get().container(Messages.RPT_SOURCESEARCH_MATCHED_0), I_CmsReport.FORMAT_OK);
            return null;
        }

        Matcher matcher = Pattern.compile(m_settings.getSearchpattern()).matcher(content);

        if (matcher.find()) {
            // search pattern did match here, so take this file in the list with matches resources
            m_matchedResources.add(file);
            getReport().print(Messages.get().container(Messages.RPT_SOURCESEARCH_MATCHED_0), I_CmsReport.FORMAT_OK);
            if (m_replace) {
                if (m_settings.getType().equals(SearchType.renameContainer)) {

                    return renameNestedContainers(
                        file,
                        m_settings.getElementResource(),
                        m_settings.getReplacepattern().split(";")[0],
                        m_settings.getReplacepattern().split(";")[1]);
                }
                return matcher.replaceAll(m_settings.getReplacepattern()).getBytes(encoding);
            }
        } else {
            // search pattern did not match
            getReport().print(
                Messages.get().container(Messages.RPT_SOURCESEARCH_NOT_MATCHED_0),
                I_CmsReport.FORMAT_NOTE);
        }
        return null;
    }
1226864
private static void populateDefaults(JSDocInfo info) {
    if (info.getVisibility() == null) {
      info.setVisibility(Visibility.INHERITED);
    }
  }
471413
def content_for(*args,&block)
      if block
        helpers.content_for(*args,&block)
      else
        rawtext(helpers.content_for(*args))
        ''
      end
    end