prompt: You will be provided with a partial code base and an issue statement explaining a problem to resolve.
  <issue>
  WIP: JuliaRequirement: Add installation methods
  
  
  </issue>
  <code>
  [start of coalib/bears/requirements/JuliaRequirement.py]
  1 from coalib.bears.requirements.PackageRequirement import PackageRequirement
  2 
  3 
  4 class JuliaRequirement(PackageRequirement):
  5     """
  6     This class is a subclass of ``PackageRequirement``, and helps specifying
  7     requirements from ``julia``, without using the manager name.
  8     """
  9 
  10     def __init__(self, package, version=""):
  11         """
  12         Constructs a new ``JuliaRequirement``, using the ``PackageRequirement``
  13         constructor.
  14 
  15         >>> pr = JuliaRequirement('Lint', '19.2')
  16         >>> pr.manager
  17         'julia'
  18         >>> pr.package
  19         'Lint'
  20         >>> pr.version
  21         '19.2'
  22 
  23         :param package: A string with the name of the package to be installed.
  24         :param version: A version string. Leave empty to specify latest version.
  25         """
  26         PackageRequirement.__init__(self, 'julia', package, version)
  27
  [end of coalib/bears/requirements/JuliaRequirement.py]
  </code>
  
  I need you to solve this issue by generating a single patch file that I can apply directly to this repository using git apply. Please respond with a single patch file in the following format.
  <patch>
  diff --git a/file.py b/file.py
  --- a/file.py
  +++ b/file.py
  @@ -1,27 +1,35 @@
   def euclidean(a, b):
  -    while b:
  -        a, b = b, a % b
  -    return a
  +    if b == 0:
  +        return a
  +    return euclidean(b, a % b)
   
   
   def bresenham(x0, y0, x1, y1):
       points = []
       dx = abs(x1 - x0)
       dy = abs(y1 - y0)
  -    sx = 1 if x0 < x1 else -1
  -    sy = 1 if y0 < y1 else -1
  -    err = dx - dy
  +    x, y = x0, y0
  +    sx = -1 if x0 > x1 else 1
  +    sy = -1 if y0 > y1 else 1
   
  -    while True:
  -        points.append((x0, y0))
  -        if x0 == x1 and y0 == y1:
  -            break
  -        e2 = 2 * err
  -        if e2 > -dy:
  -            err -= dy
  -            x0 += sx
  -        if e2 < dx:
  -            err += dx
  -            y0 += sy
  +    if dx > dy:
  +        err = dx / 2.0
  +        while x != x1:
  +            points.append((x, y))
  +            err -= dy
  +            if err < 0:
  +                y += sy
  +                err += dx
  +            x += sx
  +    else:
  +        err = dy / 2.0
  +        while y != y1:
  +            points.append((x, y))
  +            err -= dx
  +            if err < 0:
  +                x += sx
  +                err += dy
  +            y += sy
  +
  +    points.append((x, y))
       return points
  
  </patch>
golden_diff: diff --git a/coalib/bears/requirements/JuliaRequirement.py b/coalib/bears/requirements/JuliaRequirement.py
  --- a/coalib/bears/requirements/JuliaRequirement.py
  +++ b/coalib/bears/requirements/JuliaRequirement.py
  @@ -1,4 +1,9 @@
  +import shlex
  +
   from coalib.bears.requirements.PackageRequirement import PackageRequirement
  +from coalib.misc.Shell import call_without_output
  +
  +from coala_utils.string_processing import escape
   
   
   class JuliaRequirement(PackageRequirement):
  @@ -24,3 +29,31 @@
           :param version: A version string. Leave empty to specify latest version.
           """
           PackageRequirement.__init__(self, 'julia', package, version)
  +
  +    def install_command(self):
  +        """
  +        Creates the installation command for the instance of the class.
  +
  +        >>> JuliaRequirement('Lint').install_command()
  +        'julia -e \\'Pkg.add("Lint")\\''
  +
  +        :return: A string with the installation command.
  +        """
  +        code = 'Pkg.add("{}")'.format(escape(self.package, '\\"'))
  +        args = ('julia', '-e', shlex.quote(code))
  +        return ' '.join(args)
  +
  +    def is_installed(self):
  +        """
  +        Checks if the dependency is installed.
  +
  +        :return: ``True`` if dependency is installed, ``False`` otherwise.
  +        """
  +        # We need to check explicitly if `nothing` is returned, as this happens
  +        # when the package is *registered*, but *not installed*. If it's not
  +        # even registered, julia will throw an exception which lets julia exit
  +        # with an error code different from 0.
  +        code = 'Pkg.installed("{}")==nothing?exit(1):exit(0)'.format(
  +            escape(self.package, '\\"'))
  +        args = ('julia', '-e', code)
  +        return not call_without_output(args)
  
verification_info: {"golden_diff": "diff --git a/coalib/bears/requirements/JuliaRequirement.py b/coalib/bears/requirements/JuliaRequirement.py\n--- a/coalib/bears/requirements/JuliaRequirement.py\n+++ b/coalib/bears/requirements/JuliaRequirement.py\n@@ -1,4 +1,9 @@\n+import shlex\n+\n from coalib.bears.requirements.PackageRequirement import PackageRequirement\n+from coalib.misc.Shell import call_without_output\n+\n+from coala_utils.string_processing import escape\n \n \n class JuliaRequirement(PackageRequirement):\n@@ -24,3 +29,31 @@\n         :param version: A version string. Leave empty to specify latest version.\n         \"\"\"\n         PackageRequirement.__init__(self, 'julia', package, version)\n+\n+    def install_command(self):\n+        \"\"\"\n+        Creates the installation command for the instance of the class.\n+\n+        >>> JuliaRequirement('Lint').install_command()\n+        'julia -e \\\\'Pkg.add(\"Lint\")\\\\''\n+\n+        :return: A string with the installation command.\n+        \"\"\"\n+        code = 'Pkg.add(\"{}\")'.format(escape(self.package, '\\\\\"'))\n+        args = ('julia', '-e', shlex.quote(code))\n+        return ' '.join(args)\n+\n+    def is_installed(self):\n+        \"\"\"\n+        Checks if the dependency is installed.\n+\n+        :return: ``True`` if dependency is installed, ``False`` otherwise.\n+        \"\"\"\n+        # We need to check explicitly if `nothing` is returned, as this happens\n+        # when the package is *registered*, but *not installed*. If it's not\n+        # even registered, julia will throw an exception which lets julia exit\n+        # with an error code different from 0.\n+        code = 'Pkg.installed(\"{}\")==nothing?exit(1):exit(0)'.format(\n+            escape(self.package, '\\\\\"'))\n+        args = ('julia', '-e', code)\n+        return not call_without_output(args)\n", "issue": "WIP: JuliaRequirement: Add installation methods\n\n", "before_files": [{"content": "from coalib.bears.requirements.PackageRequirement import PackageRequirement\n\n\nclass JuliaRequirement(PackageRequirement):\n    \"\"\"\n    This class is a subclass of ``PackageRequirement``, and helps specifying\n    requirements from ``julia``, without using the manager name.\n    \"\"\"\n\n    def __init__(self, package, version=\"\"):\n        \"\"\"\n        Constructs a new ``JuliaRequirement``, using the ``PackageRequirement``\n        constructor.\n\n        >>> pr = JuliaRequirement('Lint', '19.2')\n        >>> pr.manager\n        'julia'\n        >>> pr.package\n        'Lint'\n        >>> pr.version\n        '19.2'\n\n        :param package: A string with the name of the package to be installed.\n        :param version: A version string. Leave empty to specify latest version.\n        \"\"\"\n        PackageRequirement.__init__(self, 'julia', package, version)\n", "path": "coalib/bears/requirements/JuliaRequirement.py"}]}