Guest User

understand

a guest
Aug 23rd, 2023
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.17 KB | None | 0 0
  1. Translate the text into code.
  2. These are the available functions.
  3. ```
  4. from oc.fns.context import get_ctx
  5. from oc.fns.shapes import is_triangle, is_line, is_square
  6. from oc.fns.spatial import all_close, is_above, is_below, is_right, is_left, is_middle
  7. from oc.fns.spatial import get_top, get_bottom, get_right, get_left
  8. from oc.fns.spatial import get_top_right, get_top_left, get_bottom_right, get_bottom_left
  9. from oc.fns.spatial import get_middle
  10. from oc.fns.spatial import get_distance, get_minimum_radius
  11. from oc.fns.color import is_dark, is_grey, is_light, lightest, darkest, same_color, different_color, is_darker, is_lighter
  12. from oc.fns.size import is_large, is_small, is_medium_size, largest, smallest, same_size, different_size, is_larger, is_smaller
  13. from oc.fns.iterators import get1idxs, get2idxs, get3idxs, getsets
  14. from oc.fns.lists import add
  15. from oc.fns.lists import sort_state
  16. import numpy as np
  17. from functools import partial
  18. from itertools import permutations
  19.  
  20. ```
  21. `idxs = list(range(7))` corresponds to the available dots.
  22.  
  23. Here are some examples.
  24.  
  25. Text: Got a triangle of 3 light grey dots by itself.
  26. Type: New question.
  27. Dots: a,b,c
  28. Save dots: a,b,c
  29. Code:
  30. ```
  31. check_abc_triangle = is_triangle([a,b,c], ctx)
  32. check_abc_light = all([is_light(dot, ctx) for dot in [a,b,c]])
  33. check_abc_alone = all([not all_close([a,b,c,dot], ctx) for dot in idxs if dot not in [a,b,c]])
  34. ```
  35.  
  36. Text: Could be. One on right is largest with a tiny gray on top??
  37. Type: Follow up question, no new dots.
  38. Previous dots: a,b,c
  39. Save dots: a,b,c
  40. Code:
  41. ```
  42. check_a_right = a == get_right([a,b,c], ctx)
  43. check_a_largest = a == largest([a,b,c], ctx)
  44. check_b_tiny = is_small(b, ctx)
  45. check_b_grey = is_grey(b, ctx)
  46. check_b_top = b == get_top([a,b,c], ctx)
  47. ```
  48.  
  49. Text: Nevermind. Do you see a pair of dark dots? One with another above and to the right of it? Same size as well.
  50. Type: New question.
  51. Dots: a,b
  52. Save dots: a,b
  53. Code:
  54. ```
  55. check_ab_pair = all_close([a,b], ctx)
  56. check_ab_dark = is_dark(a, ctx) and is_dark(b, ctx)
  57. check_b_right_a = is_right(b, a, ctx)
  58. check_b_above_a = is_above(b, a, ctx)
  59. check_ab_same_size = same_size([a,b], ctx)
  60. ```
  61.  
  62. Text: No.
  63. Type: No op.
  64. Code:
  65. ```
  66. pass
  67. ```
  68.  
  69. Text: What about a large medium grey dot near the center?
  70. Type: New question.
  71. Dots: a
  72. Save dots: a
  73. Code:
  74. ```
  75. check_a_large = is_large(a, ctx)
  76. check_a_grey = is_grey(a, ctx)
  77. check_a_center = is_middle(a, None, ctx)
  78. ```
  79.  
  80. Text: Is there a smaller black one next to it?
  81. Type: Follow up question, new dots.
  82. Previous dots: a,
  83. New dots: b,
  84. Save dots: a,b
  85. Code:
  86. ```
  87. check_b_smaller_a = is_smaller(b, a, ctx)
  88. check_b_dark = is_dark(b, ctx)
  89. check_b_next_to_a = all_close([a,b], ctx)
  90. ```
  91.  
  92. Text: No. Do you see three dots in a diagonal line, where the top left dot is light, middle dot is grey, and bottom right dot is dark?
  93. Type: New question.
  94. Dots: a,b,c
  95. Save dots: a,b,c
  96. Code:
  97. ```
  98. check_abc_line = is_line([a,b,c], ctx)
  99. check_a_top_left = a == get_top_left([a,b,c], ctx)
  100. check_a_light = is_light(a, ctx)
  101. check_b_middle = is_middle(b, [a,b,c], ctx)
  102. check_b_grey = is_grey(y, ctx)
  103. check_c_bottom_right = c == get_bottom_right([a,b,c], ctx)
  104. check_c_dark = is_dark(c, ctx)
  105. ```
  106.  
  107. Text: Yes. Is the top one close to the middle darker one?
  108. Type: Follow up question, no new dots.
  109. Previous dots: a,b,c
  110. Save dots: a,b,c
  111. Code:
  112. ```
  113. check_a_top = a == get_top([a,b,c], ctx)
  114. check_b_middle = b == get_middle([a,b,c], ctx)
  115. check_ab_close = all_close([a, b], ctx)
  116. check_b_darker_a = is_darker(b, a, ctx)
  117. ```
  118.  
  119. Text: Yes. And the smallest is on the bottom right.
  120. Type: Follow up question, no new dots.
  121. Previous dots: a,b,c
  122. Save dots: a,b,c
  123. Code:
  124. ```
  125. check_c_smallest = c == smallest([a,b,c], ctx)
  126. check_c_bottom_right = c == get_bottom_right([a,b,c], ctx)
  127. ```
  128.  
  129. Text: Yes, let's select the large one. <selection>.
  130. Type: Select a dot.
  131. Previous dots: a,b,c
  132. New dots: _
  133. Save dots: a
  134. Code:
  135. ```
  136. check_a_large = is_large(a, ctx)
  137. ```
  138.  
  139. Text: Do you see a large black dot on the bottom left?
  140. Type: New question.
  141. Dots: a
  142. Save dots: a
  143. Code:
  144. ```
  145. check_a_large = is_large(a, cta)
  146. check_a_dark = is_dark(a, cta)
  147. check_a_below_left = is_below(a, None, cta) and is_left(a, None, cta)
  148. ```
  149.  
  150. Text: I see a large black dot next to two smaller lighter dots. The two smaller ones are the same size and color. We have different views though.
  151. Type: New question.
  152. Dots: a,b,c
  153. Save dots: a,b,c
  154. Code:
  155. ```
  156. check_abc_close = all_close([a,b,c], ctx)
  157. check_a_large = is_large(a, ctx)
  158. check_c_dark = is_dark(c, ctx)
  159. check_b_smaller_a = is_smaller(b, a, ctx)
  160. check_c_smaller_a = is_smaller(c, a, ctx)
  161. check_b_lighter_a = is_lighter(b, a, ctx)
  162. check_c_lighter_a = is_lighter(c, a, ctx)
  163. check_bc_same_size = same_size([b,c], ctx)
  164. check_bc_same_color = same_color([b,c], ctx)
  165. ```
  166.  
  167. Text: Select the largest one.
  168. Type: Select a dot.
  169. Previous dots: a,b,c
  170. New dots: _
  171. Save dots: a
  172. Code:
  173. ```
  174. check_a_largest = a == get_largest([a,b,c], ctx)
  175. ```
  176.  
  177. Text: Yes.
  178. Type: No op.
  179. Code:
  180. ```
  181. pass
  182. ```
  183.  
  184. Text: Okay. <selection>.
  185. Type: No op.
  186. Code:
  187. ```
  188. pass
  189. ```
  190.  
  191. Text: Do you see a pair of dots, where the bottom dot is medium-sized and dark and the top dot is large-sized and light?
  192. Type: New question.
  193. Dots: a,b,
  194. Save dots:
Advertisement
Add Comment
Please, Sign In to add comment