<commit_before><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Curl Objects</title>

  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
</head>
  <body>

<h2>Curl Objects<br>
</h2>
<p>
Curl objects have the following methods:
</p>
 <b>close()</b><b> </b>-&gt; <i>None</i>
<blockquote> Corresponds to <b>curl_easy_cleanup</b> in libcurl. &nbsp;This
method is automatically called by pycurl when a Curl object no longer has
any references to it, but can also be called explicitly.<br>
</blockquote>
 <b>perform()</b> -&gt; <i>None</i>
<blockquote>Corresponds to <b>curl_easy_perform</b> in libcurl.<br>
</blockquote>
 <b>setopt(</b><i>option, value</i><b>)</b> -&gt; <i>None</i>
<blockquote> Corresponds to <b>curl_easy_setopt</b> in libcurl, where <i>option</i>
is specified with the CURLOPT_* constants in libcurl, except that the CURLOPT_
prefix has been removed. The type for <i>value</i> depends on the option,
and can be either a string, integer, file objects, lists, &nbsp;or functions.<br>
  <br>
 Example usage:
<pre>
import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, 'http://www.python.org/')
c.setopt(pycurl.HTTPHEADER, ['User-Agent: PycURL test', 'Accept:'])
import StringIO
b = StringIO.StringIO()
c.setopt(pycurl.WRITEFUNCTION, b.write)
c.setopt(pycurl.FOLLOWLOCATION, 1)
c.setopt(pycurl.MAXREDIRS, 5)
c.perform()
print b.getvalue()
...
</pre>
</blockquote>
  <b>getinfo(</b><i>option</i><b>) </b>-&gt; <i>Result</i>
<blockquote> Corresponds to <b>curl_easy_getinfo</b> in libcurl, where <i>option</i>
is the same as the CURLINFO_* constants in libcurl, except that the CURLINFO_
prefix has been removed. &nbsp; <i>Result </i>contains an integer, string
of float depending on which option is given. &nbsp;The <b>getinfo</b> method
should not be called unless <b>perform</b> has been called and finished.<br>
  <br>
 Example usage: <br>
  <pre>
import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, 'file:///dev/null')
c.perform()<commit_msg>formatting error<commit_after><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <title>Curl Objects</title>

  <meta http-equiv="content-type"
 content="text/html; charset=ISO-8859-1">
</head>
  <body>

<h2>Curl Objects<br>
</h2>
<p>
Curl objects have the following methods:
</p>
 <b>close()</b><b> </b>-&gt; <i>None</i>
<blockquote> Corresponds to <b>curl_easy_cleanup</b> in libcurl. &nbsp;This
method is automatically called by pycurl when a Curl object no longer has
any references to it, but can also be called explicitly.<br>
</blockquote>
 <b>perform()</b> -&gt; <i>None</i>
<blockquote>Corresponds to <b>curl_easy_perform</b> in libcurl.<br>
</blockquote>
 <b>setopt(</b><i>option, value</i><b>)</b> -&gt; <i>None</i>
<blockquote> Corresponds to <b>curl_easy_setopt</b> in libcurl, where <i>option</i>
is specified with the CURLOPT_* constants in libcurl, except that the CURLOPT_
prefix has been removed. The type for <i>value</i> depends on the option,
and can be either a string, integer, file objects, lists, &nbsp;or functions.<br>
  <br>
 Example usage:
<pre>import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, 'http://www.python.org/')
c.setopt(pycurl.HTTPHEADER, ['User-Agent: PycURL test', 'Accept:'])
import StringIO
b = StringIO.StringIO()
c.setopt(pycurl.WRITEFUNCTION, b.write)
c.setopt(pycurl.FOLLOWLOCATION, 1)
c.setopt(pycurl.MAXREDIRS, 5)
c.perform()
print b.getvalue()
...
</pre>
</blockquote>
  <b>getinfo(</b><i>option</i><b>) </b>-&gt; <i>Result</i>
<blockquote> Corresponds to <b>curl_easy_getinfo</b> in libcurl, where <i>option</i>
is the same as the CURLINFO_* constants in libcurl, except that the CURLINFO_
prefix has been removed. &nbsp; <i>Result </i>contains an integer, string
of float depending on which option is given. &nbsp;The <b>getinfo</b> method
should not be called unless <b>perform</b> has been called and finished.<br>
  <br>
 Example usage: <br>
  <pre>import pycurl
c = pycurl.Curl()
c.setopt(pycurl.URL, 'file:///dev/null')
c.perform()
{'fraction_non_alphanumeric': 0.16984402079722705, 'fraction_numerical': 0.006437236939836593, 'mean_word_length': 5.121212121212121, 'pattern_counts': {'":': 0, '<': 155, '<?xml version=': 0, '>': 155, 'https://': 0, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5688485', 'n_tokens_mistral': 1595, 'n_tokens_neox': 1482, 'n_words': 432}