Patients must have had prior treatment with anti-PD or anti-PD-L agents and had documented disease progression either while on these agents or after stopping therapy with these agents without intervening therapy; patients must have discontinued anti-PD- or anti-PD-L therapy at least days prior to registration Patients must not have had systemic therapy, excluding anti-PD- or anti-PD-L agents, within days prior to registration Prior treatment with lenvatinib or any PD-, anti-PD-L, or anti-PD-L agent, excluding melanoma and NSCLC where prior treatment with one PD-, anti-PD-L, or anti-PD-L agent is allowed No prior therapy with a CDK / inhibitor; prior anti-PD- and anti-PD-L therapy is permitted Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Subject has already received one of the following therapy/treatment: anti-PD-, anti-PD-L, or anti-PD-L inhibitor. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L, or HSP inhibitor Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent; has been on any prior Merck MK- (pembrolizumab) studies Refractory to prior anti-PD-/PD-L agent The subject has received prior pembrolizumab or any other anti-PD-, anti-PD-L, or anti-PD-L therapy, or has participated in any prior studies involving pembrolizumab Prior treatment with lenvatinib or any anti-PD-, anti-PD-L, or anti-PD-L agent Intolerance to prior anti-PD-/PD-L therapy Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent; please contact the principal investigator for further clarification if needed Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent COHORT : Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent COHORT : Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Prior exposure to an anti-PD-, anti-PD-L or anti-PD-L Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent (only cohort A) Prior therapy with a PD-, anti-PD-Ligand (PD-L), or anti-PD-L agent, or previously participated in Merck pembrolizumab (MK-) study Previous treatment with any anti-PD-, PD-L, or PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or with an agent directed to another co-inhibitory T-cell receptor. Received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Patients who have received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent are not eligible Prior disease progression on anti-PD- therapy Previous treatment with any anti-PD-, PD-L, or PD-L agent Received prior therapy with an anti-CTLA-, anti-PD-, anti-PD-ligand- (anti-PD-L), or anti-PD- ligand- (anti-PD-L) agent within weeks prior to initiation of study treatment depending on study part Prior treatment with anti-PD- or PD-L therapies The participant has received prior pembrolizumab or any other anti-PD-, anti-PD-L, or anti-PD-L therapy, or has participated in any prior studies involving pembrolizumab Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent\r\n* This criterion does not apply to eligibility for second course treatment Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent. Prior immunotherapy including anti-PD-, anti-PD-L, or anti-PD-L agents Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or with an agent directed to another stimulatory or co-inhibitory T-cell receptor (eg, CTLA-, OX-, CD) Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent For Parts B and C, patients who received previous anti- PD-, anti-PD-(L) treatment Patients may not have received prior anti PD- or anti PD-L inhibitors History of prior therapy with an IDO inhibitor in combination with an anti-PD-/anti-PD-L agent/any other drug specifically targeting checkpoint pathways; patients who have received prior therapy with single agent anti-PD-/anti-PD-L therapy or single agent IDO inhibitor will be eligible for this study Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or with an agent directed to another stimulatory or co-inhibitory T-cell receptor (TCR) (e.g., CTLA-, OX , CD). Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Prior treatment with anti-PD or anti-PD-L antibody therapy Has received prior therapy with an anti-PD-, anti-PD-L, anti-CTLA or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent. Prior therapy with an anti-PD-, anti-PD-L, anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Previous anti-PD or anti-PD-L Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent within the prior weeks Prior treatment with an anti-PD-, anti-PD-L, anti-PD-L, anti-CTLA- agent, or mifepristone Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has been receiving anti-PD- or anti-PD-L immunotherapy for at least four weeks Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Patients who received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent without having had evidence of objective response Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Prior immunotherapy or treatment with another anti PD agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Previous therapy for this cancer with an anti-PD-, anti-PD-L, anti-PD-L agent, or any other immunomodulatory agent Has received prior anti-PD- or anti-PD-L therapy Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior immunotherapy including anti-PD-, anti-PD-L, or anti-PD-L agents, or if the subject has previously participated in Merck pembrolizumab clinical trials Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Anti-PD-, anti-PD-L, or anti-PD-L agents Has received prior therapy with an anti-PD-, anti-PD-L-, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent, or sEsphB-HSA Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has had prior treatment with any other anti-PD- or PD-L or PD-L agent Prior treatment with an anti-PD-, anti-PD-L or anti-PD-L agent Prior treatment with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent. Has received prior therapy with an anti-PD-, anti-PD-L, anti-PD-L Patient had prior treatment with any other anti-PD-, or PD-ligand (L) or PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Patients who discontinued prior anti-PD-/PD-L therapy due to an anti-PD-/PD-L-related toxicity. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or with an agent directed to another stimulatory or co-inhibitory T cell receptor Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or blinatumomab REGISTRATION TO TREATMENT (STEP ): Patient must not have received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent for dose expansion; (patients in dose escalation may have received an anti-PD-, anti-PD-L, or anti-PD-L agent) Prior therapy with anti-PD-, PD-L, or PD-L agent. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent, or other immune checkpoint inhibitor (e.g. anti-CTLA) Patients may not have had any prior ipilimumab and/or anti-PD-/PD-L agent in the metastatic setting Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or with an agent directed to another stimulatory or co-inhibitory T-cell receptor (eg, CTLA-, OX-, CD) Received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L antibody. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or if the patient has previously participated in MK- clinical trials. Has received prior therapy with an anti-PD-, or anti-PD-L, or anti-PD-L agent or with an agent directed to another co-inhibitory T-cell receptor (e.g., cytotoxic T-lymphocyte-associated protein [CTLA-], OX-, CD). Prior treatment with an anti-PD-, anti-PD-L, or anti-PD-L agent No prior treatment with anti-PD- or anti-PD-L Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or if the patient has previously participated in Merck MK- clinical trials. Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or if the subject has previously participated in Merck MK- clinical trials. Anti PD-/PD-L relapsed cohorts (I and II), participants whose most recent anti-cancer therapy consisted of single-agent PD-/PD-L blockade will be enrolled Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or if the patient has previously participated in a Merck MK- clinical trial. Intolerance to prior anti-PD-/PD-L therapy Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or has participated in another Merck pembrolizumab clinical trial Prior therapy with a PD-, anti-PD-Ligand (PD-L), or anti-PD-L agent, or previously participated in a Merck pembrolizumab (MK-) study Has received prior therapy with an anti-PD-, anti-PD-L, anti-PD-L, OR other immune check point agonist/inhibitor. Prior treatment with an anti-PD-, anti-PD-L, anti-PD-L monoclonal antibody. Prior immunotherapy including anti-PD-, anti-PD-L, or anti-PD-L agent, or previously participated in Merck pembrolizumab (MK-) clinical trial Prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent or previously participated in Merck MK- clinical trial Prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent, or with an agent directed to another co-inhibitory T-cell receptor Prior therapy with an anti-PD- or anti-PD-L or -L therapy or previously participated in a Merck pembrolizumab (MK-) trial Histological or cytological diagnosis of NSCLC. Patients must have ) previously received prior anti-PD-L or anti-PD- mAb as most recent therapy, AND ) did not have progressive disease as best overall response on recent PD-L/PD- therapy (ie, stable disease months, PR, or CR), AND ) who subsequently progressed on anti-PD-L or anti-PD- mAb. Patients who received prior anti-PD- therapy are eligible for cohort only and patients who have not received prior anti-PD- therapy are eligible for cohort only Prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent With TNBC has received prior therapy with an anti-PD-, anti-PD-L, anti-CTLA-, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Previous treatment with anti-PD-, anti-PD-L or anti-PD-L therapy. Prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Prior treatment with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L Patient must have had prior treatment with anti-PD- or anti-PD-L agents and have documented disease progression on these agents prior to registration; patient must have received anti-PD- or PD-L based therapy as the immediate previous line of treatment and within days prior to registration Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Prior treatment with anti PD- or PD-L therapy (Arm A) Received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Subjects who are currently receiving treatment with the anti-PD- antibody Pembrolizumab either alone or in combination and are progressing. Subjects must have received at least doses of anti-PD-/PD-L therapy OR Subjects who have previously received any anti-PD-/PD-L therapy, alone or in combination. Subjects must have received at least doses of anti-PD-/PD-L therapy Received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent Has received prior therapy with an anti-PD-, anti-PD-L, or anti-PD-L agent