Skip to content

Core Functions

Rose Heart edited this page Feb 23, 2026 · 2 revisions

Introcuction

Imagine you have a helpful assistant that quietly takes care of many small but important tasks behind the scenes whenever you work with text or your computer system. This library is like that assistant, designed to make everyday digital chores simpler and more reliable without requiring any special technical knowledge. It handles the kind of routine work that often gets overlooked but can cause headaches if done poorly, like making sure text looks clean and consistent no matter where it comes from. Whether you're dealing with messy documents, preparing information for reports, or just trying to keep your computer running smoothly, this tool works in the background to save you time and frustration.

One of its main jobs is to tidy up text in ways that feel almost magical. Picture copying a paragraph from a website only to find strange quotation marks, unexpected symbols, or inconsistent spacing that makes the words hard to read. This library gently transforms all that into neat, uniform text that looks the way you'd expect-replacing odd characters with familiar ones, removing distracting punctuation, and breaking things down into clear words. It's like having an invisible editor that polishes your content without changing its meaning, so you can focus on what the words say rather than how they appear.

Beyond text, the library also helps your computer manage its workload wisely, especially when it's busy with many tasks at once. Think of it as a thoughtful coordinator that notices when your system is under pressure and automatically adjusts how it handles requests-slowing down slightly during peak times to avoid overwhelming things, then speeding back up when there's more room to breathe. This keeps everything running steadily whether you're working on a simple project or something more demanding, all without you needing to lift a finger or understand how it's done.

At its heart, this library is about removing small obstacles that slow people down. It doesn't require you to learn complex commands or wrestle with technical details; it simply works quietly to handle the fiddly parts of digital work. By taking care of text cleanup, system balancing, and other everyday essentials, it lets you move forward with your real tasks-writing, analyzing, creating-without getting stuck on the background noise of computing. It's the kind of practical help that makes technology feel more like a seamless partner than a puzzle to solve.


Functions

def DecodeHashCodes(input_string):

The DecodeHashCodes function serves as a helpful translator for text that contains special numeric codes. Imagine you receive a message where certain letters or symbols appear as mysterious sequences like ampersand hash sixty five semicolon. These codes are actually digital placeholders used in web content and documents to represent characters safely. The function quietly examines any text you provide and automatically converts these numeric sequences back into their intended visible characters. This makes the text readable again without requiring manual intervention or technical expertise from the user.

When processing your input, the function carefully identifies each numeric code pattern within the text. It recognizes these patterns by their distinctive structure starting with an ampersand followed by a hash mark, then a series of numbers, and ending with a semicolon. For each identified pattern, it calculates what actual character the numbers represent using standard digital encoding rules. If the numbers correspond to a valid character like a letter or symbol, it seamlessly substitutes the code with that character. Should it encounter an invalid or problematic code, it thoughtfully leaves the original sequence intact rather than causing errors or unexpected results.

This capability proves particularly valuable when handling text extracted from websites or digital documents where special characters often appear in encoded form. By transforming these numeric references into regular readable characters, the function ensures your text displays correctly across different applications and devices. It operates unobtrusively in the background, requiring no special instructions or configuration from you while reliably producing clean, human-friendly text ready for everyday use. The entire process happens instantly and smoothly, turning what might look like computer gibberish into clear, understandable language.


def DecodeHashCodes(input_string):

Non-technical

This function takes a piece of text that might contain special numeric codes representing letters or symbols and converts those codes back into the actual readable characters they stand for, making the text clear and natural to read while leaving any unrecognized codes unchanged.

Technical

  • input_string: Represents the text containing encoded numeric character references to be converted; must be a string; the function processes this text to replace valid codes like A with their corresponding characters, directly determining the output's readability.

Returns

Returns a string with all valid numeric character references replaced by their corresponding characters; invalid references remain unchanged in the resulting string.


def DecodeUnicode(text):

Non-technical

This tool quietly transforms text by replacing fancy punctuation and special symbols with their simpler, everyday equivalents, ensuring your writing remains clear and universally compatible across different platforms without unexpected formatting quirks.

Technical

  • text: A string representing the original content to process; the function scans this input for specific Unicode characters like curly quotes or special dashes and replaces them with basic ASCII alternatives, directly determining which symbols get converted in the final output.

Returns

Returns a string containing the processed text where all specified Unicode characters have been substituted with their simplified ASCII counterparts.


def Yesterday(ds=None):

Non-technical

This function helps you quickly determine what date fell exactly one day before any given date you're considering, whether you're thinking about today or a specific past or future date you provide, and it always gives you the answer in a clear, standardized year-month-day format that's easy to read and use.

Technical

  • ds: An optional string representing a specific reference date in 'YYYY-MM-DD' format; when supplied, the function calculates the previous day relative to this date instead of using the current date.

Returns

Returns a string in the format 'YYYY-MM-DD' representing the calendar date of the day immediately preceding the reference date.


def GetLoadAVG():

Non-technical

This function checks how busy your computer is right now by looking at the system's recent workload over the last one, five, and fifteen minutes, then provides these three numbers along with some additional details about active tasks so you can understand if your machine is running smoothly or needs attention.

Technical

  • No arguments required.

Returns

Returns a list of strings containing the system's current load averages for the past one, five, and fifteen minutes, along with process statistics such as the number of running processes and the total number of processes.


def renice(n):

Non-technical

This function helps your application run more smoothly alongside other tasks on your computer by adjusting how urgently it requests attention from the processor, ensuring it doesn't interfere with your other activities while maintaining balanced performance across all running software.

Technical

  • n: An integer representing the desired priority level for the current process, where lower values increase urgency (claiming more processing time) and higher values decrease urgency (yielding resources to other tasks), directly determining how the operating system schedules the application relative to competing processes.

Returns

Returns None.


def ElasticSleep(s,Fuzzy=True):

Non-technical

This function temporarily pauses your program's activity for a specified amount of time while intelligently observing your computer's current workload; if your system is under heavy strain, it gently extends the pause to prevent overwhelming the machine, but if everything is running smoothly, it keeps the break nearly as brief as you requested, and you can choose to skip this automatic adjustment for a perfectly precise pause when needed.

Technical

  • s represents the base duration of the pause in seconds as a number (float or integer), determining the minimum time the program will wait before continuing, with longer actual pauses occurring when system load is high if fuzzy mode is active.
  • Fuzzy is a boolean value (True or False) controlling whether the pause adapts to system conditions, where True enables automatic extension of the wait time during heavy computer usage while False enforces an exact, unadjusted pause matching the specified duration.

Returns

Returns None.


def ElasticDelay():

Non-technical

This function automatically adjusts how long a program should wait before continuing by checking how busy the computer is at that moment, making the pause longer when the system is overloaded to prevent slowdowns and keeping it shorter when resources are freely available to maintain smooth and efficient operation.

Technical

  • No arguments required.

Returns

Returns an integer representing the dynamically calculated delay duration in milliseconds.


def NumberOnly(s):

Non-technical

This tool checks if the text you provide can be interpreted as a valid number by accounting for common substitutions where letters like O or I are used in place of digits and by recognizing number symbols from various international writing systems. It ignores spaces and verifies that every character is a valid numeric symbol including decimal points and commas, then confirms the entire text forms a proper number, ultimately giving you a straightforward yes or no answer about whether it qualifies as a number.

Technical

  • s: The text to validate as a number. Must be a string. The function's result depends entirely on whether this text, after considering common digit substitutions and international digit forms, represents a valid numeric value.

Returns

Returns a boolean value: True if the input string is a valid number representation, False otherwise.


def StripPunctuation(text):

Non-technical

This function cleans up written text by removing all punctuation marks and special symbols, replacing them with spaces so the words remain separated and readable. It helps prepare text for tasks like counting words or analyzing content by eliminating distracting characters such as commas, exclamation points, or foreign language symbols, making the text smoother and more consistent for further use.

Technical

  • text: The input string containing the text to be processed; must be a string; determines which punctuation and special characters get replaced with spaces in the output.

Returns

Returns a string where all punctuation marks and high ASCII characters (non-standard symbols) have been replaced with spaces.


def jsonFilter(s,FilterSpace=True):

Non-technical

This function smooths out rough text by erasing troublesome hidden characters like line breaks and tabs that can disrupt data handling, and it gives you the option to also remove spaces for an even cleaner result, making your text ready for reliable use in structured formats without unexpected formatting issues.

Technical

  • s: The input text to process; must be a string; the function will remove specified characters from this text.
  • FilterSpace: A boolean value that determines if spaces should be removed; defaults to True; when True, spaces are removed from the result, when False, spaces remain preserved in the output.

Returns

Returns a string containing the cleaned text with newline, tab, carriage return, and non-breaking space characters always removed, plus regular spaces removed only when the FilterSpace parameter is set to True.


def GetWordList(text):

GetOpenRouter/355: Expecting value: line 479 column 1 (char 2629) JumpTable ERROR: 442/cannot unpack non-iterable NoneType object: Check token file

Non-technical

This function takes any piece of written text and neatly organizes it into a collection of individual words, all converted to lowercase letters while carefully removing any blank spaces or empty entries so you're left with a tidy and usable list of meaningful words ready for whatever task comes next.

Technical

  • text: A string representing the raw input text to be processed; the function uses this content to extract and prepare words for the output list.

Returns

Returns a list of strings, each string being a non-empty word (in lowercase) from the input text.


def IsSTDIN():

Non-technical

This function quickly checks if someone has typed something on the keyboard or if data is arriving through a connection within a very brief moment of waiting, so the program can decide whether to pause for that input or smoothly continue with other tasks without getting stuck.

Technical

No arguments required.

Returns

Returns a list. The list contains the standard input file descriptor if input is available within the one-second timeout period; otherwise, it is empty.