:type nums: List[int]
    :rtype: int
177893
def max_product(nums):
    
    lmin = lmax = gmax = nums[0]
    for i in range(len(nums)):
        t1 = nums[i] * lmax
        t2 = nums[i] * lmin
        lmax = max(max(t1, t2), nums[i])
        lmin = min(min(t1, t2), nums[i])
        gmax = max(gmax, lmax)
550232
def right(self, num=None):
        
        if num == None:
            return self.last.node
        if num <= 0:
            return []

        if not self.list:
            self._build_list()
        return self.list[-num:]
967273
def get_num_names( self, include_expired=False ):
        
        cur = self.db.cursor()
        return namedb_get_num_names( cur, self.lastblock, include_expired=include_expired )
1332588
def numToDigits(num, places):
    
    s = str(num)
    if len(s) < places:
        return ("0" * (places - len(s))) + s
    elif len(s) > places:
        return s[len(s)-places: ]
    else:
        return s
655965
def nb_to_q_nums(nb) -> list:
    
    def q_num(cell):
        assert cell.metadata.tags
        return first(filter(lambda t: 'q' in t, cell.metadata.tags))

    return [q_num(cell) for cell in nb['cells']]
1361912
def _num_values(self, zVar, varNum):
        '''
        
        '''
        values = 1
        if (zVar == True):
            numDims = self.zvarsinfo[varNum][2]
            dimSizes = self.zvarsinfo[varNum][3]
            dimVary = self.zvarsinfo[varNum][4]
        else:
            numDims = self.rvarsinfo[varNum][2]
            dimSizes = self.rvarsinfo[varNum][3]
            dimVary = self.rvarsinfo[varNum][4]
        if (numDims < 1):
            return values
        else:
            for x in range(0, numDims):
                if (zVar == True):
                    values = values * dimSizes[x]
                else:
                    if (dimVary[x] != 0):
                        values = values * dimSizes[x]
            return values
1095548
def add(self, num):
        
        try:
            val = self.value() + num
        except:
            val = num
        self.set(max(0, val))
397548
def to_int_list(values):
    """"""
    results = []
    for v in values:
        try:
            results.append(int(v))
        except (TypeError, ValueError):
            results.append(0)
    return results
1164397
def visit_Num(self, node: AST, dfltChaining: bool = True) -> str:
        """"""
        return str(node.n)
483304
def _next_numId(self):
        
        numId_strs = self.xpath('./w:num/@w:numId')
        num_ids = [int(numId_str) for numId_str in numId_strs]
        for num in range(1, len(num_ids)+2):
            if num not in num_ids:
                break
        return num
1102827
def not_right(self, num):
        
        if num == None:
            return FlatList([_get_list(self)[:-1:]])
        if num <= 0:
            return FlatList.EMPTY

        return FlatList(_get_list(self)[:-num:])
929158
def try_fix_num(n):
    
    if not n.isdigit():
        return n
    if n.startswith("0"):
        n = n.lstrip("0")
    if not n:
        n = "0"
    return int(n)
572497
def num(self, num, h=None, to_x=None, format="%.2f", change_style=None, change_size=None):
        
        self.txt(format % num, h=h, to_x=to_x, change_style=change_style, change_size=change_size)
1346532
def parse_int_list(s):
    
    result = []
    for item in s.split(','):
        item = item.strip().split('-')
        if len(item) == 1:
            result.append(int(item[0]))
        elif len(item) == 2:
            start, end = item
            result.extend(range(int(start), int(end)+1))
        else:
            raise ValueError("invalid range: '{0}'".format(s))
    return result
273209
def values(self):
        
        return [
            (
                np.array(dim.numeric_values)
                if (dim.numeric_values and any(~np.isnan(dim.numeric_values)))
                else None
            )
            for dim in self._slice.dimensions
        ]
399605
def strnumlist(prefix: str, numbers: List[int], suffix: str = "") -> List[str]:
    
    return ["{}{}{}".format(prefix, num, suffix) for num in numbers]
1112984
def _write_num_zeros(self)->None:
        ""
        gradient_nps = [to_np(x.data) for x in self.gradients]
        num_zeros = sum((np.asarray(x) == 0.0).sum() for x in gradient_nps)
        self._add_gradient_scalar('num_zeros', scalar_value=num_zeros)