submission_id
int32 10
42.5k
| func_code
stringlengths 22
782
| assignment_id
stringlengths 4
23
| func_name
stringlengths 4
23
| description
stringlengths 26
128
| test
stringlengths 45
1.22k
| correct
bool 2
classes | user
stringlengths 36
36
| academic_year
int32 2.02k
2.02k
|
---|---|---|---|---|---|---|---|---|
26,843 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
fccb16a1-abd7-4ee8-a2c6-5b7653d7a7dc
| 2,016 |
7,307 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
dc42d7ae-53d0-4b49-988b-c619edf38a77
| 2,016 |
12,897 |
def area(n):
return pi * n ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
a48376ed-7138-4481-a4da-74490838ea3e
| 2,016 |
104 |
def circumference(n):
return pi * n * 2
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
a48376ed-7138-4481-a4da-74490838ea3e
| 2,016 |
28,107 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def selection_sort(a):
for i in range(len(a)):
smallest = i
for j in range(i, len(a)):
if a[j] < a[smallest]:
smallest = j
swap(a, i, smallest)
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
91bbbbbf-cad8-4507-9c4d-c7cfe0ebc210
| 2,016 |
25,710 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def selection_sort(a):
for i in range(len(a)):
smallest = i
for j in range(i, len(a)):
if a[j] < a[smallest]:
smallest = j
swap(a, i, smallest)
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
91bbbbbf-cad8-4507-9c4d-c7cfe0ebc210
| 2,016 |
10,067 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
fa7e9f17-de07-4868-ab69-667438d7becd
| 2,016 |
21,280 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
a379289f-2b57-4917-ac63-01ab37fb3785
| 2,016 |
36,985 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
a379289f-2b57-4917-ac63-01ab37fb3785
| 2,016 |
35,221 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
7a72123c-6850-4e9f-b407-211283f04a4c
| 2,016 |
84 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
7a72123c-6850-4e9f-b407-211283f04a4c
| 2,016 |
18,922 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
j = len(a) - 1
while i < len(a) / 2:
swap(a, i, j)
i = i + 1
j = j - 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
f0b2f578-ae0f-4ddc-94e9-204708d09f37
| 2,016 |
19,907 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
fc73b043-0c96-4ce3-8b8f-2c4c98785aa6
| 2,016 |
10,091 |
def swap(a, x, y):
tmp = a[x]
a[x] = a[y]
a[y] = tmp
return a
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
2c7a8a81-53ed-42cc-bd4e-e268d1d767be
| 2,016 |
11,140 |
def double(n):
y = 2 * n
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
6ae36e81-5a79-4a87-a484-a86635591a14
| 2,016 |
15,632 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
return a
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
ba8a7560-aac9-45ef-b6fd-730b60e73e8c
| 2,016 |
29,120 |
def reverse(a):
i = 0
while i < len(a) / 2:
tmp = a[i]
a[i] = a[len(a) - i - 1]
a[len(a) - i - 1] = tmp
i += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
b13f3dba-a06b-4528-a4d8-c2ee1a5bb34d
| 2,016 |
27,424 |
def double(n):
double_val = n * 2
return double_val
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
ccb230ef-8610-4130-8882-d0643817d9b4
| 2,016 |
37,819 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
48db4273-a21e-41be-bca6-9b6444a15cbf
| 2,016 |
37,256 |
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
48db4273-a21e-41be-bca6-9b6444a15cbf
| 2,016 |
37,584 |
def selection_sort(a):
return a.sort()
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
bd03ecd6-cea3-4854-803a-b14d429489a7
| 2,016 |
39,681 |
def selection_sort(a):
return a.sort()
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
bd03ecd6-cea3-4854-803a-b14d429489a7
| 2,016 |
37,848 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
712c50ed-0c17-44f1-a863-183f2d9a5e14
| 2,016 |
15,389 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
712c50ed-0c17-44f1-a863-183f2d9a5e14
| 2,016 |
6,636 |
def reverse(a):
i = 0
while i < len(a) / 2:
tmp = a[i]
a[i] = a[len(a) - i - 1]
a[len(a) - i - 1] = tmp
i += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
a6392e0c-005c-4131-a7bb-80cf6af877de
| 2,016 |
41,281 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
61b5b70e-4e9d-424d-ba4b-cab01b8c205f
| 2,016 |
21,163 |
def circumference(r):
return 2 * 3.141 * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true |
3a86cbea-7925-4e8e-9baa-3505dd2219c7
| 2,016 |
18,897 |
def area(r):
return 3.141 * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
3a86cbea-7925-4e8e-9baa-3505dd2219c7
| 2,016 |
23,479 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
61b5b70e-4e9d-424d-ba4b-cab01b8c205f
| 2,016 |
4,120 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
422fe752-ca84-4537-b250-7de556e6ee94
| 2,016 |
10,761 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
3a86cbea-7925-4e8e-9baa-3505dd2219c7
| 2,016 |
27,832 |
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
3a86cbea-7925-4e8e-9baa-3505dd2219c7
| 2,016 |
5,270 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
427cdab9-477f-4fb3-92b0-bf5eef785c90
| 2,016 |
31,258 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
427cdab9-477f-4fb3-92b0-bf5eef785c90
| 2,016 |
39,768 |
def area(r):
return pi * (r * r)
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
3d19e1db-d496-420c-b077-41631364e4f7
| 2,016 |
21,334 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
3d19e1db-d496-420c-b077-41631364e4f7
| 2,016 |
32,626 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
c0a5d565-4fbf-4274-85af-71162f38b8d4
| 2,016 |
19,250 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
652b3384-e559-46c5-81db-1bf2117db63b
| 2,016 |
38,767 |
def reverse(a):
i = 0
while i < len(a) / 2:
tmp = a[i]
a[i] = a[len(a) - i - 1]
a[len(a) - i - 1] = tmp
i = i + 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
72de96bc-40bc-48ca-b1c3-91150748b31a
| 2,016 |
3,907 |
def find_smallest_position(a, i):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
return p
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def selection_sort(a):
i = 0
while i < len(a):
p = find_smallest_position(a, i)
swap(a, i, p)
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
dc42d7ae-53d0-4b49-988b-c619edf38a77
| 2,016 |
18,263 |
def find_smallest_position(a, i):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
return p
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def selection_sort(a):
i = 0
while i < len(a):
p = find_smallest_position(a, i)
swap(a, i, p)
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
dc42d7ae-53d0-4b49-988b-c619edf38a77
| 2,016 |
3,637 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - 1 - i)
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
2eb2f93d-3491-4b0b-bad9-894c90595058
| 2,016 |
12,724 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
7b8e2d7b-1f3a-4e34-b02c-e6ac46baa465
| 2,016 |
18,541 |
def area(r):
return pi * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
7b8e2d7b-1f3a-4e34-b02c-e6ac46baa465
| 2,016 |
12,555 |
def circumference(r):
ans = 2 * pi * r
return ans
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
41c113b8-6f57-4003-bed3-3587b2376170
| 2,016 |
23,779 |
def area(r):
ans = pi * r ** 2
return ans
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
41c113b8-6f57-4003-bed3-3587b2376170
| 2,016 |
16,504 |
def circumference(r):
return 2 * 3.141 * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true |
fc73b043-0c96-4ce3-8b8f-2c4c98785aa6
| 2,016 |
18,380 |
def area(r):
return 3.141 * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| true |
fc73b043-0c96-4ce3-8b8f-2c4c98785aa6
| 2,016 |
3,085 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
swap(a, i, p)
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
54b87e3d-5711-4a83-a6d1-ed14ae588835
| 2,016 |
26,583 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
swap(a, i, p)
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
54b87e3d-5711-4a83-a6d1-ed14ae588835
| 2,016 |
14,083 |
def double(n):
m = n * 2
return m
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true |
32a14d12-9054-46cd-aa7e-4bf97d33fa10
| 2,016 |
24,145 |
def circumference(r):
y = 2 * pi * r
return y
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
4b622395-1c2b-4a5d-ba03-c6e0e0ef2dd7
| 2,016 |
31,002 |
def area(r):
y = pi * r ** 2
return y
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
4b622395-1c2b-4a5d-ba03-c6e0e0ef2dd7
| 2,016 |
42,157 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
fa7e9f17-de07-4868-ab69-667438d7becd
| 2,016 |
37,024 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
fa7e9f17-de07-4868-ab69-667438d7becd
| 2,016 |
12,622 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def reverse(a):
b = 0
while b < len(a) / 2:
swap(a, b, len(a) - b - 1)
b += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
4788f2f7-8b97-41a8-88ee-697183f85246
| 2,016 |
37,498 |
def reverse(a):
i = 0
while i < len(a) / 2:
tmp = a[i]
a[i] = a[len(a) - i - 1]
a[len(a) - i - 1] = tmp
i = i + 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
6a42703e-da42-4824-8b83-b6f291ad71be
| 2,016 |
3,720 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
9550e418-a019-49c2-a2e9-8322a300fb6f
| 2,016 |
35,423 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
9550e418-a019-49c2-a2e9-8322a300fb6f
| 2,016 |
24,752 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
j = len(a) - 1
while i <= j:
swap(a, i, j)
i = i + 1
j = j - 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
e8eb24cb-1a57-439b-8705-aed3cec25793
| 2,016 |
30,321 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
a6392e0c-005c-4131-a7bb-80cf6af877de
| 2,016 |
26,927 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
48db4273-a21e-41be-bca6-9b6444a15cbf
| 2,016 |
17,041 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
48db4273-a21e-41be-bca6-9b6444a15cbf
| 2,016 |
41,493 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
return a
def reverse(a):
k = 0
while k < len(a) / 2:
swap(a, k, len(a) - k - 1)
k += 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
07676427-a705-4cb7-a5ef-6a1c3c67c950
| 2,016 |
27,057 |
def reverse(a):
i = 0
while i < len(a) / 2:
tmp = a[i]
a[i] = a[len(a) - i - 1]
a[len(a) - i - 1] = tmp
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
3bcffc16-908f-42c5-9ac3-f685ae6eca33
| 2,016 |
10,361 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
daaef1e8-1fe4-4dc4-b002-6e89fad22a66
| 2,016 |
35,463 |
def circumference(c):
return 2 * 3.141 * c
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true |
2f34a0ed-0d6a-447e-8e47-6a90f11d53a7
| 2,016 |
8,671 |
def area(r):
return 3.141 * r ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| true |
2f34a0ed-0d6a-447e-8e47-6a90f11d53a7
| 2,016 |
35,946 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
422fe752-ca84-4537-b250-7de556e6ee94
| 2,016 |
5,588 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
422fe752-ca84-4537-b250-7de556e6ee94
| 2,016 |
13,616 |
def area(x):
return pi * x ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
9675c8b9-337a-4fd1-bb8f-8e3510c7f703
| 2,016 |
9,201 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
9675c8b9-337a-4fd1-bb8f-8e3510c7f703
| 2,016 |
36,406 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
c0a5d565-4fbf-4274-85af-71162f38b8d4
| 2,016 |
40,635 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
c0a5d565-4fbf-4274-85af-71162f38b8d4
| 2,016 |
1,499 |
def circumference(r):
return 2 * pi * r
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false |
4e44ac28-c84a-43ee-9b95-c4270d7bb030
| 2,016 |
28,065 |
def area(r):
return pi * r * r
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false |
4e44ac28-c84a-43ee-9b95-c4270d7bb030
| 2,016 |
30,672 |
def circumference(r):
actual_circumference = 2 * 3.141 * r
return actual_circumference
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true |
ccb230ef-8610-4130-8882-d0643817d9b4
| 2,016 |
35,554 |
def area(r):
actual_area = 3.141 * r ** 2
return actual_area
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| true |
ccb230ef-8610-4130-8882-d0643817d9b4
| 2,016 |
24,099 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
j = len(a) - 1
while i < len(a) / 2:
swap(a, i, j)
i = i + 1
j = j - 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
e84cb3e0-5b98-4543-816e-a3570ba72e05
| 2,016 |
2,589 |
def reverse(a):
i = 0
while i < len(a) / 2:
tmp = a[i]
a[i] = a[len(a) - i - 1]
a[len(a) - i - 1] = tmp
i += 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
99a8a900-efcf-4a9e-86ba-fdd0df4312d3
| 2,016 |
27,492 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - 1 - i)
i += 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
8d8fa15f-3f0d-4a69-849b-9b7da96123cd
| 2,016 |
36,316 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
return a
def selection_sort(a):
i = 0
while i < len(a):
j = i + 1
p = i
while j < len(a):
if a[j] < a[p]:
p = j
j += 1
swap(a, i, p)
i += 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
ba8a7560-aac9-45ef-b6fd-730b60e73e8c
| 2,016 |
15,448 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - 1 - i)
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
f6343d5f-9ee0-441c-a67c-781ee180947e
| 2,016 |
16,134 |
def reverse(a):
i = 0
while i < len(a) / 2:
tmp = a[i]
a[i] = a[len(a) - i - 1]
a[len(a) - i - 1] = tmp
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
75a32f49-710d-463f-8fee-0ae9b91a3034
| 2,016 |
18,235 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i = i + 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
a2b86688-0a82-4779-8335-a584906257b0
| 2,016 |
10,776 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
2eb2f93d-3491-4b0b-bad9-894c90595058
| 2,016 |
656 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
2eb2f93d-3491-4b0b-bad9-894c90595058
| 2,016 |
5,463 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
b0c92748-3b02-4340-a9d8-2ebe9a693531
| 2,016 |
10,707 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
b0c92748-3b02-4340-a9d8-2ebe9a693531
| 2,016 |
33,482 |
def selection_sort(a):
i = 0
while i < len(a):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
tmp = a[p]
a[p] = a[i]
a[i] = tmp
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
45fe5d71-35bd-4b87-b28c-71b204939543
| 2,016 |
19,451 |
def swap(a, x, y):
tmp = a[x]
a[x] = a[y]
a[y] = tmp
return a
def selection_sort(a):
k = 0
while k < len(a):
j = k + 1
p = k
tmp = 0
while j < len(a):
if a[j] < a[p]:
p = j
j += 1
swap(a, k, p)
k += 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
2c7a8a81-53ed-42cc-bd4e-e268d1d767be
| 2,016 |
33,860 |
def swap(a, x, y):
tmp = a[x]
a[x] = a[y]
a[y] = tmp
return a
def selection_sort(a):
k = 0
while k < len(a):
j = k + 1
p = k
tmp = 0
while j < len(a):
if a[j] < a[p]:
p = j
j += 1
swap(a, k, p)
k += 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
2c7a8a81-53ed-42cc-bd4e-e268d1d767be
| 2,016 |
7,085 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
i = 0
j = len(a) - 1
while i < len(a) / 2:
swap(a, i, j)
i = i + 1
j = j - 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
7b8e2d7b-1f3a-4e34-b02c-e6ac46baa465
| 2,016 |
23,953 |
def swap(a, i, j):
tmp = a[j]
a[j] = a[i]
a[i] = tmp
def reverse(a):
i = 0
j = len(a) - 1
while i < len(a) / 2:
swap(a, i, j)
i += 1
j -= 1
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| false |
05f63619-1095-4d15-8436-1f0832a593bc
| 2,016 |
36,224 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def selection_sort(a):
i = 0
while i < len(a):
j = i + 1
p = i
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
swap(a, i, p)
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
f0b2f578-ae0f-4ddc-94e9-204708d09f37
| 2,016 |
33,526 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def selection_sort(a):
i = 0
while i < len(a):
j = i + 1
p = i
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
swap(a, i, p)
i = i + 1
return a
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| true |
f0b2f578-ae0f-4ddc-94e9-204708d09f37
| 2,016 |
32,966 |
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
return a
def reverse(a):
i = 0
while i < len(a) / 2:
swap(a, i, len(a) - i - 1)
i = i + 1
return a
|
reverse_by_swap
|
reverse
|
Reverse a list of elements by swapping its elements.
|
assert reverse([])==[] and reverse([0])==[0] and reverse([-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052])==[1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103] and reverse([-103, 113466788817036974729578468346735566318, 31758, 1867157052, 10933, -70, 1867157052])==[1867157052, -70, 10933, 1867157052, 31758, 113466788817036974729578468346735566318, -103] and reverse([1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103])==[-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052] and reverse([1867157052, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, -103])==[-103, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, 1867157052] and reverse([-103, 113466788817036974729578468346735566318, 31758, -70, 10933, 1867157052, 1867157052])==[1867157052, 1867157052, 10933, -70, 31758, 113466788817036974729578468346735566318, -103] and reverse([[1]])==[[1]]
| true |
3e9f1e04-e9fd-4164-8fa5-c7feb1dcc1f5
| 2,016 |
7,021 |
def find_smallest_position(a, i):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
return p
def selection_sort(a):
i = 0
while i < len(a):
p = find_smallest_position(a, i)
swap(a, i, p)
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
fa2c47e6-9c25-4040-9985-e5ab62711be6
| 2,016 |
9,756 |
def find_smallest_position(a, i):
p = i
j = i + 1
while j < len(a):
if a[j] < a[p]:
p = j
j = j + 1
return p
def selection_sort(a):
i = 0
while i < len(a):
p = find_smallest_position(a, i)
swap(a, i, p)
i = i + 1
|
selection_sort
|
selection_sort
|
Sort a list by repeatedly move minimimum of remaining sublist to front.
|
assert selection_sort([])==[] and selection_sort([0])==[0] and selection_sort([25204, -1, -18176])==[-18176, -1, 25204] and selection_sort([-18176, -1, 25204])==[-18176, -1, 25204]
| false |
fa2c47e6-9c25-4040-9985-e5ab62711be6
| 2,016 |
30,264 |
def circumference(r):
y = 3.141 * 2 * r
return y
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true |
6ae36e81-5a79-4a87-a484-a86635591a14
| 2,016 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.