uid stringlengths 24 24 | split stringclasses 1
value | category stringclasses 2
values | content stringlengths 5 482k | signature stringlengths 1 14k | suffix stringlengths 1 482k | prefix stringlengths 9 14k | prefix_token_count int64 3 5.01k | prefix_token_budget int64 64 256 | element_token_count int64 1 292k | signature_token_count int64 1 5.01k | prefix_context_token_count int64 0 255 | repo stringlengths 7 112 | path stringlengths 4 208 | language stringclasses 1
value | name stringlengths 1 218 | qualname stringlengths 1 218 | start_line int64 1 26.7k | end_line int64 1 26.7k | signature_start_line int64 1 26.7k | signature_end_line int64 1 26.7k | source_hash stringlengths 40 40 | source_dataset stringclasses 1
value | source_split stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
7c00dbdfdcae4044f359efcd | train | class | class ShowZeroDeterminantCase(LinearTransformationScene):
CONFIG = {
"show_basis_vectors": True,
"matrix": [[3, -2.0], [1, -2.0 / 3]],
"tex_scale_factor": 1.25,
"det_eq_symbol": "=",
}
def construct(self):
self.add_equation()
self.show_det_zero()
def add... | class ShowZeroDeterminantCase(LinearTransformationScene):
| CONFIG = {
"show_basis_vectors": True,
"matrix": [[3, -2.0], [1, -2.0 / 3]],
"tex_scale_factor": 1.25,
"det_eq_symbol": "=",
}
def construct(self):
self.add_equation()
self.show_det_zero()
def add_equation(self):
equation = self.equation = TexMob... | for row, num in zip(matrix, output_vect):
args = []
for i in range(len(row)):
if i + 1 == len(row):
sign = "="
elif row[i + 1] < 0:
sign = "-"
else:
sign = "+"
args... | 256 | 256 | 957 | 12 | 244 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | ShowZeroDeterminantCase | ShowZeroDeterminantCase | 608 | 722 | 608 | 608 | 9b3a3c74afe23953292ab5a86078fd0ad185beb9 | bigcode/the-stack | train |
04a9a0eb6ec6ad3dda2cf267 | train | class | class MysteryInputLabel(Scene):
def construct(self):
brace = Brace(Line(ORIGIN, RIGHT), DOWN)
text = brace.get_text("Mystery input")
self.play(GrowFromCenter(brace), Write(text))
self.wait()
| class MysteryInputLabel(Scene):
| def construct(self):
brace = Brace(Line(ORIGIN, RIGHT), DOWN)
text = brace.get_text("Mystery input")
self.play(GrowFromCenter(brace), Write(text))
self.wait()
| "output_vect": [4, 2, 5],
"compare_to_big_system": False,
"transition_to_geometric_view": False,
}
def construct(self):
self.remove_grid()
self.introduce_system()
self.from_system_to_matrix()
class MysteryInputLabel(Scene):
| 64 | 64 | 52 | 6 | 58 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | MysteryInputLabel | MysteryInputLabel | 2,176 | 2,181 | 2,176 | 2,176 | 717f6f3723e0a7cfbea32213c1bf119b77f954f6 | bigcode/the-stack | train |
cb9d76ab484445ae103a9eeb | train | class | class ShowDotProductChanging(LinearTransformationScene):
CONFIG = {
"matrix": [[2, -5.0 / 3], [-5.0 / 3, 2]],
"v": [1, 2],
"w": [2, 1],
"v_label": "v",
"w_label": "w",
"v_color": YELLOW,
"w_color": MAROON_B,
"rhs1": "> 0",
"rhs2": "< 0",
... | class ShowDotProductChanging(LinearTransformationScene):
| CONFIG = {
"matrix": [[2, -5.0 / 3], [-5.0 / 3, 2]],
"v": [1, 2],
"w": [2, 1],
"v_label": "v",
"w_label": "w",
"v_color": YELLOW,
"w_color": MAROON_B,
"rhs1": "> 0",
"rhs2": "< 0",
"foreground_plane_kwargs": {
"x_radius": 2 ... | .output_vect_mob.get_end(), y_point)
self.play(ShowCreation(dashed_line_to_x))
self.play(ShowCreation(dashed_line_to_y))
self.wait()
# Helpers
def resize_corner_rect_to_mobjet(self, rect, mobject):
rect.stretch_to_fit_width(mobject.get_width() + MED_LARGE_BUFF +
... | 167 | 167 | 559 | 10 | 157 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | ShowDotProductChanging | ShowDotProductChanging | 1,105 | 1,169 | 1,105 | 1,105 | c31f522d30e1b084a69b0cd8333a92be2674ce0d | bigcode/the-stack | train |
a2e3143962d713697afa4650 | train | class | class ParallelepipedForYCoordinate(ExternallyAnimatedScene):
pass
| class ParallelepipedForYCoordinate(ExternallyAnimatedScene):
| pass
| ipedAngledView(ExternallyAnimatedScene):
pass
class InputParallelepipedTopViewToSideView(ExternallyAnimatedScene):
pass
class ParallelepipedForXCoordinate(ExternallyAnimatedScene):
pass
class ParallelepipedForYCoordinate(ExternallyAnimatedScene):
| 64 | 64 | 17 | 14 | 49 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | ParallelepipedForYCoordinate | ParallelepipedForYCoordinate | 2,031 | 2,032 | 2,031 | 2,031 | 636a99e14097f8caf1656e4a9c6a3362ab375698 | bigcode/the-stack | train |
fe5c9f42bb3366161cf8fc9a | train | class | class CramersXEvaluation(Scene):
def construct(self):
frac = TexMobject("{(4)(1) - (-1)(2) \\over (2)(1) - (-1)(0)}")[0]
VGroup(frac[1], frac[12]).set_color(MAROON_B)
VGroup(frac[4], frac[8], frac[9]).set_color(RED)
VGroup(frac[16], frac[27]).set_color(GREEN)
VGroup(frac[19],... | class CramersXEvaluation(Scene):
| def construct(self):
frac = TexMobject("{(4)(1) - (-1)(2) \\over (2)(1) - (-1)(0)}")[0]
VGroup(frac[1], frac[12]).set_color(MAROON_B)
VGroup(frac[4], frac[8], frac[9]).set_color(RED)
VGroup(frac[16], frac[27]).set_color(GREEN)
VGroup(frac[19], frac[23], frac[24]).set_color(RE... | object("= \\frac{4}{2}"),
TexMobject("=2"))
group.arrange(RIGHT)
self.add(group)
self.wait(1)
# Largely copy-pasted. Not great, but what are you gonna do.
class CramersXEvaluation(Scene):
| 64 | 64 | 187 | 8 | 56 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | CramersXEvaluation | CramersXEvaluation | 2,117 | 2,131 | 2,117 | 2,117 | 49a647927acae7234a39932228d06883395f9988 | bigcode/the-stack | train |
3ead84b5a92a0a279b3e83ef | train | class | class NotTheMostComputationallyEfficient(Scene):
CONFIG = {
"words": "Not the most \\\\ computationally efficient",
"word_height": 4,
"opacity": 0.7,
}
def construct(self):
big_rect = FullScreenFadeRectangle(opacity=self.opacity)
self.add(big_rect)
words = T... | class NotTheMostComputationallyEfficient(Scene):
| CONFIG = {
"words": "Not the most \\\\ computationally efficient",
"word_height": 4,
"opacity": 0.7,
}
def construct(self):
big_rect = FullScreenFadeRectangle(opacity=self.opacity)
self.add(big_rect)
words = TextMobject(self.words)
words.set_color(RE... | (ShowCreation(h_line), randy.change, "erm")
self.wait()
for image in images:
self.play(FadeInFromDown(image), FadeInFromDown(image.rect),
randy.change, "pondering")
self.wait()
class NotTheMostComputationallyEfficient(Scene):
| 64 | 64 | 128 | 11 | 53 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | NotTheMostComputationallyEfficient | NotTheMostComputationallyEfficient | 278 | 294 | 278 | 278 | 5c6f3ee4590f40576e5d343d5463858bd7b8dc2f | bigcode/the-stack | train |
0b565dcf9c695527660a3d35 | train | class | class InputParallelepipedTopViewToSideView(ExternallyAnimatedScene):
pass
| class InputParallelepipedTopViewToSideView(ExternallyAnimatedScene):
| pass
| (RIGHT, buff=MED_SMALL_BUFF)
equation.to_edge(LEFT)
self.play(Write(equation))
self.wait()
class InputParallelepipedAngledView(ExternallyAnimatedScene):
pass
class InputParallelepipedTopViewToSideView(ExternallyAnimatedScene):
| 64 | 64 | 20 | 17 | 46 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | InputParallelepipedTopViewToSideView | InputParallelepipedTopViewToSideView | 2,023 | 2,024 | 2,023 | 2,023 | 53c63c7a5572fd8d0325a7b8da0051d51a3c83e2 | bigcode/the-stack | train |
9d56f579707c141ee6dcc260 | train | class | class TransformParallelepipedWithoutGrid(ExternallyAnimatedScene):
pass
| class TransformParallelepipedWithoutGrid(ExternallyAnimatedScene):
| pass
| Yourself(TeacherStudentsScene):
def construct(self):
self.teacher_says("Try thinking \\\\ it through!",
target_mode="hooray")
self.change_all_student_modes("pondering")
self.wait(4)
class TransformParallelepipedWithoutGrid(ExternallyAnimatedScene):
| 64 | 64 | 17 | 14 | 50 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | TransformParallelepipedWithoutGrid | TransformParallelepipedWithoutGrid | 2,192 | 2,193 | 2,192 | 2,192 | 61a50f09a9df511d05ad09f335ad46322cd08b09 | bigcode/the-stack | train |
9b0a375eadf2be8e06374098 | train | class | class ThinkItThroughYourself(TeacherStudentsScene):
def construct(self):
self.teacher_says("Try thinking \\\\ it through!",
target_mode="hooray")
self.change_all_student_modes("pondering")
self.wait(4)
| class ThinkItThroughYourself(TeacherStudentsScene):
| def construct(self):
self.teacher_says("Try thinking \\\\ it through!",
target_mode="hooray")
self.change_all_student_modes("pondering")
self.wait(4)
| ()
class MysteryInputLabel(Scene):
def construct(self):
brace = Brace(Line(ORIGIN, RIGHT), DOWN)
text = brace.get_text("Mystery input")
self.play(GrowFromCenter(brace), Write(text))
self.wait()
class ThinkItThroughYourself(TeacherStudentsScene):
| 64 | 64 | 54 | 11 | 53 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | ThinkItThroughYourself | ThinkItThroughYourself | 2,184 | 2,189 | 2,184 | 2,184 | 187ad09e5a1e55a479c1b0a4b5eceff85bccc77e | bigcode/the-stack | train |
5d97cadd41cc025179b97d4a | train | class | class WriteCramersRule(Scene):
def construct(self):
words = TextMobject("``Cramer's Rule''")
words.set_width(FRAME_WIDTH - LARGE_BUFF)
words.add_background_rectangle()
self.play(Write(words))
self.wait()
| class WriteCramersRule(Scene):
| def construct(self):
words = TextMobject("``Cramer's Rule''")
words.set_width(FRAME_WIDTH - LARGE_BUFF)
words.add_background_rectangle()
self.play(Write(words))
self.wait()
| MoveToTarget(coord_column, path_arc=np.pi),
FadeOut(columns[0]),
FadeIn(columns[1]),
FadeInFromDown(x),
y.shift,
UP,
y.fade,
1,
)
self.wait(2)
class WriteCramersRule(Scene):
| 64 | 64 | 56 | 8 | 56 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | WriteCramersRule | WriteCramersRule | 2,092 | 2,098 | 2,092 | 2,092 | 8b96fefa4bad88c14cfaa3392f34be00ce3d401c | bigcode/the-stack | train |
648673410a8c995a1511cf31 | train | class | class AltOpeningQuote(OpeningQuote):
def construct(self):
kw = {
"tex_to_color_map": {
"Jerry": YELLOW,
"Kramer": BLUE,
},
"arg_separator": "",
"alignment": "",
}
parts = VGroup(
TextMobject("Jerry: A... | class AltOpeningQuote(OpeningQuote):
| def construct(self):
kw = {
"tex_to_color_map": {
"Jerry": YELLOW,
"Kramer": BLUE,
},
"arg_separator": "",
"alignment": "",
}
parts = VGroup(
TextMobject("Jerry: Ah, you're crazy!", **kw),
... | self.matrix_mobject, self.input_vect_mob, self.output_vect_mob:
mob.set_height(self.height)
self.add(
self.matrix_mobject,
self.input_vect_mob,
self.equals,
self.output_vect_mob,
)
self.arrange(RIGHT, buff=SMALL_BUFF)
# Scenes
class... | 78 | 78 | 263 | 8 | 69 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | AltOpeningQuote | AltOpeningQuote | 75 | 101 | 75 | 75 | 00c3996d5334318b0f50fcb1dea2da2b26e12818 | bigcode/the-stack | train |
fd38a249d1abc986972dbc0a | train | class | class ThreeDCoordinatesAsVolumes(Scene):
def construct(self):
colors = [X_COLOR, Y_COLOR, Z_COLOR]
x, y, z = coords = VGroup(*list(map(TexMobject, "xyz")))
coords.set_color_by_gradient(*colors)
matrix = IntegerMatrix(np.identity(3))
matrix.set_column_colors(*colors)
d... | class ThreeDCoordinatesAsVolumes(Scene):
| def construct(self):
colors = [X_COLOR, Y_COLOR, Z_COLOR]
x, y, z = coords = VGroup(*list(map(TexMobject, "xyz")))
coords.set_color_by_gradient(*colors)
matrix = IntegerMatrix(np.identity(3))
matrix.set_column_colors(*colors)
det_text = get_det_text(matrix)
eq... | )
equation[4].elements.set_color(BLUE)
equation.arrange(RIGHT, buff=MED_SMALL_BUFF)
equation.to_edge(LEFT)
self.play(Write(equation))
self.wait()
class InputParallelepipedAngledView(ExternallyAnimatedScene):
pass
class InputParallelepipedTopViewToSideView(ExternallyAnima... | 126 | 126 | 422 | 8 | 117 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | ThreeDCoordinatesAsVolumes | ThreeDCoordinatesAsVolumes | 2,035 | 2,089 | 2,035 | 2,035 | 2e92d396e09f1ef023d5eb2148b5e4854af01f8d | bigcode/the-stack | train |
6f80b28e6a5fae2bc9b3da37 | train | class | class ShowSomeOrthonormalTransformations(LinearTransformationScene):
CONFIG = {
"random_seed": 1,
"n_angles": 7,
}
def construct(self):
for x in range(self.n_angles):
angle = TAU * np.random.random() - TAU / 2
matrix = rotation_matrix(angle, OUT)[:2, :2]
... | class ShowSomeOrthonormalTransformations(LinearTransformationScene):
| CONFIG = {
"random_seed": 1,
"n_angles": 7,
}
def construct(self):
for x in range(self.n_angles):
angle = TAU * np.random.random() - TAU / 2
matrix = rotation_matrix(angle, OUT)[:2, :2]
if x in [2, 4]:
matrix[:, 1] *= -1
... | Group(top_words, bottom_words)
words.arrange(DOWN, buff=MED_LARGE_BUFF)
for word in words:
word.add_background_rectangle()
words.to_edge(UP)
self.play(Write(words))
self.wait()
class ShowSomeOrthonormalTransformations(LinearTransformationScene):
| 64 | 64 | 116 | 13 | 51 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | ShowSomeOrthonormalTransformations | ShowSomeOrthonormalTransformations | 1,224 | 1,237 | 1,224 | 1,224 | fcbfdfaca83afe8133458ee9ed9f6db8eac9145e | bigcode/the-stack | train |
ca09611257a800bb13350d6f | train | class | class NonZeroDeterminantCase(ShowZeroDeterminantCase,
SetupSimpleSystemOfEquations):
CONFIG = {"det_eq_symbol": "\\neq"}
def construct(self):
self.add_equation()
self.show_det_equation()
output_vect = self.output_vect
matrix = self.matrix
in... | class NonZeroDeterminantCase(ShowZeroDeterminantCase,
SetupSimpleSystemOfEquations):
| CONFIG = {"det_eq_symbol": "\\neq"}
def construct(self):
self.add_equation()
self.show_det_equation()
output_vect = self.output_vect
matrix = self.matrix
input_vect = np.dot(np.linalg.inv(matrix), output_vect)
input_vect_mob = self.get_vector(input_vect, color=... | buff=MED_LARGE_BUFF,
aligned_edge=LEFT)
det_rect = BackgroundRectangle(det_equation)
self.play(
FadeIn(det_rect),
Write(det_equation[0]),
ReplacementTransform(
equation.get_part_by_tex("A").copy(),
det_equa... | 119 | 119 | 398 | 23 | 96 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | NonZeroDeterminantCase | NonZeroDeterminantCase | 725 | 777 | 725 | 726 | 14ada7603a6819d1a39071769b861210d7858215 | bigcode/the-stack | train |
4ce8b2c52d209e98f8d5aee9 | train | class | class FloatingMinus(Scene):
def construct(self):
minus = TexMobject("-")
self.add(minus)
self.play(minus.shift, 2.9 * UP, run_time=1)
| class FloatingMinus(Scene):
| def construct(self):
minus = TexMobject("-")
self.add(minus)
self.play(minus.shift, 2.9 * UP, run_time=1)
| s.add(*line[1:-1:3])
system.output_vect_elements.add(line[-1])
system.output_vect_elements.set_color(OUTPUT_COLOR)
system.arrange(DOWN, buff=0.75, index_of_submobject_to_align=-2)
return system
class FloatingMinus(Scene):
| 64 | 64 | 43 | 5 | 58 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | FloatingMinus | FloatingMinus | 601 | 605 | 601 | 601 | 946e1420cf89eb849d1733f5c0aef1d6f3288a96 | bigcode/the-stack | train |
cc444e7733c1fce43f67d398 | train | class | class AreYouPausingAndPondering(TeacherStudentsScene):
def construct(self):
self.teacher_says(
"Are you pausing \\\\ and pondering?",
target_mode="sassy",
added_anims=[self.get_student_changes(*3 * ["guilty"])])
self.wait()
self.change_all_student_modes("t... | class AreYouPausingAndPondering(TeacherStudentsScene):
| def construct(self):
self.teacher_says(
"Are you pausing \\\\ and pondering?",
target_mode="sassy",
added_anims=[self.get_student_changes(*3 * ["guilty"])])
self.wait()
self.change_all_student_modes("thinking",
added_a... | self.change_all_student_modes("pondering")
self.wait(4)
class TransformParallelepipedWithoutGrid(ExternallyAnimatedScene):
pass
class TransformParallelepipedWithGrid(ExternallyAnimatedScene):
pass
class AreYouPausingAndPondering(TeacherStudentsScene):
| 64 | 64 | 113 | 14 | 49 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | AreYouPausingAndPondering | AreYouPausingAndPondering | 2,200 | 2,214 | 2,200 | 2,200 | 6da8847f8ad3800562478ea03a2a8fdbe4e03337 | bigcode/the-stack | train |
6dd9160121cd8ef5e2168504 | train | class | class TransitionToParallelogramIdea(TeacherStudentsScene):
def construct(self):
teacher_words = TextMobject(
"Now ask about \\\\ other geometric \\\\ views of", "$x$", "and",
"$y$")
teacher_words.set_color_by_tex_to_color_map({
"$x$": X_COLOR,
"$y$": Y... | class TransitionToParallelogramIdea(TeacherStudentsScene):
| def construct(self):
teacher_words = TextMobject(
"Now ask about \\\\ other geometric \\\\ views of", "$x$", "and",
"$y$")
teacher_words.set_color_by_tex_to_color_map({
"$x$": X_COLOR,
"$y$": Y_COLOR,
})
self.student_says("But that's a... | cm.brackets, **get_kwargs(i)),
ReplacementTransform(
VGroup(*matrix_mobject.mob_matrix[:,
i]).copy(), cm.elements,
**get_kwargs(i)),
] for i, cm in enumerate(column_mobs)]))
class TransitionToParal... | 64 | 64 | 171 | 13 | 51 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | TransitionToParallelogramIdea | TransitionToParallelogramIdea | 1,411 | 1,429 | 1,411 | 1,411 | cc15fb9b1f803babd7ede31c83a930e08185cea5 | bigcode/the-stack | train |
75e70eadb811ba3cb76833bc | train | class | class SetupSimpleSystemOfEquations(LinearTransformationScene):
CONFIG = {
"matrix": [[3, 2], [-1, 2]],
"output_vect": [-4, -2],
"quit_before_final_transformation": False,
"array_scale_factor": 0.75,
"compare_to_big_system": True,
"transition_to_geometric_view": True,
... | class SetupSimpleSystemOfEquations(LinearTransformationScene):
| CONFIG = {
"matrix": [[3, 2], [-1, 2]],
"output_vect": [-4, -2],
"quit_before_final_transformation": False,
"array_scale_factor": 0.75,
"compare_to_big_system": True,
"transition_to_geometric_view": True,
}
def construct(self):
self.remove_grid()
... | .set_width(FRAME_WIDTH - 2 * MED_LARGE_BUFF)
self.play(Write(words))
self.wait()
class GaussTitle(Scene):
def construct(self):
title = TextMobject("Gaussian Elimination")
title.scale(1.5)
title.to_edge(UP)
line = Line(LEFT, RIGHT).scale(7)
line.next_to(title... | 256 | 256 | 2,178 | 12 | 244 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | SetupSimpleSystemOfEquations | SetupSimpleSystemOfEquations | 332 | 598 | 332 | 332 | 7db237f843e4eba7a933728c73b85082ec5f87fd | bigcode/the-stack | train |
7d9522416229a9055507792b | train | class | class OrthonormalWords(Scene):
def construct(self):
v_tex = "\\vec{\\textbf{v}}"
w_tex = "\\vec{\\textbf{w}}"
top_words = TexMobject(
"\\text{If }",
"T(",
v_tex,
")",
"\\cdot",
"T(",
w_tex,
")",
... | class OrthonormalWords(Scene):
| def construct(self):
v_tex = "\\vec{\\textbf{v}}"
w_tex = "\\vec{\\textbf{w}}"
top_words = TexMobject(
"\\text{If }",
"T(",
v_tex,
")",
"\\cdot",
"T(",
w_tex,
")",
"=",
v_t... | 0],
"w": [0, 1],
"v_label": "x",
"w_label": "y",
"v_color": X_COLOR,
"w_color": Y_COLOR,
"rhs1": "= 0",
"rhs2": "\\ne 0",
}
class OrthonormalWords(Scene):
| 72 | 72 | 243 | 7 | 65 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | OrthonormalWords | OrthonormalWords | 1,186 | 1,221 | 1,186 | 1,186 | 42b1dab884ab25cb950bf4b47206bcc71d04dffd | bigcode/the-stack | train |
9876a6ff8ea67f3216be5564 | train | class | class ThreeDDotVectorWithKHat(ExternallyAnimatedScene):
pass
| class ThreeDDotVectorWithKHat(ExternallyAnimatedScene):
| pass
| 15 * DEGREES,
about_point=ORIGIN,
rate_func=wiggle,
))
class TransformingAreasXCoord(TransformingAreasYCoord):
CONFIG = {
"index": 0,
}
class ThreeDDotVectorWithKHat(ExternallyAnimatedScene):
| 64 | 64 | 17 | 14 | 50 | Tarang74/manim | from_3b1b/on_hold/eola2/cramer.py | Python | ThreeDDotVectorWithKHat | ThreeDDotVectorWithKHat | 1,997 | 1,998 | 1,997 | 1,997 | 2a00902fb6860c032b89a3e85b5762cd423c44ed | bigcode/the-stack | train |
fd9848c6586a74da728afd19 | train | class | class Database:
def __init__(self, collection):
self.collection = collection
async def find_one(self, condition):
item = await engine.find_one(self.collection, condition)
return item
async def find(self, ):
items = await engine.find(self.collection)
return items
... | class Database:
| def __init__(self, collection):
self.collection = collection
async def find_one(self, condition):
item = await engine.find_one(self.collection, condition)
return item
async def find(self, ):
items = await engine.find(self.collection)
return items
async def pagi... | from .connector import engine
"""
The main purpose of writing this Database class is to avoid calls to the MongoDB engine.
In the future, complex operations which might require two or more engine operations might be
needed and in such event, we can confine them into a class method here.
"""
class Database:
| 63 | 64 | 143 | 3 | 60 | amooabeebadesina/nuxt-netlify | backend/database/database_methods.py | Python | Database | Database | 10 | 35 | 10 | 10 | aebf2e3d646aa41dbe54012172706c91beb6562d | bigcode/the-stack | train |
a6e9a4bb1285180da2fd6f4f | train | function | @command()
def push(tag, local_tag, build, filename, force, overwrite, skip_latest=False):
if force is None and shout('git status --porcelain'):
raise HokusaiError("Working directory is not clean. Aborting.")
if force is None and shout('git status --porcelain --ignored'):
raise HokusaiError("Working direc... | @command()
def push(tag, local_tag, build, filename, force, overwrite, skip_latest=False):
| if force is None and shout('git status --porcelain'):
raise HokusaiError("Working directory is not clean. Aborting.")
if force is None and shout('git status --porcelain --ignored'):
raise HokusaiError("Working directory contains ignored files and/or directories. Aborting.")
ecr = ECR()
if not ecr.pr... | import os
from hokusai.lib.command import command
from hokusai.lib.config import config
from hokusai.services.ecr import ECR
from hokusai.lib.common import print_green, shout
from hokusai.lib.exceptions import HokusaiError
from hokusai.services.docker import Docker
@command()
def push(tag, local_tag, build, filename, ... | 88 | 127 | 426 | 22 | 65 | mzikherman/hokusai | hokusai/commands/push.py | Python | push | push | 10 | 42 | 10 | 11 | 99ff9315948ebce7ccb2c7b6814e5165147e201a | bigcode/the-stack | train |
37dc4d6197ec52cb8a6d1030 | train | class | class ModelInterface:
''' An interface for the model to receive intermediate results from the forward pass '''
def __init__(self):
''' Initialization for models and optimizers.
``models`` is a dict that can contain multiple models in a single `ModelInterface`
For each model in ``models``... | class ModelInterface:
| ''' An interface for the model to receive intermediate results from the forward pass '''
def __init__(self):
''' Initialization for models and optimizers.
``models`` is a dict that can contain multiple models in a single `ModelInterface`
For each model in ``models``, there is an optimize... | # Copyright (c) 2017-present, Facebook, Inc.
# All rights reserved.
#
# This source code is licensed under the BSD-style license found in the
# LICENSE file in the root directory of this source tree.
import torch
import torch.cuda
import torch.optim
import torch.nn as nn
from torch.autograd import Variable
from collec... | 132 | 256 | 1,325 | 4 | 128 | douglasrizzo/ELF | rlpytorch/model_interface.py | Python | ModelInterface | ModelInterface | 19 | 175 | 19 | 19 | ce473a6eb04a18107e7fd520ef0cc841a3def949 | bigcode/the-stack | train |
d8282003b2f801984e44ff7c | train | class | class TestAPI(TestCase):
def setUp(self):
# Authentication
self.client = test.APIClient()
self.client2 = test.APIClient()
self.user = User.objects.create_user(
email="test@mail.com",
username="test",
password="test1234"
)
self.foll... | class TestAPI(TestCase):
| def setUp(self):
# Authentication
self.client = test.APIClient()
self.client2 = test.APIClient()
self.user = User.objects.create_user(
email="test@mail.com",
username="test",
password="test1234"
)
self.follower = User.objects.creat... | from django.test import TestCase
from django.urls import reverse
from django.core.exceptions import ObjectDoesNotExist
from rest_framework import test, status
from authors.apps.authentication.models import User
from authors.apps.articles.models import Article, FavoriteModel
from authors.apps.notify.models import Notifi... | 75 | 256 | 1,451 | 6 | 68 | andela/ah-the-answer-backend | authors/apps/notify/tests/tests_states_2.py | Python | TestAPI | TestAPI | 11 | 251 | 11 | 11 | 27530df49877782a93b9470a0a1c95377c4155c9 | bigcode/the-stack | train |
a638c203b69bbca87e22a351 | train | function | @cocotb.test()
async def test_start(dut):
clock = Clock(dut.clk, 25, units="ns") # 40M
cocotb.fork(clock.start())
dut.RSTB <= 0
dut.power1 <= 0;
dut.power2 <= 0;
dut.power3 <= 0;
dut.power4 <= 0;
await ClockCycles(dut.clk, 8)
dut.power1 <= 1;
await ClockCycles(dut.clk, 8)
... | @cocotb.test()
async def test_start(dut):
| clock = Clock(dut.clk, 25, units="ns") # 40M
cocotb.fork(clock.start())
dut.RSTB <= 0
dut.power1 <= 0;
dut.power2 <= 0;
dut.power3 <= 0;
dut.power4 <= 0;
await ClockCycles(dut.clk, 8)
dut.power1 <= 1;
await ClockCycles(dut.clk, 8)
dut.power2 <= 1;
await ClockCycles(... | import cocotb
from cocotb.clock import Clock
from cocotb.triggers import RisingEdge, FallingEdge, ClockCycles, with_timeout
@cocotb.test()
async def test_start(dut):
| 46 | 96 | 323 | 14 | 31 | chmousset/wrapped_newmot | caravel_test/test_project.py | Python | test_start | test_start | 5 | 37 | 5 | 6 | 9004452731125301f593bc7f3f6cef075d0b23b8 | bigcode/the-stack | train |
1cb82bbfb7c0676f51b795c0 | train | class | class Migration(migrations.Migration):
dependencies = [
('tracker', '0015_userprofile_countdown_number'),
]
operations = [
migrations.CreateModel(
name='NutritionInfo',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, s... | class Migration(migrations.Migration):
| dependencies = [
('tracker', '0015_userprofile_countdown_number'),
]
operations = [
migrations.CreateModel(
name='NutritionInfo',
fields=[
('id', models.AutoField(auto_created=True, primary_key=True, serialize=False, verbose_name='ID')),
... | # Generated by Django 2.2.10 on 2020-02-27 05:15
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
| 45 | 64 | 198 | 7 | 37 | okftw/track | tracker/migrations/0016_auto_20200227_1615.py | Python | Migration | Migration | 7 | 32 | 7 | 8 | 7208b1bdd8df8289503620ac35592a649c336181 | bigcode/the-stack | train |
34e7d63a6e8415fd19711701 | train | class | class WelcomeBot(object):
"""Bot to add welcome messages on User pages."""
def __init__(self):
"""Constructor."""
self.site = pywikibot.Site()
self.check_managed_sites()
self.bname = dict()
self._totallyCount = 0
self.welcomed_users = list()
if globalv... | class WelcomeBot(object):
| """Bot to add welcome messages on User pages."""
def __init__(self):
"""Constructor."""
self.site = pywikibot.Site()
self.check_managed_sites()
self.bname = dict()
self._totallyCount = 0
self.welcomed_users = list()
if globalvar.randomSign:
... | 15 # number of users that are required to add the log :)
offset = 0 # skip users newer than that timestamp
timeoffset = 0 # skip users newer than # minutes
recursive = True # define if the Bot is recursive or not
timeRecur = 3600 # how much time (sec.) the b... | 256 | 256 | 3,979 | 5 | 250 | metakgp/pywikibot | scripts/welcome.py | Python | WelcomeBot | WelcomeBot | 444 | 861 | 444 | 445 | dcb62bddc8e9cb42d4e1529c320b7af192006b8c | bigcode/the-stack | train |
87877ae9a70aedb04612741e | train | function | def load_word_function(raw):
"""Load the badword list and the whitelist."""
page = re.compile(r"(?:\"|\')(.*?)(?:\"|\')(?:, |\))", re.UNICODE)
list_loaded = page.findall(raw)
if len(list_loaded) == 0:
pywikibot.output(u'There was no input on the real-time page.')
return list_loaded
| def load_word_function(raw):
| """Load the badword list and the whitelist."""
page = re.compile(r"(?:\"|\')(.*?)(?:\"|\')(?:, |\))", re.UNICODE)
list_loaded = page.findall(raw)
if len(list_loaded) == 0:
pywikibot.output(u'There was no input on the real-time page.')
return list_loaded
| Match',
3: 'Skip ',
4: 'Warning',
5: 'Done ',
}
pywikibot.output("\03{%s}[%s]\03{default} "
% (staColor[n], staMsg[n]), newline=False)
def load_word_function(raw):
| 64 | 64 | 85 | 6 | 58 | metakgp/pywikibot | scripts/welcome.py | Python | load_word_function | load_word_function | 886 | 892 | 886 | 886 | cf30537e15dd5e507bac8e9af5be5372ab8ec68f | bigcode/the-stack | train |
2f019178aa27e7d84c02f439 | train | function | def showStatus(n=0):
"""Output colorized status."""
staColor = {
0: 'lightpurple',
1: 'lightaqua',
2: 'lightgreen',
3: 'lightyellow',
4: 'lightred',
5: 'lightblue'
}
staMsg = {
0: 'MSG ',
1: 'NoAct',
2: 'Match',
3: 'Skip ',... | def showStatus(n=0):
| """Output colorized status."""
staColor = {
0: 'lightpurple',
1: 'lightaqua',
2: 'lightgreen',
3: 'lightyellow',
4: 'lightred',
5: 'lightblue'
}
staMsg = {
0: 'MSG ',
1: 'NoAct',
2: 'Match',
3: 'Skip ',
4: 'Warning'... | ing %d seconds before rerun. %s'
% (globalvar.timeRecur, strfstr))
pywikibot.stopme()
time.sleep(globalvar.timeRecur)
else:
raise KeyboardInterrupt
except KeyboardInterrupt:
break... | 64 | 64 | 154 | 7 | 56 | metakgp/pywikibot | scripts/welcome.py | Python | showStatus | showStatus | 864 | 883 | 864 | 864 | 4ebdbb7d0217fa6f809e0ba25c47ab42c03f3234 | bigcode/the-stack | train |
32661c31f984334bf1a8c615 | train | class | class FilenameNotSet(pywikibot.Error):
"""An exception indicating that a signature filename was not specifed."""
| class FilenameNotSet(pywikibot.Error):
| """An exception indicating that a signature filename was not specifed."""
| olid; border-collapse: collapse; font-size: 95%;"'
}
# Ok, that's all. What is below, is the rest of code, now the code is fixed
# and it will run correctly in your project ;)
############################################################################
##################################################################... | 64 | 64 | 25 | 11 | 52 | metakgp/pywikibot | scripts/welcome.py | Python | FilenameNotSet | FilenameNotSet | 416 | 418 | 416 | 417 | 4d4826ee3dbe2f6a0aa6929bdbb88f0e82b87cfd | bigcode/the-stack | train |
3267206d883cccd35966234c | train | function | def main(*args):
"""
Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
@param args: command line arguments
@type args: list of unicode
"""
for arg in pywikibot.handle_args(args):
if arg.startswith('-edit'):
if len(arg) == 5:
... | def main(*args):
| """
Process command line arguments and invoke bot.
If args is an empty list, sys.argv is used.
@param args: command line arguments
@type args: list of unicode
"""
for arg in pywikibot.handle_args(args):
if arg.startswith('-edit'):
if len(arg) == 5:
globa... | except KeyboardInterrupt:
break
def showStatus(n=0):
"""Output colorized status."""
staColor = {
0: 'lightpurple',
1: 'lightaqua',
2: 'lightgreen',
3: 'lightyellow',
4: 'lightred',
5: 'lightblue'
}
staMsg = {
0: 'MSG ',
... | 256 | 256 | 1,114 | 5 | 251 | metakgp/pywikibot | scripts/welcome.py | Python | main | main | 897 | 1,017 | 897 | 897 | 3819da9b8461b656eede97c8d1cf9fb8869a3d0d | bigcode/the-stack | train |
7f880289c32727208195b5f1 | train | class | class Global(object):
"""Container class for global settings."""
attachEditCount = 1 # number of edits that an user required to be welcomed
dumpToLog = 15 # number of users that are required to add the log :)
offset = 0 # skip users newer than that timestamp
timeoffset = ... | class Global(object):
| """Container class for global settings."""
attachEditCount = 1 # number of edits that an user required to be welcomed
dumpToLog = 15 # number of users that are required to add the log :)
offset = 0 # skip users newer than that timestamp
timeoffset = 0 # skip users... | u'solid; border-collapse: collapse; font-size: 95%;"'
}
# Ok, that's all. What is below, is the rest of code, now the code is fixed
# and it will run correctly in your project ;)
############################################################################
#####################################################... | 85 | 86 | 288 | 4 | 81 | metakgp/pywikibot | scripts/welcome.py | Python | Global | Global | 421 | 441 | 421 | 422 | a054537c81c4e66b5d901a81f4d8fc791c663c35 | bigcode/the-stack | train |
2862105c35bf6fb9d4d4b9da | train | function | def lowercase(text):
return text.lower()
| def lowercase(text):
| return text.lower()
| ('col', 'colonel'),
('ft', 'fort'),
]]
def expand_abbreviations(text):
for regex, replacement in _abbreviations:
text = re.sub(regex, replacement, text)
return text
def expand_numbers(text):
return normalize_numbers(text)
def lowercase(text):
| 64 | 64 | 9 | 4 | 60 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | lowercase | lowercase | 42 | 43 | 42 | 42 | b533a885fcd95b8cb33b0560992208d769554408 | bigcode/the-stack | train |
6c34ceb62c62186e590a19d4 | train | function | def expand_numbers(text):
return normalize_numbers(text)
| def expand_numbers(text):
| return normalize_numbers(text)
| '),
('ltd', 'limited'),
('col', 'colonel'),
('ft', 'fort'),
]]
def expand_abbreviations(text):
for regex, replacement in _abbreviations:
text = re.sub(regex, replacement, text)
return text
def expand_numbers(text):
| 64 | 64 | 11 | 5 | 58 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | expand_numbers | expand_numbers | 38 | 39 | 38 | 38 | cc6f549e4c96e654943c4ee7eb2d823507bd3298 | bigcode/the-stack | train |
7ba39a92b057b6f868967935 | train | function | def english_cleaners(text):
text = convert_to_ascii(text)
text = lowercase(text)
text = expand_numbers(text)
text = expand_abbreviations(text)
text = collapse_whitespace(text)
return text
| def english_cleaners(text):
| text = convert_to_ascii(text)
text = lowercase(text)
text = expand_numbers(text)
text = expand_abbreviations(text)
text = collapse_whitespace(text)
return text
| )
def basic_cleaners(text):
text = lowercase(text)
text = collapse_whitespace(text)
return text
def transliteration_cleaners(text):
text = convert_to_ascii(text)
text = lowercase(text)
text = collapse_whitespace(text)
return text
def english_cleaners(text):
| 64 | 64 | 48 | 6 | 57 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | english_cleaners | english_cleaners | 67 | 73 | 67 | 67 | d674079f296a8f562fba24aaef0c7f82c24c2a51 | bigcode/the-stack | train |
76a9bc836d0becf4cbf55dde | train | function | def collapse_whitespace(text):
return re.sub(_whitespace_re, ' ', text)
| def collapse_whitespace(text):
| return re.sub(_whitespace_re, ' ', text)
| 'fort'),
]]
def expand_abbreviations(text):
for regex, replacement in _abbreviations:
text = re.sub(regex, replacement, text)
return text
def expand_numbers(text):
return normalize_numbers(text)
def lowercase(text):
return text.lower()
def collapse_whitespace(text):
| 64 | 64 | 19 | 6 | 58 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | collapse_whitespace | collapse_whitespace | 46 | 47 | 46 | 46 | 1375e811434a08f9ad4dcc25a2dc36ae2bf48085 | bigcode/the-stack | train |
9a792cc9211bc5f936b562f7 | train | function | def convert_to_ascii(text):
return unidecode(text)
| def convert_to_ascii(text):
| return unidecode(text)
| abbreviations:
text = re.sub(regex, replacement, text)
return text
def expand_numbers(text):
return normalize_numbers(text)
def lowercase(text):
return text.lower()
def collapse_whitespace(text):
return re.sub(_whitespace_re, ' ', text)
def convert_to_ascii(text):
| 64 | 64 | 13 | 6 | 58 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | convert_to_ascii | convert_to_ascii | 50 | 51 | 50 | 50 | ed9b6cf9969e2df6d1ef1622d081ce426d958028 | bigcode/the-stack | train |
a9abba6b726548cde6d122a2 | train | function | def expand_abbreviations(text):
for regex, replacement in _abbreviations:
text = re.sub(regex, replacement, text)
return text
| def expand_abbreviations(text):
| for regex, replacement in _abbreviations:
text = re.sub(regex, replacement, text)
return text
| hon', 'honorable'),
('sgt', 'sergeant'),
('capt', 'captain'),
('esq', 'esquire'),
('ltd', 'limited'),
('col', 'colonel'),
('ft', 'fort'),
]]
def expand_abbreviations(text):
| 63 | 64 | 33 | 7 | 56 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | expand_abbreviations | expand_abbreviations | 32 | 35 | 32 | 32 | fda397a43d3d0ed76432fa6cba572fd89799c560 | bigcode/the-stack | train |
6cbc2fb42f7e706fddfd098e | train | function | def basic_cleaners(text):
text = lowercase(text)
text = collapse_whitespace(text)
return text
| def basic_cleaners(text):
| text = lowercase(text)
text = collapse_whitespace(text)
return text
| text)
return text
def expand_numbers(text):
return normalize_numbers(text)
def lowercase(text):
return text.lower()
def collapse_whitespace(text):
return re.sub(_whitespace_re, ' ', text)
def convert_to_ascii(text):
return unidecode(text)
def basic_cleaners(text):
| 64 | 64 | 24 | 6 | 58 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | basic_cleaners | basic_cleaners | 54 | 57 | 54 | 54 | 91d44631998bea236c2dd98d7a64a930257593e3 | bigcode/the-stack | train |
cad65db6eff36ccf3d138df9 | train | function | def transliteration_cleaners(text):
text = convert_to_ascii(text)
text = lowercase(text)
text = collapse_whitespace(text)
return text
| def transliteration_cleaners(text):
| text = convert_to_ascii(text)
text = lowercase(text)
text = collapse_whitespace(text)
return text
| ()
def collapse_whitespace(text):
return re.sub(_whitespace_re, ' ', text)
def convert_to_ascii(text):
return unidecode(text)
def basic_cleaners(text):
text = lowercase(text)
text = collapse_whitespace(text)
return text
def transliteration_cleaners(text):
| 64 | 64 | 33 | 7 | 56 | sarmilaupadhyaya/MultiSpeaker-TTS-V1 | text/cleaners.py | Python | transliteration_cleaners | transliteration_cleaners | 60 | 64 | 60 | 60 | dc629647927d6820dc5fc1e8e63ff586a954eebd | bigcode/the-stack | train |
e1d7f1ee0bae195bdb1df8b8 | train | function | def linear_merge(list1, list2):
# +++your code here+++
# LAB(begin solution)
result = []
# Look at the two lists so long as both are non-empty.
# Take whichever element [0] is smaller.
while len(list1) and len(list2):
if list1[0] < list2[0]:
result.append(list1.pop(0))
else:
result.appen... | def linear_merge(list1, list2):
# +++your code here+++
# LAB(begin solution)
| result = []
# Look at the two lists so long as both are non-empty.
# Take whichever element [0] is smaller.
while len(list1) and len(list2):
if list1[0] < list2[0]:
result.append(list1.pop(0))
else:
result.append(list2.pop(0))
# Now tack on what's left
result.extend(list1)
result.exte... | list of all the elements in sorted order. You may modify the passed in lists.
# Ideally, the solution should work in "linear" time, making a single
# pass of both lists.
def linear_merge(list1, list2):
# +++your code here+++
# LAB(begin solution)
| 64 | 64 | 123 | 24 | 40 | Marianasls/python3-exercises | basic/solution/list2.py | Python | linear_merge | linear_merge | 32 | 47 | 32 | 34 | 6c952e1bfe91732d2787f78d9fcda6944cb427ca | bigcode/the-stack | train |
1511782ee35de291b5ec0913 | train | function | def test(got, expected):
if got == expected:
prefix = ' OK '
else:
prefix = ' X '
print('%s got: %s expected: %s' % (prefix, repr(got), repr(expected)))
| def test(got, expected):
| if got == expected:
prefix = ' OK '
else:
prefix = ' X '
print('%s got: %s expected: %s' % (prefix, repr(got), repr(expected)))
| backwards.
# Then use reversed() to put the result back in the correct order. That
# solution works in linear time, but is more ugly.
# Simple provided test() function used in main() to print
# what each function returns vs. what it's supposed to return.
def test(got, expected):
| 64 | 64 | 53 | 7 | 57 | Marianasls/python3-exercises | basic/solution/list2.py | Python | test | test | 63 | 68 | 63 | 63 | 88ee255e214d6f8597296c5d814f23626db56f6f | bigcode/the-stack | train |
d593097ca0e1f66b24d41d4b | train | function | def remove_adjacent(nums):
# +++your code here+++
# LAB(begin solution)
result = []
for num in nums:
if len(result) == 0 or num != result[-1]:
result.append(num)
return result
| def remove_adjacent(nums):
# +++your code here+++
# LAB(begin solution)
| result = []
for num in nums:
if len(result) == 0 or num != result[-1]:
result.append(num)
return result
| a single element,
# so [1, 2, 2, 3] returns [1, 2, 3]. You may create a new list or
# modify the passed in list.
def remove_adjacent(nums):
# +++your code here+++
# LAB(begin solution)
| 64 | 64 | 55 | 21 | 43 | Marianasls/python3-exercises | basic/solution/list2.py | Python | remove_adjacent | remove_adjacent | 15 | 22 | 15 | 17 | 1df680f3782eab82973224f204d14af82df3d677 | bigcode/the-stack | train |
3c443c454c2d048cfa5ddef0 | train | function | def main():
print('remove_adjacent')
test(remove_adjacent([1, 2, 2, 3]), [1, 2, 3])
test(remove_adjacent([2, 2, 3, 3, 3]), [2, 3])
test(remove_adjacent([]), [])
print()
print('linear_merge')
test(linear_merge(['aa', 'xx', 'zz'], ['bb', 'cc']),
['aa', 'bb', 'cc', 'xx', 'zz'])
test(linear_merge(['... | def main():
| print('remove_adjacent')
test(remove_adjacent([1, 2, 2, 3]), [1, 2, 3])
test(remove_adjacent([2, 2, 3, 3, 3]), [2, 3])
test(remove_adjacent([]), [])
print()
print('linear_merge')
test(linear_merge(['aa', 'xx', 'zz'], ['bb', 'cc']),
['aa', 'bb', 'cc', 'xx', 'zz'])
test(linear_merge(['aa', 'xx'], ... | (got, expected):
if got == expected:
prefix = ' OK '
else:
prefix = ' X '
print('%s got: %s expected: %s' % (prefix, repr(got), repr(expected)))
# Calls the above functions with interesting inputs.
def main():
| 64 | 64 | 187 | 3 | 61 | Marianasls/python3-exercises | basic/solution/list2.py | Python | main | main | 72 | 85 | 72 | 72 | e996570856b8f1780d1d59bf7b1b929951d47c3d | bigcode/the-stack | train |
5b208fb1feb61905efdacd29 | train | class | class VideoMattePrecapturedBgrTrainAugmentation(PrecapturedBgrAndPersonSameAugmentation):
def __init__(self, size):
super().__init__(
size=size,
prob_fgr_affine=0.3,
prob_bgr_affine=0.3,
prob_noise=0.1,
prob_color_jitter=0.3,
prob_grays... | class VideoMattePrecapturedBgrTrainAugmentation(PrecapturedBgrAndPersonSameAugmentation):
| def __init__(self, size):
super().__init__(
size=size,
prob_fgr_affine=0.3,
prob_bgr_affine=0.3,
prob_noise=0.1,
prob_color_jitter=0.3,
prob_grayscale=0.02,
prob_sharpness=0.1,
prob_blur=0.02,
prob_hf... | is always faster).
"""
class TemporalOffset:
def __init__(self, max_offset):
self.max_offset = max_offset
def get_frame_offset(self):
return self.max_offset
class VideoMattePrecapturedBgrTrainAugmentation(PrecapturedBgrAndPersonSameAugmentation):
| 64 | 64 | 136 | 24 | 39 | ivandrej/checkmatte | dataset/videomatte_with_precaptured_bgr.py | Python | VideoMattePrecapturedBgrTrainAugmentation | VideoMattePrecapturedBgrTrainAugmentation | 67 | 81 | 67 | 67 | c82baa380031f52a45b9ed512d9b8e5480414cec | bigcode/the-stack | train |
0768192eb4086e009050214d | train | class | class VideoMattePrecapturedBgrOnlyTrainAugmentation(PrecapturedBgrOnlyAugmentation):
def __init__(self, size):
super().__init__(
size=size,
prob_fgr_affine=0,
prob_bgr_affine=0.3,
prob_noise=0.1,
prob_color_jitter=0.1,
prob_grayscale=0.... | class VideoMattePrecapturedBgrOnlyTrainAugmentation(PrecapturedBgrOnlyAugmentation):
| def __init__(self, size):
super().__init__(
size=size,
prob_fgr_affine=0,
prob_bgr_affine=0.3,
prob_noise=0.1,
prob_color_jitter=0.1,
prob_grayscale=0.02,
prob_sharpness=0.1,
prob_blur=0.02,
prob_hfli... | ness=0.1,
prob_blur=0.02,
prob_hflip=0.5,
prob_pause=0.03,
random_sized_crop=False
)
class VideoMattePrecapturedBgrOnlyTrainAugmentation(PrecapturedBgrOnlyAugmentation):
| 64 | 64 | 135 | 23 | 41 | ivandrej/checkmatte | dataset/videomatte_with_precaptured_bgr.py | Python | VideoMattePrecapturedBgrOnlyTrainAugmentation | VideoMattePrecapturedBgrOnlyTrainAugmentation | 83 | 98 | 83 | 83 | 5dbfc051d08a6af14220224a6f63b97bf5a800a4 | bigcode/the-stack | train |
f6b55d5676d3d82e78a48a2f | train | class | class VideoMattePrecapturedBgrDataset(VideoMatteDataset):
def __init__(self, offset, *args, **kwargs):
super().__init__(*args, **kwargs)
self.offset = offset
def __getitem__(self, idx):
bgrs, precaptured_bgrs = self._get_random_video_background()
fgrs, phas = self._get_videomat... | class VideoMattePrecapturedBgrDataset(VideoMatteDataset):
| def __init__(self, offset, *args, **kwargs):
super().__init__(*args, **kwargs)
self.offset = offset
def __getitem__(self, idx):
bgrs, precaptured_bgrs = self._get_random_video_background()
fgrs, phas = self._get_videomatte(idx)
return self.transform(fgrs, phas, bgrs, p... | import os
import random
from PIL import Image
import numpy as np
from dataset.precaptured_bgr_augmentation import PrecapturedBgrAugmentation, PrecapturedBgrAndPersonSameAugmentation, \
PrecapturedBgrOnlyAugmentation, PrecapturedBgrRotationOnlyAugmentation
from dataset.videomatte import VideoMatteDataset
"""
F... | 116 | 129 | 432 | 15 | 101 | ivandrej/checkmatte | dataset/videomatte_with_precaptured_bgr.py | Python | VideoMattePrecapturedBgrDataset | VideoMattePrecapturedBgrDataset | 13 | 55 | 13 | 13 | 90536158f66c88ce458c93252a53a8db74bf2b5b | bigcode/the-stack | train |
516ede8919841c1d945127de | train | class | class VideoMattePrecapturedBgrRotationOnlyTrainAugmentation(PrecapturedBgrRotationOnlyAugmentation):
def __init__(self, size):
super().__init__(
size=size,
random_sized_crop=False
)
| class VideoMattePrecapturedBgrRotationOnlyTrainAugmentation(PrecapturedBgrRotationOnlyAugmentation):
| def __init__(self, size):
super().__init__(
size=size,
random_sized_crop=False
)
| 1,
prob_blur=0.02,
prob_hflip=0,
prob_pause=0,
random_sized_crop=False,
static_affine=True
)
class VideoMattePrecapturedBgrRotationOnlyTrainAugmentation(PrecapturedBgrRotationOnlyAugmentation):
| 64 | 64 | 52 | 25 | 39 | ivandrej/checkmatte | dataset/videomatte_with_precaptured_bgr.py | Python | VideoMattePrecapturedBgrRotationOnlyTrainAugmentation | VideoMattePrecapturedBgrRotationOnlyTrainAugmentation | 100 | 105 | 100 | 100 | 77ccb1ced6def9ef694c3ea202d22970b90c6c4f | bigcode/the-stack | train |
feebe0eeae34eb049eeb7305 | train | class | class VideoMattePrecapturedBgrValidAugmentation(PrecapturedBgrAugmentation):
def __init__(self, size):
super().__init__(
size=size,
prob_fgr_affine=0,
prob_bgr_affine=0,
prob_noise=0,
prob_color_jitter=0,
prob_grayscale=0,
p... | class VideoMattePrecapturedBgrValidAugmentation(PrecapturedBgrAugmentation):
| def __init__(self, size):
super().__init__(
size=size,
prob_fgr_affine=0,
prob_bgr_affine=0,
prob_noise=0,
prob_color_jitter=0,
prob_grayscale=0,
prob_sharpness=0,
prob_blur=0,
prob_hflip=0,
... | RotationOnlyTrainAugmentation(PrecapturedBgrRotationOnlyAugmentation):
def __init__(self, size):
super().__init__(
size=size,
random_sized_crop=False
)
class VideoMattePrecapturedBgrValidAugmentation(PrecapturedBgrAugmentation):
| 64 | 64 | 121 | 21 | 43 | ivandrej/checkmatte | dataset/videomatte_with_precaptured_bgr.py | Python | VideoMattePrecapturedBgrValidAugmentation | VideoMattePrecapturedBgrValidAugmentation | 108 | 123 | 108 | 108 | f44488ad5662e3246aec3ef240ba86270588198b | bigcode/the-stack | train |
d79190a9531f4c4485d52f5c | train | class | class TemporalOffset:
def __init__(self, max_offset):
self.max_offset = max_offset
def get_frame_offset(self):
return self.max_offset
| class TemporalOffset:
| def __init__(self, max_offset):
self.max_offset = max_offset
def get_frame_offset(self):
return self.max_offset
| _video_clips[clip_idx]
with Image.open(os.path.join(self.background_video_dir, clip, frame)) as frm:
frm = self._downsample_if_needed(frm.convert('RGB'))
return frm
"""
Fixed offset given by max_offset (bgr is always faster).
"""
class TemporalOffset:
| 64 | 64 | 35 | 4 | 60 | ivandrej/checkmatte | dataset/videomatte_with_precaptured_bgr.py | Python | TemporalOffset | TemporalOffset | 60 | 65 | 60 | 60 | 6b4dec12abdc9c168a22418040682a7c37bbae59 | bigcode/the-stack | train |
8466a58babcdc1f291a52dc9 | train | class | class NetworkManagementClientOperationsMixin:
async def check_dns_name_availability(
self,
location: str,
domain_name_label: str,
**kwargs
) -> "models.DnsNameAvailabilityResult":
"""Checks whether a domain name in the cloudapp.azure.com zone is available for use.
... | class NetworkManagementClientOperationsMixin:
| async def check_dns_name_availability(
self,
location: str,
domain_name_label: str,
**kwargs
) -> "models.DnsNameAvailabilityResult":
"""Checks whether a domain name in the cloudapp.azure.com zone is available for use.
:param location: The location of the domain ... | # coding=utf-8
# --------------------------------------------------------------------------
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License. See License.txt in the project root for license information.
# Code generated by Microsoft (R) AutoRest Code Generator.
# Changes may ... | 192 | 256 | 1,296 | 7 | 185 | vbarbaresi/azure-sdk-for-python | sdk/network/azure-mgmt-network/azure/mgmt/network/v2018_10_01/aio/operations/_network_management_client_operations.py | Python | NetworkManagementClientOperationsMixin | NetworkManagementClientOperationsMixin | 21 | 140 | 21 | 22 | c41f8b15228cf48ecd5594eca16208bdab07141d | bigcode/the-stack | train |
6dcd81aa6eaee7222a4badc9 | train | function | def test_non_fitted_error(df_vartypes):
with pytest.raises(NotFittedError):
transformer = PowerTransformer()
transformer.transform(df_vartypes)
| def test_non_fitted_error(df_vartypes):
| with pytest.raises(NotFittedError):
transformer = PowerTransformer()
transformer.transform(df_vartypes)
| 3: when dataset contains na, transform method
with pytest.raises(ValueError):
transformer = PowerTransformer()
transformer.fit(df_vartypes)
transformer.transform(df_na[["Name", "City", "Age", "Marks", "dob"]])
def test_non_fitted_error(df_vartypes):
| 64 | 64 | 34 | 11 | 53 | SunnyxBd/feature_engine | tests/test_transformation/test_power_transformer.py | Python | test_non_fitted_error | test_non_fitted_error | 48 | 51 | 48 | 48 | c0c4a33f4fe776db644bc786a21a7707f9a065f4 | bigcode/the-stack | train |
695facaec15025e1502fb31f | train | function | def test_fit_raises_error_if_na_in_df(df_na):
# test case 2: when dataset contains na, fit method
with pytest.raises(ValueError):
transformer = PowerTransformer()
transformer.fit(df_na)
| def test_fit_raises_error_if_na_in_df(df_na):
# test case 2: when dataset contains na, fit method
| with pytest.raises(ValueError):
transformer = PowerTransformer()
transformer.fit(df_na)
| output
pd.testing.assert_frame_equal(X, transf_df)
def test_error_if_exp_value_not_allowed():
with pytest.raises(ValueError):
PowerTransformer(exp="other")
def test_fit_raises_error_if_na_in_df(df_na):
# test case 2: when dataset contains na, fit method
| 64 | 64 | 47 | 28 | 36 | SunnyxBd/feature_engine | tests/test_transformation/test_power_transformer.py | Python | test_fit_raises_error_if_na_in_df | test_fit_raises_error_if_na_in_df | 33 | 37 | 33 | 34 | 3538924859ef9f9f8a0b45fe5c8baef0b2f4a632 | bigcode/the-stack | train |
629d3451c7d66703dc878d67 | train | function | def test_error_if_exp_value_not_allowed():
with pytest.raises(ValueError):
PowerTransformer(exp="other")
| def test_error_if_exp_value_not_allowed():
| with pytest.raises(ValueError):
PowerTransformer(exp="other")
| transformer.exp == 0.5
assert transformer.variables == ["Age", "Marks"]
# test fit attr
assert transformer.input_shape_ == (4, 5)
# test transform output
pd.testing.assert_frame_equal(X, transf_df)
def test_error_if_exp_value_not_allowed():
| 64 | 64 | 23 | 9 | 55 | SunnyxBd/feature_engine | tests/test_transformation/test_power_transformer.py | Python | test_error_if_exp_value_not_allowed | test_error_if_exp_value_not_allowed | 28 | 30 | 28 | 28 | 8c108889cd6b5ac1466e701b126962c16ee54d2d | bigcode/the-stack | train |
a2f6d67764ab47167913423f | train | function | def test_transform_raises_error_if_na_in_df(df_vartypes, df_na):
# test case 3: when dataset contains na, transform method
with pytest.raises(ValueError):
transformer = PowerTransformer()
transformer.fit(df_vartypes)
transformer.transform(df_na[["Name", "City", "Age", "Marks", "dob"]])
| def test_transform_raises_error_if_na_in_df(df_vartypes, df_na):
# test case 3: when dataset contains na, transform method
| with pytest.raises(ValueError):
transformer = PowerTransformer()
transformer.fit(df_vartypes)
transformer.transform(df_na[["Name", "City", "Age", "Marks", "dob"]])
| case 2: when dataset contains na, fit method
with pytest.raises(ValueError):
transformer = PowerTransformer()
transformer.fit(df_na)
def test_transform_raises_error_if_na_in_df(df_vartypes, df_na):
# test case 3: when dataset contains na, transform method
| 64 | 64 | 76 | 33 | 31 | SunnyxBd/feature_engine | tests/test_transformation/test_power_transformer.py | Python | test_transform_raises_error_if_na_in_df | test_transform_raises_error_if_na_in_df | 40 | 45 | 40 | 41 | 92d7137e49325d7369239339de96674810b08ed1 | bigcode/the-stack | train |
31559296a7db642fb02b40f1 | train | function | def test_defo_params_plus_automatically_find_variables(df_vartypes):
# test case 1: automatically select variables
transformer = PowerTransformer(variables=None)
X = transformer.fit_transform(df_vartypes)
# expected output
transf_df = df_vartypes.copy()
transf_df["Age"] = [4.47214, 4.58258, 4.3... | def test_defo_params_plus_automatically_find_variables(df_vartypes):
# test case 1: automatically select variables
| transformer = PowerTransformer(variables=None)
X = transformer.fit_transform(df_vartypes)
# expected output
transf_df = df_vartypes.copy()
transf_df["Age"] = [4.47214, 4.58258, 4.3589, 4.24264]
transf_df["Marks"] = [0.948683, 0.894427, 0.83666, 0.774597]
# test init params
assert trans... | import pandas as pd
import pytest
from sklearn.exceptions import NotFittedError
from feature_engine.transformation import PowerTransformer
def test_defo_params_plus_automatically_find_variables(df_vartypes):
# test case 1: automatically select variables
| 53 | 64 | 187 | 27 | 25 | SunnyxBd/feature_engine | tests/test_transformation/test_power_transformer.py | Python | test_defo_params_plus_automatically_find_variables | test_defo_params_plus_automatically_find_variables | 9 | 25 | 9 | 10 | d5a07e526c594ca466c39320a64f88e28d6fb1b8 | bigcode/the-stack | train |
ed7a306144a089827b67f749 | train | function | @app.route('/rest/matching', methods=["POST"])
def index():
data = request.data
ddict = json.loads(data)
content = ddict['content']
res = sim.analyze(content)
data = {'total': res[0], 'score': res[1]}
return json.dumps(data)
| @app.route('/rest/matching', methods=["POST"])
def index():
| data = request.data
ddict = json.loads(data)
content = ddict['content']
res = sim.analyze(content)
data = {'total': res[0], 'score': res[1]}
return json.dumps(data)
| from flask import Flask, request
import json
from similarity import sim
app = Flask(__name__)
@app.route('/rest/matching', methods=["POST"])
def index():
| 35 | 64 | 67 | 14 | 21 | erictg/fake_news_detector | py/main.py | Python | index | index | 8 | 17 | 8 | 9 | ddbcef06deaa87b803f27686aa4bd14706808245 | bigcode/the-stack | train |
f337b6d9c43cfae361f1bfc6 | train | class | @pulumi.output_type
class SshConfigurationResponse(dict):
"""
SSH configuration settings for the VM
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "userAccountSettings":
suggest = "user_account_settings"
elif key == "publicIPsToAllow":
... | @pulumi.output_type
class SshConfigurationResponse(dict):
| """
SSH configuration settings for the VM
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "userAccountSettings":
suggest = "user_account_settings"
elif key == "publicIPsToAllow":
suggest = "public_ips_to_allow"
if sugge... | _path_prefix(self) -> str:
"""
The path where the Batch AI service will upload the stdout and stderror of setup task.
"""
return pulumi.get(self, "std_out_err_path_prefix")
@property
@pulumi.getter(name="environmentVariables")
def environment_variables(self) -> Optional[Sequ... | 143 | 143 | 479 | 13 | 130 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | SshConfigurationResponse | SshConfigurationResponse | 1,968 | 2,018 | 1,968 | 1,969 | c31d89a0d0af687f6e674146e407a290131eef32 | bigcode/the-stack | train |
6495c4a6333aba0494cdd849 | train | class | @pulumi.output_type
class TensorFlowSettingsResponse(dict):
"""
Specifies the settings for TensorFlow job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "masterCommandLineArgs":
suggest = "master_command_line_args"
elif key == "pythonScri... | @pulumi.output_type
class TensorFlowSettingsResponse(dict):
| """
Specifies the settings for TensorFlow job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "masterCommandLineArgs":
suggest = "master_command_line_args"
elif key == "pythonScriptFilePath":
suggest = "python_script_file_path"... | _account_settings: Settings for user account that gets created on each on the nodes of a cluster.
:param Sequence[str] public_ips_to_allow: Default value is '*' can be used to match all source IPs. Maximum number of publicIPs that can be specified are 400.
"""
pulumi.set(__self__, "user_account_... | 256 | 256 | 1,121 | 13 | 243 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | TensorFlowSettingsResponse | TensorFlowSettingsResponse | 2,021 | 2,128 | 2,021 | 2,022 | 8ff9233b54be0a0157b1ecf17c5ffb1036fe6fc7 | bigcode/the-stack | train |
9fb9e6a1828c37d446421799 | train | class | @pulumi.output_type
class MountSettingsResponse(dict):
"""
Details of the File Server.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "fileServerInternalIP":
suggest = "file_server_internal_ip"
elif key == "fileServerPublicIP":
... | @pulumi.output_type
class MountSettingsResponse(dict):
| """
Details of the File Server.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "fileServerInternalIP":
suggest = "file_server_internal_ip"
elif key == "fileServerPublicIP":
suggest = "file_server_public_ip"
elif key == ... | requeue'
if node_deallocation_option is not None:
pulumi.set(__self__, "node_deallocation_option", node_deallocation_option)
@property
@pulumi.getter(name="targetNodeCount")
def target_node_count(self) -> int:
"""
Default is 0. If autoScaleSettings are not specified, the... | 161 | 161 | 537 | 12 | 149 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | MountSettingsResponse | MountSettingsResponse | 1,339 | 1,402 | 1,339 | 1,340 | d9f324cb9b94a12e6370938409df900d73888042 | bigcode/the-stack | train |
7e28643cc75b12f5f4e3dc59 | train | class | @pulumi.output_type
class BatchAIErrorResponse(dict):
"""
An error response from the Batch AI service.
"""
def __init__(__self__, *,
code: Optional[str] = None,
details: Optional[Sequence['outputs.NameValuePairResponse']] = None,
message: Optional[str] ... | @pulumi.output_type
class BatchAIErrorResponse(dict):
| """
An error response from the Batch AI service.
"""
def __init__(__self__, *,
code: Optional[str] = None,
details: Optional[Sequence['outputs.NameValuePairResponse']] = None,
message: Optional[str] = None):
"""
An error response from th... | .get(self, "account_key")
@property
@pulumi.getter(name="accountKeySecretReference")
def account_key_secret_reference(self) -> Optional['outputs.KeyVaultSecretReferenceResponse']:
"""
Users can store their secrets in Azure KeyVault and pass it to the Batch AI Service to integrate with KeyVa... | 109 | 109 | 366 | 13 | 96 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | BatchAIErrorResponse | BatchAIErrorResponse | 342 | 386 | 342 | 343 | eb796d9004cdcce8000fe4bce56f42b55b6c9064 | bigcode/the-stack | train |
18919676dcdcdc39b8868f96 | train | class | @pulumi.output_type
class CNTKsettingsResponse(dict):
"""
Specifies the settings for CNTK (aka Microsoft Cognitive Toolkit) job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLineArgs":
suggest = "command_line_args"
elif key == "c... | @pulumi.output_type
class CNTKsettingsResponse(dict):
| """
Specifies the settings for CNTK (aka Microsoft Cognitive Toolkit) job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLineArgs":
suggest = "command_line_args"
elif key == "configFilePath":
suggest = "config_file_pat... | about the error.
:param str message: A message describing the error, intended to be suitable for display in a user interface.
"""
if code is not None:
pulumi.set(__self__, "code", code)
if details is not None:
pulumi.set(__self__, "details", details)
if m... | 256 | 256 | 929 | 13 | 243 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | CNTKsettingsResponse | CNTKsettingsResponse | 389 | 492 | 389 | 390 | 0736e01a9f7485756f74eff3653e7f7fb4e312b5 | bigcode/the-stack | train |
5a6dc31c6af8dc43b614fa9d | train | class | @pulumi.output_type
class AzureStorageCredentialsInfoResponse(dict):
"""
Credentials to access Azure File Share.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "accountKey":
suggest = "account_key"
elif key == "accountKeySecretReference":
... | @pulumi.output_type
class AzureStorageCredentialsInfoResponse(dict):
| """
Credentials to access Azure File Share.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "accountKey":
suggest = "account_key"
elif key == "accountKeySecretReference":
suggest = "account_key_secret_reference"
if sugg... | under $AZ_BATCHAI_MOUNT_ROOT location.
"""
return pulumi.get(self, "relative_mount_path")
@property
@pulumi.getter(name="directoryMode")
def directory_mode(self) -> Optional[str]:
"""
Default value is 0777. Valid only if OS is linux.
"""
return pulumi.get(se... | 148 | 148 | 496 | 14 | 134 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | AzureStorageCredentialsInfoResponse | AzureStorageCredentialsInfoResponse | 288 | 339 | 288 | 289 | 17012ae2a517e31b2c0e40060d1a615d6d9fad72 | bigcode/the-stack | train |
5364f58248b4733f5300047c | train | class | @pulumi.output_type
class JobPropertiesResponseExecutionInfo(dict):
"""
Contains information about the execution of a job in the Azure Batch service.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "startTime":
suggest = "start_time"
elif k... | @pulumi.output_type
class JobPropertiesResponseExecutionInfo(dict):
| """
Contains information about the execution of a job in the Azure Batch service.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "startTime":
suggest = "start_time"
elif key == "endTime":
suggest = "end_time"
elif key =... | def get(self, key: str, default = None) -> Any:
JobPropertiesResponseConstraints.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
max_wall_clock_time: Optional[str] = None):
"""
Constraints associated with the Job.
:param str... | 203 | 203 | 677 | 14 | 189 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | JobPropertiesResponseExecutionInfo | JobPropertiesResponseExecutionInfo | 1,159 | 1,231 | 1,159 | 1,160 | 63c7ae8a8df52426408a7e8d81105f630ea9b22d | bigcode/the-stack | train |
e38b017accc304ed830135b2 | train | class | @pulumi.output_type
class ImageReferenceResponse(dict):
"""
The image reference.
"""
def __init__(__self__, *,
offer: str,
publisher: str,
sku: str,
version: Optional[str] = None):
"""
The image reference.
"""
... | @pulumi.output_type
class ImageReferenceResponse(dict):
| """
The image reference.
"""
def __init__(__self__, *,
offer: str,
publisher: str,
sku: str,
version: Optional[str] = None):
"""
The image reference.
"""
pulumi.set(__self__, "offer", offer)
pulum... | _options")
@property
@pulumi.getter(name="sourceDirectory")
def source_directory(self) -> Optional[str]:
"""
If this property is not specified, the entire File Server will be mounted.
"""
return pulumi.get(self, "source_directory")
@pulumi.output_type
class ImageReferenceRes... | 70 | 70 | 235 | 12 | 58 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | ImageReferenceResponse | ImageReferenceResponse | 954 | 991 | 954 | 955 | 0c64007e3bd850376734fd8c08a2c9f393ebcb6a | bigcode/the-stack | train |
084abf693b18db03777e908d | train | class | @pulumi.output_type
class InputDirectoryResponse(dict):
"""
Input directory for the job.
"""
def __init__(__self__, *,
id: str,
path: str):
"""
Input directory for the job.
:param str id: It will be available for the job as an environment variabl... | @pulumi.output_type
class InputDirectoryResponse(dict):
| """
Input directory for the job.
"""
def __init__(__self__, *,
id: str,
path: str):
"""
Input directory for the job.
:param str id: It will be available for the job as an environment variable under AZ_BATCHAI_INPUT_id. The service will also provi... | Optional['outputs.PrivateRegistryCredentialsResponse']:
"""
Credentials to access a container image in a private repository.
"""
return pulumi.get(self, "credentials")
@property
@pulumi.getter(name="serverUrl")
def server_url(self) -> Optional[str]:
return pulumi.ge... | 82 | 82 | 276 | 12 | 70 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | InputDirectoryResponse | InputDirectoryResponse | 1,049 | 1,075 | 1,049 | 1,050 | 799015b01c77c09c191edced291904dc794ab52b | bigcode/the-stack | train |
6f19d05337769cd854e73e4e | train | class | @pulumi.output_type
class ChainerSettingsResponse(dict):
"""
Specifies the settings for Chainer job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "pythonScriptFilePath":
suggest = "python_script_file_path"
elif key == "commandLineArgs":
... | @pulumi.output_type
class ChainerSettingsResponse(dict):
| """
Specifies the settings for Chainer job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "pythonScriptFilePath":
suggest = "python_script_file_path"
elif key == "commandLineArgs":
suggest = "command_line_args"
elif ke... | _count(self) -> Optional[int]:
"""
The default value for this property is equal to nodeCount property
"""
return pulumi.get(self, "process_count")
@property
@pulumi.getter(name="pythonInterpreterPath")
def python_interpreter_path(self) -> Optional[str]:
"""
T... | 169 | 169 | 566 | 13 | 156 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | ChainerSettingsResponse | ChainerSettingsResponse | 587 | 653 | 587 | 588 | b88de9ec5925865e9bb627b03397949fc807c0b6 | bigcode/the-stack | train |
db98a0ad60724c8d278de669 | train | class | @pulumi.output_type
class ManualScaleSettingsResponse(dict):
"""
Manual scale settings for the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "targetNodeCount":
suggest = "target_node_count"
elif key == "nodeDeallocationOption":
... | @pulumi.output_type
class ManualScaleSettingsResponse(dict):
| """
Manual scale settings for the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "targetNodeCount":
suggest = "target_node_count"
elif key == "nodeDeallocationOption":
suggest = "node_deallocation_option"
if s... | "secret_url", secret_url)
pulumi.set(__self__, "source_vault", source_vault)
@property
@pulumi.getter(name="secretUrl")
def secret_url(self) -> str:
return pulumi.get(self, "secret_url")
@property
@pulumi.getter(name="sourceVault")
def source_vault(self) -> 'outputs.ResourceId... | 138 | 138 | 463 | 13 | 125 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | ManualScaleSettingsResponse | ManualScaleSettingsResponse | 1,282 | 1,336 | 1,282 | 1,283 | f8d606a1153f12b296d673f687b6a544ccfa7275 | bigcode/the-stack | train |
b4487ba062465f892746cc98 | train | class | @pulumi.output_type
class EnvironmentSettingResponse(dict):
"""
A collection of environment variables to set.
"""
def __init__(__self__, *,
name: str,
value: Optional[str] = None):
"""
A collection of environment variables to set.
"""
pul... | @pulumi.output_type
class EnvironmentSettingResponse(dict):
| """
A collection of environment variables to set.
"""
def __init__(__self__, *,
name: str,
value: Optional[str] = None):
"""
A collection of environment variables to set.
"""
pulumi.set(__self__, "name", name)
if value is not None... | return pulumi.get(self, "disk_size_in_gb")
@property
@pulumi.getter(name="storageAccountType")
def storage_account_type(self) -> str:
return pulumi.get(self, "storage_account_type")
@pulumi.output_type
class EnvironmentSettingResponse(dict):
| 64 | 64 | 151 | 12 | 52 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | EnvironmentSettingResponse | EnvironmentSettingResponse | 795 | 818 | 795 | 796 | 232f2b719f1533e972499c62781389a0352fa2af | bigcode/the-stack | train |
f8f1b14570a2b4137c94c45c | train | class | @pulumi.output_type
class NodeSetupResponse(dict):
"""
Use this to prepare the VM. NOTE: The volumes specified in mountVolumes are mounted first and then the setupTask is run. Therefore the setup task can use local mountPaths in its execution.
"""
@staticmethod
def __key_warning(key: str):
s... | @pulumi.output_type
class NodeSetupResponse(dict):
| """
Use this to prepare the VM. NOTE: The volumes specified in mountVolumes are mounted first and then the setupTask is run. Therefore the setup task can use local mountPaths in its execution.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "mountVolumes":
... | """
def __init__(__self__, *,
name: Optional[str] = None,
value: Optional[str] = None):
"""
Represents a name-value pair.
"""
if name is not None:
pulumi.set(__self__, "name", name)
if value is not None:
pulumi.set... | 150 | 150 | 502 | 12 | 138 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | NodeSetupResponse | NodeSetupResponse | 1,506 | 1,557 | 1,506 | 1,507 | bf2b10bcea62b9d88544eafa5176cf0547494467 | bigcode/the-stack | train |
ac0eccd278183749ed1358f4 | train | class | @pulumi.output_type
class UserAccountSettingsResponse(dict):
"""
Settings for user account that gets created on each on the nodes of a cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "adminUserName":
suggest = "admin_user_name"
eli... | @pulumi.output_type
class UserAccountSettingsResponse(dict):
| """
Settings for user account that gets created on each on the nodes of a cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "adminUserName":
suggest = "admin_user_name"
elif key == "adminUserPassword":
suggest = "admin_us... | """
pulumi.set(__self__, "mount_command", mount_command)
pulumi.set(__self__, "relative_mount_path", relative_mount_path)
@property
@pulumi.getter(name="mountCommand")
def mount_command(self) -> str:
return pulumi.get(self, "mount_command")
@property
@pulumi.getter(... | 141 | 141 | 473 | 13 | 128 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | UserAccountSettingsResponse | UserAccountSettingsResponse | 2,179 | 2,231 | 2,179 | 2,180 | d93f204ca95b7910d97b46236213191e5001fcf7 | bigcode/the-stack | train |
2074fad18dc831bced676198 | train | class | @pulumi.output_type
class ScaleSettingsResponse(dict):
"""
At least one of manual or autoScale settings must be specified. Only one of manual or autoScale settings can be specified. If autoScale settings are specified, the system automatically scales the cluster up and down (within the supplied limits) based on... | @pulumi.output_type
class ScaleSettingsResponse(dict):
| """
At least one of manual or autoScale settings must be specified. Only one of manual or autoScale settings can be specified. If autoScale settings are specified, the system automatically scales the cluster up and down (within the supplied limits) based on the pending jobs on the cluster.
"""
@staticme... | (self, "port")
@pulumi.output_type
class ResourceIdResponse(dict):
"""
Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
"""
def __init__(__self__, *,
id: str):
"""
Represents a resource ID. For example, for a subnet, it is the... | 159 | 159 | 530 | 12 | 147 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | ScaleSettingsResponse | ScaleSettingsResponse | 1,846 | 1,895 | 1,846 | 1,847 | 69da6cc5c5838cf018909240380dadd21c227cf6 | bigcode/the-stack | train |
df9698d0daa304a2bf817178 | train | class | @pulumi.output_type
class ImageSourceRegistryResponse(dict):
"""
Details of the container image such as name, URL and credentials.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "serverUrl":
suggest = "server_url"
if suggest:
... | @pulumi.output_type
class ImageSourceRegistryResponse(dict):
| """
Details of the container image such as name, URL and credentials.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "serverUrl":
suggest = "server_url"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in ImageSourceRegistr... | umi.getter
def offer(self) -> str:
return pulumi.get(self, "offer")
@property
@pulumi.getter
def publisher(self) -> str:
return pulumi.get(self, "publisher")
@property
@pulumi.getter
def sku(self) -> str:
return pulumi.get(self, "sku")
@property
@pulumi.get... | 123 | 123 | 413 | 13 | 110 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | ImageSourceRegistryResponse | ImageSourceRegistryResponse | 994 | 1,046 | 994 | 995 | df33176f430018d53cd96d2ba38c42efcadb09c3 | bigcode/the-stack | train |
77c4b9fb28cf0219263f64c2 | train | class | @pulumi.output_type
class ResourceIdResponse(dict):
"""
Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
"""
def __init__(__self__, *,
id: str):
"""
Represents a resource ID. For example, for a subnet, it is the resource URL for... | @pulumi.output_type
class ResourceIdResponse(dict):
| """
Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
"""
def __init__(__self__, *,
id: str):
"""
Represents a resource ID. For example, for a subnet, it is the resource URL for the subnet.
:param str id: The ID of the re... | :
"""
Id of the compute node
"""
return pulumi.get(self, "node_id")
@property
@pulumi.getter
def port(self) -> float:
return pulumi.get(self, "port")
@pulumi.output_type
class ResourceIdResponse(dict):
| 64 | 64 | 142 | 12 | 52 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | ResourceIdResponse | ResourceIdResponse | 1,824 | 1,843 | 1,824 | 1,825 | 1c9f7509c2319e36c15be83d68f3c1c841c1439d | bigcode/the-stack | train |
100c79b7b2a738ecd9384d66 | train | class | @pulumi.output_type
class UnmanagedFileSystemReferenceResponse(dict):
"""
Details of the file system to mount on the compute cluster nodes.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "mountCommand":
suggest = "mount_command"
elif key =... | @pulumi.output_type
class UnmanagedFileSystemReferenceResponse(dict):
| """
Details of the file system to mount on the compute cluster nodes.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "mountCommand":
suggest = "mount_command"
elif key == "relativeMountPath":
suggest = "relative_mount_path"
... | umi.get(self, "worker_command_line_args")
@property
@pulumi.getter(name="workerCount")
def worker_count(self) -> Optional[int]:
"""
If specified, the value must be less than or equal to (nodeCount * numberOfGPUs per VM). If not specified, the default value is equal to nodeCount. This proper... | 114 | 114 | 383 | 15 | 99 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | UnmanagedFileSystemReferenceResponse | UnmanagedFileSystemReferenceResponse | 2,131 | 2,176 | 2,131 | 2,132 | 02194228ad1e0bf0121cc8e6ba7801bb7bdee509 | bigcode/the-stack | train |
04dd89f06ec43e25a5561f32 | train | class | @pulumi.output_type
class JobPropertiesResponseConstraints(dict):
"""
Constraints associated with the Job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "maxWallClockTime":
suggest = "max_wall_clock_time"
if suggest:
pulumi.l... | @pulumi.output_type
class JobPropertiesResponseConstraints(dict):
| """
Constraints associated with the Job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "maxWallClockTime":
suggest = "max_wall_clock_time"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in JobPropertiesResponseConstraint... | .set(__self__, "command_line", command_line)
@property
@pulumi.getter(name="commandLine")
def command_line(self) -> str:
"""
If containerSettings is specified on the job, this commandLine will be executed in the same container as job. Otherwise it will be executed on the node.
"""
... | 95 | 95 | 317 | 13 | 82 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | JobPropertiesResponseConstraints | JobPropertiesResponseConstraints | 1,117 | 1,156 | 1,117 | 1,118 | e20de02add04bd73c97bd01949e7c4010fd506d4 | bigcode/the-stack | train |
b649f8231c370f632c5daec0 | train | class | @pulumi.output_type
class FileServerReferenceResponse(dict):
"""
Provides required information, for the service to be able to mount Azure FileShare on the cluster nodes.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "fileServer":
suggest = "file_... | @pulumi.output_type
class FileServerReferenceResponse(dict):
| """
Provides required information, for the service to be able to mount Azure FileShare on the cluster nodes.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "fileServer":
suggest = "file_server"
elif key == "relativeMountPath":
... | won't be returned and customers can use SSH tunneling to download. Users can use Get Remote Login Information API to get the IP address and port information of all the compute nodes running the job.
"""
return pulumi.get(self, "download_url")
@property
@pulumi.getter
def name(self) -> str:... | 198 | 198 | 663 | 13 | 185 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | FileServerReferenceResponse | FileServerReferenceResponse | 878 | 951 | 878 | 879 | d2508e082c43541f29812119f563d9d471d0f46a | bigcode/the-stack | train |
8c19adb62612951c2923d109 | train | class | @pulumi.output_type
class VirtualMachineConfigurationResponse(dict):
"""
Settings for OS image.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "imageReference":
suggest = "image_reference"
if suggest:
pulumi.log.warn(f"Key '{k... | @pulumi.output_type
class VirtualMachineConfigurationResponse(dict):
| """
Settings for OS image.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "imageReference":
suggest = "image_reference"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in VirtualMachineConfigurationResponse. Access the val... | def admin_user_password(self) -> Optional[str]:
return pulumi.get(self, "admin_user_password")
@property
@pulumi.getter(name="adminUserSshPublicKey")
def admin_user_ssh_public_key(self) -> Optional[str]:
return pulumi.get(self, "admin_user_ssh_public_key")
@pulumi.output_type
class Virtual... | 83 | 83 | 277 | 13 | 70 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | VirtualMachineConfigurationResponse | VirtualMachineConfigurationResponse | 2,234 | 2,271 | 2,234 | 2,235 | 8cc01200823390b63cd0c02e491403913987ed8a | bigcode/the-stack | train |
e2bf67fe488a93cdc421d303 | train | class | @pulumi.output_type
class FileResponse(dict):
"""
Properties of the file.
"""
def __init__(__self__, *,
download_url: str,
name: str,
content_length: Optional[float] = None,
last_modified: Optional[str] = None):
"""
Prop... | @pulumi.output_type
class FileResponse(dict):
| """
Properties of the file.
"""
def __init__(__self__, *,
download_url: str,
name: str,
content_length: Optional[float] = None,
last_modified: Optional[str] = None):
"""
Properties of the file.
:param str downloa... | set.
"""
def __init__(__self__, *,
name: str,
value: Optional[str] = None):
"""
A collection of environment variables to set.
"""
pulumi.set(__self__, "name", name)
if value is not None:
pulumi.set(__self__, "value", value)
... | 141 | 141 | 470 | 11 | 130 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | FileResponse | FileResponse | 821 | 875 | 821 | 822 | a2bd9f042f4639610b111249c8e6e5f09b432cde | bigcode/the-stack | train |
5c9d6116884de3fe543723a7 | train | class | @pulumi.output_type
class DataDisksResponse(dict):
"""
Settings for the data disk which would be created for the File Server.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "cachingType":
suggest = "caching_type"
elif key == "diskCount":
... | @pulumi.output_type
class DataDisksResponse(dict):
| """
Settings for the data disk which would be created for the File Server.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "cachingType":
suggest = "caching_type"
elif key == "diskCount":
suggest = "disk_count"
elif key ... | key_warning(key)
return super().__getitem__(key)
def get(self, key: str, default = None) -> Any:
CustomToolkitSettingsResponse.__key_warning(key)
return super().get(key, default)
def __init__(__self__, *,
command_line: Optional[str] = None):
"""
Specifi... | 152 | 152 | 509 | 13 | 139 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | DataDisksResponse | DataDisksResponse | 731 | 792 | 731 | 732 | 3246b51116c6f5d18119736ac4d49d3e6bfd8ae5 | bigcode/the-stack | train |
7a747ce3d3c670c31cf437d7 | train | class | @pulumi.output_type
class AutoScaleSettingsResponse(dict):
"""
The system automatically scales the cluster up and down (within minimumNodeCount and maximumNodeCount) based on the pending and running jobs on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if... | @pulumi.output_type
class AutoScaleSettingsResponse(dict):
| """
The system automatically scales the cluster up and down (within minimumNodeCount and maximumNodeCount) based on the pending and running jobs on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "maximumNodeCount":
suggest = "maximum_... | JobPropertiesResponseExecutionInfo',
'KeyVaultSecretReferenceResponse',
'ManualScaleSettingsResponse',
'MountSettingsResponse',
'MountVolumesResponse',
'NameValuePairResponse',
'NodeSetupResponse',
'NodeStateCountsResponse',
'OutputDirectoryResponse',
'PrivateRegistryCredentialsRespo... | 142 | 142 | 476 | 13 | 129 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | AutoScaleSettingsResponse | AutoScaleSettingsResponse | 54 | 107 | 54 | 55 | 8636a6d8cc0b702e169fa3ea88274aa58d7cdccc | bigcode/the-stack | train |
4104a710908bb154e20e0bdf | train | class | @pulumi.output_type
class RemoteLoginInformationResponse(dict):
"""
Contains remote login details to SSH/RDP to a compute node in cluster.
"""
def __init__(__self__, *,
ip_address: str,
node_id: str,
port: float):
"""
Contains remote log... | @pulumi.output_type
class RemoteLoginInformationResponse(dict):
| """
Contains remote login details to SSH/RDP to a compute node in cluster.
"""
def __init__(__self__, *,
ip_address: str,
node_id: str,
port: float):
"""
Contains remote login details to SSH/RDP to a compute node in cluster.
:par... | _secret_reference(self) -> Optional['outputs.KeyVaultSecretReferenceResponse']:
"""
Users can store their secrets in Azure KeyVault and pass it to the Batch AI Service to integrate with KeyVault. One of password or passwordSecretReference must be specified.
"""
return pulumi.get(self, "p... | 78 | 78 | 260 | 13 | 65 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | RemoteLoginInformationResponse | RemoteLoginInformationResponse | 1,784 | 1,821 | 1,784 | 1,785 | 6ad4ec532d61de7192b282fa536622ef4886c13d | bigcode/the-stack | train |
e0a5c6543c54df7d958eef86 | train | class | @pulumi.output_type
class SetupTaskResponse(dict):
"""
Specifies a setup task which can be used to customize the compute nodes of the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLine":
suggest = "command_line"
elif key ... | @pulumi.output_type
class SetupTaskResponse(dict):
| """
Specifies a setup task which can be used to customize the compute nodes of the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLine":
suggest = "command_line"
elif key == "stdOutErrPathPrefix":
suggest = "st... | for the cluster.
"""
if auto_scale is not None:
pulumi.set(__self__, "auto_scale", auto_scale)
if manual is not None:
pulumi.set(__self__, "manual", manual)
@property
@pulumi.getter(name="autoScale")
def auto_scale(self) -> Optional['outputs.AutoScaleSetting... | 183 | 183 | 613 | 12 | 171 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | SetupTaskResponse | SetupTaskResponse | 1,898 | 1,965 | 1,898 | 1,899 | 98410ea2aeb4d9c13a017aafb2c0ca1c31053015 | bigcode/the-stack | train |
e7303e251e55786ccadfbd3e | train | class | @pulumi.output_type
class PrivateRegistryCredentialsResponse(dict):
"""
Credentials to access a container image in a private repository.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "passwordSecretReference":
suggest = "password_secret_reference... | @pulumi.output_type
class PrivateRegistryCredentialsResponse(dict):
| """
Credentials to access a container image in a private repository.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "passwordSecretReference":
suggest = "password_secret_reference"
if suggest:
pulumi.log.warn(f"Key '{key}' not... | return pulumi.get(self, "create_new")
@property
@pulumi.getter(name="pathSuffix")
def path_suffix(self) -> Optional[str]:
"""
The suffix path where the output directory will be created.
"""
return pulumi.get(self, "path_suffix")
@property
@pulumi.getter
def typ... | 150 | 150 | 502 | 13 | 137 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | PrivateRegistryCredentialsResponse | PrivateRegistryCredentialsResponse | 1,725 | 1,781 | 1,725 | 1,726 | 81459e825889e82afa73ac2d348d9c9cdff510a0 | bigcode/the-stack | train |
11e68fb6d204d7940664e5ad | train | class | @pulumi.output_type
class AzureFileShareReferenceResponse(dict):
"""
Details of the Azure File Share to mount on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "accountName":
suggest = "account_name"
elif key == "azureFileUrl"... | @pulumi.output_type
class AzureFileShareReferenceResponse(dict):
| """
Details of the Azure File Share to mount on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "accountName":
suggest = "account_name"
elif key == "azureFileUrl":
suggest = "azure_file_url"
elif key == "rel... | not None:
pulumi.set(__self__, "mount_options", mount_options)
@property
@pulumi.getter(name="accountName")
def account_name(self) -> str:
return pulumi.get(self, "account_name")
@property
@pulumi.getter(name="containerName")
def container_name(self) -> str:
return... | 246 | 246 | 820 | 14 | 232 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | AzureFileShareReferenceResponse | AzureFileShareReferenceResponse | 188 | 285 | 188 | 189 | 483c0c8572a925614e9e671e0dc53f8946793752 | bigcode/the-stack | train |
100c1884c63beffb411ead45 | train | class | @pulumi.output_type
class JobPreparationResponse(dict):
"""
Specifies the settings for job preparation.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLine":
suggest = "command_line"
if suggest:
pulumi.log.warn(f"Key '... | @pulumi.output_type
class JobPreparationResponse(dict):
| """
Specifies the settings for job preparation.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLine":
suggest = "command_line"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in JobPreparationResponse. Access the v... | variable: AZ_BATCHAI_PREV_OUTPUT_Name. The value of the variable will be populated if the job is being retried after a previous failure, otherwise it will be set to nothing.
"""
return pulumi.get(self, "id")
@property
@pulumi.getter
def path(self) -> str:
return pulumi.get(self, "p... | 91 | 91 | 306 | 12 | 79 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | JobPreparationResponse | JobPreparationResponse | 1,078 | 1,114 | 1,078 | 1,079 | d0d050fcc3fc9b5c1631b1b1b4257b148175d8eb | bigcode/the-stack | train |
a8d8692e4b273ff336324855 | train | class | @pulumi.output_type
class AzureBlobFileSystemReferenceResponse(dict):
"""
Provides required information, for the service to be able to mount Azure Blob Storage container on the cluster nodes.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "accountName":
... | @pulumi.output_type
class AzureBlobFileSystemReferenceResponse(dict):
| """
Provides required information, for the service to be able to mount Azure Blob Storage container on the cluster nodes.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "accountName":
suggest = "account_name"
elif key == "containerName":
... | ", maximum_node_count)
pulumi.set(__self__, "minimum_node_count", minimum_node_count)
if initial_node_count is None:
initial_node_count = 0
if initial_node_count is not None:
pulumi.set(__self__, "initial_node_count", initial_node_count)
@property
@pulumi.getter(... | 192 | 192 | 643 | 15 | 177 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | AzureBlobFileSystemReferenceResponse | AzureBlobFileSystemReferenceResponse | 110 | 185 | 110 | 111 | 6f4a6e0f547a0bc9984a06ee1979b8785b250527 | bigcode/the-stack | train |
2edfec957392d9910b7f9ff0 | train | class | @pulumi.output_type
class CaffeSettingsResponse(dict):
"""
Specifies the settings for Caffe job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLineArgs":
suggest = "command_line_args"
elif key == "configFilePath":
sugg... | @pulumi.output_type
class CaffeSettingsResponse(dict):
| """
Specifies the settings for Caffe job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLineArgs":
suggest = "command_line_args"
elif key == "configFilePath":
suggest = "config_file_path"
elif key == "processCo... | property
@pulumi.getter(name="languageType")
def language_type(self) -> Optional[str]:
"""
Valid values are 'BrainScript' or 'Python'.
"""
return pulumi.get(self, "language_type")
@property
@pulumi.getter(name="processCount")
def process_count(self) -> Optional[int]:... | 238 | 238 | 794 | 13 | 225 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | CaffeSettingsResponse | CaffeSettingsResponse | 495 | 584 | 495 | 496 | 46035bce2c6a5e84f2347e4b3d3ab2bc14f25c6f | bigcode/the-stack | train |
98fcb67dd627b70f4786f30e | train | class | @pulumi.output_type
class KeyVaultSecretReferenceResponse(dict):
"""
Describes a reference to Key Vault Secret.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "secretUrl":
suggest = "secret_url"
elif key == "sourceVault":
sugge... | @pulumi.output_type
class KeyVaultSecretReferenceResponse(dict):
| """
Describes a reference to Key Vault Secret.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "secretUrl":
suggest = "secret_url"
elif key == "sourceVault":
suggest = "source_vault"
if suggest:
pulumi.log.w... | return pulumi.get(self, "end_time")
@property
@pulumi.getter
def errors(self) -> Optional[Sequence['outputs.BatchAIErrorResponse']]:
return pulumi.get(self, "errors")
@property
@pulumi.getter(name="exitCode")
def exit_code(self) -> Optional[int]:
"""
This property is o... | 116 | 116 | 387 | 14 | 102 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | KeyVaultSecretReferenceResponse | KeyVaultSecretReferenceResponse | 1,234 | 1,279 | 1,234 | 1,235 | 544898233ffe5d54b26ae495ee7160c971d57997 | bigcode/the-stack | train |
405638fd43a9bf3107edab3d | train | class | @pulumi.output_type
class ContainerSettingsResponse(dict):
"""
Settings for the container to be downloaded.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "imageSourceRegistry":
suggest = "image_source_registry"
if suggest:
pu... | @pulumi.output_type
class ContainerSettingsResponse(dict):
| """
Settings for the container to be downloaded.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "imageSourceRegistry":
suggest = "image_source_registry"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in ContainerSettingsR... | (self) -> Optional[int]:
"""
The default value for this property is equal to nodeCount property
"""
return pulumi.get(self, "process_count")
@property
@pulumi.getter(name="pythonInterpreterPath")
def python_interpreter_path(self) -> Optional[str]:
return pulumi.get(s... | 88 | 88 | 296 | 12 | 76 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | ContainerSettingsResponse | ContainerSettingsResponse | 656 | 692 | 656 | 657 | 4ac4a640a85021f08c8837abc09d068e34e9b839 | bigcode/the-stack | train |
49ef96481d6785b295de7c0f | train | class | @pulumi.output_type
class NameValuePairResponse(dict):
"""
Represents a name-value pair.
"""
def __init__(__self__, *,
name: Optional[str] = None,
value: Optional[str] = None):
"""
Represents a name-value pair.
"""
if name is not None:
... | @pulumi.output_type
class NameValuePairResponse(dict):
| """
Represents a name-value pair.
"""
def __init__(__self__, *,
name: Optional[str] = None,
value: Optional[str] = None):
"""
Represents a name-value pair.
"""
if name is not None:
pulumi.set(__self__, "name", name)
if... | property
@pulumi.getter(name="unmanagedFileSystems")
def unmanaged_file_systems(self) -> Optional[Sequence['outputs.UnmanagedFileSystemReferenceResponse']]:
return pulumi.get(self, "unmanaged_file_systems")
@pulumi.output_type
class NameValuePairResponse(dict):
| 64 | 64 | 160 | 13 | 51 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | NameValuePairResponse | NameValuePairResponse | 1,479 | 1,503 | 1,479 | 1,480 | 95773c08ae88ac97945d7a026a47e0308e41e33c | bigcode/the-stack | train |
0c9a9ae82cbdc4bae915539a | train | class | @pulumi.output_type
class MountVolumesResponse(dict):
"""
Details of volumes to mount on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "azureBlobFileSystems":
suggest = "azure_blob_file_systems"
elif key == "azureFileShares":... | @pulumi.output_type
class MountVolumesResponse(dict):
| """
Details of volumes to mount on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "azureBlobFileSystems":
suggest = "azure_blob_file_systems"
elif key == "azureFileShares":
suggest = "azure_file_shares"
eli... | _ip)
if file_server_type is not None:
pulumi.set(__self__, "file_server_type", file_server_type)
if mount_point is not None:
pulumi.set(__self__, "mount_point", mount_point)
@property
@pulumi.getter(name="fileServerInternalIP")
def file_server_internal_ip(self) -> Op... | 220 | 220 | 736 | 12 | 208 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | MountVolumesResponse | MountVolumesResponse | 1,405 | 1,476 | 1,405 | 1,406 | 09acb3b4914745cf862e8b7c36dfb7048e114b7c | bigcode/the-stack | train |
f82682e57404e500886772a1 | train | class | @pulumi.output_type
class NodeStateCountsResponse(dict):
"""
Counts of various compute node states on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "idleNodeCount":
suggest = "idle_node_count"
elif key == "leavingNodeCount":
... | @pulumi.output_type
class NodeStateCountsResponse(dict):
| """
Counts of various compute node states on the cluster.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "idleNodeCount":
suggest = "idle_node_count"
elif key == "leavingNodeCount":
suggest = "leaving_node_count"
elif k... | is not None:
pulumi.set(__self__, "mount_volumes", mount_volumes)
if setup_task is not None:
pulumi.set(__self__, "setup_task", setup_task)
@property
@pulumi.getter(name="mountVolumes")
def mount_volumes(self) -> Optional['outputs.MountVolumesResponse']:
"""
... | 174 | 174 | 580 | 13 | 161 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | NodeStateCountsResponse | NodeStateCountsResponse | 1,560 | 1,628 | 1,560 | 1,561 | a5c5c3bb9de87fccc3cdf03da80c09c37b6f6972 | bigcode/the-stack | train |
b1ec8494c37b1828d68cb743 | train | class | @pulumi.output_type
class OutputDirectoryResponse(dict):
"""
Output directory for the job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "pathPrefix":
suggest = "path_prefix"
elif key == "createNew":
suggest = "create_new"
... | @pulumi.output_type
class OutputDirectoryResponse(dict):
| """
Output directory for the job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "pathPrefix":
suggest = "path_prefix"
elif key == "createNew":
suggest = "create_new"
elif key == "pathSuffix":
suggest = "pat... | _node_count)
pulumi.set(__self__, "running_node_count", running_node_count)
pulumi.set(__self__, "unusable_node_count", unusable_node_count)
@property
@pulumi.getter(name="idleNodeCount")
def idle_node_count(self) -> int:
return pulumi.get(self, "idle_node_count")
@property
... | 246 | 246 | 823 | 12 | 234 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | OutputDirectoryResponse | OutputDirectoryResponse | 1,631 | 1,722 | 1,631 | 1,632 | 88f5d288ff010002ce668e4805cee719fb348ed7 | bigcode/the-stack | train |
13acdd4b74059ca064a97c6d | train | class | @pulumi.output_type
class CustomToolkitSettingsResponse(dict):
"""
Specifies the settings for a custom tool kit job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLine":
suggest = "command_line"
if suggest:
pulumi.log... | @pulumi.output_type
class CustomToolkitSettingsResponse(dict):
| """
Specifies the settings for a custom tool kit job.
"""
@staticmethod
def __key_warning(key: str):
suggest = None
if key == "commandLine":
suggest = "command_line"
if suggest:
pulumi.log.warn(f"Key '{key}' not found in CustomToolkitSettingsResponse.... | _registry)
@property
@pulumi.getter(name="imageSourceRegistry")
def image_source_registry(self) -> 'outputs.ImageSourceRegistryResponse':
"""
Details of the container image such as name, URL and credentials.
"""
return pulumi.get(self, "image_source_registry")
@pulumi.output... | 76 | 76 | 255 | 13 | 63 | sebtelko/pulumi-azure-native | sdk/python/pulumi_azure_native/batchai/v20170901preview/outputs.py | Python | CustomToolkitSettingsResponse | CustomToolkitSettingsResponse | 695 | 728 | 695 | 696 | bbd2ba3be0cdba432182677cf4d119f3d157de5c | bigcode/the-stack | train |
16e31553cb396f2cdcb696ad | train | function | def filter_error(row):
columns = list(row)
# //check title type is None
if type(row.title) == type(None):
return False
# //check gender data
if (row.gender != 'male') and (row.gender != 'female'):
return False
# //check if every size is zero
sum_of_size = 0
for i... | def filter_error(row):
| columns = list(row)
# //check title type is None
if type(row.title) == type(None):
return False
# //check gender data
if (row.gender != 'male') and (row.gender != 'female'):
return False
# //check if every size is zero
sum_of_size = 0
for index in range(columns.in... | Users/stevelim/spark/siba.csv'
pdf = pd.read_csv('file://' + file_path, encoding='utf-8')
print(pdf.head())
df = sqlContext.createDataFrame(pdf)
df.show()
df_to_rdd = df.rdd
# error data filtering
def filter_error(row):
| 64 | 64 | 151 | 5 | 58 | limtaegeun/cloth-size-recommend | classify.py | Python | filter_error | filter_error | 37 | 61 | 37 | 38 | e3d32512fd22f81c61b7a9fc40f5330c0dea0eb9 | bigcode/the-stack | train |
2ec4d3604da3e372f456720d | train | function | def size_preprocess(rdd):
def parse_size(row):
# //chest Length To Round
chest = (row.BreastSide * 2) if (row.BreastSide != 0) else row.BreastPeripheral
waist = (row.WaistSection * 2) if (row.WaistSection != 0) else row.WaistCircumference
hip = (row.HipSection * 2) if (row.HipSectio... | def size_preprocess(rdd):
| def parse_size(row):
# //chest Length To Round
chest = (row.BreastSide * 2) if (row.BreastSide != 0) else row.BreastPeripheral
waist = (row.WaistSection * 2) if (row.WaistSection != 0) else row.WaistCircumference
hip = (row.HipSection * 2) if (row.HipSection != 0) else row.HipCircum... | float:
# //columns[index] = int(columns[index])
return False
sum_of_size += columns[index]
if sum_of_size == 0:
return False
return True
clear_rdd = df_to_rdd.filter(filter_error)
# preprocess
def size_preprocess(rdd):
| 64 | 64 | 211 | 7 | 56 | limtaegeun/cloth-size-recommend | classify.py | Python | size_preprocess | size_preprocess | 67 | 82 | 67 | 67 | 405b4a1db63ae3c8f265ac80e370c84d47ac40ef | bigcode/the-stack | train |
b6b5912e2bd11a8110335c8a | train | function | def ProfileCreateSpec(vim, *args, **kwargs):
'''Specification describing the parameters during Profile creation'''
obj = vim.client.factory.create('{urn:vim25}ProfileCreateSpec')
# do some validation checking...
if (len(args) + len(kwargs)) < 0:
raise IndexError('Expected at least 1 arguments ... | def ProfileCreateSpec(vim, *args, **kwargs):
| '''Specification describing the parameters during Profile creation'''
obj = vim.client.factory.create('{urn:vim25}ProfileCreateSpec')
# do some validation checking...
if (len(args) + len(kwargs)) < 0:
raise IndexError('Expected at least 1 arguments got: %d' % len(args))
required = [ ]
... |
import logging
from pyvisdk.exceptions import InvalidArgumentError
########################################
# Automatically generated, do not edit.
########################################
log = logging.getLogger(__name__)
def ProfileCreateSpec(vim, *args, **kwargs):
| 49 | 64 | 192 | 13 | 36 | Infinidat/pyvisdk | pyvisdk/do/profile_create_spec.py | Python | ProfileCreateSpec | ProfileCreateSpec | 11 | 32 | 11 | 11 | d6b193bc8fc791bb0ecac2cd72a40bb8a5c1e307 | bigcode/the-stack | train |
920be4ffcd65b05875c3fe09 | train | class | class AppsV1beta1Deployment(object):
"""
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attrib... | class AppsV1beta1Deployment(object):
| """
NOTE: This class is auto generated by the swagger code generator program.
Do not edit the class manually.
"""
"""
Attributes:
swagger_types (dict): The key is attribute name
and the value is attribute type.
attribute_map (dict): The key is attribute ... | # coding: utf-8
"""
Kubernetes
No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen)
OpenAPI spec version: v1.11.1
Generated by: https://github.com/swagger-api/swagger-codegen.git
"""
from pprint import pformat
from six import iteritems
import re... | 84 | 256 | 1,514 | 9 | 74 | reymont/python | kubernetes/client/models/apps_v1beta1_deployment.py | Python | AppsV1beta1Deployment | AppsV1beta1Deployment | 19 | 238 | 19 | 19 | a24717bbe9e4fcc790ed33f2636062ad792554b3 | bigcode/the-stack | train |
df17f7ab281e4d6585ca4471 | train | function | def scb(attr, old, new):
source.data['y'] = new * y
| def scb(attr, old, new):
| source.data['y'] = new * y
| fafafa")
p.circle(x=1, y=list(range(0, 11)))
p.line('x', 'y', color="orange", source=source)
slider = Slider(start=0, end=10, step=0.1, value=1)
def scb(attr, old, new):
| 64 | 64 | 20 | 9 | 55 | goncaloperes/bokeh | examples/howto/hold_app.py | Python | scb | scb | 21 | 22 | 21 | 21 | 10da0bfe5e68a212c98b9fb104e8890613fed3e5 | bigcode/the-stack | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.