Find the label for the output files 
         for this calculation
433453
def _get_label(self):
        '''
        '''
        if self._label is None:
            foundfiles = False
            for f in self._files:
                if ".files" in f: 
                    foundfiles = True
                    self._label = f.split(".")[0]
                    with open(self._label + '.files', 'r') as fp:
                        line = fp.readline().split()[0]
                        if line != self._label + ".in":
                           fp.close()
                           raise Exception('first line must be label.in')
                        line = fp.readline().split()[0]
                        if line != self._label + ".txt":
                           fp.close()
                           raise Exception('second line must be label.txt')
                        line = fp.readline().split()[0]
                        if line != self._label + "i":
                           fp.close()
                           raise Exception('third line must be labeli')
                        line = fp.readline().split()[0]
                        if line != self._label + "o":
                           fp.close()
                           raise Exception('fourth line must be labelo')
                        fp.close()
            if foundfiles:
                return self._label
            else:
                raise Exception('label.files not found')
                                
#ASE format
#        (self.prefix + '.in') # input
#        (self.prefix + '.txt')# output
#        (self.prefix + 'i')   # input
#        (self.prefix + 'o')   # output
                
        else:
            return self._label
800525
def get_label_map(opts):
    '''  '''
    results = {}
    try:
        for entry in os.scandir(diskdir):
            target = normpath(join(diskdir, os.readlink(entry.path)))
            decoded_name = entry.name.encode('utf8').decode('unicode_escape')
            results[target] = decoded_name
        if opts.debug:
            print('\n\nlabel_map:', results)
    except FileNotFoundError:
        pass
    return results
535946
def dumps(self):
        

        if not self.numbering:
            num = '*'
        else:
            num = ''

        string = Command(self.latex_name + num, self.title).dumps()
        if self.label is not None:
            string += '%\n' + self.label.dumps()
        string += '%\n' + self.dumps_content()

        return string
372250
def output(self, _filename):
        

        for contract in self.slither.contracts_derived:
            txt = "\nContract %s"%contract.name
            table = PrettyTable(["Function",
                                 "Modifiers"])
            for function in contract.functions:
                modifiers = function.modifiers
                for call in function.all_internal_calls():
                    if isinstance(call, Function):
                        modifiers += call.modifiers
                for (_, call) in function.all_library_calls():
                    if isinstance(call, Function):
                        modifiers += call.modifiers
                table.add_row([function.name, [m.name for m in set(modifiers)]])
            txt += "\n"+str(table)
            self.info(txt)
4947
def calculte_tensor_to_label_output_shapes(operator):
    '''
    
    '''
    check_input_and_output_numbers(operator, input_count_range=1, output_count_range=1)
    check_input_and_output_types(operator, good_input_types=[FloatTensorType])

    N = operator.inputs[0].type.shape[0]
    if operator.target_opset < 7:
        output_shape = [1, 1]
    else:
        output_shape = [N, 1]

    if type(operator.outputs[0].type) in [Int64Type, Int64TensorType]:
        operator.outputs[0].type = Int64TensorType(output_shape, doc_string=operator.outputs[0].type.doc_string)
    elif type(operator.outputs[0].type) in [StringType, StringTensorType]:
        operator.outputs[0].type = StringTensorType(output_shape, doc_string=operator.outputs[0].type.doc_string)
    else:
        raise ValueError('Unsupported label type')
551512
def value_labels(self):
        

        from operator import itemgetter

        card = self.pstats.nuniques

        if self.label:
            ig = itemgetter(self.name, self.label.name)
        elif self.pstats.nuniques < MAX_LABELS:
            ig = itemgetter(self.name, self.name)
        else:
            return {}

        label_set = set()
        for row in self._partition:
            label_set.add(ig(row))

            if len(label_set) >= card:
                break

        d = dict(label_set)

        assert len(d) == len(label_set)  # Else the label set has multiple values per key

        return d
249350
def label(self):
        
        value = self._element_dict.get("value")
        type_name = type(value).__name__

        if type_name == "NoneType":
            return ""

        if type_name == "list":
            # ---like '10-15' or 'A-F'---
            return "-".join([str(item) for item in value])

        if type_name in ("float", "int"):
            return str(value)

        if type_name in ("str", "unicode"):
            return value

        # ---For CA and MR subvar dimensions---
        name = value.get("references", {}).get("name")
        return name if name else ""
758026
def __get_output_filenames(self):
        
        # if there is only one file, use the normal filename with nothing appended.
        if len(self.noaa_data_sorted["Data"]) == 1:
            self.output_filenames.append(self.filename_txt)

        # if there are multiple files that need to be written out, (multiple data table pairs), then append numbers
        elif len(self.noaa_data_sorted["Data"]) > 1:
            for i in range(0, self.output_file_ct):
                tmp_name = "{}-{}.txt".format(self.dsn, i+1)
                self.output_filenames.append(tmp_name)
        return
862451
def label(self):
        """"""
        if not self.desc:
            return "%.3fs" % self.timestamp
        return "%s (%.3fs)" % (self.desc, self.timestamp)
1030460
private final String getFilenameFromLabel(Context context, String pid, String dsid, Date asOfDateTime, String MIMETYPE) throws Exception {

        // can't get datastream label directly from datastream as this is an API-M call
        // instead get list of datastream defs, as these contain labels
        DOReader reader = m_doManager.getReader(false, context, pid);
        Datastream ds = reader.GetDatastream(dsid, asOfDateTime);

        return (ds == null) ? "" : ds.DSLabel;
    }
742311
def output_files(self):
        """"""
        output_list = []

        pm_dict = self.get_dict()
        output_list.append(pm_dict['output_surface'])
        if pm_dict['target_volume'] != 0.0:
            output_list.append(pm_dict['output_surface'] + str(".cell"))

        return output_list
23957
def label(self):
        ""
        if self._label:
            return self._label
        else:
            if len(self):
                label = get_ndmapping_label(self, 'label')
                return '' if label is None else label
            else:
                return ''
899237
def label(method, text = nil, options = {}, &block)
      text = instance_exec(&text) if text.is_a?(Proc)
      super
    end
591508
def label( self, node ):
        """"""
        result = []
        if node.get('type'):
            result.append( node['type'] )
        if node.get('name' ):
            result.append( node['name'] )
        elif node.get('value') is not None:
            result.append( unicode(node['value'])[:32])
        if 'module' in node and not node['module'] in result:
            result.append( ' in %s'%( node['module'] ))
        if node.get( 'size' ):
            result.append( '%s'%( mb( node['size'] )))
        if node.get( 'totsize' ):
            result.append( '(%s)'%( mb( node['totsize'] )))
        parent_count = len( node.get('parents',()))
        if parent_count > 1:
            result.append( '/%s refs'%( parent_count ))
        return " ".join(result)
895204
def get_filename(self, runSetName, fileExtension):
        '''
        
        '''

        fileName = self.benchmark.output_base_name + ".results."

        if runSetName:
            fileName += runSetName + "."

        return fileName + fileExtension
1253416
def load_defense_output(filename):
  """"""
  result = {}
  with open(filename) as f:
    for row in csv.reader(f):
      try:
        image_filename = row[0]
        if image_filename.endswith('.png') or image_filename.endswith('.jpg'):
          image_filename = image_filename[:image_filename.rfind('.')]
        label = int(row[1])
      except (IndexError, ValueError):
        continue
      result[image_filename] = label
  return result
129217
def labels(self):
        
        if self._labels is None:
            cmd = ["skopeo", "inspect", self.skopeo_target]
            self._labels = json.loads(subprocess.check_output(cmd))["Labels"]
        return self._labels