Takes out index from the parameter's tensor name. E.g. parameter tensor name is 
        GPR-0000/kern/lengthscales, the method for that parameter will return '0000' index.
334001
def tf_compilation_index(self):
        
        if self.parameter_tensor is None:
            return None
        name = self.parameter_tensor.name
        return name.split('-', 1)[-1].split('/')[0]
956811
def _split_tensor_name(tensor_name):
  """"""
  result = re.match(r"(.*):(\d+)$", tensor_name)
  if not result:
    raise ValueError(
        "Unexpected format for tensor name. Expected node_name:output_number. "
        "Got %r" % tensor_name)
  return result.group(1), int(result.group(2))
1079965
def _ctypes_indices(parameter):
    
    if (parameter.dimension is not None and ":" in parameter.dimension):
        splice = _ctypes_splice(parameter)
        if "out" in parameter.direction:
            #Even for pure out variables, the ctypes pointer is passed in and will
            #have a value already.
            return ("integer, intent(inout) :: {}".format(splice), False)
        else:
            return ("integer, intent(in) :: {}".format(splice), False)
353124
def datapoint_indices_for_tensor(self, tensor_index):
        
        if tensor_index >= self._num_tensors:
            raise ValueError('Tensor index %d is greater than the number of tensors (%d)' %(tensor_index, self._num_tensors))
        return self._file_num_to_indices[tensor_index]
693749
private static String getForkMetricsName(TaskMetrics taskMetrics, State state, int index) {
    return taskMetrics.getName() + "." + getForkMetricsId(state, index);
  }
302835
def _split_index(params):
    
    if isinstance(params, list):
        return [params[0], _split_index(params[1])]
    elif isinstance(params, dict):
        if INDEX in params.keys():
            return _split_index(params[VALUE])
        result = dict()
        for key in params:
            result[key] = _split_index(params[key])
        return result
    else:
        return params
278312
def rm_parameter(self, name):
        
        if name not in self._parameters:
            raise ValueError("no '%s' parameter found" % (name))

        del self._parameters[name]
        del self.__dict__[name]
141807
private int nameToOutputIndex(String parameterName) throws SQLException {
    parameterMetadata.readMetadataFromDbIfRequired();
    for (int i = 0; i < parameterMetadata.getParameterCount(); i++) {
      String name = parameterMetadata.getName(i + 1);
      if (name != null && name.equalsIgnoreCase(parameterName)) {
        if (outputParameterMapper[i] == -1) {
          //this is not an outputParameter
          throw new SQLException("Parameter '" + parameterName
              + "' is not declared as output parameter with method registerOutParameter");
        }
        return outputParameterMapper[i];
      }
    }
    throw new SQLException("there is no parameter with the name " + parameterName);
  }
1082913
def decode_index_value(self, index, value):
        
        if index.endswith("_int"):
            return int(value)
        else:
            return bytes_to_str(value)
279196
def expert_to_batch_indices(self):
    
    return tf.split(
        self._batch_index, self._part_sizes_tensor, 0, num=self._num_experts)
403871
def get_operation_mtf_dimension_names(self, operation_name):
    
    mtf_dimension_names = set()
    for tensor_name in self.get_operation_input_names(operation_name):
      mtf_dimension_names.update(self.get_tensor_mtf_dimension_names(
          tensor_name))
    for tensor_name in self.get_operation_output_names(operation_name):
      mtf_dimension_names.update(self.get_tensor_mtf_dimension_names(
          tensor_name))
    return mtf_dimension_names
177456
public org.tensorflow.framework.Summary.Value getValue(int index) {
    return value_.get(index);
  }
170661
def _get_indices(self, names):
        

        def get_converter(s):
            # possibly convert to the actual key types
            # in the indices, could be a Timestamp or a np.datetime64
            if isinstance(s, (Timestamp, datetime.datetime)):
                return lambda key: Timestamp(key)
            elif isinstance(s, np.datetime64):
                return lambda key: Timestamp(key).asm8
            else:
                return lambda key: key

        if len(names) == 0:
            return []

        if len(self.indices) > 0:
            index_sample = next(iter(self.indices))
        else:
            index_sample = None     # Dummy sample

        name_sample = names[0]
        if isinstance(index_sample, tuple):
            if not isinstance(name_sample, tuple):
                msg = ("must supply a tuple to get_group with multiple"
                       " grouping keys")
                raise ValueError(msg)
            if not len(name_sample) == len(index_sample):
                try:
                    # If the original grouper was a tuple
                    return [self.indices[name] for name in names]
                except KeyError:
                    # turns out it wasn't a tuple
                    msg = ("must supply a same-length tuple to get_group"
                           " with multiple grouping keys")
                    raise ValueError(msg)

            converters = [get_converter(s) for s in index_sample]
            names = (tuple(f(n) for f, n in zip(converters, name))
                     for name in names)

        else:
            converter = get_converter(index_sample)
            names = (converter(name) for name in names)

        return [self.indices.get(name, []) for name in names]
1080975
def get_index(self, index, type, alias=None, typed=None, read_only=True, kwargs=None):
        
        if kwargs.tjson != None:
            Log.error("used `typed` parameter, not `tjson`")
        if read_only:
            # GET EXACT MATCH, OR ALIAS
            aliases = wrap(self.get_aliases())
            if index in aliases.index:
                pass
            elif index in aliases.alias:
                match = [a for a in aliases if a.alias == index][0]
                kwargs.alias = match.alias
                kwargs.index = match.index
            else:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)
            return Index(kwargs=kwargs, cluster=self)
        else:
            # GET BEST MATCH, INCLUDING PROTOTYPE
            best = self.get_best_matching_index(index, alias)
            if not best:
                Log.error("Can not find index {{index_name}}", index_name=kwargs.index)

            if best.alias != None:
                kwargs.alias = best.alias
                kwargs.index = best.index
            elif kwargs.alias == None:
                kwargs.alias = kwargs.index
                kwargs.index = best.index

            return Index(kwargs=kwargs, cluster=self)
585300
def ToName(param_type):
    
    items = inspect.getmembers(ContractParameterType)

    if type(param_type) is bytes:
        param_type = int.from_bytes(param_type, 'little')

    for item in items:
        name = item[0]
        val = int(item[1].value)

        if val == param_type:
            return name

    return None
254387
def rms(x, name=None):
    
    if name is None:
        name = x.op.name + '/rms'
        with tfv1.name_scope(None):   # name already contains the scope
            return tf.sqrt(tf.reduce_mean(tf.square(x)), name=name)
    return tf.sqrt(tf.reduce_mean(tf.square(x)), name=name)
810347
def approximant(self, index):
        
        if 'approximant' not in self.table.fieldnames:
            raise ValueError("approximant not found in input file and no "
                "approximant was specified on initialization")
        return self.table["approximant"][index]