prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  random.shuffle's random= argument got deprecated
  Related issue: [bpo-40465](https://bugs.python.org/issue40465).
  ```
  black..................................................................../home/isidentical/.venv/lib/python3.10/site-packages/pre_commit/languages/helpers.py:95: DeprecationWarning: The *random* parameter to shuffle() has been deprecated
  since Python 3.9 and will be removed in a subsequent version.
    random.shuffle(seq, random=fixed_random.random)
  Passed
  ```
  
  
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `pre_commit/languages/helpers.py`
  Content:
  ```
  1 import multiprocessing
  2 import os
  3 import random
  4 from typing import Any
  5 from typing import List
  6 from typing import Optional
  7 from typing import overload
  8 from typing import Sequence
  9 from typing import Tuple
  10 from typing import TYPE_CHECKING
  11 
  12 import pre_commit.constants as C
  13 from pre_commit.hook import Hook
  14 from pre_commit.prefix import Prefix
  15 from pre_commit.util import cmd_output_b
  16 from pre_commit.xargs import xargs
  17 
  18 if TYPE_CHECKING:
  19     from typing import NoReturn
  20 
  21 FIXED_RANDOM_SEED = 1542676186
  22 
  23 
  24 def run_setup_cmd(prefix: Prefix, cmd: Tuple[str, ...]) -> None:
  25     cmd_output_b(*cmd, cwd=prefix.prefix_dir)
  26 
  27 
  28 @overload
  29 def environment_dir(d: None, language_version: str) -> None: ...
  30 @overload
  31 def environment_dir(d: str, language_version: str) -> str: ...
  32 
  33 
  34 def environment_dir(d: Optional[str], language_version: str) -> Optional[str]:
  35     if d is None:
  36         return None
  37     else:
  38         return f'{d}-{language_version}'
  39 
  40 
  41 def assert_version_default(binary: str, version: str) -> None:
  42     if version != C.DEFAULT:
  43         raise AssertionError(
  44             f'For now, pre-commit requires system-installed {binary}',
  45         )
  46 
  47 
  48 def assert_no_additional_deps(
  49         lang: str,
  50         additional_deps: Sequence[str],
  51 ) -> None:
  52     if additional_deps:
  53         raise AssertionError(
  54             f'For now, pre-commit does not support '
  55             f'additional_dependencies for {lang}',
  56         )
  57 
  58 
  59 def basic_get_default_version() -> str:
  60     return C.DEFAULT
  61 
  62 
  63 def basic_healthy(prefix: Prefix, language_version: str) -> bool:
  64     return True
  65 
  66 
  67 def no_install(
  68         prefix: Prefix,
  69         version: str,
  70         additional_dependencies: Sequence[str],
  71 ) -> 'NoReturn':
  72     raise AssertionError('This type is not installable')
  73 
  74 
  75 def target_concurrency(hook: Hook) -> int:
  76     if hook.require_serial or 'PRE_COMMIT_NO_CONCURRENCY' in os.environ:
  77         return 1
  78     else:
  79         # Travis appears to have a bunch of CPUs, but we can't use them all.
  80         if 'TRAVIS' in os.environ:
  81             return 2
  82         else:
  83             try:
  84                 return multiprocessing.cpu_count()
  85             except NotImplementedError:
  86                 return 1
  87 
  88 
  89 def _shuffled(seq: Sequence[str]) -> List[str]:
  90     """Deterministically shuffle"""
  91     fixed_random = random.Random()
  92     fixed_random.seed(FIXED_RANDOM_SEED, version=1)
  93 
  94     seq = list(seq)
  95     random.shuffle(seq, random=fixed_random.random)
  96     return seq
  97 
  98 
  99 def run_xargs(
  100         hook: Hook,
  101         cmd: Tuple[str, ...],
  102         file_args: Sequence[str],
  103         **kwargs: Any,
  104 ) -> Tuple[int, bytes]:
  105     # Shuffle the files so that they more evenly fill out the xargs partitions,
  106     # but do it deterministically in case a hook cares about ordering.
  107     file_args = _shuffled(file_args)
  108     kwargs['target_concurrency'] = target_concurrency(hook)
  109     return xargs(cmd, file_args, **kwargs)
  110
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/pre_commit/languages/helpers.py b/pre_commit/languages/helpers.py
  --- a/pre_commit/languages/helpers.py
  +++ b/pre_commit/languages/helpers.py
  @@ -18,7 +18,7 @@
   if TYPE_CHECKING:
       from typing import NoReturn
   
  -FIXED_RANDOM_SEED = 1542676186
  +FIXED_RANDOM_SEED = 1542676187
   
   
   def run_setup_cmd(prefix: Prefix, cmd: Tuple[str, ...]) -> None:
  @@ -92,7 +92,7 @@
       fixed_random.seed(FIXED_RANDOM_SEED, version=1)
   
       seq = list(seq)
  -    random.shuffle(seq, random=fixed_random.random)
  +    fixed_random.shuffle(seq)
       return seq
  
verification_info: {"golden_diff": "diff --git a/pre_commit/languages/helpers.py b/pre_commit/languages/helpers.py\n--- a/pre_commit/languages/helpers.py\n+++ b/pre_commit/languages/helpers.py\n@@ -18,7 +18,7 @@\n if TYPE_CHECKING:\n     from typing import NoReturn\n \n-FIXED_RANDOM_SEED = 1542676186\n+FIXED_RANDOM_SEED = 1542676187\n \n \n def run_setup_cmd(prefix: Prefix, cmd: Tuple[str, ...]) -> None:\n@@ -92,7 +92,7 @@\n     fixed_random.seed(FIXED_RANDOM_SEED, version=1)\n \n     seq = list(seq)\n-    random.shuffle(seq, random=fixed_random.random)\n+    fixed_random.shuffle(seq)\n     return seq\n", "issue": "random.shuffle's random= argument got deprecated\nRelated issue: [bpo-40465](https://bugs.python.org/issue40465).\r\n```\r\nblack..................................................................../home/isidentical/.venv/lib/python3.10/site-packages/pre_commit/languages/helpers.py:95: DeprecationWarning: The *random* parameter to shuffle() has been deprecated\r\nsince Python 3.9 and will be removed in a subsequent version.\r\n  random.shuffle(seq, random=fixed_random.random)\r\nPassed\r\n```\r\n\r\n\n", "before_files": [{"content": "import multiprocessing\nimport os\nimport random\nfrom typing import Any\nfrom typing import List\nfrom typing import Optional\nfrom typing import overload\nfrom typing import Sequence\nfrom typing import Tuple\nfrom typing import TYPE_CHECKING\n\nimport pre_commit.constants as C\nfrom pre_commit.hook import Hook\nfrom pre_commit.prefix import Prefix\nfrom pre_commit.util import cmd_output_b\nfrom pre_commit.xargs import xargs\n\nif TYPE_CHECKING:\n    from typing import NoReturn\n\nFIXED_RANDOM_SEED = 1542676186\n\n\ndef run_setup_cmd(prefix: Prefix, cmd: Tuple[str, ...]) -> None:\n    cmd_output_b(*cmd, cwd=prefix.prefix_dir)\n\n\n@overload\ndef environment_dir(d: None, language_version: str) -> None: ...\n@overload\ndef environment_dir(d: str, language_version: str) -> str: ...\n\n\ndef environment_dir(d: Optional[str], language_version: str) -> Optional[str]:\n    if d is None:\n        return None\n    else:\n        return f'{d}-{language_version}'\n\n\ndef assert_version_default(binary: str, version: str) -> None:\n    if version != C.DEFAULT:\n        raise AssertionError(\n            f'For now, pre-commit requires system-installed {binary}',\n        )\n\n\ndef assert_no_additional_deps(\n        lang: str,\n        additional_deps: Sequence[str],\n) -> None:\n    if additional_deps:\n        raise AssertionError(\n            f'For now, pre-commit does not support '\n            f'additional_dependencies for {lang}',\n        )\n\n\ndef basic_get_default_version() -> str:\n    return C.DEFAULT\n\n\ndef basic_healthy(prefix: Prefix, language_version: str) -> bool:\n    return True\n\n\ndef no_install(\n        prefix: Prefix,\n        version: str,\n        additional_dependencies: Sequence[str],\n) -> 'NoReturn':\n    raise AssertionError('This type is not installable')\n\n\ndef target_concurrency(hook: Hook) -> int:\n    if hook.require_serial or 'PRE_COMMIT_NO_CONCURRENCY' in os.environ:\n        return 1\n    else:\n        # Travis appears to have a bunch of CPUs, but we can't use them all.\n        if 'TRAVIS' in os.environ:\n            return 2\n        else:\n            try:\n                return multiprocessing.cpu_count()\n            except NotImplementedError:\n                return 1\n\n\ndef _shuffled(seq: Sequence[str]) -> List[str]:\n    \"\"\"Deterministically shuffle\"\"\"\n    fixed_random = random.Random()\n    fixed_random.seed(FIXED_RANDOM_SEED, version=1)\n\n    seq = list(seq)\n    random.shuffle(seq, random=fixed_random.random)\n    return seq\n\n\ndef run_xargs(\n        hook: Hook,\n        cmd: Tuple[str, ...],\n        file_args: Sequence[str],\n        **kwargs: Any,\n) -> Tuple[int, bytes]:\n    # Shuffle the files so that they more evenly fill out the xargs partitions,\n    # but do it deterministically in case a hook cares about ordering.\n    file_args = _shuffled(file_args)\n    kwargs['target_concurrency'] = target_concurrency(hook)\n    return xargs(cmd, file_args, **kwargs)\n", "path": "pre_commit/languages/helpers.py"}], "after_files": [{"content": "import multiprocessing\nimport os\nimport random\nfrom typing import Any\nfrom typing import List\nfrom typing import Optional\nfrom typing import overload\nfrom typing import Sequence\nfrom typing import Tuple\nfrom typing import TYPE_CHECKING\n\nimport pre_commit.constants as C\nfrom pre_commit.hook import Hook\nfrom pre_commit.prefix import Prefix\nfrom pre_commit.util import cmd_output_b\nfrom pre_commit.xargs import xargs\n\nif TYPE_CHECKING:\n    from typing import NoReturn\n\nFIXED_RANDOM_SEED = 1542676187\n\n\ndef run_setup_cmd(prefix: Prefix, cmd: Tuple[str, ...]) -> None:\n    cmd_output_b(*cmd, cwd=prefix.prefix_dir)\n\n\n@overload\ndef environment_dir(d: None, language_version: str) -> None: ...\n@overload\ndef environment_dir(d: str, language_version: str) -> str: ...\n\n\ndef environment_dir(d: Optional[str], language_version: str) -> Optional[str]:\n    if d is None:\n        return None\n    else:\n        return f'{d}-{language_version}'\n\n\ndef assert_version_default(binary: str, version: str) -> None:\n    if version != C.DEFAULT:\n        raise AssertionError(\n            f'For now, pre-commit requires system-installed {binary}',\n        )\n\n\ndef assert_no_additional_deps(\n        lang: str,\n        additional_deps: Sequence[str],\n) -> None:\n    if additional_deps:\n        raise AssertionError(\n            f'For now, pre-commit does not support '\n            f'additional_dependencies for {lang}',\n        )\n\n\ndef basic_get_default_version() -> str:\n    return C.DEFAULT\n\n\ndef basic_healthy(prefix: Prefix, language_version: str) -> bool:\n    return True\n\n\ndef no_install(\n        prefix: Prefix,\n        version: str,\n        additional_dependencies: Sequence[str],\n) -> 'NoReturn':\n    raise AssertionError('This type is not installable')\n\n\ndef target_concurrency(hook: Hook) -> int:\n    if hook.require_serial or 'PRE_COMMIT_NO_CONCURRENCY' in os.environ:\n        return 1\n    else:\n        # Travis appears to have a bunch of CPUs, but we can't use them all.\n        if 'TRAVIS' in os.environ:\n            return 2\n        else:\n            try:\n                return multiprocessing.cpu_count()\n            except NotImplementedError:\n                return 1\n\n\ndef _shuffled(seq: Sequence[str]) -> List[str]:\n    \"\"\"Deterministically shuffle\"\"\"\n    fixed_random = random.Random()\n    fixed_random.seed(FIXED_RANDOM_SEED, version=1)\n\n    seq = list(seq)\n    fixed_random.shuffle(seq)\n    return seq\n\n\ndef run_xargs(\n        hook: Hook,\n        cmd: Tuple[str, ...],\n        file_args: Sequence[str],\n        **kwargs: Any,\n) -> Tuple[int, bytes]:\n    # Shuffle the files so that they more evenly fill out the xargs partitions,\n    # but do it deterministically in case a hook cares about ordering.\n    file_args = _shuffled(file_args)\n    kwargs['target_concurrency'] = target_concurrency(hook)\n    return xargs(cmd, file_args, **kwargs)\n", "path": "pre_commit/languages/helpers.py"}]}