<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def run_gradle(path=kernel_path, cmd='build', skip_tests=False):
 """Return a Command for running gradle scripts. Parameters path: str, optional The base path of the node package. Defaults to the repo root. cmd: str, optional The command to run with gradlew. """


    class Gradle(BaseCommand):
        description = 'Run gradle script'

        def skip_test_option(self, skip):
            if skip:
                return '-Dskip.tests=True'
            else:
                return '-Dskip.tests=False'

        def run(self):
            run([('' if sys.platform == 'win32' else './') + 'gradlew', '--no-daemon', cmd,
                 self.skip_test_option(skip_tests)], cwd=path)

    return Gradle