Returns the report list and removed: Altimeter string, Icing list, Turbulance list
430598
def get_taf_alt_ice_turb(wxdata: [str]) -> ([str], str, [str], [str]):  # type: ignore
    
    altimeter = ''
    icing, turbulence = [], []
    for i, item in reversed(list(enumerate(wxdata))):
        if len(item) > 6 and item.startswith('QNH') and item[3:7].isdigit():
            altimeter = wxdata.pop(i)[3:7]
        elif item.isdigit():
            if item[0] == '6':
                icing.append(wxdata.pop(i))
            elif item[0] == '5':
                turbulence.append(wxdata.pop(i))
    return wxdata, altimeter, icing, turbulence
815199
def _get_adj_list_directional(self, umis, counts):
        ''' '''

        adj_list = {umi: [] for umi in umis}

        if self.fuzzy_match:
            for umi1 in umis:
                # we need a second regex for some insertions,
                # e.g UMI1 = "ATCG", UMI2 = "ATTC"
                comp_regex_err = regex.compile("(%s){e<=1}" % str(umi1))
                comp_regex_del = regex.compile("(%s){i<=1}" % str(umi1)[::-1])
                for umi2 in umis:
                    if umi1 == umi2:
                        continue
                    if counts[umi1] >= (counts[umi2]*self.dir_threshold):
                        if (max(len(umi1), len(umi2)) -
                            min(len(umi1), len(umi2))) > 1:
                            continue
                        if (comp_regex_err.match(str(umi2)) or
                            comp_regex_del.match(str(umi2))):
                            adj_list[umi1].append(umi2)
        else:
            for umi1, umi2 in itertools.combinations(umis, 2):
                if edit_distance(umi1, umi2) <= 1:
                    if counts[umi1] >= (counts[umi2]*2)-1:
                        adj_list[umi1].append(umi2)
                    if counts[umi2] >= (counts[umi1]*2)-1:
                        adj_list[umi2].append(umi1)

        return adj_list
706116
def get_report(self):
    
    ostr = ''
    ostr += "Nodes: "+str(len(self.__nodes.keys()))+"\n"
    ostr += "Edges: "+str(len(self.__edges.keys()))+"\n"
    return ostr
1235404
def GetString(self):
    
    string_list = []
    string_list.append('Report generated from: {0:s}'.format(self.plugin_name))

    time_compiled = getattr(self, 'time_compiled', 0)
    if time_compiled:
      time_compiled = timelib.Timestamp.CopyToIsoFormat(time_compiled)
      string_list.append('Generated on: {0:s}'.format(time_compiled))

    filter_string = getattr(self, 'filter_string', '')
    if filter_string:
      string_list.append('Filter String: {0:s}'.format(filter_string))

    string_list.append('')
    string_list.append('Report text:')
    string_list.append(self.text)

    return '\n'.join(string_list)
322878
def shared(wxdata: ReportData, units: Units) -> typing.Dict[str, str]:
    
    translations = {}
    translations['visibility'] = visibility(wxdata.visibility, units.visibility)  # type: ignore
    translations['altimeter'] = altimeter(wxdata.altimeter, units.altimeter)  # type: ignore
    translations['clouds'] = clouds(wxdata.clouds, units.altitude)  # type: ignore
    translations['other'] = other_list(wxdata.other)  # type: ignore
    return translations
1002425
def list_():
    '''
    
    '''

    result = __salt__['cmd.run']('tuned-adm list').splitlines()
    # Remove "Available profiles:"
    result.pop(0)
    # Remove "Current active profile:.*"
    result.pop()
    # Output can be : " - <profile name> - <description>" (v2.7.1)
    # or " - <profile name> " (v2.4.1)
    result = [i.split('- ')[1].strip() for i in result]
    return result
1241217
function _cleanArrivals(results) {
    // List of Arrivals to Keep
    let arrivals = [];

    // Get unique arrivals
    let arrivalTimes = [];
    for ( let i = 0; i < results.length; i++ ) {
      if ( arrivalTimes.indexOf(results[i].destination.arrival.toTimestamp()) === -1 ) {
        arrivalTimes.push(results[i].destination.arrival.toTimestamp());
      }
    }

    // Pick best Trip for each arrival
    for ( let i = 0; i < arrivalTimes.length; i++ ) {
      let arrivalTime = arrivalTimes[i];
      let arrival = undefined;

      // Get Trips with arrival time
      for ( let j = 0; j < results.length; j++ ) {
        let result = results[j];
        if ( result.destination.arrival.toTimestamp() === arrivalTime ) {
          if ( arrival === undefined )  {
            arrival = result;
          }
          else if ( result.origin.departure.toTimestamp() > arrival.origin.departure.toTimestamp() ) {
            arrival = result;
          }
          else if ( result.origin.departure.toTimestamp() === arrival.origin.departure.toTimestamp() && result.length < arrival.length ) {
            arrival = result;
          }
        }
      }

      // Add arrival to list
      arrivals.push(arrival);

    }

    // Return arrivals
    return arrivals;
  }
566617
def get_report(self):
        

        lines = [super(InvalidUtterancesResult, self).get_report()]

        if len(self.invalid_utterances) > 0:
            lines.append('\nInvalid utterances:')

            sorted_items = sorted(self.invalid_utterances.items(), key=lambda x: x[0])
            lines.extend(['    * {} ({})'.format(x, y) for x, y in sorted_items])

        return '\n'.join(lines)
1337072
def get_list_filter(self, request):
        
        list_filter = super(VersionedAdmin, self).get_list_filter(request)
        return list(list_filter) + [('version_start_date', DateTimeFilter),
                                    IsCurrentFilter]
1081347
def pretty_list(rtlst, header, sortBy=0, borders=False):
    """"""
    if borders:
        _space = "|"
    else:
        _space = "  "
    # Windows has a fat terminal border
    _spacelen = len(_space) * (len(header) - 1) + (10 if WINDOWS else 0)
    _croped = False
    # Sort correctly
    rtlst.sort(key=lambda x: x[sortBy])
    # Append tag
    rtlst = header + rtlst
    # Detect column's width
    colwidth = [max([len(y) for y in x]) for x in zip(*rtlst)]
    # Make text fit in box (if required)
    width = get_terminal_width()
    if conf.auto_crop_tables and width:
        width = width - _spacelen
        while sum(colwidth) > width:
            _croped = True
            # Needs to be cropped
            # Get the longest row
            i = colwidth.index(max(colwidth))
            # Get all elements of this row
            row = [len(x[i]) for x in rtlst]
            # Get biggest element of this row: biggest of the array
            j = row.index(max(row))
            # Re-build column tuple with the edited element
            t = list(rtlst[j])
            t[i] = t[i][:-2] + "_"
            rtlst[j] = tuple(t)
            # Update max size
            row[j] = len(t[i])
            colwidth[i] = max(row)
    if _croped:
        log_runtime.info("Table cropped to fit the terminal (conf.auto_crop_tables==True)")  # noqa: E501
    # Generate padding scheme
    fmt = _space.join(["%%-%ds" % x for x in colwidth])
    # Append separation line if needed
    if borders:
        rtlst.insert(1, tuple("-" * x for x in colwidth))
    # Compile
    rt = "\n".join(((fmt % x).strip() for x in rtlst))
    return rt
254694
def environment_list(self, io_handler):
        
        # Head of the table
        headers = ("Environment Variable", "Value")

        # Lines
        lines = [item for item in os.environ.items()]

        # Sort lines
        lines.sort()

        # Print the table
        io_handler.write(self._utils.make_table(headers, lines))
824515
def taf_line(line: TafLineData, units: Units) -> str:
    
    speech = []
    start = type_and_times(line.type, line.start_time, line.end_time, line.probability)
    if line.wind_direction and line.wind_speed:
        speech.append(wind(line.wind_direction, line.wind_speed,
                           line.wind_gust, unit=units.wind_speed))
    if line.wind_shear:
        speech.append(wind_shear(line.wind_shear, units.altimeter, units.wind_speed))
    if line.visibility:
        speech.append(visibility(line.visibility, units.visibility))
    if line.altimeter:
        speech.append(altimeter(line.altimeter, units.altimeter))
    if line.other:
        speech.append(other(line.other))
    speech.append(translate.clouds(line.clouds,
                                   units.altitude).replace(' - Reported AGL', ''))
    if line.turbulance:
        speech.append(translate.turb_ice(line.turbulance, units.altitude))
    if line.icing:
        speech.append(translate.turb_ice(line.icing, units.altitude))
    return start + ' ' + ('. '.join([l for l in speech if l])).replace(',', '.')
629972
def result_tree_list(cl):
    
    import django
    result = {
        'cl': cl,
        'result_headers': list(result_headers(cl)),
        'results': list(tree_results(cl))
    }
    if django.VERSION[0] == 1 and django.VERSION[1] > 2:
        from django.contrib.admin.templatetags.admin_list import result_hidden_fields
        result['result_hidden_fields'] = list(result_hidden_fields(cl))
    return result
1223608
def report(self):
        
        aggregations = dict(
            (test, Counter().rollup(values))
            for test, values in self.socket_warnings.items()
        )
        total = sum(
            len(warnings)
            for warnings in self.socket_warnings.values()
        )

        def format_test_statistics(test, counter):
            return "%s:\n%s" % (
                test,
                '\n'.join(
                    '  - %s: %s' % (socket, count)
                    for socket, count in counter.items()
                )
            )

        def format_statistics(aggregations):
            return '\n'.join(
                format_test_statistics(test, counter)
                for test, counter in aggregations.items()
            )

        # Only print the report if there are actually things to report.
        if aggregations:
            print('=' * 70, file=self.stream)
            print(
                'NON-WHITELISTED SOCKETS OPENED: %s' % total,
                file=self.stream,
            )
            print('-' * 70, file=self.stream)
            print(format_statistics(aggregations), file=self.stream)
35120
def list_():
    '''
    
    '''
    mdata = _check_mdata_list()
    if mdata:
        cmd = '{0}'.format(mdata)
        return __salt__['cmd.run'](cmd, ignore_retcode=True).splitlines()
    return {}
60284
def sct_report_string(report):
    
    ret = []
    namespaces = {"svrl": "http://purl.oclc.org/dsdl/svrl"}
    for index, failed_assert_el in enumerate(
        report.findall("svrl:failed-assert", namespaces=namespaces)
    ):
        ret.append(
            "{}. {}".format(
                index + 1,
                failed_assert_el.find("svrl:text", namespaces=namespaces).text,
            )
        )
        ret.append("   test: {}".format(failed_assert_el.attrib["test"]))
        ret.append("   location: {}".format(failed_assert_el.attrib["location"]))
        ret.append("\n")
    return "\n".join(ret)
91338
def removePublicReport(self):
        """"""

        response = self.pingdom.request('DELETE',
                                        'reports.public/%s' % self.id)
        return response.json()['message']