(Supported) Predefined Functions

Warning

Not all functions mentioned below are supported yet. However, all of the listed functions will be supported in the future.

classad.eval(expression: Any) → Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]

Evaluates expression as a string and then returns the result of evaluating the contents of the string as a ClassAd expression.

classad.unparse(attribute: classad._base_expression.Expression)str

This function looks up the value of the provided attribute and returns the unparsed version as a str. The attribute’s value is not evaluated. If the attribute’s value is x + 3, then the function would return the string "x + 3". If the provided attribute cannot be found, an empty string is returned.

This function returns Error if other than exactly 1 argument is given or the argument is not an attribute reference.

classad.ifThenElse(if_expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], then_expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], else_expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]

A conditional expression is described by if_expression. The following defines the return values, when if_expression evaluates to

  • True - evaluate and return the value as given by then_expression

  • False - evaluate and return the value as given by else_expression

  • Undefined - return the value Undefined

  • Error - return the value Error

  • 0.0 - evaluate and return the value as given by else_expression

  • non-0.0 float values - evaluate and return the value as given by then_expression

If if_expression` evaluates to give a value of type str, the function returns the value Error. The implementation uses lazy evaluation, so expressions are only evaluated as defined.

This function returns Error if other than exactly 3 arguments are given.

classad.isUndefined(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Returns True, if expression evaluates to Undefined. Returns False in all other cases.

This function returns Error if other than exactly 1 argument is given.

classad.isError(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Returns True if expression evaluates to Error. Returns False in all other cases.

This function returns Error if other than exactly 1 argument is given.

classad.isString(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Returns True if expression evaluates to a str. Returns False in all other cases.

This function returns Error if other than exactly 1 argument is given.

classad.isInteger(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Returns True if expression evaluates to an int. Returns False in all other cases.

This function returns Error if other than exactly 1 argument is given.

classad.isReal(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Returns True if expression evaluates to a float. Returns False in all other cases.

This function returns Error if other than exactly 1 argument is given.

classad.isBoolean(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Returns True if expression evaluates to a bool. Returns False in all other cases.

This function returns Error if other than exactly 1 argument is given.

classad.int(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Returns the integer value defined by expression. If the type of the evaluated expression is float, the value is truncated (round towards zero) to an int. If the type of the evaluated expression is str, the string is converted to an int. If this result is not an integer, Error is returned. If the evaluated expression is Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.real(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCFloat, classad._primitives.Error]

Returns the float value defined by expression. If the type of the evaluated expression is int, the return value is the converted integer. If the type of the evaluated expression is str, the string is converted to a float value. If this result is not a float, Error is returned. If the evaluated expression is Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.string(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCStr, classad._primitives.Error]

Returns the string that results from evaluating expression. A non-string value is converted to a string. If the evaluated expression is Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.floor(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Returns the integer that results from evaluating expression, if the type of the evaluated expression is int. If the type of the evaluated expression is not integer, function real() is called. Its return value is then used to return the largest magnitude integer that is not larger than the returned value. If function real() returns Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.ceiling(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Returns the integer that results from evaluating expression, if the type of the evaluated expression is int. If the type of the evaluated expression is not integer, function real() is called. Its return value is then used to return the smallest magnitude integer that is not less than the returned value. If function real() returns Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.pow(base: classad._primitives.HTCInt, exponent: classad._primitives.HTCInt) → classad._primitives.HTCInt
classad.pow(base: classad._primitives.HTCInt, exponent: classad._primitives.HTCInt) → classad._primitives.HTCFloat
classad.pow(base: classad._primitives.HTCFloat, exponent: classad._primitives.HTCFloat) → classad._primitives.HTCFloat

Calculates base raised to the power of exponent. If exponent is an integer value greater than or equal to 0, and base is an integer, then an integer value is returned. If exponent is an integer value less than 0, or if either base or exponent is a float, then a float value is returned. An invocation with exponent=0 or exponent=0.0, for any value of base, including 0 or 0.0``returns the value ``1 or 1.0, type appropriate.

classad.quantize(a: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], b: classad._primitives.HTCInt) → classad._primitives.HTCInt
classad.quantize(a: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], b: classad._primitives.HTCFloat) → classad._primitives.HTCFloat
classad.quantize(a: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], b: List[Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]]) → Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]

quantize() computes the quotient of a/b, in order to further compute ceiling(quotient) * b. This computes and returns an integral multiple of b that is at least as large as a. So, when b >= a, the return value will be b. The return type is the same as that of b, where b is an int or float.

When b is a list, quantize() returns the first value in the list that is greater than or equal to a. When no value in the list is greater than or equal to a, this computes and returns an integral multiple of the last member in the list that is at least as large as a.

This function returns Error() if a or b, or a member of the list that must be considered is not an int or float.

Here are examples:

8     = quantize(3, 8)
4     = quantize(3, 2)
0     = quantize(0, 4)
6.8   = quantize(1.5, 6.8)
7.2   = quantize(6.8, 1.2)
10.2  = quantize(10, 5.1)

4     = quantize(0, {4})
2     = quantize(2, {1, 2, "A"})
3.0   = quantize(3, {1, 2, 0.5})
3.0   = quantize(2.7, {1, 2, 0.5})
ERROR = quantize(3, {1, 2, "A"})
classad.round(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Returns the integer that results from the evaluation of expression, if the type of the evaluated expression is int. If the type of the evaluated expression is not int, function real() is called. Its return value is then used to return the integer that results from a round-to-nearest rounding method. The nearest integer value to the return value is returned, except in the case of the value at the exact midpoint between two integer values. In this case, the even valued integer is returned. If real(expression) returns Error or Undefined, or the integer value does not fit into 32 bits, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.random(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error] = 1.0) → Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.Error]

If the optional argument expression evaluates to type int or float called x, the return value is the integer or float r randomly chosen from the interval 0 <= r < x. With no argument, the return value is chosen with random(1.0). Returns Error in all other cases.

This function returns Error if greater than 1 argument is given.

classad.strcat(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], *args: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCStr, classad._primitives.Error]

Returns the string which is the concatenation of all arguments, where all arguments are converted to type str by function string(). Returns Error if any argument evaluates to Undefined or Error.

classad.join(seperator: classad._primitives.HTCStr, *args: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCStr, classad._primitives.Error]
classad.join(seperator: classad._primitives.HTCStr, arguments: classad._primitives.HTCList) → Union[classad._primitives.HTCStr, classad._primitives.Error]
classad.join(arguments: classad._primitives.HTCList) → Union[classad._primitives.HTCStr, classad._primitives.Error]

Returns the string which is the concatenation of all arguments after the first one. The first argument is the separator, and it is inserted between each of the other arguments during concatenation. All arguments are converted to type string by string() before concatenation. If there are exactly two arguments and the second argument is a list, all members of the list are converted to strings and then joined using the separator. If there is only one argument, and the argument is a list, all members of the list are converted to strings and then concatenated.

Returns Error if any argument evaluates to Undefined or Error.

For example:

"a, b, c" = join(", ", "a", "b", "c")
"abc"     = join(split("a b c"))
"a;b;c"   = join(";", split("a b c"))
classad.substr(s: classad._primitives.HTCStr, offset: classad._primitives.HTCInt, length: Optional[classad._primitives.HTCInt] = None) → Union[classad._primitives.HTCStr, classad._primitives.Error]

Returns the substring of s, from the position indicated by offset, with (optional) length characters. The first character within s is at offset 0. If the optional length argument is not present, the substring extends to the end of the string. If offset is negative, the value (length - offset) is used for the offset. If length is negative, an initial substring is computed, from the offset to the end of the string. Then, the absolute value of length characters are deleted from the right end of the initial substring. Further, where characters of this resulting substring lie outside the original string, the part that lies within the original string is returned. If the substring lies completely outside the original string, the null string is returned.

This function returns Error if greater than 3 or less than 2 arguments are given.

classad.strcmp(a: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], b: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Both arguments are converted to str by function string(). The return value is an integer that will be

  • less than 0, if a is lexicographically less than b

  • equal to 0, if a is lexicographically equal to b

  • greater than 0, if a is lexicographically greater than b

If either argument evaluates to Error or Undefined, Error is returned.

This function returns Error if other than 2 arguments are given.

See also

Case is significant in comparison. Refer to stricmp() for case insignificant comparison.

classad.stricmp(a: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error], b: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

This function is the same as strcmp(), except that letter case is not significant.

See also

Refer to strcmp() for case significant comparison.

classad.toUpper(s: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCStr, classad._primitives.Error]

The single argument s is converted to type str by function string(). The return value is this string, with all lower case letters converted to upper case. If the argument evaluates to Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.toLower(s: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCStr, classad._primitives.Error]

The single argument s is converted to type str by function string(). The return value is this string, with all upper case letters converted to lower case. If the argument evaluates to Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.size(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Returns the number of characters in the string, after calling function string(). If the argument evaluates to Error or Undefined, Error is returned.

This function returns Error if other than exactly 1 argument is given.

classad.split(s: classad._primitives.HTCStr, tokens: Optional[classad._primitives.HTCStr] = None) → List[classad._primitives.HTCStr]

Returns a list of the substrings of s that have been split up by using any of the characters within string tokens. If tokens is not specified, then all white space characters are used to delimit the string.

classad.splitUserName(name: classad._primitives.HTCStr) → List[classad._primitives.HTCStr]

Returns a list of two strings. Where name includes an @ character, the first string in the list will be the substring that comes before the @ character, and the second string in the list will be the substring that comes after. Thus, if name is "user@domain", then the returned list will be {"user", "domain"}. If there is no @ character in name, then the first string in the list will be name, and the second string in the list will be the empty string. Thus, if name is username, then the returned list will be {"username", ""}.

classad.splitSlotName(name: classad._primitives.HTCStr) → List[classad._primitives.HTCStr]

Returns a list of two strings. Where name includes an @ character, the first string in the list will be the substring that comes before the @ character, and the second string in the list will be the substring that comes after. Thus, if name is "slot1@machine", then the returned list will be {"slot1", "machine"}. If there is no @ character in name, then the first string in the list will be the empty string, and the second string in the list will be name. Thus, if name is "machinename", then the returned list will be {"machinename"}.

classad.time() → classad._primitives.HTCInt

Returns the current coordinated universal time. This is the time, in seconds, since midnight of January 1, 1970.

classad.formatTime(time: Optional[classad._primitives.HTCInt], format: Optional[classad._primitives.HTCStr]) → classad._primitives.HTCStr

Returns a formatted string that is a representation of time. The argument time is interpreted as coordinated universal time in seconds, since midnight of January 1, 1970. If not specified, time will default to the current time.

The argument format is interpreted similarly to the format argument of the ANSI C strftime function. It consists of arbitrary text plus placeholders for elements of the time. These placeholders are percent signs (%) followed by a single letter. To have a percent sign in the output, use a double percent sign (%%). If format is not specified, it defaults to %c.

Because the implementation uses strftime() to implement this, and some versions implement extra, non-ANSI C options, the exact options available to an implementation may vary. An implementation is only required to implement the ANSI C options which are:

%a

abbreviated weekday name

%A

full weekday name

%b

abbreviated month name

%B

full month name

%c

local date and time representation

%d

day of the month (01-31)

%H

hour in the 24-hour clock (0-23)

%I

hour in the 12-hour clock (01-12)

%j

day of the year (001-366)

%m

month (01-12)

%M

minute (00-59)

%p

local equivalent of AM or PM

%S

second (00-59)

%U

week number of the year (Sunday as first day of week) (00-53)

%w

weekday (0-6, Sunday is 0)

%W

week number of the year (Monday as first day of week) (00-53)

%x

local date representation

%X

local time representation

%y

year without century (00-99)

%Y

year with century

%Z

time zone name, if any

classad.interval(seconds: classad._primitives.HTCInt) → classad._primitives.HTCStr

Uses seconds to return a string of the form days+hh:mm:ss. This represents an interval of time. Leading values that are zero are omitted from the string. For example, seconds of 67 becomes "1:07". A second example, seconds of 1472523 = 17*24*60*60 + 1*60*60 + 3, results in the string "17+1:02:03".

classad.debug(expression: Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]) → Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.HTCStr, classad._primitives.HTCBool, classad._primitives.Undefined, classad._primitives.Error]

This function evaluates its argument, and it returns the result. Thus, it is a no-operation. However, a side-effect of the function is that information about the evaluation is logged to the evaluating program’s log file, at the D_FULLDEBUG debug level. This is useful for determining why a given ClassAd expression is evaluating the way it does. For example, if a condor_startd START expression is unexpectedly evaluating to Undefined, then wrapping the expression in this debug() function will log information about each component of the expression to the log file, making it easier to understand the expression.

classad.envV1ToV2(old_env: classad._primitives.HTCStr) → classad._primitives.HTCStr

This function converts a set of environment variables from the old HTCondor syntax to the new syntax. The single argument should evaluate to a string that represents a set of environment variables using the old HTCondor syntax (usually stored in the job ClassAd attribute Env). The result is the same set of environment variables using the new HTCondor syntax (usually stored in the job ClassAd attribute Environment). If the argument evaluates to Undefined, then the result is also Undefined.

classad.mergeEnvironment(env: classad._primitives.HTCStr, *args: classad._primitives.HTCStr) → classad._primitives.HTCStr

This function merges multiple sets of environment variables into a single set. If multiple arguments include the same variable, the one that appears last in the argument list is used. Each argument should evaluate to a string which represents a set of environment variables using the new HTCondor syntax or Undefined, which is treated like an empty string. The result is a string that represents the merged set of environment variables using the new HTCondor syntax (suitable for use as the value of the job ClassAd attribute Environment).

classad.stringListSize(string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr]) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Returns the number of elements in the string string_list, as delimited by the optional delimiter string. Returns Error if either argument is not a str.

This function returns Error if other than 1 or 2 arguments are given.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.stringListSum(string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = 'None') → Union[classad._primitives.HTCInt, classad._primitives.Error]
classad.stringListSum(string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = 'None') → Union[classad._primitives.HTCFloat, classad._primitives.Error]

Sums and returns the sum of all items in the string string_list, as delimited by the optional delimiter string. If all items in the list are integers, the return value is int. If any item in the list is a float value (non-integer), the return value is float. If any item does not represent an integer or float value, the return value is Error.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.stringListAvg(string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = None) → classad._primitives.HTCFloat

Sums and returns the float-valued average of all items in the string string_list, as delimited by the optional delimiter string. If any item does not represent an integer or float value, the return value is Error. A list with 0 items (the empty list) returns the value 0.0.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.stringListMin(string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.Error, classad._primitives.Undefined]

Finds and returns the minimum value from all items in the string string_list, as delimited by the optional delimiter string. If all items in the list are integers, the return value is int. If any item in the list is a float value (non-integer), the return value float. If any item does not represent an integer or float value, the return value is Error. A list with 0 items (the empty list) returns the value Undefined.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.stringListMax(string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCFloat, classad._primitives.HTCInt, classad._primitives.Error, classad._primitives.Undefined]

Finds and returns the maximum value from all items in the string string_list, as delimited by the optional delimiter string. If all items in the list are integers, the return value is int. If any item in the list is a float value (noninteger), the return value float. If any item does not represent an integer or float value, the return value is Error. A list with 0 items (the empty list) returns the value Undefined.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.stringListMember(x: classad._primitives.HTCStr, string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Returns True if item x is in the string string_list, as delimited by the optional delimiter string. Returns False if item x is not in the string string_list. Comparison is done with strcmp(). The return value is Error, if any of the arguments are not strings.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.stringListIMember(x: classad._primitives.HTCStr, string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Same as stringListMember(), but comparison is done with stricmp(), so letter case is not relevant.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.stringListsIntersect(list_a: classad._primitives.HTCStr, list_b: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCInt, classad._primitives.Error]

Returns True if the lists contain any matching elements, and returns False if the lists do not contain any matching elements. Returns Error if either argument is not a str or if an incorrect number of arguments are given.

Note

The default delimiter contains the comma and space characters. A string within the string_list is ended (delimited) by one or more characters within the delimiter string.

classad.regexp(pattern: classad._primitives.HTCStr, target: classad._primitives.HTCStr, options: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Uses the description of a regular expression given by string pattern to scan through the string target. Returns True when target is a regular expression given by pattern. Returns False otherwise. If any argument is not a str, or if pattern does not describe a valid regular expression, returns Error.

The options argument is a string of special characters that modify the use of the regular expressions. Inclusion of characters other than these as options are ignored.

I or i

Ignore letter case.

M or m

Modifies the interpretation of the caret (^) and dollar sign ($) characters. The caret character matches the start of a string, as well as after each newline character. The dollar sign character matches before a newline character.

S or s

The period matches any character, including the newline character.

classad.regexps(pattern: classad._primitives.HTCStr, target: classad._primitives.HTCStr, substitute: classad._primitives.HTCStr, options: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCStr, classad._primitives.Error]

Uses the description of a regular expression given by string pattern to scan through the string target. If target is a regular expression as described by pattern, the string substitute is returned, with backslash expansion performed. If any argument is not a str, returns Error.

The options argument is a string of special characters that modify the use of the regular expressions. Inclusion of characters other than these as options are ignored.

I or i

Ignore letter case.

M or m

Modifies the interpretation of the caret (^) and dollar sign ($) characters. The caret character matches the start of a string, as well as after each newline character. The dollar sign character matches before a newline character.

S or s

The period matches any character, including the newline character.

classad.stringList_regexpMember(pattern: classad._primitives.HTCStr, string_list: classad._primitives.HTCStr, delimiter: Optional[classad._primitives.HTCStr] = None, options: Optional[classad._primitives.HTCStr] = None) → Union[classad._primitives.HTCBool, classad._primitives.Error]

Uses the description of a regular expression given by string pattern to scan through the list of strings in string_list. Returns True when one of the strings in string_list is a regular expression as described by pattern. The optional delimiter describes how the list is delimited, and string options modifies how the match is performed. Returns False if pattern does not match any entries in string_list. The return value is Error, if any of the arguments are not str, or if pattern is not a valid regular expression.

The options argument is a string of special characters that modify the use of the regular expressions. Inclusion of characters other than these as options are ignored.

I or i

Ignore letter case.

M or m

Modifies the interpretation of the caret (^) and dollar sign ($) characters. The caret character matches the start of a string, as well as after each newline character. The dollar sign character matches before a newline character.

S or s

The period matches any character, including the newline character.

classad.userHome(userName: classad._primitives.HTCStr, default: Optional[classad._primitives.HTCStr] = None) → classad._primitives.HTCStr

Returns the home directory of the given user as configured on the current system (determined using the getpwdnam() call). (Returns default if the default argument is passed and the home directory of the user is not defined.)

classad.userMap(mapSetName: classad._primitives.HTCStr, userName: classad._primitives.HTCStr) → classad._primitives.HTCList
classad.userMap(mapSetName: classad._primitives.HTCStr, userName: classad._primitives.HTCStr, preferredGroup: classad._primitives.HTCStr) → Union[classad._primitives.HTCStr, classad._primitives.Undefined]
classad.userMap(mapSetName: classad._primitives.HTCStr, userName: classad._primitives.HTCStr, preferredGroup: classad._primitives.HTCStr, defaultGroup: classad._primitives.HTCStr) → classad._primitives.HTCStr

The maps for the userMap() function are defined by the following configuration macros: <SUBSYS>_CLASSAD_USER_MAP_NAMES, CLASSAD_USER_MAPFILE_<name> and CLASSAD_USER_MAPDATA_<name> (see the HTCondor-wide Configuration File Entries section).