:type A: List[List[int]]
    :type B: List[List[int]]
    :rtype: List[List[int]]
330087
def multiply(multiplicand: list, multiplier: list) -> list:
    
    multiplicand_row, multiplicand_col = len(
        multiplicand), len(multiplicand[0])
    multiplier_row, multiplier_col = len(multiplier), len(multiplier[0])
    if(multiplicand_col != multiplier_row):
        raise Exception(
            "Multiplicand matrix not compatible with Multiplier matrix.")
    # create a result matrix
    result = [[0] * multiplier_col for i in range(multiplicand_row)]
    for i in range(multiplicand_row):
        for j in range(multiplier_col):
            for k in range(len(multiplier)):
                result[i][j] += multiplicand[i][k] * multiplier[k][j]
    return result
926185
def _get_recursive_difference(self, type):
        ''''''
        if type == 'intersect':
            return [recursive_diff(item['old'], item['new']) for item in self._intersect]
        elif type == 'added':
            return [recursive_diff({}, item) for item in self._added]
        elif type == 'removed':
            return [recursive_diff(item, {}, ignore_missing_keys=False)
                    for item in self._removed]
        elif type == 'all':
            recursive_list = []
            recursive_list.extend([recursive_diff(item['old'], item['new']) for item in self._intersect])
            recursive_list.extend([recursive_diff({}, item) for item in self._added])
            recursive_list.extend([recursive_diff(item, {},
                                                  ignore_missing_keys=False)
                                   for item in self._removed])
            return recursive_list
        else:
            raise ValueError('The given type for recursive list matching '
                             'is not supported.')
1357960
def difference(a: Iterable[Any], b: Container[Any]) -> List[Any]:
    
    d = []
    for item in a:
        if item not in b:
            d.append(item)
    return d
787939
def asym_list_diff(list1, list2):
    
    diff_list = []
    for item in list1:
        if not item in list2:
            diff_list.append(item)
    return diff_list
488530
def as_list(self):
        
        if hasattr(self, 'cust_list'):
            return self.cust_list
        if hasattr(self, 'attr_check'):
            self.attr_check()
        cls_bltns = set(dir(self.__class__))
        ret = [a for a in dir(self) if a not in cls_bltns and getattr(self, a)]
        return ret
784924
def complist(self):
        
        ans = []
        for comp in (self.component1, self.component2):
            try:
                ans.extend(comp.complist())
            except AttributeError:
                ans.append(comp)
        return ans
647971
def writeList(self, a):
        
        if self.writeReference(a) != -1:
            return

        self.context.addObject(a)

        self.writeType(TYPE_ARRAY)
        self.stream.write_ulong(len(a))

        for data in a:
            self.writeElement(data)
847079
def shape2d(a):
    
    if type(a) == int:
        return [a, a]
    if isinstance(a, (list, tuple)):
        assert len(a) == 2
        return list(a)
    raise RuntimeError("Illegal shape: {}".format(a))
128274
def list_and_add(a, b):
    
    if not isinstance(b, list):
        b = [b]
    if not isinstance(a, list):
        a = [a]
    return a + b
872706
def convert_type_list_elements(
    list_object  = None,
    element_type = str
    ):
    
    if element_type is str:
        return [str(element) if not isinstance(element, list) else convert_type_list_elements(
            list_object  = element,
            element_type = str
        ) for element in list_object]
659344
def p_array_type(self, p):
        ''''''
        if len(p) == 2:
            p[0] = p[1][0],
        elif len(p) == 5 and p[4] == ']':
            def args(t):
                return t.__args__ if isinstance(t, NDArray) else (t,)
            p[0] = tuple(NDArray[args(t) + p[3]] for t in p[1])
459315
def types(self):
        
        output = set()
        for var in self.values():
            if var.has_value():
                output.update(var.types())
        return list(output)
351917
private static <T> List<T> join(List<T> list1, List<T> list2) {
        return list1.appendList(list2);
    }
55578
def same_types(self, index1, index2):
        """"""
        try:
            same = self.table[index1].type == self.table[index2].type != SharedData.TYPES.NO_TYPE
        except Exception:
            self.error()
        return same
376623
def get_type(type_):
    
    if isinstance(type_, list):
        type_ = tuple(type_)

    for k, v in TYPE_MAP.iteritems():
        if k == type_:
            return v

    raise KeyError("Unknown type %r" % (type_,))
587021
def diff(a, b):
    
    a, b = list(a), list(b)
    opcodes = SM(None, a, b).get_opcodes()
    return parse_opcodes(opcodes)
632616
def list_diff(list_a, list_b):
    
    result = []
    for item in list_b:
        if not item in list_a:
            result.append(item)
    return result