def request(<EOL>self, path, args=None, post_args=None, files=None, method=None<EOL>):
if args is None:<EOL><INDENT>args = dict()<EOL><DEDENT>if post_args is not None:<EOL><INDENT>method = "<STR_LIT:POST>"<EOL><DEDENT>if self.access_token:<EOL><INDENT>if post_args and "<STR_LIT>" not in post_args:<EOL><INDENT>post_args["<STR_LIT>"] = self.access_token<EOL><DEDENT>elif "<STR_LIT>" not in args:<EOL><INDENT>args["<STR_LIT>"] = self.access_token<EOL><DEDENT><DEDENT>try:<EOL><INDENT>response = self.session.request(<EOL>method or "<STR_LIT:GET>",<EOL>FACEBOOK_GRAPH_URL + path,<EOL>timeout=self.timeout,<EOL>params=args,<EOL>data=post_args,<EOL>proxies=self.proxies,<EOL>files=files,<EOL>)<EOL><DEDENT>except requests.HTTPError as e:<EOL><INDENT>response = json.loads(e.read())<EOL>raise GraphAPIError(response)<EOL><DEDENT>headers = response.headers<EOL>if "<STR_LIT>" in headers["<STR_LIT>"]:<EOL><INDENT>result = response.json()<EOL><DEDENT>elif "<STR_LIT>" in headers["<STR_LIT>"]:<EOL><INDENT>mimetype = headers["<STR_LIT>"]<EOL>result = {<EOL>"<STR_LIT:data>": response.content,<EOL>"<STR_LIT>": mimetype,<EOL>"<STR_LIT:url>": response.url,<EOL>}<EOL><DEDENT>elif "<STR_LIT>" in parse_qs(response.text):<EOL><INDENT>query_str = parse_qs(response.text)<EOL>if "<STR_LIT>" in query_str:<EOL><INDENT>result = {"<STR_LIT>": query_str["<STR_LIT>"][<NUM_LIT:0>]}<EOL>if "<STR_LIT>" in query_str:<EOL><INDENT>result["<STR_LIT>"] = query_str["<STR_LIT>"][<NUM_LIT:0>]<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise GraphAPIError(response.json())<EOL><DEDENT><DEDENT>else:<EOL><INDENT>raise GraphAPIError("<STR_LIT>")<EOL><DEDENT>if result and isinstance(result, dict) and result.get("<STR_LIT:error>"):<EOL><INDENT>raise GraphAPIError(result)<EOL><DEDENT>return result<EOL>
Fetches the given path in the Graph API.

        We translate args to a valid query string. If post_args is
        given, we send a POST request to the given path with the given
        arguments.