Create a list of TargetEntry items from a list of tuples in the form (target, flags, info)

    The list can also contain existing TargetEntry items in which case the existing entry
    is re-used in the return list.
500589
def _construct_target_list(targets):
    
    target_entries = []
    for entry in targets:
        if not isinstance(entry, Gtk.TargetEntry):
            entry = Gtk.TargetEntry.new(*entry)
        target_entries.append(entry)
    return target_entries
696844
def get_target_list(self, scan_id):
        

        target_list = []
        for target, _, _ in self.scans_table[scan_id]['targets']:
            target_list.append(target)
        return target_list
1026064
def createSomeItems(store, itemType, values, counter):
    
    for i in counter:
        itemType(store=store, **values)
418848
def create_indexer(indexes: list):
    """"""

    if len(indexes) == 1:
        index = indexes[0]
        return lambda x: (x[index],)
    else:
        return itemgetter(*indexes)
1150459
def _to_tuple(self, _list):
        
        result = list()
        for l in _list:
            if isinstance(l, list):
                result.append(tuple(self._to_tuple(l)))
            else:
                result.append(l)
        return tuple(result)
1092622
function indicesToItems(target, items, indices, r) {
  for (var i = 0; i < r; i++)
    target[i] = items[indices[i]];
}
932170
def pack_found_items(self, s_text, target):
        
        all_children = self.all_children
        all_text = [target.GetItemText(i).lower() for i in all_children]

        found_items = [child for i, child in enumerate(all_children)
                       if s_text in all_text[i]]

        return found_items
1063026
def build_target_areas(entry):
    """"""
    target_areas = []
    areas = str(entry['cap:areaDesc']).split(';')
    for area in areas:
        target_areas.append(area.strip())
    return target_areas
1337122
def GetEntries(dataList, title="Select", msg=""):
    
    root = tkinter.Tk()
    root.title(title)

    label = tkinter.Label(root, text=msg)
    label.pack()

    entries = []
    for item in dataList:
        tkinter.Label(root, text=item).pack()
        entry = tkinter.Entry(root)
        entry.pack()
        entries.append(entry)

    # print entries
    tkinter.Button(root, text="OK", fg="black", command=root.quit).pack()
    root.mainloop()

    result = {}
    for (entry, data) in zip(entries, dataList):
        result[data] = entry.get()

    root.destroy()
    print(result)
    return result
138534
def make_entry_point(patches, original_entry_point):
    
    def entry(argv=None):
        argv = argv if argv is not None else sys.argv[1:]
        return main(
            tuple(patches) + ('--', original_entry_point) + tuple(argv)
        )

    return entry
58478
def add_items(self, data_dict, root=None, target=None):
        
        if root is None:
            print("Warning: TreeCtrl root must be given.")
            return
        if target is None:
            print("Warning: TreeCtrl target must be given.")
            return
        for k in sorted(data_dict):
            if isinstance(data_dict[k], dict):
                k_item_root = target.AppendItem(root, k)
                self.add_items(data_dict[k], k_item_root, target)
            else:
                item_val = ' : '.join((k, str(data_dict[k])))
                target.AppendItem(root, item_val)
1362533
def create_indexes(cls, target=None, recreate=False):
		
		
		# TODO: Nested indexes.
		
		results = []
		collection = cls.get_collection(target)
		
		if recreate:
			collection.drop_indexes()
		
		for index in cls.__indexes__.values():
			results.append(index.create(collection))
		
		return results
1325961
def wrap_list(item):
    
    if item is None:
        return []
    elif isinstance(item, list):
        return item
    elif isinstance(item, (tuple, set)):
        return list(item)
    else:
        return [item]
503369
def createList(self,args):
        
        resultList = []
        if len(args.path) == 1 and os.path.isdir(args.path[0]):
            resultList = [os.path.join(args.path[0], f) for f in os.listdir(args.path[0])]
        else:    # If there are multiple items, wildcard expansion has already created the list of files
            resultList = args.path
        return list(set(resultList))
1208305
private static void createList( int data[], int k , int level , List<int[]> ret )
    {
        data[k] = level;

        if( level < data.length-1 ) {
            for( int i = 0; i < data.length; i++ ) {
                if( data[i] == -1 ) {
                    createList(data,i,level+1,ret);
                }
            }
        } else {
            int []copy = new int[data.length];
            System.arraycopy(data,0,copy,0,data.length);
            ret.add(copy);
        }
        data[k] = -1;
    }
902720
def p_fromitem_list(self,t):
    
    if len(t)==2: t[0] = [t[1]]
    elif len(t)==4: t[0] = t[1] + [t[3]]
    else: raise NotImplementedError('unk_len', len(t)) # pragma: no cover
104394
def createListRecursively(self,args):
        
        resultList = []
        dirDict = self.getDirectoryDictionary(args)
        for key in dirDict:
            for path,dirs,files in os.walk(key):    # Walk through the directory to find al	l input
                for d in dirs:
                    resultList.append(os.path.join(path,d))
                for f in files:    # Append the file if 'ALL' are allowed or the extension is allowed
                        pattern = dirDict[key].split(',')
                        if 'ALL' in pattern or os.path.splitext(f)[1] in pattern:
                            resultList.append(os.path.join(path,f))
        return list(set(resultList))