Converts the PX Record to a String
350805
String
rrToString() {
	StringBuffer sb = new StringBuffer();
	sb.append(preference);
	sb.append(" ");
	sb.append(map822);
	sb.append(" ");
	sb.append(mapX400);
	return sb.toString();
}
492068
def to_xml_string(str = '')
      str << '<?xml version="1.0" encoding="UTF-8"?>'
      str << ('<pivotCacheDefinition xmlns="' << XML_NS << '" xmlns:r="' << XML_NS_R << '" invalid="1" refreshOnLoad="1" recordCount="0">')
      str <<   '<cacheSource type="worksheet">'
      str << (    '<worksheetSource ref="' << pivot_table.range << '" sheet="' << pivot_table.data_sheet.name << '"/>')
      str <<   '</cacheSource>'
      str << (  '<cacheFields count="' << pivot_table.header_cells_count.to_s << '">')
      pivot_table.header_cells.each do |cell|
        str << (  '<cacheField name="' << cell.value << '" numFmtId="0">')
        str <<     '<sharedItems count="0">'
        str <<     '</sharedItems>'
        str <<   '</cacheField>'
      end
      str <<   '</cacheFields>'
      str << '</pivotCacheDefinition>'
    end
760037
def to_string(self):
        
        return '%s   %s %s %s %s' % (
            self.trait, self.start_position, self.peak_start_position,
            self.peak_stop_position, self.stop_position)
839937
def format(self, record):
        """"""
        if record.levelno == logging.DEBUG:
            string = Back.WHITE + Fore.BLACK + ' debug '
        elif record.levelno == logging.INFO:
            string = Back.BLUE + Fore.WHITE + ' info '
        elif record.levelno == logging.WARNING:
            string = Back.YELLOW + Fore.BLACK + ' warning '
        elif record.levelno == logging.ERROR:
            string = Back.RED + Fore.WHITE + ' error '
        elif record.levelno == logging.CRITICAL:
            string = Back.BLACK + Fore.WHITE + ' critical '
        else:
            string = ''
        return '{none}{string}{none} {super}'.format(
            none=Style.RESET_ALL, string=string, super=super().format(record))
1023204
def to_string(self):
        
        if self._string is None:
            tokens = []
            if self.name:
                if self.scale:
                    token = self.name + ':' + str(self.scale)
                else:
                    token = self.name
            else:
                token = ''  # Spacing element to indicate next string is a feature
            tokens.append(token)
            for label, value in self.features:
                if value is None:
                    token = label
                else:
                    token = label + ':' + str(value)
                tokens.append(token)
            tokens.append('')  # Spacing element to separate from next pipe character
            output = ' '.join(tokens)
            if self.cache_string:
                self._string = output
        else:
            output = self._string
        return output
285060
private void parseRecord(Integer recordNumber, Record record) throws MPXJException
   {
      switch (recordNumber.intValue())
      {
         case MPXConstants.PROJECT_NAMES_RECORD_NUMBER:
         case MPXConstants.DDE_OLE_CLIENT_LINKS_RECORD_NUMBER:
         case MPXConstants.COMMENTS_RECORD_NUMBER:
         {
            // silently ignored
            break;
         }

         case MPXConstants.CURRENCY_SETTINGS_RECORD_NUMBER:
         {
            populateCurrencySettings(record, m_projectFile.getProjectProperties());
            m_formats.update();
            break;
         }

         case MPXConstants.DEFAULT_SETTINGS_RECORD_NUMBER:
         {
            populateDefaultSettings(record, m_projectFile.getProjectProperties());
            m_formats.update();
            break;
         }

         case MPXConstants.DATE_TIME_SETTINGS_RECORD_NUMBER:
         {
            populateDateTimeSettings(record, m_projectFile.getProjectProperties());
            m_formats.update();
            break;
         }

         case MPXConstants.BASE_CALENDAR_RECORD_NUMBER:
         {
            m_lastBaseCalendar = m_projectFile.addCalendar();
            populateCalendar(record, m_lastBaseCalendar, true);
            break;
         }

         case MPXConstants.BASE_CALENDAR_HOURS_RECORD_NUMBER:
         {
            if (m_lastBaseCalendar != null)
            {
               ProjectCalendarHours hours = m_lastBaseCalendar.addCalendarHours();
               populateCalendarHours(record, hours);
            }

            break;
         }

         case MPXConstants.BASE_CALENDAR_EXCEPTION_RECORD_NUMBER:
         {
            if (m_lastBaseCalendar != null)
            {
               populateCalendarException(record, m_lastBaseCalendar);
            }

            break;
         }

         case MPXConstants.PROJECT_HEADER_RECORD_NUMBER:
         {
            populateProjectHeader(record, m_projectFile.getProjectProperties());
            m_formats.update();
            break;
         }

         case MPXConstants.RESOURCE_MODEL_TEXT_RECORD_NUMBER:
         {
            if ((m_resourceTableDefinition == false) && (m_ignoreTextModels == false))
            {
               m_resourceModel.update(record, true);
               m_resourceTableDefinition = true;
            }

            break;
         }

         case MPXConstants.RESOURCE_MODEL_NUMERIC_RECORD_NUMBER:
         {
            if (m_resourceTableDefinition == false)
            {
               m_resourceModel.update(record, false);
               m_resourceTableDefinition = true;
            }

            break;
         }

         case MPXConstants.RESOURCE_RECORD_NUMBER:
         {
            m_lastResource = m_projectFile.addResource();
            populateResource(m_lastResource, record);
            m_eventManager.fireResourceReadEvent(m_lastResource);
            break;
         }

         case MPXConstants.RESOURCE_NOTES_RECORD_NUMBER:
         {
            if (m_lastResource != null)
            {
               m_lastResource.setNotes(record.getString(0));
            }

            break;
         }

         case MPXConstants.RESOURCE_CALENDAR_RECORD_NUMBER:
         {
            if (m_lastResource != null)
            {
               m_lastResourceCalendar = m_lastResource.addResourceCalendar();
               populateCalendar(record, m_lastResourceCalendar, false);
            }

            break;
         }

         case MPXConstants.RESOURCE_CALENDAR_HOURS_RECORD_NUMBER:
         {
            if (m_lastResourceCalendar != null)
            {
               ProjectCalendarHours hours = m_lastResourceCalendar.addCalendarHours();
               populateCalendarHours(record, hours);
            }

            break;
         }

         case MPXConstants.RESOURCE_CALENDAR_EXCEPTION_RECORD_NUMBER:
         {
            if (m_lastResourceCalendar != null)
            {
               populateCalendarException(record, m_lastResourceCalendar);
            }

            break;
         }

         case MPXConstants.TASK_MODEL_TEXT_RECORD_NUMBER:
         {
            if ((m_taskTableDefinition == false) && (m_ignoreTextModels == false))
            {
               m_taskModel.update(record, true);
               m_taskTableDefinition = true;
            }

            break;
         }

         case MPXConstants.TASK_MODEL_NUMERIC_RECORD_NUMBER:
         {
            if (m_taskTableDefinition == false)
            {
               m_taskModel.update(record, false);
               m_taskTableDefinition = true;
            }

            break;
         }

         case MPXConstants.TASK_RECORD_NUMBER:
         {
            m_lastTask = m_projectFile.addTask();
            populateTask(record, m_lastTask);

            int outlineLevel = NumberHelper.getInt(m_lastTask.getOutlineLevel());

            if (m_baseOutlineLevel == -1)
            {
               m_baseOutlineLevel = outlineLevel;
            }

            if (outlineLevel != m_baseOutlineLevel)
            {
               List<Task> childTasks = m_projectFile.getChildTasks();
               if (childTasks.isEmpty() == true)
               {
                  throw new MPXJException(MPXJException.INVALID_OUTLINE);
               }
               childTasks.get(childTasks.size() - 1).addChildTask(m_lastTask, outlineLevel);
            }

            m_eventManager.fireTaskReadEvent(m_lastTask);
            break;
         }

         case MPXConstants.TASK_NOTES_RECORD_NUMBER:
         {
            if (m_lastTask != null)
            {
               m_lastTask.setNotes(record.getString(0));
            }

            break;
         }

         case MPXConstants.RECURRING_TASK_RECORD_NUMBER:
         {
            if (m_lastTask != null)
            {
               m_lastTask.setRecurring(true);
               RecurringTask task = m_lastTask.addRecurringTask();
               populateRecurringTask(record, task);
            }

            break;
         }

         case MPXConstants.RESOURCE_ASSIGNMENT_RECORD_NUMBER:
         {
            if (m_lastTask != null)
            {
               m_lastResourceAssignment = m_lastTask.addResourceAssignment((Resource) null);
               populateResourceAssignment(record, m_lastResourceAssignment);
            }

            break;
         }

         case MPXConstants.RESOURCE_ASSIGNMENT_WORKGROUP_FIELDS_RECORD_NUMBER:
         {
            if (m_lastResourceAssignment != null)
            {
               ResourceAssignmentWorkgroupFields workgroup = m_lastResourceAssignment.addWorkgroupAssignment();
               populateResourceAssignmentWorkgroupFields(record, workgroup);
            }

            break;
         }

         case MPXConstants.FILE_CREATION_RECORD_NUMBER:
         {
            populateFileCreationRecord(record, m_projectFile.getProjectProperties());
            break;
         }

         default:
         {
            throw new MPXJException(MPXJException.INVALID_RECORD);
         }
      }
   }
513095
def format(self, record):
        """"""
        # XXX: idea, colorize message arguments
        s = super(ANSIFormatter, self).format(record)
        if hasattr(self.context, 'ansi'):
            s = self.context.ansi(s, **self.get_sgr(record))
        return s
900034
def to_string(self):
        
        
        
        graph = list()
        
        if self.obj_dict.get('strict', None) is not None:
        
            if self==self.get_parent_graph() and self.obj_dict['strict']:
            
                graph.append('strict ')

        if self.obj_dict['name'] == '':
            if 'show_keyword' in self.obj_dict and self.obj_dict['show_keyword']:
                graph.append( 'subgraph {\n' )
            else:
                graph.append( '{\n' )
        else:
            graph.append( '%s %s {\n' % (self.obj_dict['type'], self.obj_dict['name']) )


        for attr in self.obj_dict['attributes'].iterkeys():
        
            if self.obj_dict['attributes'].get(attr, None) is not None:
       
                val = self.obj_dict['attributes'].get(attr)
                if val is not None:
                    graph.append( '%s=%s' % (attr, quote_if_necessary(val)) )
                else:
                    graph.append( attr )
                    
                graph.append( ';\n' )


        edges_done = set()
        
        edge_obj_dicts = list()
        for e in self.obj_dict['edges'].itervalues():
            edge_obj_dicts.extend(e)
            
        if edge_obj_dicts:
            edge_src_set, edge_dst_set = zip( *[obj['points'] for obj in edge_obj_dicts] )
            edge_src_set, edge_dst_set = set(edge_src_set), set(edge_dst_set)
        else:
            edge_src_set, edge_dst_set = set(), set()
            
        node_obj_dicts = list()
        for e in self.obj_dict['nodes'].itervalues():
            node_obj_dicts.extend(e)

        sgraph_obj_dicts = list()
        for sg in self.obj_dict['subgraphs'].itervalues():
            sgraph_obj_dicts.extend(sg)

        
        obj_list = [ (obj['sequence'], obj) for obj in (edge_obj_dicts + node_obj_dicts + sgraph_obj_dicts) ]
        obj_list.sort()
        
        for idx, obj in obj_list:
        
            if obj['type'] == 'node':

                node = Node(obj_dict=obj)
            
                if self.obj_dict.get('suppress_disconnected', False):
                
                    if (node.get_name() not in edge_src_set and
                        node.get_name() not in edge_dst_set):
                        
                        continue
                        
                graph.append( node.to_string()+'\n' )

            elif obj['type'] == 'edge':

                edge = Edge(obj_dict=obj)
                
                if self.obj_dict.get('simplify', False) and edge in edges_done:
                    continue
                
                graph.append( edge.to_string() + '\n' )
                edges_done.add(edge)
                
            else:
            
                sgraph = Subgraph(obj_dict=obj)
                
                graph.append( sgraph.to_string()+'\n' )

        graph.append( '}\n' )
        
        return ''.join(graph)
639057
function formatRecordToString(record, style) {
  const parts = [];

  if (record.displayName) {
    parts.push(style(['gray-light'], record.displayName));
  } else if (record.key) {
    parts.push(style(['gray-light'], record.key));
  }

  if (record.datetime) {
    parts.push(style(['gray', 'bold'], record.datetime.toTimeString().split(' ')[0]));
    /* new Date().toFormat('HH24:MI:SS') */
  }

  let message = record.symbol || levelToSymbol[record.level];
  const styles = record.styles || levelToStyles[record.level];

  if (record.message) {
    if (message) {
      message += ` ${record.message}`;
    } else {
      message = record.message;
    }
  }

  if (message) {
    if (styles) {
      message = style(styles, message);
    }

    parts.push(message);
  }

  const formatRecordObject = function formatRecordObject(key, object, styles) {
    if (!object) {
      return;
    }

    const stringObject = formatObject(object, style, styles);

    if (!stringObject) {
      return;
    }

    parts.push(stringObject);
  };

  formatRecordObject('metadata', record.metadata, record.metadataStyles);
  formatRecordObject('extra', record.extra, undefined);
  formatRecordObject('context', record.context, undefined);
  return parts.join(' ');
}
107429
def format(self, record):
        """"""
        data = record.__dict__.copy()

        data['data_id'] = DATA['id']
        data['data_location_id'] = DATA_LOCATION['id']
        data['hostname'] = socket.gethostname()

        # Get relative path, so listener can reconstruct the path to the actual code.
        data['pathname'] = os.path.relpath(data['pathname'], os.path.dirname(__file__))

        # Exception and Traceback cannot be serialized.
        data['exc_info'] = None

        # Ensure logging message is instantiated to a string.
        data['msg'] = str(data['msg'])

        return json.dumps(data)
76019
def _serialize_info(self, record):
        """"""
        result = []
        for key, value in record.INFO.items():
            info = self.header.get_info_field_info(key)
            if info.type == "Flag":
                result.append(key)
            else:
                result.append("{}={}".format(key, format_value(info, value, "INFO")))
        return ";".join(result)
1315758
def stringify(self):
        
        hexcode = "#"
        for x in self.value:
            part = hex(x)[2:]
            if len(part) < 2: part = "0" + part
            hexcode += part
        return hexcode
1191142
function (record, index) {
		var locationField = this.options.codeField;
		var fieldValue = L.Util.getFieldValue(record, locationField);
		var context = {};
		var location;

		context[fieldValue] = record;

		if (this.options.getLocation) {

			var self = this;
			var callback = function (key, location) {
				self.locationToLayer(location, context[key]);
			};

			location = this.options.getLocation(context, locationField, [fieldValue], callback);
		}

		return location;
	}
551328
private boolean processRecord(List<String> record) throws MPXJException
   {
      boolean done = false;

      XerRecordType type = RECORD_TYPE_MAP.get(record.get(0));
      if (type == null)
      {
         throw new MPXJException(MPXJException.INVALID_FORMAT);
      }

      switch (type)
      {
         case HEADER:
         {
            processHeader(record);
            break;
         }

         case TABLE:
         {
            m_currentTableName = record.get(1).toLowerCase();
            m_skipTable = !REQUIRED_TABLES.contains(m_currentTableName);
            if (m_skipTable)
            {
               m_currentTable = null;
            }
            else
            {
               m_currentTable = new LinkedList<Row>();
               m_tables.put(m_currentTableName, m_currentTable);
            }
            break;
         }

         case FIELDS:
         {
            if (m_skipTable)
            {
               m_currentFieldNames = null;
            }
            else
            {
               m_currentFieldNames = record.toArray(new String[record.size()]);
               for (int loop = 0; loop < m_currentFieldNames.length; loop++)
               {
                  m_currentFieldNames[loop] = m_currentFieldNames[loop].toLowerCase();
               }
            }
            break;
         }

         case DATA:
         {
            if (!m_skipTable)
            {
               Map<String, Object> map = new HashMap<String, Object>();
               for (int loop = 1; loop < record.size(); loop++)
               {
                  String fieldName = m_currentFieldNames[loop];
                  String fieldValue = record.get(loop);
                  XerFieldType fieldType = FIELD_TYPE_MAP.get(fieldName);
                  if (fieldType == null)
                  {
                     fieldType = XerFieldType.STRING;
                  }

                  Object objectValue;
                  if (fieldValue.length() == 0)
                  {
                     objectValue = null;
                  }
                  else
                  {
                     switch (fieldType)
                     {
                        case DATE:
                        {
                           try
                           {
                              objectValue = m_df.parseObject(fieldValue);
                           }

                           catch (ParseException ex)
                           {
                              objectValue = fieldValue;
                           }

                           break;
                        }

                        case CURRENCY:
                        case DOUBLE:
                        case DURATION:
                        {
                           try
                           {
                              objectValue = Double.valueOf(m_numberFormat.parse(fieldValue.trim()).doubleValue());
                           }

                           catch (ParseException ex)
                           {
                              objectValue = fieldValue;
                           }
                           break;
                        }

                        case INTEGER:
                        {
                           objectValue = Integer.valueOf(fieldValue.trim());
                           break;
                        }

                        default:
                        {
                           objectValue = fieldValue;
                           break;
                        }
                     }
                  }

                  map.put(fieldName, objectValue);
               }

               Row currentRow = new MapRow(map);
               m_currentTable.add(currentRow);

               //
               // Special case - we need to know the default currency format
               // ahead of time, so process each row as we get it so that
               // we can correctly parse currency values in later tables.
               //
               if (m_currentTableName.equals("currtype"))
               {
                  processCurrency(currentRow);
               }
            }
            break;
         }

         case END:
         {
            done = true;
            break;
         }

         default:
         {
            break;
         }
      }

      return done;
   }
408809
def format(self, record):
        
        level_length = len(record.levelname)
        if record.levelname in self._colors_map:
            record.msg = '{0}{1}\033[0;0m'.format(
                self._colors_map[record.levelname],
                record.msg
            )
            record.levelname = '{0}{1}\033[0;0m'.format(
                self._colors_map[record.levelname],
                record.levelname
            )
        record.levelname += ' ' * (8 - level_length)
        record.name = '\033[37m\033[1m{0}\033[0;0m'.format(record.name)
        return super(ColorFormatter, self).format(record)
887895
def serialize(self, pid, record, links_factory=None, **kwargs):
        
        return json.dumps(
            self.transform_record(pid, record, links_factory, **kwargs),
            **self._format_args())
313265
def int_to_string( x ):
  """"""
  assert x >= 0
  if x == 0: return b('\0')
  result = []
  while x:
    ordinal = x & 0xFF
    result.append(int2byte(ordinal))
    x >>= 8

  result.reverse()
  return b('').join(result)