A community-maintained Python framework for creating mathematical animations.
After running 2to3
Grant Sanderson858051a80632
diff --git a/active_projects/eola2/cramer.py b/active_projects/eola2/cramer.pyindex 269f0bfdf..a296e7774 100644--- a/active_projects/eola2/cramer.py+++ b/active_projects/eola2/cramer.py@@ -321,7 +321,7 @@ class SetupSimpleSystemOfEquations(LinearTransformationScene):circle.save_state()circle.scale(5)circle.fade(1)- row_rects = VGroup(*map(SurroundingRectangle, system))+ row_rects = VGroup(*list(map(SurroundingRectangle, system)))row_rects.set_stroke(BLUE, 2)self.add(system)@@ -377,7 +377,7 @@ class SetupSimpleSystemOfEquations(LinearTransformationScene):system_in_lines_copy = system_in_lines.deepcopy()self.play(ReplacementTransform(- VGroup(*map(VGroup, system_in_lines_copy.matrix_elements)),+ VGroup(*list(map(VGroup, system_in_lines_copy.matrix_elements))),matrix_system.matrix_mobject.elements,),Write(matrix_system.matrix_mobject.brackets),@@ -386,7 +386,7 @@ class SetupSimpleSystemOfEquations(LinearTransformationScene):Write(matrix_system.equals))self.play(ReplacementTransform(- VGroup(*map(VGroup, system_in_lines_copy.output_vect_elements)),+ VGroup(*list(map(VGroup, system_in_lines_copy.output_vect_elements))),matrix_system.output_vect_mob.elements,))self.play(*[@@ -406,7 +406,7 @@ class SetupSimpleSystemOfEquations(LinearTransformationScene):matrix_system.set_height, corner_rect.get_height() - MED_LARGE_BUFF,matrix_system.move_to, corner_rect,)- self.play(*map(GrowArrow, self.basis_vectors))+ self.play(*list(map(GrowArrow, self.basis_vectors)))self.add_foreground_mobject(corner_rect)self.add_foreground_mobject(matrix_system)@@ -515,7 +515,7 @@ class SetupSimpleSystemOfEquations(LinearTransformationScene):colors = [colorfor i, color in zip(- range(len(matrix)),+ list(range(len(matrix))),it.cycle([X_COLOR, Y_COLOR, Z_COLOR, YELLOW, MAROON_B, TEAL]))]@@ -1236,7 +1236,7 @@ class SolvingASystemWithOrthonormalMatrix(LinearTransformationScene):# Column arrayscolumn_mobs = VGroup()- for i, vect in zip(range(2), [DR, DL]):+ for i, vect in zip(list(range(2)), [DR, DL]):elements = system.matrix_mobject.deepcopy().mob_matrix[:, i]column_mob = MobjectMatrix(elements)column_mob.add_background_rectangle()@@ -1621,9 +1621,9 @@ class TransformingAreasYCoord(LinearTransformationScene):GrowFromCenter(matrix_brace), Write(matrix_label),)self.add_foreground_mobjects(apply_group)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [area_words.rect, area_words, area_arrow, input_vect_label,- ]))+ ])))self.apply_matrix(matrix)self.wait(2)self.apply_inverse(matrix, run_time=0)@@ -1650,7 +1650,7 @@ class TransformingAreasYCoord(LinearTransformationScene):q_marks_group.move_to(ip)column_mobs = VGroup()- for i, vect in zip(range(2), [DOWN, LEFT]):+ for i, vect in zip(list(range(2)), [DOWN, LEFT]):column = matrix_mobject.deepcopy().mob_matrix[:, i]column_mob = MobjectMatrix(column)column_mob.scale(self.array_scale_factor)@@ -1815,7 +1815,7 @@ class TransformingAreasYCoord(LinearTransformationScene):self.play(FadeOut(self.area_scale_words),ShowCreation(h_line),- *map(MoveToTarget, area_words[1:]),+ *list(map(MoveToTarget, area_words[1:])),run_time=3)self.wait()@@ -1983,7 +1983,7 @@ class ParallelepipedForYCoordinate(ExternallyAnimatedScene):class ThreeDCoordinatesAsVolumes(Scene):def construct(self):colors = [X_COLOR, Y_COLOR, Z_COLOR]- x, y, z = coords = VGroup(*map(TexMobject, "xyz"))+ x, y, z = coords = VGroup(*list(map(TexMobject, "xyz")))coords.set_color_by_gradient(*colors)matrix = IntegerMatrix(np.identity(3))matrix.set_color_columns(*colors)diff --git a/active_projects/eola2/determinant_puzzle.py b/active_projects/eola2/determinant_puzzle.pyindex 06065ce6b..6f3354638 100644--- a/active_projects/eola2/determinant_puzzle.py+++ b/active_projects/eola2/determinant_puzzle.py@@ -95,10 +95,7 @@ class WorkOutNumerically(Scene):for matrix, det in zip([M1, M2], line1):numbers = VGroup(*[det[i] for i in indices])numbers_iter = iter(numbers)- non_numbers = VGroup(*filter(- lambda m: m not in numbers,- det- ))+ non_numbers = VGroup(*[m for m in det if m not in numbers])matrix_numbers = VGroup(*[matrix.mob_matrix[i][j].copy()for i, j in (0, 0), (1, 1), (0, 1), (1, 0)@@ -268,7 +265,7 @@ class SuccessiveLinearTransformations(LinearTransformationScene):self.reset_plane()self.play(MoveToTarget(matrices),- *map(GrowFromCenter, parens)+ *list(map(GrowFromCenter, parens)))self.apply_matrix(self.matrix_product)self.wait()diff --git a/active_projects/eop/bayes.py b/active_projects/eop/bayes.pyindex d0d76b0a2..1af6581cf 100644--- a/active_projects/eop/bayes.py+++ b/active_projects/eop/bayes.py@@ -32,9 +32,9 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):def add_cards(self):you, her = self.you, self.her- community_cards = VGroup(*map(+ community_cards = VGroup(*list(map(PlayingCard, self.community_card_values- ))+ )))community_cards.arrange_submobjects(RIGHT)community_cards.move_to(self.community_cards_center)deck = VGroup(*[@@ -47,7 +47,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):you.hand = self.get_hand(you, self.your_hand_values)her.hand = self.get_hand(her, None)- hand_cards = VGroup(*it.chain(*zip(you.hand, her.hand)))+ hand_cards = VGroup(*it.chain(*list(zip(you.hand, her.hand))))self.add(deck)for group in hand_cards, community_cards:@@ -70,10 +70,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):for card in you.hand.target:card.set_height(community_cards.get_height())- selected_community_cards = VGroup(*filter(- lambda card : card.numerical_value >= 10,- community_cards- ))+ selected_community_cards = VGroup(*[card for card in community_cards if card.numerical_value >= 10])card_cmp = lambda c1, c2 : cmp(c1.numerical_value, c2.numerical_value)@@ -118,10 +115,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):def show_flush_potential(self):you, her = self.you, self.her- heart_cards = VGroup(*filter(- lambda c : c.suit == "hearts",- self.community_cards- ))+ heart_cards = VGroup(*[c for c in self.community_cards if c.suit == "hearts"])heart_cards.save_state()her.hand.save_state()@@ -165,7 +159,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):("hearts", "hearts"),]for new_suit_pair in new_suit_pairs:- new_symbols = VGroup(*map(SuitSymbol, new_suit_pair))+ new_symbols = VGroup(*list(map(SuitSymbol, new_suit_pair)))for new_symbol, heart in zip(new_symbols, hearts):new_symbol.replace(heart, dim_to_match = 1)self.play(Transform(@@ -229,11 +223,11 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):)self.wait(3)equation.remove(percentage)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [equation,num_hearts, num_hearts_arrow,num_cards, num_cards_arrow,- ]))+ ])))self.percentage = percentage@@ -259,9 +253,9 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):FadeIn(sample_space),ReplacementTransform(percentage, top_label))- self.play(*map(GrowFromCenter, [+ self.play(*list(map(GrowFromCenter, [brace for brace in braces- ]))+ ])))self.wait(2)self.play(Write(bottom_label))self.wait(2)@@ -289,7 +283,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):self.play(hand.restore)self.wait()self.wait()- self.play(*map(FadeOut, it.chain(*hand_lists)))+ self.play(*list(map(FadeOut, it.chain(*hand_lists))))def place_high_bet(self):you, her = self.you, self.her@@ -415,7 +409,7 @@ class IntroducePokerHand(PiCreatureScene, SampleSpaceScene):def get_hand(self, pi_creature, keys = None):if keys is not None:- hand = VGroup(*map(PlayingCard, keys))+ hand = VGroup(*list(map(PlayingCard, keys)))else:hand = VGroup(*[PlayingCard(turned_over = True)@@ -585,7 +579,7 @@ class UpdatePokerPrior(SampleSpaceScene):self.wait()self.play(Write(VGroup(*label[-2:])))self.wait(2)- self.play(*map(FadeOut, [her, her.glasses]))+ self.play(*list(map(FadeOut, [her, her.glasses])))self.sample_space.add(brace, label)self.bottom_explanation = explanation@@ -619,13 +613,13 @@ class UpdatePokerPrior(SampleSpaceScene):for num in numbers])- questions = VGroup(*map(TextMobject, [+ questions = VGroup(*list(map(TextMobject, ["Does she bluff?","How much does she have?","Does she take risks?","What's her model of me?","\\vdots"- ]))+ ])))questions.arrange_submobjects(DOWN, aligned_edge = LEFT)questions[-1].next_to(questions[-2], DOWN)questions.scale(0.7)@@ -637,13 +631,13 @@ class UpdatePokerPrior(SampleSpaceScene):ShowCreation(bubble),Write(words, run_time = 2))- self.play(*map(ShowCreation, arrows))+ self.play(*list(map(ShowCreation, arrows)))self.play(numbers.set_color, YELLOW)self.play(Blink(randy))self.play(randy.change_mode, "maybe")- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [bubble, words, arrows- ]))+ ])))for question in questions:self.play(FadeIn(question),@@ -679,7 +673,7 @@ class UpdatePokerPrior(SampleSpaceScene):(0.97, 0.3),]- self.play(*map(ShowCreation, rects))+ self.play(*list(map(ShowCreation, rects)))self.play(FadeOut(rects))for i, value in enumerate(it.chain(*new_conditionals)):self.play(@@ -718,12 +712,12 @@ class UpdatePokerPrior(SampleSpaceScene):self.play(MoveToTarget(low_bet_space))self.play(Write(words),- *map(ShowCreation, arrows)+ *list(map(ShowCreation, arrows)))self.wait()for rect in high_bet_space:self.play(Indicate(rect, scale_factor = 1))- self.play(*map(FadeOut, [words, arrows]))+ self.play(*list(map(FadeOut, [words, arrows])))self.high_bet_space = high_bet_space@@ -758,11 +752,11 @@ class UpdatePokerPrior(SampleSpaceScene):self.play(MoveToTarget(rects[0]))self.wait()self.play(*it.chain(- map(Write, [frac_line, plus]),- map(MoveToTarget, rects[1:])+ list(map(Write, [frac_line, plus])),+ list(map(MoveToTarget, rects[1:]))))self.wait(3)- self.play(*map(FadeOut, [arrow, fraction] + rects))+ self.play(*list(map(FadeOut, [arrow, fraction] + rects)))self.posterior_tex = posterior_tex@@ -821,7 +815,7 @@ class UpdatePokerPrior(SampleSpaceScene):self.wait()self.play(post_words[1].fade, 0.8)self.wait(2)- self.play(*map(FadeOut, [post_words, post_arrow]))+ self.play(*list(map(FadeOut, [post_words, post_arrow])))def preview_tweaks(self):post_rects = self.post_rects@@ -830,7 +824,7 @@ class UpdatePokerPrior(SampleSpaceScene):(0.97, 0.3, 1./22),]for new_values in new_value_lists:- for i, value in zip(range(2), new_values):+ for i, value in zip(list(range(2)), new_values):self.play(*self.get_conditional_change_anims(i, value, post_rects))@@ -863,7 +857,7 @@ class UpdatePokerPrior(SampleSpaceScene):arrows.next_to(prior_rects[1], RIGHT, SMALL_BUFF)self.wait(2)- self.play(*map(FadeIn, [her, her.glasses]))+ self.play(*list(map(FadeIn, [her, her.glasses])))self.play(LaggedStart(FadeIn, risk_averse_words))self.play(her.change_mode, "sad", Animation(her.glasses))self.wait()@@ -920,7 +914,7 @@ class UpdatePokerPrior(SampleSpaceScene):*self.get_prior_change_anims(1./22, post_rects),run_time = 2)- self.play(*map(FadeOut, [her, her.glasses]))+ self.play(*list(map(FadeOut, [her, her.glasses])))def compute_posterior(self):prior_rects = self.get_prior_rectangles()@@ -978,7 +972,7 @@ class UpdatePokerPrior(SampleSpaceScene):])self.play(Write(fraction.get_part_by_tex("over")))for pair in zip(pre_top_rect_products, products[0]):- self.play(*map(Indicate, pair))+ self.play(*list(map(Indicate, pair)))self.wait()self.wait()self.play(Indicate(prior_rects[1], scale_factor = 1))@@ -993,7 +987,7 @@ class UpdatePokerPrior(SampleSpaceScene):])self.wait()for pair in zip(pre_bottom_rect_products, products[1]):- self.play(*map(Indicate, pair))+ self.play(*list(map(Indicate, pair)))self.wait()self.play(Write(fraction.get_part_by_tex("+")),@@ -1213,10 +1207,7 @@ class BayesianNetworkPreview(Scene):node.ghost = node.fill.copy().fade()self.add(node.ghost)all_ghosts.add(node.ghost)- connected_nodes = filter(- lambda n : n not in covered_nodes,- it.chain(node.children, node.parents)- )+ connected_nodes = [n for n in it.chain(node.children, node.parents) if n not in covered_nodes]for next_node in connected_nodes:if next_node in covered_nodes:continue@@ -1454,7 +1445,7 @@ class GeneralizeBayesRule(SampleSpaceScene):self.play(self.bayes_rule_words.to_edge, UP,Write(name),- *map(ShowCreation, arrows+rects)+ *list(map(ShowCreation, arrows+rects)))self.wait()@@ -1517,9 +1508,9 @@ class GeneralizeBayesRule(SampleSpaceScene):prior_rects.copy(), post_rects,run_time = 2))- self.play(*map(FadeIn, [+ self.play(*list(map(FadeIn, [post_rects.braces, post_rects.labels- ]))+ ])))self.wait()self.play(*self.get_conditional_change_anims(1, 0.2, post_rects))self.play(*self.get_conditional_change_anims(0, 0.6, post_rects))@@ -1609,15 +1600,15 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):labels.scale(0.7)braces, labels = sample_space.get_side_braces_and_labels(labels)VGroup(sample_space, braces, labels).to_edge(LEFT)- words = map(TextMobject, [+ words = list(map(TextMobject, ["Blunt honesty", "Some confidence"- ])+ ]))for word, part in zip(words, sample_space.horizontal_parts):word.scale(0.6)word.move_to(part)self.play(LaggedStart(FadeIn, sample_space, run_time = 1))- self.play(*map(GrowFromCenter, braces))+ self.play(*list(map(GrowFromCenter, braces)))for label in labels:self.play(Write(label, run_time = 2))self.wait()@@ -1626,7 +1617,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):self.change_pi_creature_with_guitar(mode)self.wait()self.wait()- self.play(*map(FadeOut, words))+ self.play(*list(map(FadeOut, words)))self.sample_space = sample_space@@ -1643,7 +1634,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):for friend in friends:friend.look_at(randy.eyes)- headphones = VGroup(*map(Headphones, friends))+ headphones = VGroup(*list(map(Headphones, friends)))self.play(FadeIn(friends))self.pi_creatures.add(*friends)@@ -1701,7 +1692,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):),)self.wait(2)- self.play(*map(FadeOut, [bubble, content]))+ self.play(*list(map(FadeOut, [bubble, content])))def friends_dont_like(self):friends = self.friends@@ -1737,7 +1728,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):)self.change_pi_creature_with_guitar("happy")self.wait()- self.play(*map(FadeOut, [bubble, content]))+ self.play(*list(map(FadeOut, [bubble, content])))self.bubble = bubble@@ -1923,10 +1914,10 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):run_time = 2,))self.wait(time)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [prior_rect, post_rect,self.ratio_group, self.post_rhs- ]))+ ])))self.prior_num_rect = prior_rect@@ -1943,11 +1934,11 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):self.wait(2)def fade_out_post_rect(self):- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.post_rects,self.post_rects.braces,self.post_rects.labels,- ]))+ ])))self.play(self.negative_space.restore)def get_negative_feedback(self):@@ -2010,7 +2001,7 @@ class MusicExample(SampleSpaceScene, PiCreatureScene):content.scale(0.6)bubble.add_content(content)- self.play(*map(MoveToTarget, friends))+ self.play(*list(map(MoveToTarget, friends)))self.play(ShowCreation(bubble),Write(bubble.content)@@ -2148,7 +2139,7 @@ class FinalWordsOnRule(SampleSpaceScene):(0.97, 0.3, 1./22),]for new_values in new_value_lists:- for i, value in zip(range(2), new_values):+ for i, value in zip(list(range(2)), new_values):self.play(*self.get_conditional_change_anims(i, value, post_rects))diff --git a/active_projects/eop/bayes_footnote.py b/active_projects/eop/bayes_footnote.pyindex c6031e4d2..98137182e 100644--- a/active_projects/eop/bayes_footnote.py+++ b/active_projects/eop/bayes_footnote.py@@ -74,7 +74,7 @@ class Introduction(TeacherStudentsScene):cross.set_stroke(RED, 6)group.add(cross)- self.play(*map(FadeIn, [bayes, intuition]))+ self.play(*list(map(FadeIn, [bayes, intuition])))self.play(Write(arrow))self.play(ShowCreation(cross))self.change_student_modes(*["confused"]*3)@@ -117,9 +117,9 @@ class Introduction(TeacherStudentsScene):music_example.next_to(poker_example, RIGHT)examples = VGroup(poker_example, music_example)brace = Brace(examples, UP)- bayes_to_intuition = VGroup(*map(TextMobject, [+ bayes_to_intuition = VGroup(*list(map(TextMobject, ["Bayes", "$\\leftrightarrow$", "Intuition"- ]))+ ])))bayes_to_intuition.arrange_submobjects(RIGHT, buff = SMALL_BUFF)bayes_to_intuition.next_to(brace, UP, SMALL_BUFF)check = TexMobject("\\checkmark")@@ -179,7 +179,7 @@ class Introduction(TeacherStudentsScene):def get_poker_example(self):rect = self.get_example_rect()values = IntroducePokerHand.CONFIG["community_card_values"]- community_cards = VGroup(*map(PlayingCard, values))+ community_cards = VGroup(*list(map(PlayingCard, values)))community_cards.arrange_submobjects(RIGHT)deck = VGroup(*[PlayingCard(turned_over = True)@@ -406,14 +406,14 @@ class AskAboutRephrasingQuestion(TeacherStudentsScene):class RephraseQuestion(Scene):def construct(self):- words = VGroup(*map(TextMobject, [+ words = VGroup(*list(map(TextMobject, [r"1 in $1{,000}$ chance \\ of having disease",r"1 in $100$ \\ false positive rate.",r"""\underline{\phantom{1 in 10}} chance \\of having disease \\after testing positive.""",- ]))+ ])))words.arrange_submobjects(RIGHT, buff = LARGE_BUFF)words.set_width(2*(FRAME_X_RADIUS - MED_LARGE_BUFF))@@ -688,7 +688,7 @@ class ShowRestrictedSpace(Scene):self.play(Transform(*arrows, run_time = 4, rate_func = there_and_back))- self.play(*map(FadeOut, [words, arrows[0]]))+ self.play(*list(map(FadeOut, [words, arrows[0]])))self.brace = brace@@ -785,7 +785,7 @@ class DepressingForMedicalTestDesigners(TestScene):self.add(title)self.play(Write(checks))self.wait(2)- self.play(*map(MoveToTarget, [title, checks]))+ self.play(*list(map(MoveToTarget, [title, checks])))def reject_test(self):randy = self.pi_creature@@ -1236,7 +1236,7 @@ class IntroduceTelepathyExample(StatisticsVsEmpathy):morty = self.mortybubble = morty.get_bubble("", direction = LEFT)numbers = [- Integer(random.choice(range(100)))+ Integer(random.choice(list(range(100))))for x in range(30)]numbers.append(Integer(67))@@ -1376,7 +1376,7 @@ class CompareNumbersInBothExamples(Scene):self.play(LaggedStart(FadeIn, titles, lag_ratio = 0.7),- *map(ShowCreation, [h_line, v_line])+ *list(map(ShowCreation, [h_line, v_line])))self.wait()self.play(FadeIn(priors))diff --git a/active_projects/eop/chapter1/all_sequences.py b/active_projects/eop/chapter1/all_sequences.pyindex 7c7d2c8e2..5954c2493 100644--- a/active_projects/eop/chapter1/all_sequences.py+++ b/active_projects/eop/chapter1/all_sequences.py@@ -1,4 +1,4 @@-from __future__ import print_function+from big_ol_pile_of_manim_imports import *from active_projects.eop.reusable_imports import *diff --git a/active_projects/eop/chapter2/permutation_grid.py b/active_projects/eop/chapter2/permutation_grid.pyindex f3cb0057b..4772c893a 100644--- a/active_projects/eop/chapter2/permutation_grid.py+++ b/active_projects/eop/chapter2/permutation_grid.py@@ -15,8 +15,8 @@ def print_permutation(index_list):"M", "N", "O", "P", "Q", "R","S", "T", "U", "V", "W", "X","Y", "Z"]- free_indices = range(n)- free_indices_p1 = range(1,n + 1)+ free_indices = list(range(n))+ free_indices_p1 = list(range(1,n + 1))#print perm_listfor i in range(n):findex = index_list[i] - 1diff --git a/active_projects/eop/combinations.py b/active_projects/eop/combinations.pyindex d4fc5b812..868b4065f 100644--- a/active_projects/eop/combinations.py+++ b/active_projects/eop/combinations.py@@ -10,7 +10,7 @@ def get_stack(vertical_buff = MED_SMALL_BUFF,):stack = VGroup()- for indices in it.combinations(range(n), k):+ for indices in it.combinations(list(range(n)), k):term = VGroup(*[obj1.copy() if i in indices else obj2.copy()for i in range(n)@@ -119,9 +119,9 @@ class ExperienceProblemSolver(PiCreatureScene):self.play(jenny.change, "happy")self.play(randy.change, "tired")self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [jenny.bubble, jenny_words, randy_words- ]))+ ])))def no_genius(self):randy, jenny = self.randy, self.jenny@@ -299,10 +299,7 @@ class InitialFiveChooseThreeExample(Scene):)self.wait()for line in stack:- ones = VGroup(*filter(- lambda mob : "1" in mob.get_tex_string(),- line- ))+ ones = VGroup(*[mob for mob in line if "1" in mob.get_tex_string()])line.ones = onesself.play(LaggedStart(ApplyMethod, ones,@@ -340,7 +337,7 @@ class InitialFiveChooseThreeExample(Scene):self.play(ShowCreation(lines))count = 1- for indices in it.combinations(range(5), 3):+ for indices in it.combinations(list(range(5)), 3):ones = VGroup(*[self.get_obj1().next_to(lines[i], UP)for i in indices@@ -353,7 +350,7 @@ class InitialFiveChooseThreeExample(Scene):count += 1self.add(num, ones)self.wait()- self.play(*map(FadeOut, [lines, num, ones]))+ self.play(*list(map(FadeOut, [lines, num, ones])))def walk_though_notation(self):equation = self.binomial_equations[3]@@ -428,10 +425,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample):stack.set_height(self.stack_height)stack.to_edge(DOWN)for line in stack:- line.ones = VGroup(*filter(- lambda mob : "1" in mob.get_tex_string(),- line- ))+ line.ones = VGroup(*[mob for mob in line if "1" in mob.get_tex_string()])equation = TexMobject("{%d \\choose %d}"%(self.n, self.k),@@ -483,7 +477,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample):self.wait(2)self.play(line.restore,- *map(FadeOut, [brace, n_options, arrows, choose_k])+ *list(map(FadeOut, [brace, n_options, arrows, choose_k])))def count_stack(self):@@ -510,7 +504,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample):coming_soon.next_to(lhs, UP)coming_soon.set_color(MAROON_B)- self.play(*map(FadeIn, [lhs, coming_soon]))+ self.play(*list(map(FadeIn, [lhs, coming_soon])))self.wait()self.play(ApplyMethod(@@ -519,7 +513,7 @@ class SixChooseThreeExample(InitialFiveChooseThreeExample):rate_func = running_start,remover = True,),- *map(FadeOut, [brace, num, coming_soon])+ *list(map(FadeOut, [brace, num, coming_soon])))self.wait()@@ -569,7 +563,7 @@ class SixChooseThreeInOtherContext(Scene):last_rights = Nonelast_ups = Nonelast_line = None- for indices in it.combinations(range(6), 3):+ for indices in it.combinations(list(range(6)), 3):bools = [i in indices for i in range(6)]arrows = VGroup(*[right.deepcopy() if b else up.deepcopy()@@ -1000,10 +994,10 @@ class ProbabilityOfKWomenInGroupOfFive(Scene):last_lineup = get_lineup()self.play(LaggedStart(FadeIn, last_lineup, run_time = 1))- for x in xrange(self.n_examples):+ for x in range(self.n_examples):lineup = get_lineup()anims = [last_lineup.items.fade, 1]- anims += map(GrowFromCenter, lineup.items)+ anims += list(map(GrowFromCenter, lineup.items))if x >= 12 and x-12 < len(prob_words):anims.append(FadeIn(prob_words[x-12]))self.play(*anims, run_time = 0.75)@@ -1107,10 +1101,7 @@ class ProbabilityOfKWomenInGroupOfFive(Scene):lineups = self.lineupsstacks = VGroup(*[VGroup() for x in range(6)])for lineup in lineups:- lineup.women = VGroup(*filter(- lambda m : "female" in m.get_tex_string(),- lineup.items- ))+ lineup.women = VGroup(*[m for m in lineup.items if "female" in m.get_tex_string()])stacks[len(lineup.women)].add(lineup)stacks.generate_target()stacks.target.scale(0.75)@@ -1447,10 +1438,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive):lineups = self.lineupsstacks = VGroup(*[VGroup() for x in range(5)])for lineup in lineups:- women = filter(- lambda m : "female" in m.get_tex_string(),- lineup.items- )+ women = [m for m in lineup.items if "female" in m.get_tex_string()]stacks[len(women)].add(lineup)stacks.generate_target()stacks.target.scale(0.75)@@ -1572,7 +1560,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive):bottom_stacks.numbers.shift, dist*LEFT/2,)self.wait()- self.play(*map(FadeOut, [add_man, add_woman, h_line]))+ self.play(*list(map(FadeOut, [add_man, add_woman, h_line])))self.set_variables_as_attrs(top_stacks, bottom_stacks)@@ -1612,7 +1600,7 @@ class BuildFiveFromFour(ProbabilityOfKWomenInGroupOfFive):self.play(Write(plus),- *map(MoveToTarget, movers)+ *list(map(MoveToTarget, movers)))self.play(VGroup(top_stacks[-1], top_stacks.numbers[-1]).align_to,@@ -1656,7 +1644,7 @@ class BuildUpFromStart(Scene):for stack, num in zip(*group.target):num.next_to(stack, UP)group.target.next_to(ORIGIN, vect)- self.play(*map(MoveToTarget, [top_group, low_group]))+ self.play(*list(map(MoveToTarget, [top_group, low_group])))self.wait(wait_time)#Expand@@ -1687,10 +1675,10 @@ class BuildUpFromStart(Scene):for num, stack in zip(stacks.numbers.target, new_stacks):num.next_to(stack, UP)- self.play(*map(MoveToTarget, [+ self.play(*list(map(MoveToTarget, [top_stacks, low_stacks,top_stacks.numbers, low_stacks.numbers,- ]))+ ])))self.wait(wait_time)#Shift@@ -1734,14 +1722,14 @@ class BuildUpFromStart(Scene):expressions.add(top_stacks.numbers[-1])self.play(*it.chain(- map(MoveToTarget, all_movers),- map(Write, plusses),+ list(map(MoveToTarget, all_movers)),+ list(map(Write, plusses)),))#Addnew_numbers = self.get_numbers(stacks)self.play(ReplacementTransform(- expressions, VGroup(*map(VGroup, new_numbers))+ expressions, VGroup(*list(map(VGroup, new_numbers)))))self.wait(wait_time)stacks.numbers = new_numbers@@ -1866,9 +1854,9 @@ class IntroducePascalsTriangle(Scene):color = PINK,))- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [morty, morty.bubble, morty.bubble.content- ]))+ ])))def issolate_9_choose_4_term(self):rows = self.rows@@ -1967,10 +1955,10 @@ class IntroducePascalsTriangle(Scene):self.play(self.nine_choose_four_term.scale_in_place, 1./1.2,self.nine_choose_four_term.set_color, WHITE,- *map(FadeOut, [+ *list(map(FadeOut, [expr, nine_choose_four_term,over_512, eq_result, self.curr_line- ])+ ])))self.play(rows.shift, 3*DOWN)@@ -2068,10 +2056,10 @@ class StacksApproachBellCurve(Scene):# number.set_width(bar.get_width())number.next_to(bar, UP, SMALL_BUFF)- self.play(*map(MoveToTarget, [+ self.play(*list(map(MoveToTarget, [bars, bars_copy,numbers, numbers_copy- ]))+ ])))self.play(bars.shift, distance*LEFT/2,numbers.shift, distance*LEFT/2,@@ -2307,7 +2295,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):updownarrow.set_color(YELLOW)updownarrow.next_to(triplet, DOWN, SMALL_BUFF)permutations = VGroup()- for indices in it.permutations(range(len(triplet))):+ for indices in it.permutations(list(range(len(triplet)))):perm = triplet.copy()resorter = VGroup(*[perm[i] for i in indices@@ -2342,7 +2330,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):if i == 4:anims.append(Write(words, run_time = 1))self.play(*anims)- self.play(*map(FadeOut, [triplet, curr_perm, updownarrow]))+ self.play(*list(map(FadeOut, [triplet, curr_perm, updownarrow])))self.order_doesnt_matter_words = words@@ -2385,7 +2373,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):self.play(FadeOut(q_marks))line.sort_submobjects(lambda p : p[0])- words = VGroup(*map(TextMobject, ["First", "Second", "Fifth"]))+ words = VGroup(*list(map(TextMobject, ["First", "Second", "Fifth"])))words.set_color(YELLOW)words.scale(0.75)word_arrow_groups = VGroup()@@ -2409,15 +2397,12 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):word_arrow_groups[j]for j in (1, 2, 0)]- self.play(*map(FadeOut, [line, odm_words]))+ self.play(*list(map(FadeOut, [line, odm_words])))def pattern_is_unambiguous(self):all_ones = VGroup()for line in self.stack:- ones = VGroup(*filter(- lambda m : "1" in m.get_tex_string(),- line- )).copy()+ ones = VGroup(*[m for m in line if "1" in m.get_tex_string()]).copy()ones.set_color(YELLOW)all_ones.add(ones)@@ -2435,7 +2420,7 @@ class ChooseThreeFromFive(InitialFiveChooseThreeExample, PiCreatureScene):)self.wait()for trip in it.combinations(self.people, 3):- rects = VGroup(*map(SurroundingRectangle, trip))+ rects = VGroup(*list(map(SurroundingRectangle, trip)))self.add(rects)self.wait(0.3)self.remove(rects)@@ -2676,7 +2661,7 @@ class StudentsGetConfused(PiCreatureScene):return pisdef get_shuffle_anim(self, line):- indices = range(len(line))+ indices = list(range(len(line)))random.shuffle(indices)line.generate_target()for i, m in zip(indices, line.target):@@ -2779,7 +2764,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive):])choice_numbers.generate_target()dots = VGroup(*[TexMobject("\\cdot") for x in range(k-1)])- product = VGroup(*it.chain(*zip(choice_numbers.target, dots)))+ product = VGroup(*it.chain(*list(zip(choice_numbers.target, dots))))product.add(choice_numbers.target[-1])product.arrange_submobjects(RIGHT, buff = SMALL_BUFF)chosen_names_brace = Brace(chosen_names, UP)@@ -2804,7 +2789,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive):lines = self.linesn_perms = self.n_permutaitons_to_show + 1- for indices in list(it.permutations(range(3)))[1:n_perms]:+ for indices in list(it.permutations(list(range(3))))[1:n_perms]:self.play(*[ApplyMethod(name.next_to, lines[i], UP, SMALL_BUFF,@@ -2852,7 +2837,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive):])choice_numbers.generate_target()dots = VGroup(*[TexMobject("\\cdot") for x in range(k-1)])- product = VGroup(*it.chain(*zip(choice_numbers.target, dots)))+ product = VGroup(*it.chain(*list(zip(choice_numbers.target, dots))))product.add(choice_numbers.target[-1])product.arrange_submobjects(RIGHT, buff = SMALL_BUFF)product.next_to(frac_line, DOWN, SMALL_BUFF)@@ -3001,7 +2986,7 @@ class HowToComputeNChooseK(ChooseThreeFromFive):place_words = VGroup(*[TexMobject("%d^\\text{%s}"%(i+1, s))for i, s in zip(- range(k),+ list(range(k)),it.chain(["st", "nd", "rd"], it.repeat("th")))])@@ -3183,9 +3168,9 @@ class WeirdKindOfCancelation(TeacherStudentsScene):mob.set_color_by_gradient(GREEN, YELLOW)fraction.next_to(self.teacher, UP+LEFT)- names = VGroup(*map(TextMobject, [+ names = VGroup(*list(map(TextMobject, ["Ali", "Ben", "Cam", "Denis", "Evan"- ]))+ ])))names.arrange_submobjects(RIGHT)names.to_edge(UP, buff = LARGE_BUFF)names.save_state()@@ -3227,12 +3212,12 @@ class WeirdKindOfCancelation(TeacherStudentsScene):self.wait(2)#Go through denominators- permutations = list(it.permutations(range(3)))[1:]+ permutations = list(it.permutations(list(range(3))))[1:]self.shuffle(chosen_names, permutations[:2])self.play(LaggedStart(ShowCreationThenDestruction,- VGroup(*map(SurroundingRectangle, bottom_numbers[::2]))+ VGroup(*list(map(SurroundingRectangle, bottom_numbers[::2])))))self.shuffle(chosen_names, permutations[2:])self.wait()@@ -3358,9 +3343,9 @@ class SumsToPowerOf2(Scene):plusses = VGroup(*[TexMobject("+") for n in numbers])plusses.remove(plusses[-1])plusses.add(TexMobject("="))- sum_group = VGroup(*it.chain(*zip(+ sum_group = VGroup(*it.chain(*list(zip(numbers.target, plusses- )))+ ))))sum_group.arrange_submobjects(RIGHT, SMALL_BUFF)sum_group.next_to(numbers, UP, LARGE_BUFF)sum_group.shift(MED_LARGE_BUFF*RIGHT)@@ -3405,9 +3390,9 @@ class SumsToPowerOf2(Scene):fractions = self.get_fractions(n)plusses.generate_target()- sum_group = VGroup(*it.chain(*zip(+ sum_group = VGroup(*it.chain(*list(zip(fractions, plusses.target- )))+ ))))sum_group.arrange_submobjects(RIGHT, buff = 2*SMALL_BUFF)sum_group.next_to(rhs, LEFT)sum_group.shift(0.5*SMALL_BUFF*DOWN)@@ -3427,9 +3412,9 @@ class SumsToPowerOf2(Scene):plusses = VGroup(*[TexMobject("+") for f in fractions[:-1]] + [TexMobject("=")])- sum_group = VGroup(*it.chain(*zip(+ sum_group = VGroup(*it.chain(*list(zip(fractions, plusses- )))+ ))))sum_group.arrange_submobjects(RIGHT)sum_group.next_to(self.n_choose_k_terms, DOWN,diff --git a/active_projects/eop/independence.py b/active_projects/eop/independence.pyindex b23cd26f6..5560347df 100644--- a/active_projects/eop/independence.py+++ b/active_projects/eop/independence.py@@ -9,10 +9,10 @@ def get_binomial_distribution(n, p):return lambda k : choose(n, k)*(p**(k))*((1-p)**(n-k))def get_quiz(*questions):- q_mobs = VGroup(*map(TextMobject, [+ q_mobs = VGroup(*list(map(TextMobject, ["%d. %s"%(i+1, question)for i, question in enumerate(questions)- ]))+ ])))q_mobs.arrange_submobjects(DOWN,buff = MED_LARGE_BUFF,@@ -348,7 +348,7 @@ class IntroduceBinomial(Scene):dist = get_binomial_distribution(n, p)chart = BarChart([dist(k) for k in range(n+1)],- bar_names = range(n+1),+ bar_names = list(range(n+1)),)chart.to_edge(LEFT)self.bar_chart = chart@@ -411,7 +411,7 @@ class IntroduceBinomial(Scene):chart = self.bar_chartchart_copy = chart.copy()dist = get_binomial_distribution(self.n, self.p)- values = np.array(map(dist, range(self.n+1)))+ values = np.array(list(map(dist, list(range(self.n+1)))))values += 0.1values /= sum(values)@@ -511,11 +511,11 @@ class IntroduceQuiz(PiCreatureScene):def show_distribution(self):dist = get_binomial_distribution(3, 0.7)- values = map(dist, range(4))+ values = list(map(dist, list(range(4))))chart = BarChart(values,width = 7,- bar_names = range(4)+ bar_names = list(range(4)))chart.to_edge(RIGHT)for short_p, bar in zip(self.abbreviated_probabilities, chart.bars):@@ -524,7 +524,7 @@ class IntroduceQuiz(PiCreatureScene):self.play(LaggedStart(Write, VGroup(- *filter(lambda m : m is not chart.bars, chart)+ *[m for m in chart if m is not chart.bars])),)self.play(*[@@ -654,10 +654,10 @@ class AssociatePatternsWithScores(BreakDownQuestionPatterns):self.think_about_binomial_patterns()def add_slot_groups(self):- self.slot_groups = VGroup(*map(+ self.slot_groups = VGroup(*list(map(self.get_slot_group,it.product(*[[True, False]]*3)- ))+ )))self.add(self.slot_groups)self.remove(self.randy)@@ -1072,7 +1072,7 @@ class ThousandPossibleQuizzes(Scene):self.play(top_group.to_edge, UP, SMALL_BUFF)self.play(bottom_label.shift, LEFT,- *map(MoveToTarget, [left_split, right_split])+ *list(map(MoveToTarget, [left_split, right_split])))self.play(FadeIn(label))self.wait()@@ -1136,7 +1136,7 @@ class ThousandPossibleQuizzes(Scene):)self.play(Write(equation),- *map(Animation, [num1, num2])+ *list(map(Animation, [num1, num2])))self.remove(num1, num2)self.wait()@@ -1160,7 +1160,7 @@ class ThousandPossibleQuizzes(Scene):line.next_to(bottom_movers.target, LEFT, MED_LARGE_BUFF, UP)self.revert_to_original_skipping_status()- self.play(*map(MoveToTarget, both_movers))+ self.play(*list(map(MoveToTarget, both_movers)))self.play(ShowCreation(line))self.play(FadeOut(line))self.wait()@@ -1210,7 +1210,7 @@ class ThousandPossibleQuizzes(Scene):def get_thousand_quizzes(self):rows = VGroup()- for x in xrange(self.n_quiz_rows):+ for x in range(self.n_quiz_rows):quiz = VGroup(*[Rectangle(height = SMALL_BUFF,@@ -1604,7 +1604,7 @@ class ComputeProbabilityOfOneWrong(Scene):probabilities = VGroup()point_8s = VGroup()point_2s = VGroup()- for i in reversed(range(3)):+ for i in reversed(list(range(3))):bool_list = [self.default_bool]*3bool_list[i] = not self.default_boolprobs = ["(%s)"%self.default_p]*3@@ -1745,9 +1745,9 @@ class ShowFullDistribution(Scene):to_fade.add(VGroup(*score[3:-1]))value_mobs.add(score[-1])dist = get_binomial_distribution(3, 0.8)- values = map(dist, range(4))+ values = list(map(dist, list(range(4))))chart = BarChart(- values, bar_names = range(4),+ values, bar_names = list(range(4)),)chart.shift(DOWN)@@ -1784,14 +1784,14 @@ class ShowFullDistribution(Scene):def compare_to_binomial_pattern(self):dist = get_binomial_distribution(3, 0.5)- values = map(dist, range(4))+ values = list(map(dist, list(range(4))))alt_chart = BarChart(values)alt_chart.move_to(self.bar_chart)bars = alt_chart.barsbars.set_fill(GREY, opacity = 0.5)vect = 4*UPbars.shift(vect)- nums = VGroup(*map(TexMobject, map(str, [1, 3, 3, 1])))+ nums = VGroup(*list(map(TexMobject, list(map(str, [1, 3, 3, 1])))))for num, bar in zip(nums, bars):num.next_to(bar, UP)bars_copy = bars.copy()@@ -1831,7 +1831,7 @@ class ShowFullDistribution(Scene):alt_rhss.add(rhs)dist = get_binomial_distribution(3, p)- values = map(dist, range(4))+ values = list(map(dist, list(range(4))))chart = self.bar_chart.copy()chart.change_bar_values(values)for label, bar in zip(chart.bar_top_labels, chart.bars):@@ -1855,7 +1855,7 @@ class ShowFullDistribution(Scene):last = mobfor k in range(4):buff = MED_LARGE_BUFF- for indices in it.combinations(range(3), k):+ for indices in it.combinations(list(range(3)), k):bool_list = np.array([False]*3)bool_list[list(indices)] = Trueprob = get_probability_of_slot_group(bool_list)@@ -1907,10 +1907,10 @@ class ShowTrueDistribution(PiCreatureScene):def show_distributions(self):dist = get_binomial_distribution(3, 0.65)- values = np.array(map(dist, range(4)))+ values = np.array(list(map(dist, list(range(4)))))alt_values = values + [0.2, 0, 0, 0.2]alt_values /= sum(alt_values)- chart = BarChart(values, bar_names = range(4))+ chart = BarChart(values, bar_names = list(range(4)))bars = chart.barsold_bars = bars.copy()arrows = VGroup()@@ -1933,10 +1933,10 @@ class ShowTrueDistribution(PiCreatureScene):arrows.set_color_by_gradient(BLUE, YELLOW)self.add(chart)- self.play(*map(MoveToTarget, it.chain(bars, old_bars)))+ self.play(*list(map(MoveToTarget, it.chain(bars, old_bars))))self.play(chart.change_bar_values, alt_values,- *map(ShowCreation, arrows)+ *list(map(ShowCreation, arrows)))self.wait(2)@@ -2100,7 +2100,7 @@ class CorrelationsWith35Percent(ThousandPossibleQuizzes):self.play(GrowFromCenter(brace),FadeIn(prop),- *map(MoveToTarget, parts)+ *list(map(MoveToTarget, parts)))self.wait()self.play(@@ -2133,7 +2133,7 @@ class CorrelationsWith35Percent(ThousandPossibleQuizzes):self.play(GrowFromCenter(brace),FadeIn(prop),- *map(MoveToTarget, parts)+ *list(map(MoveToTarget, parts)))self.wait()self.play(@@ -2166,7 +2166,7 @@ class CorrelationsWith35Percent(ThousandPossibleQuizzes):self.play(GrowFromCenter(brace),FadeIn(prop),- *map(MoveToTarget, parts)+ *list(map(MoveToTarget, parts)))self.wait()self.play(@@ -2249,8 +2249,8 @@ class NameBinomial(Scene):charts = VGroup()for n in ns:dist = get_binomial_distribution(n, p)- values = map(dist, range(n+1))- chart = BarChart(values, bar_names = range(n+1))+ values = list(map(dist, list(range(n+1))))+ chart = BarChart(values, bar_names = list(range(n+1)))chart.to_edge(LEFT)charts.add(chart)@@ -2321,10 +2321,7 @@ class NameBinomial(Scene):VGroup(*[group[i] for i in flip_indices])for group in (arrows, crosses, checkmarks)]- faded_checkmarks = VGroup(*filter(- lambda m : m not in full_checks,- checkmarks- ))+ faded_checkmarks = VGroup(*[m for m in checkmarks if m not in full_checks])self.play(*[LaggedStart(@@ -2400,7 +2397,7 @@ class NameBinomial(Scene):new_p_mob.move_to(p_mob, LEFT)dist = get_binomial_distribution(10, 0.49)- values = map(dist, range(11))+ values = list(map(dist, list(range(11))))self.play(Transform(checkmark, female),@@ -2527,7 +2524,7 @@ class CycleThroughPatterns(NameBinomial):question.to_edge(UP, buff = LARGE_BUFF)self.add(question)- all_combinations = list(it.combinations(range(n), k))+ all_combinations = list(it.combinations(list(range(n)), k))shown_combinations = all_combinations[:self.n_patterns_shown]patterns = VGroup(*[self.get_pattern(indicies)@@ -2588,8 +2585,8 @@ class Compute6of10GirlsProbability(CycleThroughPatterns):see_chapter_one.set_color(GREEN)computation = TexMobject("=\\frac{%s}{%s}"%(- "\\cdot ".join(map(str, range(10, 4, -1))),- "\\cdot ".join(map(str, range(1, 7))),+ "\\cdot ".join(map(str, list(range(10, 4, -1)))),+ "\\cdot ".join(map(str, list(range(1, 7)))),))computation.move_to(ten_choose_six, UP)@@ -2735,10 +2732,10 @@ class GeneralBinomialDistributionValues(Scene):def add_chart(self):dist = get_binomial_distribution(self.n, self.p)- values = map(dist, range(self.n+1))+ values = list(map(dist, list(range(self.n+1))))chart = BarChart(values,- bar_names = range(self.n+1)+ bar_names = list(range(self.n+1)))chart.to_edge(LEFT)@@ -2854,19 +2851,19 @@ class GeneralBinomialDistributionValues(Scene):self.wait(2)self.play(bars.restore,- *map(FadeOut, [+ *list(map(FadeOut, [brace, words,self.pascals_triangle,self.ten_choose_ks- ])+ ])))def generalize(self):alt_n = self.alt_ndist = get_binomial_distribution(alt_n, self.p)- values = map(dist, range(alt_n + 1))+ values = list(map(dist, list(range(alt_n + 1))))alt_chart = BarChart(- values, bar_names = range(alt_n + 1)+ values, bar_names = list(range(alt_n + 1)))alt_chart.move_to(self.chart)@@ -2918,7 +2915,7 @@ class GeneralBinomialDistributionValues(Scene):for new_p in new_p_values:p = new_pdist = get_binomial_distribution(self.alt_n, p)- values = map(dist, range(self.alt_n + 1))+ values = list(map(dist, list(range(self.alt_n + 1))))self.play(self.chart.change_bar_values, values,triangle.move_to, interval.number_to_point(p), DOWN@@ -3044,7 +3041,7 @@ class CorrectForDependence(NameBinomial):bar.set_color(average_color(RED_E, BLACK))dist = get_binomial_distribution(10, 0.65)- values = np.array(map(dist, range(11)))+ values = np.array(list(map(dist, list(range(11)))))alt_values = values + 0.1alt_values[0] -= 0.06alt_values[1] -= 0.03@@ -3067,7 +3064,7 @@ class CorrectForDependence(NameBinomial):MoveToTarget(bars),)self.wait()- self.play(*map(ShowCreation, arrows))+ self.play(*list(map(ShowCreation, arrows)))self.play(chart.change_bar_values, alt_values)######@@ -3170,13 +3167,10 @@ class AssumeOrderDoesntMatter(Scene):def show_equality(self):n = 3prob_groups = VGroup(*[- VGroup(*map(+ VGroup(*list(map(get_probability_of_slot_group,- filter(- lambda t : sum(t) == k,- it.product(*[[True, False]]*n)- )- ))+ [t for t in it.product(*[[True, False]]*n) if sum(t) == k]+ )))for k in range(n+1)])for prob_group in prob_groups:@@ -3401,13 +3395,13 @@ class SkepticalOfDistributions(TeacherStudentsScene):####def get_binomial(self):- k_range = range(11)+ k_range = list(range(11))dists = [get_binomial_distribution(10, p)for p in (0.2, 0.8, 0.5)]values_list = [- map(dist, k_range)+ list(map(dist, k_range))for dist in dists]chart = BarChart(@@ -3419,7 +3413,7 @@ class SkepticalOfDistributions(TeacherStudentsScene):return chartdef get_poisson(self):- k_range = range(11)+ k_range = list(range(11))L = 2values = [np.exp(-L) * (L**k) / (scipy.special.gamma(k+1))@@ -3533,7 +3527,7 @@ class Thumbnail(DangerInProbability):def construct(self):n, p = 15, 0.5dist = get_binomial_distribution(n, p)- values = np.array(map(dist, range(n+1)))+ values = np.array(list(map(dist, list(range(n+1)))))values *= 2chart = BarChart(values = values,diff --git a/active_projects/eop/pascal.py b/active_projects/eop/pascal.pyindex e02e98394..8ae04ed2d 100644--- a/active_projects/eop/pascal.py+++ b/active_projects/eop/pascal.py@@ -1,4 +1,4 @@-from __future__ import print_function+from big_ol_pile_of_manim_imports import *from once_useful_constructs.combinatorics import *diff --git a/active_projects/eop/reusables/dice.py b/active_projects/eop/reusables/dice.pyindex 7596e8259..6073001c6 100644--- a/active_projects/eop/reusables/dice.py+++ b/active_projects/eop/reusables/dice.py@@ -13,7 +13,7 @@ class DieFace(SVGMobject):class RowOfDice(VGroup):CONFIG = {- "values" : range(1,7),+ "values" : list(range(1,7)),"direction": RIGHT,}diff --git a/animation/animation.py b/animation/animation.pyindex 8d2812198..410c6cc22 100644--- a/animation/animation.py+++ b/animation/animation.py@@ -70,10 +70,10 @@ class Animation(object):return self.mobject, self.starting_mobjectdef get_all_families_zipped(self):- return zip(*map(+ return list(zip(*list(map(Mobject.family_members_with_points,self.get_all_mobjects()- ))+ ))))def get_sub_alpha(self, alpha, index, num_submobjects):if self.submobject_mode in ["lagged_start", "smoothed_lagged_start"]:diff --git a/animation/composition.py b/animation/composition.pyindex 6fb4c65ef..51f4929ed 100644--- a/animation/composition.py+++ b/animation/composition.py@@ -1,5 +1,5 @@-from __future__ import absolute_import-from __future__ import print_function++import itertools as itimport numpy as np@@ -81,7 +81,7 @@ class Succession(Animation):for anim in animations:anim.update(0)- animations = filter(lambda x: not(x.empty), animations)+ animations = [x for x in animations if not(x.empty)]self.run_times = [anim.run_time for anim in animations]if "run_time" in kwargs:@@ -100,8 +100,8 @@ class Succession(Animation):# critical_alphas[i] is the start alpha of self.animations[i]# critical_alphas[i + 1] is the end alpha of self.animations[i]critical_times = np.concatenate(([0], np.cumsum(self.run_times)))- self.critical_alphas = map(lambda x: np.true_divide(- x, run_time), critical_times) if self.num_anims > 0 else [0.0]+ self.critical_alphas = [np.true_divide(+ x, run_time) for x in critical_times] if self.num_anims > 0 else [0.0]# self.scene_mobjects_at_time[i] is the scene's mobjects at start of self.animations[i]# self.scene_mobjects_at_time[i + 1] is the scene mobjects at end of self.animations[i]@@ -149,7 +149,7 @@ class Succession(Animation):gt_alpha_iter = it.ifilter(lambda i: self.critical_alphas[i + 1] >= alpha,- range(self.num_anims)+ list(range(self.num_anims)))i = next(gt_alpha_iter, None)if i is None:@@ -188,7 +188,7 @@ class AnimationGroup(Animation):}def __init__(self, *sub_anims, **kwargs):- sub_anims = filter(lambda x: not(x.empty), sub_anims)+ sub_anims = [x for x in sub_anims if not(x.empty)]digest_config(self, locals())self.update_config(**kwargs) # Handles propagation to self.sub_animsdiff --git a/animation/creation.py b/animation/creation.pyindex 0827c37f8..8b5fa69ef 100644--- a/animation/creation.py+++ b/animation/creation.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/animation/indication.py b/animation/indication.pyindex 26538b7a6..c486b422c 100644--- a/animation/indication.py+++ b/animation/indication.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as np@@ -221,10 +221,10 @@ class Vibrate(Animation):def update_mobject(self, alpha):time = alpha * self.run_time- families = map(+ families = list(map(Mobject.submobject_family,[self.mobject, self.starting_mobject]- )+ ))for mob, start in zip(*families):mob.points = np.apply_along_axis(lambda x_y_z: (x_y_z[0], x_y_z[1] + self.wave_function(x_y_z[0], time), x_y_z[2]),diff --git a/animation/movement.py b/animation/movement.pyindex c478ab0f4..9950aa9e8 100644--- a/animation/movement.py+++ b/animation/movement.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/animation/numbers.py b/animation/numbers.pyindex 569ed46b3..03fa3928c 100644--- a/animation/numbers.py+++ b/animation/numbers.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/animation/rotation.py b/animation/rotation.pyindex 044cba64d..21b2898e0 100644--- a/animation/rotation.py+++ b/animation/rotation.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/animation/specialized.py b/animation/specialized.pyindex 956ad880d..5b43dbd3e 100644--- a/animation/specialized.py+++ b/animation/specialized.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/animation/transform.py b/animation/transform.pyindex 45e18cf31..b6635c512 100644--- a/animation/transform.py+++ b/animation/transform.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import inspectimport numpy as npdiff --git a/animation/update.py b/animation/update.pyindex fcef3e9b8..ec5dfbd08 100644--- a/animation/update.py+++ b/animation/update.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/big_ol_pile_of_manim_imports.py b/big_ol_pile_of_manim_imports.pyindex 0819d39f7..7a86ce4cd 100644--- a/big_ol_pile_of_manim_imports.py+++ b/big_ol_pile_of_manim_imports.py@@ -12,7 +12,7 @@ addressible by changing this file.Note: One should NOT import from this file for main library code, it is meant onlyas a convenience for scripts creating scenes for videos."""-from __future__ import absolute_import+from constants import *diff --git a/cairo_test.py b/cairo_test.pynew file mode 100644index 000000000..a9cb9f364--- /dev/null+++ b/cairo_test.py@@ -0,0 +1,74 @@+import math+import cairo+from PIL import Image+import subprocess as sp+import os+import numpy as np+import sys++WIDTH, HEIGHT = 1024, 1024+++def argb32_to_rgba(array):+ h, w = array.shape+ result = np.ndarray(shape=(h, w, 4), dtype=np.uint8)+ for i in range(0, 4):+ result[:, :, (i + 1) % 4] = (array // (256**i)) % 256+ # result[:, :, 3] = array % 256+ return result+++data = np.ndarray(shape=(HEIGHT, WIDTH, 4), dtype=np.uint8)++surface = cairo.ImageSurface.create_for_data(+ data, cairo.FORMAT_ARGB32, WIDTH, HEIGHT+)++# surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)++# surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, WIDTH, HEIGHT)+ctx = cairo.Context(surface)++ctx.scale(WIDTH, HEIGHT) # Normalizing the canvas++pat = cairo.LinearGradient(0.0, 0.0, 0.0, 1.0)+pat.add_color_stop_rgba(1, 0.7, 0, 0, 0.5) # First stop, 50% opacity+pat.add_color_stop_rgba(0, 0.9, 0.7, 0.2, 1) # Last stop, 100% opacity++ctx.rectangle(0, 0, 1, 1) # Rectangle(x0, y0, x1, y1)+ctx.set_source(pat)+ctx.fill()++ctx.translate(0.1, 0.1) # Changing the current transformation matrix++ctx.move_to(0, 0)+# Arc(cx, cy, radius, start_angle, stop_angle)+ctx.arc(0.2, 0.1, 0.1, -math.pi / 2, 0)+ctx.line_to(0.5, 0.1) # Line to (x,y)+# Curve(x1, y1, x2, y2, x3, y3)+ctx.curve_to(0.5, 0.2, 0.5, 0.4, 0.2, 0.8)+ctx.close_path()++ctx.set_source_rgb(0.8, 0.2, 0.5) # Solid color+ctx.set_line_width(0.01)+ctx.stroke()++# ctx.set_source(pat)+# ctx.fill()++new_data = np.array(data)+new_data[:,:,:3] = data[:,:,2::-1]++im = Image.fromarray(new_data, mode="RGBa")+im2 = im.convert("RGBA")+im2.show()+print(new_data[-1, -1])+++surface.write_to_png("example.png") # Output to PNG++FNULL = open(os.devnull, 'w')+sp.call(["open", "example.png"], stdout=FNULL, stderr=sp.STDOUT)+FNULL.close()++print(np.array(Image.open("example.png"))[-1, -1])diff --git a/camera/camera.py b/camera/camera.pyindex 568006832..848bcc240 100644--- a/camera/camera.py+++ b/camera/camera.py@@ -1,9 +1,9 @@-from __future__ import print_function+import itertools as itimport numpy as npimport operator as op-import aggdraw+# import aggdrawimport copyimport time@@ -44,7 +44,7 @@ class Camera(object):# than this value will be rescaled."max_allowable_norm": FRAME_WIDTH,"image_mode": "RGBA",- "n_rgb_coords": 4,+ "n_channels": 4,"pixel_array_dtype": 'uint8',"use_z_coordinate_for_display_order": False,# z_buff_func is only used if the flag above is set to True.@@ -131,7 +131,7 @@ class Camera(object):self.background_color, self.background_opacity)self.background = np.zeros(- (height, width, self.n_rgb_coords),+ (height, width, self.n_channels),dtype=self.pixel_array_dtype)self.background[:, :] = background_rgba@@ -372,8 +372,7 @@ class Camera(object):coord_strings[0] = "M" + coord_strings[0]# The C at the start of every 6th number communicates# that the following 6 define a cubic Bezier- coord_strings[2::6] = map(- lambda s: "C" + str(s), coord_strings[2::6])+ coord_strings[2::6] = ["C" + str(s) for s in coord_strings[2::6]]# Possibly finish with "Z"if vmobject.mark_paths_closed:coord_strings[-1] = coord_strings[-1] + " Z"@@ -549,7 +548,7 @@ class Camera(object):return 1 + (thickness - 1) / factordef get_thickening_nudges(self, thickness):- _range = range(-thickness / 2 + 1, thickness / 2 + 1)+ _range = list(range(-thickness / 2 + 1, thickness / 2 + 1))return np.array(list(it.product(_range, _range)))def thickened_coordinates(self, pixel_coords, thickness):diff --git a/camera/mapping_camera.py b/camera/mapping_camera.pyindex d85f51ca2..8fec02acf 100644--- a/camera/mapping_camera.py+++ b/camera/mapping_camera.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/camera/moving_camera.py b/camera/moving_camera.pyindex 99a384738..21b7f9479 100644--- a/camera/moving_camera.py+++ b/camera/moving_camera.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import FRAME_HEIGHTfrom constants import FRAME_WIDTHdiff --git a/camera/multi_camera.py b/camera/multi_camera.pyindex 42b428cd8..e61496dad 100644--- a/camera/multi_camera.py+++ b/camera/multi_camera.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from camera.moving_camera import MovingCamerafrom utils.iterables import list_difference_updatediff --git a/camera/three_d_camera.py b/camera/three_d_camera.pyindex d2777a335..52b7b56e2 100644--- a/camera/three_d_camera.py+++ b/camera/three_d_camera.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as np@@ -98,7 +98,7 @@ class ThreeDCamera(MovingCamera):# -np.linalg.norm(vm.get_center()-camera_point)# for vm in vmobs# ])- three_d_status = map(should_shade_in_3d, vmobs)+ three_d_status = list(map(should_shade_in_3d, vmobs))has_points = [vm.get_num_points() > 0 for vm in vmobs]if all(three_d_status) and all(has_points):cmp_vect = self.get_unit_normal_vect(vmobs[1])diff --git a/constants.py b/constants.pyindex d7c77829c..0ef138cd9 100644--- a/constants.py+++ b/constants.py@@ -200,7 +200,7 @@ COLOR_MAP = {"GREEN_SCREEN": "#00FF00","ORANGE": "#FF862F",}-PALETTE = COLOR_MAP.values()+PALETTE = list(COLOR_MAP.values())locals().update(COLOR_MAP)-for name in filter(lambda s: s.endswith("_C"), COLOR_MAP.keys()):+for name in [s for s in list(COLOR_MAP.keys()) if s.endswith("_C")]:locals()[name.replace("_C", "")] = locals()[name]diff --git a/continual_animation/from_animation.py b/continual_animation/from_animation.pyindex d0bc9e818..61314b850 100644--- a/continual_animation/from_animation.py+++ b/continual_animation/from_animation.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from continual_animation.continual_animation import ContinualAnimationdiff --git a/continual_animation/numbers.py b/continual_animation/numbers.pyindex 8c618ace2..2cc815237 100644--- a/continual_animation/numbers.py+++ b/continual_animation/numbers.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from continual_animation.from_animation import NormalAnimationAsContinualAnimationfrom animation.numbers import ChangingDecimaldiff --git a/continual_animation/update.py b/continual_animation/update.pyindex 7e57331e8..a72d471a0 100644--- a/continual_animation/update.py+++ b/continual_animation/update.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from continual_animation.continual_animation import ContinualAnimationfrom animation.update import MaintainPositionRelativeTodiff --git a/example.png b/example.pngnew file mode 100644index 000000000..f5887cd89Binary files /dev/null and b/example.png differdiff --git a/example_scenes.py b/example_scenes.pyindex 922884b3c..b511fbf67 100644--- a/example_scenes.py+++ b/example_scenes.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import absolute_import+from .big_ol_pile_of_manim_imports import *# To watch one of these scenes, run the following:diff --git a/extract_scene.py b/extract_scene.pyindex 71a50c7a1..15bd822ad 100644--- a/extract_scene.py+++ b/extract_scene.py@@ -1,7 +1,5 @@# !/usr/bin/env python2-from __future__ import absolute_import-from __future__ import print_functionimport sysimport argparseimport imp@@ -212,7 +210,7 @@ def prompt_user_for_choice(name_to_obj):print("%d: %s" % (count, name))num_to_name[count] = nametry:- user_input = raw_input(CHOOSE_NUMBER_MESSAGE)+ user_input = input(CHOOSE_NUMBER_MESSAGE)return [name_to_obj[num_to_name[int(num_str)]]for num_str in user_input.split(",")@@ -227,14 +225,14 @@ def get_scene_classes(scene_names_to_classes, config):print(NO_SCENE_MESSAGE)return []if len(scene_names_to_classes) == 1:- return scene_names_to_classes.values()+ return list(scene_names_to_classes.values())if config["scene_name"] in scene_names_to_classes:return [scene_names_to_classes[config["scene_name"]]]if config["scene_name"] != "":print(SCENE_NOT_FOUND_MESSAGE)return []if config["write_all"]:- return scene_names_to_classes.values()+ return list(scene_names_to_classes.values())return prompt_user_for_choice(scene_names_to_classes)diff --git a/for_3b1b_videos/common_scenes.py b/for_3b1b_videos/common_scenes.pyindex e32ad6019..70592d83b 100644--- a/for_3b1b_videos/common_scenes.py+++ b/for_3b1b_videos/common_scenes.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import randomimport string@@ -103,7 +103,7 @@ class PatreonThanks(Scene):patreon_logo = PatreonLogo()patreon_logo.to_edge(UP)- patrons = map(TextMobject, self.specific_patrons)+ patrons = list(map(TextMobject, self.specific_patrons))num_groups = float(len(patrons)) / self.max_patron_group_sizeproportion_range = np.linspace(0, 1, num_groups + 1)indices = (len(patrons) * proportion_range).astype('int')@@ -209,7 +209,7 @@ class PatreonEndScreen(PatreonThanks):thanks.add(underline)self.add(thanks)- patrons = VGroup(*map(TextMobject, self.specific_patrons))+ patrons = VGroup(*list(map(TextMobject, self.specific_patrons)))patrons.scale(self.patron_scale_val)for patron in patrons:if patron.get_width() > self.max_patron_width:diff --git a/for_3b1b_videos/pi_creature_animations.py b/for_3b1b_videos/pi_creature_animations.pyindex 96721b7ff..d0561236b 100644--- a/for_3b1b_videos/pi_creature_animations.py+++ b/for_3b1b_videos/pi_creature_animations.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *@@ -117,7 +117,7 @@ class FlashThroughClass(Animation):if not isinstance(mobject, PiCreatureClass):raise Exception("FlashThroughClass mobject must be a PiCreatureClass")digest_config(self, kwargs)- self.indices = range(mobject.height * mobject.width)+ self.indices = list(range(mobject.height * mobject.width))if mode == "random":np.random.shuffle(self.indices)diff --git a/for_3b1b_videos/pi_creature_scene.py b/for_3b1b_videos/pi_creature_scene.pyindex 86f23cbc5..bcef0735d 100644--- a/for_3b1b_videos/pi_creature_scene.py+++ b/for_3b1b_videos/pi_creature_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import itertools as itimport numpy as np@@ -67,10 +67,7 @@ class PiCreatureScene(Scene):def get_on_screen_pi_creatures(self):mobjects = self.get_mobjects()- return VGroup(*filter(- lambda pi: pi in mobjects,- self.get_pi_creatures()- ))+ return VGroup(*[pi for pi in self.get_pi_creatures() if pi in mobjects])def introduce_bubble(self, *args, **kwargs):if isinstance(args[0], PiCreature):@@ -99,7 +96,7 @@ class PiCreatureScene(Scene):pi.bubble is not None and \pi.bubble in on_screen_mobjects- pi_creatures_with_bubbles = filter(has_bubble, self.get_pi_creatures())+ pi_creatures_with_bubbles = list(filter(has_bubble, self.get_pi_creatures()))if pi_creature in pi_creatures_with_bubbles:pi_creatures_with_bubbles.remove(pi_creature)old_bubble = pi_creature.bubble@@ -161,10 +158,7 @@ class PiCreatureScene(Scene):if not self.any_pi_creatures_on_screen():return animations- non_pi_creature_anims = filter(- lambda anim: anim.mobject not in self.get_pi_creatures(),- animations- )+ non_pi_creature_anims = [anim for anim in animations if anim.mobject not in self.get_pi_creatures()]if len(non_pi_creature_anims) == 0:return animationsfirst_anim = non_pi_creature_anims[0]@@ -178,10 +172,7 @@ class PiCreatureScene(Scene):continueif pi_creature in first_anim.mobject.submobject_family():continue- anims_with_pi_creature = filter(- lambda anim: pi_creature in anim.mobject.submobject_family(),- animations- )+ anims_with_pi_creature = [anim for anim in animations if pi_creature in anim.mobject.submobject_family()]for anim in anims_with_pi_creature:if isinstance(anim, Transform):index = anim.mobject.submobject_family().index(pi_creature)@@ -336,7 +327,7 @@ class TeacherStudentsScene(PiCreatureScene):)def get_student_changes(self, *modes, **kwargs):- pairs = zip(self.get_students(), modes)+ pairs = list(zip(self.get_students(), modes))pairs = [(s, m) for s, m in pairs if m is not None]start = VGroup(*[s for s, m in pairs])target = VGroup(*[s.copy().change_mode(m) for s, m in pairs])diff --git a/mayavi_test.py b/mayavi_test.pynew file mode 100644index 000000000..dfd297da0--- /dev/null+++ b/mayavi_test.py@@ -0,0 +1,55 @@+from numpy import arange, pi, cos, sin++from traits.api import HasTraits, Range, Instance, \+ on_trait_change+from traitsui.api import View, Item, Group++from mayavi.core.api import PipelineBase+from mayavi.core.ui.api import MayaviScene, SceneEditor, \+ MlabSceneModel+++dphi = pi/1000.+phi = arange(0.0, 2*pi + 0.5*dphi, dphi, 'd')++def curve(n_mer, n_long):+ mu = phi*n_mer+ x = cos(mu) * (1 + cos(n_long * mu/n_mer)*0.5)+ y = sin(mu) * (1 + cos(n_long * mu/n_mer)*0.5)+ z = 0.5 * sin(n_long*mu/n_mer)+ t = sin(mu)+ return x, y, z, t+++class MyModel(HasTraits):+ n_meridional = Range(0, 30, 6, )#mode='spinner')+ n_longitudinal = Range(0, 30, 11, )#mode='spinner')++ scene = Instance(MlabSceneModel, ())++ plot = Instance(PipelineBase)+++ # When the scene is activated, or when the parameters are changed, we+ # update the plot.+ @on_trait_change('n_meridional,n_longitudinal,scene.activated')+ def update_plot(self):+ x, y, z, t = curve(self.n_meridional, self.n_longitudinal)+ if self.plot is None:+ self.plot = self.scene.mlab.plot3d(x, y, z, t,+ tube_radius=0.025, colormap='Spectral')+ else:+ self.plot.mlab_source.trait_set(x=x, y=y, z=z, scalars=t)+++ # The layout of the dialog created+ view = View(Item('scene', editor=SceneEditor(scene_class=MayaviScene),+ height=250, width=300, show_label=False),+ Group(+ '_', 'n_meridional', 'n_longitudinal',+ ),+ resizable=True,+ )++my_model = MyModel()+my_model.configure_traits()\ No newline at end of filediff --git a/mobject/coordinate_systems.py b/mobject/coordinate_systems.pyindex f238e0e28..8bc823bae 100644--- a/mobject/coordinate_systems.py+++ b/mobject/coordinate_systems.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as np@@ -102,8 +102,8 @@ class Axes(VGroup):while abs(lh - rh) > 0.001:mh = np.mean([lh, rh])hands = [lh, mh, rh]- points = map(graph.point_from_proportion, hands)- lx, mx, rx = map(self.x_axis.point_to_number, points)+ points = list(map(graph.point_from_proportion, hands))+ lx, mx, rx = list(map(self.x_axis.point_to_number, points))if lx <= x and rx >= x:if mx > x:rh = mh@@ -240,9 +240,9 @@ class NumberPlane(VMobject):def get_coordinate_labels(self, x_vals=None, y_vals=None):coordinate_labels = VGroup()if x_vals is None:- x_vals = range(-int(self.x_radius), int(self.x_radius) + 1)+ x_vals = list(range(-int(self.x_radius), int(self.x_radius) + 1))if y_vals is None:- y_vals = range(-int(self.y_radius), int(self.y_radius) + 1)+ y_vals = list(range(-int(self.y_radius), int(self.y_radius) + 1))for index, vals in enumerate([x_vals, y_vals]):num_pair = [0, 0]for val in vals:@@ -331,7 +331,7 @@ class ComplexPlane(NumberPlane):result = VGroup()if len(numbers) == 0:- numbers = range(-int(self.x_radius), int(self.x_radius) + 1)+ numbers = list(range(-int(self.x_radius), int(self.x_radius) + 1))numbers += [complex(0, y)for y in range(-int(self.y_radius), int(self.y_radius) + 1)diff --git a/mobject/frame.py b/mobject/frame.pyindex a197d474b..68bef518c 100644--- a/mobject/frame.py+++ b/mobject/frame.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *from mobject.geometry import Rectanglediff --git a/mobject/functions.py b/mobject/functions.pyindex e65605808..e6ab5772d 100644--- a/mobject/functions.py+++ b/mobject/functions.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/mobject/geometry.py b/mobject/geometry.pyindex 3cd4a00d5..c3d4ac851 100644--- a/mobject/geometry.py+++ b/mobject/geometry.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *@@ -334,7 +334,7 @@ class Line(VMobject):def set_start_and_end(self, start, end):start_to_end = self.pointify(end) - self.pointify(start)vect = np.zeros(len(start_to_end))- longer_dim = np.argmax(map(abs, start_to_end))+ longer_dim = np.argmax(list(map(abs, start_to_end)))vect[longer_dim] = start_to_end[longer_dim]self.start, self.end = [arg.get_edge_center(unit * vect)@@ -495,7 +495,7 @@ class Arrow(Line):}def __init__(self, *args, **kwargs):- points = map(self.pointify, args)+ points = list(map(self.pointify, args))if len(args) == 1:args = (points[0] + UP + LEFT, points[0])Line.__init__(self, *args, **kwargs)diff --git a/mobject/matrix.py b/mobject/matrix.pyindex 7558cf771..5e4455400 100644--- a/mobject/matrix.py+++ b/mobject/matrix.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/mobject/mobject.py b/mobject/mobject.pyindex 2f6f39dcd..397c1b81d 100644--- a/mobject/mobject.py+++ b/mobject/mobject.py@@ -1,5 +1,5 @@-from __future__ import absolute_import-from __future__ import print_function++import copyimport itertools as it@@ -40,7 +40,7 @@ class Mobject(Container):def __init__(self, *submobjects, **kwargs):Container.__init__(self, *submobjects, **kwargs)- if not all(map(lambda m: isinstance(m, Mobject), submobjects)):+ if not all([isinstance(m, Mobject) for m in submobjects]):raise Exception("All submobjects must be of type Mobject")self.submobjects = list(submobjects)self.color = Color(self.color)@@ -89,10 +89,7 @@ class Mobject(Container):Ensures all attributes which are mobjects are includedin the submobjects list."""- mobject_attrs = filter(- lambda x: isinstance(x, Mobject),- self.__dict__.values()- )+ mobject_attrs = [x for x in list(self.__dict__.values()) if isinstance(x, Mobject)]self.submobjects = list_update(self.submobjects, mobject_attrs)return self@@ -127,7 +124,7 @@ class Mobject(Container):submob.copy() for submob in self.submobjects]family = self.submobject_family()- for attr, value in self.__dict__.items():+ for attr, value in list(self.__dict__.items()):if isinstance(value, Mobject) and value in family and value is not self:setattr(copy_mobject, attr, value.copy())return copy_mobject@@ -755,16 +752,13 @@ class Mobject(Container):return result + self.submobjectsdef submobject_family(self):- sub_families = map(Mobject.submobject_family, self.submobjects)+ sub_families = list(map(Mobject.submobject_family, self.submobjects))all_mobjects = [self] + list(it.chain(*sub_families))#all_mobjects = list(it.chain(*sub_families)) + [self]return remove_list_redundancies(all_mobjects)def family_members_with_points(self):- return filter(- lambda m: m.get_num_points() > 0,- self.submobject_family()- )+ return [m for m in self.submobject_family() if m.get_num_points() > 0]def arrange_submobjects(self, direction=RIGHT, center=True, **kwargs):for m1, m2 in zip(self.submobjects, self.submobjects[1:]):diff --git a/mobject/number_line.py b/mobject/number_line.pyindex ebcfa36c3..eae38b99b 100644--- a/mobject/number_line.py+++ b/mobject/number_line.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *@@ -116,7 +116,7 @@ class NumberLine(VMobject):if len(numbers) == 0:numbers = self.default_numbers_to_display()if "force_integers" in kwargs and kwargs["force_integers"]:- numbers = map(int, numbers)+ numbers = list(map(int, numbers))result = VGroup()for number in numbers:mob = TexMobject(str(number))diff --git a/mobject/numbers.py b/mobject/numbers.pyindex fb7ae5f15..6be4e76e0 100644--- a/mobject/numbers.py+++ b/mobject/numbers.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *import operator as opdiff --git a/mobject/probability.py b/mobject/probability.pyindex dbc95b2fe..49c8f9bbe 100644--- a/mobject/probability.py+++ b/mobject/probability.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/mobject/shape_matchers.py b/mobject/shape_matchers.pyindex 4e341e0db..c0f8e394f 100644--- a/mobject/shape_matchers.py+++ b/mobject/shape_matchers.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/mobject/svg/brace.py b/mobject/svg/brace.pyindex 4ef048dad..e5c42cb75 100644--- a/mobject/svg/brace.py+++ b/mobject/svg/brace.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/mobject/svg/drawings.py b/mobject/svg/drawings.pyindex 5005a4d52..c82d31082 100644--- a/mobject/svg/drawings.py+++ b/mobject/svg/drawings.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import itertools as itfrom constants import *@@ -711,7 +711,7 @@ class Logo(VMobject):fill_opacity=1,stroke_width=0,)- for vertex3 in half_base * LEFT, ORIGIN,+ for vertex3 in (half_base * LEFT, ORIGIN,)]left_half_triangle = right_half_triangle.copy()left_half_triangle.flip(UP, about_point=ORIGIN)@@ -782,7 +782,7 @@ class Logo(VMobject):class DeckOfCards(VGroup):def __init__(self, **kwargs):- possible_values = map(str, range(1, 11)) + ["J", "Q", "K"]+ possible_values = list(map(str, list(range(1, 11)))) + ["J", "Q", "K"]possible_suits = ["hearts", "diamonds", "spades", "clubs"]VGroup.__init__(self, *[PlayingCard(value=value, suit=suit, **kwargs)@@ -804,7 +804,7 @@ class PlayingCard(VGroup):"color": LIGHT_GREY,"turned_over": False,"possible_suits": ["hearts", "diamonds", "spades", "clubs"],- "possible_values": map(str, range(2, 11)) + ["J", "Q", "K", "A"],+ "possible_values": list(map(str, list(range(2, 11)))) + ["J", "Q", "K", "A"],}def __init__(self, key=None, **kwargs):@@ -878,7 +878,7 @@ class PlayingCard(VGroup):def get_design(self, value, symbol):if value == "A":return self.get_ace_design(symbol)- if value in map(str, range(2, 11)):+ if value in list(map(str, list(range(2, 11)))):return self.get_number_design(value, symbol)else:return self.get_face_card_design(value, symbol)diff --git a/mobject/svg/svg_mobject.py b/mobject/svg/svg_mobject.pyindex 2ad45c515..50fc3e51e 100644--- a/mobject/svg/svg_mobject.py+++ b/mobject/svg/svg_mobject.py@@ -103,7 +103,7 @@ class SVGMobject(VMobject):else:pass # TODO# warnings.warn("Unknown element type: " + element.tagName)- result = filter(lambda m: m is not None, result)+ result = [m for m in result if m is not None]self.handle_transforms(element, VMobject(*result))if len(result) > 1 and not self.unpack_groups:result = [VGroup(*result)]@@ -295,15 +295,15 @@ class VMobjectFromSVGPathstring(VMobject):"A", # elliptical Arc"Z", # closepath]- result += map(lambda s: s.lower(), result)+ result += [s.lower() for s in result]return resultdef generate_points(self):pattern = "[%s]" % ("".join(self.get_path_commands()))- pairs = zip(+ pairs = list(zip(re.findall(pattern, self.path_string),re.split(pattern, self.path_string)[1:]- )+ ))# Which mobject should new points be added toself.growing_path = selffor command, coord_string in pairs:diff --git a/mobject/svg/tex_mobject.py b/mobject/svg/tex_mobject.pyindex 22c863792..6db0726fe 100644--- a/mobject/svg/tex_mobject.py+++ b/mobject/svg/tex_mobject.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *from .svg_mobject import SVGMobject@@ -92,10 +92,7 @@ class SingleStringTexMobject(SVGMobject):# Handle imbalanced \left and \rightnum_lefts, num_rights = [- len(filter(- lambda s: s[0] in "(){}[]|.\\",- tex.split(substr)[1:]- ))+ len([s for s in tex.split(substr)[1:] if s[0] in "(){}[]|.\\"])for substr in ("\\left", "\\right")]if num_lefts != num_rights:@@ -164,13 +161,13 @@ class TexMobject(SingleStringTexMobject):def break_up_tex_strings(self, tex_strings):substrings_to_isolate = op.add(self.substrings_to_isolate,- self.tex_to_color_map.keys()+ list(self.tex_to_color_map.keys()))split_list = split_string_list_to_isolate_substring(tex_strings, *substrings_to_isolate)- split_list = map(str.strip, split_list)- split_list = filter(lambda s: s != '', split_list)+ split_list = list(map(str.strip, split_list))+ split_list = [s for s in split_list if s != '']return split_listdef break_up_by_substrings(self):@@ -209,10 +206,7 @@ class TexMobject(SingleStringTexMobject):else:return tex1 == tex2- return VGroup(*filter(- lambda m: test(tex, m.get_tex_string()),- self.submobjects- ))+ return VGroup(*[m for m in self.submobjects if test(tex, m.get_tex_string())])def get_part_by_tex(self, tex, **kwargs):all_parts = self.get_parts_by_tex(tex, **kwargs)@@ -225,7 +219,7 @@ class TexMobject(SingleStringTexMobject):return selfdef set_color_by_tex_to_color_map(self, texs_to_color_map, **kwargs):- for texs, color in texs_to_color_map.items():+ for texs, color in list(texs_to_color_map.items()):try:# If the given key behaves like tex_stringstexs + ''diff --git a/mobject/three_dimensions.py b/mobject/three_dimensions.pyindex 0a183d303..a7a9bf4f8 100644--- a/mobject/three_dimensions.py+++ b/mobject/three_dimensions.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/mobject/types/image_mobject.py b/mobject/types/image_mobject.pyindex 9d6878b4b..455607236 100644--- a/mobject/types/image_mobject.py+++ b/mobject/types/image_mobject.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/mobject/types/point_cloud_mobject.py b/mobject/types/point_cloud_mobject.pyindex de6287812..dbefff926 100644--- a/mobject/types/point_cloud_mobject.py+++ b/mobject/types/point_cloud_mobject.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *@@ -54,13 +54,13 @@ class PMobject(Mobject):# def set_color_by_gradient(self, start_color, end_color):def set_color_by_gradient(self, *colors):- self.rgbas = np.array(map(+ self.rgbas = np.array(list(map(color_to_rgba,color_gradient(colors, len(self.points))- ))+ )))return self- start_rgba, end_rgba = map(color_to_rgba, [start_color, end_color])+ start_rgba, end_rgba = list(map(color_to_rgba, [start_color, end_color]))for mob in self.family_members_with_points():num_points = mob.get_num_points()mob.rgbas = np.array([@@ -70,7 +70,7 @@ class PMobject(Mobject):return selfdef set_colors_by_radial_gradient(self, center=None, radius=1, inner_color=WHITE, outer_color=BLACK):- start_rgba, end_rgba = map(color_to_rgba, [start_color, end_color])+ start_rgba, end_rgba = list(map(color_to_rgba, [start_color, end_color]))if center is None:center = self.get_center()for mob in self.family_members_with_points():@@ -129,7 +129,7 @@ class PMobject(Mobject):def ingest_submobjects(self):attrs = self.get_array_attrs()- arrays = map(self.get_merged_array, attrs)+ arrays = list(map(self.get_merged_array, attrs))for attr, array in zip(attrs, arrays):setattr(self, attr, array)self.submobjects = []@@ -184,7 +184,7 @@ class Mobject1D(PMobject):Mobject.__init__(self, **kwargs)def add_line(self, start, end, color=None):- start, end = map(np.array, [start, end])+ start, end = list(map(np.array, [start, end]))length = np.linalg.norm(end - start)if length == 0:points = [start]diff --git a/mobject/types/vectorized_mobject.py b/mobject/types/vectorized_mobject.pyindex 3253909d3..9ec444c9d 100644--- a/mobject/types/vectorized_mobject.py+++ b/mobject/types/vectorized_mobject.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from colour import Color@@ -316,10 +316,7 @@ class VMobject(Mobject):return selfdef get_subpath_mobjects(self):- return filter(- lambda m: hasattr(m, 'is_subpath') and m.is_subpath,- self.submobjects- )+ return [m for m in self.submobjects if hasattr(m, 'is_subpath') and m.is_subpath]def apply_function(self, function):factor = self.pre_function_handle_to_anchor_scale_factordiff --git a/mobject/value_tracker.py b/mobject/value_tracker.pyindex 0af4d9488..7c8ee5842 100644--- a/mobject/value_tracker.py+++ b/mobject/value_tracker.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/old_projects/256.py b/old_projects/256.pyindex f413d3686..e62bf8715 100644--- a/old_projects/256.py+++ b/old_projects/256.py@@ -292,7 +292,7 @@ class MainBreakdown(Scene):Animation(hash_names))self.play(get_passing_flash(), Animation(hash_names))- self.play(*map(FadeOut, [name, hash_names]))+ self.play(*list(map(FadeOut, [name, hash_names])))self.gpu = gpuself.rate_words = rate_wordsdiff --git a/old_projects/WindingNumber.py b/old_projects/WindingNumber.pyindex e286f1ce5..f65ba9ab0 100644--- a/old_projects/WindingNumber.py+++ b/old_projects/WindingNumber.py@@ -1,4 +1,4 @@-from __future__ import print_function+from big_ol_pile_of_manim_imports import *import time@@ -483,12 +483,12 @@ def plane_func_by_wind_spec(*specs):return (p[0], p[1], 1)else:print("Error in plane_func_by_wind_spec embiggen!")- specs = map(embiggen, specs)+ specs = list(map(embiggen, specs))- pos_specs = filter(lambda x_y_z : x_y_z[2] > 0, specs)- neg_specs = filter(lambda x_y_z1 : x_y_z1[2] < 0, specs)+ pos_specs = [x_y_z for x_y_z in specs if x_y_z[2] > 0]+ neg_specs = [x_y_z1 for x_y_z1 in specs if x_y_z1[2] < 0]- neg_specs_made_pos = map (lambda x_y_z2 : (x_y_z2[0], x_y_z2[1], -x_y_z2[2]), neg_specs)+ neg_specs_made_pos = [(x_y_z2[0], x_y_z2[1], -x_y_z2[2]) for x_y_z2 in neg_specs]def poly(c, root_specs):return np.prod([(c - complex(x, y))**z for (x, y, z) in root_specs])@@ -949,7 +949,7 @@ class EquationSolver2dNode(object):if len(self.children) == 0:return 0- return 1 + max(map(lambda n : n.depth(), self.children))+ return 1 + max([n.depth() for n in self.children])def nodes_at_depth(self, n):if n == 0:@@ -957,7 +957,7 @@ class EquationSolver2dNode(object):# Not the efficient way to flatten lists, because Python + is linear in list size,# but we have at most two children, so no big deal here- return sum(map(lambda c : c.nodes_at_depth(n - 1), self.children), [])+ return sum([c.nodes_at_depth(n - 1) for c in self.children], [])# This is definitely NOT the efficient way to do BFS, but I'm just trying to write something# quick without thinking that gets the job done on small instances for now@@ -966,17 +966,17 @@ class EquationSolver2dNode(object):# Not the efficient way to flatten lists, because Python + is linear in list size,# but this IS hacky_bfs...- return sum(map(lambda i : self.nodes_at_depth(i), range(depth + 1)), [])+ return sum([self.nodes_at_depth(i) for i in range(depth + 1)], [])def display_in_series(self):- return Succession(self.first_anim, *map(lambda n : n.display_in_series(), self.children))+ return Succession(self.first_anim, *[n.display_in_series() for n in self.children])def display_in_parallel(self):- return Succession(self.first_anim, AnimationGroup(*map(lambda n : n.display_in_parallel(), self.children)))+ return Succession(self.first_anim, AnimationGroup(*[n.display_in_parallel() for n in self.children]))def display_in_bfs(self):bfs_nodes = self.hacky_bfs()- return Succession(*map(lambda n : n.first_anim, bfs_nodes))+ return Succession(*[n.first_anim for n in bfs_nodes])def play_in_bfs(self, scene, border_anim):bfs_nodes = self.hacky_bfs()@@ -1228,7 +1228,7 @@ class EquationSolver2d(ColorMappedObjectsScene):rect.get_bottom_right(),rect.get_bottom_left(),]- border = Polygon(*map(lambda x : num_plane.coords_to_point(*x) + IN, rect_points))+ border = Polygon(*[num_plane.coords_to_point(*x) + IN for x in rect_points])match_style_with_bg(border, base_line)rect_time_without_linger = 4 * run_time_base@@ -1493,7 +1493,7 @@ class SignsExplanation(Scene):def construct(self):num_line = NumberLine()largest_num = 10- num_line.add_numbers(*range(-largest_num, largest_num + 1))+ num_line.add_numbers(*list(range(-largest_num, largest_num + 1)))self.add(num_line)self.wait()@@ -1984,7 +1984,7 @@ class LoopSplitScene(ColorMappedObjectsScene):return UpdateFromAlphaFunc(mob, lambda m, a : m.set_fill(opacity = interpolate(start, end, a)))def bullet_list_fade(start, end, bullet_list):- return map(lambda b : bullet_fade(start, end, b), bullet_list)+ return [bullet_fade(start, end, b) for b in bullet_list]def line_fade(start, end, mob):return UpdateFromAlphaFunc(mob, lambda m, a : m.set_stroke(width = interpolate(start, end, a) * stroke_width))diff --git a/old_projects/WindingNumber_G.py b/old_projects/WindingNumber_G.pyindex 07fc2c58c..a15d50fca 100644--- a/old_projects/WindingNumber_G.py+++ b/old_projects/WindingNumber_G.py@@ -176,14 +176,14 @@ class Introduce1DFunctionCase(Scene):x_axis_config = {"unit_size" : 3,"tick_frequency" : 0.25,- "numbers_with_elongated_ticks" : range(-1, 4)+ "numbers_with_elongated_ticks" : list(range(-1, 4))},y_min = -2, y_max = 4.5,)axes.to_corner(DOWN+LEFT)- axes.x_axis.add_numbers(*range(-1, 4))+ axes.x_axis.add_numbers(*list(range(-1, 4)))axes.y_axis.label_direction = LEFT- axes.y_axis.add_numbers(-1, *range(1, 5))+ axes.y_axis.add_numbers(-1, *list(range(1, 5)))inputs = TextMobject("Inputs")inputs.next_to(axes.x_axis, UP, aligned_edge = RIGHT)@@ -279,7 +279,7 @@ class Introduce1DFunctionCase(Scene):self.wait()self.play(MoveToTarget(equation, replace_mobject_with_target_in_scene = True),- *map(FadeOut, [equation_arrow, v_line])+ *list(map(FadeOut, [equation_arrow, v_line])))self.set_variables_as_attrs(@@ -778,7 +778,7 @@ class InputOutputScene(Scene):label_colors = [GREEN, RED]for plane, vect, text, color in zip(planes, vects, label_texts, label_colors):plane.stretch_to_fit_width(self.plane_width)- plane.add_coordinates(x_vals = range(-2, 3), y_vals = range(-2, 3))+ plane.add_coordinates(x_vals = list(range(-2, 3)), y_vals = list(range(-2, 3)))plane.white_parts = VGroup(plane.axes, plane.coordinate_labels)plane.lines_to_fade = VGroup(plane.main_lines, plane.secondary_lines)plane.move_to(vect*FRAME_X_RADIUS/2 + self.y_shift*DOWN)@@ -906,11 +906,11 @@ class IntroduceInputOutputScene(InputOutputScene):FadeIn(output_label))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [input_label_arrow, input_label,output_label_arrow, output_label,curved_arrow, function_label,- ]))+ ])))#General movements and wigglesout_dot_continual_update = self.get_output_dot_continual_update(in_dot, out_dot)@@ -1042,9 +1042,9 @@ class IntroduceVectorField(IntroduceInputOutputScene):newer_in_vectors.add(in_vector.copy())self.remove(*continual_updates)self.remove()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [out_dot, out_vector, in_vectors, in_dot, in_vector- ]))+ ])))self.wait()target_length = 0.4for vector in newer_in_vectors:@@ -1557,8 +1557,8 @@ class OneDRegionBoundary(Scene):)self.wait()self.play(*it.chain(- map(GrowArrow, arrows),- map(Write, signs)+ list(map(GrowArrow, arrows)),+ list(map(Write, signs))))self.wait()self.play(@@ -1737,7 +1737,7 @@ class HypothesisAboutFullyColoredBoundary(ColorMappedObjectsScene):hypothesis[0].next_to(hypothesis[1:], UP)hypothesis[0].set_color(YELLOW)s = hypothesis[1].get_tex_string()- s = filter(lambda c : c not in string.whitespace, s)+ s = [c for c in s if c not in string.whitespace]n = s.index("colors")hypothesis[1][n:n+len("colors")].set_color_by_gradient(# RED, GOLD_E, YELLOW, GREEN, BLUE, PINK,@@ -2395,7 +2395,7 @@ class BreakDownLoopWithNonzeroWinding(TransitionFromPathsToBoundaries):)self.play(FadeIn(both_cannot_be_zero),- *map(GrowArrow, arrows)+ *list(map(GrowArrow, arrows)))self.wait()@@ -2438,7 +2438,7 @@ class MonomialTerm(PathContainingZero):if hasattr(plane, "numbers_to_show"):_range = plane.numbers_to_showelse:- _range = range(-2, 3)+ _range = list(range(-2, 3))for x in _range:if x == 0:continue@@ -2534,7 +2534,7 @@ class MonomialTerm(PathContainingZero):def rescale_output_plane(self):output_stuff = VGroup(self.output_plane, self.output_coloring)- self.play(*map(FadeOut, [self.loop, self.out_loop]))+ self.play(*list(map(FadeOut, [self.loop, self.out_loop])))self.play(output_stuff.scale, 3.0/50, run_time = 2)@@ -2564,7 +2564,7 @@ class PolynomialTerms(MonomialTerm):def relabel_planes(self):self.output_plane.x_radius = 50self.output_plane.y_radius = 50- self.output_plane.numbers_to_show = range(-45, 50, 15)+ self.output_plane.numbers_to_show = list(range(-45, 50, 15))MonomialTerm.relabel_planes(self)def sweep_through_loop_interior(self):@@ -2758,7 +2758,7 @@ class ShowComplexFunction(Scene):FadeIn(rect),LaggedStart(FadeIn, title))- self.play(*map(FadeIn, [x_dot, x_label]))+ self.play(*list(map(FadeIn, [x_dot, x_label])))self.wait()self.play(ReplacementTransform(x_dot.copy(), fx_dot, path_arc = arrow.path_arc),@@ -2768,7 +2768,7 @@ class ShowComplexFunction(Scene):self.wait(2)self.play(MoveToTarget(fx_label),- *map(FadeOut, [title, x_dot, x_label, arrow, fx_dot])+ *list(map(FadeOut, [title, x_dot, x_label, arrow, fx_dot])))self.play(FadeOut(plane.coordinate_labels))self.wait()@@ -2943,12 +2943,12 @@ class MentionQAndA(Scene):title.to_edge(UP)self.add(title)- questions = VGroup(*map(TextMobject, [+ questions = VGroup(*list(map(TextMobject, ["If you think of the current videos as short stories, \\\\ what is the novel that you want to write?","How did you get into mathematics?","What motivated you to join 3b1b?","$\\vdots$",- ]))+ ])))questions.arrange_submobjects(DOWN, buff = 0.75)questions.next_to(title, DOWN, LARGE_BUFF)@@ -3179,7 +3179,7 @@ class PatreonScroll(Scene):patreon_logo.shift(SMALL_BUFF*LEFT)self.add(patreon_logo)- patrons = VGroup(*map(TextMobject, self.specific_patrons))+ patrons = VGroup(*list(map(TextMobject, self.specific_patrons)))patrons.scale(0.75)random.shuffle(patrons.submobjects)patrons.arrange_submobjects(DOWN, aligned_edge = LEFT)diff --git a/old_projects/alt_calc.py b/old_projects/alt_calc.pyindex 2d69bc9e4..57a146824 100644--- a/old_projects/alt_calc.py+++ b/old_projects/alt_calc.py@@ -792,7 +792,7 @@ class StartingCalc101(PiCreatureScene):class GraphicalIntuitions(GraphScene):CONFIG = {"func": lambda x: 0.1 * (x - 2) * (x - 5) * (x - 7) + 4,- "x_labeled_nums": range(1, 10),+ "x_labeled_nums": list(range(1, 10)),}def construct(self):@@ -1277,10 +1277,10 @@ class StandardDerivativeVisual(GraphScene):x = input_tracker.get_value()x_min = x - dxx_max = x + dx- y, y_min, y_max = map(+ y, y_min, y_max = list(map(self.graph.underlying_function,[x, x_min, x_max]- )+ ))x_line = Line(self.coords_to_point(x_min, 0),self.coords_to_point(x_max, 0),@@ -1345,10 +1345,10 @@ class IntroduceTransformationView(NumberlineTransformationScene):def show_animation_preview(self):input_points = self.get_sample_input_points()- output_points = map(+ output_points = list(map(self.number_func_to_point_func(self.func),input_points- )+ ))sample_dots = self.get_sample_dots()sample_dot_ghosts = sample_dots.copy().fade(0.5)arrows = VGroup(*[@@ -1514,7 +1514,7 @@ class TalkThroughXSquaredExample(IntroduceTransformationView):self.get_output_point(self.func(x)),buff=MED_SMALL_BUFF)- for x, num in zip(range(1, 6), self.input_line.numbers[1:])+ for x, num in zip(list(range(1, 6)), self.input_line.numbers[1:])])point_func = self.number_func_to_point_func(self.func)@@ -2197,9 +2197,9 @@ class GraphOnePlusOneOverX(GraphScene):def setup_axes(self):GraphScene.setup_axes(self)step = 2- self.x_axis.add_numbers(*range(-6, 0, step) + range(step, 7, step))+ self.x_axis.add_numbers(*list(range(-6, 0, step)) + list(range(step, 7, step)))self.y_axis.label_direction = RIGHT- self.y_axis.add_numbers(*range(-2, 0, step) + range(step, 4, step))+ self.y_axis.add_numbers(*list(range(-2, 0, step)) + list(range(step, 4, step)))def draw_graphs(self, animate=True):lower_func_graph, upper_func_graph = func_graph = VGroup(*[@@ -2953,7 +2953,7 @@ class AnalyzeFunctionWithTransformations(NumberlineTransformationScene):x_max=10,)sample_dots.set_stroke(BLACK, 0.5)- sample_points = map(Mobject.get_center, sample_dots)+ sample_points = list(map(Mobject.get_center, sample_dots))self.play(LaggedStart(FadeInAndShiftFromDirection, sample_dots,@@ -3241,10 +3241,7 @@ class StabilityAndInstability(AnalyzeFunctionWithTransformations):arrow_groups = VGroup()for point in phi_point, phi_bro_point:- arrows = VGroup(*filter(- lambda a: np.linalg.norm(a.get_start() - point) < 0.75,- self.all_arrows- )).copy()+ arrows = VGroup(*[a for a in self.all_arrows if np.linalg.norm(a.get_start() - point) < 0.75]).copy()arrows.set_fill(PINK, 1)arrows.set_stroke(PINK, 3)arrows.second_anim = LaggedStart(@@ -3254,7 +3251,7 @@ class StabilityAndInstability(AnalyzeFunctionWithTransformations):lag_ratio=0.7,run_time=2,)- arrows.anim = AnimationGroup(*map(GrowArrow, arrows))+ arrows.anim = AnimationGroup(*list(map(GrowArrow, arrows)))arrow_groups.add(arrows)phi_arrows, phi_bro_arrows = arrow_groups@@ -3318,7 +3315,7 @@ class StabilityAndInstability(AnalyzeFunctionWithTransformations):for deriv_label, dot_group in zip(deriv_labels, dot_groups):self.play(FadeInFromDown(deriv_label))self.play(LaggedStart(GrowFromCenter, dot_group))- self.play(*map(MoveToTarget, dot_group), run_time=2)+ self.play(*list(map(MoveToTarget, dot_group)), run_time=2)self.wait()diff --git a/old_projects/basel/basel.py b/old_projects/basel/basel.pyindex be7ca4572..280b72e96 100644--- a/old_projects/basel/basel.py+++ b/old_projects/basel/basel.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import print_function+from big_ol_pile_of_manim_imports import *from once_useful_constructs.light import *@@ -368,7 +368,7 @@ class IntroScene(PiCreatureScene):slab_colors = [YELLOW, BLUE] * (max_n2 / 2)for t1, t2, color in zip(series_terms, series_terms[1:], slab_colors):- line = Line(*map(self.number_line.number_to_point, [t1, t2]))+ line = Line(*list(map(self.number_line.number_to_point, [t1, t2])))rect = Rectangle()rect.stroke_width = 0rect.fill_opacity = 1@@ -570,8 +570,8 @@ class FirstLighthouseScene(PiCreatureScene):color = WHITE,number_at_center = 1.6,stroke_width = 1,- numbers_with_elongated_ticks = range(1,5),- numbers_to_show = range(1,5),+ numbers_with_elongated_ticks = list(range(1,5)),+ numbers_to_show = list(range(1,5)),unit_size = 2,tick_frequency = 0.2,line_to_number_buff = LARGE_BUFF,@@ -618,7 +618,7 @@ class FirstLighthouseScene(PiCreatureScene):euler_sum_above = TexMobject("1", "+", "{1\over 4}","+", "{1\over 9}", "+", "{1\over 16}", "+", "{1\over 25}", "+", "{1\over 36}")- for (i,term) in zip(range(len(euler_sum_above)),euler_sum_above):+ for (i,term) in zip(list(range(len(euler_sum_above))),euler_sum_above):#horizontal alignment with tick marksterm.next_to(self.number_line.number_to_point(0.5*i+1),UP,buff = 2)# vertical alignment with light indicator@@ -651,7 +651,7 @@ class FirstLighthouseScene(PiCreatureScene):# slowly switch on visible light cones and increment indicator- for (i,light_source) in zip(range(NUM_VISIBLE_CONES),light_sources[:NUM_VISIBLE_CONES]):+ for (i,light_source) in zip(list(range(NUM_VISIBLE_CONES)),light_sources[:NUM_VISIBLE_CONES]):indicator_start_time = 1.0 * (i+1) * SWITCH_ON_RUN_TIME/light_source.radius * self.number_line.unit_sizeindicator_stop_time = indicator_start_time + INDICATOR_UPDATE_TIMEindicator_rate_func = squish_rate_func(@@ -684,7 +684,7 @@ class FirstLighthouseScene(PiCreatureScene):self.wait()# quickly switch on off-screen light cones and increment indicator- for (i,light_source) in zip(range(NUM_VISIBLE_CONES,NUM_CONES),light_sources[NUM_VISIBLE_CONES:NUM_CONES]):+ for (i,light_source) in zip(list(range(NUM_VISIBLE_CONES,NUM_CONES)),light_sources[NUM_VISIBLE_CONES:NUM_CONES]):indicator_start_time = 0.5 * (i+1) * FAST_SWITCH_ON_RUN_TIME/light_source.radius * self.number_line.unit_sizeindicator_stop_time = indicator_start_time + FAST_INDICATOR_UPDATE_TIMEindicator_rate_func = squish_rate_func(#smooth, 0.8, 0.9)@@ -1659,8 +1659,8 @@ class BackToEulerSumScene(PiCreatureScene):color = WHITE,number_at_center = 1.6,stroke_width = 1,- numbers_with_elongated_ticks = range(1,5),- numbers_to_show = range(1,5),+ numbers_with_elongated_ticks = list(range(1,5)),+ numbers_to_show = list(range(1,5)),unit_size = 2,tick_frequency = 0.2,line_to_number_buff = LARGE_BUFF,@@ -3737,7 +3737,7 @@ class PondScene(ThreeDScene):stroke_width = LAKE_STROKE_WIDTH,stroke_color = LAKE_STROKE_COLOR,numbers_with_elongated_ticks = [],- numbers_to_show = range(-MAX_N,MAX_N + 1),#,2),+ numbers_to_show = list(range(-MAX_N,MAX_N + 1)),#,2),unit_size = LAKE0_RADIUS * TAU/4 / 2 * scale,tick_frequency = 1,tick_size = LAKE_STROKE_WIDTH,@@ -3828,7 +3828,7 @@ class PondScene(ThreeDScene):two_sided_sum.scale(TEX_SCALE)- for (i,submob) in zip(range(nb_symbols),two_sided_sum.submobjects):+ for (i,submob) in zip(list(range(nb_symbols)),two_sided_sum.submobjects):submob.next_to(self.number_line.number_to_point(i - 13),DOWN, buff = 2*scale)if (i == 0 or i % 2 == 1 or i == nb_symbols - 1): # non-fractionssubmob.shift(0.3 * scale * DOWN)diff --git a/old_projects/basel/basel2.py b/old_projects/basel/basel2.pyindex afa417e41..cd01d8d9d 100644--- a/old_projects/basel/basel2.py+++ b/old_projects/basel/basel2.py@@ -1,7 +1,7 @@#!/usr/bin/env python# -*- coding: utf-8 -*--from __future__ import print_function+from big_ol_pile_of_manim_imports import *from once_useful_constructs.light import *@@ -350,7 +350,7 @@ class IntroScene(PiCreatureScene):for i, t1, t2 in zip(it.count(1), [0]+series_terms, series_terms):color = next(slab_colors)- line = Line(*map(number_line.number_to_point, [t1, t2]))+ line = Line(*list(map(number_line.number_to_point, [t1, t2])))rect = Rectangle(stroke_width = 0,fill_opacity = 1,@@ -913,8 +913,8 @@ class FirstLighthouseScene(PiCreatureScene):color = WHITE,number_at_center = 1.6,stroke_width = 1,- numbers_with_elongated_ticks = range(1,6),- numbers_to_show = range(1,6),+ numbers_with_elongated_ticks = list(range(1,6)),+ numbers_to_show = list(range(1,6)),unit_size = 2,tick_frequency = 0.2,line_to_number_buff = LARGE_BUFF,@@ -1245,7 +1245,7 @@ class IntroduceScreen(Scene):FadeIn(screen))self.wait()- self.play(*map(FadeOut, [screen_label, screen_arrow]))+ self.play(*list(map(FadeOut, [screen_label, screen_arrow])))screen.save_state()self.play(FadeIn(morty),@@ -1774,7 +1774,7 @@ class InverseSquareLaw(ThreeDScene):copies.move_to(source_point, IN)copies.shift(distance*RIGHT*unit_distance)return copies- screen_copy_groups = map(get_screen_copy_group, range(1, 8))+ screen_copy_groups = list(map(get_screen_copy_group, list(range(1, 8))))def get_screen_copy_group_anim(n):group = screen_copy_groups[n]prev_group = screen_copy_groups[n-1]@@ -2281,10 +2281,10 @@ class TwoLightSourcesScene(ManipulateLightsourceSetups):LaggedStart(GrowArrow, identical_lighthouses_arrows))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [identical_lighthouses_words,identical_lighthouses_arrows,- ]))+ ])))#Show labels of lengthsself.play(ShowCreation(line_a), Write(label_a))@@ -2306,7 +2306,7 @@ class TwoLightSourcesScene(ManipulateLightsourceSetups):b_part.move_to(lsB)h_part.move_to(lsC)- self.play(*map(FadeOut, [lsA, lsB, lsC, indicator]))+ self.play(*list(map(FadeOut, [lsA, lsB, lsC, indicator])))for ls, part in (lsA, a_part), (lsB, b_part), (lsC, h_part):self.add(ls)self.play(@@ -2352,10 +2352,7 @@ class SimpleIPTProof(Scene):C = ORIGIN#Dumb and inefficientalphas = np.linspace(0, 1, 500)- i = np.argmin(map(- lambda a : np.linalg.norm(interpolate(A, B, a)),- alphas- ))+ i = np.argmin([np.linalg.norm(interpolate(A, B, a)) for a in alphas])H = interpolate(A, B, alphas[i])triangle = VGroup(Line(C, A, color = BLUE),@@ -2656,7 +2653,7 @@ class IPTScene(TwoLightSourcesScene, ZoomedScene):Animation(screen_arrow),)self.add(spotlights_update_anim)- self.play(*map(FadeOut, [screen_word, screen_arrow]))+ self.play(*list(map(FadeOut, [screen_word, screen_arrow])))self.wait()# Reshape screen@@ -2715,9 +2712,9 @@ class IPTScene(TwoLightSourcesScene, ZoomedScene):self.remove(spotlights_update_anim)self.add(spotlight_b)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [spotlight_a, lsA.ambient_light, lsB.ambient_light- ]))+ ])))show_key_point(spotlight_b, A)self.play(FadeOut(spotlight_b),@@ -2861,7 +2858,7 @@ class InscribedeAngleThreorem(TeacherStudentsScene):self.teacher.change, "raise_right_hand",ShowCreation(shape, rate_func = None),)- self.play(*map(FadeIn, [angle_mark, theta]))+ self.play(*list(map(FadeIn, [angle_mark, theta])))self.play(ShowCreation(half_angle_mark),Write(theta_halves),@@ -3608,7 +3605,7 @@ class PondScene(ThreeDScene):stroke_width = LAKE_STROKE_WIDTH,stroke_color = LAKE_STROKE_COLOR,#numbers_with_elongated_ticks = range(-MAX_N,MAX_N + 1),- numbers_to_show = range(-MAX_N,MAX_N + 1,2),+ numbers_to_show = list(range(-MAX_N,MAX_N + 1,2)),unit_size = LAKE0_RADIUS * TAU/4 / 2 * scale,tick_frequency = 1,line_to_number_buff = LARGE_BUFF,@@ -3687,7 +3684,7 @@ class PondScene(ThreeDScene):two_sided_sum.scale(TEX_SCALE)- for (i,submob) in zip(range(nb_symbols),two_sided_sum.submobjects):+ for (i,submob) in zip(list(range(nb_symbols)),two_sided_sum.submobjects):submob.next_to(self.number_line.number_to_point(i - 13),DOWN, buff = 2*scale)if (i == 0 or i % 2 == 1 or i == nb_symbols - 1): # non-fractionssubmob.shift(0.3 * scale * DOWN)@@ -3804,7 +3801,7 @@ class ThinkBackToHowAmazingThisIs(ThreeDScene):number_line = NumberLine(x_min = -self.x_radius,x_max = self.x_radius,- numbers_to_show = range(-self.max_shown_n, self.max_shown_n),+ numbers_to_show = list(range(-self.max_shown_n, self.max_shown_n)),)number_line.add_numbers()number_line.shift(2*DOWN)@@ -3816,7 +3813,7 @@ class ThinkBackToHowAmazingThisIs(ThreeDScene):])for u in (1, -1)]- dot_pairs = it.starmap(VGroup, zip(positive_dots, negative_dots))+ dot_pairs = it.starmap(VGroup, list(zip(positive_dots, negative_dots)))# Decimaldecimal = DecimalNumber(0, num_decimal_places = 6)@@ -3863,7 +3860,7 @@ class ThinkBackToHowAmazingThisIs(ThreeDScene):self.add(number_line, *dot_pairs)self.add(zoom_out, scale_decimal)- tuples = zip(term_mobjects, plusses, partial_sums)+ tuples = list(zip(term_mobjects, plusses, partial_sums))run_time = 1for term_mobs, plus_pair, partial_sum in tuples:self.play(@@ -3878,10 +3875,10 @@ class ThinkBackToHowAmazingThisIs(ThreeDScene):zoom_out.begin_wind_down()self.wait()self.remove(zoom_out, scale_decimal)- self.play(*map(FadeOut, it.chain(+ self.play(*list(map(FadeOut, it.chain(term_mobjects, plusses,number_line.numbers, [decimal]- )))+ ))))self.number_line = number_line@@ -4391,7 +4388,7 @@ class InfiniteCircleScene(PiCreatureScene):class Credits(Scene):def construct(self):credits = VGroup(*[- VGroup(*map(TextMobject, pair))+ VGroup(*list(map(TextMobject, pair)))for pair in [("Primary writer and animator:", "Ben Hambrecht"),("Editing, advising, narrating:", "Grant Sanderson"),diff --git a/old_projects/bell.py b/old_projects/bell.pyindex 9e710b16b..69744e930 100644--- a/old_projects/bell.py+++ b/old_projects/bell.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from big_ol_pile_of_manim_imports import *from tqdm import tqdm as ProgressDisplay@@ -227,7 +227,7 @@ class PhotonsThroughPerpendicularFilters(PhotonPassesCompletelyOrNotAtAll):class MoreFiltersMoreLight(FilterScene):CONFIG = {- "filter_x_coordinates" : range(-2, 3),+ "filter_x_coordinates" : list(range(-2, 3)),"pol_filter_configs" : [{"include_arrow_label" : False,@@ -399,7 +399,7 @@ class ShowALittleMath(TeacherStudentsScene):exp1.get_parts_by_tex(tex).copy(),exp2.get_parts_by_tex(tex).copy(),)- for tex in color_map.keys()+ for tex in list(color_map.keys())] + [Write(exp2, run_time = 2)])self.change_student_modes(*["pondering"]*3,@@ -569,7 +569,7 @@ class AngleToProbabilityChart(Scene):])prob_mobs.set_color(YELLOW)- angle_prob_pairs = zip(angle_mobs, prob_mobs)+ angle_prob_pairs = list(zip(angle_mobs, prob_mobs))for angle_mob, prob_mob in angle_prob_pairs:prob_mob.next_to(angle_mob, RIGHT, buff = 3)for prob_mob in prob_mobs[1:]:@@ -890,7 +890,7 @@ class ShowVariousFilterPairsFrom0To45(ShowVariousFilterPairs):self.play(LaggedStart(ShowCreation, rects))self.wait()- self.play(*map(Write, cosines), run_time = 2)+ self.play(*list(map(Write, cosines)), run_time = 2)self.wait()class ForgetPreviousActions(ShowVariousFilterPairs):@@ -1338,10 +1338,10 @@ class RemoveBFromLabeledFilters(IntroduceLabeledFiltersNoRotation):self.wait()def fade_in_labels(self):- self.play(*map(FadeIn, [+ self.play(*list(map(FadeIn, [self.blocked_at_B_label_group,self.blocked_at_C_label_group,- ]))+ ])))self.wait()class NumbersSuggestHiddenVariablesAreImpossible(TeacherStudentsScene):@@ -1772,7 +1772,7 @@ class VennDiagramProofByContradiction(Scene):terms[0].remove(less_than)plus = terms[2][0][0]terms[2][0].remove(plus)- rects = map(SurroundingRectangle, terms)+ rects = list(map(SurroundingRectangle, terms))terms[2][0].add_to_back(plus)last_rects = VGroup(*rects[1:])@@ -1855,13 +1855,13 @@ class VennDiagramProofByContradiction(Scene):self.play(FadeIn(funny_business),- *map(Write, braces),+ *list(map(Write, braces)),run_time = 1)self.wait()self.play(FadeIn(less_than),- *map(FadeOut, [funny_business, braces])+ *list(map(FadeOut, [funny_business, braces])))for term, group, region, num in zip(terms, photon_groups, regions, nums)[1:]:@@ -2005,7 +2005,7 @@ class VennDiagramProofByContradiction(Scene):R = np.sqrt(len(photons) / np.pi)pairs = []rejected = []- for x, y in it.product(*[range(-int(R)-1, int(R)+2)]*2):+ for x, y in it.product(*[list(range(-int(R)-1, int(R)+2))]*2):if x**2 + y**2 < R**2:pairs.append((x, y))else:@@ -2365,7 +2365,7 @@ class ReEmphasizeVennDiagram(VennDiagramProofByContradiction):def move_around(total_time):self.time- t_range = range(int(total_time/dt))+ t_range = list(range(int(total_time/dt)))for x in ProgressDisplay(t_range):self.time += dtnew_B_to_A = rotate_vector(B_to_A, self.time*A_freq)diff --git a/old_projects/borsuk.py b/old_projects/borsuk.pyindex 729409d69..05ee2feb1 100644--- a/old_projects/borsuk.py+++ b/old_projects/borsuk.py@@ -333,7 +333,7 @@ class IntroduceStolenNecklaceProblem(ThreeDScene):self.play(FadeOut(necklace.chain),*it.chain(*[- map(Animation, group)+ list(map(Animation, group))for group in strand_groups]))@@ -401,12 +401,12 @@ class IntroduceStolenNecklaceProblem(ThreeDScene):def get_jewels_organized_by_type(self, jewels):return [- VGroup(*filter(lambda m : m.get_color() == color, jewels))+ VGroup(*[m for m in jewels if m.get_color() == color])for color in map(Color, self.jewel_colors)]def shuffle_jewels(self, jewels, run_time = 2, path_arc = np.pi/2, **kwargs):- shuffled_indices = range(len(jewels))+ shuffled_indices = list(range(len(jewels)))random.shuffle(shuffled_indices)target_group = VGroup(*[jewel.copy().move_to(jewels[shuffled_indices[i]])@@ -426,15 +426,15 @@ class IntroduceStolenNecklaceProblem(ThreeDScene):if jewel in jewel_type:return iraise Exception("Not in any jewel_types")- type_numbers = map(jewel_to_type_number, jewels)+ type_numbers = list(map(jewel_to_type_number, jewels))n_types = len(jewel_types)- for slice_indices in it.combinations(range(1, len(jewels)), n_types):+ for slice_indices in it.combinations(list(range(1, len(jewels))), n_types):slice_indices = [0] + list(slice_indices) + [len(jewels)]if self.forced_binary_choices is not None:all_binary_choices = [self.forced_binary_choices]else:- all_binary_choices = it.product(*[range(2)]*(n_types+1))+ all_binary_choices = it.product(*[list(range(2))]*(n_types+1))for binary_choices in all_binary_choices:subsets = [type_numbers[i1:i2]@@ -813,7 +813,7 @@ class WalkEquatorPostTransform(GraphScene):self.play(ShowCreation(v_line))self.wait()self.play(FadeOut(v_line))- self.play(*map(FadeOut, [tilted_eq, dots]))+ self.play(*list(map(FadeOut, [tilted_eq, dots])))def draw_transverse_curve(self):transverse_curve = self.get_transverse_curve(self.great_arc_images)@@ -1151,16 +1151,16 @@ class GeneralizeBorsukUlam(Scene):self.wait()def get_condition(self):- squares = map(TexMobject, [+ squares = list(map(TexMobject, ["x_%d^2"%dfor d in range(1, 1+self.n_dims)- ])+ ]))for square, color in zip(squares, self.colors):square[0].set_color(color)square[-1].set_color(color)plusses = [TexMobject("+") for x in range(self.n_dims-1)]plusses += [TexMobject("=1")]- condition = VGroup(*it.chain(*zip(squares, plusses)))+ condition = VGroup(*it.chain(*list(zip(squares, plusses))))condition.arrange_submobjects(RIGHT)return condition@@ -1354,7 +1354,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem):jewels.submobjects.sort(lambda m1, m2 : cmp(m1.get_center()[0], m2.get_center()[0]))- remaining_indices = range(len(jewels))+ remaining_indices = list(range(len(jewels)))remaining_indices.remove(example_index)example_segment = self.color_necklace_by_indices(example_index)@@ -1365,10 +1365,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem):lambda m1, m2 : cmp(m1.get_center()[0], m2.get_center()[0]))segment_types = VGroup(*[- VGroup(*filter(- lambda m : m.get_color() == Color(color),- segments- ))+ VGroup(*[m for m in segments if m.get_color() == Color(color)])for color in self.jewel_colors])@@ -1437,7 +1434,7 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem):for i in slice_indices[1:-1]])cut_points = [- map(chain.point_from_proportion, pair)+ list(map(chain.point_from_proportion, pair))for pair in cut_proportions]v_lines = VGroup(*[DashedLine(UP, DOWN) for x in range(2)])@@ -1529,9 +1526,9 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem):))self.play(Blink(morty))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [morty, morty.bubble, morty.bubble.content- ]))+ ])))def shift_divide_off_tick_marks(self):groups = self.groups@@ -1618,13 +1615,13 @@ class MakeTwoJewelCaseContinuous(IntroduceStolenNecklaceProblem):self.wait()self.play(emerald_segments.restore,- *map(FadeOut, [brace, label])+ *list(map(FadeOut, [brace, label])))self.wait()self.play(ShowCreation(arrow2))self.wait()- self.play(*map(FadeOut, [words, arrow1, arrow2]))+ self.play(*list(map(FadeOut, [words, arrow1, arrow2])))for line in v_lines:self.play(line.shift, segment_width*LEFT/2)@@ -1704,7 +1701,7 @@ class ChoicesInNecklaceCutting(ReconfigurableScene):] + [final_num_pair]point_pairs = [- map(self.interval.number_to_point, num_pair)+ list(map(self.interval.number_to_point, num_pair))for num_pair in num_pairs]@@ -1763,9 +1760,9 @@ class ChoicesInNecklaceCutting(ReconfigurableScene):self.wait()self.transition_to_alt_config(denoms = [3, 3, 3])self.wait()- self.play(*map(FadeOut, list(braces) + [+ self.play(*list(map(FadeOut, list(braces) + [brace.concrete_label for brace in braces- ]))+ ])))self.choice_one_words = words@@ -1781,7 +1778,7 @@ class ChoicesInNecklaceCutting(ReconfigurableScene):)self.play(Write(words))- self.play(*map(FadeIn, [boxes, labels]))+ self.play(*list(map(FadeIn, [boxes, labels])))for binary_choices in it.product(*[[0, 1]]*3):self.play(*[ApplyMethod(group.move_to, group.target_points[choice])@@ -2061,7 +2058,7 @@ class NecklaceDivisionSphereAssociation(ChoicesInNecklaceCutting):)self.play(*it.chain(- map(GrowFromCenter, braces),+ list(map(GrowFromCenter, braces)),[Write(brace.label) for brace in braces]))self.wait()@@ -2070,14 +2067,14 @@ class NecklaceDivisionSphereAssociation(ChoicesInNecklaceCutting):def add_boxes_and_labels(self):boxes, labels = self.get_boxes_and_labels()- self.play(*map(FadeIn, [boxes, labels]))+ self.play(*list(map(FadeIn, [boxes, labels])))self.wait()def show_binary_choice_association(self):groups = self.get_groups()self.swapping_anims = []final_choices = [1, 0, 1]- quads = zip(self.braces, self.denoms, groups, final_choices)+ quads = list(zip(self.braces, self.denoms, groups, final_choices))for brace, denom, group, final_choice in quads:char = brace.label.args[0][1]choices = [@@ -2186,12 +2183,12 @@ class TotalLengthOfEachJewelEquals(NecklaceDivisionSphereAssociation, ThreeDScendef get_fair_division_indices(self, colors):colors = np.array(list(colors))- color_types = map(Color, set([c.get_hex_l() for c in colors]))+ color_types = list(map(Color, set([c.get_hex_l() for c in colors])))type_to_count = dict([(color, sum(colors == color))for color in color_types])- for i1, i2 in it.combinations(range(1, len(colors)-1), 2):+ for i1, i2 in it.combinations(list(range(1, len(colors)-1)), 2):bools = [sum(colors[i1:i2] == color) == type_to_count[color]/2for color in color_types@@ -2202,10 +2199,10 @@ class TotalLengthOfEachJewelEquals(NecklaceDivisionSphereAssociation, ThreeDScendef demonstrate_fair_division(self):segments, tick_marks = self.necklace- color_types = map(Color, set([+ color_types = list(map(Color, set([segment.get_color().get_hex_l()for segment in segments- ]))+ ])))top_segments = VGroup(*it.chain(self.groups[0][0],self.groups[2][0],@@ -2213,10 +2210,7 @@ class TotalLengthOfEachJewelEquals(NecklaceDivisionSphereAssociation, ThreeDScenbottom_segments = self.groups[1][0]for color in color_types:monochrome_groups = [- VGroup(*filter(- lambda segment: segment.get_color() == color,- segment_group- ))+ VGroup(*[segment for segment in segment_group if segment.get_color() == color])for segment_group in (top_segments, bottom_segments)]labels = VGroup()@@ -2484,7 +2478,7 @@ class FourDBorsukUlam(GeneralizeBorsukUlam, PiCreatureScene):Write(brace_text))self.wait()- self.play(*map(FadeOut, [brace, brace_text]))+ self.play(*list(map(FadeOut, [brace, brace_text])))self.wait()self.play(FadeIn(lhs),diff --git a/old_projects/brachistochrone/curves.py b/old_projects/brachistochrone/curves.pyindex ba1449d74..19cd05d55 100644--- a/old_projects/brachistochrone/curves.py+++ b/old_projects/brachistochrone/curves.py@@ -192,7 +192,7 @@ class PathSlidingScene(Scene):def write_time(self, time):if hasattr(self, "time_mob"):self.remove(self.time_mob)- digits = map(TexMobject, "%.2f"%time)+ digits = list(map(TexMobject, "%.2f"%time))digits[0].next_to(self.t_equals, buff = 0.1)for left, right in zip(digits, digits[1:]):right.next_to(left, buff = 0.1, aligned_edge = DOWN)@@ -401,7 +401,7 @@ class MinimalPotentialEnergy(Scene):side_words_start = TextMobject("Parameter describing")top_words, last_side_words = [- map(TextMobject, pair)+ list(map(TextMobject, pair))for pair in [("Light's travel time", "Potential energy"),("path", "mechanical state")@@ -483,7 +483,7 @@ class WhatGovernsSpeed(PathSlidingScene):slider = sliders.pop(1)vector = vectors.pop(1)faders = sliders+vectors+[words]- self.play(*map(FadeOut, faders))+ self.play(*list(map(FadeOut, faders)))self.remove(*faders)self.show_geometry(slider, vector)@@ -551,7 +551,7 @@ class WhatGovernsSpeed(PathSlidingScene):Point(loss_in_potential.get_left()),loss_in_potential),- *map(GrowFromCenter, potential.split())+ *list(map(GrowFromCenter, potential.split())))self.wait(2)self.play(diff --git a/old_projects/brachistochrone/cycloid.py b/old_projects/brachistochrone/cycloid.pyindex 0e0a3cef5..fd62497d0 100644--- a/old_projects/brachistochrone/cycloid.py+++ b/old_projects/brachistochrone/cycloid.py@@ -105,7 +105,7 @@ class IntroduceCycloid(CycloidScene):arrow.reverse_points()q_mark = TextMobject("?")- self.play(*map(ShimmerIn, equation.split()))+ self.play(*list(map(ShimmerIn, equation.split())))self.wait()self.play(ApplyMethod(equation.shift, 2.2*UP),@@ -545,7 +545,7 @@ class SlidingObject(CycloidScene, PathSlidingScene):self.roll_back()self.wait()if with_words:- self.play(*map(ShimmerIn, [words1, arrow, words2]))+ self.play(*list(map(ShimmerIn, [words1, arrow, words2])))self.wait()self.remove(self.circle)start_time = len(self.frames)*self.frame_durationdiff --git a/old_projects/brachistochrone/drawing_images.py b/old_projects/brachistochrone/drawing_images.pyindex 267839428..663a5dfa2 100644--- a/old_projects/brachistochrone/drawing_images.py+++ b/old_projects/brachistochrone/drawing_images.py@@ -52,7 +52,7 @@ def sort_by_color(mob):def get_image_array(name):image_files = os.listdir(IMAGE_DIR)- possibilities = filter(lambda s : s.startswith(name), image_files)+ possibilities = [s for s in image_files if s.startswith(name)]for possibility in possibilities:try:path = os.path.join(IMAGE_DIR, possibility)diff --git a/old_projects/brachistochrone/graveyard.py b/old_projects/brachistochrone/graveyard.pyindex 78f62310e..d8135a4f1 100644--- a/old_projects/brachistochrone/graveyard.py+++ b/old_projects/brachistochrone/graveyard.py@@ -117,10 +117,10 @@ class MultilayeredGlass(PhotonScene, ZoomedScene):)def show_layer_variables(self):- layer_top_pairs = zip(+ layer_top_pairs = list(zip(self.layer_tops[:self.num_variables],self.layer_tops[1:]- )+ ))v_equations = []start_ys = []end_ys = []@@ -170,7 +170,7 @@ class MultilayeredGlass(PhotonScene, ZoomedScene):self.add(start_y)self.play(GrowFromCenter(brace))self.wait()- quads = zip(v_equations, start_ys, end_ys, braces)+ quads = list(zip(v_equations, start_ys, end_ys, braces))self.equations = []for v_eq, start_y, end_y, brace in quads:self.remove(brace)@@ -223,7 +223,7 @@ class MultilayeredGlass(PhotonScene, ZoomedScene):bend_point - little_square.get_center(),run_time = 2))- self.play(*map(ShowCreation, figure_marks))+ self.play(*list(map(ShowCreation, figure_marks)))self.wait()equation_frame = little_square.copy()equation_frame.scale(0.5)diff --git a/old_projects/brachistochrone/light.py b/old_projects/brachistochrone/light.pyindex d0027f6ab..9a2fe60ca 100644--- a/old_projects/brachistochrone/light.py+++ b/old_projects/brachistochrone/light.py@@ -240,9 +240,9 @@ class ShowMultiplePathsThroughLens(ShowMultiplePathsScene):def get_paths(self):alphas = [0.25, 0.4, 0.58, 0.75]- lower_right, upper_right, upper_left, lower_left = map(+ lower_right, upper_right, upper_left, lower_left = list(map(self.lens.point_from_proportion, alphas- )+ ))return [Mobject(Line(self.start_point, a),@@ -347,7 +347,7 @@ class StraightLinesFastestInConstantMedium(PhotonScene):right.next_to(arrow, RIGHT)squaggle, line = self.get_paths()- self.play(*map(ShimmerIn, [left, arrow, right]))+ self.play(*list(map(ShimmerIn, [left, arrow, right])))self.play(ShowCreation(squaggle))self.play(self.photon_run_along_path(squaggle, run_time = 2, rate_func = None@@ -444,7 +444,7 @@ class GeometryOfGlassSituation(ShowMultiplePathsInWater):end_x = interpolate(left, right, 1.0)left_line = Line(self.start_point, left, color = RED_D)right_line = Line(self.end_point, right, color = RED_D)- h_1, h_2 = map(TexMobject, ["h_1", "h_2"])+ h_1, h_2 = list(map(TexMobject, ["h_1", "h_2"]))h_1.next_to(left_line, LEFT)h_2.next_to(right_line, RIGHT)point_a = Dot(self.start_point)@@ -711,7 +711,7 @@ class SpringSetup(ShowMultiplePathsInWater):def show_horizontal_component(self, ring):v_right = Vector(ring.get_top(), RIGHT)v_left = Vector(ring.get_bottom(), LEFT)- self.play(*map(ShowCreation, [v_right, v_left]))+ self.play(*list(map(ShowCreation, [v_right, v_left])))self.wait()self.remove(v_right, v_left)@@ -906,12 +906,12 @@ class StateSnellsLaw(PhotonScene):self.play(self.photon_run_along_path(path))self.wait()self.play(ShowCreation(vert_line))- self.play(*map(ShowCreation, arcs))- self.play(*map(GrowFromCenter, thetas))+ self.play(*list(map(ShowCreation, arcs)))+ self.play(*list(map(GrowFromCenter, thetas)))self.wait()self.play(ShimmerIn(exp1))self.wait()- self.play(*map(ShimmerIn, [equals, exp2]))+ self.play(*list(map(ShimmerIn, [equals, exp2])))self.wait()diff --git a/old_projects/brachistochrone/misc.py b/old_projects/brachistochrone/misc.pyindex 06afcdacf..812f8f96e 100644--- a/old_projects/brachistochrone/misc.py+++ b/old_projects/brachistochrone/misc.py@@ -66,7 +66,7 @@ class TimeLine(Scene):speical_dates = [2016] + [obj["date"] for obj in dated_events]- centuries = range(1600, 2100, 100)+ centuries = list(range(1600, 2100, 100))timeline = NumberLine(numerical_radius = 300,number_at_center = 1800,@@ -106,7 +106,7 @@ class TimeLine(Scene):)self.play(FadeIn(picture))self.wait(3)- self.play(*map(FadeOut, [event_mob, date_mob, line, picture]))+ self.play(*list(map(FadeOut, [event_mob, date_mob, line, picture])))class StayedUpAllNight(Scene):@@ -197,7 +197,7 @@ class StayedUpAllNight(Scene):self.play(ShimmerIn(not_newton))phil_trans.add(solution, not_newton)self.wait()- self.play(*map(ShimmerIn, newton_complaint.split()))+ self.play(*list(map(ShimmerIn, newton_complaint.split())))self.wait()self.play(ShimmerIn(dunned_def),@@ -337,16 +337,16 @@ class VideoLayout(Scene):),UP)- left_brace.words = map(TextMobject, [+ left_brace.words = list(map(TextMobject, ["Problem statement","History","Johann Bernoulli's cleverness"- ])+ ]))curr = left_brace- right_brace.words = map(TextMobject, [+ right_brace.words = list(map(TextMobject, ["Challenge","Mark Levi's cleverness",- ])+ ]))for brace in left_brace, right_brace:curr = bracedirection = DOWN if brace is left_brace else UP@@ -392,7 +392,7 @@ class ShortestPathProblem(Scene):self.play(ShimmerIn(words),- *map(GrowFromCenter, dots)+ *list(map(GrowFromCenter, dots)))self.play(ShowCreation(path))self.play(Transform(diff --git a/old_projects/brachistochrone/multilayered.py b/old_projects/brachistochrone/multilayered.pyindex 0e78aa1ac..273511aac 100644--- a/old_projects/brachistochrone/multilayered.py+++ b/old_projects/brachistochrone/multilayered.py@@ -257,7 +257,7 @@ class ShowLayerVariables(MultilayeredScene, PhotonScene):]))self.wait()- triplets = zip(v_equations, start_ys, end_ys)+ triplets = list(zip(v_equations, start_ys, end_ys))anims = []for v_eq, start_y, end_y in triplets:anims += [diff --git a/old_projects/brachistochrone/wordplay.py b/old_projects/brachistochrone/wordplay.pyindex e21bb69c5..acc7e8b30 100644--- a/old_projects/brachistochrone/wordplay.py+++ b/old_projects/brachistochrone/wordplay.py@@ -223,7 +223,7 @@ class OneSolutionTwoInsights(Scene):mark.next_to(johann, RIGHT)name = TextMobject("Mark Levi").to_edge(UP)- self.play(*map(ShimmerIn, one_solution.split()))+ self.play(*list(map(ShimmerIn, one_solution.split())))self.wait()for pair in zip(one_solution.split(), two_insights.split()):self.play(Transform(*pair, path_func = path_along_arc(np.pi)))@@ -243,9 +243,9 @@ class OneSolutionTwoInsights(Scene):class CircleOfIdeas(Scene):def construct(self):- words = map(TextMobject, [+ words = list(map(TextMobject, ["optics", "calculus", "mechanics", "geometry", "history"- ])+ ]))words[0].set_color(YELLOW)words[1].set_color(BLUE_D)words[2].set_color(GREY)@@ -401,7 +401,7 @@ class BalanceCompetingFactors(Scene):(2, BLUE_D)]]- real_factor1, real_factor2 = map(TextMobject, words)+ real_factor1, real_factor2 = list(map(TextMobject, words))for word in factor1, factor2, real_factor1, real_factor2:word.shift(0.2*UP-word.get_bottom())for f1 in factor1, real_factor1:diff --git a/old_projects/complex_multiplication_article.py b/old_projects/complex_multiplication_article.pyindex 04f9d89ac..18c445e51 100644--- a/old_projects/complex_multiplication_article.py+++ b/old_projects/complex_multiplication_article.py@@ -26,7 +26,7 @@ class SuccessiveComplexMultiplications(ComplexMultiplication):@staticmethoddef string_to_args(arg_string):args_string.replac("i", "j")- return map(copmlex, arg_string.split())+ return list(map(copmlex, arg_string.split()))def construct(self, *multipliers):norm = abs(reduce(op.mul, multipliers, 1))@@ -146,7 +146,7 @@ class DrawSolutionsToZToTheNEqualsW(Scene):radius*np.exp(complex(0, 1)*(2*np.pi*k + theta)/n)for k in range(n)]- points = map(plane.number_to_point, solutions)+ points = list(map(plane.number_to_point, solutions))dots = [Dot(point, color = BLUE_B, radius = 0.1)for point in points@@ -201,7 +201,7 @@ class DrawComplexAngleAndMagnitude(Scene):label.shift(point - edge + buff*dot_to_label_dir)label.set_color(YELLOW)- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))def add_angle_label(self, number):@@ -210,7 +210,7 @@ class DrawComplexAngleAndMagnitude(Scene):radius = 0.2)- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))def add_lines(self, tex_representation, number):point = self.plane.number_to_point(number)@@ -246,5 +246,5 @@ class DrawComplexAngleAndMagnitude(Scene):axis = OUT if point[1] > 0 else INnorm_label.next_to(brace, rotate_vector(point, np.pi/2, axis))- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))diff --git a/old_projects/counting_in_binary.py b/old_projects/counting_in_binary.pyindex c7f484217..7d54f5f71 100644--- a/old_projects/counting_in_binary.py+++ b/old_projects/counting_in_binary.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import print_function+import numpy as npimport itertools as itfrom copy import deepcopy@@ -255,7 +255,7 @@ class ShowReadingRule(Scene):self.wait()self.remove(question)self.add(answer[0])- counts = map(finger_tip_power_of_2, range(5))+ counts = list(map(finger_tip_power_of_2, list(range(5))))for count in counts:self.play(SpinInFromNothing(count, run_time = 0.3))self.wait()@@ -269,7 +269,7 @@ class ShowReadingRule(Scene):hand = Hand(num, small = True)bool_arr = [c == '1' for c in five_char_binary(num)]counts = [4-count for count in range(5) if bool_arr[count]]- count_mobs = map(finger_tip_power_of_2, counts)+ count_mobs = list(map(finger_tip_power_of_2, counts))if num in [6, 27]:count_mobs[1].shift(0.2*DOWN + 0.2*LEFT)if num in [6, 17]:diff --git a/old_projects/crypto.py b/old_projects/crypto.pyindex e1ca76b43..809ad78b3 100644--- a/old_projects/crypto.py+++ b/old_projects/crypto.py@@ -281,13 +281,13 @@ class ListRecentCurrencies(Scene):logos.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)logos.shift(LEFT)logos.to_edge(UP)- names = map(+ names = list(map(TextMobject,["Bitcoin", "Ethereum", "Ripple","Litecoin", "Ethereum Classic"],- )+ ))for logo, name in zip(logos, names):name.next_to(logo, RIGHT)anims = []@@ -305,11 +305,11 @@ class ListRecentCurrencies(Scene):class Hype(TeacherStudentsScene):def construct(self):self.teacher.change_mode("guilty")- phrases = map(TextMobject, [+ phrases = list(map(TextMobject, ["I want some!","I'll get rich, right?","Buy them all!"- ])+ ]))modes = ["hooray", "conniving", "surprised"]for student, phrase, mode in zip(self.students, phrases, modes):bubble = SpeechBubble()@@ -599,7 +599,7 @@ class LayOutPlan(LedgerScene):("Alice", "You", 50),]- self.play(*map(FadeIn, [network, ledger]))+ self.play(*list(map(FadeIn, [network, ledger])))for payment in payments:new_line = self.add_payment_line_to_ledger(*payment)from_name, to_name, amount = payment@@ -838,10 +838,10 @@ class InitialProtocol(Scene):self.add(title, h_line)def show_first_two_items(self):- items = VGroup(*map(self.get_new_item, [+ items = VGroup(*list(map(self.get_new_item, ["Anyone can add lines to the Ledger","Settle up with real money each month"- ]))+ ])))for item in items:self.wait()@@ -1025,7 +1025,7 @@ class DescribeDigitalSignatures(LedgerScene):def generate_key_pairs(self):title = TextMobject("Private", "key /", "Public", "key")title.to_edge(UP)- private, public = map(title.get_part_by_tex, ["Private", "Public"])+ private, public = list(map(title.get_part_by_tex, ["Private", "Public"]))private.set_color(self.private_color)public.set_color(self.public_color)secret = TextMobject("Secret")@@ -1084,7 +1084,7 @@ class DescribeDigitalSignatures(LedgerScene):def keep_secret_key_secret(self):keys = self.private_keys- rects = VGroup(*map(SurroundingRectangle, keys))+ rects = VGroup(*list(map(SurroundingRectangle, keys)))rects.set_color(self.private_color)lock = SVGMobject(file_name = "lock",@@ -1174,16 +1174,16 @@ class DescribeDigitalSignatures(LedgerScene):for sig in digital_signatures])- words = VGroup(*map(+ words = VGroup(*list(map(TextMobject,["Different messages", "Completely different signatures"]- ))+ )))words.arrange_submobjects(DOWN, aligned_edge = LEFT)words.scale(1.3)words.next_to(self.documents, RIGHT)self.play(FadeIn(rect))- self.play(*map(ShowCreation, arrows))+ self.play(*list(map(ShowCreation, arrows)))self.play(Transform(self.signatures, digital_signatures))self.play(*[ApplyMethod(pi.change, "pondering", digital_signatures)@@ -1450,7 +1450,7 @@ class IncludeTransactionNumber(LedgerScene):)self.play(ShowCreation(cross))self.wait()- self.play(*map(FadeOut, [payment, cross, q_marks]))+ self.play(*list(map(FadeOut, [payment, cross, q_marks])))self.ledger.content.remove(payment)def copy_payment_many_times(self):@@ -1595,11 +1595,11 @@ class ThinkAboutSettlingUp(Scene):class DontAllowOverdrawing(InitialProtocol):def construct(self):self.add_title()- lines = map(self.get_new_item, [+ lines = list(map(self.get_new_item, ["Anyone can add lines to the Ledger \\,","Only signed transactions are valid \\,","No overspending"- ])+ ]))lines[2].set_color(YELLOW)self.add(*lines[:2])@@ -1717,7 +1717,7 @@ class LedgerWithInitialBuyIn(SignedLedgerScene):])self.play(Write(invalid))self.wait(2)- self.play(*map(FadeOut, [rects, last_rect, invalid]))+ self.play(*list(map(FadeOut, [rects, last_rect, invalid])))def running_balance(self):charlie_lines = VGroup(*[@@ -1737,9 +1737,9 @@ class LedgerWithInitialBuyIn(SignedLedgerScene):title.next_to(rect.get_top(), DOWN)balance = VGroup(rect, title)- lines = VGroup(*map(TextMobject, [+ lines = VGroup(*list(map(TextMobject, ["\\$100", "\\$50", "\\$0", "Overdrawn"- ]))+ ])))lines.set_color(GREEN)lines[-1].set_color(RED)arrows = VGroup()@@ -2042,7 +2042,7 @@ class BigDifferenceBetweenLDAndCryptocurrencies(Scene):cryptos.next_to, decentralized, DOWN, LARGE_BUFF,ld.next_to, centralized, DOWN, LARGE_BUFF,)- self.play(*map(Write, words))+ self.play(*list(map(Write, words)))self.wait(2)class DistributedLedgerScene(LedgerScene):@@ -2193,7 +2193,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene):self.alice.change, "happy")self.wait()- pairs = zip(payment_copies, self.pi_creatures)+ pairs = list(zip(payment_copies, self.pi_creatures))Scene.play(self, *it.chain(*[[pi.look_at, pi.ledger[-1],@@ -2228,7 +2228,7 @@ class TransitionToDistributedLedger(DistributedLedgerScene):for ledger in ledgers])- self.play(*map(ShowCreation, arrows))+ self.play(*list(map(ShowCreation, arrows)))self.play(Write(question))self.wait()@@ -2340,11 +2340,11 @@ class YouListeningToBroadcasts(LedgerScene):class AskWhatToAddToProtocol(InitialProtocol):def construct(self):self.add_title()- items = VGroup(*map(self.get_new_item, [+ items = VGroup(*list(map(self.get_new_item, ["Broadcast transactions","Only accept signed transactions","No overspending",- ] + [""]*6))+ ] + [""]*6)))brace = Brace(VGroup(*items[3:]), LEFT)question = TextMobject("What to \\\\ add here?")question.set_color(RED)@@ -2746,10 +2746,7 @@ class IntroduceNonceOnTrasactions(LedgerScene):FadeOut(nonce_brace))ledger.content.add(nonce)- decomposed_ledger = VGroup(*filter(- lambda m : not m.is_subpath,- ledger.family_members_with_points()- ))+ decomposed_ledger = VGroup(*[m for m in ledger.family_members_with_points() if not m.is_subpath])self.play(ShowCreation(arrow),FadeIn(sha)@@ -2993,7 +2990,7 @@ class IntroduceBlockChain(Scene):rate_func = there_and_back,scale_factor = 1.1,))- self.play(*map(FadeOut, [blocks_word, arrows]))+ self.play(*list(map(FadeOut, [blocks_word, arrows])))self.blocks = blocks@@ -3095,7 +3092,7 @@ class IntroduceBlockChain(Scene):)arrow = new_arrows[0].copy().shift(-block_spacing)sha_arrows.add_to_back(arrow)- self.play(*map(FadeIn, [arrow, prev_hashes[0]]))+ self.play(*list(map(FadeIn, [arrow, prev_hashes[0]])))self.wait(2)self.prev_hashes = prev_hashes@@ -3594,11 +3591,11 @@ class IntroduceBlockCreator(DistributedBlockChainScene):big_rect.set_stroke(width = 0)big_rect.set_fill(BLACK, opacity = 1)- comments = VGroup(*map(TextMobject, [+ comments = VGroup(*list(map(TextMobject, ["- ``Block reward''","- No sender/signature","- Adds to total money supply",- ]))+ ])))comments.arrange_submobjects(DOWN, aligned_edge = LEFT)comments.move_to(big_rect, UP+LEFT)@@ -3610,7 +3607,7 @@ class IntroduceBlockCreator(DistributedBlockChainScene):for comment in comments:self.play(FadeIn(comment))self.wait(2)- self.play(*map(FadeOut, [big_rect, comments, reward_rect]))+ self.play(*list(map(FadeOut, [big_rect, comments, reward_rect])))self.pi_creatures = pi_creatures@@ -3639,10 +3636,10 @@ class IntroduceBlockCreator(DistributedBlockChainScene):arrow_creations = []for old_chain, new_chain in zip(old_chains, new_chains):for attr in "blocks", "arrows":- pairs = zip(+ pairs = list(zip(getattr(old_chain, attr),getattr(new_chain, attr),- )+ ))for m1, m2 in pairs:anims.append(Transform(m1, m2))arrow_creations.append(ShowCreation(new_chain.arrows[-1]))@@ -3763,10 +3760,7 @@ class MiningIsALottery(IntroduceBlockCreator):winner_index = 1winner = self.miners[winner_index]- losers = VGroup(*filter(- lambda m : m is not winner,- self.miners- ))+ losers = VGroup(*[m for m in self.miners if m is not winner])nonces[winner_index].set_color(GREEN)new_digest = sha256_tex_mob("Winner", 60)@@ -3909,7 +3903,7 @@ class TwoBlockChains(DistributedBlockChainScene):)self.play(Write(conflicting),- *map(ShowCreation, arrows)+ *list(map(ShowCreation, arrows)))self.wait()self.play(ShowCreation(longer_chain_rect))@@ -4387,14 +4381,14 @@ class WhenToTrustANewBlock(DistributedBlockChainScene):chain.to_edge(LEFT)self.add(chain)- words = map(TextMobject, [+ words = list(map(TextMobject, ["Don't trust yet","Still don't trust","...a little more...","Maybe trust","Probably safe","Alright, you're good."- ])+ ]))colors = [RED, RED, YELLOW, YELLOW, GREEN, GREEN]self.add_new_block()arrow = Arrow(UP, DOWN, color = RED)@@ -4937,13 +4931,13 @@ class TopicsNotCovered(TeacherStudentsScene):title.shift(DOWN)title.set_fill(opacity = 0)- topics = VGroup(*map(TextMobject, [+ topics = VGroup(*list(map(TextMobject, ["Merkle trees","Alternatives to proof of work","Scripting","$\\vdots$","(See links in description)",- ]))+ ])))topics.arrange_submobjects(DOWN, aligned_edge = LEFT)topics[-2].next_to(topics[-3], DOWN)topics.next_to(title, RIGHT)diff --git a/old_projects/dandelin.py b/old_projects/dandelin.pyindex 23242fe80..e037e1d46 100644--- a/old_projects/dandelin.py+++ b/old_projects/dandelin.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from big_ol_pile_of_manim_imports import *from old_projects.lost_lecture import Orbiting@@ -99,7 +99,7 @@ class SumOfIntegersProof(Scene):equation.to_edge(UP)one, two, three, dots, n = numbers = VGroup(*[equation.get_part_by_tex(tex, substring=False).copy()- for tex in "1", "2", "3", "\\cdots", "n",+ for tex in ("1", "2", "3", "\\cdots", "n",)])for number in numbers:number.generate_target()@@ -230,11 +230,11 @@ class MultipleDefinitionsOfAnEllipse(Scene):))self.wait()for definition in definitions:- others = filter(lambda d: d is not definition, definitions)+ others = [d for d in definitions if d is not definition]self.play(definition.set_fill, WHITE, 1,definition.scale, 1.2, {"about_edge": LEFT},- *map(Restore, others)+ *list(map(Restore, others)))self.wait(2)@@ -324,9 +324,9 @@ class StretchACircle(Scene):class ShowArrayOfEccentricities(Scene):def construct(self):eccentricities = np.linspace(0, 0.99, 6)- eccentricity_labels = VGroup(*map(+ eccentricity_labels = VGroup(*list(map(DecimalNumber, eccentricities- ))+ )))ellipses = self.get_ellipse_row(eccentricities)ellipses.set_color_by_gradient(BLUE, YELLOW)ellipses.move_to(DOWN)@@ -1473,7 +1473,7 @@ class LockhartQuote(Scene):I have no idea how it happens. I only know thatwhen it happens to me, I feel very fortunate.""" % strings- quote_parts = filter(lambda s: s, quote_text.split(" "))+ quote_parts = [s for s in quote_text.split(" ") if s]quote = TextMobject(*quote_parts,tex_to_color_map={diff --git a/old_projects/div_curl.py b/old_projects/div_curl.pyindex 0ea11cc6b..ce2543fa2 100644--- a/old_projects/div_curl.py+++ b/old_projects/div_curl.py@@ -1,4 +1,4 @@-from __future__ import print_function+from big_ol_pile_of_manim_imports import *DEFAULT_SCALAR_FIELD_COLORS = [BLUE_E, GREEN, YELLOW, RED]@@ -29,7 +29,7 @@ def get_flow_start_points(x_min=-8, x_max=8,noise_factor = delta_y / 2return np.array([x * RIGHT + y * UP + noise_factor * np.random.random(3)- for n in xrange(n_repeats)+ for n in range(n_repeats)for x in np.arange(x_min, x_max + delta_x, delta_x)for y in np.arange(y_min, y_max + delta_y, delta_y)])@@ -122,7 +122,7 @@ def get_rgb_gradient_function(min_value=0, max_value=1,colors=[BLUE, RED],flip_alphas=True, # Why?):- rgbs = np.array(map(color_to_rgb, colors))+ rgbs = np.array(list(map(color_to_rgb, colors)))def func(values):alphas = inverse_interpolate(min_value, max_value, values)@@ -494,7 +494,7 @@ class Introduction(MovingCameraScene):self.play(LaggedStart(ShowPassingFlash, stream_lines),FadeIn(div_title[0]),- *map(GrowFromCenter, div_title[1])+ *list(map(GrowFromCenter, div_title[1])))# Curl@@ -1220,14 +1220,14 @@ class ScopeMeiosis(PiCreatureScene):def construct(self):morty = self.pi_creature- section_titles = VGroup(*map(TextMobject, [+ section_titles = VGroup(*list(map(TextMobject, ["Background on div/curl","Conformal maps","Conformal map $\\Rightarrow" +"\\text{div}\\textbf{F} = " +"\\text{curl}\\textbf{F} = 0$","Complex derivatives",- ]))+ ])))sections = VGroup(*[VGroup(title, self.get_lines(title, 3))for title in section_titles@@ -1251,7 +1251,7 @@ class ScopeMeiosis(PiCreatureScene):"concerned_musician",]- for n, mode in zip(range(6), modes):+ for n, mode in zip(list(range(6)), modes):if n % 2 == 1:top_title = lineslines = self.get_lines(top_title, 4)@@ -1609,10 +1609,10 @@ class ChangingElectricField(Scene):return particlesdef get_vector_field(self):- func = get_force_field_func(*zip(- map(Mobject.get_center, self.particles),+ func = get_force_field_func(*list(zip(+ list(map(Mobject.get_center, self.particles)),[p.charge for p in self.particles]- ))+ )))self.vector_field = VectorField(func, **self.vector_field_config)return self.vector_field@@ -1925,7 +1925,7 @@ class DefineDivergenceSymbols(Scene):*fade_anims)self.wait(2)- fade_anims = map(FadeOut, [brace, label])+ fade_anims = list(map(FadeOut, [brace, label]))self.wait()@@ -3205,7 +3205,7 @@ class PhaseSpaceOfPopulationModel(ShowTwoPopulations, PiCreatureScene, MovingCam)axes.shift(self.origin)for axis in axes.x_axis, axes.y_axis:- axis.add_numbers(*range(10, 60, 10))+ axis.add_numbers(*list(range(10, 60, 10)))axes_labels = self.axes_labels = VGroup(*[VGroup(@@ -3734,10 +3734,10 @@ class DivCurlDotCross(Scene):])rects.arrange_submobjects_in_grid(n_rows=2, buff=LARGE_BUFF)rects[2:].shift(MED_LARGE_BUFF * DOWN)- titles = VGroup(*map(TextMobject, [+ titles = VGroup(*list(map(TextMobject, ["Divergence", "Curl","Dot product", "Cross product"- ]))+ ])))for title, rect in zip(titles, rects):title.next_to(rect, UP)@@ -4290,10 +4290,7 @@ class ZToHalfFlowNearWall(ComplexTransformationScene, MovingCameraScene):secondary_line_ratio=0,)plane.next_to(ORIGIN, UP, buff=0.001)- horizontal_lines = VGroup(*filter(- lambda l: np.abs(l.get_center()[0]) < 0.1,- list(plane.main_lines) + [plane.axes[0]]- ))+ horizontal_lines = VGroup(*[l for l in list(plane.main_lines) + [plane.axes[0]] if np.abs(l.get_center()[0]) < 0.1])plane.set_stroke(MAROON_B, width=2)horizontal_lines.set_stroke(BLUE, width=2)@@ -4567,7 +4564,7 @@ class ThoughtsOnAds(Scene):left_text.to_edge(LEFT)viewer, brand, creator = vcb = VGroup(- *map(TextMobject, ["viewer", "brand", "creator"])+ *list(map(TextMobject, ["viewer", "brand", "creator"])))brand.next_to(creator, LEFT, LARGE_BUFF)viewer.next_to(vcb[1:], UP, LARGE_BUFF)@@ -4626,7 +4623,7 @@ class ThoughtsOnAds(Scene):self.play(Write(misaligned),Write(aligned),- *map(GrowArrow, arrows),+ *list(map(GrowArrow, arrows)),run_time=1)diff --git a/old_projects/domino_play.py b/old_projects/domino_play.pyindex 26f8e6a0d..e9f85ec6b 100644--- a/old_projects/domino_play.py+++ b/old_projects/domino_play.py@@ -1,7 +1,7 @@#!/usr/bin/env python# -*- coding: utf-8 -*--from __future__ import print_function+from big_ol_pile_of_manim_imports import *@@ -25,7 +25,7 @@ class SimpleVelocityGraph(GraphScene):"y_tick_frequency" : 100,"y_min" : 0,"y_max" : 1000,- "y_labeled_nums" : range(0, 1000, 200),+ "y_labeled_nums" : list(range(0, 1000, 200)),"x_axis_width" : 12,"graph_origin" : 2.5*DOWN + 5*LEFT,"trailing_average_length" : 20,@@ -48,7 +48,7 @@ class SimpleVelocityGraph(GraphScene):self.draw_lines(color)def save_all_images(self):- indices = range(1, 20)+ indices = list(range(1, 20))for i1, i2 in it.combinations(indices, 2):to_remove = VGroup()for index in i1, i2:@@ -82,10 +82,7 @@ class SimpleVelocityGraph(GraphScene):for line in file:line = line.replace(" ", ",")line = line.replace("\n", "")- entries = filter(- lambda s : s is not "",- line.split(",")- )+ entries = [s for s in line.split(",") if s is not ""]if len(entries) == 0:continue@@ -597,8 +594,8 @@ class ContrastTwoGraphs(SimpleVelocityGraph):sg_copy = sg.deepcopy()sg_copy.scale(0.5)sg_copy.shift(g.get_center())- mover = VGroup(*it.chain(*zip(g.dots, g.lines)))- target = VGroup(*it.chain(*zip(sg_copy.dots, sg_copy.lines)))+ mover = VGroup(*it.chain(*list(zip(g.dots, g.lines))))+ target = VGroup(*it.chain(*list(zip(sg_copy.dots, sg_copy.lines))))for m, t in zip(mover, target):m.target = tself.play(LaggedStart(@@ -773,7 +770,7 @@ class ShowAllSteadyStateVelocities(SimpleVelocityGraph):"x_max" : 40,"x_axis_width" : 9,"x_tick_frequency" : 5,- "x_labeled_nums" : range(0, 50, 10),+ "x_labeled_nums" : list(range(0, 50, 10)),"y_min" : 0,"y_max" : 400,"y_labeled_nums" : [],diff --git a/old_projects/efvgt.py b/old_projects/efvgt.pyindex aa28f10a2..c73929c8c 100644--- a/old_projects/efvgt.py+++ b/old_projects/efvgt.py@@ -374,12 +374,12 @@ class SymmetriesOfSquare(ThreeDScene):self.wait()self.rotate_square(-np.pi)self.wait()- self.play(*map(FadeOut, [brace, q_marks]))+ self.play(*list(map(FadeOut, [brace, q_marks])))def talk_through_90_degree_rotation(self):arcs = self.get_rotation_arcs(self.square, np.pi/2)- self.play(*map(ShowCreation, arcs))+ self.play(*list(map(ShowCreation, arcs)))self.wait()self.rotate_square(np.pi/2, run_time = 2)self.wait()@@ -446,7 +446,7 @@ class SymmetriesOfSquare(ThreeDScene):for square, angle in zip(all_squares[1:4], [np.pi/2, np.pi, -np.pi/2]):arcs = self.get_rotation_arcs(square, angle, MED_SMALL_BUFF)- self.play(*map(FadeIn, [square, arcs]))+ self.play(*list(map(FadeIn, [square, arcs])))square.rotation_kwargs = {"angle" : angle}self.rotate_square(square = square, **square.rotation_kwargs)square.add(arcs)@@ -559,7 +559,7 @@ class SymmetriesOfSquare(ThreeDScene):)arc.add_tip()if abs(angle) < 3*np.pi/4:- angle_multiple_range = range(1, 4)+ angle_multiple_range = list(range(1, 4))else:angle_multiple_range = [2]arcs = VGroup(arc, *[@@ -747,7 +747,7 @@ class GroupOfCubeSymmetries(ThreeDScene):cube = self.get_cube()face_centers = [face.get_center() for face in cube[0:7:2]]- angle_axis_pairs = zip(3*[np.pi/2], face_centers)+ angle_axis_pairs = list(zip(3*[np.pi/2], face_centers))for i in range(3):ones = np.ones(3)ones[i] = -1@@ -828,13 +828,13 @@ class AddSquareSymmetries(SymmetriesOfSquare):self.play(FadeIn(arcs))self.rotate_square(square = square, angle = np.pi/2,- added_anims = map(FadeIn, equation[:2])+ added_anims = list(map(FadeIn, equation[:2])))self.wait()self.play(FadeOut(arcs))self.flip_square(square = square, axis = UP,- added_anims = map(FadeIn, equation[2:4])+ added_anims = list(map(FadeIn, equation[2:4])))self.wait()alt_square.next_to(equals, RIGHT, buff = LARGE_BUFF)@@ -848,7 +848,7 @@ class AddSquareSymmetries(SymmetriesOfSquare):)self.flip_square(square = alt_square, axis = UP+RIGHT,- added_anims = map(FadeIn, equation[4:]),+ added_anims = list(map(FadeIn, equation[4:])),)self.wait(2)@@ -1011,7 +1011,7 @@ class AddCubeSymmetries(GroupOfCubeSymmetries):)arrows.move_to(cube)arrows.shift(-axis*cube.get_height()/2/np.linalg.norm(axis))- anims += map(ShowCreation, arrows)+ anims += list(map(ShowCreation, arrows))anims.append(Rotate(cube, axis = axis, angle = angle, in_place = True,@@ -1022,7 +1022,7 @@ class AddCubeSymmetries(GroupOfCubeSymmetries):def get_composition_angle_and_axis(self):return get_composite_rotation_angle_and_axis(- *zip(*self.angle_axis_pairs)+ *list(zip(*self.angle_axis_pairs)))class DihedralGroupStructure(SymmetriesOfSquare):@@ -1061,7 +1061,7 @@ class DihedralGroupStructure(SymmetriesOfSquare):def demonstrate_sum(self, angle_axis_pairs):angle_axis_pairs = list(angle_axis_pairs) + [get_composite_rotation_angle_and_axis(- *zip(*angle_axis_pairs)+ *list(zip(*angle_axis_pairs)))]@@ -1103,7 +1103,7 @@ class DihedralGroupStructure(SymmetriesOfSquare):square.remove(square.action_illustration)self.play(FadeIn(s1))- self.play(*map(ShowCreation, s1.action_illustration))+ self.play(*list(map(ShowCreation, s1.action_illustration)))self.rotate_square(**s1.rotation_kwargs)s1_copy = s1.copy()@@ -1115,14 +1115,14 @@ class DihedralGroupStructure(SymmetriesOfSquare):Transform(s2, s1_copy).update(1)self.remove(s1_copy)self.add(s2)- self.play(*map(ShowCreation, s2.action_illustration))+ self.play(*list(map(ShowCreation, s2.action_illustration)))self.rotate_square(**s2.rotation_kwargs)self.play(Write(equals),FadeIn(s3))- self.play(*map(ShowCreation, s3.action_illustration))+ self.play(*list(map(ShowCreation, s3.action_illustration)))self.rotate_square(**s3.rotation_kwargs)self.wait()final_expression.add(*expression)@@ -1155,12 +1155,12 @@ class ThisIsAVeryGeneralIdea(Scene):groups.to_edge(UP)groups.set_color(BLUE)- examples = VGroup(*map(TextMobject, [+ examples = VGroup(*list(map(TextMobject, ["Square matrices \\\\ \\small (Where $\\det(M) \\ne 0$)","Molecular \\\\ symmetry","Cryptography","Numbers",- ]))+ ])))numbers = examples[-1]examples.arrange_submobjects(buff = LARGE_BUFF)examples.set_width(FRAME_WIDTH-1)@@ -1190,10 +1190,10 @@ class ThisIsAVeryGeneralIdea(Scene):)self.wait(2)- sub_categories = VGroup(*map(TextMobject, [+ sub_categories = VGroup(*list(map(TextMobject, ["Numbers \\\\ (Additive)","Numbers \\\\ (Multiplicative)",- ]))+ ])))sub_categories.arrange_submobjects(RIGHT, buff = MED_LARGE_BUFF)sub_categories.next_to(numbers, DOWN, 1.5*LARGE_BUFF)sub_categories.to_edge(RIGHT)@@ -1207,8 +1207,8 @@ class ThisIsAVeryGeneralIdea(Scene):sub_lines.set_color(numbers.get_color())self.play(*it.chain(- map(ShowCreation, sub_lines),- map(Write, sub_categories)+ list(map(ShowCreation, sub_lines)),+ list(map(Write, sub_categories))))self.wait()@@ -1260,7 +1260,7 @@ class AdditiveGroupOfReals(Scene):shadow_line.move_to(number_line)- self.play(*map(Write, number_line), run_time = 1)+ self.play(*list(map(Write, number_line)), run_time = 1)self.play(shadow_line.restore, Animation(number_line))self.wait()@@ -1305,7 +1305,7 @@ class AdditiveGroupOfReals(Scene):Write(words),)self.wait()- self.play(*map(FadeOut, [arrow, words]))+ self.play(*list(map(FadeOut, [arrow, words])))self.number_line.add(dot)@@ -1342,7 +1342,7 @@ class AdditiveGroupOfReals(Scene):Write(words))self.wait(2)- self.play(*map(FadeOut, [line, words]))+ self.play(*list(map(FadeOut, [line, words])))def get_write_name_of_group_anim(self):new_title = TextMobject("Additive group of real numbers")@@ -1403,7 +1403,7 @@ class AdditiveGroupOfReals(Scene):self.wait()self.play(self.number_line.restore,- *map(FadeOut, [arrows, sum_mob])+ *list(map(FadeOut, [arrows, sum_mob])))def get_adder_mobs(self, num):@@ -1540,7 +1540,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene):self.foreground_mobjects.remove(real_arrow)self.foreground_mobjects.remove(imag_arrow)- self.play(*map(FadeOut, [real_arrow, imag_arrow, self.plane]))+ self.play(*list(map(FadeOut, [real_arrow, imag_arrow, self.plane])))self.plane.restore()self.plane.set_stroke(width = 0)self.play(self.plane.restore)@@ -1634,7 +1634,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene):rate_func = squish_rate_func(smooth, 0.75, 1),),Write(plus),- *map(MoveToTarget, [rp1, rp2])+ *list(map(MoveToTarget, [rp1, rp2])))self.wait()self.play(@@ -1643,7 +1643,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene):imag_background_rect,rate_func = squish_rate_func(smooth, 0.75, 1),),- *map(MoveToTarget, [ip1, ip2])+ *list(map(MoveToTarget, [ip1, ip2])))self.wait(2)to_remove = [@@ -1656,7 +1656,7 @@ class AdditiveGroupOfComplexNumbers(ComplexTransformationScene):for mob in to_remove:if mob in self.foreground_mobjects:self.foreground_mobjects.remove(mob)- self.play(*map(FadeOut, to_remove))+ self.play(*list(map(FadeOut, to_remove)))self.play(self.plane.restore, run_time = 2)self.wait()@@ -1794,10 +1794,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals):def add_number_line(self):AdditiveGroupOfReals.add_number_line(self)self.zero_point = self.number_line.number_to_point(0)- self.one = filter(- lambda m : m.get_tex_string() is "1",- self.number_line.numbers- )[0]+ self.one = [m for m in self.number_line.numbers if m.get_tex_string() is "1"][0]self.one.add_background_rectangle()self.one.background_rectangle.scale_in_place(1.3)self.number_line.save_state()@@ -1845,10 +1842,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals):)for num in (3, 0.5)]- three_mob = filter(- lambda m : m.get_tex_string() == "3",- self.shadow_line.numbers- )[0]+ three_mob = [m for m in self.shadow_line.numbers if m.get_tex_string() == "3"][0]half_point = self.shadow_line.number_to_point(0.5)half_arrow = Arrow(half_point+UP+LEFT, half_point, buff = SMALL_BUFF,@@ -1868,7 +1862,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals):self.number_line.numbers.add(dot)self.number_line.save_state()self.wait()- self.play(*map(FadeOut, [arrow, words]))+ self.play(*list(map(FadeOut, [arrow, words])))self.stretch(3)self.play(@@ -1883,7 +1877,7 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals):self.wait()self.play(self.number_line.restore,- *map(FadeOut, [three_line, dot_copy])+ *list(map(FadeOut, [three_line, dot_copy])))self.wait()self.stretch(0.5)@@ -1902,10 +1896,10 @@ class MultiplicativeGroupOfReals(AdditiveGroupOfReals):self.wait()self.play(self.number_line.restore,- *map(FadeOut, [+ *list(map(FadeOut, [half_label, half_arrow,half_line, dot_copy- ])+ ])))self.wait()@@ -2105,10 +2099,10 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers):Indicate(self.plane.one_dot, color = RED),)self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [zero_words, zero_arrow,one_words, one_arrow,- ]))+ ])))def show_example_actions(self):z_list = [@@ -2157,10 +2151,7 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers):self.turn_arrow = arcdef show_action_at_i_again(self):- neg_one_label = filter(- lambda m : m.get_tex_string() == "-1",- self.real_labels- )[0]+ neg_one_label = [m for m in self.real_labels if m.get_tex_string() == "-1"][0]half_turn_arc = Arc(start_angle = np.pi/12,angle = 10*np.pi/12,@@ -2263,7 +2254,7 @@ class MultiplicativeGroupOfComplexNumbers(AdditiveGroupOfComplexNumbers):]for mob in to_remove:self.foreground_mobjects.remove(mob)- self.reset_plane(*map(FadeOut, to_remove))+ self.reset_plane(*list(map(FadeOut, to_remove)))self.wait()def show_break_down(self):@@ -2657,7 +2648,7 @@ class ExponentsAsHomomorphism(Scene):randy = self.randyterms = list(self.adders) + list(self.multipliers)inputs = [-1, 2]- target_texs = map(str, inputs)+ target_texs = list(map(str, inputs))target_texs += ["2^{%d}"%x for x in inputs]for mob, target_tex in zip(terms, target_texs):target = TexMobject(target_tex)@@ -2676,7 +2667,7 @@ class ExponentsAsHomomorphism(Scene):self.play(randy.look_at, self.top_line)self.show_composition(*inputs,- parallel_anims = map(MoveToTarget, self.adders)+ parallel_anims = list(map(MoveToTarget, self.adders)))self.play(FocusOn(self.bottom_line_center),@@ -2684,7 +2675,7 @@ class ExponentsAsHomomorphism(Scene):)self.show_composition(*inputs,- parallel_anims = map(MoveToTarget, self.multipliers)+ parallel_anims = list(map(MoveToTarget, self.multipliers)))self.wait()@@ -2884,7 +2875,7 @@ class ComplexExponentiationAbstract():line.add(Line(ORIGIN, FRAME_X_RADIUS*LEFT))line.set_color(RED)- self.play(*map(ShowCreation, line), run_time = 3)+ self.play(*list(map(ShowCreation, line)), run_time = 3)self.add_foreground_mobjects(line)self.real_line = line@@ -2954,7 +2945,7 @@ class ComplexExponentiationAdderHalf(self.play(FadeOut(self.real_line),- *map(ShowCreation, line)+ *list(map(ShowCreation, line)))self.foreground_mobjects.remove(self.real_line)self.play(@@ -3009,7 +3000,7 @@ class ComplexExponentiationAdderHalf(to_remove = arrow, brace, brace_textfor mob in to_remove:self.foreground_mobjects.remove(mob)- self.play(*map(FadeOut, to_remove))+ self.play(*list(map(FadeOut, to_remove)))self.apply_action(complex(0, -1))def take_steps_for_e(self):@@ -3018,12 +3009,12 @@ class ComplexExponentiationAdderHalf(Brace(Line(ORIGIN, x*UP), RIGHT, buff = SMALL_BUFF)for x in np.cumsum(slide_values)]- labels = map(TextMobject, [+ labels = list(map(TextMobject, ["1 unit","2 units","3 units","$\\pi$ units",- ])+ ]))for label, brace in zip(labels, braces):label.add_background_rectangle()label.next_to(brace, RIGHT, buff = SMALL_BUFF)@@ -3110,7 +3101,7 @@ class ComplexExponentiationMultiplierHalf(self.wait(2)self.foreground_mobjects.remove(arc)- self.play(*map(FadeOut, [arc, brace, radians_label]))+ self.play(*list(map(FadeOut, [arc, brace, radians_label])))self.apply_action(complex(0, -1))def get_arc_braces_and_label(self, angle):diff --git a/old_projects/eoc/chapter1.py b/old_projects/eoc/chapter1.pyindex 4dbf62e94..ac1a60b67 100644--- a/old_projects/eoc/chapter1.py+++ b/old_projects/eoc/chapter1.py@@ -810,7 +810,7 @@ class ApproximateOneRing(CircleScene, ReconfigurableScene):self.pi_creature.change_mode, "happy")self.wait()- self.play(*map(FadeOut, [trapezoid, strike]))+ self.play(*list(map(FadeOut, [trapezoid, strike])))self.unwrapped_ring = ring@@ -943,12 +943,12 @@ class GraphRectangles(CircleScene, GraphScene):"x_min" : 0,"x_max" : 4,"x_axis_width" : 7,- "x_labeled_nums" : range(5),+ "x_labeled_nums" : list(range(5)),"x_axis_label" : "$r$","y_min" : 0,"y_max" : 20,"y_tick_frequency" : 2.5,- "y_labeled_nums" : range(5, 25, 5),+ "y_labeled_nums" : list(range(5, 25, 5)),"y_axis_label" : "","exclude_zero_label" : False,"num_rings_in_ring_sum_start" : 3,@@ -1078,7 +1078,7 @@ class GraphRectangles(CircleScene, GraphScene):self.wait()self.play(FadeIn(dr_group))self.wait()- self.play(*map(FadeOut, [moving_arrow, values_of_r]))+ self.play(*list(map(FadeOut, [moving_arrow, values_of_r])))self.x_axis.add(r_ticks)self.r_ticks = r_ticks@@ -1132,7 +1132,7 @@ class GraphRectangles(CircleScene, GraphScene):ring.target = targetring.original_ring = ring.copy()- foreground_animations = map(Animation, [self.x_axis, self.area_label])+ foreground_animations = list(map(Animation, [self.x_axis, self.area_label]))example_ring = transformed_rings[2]self.play(@@ -1240,7 +1240,7 @@ class GraphRectangles(CircleScene, GraphScene):self.rects, self.flat_rects,np.linspace(0, 0.5, len(self.rects)))- ] + map(Animation, [self.x_axis, self.graph])+ ] + list(map(Animation, [self.x_axis, self.graph])))self.wait(2)@@ -1279,7 +1279,7 @@ class GraphRectangles(CircleScene, GraphScene):for n in range(1, 5)]- self.play(*map(FadeOut, [self.r_ticks, self.dr_group]))+ self.play(*list(map(FadeOut, [self.r_ticks, self.dr_group])))self.x_axis.remove(self.r_ticks, *self.r_ticks)for new_rects in thinner_rects_list:self.play(@@ -1339,11 +1339,11 @@ class GraphRectangles(CircleScene, GraphScene):self.play(Write(formula.bottom_line))self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.ghost_rings,self.ring_sum.tex_mobs- ]))- self.play(*map(FadeIn, [fresh_rings, self.radius_group]))+ ])))+ self.play(*list(map(FadeIn, [fresh_rings, self.radius_group])))self.wait()self.play(Transform(formula, formula_with_R),@@ -1534,10 +1534,7 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene):self.integral_condition = integral_conditiondef show_sum(self):- visible_rings = filter(- lambda ring : ring.get_fill_opacity() > 0,- self.rings- )+ visible_rings = [ring for ring in self.rings if ring.get_fill_opacity() > 0]radii = self.dR*np.arange(len(visible_rings))radii[-1] = 3-self.dR@@ -1656,13 +1653,13 @@ class RecapCircleSolution(GraphRectangles, ReconfigurableScene):self.play(Write(self.y_axis, run_time = 2),- *map(FadeOut, [+ *list(map(FadeOut, [self.approximations,self.area_label,self.area_arrows,self.dr_brace_group,self.r_ticks,- ])+ ])))self.play(ReplacementTransform(@@ -1952,11 +1949,11 @@ class MathematicianPonderingAreaUnderDifferentCurves(PiCreatureScene):class AreaUnderParabola(GraphScene):CONFIG = {"x_max" : 4,- "x_labeled_nums" : range(-1, 5),+ "x_labeled_nums" : list(range(-1, 5)),"y_min" : 0,"y_max" : 15,"y_tick_frequency" : 2.5,- "y_labeled_nums" : range(5, 20, 5),+ "y_labeled_nums" : list(range(5, 20, 5)),"n_rect_iterations" : 6,"default_right_x" : 3,"func" : lambda x : x**2,@@ -2009,7 +2006,7 @@ class AreaUnderParabola(GraphScene):rate_func = smooth,submobject_mode = "lagged_start",),- *map(Animation, foreground_mobjects)+ *list(map(Animation, foreground_mobjects)))self.wait()for new_rects in rect_lists[1:]:@@ -2018,7 +2015,7 @@ class AreaUnderParabola(GraphScene):rects, new_rects,submobject_mode = "lagged_start",),- *map(Animation, foreground_mobjects)+ *list(map(Animation, foreground_mobjects)))self.wait()@@ -2147,7 +2144,7 @@ class AreaUnderParabola(GraphScene):group, update_group,**kwargs),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))class WhoCaresAboutArea(TeacherStudentsScene):@@ -2226,7 +2223,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):self.move_right_point_to(curr_x + self.deriv_dx)self.play(FadeIn(shadow_rects),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))self.shadow_rects = shadow_rects@@ -2279,7 +2276,7 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):self.play(ReplacementTransform(dA_label[0].copy(), difference_in_area[0]),ReplacementTransform(dA_label[1].copy(), difference_in_area[2]),- *map(FadeIn, [difference_in_area[1], difference_in_area[3]])+ *list(map(FadeIn, [difference_in_area[1], difference_in_area[3]])))self.wait(2)self.play(FadeIn(dA_rect), Animation(dA_arrow))@@ -2334,10 +2331,10 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):self.play(Write(equation.get_part_by_tex("approx")))self.wait()for tex, mob in (f_tex, x_squared), ("dx", dx):- self.play(*map(Indicate, [+ self.play(*list(map(Indicate, [equation.get_part_by_tex(tex),mob- ]))+ ])))self.wait(2)self.play(*[ReplacementTransform(@@ -2387,17 +2384,17 @@ class PlayingTowardsDADX(AreaUnderParabola, ReconfigurableScene):)self.play(Blink(randy))self.wait()- self.play(*map(FadeOut, [randy, q_marks, dA_circle]))+ self.play(*list(map(FadeOut, [randy, q_marks, dA_circle])))def write_example_inputs(self):d = self.default_right_xthree = TexMobject("x =", "%d"%d)three_plus_dx = TexMobject("x = ", "%d.001"%d)- labels_lines_vects = zip(+ labels_lines_vects = list(zip([three, three_plus_dx],self.right_v_lines,[LEFT, RIGHT]- )+ ))for label, line, vect in labels_lines_vects:point = line.get_bottom()@@ -2568,7 +2565,7 @@ class AlternateAreaUnderCurve(PlayingTowardsDADX):)dx_to_zero = self.dx_to_zero_words[1]- self.play(*map(FadeIn, [box, brace]))+ self.play(*list(map(FadeIn, [box, brace])))self.wait()self.play(FadeOut(faders),diff --git a/old_projects/eoc/chapter10.py b/old_projects/eoc/chapter10.pyindex e4610e6ad..683947217 100644--- a/old_projects/eoc/chapter10.py+++ b/old_projects/eoc/chapter10.py@@ -505,7 +505,7 @@ class ExampleApproximationWithCos(ExampleApproximationWithSine):for dx in (0.01, 0.7)]- self.play(*map(ShowCreation, v_lines), run_time = 2)+ self.play(*list(map(ShowCreation, v_lines)), run_time = 2)self.play(Transform(v_lines, alt_v_lines,run_time = 2,@@ -623,7 +623,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos):))self.play(FadeIn(free_to_change),- *map(ShowCreation, arrows)+ *list(map(ShowCreation, arrows)))self.play(*[ApplyMethod(@@ -711,7 +711,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos):submobject_mode = "lagged_start"))self.wait(2)- self.play(*map(FadeOut, [poly_at_zero, equals_c0]))+ self.play(*list(map(FadeOut, [poly_at_zero, equals_c0])))self.free_to_change_group.remove(self.free_to_change_group.arrows[0]@@ -824,7 +824,7 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos):))self.wait(2)- self.play(*map(FadeOut, poly_group[:-1]))+ self.play(*list(map(FadeOut, poly_group[:-1])))self.free_to_change_group.remove(self.free_to_change_group.arrows[1])@@ -855,9 +855,9 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos):run_time = run_time))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [partial_cosine_graph, self.tangent_line- ]))+ ])))def compute_cosine_second_derivative(self):second_deriv, rhs = self.get_cosine_second_derivative()@@ -899,9 +899,9 @@ class ConstructQuadraticApproximation(ExampleApproximationWithCos):for line, graph in zip(tangent_lines, graphs)]- self.play(*map(ShowCreation, tangent_lines))+ self.play(*list(map(ShowCreation, tangent_lines)))self.play(*tangent_change_anims)- self.play(*map(FadeOut, tangent_lines))+ self.play(*list(map(FadeOut, tangent_lines)))def compute_polynomial_second_derivative(self):c2s = ["c_2", "\\text{\\tiny $\\left(-\\frac{1}{2}\\right)$}"]@@ -1136,9 +1136,9 @@ class ReflectOnQuadraticApproximation(TeacherStudentsScene):self.wait(2)self.change_student_modes(*["plain"]*3,- added_anims = map(FadeOut, [+ added_anims = list(map(FadeOut, [approx_at_point, approx_rhs, real_result- ]),+ ])),look_at_arg = approx_at_x)@@ -1297,7 +1297,7 @@ class SimilarityOfChangeBehavior(ConstructQuadraticApproximation):FadeOut(dots))self.play(*tangent_line_movements + dot_anims, run_time = 6)- self.play(*map(FadeOut, [tangent_lines, dots]))+ self.play(*list(map(FadeOut, [tangent_lines, dots])))self.wait()class MoreTerms(TeacherStudentsScene):@@ -1476,11 +1476,11 @@ class CubicAndQuarticApproximations(ConstructQuadraticApproximation):plus_quartic_term.next_to(polynomial, RIGHT)plus_quartic_term.set_color_by_tex("c_4", self.colors[4])- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.plus_cubic_term,self.polynomial_third_derivative,self.polynomial_third_derivative_brace,- ]))+ ])))self.play(Write(plus_quartic_term))self.wait()@@ -2084,9 +2084,9 @@ class TranslationOfInformation(CubicAndQuarticApproximations):run_time = 2))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [deriv_info, arrow, output_info, outer_v_lines- ]))+ ])))self.quadratic_graph = quadratic_graphself.v_line = center_v_line@@ -2112,10 +2112,10 @@ class TranslationOfInformation(CubicAndQuarticApproximations):)for d in derivs_at_x])- group = VGroup(*it.chain(*zip(+ group = VGroup(*it.chain(*list(zip(derivs_at_x,arrows- )))+ ))))group.add(TexMobject("\\vdots"))group.arrange_submobjects(DOWN, buff = SMALL_BUFF)group.set_height(FRAME_HEIGHT - MED_LARGE_BUFF)@@ -2153,7 +2153,7 @@ class TranslationOfInformation(CubicAndQuarticApproximations):derivs_at_x, derivs_at_zero))self.wait()- self.play(*map(Write, rhs_group))+ self.play(*list(map(Write, rhs_group)))self.wait()for rhs in rhs_group:self.play(Indicate(rhs[1]), color = WHITE)@@ -2245,13 +2245,13 @@ class TranslationOfInformation(CubicAndQuarticApproximations):func, color = self.colors[0])- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.cosine_derivative_group,self.cosine_graph,self.quadratic_graph,self.v_line,self.dot- ]))+ ])))self.play(ShowCreation(graph))self.graph = graph@@ -2525,10 +2525,10 @@ class ExpPolynomial(TranslationOfInformation, ExampleApproximationWithExp):)for d in derivs_at_x])- group = VGroup(*it.chain(*zip(+ group = VGroup(*it.chain(*list(zip(derivs_at_x,arrows- )))+ ))))group.add(TexMobject("\\vdots"))group.arrange_submobjects(DOWN, buff = 2*SMALL_BUFF)group.set_height(FRAME_HEIGHT - MED_LARGE_BUFF)@@ -2569,7 +2569,7 @@ class ExpPolynomial(TranslationOfInformation, ExampleApproximationWithExp):derivs_at_x, derivs_at_zero))self.wait()- self.play(*map(Write, rhs_group))+ self.play(*list(map(Write, rhs_group)))self.derivative_values = derivative_values@@ -2742,7 +2742,7 @@ class SecondTermIntuition(AreaIsDerivative):self.change_area_bounds(new_t_max = new_x)self.play(FadeIn(dark_area),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))self.play(FadeOut(self.T_label_group),@@ -3453,8 +3453,8 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence):brace = self.braces[0].copy()self.play(*it.chain(- map(FadeIn, [approx_graph, brace]),- map(Animation, self.foreground_mobjects)+ list(map(FadeIn, [approx_graph, brace])),+ list(map(Animation, self.foreground_mobjects))))self.wait()new_graphs = approx_graphs[1:self.initial_n_iterations]@@ -3462,15 +3462,15 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence):self.play(Transform(approx_graph, new_graph),Transform(brace, new_brace),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))self.wait()approx_graph.remove(approx_dot)self.play(approx_dot.move_to, self.coords_to_point(self.divergent_example, 0),*it.chain(- map(FadeOut, [approx_graph, brace]),- map(Animation, self.foreground_mobjects)+ list(map(FadeOut, [approx_graph, brace])),+ list(map(Animation, self.foreground_mobjects))))self.wait()@@ -3493,7 +3493,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence):),FadeIn(approx_graph[0]),FadeIn(brace),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))new_graphs = self.approx_graphs[1:self.initial_n_iterations]@@ -3501,7 +3501,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence):self.play(Transform(approx_graph, new_graph),Transform(brace, new_brace),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))self.wait()@@ -3528,7 +3528,7 @@ class RadiusOfConvergenceForLnX(ExpGraphConvergence):for new_graph in new_graphs:self.play(Transform(self.approx_graph, new_graph),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))self.wait()diff --git a/old_projects/eoc/chapter2.py b/old_projects/eoc/chapter2.pyindex 3e6f69b12..49cfe575f 100644--- a/old_projects/eoc/chapter2.py+++ b/old_projects/eoc/chapter2.py@@ -297,12 +297,12 @@ class GraphCarTrajectory(GraphScene):CONFIG = {"x_min" : 0,"x_max" : 10,- "x_labeled_nums" : range(1, 11),+ "x_labeled_nums" : list(range(1, 11)),"x_axis_label" : "Time (seconds)","y_min" : 0,"y_max" : 110,"y_tick_frequency" : 10,- "y_labeled_nums" : range(10, 110, 10),+ "y_labeled_nums" : list(range(10, 110, 10)),"y_axis_label" : "Distance traveled \\\\ (meters)","graph_origin" : 2.5*DOWN + 5*LEFT,"default_graph_colors" : [DISTANCE_COLOR, VELOCITY_COLOR],@@ -363,7 +363,7 @@ class GraphCarTrajectory(GraphScene):run_time = self.time_of_journey,)self.wait()- self.play(*map(FadeOut, [h_line, v_line, car]))+ self.play(*list(map(FadeOut, [h_line, v_line, car])))#Show example vertical distanceh_update(h_line, 0.6)@@ -383,7 +383,7 @@ class GraphCarTrajectory(GraphScene):Write(brace_text))self.wait(2)- self.play(*map(FadeOut, [t_dot, dashed_h, brace, brace_text]))+ self.play(*list(map(FadeOut, [t_dot, dashed_h, brace, brace_text])))#Name graphs_of_t = TexMobject("s(t)")@@ -436,7 +436,7 @@ class GraphCarTrajectory(GraphScene):self.play(FadeOut(text))else:self.wait()- self.play(*map(FadeOut, [rect, change_lines]))+ self.play(*list(map(FadeOut, [rect, change_lines])))self.rect = rectdef get_change_lines(self, curr_time, delta_t = 1):@@ -761,7 +761,7 @@ class CompareTwoTimes(Scene):def get_car_state(self, distance, time):line = Line(3*LEFT, 3*RIGHT)- dots = map(Dot, line.get_start_and_end())+ dots = list(map(Dot, line.get_start_and_end()))line.add(*dots)car = Car()car.move_to(line.get_start())@@ -1012,7 +1012,7 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene):#Initially zoom inself.play(ShowCreation(input_point_line))self.activate_zooming()- self.play(*map(FadeIn, [self.big_rectangle, self.little_rectangle]))+ self.play(*list(map(FadeIn, [self.big_rectangle, self.little_rectangle])))self.play(ApplyFunction(align_little_rectangle_on_ds_dt_group,@@ -1140,7 +1140,7 @@ class DsOverDtGraphically(GraphCarTrajectory, ZoomedScene):self.wait()self.play(ShowCreation(v_line_at_t_plus_dt))self.wait()- self.play(*map(FadeOut, [v_line_at_t, v_line_at_t_plus_dt]))+ self.play(*list(map(FadeOut, [v_line_at_t, v_line_at_t_plus_dt])))self.play(Write(frac_line),Write(lower_dt)@@ -1287,7 +1287,7 @@ class SecantLineToTangentLine(GraphCarTrajectory, DefineTrueDerivative):self.input_to_graph_point(time, self.graph)for time in (self.curr_time, self.curr_time+dt)]- dots = map(Dot, points)+ dots = list(map(Dot, points))for dot in dots:dot.scale_in_place(0.5)secant_line = Line(*points)@@ -1531,10 +1531,10 @@ class TCubedExample(SecantLineToTangentLine):"y_min" : 0,"y_max" : 16,"y_tick_frequency" : 1,- "y_labeled_nums" : range(0, 17, 2),+ "y_labeled_nums" : list(range(0, 17, 2)),"x_min" : 0,"x_max" : 4,- "x_labeled_nums" : range(1, 5),+ "x_labeled_nums" : list(range(1, 5)),"graph_origin" : 2.5*DOWN + 6*LEFT,"start_time" : 2,"end_time" : 0.5,@@ -1598,10 +1598,10 @@ class TCubedExample(SecantLineToTangentLine):))self.play(Blink(morty))self.wait()- self.play(*map(+ self.play(*list(map(FadeOut,[morty, morty.bubble, morty.bubble.content]- ))+ )))def add_ds_dt_group(self):self.curr_time = self.start_time@@ -1655,7 +1655,7 @@ class TCubedExample(SecantLineToTangentLine):Write(nonzero_size),)self.wait(2)- self.play(*map(FadeOut, [arrow, nonzero_size]))+ self.play(*list(map(FadeOut, [arrow, nonzero_size])))self.play(Write(numerator))self.play(ShowCreation(v_lines[1]))self.wait()@@ -1667,7 +1667,7 @@ class TCubedExample(SecantLineToTangentLine):self.play(Write(non_numerator))self.wait(2)self.play(- *map(MoveToTarget, s_pair),+ *list(map(MoveToTarget, s_pair)),**{"path_arc" : -np.pi/2}@@ -1773,7 +1773,7 @@ class TCubedExample(SecantLineToTangentLine):[DOWN+RIGHT, DOWN+LEFT])]))- self.play(*map(FadeOut, two_cubed_terms))+ self.play(*list(map(FadeOut, two_cubed_terms)))numerator = VGroup(*terms[1:4])self.play(numerator.scale, 1.4, numerator.get_bottom(),@@ -1900,7 +1900,7 @@ class TCubedExample(SecantLineToTangentLine):for two in twos:two.target = TexMobject("t")two.target.replace(two, dim_to_match = 1)- self.play(*map(MoveToTarget, twos))+ self.play(*list(map(MoveToTarget, twos)))def update_as_tangent_line(group, alpha):self.curr_time = interpolate(self.start_time, self.end_time, alpha)new_group = self.get_ds_dt_group(self.end_dt)@@ -1927,7 +1927,7 @@ class TCubedExample(SecantLineToTangentLine):self.play(Blink(morty))self.play(morty.change_mode, 'happy',- *map(FadeOut, [morty.bubble, morty.bubble.content])+ *list(map(FadeOut, [morty.bubble, morty.bubble.content])))numerator = VGroup(*self.rhs[:12])@@ -2055,7 +2055,7 @@ class TimeForAnActualParadox(TeacherStudentsScene):teacher.look_at, words,Write(words))- self.play(*map(Write, [arrow, paradoxes]))+ self.play(*list(map(Write, [arrow, paradoxes])))self.play(*it.chain(*[[pi.change_mode, mode, pi.look_at, words]for pi, mode in zip(@@ -2119,7 +2119,7 @@ class ParadoxAtTEquals0(TCubedExample):UpdateFromFunc(v_line, v_line_update),run_time = 5)- self.play(*map(FadeOut, [h_line, v_line]))+ self.play(*list(map(FadeOut, [h_line, v_line])))self.label_graph(graph,@@ -2171,7 +2171,7 @@ class ParadoxAtTEquals0(TCubedExample):self.play(Write(derivative[0]))self.wait()self.play(FadeIn(derivative[1]))- self.play(*map(FadeIn, derivative[2:]))+ self.play(*list(map(FadeIn, derivative[2:])))self.wait(2)self.derivative = derivativediff --git a/old_projects/eoc/chapter3.py b/old_projects/eoc/chapter3.pyindex 2301b7ea8..288612809 100644--- a/old_projects/eoc/chapter3.py+++ b/old_projects/eoc/chapter3.py@@ -50,12 +50,12 @@ class ContrastAbstractAndConcrete(Scene):h_line = Line(LEFT, RIGHT).scale(FRAME_X_RADIUS)h_line.shift((r_title.get_bottom()[1]-MED_SMALL_BUFF)*UP)- functions = VGroup(*map(TexMobject, [+ functions = VGroup(*list(map(TexMobject, ["f(x) = 2x^2 - x^3","f(x) = \\sin(x)","f(x) = e^x","\\v_dots"- ]))+ ])))functions.arrange_submobjects(DOWN,aligned_edge = LEFT,@@ -65,7 +65,7 @@ class ContrastAbstractAndConcrete(Scene):functions[-1].shift(MED_LARGE_BUFF*RIGHT)self.add(l_title, r_title)- self.play(*map(ShowCreation, [h_line, v_line]))+ self.play(*list(map(ShowCreation, [h_line, v_line])))self.play(Write(functions))self.wait()anims = [@@ -150,7 +150,7 @@ class ContrastAbstractAndConcrete(Scene):anims.append(FadeIn(pi))continuemom_index, dad_index = random.choice(- list(it.combinations(range(index), 2))+ list(it.combinations(list(range(index)), 2)))pi.parents = VGroup(pis[mom_index], pis[dad_index]).copy()pi.parents.set_fill(opacity = 0)@@ -183,13 +183,13 @@ class ListOfRules(PiCreatureScene):"use_morty" : False,}def construct(self):- rules = VGroup(*map(TexMobject, [+ rules = VGroup(*list(map(TexMobject, ["\\frac{d}{dx} x^n = nx^{n-1}","\\frac{d}{dx} \\sin(x) = \\cos(x)","\\frac{d}{dx} \\cos(x) = -\\sin(x)","\\frac{d}{dx} a^x = \\ln(a) a^x","\\vdots"- ]))+ ])))rules.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF,aligned_edge = LEFT,@@ -212,8 +212,8 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene):"big_x" : 3,"dx" : 0.1,"x_min" : -9,- "x_labeled_nums" : range(-8, 0, 2) + range(2, 10, 2),- "y_labeled_nums" : range(2, 12, 2),+ "x_labeled_nums" : list(range(-8, 0, 2)) + list(range(2, 10, 2)),+ "y_labeled_nums" : list(range(2, 12, 2)),"little_rect_nudge" : 0.5*(1.5*UP+RIGHT),"graph_origin" : 2.5*DOWN + LEFT,"zoomed_canvas_corner" : UP+LEFT,@@ -310,9 +310,9 @@ class DerivativeOfXSquaredAsGraph(GraphScene, ZoomedScene, PiCreatureScene):self.wait()self.play(Write(df_dx))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [v_line, nudged_v_line,- ]))+ ])))self.ss_group = ss_groupdef position_little_rectangle(self, rect, ss_group):@@ -415,7 +415,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene):DrawBorderThenFill(square),self.pi_creature.change_mode, "plain")- self.play(*map(GrowFromCenter, braces))+ self.play(*list(map(GrowFromCenter, braces)))self.play(Write(x_squared))self.change_mode("pondering")self.wait()@@ -478,7 +478,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene):)self.remove(corner_point, bottom_line, right_line)self.add(corner_square, bottom_rect, right_rect)- self.play(*map(GrowFromCenter, little_braces))+ self.play(*list(map(GrowFromCenter, little_braces)))self.wait()self.play(*it.chain(*[[mob.shift, vect*SMALL_BUFF]@@ -752,7 +752,7 @@ class NudgeSideLengthOfSquare(PiCreatureScene):)x_mob.save_state()x_mob.target = number- self.play(*map(MoveToTarget, xs))+ self.play(*list(map(MoveToTarget, xs)))self.wait(2)#Recursively transform to what would have happened@@ -779,7 +779,7 @@ class ChangeInAreaOverChangeInX(Scene):def construct(self):fractions = []for pair in ("Change in area", "Change in $x$"), ("$d(x^2)$", "$dx$"):- top, bottom = map(TextMobject, pair)+ top, bottom = list(map(TextMobject, pair))top.set_color(YELLOW)bottom.set_color(BLUE_B)frac_line = TexMobject("-")@@ -792,7 +792,7 @@ class ChangeInAreaOverChangeInX(Scene):words, symbols = fractionsself.play(Write(words[0], run_time = 1))- self.play(*map(Write, words[1:]), run_time = 1)+ self.play(*list(map(Write, words[1:])), run_time = 1)self.wait()self.play(Transform(words, symbols))self.wait()@@ -922,7 +922,7 @@ class NudgeSideLengthOfCube(Scene):x_squared_dx = TexMobject("x^2", "\\, dx")- self.play(*map(Write, [df, equals]))+ self.play(*list(map(Write, [df, equals])))self.grab_pieces(self.faces, faces)self.wait()self.shrink_dx("Faces are introduced")@@ -1044,7 +1044,7 @@ class NudgeSideLengthOfCube(Scene):np.pi/12, piece.get_center()-self.cube.get_center())piece.target.set_color(RED)- self.play(*map(MoveToTarget, start_pieces), rate_func = wiggle)+ self.play(*list(map(MoveToTarget, start_pieces)), rate_func = wiggle)self.wait()added_anims = []if to_write is not None:@@ -1200,12 +1200,12 @@ class GraphOfXCubed(GraphScene):"x_min" : -6,"x_max" : 6,"x_axis_width" : FRAME_WIDTH,- "x_labeled_nums" : range(-6, 7),+ "x_labeled_nums" : list(range(-6, 7)),"y_min" : -35,"y_max" : 35,"y_axis_height" : FRAME_HEIGHT,"y_tick_frequency" : 5,- "y_labeled_nums" : range(-30, 40, 10),+ "y_labeled_nums" : list(range(-30, 40, 10)),"graph_origin" : ORIGIN,"dx" : 0.2,"deriv_x_min" : -3,@@ -1287,7 +1287,7 @@ class PatternForPowerRule(PiCreatureScene):self.show_hopping()def introduce_pattern(self):- exp_range = range(1, 1+self.num_exponents)+ exp_range = list(range(1, 1+self.num_exponents))colors = color_gradient([BLUE_D, YELLOW], self.num_exponents)derivatives = VGroup()for exponent, color in zip(exp_range, colors):@@ -1367,7 +1367,7 @@ class PatternForPowerRule(PiCreatureScene):self.wait()def show_hopping(self):- exp_range = range(2, 2+self.num_exponents-1)+ exp_range = list(range(2, 2+self.num_exponents-1))self.change_mode("tired")for exp, color in zip(exp_range, self.colors[1:]):form = TexMobject(@@ -1407,7 +1407,7 @@ class PatternForPowerRule(PiCreatureScene):self.pi_creature.change_mode, "hesitant",self.pi_creature.look_at, lhs_copy)- self.play(*map(FadeOut, [form, lhs_copy]))+ self.play(*list(map(FadeOut, [form, lhs_copy])))class PowerRuleAlgebra(Scene):CONFIG = {@@ -1463,7 +1463,7 @@ class PowerRuleAlgebra(Scene):self.workout_product(equals2, full_product)def workout_product(self, equals, full_product):- product_part_tex_pairs = zip(full_product, full_product.expression_parts)+ product_part_tex_pairs = list(zip(full_product, full_product.expression_parts))xs, dxs = [VGroup(*[submob@@ -1613,7 +1613,7 @@ class OneOverX(PiCreatureScene, GraphScene):"y_min" : 0,"x_tick_frequency" : 0.5,"y_tick_frequency" : 0.5,- "x_labeled_nums" : range(0, 4),+ "x_labeled_nums" : list(range(0, 4)),"y_labeled_nums" : [1],"y_axis_height" : 10,"morty_scale_val" : 0.8,@@ -1801,7 +1801,7 @@ class OneOverX(PiCreatureScene, GraphScene):stroke_width = 0)area_change_rect.replace(- VGroup(*map(VectorizedPoint, point_pair)),+ VGroup(*list(map(VectorizedPoint, point_pair))),stretch = True)area_changes.add(area_change_rect)@@ -1847,12 +1847,12 @@ class OneOverX(PiCreatureScene, GraphScene):)self.play(GrowFromCenter(dx_brace),- *map(ShowCreation, v_lines)+ *list(map(ShowCreation, v_lines)))self.wait()self.play(GrowFromCenter(df_brace),- *map(ShowCreation, h_lines)+ *list(map(ShowCreation, h_lines)))self.change_mode("confused")self.wait()@@ -2057,7 +2057,7 @@ class SquareRootOfX(Scene):DrawBorderThenFill(square),Write(area_label))- self.play(*map(FadeIn, braces))+ self.play(*list(map(FadeIn, braces)))self.wait()self.square = square@@ -2117,8 +2117,8 @@ class SquareRootOfX(Scene):)self.play(Write(area_increase))self.play(*it.chain(- map(ShowCreation, lines),- map(FadeIn, little_braces)+ list(map(ShowCreation, lines)),+ list(map(FadeIn, little_braces))))self.play(Write(question))self.wait()@@ -2258,7 +2258,7 @@ class IntroduceUnitCircleWithSine(GraphScene):buff = SMALL_BUFF)theta_copy.target.shift(SMALL_BUFF*UP)- self.play(*map(MoveToTarget, [arc_copy, theta_copy]))+ self.play(*list(map(MoveToTarget, [arc_copy, theta_copy])))self.wait()self.angle_label = VGroup(arc_copy, theta_copy)@@ -2282,7 +2282,7 @@ class IntroduceUnitCircleWithSine(GraphScene):faders = [brace, brace_text, self.example_theta_equation]if self.remove_angle_label:faders += self.angle_label- self.play(*map(FadeOut, faders))+ self.play(*list(map(FadeOut, faders)))self.v_line = v_line@@ -2498,9 +2498,9 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene):def zoom_in(self):self.activate_zooming()self.little_rectangle.next_to(self.radial_line.get_end(), UP, LARGE_BUFF)- self.play(*map(FadeIn, [+ self.play(*list(map(FadeIn, [self.little_rectangle, self.big_rectangle- ]))+ ])))self.play(self.little_rectangle.move_to,self.radial_line.get_end(), DOWN+RIGHT,@@ -2592,7 +2592,7 @@ class DerivativeFromZoomingInOnSine(IntroduceUnitCircleWithSine, ZoomedScene):new_angle_label[1].rotate_in_place(np.pi/2)little_triangle_lines = VGroup(*[- Line(*map(little_triangle.get_corner, pair))+ Line(*list(map(little_triangle.get_corner, pair)))for pair in [(DOWN+RIGHT, UP+LEFT),(UP+LEFT, DOWN+LEFT)diff --git a/old_projects/eoc/chapter4.py b/old_projects/eoc/chapter4.pyindex befc56090..55421f41d 100644--- a/old_projects/eoc/chapter4.py+++ b/old_projects/eoc/chapter4.py@@ -17,11 +17,11 @@ class Chapter4OpeningQuote(OpeningQuote):class TransitionFromLastVideo(TeacherStudentsScene):def construct(self):- simple_rules = VGroup(*map(TexMobject, [+ simple_rules = VGroup(*list(map(TexMobject, ["\\frac{d(x^3)}{dx} = 3x^2","\\frac{d(\\sin(x))}{dx} = \\cos(x)","\\frac{d(1/x)}{dx} = -\\frac{1}{x^2}",- ]))+ ])))combination_rules = VGroup(*[TexMobject("\\frac{d}{dx}\\left(%s\\right)"%tex)@@ -174,11 +174,11 @@ class TransitionFromLastVideo(TeacherStudentsScene):)self.wait()self.change_student_modes(*["happy"]*3)- words = map(TextMobject, [+ words = list(map(TextMobject, ["composition", "product","composition", "sum","composition"- ])+ ]))for word, part in zip(words, reversed(parts)):word.set_color(YELLOW)@@ -189,7 +189,7 @@ class TransitionFromLastVideo(TeacherStudentsScene):part.set_color, YELLOW)self.wait()- self.play(*map(FadeOut, [word, part]))+ self.play(*list(map(FadeOut, [word, part])))self.play(FadeOut(parts[0]))#Bring back combinations@@ -425,9 +425,9 @@ class SumRule(GraphScene):about_point = mob.get_bottom())mob.shift_onto_screen()- self.play(*map(MoveToTarget, [+ self.play(*list(map(MoveToTarget, [graph_parts, self.graph_labels- ]))+ ])))self.wait()def show_example_stacking(self):@@ -443,10 +443,7 @@ class SumRule(GraphScene):VGroup(example_v_lines[i], nudged_v_lines[i])for i in (0, 1)]- faders = VGroup(*filter(- lambda line : line not in example_v_lines,- it.chain(*v_line_sets)- ))+ faders = VGroup(*[line for line in it.chain(*v_line_sets) if line not in example_v_lines])label_groups = []for line, tex, vect in zip(sine_lines, ["", "+dx"], [LEFT, RIGHT]):dot = Dot(line.get_bottom(), radius = 0.03, color = YELLOW)@@ -753,10 +750,7 @@ class NotGraphsForProducts(GraphScene):)self.wait()- everything = VGroup(*filter(- lambda m : not m.is_subpath,- self.get_mobjects()- ))+ everything = VGroup(*[m for m in self.get_mobjects() if not m.is_subpath])words = TextMobject("Not the best visualization")words.scale(1.5)words.shift(FRAME_Y_RADIUS*UP/2)@@ -877,7 +871,7 @@ class IntroduceProductAsArea(ReconfigurableScene):)self.wait()self.play(*it.chain(- map(FadeOut, [y_axis, graph, label, v_line]),+ list(map(FadeOut, [y_axis, graph, label, v_line])),[Animation(x_axis)]))self.wait()@@ -918,7 +912,7 @@ class IntroduceProductAsArea(ReconfigurableScene):right_box, corner_box, right_box = df_boxesself.play(FocusOn(nudge_label_group))- self.play(*map(GrowFromCenter, nudge_label_group))+ self.play(*list(map(GrowFromCenter, nudge_label_group)))self.animate_x_change(self.default_x+self.dx,rate_func = there_and_back,@@ -1085,10 +1079,7 @@ class IntroduceProductAsArea(ReconfigurableScene):top_label = self.box_label_group[1][0]right_label = self.df_box_labels[1]- faders = VGroup(*filter(- lambda m : m not in [bottom_box, top_label, right_label],- self.full_box_parts- ))+ faders = VGroup(*[m for m in self.full_box_parts if m not in [bottom_box, top_label, right_label]])faders.save_state()self.play(faders.fade, 0.8)@@ -1109,10 +1100,7 @@ class IntroduceProductAsArea(ReconfigurableScene):top_label = self.df_box_labels[0]right_label = self.box_label_group[1][1]- faders = VGroup(*filter(- lambda m : m not in [right_box, top_label, right_label],- self.full_box_parts- ))+ faders = VGroup(*[m for m in self.full_box_parts if m not in [right_box, top_label, right_label]])faders.save_state()self.play(faders.fade, 0.8)@@ -1144,7 +1132,7 @@ class IntroduceProductAsArea(ReconfigurableScene):self.wait()self.play(Write(words), ShowCreation(arrow))self.wait()- self.play(*map(FadeOut, [words, arrow, corner_copy]))+ self.play(*list(map(FadeOut, [words, arrow, corner_copy])))self.wait()corner_copy.set_color(BLACK)@@ -1198,7 +1186,7 @@ class IntroduceProductAsArea(ReconfigurableScene):self.deriv.submobjects.insert(index+1, self.deriv[index].copy())- non_deriv_indices = range(len(expanded_deriv))+ non_deriv_indices = list(range(len(expanded_deriv)))for indices in [(3, 4), (7, 8)]:top_part = VGroup()bottom_part = VGroup()@@ -1316,7 +1304,7 @@ class IntroduceProductAsArea(ReconfigurableScene):x_slider.x_val = target_xdef get_x_slider(self, x):- numbers = range(int(self.slider_x_max) + 1)+ numbers = list(range(int(self.slider_x_max) + 1))line = NumberLine(x_min = 0,x_max = self.slider_x_max,@@ -1411,9 +1399,9 @@ class MneumonicExample(TeacherStudentsScene):left_words.copy(), left_terms))self.wait()- self.play(*map(Indicate, [left, left_words[0], left_terms[0]]))+ self.play(*list(map(Indicate, [left, left_words[0], left_terms[0]])))self.wait()- self.play(*map(Indicate, [right, left_words[1], left_terms[1]]))+ self.play(*list(map(Indicate, [right, left_words[1], left_terms[1]])))self.wait()right_words = VGroup(*words[2:])@@ -1426,9 +1414,9 @@ class MneumonicExample(TeacherStudentsScene):right_words.copy(), right_terms))self.wait()- self.play(*map(Indicate, [right, right_words[1], right_terms[1]]))+ self.play(*list(map(Indicate, [right, right_words[1], right_terms[1]])))self.wait()- self.play(*map(Indicate, [left, right_words[2], right_terms[2]]))+ self.play(*list(map(Indicate, [left, right_words[2], right_terms[2]])))self.wait(3)self.play(self.get_teacher().change_mode, "shruggie")@@ -1533,8 +1521,8 @@ class ThreeLinesChainRule(ReconfigurableScene):"center_y" : 3,"x_min" : 0,"x_max" : 3,- "numbers_to_show" : range(4),- "numbers_with_elongated_ticks" : range(4),+ "numbers_to_show" : list(range(4)),+ "numbers_with_elongated_ticks" : list(range(4)),"tick_frequency" : 0.25,},{@@ -1544,8 +1532,8 @@ class ThreeLinesChainRule(ReconfigurableScene):"center_y" : 0.5,"x_min" : 0,"x_max" : 10,- "numbers_to_show" : range(0, 11),- "numbers_with_elongated_ticks" : range(0, 11, 1),+ "numbers_to_show" : list(range(0, 11)),+ "numbers_with_elongated_ticks" : list(range(0, 11, 1)),"tick_frequency" : 0.25,},{@@ -1555,8 +1543,8 @@ class ThreeLinesChainRule(ReconfigurableScene):"center_y" : -2,"x_min" : -2,"x_max" : 2,- "numbers_to_show" : range(-2, 3),- "numbers_with_elongated_ticks" : range(-2, 3),+ "numbers_to_show" : list(range(-2, 3)),+ "numbers_with_elongated_ticks" : list(range(-2, 3)),"tick_frequency" : 0.25,},],@@ -1639,7 +1627,7 @@ class ThreeLinesChainRule(ReconfigurableScene):ShowCreation(sine_arrow))self.wait(2)- self.play(*map(FadeOut, [sine_text, sine_arrow]))+ self.play(*list(map(FadeOut, [sine_text, sine_arrow])))self.animate_x_change(self.example_x, run_time = 3)def nudge_x(self):@@ -1710,7 +1698,7 @@ class ThreeLinesChainRule(ReconfigurableScene):run_time = 1,added_anims = it.chain([GrowFromCenter(dx_brace)],- map(ShowCreation, nudge_lines)+ list(map(ShowCreation, nudge_lines))))self.animate_x_change(self.example_x)@@ -1797,7 +1785,7 @@ class ThreeLinesChainRule(ReconfigurableScene):group.to_edge(RIGHT)arrow = Arrow(group.get_bottom(), self.final_derivative[0].get_top())- self.play(*map(FadeOut, [self.arrows, self.arrow_labels]))+ self.play(*list(map(FadeOut, [self.arrows, self.arrow_labels])))self.play(FadeIn(group))self.play(ShowCreation(arrow))self.wait()@@ -1965,7 +1953,7 @@ class GeneralizeChainRule(Scene):self.wait()#Generalize- self.play(*map(FadeIn, general[:5]))+ self.play(*list(map(FadeIn, general[:5])))self.wait()self.play(Transform(example_outer_brace, general_outer_brace),@@ -2026,9 +2014,9 @@ class GeneralizeChainRule(Scene):self.play(morty.change_mode, "pondering")self.play(Blink(morty))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [d_general_outer_copy, inner, circle- ]))+ ])))#Show cancelationbraces = [@@ -2038,15 +2026,15 @@ class GeneralizeChainRule(Scene):example_outer_brace,]texts = [brace.text for brace in braces]- self.play(*map(FadeOut, braces+texts))+ self.play(*list(map(FadeOut, braces+texts)))to_collapse = VGroup(VGroup(*general[7:10]), general[12])dg_dh = VGroup(*general[5:7])dh_dx = VGroup(*general[10:12])to_collapse.generate_target()- points = VGroup(*map(VectorizedPoint,+ points = VGroup(*list(map(VectorizedPoint,[m.get_left() for m in to_collapse]- ))+ )))self.play(Transform(to_collapse, points),dh_dx.next_to, dg_dh,diff --git a/old_projects/eoc/chapter5.py b/old_projects/eoc/chapter5.pyindex faec8028e..c3d035c5f 100644--- a/old_projects/eoc/chapter5.py+++ b/old_projects/eoc/chapter5.py@@ -22,10 +22,10 @@ class LastVideo(TeacherStudentsScene):last_video.save_state()this_video = series[3]- known_formulas = VGroup(*map(TexMobject, [+ known_formulas = VGroup(*list(map(TexMobject, ["\\frac{d(x^n)}{dx} = nx^{n-1}","\\frac{d(\\sin(x))}{dx} = \\cos(x)",- ]))+ ])))known_formulas.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF,)@@ -196,11 +196,11 @@ class DoublingPopulation(PiCreatureScene):for x in range(2):new_day_to_day, new_frac = self.get_from_day_to_day_label()- self.play(*map(FadeOut, [rect, frac]))+ self.play(*list(map(FadeOut, [rect, frac])))frac = new_fracself.play(Transform(day_to_day, new_day_to_day))rect = self.let_day_pass_and_highlight_new_creatures(frac)- self.play(*map(FadeOut, [rect, frac, day_to_day]))+ self.play(*list(map(FadeOut, [rect, frac, day_to_day])))def let_day_pass_and_highlight_new_creatures(self, frac):num_new_creatures = 2**self.get_curr_day()@@ -273,9 +273,9 @@ class DoublingPopulation(PiCreatureScene):fading_creatures = VGroup(*self.get_on_screen_pi_creatures()[8:])- self.play(*map(FadeIn, [+ self.play(*list(map(FadeIn, [false_deriv, false_deriv.brace, false_deriv.brace_text- ]))+ ])))self.wait()self.play(Transform(time, new_time),@@ -303,9 +303,9 @@ class DoublingPopulation(PiCreatureScene):rect.replace(real_deriv)rect.stretch_to_fit_width(rect.get_width()+MED_SMALL_BUFF)rect.stretch_to_fit_height(rect.get_height()+MED_SMALL_BUFF)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [false_deriv.brace, false_deriv.brace_text- ]))+ ])))self.play(ShowCreation(rect))self.play(*[ApplyFunction(@@ -348,8 +348,8 @@ class DoublingPopulation(PiCreatureScene):new_time.next_to(self.t_expression[-2], RIGHT)first_creature = self.get_pi_creatures()[0]- self.play(*map(FadeOut, faders))- self.play(*map(FadeIn, [first_creature, new_time]))+ self.play(*list(map(FadeOut, faders)))+ self.play(*list(map(FadeIn, [first_creature, new_time])))self.t_expression.submobjects[-1] = new_timedef let_one_day_pass(self, run_time = 2):@@ -445,8 +445,8 @@ class GraphOfTwoToT(GraphScene):CONFIG = {"x_axis_label" : "$t$","y_axis_label" : "$M$",- "x_labeled_nums" : range(1, 7),- "y_labeled_nums" : range(8, 40, 8),+ "x_labeled_nums" : list(range(1, 7)),+ "y_labeled_nums" : list(range(8, 40, 8)),"x_max" : 6,"y_min" : 0,"y_max" : 32,@@ -800,10 +800,10 @@ class AnalyzeExponentRatio(PiCreatureScene):Transform(*arrows),)self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [words[0], arrows[0], add_exp_rect, mult_rect,two_to_t_plus_dt, exp_prop_brace,- ]))+ ])))#Factor out 2^tself.play(*[@@ -886,7 +886,7 @@ class AnalyzeExponentRatio(PiCreatureScene):self.play(ReplacementTransform(rects[0].copy(), rects[1]))self.change_mode("happy")self.wait()- self.play(*map(FadeOut, rects))+ self.play(*list(map(FadeOut, rects)))#Plug in specific valuesstatic_constant = self.try_specific_dt_values()@@ -1145,7 +1145,7 @@ class GraphOfExp(GraphScene):"x_max" : 3,"x_tick_frequency" : 1,"x_axis_label" : "t",- "x_labeled_nums" : range(-3, 4),+ "x_labeled_nums" : list(range(-3, 4)),"x_axis_width" : 11,"graph_origin" : 2*DOWN + LEFT,"example_inputs" : [1, 2],@@ -1196,7 +1196,7 @@ class GraphOfExp(GraphScene):))self.wait()- self.play(*map(ShowCreation, ss_group))+ self.play(*list(map(ShowCreation, ss_group)))self.play(Write(slope_labels[0]))self.play(ShowCreation(v_lines[0]))self.play(Write(height_labels[0]))@@ -1291,8 +1291,8 @@ class ChainRuleIntuition(ThreeLinesChainRule):"center_y" : 3,"x_min" : 0,"x_max" : 3,- "numbers_to_show" : range(4),- "numbers_with_elongated_ticks" : range(4),+ "numbers_to_show" : list(range(4)),+ "numbers_with_elongated_ticks" : list(range(4)),"tick_frequency" : 1,},{@@ -1302,8 +1302,8 @@ class ChainRuleIntuition(ThreeLinesChainRule):"center_y" : 0.5,"x_min" : 0,"x_max" : 3,- "numbers_to_show" : range(0, 4),- "numbers_with_elongated_ticks" : range(4),+ "numbers_to_show" : list(range(0, 4)),+ "numbers_with_elongated_ticks" : list(range(4)),"tick_frequency" : 1,},{@@ -1313,8 +1313,8 @@ class ChainRuleIntuition(ThreeLinesChainRule):"center_y" : -2,"x_min" : 0,"x_max" : 10,- "numbers_to_show" : range(0, 11, 3),- "numbers_with_elongated_ticks" : range(11),+ "numbers_to_show" : list(range(0, 11, 3)),+ "numbers_with_elongated_ticks" : list(range(11)),"tick_frequency" : 1,},],@@ -1364,7 +1364,7 @@ class ChainRuleIntuition(ThreeLinesChainRule):line.remove(*line.numbers)dt_brace, d3t_brace, dexp3t_brace = braces- self.play(*map(FadeIn, [nudge_lines, braces]))+ self.play(*list(map(FadeIn, [nudge_lines, braces])))self.wait()for count in range(3):for dx in self.dx, 0:@@ -1526,7 +1526,7 @@ class CompareWaysToWriteExponentials(GraphScene):}def construct(self):self.setup_axes()- bases = range(2, 7)+ bases = list(range(2, 7))graphs = [self.get_graph(lambda t : base**t, color = GREEN)for base in bases@@ -1783,7 +1783,7 @@ class InvestedMoney(Scene):class NaturalLog(Scene):def construct(self):- expressions = VGroup(*map(self.get_expression, [2, 3, 7]))+ expressions = VGroup(*list(map(self.get_expression, [2, 3, 7])))expressions.arrange_submobjects(DOWN, buff = MED_SMALL_BUFF)expressions.to_edge(LEFT)@@ -1807,7 +1807,7 @@ class NaturalLog(Scene):log_constant, exp_constant = constant.copy(), constant.copy()log_base, exp_base = base.copy(), base.copy()- log_equals, exp_equals = map(TexMobject, "==")+ log_equals, exp_equals = list(map(TexMobject, "=="))ln = TexMobject("\\ln(2)")log_base.move_to(ln[-2])@@ -1858,7 +1858,7 @@ class NaturalLog(Scene):ln_a.set_color, BLUE)self.wait()- self.play(*map(FadeOut, [log_expression, exp_expression]))+ self.play(*list(map(FadeOut, [log_expression, exp_expression])))self.wait()def get_expression(self, base):@@ -1895,9 +1895,9 @@ class NextVideo(TeacherStudentsScene):this_tex[3][1].set_color(YELLOW)this_tex.next_to(brace, DOWN)- next_tex = VGroup(*map(TextMobject, [+ next_tex = VGroup(*list(map(TextMobject, ["Chain rule", "Product rule", "$\\vdots$"- ]))+ ])))next_tex.arrange_submobjects(DOWN)next_tex.next_to(brace, DOWN)next_tex.shift(diff --git a/old_projects/eoc/chapter6.py b/old_projects/eoc/chapter6.pyindex 0062f2a36..bdb0337c0 100644--- a/old_projects/eoc/chapter6.py+++ b/old_projects/eoc/chapter6.py@@ -150,17 +150,17 @@ class SlopeOfCircleExample(ZoomedScene):#Move labels to equationmovers = labels.copy()- pairs = zip(+ pairs = list(zip([movers[1], movers[2], movers[0]],self.circle_equation[1][0:-1:3]- )+ ))self.play(*[ApplyMethod(m1.replace, m2)for m1, m2 in pairs])self.wait()- self.play(*map(FadeOut, [lines, labels, movers]))+ self.play(*list(map(FadeOut, [lines, labels, movers])))self.remove(full_group)self.add(dot)self.wait()@@ -224,8 +224,8 @@ class SlopeOfCircleExample(ZoomedScene):self.play(Blink(morty))self.wait()- self.play(*map(FadeOut, to_fade))- self.play(*map(FadeOut, [radial_line, perp_mark]))+ self.play(*list(map(FadeOut, to_fade)))+ self.play(*list(map(FadeOut, [radial_line, perp_mark])))self.wait()def show_dx_and_dy(self):@@ -341,7 +341,7 @@ class SlopeOfCircleExample(ZoomedScene):)self.play(new_circle.set_stroke, None, 0)self.wait()- self.play(*map(FadeOut, [brace, brace_text]))+ self.play(*list(map(FadeOut, [brace, brace_text])))self.wait()def perform_implicit_derivative(self):@@ -663,7 +663,7 @@ class RelatedRatesExample(ThreeDScene):self.wait()self.play(ShowCreation(x_line), Write(x_label))self.wait(2)- self.play(*map(FadeOut, [x_label, y_label]))+ self.play(*list(map(FadeOut, [x_label, y_label])))self.ladder_brace = ladder_braceself.x_and_y_lines = x_and_y_lines@@ -733,9 +733,9 @@ class RelatedRatesExample(ThreeDScene):randy, "Give names"))self.play(Blink(randy))- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [randy, randy.bubble, randy.bubble.content- ]))+ ])))def write_equation(self):self.x_and_y_labels = self.get_x_and_y_labels()@@ -827,9 +827,9 @@ class RelatedRatesExample(ThreeDScene):run_time = 8,rate_func = there_and_back)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [randy, find_dx_dt, alt_equation- ]))+ ])))self.wait()def discuss_lhs_as_function(self):@@ -872,9 +872,9 @@ class RelatedRatesExample(ThreeDScene):rate_func = lambda t : 0.5*there_and_back(t))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [brace, constant_words, function_of_time- ]))+ ])))self.play(ReplacementTransform(lhs.copy(), derivative_interior),Write(derivative_scaffold),@@ -906,10 +906,10 @@ class RelatedRatesExample(ThreeDScene):GrowFromCenter(dt_brace),Write(dt_brace_text, run_time = 2))- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.dy_arrow, self.dy_label,self.dx_arrow, self.dx_label,- ]))+ ])))self.add(shadow_ladder)self.let_ladder_fall(self.ladder, *self.get_added_anims_for_ladder_fall(),@@ -2034,7 +2034,7 @@ class AlternateExample(ZoomedScene):ShowCreation(arrows))self.wait()- self.play(*map(FadeOut, [word, arrows]))+ self.play(*list(map(FadeOut, [word, arrows])))def differentiate_lhs(self):formula = self.formula@@ -2124,7 +2124,7 @@ class AlternateExample(ZoomedScene):self.play(ShowCreation(arrow))self.play(Write(equals_dx))self.wait()- self.play(*map(FadeOut, [circle, arrow]))+ self.play(*list(map(FadeOut, [circle, arrow])))self.equals_dx = equals_dx@@ -2301,7 +2301,7 @@ class DerivativeOfNaturalLog(ZoomedScene):update_dot(dot, 0)update_label(label)- self.play(*map(FadeIn, [dot, label]))+ self.play(*list(map(FadeIn, [dot, label])))self.play(UpdateFromAlphaFunc(dot, update_dot),UpdateFromFunc(label, update_label),@@ -2322,7 +2322,7 @@ class DerivativeOfNaturalLog(ZoomedScene):run_time = 3,rate_func = lambda t : 1-0.6*smooth(t),)- self.play(*map(FadeOut, [xy_start, label]))+ self.play(*list(map(FadeOut, [xy_start, label])))self.dot = dot@@ -2654,9 +2654,9 @@ class Chapter6PatreonThanks(PatreonThanks):class Thumbnail(AlternateExample):def construct(self):- title = VGroup(*map(TextMobject, [+ title = VGroup(*list(map(TextMobject, ["Implicit", "Differentiation"- ]))+ ])))title.arrange_submobjects(DOWN)title.scale(3)title.next_to(ORIGIN, UP)diff --git a/old_projects/eoc/chapter7.py b/old_projects/eoc/chapter7.pyindex 937a18734..78aee0000 100644--- a/old_projects/eoc/chapter7.py+++ b/old_projects/eoc/chapter7.py@@ -31,7 +31,7 @@ class ThisVideo(TeacherStudentsScene):integral_videos = VGroup(*series[7:9])video_groups = [deriv_videos, this_video, integral_videos]- braces = map(Brace, video_groups)+ braces = list(map(Brace, video_groups))deriv_brace, this_brace, integral_brace = bracestex_mobs = [@@ -278,11 +278,8 @@ class RefreshOnDerivativeDefinition(GraphScene):)for s in ["f", "over", "dx", "(", str(self.start_x), ")"]])- covered_new_deriv_parts = list(it.chain(*deriv_to_new_deriv.values()))- uncovered_new_deriv_parts = filter(- lambda part : part not in covered_new_deriv_parts,- new_deriv- )+ covered_new_deriv_parts = list(it.chain(*list(deriv_to_new_deriv.values())))+ uncovered_new_deriv_parts = [part for part in new_deriv if part not in covered_new_deriv_parts]new_deriv.move_to(derivative)new_brace = Brace(new_deriv, DOWN)@@ -295,7 +292,7 @@ class RefreshOnDerivativeDefinition(GraphScene):self.wait()self.play(*[ReplacementTransform(*pair, run_time = 2)- for pair in deriv_to_new_deriv.items()+ for pair in list(deriv_to_new_deriv.items())]+[Transform(deriv_brace, new_brace),dx_to_0.next_to, new_brace, DOWN@@ -632,7 +629,7 @@ class OtherViewsOfDx(TeacherStudentsScene):"h" : GREEN,"2" : RED}- for tex, color in tex_to_color.items():+ for tex, color in list(tex_to_color.items()):definition.set_color_by_tex(tex, color)definition.scale(0.8)definition.to_corner(UP+LEFT)@@ -767,11 +764,11 @@ class GraphLimitExpression(GraphScene):"x_min" : -8,"x_max" : 5,"x_axis_label" : "$h$",- "x_labeled_nums" : range(-8, 6, 2),+ "x_labeled_nums" : list(range(-8, 6, 2)),"y_min" : 0,"y_max" : 20,"y_tick_frequency" : 1,- "y_labeled_nums" : range(5, 25, 5),+ "y_labeled_nums" : list(range(5, 25, 5)),"y_axis_label" : "","big_delta" : 0.7,"small_delta" : 0.01,@@ -803,7 +800,7 @@ class GraphLimitExpression(GraphScene):"2" : self.two_color}for tex_mob in expression, limit, derivative:- for tex, color in tex_to_color.items():+ for tex, color in list(tex_to_color.items()):tex_mob.set_color_by_tex(tex, color)tex_mob.next_to(ORIGIN, RIGHT, LARGE_BUFF)tex_mob.to_edge(UP)@@ -847,7 +844,7 @@ class GraphLimitExpression(GraphScene):self.wait(2)self.play(expression.restore,- *map(FadeOut, [derivative, brace, limit])+ *list(map(FadeOut, [derivative, brace, limit])))self.wait()@@ -893,7 +890,7 @@ class GraphLimitExpression(GraphScene):undefined.to_edge(RIGHT)self.play(Write(h_equals_0, run_time = 2))- self.play(*map(ShowCreation, [arrow, dot]))+ self.play(*list(map(ShowCreation, [arrow, dot])))self.wait()self.play(ReplacementTransform(expression.copy(), new_expression@@ -989,7 +986,7 @@ class GraphLimitExpression(GraphScene):self.remove(self.limit_point_hole)#Show approaching- self.play(*map(FadeOut, [brace, brace_text]))+ self.play(*list(map(FadeOut, [brace, brace_text])))for v_line, h_line in (right_v_line, top_h_line), (left_v_line, bottom_h_line):self.play(ShowCreation(v_line),@@ -1082,7 +1079,7 @@ class GraphLimitExpression(GraphScene):))self.wait()- self.play(*map(GrowFromCenter, self.ed_group.epsilon_lines))+ self.play(*list(map(GrowFromCenter, self.ed_group.epsilon_lines)))self.play(*[ApplyMethod(line.copy().set_stroke(GREY, 2).move_to,@@ -1207,11 +1204,11 @@ class LimitCounterExample(GraphLimitExpression):CONFIG = {"x_min" : -8,"x_max" : 8,- "x_labeled_nums" : range(-8, 10, 2),+ "x_labeled_nums" : list(range(-8, 10, 2)),"x_axis_width" : FRAME_WIDTH - LARGE_BUFF,"y_min" : -4,"y_max" : 4,- "y_labeled_nums" : range(-2, 4, 1),+ "y_labeled_nums" : list(range(-2, 4, 1)),"y_axis_height" : FRAME_HEIGHT+2*LARGE_BUFF,"graph_origin" : DOWN,"graph_color" : BLUE,@@ -1288,7 +1285,7 @@ class LimitCounterExample(GraphLimitExpression):return linesfor lines in right_lines, left_lines:- self.play(*map(ShowCreation, lines))+ self.play(*list(map(ShowCreation, lines)))self.play(UpdateFromAlphaFunc(lines, update_lines,run_time = 3@@ -1462,10 +1459,10 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene):self.revert_to_original_skipping_status()def introduce_epsilon(self):- epsilon_group, small_epsilon_group = map(+ epsilon_group, small_epsilon_group = list(map(self.get_epsilon_group,self.epsilon_list[:2]- )+ ))twelve_line = epsilon_group.limit_linetwelve = self.rhs[-1]@@ -1490,15 +1487,15 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene):ReplacementTransform(twelve_line.copy(), line)for line in epsilon_group.epsilon_lines],- map(GrowFromCenter, epsilon_group.braces),+ list(map(GrowFromCenter, epsilon_group.braces)),))- self.play(*map(Write, epsilon_group.labels))+ self.play(*list(map(Write, epsilon_group.labels)))self.play(Write(distance),ShowCreation(arrows))self.wait()- self.play(*map(FadeOut, [distance, arrows]))+ self.play(*list(map(FadeOut, [distance, arrows])))self.play(Transform(epsilon_group, small_epsilon_group,run_time = 2@@ -1537,8 +1534,8 @@ class EpsilonDeltaExample(GraphLimitExpression, ZoomedScene):def introduce_delta(self):delta_group = self.get_delta_group(self.delta_list[1])- self.play(*map(GrowFromCenter, delta_group.braces))- self.play(*map(Write, delta_group.labels))+ self.play(*list(map(GrowFromCenter, delta_group.braces)))+ self.play(*list(map(Write, delta_group.labels)))self.wait()self.play(ReplacementTransform(@@ -1667,9 +1664,9 @@ class EpsilonDeltaCounterExample(LimitCounterExample, EpsilonDeltaExample):)for line in epsilon_group.epsilon_lines],- map(GrowFromCenter, epsilon_group.braces)+ list(map(GrowFromCenter, epsilon_group.braces))))- self.play(*map(Write, epsilon_group.labels))+ self.play(*list(map(Write, epsilon_group.labels)))self.play(Write(rhs))self.wait()@@ -1678,7 +1675,7 @@ class EpsilonDeltaCounterExample(LimitCounterExample, EpsilonDeltaExample):def introduce_epsilon_delta_group(self):ed_group = self.get_epsilon_delta_group(self.big_delta)- self.play(*map(ShowCreation, ed_group.delta_lines))+ self.play(*list(map(ShowCreation, ed_group.delta_lines)))self.play(ShowCreation(ed_group.input_range))self.play(ReplacementTransform(ed_group.input_range.copy(),@@ -1686,7 +1683,7 @@ class EpsilonDeltaCounterExample(LimitCounterExample, EpsilonDeltaExample):run_time = 2))self.remove(self.graph_holes)- self.play(*map(GrowFromCenter, ed_group.epsilon_lines))+ self.play(*list(map(GrowFromCenter, ed_group.epsilon_lines)))self.wait(2)self.animate_epsilon_delta_group_change(ed_group, target_delta = self.small_delta,@@ -1810,13 +1807,13 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfi"x_axis_width" : FRAME_WIDTH,"x_min" : -5,"x_max" : 5,- "x_labeled_nums" : range(-6, 8, 2),+ "x_labeled_nums" : list(range(-6, 8, 2)),"x_axis_label" : "$x$","y_axis_height" : FRAME_HEIGHT,"y_min" : -3.1,"y_max" : 3.1,"y_bottom_tick" : -4,- "y_labeled_nums" : range(-2, 4, 2),+ "y_labeled_nums" : list(range(-2, 4, 2)),"y_axis_label" : "","x_color" : RED,"hole_radius" : 0.07,@@ -1960,9 +1957,9 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfied_group.input_range.copy(),ed_group.output_range),- *map(ShowCreation, ed_group.delta_lines)+ *list(map(ShowCreation, ed_group.delta_lines)))- self.play(*map(GrowFromCenter, ed_group.epsilon_lines))+ self.play(*list(map(GrowFromCenter, ed_group.epsilon_lines)))self.play(morty.change_mode, "thinking")self.animate_epsilon_delta_group_change(ed_group, target_delta = self.small_delta,@@ -1979,7 +1976,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfiself.wait(2)self.play(func_1_group.to_corner, UP+LEFT,- *map(FadeOut, [morty, ed_group])+ *list(map(FadeOut, [morty, ed_group])))self.wait()@@ -2250,7 +2247,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfiself.play(FadeOut(cos))neg = neg_one.get_part_by_tex("-").copy()self.play(neg.next_to, cos_dx[-2], LEFT, SMALL_BUFF/self.zoom_factor)- self.play(*map(FadeOut, [neg_one, brace]))+ self.play(*list(map(FadeOut, [neg_one, brace])))neg_pi_dx = VGroup(neg, *cos_dx[-2:])self.play(neg_pi_dx.next_to, d_sine_arrow,@@ -2322,7 +2319,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfiself.wait()self.play(Transform(x, dot_one))self.wait()- self.play(*map(FadeOut, [eq_x, equals]))+ self.play(*list(map(FadeOut, [eq_x, equals])))self.wait()def show_final_ratio(self):@@ -2358,7 +2355,7 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfiself.wait()#Cancel dx's- self.play(*map(ShowCreation, circles), run_time = 2)+ self.play(*list(map(ShowCreation, circles)), run_time = 2)self.wait()self.play(dxs.fade, 0.75, FadeOut(circles))self.wait()@@ -2381,10 +2378,10 @@ class LHopitalExample(LimitCounterExample, PiCreatureScene, ZoomedScene, Reconfiheight.add_background_rectangle()self.disactivate_zooming()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.sine_graph, self.sine_label,self.parabola, self.parabola_label,- ]) + [+ ])) + [Animation(self.final_ratio)])self.play(GrowFromCenter(brace))@@ -2501,7 +2498,7 @@ class GeneralLHoptial(LHopitalExample):ShowCreation(a_dot),)self.wait()- self.play(*map(FadeOut, [a_label, a_arrow]))+ self.play(*list(map(FadeOut, [a_label, a_arrow])))self.a_dot = a_dotself.f_graph = f_graphdiff --git a/old_projects/eoc/chapter8.py b/old_projects/eoc/chapter8.pyindex 4f2e35304..fb2ba5cd1 100644--- a/old_projects/eoc/chapter8.py+++ b/old_projects/eoc/chapter8.py@@ -147,7 +147,7 @@ class InCarRestrictedView(ShowSpeedometer):time_label = TextMobject("Time (in seconds):", "0")time_label.shift(2*UP)- dots = VGroup(*map(Dot, [self.point_A, self.point_B]))+ dots = VGroup(*list(map(Dot, [self.point_A, self.point_B])))line = Line(*dots, buff = 0)line.set_color(DISTANCE_COLOR)brace = Brace(line, DOWN)@@ -186,7 +186,7 @@ class InCarRestrictedView(ShowSpeedometer):self.wait()#Ask about distance- self.play(*map(ShowCreation, dots))+ self.play(*list(map(ShowCreation, dots)))self.play(ShowCreation(line))self.play(GrowFromCenter(brace),@@ -200,14 +200,14 @@ class GraphDistanceVsTime(GraphCarTrajectory):"y_max" : 100,"y_axis_height" : 6,"y_tick_frequency" : 10,- "y_labeled_nums" : range(10, 100, 10),+ "y_labeled_nums" : list(range(10, 100, 10)),"y_axis_label" : "Distance (in meters)","x_min" : -1,"x_max" : 9,"x_axis_width" : 9,"x_tick_frequency" : 1,"x_leftmost_tick" : None, #Change if different from x_min- "x_labeled_nums" : range(1, 9),+ "x_labeled_nums" : list(range(1, 9)),"x_axis_label" : "$t$","time_of_journey" : 8,"care_movement_rate_func" : s_rate_func,@@ -233,13 +233,13 @@ class PlotVelocity(GraphScene):"x_max" : 9,"x_axis_width" : 9,"x_tick_frequency" : 1,- "x_labeled_nums" : range(1, 9),+ "x_labeled_nums" : list(range(1, 9)),"x_axis_label" : "$t$","y_min" : 0,"y_max" : 25,"y_axis_height" : 6,"y_tick_frequency" : 5,- "y_labeled_nums" : range(5, 30, 5),+ "y_labeled_nums" : list(range(5, 30, 5)),"y_axis_label" : "Velocity in $\\frac{\\text{meters}}{\\text{second}}$","num_graph_anchor_points" : 50,}@@ -263,7 +263,7 @@ class PlotVelocity(GraphScene):self.speedometer = speedometerdef plot_points(self):- times = range(0, 9)+ times = list(range(0, 9))points = [self.coords_to_point(t, v_func(t))for t in times@@ -442,7 +442,7 @@ class Antiderivative(PiCreatureScene):self.pi_creature.change_mode, "raise_right_hand")self.wait(2)- for pair in reversed(zip(functions, alt_functions)):+ for pair in reversed(list(zip(functions, alt_functions))):self.play(Transform(*pair),self.pi_creature.change_mode, "pondering"@@ -629,7 +629,7 @@ class ConstantVelocityPlot(PlotVelocity):self.play(randy.change_mode, "pondering")self.play(self.area_rect.set_color, YELLOW,- *map(Animation, self.get_mobjects()),+ *list(map(Animation, self.get_mobjects())),rate_func = there_and_back)self.play(Blink(randy))@@ -807,7 +807,7 @@ class PiecewiseConstantPlot(PlotVelocity):mob.generate_target()mob.target.fade(0.7)- self.play(*map(MoveToTarget, faders))+ self.play(*list(map(MoveToTarget, faders)))self.play(ShowCreation(pw_constant_graph, run_time = 2))self.wait()self.play(ShowCreation(line))@@ -864,7 +864,7 @@ class PiecewiseConstantPlot(PlotVelocity):),Animation(right_brace))- self.play(*map(FadeOut, [top_brace, right_brace]))+ self.play(*list(map(FadeOut, [top_brace, right_brace])))self.wait()self.rects = rects@@ -1020,10 +1020,10 @@ class PiecewiseConstantPlot(PlotVelocity):rate_func = there_and_back)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [group[1]for group in (v_lines, h_lines, height_labels)- ]))+ ])))self.play(v_lines[0].set_color, RED,rate_func = there_and_back,@@ -1050,11 +1050,11 @@ class PiecewiseConstantPlot(PlotVelocity):ShowCreation(arrow))self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [area, arrow,v_lines[0], h_lines[0], height_labels[0],rect, t_labels- ]))+ ])))def show_v_dt_for_all_rectangles(self):dt_brace_group = VGroup(self.dt_brace, self.dt_label)@@ -1096,7 +1096,7 @@ class PiecewiseConstantPlot(PlotVelocity):)integral.to_corner(UP+RIGHT)int_copy = integral.get_part_by_tex("int").copy()- bounds = map(integral.get_part_by_tex, ["0", "8"])+ bounds = list(map(integral.get_part_by_tex, ["0", "8"]))sum_word = TextMobject("``Sum''")sum_word.next_to(integral, DOWN, MED_LARGE_BUFF, LEFT)@@ -1187,9 +1187,9 @@ class PiecewiseConstantPlot(PlotVelocity):self.play(morty.change_mode, "pondering",rects.set_fill, None, 0.75,- *map(FadeOut, [+ *list(map(FadeOut, [dt_copy, self.v_t, self.v_t_brace- ])+ ])))rects.align_submobjects(next_rects)for every_other_rect in rects[::2]:@@ -1262,10 +1262,10 @@ class PiecewiseConstantPlot(PlotVelocity):self.wait()self.play(RemovePiCreatureBubble(morty, target_mode = "plain"),- *map(FadeOut, [+ *list(map(FadeOut, [cross, self.sum_word, self.ticks,self.dt_brace, self.dt_label,- ])+ ])))self.play(FadeIn(brace), FadeIn(dt_to_0))for new_rects in self.rect_list[4:]:@@ -1616,7 +1616,7 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene):self.change_area_bounds(new_t_max = new_T)self.play(FadeIn(dark_area),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))self.play(FadeOut(self.T_label_group),@@ -1750,7 +1750,7 @@ class AreaIsDerivative(PlotVelocity, ReconfigurableScene):self.play(UpdateFromAlphaFunc(group, update_group),- *map(Animation, self.foreground_mobjects),+ *list(map(Animation, self.foreground_mobjects)),**kwargs)@@ -1814,7 +1814,7 @@ class FindAntiderivative(Antiderivative):derivative, antiderivative = words = self.get_arc_labels(arcs)self.add(functions)- self.play(*map(ShowCreation, arcs))+ self.play(*list(map(ShowCreation, arcs)))for word in words:self.play(FadeIn(word, submobject_mode = "lagged_start"))self.wait()@@ -2122,7 +2122,7 @@ class LowerBound(AreaIsDerivative):big_brace = Brace(VGroup(at_T, at_zero))cancel_text = big_brace.get_text("Cancels when $T=0$")- self.play(*map(Write, [equals, at_T]))+ self.play(*list(map(Write, [equals, at_T])))self.play(GrowFromCenter(at_T.brace),Write(antideriv_text, run_time = 2)@@ -2157,10 +2157,10 @@ class LowerBound(AreaIsDerivative):Write(value_at_eight))self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [at_eight.brace, value_at_eight,at_zero.brace, happens_to_be_zero,- ]))+ ])))self.antideriv_diff = antideriv_diff@@ -2183,7 +2183,7 @@ class LowerBound(AreaIsDerivative):self.change_area_bounds(1, 7, run_time = 2)self.play(self.T_label_group[0].set_fill, None, 0,- *map(FadeIn, numbers)+ *list(map(FadeIn, numbers)))self.play(Transform(self.integral, new_integral),@@ -2340,8 +2340,8 @@ class FundamentalTheorem(GraphScene):for rect in rects])self.play(*it.chain(- map(GrowFromCenter, [f_brace, dx_brace]),- map(Write, [f_brace.label, dx_brace.label]),+ list(map(GrowFromCenter, [f_brace, dx_brace])),+ list(map(Write, [f_brace.label, dx_brace.label])),))self.wait()for i in range(start_rect_index+1, last_rect_index):@@ -2358,10 +2358,10 @@ class FundamentalTheorem(GraphScene):)self.wait()self.play(*it.chain(- map(FadeOut, [+ list(map(FadeOut, [f_brace, dx_brace,f_brace.label, dx_brace.label- ]),+ ])),[rects.set_fill, None, kwargs["fill_opacity"]]))@@ -2451,7 +2451,7 @@ class FundamentalTheorem(GraphScene):self.deriv.set_fill, None, 1,self.rhs.set_fill, None, 1,)- for label, line in reversed(zip(self.bound_labels, self.v_lines)):+ for label, line in reversed(list(zip(self.bound_labels, self.v_lines))):new_line = line.copy().set_color(YELLOW)label.save_state()self.play(label.set_color, YELLOW)@@ -2538,7 +2538,7 @@ class NegativeArea(GraphScene):ShowCreation(arrow))self.wait(2)- self.play(*map(FadeOut, [self.area, arrow]))+ self.play(*list(map(FadeOut, [self.area, arrow])))self.negative_area_words = words@@ -2649,9 +2649,9 @@ class NegativeArea(GraphScene):self.wait(2)self.play(*it.chain([FadeIn(r) for r in rects if r is not rect],- map(FadeOut, [+ list(map(FadeOut, [dt_brace, v_brace, dt_label, v_label- ])+ ]))))self.wait()for new_rects in rect_list[1:]:diff --git a/old_projects/eoc/chapter9.py b/old_projects/eoc/chapter9.pyindex 352941a15..4349123b5 100644--- a/old_projects/eoc/chapter9.py+++ b/old_projects/eoc/chapter9.py@@ -186,13 +186,13 @@ class LengthOfDayGraph(GraphScene):"x_max" : 365,"x_axis_width" : 12,"x_tick_frequency" : 25,- "x_labeled_nums" : range(50, 365, 50),+ "x_labeled_nums" : list(range(50, 365, 50)),"x_axis_label" : "Days since March 21","y_min" : 0,"y_max" : 16,"y_axis_height" : 6,"y_tick_frequency" : 1,- "y_labeled_nums" : range(2, 15, 2),+ "y_labeled_nums" : list(range(2, 15, 2)),"y_axis_label" : "Hours of daylight","graph_origin" : 6*LEFT + 3*DOWN,"camera_class" : ThreeDCamera,@@ -286,7 +286,7 @@ class LengthOfDayGraph(GraphScene):for panel, a in zip(panels, np.linspace(0, 0.2, len(panels)))])self.play(Blink(randy))- self.play(*map(FadeOut, [randy, panels]))+ self.play(*list(map(FadeOut, [randy, panels])))def set_color_summer_months(self):summer_rect = Rectangle()@@ -387,7 +387,7 @@ class AverageOfFiniteSet(Scene):labels.generate_target()symbols.generate_target()symbols.target.set_fill(opacity = 1)- sum_eq = VGroup(*it.chain(*zip(labels.target, symbols.target)))+ sum_eq = VGroup(*it.chain(*list(zip(labels.target, symbols.target))))sum_eq.arrange_submobjects(RIGHT)sum_eq.next_to(brace, UP)@@ -425,15 +425,15 @@ class AverageOfFiniteSet(Scene):self.wait()self.play(GrowFromCenter(brace),- *map(MoveToTarget, [lines, labels, symbols]),+ *list(map(MoveToTarget, [lines, labels, symbols])),run_time = 2)self.play(Write(sum_mob))self.wait()self.play(ShowCreation(dividing_lines, run_time = 2))self.play(*it.chain(- map(Write, averages),- map(GrowFromCenter, lower_braces)+ list(map(Write, averages)),+ list(map(GrowFromCenter, lower_braces))))self.play(ShowCreation(circle))self.wait(2)@@ -473,7 +473,7 @@ class TryToAddInfinitelyManyPoints(AverageOfSineStart):end_lines = VGroup(*v_lines.target[15:])plusses = VGroup(*[TexMobject("+") for x in start_lines])- sum_eq = VGroup(*it.chain(*zip(start_lines, plusses)))+ sum_eq = VGroup(*it.chain(*list(zip(start_lines, plusses))))sum_eq.add(*end_lines)sum_eq.arrange_submobjects(RIGHT)sum_eq.next_to(v_lines[0], UP, aligned_edge = LEFT)@@ -570,7 +570,7 @@ class FiniteSample(TryToAddInfinitelyManyPoints):TexMobject("+").scale(0.75)for l in v_lines])- numerator = VGroup(*it.chain(*zip(summed_v_lines, plusses)))+ numerator = VGroup(*it.chain(*list(zip(summed_v_lines, plusses))))for group in numerator, plusses:group.remove(plusses[-1])numerator.arrange_submobjects(@@ -731,8 +731,8 @@ class IntegralOfSine(FiniteSample):)for rect in rects],- map(GrowFromCenter, [side_brace, bottom_brace]),- map(Write, [sin_x, dx]),+ list(map(GrowFromCenter, [side_brace, bottom_brace])),+ list(map(Write, [sin_x, dx])),))self.wait()for i in range(start_index+1, end_index):@@ -748,7 +748,7 @@ class IntegralOfSine(FiniteSample):self.wait()self.play(rects.restore,- *map(FadeOut, [sin_x, dx, side_brace, bottom_brace])+ *list(map(FadeOut, [sin_x, dx, side_brace, bottom_brace])))self.rects = rects@@ -920,7 +920,7 @@ class IntegralOfSine(FiniteSample):MoveToTarget(integral, run_time = 2))self.wait(2)- self.play(*map(FadeOut, [self.dx_label, self.dx_brace]))+ self.play(*list(map(FadeOut, [self.dx_label, self.dx_brace])))self.integral_over_pi = VGroup(integral, over_pi)self.average = average@@ -929,7 +929,7 @@ class IntegralOfSine(FiniteSample):def write_area_over_width(self):self.play(self.integral_over_pi.shift, 2*LEFT,- *map(FadeOut, [self.average, self.average_arrow])+ *list(map(FadeOut, [self.average, self.average_arrow])))average_height = TextMobject("Average height = ")@@ -942,7 +942,7 @@ class IntegralOfSine(FiniteSample):area_over_width.next_to(self.integral_over_pi[1][0], LEFT)average_height.next_to(area_over_width, LEFT)- self.play(*map(FadeIn, [average_height, area_over_width]))+ self.play(*list(map(FadeIn, [average_height, area_over_width])))self.wait()def show_moving_v_line(self):@@ -1109,7 +1109,7 @@ class Antiderivative(AverageOfSineStart):for m in faders])self.wait()- self.play(*map(ShowCreation, ss_group), run_time = 2)+ self.play(*list(map(ShowCreation, ss_group)), run_time = 2)kwargs = {"run_time" : 20,"rate_func" : quad_smooth,@@ -1128,7 +1128,7 @@ class Antiderivative(AverageOfSineStart):**kwargs)self.play(- *map(FadeOut, [ss_group, v_line, sin_copy])+ *list(map(FadeOut, [ss_group, v_line, sin_copy])))self.wait()@@ -1170,10 +1170,7 @@ class Antiderivative(AverageOfSineStart):self.wait()self.play(FadeIn(- VGroup(*filter(- lambda part : part not in [end_pi, end_zero],- rhs- )),+ VGroup(*[part for part in rhs if part not in [end_pi, end_zero]]),submobject_mode = "lagged_start",run_time = 2,))@@ -1294,7 +1291,7 @@ class Antiderivative(AverageOfSineStart):self.play(equals.next_to, frac_lines[0].copy(), RIGHT,rhs_without_eq.next_to, frac_lines[1].copy(), UP,- *map(Write, frac_lines)+ *list(map(Write, frac_lines)))self.play(*[ReplacementTransform(@@ -1411,7 +1408,7 @@ class Antiderivative(AverageOfSineStart):secant_line_length = 4,)- self.play(*map(ShowCreation, ss_group), run_time = 2)+ self.play(*list(map(ShowCreation, ss_group)), run_time = 2)for count in range(2):for x in reversed(self.bounds):self.animate_secant_slope_group_change(@@ -1448,7 +1445,7 @@ class GeneralAverage(AverageOfContinuousVariable):])for line, color in zip(v_lines, self.bound_colors):line.set_color(color)- labels = map(TexMobject, "ab")+ labels = list(map(TexMobject, "ab"))for line, label in zip(v_lines, labels):vect = line.get_start()-line.get_end()label.next_to(line, vect/np.linalg.norm(vect))@@ -1629,7 +1626,7 @@ class GeneralAverage(AverageOfContinuousVariable):self.play(ShowCreation(v_lines, run_time = 2))- self.play(*map(Write, [brace, dx]))+ self.play(*list(map(Write, [brace, dx])))self.wait()self.play(Write(VGroup(num_samples, approx, *rhs[:-1])))self.play(ReplacementTransform(@@ -1686,9 +1683,9 @@ class GeneralAverage(AverageOfContinuousVariable):VGroup(add_up_f_over, rhs_copy).shift, 0.4*DOWN)self.play(Write(double_arrow))- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [dx, brace, num_samples, approx, rhs- ]))+ ])))self.wait()self.v_lines = v_lines@@ -1922,7 +1919,7 @@ class GeneralAntiderivative(GeneralAverage):secant_line_length = 2,)- self.play(*map(ShowCreation, ss_group))+ self.play(*list(map(ShowCreation, ss_group)))for x in range(2):for bound in reversed(self.bounds):self.animate_secant_slope_group_change(@@ -1999,7 +1996,7 @@ class ASecondIntegralSensation(TeacherStudentsScene):ShowCreation(line),run_time = 2)- self.play(*map(FadeOut, [arrow]))+ self.play(*list(map(FadeOut, [arrow])))self.wait(2)self.change_student_modes(*["pondering"]*3,diff --git a/old_projects/eoc/footnote.py b/old_projects/eoc/footnote.pyindex 9f1b0b83d..b4c2c454c 100644--- a/old_projects/eoc/footnote.py+++ b/old_projects/eoc/footnote.py@@ -113,7 +113,7 @@ class SecondDerivativeGraphically(GraphScene):self.play(Write(deriv),- *map(ShowCreation, ss_group)+ *list(map(ShowCreation, ss_group)))self.animate_secant_slope_group_change(ss_group, target_x = self.x3,@@ -208,7 +208,7 @@ class SecondDerivativeGraphically(GraphScene):added_anims = [Animation(positive_curve)])- self.play(*map(FadeOut, [self.ss_group, positive_curve]))+ self.play(*list(map(FadeOut, [self.ss_group, positive_curve])))self.animate_secant_slope_group_change(self.ss_group, target_x = self.x1,run_time = 0@@ -225,10 +225,10 @@ class SecondDerivativeGraphically(GraphScene):added_anims = [Animation(negative_curve)])self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.graph, self.ss_group,negative_curve, self.second_deriv_words- ]))+ ])))def contrast_big_and_small_concavity(self):colors = color_gradient([GREEN, WHITE], 3)@@ -315,9 +315,9 @@ class IntroduceNotation(TeacherStudentsScene):rp = clunky_deriv.get_part_by_tex("(")lp = clunky_deriv.get_part_by_tex(")")- dfs, overs, dxs = map(clunky_deriv.get_parts_by_tex, [+ dfs, overs, dxs = list(map(clunky_deriv.get_parts_by_tex, ["df", "over", "dx"- ])+ ]))df_over_dx = VGroup(dfs[0], overs[0], dxs[0])d = clunky_deriv.get_part_by_tex("d")d_over_dx = VGroup(d, overs[1], dxs[1])@@ -566,7 +566,7 @@ class HowToReadNotation(GraphScene, ReconfigurableScene):ddf.set_color(MAROON_B)self.play(- *map(MoveToTarget, [df_dx_groups, df_labels]),+ *list(map(MoveToTarget, [df_dx_groups, df_labels])),run_time = 2)self.play(ShowCreation(h_lines, run_time = 2))@@ -797,7 +797,7 @@ class SecondDerivativeAsAcceleration(Scene):s_graph.scale, 0.3,s_graph.next_to, s_words, LEFT)- self.play(*map(FadeIn, [v_graph, v_words]) )+ self.play(*list(map(FadeIn, [v_graph, v_words])) )self.wait(2)self.play(v_graph.scale, 0.3,@@ -827,7 +827,7 @@ class SecondDerivativeAsAcceleration(Scene):self.play(a_graph.scale, 0.3,a_graph.next_to, self.a_words, LEFT,- *map(FadeOut, [positive_rect, negative_rect])+ *list(map(FadeOut, [positive_rect, negative_rect])))self.play(FadeOut(self.car),diff --git a/old_projects/eoc/old_chapter1.py b/old_projects/eoc/old_chapter1.pyindex efd8c134c..2c593564d 100644--- a/old_projects/eoc/old_chapter1.py+++ b/old_projects/eoc/old_chapter1.py@@ -364,9 +364,9 @@ class IntroduceCircle(Scene):radius.set_color(MAROON_B)R = TexMobject("R").next_to(radius, UP)- area, circumference = words = VGroup(*map(TextMobject, [+ area, circumference = words = VGroup(*list(map(TextMobject, ["Area =", "Circumference ="- ]))+ ])))area.set_color(BLUE)circumference.set_color(YELLOW)@@ -696,7 +696,7 @@ class IntroduceTinyChangeInArea(CircleScene):expanded.shift(LEFT/2.)faders = [area_brace, area_word, new_area_brace, new_area_word]- self.play(*map(FadeOut, faders))+ self.play(*list(map(FadeOut, faders)))trips = [([0, 2, 8], pi_R_squared, plus),([8, 0, 2, 1, 4, 5, 6, 7], two_pi_R_dR, plus2),@@ -824,13 +824,13 @@ class BuildToDADR(CircleScene):)self.wait()self.play(*it.chain(- map(Write, [equals, two_pi_R, dR]),- map(FadeIn, [circum_text, circum_brace])+ list(map(Write, [equals, two_pi_R, dR])),+ list(map(FadeIn, [circum_text, circum_brace]))))self.wait()self.play(*it.chain(- map(Write, [plus, pi, dR2, squared]),- map(FadeIn, [error_brace, error_text])+ list(map(Write, [plus, pi, dR2, squared])),+ list(map(FadeIn, [error_brace, error_text]))))self.wait(2)self.change = change@@ -860,7 +860,7 @@ class BuildToDADR(CircleScene):self.play(*it.chain([Write(term.frac_line) for term in terms],- map(MoveToTarget, [self.equals, self.plus])+ list(map(MoveToTarget, [self.equals, self.plus]))))self.play(*[term.denom.restore for term in terms])self.wait(2)@@ -945,9 +945,9 @@ class BuildToDADR(CircleScene):error_brace.target = Brace(self.error_term.target)error_text.target = error_brace.target.get_text("Truly tiny")error_text.target.set_color(error_text.get_color())- self.play(*map(MoveToTarget, [+ self.play(*list(map(MoveToTarget, [error_brace, error_text, self.plus, self.error_term- ]))+ ])))self.wait()difference_text = TextMobject(@@ -985,7 +985,7 @@ class BuildToDADR(CircleScene):MoveToTarget(difference_arrow),)self.wait(2)- self.play(*map(FadeOut, [difference_text, difference_arrow]))+ self.play(*list(map(FadeOut, [difference_text, difference_arrow])))def elaborate_on_d(self):arc = Arc(-np.pi, start_angle = -np.pi/2)@@ -1022,7 +1022,7 @@ class BuildToDADR(CircleScene):Write(d),self.pi_creature.change_mode, "speaking")- self.play(*map(Write, [arrow, ignore_error]))+ self.play(*list(map(Write, [arrow, ignore_error])))self.play(error_group.fade, 0.8)self.wait(2)equality_brace = Brace(VGroup(self.change.denom, self.circum_term))@@ -1033,7 +1033,7 @@ class BuildToDADR(CircleScene):Write(equal_word, run_time = 1))self.wait(2)- self.play(*map(FadeOut, [equality_brace, equal_word]))+ self.play(*list(map(FadeOut, [equality_brace, equal_word])))less_wrong_philosophy = TextMobject("``Less wrong'' philosophy")less_wrong_philosophy.move_to(ignore_error, LEFT)@@ -1106,7 +1106,7 @@ class BuildToDADR(CircleScene):self.wait()self.play(*it.chain([mob.restore for mob in to_infs],- map(FadeOut, [bubble, bubble.content]),+ list(map(FadeOut, [bubble, bubble.content])),[randy.change_mode, "erm"],[self.pi_creature.change_mode, "happy"],))@@ -1465,10 +1465,10 @@ class DerivativeAsTangentLine(ZoomedScene):dot.scale(0.1)dot.move_to(graph_point)- self.play(*map(FadeIn, [+ self.play(*list(map(FadeIn, [self.little_rectangle,self.big_rectangle- ]))+ ])))self.play(self.little_rectangle.move_to,graph_point+self.little_rect_nudge@@ -1556,7 +1556,7 @@ class DerivativeAsTangentLine(ZoomedScene):self.note_R_value_of_point()alphas = np.arange(0, 1, 0.01)- graph_points = map(self.graph.point_from_proportion, alphas)+ graph_points = list(map(self.graph.point_from_proportion, alphas))curr_graph_point = self.graph_point(R)self.last_alpha = alphas[np.argmin([np.linalg.norm(point - curr_graph_point)@@ -1600,7 +1600,7 @@ class DerivativeAsTangentLine(ZoomedScene):self.play(ShowCreation(arrow))self.play(dot.scale_in_place, 2, rate_func = there_and_back)self.wait()- self.play(*map(FadeOut, [dashed_line, dot, arrow]))+ self.play(*list(map(FadeOut, [dashed_line, dot, arrow])))def state_commonality(self):morty = Mortimer()@@ -1731,10 +1731,10 @@ class IntroduceConcentricRings(CircleScene):moving_rings.generate_target()moving_rings.target.set_stroke(width = 0)plusses = VGroup(*[TexMobject("+") for ring in moving_rings])- area_sum = VGroup(*it.chain(*zip(+ area_sum = VGroup(*it.chain(*list(zip([ring for ring in moving_rings.target],plusses- )))+ ))))dots_equals_area = TexMobject("\\dots", "=", "\\pi R^2")area_sum.add(*dots_equals_area)area_sum.arrange_submobjects()@@ -2028,13 +2028,13 @@ class GraphIntegral(GraphScene):"x_max" : 4,"x_tick_frequency" : 0.25,"x_leftmost_tick" : -0.25,- "x_labeled_nums" : range(1, 5),+ "x_labeled_nums" : list(range(1, 5)),"x_axis_label" : "r","y_min" : -2,"y_max" : 25,"y_tick_frequency" : 2.5,"y_bottom_tick" : 0,- "y_labeled_nums" : range(5, 30, 5),+ "y_labeled_nums" : list(range(5, 30, 5)),"y_axis_label" : "","dr" : 0.125,"R" : 3.5,@@ -2122,7 +2122,7 @@ class GraphIntegral(GraphScene):rectangles.save_state()rectangles.stretch_to_fit_height(0)rectangles.move_to(self.graph_origin, DOWN+LEFT)- self.play(*map(FadeOut, [arrows, values_words]))+ self.play(*list(map(FadeOut, [arrows, values_words])))self.play(rectangles.restore,Animation(ticks),@@ -2158,7 +2158,7 @@ class GraphIntegral(GraphScene):ShowCreation(graph))self.wait(3)- self.play(*map(FadeOut, [ticks, dr_brace, dr_text]))+ self.play(*list(map(FadeOut, [ticks, dr_brace, dr_text])))self.rectangles = rectanglesdef thinner_rectangles(self):diff --git a/old_projects/eola/chapter0.py b/old_projects/eola/chapter0.pyindex 0c2b1767e..354e159db 100644--- a/old_projects/eola/chapter0.py+++ b/old_projects/eola/chapter0.py@@ -92,14 +92,14 @@ class AboutLinearAlgebra(Scene):def show_dependencies(self):linalg = TextMobject("Linear Algebra")- subjects = map(TextMobject, [+ subjects = list(map(TextMobject, ["Computer science","Physics","Electrical engineering","Mechanical engineering","Statistics","\\vdots"- ])+ ]))prev = subjects[0]for subject in subjects[1:]:subject.next_to(prev, DOWN, aligned_edge = LEFT)@@ -132,7 +132,7 @@ class AboutLinearAlgebra(Scene):new_linalg = bubble.position_mobject_inside(linalg.copy())q_marks = TextMobject("???").next_to(randy, UP)- self.play(*map(FadeOut, all_else))+ self.play(*list(map(FadeOut, all_else)))self.remove(*all_else)self.play(Transform(linalg, new_linalg),@@ -813,7 +813,7 @@ class TableOfContents(Scene):h_line = Line(FRAME_X_RADIUS*LEFT, FRAME_X_RADIUS*RIGHT)h_line.next_to(title, DOWN)h_line.to_edge(LEFT, buff = 0)- chapters = VMobject(*map(TextMobject, [+ chapters = VMobject(*list(map(TextMobject, ["Chapter 1: Vectors, what even are they?","Chapter 2: Linear combinations, span and bases","Chapter 3: Matrices as linear transformations",@@ -824,7 +824,7 @@ class TableOfContents(Scene):"Chapter 8: Change of basis","Chapter 9: Eigenvectors and eigenvalues","Chapter 10: Abstract vector spaces",- ]))+ ])))chapters.arrange_submobjects(DOWN)chapters.scale(0.7)chapters.next_to(h_line, DOWN)@@ -930,11 +930,11 @@ class AboutPacing(Scene):class DifferingBackgrounds(Scene):def construct(self):- words = map(TextMobject, [+ words = list(map(TextMobject, ["Just brushing up","Has yet to take the course","Supplementing course concurrently",- ])+ ]))students = VMobject(*[Randolph(color = c)for c in (BLUE_D, BLUE_C, BLUE_E)diff --git a/old_projects/eola/chapter1.py b/old_projects/eola/chapter1.pyindex 564098873..128e47ec1 100644--- a/old_projects/eola/chapter1.py+++ b/old_projects/eola/chapter1.py@@ -183,11 +183,11 @@ class DifferentConceptions(Scene):title = TextMobject("Vectors $\\Leftrightarrow$ lists of numbers")title.to_edge(UP)- vectors = VMobject(*map(matrix_to_mobject, [+ vectors = VMobject(*list(map(matrix_to_mobject, [[2, 1],[5, 0, 0, -3],[2.3, -7.1, 0.1],- ]))+ ])))vectors.arrange_submobjects(RIGHT, buff = 1)vectors.to_edge(LEFT)@@ -445,9 +445,9 @@ class HowIWantYouToThinkAboutVectors(Scene):vector = Vector([-2, 3])plane = NumberPlane()axis_labels = plane.get_axis_labels()- other_vectors = VMobject(*map(Vector, [+ other_vectors = VMobject(*list(map(Vector, [[1, 2], [2, -1], [4, 0]- ]))+ ])))colors = [GREEN_B, MAROON_B, PINK]for v, color in zip(other_vectors.split(), colors):v.set_color(color)@@ -512,9 +512,9 @@ class HowIWantYouToThinkAboutVectors(Scene):class ListsOfNumbersAddOn(Scene):def construct(self):- arrays = VMobject(*map(matrix_to_mobject, [+ arrays = VMobject(*list(map(matrix_to_mobject, [[-2, 3], [1, 2], [2, -1], [4, 0]- ]))+ ])))arrays.arrange_submobjects(buff = 0.4)arrays.scale(2)self.play(Write(arrays))@@ -537,10 +537,7 @@ class CoordinateSystemWalkthrough(VectorScene):y_tick_marks = x_tick_marks.copy().rotate(np.pi/2)tick_marks = VMobject(x_tick_marks, y_tick_marks)tick_marks.set_color(WHITE)- plane_lines = filter(- lambda m : isinstance(m, Line),- plane.submobject_family()- )+ plane_lines = [m for m in plane.submobject_family() if isinstance(m, Line)]origin_words = TextMobject("Origin")origin_words.shift(2*UP+2*LEFT)dot = Dot(radius = 0.1).set_color(RED)@@ -576,7 +573,7 @@ class CoordinateSystemWalkthrough(VectorScene):self.wait(2)self.remove(unit_brace, one)self.play(- *map(GrowFromCenter, plane_lines) + [+ *list(map(GrowFromCenter, plane_lines)) + [Animation(x_axis), Animation(y_axis)])self.wait()@@ -748,7 +745,7 @@ class AddingNumbersOnNumberLine(Scene):seven_vect.shift(0.5*DOWN)vects = [two_vect, five_vect, seven_vect]- two, five, seven = map(TexMobject, ["2", "5", "7"])+ two, five, seven = list(map(TexMobject, ["2", "5", "7"]))two.next_to(two_vect, UP)five.next_to(five_vect, UP)seven.next_to(seven_vect, DOWN)@@ -864,9 +861,9 @@ class VectorAdditionNumerically(VectorScene):self.wait(2)starters = [x1, y1, x2, y2, sum_x_start, sum_y_start]- variables = map(TexMobject, [+ variables = list(map(TexMobject, ["x_1", "y_1", "x_2", "y_2", "x_1+y_1", "x_2+y_2"- ])+ ]))for i, (var, starter) in enumerate(zip(variables, starters)):if i%2 == 0:var.set_color(X_COLOR)@@ -896,7 +893,7 @@ class MultiplicationByANumberIntro(Scene):def construct(self):v = TexMobject("\\vec{\\textbf{v}}")v.set_color(YELLOW)- nums = map(TexMobject, ["2", "\\dfrac{1}{3}", "-1.8"])+ nums = list(map(TexMobject, ["2", "\\dfrac{1}{3}", "-1.8"]))for mob in [v] + nums:mob.scale(1.5)@@ -975,9 +972,9 @@ class ShowScalarMultiplication(VectorScene):original_v = v.copy()scaling_word = TextMobject("``Scaling''").to_corner(UP+LEFT)scaling_word.shift(2*RIGHT)- scalars = VMobject(*map(TexMobject, [+ scalars = VMobject(*list(map(TexMobject, ["2,", "\\dfrac{1}{3},", "-1.8,", "\\dots"- ]))+ ])))scalars.arrange_submobjects(RIGHT, buff = 0.4)scalars.next_to(scaling_word, DOWN, aligned_edge = LEFT)scalars_word = TextMobject("``Scalars''")@@ -1024,8 +1021,8 @@ class ScalingNumerically(VectorScene):x, y = v_coords.get_mob_matrix().flatten()two_v_elems = two_v_coords.get_mob_matrix().flatten()- x_sym, y_sym = map(TexMobject, ["x", "y"])- two_x_sym, two_y_sym = map(TexMobject, ["2x", "2y"])+ x_sym, y_sym = list(map(TexMobject, ["x", "y"]))+ two_x_sym, two_y_sym = list(map(TexMobject, ["2x", "2y"]))VMobject(x_sym, two_x_sym).set_color(X_COLOR)VMobject(y_sym, two_y_sym).set_color(Y_COLOR)syms = [x_sym, y_sym, two_x_sym, two_y_sym]@@ -1171,7 +1168,7 @@ class DataAnalyst(Scene):string_vects = string_vects_matrix.get_mob_matrix().flatten()string_vects = VMobject(*string_vects)- vects = VMobject(*map(Vector, ellipse_points))+ vects = VMobject(*list(map(Vector, ellipse_points)))self.play(Write(string_vects))self.wait(2)diff --git a/old_projects/eola/chapter10.py b/old_projects/eola/chapter10.pyindex a7c4a0ea8..e7cb25bd4 100644--- a/old_projects/eola/chapter10.py+++ b/old_projects/eola/chapter10.py@@ -132,7 +132,7 @@ class ManyPrerequisites(Scene):self.play(Write(rects[0]))self.wait()- self.play(*map(FadeIn, rects[1:]))+ self.play(*list(map(FadeIn, rects[1:])))self.wait()class ExampleTranformationScene(LinearTransformationScene):@@ -308,7 +308,7 @@ class AllXAxisVectorsAreEigenvectors(ExampleTranformationScene):def construct(self):vectors = VGroup(*[self.add_vector(u*x*RIGHT, animate = False)- for x in reversed(range(1, int(FRAME_X_RADIUS)+1))+ for x in reversed(list(range(1, int(FRAME_X_RADIUS)+1)))for u in -1, 1])vectors.set_color_by_gradient(YELLOW, X_COLOR)@@ -465,8 +465,8 @@ class NameEigenvectorsAndEigenvalues(ExampleTranformationScene):path_arc = 0,)self.wait(2)- self.play(*map(FadeOut, [non_eigen, non_eigen_span]))- self.play(*map(MoveToTarget, [x_words, sneak_words]))+ self.play(*list(map(FadeOut, [non_eigen, non_eigen_span])))+ self.play(*list(map(MoveToTarget, [x_words, sneak_words])))self.wait()for words in x_words, sneak_words:self.play(Write(words.eigen_val_words), run_time = 2)@@ -591,23 +591,23 @@ class ContrastMatrixUnderstandingWithEigenvalue(TeacherStudentsScene):everyone = self.get_pi_creatures()self.play(Write(axis_and_rotation),- *it.chain(*zip(+ *it.chain(*list(zip([pi.change_mode for pi in everyone],["hooray"]*4,[pi.look_at for pi in everyone],[axis_and_rotation]*4,- )),+ ))),run_time = 2)self.random_blink(2)self.play(Transform(axis_and_rotation, matrix),- *it.chain(*zip(+ *it.chain(*list(zip([pi.change_mode for pi in everyone],["confused"]*4,[pi.look_at for pi in everyone],[matrix]*4,- ))+ ))))self.random_blink(3)@@ -704,11 +704,11 @@ class SymbolicEigenvectors(Scene):Write(lamb_text))self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [A_brace, A_text,lamb_brace, lamb_text,v_text, v_arrows- ]))+ ])))def contrast_multiplication_types(self):A, v1, equals, lamb, v2 = self.expression@@ -756,11 +756,11 @@ class SymbolicEigenvectors(Scene):)self.play(Blink(morty))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [left_group.brace, left_group.text,right_group.brace, right_group.text,morty, bubble, solve_text- ]))+ ])))def rewrite_righthand_side(self):A, v1, equals, lamb, v2 = self.expression@@ -848,12 +848,12 @@ class SymbolicEigenvectors(Scene):).arrange_submobjects().next_to(equals).shift(SMALL_BUFF*UP)self.play(Write(parens),- *map(MoveToTarget, [lamb, id_text, v2])+ *list(map(MoveToTarget, [lamb, id_text, v2])))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [corner_group, id_brace, id_text_copy, new_lamb- ]))+ ])))self.expression = VGroup(A, v1, equals,VGroup(l_paren, lamb, id_text, r_paren),@@ -878,7 +878,7 @@ class SymbolicEigenvectors(Scene):self.play(Write(zero),Write(minus),- *map(MoveToTarget, movers),+ *list(map(MoveToTarget, movers)),path_arc = np.pi/3)self.wait()@@ -1299,12 +1299,12 @@ class RevisitExampleTransformation(ExampleTranformationScene):rect.target = BackgroundRectangle(VGroup(l_bracket.target, r_bracket.target))- result = map(MoveToTarget, movers)- result += map(Write, [minus1, minus2])- result += map(Animation, [+ result = list(map(MoveToTarget, movers))+ result += list(map(Write, [minus1, minus2]))+ result += list(map(Animation, [self.matrix.get_mob_matrix()[i, 1-i]for i in range(2)- ])+ ]))self.diag_entries = [VGroup(three, minus1, lamb),VGroup(two, minus2, lamb_copy),@@ -1385,8 +1385,8 @@ class RevisitExampleTransformation(ExampleTranformationScene):)self.wait()self.play(*it.chain(- map(MoveToTarget, [brace, brace_text]),- map(FadeOut, [one, zero, minus, cdot, new_rect])+ list(map(MoveToTarget, [brace, brace_text])),+ list(map(FadeOut, [one, zero, minus, cdot, new_rect]))))self.wait()self.play(Write(equals_0))@@ -1404,7 +1404,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):if to_fade is not None:faders.append(to_fade)self.play(*it.chain(- map(FadeOut, faders),+ list(map(FadeOut, faders)),[lambda_equals_two.scale_in_place, 1.3,lambda_equals_two.next_to, self.matrix, DOWN@@ -1423,7 +1423,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):self.play(Transform(lamb, two))self.play(*it.chain([mob.restore for mob in (self.plane, self.i_hat, self.j_hat)],- map(Animation, self.foreground_mobjects),+ list(map(Animation, self.foreground_mobjects)),))xy_array = Matrix(["x", "y"])@@ -1436,7 +1436,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):equals = TexMobject("=").next_to(xy_array)equals.add_background_rectangle()zero_array.next_to(equals)- self.play(*map(Write, [xy_array, equals, zero_array]))+ self.play(*list(map(Write, [xy_array, equals, zero_array])))self.wait()vectors = VGroup(*[@@ -1452,7 +1452,7 @@ class RevisitExampleTransformation(ExampleTranformationScene):submobject_mode = "lagged_start",run_time = 2),- *map(Animation, self.foreground_mobjects)+ *list(map(Animation, self.foreground_mobjects)))self.wait()self.apply_transposed_matrix(@@ -1461,8 +1461,8 @@ class RevisitExampleTransformation(ExampleTranformationScene):self.wait()self.play(*it.chain([mob.restore for mob in (self.plane, self.i_hat, self.j_hat, vectors)],- map(FadeOut, [xy_array, equals, zero_array]),- map(Animation, self.foreground_mobjects)+ list(map(FadeOut, [xy_array, equals, zero_array])),+ list(map(Animation, self.foreground_mobjects))))def show_unaltered_transform(self):@@ -1480,8 +1480,8 @@ class RevisitExampleTransformation(ExampleTranformationScene):self.lambda_equals_two.target = brace_textmovers.append(self.lambda_equals_two)self.play(*it.chain(- map(MoveToTarget, movers),- map(FadeOut, faders),+ list(map(MoveToTarget, movers)),+ list(map(FadeOut, faders)),[GrowFromCenter(brace)]))VGroup(*faders).set_fill(opacity = 0)@@ -1550,7 +1550,7 @@ class SolveRotationEigenvalues(Rotate90Degrees):det_text = get_det_text(self.matrix)equals = TexMobject("=").next_to(det_text)- self.play(*map(Write, [det_text, equals]))+ self.play(*list(map(Write, [det_text, equals])))self.wait()minus = TexMobject("-")for entries, sym in (diag_entries, equals), (off_diag_entries, minus):@@ -1721,9 +1721,9 @@ class ShearExample(RevisitExampleTransformation):Write(brace_text))self.wait()- self.play(* map(FadeOut, [+ self.play(* list(map(FadeOut, [one, zero, minus, cdot, new_rect, brace, brace_text- ]))+ ])))self.wait()self.play(Write(equals_0))self.wait()@@ -1782,11 +1782,11 @@ class ScalingExample(LinearTransformationScene):class IntroduceEigenbasis(TeacherStudentsScene):def construct(self):- words1, words2 = map(TextMobject, [+ words1, words2 = list(map(TextMobject, ["Finish with ``eigenbasis.''","""Make sure you'vewatched the last video"""- ])+ ]))words1.set_color(YELLOW)self.teacher_says(words1)self.change_student_modes(@@ -1845,7 +1845,7 @@ class BasisVectorsAreEigenvectors(LinearTransformationScene):for array in matrix, i_coords, j_coords:array.rect = BackgroundRectangle(array)array.add_to_back(array.rect)- self.play(*map(Write, [i_coords, j_coords]))+ self.play(*list(map(Write, [i_coords, j_coords])))self.wait()self.play(Transform(i_coords.rect, matrix.rect),@@ -1945,11 +1945,11 @@ class RepeatedMultiplicationInAction(Scene):]), LEFT)self.add(vector)- self.play(*map(FadeIn, [matrix]+scalars))+ self.play(*list(map(FadeIn, [matrix]+scalars)))self.wait()self.play(FadeOut(matrix),- *map(MoveToTarget, scalars + [l_bracket])+ *list(map(MoveToTarget, scalars + [l_bracket])))self.wait()#nth multiplications@@ -1977,11 +1977,11 @@ class RepeatedMultiplicationInAction(Scene):]), LEFT)movers.append(l_bracket)- self.play(*map(FadeIn, [matrix]+new_scalars))+ self.play(*list(map(FadeIn, [matrix]+new_scalars)))self.wait()self.play(FadeOut(matrix),- *map(MoveToTarget, movers)+ *list(map(MoveToTarget, movers)))self.remove(*to_remove)self.wait()@@ -2048,8 +2048,8 @@ class RepeatedMultilpicationOfMatrices(Scene):).next_to(vector, LEFT)self.play(*it.chain(- map(FadeOut, [brace, brace_text[1]] + list(matrices[:-1])),- map(MoveToTarget, [hundred, hundred_copy, last_matrix])+ list(map(FadeOut, [brace, brace_text[1]] + list(matrices[:-1]))),+ list(map(MoveToTarget, [hundred, hundred_copy, last_matrix]))), run_time = 2)self.wait()else:@@ -2216,7 +2216,7 @@ class ChangeToEigenBasis(ExampleTranformationScene):)self.wait()self.add_foreground_mobject(cob_matrix, inv_cob, neg_1)- self.play(*map(FadeOut, self.to_fade))+ self.play(*list(map(FadeOut, self.to_fade)))self.wait()self.play(FadeOut(self.plane))cob_transform = self.get_matrix_transformation([[1, 0], [-1, 1]])@@ -2225,7 +2225,7 @@ class ChangeToEigenBasis(ExampleTranformationScene):self.plane.axes.set_color(WHITE)self.play(FadeIn(self.plane),- *map(Animation, self.foreground_mobjects+self.moving_vectors)+ *list(map(Animation, self.foreground_mobjects+self.moving_vectors)))self.add(self.plane.copy().set_color(GREY).set_stroke(width = 2))self.apply_transposed_matrix(self.t_matrix)diff --git a/old_projects/eola/chapter11.py b/old_projects/eola/chapter11.pyindex 85d16dff5..0e2f66336 100644--- a/old_projects/eola/chapter11.py+++ b/old_projects/eola/chapter11.py@@ -122,7 +122,7 @@ class WhatIsA2DVector(LinearTransformationScene):student.bubble = get_small_bubble(student, height = 4, width = 4,)- self.play(*map(FadeIn, students))+ self.play(*list(map(FadeIn, students)))self.play(Blink(physics_student))self.wait()for student, vect in zip(students, [RIGHT, LEFT]):@@ -171,16 +171,16 @@ class WhatIsA2DVector(LinearTransformationScene):self.play(Blink(student))self.wait()self.play(*it.chain(- map(FadeOut, everything + [+ list(map(FadeOut, everything + [physics_student.bubble,physics_student.v,physics_student.coords,physics_student.arrow,physics_student.q_marks,cs_student.q_marks,- ]),+ ])),[ApplyMethod(s.change_mode, "plain") for s in students],- map(Animation, [cs_student.bubble, cs_student.arrow]),+ list(map(Animation, [cs_student.bubble, cs_student.arrow])),[mob.restore for mob in (cs_student.v, cs_student.coords)],))bubble = cs_student.get_bubble(SpeechBubble, width = 4, height = 3)@@ -197,18 +197,18 @@ class WhatIsA2DVector(LinearTransformationScene):class HigherDimensionalVectorsNumerically(Scene):def construct(self):- words = VGroup(*map(TextMobject, [+ words = VGroup(*list(map(TextMobject, ["4D vector","5D vector","100D vector",- ]))+ ])))words.arrange_submobjects(RIGHT, buff = LARGE_BUFF*2)words.to_edge(UP)- vectors = VGroup(*map(Matrix, [+ vectors = VGroup(*list(map(Matrix, [[3, 1, 4, 1],[5, 9, 2, 6, 5],[3, 5, 8, "\\vdots", 0, 8, 6]- ]))+ ])))colors = [YELLOW, MAROON_B, GREEN]for word, vector, color in zip(words, vectors, colors):vector.shift(word.get_center()[0]*RIGHT)@@ -255,7 +255,7 @@ class HyperCube(VMobject):"dims" : 4,}def generate_points(self):- corners = np.array(map(np.array, it.product(*[(-1, 1)]*self.dims)))+ corners = np.array(list(map(np.array, it.product(*[(-1, 1)]*self.dims))))def project(four_d_array):result = four_d_array[:3]w = four_d_array[self.dims-1]@@ -345,15 +345,15 @@ class ManyCoordinateSystems(LinearTransformationScene):for t_matrix in t_matrices:self.animate_coordinates()self.play(*it.chain(- map(FadeOut, movers),- map(Animation, self.foreground_mobjects)+ list(map(FadeOut, movers)),+ list(map(Animation, self.foreground_mobjects))))for mover in movers:mover.restore()self.apply_transposed_matrix(t_matrix, run_time = 0)self.play(*it.chain(- map(FadeIn, movers),- map(Animation, self.foreground_mobjects)+ list(map(FadeIn, movers)),+ list(map(Animation, self.foreground_mobjects))))self.animate_coordinates()@@ -367,7 +367,7 @@ class ManyCoordinateSystems(LinearTransformationScene):]).Tinv_cob = np.linalg.inv(cob_matrix)coords = np.dot(inv_cob, self.v_coords)- array = Matrix(map(DecimalNumber, coords))+ array = Matrix(list(map(DecimalNumber, coords)))array.get_entries()[0].set_color(X_COLOR)array.get_entries()[1].set_color(Y_COLOR)array.add_to_back(BackgroundRectangle(array))@@ -386,14 +386,14 @@ class ManyCoordinateSystems(LinearTransformationScene):self.play(Write(array, run_time = 1))self.wait()- self.play(*map(MoveToTarget, [self.i_hat, coord1]))- self.play(*map(MoveToTarget, [self.j_hat, coord2]))+ self.play(*list(map(MoveToTarget, [self.i_hat, coord1])))+ self.play(*list(map(MoveToTarget, [self.j_hat, coord2])))self.play(VGroup(self.j_hat, coord2).shift, self.i_hat.get_end())self.wait(2)self.play(self.i_hat.restore,self.j_hat.restore,- *map(FadeOut, [array, coord1, coord2])+ *list(map(FadeOut, [array, coord1, coord2])))class DeterminantAndEigenvectorDontCare(LinearTransformationScene):@@ -479,13 +479,13 @@ class DeterminantAndEigenvectorDontCare(LinearTransformationScene):if cob_matrix is not None:self.play(FadeOut(self.plane),- *map(Animation, non_plane_mobs)+ *list(map(Animation, non_plane_mobs)))transform = self.get_matrix_transformation(cob_matrix)self.plane.apply_function(transform)self.play(FadeIn(self.plane),- *map(Animation, non_plane_mobs)+ *list(map(Animation, non_plane_mobs)))self.wait()self.apply_transposed_matrix(@@ -675,7 +675,7 @@ class AddTwoFunctions(FunctionGraphScene):self.wait()for lines in f_lines, g_lines:self.add_lines(lines)- self.play(*map(FadeOut, [f_graph, g_graph]))+ self.play(*list(map(FadeOut, [f_graph, g_graph])))self.wait()self.play(FadeOut(brace))fg_group = VGroup(*list(f_label)+list(g_label))@@ -860,7 +860,7 @@ class ShowSlopes(Animation):def update_mobject(self, alpha):f = self.graph.point_from_proportion- low, high = map(f, np.clip([alpha-self.dx, alpha+self.dx], 0, 1))+ low, high = list(map(f, np.clip([alpha-self.dx, alpha+self.dx], 0, 1)))slope = (high[1]-low[1])/(high[0]-low[0])self.mobject.restore()self.mobject.rotate(np.arctan(slope))@@ -974,7 +974,7 @@ class FromVectorsToFunctions(VectorScene):self.play(MoveToTarget(func_tex),- *map(Write, [L, lp, rp, equals, new_func])+ *list(map(Write, [L, lp, rp, equals, new_func])))self.remove(func_tex)self.add(func_tex.target)@@ -1188,19 +1188,19 @@ class FormalDefinitionOfLinear(LinearTransformationScene):rhs.next_to(vw_label, RIGHT)rect = BackgroundRectangle(rhs)self.play(*it.chain(- map(Write, [rect, equals, plus]),- map(MoveToTarget, [v_label_copy, w_label_copy]),+ list(map(Write, [rect, equals, plus])),+ list(map(MoveToTarget, [v_label_copy, w_label_copy])),))to_fade = [self.plane, v, v_label, w_group, vw_label, vw_sum]to_fade += self.get_mobjects_from_last_animation()self.wait()self.play(*it.chain(- map(FadeOut, to_fade),- map(Animation, self.foreground_mobjects)+ list(map(FadeOut, to_fade)),+ list(map(Animation, self.foreground_mobjects))))self.plane.restore()- self.play(FadeIn(self.plane), *map(Animation, self.foreground_mobjects))+ self.play(FadeIn(self.plane), *list(map(Animation, self.foreground_mobjects)))self.transformable_mobjects = []self.moving_vectors = []self.transformable_labels = []@@ -1257,7 +1257,7 @@ class FormalDefinitionOfLinear(LinearTransformationScene):scaled_v_label, scaled_v, v_copy,v, rhs] + self.transformable_labels + self.moving_vectors- self.play(*map(FadeOut, faders))+ self.play(*list(map(FadeOut, faders)))def add_words(self):randy = Randolph().shift(LEFT).to_edge(DOWN)@@ -1416,12 +1416,12 @@ class ProposeDerivativeAsMatrix(TeacherStudentsScene):class PolynomialsHaveArbitrarilyLargeDegree(Scene):def construct(self):- polys = VGroup(*map(TexMobject, [+ polys = VGroup(*list(map(TexMobject, ["x^{300} + 9x^2","4x^{4{,}000{,}000{,}000} + 1","3x^{\\left(10^{100}\\right)}","\\vdots"- ]))+ ])))polys.set_color_by_gradient(BLUE_B, BLUE_D)polys.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)polys.scale(1.3)@@ -1569,7 +1569,7 @@ class IntroducePolynomialSpace(Scene):Write(brace.text),*[ApplyMethod(self.poly1[index].set_color, color)- for index, color in index_to_color.items()+ for index, color in list(index_to_color.items())])self.wait()@@ -1674,7 +1674,7 @@ class IntroducePolynomialSpace(Scene):))self.wait()- self.play(*map(FadeOut, [self.poly1]+more_terms))+ self.play(*list(map(FadeOut, [self.poly1]+more_terms)))self.poly2.next_to(equals, LEFT)self.poly2.shift(MED_SMALL_BUFF*UP)self.poly2.set_color(WHITE)@@ -1699,7 +1699,7 @@ class IntroducePolynomialSpace(Scene):self.remove(*self.get_mobjects_from_last_animation())self.add(self.poly2)self.wait()- self.play(*map(FadeOut, [self.poly2, coords, equals]))+ self.play(*list(map(FadeOut, [self.poly2, coords, equals])))def derivative_as_matrix(self):matrix = Matrix([@@ -1754,7 +1754,7 @@ class IntroducePolynomialSpace(Scene):deriv.target.shift(0.25*RIGHT)self.play(FadeOut(equals),- *map(MoveToTarget, [matrix, deriv])+ *list(map(MoveToTarget, [matrix, deriv])))poly = TexMobject(@@ -1795,7 +1795,7 @@ class IntroducePolynomialSpace(Scene):poly_result.next_to(eq1)brace = Brace(poly_result, buff = 0)- self.play(*map(Write, [eq1, eq2, brace]))+ self.play(*list(map(Write, [eq1, eq2, brace])))result_coefs = VGroup(*np.array(poly_result)[[6, 3, 0]])VGroup(*poly_result[0:2]).set_color(MAROON_B)@@ -1836,14 +1836,14 @@ class IntroducePolynomialSpace(Scene):vert_rect.replace(array.get_entries(), stretch = True)vert_rect.stretch_in_place(1.1, 1)vert_rect.stretch_in_place(1.5, 0)- tuples = zip(+ tuples = list(zip(relevant_entries,diag_entries,result_entries,rects,result_terms,coefs[1:]- )+ ))self.play(Write(result_array.get_brackets()))for entry, diag_entry, result_entry, rect, result_term, coef in tuples:self.play(FadeIn(rect), FadeIn(vert_rect))@@ -1864,7 +1864,7 @@ class IntroducePolynomialSpace(Scene):self.play(Transform(coef.copy(), VGroup(result_term)))self.wait()self.play(FadeOut(rect), FadeOut(vert_rect))- self.play(*map(Write, result_array.get_entries()[3:]))+ self.play(*list(map(Write, result_array.get_entries()[3:])))self.wait()class MatrixVectorMultiplicationAndDerivative(TeacherStudentsScene):@@ -1925,19 +1925,19 @@ class CompareTermsInLinearAlgebraToFunction(Scene):VGroup(h_line, v_line).set_color(BLUE)self.add(l_title, r_title)- self.play(*map(ShowCreation, [h_line, v_line]))+ self.play(*list(map(ShowCreation, [h_line, v_line])))self.wait()- lin_alg_concepts = VGroup(*map(TextMobject, [+ lin_alg_concepts = VGroup(*list(map(TextMobject, ["Linear transformations","Dot products","Eigenvectors",- ]))- function_concepts = VGroup(*map(TextMobject, [+ ])))+ function_concepts = VGroup(*list(map(TextMobject, ["Linear operators","Inner products","Eigenfunctions",- ]))+ ])))for concepts, vect in (lin_alg_concepts, LEFT), (function_concepts, RIGHT):concepts.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF, aligned_edge = LEFT)concepts.next_to(h_line, DOWN, buff = LARGE_BUFF)@@ -2100,13 +2100,13 @@ class ShowVectorSpaces(Scene):class ToolsOfLinearAlgebra(Scene):def construct(self):- words = VGroup(*map(TextMobject, [+ words = VGroup(*list(map(TextMobject, ["Linear transformations","Null space","Eigenvectors","Dot products","$\\vdots$"- ]))+ ])))words.arrange_submobjects(DOWN, aligned_edge = LEFT, buff = MED_SMALL_BUFF)words[-1].next_to(words[-2], DOWN)self.play(FadeIn(@@ -2373,8 +2373,8 @@ class VectorSpaceOfPiCreatures(Scene):self.play(FadeOut(creatures))self.play(*it.chain(- map(MoveToTarget, [pi1, pi2, pi3]),- map(Write, [plus, equals, two, equals2]),+ list(map(MoveToTarget, [pi1, pi2, pi3])),+ list(map(Write, [plus, equals, two, equals2])),))self.play(Transform(pi1.copy(), sum_pi),diff --git a/old_projects/eola/chapter2.py b/old_projects/eola/chapter2.pyindex 086cbd964..a8069ac51 100644--- a/old_projects/eola/chapter2.py+++ b/old_projects/eola/chapter2.py@@ -655,13 +655,13 @@ class VectorsToDotsScene(VectorScene):return Dot(vector.get_end(), fill_color = vector.get_stroke_color())self.wait()vectors.remove(prototype_vector)- self.play(*map(FadeOut, vectors)+[Animation(prototype_vector)])+ self.play(*list(map(FadeOut, vectors))+[Animation(prototype_vector)])self.remove(vector_group)self.add(prototype_vector)self.wait()self.play(Transform(prototype_vector, v_to_dot(prototype_vector)))self.wait()- self.play(*map(FadeIn, vectors) + [Animation(prototype_vector)])+ self.play(*list(map(FadeIn, vectors)) + [Animation(prototype_vector)])rate_functions = [squish_rate_func(smooth, float(x)/(len(vectors)+2), 1)for x in range(len(vectors))diff --git a/old_projects/eola/chapter3.py b/old_projects/eola/chapter3.pyindex 6f9aa949b..786d39a51 100644--- a/old_projects/eola/chapter3.py+++ b/old_projects/eola/chapter3.py@@ -98,7 +98,7 @@ class DescribeTransformation(Scene):f_of_x = TexMobject("f(x)")L_of_v = TexMobject("L(\\vec{\\textbf{v}})")nums = [5, 2, -3]- num_inputs = VMobject(*map(TexMobject, map(str, nums)))+ num_inputs = VMobject(*list(map(TexMobject, list(map(str, nums)))))num_outputs = VMobject(*[TexMobject(str(num**2))for num in nums@@ -594,7 +594,7 @@ class FollowIHatJHat(LinearTransformationScene):)self.wait()- self.play(*map(FadeOut, [i_label, j_label]))+ self.play(*list(map(FadeOut, [i_label, j_label])))self.apply_transposed_matrix([[-1, 1], [-2, -1]])self.wait()@@ -951,9 +951,9 @@ class MatrixVectorMultiplication(LinearTransformationScene):ShowCreation(j_arrow))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [i_message, i_circle, i_arrow, j_message, j_circle, j_arrow- ]))+ ])))def multiply_by_vector(self, matrix):@@ -1009,8 +1009,8 @@ class MatrixVectorMultiplication(LinearTransformationScene):else:row1 = ["3", "(5)", "+", "2", "(7)"]row2 = ["-2", "(5)", "+", "1", "(7)"]- row1 = VMobject(*map(TexMobject, row1))- row2 = VMobject(*map(TexMobject, row2))+ row1 = VMobject(*list(map(TexMobject, row1)))+ row2 = VMobject(*list(map(TexMobject, row2)))for row in row1, row2:row.arrange_submobjects(RIGHT, buff = 0.1)final_sum = Matrix([row1, row2])@@ -1417,8 +1417,8 @@ class UsedToThinkinfOfFunctionsAsGraphs(VectorScene):self.wait()def show_inputs_and_output(self):- numbers = range(-3, 4)- inputs = VMobject(*map(TexMobject, map(str, numbers)))+ numbers = list(range(-3, 4))+ inputs = VMobject(*list(map(TexMobject, list(map(str, numbers)))))inputs.arrange_submobjects(DOWN, buff = 0.5, aligned_edge = RIGHT)arrows = VMobject(*[Arrow(LEFT, RIGHT).next_to(mob)diff --git a/old_projects/eola/chapter4.py b/old_projects/eola/chapter4.pyindex 4391265d6..c0d727c21 100644--- a/old_projects/eola/chapter4.py+++ b/old_projects/eola/chapter4.py@@ -167,9 +167,9 @@ class FollowLinearCombination(LinearTransformationScene):for mob in (scaled_j, scaled_j_label)])self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [scaled_i, scaled_j, scaled_i_label, scaled_j_label,- ]))+ ])))def record_basis_coordinates(self, vect_array, vect):i_label = vector_coordinate_label(self.i_hat)@@ -341,7 +341,7 @@ class IntroduceIdeaOfComposition(RotationThenShear):everything = list_difference_update(everything, matrix.submobject_family())- self.play(*map(FadeOut, everything) + [Animation(matrix)])+ self.play(*list(map(FadeOut, everything)) + [Animation(matrix)])new_matrix = matrix.copy()new_matrix.center().to_edge(UP)self.play(Transform(matrix, new_matrix))@@ -350,7 +350,7 @@ class IntroduceIdeaOfComposition(RotationThenShear):self.setup()everything = self.get_mobjects()- self.play(*map(FadeIn, everything) + [Animation(matrix)])+ self.play(*list(map(FadeIn, everything)) + [Animation(matrix)])func = self.get_matrix_transformation([[1, 1], [-1, 0]])bases = VMobject(self.i_hat, self.j_hat)new_bases = VMobject(*[@@ -382,7 +382,7 @@ class ExplainWhyItsMatrixMultiplication(Scene):rot_matrix.set_color(TEAL)shear_matrix = Matrix([[1, 1], [0, 1]])shear_matrix.set_color(PINK)- l_paren, r_paren = map(TexMobject, ["\\Big(", "\\Big)"])+ l_paren, r_paren = list(map(TexMobject, ["\\Big(", "\\Big)"]))for p in l_paren, r_paren:p.set_height(1.4*vect.get_height())long_way = VMobject(@@ -420,9 +420,9 @@ class ExplainWhyItsMatrixMultiplication(Scene):[equals, comp_matrix, vect_copy],]for group in groups:- self.play(*map(Write, group))+ self.play(*list(map(Write, group)))self.wait()- self.play(*map(FadeOut, [l_paren, r_paren, vect, vect_copy]))+ self.play(*list(map(FadeOut, [l_paren, r_paren, vect, vect_copy])))comp_matrix.add(equals)matrices = VMobject(shear_matrix, rot_matrix, comp_matrix)self.play(ApplyMethod(@@ -486,12 +486,12 @@ class MoreComplicatedExampleVisually(LinearTransformationScene):self.play(Write(comp_matrix))self.add_foreground_mobject(comp_matrix)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.background_plane,self.plane,self.i_hat,self.j_hat,- ]) + [+ ])) + [Animation(m) for m in self.foreground_mobjects])self.remove(self.i_hat, self.j_hat)@@ -615,7 +615,7 @@ class MoreComplicatedExampleNumerically(MoreComplicatedExampleVisually):Transform(question, second),)self.wait()- self.play(*map(FadeOut, [question, first_arrow]))+ self.play(*list(map(FadeOut, [question, first_arrow])))self.play(Write(intermediate))self.wait()self.play(Write(product))@@ -639,9 +639,9 @@ class MoreComplicatedExampleNumerically(MoreComplicatedExampleVisually):class GeneralMultiplication(MoreComplicatedExampleNumerically):def get_result(self):- entries = map(TexMobject, [+ entries = list(map(TexMobject, ["ae+bg", "af+bh", "ce+dg", "cf+dh"- ])+ ]))for mob in entries:mob.split()[0].set_color(PINK)mob.split()[3].set_color(PINK)@@ -749,7 +749,7 @@ class AskAboutCommutativity(Scene):neq = TexMobject("\\neq")neq.move_to(eq)- self.play(*map(Write, [l_m1, l_m2, eq]))+ self.play(*list(map(Write, [l_m1, l_m2, eq])))self.play(Transform(l_m1.copy(), r_m1),Transform(l_m2.copy(), r_m2),@@ -902,10 +902,10 @@ class AskAssociativityQuestion(Scene):everything.remove(title)everything = VMobject(*everything)- matrices = map(matrix_to_mobject, [+ matrices = list(map(matrix_to_mobject, [np.array(list(m)).reshape((2, 2))for m in ("abcd", "efgh", "ijkl")- ])+ ]))VMobject(*matrices).arrange_submobjects()self.play(everything.to_edge, UP)diff --git a/old_projects/eola/chapter5.py b/old_projects/eola/chapter5.pyindex 9906c2fa2..a79c481ec 100644--- a/old_projects/eola/chapter5.py+++ b/old_projects/eola/chapter5.py@@ -21,13 +21,10 @@ class Blob(Circle):def probably_contains(self, point):border_points = np.array(self.get_anchors_and_handles()[0])- distances = map(lambda p : np.linalg.norm(p-point), border_points)+ distances = [np.linalg.norm(p-point) for p in border_points]min3 = border_points[np.argsort(distances)[:3]]center_direction = self.get_center() - point- in_center_direction = map(- lambda p : np.dot(p-point, center_direction) > 0,- min3- )+ in_center_direction = [np.dot(p-point, center_direction) > 0 for p in min3]return sum(in_center_direction) <= 2class RightHand(VMobject):@@ -184,7 +181,7 @@ class DiagonalExample(LinearTransformationScene):width_target, height_target = width.copy(), height.copy()det = np.linalg.det(self.transposed_matrix)- times, eq_det = map(TexMobject, ["\\times", "=%d"%det])+ times, eq_det = list(map(TexMobject, ["\\times", "=%d"%det]))words = TextMobject("New area $=$")equation = VMobject(words, width_target, times, height_target, eq_det@@ -198,7 +195,7 @@ class DiagonalExample(LinearTransformationScene):ShowCreation(background_rect),Transform(width.copy(), width_target),Transform(height.copy(), height_target),- *map(Write, [words, times, eq_det])+ *list(map(Write, [words, times, eq_det])))self.wait()@@ -918,7 +915,7 @@ class TwoDDeterminantFormulaIntuition(LinearTransformationScene):])self.wait()- self.play(*map(FadeOut, [i_brace, side_brace, width, height]))+ self.play(*list(map(FadeOut, [i_brace, side_brace, width, height])))matrix1 = np.dot([[a, b], [c, d]],np.linalg.inv([[a, b], [0, d]])diff --git a/old_projects/eola/chapter6.py b/old_projects/eola/chapter6.pyindex 7516ac139..58cfb3f80 100644--- a/old_projects/eola/chapter6.py+++ b/old_projects/eola/chapter6.py@@ -25,12 +25,12 @@ class ListTerms(Scene):title.set_color(YELLOW)title.to_edge(UP)randy = Randolph().to_corner()- words = VMobject(*map(TextMobject, [+ words = VMobject(*list(map(TextMobject, ["Inverse matrices","Column space","Rank","Null space",- ]))+ ])))words.arrange_submobjects(DOWN, aligned_edge = LEFT)words.next_to(title, DOWN, aligned_edge = LEFT)words.shift(RIGHT)@@ -243,17 +243,17 @@ class SystemOfEquations(Scene):[1, 3, 0]])mob_matrix = matrix.get_mob_matrix()- rhs = map(TexMobject, map(str, [-3, 0, 2]))- variables = map(TexMobject, list("xyz"))+ rhs = list(map(TexMobject, list(map(str, [-3, 0, 2]))))+ variables = list(map(TexMobject, list("xyz")))for v, color in zip(variables, [X_COLOR, Y_COLOR, Z_COLOR]):v.set_color(color)equations = VMobject()for row in mob_matrix:- equation = VMobject(*it.chain(*zip(+ equation = VMobject(*it.chain(*list(zip(row,[v.copy() for v in variables],- map(TexMobject, list("++="))- )))+ list(map(TexMobject, list("++=")))+ ))))equation.arrange_submobjects(RIGHT, buff = 0.1,aligned_edge = DOWN@@ -342,7 +342,7 @@ class SystemOfEquations(Scene):for mob in sine, product:self.play(Transform(squared, mob))draw_circle_slash(mob)- self.play(*map(FadeOut, [words, arrow, squared]))+ self.play(*list(map(FadeOut, [words, arrow, squared])))self.wait()@@ -393,13 +393,13 @@ class SystemOfEquations(Scene):FadeIn(mob.words))self.wait()- self.play(*map(FadeOut, [mob.square, mob.words]))+ self.play(*list(map(FadeOut, [mob.square, mob.words])))self.play(ShowCreation(zero_circles),Write(zero_circles.words, run_time = 1))self.wait()- self.play(*map(FadeOut, [zero_circles, zero_circles.words]))+ self.play(*list(map(FadeOut, [zero_circles, zero_circles.words])))self.wait()title = TextMobject("``Linear system of equations''")title.scale(1.5)@@ -491,7 +491,7 @@ class SystemOfEquations(Scene):FadeIn(mob.words))self.wait()- self.play(*map(FadeOut, [mob.brace, mob.words]))+ self.play(*list(map(FadeOut, [mob.brace, mob.words])))self.wait()for mob in parts:self.play(@@ -678,7 +678,7 @@ class ShowBijectivity(LinearTransformationScene):"submobject_mode" : "lagged_start","run_time" : 2}- anims = map(Animation, self.foreground_mobjects)+ anims = list(map(Animation, self.foreground_mobjects))self.play(ShowCreation(vectors, **kwargs), *anims)self.play(Transform(vectors, dots, **kwargs), *anims)self.wait()@@ -1092,7 +1092,7 @@ class InvertNonInvertable(LinearTransformationScene):self.add_foreground_mobject(no_func)self.play(grid.restore,- *map(Animation, self.foreground_mobjects),+ *list(map(Animation, self.foreground_mobjects)),run_time = 3)self.wait()@@ -1122,7 +1122,7 @@ class OneInputMultipleOutputs(InvertNonInvertable):*[Transform(output_vector.copy(), input_vector)for input_vector in input_vectors.split()- ] + map(Animation, self.foreground_mobjects),+ ] + list(map(Animation, self.foreground_mobjects)),run_time = 3)multiple_outputs = TextMobject(@@ -1204,7 +1204,7 @@ class DefineRank(Scene):self.play(Write(rank))self.play(ShowCreation(arrow),- *map(Write, dims)+ *list(map(Write, dims)))self.wait()@@ -1364,7 +1364,7 @@ class NameColumnSpace(Scene):matrix.set_color_columns(X_COLOR, Y_COLOR, Z_COLOR)matrix.to_corner(UP+LEFT)cols = list(matrix.copy().get_mob_matrix().T)- col_arrays = map(Matrix, cols)+ col_arrays = list(map(Matrix, cols))span_text = TexMobject("\\text{Span}",@@ -1406,7 +1406,7 @@ class NameColumnSpace(Scene):])self.play(Write(span_text),- *map(Animation, self.get_mobjects_from_last_animation())+ *list(map(Animation, self.get_mobjects_from_last_animation())))self.play(ShowCreation(arrow),@@ -1496,7 +1496,7 @@ class NameColumnSpace(Scene):def replace_number_matrix(self, matrix, new_numbers):starters = matrix.flatten()- targets = map(TexMobject, map(str, np.array(new_numbers).flatten()))+ targets = list(map(TexMobject, list(map(str, np.array(new_numbers).flatten()))))for start, target in zip(starters, targets):target.move_to(start)target.set_color(start.get_color())@@ -1674,7 +1674,7 @@ class NameNullSpace(LinearTransformationScene):self.play(vectors.restore,self.plane.restore,- *map(Animation, self.foreground_mobjects),+ *list(map(Animation, self.foreground_mobjects)),run_time = 2)self.play(Transform(diff --git a/old_projects/eola/chapter7.py b/old_projects/eola/chapter7.pyindex 7bea8dcac..ef415e170 100644--- a/old_projects/eola/chapter7.py+++ b/old_projects/eola/chapter7.py@@ -57,13 +57,13 @@ class TraditionalOrdering(RandolphScene):title.set_color(YELLOW)title.scale(1.2)title.to_corner(UP+LEFT)- topics = VMobject(*map(TextMobject, [+ topics = VMobject(*list(map(TextMobject, ["Topic 1: Vectors","Topic 2: Dot products","\\vdots","(everything else)","\\vdots",- ]))+ ])))topics.arrange_submobjects(DOWN, aligned_edge = LEFT, buff = SMALL_BUFF)# topics.next_to(title, DOWN+RIGHT)@@ -162,7 +162,7 @@ class ShowNumericalDotProduct(Scene):dot_product = VGroup(v1, inter_array_dot, v2)dot_product.arrange_submobjects(RIGHT, buff = MED_SMALL_BUFF/2)dot_product.to_edge(LEFT)- pairs = zip(v1.get_entries(), v2.get_entries())+ pairs = list(zip(v1.get_entries(), v2.get_entries()))for pair, color in zip(pairs, [X_COLOR, Y_COLOR, Z_COLOR, PINK]):VGroup(*pair).set_color(color)@@ -180,10 +180,10 @@ class ShowNumericalDotProduct(Scene):products.target = products.copy()plusses = ["+"]*(len(self.v1)-1)- symbols = VGroup(*map(TexMobject, ["="] + plusses))- final_sum = VGroup(*it.chain(*zip(+ symbols = VGroup(*list(map(TexMobject, ["="] + plusses)))+ final_sum = VGroup(*it.chain(*list(zip(symbols, products.target- )))+ ))))final_sum.arrange_submobjects(RIGHT, buff = SMALL_BUFF)final_sum.next_to(dot_product, RIGHT)@@ -432,11 +432,11 @@ class ShowQualitativeDotProductValues(VectorScene):less_than = TexMobject("<").set_color(RED).move_to(comp)v_sym.set_color(V_COLOR)w_sym.set_color(W_COLOR)- words = map(TextMobject, [+ words = list(map(TextMobject, ["Similar directions","Perpendicular","Opposing directions"- ])+ ]))for word, sym in zip(words, [comp, equals, less_than]):word.add_background_rectangle()word.next_to(sym, DOWN, aligned_edge = LEFT, buff = MED_SMALL_BUFF)@@ -555,7 +555,7 @@ class SymmetricVAndW(VectorScene):)self.wait(0.5)self.remove(line_of_symmetry_words)- self.play(*map(Uncreate, line_of_symmetry_words))+ self.play(*list(map(Uncreate, line_of_symmetry_words)))for vect in w, v:self.play(ShowCreation(vect.proj_line))vect_copy = vect.copy()@@ -563,9 +563,9 @@ class SymmetricVAndW(VectorScene):self.remove(vect_copy)self.add(vect.proj)self.wait()- self.play(*map(FadeOut,[+ self.play(*list(map(FadeOut,[v.proj, v.proj_line, w.proj, w.proj_line- ]))+ ])))self.show_doubling(v, w)def show_doubling(self, v, w):@@ -639,9 +639,9 @@ class SymmetricVAndW(VectorScene):run_time = 2)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [projector.proj, projector.proj_line- ]))+ ])))class LurkingQuestion(TeacherStudentsScene):def construct(self):@@ -702,7 +702,7 @@ class Introduce2Dto1DLinearTransformations(TwoDToOneDScene):ShowCreation(number_line),*[Animation(v) for v in (self.i_hat, self.j_hat)])- self.play(*map(Write, [numbers, number_line_words]))+ self.play(*list(map(Write, [numbers, number_line_words])))self.wait()class Symbolic2To1DTransform(Scene):@@ -856,7 +856,7 @@ class FormalVsVisual(Scene):mob.next_to(text, DOWN, buff = MED_SMALL_BUFF)self.add(title)- self.play(*map(ShowCreation, [line, v_line]))+ self.play(*list(map(ShowCreation, [line, v_line])))for mob in formal, visual, additivity, scaling, visual_statement:self.play(Write(mob, run_time = 2))self.wait()@@ -1108,7 +1108,7 @@ class FollowVectorViaCoordinates(TwoDToOneDScene):basis_labels, array, [DOWN, RIGHT])- self.play(*map(Write, basis_labels))+ self.play(*list(map(Write, basis_labels)))self.play(ShowCreation(v),Write(array),@@ -1129,7 +1129,7 @@ class FollowVectorViaCoordinates(TwoDToOneDScene):])self.wait()self.play(- *map(FadeOut, to_fade) + [+ *list(map(FadeOut, to_fade)) + [vect.restorefor vect in (self.i_hat, self.j_hat)]@@ -1161,7 +1161,7 @@ class FollowVectorViaCoordinates(TwoDToOneDScene):for label, vect, direction in zip(new_labels, list(bases) + [v], [UP, DOWN, UP]):label.next_to(vect, direction)- self.play(*map(Write, new_labels))+ self.play(*list(map(Write, new_labels)))self.wait()scaling_anim_tuples = self.get_scaling_anim_tuples(new_labels, array, [UP, DOWN]@@ -1183,10 +1183,10 @@ class FollowVectorViaCoordinates(TwoDToOneDScene):def get_scaling_anim_tuples(self, labels, array, directions):scaling_anim_tuples = []bases = self.i_hat, self.j_hat- quints = zip(+ quints = list(zip(bases, self.v_coords, labels,array.get_entries(), directions- )+ ))for basis, scalar, label, entry, direction in quints:basis.save_state()basis.scaled = basis.copy().scale(scalar)@@ -1242,7 +1242,7 @@ class TwoDOneDMatrixMultiplication(Scene):self.show_product(matrix, vector)def show_product(self, matrix, vector):- starter_pairs = zip(vector.get_entries(), matrix.get_entries())+ starter_pairs = list(zip(vector.get_entries(), matrix.get_entries()))pairs = [VMobject(e1.copy(), TexMobject("\\cdot"), e2.copy()@@ -1251,8 +1251,8 @@ class TwoDOneDMatrixMultiplication(Scene):)for e1, e2 in starter_pairs]- symbols = map(TexMobject, ["=", "+"])- equation = VMobject(*it.chain(*zip(symbols, pairs)))+ symbols = list(map(TexMobject, ["=", "+"]))+ equation = VMobject(*it.chain(*list(zip(symbols, pairs))))equation.arrange_submobjects(align_using_submobjects = True)equation.next_to(vector, RIGHT)@@ -1288,8 +1288,8 @@ class AssociationBetweenMatricesAndVectors(Scene):matrices_words, arrow, vectors_words).arrange_submobjects(buff = MED_SMALL_BUFF)- matrices = VGroup(*map(Matrix, self.matrices))- vectors = VGroup(*map(Matrix, [m[0] for m in self.matrices]))+ matrices = VGroup(*list(map(Matrix, self.matrices)))+ vectors = VGroup(*list(map(Matrix, [m[0] for m in self.matrices])))for m in list(matrices) + list(vectors):x, y = m.get_entries()x.set_color(X_COLOR)@@ -1300,7 +1300,7 @@ class AssociationBetweenMatricesAndVectors(Scene):for m, direction in zip(group, [UP, DOWN]):m.next_to(group.words, direction, buff = MED_SMALL_BUFF)- self.play(*map(Write, [matrices_words, vectors_words]))+ self.play(*list(map(Write, [matrices_words, vectors_words])))self.play(ShowCreation(arrow))self.wait()self.play(FadeIn(vectors))@@ -1360,7 +1360,7 @@ class SomeKindOfConnection(Scene):number_line.to_edge(RIGHT)squish_plane.move_to(number_line)- numbers = number_line.get_numbers(*range(-6, 8, 2))+ numbers = number_line.get_numbers(*list(range(-6, 8, 2)))v_line = Line(UP, DOWN).scale(FRAME_Y_RADIUS)v_line.set_color(GREY)v_line.set_stroke(width = 10)@@ -1376,9 +1376,9 @@ class SomeKindOfConnection(Scene):array.add_to_back(BackgroundRectangle(array))- self.play(*map(ShowCreation, [+ self.play(*list(map(ShowCreation, [plane, number_line, v_line- ])+[+ ]))+[Write(numbers, run_time = 2)])self.play(Write(matrix, run_time = 1))@@ -1667,19 +1667,19 @@ class ProjectBasisVectors(ProjectOntoUnitVectorNumberline):i_label = TexMobject(i_tex[1:-1])j_label = TexMobject(j_tex[1:-1])u_label = TexMobject("\\hat{\\textbf{u}}")- trips = zip(+ trips = list(zip((i_label, j_label, u_label),(i_hat, j_hat, self.u_hat),(DOWN+RIGHT, UP+LEFT, UP),- )+ ))for label, vect, direction in trips:label.set_color(vect.get_color())label.scale(1.2)label.next_to(vect.get_end(), direction, buff = MED_SMALL_BUFF/2)self.play(Write(u_label, run_time = 1))- self.play(*map(ShowCreation, basis_vectors))- self.play(*map(Write, [i_label, j_label]), run_time = 1)+ self.play(*list(map(ShowCreation, basis_vectors)))+ self.play(*list(map(Write, [i_label, j_label])), run_time = 1)self.play(ShowCreation(proj_lines))self.play(Write(question),@@ -1688,12 +1688,12 @@ class ProjectBasisVectors(ProjectOntoUnitVectorNumberline):run_time = 2,)to_remove = [proj_lines]- quads = zip(basis_vectors, proj_basis, proj_lines, proj_dots)+ quads = list(zip(basis_vectors, proj_basis, proj_lines, proj_dots))for vect, proj_vect, proj_line, proj_dot in quads:self.play(Transform(vect.copy(), proj_vect))to_remove += self.get_mobjects_from_last_animation()self.wait()- self.play(*map(FadeOut, to_remove))+ self.play(*list(map(FadeOut, to_remove)))# self.show_u_coords(u_label)u_x, u_y = [@@ -1771,7 +1771,7 @@ class ProjectBasisVectors(ProjectOntoUnitVectorNumberline):for mob in self.get_mobjects()if mob not in starting_mobjects + [final_coord]]- self.play(*map(FadeOut, added_mobjects))+ self.play(*list(map(FadeOut, added_mobjects)))class ShowSingleProjection(ProjectBasisVectors):CONFIG = {@@ -1813,10 +1813,7 @@ class GeneralTwoDOneDMatrixMultiplication(TwoDOneDMatrixMultiplication):def construct(self):TwoDOneDMatrixMultiplication.construct(self)everything = VGroup(*self.get_mobjects())- to_fade = filter(- lambda m : isinstance(m, Brace) or isinstance(m, TextMobject),- everything- )+ to_fade = [m for m in everything if isinstance(m, Brace) or isinstance(m, TextMobject)]u = Matrix(self.matrix[0])v = Matrix(self.vector)@@ -1838,7 +1835,7 @@ class GeneralTwoDOneDMatrixMultiplication(TwoDOneDMatrixMultiplication):self.play(everything.to_corner, UP+RIGHT,- *map(FadeOut, to_fade)+ *list(map(FadeOut, to_fade)))self.remove(everything)self.add(*everything)@@ -1955,7 +1952,7 @@ class ScaleUpUHat(ProjectOntoUnitVectorNumberline) :v.label.add_background_rectangle()v.label.next_to(v.get_end(), direction)- self.play(*map(ShowCreation, bases))+ self.play(*list(map(ShowCreation, bases)))for b in bases:mover = b.copy()self.play(ShowCreation(b.proj_line))@@ -1967,11 +1964,11 @@ class ScaleUpUHat(ProjectOntoUnitVectorNumberline) :Transform(b.proj.label, b.scaled_proj.label))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [mobfor mob in self.get_mobjects()if mob not in start_state- ]))+ ])))def transform_some_vector(self):words = TextMobject(@@ -2048,7 +2045,7 @@ class TwoDOneDTransformationSeparateSpace(Scene):number_line.to_edge(RIGHT)squish_plane.move_to(number_line)- numbers = number_line.get_numbers(*range(-6, 8, 2))+ numbers = number_line.get_numbers(*list(range(-6, 8, 2)))v_line = Line(UP, DOWN).scale(FRAME_Y_RADIUS)v_line.set_color(GREY)v_line.set_stroke(width = 10)@@ -2077,9 +2074,9 @@ class TwoDOneDTransformationSeparateSpace(Scene):start_words.next_to(ORIGIN, RIGHT, buff = MED_SMALL_BUFF).to_edge(UP)end_words.next_to(ORIGIN, DOWN+LEFT, buff = MED_SMALL_BUFF/2)- self.play(*map(ShowCreation, [+ self.play(*list(map(ShowCreation, [plane, number_line, v_line- ])+[+ ]))+[Write(numbers, run_time = 2)])self.play(Write(start_words, run_time = 2))@@ -2236,7 +2233,7 @@ class WhatTheVectorWantsToBe(Scene):number_line.to_edge(RIGHT)squish_plane.move_to(number_line)- numbers = number_line.get_numbers(*range(-6, 8, 2))+ numbers = number_line.get_numbers(*list(range(-6, 8, 2)))v_line = Line(UP, DOWN).scale(FRAME_Y_RADIUS)v_line.set_color(GREY)v_line.set_stroke(width = 10)@@ -2269,13 +2266,13 @@ class WhatTheVectorWantsToBe(Scene):)self.play(Transform(plane.copy(), squish_plane, run_time = 3),- *map(Animation, [+ *list(map(Animation, [words,matrix,plane,vect,v_coords- ])+ ])))self.wait()diff --git a/old_projects/eola/chapter8.py b/old_projects/eola/chapter8.pyindex 01b861ecd..462e437d6 100644--- a/old_projects/eola/chapter8.py+++ b/old_projects/eola/chapter8.py@@ -137,7 +137,7 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene):self.square.apply_function(transform)self.play(ShowCreation(self.square),- *map(Animation, [self.v, self.w])+ *list(map(Animation, [self.v, self.w])))self.wait()self.play(FadeOut(self.square))@@ -148,10 +148,10 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene):self.wait()self.play(FadeIn(self.square),- *map(Animation, [self.v, self.w, v_copy, w_copy])+ *list(map(Animation, [self.v, self.w, v_copy, w_copy])))self.wait()- self.play(*map(FadeOut, [v_copy, w_copy]))+ self.play(*list(map(FadeOut, [v_copy, w_copy])))def write_area_words(self):times = TexMobject("\\times")@@ -240,7 +240,7 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene):self.area_words.target = self.area_words.copy()self.area_words.target.next_to(minus_sign, RIGHT)- self.play(*map(MoveToTarget, [square, self.v, self.w]))+ self.play(*list(map(MoveToTarget, [square, self.v, self.w])))arc = self.get_arc(self.v, self.w, radius = 1.5)arc.set_color(GREEN)self.play(ShowCreation(arc))@@ -262,7 +262,7 @@ class SimpleDefine2dCrossProduct(LinearTransformationScene):MoveToTarget(self.area_words))self.wait()- self.play(*map(FadeOut, [negative, negative.arrow, arc]))+ self.play(*list(map(FadeOut, [negative, negative.arrow, arc])))def swap_v_and_w(self):new_cross = self.cross.copy()@@ -445,17 +445,17 @@ class ContrastDotAndCross(Scene):[random.randint(0, 9) for in_count in range(dim)]for out_count in range(2)]- m1, m2 = map(Matrix, arrays)+ m1, m2 = list(map(Matrix, arrays))for matrix in m1, m2:for entry, color in zip(matrix.get_entries(), colors):entry.set_color(color)entry.target = entry.copy()- syms = VGroup(*map(TexMobject, ["="] + ["+"]*(dim-1)))+ syms = VGroup(*list(map(TexMobject, ["="] + ["+"]*(dim-1))))def get_dot():dot = TexMobject("\\cdot")syms.add(dot)return dot- result = VGroup(*it.chain(*zip(+ result = VGroup(*it.chain(*list(zip(syms,[VGroup(@@ -463,7 +463,7 @@ class ContrastDotAndCross(Scene):).arrange_submobjects()for e1, e2 in zip(m1.get_entries(), m2.get_entries())]- )))+ ))))result.arrange_submobjects(RIGHT)dot_prod = VGroup(m1, TexMobject("\\cdot"), m2, result@@ -500,7 +500,7 @@ class ContrastDotAndCross(Scene):[random.randint(0, 9) for in_count in range(3)]for out_count in range(2)]- matrices = map(Matrix, arrays)+ matrices = list(map(Matrix, arrays))for matrix in matrices:for entry, color in zip(matrix.get_entries(), colors):entry.set_color(color)@@ -511,7 +511,7 @@ class ContrastDotAndCross(Scene):index_to_cross_enty = {}syms = VGroup()movement_sets = []- for a, b, c in it.permutations(range(3)):+ for a, b, c in it.permutations(list(range(3))):e1, e2 = m1.get_entries()[b], m2.get_entries()[c]for e in e1, e2:e.target = e.copy()@@ -576,7 +576,7 @@ class ContrastDotAndCross(Scene):h_line.next_to(self.only_3d_text, DOWN, buff = MED_SMALL_BUFF/2)h_line.to_edge(RIGHT, buff = 0)arrays = np.random.randint(0, 9, (2, 2))- m1, m2 = matrices = map(Matrix, arrays)+ m1, m2 = matrices = list(map(Matrix, arrays))for m in matrices:for e, color in zip(m.get_entries(), [X_COLOR, Y_COLOR]):e.set_color(color)@@ -586,9 +586,9 @@ class ContrastDotAndCross(Scene):entries = [x1, x2, x3, x4]for entry in entries:entry.target = entry.copy()- eq, dot1, minus, dot2 = syms = map(TexMobject,+ eq, dot1, minus, dot2 = syms = list(map(TexMobject,["=", "\\cdot", "-", "\\cdot"]- )+ ))result = VGroup(eq, x1.target, dot1, x4.target,minus, x3.target, dot2, x2.target,@@ -748,7 +748,7 @@ class Define2dCrossProduct(LinearTransformationScene):everything.remove(self.plane)everything.remove(self.background_plane)self.play(- *map(FadeOut, everything) + [+ *list(map(FadeOut, everything)) + [Animation(self.background_plane),self.plane.restore,Animation(matrix),@@ -799,22 +799,22 @@ class Define2dCrossProduct(LinearTransformationScene):col2.set_color, Y_COLOR)self.wait()- self.play(*map(FadeOut, [i_words, i_words.arrow, basis_labels]))+ self.play(*list(map(FadeOut, [i_words, i_words.arrow, basis_labels])))self.add_vector(i_hat, animate = False)self.add_vector(j_hat, animate = False)- self.play(*map(FadeOut, [side_brace, transform_words]))+ self.play(*list(map(FadeOut, [side_brace, transform_words])))self.add_foreground_mobject(matrix)self.apply_transposed_matrix([self.v_coords, self.w_coords])self.wait()self.play(FadeOut(self.plane),- *map(Animation, [+ *list(map(Animation, [self.background_plane,matrix,i_hat,j_hat,- ])+ ])))self.play(ShowCreation(self.v),@@ -842,7 +842,7 @@ class Define2dCrossProduct(LinearTransformationScene):for mob in to_restore:mob.fade(1)- self.play(*map(FadeOut, vect_stuffs))+ self.play(*list(map(FadeOut, vect_stuffs)))self.play(*[m.restore for m in to_restore] + [Animation(self.matrix)@@ -858,7 +858,7 @@ class Define2dCrossProduct(LinearTransformationScene):self.play(FadeOut(self.plane),Animation(self.matrix),- *map(FadeIn, vect_stuffs)+ *list(map(FadeIn, vect_stuffs)))self.play(Write(self.cross_product))@@ -877,7 +877,7 @@ class Define2dCrossProduct(LinearTransformationScene):)self.wait()- pm = VGroup(*map(TexMobject, ["+", "-"]))+ pm = VGroup(*list(map(TexMobject, ["+", "-"])))pm.set_color_by_gradient(GREEN, RED)pm.arrange_submobjects(DOWN, buff = SMALL_BUFF)pm.add_to_back(BackgroundRectangle(pm))@@ -887,9 +887,9 @@ class Define2dCrossProduct(LinearTransformationScene):path_arc = -np.pi/2)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [area_arrow, self.v.coord_array, self.w.coord_array- ]))+ ])))def show_orientation_rule(self):self.remove(self.i_hat, self.j_hat)@@ -1045,7 +1045,7 @@ class TwoDCrossProductExample(Define2dCrossProduct):Transform(v.coords.get_brackets(), matrix.get_brackets()),Transform(w.coords.get_brackets(), matrix.get_brackets()),)- self.play(*map(Write, [det_text, cross_product]))+ self.play(*list(map(Write, [det_text, cross_product])))v1, v2 = v.coords.get_entries()@@ -1054,10 +1054,10 @@ class TwoDCrossProductExample(Define2dCrossProduct):for entry in entries:entry.target = entry.copy()det = np.linalg.det([self.v_coords, self.w_coords])- equals, dot1, minus, dot2, equals_result = syms = VGroup(*map(+ equals, dot1, minus, dot2, equals_result = syms = VGroup(*list(map(TexMobject,["=", "\\cdot", "-", "\\cdot", "=%d"%det]- ))+ )))equation_end = VGroup(equals, v1.target, dot1, w2.target,@@ -1101,7 +1101,7 @@ class TwoDCrossProductExample(Define2dCrossProduct):def show_transformation(self, v, w):i_hat, j_hat = self.get_basis_vectors()- self.play(*map(ShowCreation, [i_hat, j_hat]))+ self.play(*list(map(ShowCreation, [i_hat, j_hat])))self.add_unit_square(animate = True, opacity = 0.2)self.apply_transposed_matrix([v.get_end()[:2], w.get_end()[:2]],@@ -1172,7 +1172,7 @@ class BiggerWhenPerpendicular(LinearTransformationScene):self.play(FadeIn(group),ShowCreation(start_square),- *map(Animation, [v, w])+ *list(map(Animation, [v, w])))self.play(GrowFromCenter(bigger))self.wait()@@ -1239,7 +1239,7 @@ class ScalingRule(LinearTransformationScene):self.play(ShowCreation(w))self.play(ShowCreation(square),- *map(Animation, [v, w])+ *list(map(Animation, [v, w])))self.wait()self.play(@@ -1249,7 +1249,7 @@ class ScalingRule(LinearTransformationScene):self.wait()self.play(Transform(square, new_squares),- *map(Animation, [v, w]),+ *list(map(Animation, [v, w])),path_arc = -np.pi/6)self.wait()@@ -1384,7 +1384,7 @@ class ShowCrossProductFormula(Scene):["%s_%d"%(s, i) for i in range(1, 4)]for s in ("v", "w")]- matrices = map(Matrix, arrays)+ matrices = list(map(Matrix, arrays))for matrix in matrices:for entry, color in zip(matrix.get_entries(), colors):entry.set_color(color)@@ -1395,7 +1395,7 @@ class ShowCrossProductFormula(Scene):entry_dicts = [{} for x in range(3)]movement_sets = []- for a, b, c in it.permutations(range(3)):+ for a, b, c in it.permutations(list(range(3))):sign = get_perm_sign(a, b, c)e1, e2 = m1.get_entries()[b], m2.get_entries()[c]for e in e1, e2:@@ -1515,7 +1515,7 @@ class DeterminantTrick(Scene):for entry in col1:self.play(Write(entry))self.wait()- self.play(*map(Write, [equals, det_text]))+ self.play(*list(map(Write, [equals, det_text])))self.wait()disclaimer = TextMobject("$^*$ See ``Note on conventions'' in description")@@ -1563,7 +1563,7 @@ class DeterminantTrick(Scene):mob.save_state()basis = quint[0]basis.t.scale(1/0.8)- lp, minus, rp = syms = VGroup(*map(TexMobject, "(-)"))+ lp, minus, rp = syms = VGroup(*list(map(TexMobject, "(-)")))term = VGroup(basis.t, lp,quint[1].t, quint[2].t, minus,diff --git a/old_projects/eola/chapter8p2.py b/old_projects/eola/chapter8p2.pyindex 64a94edb0..fc2d9a871 100644--- a/old_projects/eola/chapter8p2.py+++ b/old_projects/eola/chapter8p2.py@@ -42,7 +42,7 @@ class CrossProductSymbols(Scene):vector_text = brace.get_text("Vector")vector_text.set_color(RED)self.add(equation)- self.play(*map(Write, [brace, vector_text]))+ self.play(*list(map(Write, [brace, vector_text])))self.wait()class DeterminantTrickCopy(DeterminantTrick):@@ -200,7 +200,7 @@ class DotProductToTransformSymbol(Scene):_input = Matrix(["x", "y"])_input.get_entries().set_color_by_gradient(X_COLOR, Y_COLOR)left_input, right_input = [_input.copy() for x in range(2)]- dot, equals = map(TexMobject, ["\\cdot", "="])+ dot, equals = list(map(TexMobject, ["\\cdot", "="]))equation = VGroup(vector, dot, left_input, equals,matrix, right_input@@ -338,7 +338,7 @@ class ThreeStepPlan(Scene):VGroup(linear, transformation),linear_transformation),- *map(FadeOut, steps)+ *list(map(FadeOut, steps)))self.wait()self.play(Write(left_right_arrow))@@ -382,7 +382,7 @@ class DefineDualTransform(Scene):def show_triple_cross_product(self):colors = [WHITE, ORANGE, W_COLOR]- tex_mobs = map(TexMobject, get_vect_tex(*"uvw"))+ tex_mobs = list(map(TexMobject, get_vect_tex(*"uvw")))u_tex, v_tex, w_tex = tex_mobsarrays = [Matrix(["%s_%d"%(s, d) for d in range(1, 4)])@@ -482,7 +482,7 @@ class DefineDualTransform(Scene):)self.wait()- x, y, z = variables = map(TexMobject, "xyz")+ x, y, z = variables = list(map(TexMobject, "xyz"))for var, entry in zip(variables, self.u_entries):var.scale(0.8)var.move_to(entry)@@ -540,7 +540,7 @@ class DefineDualTransform(Scene):def introduce_dual_vector(self):everything = VGroup(*self.get_mobjects())colors = [X_COLOR, Y_COLOR, Z_COLOR]- q_marks = VGroup(*map(TextMobject, "???"))+ q_marks = VGroup(*list(map(TextMobject, "???")))q_marks.scale(2)q_marks.set_color_by_gradient(*colors)@@ -596,16 +596,16 @@ class DefineDualTransform(Scene):ShowCreation(matrix_arrow))self.wait(2)- self.play(*map(FadeOut, [matrix_words, matrix_arrow]))+ self.play(*list(map(FadeOut, [matrix_words, matrix_arrow])))self.play(Transform(func, dual_vector),Write(dual_dot[1]))self.wait()- p_coords = VGroup(*map(TexMobject, [+ p_coords = VGroup(*list(map(TexMobject, ["p_%d"%d for d in range(1, 4)- ]))+ ])))p_coords.set_color(RED)p_array = Matrix(list(p_coords))p_array.set_height(dual_vector.get_height())@@ -690,13 +690,13 @@ class DefineDualTransform(Scene):sym_strings = ["(", "\\cdot", "-", "\\cdot", ")"]if i < 2:sym_strings[-1] += "+"- syms = map(TexMobject, sym_strings)+ syms = list(map(TexMobject, sym_strings))for mob, sym in zip(quint, syms):mob.target = mob.copy()mob.target.scale(1.5)mob.sym = symquint_targets = [mob.target for mob in quint]- component = VGroup(*it.chain(*zip(quint_targets, syms)))+ component = VGroup(*it.chain(*list(zip(quint_targets, syms))))component.arrange_submobjects()cross_components.add(component)to_fade.add(syms[0], syms[-1], quint[0])@@ -723,7 +723,7 @@ class DefineDualTransform(Scene):).next_to(cross_components, LEFT),new_ps),- *map(FadeOut, to_fade)+ *list(map(FadeOut, to_fade)))self.play(*[Write(TexMobject("=").next_to(p, buff = 2*SMALL_BUFF))diff --git a/old_projects/eola/chapter9.py b/old_projects/eola/chapter9.pyindex 3a29a7a1d..0f0e3ea0a 100644--- a/old_projects/eola/chapter9.py+++ b/old_projects/eola/chapter9.py@@ -92,7 +92,7 @@ class LinearCombinationScene(LinearTransformationScene):basis.save_state()basis.label.save_state()if coord_mobs is None:- coord_mobs = map(TexMobject, map(str, numerical_coords))+ coord_mobs = list(map(TexMobject, list(map(str, numerical_coords))))VGroup(*coord_mobs).set_fill(opacity = 0)for coord, basis in zip(coord_mobs, basis_vectors):coord.next_to(basis.label, LEFT)@@ -111,9 +111,9 @@ class LinearCombinationScene(LinearTransformationScene):)coord.target.next_to(basis.label.target, LEFT)coord.target.set_fill(basis.get_color(), opacity = 1)- self.play(*map(MoveToTarget, [+ self.play(*list(map(MoveToTarget, [coord, basis, basis.label- ]))+ ])))self.wait()self.play(*[ApplyMethod(m.shift, basis_vectors[0].get_end())@@ -164,7 +164,7 @@ class RemindOfCoordinates(LinearCombinationScene):)self.wait()self.wait()- self.play(*map(FadeOut, [x_coord, y_coord, x_line, y_line]))+ self.play(*list(map(FadeOut, [x_coord, y_coord, x_line, y_line])))def show_abstract_scalar_idea(self, x_coord, y_coord):@@ -191,7 +191,7 @@ class RemindOfCoordinates(LinearCombinationScene):y_coord.move_to, y_shift + 3*UP,Write(words))- self.play(*map(FadeIn, [self.i_hat, self.j_hat]))+ self.play(*list(map(FadeIn, [self.i_hat, self.j_hat])))self.wait()self.play(Transform(self.i_hat, scaled_i))self.play(Transform(self.j_hat, scaled_j))@@ -204,7 +204,7 @@ class RemindOfCoordinates(LinearCombinationScene):self.wait()def scale_basis_vectors(self, x_coord, y_coord):- self.play(*map(Write, [self.i_hat.label, self.j_hat.label]))+ self.play(*list(map(Write, [self.i_hat.label, self.j_hat.label])))self.show_linear_combination(self.vector_coords,basis_vectors = [self.i_hat, self.j_hat],@@ -423,13 +423,13 @@ class IntroduceJennifer(JenniferScene):self.play(ShowCreation(v))self.wait()self.play(*it.chain(- map(FadeIn, [+ list(map(FadeIn, [self.plane, self.i_hat, self.j_hat,self.i_hat.label, self.j_hat.label,you- ]),- map(Animation, [jenny, v]),- map(FadeOut, self.basis_vectors),+ ])),+ list(map(Animation, [jenny, v])),+ list(map(FadeOut, self.basis_vectors)),))self.play(ShowCreation(you.bubble),@@ -442,13 +442,13 @@ class IntroduceJennifer(JenniferScene):coord_mobs = you.coords.get_entries().copy(),)self.play(*it.chain(- map(FadeOut, [+ list(map(FadeOut, [self.plane, self.i_hat, self.j_hat,self.i_hat.label, self.j_hat.label,you.bubble, you.coords- ]),- map(FadeIn, [self.jenny_plane, self.basis_vectors]),- map(Animation, [v, you, jenny]),+ ])),+ list(map(FadeIn, [self.jenny_plane, self.basis_vectors])),+ list(map(Animation, [v, you, jenny])),))self.play(ShowCreation(jenny.bubble),@@ -500,9 +500,9 @@ class IntroduceJennifer(JenniferScene):)coord.target.next_to(basis.label.target, LEFT)coord.target.set_fill(basis.get_color(), opacity = 1)- self.play(*map(MoveToTarget, [+ self.play(*list(map(MoveToTarget, [coord, basis, basis.label- ]))+ ])))self.wait()self.play(*[ApplyMethod(m.shift, basis_vectors[0].get_end())@@ -544,19 +544,19 @@ class IntroduceJennifer(JenniferScene):Transform(self.jenny.bubble, self.you.bubble),self.you.change_mode, "speaking",self.jenny.change_mode, "erm",- *map(MoveToTarget, [+ *list(map(MoveToTarget, [self.jenny.coords,b1, b2, new_label1, new_label2, sum_vect- ])+ ])))self.play(Blink(self.you))self.wait()self.play(*it.chain(- map(FadeOut, [+ list(map(FadeOut, [self.jenny.bubble, self.jenny.coords,coord_mobs, sum_vect- ]),+ ])),[ApplyMethod(pi.change_mode, "plain")for pi in (self.jenny, self.you)@@ -608,11 +608,11 @@ class IntroduceJennifer(JenniferScene):FadeOut(b1_coords),self.jenny.change_mode, "speaking",self.you.change_mode, "confused",- *map(Animation, [+ *list(map(Animation, [self.basis_vectors,b1_coords.mover,b2_coords.mover,- ])+ ])))self.play(MoveToTarget(b1_coords.mover))self.play(MoveToTarget(b2_coords.mover))@@ -692,7 +692,7 @@ class SpaceHasNoGrid(LinearTransformationScene):self.play(Write(words),FadeOut(self.plane),- *map(Animation, [self.i_hat, self.j_hat])+ *list(map(Animation, [self.i_hat, self.j_hat])))self.wait()@@ -768,7 +768,7 @@ class ShowOriginOfGrid(JenniferScene):self.wait()self.play(Transform(self.jenny_plane, self.plane),- *map(Animation, [origin_word, origin_dot, arrow])+ *list(map(Animation, [origin_word, origin_dot, arrow])))self.wait()self.play(Write(coords))@@ -779,7 +779,7 @@ class ShowOriginOfGrid(JenniferScene):self.wait()self.play(self.jenny_plane.restore,- *map(Animation, [origin_word, origin_dot, arrow, coords])+ *list(map(Animation, [origin_word, origin_dot, arrow, coords])))for vect in self.b1, self.b2:self.play(@@ -847,7 +847,7 @@ class TranslateFromJenny(JenniferScene):everything.remove(submob)self.play(Transform(self.jenny_plane, self.plane),- *map(Animation, everything)+ *list(map(Animation, everything)))self.play(self.you.change_mode, "confused",@@ -872,7 +872,7 @@ class TranslateFromJenny(JenniferScene):def perform_arithmetic(self):jenny_x, jenny_y = self.jenny.coords.get_entries().copy()- equals, plus, equals2 = syms = map(TexMobject, list("=+="))+ equals, plus, equals2 = syms = list(map(TexMobject, list("=+=")))result = Matrix([-4, 1])result.set_height(self.you.coords.get_height())for mob in syms + [self.you.coords, self.jenny.coords, result]:@@ -898,7 +898,7 @@ class TranslateFromJenny(JenniferScene):[self.you.coords, equals],]for mover_set in mover_sets:- self.play(*map(MoveToTarget, mover_set))+ self.play(*list(map(MoveToTarget, mover_set)))self.wait()self.play(MoveToTarget(equals2),@@ -1102,14 +1102,14 @@ class ChangeOfBasisExample(JenniferScene):basis_vectors = [self.i_hat, self.j_hat],coord_mobs = v_coords.get_entries().copy(),)- self.play(*map(FadeOut, [self.i_hat.label, self.j_hat.label]))+ self.play(*list(map(FadeOut, [self.i_hat.label, self.j_hat.label])))self.apply_transposed_matrix(self.cob_matrix().T)VGroup(self.i_hat, self.j_hat).fade()self.add(self.b1, self.b2)self.play(Transform(start_words, end_words),Transform(self.you, self.jenny),- *map(Write, [self.b1.label, self.b2.label])+ *list(map(Write, [self.b1.label, self.b2.label])))self.play(Blink(self.you))self.show_linear_combination(@@ -1161,7 +1161,7 @@ class FeelsBackwards(Scene):inverse_word.next_to(matrix, LEFT, buff = MED_SMALL_BUFF)inverse_exponent = TexMobject("-1")inverse_exponent.next_to(matrix.get_corner(UP+RIGHT), RIGHT)- self.play(*map(Write, [inverse_word, inverse_exponent]))+ self.play(*list(map(Write, [inverse_word, inverse_exponent])))self.play(Swap(jenny_grid, our_grid),top_arrow.scale_in_place, 0.8,@@ -1327,7 +1327,7 @@ class SummarizeTranslationProcess(Scene):def define_matrix(self):matrix = Matrix([[2, -1], [1, 1]])matrix.set_color_columns(X_COLOR, Y_COLOR)- A, equals = map(TexMobject, list("A="))+ A, equals = list(map(TexMobject, list("A=")))equation = VGroup(A, equals, matrix)equation.arrange_submobjects()equation.to_corner(UP+LEFT)@@ -1344,7 +1344,7 @@ class SummarizeTranslationProcess(Scene):self.add(A, equals, matrix)self.play(Write(words),- *map(ShowCreation, [arrow1, arrow2])+ *list(map(ShowCreation, [arrow1, arrow2])))self.A_copy = A.copy()@@ -1420,10 +1420,10 @@ class Prerequisites(Scene):h_line.next_to(title, DOWN)self.add(title, h_line)- prereqs = map(TextMobject, [+ prereqs = list(map(TextMobject, ["Linear transformations","Matrix multiplication",- ])+ ]))for direction, words in zip([LEFT, RIGHT], prereqs):rect = Rectangle(height = 9, width = 16)rect.set_height(3.5)@@ -1466,7 +1466,7 @@ class RotationExample(LinearTransformationScene):)self.wait()- i_coords, j_coords = coord_arrays = map(Matrix, self.t_matrix)+ i_coords, j_coords = coord_arrays = list(map(Matrix, self.t_matrix))for coords, vect in zip(coord_arrays, [self.i_hat, self.j_hat]):coords.scale(0.7)coords.rect = BackgroundRectangle(coords)@@ -1550,7 +1550,7 @@ class JennyWatchesRotation(JenniferScene):Rotate(mob, np.pi/2, run_time = 3)for mob in (self.jenny_plane, self.b1, self.b2)],- map(Animation, [jenny, jenny.bubble, matrix])+ list(map(Animation, [jenny, jenny.bubble, matrix]))))self.play(jenny.change_mode, "pondering")self.play(Blink(jenny))@@ -1598,13 +1598,13 @@ class HowToTranslateAMatrix(Scene):def construct(self):self.add_title()- arrays = VGroup(*map(Matrix, [+ arrays = VGroup(*list(map(Matrix, [[["1/3", "-2/3"], ["5/3", "-1/3"]],[-1, 2],[[2, -1], [1, 1]],[[0, -1], [1, 0]],[[2, -1], [1, 1]],- ]))+ ])))result, her_vector, cob_matrix, transform, inv_cob = arraysneg_1 = TexMobject("-1")neg_1.next_to(inv_cob.get_corner(UP+RIGHT), RIGHT)@@ -1759,7 +1759,7 @@ class JennyWatchesRotationWithMatrixAndVector(JenniferScene):Rotate(mob, np.pi/2, run_time = 3)for mob in (self.jenny_plane, self.b1, self.b2, vector)],- map(Animation, [self.jenny, matrix, vector_array]),+ list(map(Animation, [self.jenny, matrix, vector_array])),))self.play(self.jenny.change_mode, "pondering",diff --git a/old_projects/eola/footnote.py b/old_projects/eola/footnote.pyindex 43a2a188d..9b27ae02b 100644--- a/old_projects/eola/footnote.py+++ b/old_projects/eola/footnote.py@@ -139,10 +139,7 @@ class PutTogether3x3Matrix(Scene):))matrix.to_edge(DOWN)- start_entries = reduce(op.add, map(- lambda a : a.get_entries().split(),- arrays- ))+ start_entries = reduce(op.add, [a.get_entries().split() for a in arrays])target_entries = matrix.get_mob_matrix().transpose().flatten()start_l_bracket = i_array.get_brackets().split()[0]start_r_bracket = k_array.get_brackets().split()[1]@@ -190,7 +187,7 @@ class ShowVCoordinateMeaning(Scene):coords = Matrix(["x", "y", "z"])eq2 = eq.copy()if self.post_transform:- L, l_paren, r_paren = map(TexMobject, "L()")+ L, l_paren, r_paren = list(map(TexMobject, "L()"))parens = VMobject(l_paren, r_paren)parens.scale(2)parens.stretch_to_fit_height(@@ -199,11 +196,11 @@ class ShowVCoordinateMeaning(Scene):VMobject(L, l_paren, coords, r_paren).arrange_submobjects(buff = 0.1)coords.submobjects = [L, l_paren] + coords.submobjects + [r_paren]- lin_comb = VMobject(*map(TexMobject, [+ lin_comb = VMobject(*list(map(TexMobject, ["x", self.i_str, "+","y", self.j_str, "+","z", self.k_str,- ]))+ ])))lin_comb.arrange_submobjects(RIGHT, buff = 0.1,aligned_edge = ORIGIN if self.post_transform else DOWN@@ -223,7 +220,7 @@ class ShowVCoordinateMeaning(Scene):if not self.post_transform:lin_comb.shift(0.35*UP)- self.play(*map(Write, [v, eq, coords]))+ self.play(*list(map(Write, [v, eq, coords])))self.wait()self.play(Transform(@@ -259,7 +256,7 @@ class ShowMatrixVectorMultiplication(Scene):for col in matrix.copy().get_mob_matrix().transpose()]coords = x, y, z = [m.copy() for m in vect.get_entries().split()]- eq, plus1, plus2 = map(TexMobject, list("=++"))+ eq, plus1, plus2 = list(map(TexMobject, list("=++")))everything = VMobject(matrix, vect, eq,x, col1, plus1,@@ -285,17 +282,17 @@ class ShowMatrixVectorMultiplication(Scene):matrix_brace, vect_brace, result_brace = braces- self.play(*map(Write, [matrix, vect]), run_time = 2)+ self.play(*list(map(Write, [matrix, vect])), run_time = 2)self.play(Write(matrix_brace, run_time = 1))self.play(Write(vect_brace, run_time = 1))- sexts = zip(+ sexts = list(zip(matrix.get_mob_matrix().transpose(),columns,vect.get_entries().split(),coords,[eq, plus1, plus2],[X_COLOR, Y_COLOR, Z_COLOR]- )+ ))for o_col, col, start_coord, coord, sym, color in sexts:o_col = VMobject(*o_col)self.play(@@ -386,12 +383,12 @@ class QuestionsToPonder(Scene):title = TextMobject("Questions to ponder")title.set_color(YELLOW).to_edge(UP)self.add(title)- questions = VMobject(*map(TextMobject, [+ questions = VMobject(*list(map(TextMobject, ["1. Can you visualize these transformations?","2. Can you represent them with matrices?","3. How many rows and columns?","4. When can you multiply these matrices?",- ]))+ ])))questions.arrange_submobjects(DOWN, buff = 1, aligned_edge = LEFT)questions.to_edge(LEFT)for question in questions.split():diff --git a/old_projects/eola/footnote2.py b/old_projects/eola/footnote2.pyindex 965378cf5..3a23de090 100644--- a/old_projects/eola/footnote2.py+++ b/old_projects/eola/footnote2.py@@ -137,7 +137,7 @@ class PlaneStartState(LinearTransformationScene):def construct(self):self.add_title("Input space")labels = self.get_basis_vector_labels()- self.play(*map(Write, labels))+ self.play(*list(map(Write, labels)))self.wait()class OutputIn3dWords(Scene):@@ -440,12 +440,12 @@ class TwoDTo1DTransform(LinearTransformationScene):self.remove(plane_words)mobjects = self.get_mobjects()self.play(- *map(FadeOut, mobjects) + [ShowCreation(line)]+ *list(map(FadeOut, mobjects)) + [ShowCreation(line)])self.play(Write(line_words))self.wait()self.remove(line_words)- self.play(*map(FadeIn, mobjects))+ self.play(*list(map(FadeIn, mobjects)))self.apply_transposed_matrix(self.t_matrix)self.play(Write(VMobject(*line.get_number_mobjects())))self.wait()diff --git a/old_projects/eulers_characteristic_formula.py b/old_projects/eulers_characteristic_formula.pyindex 19b598b6f..1c35d7685 100644--- a/old_projects/eulers_characteristic_formula.py+++ b/old_projects/eulers_characteristic_formula.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import absolute_import+import numpy as npimport itertools as itfrom copy import deepcopy@@ -396,10 +396,7 @@ class IntroduceCycle(WalkingRandolph):def construct(self):WalkingRandolph.construct(self)self.remove(self.randy)- encompassed_cycles = filter(- lambda c : set(c).issubset(self.path),- self.graph.region_cycles- )+ encompassed_cycles = [c for c in self.graph.region_cycles if set(c).issubset(self.path)]regions = [self.region_from_cycle(cycle)for cycle in encompassed_cycles@@ -473,8 +470,8 @@ class DefineSpanningTree(GraphScene):))self.wait(2)- unneeded_edges = filter(out_of_spanning_set, self.graph.edges)- for edge, limit in zip(unneeded_edges, range(5)):+ unneeded_edges = list(filter(out_of_spanning_set, self.graph.edges))+ for edge, limit in zip(unneeded_edges, list(range(5))):line = Line(self.points[edge[0]], self.points[edge[1]])line.set_color("red")self.play(ShowCreation(line, run_time = 1.0))@@ -617,10 +614,7 @@ class FacebookGraphAsAbstractSet(Scene):class ExamplesOfGraphs(GraphScene):def construct(self):buff = 0.5- self.graph.vertices = map(- lambda v : v + DOWN + RIGHT,- self.graph.vertices- )+ self.graph.vertices = [v + DOWN + RIGHT for v in self.graph.vertices]GraphScene.construct(self)self.generate_regions()objects, notions = Mobject(*TextMobject(@@ -667,7 +661,7 @@ class ExamplesOfGraphs(GraphScene):self.wait()def handle_english_words(self, words1, words2):- words = map(TextMobject, ["graph", "grape", "gape", "gripe"])+ words = list(map(TextMobject, ["graph", "grape", "gape", "gripe"]))words[0].shift(RIGHT)words[1].shift(3*RIGHT)words[2].shift(3*RIGHT + 2*UP)@@ -773,17 +767,11 @@ class DrawDualGraph(GraphScene):outer_region = self.regions.pop()outer_region_mob = region_mobs.pop()outer_dual_vertex = self.dual_vertices.pop()- internal_edges = filter(- lambda e : abs(e.start[0]) < FRAME_X_RADIUS and \+ internal_edges = [e for e in self.dual_edges if abs(e.start[0]) < FRAME_X_RADIUS and \abs(e.end[0]) < FRAME_X_RADIUS and \abs(e.start[1]) < FRAME_Y_RADIUS and \- abs(e.end[1]) < FRAME_Y_RADIUS,- self.dual_edges- )- external_edges = filter(- lambda e : e not in internal_edges,- self.dual_edges- )+ abs(e.end[1]) < FRAME_Y_RADIUS]+ external_edges = [e for e in self.dual_edges if e not in internal_edges]self.wait()self.reset_background()@@ -1050,10 +1038,7 @@ class MortimerCannotTraverseCycle(GraphScene):)all_lines.append(line)center = line.get_center()- distances = map(- lambda e : np.linalg.norm(center - e.get_center()),- self.edges- )+ distances = [np.linalg.norm(center - e.get_center()) for e in self.edges]matching_edges.append(self.edges[distances.index(min(distances))])diff --git a/old_projects/fc1.py b/old_projects/fc1.pyindex 312187cc3..43f8ac131 100644--- a/old_projects/fc1.py+++ b/old_projects/fc1.py@@ -14,10 +14,10 @@ class CrossingOneMillion(TeacherStudentsScene):number.scale(3)self.look_at(number, run_time=0)- confetti_spirils = self.confetti_spirils = map(+ confetti_spirils = self.confetti_spirils = list(map(NormalAnimationAsContinualAnimation,get_confetti_animations(50)- )+ ))self.add(*confetti_spirils)self.play(ChangeDecimalToValue(@@ -138,12 +138,12 @@ class AllFeaturedCreators(MortyPiCreatureScene):dots.arrange_submobjects(DOWN, buff=LARGE_BUFF)dots.to_edge(LEFT, buff=2)- creators = VGroup(*map(TextMobject, [+ creators = VGroup(*list(map(TextMobject, ["Think Twice","LeiosOS","Welch Labs","Infinity plus one",- ]))+ ])))for creator, dot in zip(creators, dots):creator.next_to(dot, RIGHT)@@ -151,16 +151,16 @@ class AllFeaturedCreators(MortyPiCreatureScene):dot.scale(4)dot.set_fill(opacity=0)- rects = VGroup(*map(SurroundingRectangle, creators))+ rects = VGroup(*list(map(SurroundingRectangle, creators)))rects.set_stroke(WHITE, 2)rects.set_fill(BLUE_E, 1)- think_words = VGroup(*map(TextMobject, [+ think_words = VGroup(*list(map(TextMobject, ["(thinks visually)","(thinks in terms of communities)","(thinks in terms of series)","(thinks playfully)",- ]))+ ])))for word, creator in zip(think_words, creators):# word.move_to(creator, RIGHT)# word.align_to(RIGHT, LEFT)diff --git a/old_projects/fourier.py b/old_projects/fourier.pyindex 60c2a828f..f3219a277 100644--- a/old_projects/fourier.py+++ b/old_projects/fourier.py@@ -108,12 +108,12 @@ class TODOInsertUnmixingSound(TODOStub):class OtherContexts(PiCreatureScene):def construct(self):- items = VGroup(*map(TextMobject, [+ items = VGroup(*list(map(TextMobject, ["Extracting frequencies from sound","Uncertainty principle","Riemann Zeta function and primes","Differential equations",- ]))+ ])))items.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF,aligned_edge = LEFT@@ -319,7 +319,7 @@ class AddingPureFrequencies(PiCreatureScene):D_label.target.next_to(D_graph.target, UP)self.play(*it.chain(- map(MoveToTarget, movers),+ list(map(MoveToTarget, movers)),[ApplyMethod(mob.shift, FRAME_Y_RADIUS*DOWN, remover = True)for mob in (randy, speaker)@@ -352,7 +352,7 @@ class AddingPureFrequencies(PiCreatureScene):self.revert_to_original_skipping_status()self.play(GrowFromCenter(v_line))self.play(FadeOut(v_line))- self.play(*map(ShowCreation, lines))+ self.play(*list(map(ShowCreation, lines)))self.wait()self.play(MoveToTarget(sum_lines, path_arc = np.pi/4))self.wait(2)@@ -469,9 +469,9 @@ class AddingPureFrequencies(PiCreatureScene):thin_new_sum_graph = new_sum_graph.copy().fade()self.play(*it.chain(- map(ShowCreation, [F_axes, C_axes, F_graph, C_graph]),- map(Write, [F_label, C_label]),- map(FadeOut, [self.sum_graph])+ list(map(ShowCreation, [F_axes, C_axes, F_graph, C_graph])),+ list(map(Write, [F_label, C_label])),+ list(map(FadeOut, [self.sum_graph]))))self.play(ReplacementTransform(graphs.copy(), thin_new_sum_graph@@ -598,7 +598,7 @@ class BreakApartSum(Scene):run_time = 8,rate_func = None,)- self.play(*map(FadeOut, [dot, v_line]))+ self.play(*list(map(FadeOut, [dot, v_line])))self.set_variables_as_attrs(axes, graph)@@ -814,7 +814,7 @@ class FourierMachineScene(Scene):"x_max" : 5.0,"x_axis_config" : {"unit_size" : 1.4,- "numbers_to_show" : range(1, 6),+ "numbers_to_show" : list(range(1, 6)),},"y_min" : -1.0,"y_max" : 1.0,@@ -1125,7 +1125,7 @@ class WrapCosineGraphAroundCircle(FourierMachineScene):self.play(FadeIn(words),LaggedStart(FadeIn, braces),- *map(ShowCreation, v_lines)+ *list(map(ShowCreation, v_lines)))self.wait()self.play(@@ -1639,10 +1639,7 @@ class DrawFrequencyPlot(WrapCosineGraphAroundCircle, PiCreatureScene):added_anims = kwargs.get("added_anims", [])anims = [self.get_frequency_change_animation(self.graph, new_freq)]if hasattr(self, "winding_freq_label"):- freq_label = filter(- lambda sm : isinstance(sm, DecimalNumber),- self.winding_freq_label- )[0]+ freq_label = [sm for sm in self.winding_freq_label if isinstance(sm, DecimalNumber)][0]anims.append(ChangeDecimalToValue(freq_label, new_freq))if hasattr(self, "v_lines_indicating_periods"):anims.append(self.get_period_v_lines_update_anim())@@ -1731,7 +1728,7 @@ class ShowLowerFrequency(DrawFrequencyPlot):self.play(Write(bps_label),LaggedStart(FadeIn, braces),- *map(ShowCreation, v_lines),+ *list(map(ShowCreation, v_lines)),run_time = 1)self.wait()@@ -1791,7 +1788,7 @@ class ShowLowerFrequency(DrawFrequencyPlot):Write(com_words))self.wait()- self.play(*map(FadeOut, [arrow, com_words]))+ self.play(*list(map(FadeOut, [arrow, com_words])))self.change_frequency(0.0)self.wait()@@ -2473,7 +2470,7 @@ class ApplyFourierToFourier(DrawFrequencyPlot):"y_max" : 1.5,"x_max" : 5,"x_axis_config" : {- "numbers_to_show" : range(1, 5),+ "numbers_to_show" : list(range(1, 5)),"unit_size" : 2.5,},},@@ -2918,11 +2915,11 @@ class WriteComplexExponentialExpression(DrawFrequencyPlot):ambient_ghost_dot_movement.rate = 0self.remove(*updates)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [update.mobjectfor update in updatesif update.mobject is not vector- ]))+ ])))self.play(ghost_dot.move_to, ORIGIN)exp_expression[1].add(minus, f)@@ -2981,9 +2978,9 @@ class WriteComplexExponentialExpression(DrawFrequencyPlot):self.play(Blink(morty))self.play(morty.change, "hooray", rect)self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [morty, rect, graph_y_vector, vector- ]))+ ])))self.integrand = integrand@@ -3371,10 +3368,10 @@ class ScaleUpCenterOfMass(WriteComplexExponentialExpression):to_squish.generate_target()squish_factor = 0.75to_squish.target.stretch(squish_factor, 0, about_edge = LEFT)- pairs = zip(+ pairs = list(zip(to_squish.family_members_with_points(),to_squish.target.family_members_with_points()- )+ ))to_unsquish = list(axes.x_axis.numbers) + list(axes.labels)for sm, tsm in pairs:if sm in to_unsquish:@@ -3573,7 +3570,7 @@ class SummarizeTheFullTransform(DrawFrequencyPlot):"x_max" : 5,"x_axis_config" : {"unit_size" : 1,- "numbers_to_show" : range(1, 5),+ "numbers_to_show" : list(range(1, 5)),},"y_max" : 2,"y_min" : -2,@@ -3910,10 +3907,10 @@ class BoundsAtInfinity(SummarizeFormula):},default_num_graph_points = 1000,)- axes.x_axis.add_numbers(*filter(+ axes.x_axis.add_numbers(*list(filter(lambda x : x != 0,- range(-8, 10, 2),- ))+ list(range(-8, 10, 2)),+ )))axes.shift(DOWN)self.add(axes)diff --git a/old_projects/fractal_dimension.py b/old_projects/fractal_dimension.pyindex f4d0c1e2b..a4c2659e1 100644--- a/old_projects/fractal_dimension.py+++ b/old_projects/fractal_dimension.py@@ -1,4 +1,4 @@-from __future__ import print_function+from big_ol_pile_of_manim_imports import *from functools import reduce@@ -605,9 +605,9 @@ class FourSelfSimilarShapes(Scene):self.mention_measurements()def get_titles(self):- titles = VGroup(*map(TextMobject, [+ titles = VGroup(*list(map(TextMobject, ["Line", "Square", "Cube", "Sierpinski"- ]))+ ])))for title, x in zip(titles, np.linspace(-0.75, 0.75, 4)):title.shift(x*FRAME_X_RADIUS*RIGHT)titles.to_edge(UP)@@ -656,7 +656,7 @@ class FourSelfSimilarShapes(Scene):FadeIn(brace_text))self.wait()- self.play(*map(FadeOut, [brace, brace_text]))+ self.play(*list(map(FadeOut, [brace, brace_text])))self.wait()for title in titles:@@ -702,12 +702,12 @@ class FourSelfSimilarShapes(Scene):def mention_measurements(self):line, square, cube, sierpinski = self.shapes_copy- labels = map(TextMobject, [+ labels = list(map(TextMobject, ["$1/2$ length","$1/4$ area","$1/8$ volume","You'll see...",- ])+ ]))for label, shape in zip(labels, self.shapes_copy):label.next_to(shape, DOWN)label.to_edge(DOWN, buff = MED_LARGE_BUFF)@@ -735,9 +735,9 @@ class GeneralWordForMeasurement(Scene):mass = TextMobject("Mass")mass.move_to(measure)- words = VGroup(*map(TextMobject, [+ words = VGroup(*list(map(TextMobject, ["Length", "Area", "Volume"- ]))+ ])))words.arrange_submobjects(RIGHT, buff = 2*LARGE_BUFF)words.next_to(measure, DOWN, buff = 2*LARGE_BUFF)colors = color_gradient([BLUE_B, BLUE_D], len(words))@@ -763,7 +763,7 @@ class GeneralWordForMeasurement(Scene):class ImagineShapesAsMetal(FourSelfSimilarShapes):def construct(self):- titles = VGroup(*map(VGroup, self.get_titles()))+ titles = VGroup(*list(map(VGroup, self.get_titles())))shapes = self.get_shapes(titles)shapes.shift(DOWN)descriptions = VGroup(*[@@ -1030,7 +1030,7 @@ class DefineTwoDimensional(PiCreatureScene):self.scale_factor,)brace.target = Brace(shape.target, LEFT)- self.play(*map(MoveToTarget, group))+ self.play(*list(map(MoveToTarget, group)))self.play(bottom_L.next_to, brace, LEFT)self.wait()@@ -1384,7 +1384,7 @@ class DimensionOfKoch(Scene):Transform(third, formula[0]),Transform(fourth, formula[-1]),)- self.play(*map(FadeIn, formula[1:-1]))+ self.play(*list(map(FadeIn, formula[1:-1])))self.remove(third, fourth)self.add(formula)self.wait(2)@@ -1888,7 +1888,7 @@ class BoxCountingWithDisk(BoxCountingScene):approx = TexMobject("\\approx 2^2")approx.next_to(decimal, RIGHT, aligned_edge = DOWN)approx.shift_onto_screen()- self.play(*map(Write, [frac_line, decimal]))+ self.play(*list(map(Write, [frac_line, decimal])))self.play(Write(approx))self.wait()@@ -2010,7 +2010,7 @@ class BoxCountingSierpinski(BoxCountingScene):counting_label = self.get_counting_label()self.play(ShowCreation(sierp))- self.play(*map(FadeIn, [corner_rect, counting_label]))+ self.play(*list(map(FadeIn, [corner_rect, counting_label])))self.wait()counting_mob = self.count_boxes(boxes)self.wait()@@ -2033,7 +2033,7 @@ class BoxCountingSierpinski(BoxCountingScene):equals_exp.next_to(approx_three, RIGHT, aligned_edge = DOWN)equals_exp.shift_onto_screen()- self.play(*map(Write, [frac_line, approx_three]))+ self.play(*list(map(Write, [frac_line, approx_three])))self.wait()self.play(Write(equals_exp))self.wait()@@ -2458,12 +2458,12 @@ class ListDimensionTypes(PiCreatureScene):"use_morty" : False,}def construct(self):- types = VGroup(*map(TextMobject, [+ types = VGroup(*list(map(TextMobject, ["Box counting dimension","Information dimension","Hausdorff dimension","Packing dimension"- ]))+ ])))types.arrange_submobjects(DOWN, aligned_edge = LEFT)for text in types:self.play(@@ -2735,7 +2735,7 @@ class CompareBritainAndNorway(Scene):self.add(britain_label, norway_label)self.play(- *map(ShowCreation, [norway, britain]),+ *list(map(ShowCreation, [norway, britain])),run_time = 3)self.wait()diff --git a/old_projects/hanoi.py b/old_projects/hanoi.pyindex d7a759f8f..8bebbcca6 100644--- a/old_projects/hanoi.py+++ b/old_projects/hanoi.py@@ -372,8 +372,8 @@ class TowersOfHanoiScene(Scene):self.move_disk_to_peg(disk_index, next_peg_index, **kwargs)def move_subtower_to_peg(self, num_disks, next_peg_index, **kwargs):- disk_indices = range(num_disks)- peg_indices = map(self.disk_index_to_peg_index, disk_indices)+ disk_indices = list(range(num_disks))+ peg_indices = list(map(self.disk_index_to_peg_index, disk_indices))if len(set(peg_indices)) != 1:warnings.warn("These disks don't make up a tower right now")self.move_disks_to_peg(disk_indices, next_peg_index, **kwargs)@@ -470,7 +470,7 @@ def get_binary_tex_mobs(num_list):nudge = zero_width + SMALL_BUFFfor num in num_list:bin_string = bin(num)[2:]#Strip off the "0b" prefix- bits = VGroup(*map(TexMobject, bin_string))+ bits = VGroup(*list(map(TexMobject, bin_string)))for n, bit in enumerate(bits):bit.shift(n*nudge*RIGHT)bits.move_to(ORIGIN, RIGHT)@@ -782,7 +782,7 @@ class KeithShowingBinary(Scene):randy.bubble.set_fill(BLACK, opacity = 1)randy.bubble.write("Hold on...how does \\\\ binary work again?")- binary_tex_mobs = get_binary_tex_mobs(range(16))+ binary_tex_mobs = get_binary_tex_mobs(list(range(16)))binary_tex_mobs.shift(keith.get_corner(UP+LEFT))binary_tex_mobs.shift(0.5*(UP+RIGHT))bits_list = binary_tex_mobs.split()@@ -934,7 +934,7 @@ class RhythmOfDecimalCounting(CountingScene):self.wait()self.play(ten_group.restore,- *map(FadeOut, [brace, two_digits])+ *list(map(FadeOut, [brace, two_digits])))for x in range(89):@@ -986,7 +986,7 @@ class DecimalCountingAtHundredsScale(CountingScene):).update(1)for x in range(10):- this_range = range(8) if x == 0 else range(9)+ this_range = list(range(8)) if x == 0 else list(range(9))for y in this_range:self.increment(run_time_per_anim = 0.25)self.increment(run_time_per_anim = 1)@@ -1095,7 +1095,7 @@ class IntroduceBinaryCounting(BinaryCountingScene):Transform(twos_place, fours_place),)self.play(Blink(randy))- self.play(*map(FadeOut, [bubble, curr_content]))+ self.play(*list(map(FadeOut, [bubble, curr_content])))#Up to 1000for x in range(4):@@ -1105,7 +1105,7 @@ class IntroduceBinaryCounting(BinaryCountingScene):self.play(randy.change_mode, "happy",randy.look_at, self.number_mob,- *map(MoveToTarget, [brace, twos_place])+ *list(map(MoveToTarget, [brace, twos_place])))for x in range(8):self.increment(total_run_time = 1)@@ -1176,7 +1176,7 @@ class BinaryCountingAtEveryScale(Scene):bit_mob.set_color(YELLOW)bit_mob[0].set_color(MAROON_B)self.play(get_run_through(bit_mobs[1:2**(self.num_bits-1)]))- self.play(*map(FadeIn, [upper_brace, roll_over]))+ self.play(*list(map(FadeIn, [upper_brace, roll_over])))self.play(Transform(VGroup(*reversed(list(curr_bits))),VGroup(*reversed(list(bit_mobs[2**(self.num_bits-1)]))),@@ -1344,7 +1344,7 @@ class IntroduceSolveByCounting(TowersOfHanoiScene):disk[1].set_fill, BLACK,eights_bit.restore,)- self.play(*map(FadeOut, [brace, words]))+ self.play(*list(map(FadeOut, [brace, words])))for disk_index in get_ruler_sequence(2):self.play(self.get_increment_animation())self.move_disk(disk_index, stay_on_peg = False)@@ -1522,7 +1522,7 @@ class RecursiveSolution(TowersOfHanoiScene):)self.wait()self.blink()- self.play(*map(FadeOut, [bubble, bubble.content]))+ self.play(*list(map(FadeOut, [bubble, bubble.content])))big_disk.remove(self.eyes)self.move_subtower_to_peg(3, 2, run_time = 2, added_anims = [self.eyes.look_at_anim(self.pegs[2].get_top()),@@ -1553,7 +1553,7 @@ class RecursiveSolution(TowersOfHanoiScene):self.wait()self.play(GrowFromCenter(sub_sub_steps_brace),- *map(FadeOut, [arc, q_mark])+ *list(map(FadeOut, [arc, q_mark])))#Disk 2 frustration@@ -2043,9 +2043,9 @@ class RecursiveSolutionToConstrained(RecursiveSolution):for steps in subdivisions]sub_steps_brace, sub_sub_steps_brace = braces[:2]- steps = VGroup(title, *it.chain(*zip(+ steps = VGroup(title, *it.chain(*list(zip(braces, subdivisions- )))+ ))))steps.arrange_submobjects(DOWN)steps.to_edge(UP)@@ -2405,13 +2405,13 @@ class TernaryCountingSelfSimilarPattern(Scene):title = TextMobject("Count to " + "2"*self.num_trits)for i, color in enumerate(colors):title[-i-1].set_color(color)- steps = VGroup(*map(TextMobject, [+ steps = VGroup(*list(map(TextMobject, ["Count to %s,"%("2"*(self.num_trits-1)),"Roll over,","Count to %s,"%("2"*(self.num_trits-1)),"Roll over,","Count to %s,"%("2"*(self.num_trits-1)),- ]))+ ])))steps.arrange_submobjects(RIGHT)for step in steps[::2]:for i, color in enumerate(colors[:-1]):@@ -2572,7 +2572,7 @@ class DescribeSolutionByCountingToConstrained(SolveConstrainedWithTernaryCountin)self.move_next_disk(stay_on_peg = True)self.wait()- self.play(*map(FadeOut, [brace, word]))+ self.play(*list(map(FadeOut, [brace, word])))#Count up to 22for x in range(5):@@ -2595,7 +2595,7 @@ class DescribeSolutionByCountingToConstrained(SolveConstrainedWithTernaryCountinself.wait()self.move_next_disk(stay_on_peg = True)self.wait()- self.play(*map(FadeOut, [braces[2], words[2]]))+ self.play(*list(map(FadeOut, [braces[2], words[2]])))for x in range(20):self.increment()@@ -2743,7 +2743,7 @@ class RepeatingConfiguraiton(Scene):arrows = VGroup(*[Arrow(LEFT, RIGHT) for x in range(9)])arrows.add(VGroup())arrows.scale(0.5)- group = VGroup(*it.chain(*zip(dots, arrows)))+ group = VGroup(*it.chain(*list(zip(dots, arrows))))group.arrange_submobjects()title = TextMobject("Same state twice")title.shift(3*UP)@@ -2780,7 +2780,7 @@ class ShowSomeGraph(Scene):title.scale(2)title.to_edge(UP)- nodes = VGroup(*map(Dot, [+ nodes = VGroup(*list(map(Dot, [2*LEFT,UP,DOWN,@@ -2788,7 +2788,7 @@ class ShowSomeGraph(Scene):2*RIGHT+2*UP,2*RIGHT+2*DOWN,4*RIGHT+2*UP,- ]))+ ])))edge_pairs = [(0, 1),(0, 2),@@ -2904,7 +2904,7 @@ class SierpinskiGraphScene(Scene):min_distance = self.distance_between_nodes(0, 1)min_distance *= 1.1 ##Just a little buff to be surenode_radius = self.nodes[0].get_width()/2- for i, j in it.combinations(range(3**self.num_disks), 2):+ for i, j in it.combinations(list(range(3**self.num_disks)), 2):center1 = self.nodes[i].get_center()center2 = self.nodes[j].get_center()vect = center1-center2@@ -3002,7 +3002,7 @@ class IntroduceGraphStructure(SierpinskiGraphScene):arc.set_color(YELLOW)node.arc = arc- self.play(*map(MoveToTarget, nodes))+ self.play(*list(map(MoveToTarget, nodes)))edge = Line(nodes[0].get_right(), nodes[1].get_left(),color = YELLOW,@@ -3070,7 +3070,7 @@ class DescribeTriforcePattern(SierpinskiGraphScene):node.target.set_height(6)node.target.center().next_to(ORIGIN, vect)- self.play(*map(MoveToTarget, nodes))+ self.play(*list(map(MoveToTarget, nodes)))self.wait()self.play(*[node.restore for node in nodes])bold_edges = [@@ -3079,14 +3079,14 @@ class DescribeTriforcePattern(SierpinskiGraphScene):]self.play(ShowCreation(bold_edges[0]))self.wait()- self.play(*map(ShowCreation, bold_edges[1:]))+ self.play(*list(map(ShowCreation, bold_edges[1:])))self.wait()power_of_three = 3**(self.scale-1)index_sets = [- range(0, power_of_three),- range(power_of_three, 2*power_of_three),- range(2*power_of_three, 3*power_of_three),+ list(range(0, power_of_three)),+ list(range(power_of_three, 2*power_of_three)),+ list(range(2*power_of_three, 3*power_of_three)),]if self.first_connect_0_and_2_islands:index_sets = [index_sets[0], index_sets[2], index_sets[1]]@@ -3100,7 +3100,7 @@ class DescribeTriforcePattern(SierpinskiGraphScene):run_time = 1,rate_func = wiggle)- self.play(*map(wiggle_island, islands[:2]))+ self.play(*list(map(wiggle_island, islands[:2])))self.wait()self.play(wiggle_island(islands[2]))self.wait()@@ -3205,12 +3205,12 @@ class PatreonThanks(Scene):special_thanks.set_color(YELLOW)special_thanks.shift(3*UP)- left_patrons = VGroup(*map(TextMobject,+ left_patrons = VGroup(*list(map(TextMobject,self.specific_patrons[:n_patrons/2]- ))- right_patrons = VGroup(*map(TextMobject,+ )))+ right_patrons = VGroup(*list(map(TextMobject,self.specific_patrons[n_patrons/2:]- ))+ )))for patrons, vect in (left_patrons, LEFT), (right_patrons, RIGHT):patrons.arrange_submobjects(DOWN, aligned_edge = LEFT)patrons.next_to(special_thanks, DOWN)diff --git a/old_projects/highD.py b/old_projects/highD.pyindex ea27a68fa..f877024fb 100644--- a/old_projects/highD.py+++ b/old_projects/highD.py@@ -553,20 +553,13 @@ class BackAndForth(Scene):self.wait(3)for tup, eq, to_draw in (pair, circle_eq, circle), (triplet, sphere_eq, VMobject()):for mob in tup, eq:- mob.xyz = VGroup(*filter(- lambda sm : sm is not None,- map(mob.get_part_by_tex, "xyz")- ))+ mob.xyz = VGroup(*[sm for sm in map(mob.get_part_by_tex, "xyz") if sm is not None])self.play(ReplacementTransform(tup.xyz, eq.xyz),- FadeOut(VGroup(*filter(- lambda sm : sm not in tup.xyz, tup- ))),+ FadeOut(VGroup(*[sm for sm in tup if sm not in tup.xyz])),)self.play(- Write(VGroup(*filter(- lambda sm : sm not in eq.xyz, eq- ))),+ Write(VGroup(*[sm for sm in eq if sm not in eq.xyz])),ShowCreation(to_draw))self.wait(3)@@ -576,11 +569,11 @@ class SphereForming(ExternallyAnimatedScene):class PreviousVideos(Scene):def construct(self):- titles = VGroup(*map(TextMobject, [+ titles = VGroup(*list(map(TextMobject, ["Pi hiding in prime regularities","Visualizing all possible pythagorean triples","Borsuk-Ulam theorem",- ]))+ ])))titles.to_edge(UP, buff = MED_SMALL_BUFF)screen = ScreenRectangle(height = 6)screen.next_to(titles, DOWN)@@ -604,10 +597,10 @@ class AskAboutLongerLists(TeacherStudentsScene):"$(x_1, x_2, x_3, x_4)?$")tup = question[1]- alt_tups = map(TextMobject, [+ alt_tups = list(map(TextMobject, ["$(x_1, x_2, x_3, x_4, x_5)?$","$(x_1, x_2, \\dots, x_{99}, x_{100})?$"- ])+ ]))self.student_says(question, run_time = 1)self.wait()@@ -649,11 +642,11 @@ class Professionals(PiCreatureScene):self.analogies()def introduce_characters(self):- titles = VGroup(*map(TextMobject, [+ titles = VGroup(*list(map(TextMobject, ["Mathematician","Computer scientist","Physicist",- ]))+ ])))self.remove(*self.pi_creatures)for title, pi in zip(titles, self.pi_creatures):title.next_to(pi, DOWN)@@ -718,7 +711,7 @@ class Professionals(PiCreatureScene):examples.add(Circle())examples.arrange_submobjects(RIGHT, buff = 2)examples.to_edge(UP, buff = LARGE_BUFF)- labels = VGroup(*map(TextMobject, ["2D", "3D"]))+ labels = VGroup(*list(map(TextMobject, ["2D", "3D"])))title = TextMobject("Fly by instruments")title.scale(1.5)@@ -791,7 +784,7 @@ class OfferAHybrid(SliderScene):self.add(titles, h_line, v_lines, equation)self.wait()- self.play(*map(MoveToTarget, [titles, v_lines, equation]))+ self.play(*list(map(MoveToTarget, [titles, v_lines, equation])))self.play(Write(self.sliders, run_time = 1))self.initialize_ambiant_slider_movement()self.wait(10)@@ -799,9 +792,9 @@ class OfferAHybrid(SliderScene):self.wait()def get_titles(self):- titles = VGroup(*map(TextMobject, [+ titles = VGroup(*list(map(TextMobject, ["Analytic", "Hybrid", "Geometric"- ]))+ ])))titles.to_edge(UP)titles[1].set_color(BLUE)titles.generate_target()@@ -833,11 +826,11 @@ class DismissProjection(PiCreatureScene):self.transition_to_next_scene()def show_all_spheres(self):- equations = VGroup(*map(TexMobject, [+ equations = VGroup(*list(map(TexMobject, ["x^2 + y^2 = 1","x^2 + y^2 + z^2 = 1","x^2 + y^2 + z^2 + w^2 = 1",- ]))+ ])))colors = [YELLOW, GREEN, BLUE]for equation, edge, color in zip(equations, [LEFT, ORIGIN, RIGHT], colors):equation.set_color(color)@@ -927,7 +920,7 @@ class DismissProjection(PiCreatureScene):sphere = self.spheres[-1]morty = self.pi_creature- alt_dims = VGroup(*map(TextMobject, ["5D", "6D", "7D"]))+ alt_dims = VGroup(*list(map(TextMobject, ["5D", "6D", "7D"])))alt_dims.next_to(morty.eyes, UP, SMALL_BUFF)alt_dim = alt_dims[0]@@ -968,7 +961,7 @@ class DismissProjection(PiCreatureScene):self.descriptor,self.pi_creature])))- self.play(*map(MoveToTarget, [equation, tup]))+ self.play(*list(map(MoveToTarget, [equation, tup])))self.wait()###@@ -1172,7 +1165,7 @@ class TwoDimensionalCase(Introduce4DSliders):red_rects = VGroup()for slider in self.sliders:for x1, x2 in (-0.5, 0.5), (0.75, 1.0), (-1.0, -0.75):- p1, p2 = map(slider.number_to_point, [x1, x2])+ p1, p2 = list(map(slider.number_to_point, [x1, x2]))rect = Rectangle(stroke_width = 0,fill_opacity = 0.5,@@ -1236,7 +1229,7 @@ class TwoDimensionalCase(Introduce4DSliders):self.reset_dials([1, 0], run_time = 1)self.reset_dials([0.9, -np.sqrt(0.19)], run_time = 2)self.play(FadeOut(self.real_estate_rects))- self.play(*map(FadeOut, [x_brace, y_brace, x_text, y_text]))+ self.play(*list(map(FadeOut, [x_brace, y_brace, x_text, y_text])))self.wait()def note_circle_steepness(self):@@ -1623,7 +1616,7 @@ class TwoDBoxExample(Scene):rate_func = smooth,))self.wait(0.5)- self.play(*map(FadeOut, [radius, r_equals_1]))+ self.play(*list(map(FadeOut, [radius, r_equals_1])))self.wait()self.corner_radius = radius@@ -1705,7 +1698,7 @@ class TwoDBoxExample(Scene):self.play(ReplacementTransform(sqrt_1_plus_1, sqrt_2))self.play(Write(root_2_value, run_time = 1),- *map(FadeOut, [bottom_one, side_one])+ *list(map(FadeOut, [bottom_one, side_one])))self.wait()self.play(ShowCreation(corner_radius))@@ -2040,7 +2033,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase):)self.wait(5)self.wind_down_ambient_movement(wait = False)- self.play(*map(FadeOut, [x_brace, phrases[0]]))+ self.play(*list(map(FadeOut, [x_brace, phrases[0]])))def swap_with_top_right_circle(self):alt_circle = self.corner_circles[0]@@ -2088,7 +2081,7 @@ class TwoDBoxWithSliders(TwoDimensionalCase):self.wait()self.wind_down_ambient_movement(0)self.reset_dials(target_vector)- self.play(*map(ShowCreation, [h_line, v_line]))+ self.play(*list(map(ShowCreation, [h_line, v_line])))self.wait()re_line = DashedLine(@@ -2480,7 +2473,7 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders):sphere_words.shift(2*UP)self.add(sphere_words)- pairs = zip(self.coordinate_mobs, self.coordinates)+ pairs = list(zip(self.coordinate_mobs, self.coordinates))for coord_mob, coords in pairs[1:] + [pairs[0]]:coord_mob.set_color(GREEN)coord_mob_copy = coord_mob.copy()@@ -2503,9 +2496,9 @@ class FourDBoxExampleWithSliders(ThreeDBoxExampleWithSliders):self.play(self.sliders.center,sphere_words.shift, LEFT,- *map(FadeOut, [+ *list(map(FadeOut, [self.coordinate_mobs, self.box_vertices_title- ])+ ])))self.initialize_ambiant_slider_movement()self.wait(4)@@ -3169,7 +3162,7 @@ class ProportionOfSphereInBox(GraphScene):"x_min" : 0,"x_max" : 50,"x_tick_frequency" : 5,- "x_labeled_nums" : range(10, 50, 10),+ "x_labeled_nums" : list(range(10, 50, 10)),"num_graph_anchor_points" : 100,}def construct(self):@@ -3280,12 +3273,12 @@ class FunHighDSpherePhenomena(Scene):h_line.next_to(title, DOWN)self.add(title, h_line)- items = VGroup(*map(TextMobject, [+ items = VGroup(*list(map(TextMobject, ["$\\cdot$ Most volume is near the equator","$\\cdot$ Most volume is near the surface","$\\cdot$ Sphere packing in 8 dimensions","$\\cdot$ Sphere packing in 24 dimensions",- ]))+ ])))items.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF, aligned_edge = LEFT)@@ -3449,10 +3442,10 @@ class Announcements(TeacherStudentsScene):h_line.next_to(title, DOWN)self.add(title, h_line)- items = VGroup(*map(TextMobject, [+ items = VGroup(*list(map(TextMobject, ["$\\cdot$ Where to learn more","$\\cdot$ Q\\&A Followup (podcast!)",- ]))+ ])))items.arrange_submobjects(DOWN, aligned_edge = LEFT)items.next_to(h_line, DOWN)diff --git a/old_projects/hilbert/fractal_porn.py b/old_projects/hilbert/fractal_porn.pyindex 556175933..6199ff9eb 100644--- a/old_projects/hilbert/fractal_porn.py+++ b/old_projects/hilbert/fractal_porn.py@@ -132,12 +132,12 @@ class SurpriseFractal(Intro):class IntroduceKoch(Intro):def construct(self):- words = map(TextMobject, [+ words = list(map(TextMobject, ["This is another famous fractal.","The ``Koch Snowflake''","Let's finish things off by seeing how to turn \this into a space-filling curve"- ])+ ]))for text in words:text.to_edge(UP)@@ -185,12 +185,12 @@ class FromKochToSpaceFilling(Scene):def revisit_koch(self):- words = map(TextMobject, [+ words = list(map(TextMobject, ["First, look at how one section of this curve is made.","This pattern of four lines is the ``seed''","With each iteration, every straight line is \replaced with an appropriately small copy of the seed",- ])+ ]))for text in words:text.to_edge(UP)@@ -266,12 +266,12 @@ class FromKochToSpaceFilling(Scene):seed.shift(3*LEFT+2*DOWN)fractal = TextMobject("Fractal")fractal.shift(3*RIGHT+2*DOWN)- words = map(TextMobject, [+ words = list(map(TextMobject, ["A sharper angle results in a richer curve","A more obtuse angle gives a sparser curve","And as the angle approaches 0\\dots","We have a new space-filling curve."- ])+ ]))for text in words:text.to_edge(UP)sharper, duller, space_filling = [diff --git a/old_projects/hilbert/section1.py b/old_projects/hilbert/section1.pyindex 5d797d91f..d8ccdc2b1 100644--- a/old_projects/hilbert/section1.py+++ b/old_projects/hilbert/section1.py@@ -59,10 +59,10 @@ class AboutSpaceFillingCurves(TransformOverIncreasingOrders):"|\\mathds{N}|"]).scale(2).split()infinity = TexMobject("\\infty").scale(2)- local_mobjects = filter(+ local_mobjects = list(filter(lambda m : isinstance(m, Mobject),- locals().values(),- )+ list(locals().values()),+ ))for mob in local_mobjects:mob.sort_points(np.linalg.norm)@@ -225,7 +225,7 @@ class SoundDataIsOneDimensional(Scene):center = 2*DOWN + UP*k)for k, color in zip(- range(overtones),+ list(range(overtones)),Color(BLUE_E).range_to(WHITE, overtones))]@@ -600,7 +600,7 @@ class WeaveLineThroughPixels(Scene):side_length = unit,color = WHITE).shift(x*right+y*up)- for x, y in it.product(range(2**order), range(2**order))+ for x, y in it.product(list(range(2**order)), list(range(2**order)))])squares.center()targets = Mobject()@@ -813,7 +813,7 @@ class Order3PseudoHilbertCurve(Scene):self.wait()self.play(ShowCreation(grid8))self.wait()- self.play(*map(GrowFromCenter, mini_curves))+ self.play(*list(map(GrowFromCenter, mini_curves)))self.wait()self.clear()self.add(words, grid8, *mini_curves)diff --git a/old_projects/hilbert/section2.py b/old_projects/hilbert/section2.pyindex 73291a7a5..679795148 100644--- a/old_projects/hilbert/section2.py+++ b/old_projects/hilbert/section2.py@@ -16,7 +16,7 @@ def get_time_line():tick_frequency = 10,leftmost_tick = 1720,number_at_center = 1870,- numbers_with_elongated_ticks = range(1700, 2100, 100)+ numbers_with_elongated_ticks = list(range(1700, 2100, 100)))time_line.sort_points(lambda p : p[0])time_line.set_color_by_gradient(@@ -24,7 +24,7 @@ def get_time_line():PeanoCurve.CONFIG["end_color"])time_line.add_numbers(- 2020, *range(1800, 2050, 50)+ 2020, *list(range(1800, 2050, 50)))return time_line@@ -599,7 +599,7 @@ class FormalDefinitionOfContinuity(Scene):Homotopy(self.output_homotopy, self.output_dot, **kwargs))- A, B = map(Mobject.get_center, [self.input_dot, self.output_dot])+ A, B = list(map(Mobject.get_center, [self.input_dot, self.output_dot]))A_text = TextMobject("A")A_text.shift(A+2*(LEFT+UP))A_arrow = Arrow(diff --git a/old_projects/inventing_math.py b/old_projects/inventing_math.pyindex 76346d371..677d0f81f 100644--- a/old_projects/inventing_math.py+++ b/old_projects/inventing_math.py@@ -524,7 +524,7 @@ class OrganizePartialSums(Scene):partial_sums = TexMobject(PARTIAL_CONVERGENT_SUMS_TEXT, size = "\\small")partial_sums.scale(1.5).to_edge(UP)partial_sum_parts = partial_sums.split()- for x in [0] + range(2, len(partial_sum_parts), 4):+ for x in [0] + list(range(2, len(partial_sum_parts), 4)):partial_sum_parts[x].set_color("yellow")pure_sums = [partial_sum_parts[x]@@ -661,7 +661,7 @@ class ListOfPartialSums(Scene):size = "\\large").split())numbers, equals, sums = [- all_terms[range(k, 12, 3)]+ all_terms[list(range(k, 12, 3))]for k in (0, 1, 2)]dots = all_terms[12]@@ -738,10 +738,7 @@ class CircleZoomInOnOne(Scene):text = TextMobject("All but finitely many dots fall inside even the tiniest circle.")- numbers = map(- lambda s : TexMobject("\\frac{1}{%s}"%s),- ["100", "1,000,000", "g_{g_{64}}"]- )+ numbers = [TexMobject("\\frac{1}{%s}"%s) for s in ["100", "1,000,000", "g_{g_{64}}"]]for num in numbers + [text]:num.shift(2*UP)num.sort_points(lambda p : np.dot(p, DOWN+RIGHT))@@ -796,10 +793,7 @@ class ZoomInOnOne(Scene):self.add(one)def zoom_with_numbers(self, numbers, next_numbers):- all_numbers = map(- lambda n_u: TexMobject(str(n_u[0])).scale(0.5).shift(0.4*DOWN+2*n_u[1]*RIGHT),- zip(numbers+next_numbers, it.cycle([-1, 1]))- )+ all_numbers = [TexMobject(str(n_u[0])).scale(0.5).shift(0.4*DOWN+2*n_u[1]*RIGHT) for n_u in zip(numbers+next_numbers, it.cycle([-1, 1]))]num_levels = 3scale_factor = 10@@ -887,8 +881,8 @@ class DefineInfiniteSum(Scene):if count % 3 == 2:self.wait(0.5)self.wait()- esses = np.array(terms)[range(0, len(terms), 3)]- other_terms = filter(lambda m : m not in esses, terms)+ esses = np.array(terms)[list(range(0, len(terms), 3))]+ other_terms = [m for m in terms if m not in esses]self.play(*[ApplyMethod(ess.set_color, "yellow")for ess in esses@@ -988,14 +982,14 @@ class ChopIntervalInProportions(Scene):if mode == "p":num_terms = 4prop = 0.7- left_terms = map(TexMobject, ["(1-p)", ["p","(1-p)"]]+[+ left_terms = list(map(TexMobject, ["(1-p)", ["p","(1-p)"]]+[["p^%d"%(count), "(1-p)"]for count in range(2, num_terms)- ])- right_terms = map(TexMobject, ["p"] + [+ ]))+ right_terms = list(map(TexMobject, ["p"] + [["p", "^%d"%(count+1)]for count in range(1, num_terms)- ])+ ]))interval = zero_to_one_interval()left = INTERVAL_RADIUS*LEFTright = INTERVAL_RADIUS*RIGHT@@ -1315,7 +1309,7 @@ class ListPartialDivergentSums(Scene):for n in range(num_lines)]terms = TexMobject(- list(it.chain.from_iterable(zip(rhss, lhss))) + ["\\vdots&", ""],+ list(it.chain.from_iterable(list(zip(rhss, lhss)))) + ["\\vdots&", ""],size = "\\large").shift(RIGHT).split()words = TextMobject("These numbers don't \\\\ approach anything")@@ -1792,7 +1786,7 @@ class RoomsAndSubroomsWithNumbers(Scene):def draw_remaining_rectangles(self, rectangles):clusters = []- centers = [ORIGIN] + map(Mobject.get_center, rectangles)+ centers = [ORIGIN] + list(map(Mobject.get_center, rectangles))shift_vals = [2*(c2 - c1)[0]*RIGHTfor c1, c2 in zip(centers[1:], centers)@@ -1800,10 +1794,7 @@ class RoomsAndSubroomsWithNumbers(Scene):for rectangle, count in zip(rectangles, it.count(1)):cluster = [rectangle]for shift_val in shift_vals[:count]:- cluster += map(- lambda mob : mob.shift(shift_val),- deepcopy(cluster)- )+ cluster += [mob.shift(shift_val) for mob in deepcopy(cluster)]clusters.append(cluster)for rect in cluster[1:]:self.play(FadeIn(rect, run_time = 0.6**(count-1)))@@ -1875,7 +1866,7 @@ class RoomsAndSubroomsWithNumbers(Scene):def center_in_closest_rect(mobject, rectangles):center = mobject.get_center()diffs = [r.get_center()-center for r in rectangles]- mobject.shift(diffs[np.argmin(map(np.linalg.norm, diffs))])+ mobject.shift(diffs[np.argmin(list(map(np.linalg.norm, diffs)))])def add_negative_one(self, num_mobs):neg_one = TexMobject("-1").scale(0.5)@@ -1901,10 +1892,7 @@ class RoomsAndSubroomsWithNumbers(Scene):self.add(text)self.clear_way_for_text(text, cluster)self.add(*cluster)- pairs = filter(- lambda a_b : (a_b[0]-a_b[1])%(2**count) == 0 and (a_b[0]-a_b[1])%(2**(count+1)) != 0,- it.combinations(range(16), 2)- )+ pairs = [a_b for a_b in it.combinations(list(range(16)), 2) if (a_b[0]-a_b[1])%(2**count) == 0 and (a_b[0]-a_b[1])%(2**(count+1)) != 0]for pair in sample(pairs, min(10, len(pairs))):for index in pair:num_mobs[index].set_color("green")@@ -2086,7 +2074,7 @@ class FuzzyDiscoveryToNewMath(Scene):)]midpoints = []- triplets = zip(fuzzy_discoveries, new_maths, it.count(2, -1.75))+ triplets = list(zip(fuzzy_discoveries, new_maths, it.count(2, -1.75)))for disc, math, count in triplets:math.scale(0.65)for mob in disc, math:@@ -2095,7 +2083,7 @@ class FuzzyDiscoveryToNewMath(Scene):midpoints.append(count*UP)self.add(fuzzy, lines)- self.play(*map(ShimmerIn, fuzzy_discoveries))+ self.play(*list(map(ShimmerIn, fuzzy_discoveries)))self.wait()self.play(DelayByOrder(Transform(deepcopy(fuzzy), new_mathdiff --git a/old_projects/inventing_math_images.py b/old_projects/inventing_math_images.pyindex 655277cc7..b6d1b7129 100644--- a/old_projects/inventing_math_images.py+++ b/old_projects/inventing_math_images.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import absolute_import+import numpy as npimport itertools as itfrom copy import deepcopy@@ -30,7 +30,7 @@ class SimpleText(Scene):]@staticmethoddef args_to_string(text):- return initials(filter(lambda c : c in string.letters + " ", text))+ return initials([c for c in text if c in string.letters + " "])def construct(self, text):self.add(TextMobject(text))diff --git a/old_projects/leibniz.py b/old_projects/leibniz.pyindex 4499ae77c..50aeca5fa 100644--- a/old_projects/leibniz.py+++ b/old_projects/leibniz.py@@ -43,7 +43,7 @@ class LatticePointScene(Scene):def setup_lattice_points(self):M = self.max_lattice_point_radius- int_range = range(-M, M+1)+ int_range = list(range(-M, M+1))self.lattice_points = VGroup()for x, y in it.product(*[int_range]*2):r_squared = x**2 + y**2@@ -91,10 +91,7 @@ class LatticePointScene(Scene):return radial_line, root_labeldef get_lattice_points_on_r_squared_circle(self, r_squared):- points = VGroup(*filter(- lambda dot : dot.r_squared == r_squared,- self.lattice_points- ))+ points = VGroup(*[dot for dot in self.lattice_points if dot.r_squared == r_squared])points.sort_submobjects(lambda p : angle_of_vector(p-self.plane_center)%(2*np.pi))@@ -122,8 +119,8 @@ class LatticePointScene(Scene):def add_axis_labels(self, spacing = 2):x_max = int(self.plane.point_to_coords(FRAME_X_RADIUS*RIGHT)[0])y_max = int(self.plane.point_to_coords(FRAME_Y_RADIUS*UP)[1])- x_range = range(spacing, x_max, spacing)- y_range = range(spacing, y_max, spacing)+ x_range = list(range(spacing, x_max, spacing))+ y_range = list(range(spacing, y_max, spacing))for r in x_range, y_range:r += [-n for n in r]tick = Line(ORIGIN, MED_SMALL_BUFF*UP)@@ -297,7 +294,7 @@ class ShowSum(TeacherStudentsScene):for n in range(self.num_terms_to_add)]partial_sums = np.cumsum(numbers)- points = map(line.number_to_point, partial_sums)+ points = list(map(line.number_to_point, partial_sums))arrows = [Arrow(p1, p2,@@ -327,7 +324,7 @@ class ShowSum(TeacherStudentsScene):fading_terms = [TexMobject(sign + "\\frac{1}{%d}"%(2*n + 1))for n, sign in zip(- range(self.num_terms_to_add),+ list(range(self.num_terms_to_add)),it.cycle("+-"))]@@ -473,7 +470,7 @@ class CertainRegularityInPrimes(LatticePointScene):self.get_radial_line_with_label(np.sqrt(p))for p in primes]- lines, labels = zip(*lines_and_labels)+ lines, labels = list(zip(*lines_and_labels))circles = [self.get_circle(np.sqrt(p))for p in primes@@ -617,7 +614,7 @@ class Outline(PiCreatureScene):self.wait()def show_chi(self):- input_range = range(1, 7)+ input_range = list(range(1, 7))chis = VGroup(*[TexMobject("\\chi(%d)"%n)for n in input_range@@ -774,7 +771,7 @@ class CountLatticePoints(LatticePointScene):run_time = 2,)self.wait(2)- self.play(*map(FadeOut, [label, lines, example_dot]))+ self.play(*list(map(FadeOut, [label, lines, example_dot])))def draw_lattice_points_in_circle(self):circle = self.get_circle()@@ -798,7 +795,7 @@ class CountLatticePoints(LatticePointScene):self.add_foreground_mobject(brace)self.draw_lattice_points()self.wait()- self.play(*map(FadeOut, [brace, radius]))+ self.play(*list(map(FadeOut, [brace, radius])))self.circle = circle@@ -1036,12 +1033,12 @@ class CountThroughRings(LatticePointScene):self.wait()self.play(Transform(distance, distance_num))self.wait(3)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.example_circle, self.points_on_example_circle,distance, a, b,radial_line, h_line, v_line,label- ]))+ ])))def count_through_rings(self):counts = [@@ -1053,7 +1050,7 @@ class CountThroughRings(LatticePointScene):"\\sqrt{%d} \\Rightarrow"%n, str(count))for n, count in zip(- range(self.num_rings_to_show_explicitly),+ list(range(self.num_rings_to_show_explicitly)),counts)])@@ -1285,11 +1282,11 @@ class LookAtExampleRing(LatticePointScene):self.wait()self.play(points.restore, run_time = 2)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [curr_label, curr_sum_of_squares,circle, points,radius, root_label- ]))+ ])))def analyze_11(self):R = np.sqrt(11)@@ -1406,7 +1403,7 @@ class IntroduceComplexConjugate(LatticePointScene):label.add_background_rectangle()label.next_to(dot, UP+RIGHT, buff = 0)- y_range = range(-9, 10, 3)+ y_range = list(range(-9, 10, 3))ticks = VGroup(*[Line(ORIGIN, MED_SMALL_BUFF*RIGHT@@ -1440,14 +1437,14 @@ class IntroduceComplexConjugate(LatticePointScene):)self.play(FadeIn(tuple_label))self.wait()- self.play(*map(FadeOut, [tuple_label, y_coord]))- self.play(*map(FadeIn, [complex_label, imag_y_coord]))- self.play(*map(Write, [imag_coords, ticks]))+ self.play(*list(map(FadeOut, [tuple_label, y_coord])))+ self.play(*list(map(FadeIn, [complex_label, imag_y_coord])))+ self.play(*list(map(Write, [imag_coords, ticks])))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [v_arrow, h_arrow,x_coord, imag_y_coord,- ]))+ ])))self.complex_label = complex_labelself.example_dot = dot@@ -1516,7 +1513,7 @@ class IntroduceComplexConjugate(LatticePointScene):morty = Mortimer().to_edge(DOWN)randy.make_eye_contact(morty)- self.play(*map(FadeIn, [randy, morty]))+ self.play(*list(map(FadeIn, [randy, morty])))self.play(PiCreatureSays(randy, "Wait \\dots why?",target_mode = "confused",@@ -1540,7 +1537,7 @@ class IntroduceComplexConjugate(LatticePointScene):self.play(Blink(morty))self.play(randy.change_mode, "pondering")self.play(RemovePiCreatureBubble(morty))- self.play(*map(FadeOut, [randy, morty]))+ self.play(*list(map(FadeOut, [randy, morty])))def expand_algebraically(self):x, y = self.example_coords@@ -1596,11 +1593,11 @@ class IntroduceComplexConjugate(LatticePointScene):Transform(expansion[1], alt_y_term),)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [expansion[0].rect,expansion[1].rect,expansion- ]))+ ])))def discuss_geometry(self):randy = Randolph(color = BLUE_C)@@ -1613,7 +1610,7 @@ class IntroduceComplexConjugate(LatticePointScene):screen = ScreenRectangle(height = 3.5)screen.to_corner(DOWN+RIGHT, buff = MED_SMALL_BUFF)- self.play(*map(FadeIn, [randy, morty]))+ self.play(*list(map(FadeIn, [randy, morty])))self.play(PiCreatureSays(morty, "More geometry!",target_mode = "hooray",@@ -1639,7 +1636,7 @@ class IntroduceComplexConjugate(LatticePointScene):self.play(Blink(morty))self.play(RemovePiCreatureBubble(randy, target_mode = "pondering"))self.wait()- self.play(*map(FadeOut, [randy, morty, screen]))+ self.play(*list(map(FadeOut, [randy, morty, screen])))def show_geometrically(self):dots = [self.example_dot, self.conjugate_dot]@@ -1795,7 +1792,7 @@ class NameGaussianIntegers(LatticePointScene):run_time = 1, rate_func = smooth,about_point = self.plane_center),- *map(GrowFromCenter, dots)+ *list(map(GrowFromCenter, dots)))self.play(Write(root_label))self.wait()@@ -1841,10 +1838,10 @@ class NameGaussianIntegers(LatticePointScene):])dot.conjugate_dot = self.circle_dots[-i]- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.a_plus_bi, self.integers_label,self.gaussian_integers,- ]))+ ])))last_dot = Nonefor dot in self.circle_dots:@@ -1857,7 +1854,7 @@ class NameGaussianIntegers(LatticePointScene):FadeIn(dot.equation),FadeIn(dot.label),]- anims += map(ShowCreation, dot.line_pair)+ anims += list(map(ShowCreation, dot.line_pair))else:anims += [last_dot.set_color, self.dot_color,@@ -2056,7 +2053,7 @@ class IntroduceGaussianPrimes(LatticePointScene, PiCreatureScene):VGroup(p1_dot, p2_dot)))- self.play(*map(Write, [p1_label, p2_label]))+ self.play(*list(map(Write, [p1_label, p2_label])))self.wait()self.play(Write(gaussian_prime))self.wait()@@ -2157,7 +2154,7 @@ class FromIntegerFactorsToGaussianFactors(TeacherStudentsScene):mob.copy(),mob.factors),- *map(ShowCreation, mob.arrows)+ *list(map(ShowCreation, mob.arrows)))self.wait()self.play(*[@@ -2191,8 +2188,8 @@ class FactorizationPattern(Scene):x_min = 0,x_max = 36,unit_size = 0.4,- numbers_to_show = range(0, 33, 4),- numbers_with_elongated_ticks = range(0, 33, 4),+ numbers_to_show = list(range(0, 33, 4)),+ numbers_with_elongated_ticks = list(range(0, 33, 4)),)line.shift(2*DOWN)line.to_edge(LEFT)@@ -2208,7 +2205,7 @@ class FactorizationPattern(Scene):for prime in primes])dots.set_color(GREEN)- prime_mobs = VGroup(*map(TexMobject, map(str, primes)))+ prime_mobs = VGroup(*list(map(TexMobject, list(map(str, primes)))))arrows = VGroup()for prime_mob, dot in zip(prime_mobs, dots):prime_mob.next_to(dot, UP, LARGE_BUFF)@@ -2236,9 +2233,9 @@ class FactorizationPattern(Scene):factorization.add(v_dots)self.play(*it.chain(- map(Write, prime_mobs),- map(ShowCreation, arrows),- map(DrawBorderThenFill, dots),+ list(map(Write, prime_mobs)),+ list(map(ShowCreation, arrows)),+ list(map(DrawBorderThenFill, dots)),))self.wait()self.play(*[@@ -2255,7 +2252,7 @@ class FactorizationPattern(Scene):submobject_mode = "lagged_start"))self.wait(4)- self.play(*map(FadeOut, [movers, factorizations]))+ self.play(*list(map(FadeOut, [movers, factorizations])))def show_three_mod_four_primes(self):primes = [3, 7, 11, 19, 23, 31]@@ -2264,7 +2261,7 @@ class FactorizationPattern(Scene):for prime in primes])dots.set_color(RED)- prime_mobs = VGroup(*map(TexMobject, map(str, primes)))+ prime_mobs = VGroup(*list(map(TexMobject, list(map(str, primes)))))arrows = VGroup()for prime_mob, dot in zip(prime_mobs, dots):prime_mob.next_to(dot, UP, LARGE_BUFF)@@ -2285,17 +2282,17 @@ class FactorizationPattern(Scene):])self.play(*it.chain(- map(Write, prime_mobs),- map(ShowCreation, arrows),- map(DrawBorderThenFill, dots),+ list(map(Write, prime_mobs)),+ list(map(ShowCreation, arrows)),+ list(map(DrawBorderThenFill, dots)),))self.wait()self.play(Write(words),- *map(ShowCreation, word_arrows)+ *list(map(ShowCreation, word_arrows)))self.wait(4)- self.play(*map(FadeOut, [words, word_arrows]))+ self.play(*list(map(FadeOut, [words, word_arrows])))def ask_why_this_is_true(self):randy = Randolph(color = BLUE_C)@@ -2320,10 +2317,10 @@ class FactorizationPattern(Scene):self.wait()self.play(FadeIn(links_text))self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [randy, randy.bubble, randy.bubble.content,links_text- ]))+ ])))def show_two(self):two_dot = Dot(self.number_line.number_to_point(2))@@ -2493,9 +2490,9 @@ class IntroduceRecipe(Scene):factors = self.integer_factorssymbols = ["="] + ["\\cdot"]*(len(factors)-1)- factorization = TexMobject(*it.chain(*zip(- symbols, map(str, factors)- )))+ factorization = TexMobject(*it.chain(*list(zip(+ symbols, list(map(str, factors))+ ))))factorization.next_to(N_mob.target, RIGHT)self.play(MoveToTarget(@@ -2512,7 +2509,7 @@ class IntroduceRecipe(Scene):def subfactor_ordinary_factorization(self):factors = self.gaussian_factorsfactorization = TexMobject(- "=", *map(self.complex_number_to_tex, factors)+ "=", *list(map(self.complex_number_to_tex, factors)))max_width = FRAME_WIDTH - 2if factorization.get_width() > max_width:@@ -2628,7 +2625,7 @@ class IntroduceRecipe(Scene):ShowCreation(arrow))self.wait(3)- self.play(*map(FadeOut, [words, arrow]))+ self.play(*list(map(FadeOut, [words, arrow])))self.output_label_group = VGroup(words, arrow)@@ -2900,7 +2897,7 @@ class ThreeOutputsAsLatticePointsContinued(ThreeOutputsAsLatticePoints):self.play(FadeIn(words_group[0]),- *map(ShowCreation, lines)+ *list(map(ShowCreation, lines)))for words, angle, color in zip(words_group[1:], angles, self.colors[1:]):self.play(FadeIn(words))@@ -3315,7 +3312,7 @@ class SummarizeCountingRule(Show125Circle):MoveToTarget(choices_copy),FadeIn(equals_four))- self.play(*map(FadeIn, [final_choice_words, final_choice_arrow]))+ self.play(*list(map(FadeIn, [final_choice_words, final_choice_arrow])))self.wait()def ask_about_two(self):@@ -3387,7 +3384,7 @@ class RecipeFor10(IntroduceRecipe):MaintainPositionRelativeTo(times_i, arrow))self.wait(2)- self.play(*map(FadeOut, [arrow, times_i, curr_product]))+ self.play(*list(map(FadeOut, [arrow, times_i, curr_product])))class FactorsOfTwoNeitherHelpNorHurt(TeacherStudentsScene):def construct(self):@@ -3406,15 +3403,15 @@ class EffectOfPowersOfTwo(LatticePointScene):"square_radii" : [5, 10, 20, 40, 80],}def construct(self):- radii = map(np.sqrt, self.square_radii)- circles = map(self.get_circle, radii)- radial_lines, root_labels = zip(*map(+ radii = list(map(np.sqrt, self.square_radii))+ circles = list(map(self.get_circle, radii))+ radial_lines, root_labels = list(zip(*list(map(self.get_radial_line_with_label, radii- ))- dots_list = map(+ ))))+ dots_list = list(map(self.get_lattice_points_on_r_squared_circle,self.square_radii- )+ ))groups = [VGroup(*mobs)for mobs in zip(radial_lines, circles, root_labels, dots_list)@@ -3445,7 +3442,7 @@ class NumberTheoryAtItsBest(TeacherStudentsScene):class IntroduceChi(FactorizationPattern):CONFIG = {"numbers_list" : [- range(i, 36, d)+ list(range(i, 36, d))for i, d in (1, 4), (3, 4), (2, 2)],"colors" : [GREEN, RED, YELLOW]@@ -3510,13 +3507,13 @@ class IntroduceChi(FactorizationPattern):self.wait()def fade_out_labels(self):- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.last_dots, self.last_arrows, self.last_labels,self.number_line- ]))+ ])))def cyclic_pattern(self):- input_range = range(1, 9)+ input_range = list(range(1, 9))chis = VGroup(*[TexMobject("\\chi(%d)"%n)for n in input_range@@ -3557,7 +3554,7 @@ class IntroduceChi(FactorizationPattern):))self.wait()- self.play(*map(FadeOut, [chis, arrows, numbers]))+ self.play(*list(map(FadeOut, [chis, arrows, numbers])))def write_multiplicative_label(self):morty = Mortimer()@@ -3949,9 +3946,9 @@ class ExpandCountWith45(SummarizeCountingRule):self.factorization = factorizationdef expand_expression(self):- equals, four, lp, rp = map(TexMobject, [+ equals, four, lp, rp = list(map(TexMobject, ["=", "4", "\\big(", "\\big)"- ])+ ]))expansion = VGroup(equals, four, lp)chi_pairs = list(it.product(*[factor[1::2]@@ -4002,7 +3999,7 @@ class ExpandCountWith45(SummarizeCountingRule):for movers in mover_groups:self.wait()self.play(movers.next_to, rect, DOWN)- self.play(*map(MoveToTarget, movers))+ self.play(*list(map(MoveToTarget, movers)))self.play(Write(plusses))self.wait()@@ -4010,9 +4007,9 @@ class ExpandCountWith45(SummarizeCountingRule):self.prime_pairs = prime_pairsdef show_divisor_sum(self):- equals, four, lp, rp = map(TexMobject, [+ equals, four, lp, rp = list(map(TexMobject, ["=", "4", "\\big(", "\\big)"- ])+ ]))divisor_sum = VGroup(equals, four, lp)num_pairs = list(it.product([1, 3, 9], [1, 5]))@@ -4102,7 +4099,7 @@ class CountLatticePointsInBigCircle(LatticePointScene):pi_R_squared_rect = BackgroundRectangle(pi_R_squared)pi_R_squared_group = VGroup(pi_R_squared_rect, pi_R_squared)- self.play(*map(FadeIn, [circle, radius, R_group]))+ self.play(*list(map(FadeIn, [circle, radius, R_group])))self.add_foreground_mobject(R_group)self.draw_lattice_points()self.wait()@@ -4123,7 +4120,7 @@ class CountLatticePointsInBigCircle(LatticePointScene):self.radius = radiusdef show_rings(self):- N_range = range(self.max_lattice_point_radius**2)+ N_range = list(range(self.max_lattice_point_radius**2))rings = VGroup(*[self.get_circle(radius = np.sqrt(N))for N in N_range@@ -4178,8 +4175,8 @@ class CountLatticePointsInBigCircle(LatticePointScene):])new_dots.sort_submobjects(np.linalg.norm)- self.play(*map(ShowCreation, [circle, arrow]))- self.play(*map(FadeOut, [circle, arrow]))+ self.play(*list(map(ShowCreation, [circle, arrow])))+ self.play(*list(map(FadeOut, [circle, arrow])))self.play(FadeOut(center_dot))self.lattice_points.remove(center_dot)self.wait()@@ -4278,10 +4275,10 @@ class AddUpGrid(Scene):fours = VGroup()parens = VGroup()arrows = VGroup()- for N, radical in zip(range(1, 13), self.radicals):- arrow, four, lp, rp = map(TexMobject, [+ for N, radical in zip(list(range(1, 13)), self.radicals):+ arrow, four, lp, rp = list(map(TexMobject, ["\\Rightarrow", "4", "\\big(", "\\big)"- ])+ ]))fours.add(four)parens.add(lp, rp)arrows.add(arrow)@@ -4372,7 +4369,7 @@ class AddUpGrid(Scene):)self.play(Blink(randy))self.wait()- self.play(*map(FadeOut, [prime_rects, randy]))+ self.play(*list(map(FadeOut, [prime_rects, randy])))def organize_into_columns(self):left_x = self.arrows.get_right()[0] + SMALL_BUFF@@ -4390,8 +4387,8 @@ class AddUpGrid(Scene):)self.play(*it.chain(- map(MoveToTarget, self.chi_mobs),- map(MoveToTarget, self.plusses),+ list(map(MoveToTarget, self.chi_mobs)),+ list(map(MoveToTarget, self.plusses)),), run_time = 2)self.wait()@@ -4414,7 +4411,7 @@ class AddUpGrid(Scene):approx.next_to(words, RIGHT, SMALL_BUFF)words.add(approx)- self.play(*map(FadeIn, [rect, words]))+ self.play(*list(map(FadeIn, [rect, words])))self.wait()self.count_rect = rect@@ -4483,7 +4480,7 @@ class AddUpGrid(Scene):self.corner_four.generate_target()R_squared = TexMobject("R^2")dots = TexMobject("\\cdots")- lp, rp = map(TexMobject, ["\\big(", "\\big)"])+ lp, rp = list(map(TexMobject, ["\\big(", "\\big)"]))new_sum = VGroup(self.corner_four.target, R_squared, lp)@@ -4519,8 +4516,8 @@ class AddUpGrid(Scene):R_movers.add(mover)self.play(*it.chain(- map(Write, [lp, rp, dots]),- map(MoveToTarget, full_sum_parts),+ list(map(Write, [lp, rp, dots])),+ list(map(MoveToTarget, full_sum_parts)),), run_time = 2)self.remove(R_movers)self.add(R_squared)@@ -4550,10 +4547,10 @@ class AddUpGrid(Scene):)self.play(- *map(FadeOut, [+ *list(map(FadeOut, [self.chi_mobs, self.plusses, self.arrows,self.radicals, self.row_lines- ]) + [+ ])) + [FadeOut(self.count_rect),Animation(self.new_sum),Animation(self.count_words),@@ -4786,7 +4783,7 @@ class Thumbnail(Scene):primes = [n for n in range(2, 1000)- if all(n%k != 0 for k in range(2, n))+ if all(n%k != 0 for k in list(range(2, n)))]prime_mobs = VGroup()x_spacing = 1.7diff --git a/old_projects/lost_lecture.py b/old_projects/lost_lecture.pyindex ef22211f8..8b2305e92 100644--- a/old_projects/lost_lecture.py+++ b/old_projects/lost_lecture.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from big_ol_pile_of_manim_imports import *from old_projects.div_curl import VectorField@@ -985,7 +985,7 @@ class FeynmanElementaryQuote(Scene):to know ahead of time in order to understand it,except to have an infinite amount of intelligence."""- quote_parts = filter(lambda s: s, quote_text.split(" "))+ quote_parts = [s for s in quote_text.split(" ") if s]quote = TextMobject(*quote_parts,tex_to_color_map={@@ -1042,7 +1042,7 @@ class FeynmanElementaryQuote(Scene):images.arrange_submobjects(RIGHT, buff=LARGE_BUFF)images.to_edge(DOWN, buff=LARGE_BUFF)images[1].move_to(images[0])- crosses = VGroup(*map(Cross, images))+ crosses = VGroup(*list(map(Cross, images)))crosses.set_stroke("RED", 10)for image, cross in zip(images, crosses):@@ -1135,16 +1135,13 @@ class TableOfContents(Scene):))self.wait()for item in items:- other_items = VGroup(*filter(- lambda m: m is not item,- items- ))+ other_items = VGroup(*[m for m in items if m is not item])new_item = item.copy()new_item.scale(scale_factor, about_edge=LEFT)new_item.set_fill(WHITE, 1)self.play(Transform(item, new_item),- *map(MoveToTarget, other_items)+ *list(map(MoveToTarget, other_items)))self.wait()@@ -1316,7 +1313,7 @@ class ShowEllipseDefiningProperty(Scene):self.play(ReplacementTransform(focus_words.copy(), foci_word),)- self.play(*map(ShowCreation, connecting_lines))+ self.play(*list(map(ShowCreation, connecting_lines)))for word in list(focus_words) + [foci_word]:word.add_background_rectangle()self.add_foreground_mobjects(word)@@ -1619,10 +1616,10 @@ class ProveEllipse(ShowEmergingEllipse, ShowEllipseDefiningProperty):focal_sum_point = VectorizedPoint()focal_sum_point.move_to(circle.get_top())dots = [self.ep_dot, self.center_dot]- colors = map(Mobject.get_color, dots)+ colors = list(map(Mobject.get_color, dots))def get_foci():- return map(Mobject.get_center, dots)+ return list(map(Mobject.get_center, dots))focal_lines, focal_lines_update_animation = \self.get_focal_lines_and_update(get_foci, focal_sum_point)@@ -1662,10 +1659,10 @@ class ProveEllipse(ShowEmergingEllipse, ShowEllipseDefiningProperty):)self.wait()self.remove(*to_add)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [focal_lines, distance_labels,sum_expression, numbers- ]))+ ])))self.set_variables_as_attrs(focal_lines, focal_lines_update_animation,@@ -2027,7 +2024,7 @@ class ProveEllipse(ShowEmergingEllipse, ShowEllipseDefiningProperty):self.wait()self.remove(*self.focal_sum_things_to_add)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [radial_line,QP_line,P_dot, P_label,@@ -2038,7 +2035,7 @@ class ProveEllipse(ShowEmergingEllipse, ShowEllipseDefiningProperty):self.sum_expression,sum_rect,tangency_comment,- ]))+ ])))self.wait()# Show all lines@@ -2578,7 +2575,7 @@ class AngularMomentumArgument(KeplersSecondLaw):area_label.get_part_by_tex(tex).copy(),area_expression.get_part_by_tex(tex),)- for tex in "=", "\\frac{1}{2}", "\\times"+ for tex in ("=", "\\frac{1}{2}", "\\times")])self.play(Restore(R_term))self.play(ReplacementTransform(@@ -2761,7 +2758,7 @@ class FeynmanRecountingNewton(Scene):FadeInAndShiftFromDirection(mob, direction=3 * LEFT)- for mob in principia, principia.rect+ for mob in (principia, principia.rect)])self.wait()@@ -2930,7 +2927,7 @@ class IntroduceShapeOfVelocities(AskAboutEllipses, MovingCameraScene):p1, p2 = [ellipse.point_from_proportion(a)- for a in alpha, alpha + d_alpha+ for a in (alpha, alpha + d_alpha)]vector = Arrow(p1, p2, buff=0@@ -3111,7 +3108,7 @@ class ShowEqualAngleSlices(IntroduceShapeOfVelocities):self.play(FadeIn(faders),- *map(ShowCreation, lines)+ *list(map(ShowCreation, lines)))self.play(*[LaggedStart(@@ -3670,7 +3667,7 @@ class UseVelocityDiagramToDeduceCurve(ShowEqualAngleSlices):frame.shift(3 * LEFT + 0.5 * UP)self.play(ApplyWave(ellipse))- self.play(*map(GrowArrow, vectors))+ self.play(*list(map(GrowArrow, vectors)))self.play(LaggedStart(MoveToTarget, vectors,@@ -3908,7 +3905,7 @@ class UseVelocityDiagramToDeduceCurve(ShowEqualAngleSlices):self.wait()self.play(ShowCreation(cross))self.wait()- self.play(*map(FadeOut, [v_line, arc, theta_q, cross]))+ self.play(*list(map(FadeOut, [v_line, arc, theta_q, cross])))self.wait()self.play(ReplacementTransform(@@ -4076,7 +4073,7 @@ class UseVelocityDiagramToDeduceCurve(ShowEqualAngleSlices):self.play(self.ghost_lines.set_stroke, {"width": 0.5},self.eccentric_lines.set_stroke, {"width": 0.5},- *map(WiggleOutThenIn, [e_line, c_line])+ *list(map(WiggleOutThenIn, [e_line, c_line])))for x in range(3):self.play(diff --git a/old_projects/moser_intro.py b/old_projects/moser_intro.pyindex 360e965db..e20478611 100644--- a/old_projects/moser_intro.py+++ b/old_projects/moser_intro.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import absolute_import+import numpy as npimport itertools as itimport operator as op@@ -37,7 +37,7 @@ def count_sections(*radians):]dots = [Dot(point) for point in points]interior = Region(lambda x, y : x**2 + y**2 < RADIUS**2)- for x in xrange(1, len(points)):+ for x in range(1, len(points)):if x == 1:sc.animate(ShowCreation(dots[0]), ShowCreation(dots[1]))sc.add(dots[0], dots[1])@@ -45,7 +45,7 @@ def count_sections(*radians):sc.animate(ShowCreation(dots[x]))sc.add(dots[x])new_lines = Mobject(*[- Line(points[x], points[y]) for y in xrange(x)+ Line(points[x], points[y]) for y in range(x)])sc.animate(Transform(deepcopy(dots[x]), new_lines, run_time = 2.0))sc.add(new_lines)@@ -53,7 +53,7 @@ def count_sections(*radians):regions = plane_partition_from_points(*points[:x+1])for reg in regions:reg.intersect(interior)- regions = filter(lambda reg : reg.bool_grid.any(), regions)+ regions = [reg for reg in regions if reg.bool_grid.any()]last_num = Nonefor reg, count in zip(regions, it.count(1)):@@ -81,9 +81,9 @@ def summarize_pattern(*radians):]dots = [Dot(point) for point in points]last_num = None- for x in xrange(len(points)):+ for x in range(len(points)):new_lines = Mobject(*[- Line(points[x], points[y]) for y in xrange(x)+ Line(points[x], points[y]) for y in range(x)])num = TexMobject(str(moser_function(x + 1))).center()sc.animate(@@ -110,7 +110,7 @@ def connect_points(*radians):sc.add(*dots)anims = []all_lines = []- for x in xrange(len(points)):+ for x in range(len(points)):lines = [Line(points[x], points[y]) for y in range(len(points))]lines = Mobject(*lines)anims.append(Transform(deepcopy(dots[x]), lines, run_time = 3.0))diff --git a/old_projects/moser_main.py b/old_projects/moser_main.pyindex ec1cfc430..94a2f2e4e 100644--- a/old_projects/moser_main.py+++ b/old_projects/moser_main.py@@ -72,12 +72,9 @@ class CircleScene(Scene):self.remove(*self.lines)self.lines = []for point_pair in it.combinations(self.points, 2):- int_points = filter(- lambda p : is_on_line(p, *point_pair),- self.intersection_points- )+ int_points = [p for p in self.intersection_points if is_on_line(p, *point_pair)]points = list(point_pair) + int_points- points = map(lambda p : (p[0], p[1], 0), points)+ points = [(p[0], p[1], 0) for p in points]points.sort(cmp = lambda x,y: cmp(x[0], y[0]))self.lines += [Line(points[i], points[i+1])@@ -121,7 +118,7 @@ class CircleScene(Scene):def generate_regions(self):self.regions = plane_partition_from_points(*self.points)interior = Region(lambda x, y : x**2 + y**2 < self.radius**2)- map(lambda r : r.intersect(interior), self.regions)+ list(map(lambda r : r.intersect(interior), self.regions))self.exterior = interior.complement()@@ -136,8 +133,8 @@ class CountSections(CircleScene):], run_time = 2.0)regions = plane_partition_from_points(*self.points)interior = Region(lambda x, y : x**2 + y**2 < self.radius**2)- map(lambda r : r.intersect(interior), regions)- regions = filter(lambda r : r.bool_grid.any(), regions)+ list(map(lambda r : r.intersect(interior), regions))+ regions = [r for r in regions if r.bool_grid.any()]self.count_regions(regions, num_offset = ORIGIN)class MoserPattern(CircleScene):@@ -247,7 +244,7 @@ class HardProblemsSimplerQuestions(Scene):omega = np.array((0.5, 0.5*np.sqrt(3), 0))dots = Mobject(*[Dot(t*np.array((1, 0, 0)) + s * omega)- for t, s in it.product(range(-2, 3), range(-2, 3))+ for t, s in it.product(list(range(-2, 3)), list(range(-2, 3)))])for mob in dots, other_grid:mob.scale(0.5).shift(left_center + (0, 2, 0))@@ -391,7 +388,7 @@ class GeneralPositionRule(Scene):(np.arange(0, 2*np.pi, np.pi/3),"Not okay",- zip(range(3), range(3, 6))+ list(zip(list(range(3)), list(range(3, 6))))),(RADIANS,@@ -401,7 +398,7 @@ class GeneralPositionRule(Scene):(np.arange(0, 2*np.pi, np.pi/4),"Not okay",- zip(range(4), range(4, 8))+ list(zip(list(range(4)), list(range(4, 8))))),([2*np.pi*random() for x in range(5)],@@ -486,7 +483,7 @@ class IllustrateNChooseK(Scene):def __init__(self, n, k, *args, **kwargs):Scene.__init__(self, *args, **kwargs)- nrange = range(1, n+1)+ nrange = list(range(1, n+1))tuples = list(it.combinations(nrange, k))nrange_mobs = TexMobject([str(n) + r'\;' for n in nrange]).split()tuple_mobs = TexMobjects(@@ -550,7 +547,7 @@ class IllustrateNChooseK(Scene):class IntersectionPointCorrespondances(CircleScene):args_list = [- (RADIANS, range(0, 7, 2)),+ (RADIANS, list(range(0, 7, 2))),]@staticmethoddef args_to_string(*args):@@ -569,7 +566,7 @@ class IntersectionPointCorrespondances(CircleScene):intersection_dot = Dot(intersection_point)intersection_dot_arrow = Arrow(intersection_point).nudge()self.add(intersection_dot)- pairs = list(it.combinations(range(len(radians)), 2))+ pairs = list(it.combinations(list(range(len(radians))), 2))lines_to_save = [self.lines[pairs.index((indices[p0], indices[p1]))]for p0, p1 in [(0, 2), (1, 3)]@@ -628,7 +625,7 @@ class LinesIntersectOutside(CircleScene):)intersection_point = tuple(list(intersection_point) + [0])intersection_dot = Dot(intersection_point)- pairs = list(it.combinations(range(len(radians)), 2))+ pairs = list(it.combinations(list(range(len(radians))), 2))lines_to_save = [self.lines[pairs.index((indices[p0], indices[p1]))]for p0, p1 in [(0, 1), (2, 3)]@@ -647,7 +644,7 @@ class LinesIntersectOutside(CircleScene):class QuadrupletsToIntersections(CircleScene):def __init__(self, radians, *args, **kwargs):CircleScene.__init__(self, radians, *args, **kwargs)- quadruplets = it.combinations(range(len(radians)), 4)+ quadruplets = it.combinations(list(range(len(radians))), 4)frame_time = 1.0for quad in quadruplets:intersection_dot = Dot(intersection(@@ -780,12 +777,12 @@ class EulersFormula(GraphScene):(key, mob)for key, mob in zip(terms, TexMobjects(terms))])- for mob in form.values():+ for mob in list(form.values()):mob.shift((0, FRAME_Y_RADIUS-0.7, 0))- formula = Mobject(*[form[k] for k in form.keys() if k != "=2"])+ formula = Mobject(*[form[k] for k in list(form.keys()) if k != "=2"])new_form = dict([(key, deepcopy(mob).shift((0, -0.7, 0)))- for key, mob in zip(form.keys(), form.values())+ for key, mob in zip(list(form.keys()), list(form.values()))])self.add(formula)colored_dots = [@@ -870,7 +867,7 @@ class CannotDirectlyApplyEulerToMoser(CircleScene):class ShowMoserGraphLines(CircleScene):def __init__(self, radians, *args, **kwargs):- radians = list(set(map(lambda x : x%(2*np.pi), radians)))+ radians = list(set([x%(2*np.pi) for x in radians]))radians.sort()CircleScene.__init__(self, radians, *args, **kwargs)n, plus_n_choose_4 = TexMobject(["n", "+{n \\choose 4}"]).split()@@ -931,7 +928,7 @@ class ShowMoserGraphLines(CircleScene):class HowIntersectionChopsLine(CircleScene):args_list = [- (RADIANS, range(0, 7, 2)),+ (RADIANS, list(range(0, 7, 2))),]@staticmethoddef args_to_string(*args):@@ -947,7 +944,7 @@ class HowIntersectionChopsLine(CircleScene):)if len(intersection_point) == 2:intersection_point = list(intersection_point) + [0]- pairs = list(it.combinations(range(len(radians)), 2))+ pairs = list(it.combinations(list(range(len(radians))), 2))lines = [Line(self.points[indices[p0]], self.points[indices[p1]])for p0, p1 in [(2, 0), (1, 3)]@@ -1041,11 +1038,11 @@ class ApplyEulerToMoser(CircleScene):for d in dicts:if not d:continue- main_key = d.keys()[0]- for key in d.keys():+ main_key = list(d.keys())[0]+ for key in list(d.keys()):d[key].shift(shift_val)main_center = d[main_key].get_center()- for key in d.keys():+ for key in list(d.keys()):d[key] = deepcopy(d[main_key]).shift(d[key].get_center() - main_center)@@ -1445,7 +1442,7 @@ class MoserSolutionInPascal(PascalsTriangleScene):])self.wait()- term_range = range(0, min(4, n)+1, 2)+ term_range = list(range(0, min(4, n)+1, 2))target_terms = dict([(k, deepcopy(self.coords_to_mobs[n][k]).set_color(term_color))for k in term_range@@ -1643,7 +1640,7 @@ class ExplainNChoose4Formula(Scene):r"There are $(4 \cdot 3 \cdot 2 \cdot 1)$ total permutations").shift((0, -2, 0))self.add(parens, num_perms_explain, *form_mobs)- perms = list(it.permutations(range(4)))+ perms = list(it.permutations(list(range(4))))for count in range(6):perm = perms[randint(0, 23)]new_quad_mobs = [diff --git a/old_projects/mug.py b/old_projects/mug.pyindex 7f96ae48c..b58bc0721 100644--- a/old_projects/mug.py+++ b/old_projects/mug.py@@ -9,9 +9,9 @@ from old_projects.efvgt import ConfettiSpirilclass HappyHolidays(TeacherStudentsScene):def construct(self):- hats = VGroup(*map(+ hats = VGroup(*list(map(self.get_hat, self.pi_creatures- ))+ )))self.add(self.get_snowflakes())self.change_student_modes(*["hooray"]*3,@@ -642,7 +642,7 @@ class TwoKindsOfViewers(PiCreatureScene, UtilitiesPuzzleScene):words.to_edge(UP)eulers = words.get_part_by_tex("V-E+F")eulers.set_color(GREEN)- non_eulers = VGroup(*filter(lambda m : m is not eulers, words))+ non_eulers = VGroup(*[m for m in words if m is not eulers])self.add(words)self.wait()@@ -676,10 +676,10 @@ class TwoKindsOfViewers(PiCreatureScene, UtilitiesPuzzleScene):self.wait()### Out of thin air- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [non_eulers, pi1, pi2, pi1.bubble,know_eulers, dont- ]))+ ])))self.play(eulers.next_to, ORIGIN, LEFT, LARGE_BUFF)arrow = Arrow(eulers, objects, color = WHITE)self.play(@@ -766,7 +766,7 @@ class IntroduceRegions(UtilitiesPuzzleScene):FadeOut(back_region),FadeOut(front_regions[0]),FadeOut(paint_bucket),- *map(Animation, front_regions[1:])+ *list(map(Animation, front_regions[1:])))#Line tries to escape@@ -1055,9 +1055,9 @@ class LightUpNodes(IntroduceRegions):title.add(underline)self.add(title)self.count_titles = titles- self.v_count, self.e_count, self.f_count = self.counts = map(+ self.v_count, self.e_count, self.f_count = self.counts = list(map(Integer, [1, 0, 1]- )+ ))for count, title in zip(self.counts, titles):count.next_to(title, DOWN)self.add(count)@@ -1097,9 +1097,9 @@ class LightUpNodes(IntroduceRegions):LaggedStart(GrowArrow, dim_arrows))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [lit_word, lit_arrow, dim_word, dim_arrows- ]))+ ])))def show_rule_for_lighting(self):lines = self.lines@@ -1318,7 +1318,7 @@ class ConcludeFiveRegions(LightUpNodes):remover = True,),Indicate(self.f_count),- *map(Animation, self.mobjects)+ *list(map(Animation, self.mobjects)))self.wait()@@ -1367,10 +1367,7 @@ class ConcludeFiveRegions(LightUpNodes):f_rect = SurroundingRectangle(VGroup(self.count_titles[-1], self.f_count))- on_screen_side_lines = VGroup(*filter(- lambda m : m in self.mobjects,- self.side_lines- ))+ on_screen_side_lines = VGroup(*[m for m in self.side_lines if m in self.mobjects])side_lines_rect = SurroundingRectangle(on_screen_side_lines)side_lines_rect.set_color(WHITE)@@ -1701,7 +1698,7 @@ class FiveRegionsFourEdgesEachGraph(Scene):self.play(FadeIn(r1), run_time = 0.5)self.play(FadeIn(r2), Animation(r1), run_time = 0.5)self.wait(0.5)- self.play(*map(FadeOut, [r2, r1, edge]), run_time = 0.5)+ self.play(*list(map(FadeOut, [r2, r1, edge])), run_time = 0.5)self.remove_foreground_mobjects(edge)def ten_total_edges(self):@@ -1762,7 +1759,7 @@ class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene):])points *= 0.75points += DOWN- vertices = VGroup(*map(Dot, points))+ vertices = VGroup(*list(map(Dot, points)))vertices.set_color(YELLOW)edges = VGroup(*[VGroup(*[@@ -1817,9 +1814,9 @@ class EulersFormulaForGeneralPlanarGraph(LightUpNodes, ThreeDScene):groups = [count_titles, counts]for group in groups:- group.symbols = VGroup(*map(TexMobject, ["-", "+", "="]))+ group.symbols = VGroup(*list(map(TexMobject, ["-", "+", "="])))group.generate_target()- line = VGroup(*it.chain(*zip(group.target, group.symbols)))+ line = VGroup(*it.chain(*list(zip(group.target, group.symbols))))line.arrange_submobjects(RIGHT)line.to_edge(UP, buff = MED_SMALL_BUFF)VGroup(counts.target, counts.symbols).shift(0.75*DOWN)diff --git a/old_projects/music_and_measure.py b/old_projects/music_and_measure.pyindex 95091c2c1..848cc99c7 100644--- a/old_projects/music_and_measure.py+++ b/old_projects/music_and_measure.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import absolute_import+import numpy as npimport itertools as itfrom copy import deepcopy@@ -166,7 +166,7 @@ class IntervalScene(NumberLineScene):pause_time = 1.0,remove_as_you_go = True):shrink = not remove_as_you_go- for fraction, count in zip(rationals(), range(num_fractions)):+ for fraction, count in zip(rationals(), list(range(num_fractions))):frac_mob, tick = self.add_fraction(fraction, shrink)self.wait(pause_time)if remove_as_you_go:@@ -189,7 +189,7 @@ class IntervalScene(NumberLineScene):def add_fraction_ticks(self, num_fractions = 1000, run_time = 0):long_tick_size = self.number_line.tick_size*TICK_STRETCH_FACTORall_ticks = []- for frac, count in zip(rationals(), range(num_fractions)):+ for frac, count in zip(rationals(), list(range(num_fractions))):point = self.number_line.number_to_point(frac)tick_rad = 2.0*long_tick_size/frac.denominatortick = Line(point+tick_rad*DOWN, point+tick_rad*UP)@@ -255,7 +255,7 @@ class IntervalScene(NumberLineScene):class TwoChallenges(Scene):def construct(self):two_challenges = TextMobject("Two Challenges", size = "\\Huge").to_edge(UP)- one, two = map(TextMobject, ["1.", "2."])+ one, two = list(map(TextMobject, ["1.", "2."]))one.shift(UP).to_edge(LEFT)two.shift(DOWN).to_edge(LEFT)notes = ImageMobject("musical_notes").scale(0.3)@@ -832,10 +832,10 @@ class AllValuesBetween1And2(NumberLineScene):NumberLineScene.construct(self)irrational = 1.2020569031595942cont_frac = [1, 4, 1, 18, 1, 1, 1, 4, 1, 9, 9, 2, 1, 1, 1, 2]- one, two, irr = map(+ one, two, irr = list(map(self.number_line.number_to_point,[1, 2, irrational]- )+ ))top_arrow = Arrow(one+UP, one)bot_arrow = Arrow(irr+2*DOWN, irr)r = TexMobject("r").next_to(top_arrow, UP)@@ -876,7 +876,7 @@ class AllValuesBetween1And2(NumberLineScene):run_time = 0.5)self.wait(0.5)- points = map(self.number_line.number_to_point, [approx, irrational])+ points = list(map(self.number_line.number_to_point, [approx, irrational]))distance = np.linalg.norm(points[1]-points[0])if distance < 0.3*FRAME_X_RADIUS and num_zooms < max_num_zooms:num_zooms += 1@@ -1114,13 +1114,13 @@ class StepsToSolution(IntervalScene):def construct(self):IntervalScene.construct(self)self.spacing = 0.7- steps = map(TextMobject, [+ steps = list(map(TextMobject, ["Enumerate all rationals in (0, 1)","Assign one interval to each rational","Choose sum of the form $\\mathlarger{\\sum}_{n=1}^\\infty a_n = 1$","Pick any $\\epsilon$ such that $0 < \\epsilon < 1$","Stretch the $n$th interval to have length $\\epsilon/2^n$",- ])+ ]))for step in steps:step.shift(DOWN)for step in steps[2:]:@@ -1145,7 +1145,7 @@ class StepsToSolution(IntervalScene):anims = []commas = Mobject()denom_to_mobs = {}- for frac, count in zip(rationals(), range(1,28)):+ for frac, count in zip(rationals(), list(range(1,28))):mob, tick = self.add_fraction(frac, shrink = True)self.wait(0.1)self.remove(tick)@@ -1259,7 +1259,7 @@ class OurSumCanBeArbitrarilySmall(Scene):equals = TexMobject("=").next_to(epsilon)self.add(epsilon, equals)for num in np.arange(1, 0, -step_size):- parts = map(TexMobject, str(num))+ parts = list(map(TexMobject, str(num)))parts[0].next_to(equals)for i in range(1, len(parts)):parts[i].next_to(parts[i-1], buff = 0.1, aligned_edge = DOWN)@@ -1285,7 +1285,7 @@ class StillFeelsCounterintuitive(IntervalScene):def construct(self):IntervalScene.construct(self)ticks = self.add_fraction_ticks(run_time = 1.0)- epsilon, equals, num = map(TexMobject, ["\\epsilon", "=", "0.3"])+ epsilon, equals, num = list(map(TexMobject, ["\\epsilon", "=", "0.3"]))epsilon.shift(2*UP)equals.next_to(epsilon)num.next_to(equals)@@ -1347,7 +1347,7 @@ class WhatDoesItLookLikeToBeOutside(Scene):class ZoomInOnSqrt2Over2(IntervalScene):def construct(self):IntervalScene.construct(self)- epsilon, equals, num = map(TexMobject, ["\\epsilon", "=", "0.3"])+ epsilon, equals, num = list(map(TexMobject, ["\\epsilon", "=", "0.3"]))equals.next_to(epsilon)num.next_to(equals)self.add(Mobject(epsilon, equals, num).center().shift(2*UP))diff --git a/old_projects/mvcr.py b/old_projects/mvcr.pyindex ee7350491..aaf4806cc 100644--- a/old_projects/mvcr.py+++ b/old_projects/mvcr.py@@ -242,10 +242,10 @@ class ComputationalNetwork(MovingCameraScene):self.value_labels = value_labelsself.revert_to_formula_animations = [ApplyMethod(term.set_fill, {"opacity": 1})- for term in x_in_f, x_in_g, f_in_h, g_in_h+ for term in (x_in_f, x_in_g, f_in_h, g_in_h)] + [FadeOut(term)- for term in two_copy1, two_copy2, four_copy, one_copy+ for term in (two_copy1, two_copy2, four_copy, one_copy)]def compare_x_and_h_wiggling(self):@@ -552,7 +552,7 @@ class ComputationalNetwork(MovingCameraScene):group,submobject_mode="one_at_a_time")- for group in top_lines, bottom_lines+ for group in (top_lines, bottom_lines)])self.wait()self.play(FadeOut(rect))diff --git a/old_projects/name_animation.py b/old_projects/name_animation.pyindex 40131d3f8..b1880ffee 100644--- a/old_projects/name_animation.py+++ b/old_projects/name_animation.py@@ -1,7 +1,7 @@#!/usr/bin/env python2# -*- coding: utf-8 -*--from __future__ import print_function+from big_ol_pile_of_manim_imports import *NAME_WITH_SPACES = "Prime Meridian"diff --git a/old_projects/nn/mnist_loader.py b/old_projects/nn/mnist_loader.pyindex 7687f4137..74e6360fb 100644--- a/old_projects/nn/mnist_loader.py+++ b/old_projects/nn/mnist_loader.py@@ -10,7 +10,7 @@ function usually called by our neural network code.#### Libraries# Standard library-import cPickle+import pickleimport gzip# Third-party libraries@@ -40,7 +40,7 @@ def load_data():below."""f = gzip.open('/Users/grant/cs/neural-networks-and-deep-learning/data/mnist.pkl.gz', 'rb')- training_data, validation_data, test_data = cPickle.load(f)+ training_data, validation_data, test_data = pickle.load(f)f.close()return (training_data, validation_data, test_data)@@ -68,11 +68,11 @@ def load_data_wrapper():tr_d, va_d, te_d = load_data()training_inputs = [np.reshape(x, (784, 1)) for x in tr_d[0]]training_results = [vectorized_result(y) for y in tr_d[1]]- training_data = zip(training_inputs, training_results)+ training_data = list(zip(training_inputs, training_results))validation_inputs = [np.reshape(x, (784, 1)) for x in va_d[0]]- validation_data = zip(validation_inputs, va_d[1])+ validation_data = list(zip(validation_inputs, va_d[1]))test_inputs = [np.reshape(x, (784, 1)) for x in te_d[0]]- test_data = zip(test_inputs, te_d[1])+ test_data = list(zip(test_inputs, te_d[1]))return (training_data, validation_data, test_data)def vectorized_result(j):diff --git a/old_projects/nn/network.py b/old_projects/nn/network.pyindex 7a9843047..b8386028b 100644--- a/old_projects/nn/network.py+++ b/old_projects/nn/network.py@@ -8,7 +8,7 @@ using backpropagation. Note that I have focused on making the codesimple, easily readable, and easily modifiable. It is not optimized,and omits many desirable features."""-from __future__ import print_function+#### Libraries# Standard library@@ -18,7 +18,7 @@ import randomimport numpy as npimport osfrom PIL import Image-import cPickle+import picklefrom nn.mnist_loader import load_data_wrapperNN_DIRECTORY = os.path.dirname(os.path.realpath(__file__))@@ -91,11 +91,11 @@ class Network(object):tracking progress, but slows things down substantially."""if test_data: n_test = len(test_data)n = len(training_data)- for j in xrange(epochs):+ for j in range(epochs):random.shuffle(training_data)mini_batches = [training_data[k:k+mini_batch_size]- for k in xrange(0, n, mini_batch_size)]+ for k in range(0, n, mini_batch_size)]for mini_batch in mini_batches:self.update_mini_batch(mini_batch, eta)if test_data:@@ -147,7 +147,7 @@ class Network(object):# second-last layer, and so on. It's a renumbering of the# scheme in the book, used here to take advantage of the fact# that Python can use negative indices in lists.- for l in xrange(2, self.num_layers):+ for l in range(2, self.num_layers):z = zs[-l]sp = self.d_non_linearity(z)delta = np.dot(self.weights[-l+1].transpose(), delta) * sp@@ -196,7 +196,7 @@ def ReLU_prime(z):def get_pretrained_network():data_file = open(PRETRAINED_DATA_FILE)- weights, biases = cPickle.load(data_file)+ weights, biases = pickle.load(data_file)sizes = [w.shape[1] for w in weights]sizes.append(weights[-1].shape[0])network = Network(sizes)@@ -210,7 +210,7 @@ def save_pretrained_network(epochs = 30, mini_batch_size = 10, eta = 3.0):network.SGD(training_data, epochs, mini_batch_size, eta)weights_and_biases = (network.weights, network.biases)data_file = open(PRETRAINED_DATA_FILE, mode = 'w')- cPickle.dump(weights_and_biases, data_file)+ pickle.dump(weights_and_biases, data_file)data_file.close()def test_network():@@ -241,7 +241,7 @@ def maximizing_input(network, layer_index, layer_vect, n_steps = 100, seed_guesselse:pre_sig_guess = np.random.randn(weights[0].shape[1])norms = []- for step in xrange(n_steps):+ for step in range(n_steps):activations = network.get_activation_of_all_layers(sigmoid(pre_sig_guess), layer_index)@@ -269,19 +269,19 @@ def save_organized_images(n_images_per_number = 10):training_data, validation_data, test_data = load_data_wrapper()image_map = dict([(k, []) for k in range(10)])for im, output_arr in training_data:- if min(map(len, image_map.values())) >= n_images_per_number:+ if min(list(map(len, list(image_map.values())))) >= n_images_per_number:breakvalue = int(np.argmax(output_arr))if len(image_map[value]) >= n_images_per_number:continueimage_map[value].append(im)data_file = open(IMAGE_MAP_DATA_FILE, mode = 'w')- cPickle.dump(image_map, data_file)+ pickle.dump(image_map, data_file)data_file.close()def get_organized_images():data_file = open(IMAGE_MAP_DATA_FILE, mode = 'r')- image_map = cPickle.load(data_file)+ image_map = pickle.load(data_file)data_file.close()return image_mapdiff --git a/old_projects/nn/part1.py b/old_projects/nn/part1.pyindex 2863c0e4a..a1123bd95 100644--- a/old_projects/nn/part1.py+++ b/old_projects/nn/part1.py@@ -369,8 +369,8 @@ class ExampleThrees(PiCreatureScene):),randy.change, "sassy",*it.chain(- map(GrowFromCenter, braces),- map(FadeIn, brace_labels)+ list(map(GrowFromCenter, braces)),+ list(map(FadeIn, brace_labels))))self.wait()@@ -415,9 +415,9 @@ class ExampleThrees(PiCreatureScene):self.wait(0.5)self.play(randy.change, "plain",- *map(FadeOut, [+ *list(map(FadeOut, [self.bubble, self.arrow, self.real_three- ]) + [MoveToTarget(three)]+ ])) + [MoveToTarget(three)])for alt_three in alt_threes[:2]:self.play(three.replace, alt_three)@@ -975,11 +975,11 @@ class BreakDownName(Scene):)self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [name, randy, brain,q2, a1, a2,q1[0], q1[2]- ]))+ ])))self.neuron_word = q1[1]@@ -1335,7 +1335,7 @@ class DiscussChoiceForHiddenLayers(TeacherStudentsScene):network_mob.set_height(4)network_mob.to_edge(UP, buff = LARGE_BUFF)layers = VGroup(*network_mob.layers[1:3])- rects = VGroup(*map(SurroundingRectangle, layers))+ rects = VGroup(*list(map(SurroundingRectangle, layers)))self.add(network_mob)two_words = TextMobject("2 hidden layers")@@ -1463,7 +1463,7 @@ class AskAboutLayers(PreviewMNistNetwork):)for group in neuron_groups])- rects = map(SurroundingRectangle, neuron_groups[1:3])+ rects = list(map(SurroundingRectangle, neuron_groups[1:3]))self.play(Write(question, run_time = 1),@@ -1474,7 +1474,7 @@ class AskAboutLayers(PreviewMNistNetwork):))self.wait()- self.play(*map(ShowCreation, rects))+ self.play(*list(map(ShowCreation, rects)))self.wait()class BreakUpMacroPatterns(IntroduceEachLayer):@@ -1506,7 +1506,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer):))[:,:,0].flatten()/255.0for p in prefixes]- mobjects = map(MNistMobject, vects)+ mobjects = list(map(MNistMobject, vects))for mob in mobjects:image = mob[1]self.make_transparent(image)@@ -1549,7 +1549,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer):self.play(FadeIn(nine))self.wait()- self.play(*map(FadeIn, parts))+ self.play(*list(map(FadeIn, parts)))self.wait()self.play(Write(equation[1]),@@ -1651,7 +1651,7 @@ class BreakUpMacroPatterns(IntroduceEachLayer):for pattern in patterns[5:]:pattern.fade(1)- self.play(*map(FadeOut, everything))+ self.play(*list(map(FadeOut, everything)))self.play(FadeIn(network_mob,@@ -1732,9 +1732,9 @@ class BreakUpMacroPatterns(IntroduceEachLayer):class GenerallyLoopyPattern(Scene):def construct(self):image_map = get_organized_images()- images = map(MNistMobject, it.chain(+ images = list(map(MNistMobject, it.chain(image_map[8], image_map[9],- ))+ )))random.shuffle(images)for image in images:@@ -1914,7 +1914,7 @@ class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer):nine_pa = self.nine[1].pixel_arrayn, k = 6, 4colors = color_gradient([BLUE, YELLOW, RED, MAROON_B, GREEN], 10)- for i, j in it.product(range(n), range(k)):+ for i, j in it.product(list(range(n)), list(range(k))):mob = ImageMobject(np.zeros((28, 28, 4), dtype = 'uint8'))mob.replace(self.nine[1])pa = mob.pixel_array@@ -1955,7 +1955,7 @@ class SecondLayerIsLittleEdgeLayer(IntroduceEachLayer):Write(words, run_time = 2))self.wait()- self.play(*map(FadeOut, [rect, words]))+ self.play(*list(map(FadeOut, [rect, words])))def show_propogation(self):nine = self.nine@@ -2464,7 +2464,7 @@ class IntroduceWeights(IntroduceEachLayer):)] + [Write(weighted_sum[i])- for i in range(2, 12, 3) + [-4, -3]+ for i in list(range(2, 12, 3)) + [-4, -3]],run_time = 1.5)@@ -2715,8 +2715,8 @@ class IntroduceSigmoid(GraphScene):"y_max" : 2,"y_axis_label" : "","graph_origin" : DOWN,- "x_labeled_nums" : range(-4, 5),- "y_labeled_nums" : range(-1, 3),+ "x_labeled_nums" : list(range(-4, 5)),+ "y_labeled_nums" : list(range(-1, 3)),}def construct(self):self.setup_axes()@@ -3277,7 +3277,7 @@ class WhenTheNetworkFails(MoreHonestMNistNetworkPreview):DrawBorderThenFill(box))self.wait()- self.play(*map(FadeOut, [words, box]))+ self.play(*list(map(FadeOut, [words, box])))def incorrect_classification(self):network = self.network@@ -3567,17 +3567,17 @@ class IntroduceWeightMatrix(NetworkScene):lwb.align_to(rwb, UP)row_1, row_k = [- VGroup(*map(TexMobject, [+ VGroup(*list(map(TexMobject, ["w_{%s, 0}"%i,"w_{%s, 1}"%i,"\\cdots","w_{%s, n}"%i,- ]))+ ])))for i in ("1", "k")]- dots_row = VGroup(*map(TexMobject, [+ dots_row = VGroup(*list(map(TexMobject, ["\\vdots", "\\vdots", "\\ddots", "\\vdots"- ]))+ ])))lower_rows = VGroup(row_1, dots_row, row_k)lower_rows.scale(0.75)@@ -3671,9 +3671,9 @@ class IntroduceWeightMatrix(NetworkScene):self.show_meaning_of_lower_rows(arrow, brace, top_row_rect, result_terms)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [result_terms, result_brackets, equals, column_rect- ]))+ ])))def show_meaning_of_lower_rows(self, arrow, brace, row_rect, result_terms):n1, n2, nk = neurons = VGroup(*[@@ -3735,9 +3735,9 @@ class IntroduceWeightMatrix(NetworkScene):plus = TexMobject("+")b_brackets = a_column_brackets.copy()- b_column = VGroup(*map(TexMobject, [+ b_column = VGroup(*list(map(TexMobject, ["b_0", "b_1", "\\vdots", "b_n",- ]))+ ])))b_column.scale(0.85)b_column.arrange_submobjects(DOWN, buff = 0.35)b_column.move_to(a_column)@@ -3855,13 +3855,13 @@ class IntroduceWeightMatrix(NetworkScene):self.wait(2)def fade_weighted_sum(self):- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.a1_label, self.a1_equals,self.sigma, self.sigma_parens,self.weighted_sum,self.bias_name,self.sigmoid_name,- ]))+ ])))###@@ -3903,10 +3903,10 @@ class SigmoidAppliedToVector(Scene):tex.set_width(FRAME_WIDTH - 1)tex.to_edge(DOWN)indices = it.chain(- [0], range(1, 5), range(16, 16+4),- range(25, 25+2), [25+3],- range(29, 29+2), [29+3],- range(33, 33+2), [33+3],+ [0], list(range(1, 5)), list(range(16, 16+4)),+ list(range(25, 25+2)), [25+3],+ list(range(29, 29+2)), [29+3],+ list(range(33, 33+2)), [33+3],)for i in indices:tex[i].set_color(YELLOW)@@ -4050,7 +4050,7 @@ class NeuronIsFunction(MoreHonestMNistNetworkPreview):self.play(FadeOut(self.network_mob),- *map(Animation, [neuron, edges, prev_layer])+ *list(map(Animation, [neuron, edges, prev_layer])))self.play(LaggedStart(ShowCreationThenDestruction,diff --git a/old_projects/nn/part2.py b/old_projects/nn/part2.pyindex 0882f5930..6d96943cd 100644--- a/old_projects/nn/part2.py+++ b/old_projects/nn/part2.py@@ -1,4 +1,4 @@-from __future__ import print_function+import sysimport os.pathimport cv2@@ -232,11 +232,11 @@ class PreviewLearning(NetworkScene):edge_group.copy()for edge_group in edge_groups])- tups = zip(+ tups = list(zip(it.count(), nabla_b, nabla_w,delta_neuron_groups, neuron_groups,delta_edge_groups, edge_groups- )+ ))pc_color = self.positive_change_colornc_color = self.negative_change_colorfor i, nb, nw, delta_neurons, neurons, delta_edges, edges in reversed(tups):@@ -278,7 +278,7 @@ class PreviewLearning(NetworkScene):[ReplacementTransform(edge_groups.saved_state, edge_groups,)],- map(FadeOut, [delta_edge_groups, delta_neuron_groups]),+ list(map(FadeOut, [delta_edge_groups, delta_neuron_groups])),added_outro_anims,))@@ -476,7 +476,7 @@ class MNistDescription(Scene):FadeOut(word_group),)else:- pairs = zip(last_group, group)+ pairs = list(zip(last_group, group))random.shuffle(pairs)time = 0for t1, t2 in pairs:@@ -541,7 +541,7 @@ class NotSciFi(TeacherStudentsScene):class FunctionMinmization(GraphScene):CONFIG = {- "x_labeled_nums" : range(-1, 10),+ "x_labeled_nums" : list(range(-1, 10)),}def construct(self):self.setup_axes()@@ -705,7 +705,7 @@ class IntroduceCostFunction(PreviewLearning):))self.play(Write(weights_word),- *map(GrowArrow, weights_arrow_to_syms),+ *list(map(GrowArrow, weights_arrow_to_syms)),run_time = 1)self.wait()@@ -748,11 +748,11 @@ class IntroduceCostFunction(PreviewLearning):rate_func = wiggle,run_time = 2))- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [weights_word, weights_arrow_to_edges,bias_word, bias_arrow,formula- ]))+ ])))def bring_back_rest_of_network(self):network_mob = self.network_mob@@ -799,7 +799,7 @@ class IntroduceCostFunction(PreviewLearning):VGroup(*layer0.neurons[:n/2]).set_fill(opacity = 0),[VectorizedPoint(layer0.dots.get_center())- for x in xrange(len(neurons)-n)+ for x in range(len(neurons)-n)],VGroup(*layer0.neurons[-n/2:]).set_fill(opacity = 0),))@@ -874,10 +874,10 @@ class IntroduceCostFunction(PreviewLearning):def fade_all_but_last_layer(self):network_mob = self.network_mob- to_fade = VGroup(*it.chain(*zip(+ to_fade = VGroup(*it.chain(*list(zip(network_mob.layers[:-1],network_mob.edge_groups- )))+ ))))self.play(LaggedStart(FadeOut, to_fade, run_time = 1))@@ -1328,10 +1328,10 @@ class EmphasizeComplexityOfCostFunction(IntroduceCostFunction):cost.next_to(arrow, DOWN)training_data, validation_data, test_data = load_data_wrapper()- training_examples = Group(*map(+ training_examples = Group(*list(map(self.get_training_pair_mob,training_data[:self.n_examples]- ))+ )))training_examples.next_to(parameter_words, DOWN, buff = LARGE_BUFF)self.play(@@ -1631,8 +1631,8 @@ class SingleVariableCostFunction(GraphScene):)self.wait()self.play(*it.chain(- map(GrowArrow, arrows),- map(FadeIn, q_marks),+ list(map(GrowArrow, arrows)),+ list(map(FadeIn, q_marks)),))self.wait()@@ -1831,12 +1831,12 @@ class TwoVariableInputSpace(Scene):name = TextMobject("Input space")name.add_background_rectangle()name.next_to(plane.get_corner(UP+LEFT), DOWN+RIGHT)- x, y = map(TexMobject, ["x", "y"])+ x, y = list(map(TexMobject, ["x", "y"]))x.next_to(plane.coords_to_point(3.25, 0), UP, SMALL_BUFF)y.next_to(plane.coords_to_point(0, 3.6), RIGHT, SMALL_BUFF)self.play(- *map(Write, [plane, name, x, y]),+ *list(map(Write, [plane, name, x, y])),run_time = 1)self.wait()@@ -2027,7 +2027,7 @@ class ShowFullCostFunctionGradient(PreviewLearning):),LaggedStart(FadeIn, words),)- self.play(*map(Write, [lb, rb, lhs]), run_time = 1)+ self.play(*list(map(Write, [lb, rb, lhs])), run_time = 1)self.wait()self.column_vect = column_vect@@ -2040,10 +2040,7 @@ class ShowFullCostFunctionGradient(PreviewLearning):)lhs.shift(2*RIGHT)lhs.set_color_by_tex("W", YELLOW)- old_decimals = VGroup(*filter(- lambda m : isinstance(m, DecimalNumber),- column_vect[1]- ))+ old_decimals = VGroup(*[m for m in column_vect[1] if isinstance(m, DecimalNumber)])new_decimals = VGroup()new_nums = [0.18, 0.45, -0.51, 0.4, -0.32, 0.82]for decimal, new_num in zip(old_decimals, new_nums):@@ -2754,7 +2751,7 @@ class ContinuouslyRangingNeuron(PreviewLearning):decimal.set_color(WHITE)decimal_color_anim = UpdateFromFunc(decimal, update_decimal_color)- self.play(*map(MoveToTarget, [neuron, decimal]))+ self.play(*list(map(MoveToTarget, [neuron, decimal])))for x in 0.7, 0.35, 0.97, 0.23, 0.54:curr_num = neuron.get_fill_opacity()self.play(@@ -3401,7 +3398,7 @@ class SomethingToImproveUpon(PiCreatureScene, TestPerformance):)hidden_layers = network_mob.layers[1:3]- rects = VGroup(*map(SurroundingRectangle, hidden_layers))+ rects = VGroup(*list(map(SurroundingRectangle, hidden_layers)))np.random.seed(0)self.play(ShowCreation(rects))@@ -3518,7 +3515,7 @@ class RandomlyLabeledImageData(Scene):group.shift(3*UP + 1.5*y*DOWN)groups.add(group)labels.add(group[-1])- permutation = range(len(labels))+ permutation = list(range(len(labels)))while any(np.arange(len(labels)) == permutation):random.shuffle(permutation)for label, i in zip(labels, permutation):@@ -3561,7 +3558,7 @@ class TrainOnImages(PreviewLearning, RandomlyLabeledImageData):def construct(self):self.setup_network_mob()- image_names, label_names = zip(*self.image_label_pairs)+ image_names, label_names = list(zip(*self.image_label_pairs))label_names = list(label_names)random.shuffle(label_names)groups = [diff --git a/old_projects/nn/part3.py b/old_projects/nn/part3.pyindex 3605801a6..89fc73b1d 100644--- a/old_projects/nn/part3.py+++ b/old_projects/nn/part3.py@@ -146,7 +146,7 @@ class InterpretGradientComponents(GradientNudging):self.play(randy.change, "confused", words)self.play(Blink(randy))self.wait()- self.play(*map(FadeOut, [randy, words, arrow]))+ self.play(*list(map(FadeOut, [randy, words, arrow])))def circle_magnitudes(self):rects = VGroup()@@ -286,9 +286,9 @@ class InterpretGradientComponents(GradientNudging):run_time = 2,)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [w.dot, w.brace, w.number_line, w.words- ]))+ ])))######@@ -501,7 +501,7 @@ class ShowAveragingCost(PreviewLearning):words.scale(0.8)words.to_corner(UP+LEFT)- for x in xrange(self.n_adjustments):+ for x in range(self.n_adjustments):if x < 2:self.play(FadeIn(words[x]))for train_in, train_out in training_data[:n_examples_per_adjustment]:@@ -660,7 +660,7 @@ class WalkThroughTwoExample(ShowAveragingCost):self.play(FadeOut(to_fade),- *map(MoveToTarget, movers)+ *list(map(MoveToTarget, movers)))self.show_decimals(neurons)self.cannot_directly_affect_activations()@@ -1031,9 +1031,9 @@ class WalkThroughTwoExample(ShowAveragingCost):two_neuron_arrow.next_to(two_neuron, UP)VGroup(neuron_arrows, two_neuron_arrow).set_color(YELLOW)- neuron_rects = VGroup(*map(+ neuron_rects = VGroup(*list(map(SurroundingRectangle, bright_neurons- ))+ )))two_neuron_rect = SurroundingRectangle(two_neuron)seeing_words = TextMobject("Seeing a 2")seeing_words.scale(0.8)@@ -1260,7 +1260,7 @@ class WalkThroughTwoExample(ShowAveragingCost):arrows_to_fade = VGroup(prev_neuron_arrows)output_labels = self.network_mob.output_labels- quads = zip(neurons, self.decimals, self.arrows, output_labels)+ quads = list(zip(neurons, self.decimals, self.arrows, output_labels))self.revert_to_original_skipping_status()self.play(@@ -1498,9 +1498,9 @@ class ConstructGradientFromAllTrainingExamples(Scene):self.v_lines = v_linesdef setup_weights(self):- weights = VGroup(*map(TexMobject, [+ weights = VGroup(*list(map(TexMobject, ["w_0", "w_1", "w_2", "\\vdots", "w_{13{,}001}"- ]))+ ])))for i, weight in enumerate(weights):weight.move_to(self.get_grid_position(i, 0))weights.to_edge(LEFT, buff = MED_SMALL_BUFF)@@ -1520,7 +1520,7 @@ class ConstructGradientFromAllTrainingExamples(Scene):self.add(two)self.two_changes = VGroup()- for i in range(3) + [4]:+ for i in list(range(3)) + [4]:weight = self.weights[i]bubble, change = self.get_requested_change_bubble(two)weight.save_state()@@ -1591,7 +1591,7 @@ class ConstructGradientFromAllTrainingExamples(Scene):self.get_random_decimal().move_to(self.get_grid_position(i, j))- for i in range(3) + [4]+ for i in list(range(3)) + [4]for j in range(1, self.n_examples)])for change in changes:@@ -1624,7 +1624,7 @@ class ConstructGradientFromAllTrainingExamples(Scene):VGroup(two_change, *changes[k*i:k*(i+1)])for i, two_change in enumerate(self.two_changes)])- for i in range(3) + [-1]:+ for i in list(range(3)) + [-1]:self.change_rows[i].add(more_h_dots[i])self.all_eyes = VGroup(*[@@ -2212,10 +2212,7 @@ class SimplestNetworkExample(PreviewLearning):w.set_color(edge.get_color())b_terms = expression.get_parts_by_tex("b_")variables = VGroup(*it.chain(w_terms, b_terms))- other_terms = VGroup(*filter(- lambda m : m not in variables,- expression- ))+ other_terms = VGroup(*[m for m in expression if m not in variables])random.shuffle(variables.submobjects)self.play(ReplacementTransform(edges.copy(), w_terms))@@ -2238,10 +2235,10 @@ class SimplestNetworkExample(PreviewLearning):self.remove(expression)def focus_just_on_last_two_layers(self):- to_fade = VGroup(*it.chain(*zip(+ to_fade = VGroup(*it.chain(*list(zip(self.network_mob.layers[:2],self.network_mob.edge_groups[:2],- )))+ ))))for mob in to_fade:mob.save_state()self.play(LaggedStart(@@ -2316,7 +2313,7 @@ class SimplestNetworkExample(PreviewLearning):Write(not_exponents, run_time = 2))self.wait()- self.play(*map(FadeOut, [not_exponents, superscript_rects]))+ self.play(*list(map(FadeOut, [not_exponents, superscript_rects])))self.set_variables_as_attrs(a_labels, a_label_arrows, decimals,@@ -2343,7 +2340,7 @@ class SimplestNetworkExample(PreviewLearning):)VGroup(words, rect, y_label).set_color(self.desired_output_color)- self.play(*map(FadeIn, [neuron, decimal]))+ self.play(*list(map(FadeIn, [neuron, decimal])))self.play(ShowCreation(rect),Write(words, run_time = 1)@@ -2391,9 +2388,7 @@ class SimplestNetworkExample(PreviewLearning):"(", "0.00", "-", "0.00", ")", "^2")numbers = expression.get_parts_by_tex("0.00")- non_numbers = VGroup(*filter(- lambda m : m not in numbers, expression- ))+ non_numbers = VGroup(*[m for m in expression if m not in numbers])expression.next_to(cost_equation, DOWN, aligned_edge = RIGHT)decimals = VGroup(self.decimals[0],@@ -2409,10 +2404,7 @@ class SimplestNetworkExample(PreviewLearning):ReplacementTransform(pre_y, y),)self.play(LaggedStart(- FadeIn, VGroup(*filter(- lambda m : m not in [a, y],- cost_equation- ))+ FadeIn, VGroup(*[m for m in cost_equation if m not in [a, y]])))self.play(MoveToTarget(decimals),@@ -2425,7 +2417,7 @@ class SimplestNetworkExample(PreviewLearning):)self.play(C0.shift, MED_SMALL_BUFF*UP, rate_func = wiggle)self.wait()- self.play(*map(FadeOut, [decimals, non_numbers]))+ self.play(*list(map(FadeOut, [decimals, non_numbers])))self.set_variables_as_attrs(cost_equation, cost_word, cost_arrow@@ -2955,14 +2947,11 @@ class SimplestNetworkExample(PreviewLearning):graph_parts.scale, 0.7, graph_parts.get_bottom())self.wait(2)- self.play(*map(FadeOut, [rect, words]))+ self.play(*list(map(FadeOut, [rect, words])))def indicate_everything_on_screen(self):everything = VGroup(*self.get_top_level_mobjects())- everything = VGroup(*filter(- lambda m : not m.is_subpath,- everything.family_members_with_points()- ))+ everything = VGroup(*[m for m in everything.family_members_with_points() if not m.is_subpath])self.play(LaggedStart(Indicate, everything,rate_func = wiggle,@@ -3091,7 +3080,7 @@ class SimplestNetworkExample(PreviewLearning):for d in (decimal, moving_decimals[0])])- self.play(*map(FadeOut, [double_arrow, moving_decimals]))+ self.play(*list(map(FadeOut, [double_arrow, moving_decimals])))#da_dzself.play(@@ -3292,11 +3281,11 @@ class SimplestNetworkExample(PreviewLearning):)self.wait(2)self.cycle_through_altnernate_training_examples()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [VGroup(*full_derivative[3:]),lhs_brace, lhs_text,rhs_brace, rhs_text,- ]))+ ])))self.dC_dw = lhs@@ -3472,7 +3461,7 @@ class SimplestNetworkExample(PreviewLearning):))self.wait(2)- self.play(*map(FadeOut, [dz_db, arrow, one]))+ self.play(*list(map(FadeOut, [dz_db, arrow, one])))self.dz_db = dz_db@@ -3726,7 +3715,7 @@ class GeneralFormulas(SimplestNetworkExample):all_subscript_rects.add(subscript_rects)start_labels, start_arrows = [- VGroup(*map(VGroup, [group[i][0] for i in (0, 1)])).copy()+ VGroup(*list(map(VGroup, [group[i][0] for i in (0, 1)]))).copy()for group in (all_labels, all_arrows)]for label in start_labels:@@ -3734,7 +3723,7 @@ class GeneralFormulas(SimplestNetworkExample):self.add(all_decimals)self.play(*it.chain(- map(Write, start_labels),+ list(map(Write, start_labels)),[GrowArrow(a[0]) for a in start_arrows]))self.wait()@@ -3824,7 +3813,7 @@ class GeneralFormulas(SimplestNetworkExample):*[ReplacementTransform(n1.decimal.copy(), n2.decimal)for n1, n2 in zip(layer.neurons, desired_output.neurons)- ] + map(GrowArrow, arrows)+ ] + list(map(GrowArrow, arrows)))self.wait()@@ -3848,10 +3837,7 @@ class GeneralFormulas(SimplestNetworkExample):aj.target = cost_equation.get_part_by_tex("a^{(L)}_j")yj.target = cost_equation.get_part_by_tex("y_j")yj.target.set_color(self.desired_output_color)- to_fade_in = VGroup(*filter(- lambda m : m not in [aj.target, yj.target],- cost_equation- ))+ to_fade_in = VGroup(*[m for m in cost_equation if m not in [aj.target, yj.target]])sum_part = cost_equation.get_part_by_tex("sum")self.play(*[@@ -3874,10 +3860,7 @@ class GeneralFormulas(SimplestNetworkExample):def show_example_weight(self):edges = self.network_mob.edge_groups[-1]edge = self.chosen_neurons[1].edges_in[1]- faded_edges = VGroup(*filter(- lambda e : e is not edge,- edges- ))+ faded_edges = VGroup(*[e for e in edges if e is not edge])faded_edges.save_state()for faded_edge in faded_edges:faded_edge.save_state()@@ -3974,10 +3957,7 @@ class GeneralFormulas(SimplestNetworkExample):aLm1_part),)- self.play(Write(VGroup(*filter(- lambda m : m not in [w_part, aLm1_part],- z_formula- ))))+ self.play(Write(VGroup(*[m for m in z_formula if m not in [w_part, aLm1_part]])))self.wait()self.play(ReplacementTransform(self.chosen_neurons[1].label.copy(),diff --git a/old_projects/nn/playground.py b/old_projects/nn/playground.pyindex f6b22e7b6..231bd18fa 100644--- a/old_projects/nn/playground.py+++ b/old_projects/nn/playground.py@@ -112,7 +112,7 @@ class Test(Scene):out[k] = 1in_vect = maximizing_input(network, layer, out)new_out = network.get_activation_of_all_layers(in_vect)[layer]- group = Group(*map(MNistMobject, [in_vect, new_out]))+ group = Group(*list(map(MNistMobject, [in_vect, new_out])))group.arrange_submobjects(DOWN+RIGHT, SMALL_BUFF)groups.add(group)groups.arrange_submobjects_in_grid()@@ -133,7 +133,7 @@ class Test(Scene):def get_set(self, network, test):test_in, test_out = testactivations = network.get_activation_of_all_layers(test_in)- group = Group(*map(MNistMobject, activations))+ group = Group(*list(map(MNistMobject, activations)))group.arrange_submobjects(RIGHT, buff = LARGE_BUFF)return groupdiff --git a/old_projects/patreon.py b/old_projects/patreon.pyindex 30a18bd1c..468b8a8fe 100644--- a/old_projects/patreon.py+++ b/old_projects/patreon.py@@ -122,7 +122,7 @@ class GrowingToDoList(Scene):underline = Line(title.get_left(), title.get_right())underline.next_to(title, DOWN)- lines = VGroup(*map(TextMobject, [+ lines = VGroup(*list(map(TextMobject, ["That one on topology","Something with quaternions","Solving puzzles with binary counting",@@ -136,7 +136,7 @@ class GrowingToDoList(Scene):"Fourier stuffs","$1+2+3+\\cdots = -\\frac{1}{12}$","Understanding entropy",- ]))+ ])))lines.scale(0.65)lines.arrange_submobjects(DOWN, buff = MED_SMALL_BUFF, aligned_edge = LEFT)lines.set_color_by_gradient(BLUE_C, YELLOW)@@ -461,7 +461,7 @@ class PythagoreanTransformation(Scene):b_square_tex.move_to(b_square)self.play(ShowCreation(tri1, run_time = 2))- self.play(*map(Write, [a, b, c]))+ self.play(*list(map(Write, [a, b, c])))self.wait()self.play(FadeIn(c_square),@@ -479,7 +479,7 @@ class PythagoreanTransformation(Scene):self.remove(mover)self.add(big_square, *[tri1]+copies)self.wait(2)- self.play(*map(FadeOut, [a, b, c, c_square]))+ self.play(*list(map(FadeOut, [a, b, c, c_square])))self.play(tri3.shift,tri1.get_corner(UP+LEFT) -\@@ -612,7 +612,7 @@ class IntegrationByParts(Scene):self.draw_curve(curve)self.play(ShowCreation(rect))- self.play(*map(Write, [down_brace, left_brace, f_T, g_T]))+ self.play(*list(map(Write, [down_brace, left_brace, f_T, g_T])))self.wait()self.play(FadeIn(upper_right))self.play(@@ -660,7 +660,7 @@ class IntegrationByParts(Scene):rate_func = None)self.wait()- self.play(*map(FadeOut, [coords, dot]))+ self.play(*list(map(FadeOut, [coords, dot])))class EndScreen(TeacherStudentsScene):def construct(self):diff --git a/old_projects/pi_day.py b/old_projects/pi_day.pyindex 8445d7c1e..fb4850c06 100644--- a/old_projects/pi_day.py+++ b/old_projects/pi_day.py@@ -428,7 +428,7 @@ class ManyFormulas(Scene):angle_group = angle_groups[0]- self.play(*map(FadeIn, [circle, radius]))+ self.play(*list(map(FadeIn, [circle, radius])))self.play(circle.set_stroke, {"width" : 1,},FadeIn(angle_group),@@ -722,7 +722,7 @@ class UsingTheta(Scene):class ThingsNamedAfterEuler(Scene):def construct(self):- group = VGroup(*map(TextMobject, [+ group = VGroup(*list(map(TextMobject, ["Euler's formula (Complex analysis)","Euler's formula (Graph theory)","Euler's formula (Mechanical engineering)",@@ -733,7 +733,7 @@ class ThingsNamedAfterEuler(Scene):"Euler equations (fluid dynamics)","Euler angles (rigid-body mechanics)","Euler totient function (number theory)",- ]))+ ])))group.arrange_submobjects(DOWN, aligned_edge = LEFT)group.set_height(FRAME_HEIGHT - 1)@@ -973,12 +973,12 @@ class SpecialThanks(Scene):h_line.next_to(title, DOWN)h_line.set_stroke(WHITE, 1)- people = VGroup(*map(TextMobject, [+ people = VGroup(*list(map(TextMobject, ["Ben Hambrecht","University Library Basel","Martin Mattmüller","Library of the Institut de France",- ]))+ ])))people.arrange_submobjects(DOWN, aligned_edge = LEFT, buff = MED_LARGE_BUFF)people.next_to(h_line, DOWN)diff --git a/old_projects/playground_counting_in_binary.py b/old_projects/playground_counting_in_binary.pyindex df786cf92..070de121a 100644--- a/old_projects/playground_counting_in_binary.py+++ b/old_projects/playground_counting_in_binary.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import print_function+import numpy as npimport itertools as itfrom copy import deepcopy@@ -191,10 +191,9 @@ class ShowCounting(SceneFromVideo):print(count)mob = TexMobject(str(count)).scale(1.5)mob.shift(0.3*LEFT).to_edge(UP, buff = 0.1)- index_range = range(+ index_range = list(range(max(COUNT_TO_FRAME_NUM[count]-10, 0),- COUNT_TO_FRAME_NUM[count+1]-10- )+ COUNT_TO_FRAME_NUM[count+1]-10))for index in index_range:self.frames[index] = disp.paint_mobject(mob, self.frames[index]diff --git a/old_projects/putnam.py b/old_projects/putnam.pyindex eb8eae3a8..51fa345d4 100644--- a/old_projects/putnam.py+++ b/old_projects/putnam.py@@ -100,7 +100,7 @@ class IntroducePutnam(Scene):self.play(ReplacementTransform(six_hours, three_hours),ReplacementTransform(six_hours.copy(), three_hours_copy),- *map(ShowCreation, rects)+ *list(map(ShowCreation, rects)))self.wait()self.play(LaggedStart(@@ -180,11 +180,11 @@ class OtherVideoClips(Scene):rect.set_height(6.5)rect.center()rect.to_edge(DOWN)- titles = map(TextMobject, [+ titles = list(map(TextMobject, ["Essence of calculus, chapter 1","Pi hiding in prime regularities","How do cryptocurrencies work?"- ])+ ]))self.add(rect)last_title = None@@ -363,7 +363,7 @@ class TwoDCase(Scene):self.play(morty.change, "happy",morty.fade, 1,- *map(FadeOut, [bubble, bubble.content])+ *list(map(FadeOut, [bubble, bubble.content])))self.remove(morty)@@ -498,9 +498,9 @@ class TwoDCase(Scene):arc = self.arcself.triangle.save_state()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.push_pins, self.triangle, self.arc_lines- ]))+ ])))self.update_animations.remove(self.triangle_update)self.update_animations += [self.get_center_lines_update(self.point_mobs, self.center_lines),@@ -768,7 +768,7 @@ class TwoDCase(Scene):def get_point_mob_angles(self):point_mobs = self.point_mobspoints = [pm.get_center() - self.center for pm in point_mobs]- return np.array(map(angle_of_vector, points))+ return np.array(list(map(angle_of_vector, points)))def have_p3_jump_around_randomly(self, n_jumps, wait_time = 0.75, run_time = 0):for x in range(n_jumps):@@ -881,7 +881,7 @@ class RevisitTwoDCase(TwoDCase):self.n_in += 1else:self.n_out += 1- nums = map(Integer, [self.n_in, self.n_in, self.n_out])+ nums = list(map(Integer, [self.n_in, self.n_in, self.n_out]))VGroup(*nums[:2]).set_color(self.positive_triangle_color)VGroup(*nums[2:]).set_color(self.negative_triangle_color)for num, placeholder, position in zip(nums, placeholders, positions):@@ -902,7 +902,7 @@ class RevisitTwoDCase(TwoDCase):nums = place_random_triangles(self.n_random_trials, 0.05)self.add(nums)self.wait()- self.play(*map(FadeOut, [frac, nums, title]))+ self.play(*list(map(FadeOut, [frac, nums, title])))def add_lines_and_comment_on_them(self):center_lines = self.get_center_lines()@@ -938,12 +938,12 @@ class RevisitTwoDCase(TwoDCase):self.play(center_lines.restore,center_lines.fade, 1,- *map(FadeOut, [+ *list(map(FadeOut, [rect, words2, center_line_shadows,self.triangle, arcs,self.point_mobs,self.point_labels,- ])+ ])))center_lines.restore()self.remove(center_lines)@@ -960,12 +960,12 @@ class RevisitTwoDCase(TwoDCase):group = VGroup(random_procedure, underline)group.to_corner(UP+RIGHT)- words = VGroup(*map(TextMobject, [+ words = VGroup(*list(map(TextMobject, ["Choose 3 random points","Choose 2 random lines","Flip coin for each line \\\\ to get $P_1$ and $P_2$","Choose $P_3$ at random"- ]))+ ])))words.scale(0.8)words.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)words.next_to(underline, DOWN)@@ -1210,7 +1210,7 @@ class ContrastTwoRandomProcesses(TwoDCase):)self.add(c2)n = len(c2) - len(c1)- self.play(*map(GrowFromCenter, c2[-n:]))+ self.play(*list(map(GrowFromCenter, c2[-n:])))class Rewrite3DRandomProcedure(Scene):def construct(self):@@ -1222,12 +1222,12 @@ class Rewrite3DRandomProcedure(Scene):group = VGroup(random_procedure, underline)group.to_corner(UP+LEFT)- words = VGroup(*map(TextMobject, [+ words = VGroup(*list(map(TextMobject, ["Choose 4 random points","Choose 3 random lines","Choose $P_4$ at random","Flip coin for each line \\\\ to get $P_1$, $P_2$, $P_3$",- ]))+ ])))words.scale(0.8)words.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)words.next_to(underline, DOWN)diff --git a/old_projects/pythagorean_proof.py b/old_projects/pythagorean_proof.pyindex b59eb9bcf..8b13654c5 100644--- a/old_projects/pythagorean_proof.py+++ b/old_projects/pythagorean_proof.py@@ -165,7 +165,7 @@ class IndicateTroublePointFromParallelLines(AddParallelLines):vect = DOWN+RIGHTarrow = Arrow(circle.get_center()+2*vect, circle.get_boundary_point(vect))arrow.set_color(circle.get_color())- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))class DrawAllThreeSquaresWithMoreTriangles(DrawAllThreeSquares):@@ -224,7 +224,7 @@ class IndicateBigRectangleTroublePoint(DrawAllThreeSquaresWithMoreTriangles):circle.shift(4*RIGHT)vect = DOWN+RIGHTarrow = Arrow(circle.get_center()+vect, circle.get_boundary_point(vect))- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))class ShowBigRectangleDimensions(DrawAllThreeSquaresWithMoreTriangles):args_list = [(10, False)]@@ -239,7 +239,7 @@ class ShowBigRectangleDimensions(DrawAllThreeSquaresWithMoreTriangles):b_plus_2a = TexMobject("b+2a").scale(TEX_MOB_SCALE_FACTOR)a_plus_2b.next_to(u_brace, DOWN)b_plus_2a.next_to(side_brace, LEFT)- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))class FillInAreaOfBigRectangle(DrawAllThreeSquaresWithMoreTriangles):args_list = [(10, False)]@@ -267,7 +267,7 @@ class DrawOnlyABSquares(Scene):symobl.shift(mob.get_center())self.add(symobl)triangle = Triangle()- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))class AddTriangleCopyToABSquares(DrawOnlyABSquares):def construct(self):@@ -317,7 +317,7 @@ class DrawCSquareWithAllTraingles(Scene):]@staticmethoddef args_to_string(*toggle_vector):- return "".join(map(str, map(int, toggle_vector)))+ return "".join(map(str, list(map(int, toggle_vector))))def construct(self, *toggle_vector):if len(toggle_vector) == 0:@@ -388,7 +388,7 @@ class ZoomInOnTroublePoint(Scene):angle1_arc.filter_out(lambda x_y_z2 : not (x_y_z2[0] > 0 and x_y_z2[1] > 0 and x_y_z2[1] < x_y_z2[0]/3))angle2_arc.filter_out(lambda x_y_z3 : not (x_y_z3[0] < 0 and x_y_z3[1] > 0 and x_y_z3[1] < -3*x_y_z3[0]))- self.add_mobjects_among(locals().values())+ self.add_mobjects_among(list(locals().values()))self.add_elbow()if rotate:for mob in self.mobjects:@@ -456,7 +456,7 @@ class CompletelyFillLargeSquare(LabelLargeSquare):LabelLargeSquare.construct(self)vertices = [2*(DOWN+LEFT), 2*(DOWN+RIGHT), 2*(UP+RIGHT), 2*(UP+LEFT)]vertices.append(vertices[0])- pairs = zip(vertices, vertices[1:])+ pairs = list(zip(vertices, vertices[1:]))self.set_color_region(region_from_line_boundary(*pairs), color = BLUE)diff --git a/old_projects/qa_round_two.py b/old_projects/qa_round_two.pyindex e43f56578..9b7b477d5 100644--- a/old_projects/qa_round_two.py+++ b/old_projects/qa_round_two.py@@ -106,7 +106,7 @@ class PowersOfTwo(Scene):two_to_ten.replace(mob[0])self.play(two_to_ten.restore,- *map(ShowCreation, lines)+ *list(map(ShowCreation, lines)))curr_po2_outline = curr_po2[-1].copy()diff --git a/old_projects/tattoo.py b/old_projects/tattoo.pyindex af883894a..7de497bb0 100644--- a/old_projects/tattoo.py+++ b/old_projects/tattoo.py@@ -255,9 +255,9 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene):Write(one))self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [words, arrow, brace, one- ]))+ ])))self.radial_line_label = VGroup(brace, one)def show_sine_and_cosine(self):@@ -335,9 +335,9 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene):self.wait()self.change_mode("confused")self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [tan_frac, cot_frac, self.sin_group, self.cos_group- ]))+ ])))self.wait()self.play(@@ -387,7 +387,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene):self.tangent_line = self.get_tangent_line()self.add(self.tangent_line)self.play(*it.chain(*[- map(FadeOut, [tan_group, cot_group]),+ list(map(FadeOut, [tan_group, cot_group])),[Animation(self.theta_group[-1])]]))@@ -472,9 +472,9 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene):self.change_mode("confused")self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [sec_group, sec_frac- ]))+ ])))self.csc_group = csc_groupself.csc_frac =csc_frac@@ -543,7 +543,7 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene):self.pi_creature.change_mode, "confused")self.wait(2)- self.play(*map(FadeOut, [question, arrow]))+ self.play(*list(map(FadeOut, [question, arrow])))self.play(Write(opp_over_hyp))@@ -578,11 +578,11 @@ class ExplainTrigFunctionDistances(TrigRepresentationsScene, PiCreatureScene):self.change_mode("happy")self.play(FadeOut(opp_over_hyp))self.reciprocate(frac1, frac2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [one, self.csc_group, tri1,frac1, frac2, self.csc_frac,arc_theta- ]))+ ])))def reciprocate(self, frac1, frac2):# Not general, meant only for these definitions:@@ -721,13 +721,13 @@ class RenameAllInTermsOfSine(Scene):"= \\frac{1}{\\sin(90^\\circ - \\theta)}","= \\frac{\\sin(90^\\circ - \\theta)}{\\sin(\\theta)}",]- mobs = VGroup(*map(TexMobject, texs))+ mobs = VGroup(*list(map(TexMobject, texs)))sin, cos, tan = mobs[:3]sin.target_color = YELLOWcos.target_color = GREENtan.target_color = RED- rhs_mobs = VGroup(*map(TexMobject, equivs))+ rhs_mobs = VGroup(*list(map(TexMobject, equivs)))rhs_mobs.submobjects[0] = VectorizedPoint()for mob, shift_val in zip(mobs, shift_vals):mob.shift(shift_val)@@ -741,7 +741,7 @@ class RenameAllInTermsOfSine(Scene):VGroup(mob.target, rhs_mob).move_to(mob)sin.target.set_color(sin.target_color)self.play(*it.chain(*[- map(MoveToTarget, mobs),+ list(map(MoveToTarget, mobs)),[Write(rhs_mobs)]]))self.wait(2)diff --git a/old_projects/tau_poem.py b/old_projects/tau_poem.pyindex 4ec0f7052..fbb4111ed 100644--- a/old_projects/tau_poem.py+++ b/old_projects/tau_poem.py@@ -1,6 +1,6 @@#!/usr/bin/env python-from __future__ import absolute_import+import numpy as npimport itertools as itfrom copy import deepcopy@@ -59,7 +59,7 @@ FORMULAE = [# "\\sum_{n = 0}^\\infty \\frac{(-1)^n}{2n+1} = \\frac{\\pi}{4} \\\\",]-DIGITS = map(str, list("62831853071795864769"))+DIGITS = list(map(str, list("62831853071795864769")))DIGITS[1] = "." + DIGITS[1] #2->.2BUFF = 1.0@@ -84,7 +84,7 @@ class HappyTauDayWords(Scene):self.play(BlinkPiCreature(pi))class TauPoem(Scene):- args_list = map(lambda x : (x,), range(len(POEM_LINES)))+ args_list = [(x,) for x in range(len(POEM_LINES))]@staticmethoddef args_to_string(line_num, *ignore):return str(line_num)diff --git a/old_projects/three_dimensions.py b/old_projects/three_dimensions.pyindex 304463ae9..8c69a1e13 100644--- a/old_projects/three_dimensions.py+++ b/old_projects/three_dimensions.py@@ -38,7 +38,7 @@ class CubeWithFaces(Mobject2D):self.set_color(BLUE)def unit_normal(self, coords):- return np.array(map(lambda x : 1 if abs(x) == 1 else 0, coords))+ return np.array([1 if abs(x) == 1 else 0 for x in coords])class Cube(Mobject1D):def generate_points(self):@@ -87,7 +87,7 @@ class Dodecahedron(Mobject1D):]).points#Rotate those 5 edges into all 30.for i in range(3):- perm = map(lambda j : j%3, range(i, i+3))+ perm = [j%3 for j in range(i, i+3)]for b in [-1, 1]:matrix = b*np.array([x[perm], y[perm], z[perm]])self.add_points(np.dot(five_lines_points, matrix))diff --git a/old_projects/triangle_of_power/end.py b/old_projects/triangle_of_power/end.pyindex b6defafce..bc2fb3d5f 100644--- a/old_projects/triangle_of_power/end.py+++ b/old_projects/triangle_of_power/end.py@@ -177,9 +177,9 @@ class TriangleOfPowerIsBetter(Scene):def construct(self):top = TOP("x", "y", "z", radius = 0.75)top.set_color(BLUE)- alts = VMobject(*map(TexMobject, [+ alts = VMobject(*list(map(TexMobject, ["x^y", "\\log_x(z)", "\\sqrt[y]{z}"- ]))+ ])))for mob, color in zip(alts.split(), OPERATION_COLORS):mob.set_color(color)alts.arrange_submobjects(DOWN)diff --git a/old_projects/triangle_of_power/intro.py b/old_projects/triangle_of_power/intro.pyindex 1f0ee12ff..61156e5b2 100644--- a/old_projects/triangle_of_power/intro.py+++ b/old_projects/triangle_of_power/intro.py@@ -332,11 +332,11 @@ class WhatTheHell(Scene):def construct(self):randy = Randolph()randy.to_corner(DOWN+LEFT)- exp, rad, log = map(TexMobject,[+ exp, rad, log = list(map(TexMobject,["2^3 = 8","\\sqrt[3]{8} = 2","\\log_2(8) = 3",- ])+ ]))# exp.set_color(BLUE_D)# rad.set_color(RED_D)# log.set_color(GREEN_D)@@ -458,9 +458,9 @@ class LogarithmProperties(Scene):class HaveToShare(Scene):def construct(self):- words = map(TextMobject, [+ words = list(map(TextMobject, ["Lovely", "Symmetrical", "Utterly Reasonable"- ])+ ]))for w1, w2 in zip(words, words[1:]):w2.next_to(w1, DOWN)VMobject(*words).center()diff --git a/old_projects/triangle_of_power/triangle.py b/old_projects/triangle_of_power/triangle.pyindex 5fd7b2d7a..c8eea6760 100644--- a/old_projects/triangle_of_power/triangle.py+++ b/old_projects/triangle_of_power/triangle.py@@ -22,14 +22,14 @@ def get_equation(index, x = 2, y = 3, z = 8, expression_only = False):return TexMobject(tex).set_color(OPERATION_COLORS[index])def get_inverse_rules():- return map(TexMobject, [+ return list(map(TexMobject, ["x^{\\log_x(z)} = z","\\log_x\\left(x^y \\right) = y","\\sqrt[y]{x^y} = x","\\left(\\sqrt[y]{z}\\right)^y = z","\\sqrt[\\log_x(z)]{z} = x","\\log_{\\sqrt[y]{z}}(z) = y",- ])+ ]))def get_top_inverse_rules():result = []@@ -283,9 +283,9 @@ class SixDifferentInverses(Scene):top_rule.set_height(1.5)top_rule.center()top_rule.shift(rule.get_center())- self.play(*map(FadeOut, rules))+ self.play(*list(map(FadeOut, rules)))self.remove(*rules)- self.play(*map(GrowFromCenter, top_rules))+ self.play(*list(map(GrowFromCenter, top_rules)))self.wait()self.remove(general_idea)rules = get_inverse_rules()@@ -395,10 +395,7 @@ class AdditiveProperty(Scene):ApplyMethod(log_rule.set_color, RED),)self.wait()- all_tops = filter(- lambda m : isinstance(m, TOP),- t_exp_rule.split()+t_log_rule.split()- )+ all_tops = [m for m in t_exp_rule.split()+t_log_rule.split() if isinstance(m, TOP)]self.put_in_circles(all_tops)self.set_color_appropriate_parts(t_exp_rule, t_log_rule)diff --git a/old_projects/triples.py b/old_projects/triples.pyindex 1734e7f71..8ab09044d 100644--- a/old_projects/triples.py+++ b/old_projects/triples.py@@ -67,21 +67,18 @@ class IntroduceTriples(TeacherStudentsScene):)if c in [5, 13, 25]:if c == 5:- keys = range(0, 5, 2)+ keys = list(range(0, 5, 2))elif c == 13:- keys = range(0, 13, 3)+ keys = list(range(0, 13, 3))elif c == 25:- keys = range(0, 25, 4)- i_list = filter(- lambda i : (i%c) in keys and (i//c) in keys,- range(c**2)- )+ keys = list(range(0, 25, 4))+ i_list = [i for i in range(c**2) if (i%c) in keys and (i//c) in keys]else:- i_list = range(a**2)- not_i_list = filter(+ i_list = list(range(a**2))+ not_i_list = list(filter(lambda i : i not in i_list,- range(c**2),- )+ list(range(c**2)),+ ))c_square_parts = [VGroup(*[c_square[i] for i in i_list]),VGroup(*[c_square[i] for i in not_i_list]),@@ -121,7 +118,7 @@ class IntroduceTriples(TeacherStudentsScene):self.play(Write(equation))self.play(c_square.set_color, C_COLOR)self.wait()- self.play(*map(FadeOut, [full_group, equation]))+ self.play(*list(map(FadeOut, [full_group, equation])))class CompareToFermatsLastTheorem(TeacherStudentsScene):def construct(self):@@ -204,8 +201,8 @@ class ShowManyTriples(Scene):if triangle.get_width() > max_width:triangle.set_width(max_width)triangle.move_to(2*RIGHT)- num_strings = map(str, (a, b, c))- labels = map(TexMobject, num_strings)+ num_strings = list(map(str, (a, b, c)))+ labels = list(map(TexMobject, num_strings))for label, color in zip(labels, SIDE_COLORS):label.set_color(color)labels[0].next_to(triangle, DOWN)@@ -350,7 +347,7 @@ class PythagoreanProof(Scene):self.add(triangle, triangle_copy)self.play(Write(side_labels))self.wait()- self.play(*map(DrawBorderThenFill, squares))+ self.play(*list(map(DrawBorderThenFill, squares)))self.add_labels_to_squares(squares, side_labels)self.wait()self.play(@@ -373,10 +370,10 @@ class PythagoreanProof(Scene):)self.wait()- big_squares = VGroup(*map(+ big_squares = VGroup(*list(map(self.get_big_square,[triangle, triangle_copy]- ))+ )))negative_space_words = TextMobject("Same negative \\\\ space")@@ -389,12 +386,12 @@ class PythagoreanProof(Scene):FadeIn(big_squares),Write(negative_space_words),ShowCreation(double_arrow),- *map(FadeOut, squares)+ *list(map(FadeOut, squares)))self.wait(2)self.play(*it.chain(- map(FadeIn, squares),- map(Animation, big_squares),+ list(map(FadeIn, squares)),+ list(map(Animation, big_squares)),))self.wait(2)@@ -436,7 +433,7 @@ class PythagoreanProof(Scene):#####def get_triangle_side_labels(self, triangle):- a, b, c = map(TexMobject, "abc")+ a, b, c = list(map(TexMobject, "abc"))for mob, color in zip([a, b, c], SIDE_COLORS):mob.set_color(color)a.next_to(triangle, DOWN)@@ -603,7 +600,7 @@ class ReframeOnLattice(PiCreatureScene):Transform(group.line, new_group.line),)self.wait(2)- self.play(*map(FadeOut, [group, group.triangle, group.line]))+ self.play(*list(map(FadeOut, [group, group.triangle, group.line])))def resize_plane(self):new_plane = ComplexPlane(@@ -638,7 +635,7 @@ class ReframeOnLattice(PiCreatureScene):self.play(MoveToTarget(self.plane),- *map(MoveToTarget, self.plane.coordinate_labels),+ *list(map(MoveToTarget, self.plane.coordinate_labels)),run_time = 2)self.remove(self.plane)@@ -922,7 +919,7 @@ class ReframeOnLattice(PiCreatureScene):dot.target.move_to(line.target.get_end())self.play(FadeOut(distance_label),- *map(MoveToTarget, [five, line, dot]),+ *list(map(MoveToTarget, [five, line, dot])),run_time = 2)self.wait(2)@@ -930,12 +927,12 @@ class ReframeOnLattice(PiCreatureScene):####def get_all_plane_dots(self):- x_min, y_min = map(int, self.plane.point_to_coords(+ x_min, y_min = list(map(int, self.plane.point_to_coords(FRAME_X_RADIUS*LEFT + FRAME_Y_RADIUS*DOWN- ))- x_max, y_max = map(int, self.plane.point_to_coords(+ )))+ x_max, y_max = list(map(int, self.plane.point_to_coords(FRAME_X_RADIUS*RIGHT + FRAME_Y_RADIUS*UP- ))+ )))result = VGroup(*[Dot(self.plane.coords_to_point(x, y),@@ -964,8 +961,8 @@ class OneMoreExample(Scene):"unit_size" : 0.5,"plane_center" : 3*LEFT + 3*DOWN,"dot_color" : YELLOW,- "x_label_range" : range(-6, 25, 3),- "y_label_range" : range(3, 13, 3),+ "x_label_range" : list(range(-6, 25, 3)),+ "y_label_range" : list(range(3, 13, 3)),}def construct(self):self.add_plane()@@ -1319,8 +1316,8 @@ class FiveTwoExample(GeneralExample):CONFIG = {"number" : complex(5, 2),"unit_size" : 0.25,- "x_label_range" : range(-10, 40, 5),- "y_label_range" : range(0, 30, 5),+ "x_label_range" : list(range(-10, 40, 5)),+ "y_label_range" : list(range(0, 30, 5)),}class WriteGeneralFormula(GeneralExample):@@ -1419,7 +1416,7 @@ class WriteGeneralFormula(GeneralExample):line.set_color(self.square_color)- self.play(*map(FadeIn, [rect, top_line, second_line]))+ self.play(*list(map(FadeIn, [rect, top_line, second_line])))self.wait()self.play(real_part.copy().next_to, real_part_line.copy(),@@ -1504,10 +1501,10 @@ class WriteGeneralFormula(GeneralExample):triple_mobs.arrange_submobjects(DOWN)triple_mobs.next_to(triple_title, DOWN, MED_LARGE_BUFF)- self.play(*map(FadeIn, [+ self.play(*list(map(FadeIn, [rect, h_line, v_line,uv_title, triple_title- ]))+ ])))self.play(*[LaggedStart(FadeIn, mob,@@ -1522,8 +1519,8 @@ class VisualizeZSquared(Scene):"initial_unit_size" : 0.4,"final_unit_size" : 0.1,"plane_center" : 3*LEFT + 2*DOWN,- "x_label_range" : range(-12, 24, 4),- "y_label_range" : range(-4, 24, 4),+ "x_label_range" : list(range(-12, 24, 4)),+ "y_label_range" : list(range(-4, 24, 4)),"dot_color" : YELLOW,"square_color" : MAROON_B,"big_dot_radius" : 0.075,@@ -1644,7 +1641,7 @@ class VisualizeZSquared(Scene):label.next_to(point, vect)label.add_background_rectangle()- self.play(*map(FadeIn, [z_label, z_dot]))+ self.play(*list(map(FadeIn, [z_label, z_dot])))self.wait()self.play(ShowCreation(arrow))self.play(ReplacementTransform(@@ -1662,9 +1659,9 @@ class VisualizeZSquared(Scene):arrows.add(arrow)dots.add(z_dot, square_dot)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [dots, arrows, self.z_to_z_squared- ]))+ ])))def draw_dots(self):min_corner, max_corner = [@@ -1673,8 +1670,8 @@ class VisualizeZSquared(Scene):)for u in (-1, 1)]- x_min, y_min = map(int, min_corner[:2])- x_max, y_max = map(int, max_corner[:2])+ x_min, y_min = list(map(int, min_corner[:2]))+ x_max, y_max = list(map(int, max_corner[:2]))dots = VGroup(*[Dot(@@ -1779,7 +1776,7 @@ class VisualizeZSquared(Scene):self.revert_to_original_skipping_status()self.play(- *map(MoveToTarget, movers),+ *list(map(MoveToTarget, movers)),run_time = 3)self.wait(2)@@ -1876,8 +1873,8 @@ class PointsWeMiss(VisualizeZSquared):CONFIG = {"final_unit_size" : 0.4,"plane_center" : 2*LEFT + 2*DOWN,- "dot_x_range" : range(-5, 6),- "dot_y_range" : range(-4, 4),+ "dot_x_range" : list(range(-5, 6)),+ "dot_y_range" : list(range(-4, 4)),}def construct(self):self.add_plane()@@ -1915,11 +1912,11 @@ class PointsWeMiss(VisualizeZSquared):def show_missing_point(self):z_list = [complex(6, 8), complex(9, 12), complex(3, 4)]- points = map(+ points = list(map(self.background_plane.number_to_point,z_list- )- dots = VGroup(*map(Dot, points))+ ))+ dots = VGroup(*list(map(Dot, points)))for dot in dots[:2]:dot.set_stroke(RED, 4)dot.set_fill(opacity = 0)@@ -1964,11 +1961,11 @@ class PointsWeMiss(VisualizeZSquared):def show_second_missing_point(self):z_list = [complex(4, 3), complex(8, 6)]- points = map(+ points = list(map(self.background_plane.number_to_point,z_list- )- dots = VGroup(*map(Dot, points))+ ))+ dots = VGroup(*list(map(Dot, points)))dots[0].set_stroke(RED, 4)dots[0].set_fill(opacity = 0)labels = VGroup(*[@@ -2067,10 +2064,10 @@ class DrawSingleRadialLine(PointsWeMiss):class DrawRadialLines(PointsWeMiss):CONFIG = {"final_unit_size" : 0.2,- "dot_x_range" : range(-4, 10),- "dot_y_range" : range(-4, 10),- "x_label_range" : range(-12, 40, 4),- "y_label_range" : range(-4, 32, 4),+ "dot_x_range" : list(range(-4, 10)),+ "dot_y_range" : list(range(-4, 10)),+ "x_label_range" : list(range(-12, 40, 4)),+ "y_label_range" : list(range(-4, 32, 4)),"big_dot_radius" : 0.05,}def construct(self):@@ -2214,8 +2211,8 @@ class RationalPointsOnUnitCircle(DrawRadialLines):self.from_rational_point_to_triple()def add_plane(self):- added_x_coords = range(-4, 6, 2)- added_y_coords = range(-2, 4, 2)+ added_x_coords = list(range(-4, 6, 2))+ added_y_coords = list(range(-2, 4, 2))self.x_label_range += added_x_coordsself.y_label_range += added_y_coordsDrawRadialLines.add_plane(self)@@ -2561,7 +2558,7 @@ class SupposeMissingPoint(PointsWeMiss):self.play(ShowCreation(circle))self.add(dot.copy().fade())self.add(line.copy().set_stroke(GREY, 1))- self.play(*map(MoveToTarget, [dot, line]))+ self.play(*list(map(MoveToTarget, [dot, line])))self.wait()self.play(Write(rational_point_word),@@ -2643,7 +2640,7 @@ class FinalProof(RationalPointsOnUnitCircle):rise_text = rise_brace.get_text("Rise = $\\frac{b}{c}$")rise_text.add_background_rectangle()- self.play(*map(ShowCreation, [h_line, v_line]))+ self.play(*list(map(ShowCreation, [h_line, v_line])))self.wait()self.play(GrowFromCenter(rise_brace),@@ -2655,13 +2652,13 @@ class FinalProof(RationalPointsOnUnitCircle):FadeIn(run_text))self.wait(3)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.example_dot, self.example_label,self.secant_line,h_line, v_line,run_brace, rise_brace,run_text, rise_text,- ]))+ ])))def show_all_rational_slopes(self):lines = VGroup()@@ -2707,7 +2704,7 @@ class FinalProof(RationalPointsOnUnitCircle):Transform(label, new_label),)self.wait()- self.play(*map(FadeOut, [line, label]))+ self.play(*list(map(FadeOut, [line, label])))def square_example_point(self):z = complex(2, 1)@@ -2948,8 +2945,8 @@ class BitOfCircleGeometry(Scene):group.set_color(color)group.add(arc, label)if len(groups) == 0:- self.play(*map(ShowCreation, [dot1, dot2]))- self.play(*map(ShowCreation, [line1, line2]))+ self.play(*list(map(ShowCreation, [dot1, dot2])))+ self.play(*list(map(ShowCreation, [line1, line2])))self.play(ShowCreation(arc))self.play(FadeIn(label))groups.add(group)@@ -3032,12 +3029,12 @@ class Thumbnail(DrawRadialLines):fill_opacity = 1,)rect.to_corner(UP+RIGHT, buff = 0.01)- triples = VGroup(*map(TexMobject, [+ triples = VGroup(*list(map(TexMobject, ["3^2 + 4^2 = 5^2","5^2 + 12^2 = 13^2","8^2 + 15^2 = 17^2","\\vdots"- ]))+ ])))triples.arrange_submobjects(DOWN, buff = MED_LARGE_BUFF)triples.next_to(rect.get_top(), DOWN)self.add(rect, triples)diff --git a/old_projects/uncertainty.py b/old_projects/uncertainty.pyindex 134634b10..4aea680db 100644--- a/old_projects/uncertainty.py+++ b/old_projects/uncertainty.py@@ -1,6 +1,6 @@# -*- coding: utf-8 -*--from __future__ import print_function+import scipyfrom big_ol_pile_of_manim_imports import *from old_projects.fourier import *@@ -423,7 +423,7 @@ class FourierTradeoff(Scene):)time_axes.add(time_label)time_axes.center().to_edge(UP)- time_axes.x_axis.add_numbers(*range(1, 2*time_mean))+ time_axes.x_axis.add_numbers(*list(range(1, 2*time_mean)))frequency_axes = Axes(x_min = 0,@@ -780,7 +780,7 @@ class TwoCarsAtRedLight(Scene):axes.add(time_label, y_title)axes.to_corner(UP+LEFT, buff = MED_SMALL_BUFF)graph = axes.get_graph(- self.get_multispike_function(range(1, 4)),+ self.get_multispike_function(list(range(1, 4))),x_min = 0.8,x_max = 3.8,)@@ -894,7 +894,7 @@ class TwoCarsAtRedLight(Scene):n_spikes = 12new_time_graph = time_axes.get_graph(- self.get_multispike_function(range(1, n_spikes+1)),+ self.get_multispike_function(list(range(1, n_spikes+1))),x_min = 0.8,x_max = n_spikes + 0.8,)@@ -972,12 +972,12 @@ class TwoCarsAtRedLight(Scene):self.play(FadeIn(label),GrowArrow(arrow),- *map(self.get_flashes, self.cars)+ *list(map(self.get_flashes, self.cars)))self.play(GrowFromCenter(brace),Write(text, run_time = 1),- *map(self.get_flashes, self.cars)+ *list(map(self.get_flashes, self.cars)))self.play(*[self.get_flashes(car, num_flashes = 10)@@ -1095,7 +1095,7 @@ class VariousMusicalNotes(Scene):self.play(ShowCreation(long_graph),- *map(FadeOut, [last_brace, last_phrase])+ *list(map(FadeOut, [last_brace, last_phrase])))self.play(Write(short_signal_words),@@ -1128,7 +1128,7 @@ class CrossOutDefinitenessAndCertainty(TeacherStudentsScene):)words.arrange_submobjects(DOWN)words.next_to(self.teacher, UP+LEFT)- crosses = VGroup(*map(Cross, words))+ crosses = VGroup(*list(map(Cross, words)))self.add(words)self.play(@@ -1175,7 +1175,7 @@ class FourierRecapScene(DrawFrequencyPlot):"x_max" : 10.0,"x_axis_config" : {"unit_size" : 0.7,- "numbers_to_show" : range(1, 10, 1),+ "numbers_to_show" : list(range(1, 10, 1)),}},"initial_winding_frequency" : 0.1,@@ -1247,10 +1247,10 @@ class FourierRecapScene(DrawFrequencyPlot):rate_func = wiggle,))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [self.frequency_axes, fourier_graph,signal_label, fourier_label,- ]))+ ])))self.time_graph = time_graphself.set_variables_as_attrs(time_graph, fourier_label)@@ -1630,9 +1630,9 @@ class LongAndShortSignalsInWindingMachine(FourierRecapScene):run_time = 3)self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [dot, arrow, self.center_of_mass_dot- ]))+ ])))#This is not great...for attr in "center_of_mass_dot", "fourier_graph_dot":self.__dict__.pop(attr)@@ -2802,16 +2802,16 @@ class AmbiguityInLongEchos(IntroduceDopplerRadar, PiCreatureScene):))def get_graph(func):return frequency_axes.get_graph(func)- shifted_graphs = VGroup(*map(- get_graph, map(get_func, self.object_velocities)- ))+ shifted_graphs = VGroup(*list(map(+ get_graph, list(map(get_func, self.object_velocities))+ )))shifted_graphs.match_style(fourier_graph)return shifted_graphsdef get_sum_graph(self, axes, graphs):def get_func(graph):return graph.underlying_function- funcs = map(get_func, graphs)+ funcs = list(map(get_func, graphs))return axes.get_graph(lambda t : sum([func(t) for func in funcs]),)@@ -2925,7 +2925,7 @@ class IntroduceDeBroglie(Scene):x_min = 1900,x_max = 1935,tick_frequency = 1,- numbers_with_elongated_ticks = range(1900, 1941, 10),+ numbers_with_elongated_ticks = list(range(1900, 1941, 10)),color = BLUE_D)time_line.stretch_to_fit_width(FRAME_WIDTH - picture.get_width() - 2)@@ -3486,7 +3486,7 @@ class HangingWeightsScene(MovingCameraScene):return springalphas = np.linspace(0, 1, self.n_springs)bezier([0, 1, 0, 1])- springs = self.springs = VGroup(*map(get_spring, alphas))+ springs = self.springs = VGroup(*list(map(get_spring, alphas)))k_tracker = self.k_tracker = VectorizedPoint()t_tracker = self.t_tracker = VectorizedPoint()@@ -3542,7 +3542,7 @@ class HangingWeightsScene(MovingCameraScene):arrows.set_color(WHITE)self.wait(3)- self.play(*map(GrowArrow, arrows))+ self.play(*list(map(GrowArrow, arrows)))self.play(*[UpdateFromAlphaFunc(weight, lambda w, a : w.set_width(@@ -3650,7 +3650,7 @@ class HangingWeightsScene(MovingCameraScene):index = int(0.5*len(self.springs))weights = VGroup(self.weights[index], self.weights[index+4])- flashes = map(self.get_peak_flash_anim, weights)+ flashes = list(map(self.get_peak_flash_anim, weights))weights.save_state()weights.set_fill(RED)self.add(*flashes)@@ -3896,9 +3896,9 @@ class FourierTransformOfWaveFunction(Scene):run_time = 3,)last_f = f- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [sinusoid, v_line, freq_label- ]))+ ])))def this_is_momentum(self):formula = TexMobject("p", "=", "h", "\\xi")@@ -3940,7 +3940,7 @@ class FourierTransformOfWaveFunction(Scene):run_time = 2)self.wait()- self.play(*map(FadeOut, [brace, words, formula]))+ self.play(*list(map(FadeOut, [brace, words, formula])))def show_tradeoff(self):for a in 5, 0.1, 0.01, 10, 0.5:@@ -4156,7 +4156,7 @@ class ProbabalisticDetection(FourierTransformOfWaveFunction):self.play(FadeIn(VGroup(axes, wave)),question_group.next_to, v_lines, UP, {"buff" : 0},- *map(ShowCreation, v_lines)+ *list(map(ShowCreation, v_lines)))self.wait(10)@@ -4355,9 +4355,9 @@ class ThinkOfHeisenbergUncertainty(PiCreatureScene):]self.add(*continual_anims)- position, momentum, time, frequency = map(TextMobject, [+ position, momentum, time, frequency = list(map(TextMobject, ["Position", "Momentum", "Time", "Frequency"- ])+ ]))VGroup(position, time).set_color(BLUE)VGroup(momentum, frequency).set_color(YELLOW)groups = VGroup()diff --git a/old_projects/wallis.py b/old_projects/wallis.pyindex 8fe789218..b35e1959d 100644--- a/old_projects/wallis.py+++ b/old_projects/wallis.py@@ -1,6 +1,6 @@# -*- coding: utf-8 -*--from __future__ import print_function+from big_ol_pile_of_manim_imports import *from once_useful_constructs.light import AmbientLightfrom once_useful_constructs.light import Lighthouse@@ -47,7 +47,7 @@ class WallisNumeratorDenominatorGenerator(object):def __next__(self):return next(self)- def next(self):+ def __next__(self):n = self.nself.n += 1if n % 2 == 0:@@ -127,7 +127,7 @@ class Introduction(Scene):rects = VGroup(*[SurroundingRectangle(product_mob[:n])- for n in range(3, 4 * n_terms, 4) + [4 * n_terms]+ for n in list(range(3, 4 * n_terms, 4)) + [4 * n_terms]])rect = rects[0].copy()@@ -288,7 +288,7 @@ class SourcesOfOriginality(TeacherStudentsScene):))self.play(big_rect.restore)- self.play(*map(ShowCreation, [left_rect, right_rect]))+ self.play(*list(map(ShowCreation, [left_rect, right_rect])))self.wait()self.play(math.match_color, left_rect,@@ -518,7 +518,7 @@ class ShowProduct(Scene):decimal.next_to(brace, DOWN)self.add(brace, decimal, dots[0], parts[0])- tuples = zip(parts[1:], lines, dots[1:], partial_products[1:], braces[1:])+ tuples = list(zip(parts[1:], lines, dots[1:], partial_products[1:], braces[1:]))for part, line, dot, prod, new_brace in tuples:self.play(FadeIn(part),@@ -636,7 +636,7 @@ class ShowProduct(Scene):parts.prefix.generate_target()larger_parts.fade(0.5)full_product = VGroup(*it.chain(- *zip(larger_parts.prefix.target, smaller_parts.prefix.target)+ *list(zip(larger_parts.prefix.target, smaller_parts.prefix.target))))for i, tex, vect in (0, "\\cdot", LEFT), (-1, "\\cdots", RIGHT):part = smaller_parts.prefix.target[i]@@ -682,8 +682,8 @@ class ShowProduct(Scene):decimal = DecimalNumber(next(partial_products_iter), num_decimal_places=4)decimal.next_to(brace, DOWN)- self.play(*map(FadeIn, [brace, decimal, dots[0]]))- tuples = zip(lines, dots[1:], braces[1:])+ self.play(*list(map(FadeIn, [brace, decimal, dots[0]])))+ tuples = list(zip(lines, dots[1:], braces[1:]))for line, dot, new_brace in tuples:self.play(Transform(brace, new_brace),@@ -766,14 +766,14 @@ class ShowProduct(Scene):y_max=y_max + 0.25,y_axis_config={"unit_size": unit_size,- "numbers_with_elongated_ticks": range(1, y_max + 1),+ "numbers_with_elongated_ticks": list(range(1, y_max + 1)),"tick_size": 0.05,},)axes.shift(6 * LEFT + 3 * DOWN - axes.coords_to_point(0, 0))axes.y_axis.label_direction = LEFT- axes.y_axis.add_numbers(*range(1, y_max + 1))+ axes.y_axis.add_numbers(*list(range(1, y_max + 1)))return axes@@ -1131,10 +1131,7 @@ class IntroduceDistanceProduct(DistanceProductScene):d_terms.set_color(YELLOW)plusses = sum_of_inverse_squares.get_parts_by_tex("+")last_term = sum_of_inverse_squares[-6:]- non_d_terms = VGroup(*filter(- lambda m: m not in d_terms and m not in last_term,- sum_of_inverse_squares- ))+ non_d_terms = VGroup(*[m for m in sum_of_inverse_squares if m not in d_terms and m not in last_term])brace = Brace(sum_of_inverse_squares, DOWN)brace_text = brace.get_text("Total intensity of light")@@ -1563,7 +1560,7 @@ class FromGeometryToAlgebra(DistanceProductScene):self.play(FadeIn(spacing_words),arcs_anim,- *map(GrowArrow, arrows)+ *list(map(GrowArrow, arrows)))self.play(FadeOut(arrows), arcs_anim)self.wait()@@ -1631,7 +1628,7 @@ class FromGeometryToAlgebra(DistanceProductScene):arrow.rotate(np.pi, about_point=point)outer_arrow = self.outer_arrow = outer_arrows[3].copy()- values = map(plane.point_to_number, self.get_lh_points())+ values = list(map(plane.point_to_number, self.get_lh_points()))complex_decimal = self.complex_decimal = DecimalNumber(values[3],num_decimal_places=3,@@ -1760,7 +1757,7 @@ class FromGeometryToAlgebra(DistanceProductScene):)self.wait()self.add(line_ghost)- for i in range(2, self.num_lighthouses) + [0]:+ for i in list(range(2, self.num_lighthouses)) + [0]:anims = [Transform(angle_arc, angle_arcs[i]),Transform(angle_label, angle_labels[i]),@@ -1789,7 +1786,7 @@ class FromGeometryToAlgebra(DistanceProductScene):self.play(FadeOut(angle_arc),FadeOut(angle_label),- *map(ShowCreationThenDestruction, lines)+ *list(map(ShowCreationThenDestruction, lines)))self.wait()@@ -2296,7 +2293,7 @@ class PlugObserverIntoPolynomial(DistanceProductScene):light[1:].fade(0.5)added_lights = self.lights.copy()added_lights.rotate(full_angle / 2, about_point=origin)- new_lights = VGroup(*it.chain(*zip(self.lights, added_lights)))+ new_lights = VGroup(*it.chain(*list(zip(self.lights, added_lights))))self.num_lighthouses *= 2dot.generate_target()dot.target.move_to(self.get_circle_point_at_proportion(@@ -2592,7 +2589,7 @@ class DistanceProductIsChordF(PlugObserverIntoPolynomial):fraction_words[0][0].set_color(YELLOW)fraction_words.arrange_submobjects(DOWN, SMALL_BUFF, aligned_edge=LEFT)fraction_words.next_to(O_dot.label, RIGHT)- map(TexMobject.add_background_rectangle, fraction_words)+ list(map(TexMobject.add_background_rectangle, fraction_words))f_arc, new_arc = [Arc(@@ -2771,7 +2768,7 @@ class ProveLemma2(PlugObserverIntoPolynomial):q_marks.match_color(product_decimal)zero_rects = VGroup(- *map(SurroundingRectangle, [dot, stacked_labels[0]]))+ *list(map(SurroundingRectangle, [dot, stacked_labels[0]])))self.play(LaggedStart(ShowCreation, lines),@@ -2790,7 +2787,7 @@ class ProveLemma2(PlugObserverIntoPolynomial):))self.wait()self.add_foreground_mobject(zero_rects)- self.play(*map(ShowCreation, zero_rects))+ self.play(*list(map(ShowCreation, zero_rects)))self.wait(2)self.play(VGroup(light_to_remove, zero_rects[0]@@ -3175,7 +3172,7 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):)if pi is sailor:arcs = self.get_halfway_indication_arcs()- self.play(*map(ShowCreationThenDestruction, arcs))+ self.play(*list(map(ShowCreationThenDestruction, arcs)))self.wait()def write_distance_product_fraction(self):@@ -3242,12 +3239,12 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):new_keeper_dp_decimal.replace(keeper_dp_decimal, dim_to_match=1)new_keeper_dp_decimal.set_color(YELLOW)- self.play(*map(ShowCreation, keeper_lines))+ self.play(*list(map(ShowCreation, keeper_lines)))self.play(ReplacementTransform(keeper_lines.copy(), VGroup(fraction[0])))self.play(FadeOut(keeper_lines))- self.play(*map(ShowCreation, sailor_lines))+ self.play(*list(map(ShowCreation, sailor_lines)))self.play(ReplacementTransform(sailor_lines.copy(),@@ -3701,9 +3698,9 @@ class KeeperAndSailor(DistanceProductScene, PiCreatureScene):self.wait()# Organize fractions- fractions = VGroup(*it.chain(*zip(+ fractions = VGroup(*it.chain(*list(zip(limit_fractions, cw_limit_fractions,- )))+ ))))fractions.generate_target()wallis_product = VGroup()dots = VGroup()@@ -4281,14 +4278,14 @@ class NonCommunitingLimitsExample(Scene):rows.center().to_edge(UP)rows[-1].shift(MED_SMALL_BUFF * UP)- row_rects = VGroup(*map(SurroundingRectangle, rows[:-1]))+ row_rects = VGroup(*list(map(SurroundingRectangle, rows[:-1])))row_rects.set_color(YELLOW)columns = VGroup(*[VGroup(*[row[0][i] for row in rows])for i in range(len(rows[0][0]))])- column_rects = VGroup(*map(SurroundingRectangle, columns))+ column_rects = VGroup(*list(map(SurroundingRectangle, columns)))column_rects.set_color(BLUE)row_arrows = VGroup(*[@@ -4365,7 +4362,7 @@ class NonCommunitingLimitsExample(Scene):terms = [1] * (self.num_terms_per_row)if seven_index < len(terms):terms[seven_index] = 7- row = VGroup(*map(Integer, terms))+ row = VGroup(*list(map(Integer, terms)))self.arrange_row(row)dots = self.get_row_dots(row)@@ -4497,9 +4494,9 @@ class DelicacyInIntermixingSeries(Scene):randy.flip()randy.to_corner(DR)- movers2 = VGroup(*it.chain(*zip(+ movers2 = VGroup(*it.chain(*list(zip(top_product.parts, bottom_product.parts- )))+ ))))final_product = VGroup()for mover in movers2:mover.final_position = mover.copy()@@ -5217,7 +5214,7 @@ class Thumbnail(DistanceProductScene):product.scale(1.5)product.move_to(2.5 * UP)frac_lines = product.get_parts_by_tex("\\over")- frac_indices = map(product.index_of_part, frac_lines)+ frac_indices = list(map(product.index_of_part, frac_lines))parts = VGroup(*[product[i-1:i+2]for i in frac_indicesdiff --git a/old_projects/waves.py b/old_projects/waves.pyindex a278940c3..c67c866d6 100644--- a/old_projects/waves.py+++ b/old_projects/waves.py@@ -463,7 +463,7 @@ class WantToLearnQM(TeacherStudentsScene):self.wait(2)self.teacher_says("First, lots and lots \\\\ of linear algebra",- added_anims = map(FadeOut, bubbles)+ added_anims = list(map(FadeOut, bubbles)))self.wait()@@ -895,7 +895,7 @@ class CurlRelationBetweenFields(ThreeDScene):self.play(ShowCreation(M_vects, run_time = 2),- *map(FadeOut, self.E_vects[1:])+ *list(map(FadeOut, self.E_vects[1:])))self.wait()self.play(@@ -1008,11 +1008,11 @@ class ListRelevantWaveIdeas(TeacherStudentsScene):h_line = Line(title.get_left(), title.get_right())h_line.next_to(title, DOWN, SMALL_BUFF)- topics = VGroup(*map(TextMobject, [+ topics = VGroup(*list(map(TextMobject, ["- Superposition","- Amplitudes","- How phase influences addition",- ]))+ ])))topics.scale(0.8)topics.arrange_submobjects(DOWN, aligned_edge = LEFT)topics.next_to(h_line, DOWN, aligned_edge = LEFT)@@ -1240,7 +1240,7 @@ class ShowVectorEquation(Scene):y_min = -1.5,y_max = 1.5,)- axes.x_axis.add_numbers(*range(1, 6))+ axes.x_axis.add_numbers(*list(range(1, 6)))t = TexMobject("t")t.next_to(axes.x_axis, UP, SMALL_BUFF, RIGHT)cos = self.x_without_phi.copy()@@ -1357,7 +1357,7 @@ class ShowVectorEquation(Scene):ShowCreation(arrow))self.wait(3)- self.play(*map(FadeOut, [words, arrow]))+ self.play(*list(map(FadeOut, [words, arrow])))self.corner_cos.add(corner_phi)@@ -1449,16 +1449,16 @@ class ShowVectorEquation(Scene):Arrow(kets_word.get_top(), ket, color = ket.get_color())for ket in kets])- ket_rects = VGroup(*map(SurroundingRectangle, kets))+ ket_rects = VGroup(*list(map(SurroundingRectangle, kets)))ket_rects.set_color(WHITE)unit_vectors = VGroup(*[Vector(2*vect) for vect in (RIGHT, UP)])unit_vectors.set_fill(YELLOW)self.play(FadeOut(self.brackets),- *map(MoveToTarget, [E_equals, x, y])+ *list(map(MoveToTarget, [E_equals, x, y])))- self.play(*map(Write, [right_ket, plus, up_ket]), run_time = 1)+ self.play(*list(map(Write, [right_ket, plus, up_ket])), run_time = 1)self.play(Write(kets_word),LaggedStart(ShowCreation, arrows, lag_ratio = 0.7),@@ -1471,7 +1471,7 @@ class ShowVectorEquation(Scene):self.play(ReplacementTransform(ket[1][1].copy(), unit_vect))self.wait()self.play(FadeOut(unit_vectors))- self.play(*map(FadeOut, [kets_word, arrows]))+ self.play(*list(map(FadeOut, [kets_word, arrows])))self.kets = ketsself.plus = plus@@ -1521,12 +1521,12 @@ class ShowVectorEquation(Scene):Transform(self.h_brace, new_h_brace),self.h_brace.A.next_to, new_h_brace, RIGHT, SMALL_BUFF,Transform(self.horizontally_polarized_words, words),- *map(FadeOut, [+ *list(map(FadeOut, [self.corner_group, self.v_brace,self.v_brace.A, self.low_f_graph,- ])+ ])))- self.play(*map(MoveToTarget, movers))+ self.play(*list(map(MoveToTarget, movers)))self.wait(5)class ChangeFromHorizontalToVerticallyPolarized(DirectionOfPolarizationScene):@@ -1587,7 +1587,7 @@ class SumOfTwoWaves(ChangeFromHorizontalToVerticallyPolarized):self.set_camera_position(0.95*np.pi/2, -0.03*np.pi)def construct(self):- plus, equals = pe = VGroup(*map(TexMobject, "+="))+ plus, equals = pe = VGroup(*list(map(TexMobject, "+=")))pe.scale(2)pe.rotate(np.pi/2, RIGHT)pe.rotate(np.pi/2, OUT)@@ -1681,9 +1681,9 @@ class ShowTipToTailSum(ShowVectorEquation):h_line.update(h_line)v_line.update(v_line)self.play(*it.chain(- map(MoveToTarget, self.kets),+ list(map(MoveToTarget, self.kets)),[Write(plus)],- map(ShowCreation, [h_line, v_line]),+ list(map(ShowCreation, [h_line, v_line])),))blue_black = average_color(BLUE, BLACK)self.play(@@ -1766,8 +1766,8 @@ class ShowTipToTailSum(ShowVectorEquation):self.play(*it.chain(- map(MoveToTarget, self.ket_sum),- map(Write, A_mobs),+ list(map(MoveToTarget, self.ket_sum)),+ list(map(Write, A_mobs)),[UpdateFromAlphaFunc(ov.vector,@@ -2047,7 +2047,7 @@ class ShowPolarizingFilter(DirectionOfPolarizationScene):self.play(Write(words, run_time = 2),- *map(GrowFromCenter, lines)+ *list(map(GrowFromCenter, lines)))self.wait(6)self.play(FadeOut(lines))@@ -2494,7 +2494,7 @@ class DescribePhoton(ThreeDScene):y_unit_size = 2,y_radius = FRAME_X_RADIUS,)- plane.add_coordinates(x_vals = range(-3, 4), y_vals = [])+ plane.add_coordinates(x_vals = list(range(-3, 4)), y_vals = [])plane.rotate(np.pi/2, RIGHT)plane.rotate(np.pi/2, OUT)@@ -2583,7 +2583,7 @@ class DescribePhoton(ThreeDScene):Write(word, run_time = 1))self.wait()- self.play(*map(FadeOut, [new_alpha, group]))+ self.play(*list(map(FadeOut, [new_alpha, group])))def change_basis(self):superposition = self.superposition@@ -2647,7 +2647,7 @@ class DescribePhoton(ThreeDScene):self.equation.generate_target()- self.play(*map(MoveToTarget, movers))+ self.play(*list(map(MoveToTarget, movers)))self.wait(2)self.play(*[mob.restore for mob in movers])self.wait()@@ -2676,11 +2676,11 @@ class DescribePhoton(ThreeDScene):rate_func = squish_rate_func(there_and_back)))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [morty, words, rect,self.equation.rect,self.equation.words,- ]))+ ])))def write_components(self):d_brace = Brace(Line(ORIGIN, 2*RIGHT), UP, buff = SMALL_BUFF)@@ -2849,7 +2849,7 @@ class DescribePhoton(ThreeDScene):everything.remove(self.photon.mobject)everything.remove(self.axes)- self.play(*map(FadeOut, everything))+ self.play(*list(map(FadeOut, everything)))self.move_camera(phi = 0.8*np.pi/2,theta = -0.3*np.pi,@@ -3017,7 +3017,7 @@ class ShootPhotonThroughFilter(DirectionOfPolarizationScene):self.play(Write(words, run_time = 2),self.superposition_tex.h_rect.set_stroke, RED, 3,- *map(GrowFromCenter, lines)+\+ *list(map(GrowFromCenter, lines))+\[Animation(self.pol_filter),Animation(self.frozen_photon.mobject)@@ -3339,7 +3339,7 @@ class ThreeFilters(ShootPhotonThroughFilter):use_rectangular_stem = False,path_arc = 0.5*np.pi,)- labels = VGroup(*map(TexMobject, ["0\\%", "25\\%"]))+ labels = VGroup(*list(map(TexMobject, ["0\\%", "25\\%"])))labels.scale(1.5)labels.next_to(arrow, DOWN)group = VGroup(arrow, labels)@@ -3405,7 +3405,7 @@ class ThreeFilters(ShootPhotonThroughFilter):n_to_block = int((1-ratio)*self.n_lines)random.seed(self.random_seed)indices_to_block = random.sample(- range(self.n_lines), n_to_block+ list(range(self.n_lines)), n_to_block)VGroup(*[lines[i] for i in indices_to_block]).set_stroke(width = 0)return linesdiff --git a/old_projects/wcat.py b/old_projects/wcat.pyindex 7c3a44571..d04ba6e53 100644--- a/old_projects/wcat.py+++ b/old_projects/wcat.py@@ -89,7 +89,7 @@ class ClosedLoopScene(Scene):pairs = adjacent_pairs(self.dots)else:n_pairs = len(list(self.dots))/2- pairs = zip(self.dots[:n_pairs], self.dots[n_pairs:])+ pairs = list(zip(self.dots[:n_pairs], self.dots[n_pairs:]))for d1, d2 in pairs:line = Line(d1.get_center(), d2.get_center())line.start_dot = d1@@ -119,7 +119,7 @@ class ClosedLoopScene(Scene):dots = self.dotsalphas = []alpha_range = np.arange(0, 1, precision)- loop_points = np.array(map(self.loop.point_from_proportion, alpha_range))+ loop_points = np.array(list(map(self.loop.point_from_proportion, alpha_range)))for dot in dots:vects = loop_points - dot.get_center()norms = np.apply_along_axis(np.linalg.norm, 1, vects)@@ -228,7 +228,7 @@ class Introduction(TeacherStudentsScene):pi.generate_target()pi.target.change_mode("happy")pi.target.look_at(self.get_teacher().bubble)- self.play(*map(MoveToTarget, self.get_students()))+ self.play(*list(map(MoveToTarget, self.get_students())))self.random_blink(3)self.teacher_says("Here's why \\\\ I'm excited...",@@ -236,7 +236,7 @@ class Introduction(TeacherStudentsScene):)for pi in self.get_students():pi.target.look_at(self.get_teacher().eyes)- self.play(*map(MoveToTarget, self.get_students()))+ self.play(*list(map(MoveToTarget, self.get_students())))self.wait()class WhenIWasAKid(TeacherStudentsScene):@@ -272,7 +272,7 @@ class WhenIWasAKid(TeacherStudentsScene):)self.remove(self.get_teacher())self.add(me)- self.play(*map(FadeIn, children[:-1] + [speaker]))+ self.play(*list(map(FadeIn, children[:-1] + [speaker])))self.random_blink()def run_class(self):@@ -354,10 +354,10 @@ class WhenIWasAKid(TeacherStudentsScene):self.play(Transform(me, morty),- *map(FadeOut, [+ *list(map(FadeOut, [self.students, self.teacher,me.bubble, me.bubble.content- ])+ ])))self.remove(me)self.add(morty)@@ -623,12 +623,12 @@ class PairOfPairBecomeRectangle(Scene):]midpoint = Dot(LEFT, color = RED)- words = VGroup(*map(TextMobject, [+ words = VGroup(*list(map(TextMobject, ["Common midpoint","Same distance apart","$\\Downarrow$","Rectangle",- ]))+ ])))words.arrange_submobjects(DOWN)words.to_edge(RIGHT)words[-1].set_color(BLUE)@@ -637,7 +637,7 @@ class PairOfPairBecomeRectangle(Scene):ShowCreation(dots),Write(labels))- self.play(*map(ShowCreation, lines))+ self.play(*list(map(ShowCreation, lines)))self.wait()self.play(*[ApplyMethod(@@ -672,7 +672,7 @@ class PairOfPairBecomeRectangle(Scene):ShowCreation(rectangle),Animation(dots))- self.play(*map(Write, words[2:]))+ self.play(*list(map(Write, words[2:])))self.wait()class SearchForRectangleOnLoop(ClosedLoopScene):@@ -841,7 +841,7 @@ class PairOfRealsToPlane(Scene):DashedLine(dot, two_d_point, color = dot.get_color())for dot in dots])- self.play(*map(ShowCreation, lines))+ self.play(*list(map(ShowCreation, lines)))self.play(ShowCreation(two_d_point))everything = VGroup(*self.get_mobjects())self.play(@@ -960,7 +960,7 @@ class DefineUnorderedPair(ClosedLoopScene):arrow_pairs = [VGroup(*arrows[:2]), VGroup(*arrows[2:])]for label, arrow_pair in zip(labels, arrow_pairs):- self.play(*map(FadeIn, [label, arrow_pair]))+ self.play(*list(map(FadeIn, [label, arrow_pair])))self.wait()for x in range(2):self.play(@@ -1114,7 +1114,7 @@ class RepresentPairInUnitSquare(ClosedLoopScene):self.play(FadeIn(square),Animation(self.dots),- *map(Write, right_words[1:])+ *list(map(Write, right_words[1:])))self.wait()@@ -1141,9 +1141,9 @@ class RepresentPairInUnitSquare(ClosedLoopScene):dot.target.get_center(),inner_dot.target.get_center())- self.play(*map(MoveToTarget, movers))+ self.play(*list(map(MoveToTarget, movers)))self.wait()- self.play(*map(FadeOut, [dashed_lines, self.dots]))+ self.play(*list(map(FadeOut, [dashed_lines, self.dots])))class EdgesOfSquare(Scene):def construct(self):@@ -1345,7 +1345,7 @@ class WigglingPairOfPoints(ClosedLoopScene):self.add_connecting_lines()self.dots.set_color_by_gradient(GREEN, RED)self.connecting_lines.set_color(YELLOW)- for x, pair in zip(range(20), it.cycle(alpha_pairs)):+ for x, pair in zip(list(range(20)), it.cycle(alpha_pairs)):self.move_dots_to_alphas(pair, run_time = 0.3)@@ -1508,7 +1508,7 @@ class FoldUnitSquare(EdgesOfSquare):vect = UP+RIGHT if a < b else DOWN+RIGHTlabel.next_to(dot, vect, buff = SMALL_BUFF)- self.play(*map(FadeIn, [dot, label]))+ self.play(*list(map(FadeIn, [dot, label])))x_line = Line(point+a*unit*LEFT, point)y_line = Line(point+b*unit*DOWN, point)x_line.set_color(GREEN)@@ -1528,7 +1528,7 @@ class FoldUnitSquare(EdgesOfSquare):start_dots.add(dot)else:end_dots.add(dot)- self.play(*map(FadeOut, [x_line, y_line]))+ self.play(*list(map(FadeOut, [x_line, y_line])))self.start_dots, self.end_dots = start_dots, end_dotsdef perform_fold(self):@@ -1855,7 +1855,7 @@ class StripMustIntersectItself(TeacherStudentsScene):student.generate_target()student.target.change_mode("pondering")student.target.look_at(dot)- self.play(*map(MoveToTarget, self.get_students()))+ self.play(*list(map(MoveToTarget, self.get_students())))self.random_blink(4)class PairOfMobiusPointsLandOnEachother(Scene):@@ -1947,12 +1947,12 @@ class PatreonThanks(Scene):special_thanks.set_color(YELLOW)special_thanks.shift(2*UP)- left_patrons = VGroup(*map(TextMobject,+ left_patrons = VGroup(*list(map(TextMobject,self.specific_patrons[:n_patrons/2]- ))- right_patrons = VGroup(*map(TextMobject,+ )))+ right_patrons = VGroup(*list(map(TextMobject,self.specific_patrons[n_patrons/2:]- ))+ )))for patrons, vect in (left_patrons, LEFT), (right_patrons, RIGHT):patrons.arrange_submobjects(DOWN, aligned_edge = LEFT)patrons.next_to(special_thanks, DOWN)@@ -2027,11 +2027,11 @@ class CreditThree(Scene):self.add(randy)bubble = randy.get_bubble(width = 2, height = 2)- domains = VGroup(*map(TextMobject, [+ domains = VGroup(*list(map(TextMobject, ["visualnumbertheory.com","buymywidgets.com","learnwhatilearn.com",- ]))+ ])))domains.arrange_submobjects(DOWN, aligned_edge = LEFT)domains.next_to(randy, UP, buff = LARGE_BUFF)domains.shift_onto_screen()diff --git a/old_projects/zeta.py b/old_projects/zeta.pyindex 9189cc8c3..c0fa195df 100644--- a/old_projects/zeta.py+++ b/old_projects/zeta.py@@ -1,4 +1,4 @@-from __future__ import print_function+from big_ol_pile_of_manim_imports import *import mpmath@@ -437,7 +437,7 @@ class DefineForRealS(PiCreatureScene):x_min = 0,x_max = 3,tick_frequency = 0.25,- numbers_with_elongated_ticks = range(4),+ numbers_with_elongated_ticks = list(range(4)),unit_size = 3,)number_line.add_numbers()@@ -501,9 +501,9 @@ class DefineForRealS(PiCreatureScene):self.pi_creature.change_mode, "happy")self.wait(3)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [fracs, pi_arrow, pi_dot, approx,- ]))+ ])))self.lines = linesself.braces = bracesself.dots = dots@@ -596,13 +596,13 @@ class DefineForRealS(PiCreatureScene):zeta_s_eq.shift(0.5*UP)inputs.add(*zeta_s_eq[2:2+n_input_chars])- sum_terms = TexMobject(*it.chain(*zip(+ sum_terms = TexMobject(*it.chain(*list(zip(["\\frac{1}{%d^{%s}}"%(d, input_string)for d in range(1, 1+num_shown_terms)],it.cycle(["+"])- )))+ ))))sum_terms.add(TexMobject("\\cdots").next_to(sum_terms))sum_terms.next_to(zeta_s_eq, RIGHT)for x in range(num_shown_terms):@@ -841,7 +841,7 @@ class FromRealToComplex(ComplexTransformationScene):number_line = NumberLine(unit_size = 2,tick_frequency = 0.5,- numbers_with_elongated_ticks = range(-2, 3)+ numbers_with_elongated_ticks = list(range(-2, 3)))number_line.add_numbers()input_dot = Dot(number_line.number_to_point(2))@@ -966,7 +966,7 @@ class FromRealToComplex(ComplexTransformationScene):self.play(Blink(randy))self.play(randy.change_mode, "happy")self.wait()- self.play(*map(FadeOut, [randy, bubble, frac, words]))+ self.play(*list(map(FadeOut, [randy, bubble, frac, words])))def show_s_equals_two_lines(self):self.input_label.save_state()@@ -1087,9 +1087,9 @@ class FromRealToComplex(ComplexTransformationScene):self.play(FadeIn(anti_domain))self.play(Write(anti_domain_words))self.wait(2)- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [anti_domain, anti_domain_words,- ]))+ ])))self.domain_words = domain_wordsdef ask_about_visualizing_all(self):@@ -1114,9 +1114,9 @@ class FromRealToComplex(ComplexTransformationScene):self.play(morty.change_mode, "pondering",morty.look_at, self.input_dot,- *map(FadeOut, [+ *list(map(FadeOut, [bubble, bubble.content, self.domain_words- ])+ ])))arrow = Arrow(self.input_dot, self.output_dot, buff = SMALL_BUFF)arrow.set_color(WHITE)@@ -1169,7 +1169,7 @@ class FromRealToComplex(ComplexTransformationScene):]power_sums = np.cumsum(powers)lines = VGroup(*[- Line(*map(self.z_to_point, z_pair))+ Line(*list(map(self.z_to_point, z_pair)))for z_pair in zip(power_sums, power_sums[1:])])widths = np.linspace(line_thickness, 0, len(list(lines)))@@ -1276,7 +1276,7 @@ class ComplexExponentiation(Scene):self.wait()self.play(imag_part.move_to, imag_part.get_left(),- *map(FadeOut, [brace, we_understand, real_part])+ *list(map(FadeOut, [brace, we_understand, real_part])))self.wait()self.imag_exponent = imag_part@@ -1544,7 +1544,7 @@ class ShowMultiplicationOfRealAndImaginaryExponentialParts(FromRealToComplex):imag_part.generate_target()real_part.target.next_to(brace, UP+RIGHT, buff = 0)imag_part.target.next_to(real_part.target, buff = 0)- self.play(*map(MoveToTarget, [real_part, imag_part]))+ self.play(*list(map(MoveToTarget, [real_part, imag_part])))self.wait()class ComplexFunctionsAsTransformations(ComplexTransformationScene):@@ -1587,7 +1587,7 @@ class ComplexFunctionsAsTransformations(ComplexTransformationScene):2*RIGHT+DOWN,RIGHT+2*UP,]- input_dots = VGroup(*map(Dot, input_points))+ input_dots = VGroup(*list(map(Dot, input_points)))input_dots.set_color(YELLOW)output_dots = VGroup(*[Dot(ip + on)@@ -1634,7 +1634,7 @@ class VisualizingSSquared(ComplexTransformationScene):self.title = titledef plug_in_specific_values(self):- inputs = map(complex, [2, -1, complex(0, 1)])+ inputs = list(map(complex, [2, -1, complex(0, 1)]))input_dots = VGroup(*[Dot(self.z_to_point(z), color = YELLOW)for z in inputs@@ -1788,7 +1788,7 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene):self.wait()self.play(morty.look_at, self.plane.get_bottom(),- *map(FadeOut, [bubble, bubble.content])+ *list(map(FadeOut, [bubble, bubble.content])))self.play(Blink(morty))self.play(FadeOut(morty))@@ -1799,10 +1799,10 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene):words.next_to(ORIGIN, UP+LEFT)words.shift(LEFT+UP)- line = Line(*map(self.z_to_point, [+ line = Line(*list(map(self.z_to_point, [complex(np.euler_gamma, u*FRAME_Y_RADIUS)for u in (1, -1)- ]))+ ])))line.set_color(YELLOW)arrows = [Arrow(words.get_right(), point)@@ -1818,7 +1818,7 @@ class ShowZetaOnHalfPlane(ZetaTransformationScene):)self.play(FadeOut(arrows[0]))self.wait(2)- self.play(*map(FadeOut, [words, line]))+ self.play(*list(map(FadeOut, [words, line])))def set_color_i_line(self):right_i_lines, left_i_lines = [@@ -1998,9 +1998,9 @@ class SquiggleOnExtensions(ZetaTransformationScene):arrow = Arrow(label.get_right(), dot, buff = SMALL_BUFF)self.play(Write(label, run_time = 1))- self.play(*map(ShowCreation, [arrow, dot]))+ self.play(*list(map(ShowCreation, [arrow, dot])))self.wait()- self.play(*map(FadeOut, [arrow, label]))+ self.play(*list(map(FadeOut, [arrow, label])))return dotdef cycle_through_options(self):@@ -2166,7 +2166,7 @@ class IntroduceAnglePreservation(VisualizingSSquared):for index in 3, 7:randy.bubble.content[index].set_color(YELLOW)- self.play(*map(FadeIn, [randy, morty]))+ self.play(*list(map(FadeIn, [randy, morty])))self.play(randy.change_mode, "speaking",ShowCreation(randy.bubble),@@ -2182,11 +2182,11 @@ class IntroduceAnglePreservation(VisualizingSSquared):)self.play(Blink(randy))self.wait()- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [randy, morty,randy.bubble, randy.bubble.content,morty.bubble, morty.bubble.content,- ]))+ ])))def cycle_through_line_pairs(self):@@ -2215,10 +2215,10 @@ class IntroduceAnglePreservation(VisualizingSSquared):for y in np.arange(0, 3, 0.5)if not (x <= 0 and y == 0)]- brackets = VGroup(*map(+ brackets = VGroup(*list(map(self.get_right_angle_bracket,intersection_inputs- ))+ )))self.apply_function()self.wait()self.play(@@ -2300,7 +2300,7 @@ class IntroduceAnglePreservation(VisualizingSSquared):angle_group = VGroup(angle_tex, angle_arrow)- self.play(*map(ShowCreation, lines))+ self.play(*list(map(ShowCreation, lines)))self.play(Write(angle_tex),ShowCreation(angle_arrow),@@ -2321,7 +2321,7 @@ class IntroduceAnglePreservation(VisualizingSSquared):ShowCreation(arrow))self.wait(2)- self.play(*map(FadeOut, [arc, angle_tex, arrow]))+ self.play(*list(map(FadeOut, [arc, angle_tex, arrow])))def put_angle_tex_next_to_arc(self, angle_tex, arc):vect = arc.point_from_proportion(0.5)-interpolate(@@ -2478,10 +2478,10 @@ class NoteZetaFunctionAnalyticOnRightHalf(ZetaTransformationScene):for y in np.arange(-0.5, 0.5, 1./16)if abs(y) > 1./16]- brackets = VGroup(*map(+ brackets = VGroup(*list(map(self.get_right_angle_bracket,intersection_inputs- ))+ )))self.play(ShowCreation(brackets, run_time = 3))self.wait()@@ -2824,9 +2824,9 @@ class DiscussZeros(ZetaTransformationScene):self.play(Blink(randy))self.wait()self.play(Blink(randy))- self.play(*map(FadeOut, [+ self.play(*list(map(FadeOut, [randy, bubble, bubble.content, trivial_zero_words- ]))+ ])))def show_critical_strip(self):strip = Rectangle(@@ -2884,9 +2884,9 @@ class DiscussZeros(ZetaTransformationScene):self.wait(3)self.play(photo.shift, 7*LEFT,- *map(FadeOut, [+ *list(map(FadeOut, [primes, self.dots, strip- ])+ ])))self.remove(photo)self.critical_line = critical_line@@ -2911,7 +2911,7 @@ class DiscussZeros(ZetaTransformationScene):def get_dot_wandering_anims(self):self.dot_anim_count += 1if self.dot_anim_count == 1:- return map(MoveToTarget, self.dots)+ return list(map(MoveToTarget, self.dots))denom = 4*(len(list(self.dots)))def get_rate_func(index):return lambda t : (float(self.dot_anim_count + 2*index + t)/denom)%1@@ -3165,12 +3165,12 @@ class PatreonThanks(Scene):patreon_logo.set_height(1.5)patreon_logo.next_to(special_thanks, DOWN)- left_patrons = VGroup(*map(TextMobject,+ left_patrons = VGroup(*list(map(TextMobject,self.specific_patrons[:n_patrons/2]- ))- right_patrons = VGroup(*map(TextMobject,+ )))+ right_patrons = VGroup(*list(map(TextMobject,self.specific_patrons[n_patrons/2:]- ))+ )))for patrons, vect in (left_patrons, LEFT), (right_patrons, RIGHT):patrons.arrange_submobjects(DOWN, aligned_edge = LEFT)patrons.next_to(special_thanks, DOWN)diff --git a/once_useful_constructs/arithmetic.py b/once_useful_constructs/arithmetic.pyindex d61b655a9..1f85b5821 100644--- a/once_useful_constructs/arithmetic.py+++ b/once_useful_constructs/arithmetic.py@@ -32,11 +32,11 @@ class RearrangeEquation(Scene):[n % len(start_mobs) for n in index_map])unmatched_end_indices.difference_update(- [n % len(end_mobs) for n in index_map.values()]+ [n % len(end_mobs) for n in list(index_map.values())])mobject_pairs = [(start_mobs[a], end_mobs[b])- for a, b in index_map.iteritems()+ for a, b in index_map.items()] + [(Point(end_mobs[b].get_center()), end_mobs[b])for b in unmatched_end_indicesdiff --git a/once_useful_constructs/complex_transformation_scene.py b/once_useful_constructs/complex_transformation_scene.pyindex a10d6a553..e738e429c 100644--- a/once_useful_constructs/complex_transformation_scene.py+++ b/once_useful_constructs/complex_transformation_scene.py@@ -52,7 +52,7 @@ class ComplexTransformationScene(Scene):def play(self, *animations, **kwargs):Scene.play(self,- *list(animations) + map(Animation, self.foreground_mobjects),+ *list(animations) + list(map(Animation, self.foreground_mobjects)),**kwargs)diff --git a/once_useful_constructs/fractals.py b/once_useful_constructs/fractals.pyindex 711d6ac41..0bb29d455 100644--- a/once_useful_constructs/fractals.py+++ b/once_useful_constructs/fractals.py@@ -32,7 +32,7 @@ def fractalify(vmobject, order=3, *args, **kwargs):return vmobject-def fractalification_iteration(vmobject, dimension=1.05, num_inserted_anchors_range=range(1, 4)):+def fractalification_iteration(vmobject, dimension=1.05, num_inserted_anchors_range=list(range(1, 4))):num_points = vmobject.get_num_points()if num_points > 0:# original_anchors = vmobject.get_anchors()@@ -667,7 +667,7 @@ class SnakeCurve(FractalCurve):DOWN * (self.radius - step / 2)for y in range(resolution):- x_range = range(resolution)+ x_range = list(range(resolution))if y % 2 == 0:x_range.reverse()for x in x_range:diff --git a/once_useful_constructs/graph_theory.py b/once_useful_constructs/graph_theory.pyindex c44dcfba3..81a5fc365 100644--- a/once_useful_constructs/graph_theory.py+++ b/once_useful_constructs/graph_theory.py@@ -170,7 +170,7 @@ class CompleteGraph(Graph):for x in range(self.num_vertices)for theta in [2 * np.pi * x / self.num_vertices]]- self.edges = it.combinations(range(self.num_vertices), 2)+ self.edges = it.combinations(list(range(self.num_vertices)), 2)def __str__(self):return Graph.__str__(self) + str(self.num_vertices)@@ -193,7 +193,7 @@ class DiscreteGraphScene(Scene):Scene.__init__(self, *args, **kwargs)def construct(self):- self.points = map(np.array, self.graph.vertices)+ self.points = list(map(np.array, self.graph.vertices))self.vertices = self.dots = [Dot(p) for p in self.points]self.edges = self.lines = [Line(self.points[i], self.points[j])@@ -263,7 +263,7 @@ class DiscreteGraphScene(Scene):])def annotate_edges(self, mobject, fade_in=True, **kwargs):- angles = map(np.arctan, map(Line.get_slope, self.edges))+ angles = list(map(np.arctan, list(map(Line.get_slope, self.edges))))self.edge_annotations = [mobject.copy().rotate(angle).move_to(edge.get_center())for angle, edge in zip(angles, self.edges)@@ -320,7 +320,7 @@ class DiscreteGraphScene(Scene):self.generate_spanning_tree()root = self.spanning_tree_rootcolor = self.spanning_tree.get_color()- indices = range(len(self.points))+ indices = list(range(len(self.points)))# Build dictsparent_of = dict([tuple(reversed(pair))diff --git a/once_useful_constructs/light.py b/once_useful_constructs/light.pyindex 841dd7bfe..71d8be9c0 100644--- a/once_useful_constructs/light.py+++ b/once_useful_constructs/light.py@@ -242,10 +242,10 @@ class Spotlight(VMobject):def viewing_angles(self, screen):screen_points = screen.get_anchors()- projected_screen_points = map(self.project, screen_points)+ projected_screen_points = list(map(self.project, screen_points))- viewing_angles = np.array(map(self.viewing_angle_of_point,- projected_screen_points))+ viewing_angles = np.array(list(map(self.viewing_angle_of_point,+ projected_screen_points)))lower_angle = upper_angle = 0if len(viewing_angles) != 0:diff --git a/requirements.txt b/requirements.txtindex 20b01a11f..688dd4072 100644--- a/requirements.txt+++ b/requirements.txt@@ -1,9 +1,9 @@argparse==1.4.0-colour==0.1.2-numpy==1.11.1-Pillow==3.4.2-progressbar==2.3-scipy==0.17.1-tqdm==4.7.1-opencv-python==3.1.0+colour==0.1.5+numpy==1.15.0+Pillow==5.2.0+progressbar==2.5+scipy==1.1.0+tqdm==4.24.0+opencv-python==3.4.2.17git+https://github.com/scottopell/aggdraw-64bits@c95aac4369038706943fd0effb7d888683860e5a#egg=aggdrawdiff --git a/scene/graph_scene.py b/scene/graph_scene.pyindex 76def06b6..dae98e832 100644--- a/scene/graph_scene.py+++ b/scene/graph_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *import itertools as it@@ -82,10 +82,7 @@ class GraphScene(Scene):x_axis.shift(self.graph_origin - x_axis.number_to_point(0))if len(self.x_labeled_nums) > 0:if self.exclude_zero_label:- self.x_labeled_nums = filter(- lambda x: x != 0,- self.x_labeled_nums- )+ self.x_labeled_nums = [x for x in self.x_labeled_nums if x != 0]x_axis.add_numbers(*self.x_labeled_nums)if self.x_axis_label:x_label = TextMobject(self.x_axis_label)@@ -118,10 +115,7 @@ class GraphScene(Scene):y_axis.rotate(np.pi / 2, about_point=y_axis.number_to_point(0))if len(self.y_labeled_nums) > 0:if self.exclude_zero_label:- self.y_labeled_nums = filter(- lambda y: y != 0,- self.y_labeled_nums- )+ self.y_labeled_nums = [y for y in self.y_labeled_nums if y != 0]y_axis.add_numbers(*self.y_labeled_nums)if self.y_axis_label:y_label = TextMobject(self.y_axis_label)@@ -258,11 +252,11 @@ class GraphScene(Scene):else:raise Exception("Invalid input sample type")graph_point = self.input_to_graph_point(sample_input, graph)- points = VGroup(*map(VectorizedPoint, [+ points = VGroup(*list(map(VectorizedPoint, [self.coords_to_point(x, 0),self.coords_to_point(x + width_scale_factor * dx, 0),graph_point- ]))+ ])))rect = Rectangle()rect.replace(points, stretch=True)diff --git a/scene/moving_camera_scene.py b/scene/moving_camera_scene.pyindex 29e1430f6..a0986d744 100644--- a/scene/moving_camera_scene.py+++ b/scene/moving_camera_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from scene.scene import Scenefrom camera.moving_camera import MovingCameradiff --git a/scene/reconfigurable_scene.py b/scene/reconfigurable_scene.pyindex 789f9156f..b12670fc6 100644--- a/scene/reconfigurable_scene.py+++ b/scene/reconfigurable_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from scene.scene import Scenefrom animation.transform import Transformdiff --git a/scene/sample_space_scene.py b/scene/sample_space_scene.pyindex 357c2df44..b7479f7e7 100644--- a/scene/sample_space_scene.py+++ b/scene/sample_space_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *from .scene import Scene@@ -141,7 +141,7 @@ class SampleSpaceScene(Scene):anims = [UpdateFromFunc(post_rects, update_rects)]if hasattr(post_rects, "braces"):- anims += map(Animation, [+ anims += list(map(Animation, [post_rects.labels, post_rects.braces- ])+ ]))return animsdiff --git a/scene/scene.py b/scene/scene.pyindex 61e9b21a2..2cc50c357 100644--- a/scene/scene.py+++ b/scene/scene.py@@ -1,4 +1,4 @@-from __future__ import print_function+import inspectimport itertools as itimport numpy as np@@ -110,11 +110,11 @@ class Scene(Container):to share local variables."""caller_locals = inspect.currentframe().f_back.f_locals- for key, value in caller_locals.items():+ for key, value in list(caller_locals.items()):for o in objects:if value is o:setattr(self, key, value)- for key, value in newly_named_objects.items():+ for key, value in list(newly_named_objects.items()):setattr(self, key, value)return self@@ -185,10 +185,7 @@ class Scene(Container):self.wait(wind_down_time)# TODO, this is not done with the remove method so as to# keep the relevant mobjects. Better way?- self.continual_animations = filter(- lambda ca: ca in continual_animations,- self.continual_animations- )+ self.continual_animations = [ca for ca in self.continual_animations if ca in continual_animations]def should_continually_update(self):return len(self.continual_animations) > 0 or self.always_continually_update@@ -207,7 +204,7 @@ class Scene(Container):for family in families])return num_families == 1- return filter(is_top_level, mobjects)+ return list(filter(is_top_level, mobjects))def separate_mobjects_and_continual_animations(self, mobjects_or_continual_animations):mobjects = []@@ -243,7 +240,7 @@ class Scene(Container):So a scene can just add all mobjects it's defined up to that pointby calling add_mobjects_among(locals().values())"""- mobjects = filter(lambda x: isinstance(x, Mobject), values)+ mobjects = [x for x in values if isinstance(x, Mobject)]self.add(*mobjects)return self@@ -256,11 +253,8 @@ class Scene(Container):for list_name in "mobjects", "foreground_mobjects":self.restructure_mobjects(mobjects, list_name, False)- self.continual_animations = filter(- lambda ca: ca not in continual_animations and- ca.mobject not in to_remove,- self.continual_animations- )+ self.continual_animations = [ca for ca in self.continual_animations if ca not in continual_animations and+ ca.mobject not in to_remove]return selfdef restructure_mobjects(diff --git a/scene/scene_from_video.py b/scene/scene_from_video.pyindex b422e7615..64334deff 100644--- a/scene/scene_from_video.py+++ b/scene/scene_from_video.py@@ -1,5 +1,5 @@-from __future__ import absolute_import-from __future__ import print_function++import cv2@@ -24,11 +24,11 @@ class SceneFromVideo(Scene):start_frame = 0end_frame = frame_countelse:- start_frame, end_frame = map(lambda t: fps * t, time_range)+ start_frame, end_frame = [fps * t for t in time_range]frame_count = end_frame - start_frameprint("Reading in " + file_name + "...")- for count in show_progress(range(start_frame, end_frame + 1)):+ for count in show_progress(list(range(start_frame, end_frame + 1))):returned, frame = cap.read()if not returned:breakdiff --git a/scene/three_d_scene.py b/scene/three_d_scene.pyindex 937fc748f..58f790515 100644--- a/scene/three_d_scene.py+++ b/scene/three_d_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from constants import *diff --git a/scene/vector_space_scene.py b/scene/vector_space_scene.pyindex e694998b6..32645885f 100644--- a/scene/vector_space_scene.py+++ b/scene/vector_space_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+import numpy as npdiff --git a/scene/zoomed_scene.py b/scene/zoomed_scene.pyindex 2d3d4ac0b..3bc763b69 100644--- a/scene/zoomed_scene.py+++ b/scene/zoomed_scene.py@@ -1,4 +1,4 @@-from __future__ import absolute_import+from scene.moving_camera_scene import MovingCameraScenefrom camera.moving_camera import MovingCameradiff --git a/stage_scenes.py b/stage_scenes.pyindex 0caa31b96..d47f1b27f 100644--- a/stage_scenes.py+++ b/stage_scenes.py@@ -1,5 +1,5 @@-from __future__ import absolute_import-from __future__ import print_function++import inspectimport osimport sys@@ -39,7 +39,7 @@ def stage_animations(module_name):sorted_files = []for scene_class in scene_classes:scene_name = scene_class.__name__- for clip in filter(lambda f: f.startswith(scene_name + "."), files):+ for clip in [f for f in files if f.startswith(scene_name + ".")]:sorted_files.append(os.path.join(animation_dir, clip))animation_subdir = os.path.dirname(animation_dir)diff --git a/utils/color.py b/utils/color.pyindex f8999670e..b5f308ba9 100644--- a/utils/color.py+++ b/utils/color.py@@ -47,7 +47,7 @@ def color_to_int_rgba(color, opacity=1.0):def color_gradient(reference_colors, length_of_output):if length_of_output == 0:return reference_colors[0]- rgbs = map(color_to_rgb, reference_colors)+ rgbs = list(map(color_to_rgb, reference_colors))alphas = np.linspace(0, (len(rgbs) - 1), length_of_output)floors = alphas.astype('int')alphas_mod1 = alphas % 1@@ -66,7 +66,7 @@ def interpolate_color(color1, color2, alpha):def average_color(*colors):- rgbs = np.array(map(color_to_rgb, colors))+ rgbs = np.array(list(map(color_to_rgb, colors)))mean_rgb = np.apply_along_axis(np.mean, 0, rgbs)return rgb_to_color(mean_rgb)diff --git a/utils/config_ops.py b/utils/config_ops.pyindex 6bd067db0..2c1be3721 100644--- a/utils/config_ops.py+++ b/utils/config_ops.py@@ -61,7 +61,7 @@ def digest_config(obj, kwargs, caller_locals={}):def merge_config(all_dicts):- all_config = reduce(op.add, [d.items() for d in all_dicts])+ all_config = reduce(op.add, [list(d.items()) for d in all_dicts])config = dict()for c in all_config:key, value = c@@ -79,7 +79,7 @@ def soft_dict_update(d1, d2):Adds key values pairs of d2 to d1 only when d1 doesn'talready have that key"""- for key, value in d2.items():+ for key, value in list(d2.items()):if key not in d1:d1[key] = value@@ -89,7 +89,7 @@ def digest_locals(obj, keys=None):inspect.currentframe().f_back.f_locals)if keys is None:- keys = caller_locals.keys()+ keys = list(caller_locals.keys())for key in keys:setattr(obj, key, caller_locals[key])diff --git a/utils/iterables.py b/utils/iterables.pyindex 9fa2b16ec..e5fed77fa 100644--- a/utils/iterables.py+++ b/utils/iterables.py@@ -23,19 +23,19 @@ def list_update(l1, l2):Used instead of list(set(l1).update(l2)) to maintain order,making sure duplicates are removed from l1, not l2."""- return filter(lambda e: e not in l2, l1) + list(l2)+ return [e for e in l1 if e not in l2] + list(l2)def list_difference_update(l1, l2):- return filter(lambda e: e not in l2, l1)+ return [e for e in l1 if e not in l2]def all_elements_are_instances(iterable, Class):- return all(map(lambda e: isinstance(e, Class), iterable))+ return all([isinstance(e, Class) for e in iterable])def adjacent_pairs(objects):- return zip(objects, list(objects[1:]) + [objects[0]])+ return list(zip(objects, list(objects[1:]) + [objects[0]]))def batch_by_property(items, property_func):@@ -90,8 +90,8 @@ def make_even(iterable_1, iterable_2):list_1, list_2 = list(iterable_1), list(iterable_2)length = max(len(list_1), len(list_2))return (- [list_1[(n * len(list_1)) / length] for n in xrange(length)],- [list_2[(n * len(list_2)) / length] for n in xrange(length)]+ [list_1[(n * len(list_1)) / length] for n in range(length)],+ [list_2[(n * len(list_2)) / length] for n in range(length)])@@ -105,19 +105,8 @@ def make_even_by_cycling(iterable_1, iterable_2):)-def composition(func_list):- """- func_list should contain elements of the form (f, args)- """- return reduce(- lambda (f1, args1), (f2, args2): (lambda x: f1(f2(x, *args2), *args1)),- func_list,- lambda x: x- )--def remove_nones(sequence):- return filter(lambda x: x, sequence)+ return [x for x in sequence if x]# Note this is redundant with it.chaindiff --git a/utils/simple_functions.py b/utils/simple_functions.pyindex 83d9445f1..bf4540d69 100644--- a/utils/simple_functions.py+++ b/utils/simple_functions.py@@ -12,8 +12,8 @@ def choose(n, r):return 0if r == 0:return 1- denom = reduce(op.mul, xrange(1, r + 1), 1)- numer = reduce(op.mul, xrange(n, n - r, -1), 1)+ denom = reduce(op.mul, range(1, r + 1), 1)+ numer = reduce(op.mul, range(n, n - r, -1), 1)return numer // denom# Just to have a less heavyweight name for this extremely common operationdiff --git a/utils/strings.py b/utils/strings.pyindex 67ed144ce..9034bca43 100644--- a/utils/strings.py+++ b/utils/strings.py@@ -5,9 +5,7 @@ import itertools as itdef to_camel_case(name):return "".join([- filter(- lambda c: c not in string.punctuation + string.whitespace, part- ).capitalize()+ [c for c in part if c not in string.punctuation + string.whitespace].capitalize()for part in name.split("_")])@@ -20,11 +18,11 @@ def initials(name, sep_values=[" ", "_"]):def camel_case_initials(name):- return filter(lambda c: c.isupper(), name)+ return [c for c in name if c.isupper()]def complex_string(complex_num):- return filter(lambda c: c not in "()", str(complex_num))+ return [c for c in str(complex_num) if c not in "()"]def split_string_to_isolate_substrings(full_string, *substrings_to_isolate):@@ -39,12 +37,12 @@ def split_string_to_isolate_substrings(full_string, *substrings_to_isolate):if len(substrings_to_isolate) == 0:return [full_string]substring_to_isolate = substrings_to_isolate[0]- all_substrings = list(it.chain(*zip(+ all_substrings = list(it.chain(*list(zip(full_string.split(substring_to_isolate),it.repeat(substring_to_isolate)- )))+ ))))all_substrings.pop(-1)- all_substrings = filter(lambda s: s != "", all_substrings)+ all_substrings = [s for s in all_substrings if s != ""]return split_string_list_to_isolate_substring(all_substrings, *substrings_to_isolate[1:])diff --git a/utils/tex_file_writing.py b/utils/tex_file_writing.pyindex 7d9384d05..af58ebb22 100644--- a/utils/tex_file_writing.py+++ b/utils/tex_file_writing.py@@ -1,4 +1,4 @@-from __future__ import print_function+import osfrom constants import TEX_DIRfrom constants import TEX_TEXT_TO_REPLACE