generative_ai.dataset_generation.step_1_generation module#

Define functionalities to extract details of docstrings.

get_all_member_details(module_name: str, member_name: str, member_object: Any) MemberDetails#

Extract all details of a module object.

Parameters:
  • module_name (str) -- fully qualified name of the module

  • member_name (str) -- name of the object

  • member_object (_type_) -- original object

Returns:

all details of the object

Return type:

MemberDetails

get_all_module_contents(module_name: str) ModuleDetails#

Extract all details of a module.

Parameters:

module_name (str) -- name of the module to import with

Returns:

details of the module

Return type:

ModuleDetails

get_all_package_contents(package_name: str) list[PackageDetails]#

Extract all details of a root package.

Parameters:

package_name (str) -- name of the root package to import with

Returns:

all details of the root package and its sub-packages

Return type:

list[PackageDetails]

get_all_parameters_details(signature: Signature, docstring: NumpyDocString) list[ParameterDetails]#

Extract all details of arguments of a function or a method.

Parameters:
  • signature (inspect.Signature) -- input and output of the function or method

  • docstring (NumpyDocString) -- documentation of the function or method

Returns:

all details of the arguments of the function or method

Return type:

list[ParameterDetails]

import_package(package_name: str) module#

Load a package from its name.

Parameters:

package_name (str) -- name of the package to import with

Returns:

the loaded package

Return type:

types.ModuleType

Raises:

ValueError -- if the package could not be found