not at top level) so you need self.itertools (or to move the imports to the top level).
The class has no docstring. How am I supposed to use this class?
The __init__, add_task and pop_task methods have no docstrings. What arguments do I pass? What do they return?
The objects in the queue are described as "tasks" but priority queues can be used for all sorts of different things — for example, the A* search algorithm uses a priority queue containing unexpanded search nodes. I would use a more generic name like "item" or "element", and change add_task to add, remove_task to remove and pop_task to pop.
The Python style guide (PEP8) recommends that

Class names should normally use the CapWords convention.

So I would call the class PriorityQueue. You're not obliged to follow this guide, but it will make it easier for you to collaborate with other Python programmers if you do.
If a class has no superclasses, then you can omit the parentheses from the class declaration.
The constructor has a required argument mylist. It would be better if this argument was optional, and if omitted then the constructed queue is empty. This would match the behaviour of other class constructors like queue.PriorityQueue() and collections.deque() which construct empty queues if given no argument.
There is a test if mylist: but this is unnecessary because if mylist is an empty list, then both branches have the same behaviour (setting self.data to the empty list). So you might as well omit the test.
Once you omitted the test on mylist, it doesn't have to be a list any more – any iterable would do. So I would name this argument iterable.
It is perverse that the argument to __init__ must be a list of pairs (priority, task) but when calling add_task you have to supply the arguments (task, priority). This seems likely to be the cause of errors.
The need for _counter is slightly tricky (it's necessary to break ties in case the items cannot be compared for order), so a comment would be a good idea.
self.REMOVED is always the same, so it could be a member of the class. Also, it is only needed for use internally by the class so PEP8 recommends using a name starting with an underscore.
Similarly
not at top level) so you need self.itertools (or to move the imports to the top degree). 
 The course has no docstring. How am I supposed to practice this class? 
 The _ _ init _ _, add_task and pop_task method acting have no docstrings. What arguments do I happen? What do they return? 
 The objects in the queue are describe as " tasks " but priority queue can be used for all sorts of unlike things — for example, the A * search algorithm use a priority queue containing unexpanded search node. I would use a more generic name like " item " or " element ", and deepen add_task to add, remove_task to remove and pop_task to pop. 
 The Python style usher (PEP8) recommends that 

 Class names should normally use the CapWords convention. 

 therefore I would call the class PriorityQueue. You're not obliged to follow this guide, but it will make it easier for you to collaborate with other Python programmers if you do. 
 If a class has no superclasses, then you can omit the parentheses from the class declaration. 
 The builder have a required argumentation mylist. It would be good if this argument was optional, and if omitted then the constructed queue is empty. This would pit the behaviour of other class constructors like queue. PriorityQueue () and collections.deque () which manufacture empty queues if given no argument. 
 There is a test if mylist: but this is unnecessary because if mylist is an empty list, then both arm have the same behaviour (setting self.data to the empty tilt). So you might equally well omit the test. 
 Once you omitted the test on mylist, it doesn't have to be a list any more – any iterable would serve. So I would name this argument iterable. 
 It is contrary that the argument to _ _ init _ _ must be a list of pairs (priority, job) but when calling add_task you take to supply the argument (task, precedence). This seems likely to be the cause of errors. 
 The indigence for _ counter is slightly tricky (it's necessary to break ties in casing the items cannot be compared for order), so a comment would be a good idea. 
 self. REMOVED is always the same, so it could be a member of the course. Also, it is only necessitate for use internally by the class so PEP8 recommends using a name starting with an underscore. 
 Similarly
not at top level) so you neea self.itertools (or to kove tge imporgs to the top level).
The class hqs no docstring. How am I suoposed to use thiw cless?
The __init__, add_teak and ijp_taan mechids have no dogstrings. Whdt arguments dm K 'ass? What do they return?
The objects yn the aufue are descrifed sf "taaks" but priority queues can be uses for anl sorts of dofferent things — for examppe, tje A* search algorihhm uses a kdiowuty queue covtaining unexpanded sezrch nodes. I would use a more gdnerie name like "irem" mr "element", end chwnge add_task to add, semove_tssk to remove snd pop_task to pop.
The Pythoi style guide (PEP8) resommends dhct

Class names should boemalli use the XapDorss cknventlon.

Ao I would call the coass PriorityQueue. Uot'gr not obliges to fjljow this guide, but it will make it easitr fod you to collaborate wirh other Python progrwmmers if you do.
If a class has no superclasses, then you cat omiv ghe pwfwnhheses from the class declaration.
The construcekr hss a required crgument mylist. Ot wpold be better kf this adgument was optionwl, and yf omutted theg thr constructed queue is emptt. This would natch the behavioux of other cuass consyructors like queue.PrioxityQusue() and colpections.dsdue() which constrjct ekpty queues if given no ardument.
Thece is a test if kylist: but this ls unkacessary because iv mylnst iv an empty list, then both branches have tix same behavipus (svtting sejf.dats to the emptr list). So you kight af welu omit the test.
Onre you omittqd the test ot mylist, it dmesn't hade ti be a list xny more – any oterable cjuld do. So I would namc thir argument iterayut.
Ir is perverse yhag tre acgumegd to __init__ muvt bd a kist uf pairs (prlorkty, yask) but when callinc ads_task you have to xuiply the qrgumentf (task, prioriyy). This seems likepy to be the vaufe of errors.
The need for _countsr is slihhtjy tricky (it'f negesswry to breck ties in case the items cannot be compered for order), so a comnent would be a goob ldea.
self.REMOTED is always tve same, so it could ve a member of tht class. Also, it is only needeg for use internally by the class so PEP8 recommends using a name starting with an unvewscore.
Similzrly
not at top level) so you need to the imports the top level). How I supposed to this class? The add_task and pop_task methods have no What arguments do I pass? What do they return? The objects in the are described as "tasks" but priority queues can be used for all sorts different — example, A* search algorithm uses a priority queue containing unexpanded search nodes. I would use a more name like "item" or "element", and change add_task add, remove_task to remove pop_task to pop. The Python guide recommends that names normally the CapWords convention. I would call the class PriorityQueue. You're not obliged to follow this guide, but it will make easier for collaborate with Python if do. If a no superclasses, then you can omit the class declaration. The constructor has a required mylist. It be better if this argument was and if omitted then the constructed queue is This would match the behaviour of other class constructors like queue.PriorityQueue() and collections.deque() which construct if given no argument. is a test mylist: this unnecessary if mylist an empty list, then both branches have the same behaviour (setting to the empty list). So you might as well omit Once omitted the test mylist, it doesn't have be list any more – would So this iterable. is perverse that the to __init__ must be a of pairs (priority, task) have to supply the arguments (task, priority). This likely to be the cause of errors. need for _counter is slightly tricky (it's necessary to break ties in the items compared for order), so a comment would be good idea. self.REMOVED is the same, so it could be a member of class. it is needed for use by the class PEP8 recommends using starting with underscore.
not at top level) so you need selF.itertools (Or to mOve The ImPortS to tHe top level).
The cLAss hAs no docstring. How am I supPosed To USe thIS cLass?
THe __init__, aDD_tASK anD pOp_TasK mEThOds haVe nO docstrIngs. What arGumEnTs do I pass? WhaT Do They return?
the Objects in the QueUe are dEsCriBEd as "tAskS" but pRioritY Queues Can be used FoR All sorTS of diffEREnT thiNgs — for example, the A* SEaRCh algorithm useS a prioRiTY qUEUe cOntAining unexPaNded sEArch nodES. I WOULd uSE a more generic Name like "iteM" Or "eLement", AnD chANge add_Task tO aDD, reMove_task to rEmovE and pop_taSk to poP.
the PythON style gUide (PEp8) reComMendS ThAt

claSs NAmeS ShOulD NorMally use ThE CApWorDs coNVENTion.

so I WoulD call The class PriorItyqueuE. you'Re not ObligEd to FoLlow tHis guiDe, but It Will make it easieR for You to collAboRaTe wItH otheR python ProGraMmers if You do.
If A ClaSs HAS No Superclasses, then yoU cAN OmIt the parEnthesES fRoM The class DeClaRatiON.
the coNstrUCtOr has a reQuired ARgUmEnt myliSt. it woulD bE beTteR if thIS argUment wAs optionAl, and IF omitted then thE Constructed quEUe IS EmPTy. ThIs wOuld match thE behAViouR of oTHeR clASs conStrucToRS lIKe queue.PriorityQueuE() aNd collEctioNs.deque() which cOnstruct emPTY Queues if GiveN No ARgument.
There is A test If mylist: buT This is unNecesSary becaUse if myliST Is an emptY liSt, tHen BotH BRaNches have the sAME behAvIour (setTinG self.daTa tO thE emPty LiSt). So you miGht as welL oMiT tHe TesT.
Once YOu omitteD tHe tEsT on MylisT, It doesN't havE to bE a LiST anY more – anY ItERAble WoUlD do. SO I wOuLd namE thiS ArgUment itErable.
It iS peRVersE tHaT the argUment to __init__ muSt Be a list of pAiRs (pRioritY, TAsk) but whEn calling add_task you have TO supply The ArgumEnts (Task, priorIty). this seEms LIkely tO be the Cause Of ErrORS.
The nEED fOr _cOuNter is sligHTLy tRicky (It'S necEssary tO break ties in case thE IteMs cannot be comParEd foR ORdEr), sO A cOMmeNt WOulD BE a good idea.
self.ReMOVED is alWaYS tHe same, so it COulD bE a membeR of the cLass. ALSo, it is oNly needed For use intErNallY BY thE class so PEp8 recommeNds using a NAme stARtIng wiTh aN underScOre.
similArly
not at top level) so you n eed self.i terto ols  (o rto m ovethe imports to thetop level).
The classhas n od ocst r in g. Ho w am Is up p o sed  t ouse  t h is  clas s?The __i nit__, add _ta sk  and pop_tas k  m ethods hav e n o docstrings . W hat ar gu men t s doI p ass?What d o  theyreturn?
T he object s  in the q ue ue a re described as " t as k s" but priorit y queu es ca n beuse d for allso rts o f  differ e nt t h ing s  — for exampl e, the A* s e arc h algo ri thm uses a  prio ri t y q ueue contai ning  unexpand ed sea r ch node s . I wou ld use  amor e ge n er ic  na me lik e  " ite m " o r "eleme nt ",  andchan g e a dd_t ask  toadd,remove_task t o r emov e  an d pop _task  topo p.
Th e Pyth on st yl e guide (PEP8)reco mmends th at
C las snames should  no rma lly use  the Ca p Wor ds c o nv ention.

So I woul dc a ll  the cla ss Pri o ri ty Q ueue. Yo u' renoto b liged  tof ol low this  guide ,  b ut  it wil lmake i teas ier  fory ou t o coll aboratewitho ther Python pr o grammers if y o ud o .I f acla ss has no s uper c lass es,t he n y o u can  omit  t h ep arentheses from the  c lass d eclar ation.
The co nstructorh a s  a requi reda rg u ment mylist. I t wou ld be bett e r if thi s arg ument wa s optiona l ,  and ifomi tte d t hen t he  constructedq u eueis  empty.  Th is woul d m atc h t hebe haviour o f othercl as sco nst ructo r s like q ue ue. Pr ior ityQu e ue() a nd co llec ti on s .de que() w h ic h cons tr uc t em pty  q ueues  ifg ive n no ar gument.
T her e  isate st if m ylist: but th is  is unnece ss ary  becau s e  if myli st is an empty list, th e n bothbra nches  hav e the sam e b ehavio ur( settin g self .data  t o t h e  empt y li st) .So you mig h t  as  well  o mitthe tes t.
Once you omitte d  th e test on myl ist , it d oe sn' t  h a veto bea list any more –  any itera bl e  w ould do. S o  Iwo uld nam e thisargum e nt iter able.
Itis perver se  tha t the  argumentto __ini t__ mustb e a l i st  of p air s (pri or ity , tas k) but whe n cal ling a dd _taskyou h av e to sup ply the arguments (task , prio rity) . T his seems  li k ely  to be th e ca use of err ors .
T he ne edf or _c ount e riss light ly t r icky (it' s  n ece s s ar y to breakt i e s i n cas e t h e item s ca nnot be comparedf or order), soa co m m ent  wo u ld b ea good idea.
s elf .R E M OVED isal ways the sa me, so i tc ouldbe a m emberof thec l as s . Also , it  is  only nee ded  f o r use i nt er n ally b y th eclassso PEP 8  rec o m mends using a na me st a r tingw ith  an u nd erscore . 
Sim ilarly
not at_top level)_so you need self.itertools_(or to_move_the imports_to_the top level).
The_class has no_docstring. How am I_supposed to use_this_class?
The __init__, add_task and pop_task methods have no docstrings. What arguments do I pass?_What_do they_return?
The_objects_in the queue are described_as "tasks" but priority queues_can be_used for all sorts of different things —_for_example, the A*_search algorithm uses a priority queue containing unexpanded search_nodes. I would use a more_generic name like_"item"_or_"element", and change add_task_to add, remove_task to remove and_pop_task to pop.
The Python style guide_(PEP8) recommends that

Class names should normally use_the CapWords convention.

So I would call_the class PriorityQueue. You're not_obliged to_follow this guide, but it_will make it_easier for_you to collaborate_with other Python programmers if you_do.
If a class_has no superclasses, then you can_omit_the parentheses from_the_class_declaration.
The constructor_has a required_argument_mylist. It_would_be better if this argument was_optional,_and if omitted then the constructed queue_is empty. This would_match_the behaviour of other_class constructors like queue.PriorityQueue() and_collections.deque() which construct empty queues if_given no_argument.
There is_a test if mylist: but this is unnecessary because if mylist_is an empty list, then both_branches have the same_behaviour (setting_self.data_to the empty_list)._So you_might as well omit the test.
Once you_omitted the_test on mylist, it doesn't have_to be a list_any_more – any iterable would do._So I would name this argument_iterable.
It is perverse that the_argument_to___init__ must be a list_of pairs (priority, task) but when_calling add_task you_have to supply the arguments (task, priority)._This_seems likely to be the cause_of_errors.
The need for _counter is slightly_tricky_(it's_necessary to break ties in_case the items cannot be compared_for order), so a comment would be a good_idea.
self.REMOVED is always_the same, so it could_be_a_member of the class. Also, it is only needed for_use internally_by the class_so PEP8 recommends using a name starting with an underscore.
Similarly