Print user-requested fields or provided fields minus info fields.
186907
def _adjust_prt_flds(self, kws_xlsx, desc2nts, shade_hdrgos):
        """"""
        # Use xlsx prt_flds from the user, if provided
        if "prt_flds" in kws_xlsx:
            return kws_xlsx["prt_flds"]
        # If the user did not provide specific fields to print in an xlsx file:
        dont_print = set(['hdr_idx', 'is_hdrgo', 'is_usrgo'])
        # Are we printing GO group headers?
        # Build new list of xlsx print fields, excluding those which add no new information
        prt_flds_adjusted = []
        # Get all namedtuple fields
        nt_flds = self.sortobj.get_fields(desc2nts)
        # Keep fields intended for print and optionally gray-shade field (format_txt)
        # print('FFFFFFFFFFFFFFF WrXlsxSortedGos::_adjust_prt_flds:', nt_flds)
        for nt_fld in nt_flds:
            if nt_fld not in dont_print:
                # Only add grey-shade to hdrgo and section name rows if hdrgo_prt=True
                if nt_fld == "format_txt":
                    if shade_hdrgos is True:
                        prt_flds_adjusted.append(nt_fld)
                else:
                    prt_flds_adjusted.append(nt_fld)
        kws_xlsx['prt_flds'] = prt_flds_adjusted
1193501
def process_fields_param(fields):
    
    if not fields:
        return fields
    if isinstance(fields, six.string_types):
        fields = split_strip(fields)
    if '_type' not in fields:
        fields.append('_type')
    return {
        '_source_include': fields,
        '_source': True,
    }
563640
def _calldata_fields(fields, exclude_fields, format_ids):
    """"""
    if fields is None:
        # no fields specified by user
        # default to all standard fields plus all FORMAT fields in VCF header
        fields = config.STANDARD_CALLDATA_FIELDS + format_ids
    else:
        # fields specified by user
        for f in fields:
            # check if field is standard or defined in VCF header
            if (f not in config.STANDARD_CALLDATA_FIELDS and
                    f not in format_ids):
                # support extracting FORMAT even if not declared in header,
                # but warn...
                print('WARNING: no definition found for field %s' % f,
                      file=sys.stderr)
    # process exclusions
    if exclude_fields is not None:
        fields = [f for f in fields if f not in exclude_fields]
    return tuple(fields)
128229
private void ensureReturnFields(String[] requestedReturnFields) {

        if ((requestedReturnFields != null) && (requestedReturnFields.length > 0)) {
            List<String> result = new ArrayList<String>();
            for (String field : requestedReturnFields) {
                String commasep = field.replaceAll(" ", ",");
                List<String> list = CmsStringUtil.splitAsList(commasep, ',');
                if (!list.contains("*")) {
                    for (String reqField : CmsStringUtil.splitAsList(MINIMUM_FIELDS, ",")) {
                        if (!list.contains(reqField)) {
                            list.add(reqField);
                        }
                    }
                }
                result.addAll(list);
            }
            setParam(CommonParams.FL, CmsStringUtil.arrayAsString(result.toArray(new String[0]), ","));
        }
    }
313531
def PrintField(self, field, value):
    """"""
    out = self.out
    out.write(' ' * self.indent)
    if self.use_field_number:
      out.write(str(field.number))
    else:
      if field.is_extension:
        out.write('[')
        if (field.containing_type.GetOptions().message_set_wire_format and
            field.type == descriptor.FieldDescriptor.TYPE_MESSAGE and
            field.label == descriptor.FieldDescriptor.LABEL_OPTIONAL):
          out.write(field.message_type.full_name)
        else:
          out.write(field.full_name)
        out.write(']')
      elif field.type == descriptor.FieldDescriptor.TYPE_GROUP:
        # For groups, use the capitalized name.
        out.write(field.message_type.name)
      else:
        out.write(field.name)

    if field.cpp_type != descriptor.FieldDescriptor.CPPTYPE_MESSAGE:
      # The colon is optional in this case, but our cross-language golden files
      # don't include it.
      out.write(': ')

    self.PrintFieldValue(field, value)
    if self.as_one_line:
      out.write(' ')
    else:
      out.write('\n')
163603
def _clean_fields(allowed_fields: dict, fields: FieldsParam) -> Iterable[str]:
    """"""
    if fields == ALL:
        fields = allowed_fields.keys()
    else:
        fields = tuple(fields)
        unknown_fields = set(fields) - allowed_fields.keys()
        if unknown_fields:
            raise ValueError('Unknown fields: {}'.format(unknown_fields))
    return fields
748277
def _init_fields(self):
        """"""
        if self.opts.fields:
            available_field_names = self.set_class(self.opts.fields)
        else:
            available_field_names = self.set_class(self.declared_fields.keys())
            if self.opts.additional:
                available_field_names |= self.set_class(self.opts.additional)

        invalid_fields = self.set_class()

        if self.only is not None:
            # Return only fields specified in only option
            field_names = self.set_class(self.only)

            invalid_fields |= field_names - available_field_names
        else:
            field_names = available_field_names

        # If "exclude" option or param is specified, remove those fields.
        exclude_field_names = set(self.opts.exclude) | set(self.exclude)
        if exclude_field_names:
            # Note that this isn't available_field_names, since we want to
            # apply "only" for the actual calculation.
            field_names = field_names - exclude_field_names

            invalid_fields |= exclude_field_names - available_field_names

        if invalid_fields:
            message = 'Invalid fields for {}: {}.'.format(self, invalid_fields)
            raise ValueError(message)

        fields_dict = self.dict_class()
        for field_name in field_names:
            field_obj = self.declared_fields.get(field_name, ma_fields.Inferred())
            self._bind_field(field_name, field_obj)
            fields_dict[field_name] = field_obj

        dump_data_keys = [
            obj.data_key or name for name, obj in iteritems(fields_dict) if not obj.load_only
        ]
        if len(dump_data_keys) != len(set(dump_data_keys)):
            data_keys_duplicates = {x for x in dump_data_keys if dump_data_keys.count(x) > 1}
            raise ValueError(
                'The data_key argument for one or more fields collides '
                "with another field's name or data_key argument. "
                'Check the following field names and '
                'data_key arguments: {}'.format(list(data_keys_duplicates)),
            )

        load_attributes = [
            obj.attribute or name for name, obj in iteritems(fields_dict) if not obj.dump_only
        ]
        if len(load_attributes) != len(set(load_attributes)):
            attributes_duplicates = {x for x in load_attributes if load_attributes.count(x) > 1}
            raise ValueError(
                'The attribute argument for one or more fields collides '
                "with another field's name or attribute argument. "
                'Check the following field names and '
                'attribute arguments: {}'.format(list(attributes_duplicates)),
            )

        return fields_dict
234463
def get_fields(self, request, obj=None):
        
        fields = self.fields[:]
        if not obj:
            fields.remove('value')
        return fields
320142
def _prep_fields_param(fields):
    """"""

    store_samples = False

    if fields is None:
        # add samples by default
        return True, None

    if isinstance(fields, str):
        fields = [fields]
    else:
        fields = list(fields)

    if 'samples' in fields:
        fields.remove('samples')
        store_samples = True
    elif '*' in fields:
        store_samples = True

    return store_samples, fields
958120
def get_readonly_fields(self, request, obj=None):
        """"""
        return list(self.readonly_fields) + [field.name for field in obj._meta.fields]
1268182
function removeBadFields(attrs){
	var badList = ['scores', 'table', 'headers'];
	for(var k in badList){
		if(attrs[badList[k]])
			delete attrs[badList[k]];
	}
}
202645
def fields_for(*args, &block)
      if search_obj = args.find { |arg| arg.is_a?(Searchlogic::Search) }
        args.unshift(:search) if args.first == search_obj
        options = args.extract_options!
        if !options[:skip_order_field]
          concat(content_tag("div", hidden_field_tag("#{args.first}[order]", search_obj.order), :style => "display: inline"))
        end
        args << options
        super
      else
        super
      end
    end
28668
def process_fields(self, fields):
		""""""
		
		result = []
		strip = ''.join(self.PREFIX_MAP)
		
		for field in fields:
			direction = self.PREFIX_MAP['']
			
			if field[0] in self.PREFIX_MAP:
				direction = self.PREFIX_MAP[field[0]]
				field = field.lstrip(strip)
			
			result.append((field, direction))
		
		return result
317502
def process_user_record(cls, info):
        """"""
        keys = list(info.keys())
        # Value conversion
        for k in keys:
            v = info[k]
            if v in ('N/A', 'no_information'):
                info[k] = None
            elif v == 'false':
                info[k] = False
            elif v == 'true':
                info[k] = True
        # Object conversion
        for p, t in cls.list_sub_objects:
            obj = dict([(k[len(p):], info.pop(k))
                        for k in keys if k.startswith(p)])
            if obj.get('active', False):
                info.setdefault(t, []).append(obj)
        return info
13824
private void printDoubleWithFields(String name, String fields, double value) {
		print(METRIC_PREFIX);
		print(name);
		if (fields != null) {
			print(fields);
		}
		print(' ');
		println(decimalFormat.format(value));
	}
287274
protected static void printHiddenField(ChainWriter out, int indent, String name, String value) throws IOException {
		for(int c=0;c<indent;c++) out.print("  ");
		out.print("<input type='hidden' name='").encodeXmlAttribute(name).print("' value='").encodeXmlAttribute(value).print("' />\n");
	}

	public List<UploadedFile> getUploadedFiles() {
		if(reqUploadedFiles==null) Collections.emptyList();
		return Collections.unmodifiableList(reqUploadedFiles);
	}

	/**
	 * Gets a file that was uploaded given its ID.  The authentication
	 * credentials for this request must match those of the provided ID.
	 *
	 * @return  the owner of the object
	 * @return  the <code>UploadedFile</code> or <code>null</code> if not found
	 *
	 * @exception  SecurityException  if the ID is not assigned to the person logged in
	 */
	public static UploadedFile getUploadedFile(WebSiteUser owner, long id, ServletContext context, LoggerAccessor loggerAccessor) throws SecurityException {
		synchronized(uploadedFiles) {
			UploadedFile uf=uploadedFiles.get(Long.valueOf(id));
			if(uf!=null) {
				if(uf.getOwner().equals(owner)) return uf;
				else {
					loggerAccessor.getLogger(
						context,
						WebSiteRequest.class.getName()
					).log(
						Level.SEVERE,
						"UploadedFile found, but owner doesn''t match: uf.getOwner()=\"{0}\", owner=\"{1}\".",
						new Object[] {
							uf.getOwner(),
							owner
						}
					);
				}
			}
			return null;
		}
	}

	@Override
	public File rename(File file) {
		try {
			while(true) {
				File newFile=new File(getFileUploadDirectory(getServletContext()), String.valueOf(getNextID()));
				if(!newFile.exists()) return newFile;
			}
		} catch(IOException err) {
			throw new WrappedException(err, new Object[] {"file.getPath()="+file.getPath()});
		}
	}

	/**
	 * Gets the person who is logged in or <code>null</code> if no login is performed for this request.
	 *
	 * @exception LoginException if an invalid login attempt is made or the user credentials are not found
	 */
	public WebSiteUser getWebSiteUser(HttpServletResponse resp) throws IOException, SQLException, LoginException {
		return null;
	}

	/**
	 * Determines if the user is currently logged in.
	 */
	public boolean isLoggedIn() throws IOException, SQLException {
		try {
			return getWebSiteUser(null)!=null;
		} catch(LoginException err) {
			return false;
		}
	}

	/**
	 * Logs out the current user or does nothing if not logged in.
	 */
	public void logout(HttpServletResponse resp) {
	}
762044
public static String printToUnicodeString(final UnknownFieldSet fields) {
    try {
      final StringBuilder text = new StringBuilder();
      UNICODE_PRINTER.printUnknownFields(fields, new TextGenerator(text));
      return text.toString();
    } catch (IOException e) {
      throw new IllegalStateException(e);
    }
  }