-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #36 from HemanthSai7/main
Frontend
- Loading branch information
Showing
11 changed files
with
43 additions
and
160 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,110 +1,18 @@ | ||
def add(a, b): | ||
""" | ||
This function adds two numbers. | ||
Arguments: | ||
a (int): The first number to be added. | ||
b (int): The second number to be added. | ||
Returns: | ||
int: The sum of the two numbers. | ||
""" | ||
'\n This function adds two numbers.\n\n Arguments:\n a (int): The first number to be added.\n b (int): The second number to be added.\n\n Returns:\n int: The sum of the two numbers.\n ' | ||
'\n This function adds two numbers.\n\n Arguments:\n a (int): The first number to be added.\n b (int): The second number to be added.\n\n Returns:\n int: The sum of the two numbers.\n ' | ||
return a + b | ||
|
||
def multiply(a, b): | ||
""" | ||
This function multiplies two numbers. | ||
Args: | ||
a: A number to be multiplied. | ||
This should be a numeric value (int or float). | ||
b: Another number to be multiplied. | ||
This should be a numeric value (int or float). | ||
Returns: | ||
The product of the two numbers. | ||
This will be a numeric value (int or float), representing the result of the multiplication. | ||
Raises: | ||
None | ||
""" | ||
'\n This function multiplies two numbers.\n\n Args:\n a: A number to be multiplied.\n This should be a numeric value (int or float).\n b: Another number to be multiplied.\n This should be a numeric value (int or float).\n\n Returns:\n The product of the two numbers.\n This will be a numeric value (int or float), representing the result of the multiplication.\n\n Raises:\n None\n\n ' | ||
'\n This function multiplies two numbers.\n\n Args:\n a: A number to be multiplied.\n b: Another number to be multiplied.\n\n Returns:\n The product of the two numbers.\n ' | ||
return a * b | ||
|
||
def subtract(a, b): | ||
""" | ||
Subtracts the second number from the first. | ||
Args: | ||
a (int): The first number to be subtracted. | ||
b (int): The second number to be subtracted from the first. | ||
Returns: | ||
int: The result of the subtraction. | ||
""" | ||
'\n Subtracts the second number from the first.\n\n Args:\n a (int): The first number to be subtracted.\n b (int): The second number to be subtracted from the first.\n\n Returns:\n int: The result of the subtraction.\n ' | ||
'\ndef subtract(a, b):\n ' | ||
return a - b | ||
|
||
def divide(a, b): | ||
""" | ||
This function divides the first argument by the second argument. | ||
Arguments: | ||
a (float): The first number to be divided. | ||
b (float): The second number to be divided. | ||
Raises: | ||
ValueError: If the second argument is zero, it raises a ValueError with the message 'Cannot divide by zero'. | ||
Returns: | ||
float: The result of the division of the first argument by the second argument. | ||
""" | ||
"\n This function divides the first argument by the second argument.\n\n Arguments:\n a (float): The first number to be divided.\n b (float): The second number to be divided.\n\n Raises:\n ValueError: If the second argument is zero, it raises a ValueError with the message 'Cannot divide by zero'.\n\n Returns:\n float: The result of the division of the first argument by the second argument.\n " | ||
"\n This function divides the first argument by the second argument.\n\n Arguments:\n a -- The first number to be divided. It should be of type float.\n b -- The second number to be divided. It should be of type float.\n\n Raises:\n ValueError -- If the second argument is zero, it raises a ValueError with the message 'Cannot divide by zero'.\n\n Returns:\n float -- The result of the division of the first argument by the second argument.\n " | ||
if b == 0: | ||
raise ValueError('Cannot divide by zero') | ||
return a / b | ||
|
||
def func(*args, **kwargs): | ||
""" | ||
This function searches for specified terms within the input string using a specified search type. | ||
Parameters: | ||
- input_string (str): The string to search within. | ||
- search_terms (list): A list of strings to search for within the input_string. | ||
- search_type (str, optional): Specifies how the search_terms should be searched within the input_string. | ||
Possible values: 'AND' (all search_terms must be present in the input_string), 'OR' (at least one search_term must be present in the input_string). Default is 'AND'. | ||
Returns: | ||
- search_results (list): A list of all occurrences of the search_terms within the input_string. | ||
Raises: | ||
- ValueError: If the search_type is not 'AND' or 'OR'. | ||
""" | ||
"\nUsage: query(input_string, search_terms, search_type='AND')\n\nThis function searches for specified terms within the input string using a specified search type.\n\nParameters:\n- input_string (str): The string to search within.\n- search_terms (list): A list of strings to search for within the input_string.\n- search_type (str, optional): Specifies how the search_terms should be searched within the input_string.\n Possible values: 'AND' (all search_terms must be present in the input_string), 'OR' (at least one search_term must be present in the input_string). Default is 'AND'.\n\nReturns:\n- search_results (list): A list of all occurrences of the search_terms within the input_string.\n\nRaises:\n- ValueError: If the search_type is not 'AND' or 'OR'.\n" | ||
"\nUsage: func(*args, **kwargs)\n\nThis function returns a wrapper function that calls the original function.\n\nParameters:\n- args (tuple): A tuple of non-keyworded arguments to pass to the function.\n- kwargs (dict): A dictionary of keyworded arguments to pass to the function.\n\nReturns:\n- wrapper (function): A new function that calls the original function with the given arguments.\n\nRaises:\n- TypeError: If the arguments passed to the wrapper function do not match the original function's signature.\n" | ||
|
||
def wrapper(*args, **kwargs): | ||
""" | ||
This function acts as a wrapper for another function, allowing it to be called with a variety of arguments. | ||
Arguments: | ||
*args (list): any number of positional arguments (default: None) | ||
**kwargs (dict): any number of keyword arguments (default: None) | ||
Returns: | ||
Whatever the wrapped function returns (default: None) | ||
Raises: | ||
Whatever exceptions the wrapped function raises (default: None) | ||
TypeError: If any argument is not of the expected type. | ||
""" | ||
'\n This function performs a specific operation on the given arguments.\n\n Arguments:\n arg1 -- a string argument (default: None)\n arg2 -- an integer argument (default: None)\n arg3 -- a floating point number argument (default: None)\n arg4 -- a boolean argument (default: None)\n\n Returns:\n None\n\n Raises:\n TypeError -- If any argument is not of the expected type.\n ' | ||
'\n This function acts as a wrapper for another function, allowing it to be called with a variety of arguments.\n\n Arguments:\n *args -- any number of positional arguments (default: None)\n **kwargs -- any number of keyword arguments (default: None)\n\n Returns:\n Whatever the wrapped function returns (default: None)\n\n Raises:\n Whatever exceptions the wrapped function raises (default: None)\n ' | ||
return func(*args, **kwargs) | ||
return wrapper |