[docs]defcreate_project(project:str,owners:Union[str,List[str]],uploaders:List[str]=[],baseline:int=None,growth_rate:int=None,year:int=None,url:str=rest_url(),token:str=None,):"""Create a new project with the associated permissions. See Also: :py:func:`~gypsum_client.remove_operations.remove_project`, to remove the project. Example: .. code-block:: python createProject( "test-Py-create", owners="jkanche", uploaders=[{"id": "ArtifactDB-bot"}] ) Args: project: Project name. owners: List of GitHub users or organizations that are owners of this project. May also be a string containing the Github user or organization. uploaders: List of authorized uploaders for this project. Defaults to an empty list. Checkout :py:func:`~gypsum_client.fetch_assets.fetch_permissions` for more info. baseline: Baseline quote in bytes. growth_rate: Expected annual growth rate in bytes. year: Year of project creation. url: URL to the gypsum REST API. token: GitHub access token to authenticate with the gypsum REST API. The token must refer to a gypsum administrator account. """url=_remove_slash_url(url)uploaders=_sanitize_uploaders(uploaders)ifuploadersisnotNoneelse[]iftokenisNone:token=access_token()quota={}ifbaselineisnotNone:quota["baseline"]=baselineifgrowth_rateisnotNone:quota["growth_rate"]=growth_rateifyearisnotNone:quota["year"]=yearifisinstance(owners,str):owners=[owners]body={"permissions":{"owners":owners,"uploaders":uploaders}}iflen(quota)>0:body["quota"]=quotareq=requests.post(f"{url}/create/{quote_plus(project)}",json=body,headers={"Authorization":"Bearer "+token},verify=REQUESTS_MOD["verify"],)try:req.raise_for_status()exceptExceptionase:raiseException(f"Failed to create a project, {req.status_code} and reason: {req.text}")frome