(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
expressionas a string and then returns the result of evaluating the contents of the string as aClassAdexpression.
-
classad.unparse(attribute: classad._base_expression.Expression) → str¶ This function looks up the value of the provided
attributeand returns the unparsed version as astr. The attribute’s value is not evaluated. If the attribute’s value isx + 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
Errorif other than exactly1argument 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, whenif_expressionevaluates toTrue- evaluate and return the value as given bythen_expressionFalse- evaluate and return the value as given byelse_expressionUndefined- return the valueUndefinedError- return the valueError0.0- evaluate and return the value as given byelse_expressionnon-
0.0float values - evaluate and return the value as given bythen_expression
If
if_expression`evaluates to give a value of typestr, the function returns the valueError. The implementation uses lazy evaluation, so expressions are only evaluated as defined.This function returns
Errorif other than exactly3arguments 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, ifexpressionevaluates toUndefined. ReturnsFalsein all other cases.This function returns
Errorif other than exactly1argument 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
Trueifexpressionevaluates toError. ReturnsFalsein all other cases.This function returns
Errorif other than exactly1argument 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
Trueifexpressionevaluates to astr. ReturnsFalsein all other cases.This function returns
Errorif other than exactly1argument 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
Trueifexpressionevaluates to anint. ReturnsFalsein all other cases.This function returns
Errorif other than exactly1argument 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
Trueifexpressionevaluates to afloat. ReturnsFalsein all other cases.This function returns
Errorif other than exactly1argument 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
Trueifexpressionevaluates to abool. ReturnsFalsein all other cases.This function returns
Errorif other than exactly1argument 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 evaluatedexpressionisfloat, the value is truncated (round towards zero) to anint. If the type of the evaluatedexpressionisstr, the string is converted to anint. If this result is not an integer,Erroris returned. If the evaluatedexpressionisErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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
floatvalue defined byexpression. If the type of the evaluatedexpressionisint, the return value is the converted integer. If the type of the evaluatedexpressionisstr, the string is converted to afloatvalue. If this result is not a float,Erroris returned. If the evaluatedexpressionisErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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 evaluatedexpressionisErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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 evaluatedexpressionisint. If the type of the evaluatedexpressionis not integer, functionreal()is called. Its return value is then used to return the largest magnitude integer that is not larger than the returned value. If functionreal()returnsErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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 evaluatedexpressionisint. If the type of the evaluatedexpressionis not integer, functionreal()is called. Its return value is then used to return the smallest magnitude integer that is not less than the returned value. If functionreal()returnsErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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
baseraised to the power ofexponent. Ifexponentis an integer value greater than or equal to0, andbaseis an integer, then an integer value is returned. Ifexponentis an integer value less than0, or if eitherbaseorexponentis a float, then a float value is returned. An invocation withexponent=0orexponent=0.0, for any value ofbase, including0or0.0``returns the value ``1or1.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 ofa/b, in order to further computeceiling(quotient) * b. This computes and returns an integral multiple ofbthat is at least as large asa. So, whenb >= a, the return value will beb. The return type is the same as that ofb, wherebis anintorfloat.When
bis alist,quantize()returns the first value in the list that is greater than or equal toa. When no value in the list is greater than or equal toa, this computes and returns an integral multiple of the last member in the list that is at least as large asa.This function returns
Error()ifaorb, 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 evaluatedexpressionisint. If the type of the evaluatedexpressionis notint, functionreal()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. Ifreal(expression)returnsErrororUndefined, or the integer value does not fit into 32 bits,Erroris returned.This function returns
Errorif other than exactly1argument 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
expressionevaluates to typeintorfloatcalledx, the return value is the integer or floatrrandomly chosen from the interval0 <= r < x. With no argument, the return value is chosen withrandom(1.0). ReturnsErrorin all other cases.This function returns
Errorif greater than1argument 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
strby functionstring(). ReturnsErrorif any argument evaluates toUndefinedorError.
-
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
stringbystring()before concatenation. If there are exactly two arguments and the second argument is alist, 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
Errorif any argument evaluates toUndefinedorError.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 byoffset, with (optional)lengthcharacters. The first character withinsis at offset0. If the optionallengthargument is not present, the substring extends to the end of the string. Ifoffsetis negative, the value(length - offset)is used for the offset. Iflengthis negative, an initial substring is computed, from the offset to the end of the string. Then, the absolute value oflengthcharacters 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
Errorif greater than3or less than2arguments 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
strby functionstring(). The return value is an integer that will beless than 0, if
ais lexicographically less thanbequal to 0, if
ais lexicographically equal tobgreater than 0, if
ais lexicographically greater thanb
If either argument evaluates to
ErrororUndefined,Erroris returned.This function returns
Errorif other than2arguments 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
sis converted to typestrby functionstring(). The return value is this string, with all lower case letters converted to upper case. If the argument evaluates toErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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
sis converted to typestrby functionstring(). The return value is this string, with all upper case letters converted to lower case. If the argument evaluates toErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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 toErrororUndefined,Erroris returned.This function returns
Errorif other than exactly1argument 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
sthat have been split up by using any of the characters within stringtokens. Iftokensis 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
nameincludes 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, ifnameis"user@domain", then the returned list will be{"user", "domain"}. If there is no@character inname, then the first string in the list will bename, and the second string in the list will be the empty string. Thus, ifnameisusername, then the returned list will be{"username", ""}.
-
classad.splitSlotName(name: classad._primitives.HTCStr) → List[classad._primitives.HTCStr]¶ Returns a list of two strings. Where
nameincludes 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, ifnameis"slot1@machine", then the returned list will be{"slot1", "machine"}. If there is no@character inname, then the first string in the list will be the empty string, and the second string in the list will bename. Thus, ifnameis"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 argumenttimeis interpreted as coordinated universal time in seconds, since midnight of January 1, 1970. If not specified,timewill default to the current time.The argument
formatis 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 (%%). Ifformatis 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:
%aabbreviated weekday name
%Afull weekday name
%babbreviated month name
%Bfull month name
%clocal date and time representation
%dday of the month (01-31)
%Hhour in the 24-hour clock (0-23)
%Ihour in the 12-hour clock (01-12)
%jday of the year (001-366)
%mmonth (01-12)
%Mminute (00-59)
%plocal equivalent of AM or PM
%Ssecond (00-59)
%Uweek number of the year (Sunday as first day of week) (00-53)
%wweekday (0-6, Sunday is 0)
%Wweek number of the year (Monday as first day of week) (00-53)
%xlocal date representation
%Xlocal time representation
%yyear without century (00-99)
%Yyear with century
%Ztime zone name, if any
-
classad.interval(seconds: classad._primitives.HTCInt) → classad._primitives.HTCStr¶ Uses
secondsto return a string of the formdays+hh:mm:ss. This represents an interval of time. Leading values that are zero are omitted from the string. For example,secondsof 67 becomes"1:07". A second example,secondsof1472523 = 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_FULLDEBUGdebug level. This is useful for determining why a given ClassAd expression is evaluating the way it does. For example, if a condor_startdSTARTexpression is unexpectedly evaluating toUndefined, then wrapping the expression in thisdebug()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 attributeEnvironment). If the argument evaluates toUndefined, then the result is alsoUndefined.
-
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 attributeEnvironment).
-
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 optionaldelimiterstring. ReturnsErrorif either argument is not astr.This function returns
Errorif other than1or2arguments are given.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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 optionaldelimiterstring. If all items in the list are integers, the return value isint. If any item in the list is a float value (non-integer), the return value isfloat. If any item does not represent an integer or float value, the return value isError.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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 optionaldelimiterstring. If any item does not represent an integer or float value, the return value isError. A list with0items (the empty list) returns the value 0.0.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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 optionaldelimiterstring. If all items in the list are integers, the return value isint. If any item in the list is a float value (non-integer), the return valuefloat. If any item does not represent an integer or float value, the return value isError. A list with0items (the empty list) returns the valueUndefined.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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 optionaldelimiterstring. If all items in the list are integers, the return value isint. If any item in the list is a float value (noninteger), the return valuefloat. If any item does not represent an integer or float value, the return value isError. A list with0items (the empty list) returns the valueUndefined.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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
Trueif itemxis in the stringstring_list, as delimited by the optionaldelimiterstring. ReturnsFalseif itemxis not in the stringstring_list. Comparison is done withstrcmp(). The return value isError, if any of the arguments are not strings.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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 withstricmp(), so letter case is not relevant.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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
Trueif the lists contain any matching elements, and returnsFalseif the lists do not contain any matching elements. ReturnsErrorif either argument is not astror if an incorrect number of arguments are given.Note
The default delimiter contains the comma and space characters. A string within the
string_listis ended (delimited) by one or more characters within thedelimiterstring.
-
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
patternto scan through the stringtarget. ReturnsTruewhen target is a regular expression given bypattern. ReturnsFalseotherwise. If any argument is not astr, or ifpatterndoes not describe a valid regular expression, returnsError.The
optionsargument is a string of special characters that modify the use of the regular expressions. Inclusion of characters other than these as options are ignored.IoriIgnore letter case.
MormModifies 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.
SorsThe 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
patternto scan through the stringtarget. Iftargetis a regular expression as described bypattern, the string substitute is returned, with backslash expansion performed. If any argument is not astr, returnsError.The
optionsargument is a string of special characters that modify the use of the regular expressions. Inclusion of characters other than these as options are ignored.IoriIgnore letter case.
MormModifies 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.
SorsThe 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
patternto scan through the list of strings instring_list. ReturnsTruewhen one of the strings instring_listis a regular expression as described bypattern. The optionaldelimiterdescribes how the list is delimited, and stringoptionsmodifies how the match is performed. ReturnsFalseifpatterndoes not match any entries instring_list. The return value isError, if any of the arguments are notstr, or ifpatternis not a valid regular expression.The
optionsargument is a string of special characters that modify the use of the regular expressions. Inclusion of characters other than these as options are ignored.IoriIgnore letter case.
MormModifies 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.
SorsThe 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
defaultif thedefaultargument 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>andCLASSAD_USER_MAPDATA_<name>(see the HTCondor-wide Configuration File Entries section).