The ____ module in Python provides a way to measure the approximate CPU time used by a process.

  • cpu
  • os
  • sys
  • time
The time module in Python provides functions for working with time, including measuring the approximate CPU time used by a process using functions like time.process_time().

The ____ sort algorithm repeatedly divides the list into two halves until each sub-list contains a single element.

  • Bubble
  • Insertion
  • Merge
  • Quick
The Merge Sort algorithm repeatedly divides the list into two halves until each sub-list contains a single element and then merges them back together in a sorted manner. It is known for its stable and efficient sorting.

The ____ statement in Python is used to verify if a given logical expression is true and raise an error if it’s false.

  • assert
  • check
  • confirm
  • validate
In Python, the assert statement is used for debugging and testing. It checks whether a given logical expression is true and raises an AssertionError if it's false, helping to catch bugs early.

The ____ statement is used to bring in an entire module into the current namespace.

  • from module import *
  • import all
  • import module
  • module import
In Python, you can use the from module import * statement to bring in all definitions from a module into the current namespace. However, it is generally recommended to use import module or from module import name to import specific functions or classes from a module.

The ____ method in Python is used to initialize a newly created object and is called every time the class is instantiated.

  • constructor
  • destructor
  • generator
  • initializer
The "constructor" method in Python is used to initialize a newly created object and is called every time the class is instantiated. This method is typically named __init__ in Python classes.

The ____ method in Python web frameworks is used to handle HTTP POST requests from the client.

  • DELETE
  • GET
  • POST
  • PUT
In Python web frameworks like Flask and Django, the POST method is used to handle HTTP POST requests from the client. This method is commonly used for submitting data to the server, such as form submissions.

The ____ method in Seaborn is used to draw a box plot to show distributions with respect to categories.

  • boxplot
  • categoryplot
  • drawbox
  • plot_box
In Seaborn, the boxplot method is used to draw a box plot, also known as a box-and-whisker plot. This type of plot is valuable for visualizing the distribution of data, including measures such as median, quartiles, and outliers, across different categories or groups.

The ____ method in TensorFlow or PyTorch is used to apply gradients to variables.

  • apply_gradients
  • backpropagate
  • compute_gradients
  • optimize
In TensorFlow and PyTorch, the apply_gradients method is used to apply gradients to variables. Gradients represent the direction and magnitude of changes needed to optimize a model's parameters during training. The apply_gradients method is an essential step in the optimization process.

The ____ method in the unittest framework is used to clean up the resources used during the test.

  • cleanup
  • finalize
  • setUp
  • tearDown
In the unittest framework, the tearDown method is used to clean up any resources or perform cleanup tasks after a test has been executed. It is often used to release resources like file handles, database connections, or temporary files created during the test.

The ____ function in the functools module is used to transform a method into a class method decorator.

  • classmethod
  • decorator
  • method2class
  • staticmethod
The classmethod function in the functools module is used to transform a method into a class method decorator. Class methods can be called on the class itself rather than on instances of the class.