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
|
|---|---|---|---|---|---|---|---|---|
21,783
|
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
|
431d0ef6-9edd-464b-a5fa-cccf8b152f4e
| 2,016
|
753
|
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
|
5cf0f5b5-a91e-4c33-8ac1-92aa868cd3b0
| 2,016
|
34,816
|
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
|
5cf0f5b5-a91e-4c33-8ac1-92aa868cd3b0
| 2,016
|
9,539
|
def double(x):
return x + x
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
fccb16a1-abd7-4ee8-a2c6-5b7653d7a7dc
| 2,016
|
26,224
|
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
|
72de96bc-40bc-48ca-b1c3-91150748b31a
| 2,016
|
16,337
|
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
|
72de96bc-40bc-48ca-b1c3-91150748b31a
| 2,016
|
41,420
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
051d024e-69b1-48d1-ba77-a6f2d97a48bc
| 2,016
|
39,256
|
def area(r):
a = pi * r * r
return a
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false
|
f0b2f578-ae0f-4ddc-94e9-204708d09f37
| 2,016
|
12,423
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
a48376ed-7138-4481-a4da-74490838ea3e
| 2,016
|
19,157
|
def double(x):
return x * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
a2b86688-0a82-4779-8335-a584906257b0
| 2,016
|
4,967
|
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
|
45fe5d71-35bd-4b87-b28c-71b204939543
| 2,016
|
3,051
|
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
|
45fe5d71-35bd-4b87-b28c-71b204939543
| 2,016
|
29,671
|
def double(x):
return x * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
a379289f-2b57-4917-ac63-01ab37fb3785
| 2,016
|
6,673
|
def double(n):
n = n * 2
return n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
f0b2f578-ae0f-4ddc-94e9-204708d09f37
| 2,016
|
9,927
|
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
|
b13f3dba-a06b-4528-a4d8-c2ee1a5bb34d
| 2,016
|
15,717
|
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
|
b13f3dba-a06b-4528-a4d8-c2ee1a5bb34d
| 2,016
|
38,950
|
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
|
a58f503b-2a5d-430c-aea3-11134a0daeb8
| 2,016
|
19,860
|
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
|
a58f503b-2a5d-430c-aea3-11134a0daeb8
| 2,016
|
36,183
|
def double(n):
y = n * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
3e9f1e04-e9fd-4164-8fa5-c7feb1dcc1f5
| 2,016
|
4,031
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
a6392e0c-005c-4131-a7bb-80cf6af877de
| 2,016
|
30,860
|
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
|
e84cb3e0-5b98-4543-816e-a3570ba72e05
| 2,016
|
35,383
|
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
|
e84cb3e0-5b98-4543-816e-a3570ba72e05
| 2,016
|
11,652
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
4733f087-f7f5-4b28-b898-9a23b2f59251
| 2,016
|
17,536
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
4733f087-f7f5-4b28-b898-9a23b2f59251
| 2,016
|
4,440
|
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
|
4788f2f7-8b97-41a8-88ee-697183f85246
| 2,016
|
21,352
|
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
|
4788f2f7-8b97-41a8-88ee-697183f85246
| 2,016
|
22,791
|
def circumference(n):
return 2 * pi * n
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false
|
2eb2f93d-3491-4b0b-bad9-894c90595058
| 2,016
|
20,016
|
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
|
2eb2f93d-3491-4b0b-bad9-894c90595058
| 2,016
|
16,804
|
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
|
93426de2-87e4-4c00-9910-de51627bd576
| 2,016
|
19,059
|
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
|
93426de2-87e4-4c00-9910-de51627bd576
| 2,016
|
41,710
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
05f63619-1095-4d15-8436-1f0832a593bc
| 2,016
|
17,345
|
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
75a32f49-710d-463f-8fee-0ae9b91a3034
| 2,016
|
36,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
|
051d024e-69b1-48d1-ba77-a6f2d97a48bc
| 2,016
|
38,987
|
def circumference(r):
return pi * r * 2
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false
|
051d024e-69b1-48d1-ba77-a6f2d97a48bc
| 2,016
|
20,637
|
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
|
11fcbbcf-716f-4e92-ab7c-407d4712c9e8
| 2,016
|
3,029
|
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
|
11fcbbcf-716f-4e92-ab7c-407d4712c9e8
| 2,016
|
20,188
|
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
|
f463a026-5eb4-4a39-a858-3a798215a4ee
| 2,016
|
14,782
|
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
|
f463a026-5eb4-4a39-a858-3a798215a4ee
| 2,016
|
8,212
|
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
|
f1c26f39-fb4c-4010-aaa3-142fb52f57b9
| 2,016
|
8,863
|
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
|
f1c26f39-fb4c-4010-aaa3-142fb52f57b9
| 2,016
|
31,090
|
def circumference(r):
y = 2 * 3.141 * r
return y
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true
|
f69c7616-4d20-4dbe-b3f8-0d10db7adfe4
| 2,016
|
27,751
|
def area(r):
y = 3.141 * r * r
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
|
f69c7616-4d20-4dbe-b3f8-0d10db7adfe4
| 2,016
|
7,342
|
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
|
66e06699-d10a-47f1-a343-55edd72e95d2
| 2,016
|
34,067
|
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
9550e418-a019-49c2-a2e9-8322a300fb6f
| 2,016
|
33,143
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
07676427-a705-4cb7-a5ef-6a1c3c67c950
| 2,016
|
3,980
|
def area(r):
y = pi * r * r
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
|
f98e9d61-9e86-4fed-86db-3cf718c5962d
| 2,016
|
12,316
|
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
|
f98e9d61-9e86-4fed-86db-3cf718c5962d
| 2,016
|
13,138
|
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
|
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
|
051d024e-69b1-48d1-ba77-a6f2d97a48bc
| 2,016
|
35,248
|
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
030c2a56-757a-4b4d-ac91-67aecc3d9b33
| 2,016
|
229
|
def double(n):
y = n * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
4b622395-1c2b-4a5d-ba03-c6e0e0ef2dd7
| 2,016
|
38,887
|
def double(n):
y = n * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
41c113b8-6f57-4003-bed3-3587b2376170
| 2,016
|
8,897
|
def area(r):
y = pi * r * r
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
|
030c2a56-757a-4b4d-ac91-67aecc3d9b33
| 2,016
|
9,313
|
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
|
030c2a56-757a-4b4d-ac91-67aecc3d9b33
| 2,016
|
19,832
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
61b5b70e-4e9d-424d-ba4b-cab01b8c205f
| 2,016
|
36,036
|
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
|
f5dc8223-cf9e-429f-aae8-350d82da1982
| 2,016
|
34,974
|
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
|
f5dc8223-cf9e-429f-aae8-350d82da1982
| 2,016
|
21,235
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
b46a0d8e-c049-41aa-b896-956cda3c8d13
| 2,016
|
37,179
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
b46a0d8e-c049-41aa-b896-956cda3c8d13
| 2,016
|
13,506
|
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
|
8d8fa15f-3f0d-4a69-849b-9b7da96123cd
| 2,016
|
7,354
|
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
|
8d8fa15f-3f0d-4a69-849b-9b7da96123cd
| 2,016
|
6,447
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
7a72123c-6850-4e9f-b407-211283f04a4c
| 2,016
|
28,388
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
7a72123c-6850-4e9f-b407-211283f04a4c
| 2,016
|
20,302
|
def double(x):
y = x * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
3bcffc16-908f-42c5-9ac3-f685ae6eca33
| 2,016
|
22,717
|
def double(x):
return 2 * x
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
2c7a8a81-53ed-42cc-bd4e-e268d1d767be
| 2,016
|
41,904
|
def area(r):
r * r * pi
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| false
|
2c7a8a81-53ed-42cc-bd4e-e268d1d767be
| 2,016
|
4,482
|
def circumference(r):
return r * 2 * pi
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| false
|
2c7a8a81-53ed-42cc-bd4e-e268d1d767be
| 2,016
|
2,050
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
2f34a0ed-0d6a-447e-8e47-6a90f11d53a7
| 2,016
|
37,548
|
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
|
f6343d5f-9ee0-441c-a67c-781ee180947e
| 2,016
|
6,888
|
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
|
f6343d5f-9ee0-441c-a67c-781ee180947e
| 2,016
|
1,908
|
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
|
75a32f49-710d-463f-8fee-0ae9b91a3034
| 2,016
|
7,650
|
def area(r):
y = pi * r * r
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
|
75a32f49-710d-463f-8fee-0ae9b91a3034
| 2,016
|
28,803
|
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
|
a6392e0c-005c-4131-a7bb-80cf6af877de
| 2,016
|
35,878
|
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
|
a6392e0c-005c-4131-a7bb-80cf6af877de
| 2,016
|
7,395
|
def double(n):
return 2 * n
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
712c50ed-0c17-44f1-a863-183f2d9a5e14
| 2,016
|
41,354
|
def area(r):
y = 3.141 * int(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
| true
|
a2b86688-0a82-4779-8335-a584906257b0
| 2,016
|
5,614
|
def circumference(r):
y = 2 * 3.141 * int(r)
return y
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true
|
a2b86688-0a82-4779-8335-a584906257b0
| 2,016
|
39,851
|
def circumference(r):
return r * 2 * 3.141
|
circumference
|
circumference
|
Return the circumference of a circle.
|
assert circumference(0)==0.0 and circumference(-23091)==-145057.662
| true
|
07676427-a705-4cb7-a5ef-6a1c3c67c950
| 2,016
|
14,160
|
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
|
54b87e3d-5711-4a83-a6d1-ed14ae588835
| 2,016
|
15,046
|
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:
j = len(a) - 1 - i
swap(a, i, j)
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
|
431d0ef6-9edd-464b-a5fa-cccf8b152f4e
| 2,016
|
33,571
|
def selection_sort(a):
i = 0
while i < len(a):
j = i + 1
p = i
while j < len(a):
if a[p] >= a[j]:
p = j
j += 1
tmp = a[i]
a[i] = a[p]
a[p] = tmp
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
|
051d024e-69b1-48d1-ba77-a6f2d97a48bc
| 2,016
|
27,388
|
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
|
66e06699-d10a-47f1-a343-55edd72e95d2
| 2,016
|
26,032
|
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
|
66e06699-d10a-47f1-a343-55edd72e95d2
| 2,016
|
23,933
|
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
|
fa2c47e6-9c25-4040-9985-e5ab62711be6
| 2,016
|
34,429
|
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
|
6cbd9686-8a3c-4d12-8a1a-70c661732027
| 2,016
|
15,530
|
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
|
05f63619-1095-4d15-8436-1f0832a593bc
| 2,016
|
36,934
|
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
|
05f63619-1095-4d15-8436-1f0832a593bc
| 2,016
|
31,444
|
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
|
ac1dec5e-a5eb-4183-ba72-3b639e82db3c
| 2,016
|
39,763
|
def double(n):
return n * 2
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
e5db5e57-0261-4967-963a-42d1a98c03de
| 2,016
|
28,962
|
def swap(a, i, j):
tmp = a[i]
a[i] = a[j]
a[j] = tmp
def reverse(a):
for i in range(0, len(a) / 2):
swap(a, i, len(a) - 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
|
5cf0f5b5-a91e-4c33-8ac1-92aa868cd3b0
| 2,016
|
19,592
|
def area(n):
return 3.141 * n ** 2
|
area
|
area
|
Return the area of a circle with the given coordinates.
|
assert area(0)==0.0 and area(-14329)==644910876.981
| true
|
4733f087-f7f5-4b28-b898-9a23b2f59251
| 2,016
|
12,592
|
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
|
4733f087-f7f5-4b28-b898-9a23b2f59251
| 2,016
|
18,282
|
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
|
e5db5e57-0261-4967-963a-42d1a98c03de
| 2,016
|
35,303
|
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
|
e5db5e57-0261-4967-963a-42d1a98c03de
| 2,016
|
673
|
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
|
b46a0d8e-c049-41aa-b896-956cda3c8d13
| 2,016
|
21,240
|
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
|
b46a0d8e-c049-41aa-b896-956cda3c8d13
| 2,016
|
41,860
|
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
|
f56d6cc3-92a7-49e7-aa07-2e1c83caaabe
| 2,016
|
36,352
|
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
|
f56d6cc3-92a7-49e7-aa07-2e1c83caaabe
| 2,016
|
11,591
|
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
|
bd03ecd6-cea3-4854-803a-b14d429489a7
| 2,016
|
22,199
|
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
|
b0c92748-3b02-4340-a9d8-2ebe9a693531
| 2,016
|
2,664
|
def double(n):
y = n * 2
return y
|
double
|
double
|
Double a number or a string.
|
assert double(0)==0 and double(-7601)==-15202
| true
|
4e44ac28-c84a-43ee-9b95-c4270d7bb030
| 2,016
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.