<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def getVariables(self, sourceCountry, optionalCountryDataset=None, searchText=None):
 r""" The GeoEnrichment GetVariables helper method allows you to search the data collections for variables that contain specific keywords. To see the comprehensive set of global Esri Demographics data that are available, use the interactive data browser: http://resources.arcgis.com/en/help/arcgis-rest-api/02r3/02r300000266000000.htm#GUID-2D66F7F8-83A9-4EAA-B5E2-F09D629939CE Inputs: sourceCountry - specify the source country for the search. Use this parameter to limit the search and query of standard geographic features to one country. This parameter supports both the two-digit and three-digit country codes illustrated in the coverage table. Examples Example 1 - Set source country to the United States: sourceCountry=US Example 2 - Set source country to the Canada: sourceCountry=CA Additional notes Currently, the service is available for Canada, the United States and a number of European countries. Other countries will be added in the near future. The list of available countries and their associated IDS are listed in the coverage section. optionalCountryDataset - Optional parameter to specify a specific dataset within a defined country. This parameter will not be used in the Beta release. In the future, some countries may have two or more datasets that may have different vintages and standard geography areas. For example, in the United States, there may be an optional dataset with historic census data from previous years. Examples optionalCountryDataset=USA_ESRI_2013 Additional notes Most countries only have a single dataset. The United States has multiple datasets. searchText - Optional parameter to specify the text to query and search the data collections for the country and datasets specified. You can use this parameter to query and find specific keywords that are contained in a data collection. Default value (null or empty) Examples Example 1 - Return all the data collections and variabels that contain the word furniture: searchText=furniture Search terms A query is broken up into terms and operators. There are two types of terms: Single Terms and Phrases. A Single Term is a single word such as "Income" or "Households". A Phrase is a group of words surrounded by double quotes such as "Household Income". Multiple terms can be combined together with Boolean operators to form a more complex query (see below). Fields Geography search supports fielded data. When performing a search, you can either specify a field or use search through all fields. You can search any field by typing the field name followed by a colon ":" then the term you are looking for. For example, to search for "Income" in the Alias field: Alias:Income The search supports single and multiple character wildcard searches within single terms (not within phrase queries). To perform a single character wildcard search, use the "?" symbol. To perform a multiple character wildcard search, use the "*" symbol. The single character wildcard search looks for terms that match that with the single character replaced. For example, to search for "San" or "Sen" you can use the search: Fuzzy searches Fuzzy searches are based on the Levenshtein Distance or Edit Distance algorithm. To perform a fuzzy search, you can explicitly set a fuzzy search by using the tilde symbol "~" at the end of a Single Term. For example, a term similar in spelling to "Hous" uses the fuzzy search: Hous~ An additional (optional) numeric parameter can be specified after the tilde symbol ("~") to set the similarity tolerance. The value is between 0 and 1; with a value closer to 1, only terms with a higher similarity will be matched. For example, if you only want to match terms with a similarity of 0.0 or higher, you can set the fuzzy search as follows: hous~0.8 The default that is used if the optional similarity number is not provided is 0.5. Boolean operators Boolean operators allow terms to be combined through logic operators. The search supports AND, "+", OR, NOT and "-" as Boolean operators. Boolean operators must be ALL CAPS. In searchText , the AND operator is the default conjunction operator. This means that if there is no Boolean operator between two or more terms, the AND operator is used. The AND operator matches items where both terms exist anywhere in the list of standard geography features. The symbol "&" can be used in place of the word AND. The OR operator links two terms and finds a matching variable if either of the terms exist. This is equivalent to a union with using sets. The symbol "||" can be used in place of the word OR. To search for features that contain either "Income" or "Wealth" use the following query: Income OR Wealth The "+" or required operator requires that the term after the "+" symbol exist somewhere in the attributes of a variable. To search for features that must contain "Income" and may contain "Household" use the following query: +Income OR Household Escaping Special Characters Search supports escaping special characters that are part of the query syntax. The available special characters are as follows: + - && || ! ( ) { } [ ] ^ " ~ * ? : \ To escape these characters, use the \ before the character. """

        url = self._base_url + self._url_getVariables
        params = {
            "f" : "json",
            "sourceCountry" : sourceCountry
        }
        if not searchText is None:
            params["searchText"] = searchText
        if not optionalCountryDataset is None:
            params['optionalCountryDataset'] = optionalCountryDataset
        return self._post(url=url,
                             param_dict=params,
                             securityHandler=self._securityHandler,
                             proxy_url=self._proxy_url,
                             proxy_port=self._proxy_port)