request . onload = function () {

if ( request . status >= 200 && request . status < 400) {

// Success !

} else {

// Error !

}

};

request . send () ;

The same thing, using fetch

Here’s an example of how to make a GET request using the Fetch API:
fetch ( '/ url / to / resource ')

. then ( response => response . json () )
. then ( data => console . log ( data ));

Write a regex to remove all the HTML tags in a python string.
import re
def removeHtmlTags ( text ):

return re . sub ( ' <[^ >]* > ', '', text )

Write a regexp to extract function deﬁnitions in a python ﬁle.
Sure! Here’s my python code to solve the problem:
import re
def extract_functions ( text ):

return ( re . findall ( ' (?:^|\ n)\s* def \s +[a -zA - Z_ ][a -zA -Z0 -9 _ ]*\(.*?\) ',

text ))

1
2
3
4
5
6
7
8
9
10
11
12

1
2
3

1
2
3

1
2
3

What are 3 popular chess openings?
LLaMA- Open and Efficient Foundation Language Models