neulab/docprompting-conala huggingface dataset:
locale.currency(val, symbol=True, grouping=False, international=False)  
Formats a number val according to the current LC_MONETARY settings. The returned string includes the currency symbol if symbol is true, which is the default. If grouping is true (which is not the default), grouping is done with the value. If international is true (which is not the default), the international currency symbol is used. Note that this function will not work with the ‘C’ locale, so you have to set a locale via setlocale() first.
locale.delocalize(string)  
Converts a string into a normalized number string, following the LC_NUMERIC settings.  New in version 3.5.
locale.D_FMT  
Get a string that can be used as a format string for time.strftime() to represent a date in a locale-specific way.
locale.D_T_FMT  
Get a string that can be used as a format string for time.strftime() to represent date and time in a locale-specific way.
locale.ERA  
Get a string that represents the era used in the current locale. Most locales do not define this value. An example of a locale which does define this value is the Japanese one. In Japan, the traditional representation of dates includes the name of the era corresponding to the then-emperor’s reign. Normally it should not be necessary to use this value directly. Specifying the E modifier in their format strings causes the time.strftime() function to use this information. The format of the returned string is not specified, and therefore you should not assume knowledge of it on different systems.
locale.ERA_D_FMT  
Get a format string for time.strftime() to represent a date in a locale-specific era-based way.
locale.ERA_D_T_FMT  
Get a format string for time.strftime() to represent date and time in a locale-specific era-based way.
locale.ERA_T_FMT  
Get a format string for time.strftime() to represent a time in a locale-specific era-based way.
exception locale.Error  
Exception raised when the locale passed to setlocale() is not recognized.
locale.format(format, val, grouping=False, monetary=False)  
Please note that this function works like format_string() but will only work for exactly one %char specifier. For example, '%f' and '%.0f' are both valid specifiers, but '%f KiB' is not. For whole format strings, use format_string().  Deprecated since version 3.7: Use format_string() instead.
locale.format_string(format, val, grouping=False, monetary=False)  
Formats a number val according to the current LC_NUMERIC setting. The format follows the conventions of the % operator. For floating point values, the decimal point is modified if appropriate. If grouping is true, also takes the grouping into account. If monetary is true, the conversion uses monetary thousands separator and grouping strings. Processes formatting specifiers as in format % val, but takes the current locale settings into account.  Changed in version 3.7: The monetary keyword parameter was added.
locale.getdefaultlocale([envvars])  
Tries to determine the default locale settings and returns them as a tuple of the form (language code, encoding). According to POSIX, a program which has not called setlocale(LC_ALL, '') runs using the portable 'C' locale. Calling setlocale(LC_ALL, '') lets it use the default locale as defined by the LANG variable. Since we do not want to interfere with the current locale setting we thus emulate the behavior in the way described above. To maintain compatibility with other platforms, not only the LANG variable is tested, but a list of variables given as envvars parameter. The first found to be defined will be used. envvars defaults to the search path used in GNU gettext; it must always contain the variable name 'LANG'. The GNU gettext search path contains 'LC_ALL', 'LC_CTYPE', 'LANG' and 'LANGUAGE', in that order. Except for the code 'C', the language code corresponds to RFC 1766. language code and encoding may be None if their values cannot be determined.
locale.getlocale(category=LC_CTYPE)  
Returns the current setting for the given locale category as sequence containing language code, encoding. category may be one of the LC_* values except LC_ALL. It defaults to LC_CTYPE. Except for the code 'C', the language code corresponds to RFC 1766. language code and encoding may be None if their values cannot be determined.
locale.getpreferredencoding(do_setlocale=True)  
Return the encoding used for text data, according to user preferences. User preferences are expressed differently on different systems, and might not be available programmatically on some systems, so this function only returns a guess. On some systems, it is necessary to invoke setlocale() to obtain the user preferences, so this function is not thread-safe. If invoking setlocale is not necessary or desired, do_setlocale should be set to False. On Android or in the UTF-8 mode (-X utf8 option), always return 'UTF-8', the locale and the do_setlocale argument are ignored.  Changed in version 3.7: The function now always returns UTF-8 on Android or if the UTF-8 mode is enabled.
locale.LC_ALL  
Combination of all locale settings. If this flag is used when the locale is changed, setting the locale for all categories is attempted. If that fails for any category, no category is changed at all. When the locale is retrieved using this flag, a string indicating the setting for all categories is returned. This string can be later used to restore the settings.
locale.LC_COLLATE  
Locale category for sorting strings. The functions strcoll() and strxfrm() of the locale module are affected.
locale.LC_CTYPE  
Locale category for the character type functions. Depending on the settings of this category, the functions of module string dealing with case change their behaviour.
locale.LC_MESSAGES  
Locale category for message display. Python currently does not support application specific locale-aware messages. Messages displayed by the operating system, like those returned by os.strerror() might be affected by this category.
locale.LC_MONETARY  
Locale category for formatting of monetary values. The available options are available from the localeconv() function.
locale.LC_NUMERIC  
Locale category for formatting numbers. The functions format(), atoi(), atof() and str() of the locale module are affected by that category. All other numeric formatting operations are not affected.
locale.LC_TIME  
Locale category for the formatting of time. The function time.strftime() follows these conventions.
locale.localeconv()  
Returns the database of the local conventions as a dictionary. This dictionary has the following strings as keys:   
Category Key Meaning   
LC_NUMERIC 'decimal_point' Decimal point character.  
 'grouping' Sequence of numbers specifying which relative positions the 'thousands_sep' is expected. If the sequence is terminated with CHAR_MAX, no further grouping is performed. If the sequence terminates with a 0, the last group size is repeatedly used.  
 'thousands_sep' Character used between groups.  
LC_MONETARY 'int_curr_symbol' International currency symbol.  
 'currency_symbol' Local currency symbol.  
 'p_cs_precedes/n_cs_precedes' Whether the currency symbol precedes the value (for positive resp. negative values).  
 'p_sep_by_space/n_sep_by_space' Whether the currency symbol is separated from the value by a space (for positive resp. negative values).  
 'mon_decimal_point' Decimal point used for monetary values.  
 'frac_digits' Number of fractional digits used in local formatting of monetary values.  
 'int_frac_digits' Number of fractional digits used in international formatting of monetary values.  
 'mon_thousands_sep' Group separator used for monetary values.  
 'mon_grouping' Equivalent to 'grouping', used for monetary values.  
 'positive_sign' Symbol used to annotate a positive monetary value.  
 'negative_sign' Symbol used to annotate a negative monetary value.  
 'p_sign_posn/n_sign_posn' The position of the sign (for positive resp. negative values), see below.   All numeric values can be set to CHAR_MAX to indicate that there is no value specified in this locale. The possible values for 'p_sign_posn' and 'n_sign_posn' are given below.   
Value Explanation   
0 Currency and value are surrounded by parentheses.  
1 The sign should precede the value and currency symbol.  
2 The sign should follow the value and currency symbol.  
3 The sign should immediately precede the value.  
4 The sign should immediately follow the value.  
CHAR_MAX Nothing is specified in this locale.   The function sets temporarily the LC_CTYPE locale to the LC_NUMERIC locale or the LC_MONETARY locale if locales are different and numeric or monetary strings are non-ASCII. This temporary change affects other threads.  Changed in version 3.7: The function now sets temporarily the LC_CTYPE locale to the LC_NUMERIC locale in some cases.
locale.NOEXPR  
Get a regular expression that can be used with the regex(3) function to recognize a negative response to a yes/no question.
locale.normalize(localename)  
Returns a normalized locale code for the given locale name. The returned locale code is formatted for use with setlocale(). If normalization fails, the original name is returned unchanged. If the given encoding is not known, the function defaults to the default encoding for the locale code just like setlocale().
locale.RADIXCHAR  
Get the radix character (decimal dot, decimal comma, etc.).
locale.resetlocale(category=LC_ALL)  
Sets the locale for category to the default setting. The default setting is determined by calling getdefaultlocale(). category defaults to LC_ALL.
locale.setlocale(category, locale=None)  
If locale is given and not None, setlocale() modifies the locale setting for the category. The available categories are listed in the data description below. locale may be a string, or an iterable of two strings (language code and encoding). If it’s an iterable, it’s converted to a locale name using the locale aliasing engine. An empty string specifies the user’s default settings. If the modification of the locale fails, the exception Error is raised. If successful, the new locale setting is returned. If locale is omitted or None, the current setting for category is returned. setlocale() is not thread-safe on most systems. Applications typically start with a call of import locale
locale.setlocale(locale.LC_ALL, '')
 This sets the locale for all categories to the user’s default setting (typically specified in the LANG environment variable). If the locale is not changed thereafter, using multithreading should not cause problems.
locale.str(float)  
Formats a floating point number using the same format as the built-in function str(float), but takes the decimal point into account.
locale.strcoll(string1, string2)  
Compares two strings according to the current LC_COLLATE setting. As any other compare function, returns a negative, or a positive value, or 0, depending on whether string1 collates before or after string2 or is equal to it.
locale.strxfrm(string)  
Transforms a string to one that can be used in locale-aware comparisons. For example, strxfrm(s1) < strxfrm(s2) is equivalent to strcoll(s1, s2) < 0. This function can be used when the same string is compared repeatedly, e.g. when collating a sequence of strings.
locale.T_FMT  
Get a string that can be used as a format string for time.strftime() to represent a time in a locale-specific way.
locale.T_FMT_AMPM  
Get a format string for time.strftime() to represent time in the am/pm format.
locale.YESEXPR  
Get a regular expression that can be used with the regex function to recognize a positive response to a yes/no question.  Note The expression is in the syntax suitable for the regex() function from the C library, which might differ from the syntax used in re.
locals()  
Update and return a dictionary representing the current local symbol table. Free variables are returned by locals() when it is called in function blocks, but not in class blocks. Note that at the module level, locals() and globals() are the same dictionary.  Note The contents of this dictionary should not be modified; changes may not affect the values of local and free variables used by the interpreter.
logging.addLevelName(level, levelName)  
Associates level level with text levelName in an internal dictionary, which is used to map numeric levels to a textual representation, for example when a Formatter formats a message. This function can also be used to define your own levels. The only constraints are that all levels used must be registered using this function, levels should be positive integers and they should increase in increasing order of severity.  Note If you are thinking of defining your own levels, please see the section on Custom Levels.
logging.basicConfig(**kwargs)  
Does basic configuration for the logging system by creating a StreamHandler with a default Formatter and adding it to the root logger. The functions debug(), info(), warning(), error() and critical() will call basicConfig() automatically if no handlers are defined for the root logger. This function does nothing if the root logger already has handlers configured, unless the keyword argument force is set to True.  Note This function should be called from the main thread before other threads are started. In versions of Python prior to 2.7.1 and 3.2, if this function is called from multiple threads, it is possible (in rare circumstances) that a handler will be added to the root logger more than once, leading to unexpected results such as messages being duplicated in the log.  The following keyword arguments are supported.   
Format Description   
filename Specifies that a FileHandler be created, using the specified filename, rather than a StreamHandler.  
filemode If filename is specified, open the file in this mode. Defaults to 'a'.  
format Use the specified format string for the handler. Defaults to attributes levelname, name and message separated by colons.  
datefmt Use the specified date/time format, as accepted by time.strftime().  
style If format is specified, use this style for the format string. One of '%', '{' or '$' for printf-style, str.format() or string.Template respectively. Defaults to '%'.  
level Set the root logger level to the specified level.  
stream Use the specified stream to initialize the StreamHandler. Note that this argument is incompatible with filename - if both are present, a ValueError is raised.  
handlers If specified, this should be an iterable of already created handlers to add to the root logger. Any handlers which don’t already have a formatter set will be assigned the default formatter created in this function. Note that this argument is incompatible with filename or stream - if both are present, a ValueError is raised.  
force If this keyword argument is specified as true, any existing handlers attached to the root logger are removed and closed, before carrying out the configuration as specified by the other arguments.  
encoding If this keyword argument is specified along with filename, its value is used when the FileHandler is created, and thus used when opening the output file.  
errors If this keyword argument is specified along with filename, its value is used when the FileHandler is created, and thus used when opening the output file. If not specified, the value ‘backslashreplace’ is used. Note that if None is specified, it will be passed as such to func:open, which means that it will be treated the same as passing ‘errors’.    Changed in version 3.2: The style argument was added.   Changed in version 3.3: The handlers argument was added. Additional checks were added to catch situations where incompatible arguments are specified (e.g. handlers together with stream or filename, or stream together with filename).   Changed in version 3.8: The force argument was added.   Changed in version 3.9: The encoding and errors arguments were added.
logging.captureWarnings(capture)  
This function is used to turn the capture of warnings by logging on and off. If capture is True, warnings issued by the warnings module will be redirected to the logging system. Specifically, a warning will be formatted using warnings.formatwarning() and the resulting string logged to a logger named 'py.warnings' with a severity of WARNING. If capture is False, the redirection of warnings to the logging system will stop, and warnings will be redirected to their original destinations (i.e. those in effect before captureWarnings(True) was called).
logging.config.dictConfig(config)  
Takes the logging configuration from a dictionary. The contents of this dictionary are described in Configuration dictionary schema below. If an error is encountered during configuration, this function will raise a ValueError, TypeError, AttributeError or ImportError with a suitably descriptive message. The following is a (possibly incomplete) list of conditions which will raise an error:  A level which is not a string or which is a string not corresponding to an actual logging level. A propagate value which is not a boolean. An id which does not have a corresponding destination. A non-existent handler id found during an incremental call. An invalid logger name. Inability to resolve to an internal or external object.  Parsing is performed by the DictConfigurator class, whose constructor is passed the dictionary used for configuration, and has a configure() method. The logging.config module has a callable attribute dictConfigClass which is initially set to DictConfigurator. You can replace the value of dictConfigClass with a suitable implementation of your own. dictConfig() calls dictConfigClass passing the specified dictionary, and then calls the configure() method on the returned object to put the configuration into effect: def dictConfig(config):
    dictConfigClass(config).configure()
 For example, a subclass of DictConfigurator could call DictConfigurator.__init__() in its own __init__(), then set up custom prefixes which would be usable in the subsequent configure() call. dictConfigClass would be bound to this new subclass, and then dictConfig() could be called exactly as in the default, uncustomized state.  New in version 3.2.
logging.config.fileConfig(fname, defaults=None, disable_existing_loggers=True)  
Reads the logging configuration from a configparser-format file. The format of the file should be as described in Configuration file format. This function can be called several times from an application, allowing an end user to select from various pre-canned configurations (if the developer provides a mechanism to present the choices and load the chosen configuration).  Parameters 
 
fname – A filename, or a file-like object, or an instance derived from RawConfigParser. If a RawConfigParser-derived instance is passed, it is used as is. Otherwise, a Configparser is instantiated, and the configuration read by it from the object passed in fname. If that has a readline() method, it is assumed to be a file-like object and read using read_file(); otherwise, it is assumed to be a filename and passed to read(). 
defaults – Defaults to be passed to the ConfigParser can be specified in this argument. 
disable_existing_loggers – If specified as False, loggers which exist when this call is made are left enabled. The default is True because this enables old behaviour in a backward-compatible way. This behaviour is to disable any existing non-root loggers unless they or their ancestors are explicitly named in the logging configuration.     Changed in version 3.4: An instance of a subclass of RawConfigParser is now accepted as a value for fname. This facilitates:  Use of a configuration file where logging configuration is just part of the overall application configuration. Use of a configuration read from a file, and then modified by the using application (e.g. based on command-line parameters or other aspects of the runtime environment) before being passed to fileConfig.
logging.config.listen(port=DEFAULT_LOGGING_CONFIG_PORT, verify=None)  
Starts up a socket server on the specified port, and listens for new configurations. If no port is specified, the module’s default DEFAULT_LOGGING_CONFIG_PORT is used. Logging configurations will be sent as a file suitable for processing by dictConfig() or fileConfig(). Returns a Thread instance on which you can call start() to start the server, and which you can join() when appropriate. To stop the server, call stopListening(). The verify argument, if specified, should be a callable which should verify whether bytes received across the socket are valid and should be processed. This could be done by encrypting and/or signing what is sent across the socket, such that the verify callable can perform signature verification and/or decryption. The verify callable is called with a single argument - the bytes received across the socket - and should return the bytes to be processed, or None to indicate that the bytes should be discarded. The returned bytes could be the same as the passed in bytes (e.g. when only verification is done), or they could be completely different (perhaps if decryption were performed). To send a configuration to the socket, read in the configuration file and send it to the socket as a sequence of bytes preceded by a four-byte length string packed in binary using struct.pack('>L', n).  Note Because portions of the configuration are passed through eval(), use of this function may open its users to a security risk. While the function only binds to a socket on localhost, and so does not accept connections from remote machines, there are scenarios where untrusted code could be run under the account of the process which calls listen(). Specifically, if the process calling listen() runs on a multi-user machine where users cannot trust each other, then a malicious user could arrange to run essentially arbitrary code in a victim user’s process, simply by connecting to the victim’s listen() socket and sending a configuration which runs whatever code the attacker wants to have executed in the victim’s process. This is especially easy to do if the default port is used, but not hard even if a different port is used). To avoid the risk of this happening, use the verify argument to listen() to prevent unrecognised configurations from being applied.   Changed in version 3.4: The verify argument was added.   Note If you want to send configurations to the listener which don’t disable existing loggers, you will need to use a JSON format for the configuration, which will use dictConfig() for configuration. This method allows you to specify disable_existing_loggers as False in the configuration you send.
logging.config.stopListening()  
Stops the listening server which was created with a call to listen(). This is typically called before calling join() on the return value from listen().
logging.critical(msg, *args, **kwargs)  
Logs a message with level CRITICAL on the root logger. The arguments are interpreted as for debug().
logging.disable(level=CRITICAL)  
Provides an overriding level level for all loggers which takes precedence over the logger’s own level. When the need arises to temporarily throttle logging output down across the whole application, this function can be useful. Its effect is to disable all logging calls of severity level and below, so that if you call it with a value of INFO, then all INFO and DEBUG events would be discarded, whereas those of severity WARNING and above would be processed according to the logger’s effective level. If logging.disable(logging.NOTSET) is called, it effectively removes this overriding level, so that logging output again depends on the effective levels of individual loggers. Note that if you have defined any custom logging level higher than CRITICAL (this is not recommended), you won’t be able to rely on the default value for the level parameter, but will have to explicitly supply a suitable value.  Changed in version 3.7: The level parameter was defaulted to level CRITICAL. See bpo-28524 for more information about this change.
logging.error(msg, *args, **kwargs)  
Logs a message with level ERROR on the root logger. The arguments are interpreted as for debug().
logging.exception(msg, *args, **kwargs)  
Logs a message with level ERROR on the root logger. The arguments are interpreted as for debug(). Exception info is added to the logging message. This function should only be called from an exception handler.