<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def parse(v, country_code=None):
 """Try parse `v` to currencies; filter by country_code If `v` is a number, try `by_code_num()`; otherwise try: 1) if `v` is 3 character uppercase: `by_alpha3()` 2) Exact symbol match: `by_symbol()` 3) Exact country code match: `by_country()` 4) Fuzzy by symbol match heuristic: `by_symbol_match()` Parameters: v: Union[unicode, int] Either a iso4217 numeric code or some string country_code: Optional[unicode] Iso3166 alpha2 country code. Returns: List[Currency]: found Currency objects. """

    if isinstance(v, int):
        res = by_code_num(v)
        return [] if not res else [res]

    if not isinstance(v, (str, unicode)):
        raise ValueError('`v` of incorrect type {}. Only accepts str, bytes, unicode and int.')

    # check alpha3
    if re.match('^[A-Z]{3}$', v):
        res = by_alpha3(v)
        if res:
            return [res]

    # check by symbol
    res = by_symbol(v, country_code)
    if res:
        return res

    # check by country code
    res = by_country(v)
    if res:
        return res

    # more or less fuzzy match by symbol
    res = by_symbol_match(v, country_code)
    if res:
        return res