def check_import(all_imports):
    dependent_modules = set()
    dependent_lines = dict()
    for import_code in all_imports:
        python_cmd = "python -c '{}'".format(import_code)
        p = subprocess.Popen(python_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        (stdout, stderr) = p.communicate()
        if (p.returncode != 0):
            stdout = stdout.decode('utf-8').strip().split('\n')
            for line in stdout:
                if line.startswith('ModuleNotFoundError:'):
                    require_module = line.strip().split(' ')[(- 1)].strip("'").split('.')[0]
                    print('{}: {}'.format(require_module, import_code))
                    if (require_module in CUSTOM_MODULES):
                        pass
                    else:
                        dependent_modules.add(require_module)
                        dependent_lines[require_module] = import_code
    return (dependent_modules, dependent_lines)
def check_import(all_imports):
    dependent_modules = set()
    dependent_lines = dict()
    for import_code in all_imports:
        python_cmd = "python -c '{}'".format(import_code)
        p = subprocess.Popen(python_cmd, shell=True, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
        (stdout, stderr) = p.communicate()
        if (p.returncode != 0):
            stdout = stdout.decode('utf-8').strip().split('\n')
            for line in stdout:
                if line.startswith('ModuleNotFoundError:'):
                    require_module = line.strip().split(' ')[(- 1)].strip("'").split('.')[0]
                    print('{}: {}'.format(require_module, import_code))
                    if (require_module in CUSTOM_MODULES):
                        pass
                    else:
                        dependent_modules.add(require_module)
                        dependent_lines[require_module] = import_code
    return (dependent_modules, dependent_lines)