<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _pycurl_post(self, url, json=None, data=None, username="", password="", headers={}, timeout=30):
 """This function will POST to the url endpoint using pycurl. returning an AdyenResult object on 200 HTTP responce. Either json or data has to be provided. If username and password are provided, basic auth will be used. Args: url (str):
 url to send the POST json (dict, optional):
 Dict of the JSON to POST data (dict, optional):
 Dict, presumed flat structure of key/value of request to place username (str, optional):
 Username for basic auth. Must be included as part of password. password (str, optional):
 Password for basic auth. Must be included as part of username. headers (dict, optional):
 Key/Value pairs of headers to include timeout (int, optional):
 Default 30. Timeout for the request. Returns: str: Raw response received str: Raw request placed int: HTTP status code, eg 200,404,401 dict: Key/Value pairs of the headers received. """


        response_headers = {}

        curl = pycurl.Curl()
        curl.setopt(curl.URL, url)
        if sys.version_info[0] >= 3:
            stringbuffer = BytesIO()
        else:
            stringbuffer = StringIO()

        curl.setopt(curl.WRITEDATA, stringbuffer)

        # Add User-Agent header to request so that the
        # request can be identified as coming from the Adyen Python library.
        headers['User-Agent'] = self.user_agent

        # Convert the header dict to formatted array as pycurl needs.
        if sys.version_info[0] >= 3:
            header_list = ["%s:%s" % (k, v) for k, v in headers.items()]
        else:
            header_list = ["%s:%s" % (k, v) for k, v in headers.iteritems()]
        # Ensure proper content-type when adding headers
        if json:
            header_list.append("Content-Type:application/json")

        curl.setopt(pycurl.HTTPHEADER, header_list)

        # Return regular dict instead of JSON encoded dict for request:
        raw_store = json

        # Set the request body.
        raw_request = json_lib.dumps(json) if json else urlencode(data)
        curl.setopt(curl.POSTFIELDS, raw_request)

        if username and password:
            curl.setopt(curl.USERPWD, '%s:%s' % (username, password))

        curl.setopt(curl.TIMEOUT, timeout)
        curl.perform()

        # Grab the response content
        result = stringbuffer.getvalue()
        status_code = curl.getinfo(curl.RESPONSE_CODE)

        curl.close()

        # Return regular dict instead of JSON encoded dict for request:
        raw_request = raw_store

        return result, raw_request, status_code, response_headers