pep8speaks: Hello @thomasyu888! Thanks for opening this PR. We checked the lines you've touched for [PEP 8](https://www.python.org/dev/peps/pep-0008) issues, and found:



* In the file [`tests/test_utils.py`](https://github.com/Sage-Bionetworks/challengeutils/blob/58954c066ba8a7254b585388dbb656d10f3e9d20/tests/test_utils.py):

> [Line 281:9](https://github.com/Sage-Bionetworks/challengeutils/blob/58954c066ba8a7254b585388dbb656d10f3e9d20/tests/test_utils.py#L281): [E221](https://duckduckgo.com/?q=pep8%20E221) multiple spaces before operator


diff --git a/challengeutils/utils.py b/challengeutils/utils.py
index 984eae1..33e3d6c 100644
--- a/challengeutils/utils.py
+++ b/challengeutils/utils.py
@@ -11,6 +11,7 @@ import synapseclient
 from synapseclient.annotations import (is_submission_status_annotations,
                                        to_submission_status_annotations)
 from synapseclient.core.exceptions import SynapseHTTPError
+from synapseclient.core.utils import id_of
 
 logging.basicConfig(level=logging.INFO)
 logger = logging.getLogger(__name__)
@@ -517,3 +518,16 @@ def delete_submission(syn, submissionid):
     """
     sub = syn.getSubmission(submissionid, downloadFile=False)
     syn.delete(sub)
+
+
+def remove_team_member(syn, team, user):
+    """Removes team member
+
+    Args:
+        syn: Synapse object
+        team: synaspeclient.Team or its id
+        user: synapseclient.UserProfile or its id
+    """
+    teamid = id_of(team)
+    userid = id_of(user)
+    syn.restDELETE(f"/team/{teamid}/member/{userid}")

removal of members from a Team
diff --git a/tests/test_utils.py b/tests/test_utils.py
index 5979fb1..339b953 100644
--- a/tests/test_utils.py
+++ b/tests/test_utils.py
@@ -275,3 +275,14 @@ def test_delete_submission():
         challengeutils.utils.delete_submission(syn, "12345")
         patch_get.assert_called_once_with("12345", downloadFile=False)
         patch_delete.assert_called_once_with(sub)
+
+
+def test_remove_team_member():
+    team = synapseclient.Team(id=123)
+    user = synapseclient.UserProfile(ownerId=2222)
+
+    with patch.object(syn, "restDELETE") as patch_rest:
+        challengeutils.utils.remove_team_member(syn, team, user)
+        patch_rest.assert_called_once_with(
+            "/team/123/member/2222"
+        )

pip install -e .[dev]
parse_log_pytest
requirements.txt
pytest
3.7
requirements.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
certifi @ file:///croot/certifi_1671487769961/work/certifi
cffi==1.15.1
-e git+https://github.com/Sage-Bionetworks/challengeutils.git@81b0e0f78ffe9c96106dbcc6d3e49ae0c2dcc3f2#egg=challengeutils
charset-normalizer==3.4.1
cryptography==44.0.2
Deprecated==1.2.4
entrypoints==0.4
exceptiongroup==1.2.2
idna==3.10
importlib-metadata==6.7.0
iniconfig==2.0.0
keyring==12.0.2
keyrings.alt==3.1
numpy==1.21.6
packaging==24.0
pandas==1.0.1
pluggy==1.2.0
pycparser==2.21
pytest==7.4.4
python-dateutil==2.9.0.post0
pytz==2025.2
requests==2.31.0
SecretStorage==2.3.1
six==1.17.0
synapseclient==2.1.0
tomli==2.0.1
typing_extensions==4.7.1
urllib3==2.0.7
wrapt==1.16.0
zipp==3.15.0

name: challengeutils
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2022.12.7=py37h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.4.4=h6a678d5_1
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=22.3.1=py37h06a4308_0
  - python=3.7.16=h7a1cb2a_0
  - readline=8.2=h5eee18b_0
  - setuptools=65.6.3=py37h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.38.4=py37h06a4308_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - cffi==1.15.1
      - charset-normalizer==3.4.1
      - cryptography==44.0.2
      - deprecated==1.2.4
      - entrypoints==0.4
      - exceptiongroup==1.2.2
      - idna==3.10
      - importlib-metadata==6.7.0
      - iniconfig==2.0.0
      - keyring==12.0.2
      - keyrings-alt==3.1
      - numpy==1.21.6
      - packaging==24.0
      - pandas==1.0.1
      - pluggy==1.2.0
      - pycparser==2.21
      - pytest==7.4.4
      - python-dateutil==2.9.0.post0
      - pytz==2025.2
      - requests==2.31.0
      - secretstorage==2.3.1
      - six==1.17.0
      - synapseclient==2.1.0
      - tomli==2.0.1
      - typing-extensions==4.7.1
      - urllib3==2.0.7
      - wrapt==1.16.0
      - zipp==3.15.0
prefix: /opt/conda/envs/challengeutils

tests/test_utils.py::test_remove_team_member
tests/test_utils.py::test_raiseerror__switch_annotation_permission tests/test_utils.py::test_filter__switch_annotation_permission tests/test_utils.py::test_nooverlap__switch_annotation_permission tests/test_utils.py::test_append_update_single_submission_status tests/test_utils.py::test_update_update_single_submission_status tests/test_utils.py::test_substatus_update_single_submission_status tests/test_utils.py::test_topublic_update_single_submission_status tests/test_utils.py::test_valid__check_date_range tests/test_utils.py::test_invalid__check_date_range tests/test_utils.py::test__get_contributors tests/test_utils.py::test_get_contributors tests/test_utils.py::test_list_evaluations tests/test_utils.py::test_defaultloc_download_submission tests/test_utils.py::test_specifyloc_download_submission tests/test_utils.py::test_userid__get_submitter_name tests/test_utils.py::test_teamid__get_submitter_name tests/test_utils.py::test_delete_submission
challengeutils/utils.py
challengeutils/utils.py