Return the textual representation of an :class:`~taxi.timesheet.lines.Entry` instance. This method is a bit
        convoluted since we don't want to completely mess up the original formatting of the entry.
18794
def entry_line_to_text(self, entry):
        
        line = []

        # The entry is new, it didn't come from an existing line, so let's just return a simple text representation of
        # it
        if not entry._text:
            flags_text = self.flags_to_text(entry.flags)
            duration_text = self.duration_to_text(entry.duration)

            return ''.join(
                (flags_text, ' ' if flags_text else '', entry.alias, ' ', duration_text, ' ', entry.description)
            )

        for i, text in enumerate(entry._text):
            # If this field is mapped to an attribute, check if it has changed
            # and, if so, regenerate its text. The only fields that are not
            # mapped to attributes are spacing fields
            if i in self.ENTRY_ATTRS_POSITION:
                if self.ENTRY_ATTRS_POSITION[i] in entry._changed_attrs:
                    attr_name = self.ENTRY_ATTRS_POSITION[i]
                    attr_value = getattr(entry, self.ENTRY_ATTRS_POSITION[i])

                    # Some attributes need to be transformed to their textual representation, such as flags or duration
                    if attr_name in self.ENTRY_ATTRS_TRANSFORMERS:
                        attr_value = getattr(self, self.ENTRY_ATTRS_TRANSFORMERS[attr_name])(attr_value)
                else:
                    attr_value = text

                line.append(attr_value)
            else:
                # If the length of the field has changed, do whatever we can to keep the current formatting (ie. number
                # of whitespaces)
                if len(line[i-1]) != len(entry._text[i-1]):
                    text = ' ' * max(1, (len(text) - (len(line[i-1]) - len(entry._text[i-1]))))

                line.append(text)

        return ''.join(line).strip()
232442
def _line_to_entry(self,line):
    """"""
    f = line.rstrip().split("\t")
    """
    'chrom'
    'chromStart'
    'chromEnd'
    'name'
    'score'
    'strand'
    'thickStart'
    'thickEnd'
    'itemRgb'
    'blockCount'
    'blockSizes'
    'blockStarts'
    """
    return Bed12Fields(
       f[0],
       int(f[1]),
       int(f[2]),
       f[3],
       int(f[4]),
       f[5],
       int(f[6]),
       int(f[7]),
       [int(x) for x in f[8].rstrip(',').split(',')],
       int(f[9]),
       [int(x) for x in f[10].rstrip(',').split(',')],
       [int(x) for x in f[11].rstrip(',').split(',')])
193805
def toc(tt, return_msg=False, write_msg=True, verbose=None):
    
    if verbose is not None:
        write_msg = verbose
    (msg, start_time) = tt
    ellapsed = (default_timer() - start_time)
    if (not return_msg) and write_msg and msg is not None:
        sys.stdout.write('...toc(%.4fs, ' % ellapsed + '"' + str(msg) + '"' + ')\n')
    if return_msg:
        return msg
    else:
        return ellapsed
604047
def _SerializeEntries(entries):
  """"""

  output = []
  for python_format, wire_format, type_descriptor in entries:

    if wire_format is None or (python_format and
                               type_descriptor.IsDirty(python_format)):
      wire_format = type_descriptor.ConvertToWireFormat(python_format)

    precondition.AssertIterableType(wire_format, bytes)
    output.extend(wire_format)

  return b"".join(output)
1188856
def entry_lines(file)
      entries = []
      ::Zip::ZipFile.foreach(file) do |zentry|
        entries << zentry
      end
      entries
    end
95906
def str_def(self):
        
        return "classname={!r}; line={!r}; column={!r}; message={!r};". \
            format(self.__class__.__name__, self.line, self.column,
                   self.args[0])
743921
def inline(self) -> str:
        
        return "{0}:{1}:{2}:{3}".format(self.pubkey_from, self.pubkey_to,
                                        self.timestamp.number, self.signatures[0])
122148
def parse_line(line: str, char_index=0) -> Tuple[ListingType, str]:
    """"""

    entry_name = str.rpartition(line, ' ')[-1]
    entry_type = LISTING_FLAG_MAP.get(line[char_index], ListingType.other)
    return entry_type, entry_name
195773
def get(self, entry):
        
        try:
            output = yield utils.getProcessOutput(
                "pass",
                args=[entry],
                env=self._env
            )
            return output.decode("utf-8", "ignore").splitlines()[0]
        except IOError:
            return None
1341427
def _parse_transaction_entry(entry):
    
    parts = entry.split()

    date_string = parts[0]
    try:
        date = datetime.datetime.strptime(date_string[:-1], '%Y-%m-%d').date()
    except ValueError:
        raise ValueError('Invalid date in vacationrc for entry: {}'.format(entry))

    if len(parts) < 2:
        raise ValueError('.vacationrc missing an action for entry: {}'.format(entry))
    action = parts[1].lower()
    if action not in ('days', 'rate', 'off', 'adjust', 'show'):
        raise ValueError('Invalid action in vacationrc for entry: {}'.format(entry))

    try:
        value = float(parts[2])
    except IndexError:
        value = None
    except (ValueError, TypeError):
        raise ValueError('Invalid value in vacationrc for entry: {}'.format(entry))

    return (date, action, value)
1158370
def get_log_entry_mdata():
    """"""
    return {
        'priority': {
            'element_label': {
                'text': 'priority',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.type.Type object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_type_values': ['NoneType%3ANONE%40dlkit.mit.edu'],
            'syntax': 'TYPE',
            'type_set': [],
        },
        'timestamp': {
            'element_label': {
                'text': 'timestamp',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'enter a valid datetime object.',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_date_time_values': [MIN_DATETIME],
            'syntax': 'DATETIME',
            'date_time_set': []
        },
        'agent': {
            'element_label': {
                'text': 'agent',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'instructions': {
                'text': 'accepts an osid.id.Id object',
                'languageTypeId': str(DEFAULT_LANGUAGE_TYPE),
                'scriptTypeId': str(DEFAULT_SCRIPT_TYPE),
                'formatTypeId': str(DEFAULT_FORMAT_TYPE),
            },
            'required': False,
            'read_only': False,
            'linked': False,
            'array': False,
            'default_id_values': [''],
            'syntax': 'ID',
            'id_set': [],
        },
    }
1299644
def _script_to_har_entry(cls, script, url):
        '''  '''
        entry = {
            'request': {'url': url},
            'response': {'url': url, 'content': {'text': script}}
        }

        cls._set_entry_type(entry, INLINE_SCRIPT_ENTRY)

        return entry
1087284
def _get_long_description(self):
        

        if self.description is None:
            return None

        lines = [x for x in self.description.split('\n')]
        if len(lines) == 1:
            return None

        elif len(lines) >= 3 and lines[1] == '':
            return '\n'.join(lines[2:])

        return self.description
1304918
def text(self):
        
        return self.template.format(name=self.name, type=self.type)
1008508
def get_entry_text(self, fname):
        """"""
        if fname.split('.')[-1] == 'gz':
            with gz.open(fname, 'rt') as f:
                filetext = f.read()
        else:
            with codecs.open(fname, 'r') as f:
                filetext = f.read()
        return filetext
465102
def to_representation(self, failure_line):
        
        try:
            matches = failure_line.error.matches.all()
        except AttributeError:  # failure_line.error can return None
            matches = []
        tle_serializer = TextLogErrorMatchSerializer(matches, many=True)

        classified_failures = models.ClassifiedFailure.objects.filter(error_matches__in=matches)
        cf_serializer = ClassifiedFailureSerializer(classified_failures, many=True)

        response = super().to_representation(failure_line)
        response['matches'] = tle_serializer.data
        response['classified_failures'] = cf_serializer.data
        return response
916958
def entries(self):
        
        entries_list = self._timesheets_callback('entries')()

        return reduce(lambda x, y: x + y, entries_list)