Define the most important tab parametersfor a fixed-type tab file
17461
def _metadata_fixed(self):
        
        # Number of fluids and index of all the phisical properties
        fluids = {}
        props_idx = {}
        with open(self.abspath) as fobj:
            contents = fobj.readlines()
            for idx, line in enumerate(contents):
                if re.findall(r"\'[\w \-\,]*\'", line):
                    if line.split('\'')[-1] not in ('', '\n'):
                        fluid = line.split('\'')[-1].replace("\n", "")
                    else:
                        fluid = 'unknown'
                    fluids[fluid] = [idx, contents[idx+1], contents[idx+2]]
                if idx not in (0, 1) and re.findall(r"[\w\-\/\,]*[()]+", line):
                    prop, unit = line.replace("\n", "").split("(")[0:2]
                    prop = prop[1:-1]
                    props_idx[idx] = (fluid, prop, unit.replace(")", ""))
        self.metadata['nfluids'] = len(fluids)
        # Delete the fluid idx from multiple fluids tab
        for fluid in fluids:
            if self.metadata['nfluids'] != 1:
                fluids[fluid] = [el for idx, el in
                                 enumerate(fluids[fluid]) if idx != 1]
        # Define T and P arrays and all the other patrameters for a fixed tab
        for fluid_idx, fluid in enumerate(fluids):
            p_points, t_points = re.findall(r'[\w+\-\.]+',
                                            fluids[fluid][1])[0:2]
            self.metadata['t_points'].append(int(t_points))
            self.metadata['p_points'].append(int(p_points))
            self.metadata['fluids'].append(fluid)
            # t and p arrays definition
            with open(self.abspath) as fobj:
                contents = fobj.readlines()
                if len(re.findall(r'[\w+\-\.]+', contents[2])) == 2 and\
                   len(re.findall(r'[\w+\-\.]+', contents[3])) == 2:
                    # for tab file like 'Pearl-2-rich-sep2008.tab':
                    # 'WATER-OPTION ENTROPY 'P-2-rich EOS = PR
                    #    42   35    .205826E-01
                    #   .487805E+06    .882353E+01
                    #   .100000E+06   -.500000E+02
                    p_0, t_0 = re.findall(r'[\w+\-\.]+', contents[3])
                    p_step, t_step = re.findall(r'[\w+\-\.]+', contents[2])
                    t_points = self.metadata["t_points"]
                    p_points = self.metadata["p_points"]
                    t_f = float(t_step)*t_points[fluid_idx] + float(t_0)
                    p_f = float(p_step)*p_points[fluid_idx] + float(p_0)
                    self.metadata['t_array'].append(np.arange(float(t_0),
                                                              t_f,
                                                              float(t_step)))
                    self.metadata['p_array'].append(np.arange(float(p_0),
                                                              p_f,
                                                              float(p_step)))
                else:
                    # for tab file like 'Malampaya_export_gas_2011.tab':
                    if self.metadata['nfluids'] != 1:
                        t_p = self._partial_extraction_fixed(fluids[fluid][0],
                                                             3)
                    else:
                        t_p = self._partial_extraction_fixed(fluids[fluid][0],
                                                             2)
                    len_t_array = self.metadata['t_points'][fluid_idx]
                    len_p_array = self.metadata['p_points'][fluid_idx]

        self.metadata['p_array'].append(t_p[:len_p_array])
        self.metadata['t_array'].append(t_p[len_p_array:
                                            len_t_array+len_p_array])
        self.data = pd.DataFrame(props_idx,
                                 index=("Fluid", "Property",
                                        "Unit")).transpose()
1236577
function(text, node, type) {
			var maxNum = 0;
			var that = this;
			
			var tsOptions = {
				tabstop: function(data) {
					var group = parseInt(data.group, 10);
					if (group === 0)
						return '${0}';
					
					if (group > maxNum) maxNum = group;
					if (data.placeholder) {
						// respect nested placeholders
						var ix = group + tabstopIndex;
						var placeholder = that.processText(data.placeholder, tsOptions);
						return '${' + ix + ':' + placeholder + '}';
					} else {
						return '${' + (group + tabstopIndex) + '}';
					}
				}
			};
			
			// upgrade tabstops
			text = this.processText(text, tsOptions);
			
			// resolve variables
			text = this.replaceVariables(text, this.variablesResolver(node));
			
			tabstopIndex += maxNum + 1;
			return text;
		}
134698
function(node, offset) {
			var maxNum = 0;
			var options = {
				tabstop: function(data) {
					var group = parseInt(data.group, 10);
					if (group > maxNum) maxNum = group;
						
					if (data.placeholder)
						return '${' + (group + offset) + ':' + data.placeholder + '}';
					else
						return '${' + (group + offset) + '}';
				}
			};
			
			['start', 'end', 'content'].forEach(function(p) {
				node[p] = this.processText(node[p], options);
			}, this);
			
			return maxNum;
		}
92388
def generate_tab_names(name):
    

    package_name, module_name = name.rsplit('.', 1)

    version = ply_dist.version.replace(
        '.', '_') if ply_dist is not None else 'unknown'
    data = (package_name, module_name, py_major, version)
    lextab = '%s.lextab_%s_py%d_ply%s' % data
    yacctab = '%s.yacctab_%s_py%d_ply%s' % data
    return lextab, yacctab
469498
def insert_tab index, title, config={}, &block
      @tabs.insert(index, Tab.new(title, self, config, &block) )
    end
1206220
def addTab(self, tab):
        
        if not isinstance(tab, XViewPanelItem):
            tab = XViewPanelItem(tab, self)
            tab.setFixedHeight(self.height())

        index = len(self.items())
        self.layout().insertWidget(index, tab)

        self.setCurrentIndex(index)
        return tab
421933
function parseOptions(type, options) {
    const ret = {
        indentChar: " ",
        indentSize: 2,
        attribute: 1,
        closeBracket: 0,
    }

    if (Number.isSafeInteger(type)) {
        ret.indentSize = type
    } else if (type === "tab") {
        ret.indentChar = "\t"
        ret.indentSize = 1
    }
    if (Number.isSafeInteger(options.attribute)) {
        ret.attribute = options.attribute
    }
    if (Number.isSafeInteger(options.closeBracket)) {
        ret.closeBracket = options.closeBracket
    }

    return ret
}
929031
def find_editor_tab(self, file):
        

        for i in range(self.Script_Editor_tabWidget.count()):
            if not self.get_widget(i).file == file:
                continue

            LOGGER.debug("> File '{0}': Tab index '{1}'.".format(file, i))
            return i
492905
def tabModificationStateChanged(self, tab):
		'''
		
		'''
		if tab == self.currentTab:
			changed = tab.editBox.document().isModified()
			if self.autoSaveActive(tab):
				changed = False
			self.actionSave.setEnabled(changed)
			self.setWindowModified(changed)
687630
function tabBrowser_getTab(index) {
    if (index === undefined)
      index = this.selectedIndex;

    return this.getElement({type: "tabs_tab", subtype: "index", value: index});
  }
1363427
def tab_name_editor(self):
        """"""
        index = self.tabwidget.currentIndex()
        self.tabwidget.tabBar().tab_name_editor.edit_tab(index)
910036
def semantic_tabs(visitor, block):
    
    import re
    global __section__
    
    __section__ += 1
    
    r_name = re.compile(r'(^-- [^-]+ --$)', re.M)
    def get_id():
        global __seq__
        
        __seq__ += 1
        
        return 'tab_item_%d_%d' % (__section__, __seq__)
    
    txt = []
    txt.append('<div class="ui tabular filter menu">')
    
    body = block['body']
    i = 0
    items = r_name.split(body)
    first = True
    entries = []
    in_tab = False #if tab processed
    ids = []
    while i<len(items):
        if in_tab:
            entries.append(items[i])
            in_tab = False
        if items[i].startswith('-- ') and items[i].endswith(' --'):
            if first:
                cls = ' class="active"'
                first = False
            else:
                cls = ''
            _id = get_id()
            ids.append(_id)
            txt.append('<a class="%sitem" data-tab="%s">%s</a>' % (cls, _id, items[i][3:-3]))
            in_tab = True
        
        i += 1
    txt.append('</div>')
    
    txt.append('<div class="tab-content">')
    for i, x in enumerate(entries):
        if i == 0:
            cls = ' active'
        else:
            cls = ''
        txt.append('<div class="ui divided inbox selection list%s tab" data-tab="%s">' % (cls, ids[i]))
        txt.append(visitor.parse_text(x, 'article'))
        txt.append('</div>')
        
    txt.append('</div>')
    txt.append('</div>')
    
    return '\n'.join(txt)
196027
def parameter_action(self, text, loc, par):
        """"""
        exshared.setpos(loc, text)
        if DEBUG > 0:
            print("PARAM:",par)
            if DEBUG == 2: self.symtab.display()
            if DEBUG > 2: return
        index = self.symtab.insert_parameter(par.name, par.type)
        self.shared.function_params += 1
        return index
552097
def tabs_obsolete(physical_line):
    
    indent = indent_match(physical_line).group(1)
    if indent.count('\t'):
        return indent.index('\t'), "W191 indentation contains tabs"
484297
function (elem) {
		var attributeNode = elem.getAttributeNode("tabIndex");
		return attributeNode && attributeNode.specified && (parseInt(elem.getAttribute('tabIndex')) || 0);
	}
3057
def get_tabs(tabs, options, index)
      tab_array = []

      Array(tabs).map do |tab|
        tab_hash = {}

        if tab[:anchor_string]
          tab_hash[:anchorString]             = tab[:anchor_string]
          tab_hash[:anchorXOffset]            = tab[:anchor_x_offset] || '0'
          tab_hash[:anchorYOffset]            = tab[:anchor_y_offset] || '0'
          tab_hash[:anchorIgnoreIfNotPresent] = tab[:ignore_anchor_if_not_present] || false
          tab_hash[:anchorUnits]              = 'pixels'
        end

        tab_hash[:conditionalParentLabel]   = tab[:conditional_parent_label] if tab.key?(:conditional_parent_label)
        tab_hash[:conditionalParentValue]   = tab[:conditional_parent_value] if tab.key?(:conditional_parent_value)
        tab_hash[:documentId]               = tab[:document_id] || '1'
        tab_hash[:pageNumber]               = tab[:page_number] || '1'
        tab_hash[:recipientId]              = index + 1
        tab_hash[:required]                 = tab[:required] || false

        if options[:template] == true
          tab_hash[:templateLocked]   = tab[:template_locked].nil? ? true : tab[:template_locked]
          tab_hash[:templateRequired] = tab[:template_required].nil? ? true : tab[:template_required]
        end

        if options[:sign_here_tab] == true || options[:initial_here_tab] == true
          tab_hash[:scaleValue] = tab[:scale_value] || 1
        end

        tab_hash[:xPosition]  = tab[:x_position] || '0'
        tab_hash[:yPosition]  = tab[:y_position] || '0'
        tab_hash[:name]       = tab[:name] if tab[:name]
        tab_hash[:optional]   = tab[:optional] || false
        tab_hash[:tabLabel]   = tab[:label] || 'Signature 1'
        tab_hash[:width]      = tab[:width] if tab[:width]
        tab_hash[:height]     = tab[:height] if tab[:height]
        tab_hash[:value]      = tab[:value] if tab[:value]
        tab_hash[:fontSize]   = tab[:font_size] if tab[:font_size]
        tab_hash[:fontColor]  = tab[:font_color] if tab[:font_color]
        tab_hash[:bold]       = tab[:bold] if tab[:bold]
        tab_hash[:italic]     = tab[:italic] if tab[:italic]
        tab_hash[:underline]  = tab[:underline] if tab[:underline]
        tab_hash[:selected]   = tab[:selected] if tab[:selected]

        tab_hash[:locked]     = tab[:locked] || false

        tab_hash[:list_items] = tab[:list_items] if tab[:list_items]

        tab_hash[:groupName] = tab[:group_name] if tab.key?(:group_name)
        tab_hash[:radios] = get_tabs(tab[:radios], options, index) if tab.key?(:radios)

        tab_hash[:validationMessage] = tab[:validation_message] if tab[:validation_message]
        tab_hash[:validationPattern] = tab[:validation_pattern] if tab[:validation_pattern]

        tab_array << tab_hash
      end
      tab_array
    end
1049360
def get_tab_text(self, index, is_modified=None, is_readonly=None):
        """"""
        files_path_list = [finfo.filename for finfo in self.data]
        fname = self.data[index].filename
        fname = sourcecode.disambiguate_fname(files_path_list, fname)
        return self.__modified_readonly_title(fname,
                                              is_modified, is_readonly)