Assign arbitrary label to combination of CIFTI spaces
358617
def _define_variant(self):
        """"""
        space = None
        variants = {
            # to be expanded once addtional spaces are supported
            'space1': ['fsaverage5', 'MNI152NLin2009cAsym'],
            'space2': ['fsaverage6', 'MNI152NLin2009cAsym'],
        }
        for sp, targets in variants.items():
            if all(target in targets for target in
                    [self.inputs.surface_target, self.inputs.volume_target]):
                space = sp
        if space is None:
            raise NotImplementedError

        variant_key = os.path.abspath('dtseries_variant.json')
        with open(variant_key, 'w') as fp:
            json.dump({space: variants[space]}, fp)
        return variant_key, space
412325
def provide_label(self):
        """"""
        return [(k, tuple([self.batch_size] + list(v.shape[1:]))) for k, v in self.label]
99901
def p_label_line_co(p):
    
    lbl = make_label(p[1], p.lineno(1))
    p[0] = make_block(lbl, p[2]) if len(p) == 3 else lbl
151375
def assign_indent_numbers(lst, inum, dic=collections.defaultdict(int)):
    
    for i in lst:
        dic[i] = inum
    return dic
1225401
def _collected_label(collect, label):
    """"""
    if not collect.__name__.startswith('<'):
        return label + ' ' + collect.__name__
    else:
        return label
410197
function parse_Label(blob, length, opts) {
	var target = blob.l + length;
	var cell = parse_XLSCell(blob, 6);
	if(opts.biff == 2) blob.l++;
	var str = parse_XLUnicodeString(blob, target - blob.l, opts);
	cell.val = str;
	return cell;
}
945314
function(data, options) {
    if (typeof data.length !== 'undefined') {
      if (typeof data[0].length !== 'undefined') {
        this.grouped = true;

        // TODO: Find longest?
        this.group_size = data[0].length;
        var o = {}, k, i = 0;
        for (k in options.labels) {
          k = options.labels[k];
          o[k] = data[i];
          i++;
        }
        return o;
      } else {
        return { 'one': data };
      }
    } else {
      return data;
    }
  }
275012
def label(self, input_grid):
        
        marked = self.find_local_maxima(input_grid)
        marked = np.where(marked >= 0, 1, 0)
        # splabel returns two things in a tuple: an array and an integer
        # assign the first thing (array) to markers
        markers = splabel(marked)[0]
        return markers
169307
function MapLabel(opt_options) {
  this.set('fontFamily', 'sans-serif');
  this.set('fontSize', 12);
  this.set('fontColor', '#000000');
  this.set('strokeWeight', 4);
  this.set('strokeColor', '#ffffff');
  this.set('align', 'center');

  this.set('zIndex', 1e3);

  this.setValues(opt_options);
}
1237363
def trl(label, desc = "", tokens = {}, options = {})
      tr(label, desc, tokens, options.merge(:skip_decorations => true))
    end
793543
def load_label(self, idx, label_type=None):
        
        if label_type == 'semantic':
            label = scipy.io.loadmat('{}/SemanticLabels/spatial_envelope_256x256_static_8outdoorcategories/{}.mat'.format(self.siftflow_dir, idx))['S']
        elif label_type == 'geometric':
            label = scipy.io.loadmat('{}/GeoLabels/spatial_envelope_256x256_static_8outdoorcategories/{}.mat'.format(self.siftflow_dir, idx))['S']
            label[label == -1] = 0
        else:
            raise Exception("Unknown label type: {}. Pick semantic or geometric.".format(label_type))
        label = label.astype(np.uint8)
        label -= 1  # rotate labels so classes start at 0, void is 255
        label = label[np.newaxis, ...]
        return label.copy()
355753
def label(self, name, internal=False, definition=False):
        
        return "{0}{1}{2}".format(self.internal if internal else "", name, self.definition if definition else "")
133747
def create_single(cls, value, idx='default'):
        

        return LabelList(idx=idx, labels=[
            Label(value=value)
        ])
1209038
def _label_desc(self, label, desc, label_color=''):
        '''  '''
        return self.BRIGHT +  label_color + label + self.RESET + desc
595897
function autoAlignLabel() {
			// Auto-align label, depending on it's position
			if (!settings.hasOwnProperty("label") || (settings.hasOwnProperty("label") && !settings.label.hasOwnProperty("align"))) {
				switch(options.label.position) {
				case "left":
					options.label.align = "right";
					break;
				case "right":
					options.label.align = "left";
					break;
				default:
					options.label.align = "center";
				}

				if (options.label.rotate === "left") {
					options.label.align = "right";
				} else if (options.label.rotate === "right") {
					options.label.align = "left";
				}
			}

			if (!settings.hasOwnProperty("label") || (settings.hasOwnProperty("label") && !settings.label.hasOwnProperty("offset"))) {
				if (options.label.position === "left" || options.label.position === "right") {
					options.label.offset = {
						x: 10,
						y: 15
					};
				}
			}
		}
418153
def _format_labels(bins, precision, right=True,
                   include_lowest=False, dtype=None):
    

    closed = 'right' if right else 'left'

    if is_datetime64tz_dtype(dtype):
        formatter = partial(Timestamp, tz=dtype.tz)
        adjust = lambda x: x - Timedelta('1ns')
    elif is_datetime64_dtype(dtype):
        formatter = Timestamp
        adjust = lambda x: x - Timedelta('1ns')
    elif is_timedelta64_dtype(dtype):
        formatter = Timedelta
        adjust = lambda x: x - Timedelta('1ns')
    else:
        precision = _infer_precision(precision, bins)
        formatter = lambda x: _round_frac(x, precision)
        adjust = lambda x: x - 10 ** (-precision)

    breaks = [formatter(b) for b in bins]
    labels = IntervalIndex.from_breaks(breaks, closed=closed)

    if right and include_lowest:
        # we will adjust the left hand side by precision to
        # account that we are all right closed
        v = adjust(labels[0].left)

        i = IntervalIndex([Interval(v, labels[0].right, closed='right')])
        labels = i.append(labels[1:])

    return labels
661041
def translate_labels(val):
    '''
    
    '''
    if not isinstance(val, dict):
        if not isinstance(val, list):
            val = split(val)
        new_val = {}
        for item in val:
            if isinstance(item, dict):
                if len(item) != 1:
                    raise SaltInvocationError('Invalid label(s)')
                key = next(iter(item))
                val = item[key]
            else:
                try:
                    key, val = split(item, '=', 1)
                except ValueError:
                    key = item
                    val = ''
            if not isinstance(key, six.string_types):
                key = six.text_type(key)
            if not isinstance(val, six.string_types):
                val = six.text_type(val)
            new_val[key] = val
        val = new_val
    return val