


"""simple docstring"""







# This code is adapted from OpenAI's release
# https://github.com/openai/human-eval/blob/master/human_eval/execution.py

import contextlib
import faulthandler
import io
import multiprocessing
import os
import platform
import signal
import tempfile
def _A						(						lowercase	,   lowercase	,   lowercase	,   lowercase		):







    """simple docstring"""
    a					=multiprocessing.Manager()
    a					=manager.list()

    a					=multiprocessing.Process(target=lowercase	,   args=(check_program, result, timeout)		)
    p.start()
    p.join(timeout=timeout + 1		)
    if p.is_alive():
        p.kill()

    if not result:
        result.append('''timed out'''		)

    return {
        "task_id": task_id,
        "passed": result[0] == "passed",
        "result": result[0],
        "completion_id": completion_id,
    }
def _A						(						lowercase	,   lowercase	,   lowercase		):







    """simple docstring"""
    with create_tempdir():
        # These system calls are needed when cleaning up tempdir.
        import os
        import shutil

        a					=shutil.rmtree
        a					=os.rmdir
        a					=os.chdir

        # Disable functionalities that can make destructive changes to the test.
        reliability_guard()

        # Run program.
        try:
            a					={}
            with swallow_io():
                with time_limit(lowercase		):
                    exec(lowercase	,   lowercase		)
            result.append('''passed'''		)
        except TimeoutException:
            result.append('''timed out'''		)
        except BaseException as e:
            result.append(f'''failed: {e}'''		)

        # Needed for cleaning up.
        a					=rmtree
        a					=rmdir
        a					=chdir
@contextlib.contextmanager
def _A						(						lowercase		):







    """simple docstring"""
    def signal_handler(lowercase	,   lowercase		):
        raise TimeoutException('''Timed out!'''		)

    signal.setitimer(signal.ITIMER_REAL	,   lowercase		)
    signal.signal(signal.SIGALRM	,   lowercase		)
    try:
        yield
    finally:
        signal.setitimer(signal.ITIMER_REAL	,   0		)
@contextlib.contextmanager
def _A						(						):







    """simple docstring"""
    a					=WriteOnlyStringIO()
    with contextlib.redirect_stdout(lowercase		):
        with contextlib.redirect_stderr(lowercase		):
            with redirect_stdin(lowercase		):
                yield
@contextlib.contextmanager
def _A						(						):







    """simple docstring"""
    with tempfile.TemporaryDirectory() as dirname:
        with chdir(lowercase		):
            yield dirname






class 				__A    (	_SCREAMING_SNAKE_CASE      ):






 """simple docstring"""




 pass






class 				__A    (	io.StringIO      ):






 """simple docstring"""




 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					Dict:
     raise OSError


 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					Optional[Any]:
     raise OSError


 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					Union[str, Any]:
     raise OSError





 def 				SCREAMING_SNAKE_CASE							(		self			,   *__A			,   **__A						) ->					List[str]:
     return False






class 				__A    (	contextlib._RedirectStream      ):  # type: ignore






 """simple docstring"""




 __lowerCAmelCase			 =  "stdin"

@contextlib.contextmanager
def _A						(						lowercase		):







    """simple docstring"""
    if root == ".":
        yield
        return
    a					=os.getcwd()
    os.chdir(lowercase		)
    try:
        yield
    except BaseException as exc:
        raise exc
    finally:
        os.chdir(lowercase		)





def _A						(						lowercase=None		):







    """simple docstring"""

    if maximum_memory_bytes is not None:
        import resource

        resource.setrlimit(resource.RLIMIT_AS	,   (maximum_memory_bytes, maximum_memory_bytes)		)
        resource.setrlimit(resource.RLIMIT_DATA	,   (maximum_memory_bytes, maximum_memory_bytes)		)
        if not platform.uname().system == "Darwin":
            resource.setrlimit(resource.RLIMIT_STACK	,   (maximum_memory_bytes, maximum_memory_bytes)		)

    faulthandler.disable()

    import builtins

    a					=None
    a					=None

    import os

    a					='''1'''

    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None
    a					=None

    import shutil

    a					=None
    a					=None
    a					=None

    import subprocess

    a					=None  # type: ignore

    a					=None

    import sys

    a					=None
    a					=None
    a					=None
    a					=None
    a					=None



"""simple docstring"""







from __future__ import annotations
def _A						(						lowercase	,   lowercase	,   lowercase	,   ):







    """simple docstring"""
    if (electron_conc, hole_conc, intrinsic_conc).count(0		) != 1:
        raise ValueError('''You cannot supply more or less than 2 values'''		)
    elif electron_conc < 0:
        raise ValueError('''Electron concentration cannot be negative in a semiconductor'''		)
    elif hole_conc < 0:
        raise ValueError('''Hole concentration cannot be negative in a semiconductor'''		)
    elif intrinsic_conc < 0:
        raise ValueError(
            '''Intrinsic concentration cannot be negative in a semiconductor'''		)
    elif electron_conc == 0:
        return (
            "electron_conc",
            intrinsic_conc**2 / hole_conc,
        )
    elif hole_conc == 0:
        return (
            "hole_conc",
            intrinsic_conc**2 / electron_conc,
        )
    elif intrinsic_conc == 0:
        return (
            "intrinsic_conc",
            (electron_conc * hole_conc) ** 0.5,
        )
    else:
        return (-1, -1)


if __name__ == "__main__":
       import doctest

       doctest.testmod()