<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def create_relocate(cls, from_pattern, shade_pattern=None, shade_prefix=None):
 """Creates a rule which shades jar entries from one pattern to another. Examples: :: # Rename everything in the org.foobar.example package # to __shaded_by_pants__.org.foobar.example. shading_relocate('org.foobar.example.**') # Rename org.foobar.example.Main to __shaded_by_pants__.org.foobar.example.Main shading_relocate('org.foobar.example.Main') # Rename org.foobar.example.Main to org.foobar.example.NotMain shading_relocate('org.foobar.example.Main', 'org.foobar.example.NotMain') # Rename all 'Main' classes under any direct subpackage of org.foobar. shading_relocate('org.foobar.*.Main') # Rename org.foobar package to com.barfoo package shading_relocate('org.foobar.**', 'com.barfoo.@1') # Rename everything in org.foobar.example package to __hello__.org.foobar.example shading_relocate('org.foobar.example.**', shade_prefix='__hello__') :param string from_pattern: Any fully-qualified classname which matches this pattern will be shaded. '*' is a wildcard that matches any individual package component, and '**' is a wildcard that matches any trailing pattern (ie the rest of the string). :param string shade_pattern: The shaded pattern to use, where ``@1``, ``@2``, ``@3``, etc are references to the groups matched by wildcards (groups are numbered from left to right). If omitted, this pattern is inferred from the input pattern, prefixed by the ``shade_prefix`` (if provided). (Eg, a ``from_pattern`` of ``com.*.foo.bar.**`` implies a default ``shade_pattern`` of ``__shaded_by_pants__.com.@1.foo.@2``) :param string shade_prefix: Prefix to prepend when generating a ``shade_pattern`` (if a ``shade_pattern`` is not provided by the user). Defaults to '``__shaded_by_pants__.``'. """

    # NB(gmalmquist): Have have to check "is None" rather than using an or statement, because the
    # empty-string is a valid prefix which should not be replaced by the default prefix.
    shade_prefix = Shading.SHADE_PREFIX if shade_prefix is None else shade_prefix
    return RelocateRule.new(from_pattern, shade_pattern, shade_prefix)