Returns a left-padded list.
501034
public List<MetricData> getData(int span) {
        int count = span / period;
        if (dataList.size() < count) {
            if (dataList.isEmpty()) {
                return dataList;
            }
            else {
                // left-pad
                List<MetricData> padded = new ArrayList<>(dataList);
                MetricData first = dataList.get(0);
                List<Metric> pads = new ArrayList<>();
                for (Metric metric : first.getMetrics()) {
                    pads.add(new Metric(metric.getId(), metric.getName(), 0));
                }
                LocalDateTime time = first.getTime();
                while (padded.size() < count) {
                    time = time.minusSeconds(period);
                    padded.add(0, new MetricData(time, pads));
                }
                return padded;
            }
        }
        else {
            return dataList.subList(dataList.size() - count, dataList.size() - 1);
        }
    }
988923
def itemlist(item, sep, suppress_trailing=True):
    """"""
    return condense(item + ZeroOrMore(addspace(sep + item)) + Optional(sep.suppress() if suppress_trailing else sep))
182603
def strSlist(string):
    
    sign = '-' if string[0] == '-' else '+'
    values = [abs(int(x)) for x in string.split(':')]
    return _fixSlist(list(sign) + values)
659841
def chunk_list(list_, size):
    
    ll = len(list_)
    if ll <= size:
        return [list_]
    elif size == 0:
        return list_ # or None ??
    elif size == 1:
        return [[l] for l in list_]
    else:
        chunks = []
        for start, stop in zip(range(0, ll, size), range(size, ll, size)):
            chunks.append(list_[start:stop])
        chunks.append(list_[stop:])  # snag unaligned chunks from last stop
        return chunks
167266
def shape_list(l,shape,dtype):
    
    return np.array(l, dtype=dtype).reshape(shape)
102160
def iter_left_col_tcs(self):
        """"""
        col_idx = self._left
        for tr in self._tbl.tr_lst[self._top:self._bottom]:
            yield tr.tc_lst[col_idx]
292926
def byte_list_to_u16le_list(byteData):
    """"""
    data = []
    for i in range(0, len(byteData), 2):
        data.append(byteData[i] | (byteData[i + 1] << 8))
    return data
772331
def list():
        """"""
        handle = winreg.ConnectRegistry(None, winreg.HKEY_LOCAL_MACHINE)
        tzkey = winreg.OpenKey(handle, TZKEYNAME)
        result = [winreg.EnumKey(tzkey, i)
                  for i in range(winreg.QueryInfoKey(tzkey)[0])]
        tzkey.Close()
        handle.Close()
        return result
632527
def items(self):
        """"""
        result = [(key, self._mapping[key]) for key in list(self._queue)]
        result.reverse()
        return result
306701
def camelcase2list(s, lower=False):
    """"""
    s = re.findall(r'([A-Z][a-z0-9]+)', s)
    return [w.lower() for w in s] if lower else s
527815
def list(cls, name, parent=None, interleave=None):
        """"""
        node = cls.leaf_list(name, parent, interleave=interleave)
        node.keys = []
        node.keymap = {}
        return node
1206971
def _list_lstrip(self, L, val=0):
        ''''''
        for i in _range(len(L)):
            if L[i] != val:
                return L[i:]
1341170
def list(self):
        """"""
        service = self._service

        lxc_names = service.list_names()
        lxc_list = []
        for name in lxc_names:
            lxc = self.get(name)
            lxc_list.append(lxc)
        return lxc_list
929726
def I(self):
        

        """
        return list(set(range(self.nstates)) - set(self._A) - set(self._B))
74139
def build_list(self):
        """"""
        ret = []
        for p in self.args.stdout.split(','):
            if '.' in p:
                p, a = p.split('.')
            else:
                a = None
            ret.append((p, a))
        return ret
335750
def lzs (inlist):
    
    zscores = []
    for item in inlist:
        zscores.append(z(inlist,item))
    return zscores
1125695
def slicelist(b):
    """"""

    slicelst = []
    started = False
    for i, e in enumerate(b):
        if e and not started:
            start = i
            started = True
        elif not e and started:
            slicelst.append(slice(start, i))
            started = False

    if e:
        slicelst.append(slice(start, i + 1))  # True in the end.

    return slicelst