"""
This type stub file was generated by pyright.
"""

import os
from typing import Union
from .. import constants as const

"""
This type stub file was generated by pyright.
"""
def get_operating_system():
    ...

def get_arch():
    ...

operating_system = ...
arch = ...
log = ...
devnull = ...
to_string = ...
class PulpSolverError(const.PulpError):
    """
    Pulp Solver-related exceptions
    """
    ...


class LpSolver:
    """A generic LP Solver"""
    name = ...
    def __init__(self, mip=..., msg=..., options=..., timeLimit=..., *args, **kwargs) -> None:
        """
        :param bool mip: if False, assume LP even if integer variables
        :param bool msg: if False, no log is shown
        :param list options:
        :param float timeLimit: maximum time for solver (in seconds)
        :param args:
        :param kwargs: optional named options to pass to each solver,
                        e.g. gapRel=0.1, gapAbs=10, logPath="",
        """
        ...
    
    def available(self):
        """True if the solver is available"""
        ...
    
    def actualSolve(self, lp):
        """Solve a well formulated lp problem"""
        ...
    
    def actualResolve(self, lp, **kwargs):
        """
        uses existing problem information and solves the problem
        If it is not implemented in the solver
        just solve again
        """
        ...
    
    def copy(self):
        """Make a copy of self"""
        ...
    
    def solve(self, lp):
        """Solve the problem lp"""
        ...
    
    def getCplexStyleArrays(self, lp, senseDict=..., LpVarCategories=..., LpObjSenses=..., infBound=...):
        """returns the arrays suitable to pass to a cdll Cplex
        or other solvers that are similar

        Copyright (c) Stuart Mitchell 2007
        """
        ...
    
    def toDict(self):
        ...
    
    to_dict = ...
    def toJson(self, filename, *args, **kwargs):
        ...
    
    to_json = ...


class LpSolver_CMD(LpSolver):
    """A generic command line LP Solver"""
    name = ...
    def __init__(self, path=..., keepFiles=..., *args, **kwargs) -> None:
        """

        :param bool mip: if False, assume LP even if integer variables
        :param bool msg: if False, no log is shown
        :param list options: list of additional options to pass to solver (format depends on the solver)
        :param float timeLimit: maximum time for solver (in seconds)
        :param str path: a path to the solver binary
        :param bool keepFiles: if True, files are saved in the current directory and not deleted after solving
        :param args: parameters to pass to :py:class:`LpSolver`
        :param kwargs: parameters to pass to :py:class:`LpSolver`
        """
        ...
    
    def copy(self):
        """Make a copy of self"""
        ...
    
    def setTmpDir(self):
        """Set the tmpDir attribute to a reasonnable location for a temporary
        directory"""
        ...
    
    def create_tmp_files(self, name, *args):
        ...
    
    def silent_remove(self, file: Union[str, bytes, os.PathLike]) -> None:
        ...
    
    def delete_tmp_files(self, *args):
        ...
    
    def defaultPath(self):
        ...
    
    @staticmethod
    def executableExtension(name):
        ...
    
    @staticmethod
    def executable(command):
        """Checks that the solver command is executable,
        And returns the actual path to it."""
        ...
    
    def get_pipe(self):
        ...
    


def ctypesArrayFill(myList, type=...):
    """
    Creates a c array with ctypes from a python list
    type is the type of the c array
    """
    ...

