Assumes pi.* table prefix.
15507
protected ProcessInstance buildProcessInstance(ResultSet rs) throws SQLException {
        ProcessInstance pi = new ProcessInstance();
        pi.setMasterRequestId(rs.getString("master_request_id"));
        pi.setId(rs.getLong("process_instance_id"));
        pi.setProcessId(rs.getLong("process_id"));
        pi.setOwner(rs.getString("owner"));
        pi.setOwnerId(rs.getLong("owner_id"));
        int statusCode = rs.getInt("status_cd");
        pi.setStatus(WorkStatuses.getWorkStatuses().get(statusCode));
        pi.setStartDate(rs.getTimestamp("start_dt"));
        pi.setEndDate(rs.getTimestamp("end_dt"));
        pi.setCompletionCode(rs.getString("compcode"));
        pi.setComment(rs.getString("comments"));
        pi.setTemplate(rs.getString("template"));
        // avoid loading into ProcessCache
        if (pi.getComment() != null) {
            AssetHeader assetHeader = new AssetHeader(pi.getComment());
            pi.setProcessName(assetHeader.getName());
            pi.setProcessVersion(assetHeader.getVersion());
            pi.setPackageName(assetHeader.getPackageName());
        }
        if (pi.getTemplate() != null) {
            AssetHeader templateHeader = new AssetHeader(pi.getTemplate());
            pi.setTemplate(templateHeader.getName());
            pi.setTemplatePackage(templateHeader.getPackageName());
            pi.setTemplateVersion(templateHeader.getVersion());
        }
        return pi;
    }
435282
public static function prettifyTableName($table, $prefix = '')
    {
        if ($prefix) {
            $table = self::removePrefix($table, $prefix);
        }

        return self::underscoresToCamelCase($table, true);
    }
837860
def mod2pi(ts):
    
    return np.pi - np.mod(np.pi - ts, 2*np.pi)
147226
void declarePrefix (String prefix, String uri)
    {
                                // Lazy processing...
        if (!tablesDirty) {
            copyTables();
        }
        if (declarations == null) {
            declarations = new Vector();
        }
            
        prefix = prefix.intern();
        uri = uri.intern();
        if ("".equals(prefix)) {
            if ("".equals(uri)) {
                defaultNS = null;
            } else {
                defaultNS = uri;
            }
        } else {
            prefixTable.put(prefix, uri);
            uriTable.put(uri, prefix); // may wipe out another prefix
        }
        declarations.addElement(prefix);
    }
198057
function pickPrefix(prefix, object) {
    var length = prefix.length;
    var sub;
    return foldl(
      function(acc, val, key) {
        if (key.substr(0, length) === prefix) {
          sub = key.substr(length);
          acc[sub] = val;
        }
        return acc;
      },
      {},
      object
    );
  }
177083
private TableAlias createTableAlias(ClassDescriptor aCld, String aPath, String aUserAlias, List hints)
    {
		if (aUserAlias == null)
		{
			return createTableAlias(aCld, hints, aPath);
		}
		else
		{
			return createTableAlias(aCld, hints, aUserAlias + ALIAS_SEPARATOR + aPath);
		}
    }
1147949
def _get_ntgpadnt(self, ver, add_ns):
        """"""
        hdrs = self.gpad_columns[ver]
        if add_ns:
            hdrs = hdrs + ['NS']
        return cx.namedtuple("ntgpadobj", hdrs)
454989
def resolve_column(self, ref):
    ""
    if isinstance(ref, sqparse2.AttrX):
      if ref.parent.name not in self:
        raise ScopeUnkError('unk table or table alias', ref.parent.name)
      return ref.parent.name, ref.attr.name
    elif isinstance(ref, sqparse2.NameX):
      matches = set()
      for name, target in self.names.items():
        if isinstance(target, SyntheticTable):
          if ref.name in target.columns(self):
            matches.add(name)
        elif isinstance(target, table.Table):
          try: target.get_column(ref.name)
          except KeyError: pass
          else: matches.add(name)
        else:
          raise TypeError('expected SyntheticTable', type(target), target)
      if not matches: raise ScopeUnkError(ref)
      elif len(matches) > 1: raise ScopeCollisionError(matches, ref)
      else: return list(matches)[0], ref.name
    else:
      raise TypeError('unexpected', type(ref), ref)
1189784
private static String prefix(String s, int start) {
        StringBuilder prefix=new StringBuilder(MAX_PREFIX_LENGTH+20);
        if(start==0) {
            prefix.append("\"");
        } else {
            prefix.append("[at pattern index ").append(start).append("] \"");
        }
        int substringLength=s.length()-start;
        if(substringLength<=MAX_PREFIX_LENGTH) {
            prefix.append(start==0 ? s : s.substring(start));
        } else {
            int limit=start+MAX_PREFIX_LENGTH-4;
            if(Character.isHighSurrogate(s.charAt(limit-1))) {
                // remove lead surrogate from the end of the prefix
                --limit;
            }
            prefix.append(s, start, limit).append(" ...");
        }
        return prefix.append("\"").toString();
    }
83327
private void step1(DBIDRef id, WritableDBIDDataStore pi, WritableDoubleDataStore lambda) {
    // P(n+1) = n+1:
    pi.put(id, id);
    // L(n+1) = infinity
    // Initialized already.
    // lambda.putDouble(id, Double.POSITIVE_INFINITY);
  }
837112
public function PrefixTable($Table) {
      $Prefix = $this->Database->DatabasePrefix;
      
      if ($Prefix != '' && substr($Table, 0, strlen($Prefix)) != $Prefix)
         $Table = $Prefix.$Table;

      return $Table;
   }
1222544
def index_name(table, columns):
    """"""
    sig = '||'.join(columns)
    key = sha1(sig.encode('utf-8')).hexdigest()[:16]
    return 'ix_%s_%s' % (table, key)
1141813
def prefix(self, prefix):
        
        original_prefix = self._prefix
        self._prefix += prefix
        yield self
        self._prefix = original_prefix
22936
def followingPrefix(prefix):
        """"""
        prefixBytes = array('B', prefix)

        changeIndex = len(prefixBytes) - 1
        while (changeIndex >= 0 and prefixBytes[changeIndex] == 0xff ):
            changeIndex = changeIndex - 1;
        if(changeIndex < 0):
            return None
        newBytes = array('B', prefix[0:changeIndex + 1])
        newBytes[changeIndex] = newBytes[changeIndex] + 1
        return newBytes.tostring()
25914
def step_impl2(context, first, second, prefix):
    
    context.first = first
    context.second = second
1088750
def getInputSourceHandle(self, pchInputSourcePath):
        """"""

        fn = self.function_table.getInputSourceHandle
        pHandle = VRInputValueHandle_t()
        result = fn(pchInputSourcePath, byref(pHandle))
        return result, pHandle
588505
def table_repr(columns, rows, data, padding=2):
    """"""
    padding = ' ' * padding
    column_lengths = [len(column) for column in columns]
    for row in rows:
        for i, column in enumerate(columns):
            item = str(data[row][column])
            column_lengths[i] = max(len(item), column_lengths[i])
    max_row_length = max(len(row) for row in rows) if len(rows) else 0
    table_row = ' ' * max_row_length
    for i, column in enumerate(columns):
        table_row += padding + column.rjust(column_lengths[i])
    table_rows = [table_row]
    for row in rows:
        table_row = row.rjust(max_row_length)
        for i, column in enumerate(columns):
            item = str(data[row][column])
            table_row += padding + item.rjust(column_lengths[i])
        table_rows.append(table_row)
    return '\n'.join(table_rows)