body_hash stringlengths 64 64 | body stringlengths 23 109k | docstring stringlengths 1 57k | path stringlengths 4 198 | name stringlengths 1 115 | repository_name stringlengths 7 111 | repository_stars float64 0 191k | lang stringclasses 1 value | body_without_docstring stringlengths 14 108k | unified stringlengths 45 133k |
|---|---|---|---|---|---|---|---|---|---|
14b10cb90cb9b2ef3a4dcea35e0c5c471575a26277901b182811ec60d31e6d77 | def Insert(self, request, global_params=None):
'Creates a TargetInstance resource in the specified project and zone using the data included in the request.\n\n Args:\n request: (ComputeTargetInstancesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | Creates a TargetInstance resource in the specified project and zone using the data included in the request.
Args:
request: (ComputeTargetInstancesInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Insert | bshaffer/google-cloud-sdk | 0 | python | def Insert(self, request, global_params=None):
'Creates a TargetInstance resource in the specified project and zone using the data included in the request.\n\n Args:\n request: (ComputeTargetInstancesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | def Insert(self, request, global_params=None):
'Creates a TargetInstance resource in the specified project and zone using the data included in the request.\n\n Args:\n request: (ComputeTargetInstancesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Creates a TargetInstance resource in the specified project and zone using the data included in the request.
Args:
request: (ComputeTargetInstancesInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
2a96ed6938d5a260133befe49d21ab34bf15ac3577e269063d174daef5e65afe | def List(self, request, global_params=None):
'Retrieves a list of TargetInstance resources available to the specified project and zone.\n\n Args:\n request: (ComputeTargetInstancesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetInstanceList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves a list of TargetInstance resources available to the specified project and zone.
Args:
request: (ComputeTargetInstancesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetInstanceList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves a list of TargetInstance resources available to the specified project and zone.\n\n Args:\n request: (ComputeTargetInstancesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetInstanceList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves a list of TargetInstance resources available to the specified project and zone.\n\n Args:\n request: (ComputeTargetInstancesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetInstanceList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves a list of TargetInstance resources available to the specified project and zone.
Args:
request: (ComputeTargetInstancesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetInstanceList) The response message.<|endoftext|> |
bd6322a89b9371296bcd38dd4b8a8604c5d635c81fcb49b1a2f9a0b490ec3660 | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetInstancesTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetInstancesTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | TestIamPermissions | bshaffer/google-cloud-sdk | 0 | python | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetInstancesTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetInstancesTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetInstancesTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message.<|endoftext|> |
d43e9253c1b73076ef2c041b7b36f14ba1684b61aa721e2308942ef36cfd1b6d | def AddHealthCheck(self, request, global_params=None):
'Adds health check URLs to a target pool.\n\n Args:\n request: (ComputeTargetPoolsAddHealthCheckRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('AddHealthCheck')
return self._RunMethod(config, request, global_params=global_params) | Adds health check URLs to a target pool.
Args:
request: (ComputeTargetPoolsAddHealthCheckRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | AddHealthCheck | bshaffer/google-cloud-sdk | 0 | python | def AddHealthCheck(self, request, global_params=None):
'Adds health check URLs to a target pool.\n\n Args:\n request: (ComputeTargetPoolsAddHealthCheckRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('AddHealthCheck')
return self._RunMethod(config, request, global_params=global_params) | def AddHealthCheck(self, request, global_params=None):
'Adds health check URLs to a target pool.\n\n Args:\n request: (ComputeTargetPoolsAddHealthCheckRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('AddHealthCheck')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Adds health check URLs to a target pool.
Args:
request: (ComputeTargetPoolsAddHealthCheckRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
f2a280354e006a270626591cc87a3e4eb817d4880d55fe1c38240112cf6564fb | def AddInstance(self, request, global_params=None):
'Adds an instance to a target pool.\n\n Args:\n request: (ComputeTargetPoolsAddInstanceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('AddInstance')
return self._RunMethod(config, request, global_params=global_params) | Adds an instance to a target pool.
Args:
request: (ComputeTargetPoolsAddInstanceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | AddInstance | bshaffer/google-cloud-sdk | 0 | python | def AddInstance(self, request, global_params=None):
'Adds an instance to a target pool.\n\n Args:\n request: (ComputeTargetPoolsAddInstanceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('AddInstance')
return self._RunMethod(config, request, global_params=global_params) | def AddInstance(self, request, global_params=None):
'Adds an instance to a target pool.\n\n Args:\n request: (ComputeTargetPoolsAddInstanceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('AddInstance')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Adds an instance to a target pool.
Args:
request: (ComputeTargetPoolsAddInstanceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
083c66eb95ba18a44ba8d1c191d3988ef811be8facf4ec965816fce89f0f98f5 | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of target pools.\n\n Args:\n request: (ComputeTargetPoolsAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params) | Retrieves an aggregated list of target pools.
Args:
request: (ComputeTargetPoolsAggregatedListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPoolAggregatedList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | AggregatedList | bshaffer/google-cloud-sdk | 0 | python | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of target pools.\n\n Args:\n request: (ComputeTargetPoolsAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params) | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of target pools.\n\n Args:\n request: (ComputeTargetPoolsAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves an aggregated list of target pools.
Args:
request: (ComputeTargetPoolsAggregatedListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPoolAggregatedList) The response message.<|endoftext|> |
ce38e751905829361c3f922d0799e16ad4c2ca053fcac9f6f84d114cbb5f9c6e | def Delete(self, request, global_params=None):
'Deletes the specified target pool.\n\n Args:\n request: (ComputeTargetPoolsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | Deletes the specified target pool.
Args:
request: (ComputeTargetPoolsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Delete | bshaffer/google-cloud-sdk | 0 | python | def Delete(self, request, global_params=None):
'Deletes the specified target pool.\n\n Args:\n request: (ComputeTargetPoolsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | def Delete(self, request, global_params=None):
'Deletes the specified target pool.\n\n Args:\n request: (ComputeTargetPoolsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Deletes the specified target pool.
Args:
request: (ComputeTargetPoolsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
49733073ba26590eb3bb2ea9458d2f336151a9300bf0dc1b268855f83cef6da0 | def Get(self, request, global_params=None):
'Returns the specified target pool. Gets a list of available target pools by making a list() request.\n\n Args:\n request: (ComputeTargetPoolsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPool) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Returns the specified target pool. Gets a list of available target pools by making a list() request.
Args:
request: (ComputeTargetPoolsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPool) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Returns the specified target pool. Gets a list of available target pools by making a list() request.\n\n Args:\n request: (ComputeTargetPoolsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPool) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Returns the specified target pool. Gets a list of available target pools by making a list() request.\n\n Args:\n request: (ComputeTargetPoolsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPool) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns the specified target pool. Gets a list of available target pools by making a list() request.
Args:
request: (ComputeTargetPoolsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPool) The response message.<|endoftext|> |
7d1d34c87a08317101dc377e6ee9bb5d1d4771274bf4547dc16ecf4fab235991 | def GetHealth(self, request, global_params=None):
'Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.\n\n Args:\n request: (ComputeTargetPoolsGetHealthRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolInstanceHealth) The response message.\n '
config = self.GetMethodConfig('GetHealth')
return self._RunMethod(config, request, global_params=global_params) | Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
Args:
request: (ComputeTargetPoolsGetHealthRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPoolInstanceHealth) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | GetHealth | bshaffer/google-cloud-sdk | 0 | python | def GetHealth(self, request, global_params=None):
'Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.\n\n Args:\n request: (ComputeTargetPoolsGetHealthRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolInstanceHealth) The response message.\n '
config = self.GetMethodConfig('GetHealth')
return self._RunMethod(config, request, global_params=global_params) | def GetHealth(self, request, global_params=None):
'Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.\n\n Args:\n request: (ComputeTargetPoolsGetHealthRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolInstanceHealth) The response message.\n '
config = self.GetMethodConfig('GetHealth')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Gets the most recent health check results for each IP for the instance that is referenced by the given target pool.
Args:
request: (ComputeTargetPoolsGetHealthRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPoolInstanceHealth) The response message.<|endoftext|> |
a23587535ecd9a7f9a21e70609f517c480123023549b82670ef35e652ae37e8a | def Insert(self, request, global_params=None):
'Creates a target pool in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeTargetPoolsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | Creates a target pool in the specified project and region using the data included in the request.
Args:
request: (ComputeTargetPoolsInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Insert | bshaffer/google-cloud-sdk | 0 | python | def Insert(self, request, global_params=None):
'Creates a target pool in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeTargetPoolsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | def Insert(self, request, global_params=None):
'Creates a target pool in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeTargetPoolsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Creates a target pool in the specified project and region using the data included in the request.
Args:
request: (ComputeTargetPoolsInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
ab3c6791cb5e2607702a58640e44446ff1d0847b79042d5531de16a27db16534 | def List(self, request, global_params=None):
'Retrieves a list of target pools available to the specified project and region.\n\n Args:\n request: (ComputeTargetPoolsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves a list of target pools available to the specified project and region.
Args:
request: (ComputeTargetPoolsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPoolList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves a list of target pools available to the specified project and region.\n\n Args:\n request: (ComputeTargetPoolsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves a list of target pools available to the specified project and region.\n\n Args:\n request: (ComputeTargetPoolsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetPoolList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves a list of target pools available to the specified project and region.
Args:
request: (ComputeTargetPoolsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetPoolList) The response message.<|endoftext|> |
3eae7778a798d4645a904aaa2bc9285497e86e6459143ab445b0947298215d95 | def RemoveHealthCheck(self, request, global_params=None):
'Removes health check URL from a target pool.\n\n Args:\n request: (ComputeTargetPoolsRemoveHealthCheckRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('RemoveHealthCheck')
return self._RunMethod(config, request, global_params=global_params) | Removes health check URL from a target pool.
Args:
request: (ComputeTargetPoolsRemoveHealthCheckRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | RemoveHealthCheck | bshaffer/google-cloud-sdk | 0 | python | def RemoveHealthCheck(self, request, global_params=None):
'Removes health check URL from a target pool.\n\n Args:\n request: (ComputeTargetPoolsRemoveHealthCheckRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('RemoveHealthCheck')
return self._RunMethod(config, request, global_params=global_params) | def RemoveHealthCheck(self, request, global_params=None):
'Removes health check URL from a target pool.\n\n Args:\n request: (ComputeTargetPoolsRemoveHealthCheckRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('RemoveHealthCheck')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Removes health check URL from a target pool.
Args:
request: (ComputeTargetPoolsRemoveHealthCheckRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
bacf47ce893ad543cbba8459e68e7c84b66f2c07481b65cc3cbf776758bf06f5 | def RemoveInstance(self, request, global_params=None):
'Removes instance URL from a target pool.\n\n Args:\n request: (ComputeTargetPoolsRemoveInstanceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('RemoveInstance')
return self._RunMethod(config, request, global_params=global_params) | Removes instance URL from a target pool.
Args:
request: (ComputeTargetPoolsRemoveInstanceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | RemoveInstance | bshaffer/google-cloud-sdk | 0 | python | def RemoveInstance(self, request, global_params=None):
'Removes instance URL from a target pool.\n\n Args:\n request: (ComputeTargetPoolsRemoveInstanceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('RemoveInstance')
return self._RunMethod(config, request, global_params=global_params) | def RemoveInstance(self, request, global_params=None):
'Removes instance URL from a target pool.\n\n Args:\n request: (ComputeTargetPoolsRemoveInstanceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('RemoveInstance')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Removes instance URL from a target pool.
Args:
request: (ComputeTargetPoolsRemoveInstanceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
b535b234574b515f857f69a882f38614d53eee504b69a904b37372b9bcb7905a | def SetBackup(self, request, global_params=None):
"Changes a backup target pool's configurations.\n\n Args:\n request: (ComputeTargetPoolsSetBackupRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n "
config = self.GetMethodConfig('SetBackup')
return self._RunMethod(config, request, global_params=global_params) | Changes a backup target pool's configurations.
Args:
request: (ComputeTargetPoolsSetBackupRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetBackup | bshaffer/google-cloud-sdk | 0 | python | def SetBackup(self, request, global_params=None):
"Changes a backup target pool's configurations.\n\n Args:\n request: (ComputeTargetPoolsSetBackupRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n "
config = self.GetMethodConfig('SetBackup')
return self._RunMethod(config, request, global_params=global_params) | def SetBackup(self, request, global_params=None):
"Changes a backup target pool's configurations.\n\n Args:\n request: (ComputeTargetPoolsSetBackupRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n "
config = self.GetMethodConfig('SetBackup')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Changes a backup target pool's configurations.
Args:
request: (ComputeTargetPoolsSetBackupRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
2244df7b4c92c39fb245f34e302bd3aff5a915805967e0718b08874c9e81c19c | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetPoolsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetPoolsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | TestIamPermissions | bshaffer/google-cloud-sdk | 0 | python | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetPoolsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetPoolsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetPoolsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message.<|endoftext|> |
5d1801c252b73f0f71f3bd85a3c6a3558b893b6024e6e844b6ae56c2df02177d | def Delete(self, request, global_params=None):
'Deletes the specified TargetSslProxy resource.\n\n Args:\n request: (ComputeTargetSslProxiesDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | Deletes the specified TargetSslProxy resource.
Args:
request: (ComputeTargetSslProxiesDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Delete | bshaffer/google-cloud-sdk | 0 | python | def Delete(self, request, global_params=None):
'Deletes the specified TargetSslProxy resource.\n\n Args:\n request: (ComputeTargetSslProxiesDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | def Delete(self, request, global_params=None):
'Deletes the specified TargetSslProxy resource.\n\n Args:\n request: (ComputeTargetSslProxiesDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Deletes the specified TargetSslProxy resource.
Args:
request: (ComputeTargetSslProxiesDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
a4e4194e2e5be0d3bc6fccd7257b89fee1f170e516bb0cd379aedde13a347f79 | def Get(self, request, global_params=None):
'Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.\n\n Args:\n request: (ComputeTargetSslProxiesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetSslProxy) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.
Args:
request: (ComputeTargetSslProxiesGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetSslProxy) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.\n\n Args:\n request: (ComputeTargetSslProxiesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetSslProxy) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.\n\n Args:\n request: (ComputeTargetSslProxiesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetSslProxy) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns the specified TargetSslProxy resource. Gets a list of available target SSL proxies by making a list() request.
Args:
request: (ComputeTargetSslProxiesGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetSslProxy) The response message.<|endoftext|> |
917ecf2ff22ebf765771f28bcc3470e916ecf74a1e16be01d330956e72e800eb | def Insert(self, request, global_params=None):
'Creates a TargetSslProxy resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeTargetSslProxiesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | Creates a TargetSslProxy resource in the specified project using the data included in the request.
Args:
request: (ComputeTargetSslProxiesInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Insert | bshaffer/google-cloud-sdk | 0 | python | def Insert(self, request, global_params=None):
'Creates a TargetSslProxy resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeTargetSslProxiesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | def Insert(self, request, global_params=None):
'Creates a TargetSslProxy resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeTargetSslProxiesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Creates a TargetSslProxy resource in the specified project using the data included in the request.
Args:
request: (ComputeTargetSslProxiesInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
96ac671cc814f142fe415ae1b987bc7ff42b0eef02dd47f1973a4327c2930900 | def List(self, request, global_params=None):
'Retrieves the list of TargetSslProxy resources available to the specified project.\n\n Args:\n request: (ComputeTargetSslProxiesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetSslProxyList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves the list of TargetSslProxy resources available to the specified project.
Args:
request: (ComputeTargetSslProxiesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetSslProxyList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves the list of TargetSslProxy resources available to the specified project.\n\n Args:\n request: (ComputeTargetSslProxiesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetSslProxyList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves the list of TargetSslProxy resources available to the specified project.\n\n Args:\n request: (ComputeTargetSslProxiesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetSslProxyList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves the list of TargetSslProxy resources available to the specified project.
Args:
request: (ComputeTargetSslProxiesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetSslProxyList) The response message.<|endoftext|> |
f6443bfcc36bb25df52e413f2bf7ab3d3b465ebe61c21b8c78b8736510333bc2 | def SetBackendService(self, request, global_params=None):
'Changes the BackendService for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetBackendServiceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetBackendService')
return self._RunMethod(config, request, global_params=global_params) | Changes the BackendService for TargetSslProxy.
Args:
request: (ComputeTargetSslProxiesSetBackendServiceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetBackendService | bshaffer/google-cloud-sdk | 0 | python | def SetBackendService(self, request, global_params=None):
'Changes the BackendService for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetBackendServiceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetBackendService')
return self._RunMethod(config, request, global_params=global_params) | def SetBackendService(self, request, global_params=None):
'Changes the BackendService for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetBackendServiceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetBackendService')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Changes the BackendService for TargetSslProxy.
Args:
request: (ComputeTargetSslProxiesSetBackendServiceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
5bd2d6a09a827ae5600eafe09f3ac193c962e0fab1b14b3e8af9c0c1fdf6e6e2 | def SetProxyHeader(self, request, global_params=None):
'Changes the ProxyHeaderType for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetProxyHeaderRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetProxyHeader')
return self._RunMethod(config, request, global_params=global_params) | Changes the ProxyHeaderType for TargetSslProxy.
Args:
request: (ComputeTargetSslProxiesSetProxyHeaderRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetProxyHeader | bshaffer/google-cloud-sdk | 0 | python | def SetProxyHeader(self, request, global_params=None):
'Changes the ProxyHeaderType for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetProxyHeaderRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetProxyHeader')
return self._RunMethod(config, request, global_params=global_params) | def SetProxyHeader(self, request, global_params=None):
'Changes the ProxyHeaderType for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetProxyHeaderRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetProxyHeader')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Changes the ProxyHeaderType for TargetSslProxy.
Args:
request: (ComputeTargetSslProxiesSetProxyHeaderRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
c89a9eb3c38aad1608c281b08688f92e7bee21c6020508fccf759a2acedead3f | def SetSslCertificates(self, request, global_params=None):
'Changes SslCertificates for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetSslCertificatesRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetSslCertificates')
return self._RunMethod(config, request, global_params=global_params) | Changes SslCertificates for TargetSslProxy.
Args:
request: (ComputeTargetSslProxiesSetSslCertificatesRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetSslCertificates | bshaffer/google-cloud-sdk | 0 | python | def SetSslCertificates(self, request, global_params=None):
'Changes SslCertificates for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetSslCertificatesRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetSslCertificates')
return self._RunMethod(config, request, global_params=global_params) | def SetSslCertificates(self, request, global_params=None):
'Changes SslCertificates for TargetSslProxy.\n\n Args:\n request: (ComputeTargetSslProxiesSetSslCertificatesRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetSslCertificates')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Changes SslCertificates for TargetSslProxy.
Args:
request: (ComputeTargetSslProxiesSetSslCertificatesRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
92683c24a4136abe27d2ecdd73e5ba2abe4ad933a737d0286ed18d421eaf6a18 | def SetSslPolicy(self, request, global_params=None):
'Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.\n\n Args:\n request: (ComputeTargetSslProxiesSetSslPolicyRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetSslPolicy')
return self._RunMethod(config, request, global_params=global_params) | Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.
Args:
request: (ComputeTargetSslProxiesSetSslPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetSslPolicy | bshaffer/google-cloud-sdk | 0 | python | def SetSslPolicy(self, request, global_params=None):
'Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.\n\n Args:\n request: (ComputeTargetSslProxiesSetSslPolicyRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetSslPolicy')
return self._RunMethod(config, request, global_params=global_params) | def SetSslPolicy(self, request, global_params=None):
'Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.\n\n Args:\n request: (ComputeTargetSslProxiesSetSslPolicyRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetSslPolicy')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Sets the SSL policy for TargetSslProxy. The SSL policy specifies the server-side support for SSL features. This affects connections between clients and the SSL proxy load balancer. They do not affect the connection between the load balancer and the backends.
Args:
request: (ComputeTargetSslProxiesSetSslPolicyRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
1f6b09b8c0ae63b20f6cf988d81f0781c9c0d9862c98011bb635b2915e4545c0 | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetSslProxiesTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetSslProxiesTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | TestIamPermissions | bshaffer/google-cloud-sdk | 0 | python | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetSslProxiesTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetSslProxiesTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetSslProxiesTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message.<|endoftext|> |
55a0e28a06b38a569526458952896057e9e226784fec52e8eedaa33c7bc2f386 | def Delete(self, request, global_params=None):
'Deletes the specified TargetTcpProxy resource.\n\n Args:\n request: (ComputeTargetTcpProxiesDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | Deletes the specified TargetTcpProxy resource.
Args:
request: (ComputeTargetTcpProxiesDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Delete | bshaffer/google-cloud-sdk | 0 | python | def Delete(self, request, global_params=None):
'Deletes the specified TargetTcpProxy resource.\n\n Args:\n request: (ComputeTargetTcpProxiesDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | def Delete(self, request, global_params=None):
'Deletes the specified TargetTcpProxy resource.\n\n Args:\n request: (ComputeTargetTcpProxiesDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Deletes the specified TargetTcpProxy resource.
Args:
request: (ComputeTargetTcpProxiesDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
720d08f47f700e438ad9d90fc83490b53469051d0d69cdbc5e73ef985d1c02ed | def Get(self, request, global_params=None):
'Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.\n\n Args:\n request: (ComputeTargetTcpProxiesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetTcpProxy) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.
Args:
request: (ComputeTargetTcpProxiesGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetTcpProxy) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.\n\n Args:\n request: (ComputeTargetTcpProxiesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetTcpProxy) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.\n\n Args:\n request: (ComputeTargetTcpProxiesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetTcpProxy) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns the specified TargetTcpProxy resource. Gets a list of available target TCP proxies by making a list() request.
Args:
request: (ComputeTargetTcpProxiesGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetTcpProxy) The response message.<|endoftext|> |
b8d6e6be2125dc380df0159398a8697e9a022e6e052d09a45229ffa8d044ea69 | def Insert(self, request, global_params=None):
'Creates a TargetTcpProxy resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeTargetTcpProxiesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | Creates a TargetTcpProxy resource in the specified project using the data included in the request.
Args:
request: (ComputeTargetTcpProxiesInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Insert | bshaffer/google-cloud-sdk | 0 | python | def Insert(self, request, global_params=None):
'Creates a TargetTcpProxy resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeTargetTcpProxiesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | def Insert(self, request, global_params=None):
'Creates a TargetTcpProxy resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeTargetTcpProxiesInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Creates a TargetTcpProxy resource in the specified project using the data included in the request.
Args:
request: (ComputeTargetTcpProxiesInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
a3bed22899fd3e04aadcfb920d78dffb8d19a8de092e76f17596f88cc70c7aad | def List(self, request, global_params=None):
'Retrieves the list of TargetTcpProxy resources available to the specified project.\n\n Args:\n request: (ComputeTargetTcpProxiesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetTcpProxyList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves the list of TargetTcpProxy resources available to the specified project.
Args:
request: (ComputeTargetTcpProxiesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetTcpProxyList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves the list of TargetTcpProxy resources available to the specified project.\n\n Args:\n request: (ComputeTargetTcpProxiesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetTcpProxyList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves the list of TargetTcpProxy resources available to the specified project.\n\n Args:\n request: (ComputeTargetTcpProxiesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetTcpProxyList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves the list of TargetTcpProxy resources available to the specified project.
Args:
request: (ComputeTargetTcpProxiesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetTcpProxyList) The response message.<|endoftext|> |
750b891403d49bf04e2eb384c9407e27a7c6fa152ddd2f5d0f951c80b1edd479 | def SetBackendService(self, request, global_params=None):
'Changes the BackendService for TargetTcpProxy.\n\n Args:\n request: (ComputeTargetTcpProxiesSetBackendServiceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetBackendService')
return self._RunMethod(config, request, global_params=global_params) | Changes the BackendService for TargetTcpProxy.
Args:
request: (ComputeTargetTcpProxiesSetBackendServiceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetBackendService | bshaffer/google-cloud-sdk | 0 | python | def SetBackendService(self, request, global_params=None):
'Changes the BackendService for TargetTcpProxy.\n\n Args:\n request: (ComputeTargetTcpProxiesSetBackendServiceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetBackendService')
return self._RunMethod(config, request, global_params=global_params) | def SetBackendService(self, request, global_params=None):
'Changes the BackendService for TargetTcpProxy.\n\n Args:\n request: (ComputeTargetTcpProxiesSetBackendServiceRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetBackendService')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Changes the BackendService for TargetTcpProxy.
Args:
request: (ComputeTargetTcpProxiesSetBackendServiceRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
4eb3bc6cac299020040b9c86759d6e6ef211985ac7b5be2b3c9750bbf4f94b5d | def SetProxyHeader(self, request, global_params=None):
'Changes the ProxyHeaderType for TargetTcpProxy.\n\n Args:\n request: (ComputeTargetTcpProxiesSetProxyHeaderRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetProxyHeader')
return self._RunMethod(config, request, global_params=global_params) | Changes the ProxyHeaderType for TargetTcpProxy.
Args:
request: (ComputeTargetTcpProxiesSetProxyHeaderRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetProxyHeader | bshaffer/google-cloud-sdk | 0 | python | def SetProxyHeader(self, request, global_params=None):
'Changes the ProxyHeaderType for TargetTcpProxy.\n\n Args:\n request: (ComputeTargetTcpProxiesSetProxyHeaderRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetProxyHeader')
return self._RunMethod(config, request, global_params=global_params) | def SetProxyHeader(self, request, global_params=None):
'Changes the ProxyHeaderType for TargetTcpProxy.\n\n Args:\n request: (ComputeTargetTcpProxiesSetProxyHeaderRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetProxyHeader')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Changes the ProxyHeaderType for TargetTcpProxy.
Args:
request: (ComputeTargetTcpProxiesSetProxyHeaderRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
2bc14301e1be0f6732f316cd2835b3449944d5f3241a8e893009fd7a7e8ae1a7 | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of target VPN gateways.\n\n Args:\n request: (ComputeTargetVpnGatewaysAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGatewayAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params) | Retrieves an aggregated list of target VPN gateways.
Args:
request: (ComputeTargetVpnGatewaysAggregatedListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetVpnGatewayAggregatedList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | AggregatedList | bshaffer/google-cloud-sdk | 0 | python | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of target VPN gateways.\n\n Args:\n request: (ComputeTargetVpnGatewaysAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGatewayAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params) | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of target VPN gateways.\n\n Args:\n request: (ComputeTargetVpnGatewaysAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGatewayAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves an aggregated list of target VPN gateways.
Args:
request: (ComputeTargetVpnGatewaysAggregatedListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetVpnGatewayAggregatedList) The response message.<|endoftext|> |
8779403a554101a756cd2301ab01b196d0453519b24e24e9a1914152212cfdc8 | def Delete(self, request, global_params=None):
'Deletes the specified target VPN gateway.\n\n Args:\n request: (ComputeTargetVpnGatewaysDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | Deletes the specified target VPN gateway.
Args:
request: (ComputeTargetVpnGatewaysDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Delete | bshaffer/google-cloud-sdk | 0 | python | def Delete(self, request, global_params=None):
'Deletes the specified target VPN gateway.\n\n Args:\n request: (ComputeTargetVpnGatewaysDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | def Delete(self, request, global_params=None):
'Deletes the specified target VPN gateway.\n\n Args:\n request: (ComputeTargetVpnGatewaysDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Deletes the specified target VPN gateway.
Args:
request: (ComputeTargetVpnGatewaysDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
8922df25276261115f2acb4cf898224868520ac7d69be9dcdb7a0ae19b1cbcd3 | def Get(self, request, global_params=None):
'Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.\n\n Args:\n request: (ComputeTargetVpnGatewaysGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGateway) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.
Args:
request: (ComputeTargetVpnGatewaysGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetVpnGateway) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.\n\n Args:\n request: (ComputeTargetVpnGatewaysGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGateway) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.\n\n Args:\n request: (ComputeTargetVpnGatewaysGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGateway) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns the specified target VPN gateway. Gets a list of available target VPN gateways by making a list() request.
Args:
request: (ComputeTargetVpnGatewaysGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetVpnGateway) The response message.<|endoftext|> |
b8b456c422f57842ad4004cd061d2caf5e03e02685f49935ece208686e0353b1 | def Insert(self, request, global_params=None):
'Creates a target VPN gateway in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeTargetVpnGatewaysInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | Creates a target VPN gateway in the specified project and region using the data included in the request.
Args:
request: (ComputeTargetVpnGatewaysInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Insert | bshaffer/google-cloud-sdk | 0 | python | def Insert(self, request, global_params=None):
'Creates a target VPN gateway in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeTargetVpnGatewaysInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | def Insert(self, request, global_params=None):
'Creates a target VPN gateway in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeTargetVpnGatewaysInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Creates a target VPN gateway in the specified project and region using the data included in the request.
Args:
request: (ComputeTargetVpnGatewaysInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
d04f4837363d10a905645c5957ebaaf3ca4824ff45af148e99d5e1b9c5792e12 | def List(self, request, global_params=None):
'Retrieves a list of target VPN gateways available to the specified project and region.\n\n Args:\n request: (ComputeTargetVpnGatewaysListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGatewayList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves a list of target VPN gateways available to the specified project and region.
Args:
request: (ComputeTargetVpnGatewaysListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetVpnGatewayList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves a list of target VPN gateways available to the specified project and region.\n\n Args:\n request: (ComputeTargetVpnGatewaysListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGatewayList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves a list of target VPN gateways available to the specified project and region.\n\n Args:\n request: (ComputeTargetVpnGatewaysListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TargetVpnGatewayList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves a list of target VPN gateways available to the specified project and region.
Args:
request: (ComputeTargetVpnGatewaysListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TargetVpnGatewayList) The response message.<|endoftext|> |
1573f479f3cc0369b7c88d771fcdd11d45f9b3a14e17672be69ca0563c1a1f11 | def SetLabels(self, request, global_params=None):
'Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.\n\n Args:\n request: (ComputeTargetVpnGatewaysSetLabelsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetLabels')
return self._RunMethod(config, request, global_params=global_params) | Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.
Args:
request: (ComputeTargetVpnGatewaysSetLabelsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetLabels | bshaffer/google-cloud-sdk | 0 | python | def SetLabels(self, request, global_params=None):
'Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.\n\n Args:\n request: (ComputeTargetVpnGatewaysSetLabelsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetLabels')
return self._RunMethod(config, request, global_params=global_params) | def SetLabels(self, request, global_params=None):
'Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.\n\n Args:\n request: (ComputeTargetVpnGatewaysSetLabelsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetLabels')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Sets the labels on a TargetVpnGateway. To learn more about labels, read the Labeling Resources documentation.
Args:
request: (ComputeTargetVpnGatewaysSetLabelsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
cb965401fb8baf28cd846eb70f7cddc806b47363054b5d4b9f677e46f35d13b5 | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetVpnGatewaysTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetVpnGatewaysTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | TestIamPermissions | bshaffer/google-cloud-sdk | 0 | python | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetVpnGatewaysTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeTargetVpnGatewaysTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeTargetVpnGatewaysTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message.<|endoftext|> |
e6b0ae85137ae0c660f2760cb7f6a5c27d4d71bf07837bbc14ca15ce297d2a60 | def Delete(self, request, global_params=None):
'Deletes the specified UrlMap resource.\n\n Args:\n request: (ComputeUrlMapsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | Deletes the specified UrlMap resource.
Args:
request: (ComputeUrlMapsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Delete | bshaffer/google-cloud-sdk | 0 | python | def Delete(self, request, global_params=None):
'Deletes the specified UrlMap resource.\n\n Args:\n request: (ComputeUrlMapsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | def Delete(self, request, global_params=None):
'Deletes the specified UrlMap resource.\n\n Args:\n request: (ComputeUrlMapsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Deletes the specified UrlMap resource.
Args:
request: (ComputeUrlMapsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
ef5f66f8abb9f32c0ac0368879c4c963482c58a8fe4a70e21be79cffdec699b4 | def Get(self, request, global_params=None):
'Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.\n\n Args:\n request: (ComputeUrlMapsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMap) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.
Args:
request: (ComputeUrlMapsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(UrlMap) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.\n\n Args:\n request: (ComputeUrlMapsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMap) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.\n\n Args:\n request: (ComputeUrlMapsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMap) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns the specified UrlMap resource. Gets a list of available URL maps by making a list() request.
Args:
request: (ComputeUrlMapsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(UrlMap) The response message.<|endoftext|> |
2fd6fdf022b6412f4ec95c35a042b472ec5573307708e19bde56856202b39241 | def Insert(self, request, global_params=None):
'Creates a UrlMap resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeUrlMapsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | Creates a UrlMap resource in the specified project using the data included in the request.
Args:
request: (ComputeUrlMapsInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Insert | bshaffer/google-cloud-sdk | 0 | python | def Insert(self, request, global_params=None):
'Creates a UrlMap resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeUrlMapsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | def Insert(self, request, global_params=None):
'Creates a UrlMap resource in the specified project using the data included in the request.\n\n Args:\n request: (ComputeUrlMapsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Creates a UrlMap resource in the specified project using the data included in the request.
Args:
request: (ComputeUrlMapsInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
4235d47cdae115bdc1d90422f767cfab8a8f7429e39f8444029f011e6f48447f | def InvalidateCache(self, request, global_params=None):
'Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.\n\n Args:\n request: (ComputeUrlMapsInvalidateCacheRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('InvalidateCache')
return self._RunMethod(config, request, global_params=global_params) | Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
Args:
request: (ComputeUrlMapsInvalidateCacheRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | InvalidateCache | bshaffer/google-cloud-sdk | 0 | python | def InvalidateCache(self, request, global_params=None):
'Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.\n\n Args:\n request: (ComputeUrlMapsInvalidateCacheRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('InvalidateCache')
return self._RunMethod(config, request, global_params=global_params) | def InvalidateCache(self, request, global_params=None):
'Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.\n\n Args:\n request: (ComputeUrlMapsInvalidateCacheRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('InvalidateCache')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Initiates a cache invalidation operation, invalidating the specified path, scoped to the specified UrlMap.
Args:
request: (ComputeUrlMapsInvalidateCacheRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
22ae61caf9fbe1407c159ca828a0fa47065d1322a1d9064a8d1a7cce36d69586 | def List(self, request, global_params=None):
'Retrieves the list of UrlMap resources available to the specified project.\n\n Args:\n request: (ComputeUrlMapsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMapList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves the list of UrlMap resources available to the specified project.
Args:
request: (ComputeUrlMapsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(UrlMapList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves the list of UrlMap resources available to the specified project.\n\n Args:\n request: (ComputeUrlMapsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMapList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves the list of UrlMap resources available to the specified project.\n\n Args:\n request: (ComputeUrlMapsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMapList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves the list of UrlMap resources available to the specified project.
Args:
request: (ComputeUrlMapsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(UrlMapList) The response message.<|endoftext|> |
4b155bc4033989b19a0708dfc0382e3c584741d21c0cc7c76e3dd030c9d6b945 | def Patch(self, request, global_params=None):
'Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.\n\n Args:\n request: (ComputeUrlMapsPatchRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Patch')
return self._RunMethod(config, request, global_params=global_params) | Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
Args:
request: (ComputeUrlMapsPatchRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Patch | bshaffer/google-cloud-sdk | 0 | python | def Patch(self, request, global_params=None):
'Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.\n\n Args:\n request: (ComputeUrlMapsPatchRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Patch')
return self._RunMethod(config, request, global_params=global_params) | def Patch(self, request, global_params=None):
'Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.\n\n Args:\n request: (ComputeUrlMapsPatchRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Patch')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Patches the specified UrlMap resource with the data included in the request. This method supports PATCH semantics and uses the JSON merge patch format and processing rules.
Args:
request: (ComputeUrlMapsPatchRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
b1adc6caa42ec411cc746f1ee73bce509713b2c4b16831a5608187acf68904e8 | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeUrlMapsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeUrlMapsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | TestIamPermissions | bshaffer/google-cloud-sdk | 0 | python | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeUrlMapsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeUrlMapsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeUrlMapsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message.<|endoftext|> |
0cb21ff7345bd7b12aa6c849f2140d73985d9f2c01387f40ca3513e37de06cf5 | def Update(self, request, global_params=None):
'Updates the specified UrlMap resource with the data included in the request.\n\n Args:\n request: (ComputeUrlMapsUpdateRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Update')
return self._RunMethod(config, request, global_params=global_params) | Updates the specified UrlMap resource with the data included in the request.
Args:
request: (ComputeUrlMapsUpdateRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Update | bshaffer/google-cloud-sdk | 0 | python | def Update(self, request, global_params=None):
'Updates the specified UrlMap resource with the data included in the request.\n\n Args:\n request: (ComputeUrlMapsUpdateRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Update')
return self._RunMethod(config, request, global_params=global_params) | def Update(self, request, global_params=None):
'Updates the specified UrlMap resource with the data included in the request.\n\n Args:\n request: (ComputeUrlMapsUpdateRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Update')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Updates the specified UrlMap resource with the data included in the request.
Args:
request: (ComputeUrlMapsUpdateRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
4948f88011d2d64d1285db83ad386cd0c40634e286c341dab8bd1b6b5774c5e4 | def Validate(self, request, global_params=None):
'Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.\n\n Args:\n request: (ComputeUrlMapsValidateRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMapsValidateResponse) The response message.\n '
config = self.GetMethodConfig('Validate')
return self._RunMethod(config, request, global_params=global_params) | Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.
Args:
request: (ComputeUrlMapsValidateRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(UrlMapsValidateResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Validate | bshaffer/google-cloud-sdk | 0 | python | def Validate(self, request, global_params=None):
'Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.\n\n Args:\n request: (ComputeUrlMapsValidateRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMapsValidateResponse) The response message.\n '
config = self.GetMethodConfig('Validate')
return self._RunMethod(config, request, global_params=global_params) | def Validate(self, request, global_params=None):
'Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.\n\n Args:\n request: (ComputeUrlMapsValidateRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (UrlMapsValidateResponse) The response message.\n '
config = self.GetMethodConfig('Validate')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Runs static validation for the UrlMap. In particular, the tests of the provided UrlMap will be run. Calling this method does NOT create the UrlMap.
Args:
request: (ComputeUrlMapsValidateRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(UrlMapsValidateResponse) The response message.<|endoftext|> |
8ef0a5c055d2a10b49503b6655df685fa6972df92187f475bdf51a786c8c89b9 | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of VPN tunnels.\n\n Args:\n request: (ComputeVpnTunnelsAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnelAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params) | Retrieves an aggregated list of VPN tunnels.
Args:
request: (ComputeVpnTunnelsAggregatedListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(VpnTunnelAggregatedList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | AggregatedList | bshaffer/google-cloud-sdk | 0 | python | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of VPN tunnels.\n\n Args:\n request: (ComputeVpnTunnelsAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnelAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params) | def AggregatedList(self, request, global_params=None):
'Retrieves an aggregated list of VPN tunnels.\n\n Args:\n request: (ComputeVpnTunnelsAggregatedListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnelAggregatedList) The response message.\n '
config = self.GetMethodConfig('AggregatedList')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves an aggregated list of VPN tunnels.
Args:
request: (ComputeVpnTunnelsAggregatedListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(VpnTunnelAggregatedList) The response message.<|endoftext|> |
6a52abd62206de5f4a2f081631c34fe055e70c3b3cd8c4fd4933dc671ef8b512 | def Delete(self, request, global_params=None):
'Deletes the specified VpnTunnel resource.\n\n Args:\n request: (ComputeVpnTunnelsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | Deletes the specified VpnTunnel resource.
Args:
request: (ComputeVpnTunnelsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Delete | bshaffer/google-cloud-sdk | 0 | python | def Delete(self, request, global_params=None):
'Deletes the specified VpnTunnel resource.\n\n Args:\n request: (ComputeVpnTunnelsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | def Delete(self, request, global_params=None):
'Deletes the specified VpnTunnel resource.\n\n Args:\n request: (ComputeVpnTunnelsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Deletes the specified VpnTunnel resource.
Args:
request: (ComputeVpnTunnelsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
9359b9dfe4dc023c89e622885703fd8a244ae2fb0467946587d7b9321a50ffb9 | def Get(self, request, global_params=None):
'Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.\n\n Args:\n request: (ComputeVpnTunnelsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnel) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.
Args:
request: (ComputeVpnTunnelsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(VpnTunnel) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.\n\n Args:\n request: (ComputeVpnTunnelsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnel) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.\n\n Args:\n request: (ComputeVpnTunnelsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnel) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns the specified VpnTunnel resource. Gets a list of available VPN tunnels by making a list() request.
Args:
request: (ComputeVpnTunnelsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(VpnTunnel) The response message.<|endoftext|> |
f995376ddb080331cc0b818b929feaeb3e9f033ee1e1b7c5064e4a2020036579 | def Insert(self, request, global_params=None):
'Creates a VpnTunnel resource in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeVpnTunnelsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | Creates a VpnTunnel resource in the specified project and region using the data included in the request.
Args:
request: (ComputeVpnTunnelsInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Insert | bshaffer/google-cloud-sdk | 0 | python | def Insert(self, request, global_params=None):
'Creates a VpnTunnel resource in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeVpnTunnelsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params) | def Insert(self, request, global_params=None):
'Creates a VpnTunnel resource in the specified project and region using the data included in the request.\n\n Args:\n request: (ComputeVpnTunnelsInsertRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Insert')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Creates a VpnTunnel resource in the specified project and region using the data included in the request.
Args:
request: (ComputeVpnTunnelsInsertRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
5f2dfbf2c105be2b61a7de5ca059378d057c739785a5a7fea8e9a2d633b5c582 | def List(self, request, global_params=None):
'Retrieves a list of VpnTunnel resources contained in the specified project and region.\n\n Args:\n request: (ComputeVpnTunnelsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnelList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves a list of VpnTunnel resources contained in the specified project and region.
Args:
request: (ComputeVpnTunnelsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(VpnTunnelList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves a list of VpnTunnel resources contained in the specified project and region.\n\n Args:\n request: (ComputeVpnTunnelsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnelList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves a list of VpnTunnel resources contained in the specified project and region.\n\n Args:\n request: (ComputeVpnTunnelsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (VpnTunnelList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves a list of VpnTunnel resources contained in the specified project and region.
Args:
request: (ComputeVpnTunnelsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(VpnTunnelList) The response message.<|endoftext|> |
c3c8f35204f618dc0f6e8c23c7190f10c5bf782eefe618e6dee2293404da46de | def SetLabels(self, request, global_params=None):
'Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.\n\n Args:\n request: (ComputeVpnTunnelsSetLabelsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetLabels')
return self._RunMethod(config, request, global_params=global_params) | Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.
Args:
request: (ComputeVpnTunnelsSetLabelsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | SetLabels | bshaffer/google-cloud-sdk | 0 | python | def SetLabels(self, request, global_params=None):
'Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.\n\n Args:\n request: (ComputeVpnTunnelsSetLabelsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetLabels')
return self._RunMethod(config, request, global_params=global_params) | def SetLabels(self, request, global_params=None):
'Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.\n\n Args:\n request: (ComputeVpnTunnelsSetLabelsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('SetLabels')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Sets the labels on a VpnTunnel. To learn more about labels, read the Labeling Resources documentation.
Args:
request: (ComputeVpnTunnelsSetLabelsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
9820619f24834ec02d7e9c3b3c58578a86ec1922769c22497767f8a4db83e925 | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeVpnTunnelsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeVpnTunnelsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | TestIamPermissions | bshaffer/google-cloud-sdk | 0 | python | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeVpnTunnelsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params) | def TestIamPermissions(self, request, global_params=None):
'Returns permissions that a caller has on the specified resource.\n\n Args:\n request: (ComputeVpnTunnelsTestIamPermissionsRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (TestPermissionsResponse) The response message.\n '
config = self.GetMethodConfig('TestIamPermissions')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns permissions that a caller has on the specified resource.
Args:
request: (ComputeVpnTunnelsTestIamPermissionsRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(TestPermissionsResponse) The response message.<|endoftext|> |
fcf4988c90f3e76a27f82a09f904df16e6a2a2328258d97ed4fd143d7163c179 | def Delete(self, request, global_params=None):
'Deletes the specified zone-specific Operations resource.\n\n Args:\n request: (ComputeZoneOperationsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (ComputeZoneOperationsDeleteResponse) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | Deletes the specified zone-specific Operations resource.
Args:
request: (ComputeZoneOperationsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ComputeZoneOperationsDeleteResponse) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Delete | bshaffer/google-cloud-sdk | 0 | python | def Delete(self, request, global_params=None):
'Deletes the specified zone-specific Operations resource.\n\n Args:\n request: (ComputeZoneOperationsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (ComputeZoneOperationsDeleteResponse) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params) | def Delete(self, request, global_params=None):
'Deletes the specified zone-specific Operations resource.\n\n Args:\n request: (ComputeZoneOperationsDeleteRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (ComputeZoneOperationsDeleteResponse) The response message.\n '
config = self.GetMethodConfig('Delete')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Deletes the specified zone-specific Operations resource.
Args:
request: (ComputeZoneOperationsDeleteRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ComputeZoneOperationsDeleteResponse) The response message.<|endoftext|> |
ccb902c640eb254655bad52da611437db250cd7117e0f7935ef22753c41ce7e4 | def Get(self, request, global_params=None):
'Retrieves the specified zone-specific Operations resource.\n\n Args:\n request: (ComputeZoneOperationsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Retrieves the specified zone-specific Operations resource.
Args:
request: (ComputeZoneOperationsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Retrieves the specified zone-specific Operations resource.\n\n Args:\n request: (ComputeZoneOperationsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Retrieves the specified zone-specific Operations resource.\n\n Args:\n request: (ComputeZoneOperationsGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Operation) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves the specified zone-specific Operations resource.
Args:
request: (ComputeZoneOperationsGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Operation) The response message.<|endoftext|> |
b3c050c890248d320bbe8bbc1baaf82d16481e4924e615b50a3f27cf31c1be66 | def List(self, request, global_params=None):
'Retrieves a list of Operation resources contained within the specified zone.\n\n Args:\n request: (ComputeZoneOperationsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (OperationList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves a list of Operation resources contained within the specified zone.
Args:
request: (ComputeZoneOperationsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(OperationList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves a list of Operation resources contained within the specified zone.\n\n Args:\n request: (ComputeZoneOperationsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (OperationList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves a list of Operation resources contained within the specified zone.\n\n Args:\n request: (ComputeZoneOperationsListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (OperationList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves a list of Operation resources contained within the specified zone.
Args:
request: (ComputeZoneOperationsListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(OperationList) The response message.<|endoftext|> |
58232b760e72eeb8fe9b1ada31a16abcce9732950adfed13cda88c735d11f143 | def Get(self, request, global_params=None):
'Returns the specified Zone resource. Gets a list of available zones by making a list() request.\n\n Args:\n request: (ComputeZonesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Zone) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | Returns the specified Zone resource. Gets a list of available zones by making a list() request.
Args:
request: (ComputeZonesGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Zone) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | Get | bshaffer/google-cloud-sdk | 0 | python | def Get(self, request, global_params=None):
'Returns the specified Zone resource. Gets a list of available zones by making a list() request.\n\n Args:\n request: (ComputeZonesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Zone) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params) | def Get(self, request, global_params=None):
'Returns the specified Zone resource. Gets a list of available zones by making a list() request.\n\n Args:\n request: (ComputeZonesGetRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (Zone) The response message.\n '
config = self.GetMethodConfig('Get')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Returns the specified Zone resource. Gets a list of available zones by making a list() request.
Args:
request: (ComputeZonesGetRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(Zone) The response message.<|endoftext|> |
4d7c75d7e0c486b190c3b5c2da2741c85a1c275ff238207a1e164795cc6d33e3 | def List(self, request, global_params=None):
'Retrieves the list of Zone resources available to the specified project.\n\n Args:\n request: (ComputeZonesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (ZoneList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | Retrieves the list of Zone resources available to the specified project.
Args:
request: (ComputeZonesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ZoneList) The response message. | lib/googlecloudsdk/third_party/apis/compute/beta/compute_beta_client.py | List | bshaffer/google-cloud-sdk | 0 | python | def List(self, request, global_params=None):
'Retrieves the list of Zone resources available to the specified project.\n\n Args:\n request: (ComputeZonesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (ZoneList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params) | def List(self, request, global_params=None):
'Retrieves the list of Zone resources available to the specified project.\n\n Args:\n request: (ComputeZonesListRequest) input message\n global_params: (StandardQueryParameters, default: None) global arguments\n Returns:\n (ZoneList) The response message.\n '
config = self.GetMethodConfig('List')
return self._RunMethod(config, request, global_params=global_params)<|docstring|>Retrieves the list of Zone resources available to the specified project.
Args:
request: (ComputeZonesListRequest) input message
global_params: (StandardQueryParameters, default: None) global arguments
Returns:
(ZoneList) The response message.<|endoftext|> |
e44ce3fc3f8860382bcf48f5fa43079b744dfd6f7f5313124802bf13184e3592 | def plotBarGraph(x: List[Any], y: List[float], title: str='', xLabel: str='', yLabel: str='', color: str='blue', lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1) -> None:
'\n Plot bar graphs with given X labels and Y values lists, this function also supports other optional\n parameters as shown below.\n\n :param x: a list of X labels for the graphs\n :param y: a list of Y coordinates for the bar graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,\n purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical/horizontal spacing index\n :return: None\n '
cMap = colorMap()
xList = numpy.arange(len(y))
plt.figure(1, (15, 10))
plt.rcParams['figure.figsize'] = (15, 10)
plt.rcParams['axes.linewidth'] = (lineWidth * 2)
if (title is not None):
plt.title(title, size=int((fontSize * 1.4)), weight='bold')
if (xLabel != ''):
plt.xlabel(xLabel, size=int((fontSize * 1.2)), weight='bold')
if (yLabel != ''):
plt.ylabel(yLabel, size=int((fontSize * 1.2)), weight='bold')
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
plt.xlim([(min(xList) - ((max(xList) - min(xList)) * spacing)), (max(xList) + ((max(xList) - min(xList)) * spacing))])
if (min(y) >= 0):
plt.ylim([min(y), (max(y) + ((max(y) - min(y)) * spacing))])
else:
plt.ylim([(min(y) - ((max(y) - min(y)) * spacing)), (max(y) + ((max(y) - min(y)) * spacing))])
if (color is None):
plt.bar(xList, y, alpha=0.7, linewidth=lineWidth)
else:
for aColor in cMap:
if (aColor[0] == color):
plt.bar(xList, y, color=aColor[1], alpha=1, linewidth=lineWidth)
plt.xticks(xList, x)
plt.axhline(y=0, color='#ccc', linestyle=':', linewidth=lineWidth)
plt.show() | Plot bar graphs with given X labels and Y values lists, this function also supports other optional
parameters as shown below.
:param x: a list of X labels for the graphs
:param y: a list of Y coordinates for the bar graphs
:param title: overall title of the graph
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,
purple, darkred, orange, brown, pink and teal)
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical/horizontal spacing index
:return: None | Quanlse/Utils/Plot.py | plotBarGraph | baidu/Quanlse | 33 | python | def plotBarGraph(x: List[Any], y: List[float], title: str=, xLabel: str=, yLabel: str=, color: str='blue', lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1) -> None:
'\n Plot bar graphs with given X labels and Y values lists, this function also supports other optional\n parameters as shown below.\n\n :param x: a list of X labels for the graphs\n :param y: a list of Y coordinates for the bar graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,\n purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical/horizontal spacing index\n :return: None\n '
cMap = colorMap()
xList = numpy.arange(len(y))
plt.figure(1, (15, 10))
plt.rcParams['figure.figsize'] = (15, 10)
plt.rcParams['axes.linewidth'] = (lineWidth * 2)
if (title is not None):
plt.title(title, size=int((fontSize * 1.4)), weight='bold')
if (xLabel != ):
plt.xlabel(xLabel, size=int((fontSize * 1.2)), weight='bold')
if (yLabel != ):
plt.ylabel(yLabel, size=int((fontSize * 1.2)), weight='bold')
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
plt.xlim([(min(xList) - ((max(xList) - min(xList)) * spacing)), (max(xList) + ((max(xList) - min(xList)) * spacing))])
if (min(y) >= 0):
plt.ylim([min(y), (max(y) + ((max(y) - min(y)) * spacing))])
else:
plt.ylim([(min(y) - ((max(y) - min(y)) * spacing)), (max(y) + ((max(y) - min(y)) * spacing))])
if (color is None):
plt.bar(xList, y, alpha=0.7, linewidth=lineWidth)
else:
for aColor in cMap:
if (aColor[0] == color):
plt.bar(xList, y, color=aColor[1], alpha=1, linewidth=lineWidth)
plt.xticks(xList, x)
plt.axhline(y=0, color='#ccc', linestyle=':', linewidth=lineWidth)
plt.show() | def plotBarGraph(x: List[Any], y: List[float], title: str=, xLabel: str=, yLabel: str=, color: str='blue', lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1) -> None:
'\n Plot bar graphs with given X labels and Y values lists, this function also supports other optional\n parameters as shown below.\n\n :param x: a list of X labels for the graphs\n :param y: a list of Y coordinates for the bar graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,\n purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical/horizontal spacing index\n :return: None\n '
cMap = colorMap()
xList = numpy.arange(len(y))
plt.figure(1, (15, 10))
plt.rcParams['figure.figsize'] = (15, 10)
plt.rcParams['axes.linewidth'] = (lineWidth * 2)
if (title is not None):
plt.title(title, size=int((fontSize * 1.4)), weight='bold')
if (xLabel != ):
plt.xlabel(xLabel, size=int((fontSize * 1.2)), weight='bold')
if (yLabel != ):
plt.ylabel(yLabel, size=int((fontSize * 1.2)), weight='bold')
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
plt.xlim([(min(xList) - ((max(xList) - min(xList)) * spacing)), (max(xList) + ((max(xList) - min(xList)) * spacing))])
if (min(y) >= 0):
plt.ylim([min(y), (max(y) + ((max(y) - min(y)) * spacing))])
else:
plt.ylim([(min(y) - ((max(y) - min(y)) * spacing)), (max(y) + ((max(y) - min(y)) * spacing))])
if (color is None):
plt.bar(xList, y, alpha=0.7, linewidth=lineWidth)
else:
for aColor in cMap:
if (aColor[0] == color):
plt.bar(xList, y, color=aColor[1], alpha=1, linewidth=lineWidth)
plt.xticks(xList, x)
plt.axhline(y=0, color='#ccc', linestyle=':', linewidth=lineWidth)
plt.show()<|docstring|>Plot bar graphs with given X labels and Y values lists, this function also supports other optional
parameters as shown below.
:param x: a list of X labels for the graphs
:param y: a list of Y coordinates for the bar graphs
:param title: overall title of the graph
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,
purple, darkred, orange, brown, pink and teal)
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical/horizontal spacing index
:return: None<|endoftext|> |
d0aa4a68e08c3046e8d0a9927195880f01bd275ca29ad7c74e44a20d9643ba8f | def plotLineGraph(x: Union[(List[List[float]], List[float])], y: Union[(List[List[float]], List[float])], title: str='', xLabel: str='', yLabel: str='', legends: List[str]=None, color: List[str]=None, lineWidth: float=2.0, fontSize: float=10, spacing: float=0.05, log=False) -> None:
'\n Plot line graph, with the given 2-dimensional lists of X and Y values,\n this function also supports other optional parameters as shown below.\n\n :param x: a 2-dim list of X coordinates for the line graphs\n :param y: a 2-dim list of Y coordinates for the line graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param legends: a list of strings - a label each string\n :param color: a list of colors - a color for each line (unspecified lines will be of default color)\n (from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical spacing index\n :param log: log, default at false\n :return: None\n '
if (color is None):
color = ['blue', 'pink', 'cyan', 'mint', 'red']
if log:
tmp = y
y = numpy.log(numpy.array(y))
if (y.min() == (- numpy.Infinity)):
y = tmp
print("can't take log of zero, switch back to non-log mode")
cMap = colorMap()
plt.rcParams['figure.figsize'] = (8, 6)
plt.rcParams['axes.linewidth'] = (lineWidth * 0.75)
if (not isinstance(x[0], list)):
x = [x]
y = [y]
plt.figure(1, (15, 10))
maximumX = max(x[0])
minimumX = min(x[0])
maximumY = max(y[0])
minimumY = min(y[0])
for i in range(0, len(x)):
if (max(y[i]) > maximumY):
maximumY = max(y[i])
if (min(y[i]) < minimumY):
minimumY = min(y[i])
if (max(x[i]) > maximumX):
maximumX = max(x[i])
if (min(x[i]) < minimumX):
minimumX = min(x[i])
if ((color is None) or (i < 0) or (i >= len(color))):
if (legends is not None):
plt.plot(x[i], y[i], label=legends[i], linewidth=lineWidth, alpha=1)
else:
plt.plot(x[i], y[i], linewidth=lineWidth)
else:
flag = False
for aColor in cMap:
if (aColor[0] == color[i]):
flag = True
if (legends is not None):
plt.plot(x[i], y[i], color=aColor[1], linewidth=lineWidth, label=legends[i], alpha=1)
else:
plt.plot(x[i], y[i], color=aColor[1], linewidth=lineWidth, alpha=1)
if (flag is False):
raise ValueError('Color not found!')
plt.xlim([(minimumX - ((maximumX - minimumX) * spacing)), (maximumX + ((maximumX - minimumY) * spacing))])
plt.ylim([(minimumY - ((maximumY - minimumY) * spacing)), (maximumY + ((maximumY - minimumY) * spacing))])
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
if (title is not None):
plt.title(title, size=int((fontSize * 1.9)), weight='bold')
if (xLabel is not None):
plt.xlabel(xLabel, size=int((fontSize * 1.4)), weight='bold')
if (yLabel is not None):
plt.ylabel(yLabel, size=int((fontSize * 1.4)), weight='bold')
plt.legend()
plt.show() | Plot line graph, with the given 2-dimensional lists of X and Y values,
this function also supports other optional parameters as shown below.
:param x: a 2-dim list of X coordinates for the line graphs
:param y: a 2-dim list of Y coordinates for the line graphs
:param title: overall title of the graph
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param legends: a list of strings - a label each string
:param color: a list of colors - a color for each line (unspecified lines will be of default color)
(from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical spacing index
:param log: log, default at false
:return: None | Quanlse/Utils/Plot.py | plotLineGraph | baidu/Quanlse | 33 | python | def plotLineGraph(x: Union[(List[List[float]], List[float])], y: Union[(List[List[float]], List[float])], title: str=, xLabel: str=, yLabel: str=, legends: List[str]=None, color: List[str]=None, lineWidth: float=2.0, fontSize: float=10, spacing: float=0.05, log=False) -> None:
'\n Plot line graph, with the given 2-dimensional lists of X and Y values,\n this function also supports other optional parameters as shown below.\n\n :param x: a 2-dim list of X coordinates for the line graphs\n :param y: a 2-dim list of Y coordinates for the line graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param legends: a list of strings - a label each string\n :param color: a list of colors - a color for each line (unspecified lines will be of default color)\n (from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical spacing index\n :param log: log, default at false\n :return: None\n '
if (color is None):
color = ['blue', 'pink', 'cyan', 'mint', 'red']
if log:
tmp = y
y = numpy.log(numpy.array(y))
if (y.min() == (- numpy.Infinity)):
y = tmp
print("can't take log of zero, switch back to non-log mode")
cMap = colorMap()
plt.rcParams['figure.figsize'] = (8, 6)
plt.rcParams['axes.linewidth'] = (lineWidth * 0.75)
if (not isinstance(x[0], list)):
x = [x]
y = [y]
plt.figure(1, (15, 10))
maximumX = max(x[0])
minimumX = min(x[0])
maximumY = max(y[0])
minimumY = min(y[0])
for i in range(0, len(x)):
if (max(y[i]) > maximumY):
maximumY = max(y[i])
if (min(y[i]) < minimumY):
minimumY = min(y[i])
if (max(x[i]) > maximumX):
maximumX = max(x[i])
if (min(x[i]) < minimumX):
minimumX = min(x[i])
if ((color is None) or (i < 0) or (i >= len(color))):
if (legends is not None):
plt.plot(x[i], y[i], label=legends[i], linewidth=lineWidth, alpha=1)
else:
plt.plot(x[i], y[i], linewidth=lineWidth)
else:
flag = False
for aColor in cMap:
if (aColor[0] == color[i]):
flag = True
if (legends is not None):
plt.plot(x[i], y[i], color=aColor[1], linewidth=lineWidth, label=legends[i], alpha=1)
else:
plt.plot(x[i], y[i], color=aColor[1], linewidth=lineWidth, alpha=1)
if (flag is False):
raise ValueError('Color not found!')
plt.xlim([(minimumX - ((maximumX - minimumX) * spacing)), (maximumX + ((maximumX - minimumY) * spacing))])
plt.ylim([(minimumY - ((maximumY - minimumY) * spacing)), (maximumY + ((maximumY - minimumY) * spacing))])
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
if (title is not None):
plt.title(title, size=int((fontSize * 1.9)), weight='bold')
if (xLabel is not None):
plt.xlabel(xLabel, size=int((fontSize * 1.4)), weight='bold')
if (yLabel is not None):
plt.ylabel(yLabel, size=int((fontSize * 1.4)), weight='bold')
plt.legend()
plt.show() | def plotLineGraph(x: Union[(List[List[float]], List[float])], y: Union[(List[List[float]], List[float])], title: str=, xLabel: str=, yLabel: str=, legends: List[str]=None, color: List[str]=None, lineWidth: float=2.0, fontSize: float=10, spacing: float=0.05, log=False) -> None:
'\n Plot line graph, with the given 2-dimensional lists of X and Y values,\n this function also supports other optional parameters as shown below.\n\n :param x: a 2-dim list of X coordinates for the line graphs\n :param y: a 2-dim list of Y coordinates for the line graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param legends: a list of strings - a label each string\n :param color: a list of colors - a color for each line (unspecified lines will be of default color)\n (from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical spacing index\n :param log: log, default at false\n :return: None\n '
if (color is None):
color = ['blue', 'pink', 'cyan', 'mint', 'red']
if log:
tmp = y
y = numpy.log(numpy.array(y))
if (y.min() == (- numpy.Infinity)):
y = tmp
print("can't take log of zero, switch back to non-log mode")
cMap = colorMap()
plt.rcParams['figure.figsize'] = (8, 6)
plt.rcParams['axes.linewidth'] = (lineWidth * 0.75)
if (not isinstance(x[0], list)):
x = [x]
y = [y]
plt.figure(1, (15, 10))
maximumX = max(x[0])
minimumX = min(x[0])
maximumY = max(y[0])
minimumY = min(y[0])
for i in range(0, len(x)):
if (max(y[i]) > maximumY):
maximumY = max(y[i])
if (min(y[i]) < minimumY):
minimumY = min(y[i])
if (max(x[i]) > maximumX):
maximumX = max(x[i])
if (min(x[i]) < minimumX):
minimumX = min(x[i])
if ((color is None) or (i < 0) or (i >= len(color))):
if (legends is not None):
plt.plot(x[i], y[i], label=legends[i], linewidth=lineWidth, alpha=1)
else:
plt.plot(x[i], y[i], linewidth=lineWidth)
else:
flag = False
for aColor in cMap:
if (aColor[0] == color[i]):
flag = True
if (legends is not None):
plt.plot(x[i], y[i], color=aColor[1], linewidth=lineWidth, label=legends[i], alpha=1)
else:
plt.plot(x[i], y[i], color=aColor[1], linewidth=lineWidth, alpha=1)
if (flag is False):
raise ValueError('Color not found!')
plt.xlim([(minimumX - ((maximumX - minimumX) * spacing)), (maximumX + ((maximumX - minimumY) * spacing))])
plt.ylim([(minimumY - ((maximumY - minimumY) * spacing)), (maximumY + ((maximumY - minimumY) * spacing))])
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
if (title is not None):
plt.title(title, size=int((fontSize * 1.9)), weight='bold')
if (xLabel is not None):
plt.xlabel(xLabel, size=int((fontSize * 1.4)), weight='bold')
if (yLabel is not None):
plt.ylabel(yLabel, size=int((fontSize * 1.4)), weight='bold')
plt.legend()
plt.show()<|docstring|>Plot line graph, with the given 2-dimensional lists of X and Y values,
this function also supports other optional parameters as shown below.
:param x: a 2-dim list of X coordinates for the line graphs
:param y: a 2-dim list of Y coordinates for the line graphs
:param title: overall title of the graph
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param legends: a list of strings - a label each string
:param color: a list of colors - a color for each line (unspecified lines will be of default color)
(from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical spacing index
:param log: log, default at false
:return: None<|endoftext|> |
641b5f49b80e5b00be7a8093581cf3ffc19b2865613597102f968335c5c1c665 | def plotPulse(x: Union[(List[List[float]], List[float])], y: Union[(List[List[Union[(float, complex)]]], List[Union[(float, complex)]])], title: Union[(List[str], str)], yLabel: Union[(List[str], str)], color: Union[(List[str], str)], xLabel: str='', lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1, dark: bool=False, complx: bool=False) -> None:
'\n Plots pulse graphs, and is used in the plotWave() function in the Hamiltonian file. This function takes\n two mandatory two-dimensional lists of X and Y values. This function also supports other optional parameters\n as shown below.\n\n :param x: a 2-dim list consisting the time coordinates for each pulse\n :param y: a 2-dim list consisting the amplitudes for each pulse\n :param title: a list of titles, one for each pulse\n :param yLabel: a lists of y labels for each pulse\n :param xLabel: a string of x label (for all pulse)\n :param color: a list of colors for each pulse\n (from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)\n If pulse consists more than 250 cuts, switch to slice\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical spacing index\n :param dark: enables a dark-themed mode\n :param complx: enable complex plotting\n :return: None\n '
if dark:
fontColor = 'ghostwhite'
bgColor = '#1B1C21'
axisColor = 'grey'
else:
fontColor = 'black'
bgColor = 'white'
axisColor = 'black'
cMap = colorMap()
if (len(x) == 1):
(fig, ax1) = plt.subplots(len(x), 1, figsize=(16, ((len(x) * 1.5) + (3 / 4))))
ax = [ax1]
else:
(fig, ax) = plt.subplots(len(x), 1, figsize=(16, ((len(x) * 1.5) + (3 / 4))))
fig.patch.set_facecolor(bgColor)
for k in range(0, len(x)):
if (len(x[k]) != len(y[k])):
raise ArgumentError('Lengths of lists do not match')
maxPieces = 250
plotType = 'slice'
if ((len(y[k]) > maxPieces) or (complx is True)):
plotType = 'line'
colorFound = False
for aColor in cMap:
if (aColor[0] == color[k]):
colorFound = True
if (plotType == 'line'):
realY = [y[k][i].real for i in range(len(y[k]))]
comY = [y[k][i].imag for i in range(len(y[k]))]
ax[k].axhline(linewidth=(lineWidth * 1.3), color=axisColor, alpha=0.4, ls=':')
ax[k].plot(x[k], realY, color=aColor[1], linewidth=(lineWidth * 1.3))
ax[k].fill_between(x[k], 0, realY, facecolor=aColor[1], alpha=0.07)
if complx:
ax[k].plot(x[k], comY, color='darkviolet', linewidth=(lineWidth * 1.3))
ax[k].fill_between(x[k], 0, comY, facecolor='darkviolet', alpha=0.05)
elif (plotType != 'line'):
for i in x[k]:
i += ((x[k][1] - x[k][0]) / 2)
ax[k].bar(x[k], y[k], color=bgColor, alpha=1, width=(x[k][1] - x[k][0]), edgecolor=aColor[1], linewidth=(lineWidth * 1.3))
ax[k].bar(x[k], y[k], color=aColor[1], alpha=0.05, width=(x[k][1] - x[k][0]), linewidth=0)
break
if (not colorFound):
raise ValueError('Color not found!')
if (complx is False):
if (type(y[k][0]) is complex):
raise ValueError('Complex value found in non-complex mode!')
if (max(y[k]) == min(y[k])):
ax[k].set_ylim((min(y[k]) - (spacing * 10)), (max(y[k]) + (spacing * 10)))
else:
ax[k].set_ylim([(min(y[k]) - (((max(y[k]) - min(y[k])) * spacing) * 2.5)), (max(y[k]) + ((max(y[k]) - min(y[k])) * (spacing + 0.3)))])
ax[k].set_xlim(min(x[k]), max(x[k]))
else:
maxY = max(max(realY), max(comY))
minY = min(min(realY), min(comY))
if (maxY == minY):
ax[k].set_ylim((minY - (spacing * 10)), (maxY + (spacing * 10)))
else:
ax[k].set_ylim([(minY - (((maxY - minY) * spacing) * 2.5)), (maxY + ((maxY - minY) * (spacing + 0.3)))])
ax[k].set_xlim(min(x[k]), max(x[k]))
if (k != (len(x) - 1)):
ax[k].set_xticks([])
else:
ax[k].set_xlabel(xLabel, size=(fontSize * 1.6))
ax[k].set_title((title[k] + ' '), fontdict={'fontsize': 15, 'fontweight': 'bold'}, y=0.75, loc='right', color=fontColor)
ax[k].set_ylabel(yLabel[k], size=(fontSize * 1.4))
ax[k].yaxis.set_major_formatter(FormatStrFormatter('%.1f'))
ax[k].tick_params(labelsize=(fontSize * 1.3))
ax[k].spines['top'].set_linewidth(1.5)
ax[k].spines['bottom'].set_linewidth(1.5)
ax[k].spines['left'].set_linewidth(1.5)
ax[k].spines['right'].set_linewidth(1.5)
ax[k].spines['bottom'].set_color(axisColor)
ax[k].spines['right'].set_color(axisColor)
ax[k].spines['left'].set_color(axisColor)
ax[k].spines['top'].set_color(axisColor)
ax[k].xaxis.label.set_color(fontColor)
ax[k].yaxis.label.set_color(fontColor)
ax[k].tick_params(axis='x', colors=fontColor)
ax[k].tick_params(axis='y', colors=fontColor)
ax[k].set_facecolor(bgColor)
fig.canvas.draw()
for i in range(len(ax[k].get_yticklabels())):
for j in range(len(ax[k].get_yticklabels())):
if ((ax[k].get_yticklabels()[i].get_text() == '0.0') and (ax[k].get_yticklabels()[j].get_text() == '-0.0')):
ax[k].yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
break
if ((ax[k].get_yticklabels()[i].get_text() == ax[k].get_yticklabels()[j].get_text()) and (i != j)):
ax[k].yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
break
fig.align_ylabels(ax[:])
plt.show() | Plots pulse graphs, and is used in the plotWave() function in the Hamiltonian file. This function takes
two mandatory two-dimensional lists of X and Y values. This function also supports other optional parameters
as shown below.
:param x: a 2-dim list consisting the time coordinates for each pulse
:param y: a 2-dim list consisting the amplitudes for each pulse
:param title: a list of titles, one for each pulse
:param yLabel: a lists of y labels for each pulse
:param xLabel: a string of x label (for all pulse)
:param color: a list of colors for each pulse
(from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)
If pulse consists more than 250 cuts, switch to slice
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical spacing index
:param dark: enables a dark-themed mode
:param complx: enable complex plotting
:return: None | Quanlse/Utils/Plot.py | plotPulse | baidu/Quanlse | 33 | python | def plotPulse(x: Union[(List[List[float]], List[float])], y: Union[(List[List[Union[(float, complex)]]], List[Union[(float, complex)]])], title: Union[(List[str], str)], yLabel: Union[(List[str], str)], color: Union[(List[str], str)], xLabel: str=, lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1, dark: bool=False, complx: bool=False) -> None:
'\n Plots pulse graphs, and is used in the plotWave() function in the Hamiltonian file. This function takes\n two mandatory two-dimensional lists of X and Y values. This function also supports other optional parameters\n as shown below.\n\n :param x: a 2-dim list consisting the time coordinates for each pulse\n :param y: a 2-dim list consisting the amplitudes for each pulse\n :param title: a list of titles, one for each pulse\n :param yLabel: a lists of y labels for each pulse\n :param xLabel: a string of x label (for all pulse)\n :param color: a list of colors for each pulse\n (from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)\n If pulse consists more than 250 cuts, switch to slice\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical spacing index\n :param dark: enables a dark-themed mode\n :param complx: enable complex plotting\n :return: None\n '
if dark:
fontColor = 'ghostwhite'
bgColor = '#1B1C21'
axisColor = 'grey'
else:
fontColor = 'black'
bgColor = 'white'
axisColor = 'black'
cMap = colorMap()
if (len(x) == 1):
(fig, ax1) = plt.subplots(len(x), 1, figsize=(16, ((len(x) * 1.5) + (3 / 4))))
ax = [ax1]
else:
(fig, ax) = plt.subplots(len(x), 1, figsize=(16, ((len(x) * 1.5) + (3 / 4))))
fig.patch.set_facecolor(bgColor)
for k in range(0, len(x)):
if (len(x[k]) != len(y[k])):
raise ArgumentError('Lengths of lists do not match')
maxPieces = 250
plotType = 'slice'
if ((len(y[k]) > maxPieces) or (complx is True)):
plotType = 'line'
colorFound = False
for aColor in cMap:
if (aColor[0] == color[k]):
colorFound = True
if (plotType == 'line'):
realY = [y[k][i].real for i in range(len(y[k]))]
comY = [y[k][i].imag for i in range(len(y[k]))]
ax[k].axhline(linewidth=(lineWidth * 1.3), color=axisColor, alpha=0.4, ls=':')
ax[k].plot(x[k], realY, color=aColor[1], linewidth=(lineWidth * 1.3))
ax[k].fill_between(x[k], 0, realY, facecolor=aColor[1], alpha=0.07)
if complx:
ax[k].plot(x[k], comY, color='darkviolet', linewidth=(lineWidth * 1.3))
ax[k].fill_between(x[k], 0, comY, facecolor='darkviolet', alpha=0.05)
elif (plotType != 'line'):
for i in x[k]:
i += ((x[k][1] - x[k][0]) / 2)
ax[k].bar(x[k], y[k], color=bgColor, alpha=1, width=(x[k][1] - x[k][0]), edgecolor=aColor[1], linewidth=(lineWidth * 1.3))
ax[k].bar(x[k], y[k], color=aColor[1], alpha=0.05, width=(x[k][1] - x[k][0]), linewidth=0)
break
if (not colorFound):
raise ValueError('Color not found!')
if (complx is False):
if (type(y[k][0]) is complex):
raise ValueError('Complex value found in non-complex mode!')
if (max(y[k]) == min(y[k])):
ax[k].set_ylim((min(y[k]) - (spacing * 10)), (max(y[k]) + (spacing * 10)))
else:
ax[k].set_ylim([(min(y[k]) - (((max(y[k]) - min(y[k])) * spacing) * 2.5)), (max(y[k]) + ((max(y[k]) - min(y[k])) * (spacing + 0.3)))])
ax[k].set_xlim(min(x[k]), max(x[k]))
else:
maxY = max(max(realY), max(comY))
minY = min(min(realY), min(comY))
if (maxY == minY):
ax[k].set_ylim((minY - (spacing * 10)), (maxY + (spacing * 10)))
else:
ax[k].set_ylim([(minY - (((maxY - minY) * spacing) * 2.5)), (maxY + ((maxY - minY) * (spacing + 0.3)))])
ax[k].set_xlim(min(x[k]), max(x[k]))
if (k != (len(x) - 1)):
ax[k].set_xticks([])
else:
ax[k].set_xlabel(xLabel, size=(fontSize * 1.6))
ax[k].set_title((title[k] + ' '), fontdict={'fontsize': 15, 'fontweight': 'bold'}, y=0.75, loc='right', color=fontColor)
ax[k].set_ylabel(yLabel[k], size=(fontSize * 1.4))
ax[k].yaxis.set_major_formatter(FormatStrFormatter('%.1f'))
ax[k].tick_params(labelsize=(fontSize * 1.3))
ax[k].spines['top'].set_linewidth(1.5)
ax[k].spines['bottom'].set_linewidth(1.5)
ax[k].spines['left'].set_linewidth(1.5)
ax[k].spines['right'].set_linewidth(1.5)
ax[k].spines['bottom'].set_color(axisColor)
ax[k].spines['right'].set_color(axisColor)
ax[k].spines['left'].set_color(axisColor)
ax[k].spines['top'].set_color(axisColor)
ax[k].xaxis.label.set_color(fontColor)
ax[k].yaxis.label.set_color(fontColor)
ax[k].tick_params(axis='x', colors=fontColor)
ax[k].tick_params(axis='y', colors=fontColor)
ax[k].set_facecolor(bgColor)
fig.canvas.draw()
for i in range(len(ax[k].get_yticklabels())):
for j in range(len(ax[k].get_yticklabels())):
if ((ax[k].get_yticklabels()[i].get_text() == '0.0') and (ax[k].get_yticklabels()[j].get_text() == '-0.0')):
ax[k].yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
break
if ((ax[k].get_yticklabels()[i].get_text() == ax[k].get_yticklabels()[j].get_text()) and (i != j)):
ax[k].yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
break
fig.align_ylabels(ax[:])
plt.show() | def plotPulse(x: Union[(List[List[float]], List[float])], y: Union[(List[List[Union[(float, complex)]]], List[Union[(float, complex)]])], title: Union[(List[str], str)], yLabel: Union[(List[str], str)], color: Union[(List[str], str)], xLabel: str=, lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1, dark: bool=False, complx: bool=False) -> None:
'\n Plots pulse graphs, and is used in the plotWave() function in the Hamiltonian file. This function takes\n two mandatory two-dimensional lists of X and Y values. This function also supports other optional parameters\n as shown below.\n\n :param x: a 2-dim list consisting the time coordinates for each pulse\n :param y: a 2-dim list consisting the amplitudes for each pulse\n :param title: a list of titles, one for each pulse\n :param yLabel: a lists of y labels for each pulse\n :param xLabel: a string of x label (for all pulse)\n :param color: a list of colors for each pulse\n (from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)\n If pulse consists more than 250 cuts, switch to slice\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical spacing index\n :param dark: enables a dark-themed mode\n :param complx: enable complex plotting\n :return: None\n '
if dark:
fontColor = 'ghostwhite'
bgColor = '#1B1C21'
axisColor = 'grey'
else:
fontColor = 'black'
bgColor = 'white'
axisColor = 'black'
cMap = colorMap()
if (len(x) == 1):
(fig, ax1) = plt.subplots(len(x), 1, figsize=(16, ((len(x) * 1.5) + (3 / 4))))
ax = [ax1]
else:
(fig, ax) = plt.subplots(len(x), 1, figsize=(16, ((len(x) * 1.5) + (3 / 4))))
fig.patch.set_facecolor(bgColor)
for k in range(0, len(x)):
if (len(x[k]) != len(y[k])):
raise ArgumentError('Lengths of lists do not match')
maxPieces = 250
plotType = 'slice'
if ((len(y[k]) > maxPieces) or (complx is True)):
plotType = 'line'
colorFound = False
for aColor in cMap:
if (aColor[0] == color[k]):
colorFound = True
if (plotType == 'line'):
realY = [y[k][i].real for i in range(len(y[k]))]
comY = [y[k][i].imag for i in range(len(y[k]))]
ax[k].axhline(linewidth=(lineWidth * 1.3), color=axisColor, alpha=0.4, ls=':')
ax[k].plot(x[k], realY, color=aColor[1], linewidth=(lineWidth * 1.3))
ax[k].fill_between(x[k], 0, realY, facecolor=aColor[1], alpha=0.07)
if complx:
ax[k].plot(x[k], comY, color='darkviolet', linewidth=(lineWidth * 1.3))
ax[k].fill_between(x[k], 0, comY, facecolor='darkviolet', alpha=0.05)
elif (plotType != 'line'):
for i in x[k]:
i += ((x[k][1] - x[k][0]) / 2)
ax[k].bar(x[k], y[k], color=bgColor, alpha=1, width=(x[k][1] - x[k][0]), edgecolor=aColor[1], linewidth=(lineWidth * 1.3))
ax[k].bar(x[k], y[k], color=aColor[1], alpha=0.05, width=(x[k][1] - x[k][0]), linewidth=0)
break
if (not colorFound):
raise ValueError('Color not found!')
if (complx is False):
if (type(y[k][0]) is complex):
raise ValueError('Complex value found in non-complex mode!')
if (max(y[k]) == min(y[k])):
ax[k].set_ylim((min(y[k]) - (spacing * 10)), (max(y[k]) + (spacing * 10)))
else:
ax[k].set_ylim([(min(y[k]) - (((max(y[k]) - min(y[k])) * spacing) * 2.5)), (max(y[k]) + ((max(y[k]) - min(y[k])) * (spacing + 0.3)))])
ax[k].set_xlim(min(x[k]), max(x[k]))
else:
maxY = max(max(realY), max(comY))
minY = min(min(realY), min(comY))
if (maxY == minY):
ax[k].set_ylim((minY - (spacing * 10)), (maxY + (spacing * 10)))
else:
ax[k].set_ylim([(minY - (((maxY - minY) * spacing) * 2.5)), (maxY + ((maxY - minY) * (spacing + 0.3)))])
ax[k].set_xlim(min(x[k]), max(x[k]))
if (k != (len(x) - 1)):
ax[k].set_xticks([])
else:
ax[k].set_xlabel(xLabel, size=(fontSize * 1.6))
ax[k].set_title((title[k] + ' '), fontdict={'fontsize': 15, 'fontweight': 'bold'}, y=0.75, loc='right', color=fontColor)
ax[k].set_ylabel(yLabel[k], size=(fontSize * 1.4))
ax[k].yaxis.set_major_formatter(FormatStrFormatter('%.1f'))
ax[k].tick_params(labelsize=(fontSize * 1.3))
ax[k].spines['top'].set_linewidth(1.5)
ax[k].spines['bottom'].set_linewidth(1.5)
ax[k].spines['left'].set_linewidth(1.5)
ax[k].spines['right'].set_linewidth(1.5)
ax[k].spines['bottom'].set_color(axisColor)
ax[k].spines['right'].set_color(axisColor)
ax[k].spines['left'].set_color(axisColor)
ax[k].spines['top'].set_color(axisColor)
ax[k].xaxis.label.set_color(fontColor)
ax[k].yaxis.label.set_color(fontColor)
ax[k].tick_params(axis='x', colors=fontColor)
ax[k].tick_params(axis='y', colors=fontColor)
ax[k].set_facecolor(bgColor)
fig.canvas.draw()
for i in range(len(ax[k].get_yticklabels())):
for j in range(len(ax[k].get_yticklabels())):
if ((ax[k].get_yticklabels()[i].get_text() == '0.0') and (ax[k].get_yticklabels()[j].get_text() == '-0.0')):
ax[k].yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
break
if ((ax[k].get_yticklabels()[i].get_text() == ax[k].get_yticklabels()[j].get_text()) and (i != j)):
ax[k].yaxis.set_major_formatter(mtick.FormatStrFormatter('%.2e'))
break
fig.align_ylabels(ax[:])
plt.show()<|docstring|>Plots pulse graphs, and is used in the plotWave() function in the Hamiltonian file. This function takes
two mandatory two-dimensional lists of X and Y values. This function also supports other optional parameters
as shown below.
:param x: a 2-dim list consisting the time coordinates for each pulse
:param y: a 2-dim list consisting the amplitudes for each pulse
:param title: a list of titles, one for each pulse
:param yLabel: a lists of y labels for each pulse
:param xLabel: a string of x label (for all pulse)
:param color: a list of colors for each pulse
(from mint, blue, red, green, yellow, black, pink, cyan, purple, darkred, orange, brown, pink and teal)
If pulse consists more than 250 cuts, switch to slice
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical spacing index
:param dark: enables a dark-themed mode
:param complx: enable complex plotting
:return: None<|endoftext|> |
3748af44694bcc6723e077996bca4f4adcb8e3c7c682130caf30911dcc82466b | def plotProcess(chi: Dict[(str, Any)]) -> None:
'\n Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,\n which is directly generated from processTomography.\n\n :param chi: Chi Dictionary that is obtained from processTomography\n :return: None\n '
fig = plt.figure(figsize=(12, 6))
ax2 = fig.add_subplot(121, projection='3d')
ax1 = fig.add_subplot(122, projection='3d')
numX = len(chi['XLabel'])
numY = len(chi['YLabel'])
_x = numpy.arange(numX)
_y = numpy.arange(numY)
(_xx, _yy) = numpy.meshgrid(_x, _y)
(x, y) = (_xx.ravel(), _yy.ravel())
top = numpy.reshape(chi['Imag'], (numX * numY))
bottom = numpy.zeros_like(top)
width = depth = 0.7
ax1.bar3d(x, y, bottom, width, depth, top, shade=True, color='r')
ax1.set_xticks(numpy.linspace(0.5, (numX - 0.5), numX))
ax1.set_yticks(numpy.linspace(0.5, (numY - 0.5), numY))
ax1.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
ax1.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
ax1.set_title('Chi Matrix - Imaginary Parts', fontsize=18)
ax1.set_zlim((- 0.5), 0.5)
top = numpy.reshape(chi['Real'], (numX * numY))
bottom = numpy.zeros_like(top)
ax2.bar3d(x, y, bottom, width, depth, top, shade=True, color='c')
ax2.set_xticks(numpy.linspace(0.5, (numX - 0.5), numX))
ax2.set_yticks(numpy.linspace(0.5, (numY - 0.5), numY))
ax2.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
ax2.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
ax2.set_title('Chi Matrix - Real Parts', fontsize=18)
ax2.set_zlim((- 0.5), 0.5)
plt.show() | Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,
which is directly generated from processTomography.
:param chi: Chi Dictionary that is obtained from processTomography
:return: None | Quanlse/Utils/Plot.py | plotProcess | baidu/Quanlse | 33 | python | def plotProcess(chi: Dict[(str, Any)]) -> None:
'\n Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,\n which is directly generated from processTomography.\n\n :param chi: Chi Dictionary that is obtained from processTomography\n :return: None\n '
fig = plt.figure(figsize=(12, 6))
ax2 = fig.add_subplot(121, projection='3d')
ax1 = fig.add_subplot(122, projection='3d')
numX = len(chi['XLabel'])
numY = len(chi['YLabel'])
_x = numpy.arange(numX)
_y = numpy.arange(numY)
(_xx, _yy) = numpy.meshgrid(_x, _y)
(x, y) = (_xx.ravel(), _yy.ravel())
top = numpy.reshape(chi['Imag'], (numX * numY))
bottom = numpy.zeros_like(top)
width = depth = 0.7
ax1.bar3d(x, y, bottom, width, depth, top, shade=True, color='r')
ax1.set_xticks(numpy.linspace(0.5, (numX - 0.5), numX))
ax1.set_yticks(numpy.linspace(0.5, (numY - 0.5), numY))
ax1.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
ax1.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
ax1.set_title('Chi Matrix - Imaginary Parts', fontsize=18)
ax1.set_zlim((- 0.5), 0.5)
top = numpy.reshape(chi['Real'], (numX * numY))
bottom = numpy.zeros_like(top)
ax2.bar3d(x, y, bottom, width, depth, top, shade=True, color='c')
ax2.set_xticks(numpy.linspace(0.5, (numX - 0.5), numX))
ax2.set_yticks(numpy.linspace(0.5, (numY - 0.5), numY))
ax2.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
ax2.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
ax2.set_title('Chi Matrix - Real Parts', fontsize=18)
ax2.set_zlim((- 0.5), 0.5)
plt.show() | def plotProcess(chi: Dict[(str, Any)]) -> None:
'\n Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,\n which is directly generated from processTomography.\n\n :param chi: Chi Dictionary that is obtained from processTomography\n :return: None\n '
fig = plt.figure(figsize=(12, 6))
ax2 = fig.add_subplot(121, projection='3d')
ax1 = fig.add_subplot(122, projection='3d')
numX = len(chi['XLabel'])
numY = len(chi['YLabel'])
_x = numpy.arange(numX)
_y = numpy.arange(numY)
(_xx, _yy) = numpy.meshgrid(_x, _y)
(x, y) = (_xx.ravel(), _yy.ravel())
top = numpy.reshape(chi['Imag'], (numX * numY))
bottom = numpy.zeros_like(top)
width = depth = 0.7
ax1.bar3d(x, y, bottom, width, depth, top, shade=True, color='r')
ax1.set_xticks(numpy.linspace(0.5, (numX - 0.5), numX))
ax1.set_yticks(numpy.linspace(0.5, (numY - 0.5), numY))
ax1.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
ax1.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
ax1.set_title('Chi Matrix - Imaginary Parts', fontsize=18)
ax1.set_zlim((- 0.5), 0.5)
top = numpy.reshape(chi['Real'], (numX * numY))
bottom = numpy.zeros_like(top)
ax2.bar3d(x, y, bottom, width, depth, top, shade=True, color='c')
ax2.set_xticks(numpy.linspace(0.5, (numX - 0.5), numX))
ax2.set_yticks(numpy.linspace(0.5, (numY - 0.5), numY))
ax2.w_xaxis.set_ticklabels(chi['XLabel'], fontsize=12)
ax2.w_yaxis.set_ticklabels(chi['YLabel'], fontsize=12)
ax2.set_title('Chi Matrix - Real Parts', fontsize=18)
ax2.set_zlim((- 0.5), 0.5)
plt.show()<|docstring|>Generate the Process Tomography Plot in 3D. This function takes a mandatory dictionary Chi,
which is directly generated from processTomography.
:param chi: Chi Dictionary that is obtained from processTomography
:return: None<|endoftext|> |
f81614bb3980909ac5425b1b554f8ac64cc2d7600f673973fb7a58b49d48e935 | def plotHeatMap(matrix: numpy.ndarray, xTicks: List=None, yTicks: List=None, xLabel: str='', yLabel: str='', useLog: bool=False, cMap: str='cividis') -> None:
'\n Plot a 2D heat map.\n\n :param matrix: the values of each square\n :param xTicks: ticks on X axis\n :param yTicks: ticks on Y axis\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param useLog: format ticks on a log scale\n :param cMap: indicate color_map\n :return: None\n '
ax = plt.gca()
if useLog:
_matrix = numpy.log10(matrix)
im = ax.imshow(_matrix, cmap=cMap, vmin=(- 10), vmax=0)
else:
_matrix = matrix
im = ax.imshow(_matrix, cmap=cMap)
for (edge, spine) in ax.spines.items():
spine.set_visible(False)
ax.set_xticks(numpy.arange(numpy.shape(_matrix)[1]))
ax.set_yticks(numpy.arange(numpy.shape(_matrix)[0]))
ax.grid(which='minor', color='w', linestyle='-', linewidth=3)
ax.tick_params(which='minor', bottom=False, left=False)
if (xTicks is None):
ax.set_xticklabels(numpy.arange(numpy.shape(_matrix)[1]))
else:
ax.set_xticklabels(xTicks)
if (yTicks is None):
ax.set_yticklabels(numpy.arange(numpy.shape(_matrix)[0]))
else:
ax.set_yticklabels(yTicks)
im_ratio = (numpy.shape(_matrix)[0] / numpy.shape(_matrix)[1])
if useLog:
cbar = ax.figure.colorbar(im, ax=ax, fraction=(0.046 * im_ratio), pad=0.04)
cbar.ax.set_ylabel('$\\log_{10}(Population)$', rotation=(- 90), va='bottom')
else:
cbar = ax.figure.colorbar(im, ax=ax, fraction=(0.046 * im_ratio), pad=0.04)
cbar.ax.set_ylabel('Population', rotation=(- 90), va='bottom')
valFormat = '{x:.2f}'
threshold = (im.norm(numpy.max(_matrix)) / 2.0)
textColors = ('black', 'white')
kw = dict(horizontalalignment='center', verticalalignment='center')
for i in range(numpy.shape(_matrix)[0]):
for j in range(numpy.shape(_matrix)[1]):
value = float(_matrix[(i, j)])
kw.update(color=textColors[int((im.norm(value) < threshold))])
im.axes.text(j, i, str(round(value, 2)), **kw)
plt.xlabel(xLabel)
plt.ylabel(yLabel)
plt.show() | Plot a 2D heat map.
:param matrix: the values of each square
:param xTicks: ticks on X axis
:param yTicks: ticks on Y axis
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param useLog: format ticks on a log scale
:param cMap: indicate color_map
:return: None | Quanlse/Utils/Plot.py | plotHeatMap | baidu/Quanlse | 33 | python | def plotHeatMap(matrix: numpy.ndarray, xTicks: List=None, yTicks: List=None, xLabel: str=, yLabel: str=, useLog: bool=False, cMap: str='cividis') -> None:
'\n Plot a 2D heat map.\n\n :param matrix: the values of each square\n :param xTicks: ticks on X axis\n :param yTicks: ticks on Y axis\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param useLog: format ticks on a log scale\n :param cMap: indicate color_map\n :return: None\n '
ax = plt.gca()
if useLog:
_matrix = numpy.log10(matrix)
im = ax.imshow(_matrix, cmap=cMap, vmin=(- 10), vmax=0)
else:
_matrix = matrix
im = ax.imshow(_matrix, cmap=cMap)
for (edge, spine) in ax.spines.items():
spine.set_visible(False)
ax.set_xticks(numpy.arange(numpy.shape(_matrix)[1]))
ax.set_yticks(numpy.arange(numpy.shape(_matrix)[0]))
ax.grid(which='minor', color='w', linestyle='-', linewidth=3)
ax.tick_params(which='minor', bottom=False, left=False)
if (xTicks is None):
ax.set_xticklabels(numpy.arange(numpy.shape(_matrix)[1]))
else:
ax.set_xticklabels(xTicks)
if (yTicks is None):
ax.set_yticklabels(numpy.arange(numpy.shape(_matrix)[0]))
else:
ax.set_yticklabels(yTicks)
im_ratio = (numpy.shape(_matrix)[0] / numpy.shape(_matrix)[1])
if useLog:
cbar = ax.figure.colorbar(im, ax=ax, fraction=(0.046 * im_ratio), pad=0.04)
cbar.ax.set_ylabel('$\\log_{10}(Population)$', rotation=(- 90), va='bottom')
else:
cbar = ax.figure.colorbar(im, ax=ax, fraction=(0.046 * im_ratio), pad=0.04)
cbar.ax.set_ylabel('Population', rotation=(- 90), va='bottom')
valFormat = '{x:.2f}'
threshold = (im.norm(numpy.max(_matrix)) / 2.0)
textColors = ('black', 'white')
kw = dict(horizontalalignment='center', verticalalignment='center')
for i in range(numpy.shape(_matrix)[0]):
for j in range(numpy.shape(_matrix)[1]):
value = float(_matrix[(i, j)])
kw.update(color=textColors[int((im.norm(value) < threshold))])
im.axes.text(j, i, str(round(value, 2)), **kw)
plt.xlabel(xLabel)
plt.ylabel(yLabel)
plt.show() | def plotHeatMap(matrix: numpy.ndarray, xTicks: List=None, yTicks: List=None, xLabel: str=, yLabel: str=, useLog: bool=False, cMap: str='cividis') -> None:
'\n Plot a 2D heat map.\n\n :param matrix: the values of each square\n :param xTicks: ticks on X axis\n :param yTicks: ticks on Y axis\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param useLog: format ticks on a log scale\n :param cMap: indicate color_map\n :return: None\n '
ax = plt.gca()
if useLog:
_matrix = numpy.log10(matrix)
im = ax.imshow(_matrix, cmap=cMap, vmin=(- 10), vmax=0)
else:
_matrix = matrix
im = ax.imshow(_matrix, cmap=cMap)
for (edge, spine) in ax.spines.items():
spine.set_visible(False)
ax.set_xticks(numpy.arange(numpy.shape(_matrix)[1]))
ax.set_yticks(numpy.arange(numpy.shape(_matrix)[0]))
ax.grid(which='minor', color='w', linestyle='-', linewidth=3)
ax.tick_params(which='minor', bottom=False, left=False)
if (xTicks is None):
ax.set_xticklabels(numpy.arange(numpy.shape(_matrix)[1]))
else:
ax.set_xticklabels(xTicks)
if (yTicks is None):
ax.set_yticklabels(numpy.arange(numpy.shape(_matrix)[0]))
else:
ax.set_yticklabels(yTicks)
im_ratio = (numpy.shape(_matrix)[0] / numpy.shape(_matrix)[1])
if useLog:
cbar = ax.figure.colorbar(im, ax=ax, fraction=(0.046 * im_ratio), pad=0.04)
cbar.ax.set_ylabel('$\\log_{10}(Population)$', rotation=(- 90), va='bottom')
else:
cbar = ax.figure.colorbar(im, ax=ax, fraction=(0.046 * im_ratio), pad=0.04)
cbar.ax.set_ylabel('Population', rotation=(- 90), va='bottom')
valFormat = '{x:.2f}'
threshold = (im.norm(numpy.max(_matrix)) / 2.0)
textColors = ('black', 'white')
kw = dict(horizontalalignment='center', verticalalignment='center')
for i in range(numpy.shape(_matrix)[0]):
for j in range(numpy.shape(_matrix)[1]):
value = float(_matrix[(i, j)])
kw.update(color=textColors[int((im.norm(value) < threshold))])
im.axes.text(j, i, str(round(value, 2)), **kw)
plt.xlabel(xLabel)
plt.ylabel(yLabel)
plt.show()<|docstring|>Plot a 2D heat map.
:param matrix: the values of each square
:param xTicks: ticks on X axis
:param yTicks: ticks on Y axis
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param useLog: format ticks on a log scale
:param cMap: indicate color_map
:return: None<|endoftext|> |
14be0ecece9d6a225c5fde3f09fdc2b372ba9e65cf5959a281f8a4f6c55be8b4 | def colorMap():
'\n Default color setting.\n\n :return: Color map\n '
return [['mint', 'mediumspringgreen'], ['lightblue', 'deepskyblue'], ['blue', 'cornflowerblue'], ['yellow', 'yellow'], ['green', 'forestgreen'], ['red', 'crimson'], ['gold', 'gold'], ['black', 'black'], ['cyan', 'darkturquoise'], ['purple', 'darkviolet'], ['teal', 'teal'], ['darkred', 'darkred'], ['orange', 'orangered'], ['brown', 'peru'], ['pink', 'deeppink']] | Default color setting.
:return: Color map | Quanlse/Utils/Plot.py | colorMap | baidu/Quanlse | 33 | python | def colorMap():
'\n Default color setting.\n\n :return: Color map\n '
return [['mint', 'mediumspringgreen'], ['lightblue', 'deepskyblue'], ['blue', 'cornflowerblue'], ['yellow', 'yellow'], ['green', 'forestgreen'], ['red', 'crimson'], ['gold', 'gold'], ['black', 'black'], ['cyan', 'darkturquoise'], ['purple', 'darkviolet'], ['teal', 'teal'], ['darkred', 'darkred'], ['orange', 'orangered'], ['brown', 'peru'], ['pink', 'deeppink']] | def colorMap():
'\n Default color setting.\n\n :return: Color map\n '
return [['mint', 'mediumspringgreen'], ['lightblue', 'deepskyblue'], ['blue', 'cornflowerblue'], ['yellow', 'yellow'], ['green', 'forestgreen'], ['red', 'crimson'], ['gold', 'gold'], ['black', 'black'], ['cyan', 'darkturquoise'], ['purple', 'darkviolet'], ['teal', 'teal'], ['darkred', 'darkred'], ['orange', 'orangered'], ['brown', 'peru'], ['pink', 'deeppink']]<|docstring|>Default color setting.
:return: Color map<|endoftext|> |
bfb0b0ea3e289c96fe203f2931f9f13bf5404c0538e82b2f8a1831ddc69e5186 | def plotIonPosition(ionPos: List[Any]) -> None:
'\n Plot the position of the ion in the equilibrium.\n\n :param ionPos: the positions of the ions.\n :return: None\n '
plt.figure()
plt.scatter(numpy.array(ionPos), numpy.zeros(numpy.size(ionPos)), s=100)
plt.title('Ions equilibrium position', fontsize='large', fontweight='bold')
font2 = {'family': 'Times New Roman', 'weight': 'bold', 'size': 15}
plt.xlabel('Z axial ($\\mu$m)', font2)
plt.ylabel('XY plane', font2)
ax = plt.gca()
ax.spines['bottom'].set_linewidth(2)
ax.spines['left'].set_linewidth(2)
ax.spines['right'].set_linewidth(2)
ax.spines['top'].set_linewidth(2)
plt.tick_params(labelsize=15)
plt.show() | Plot the position of the ion in the equilibrium.
:param ionPos: the positions of the ions.
:return: None | Quanlse/Utils/Plot.py | plotIonPosition | baidu/Quanlse | 33 | python | def plotIonPosition(ionPos: List[Any]) -> None:
'\n Plot the position of the ion in the equilibrium.\n\n :param ionPos: the positions of the ions.\n :return: None\n '
plt.figure()
plt.scatter(numpy.array(ionPos), numpy.zeros(numpy.size(ionPos)), s=100)
plt.title('Ions equilibrium position', fontsize='large', fontweight='bold')
font2 = {'family': 'Times New Roman', 'weight': 'bold', 'size': 15}
plt.xlabel('Z axial ($\\mu$m)', font2)
plt.ylabel('XY plane', font2)
ax = plt.gca()
ax.spines['bottom'].set_linewidth(2)
ax.spines['left'].set_linewidth(2)
ax.spines['right'].set_linewidth(2)
ax.spines['top'].set_linewidth(2)
plt.tick_params(labelsize=15)
plt.show() | def plotIonPosition(ionPos: List[Any]) -> None:
'\n Plot the position of the ion in the equilibrium.\n\n :param ionPos: the positions of the ions.\n :return: None\n '
plt.figure()
plt.scatter(numpy.array(ionPos), numpy.zeros(numpy.size(ionPos)), s=100)
plt.title('Ions equilibrium position', fontsize='large', fontweight='bold')
font2 = {'family': 'Times New Roman', 'weight': 'bold', 'size': 15}
plt.xlabel('Z axial ($\\mu$m)', font2)
plt.ylabel('XY plane', font2)
ax = plt.gca()
ax.spines['bottom'].set_linewidth(2)
ax.spines['left'].set_linewidth(2)
ax.spines['right'].set_linewidth(2)
ax.spines['top'].set_linewidth(2)
plt.tick_params(labelsize=15)
plt.show()<|docstring|>Plot the position of the ion in the equilibrium.
:param ionPos: the positions of the ions.
:return: None<|endoftext|> |
ef4f40da6d5f3bf0074e2b28418f3e98a45ad6f3def6889cd12fdf94a129dae7 | def plotPop(x: List[Any], y: List[float], title: str='', xLabel: str='', yLabel: str='', color: str='purple', lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1) -> None:
'\n Plot bar graphs with given X labels and Y values lists, this function also supports other optional\n parameters as shown below.\n\n :param x: a list of X labels for the graphs\n :param y: a list of Y coordinates for the bar graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,\n purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical/horizontal spacing index\n :return: None\n '
cMap = colorMap()
xList = numpy.arange(len(y))
plt.figure(1, (15, 10))
plt.rcParams['figure.figsize'] = (15, 10)
plt.rcParams['axes.linewidth'] = (lineWidth * 2)
if (title is not None):
plt.title(title, size=int((fontSize * 1.4)), weight='bold')
if (xLabel != ''):
plt.xlabel(xLabel, size=int((fontSize * 1.2)), weight='bold')
if (yLabel != ''):
plt.ylabel(yLabel, size=int((fontSize * 1.2)), weight='bold')
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
plt.xlim([(min(xList) - ((max(xList) - min(xList)) * spacing)), (max(xList) + ((max(xList) - min(xList)) * spacing))])
if (min(y) >= 0):
plt.ylim([0, 1])
else:
plt.ylim([(min(y) - ((max(y) - min(y)) * spacing)), (max(y) + ((max(y) - min(y)) * spacing))])
if (color is None):
plt.bar(xList, y, alpha=0.7, linewidth=lineWidth)
else:
for aColor in cMap:
if (aColor[0] == color):
plt.bar(xList, y, color=aColor[1], alpha=1, linewidth=lineWidth)
plt.xticks(xList, x)
plt.axhline(y=0, color='#ccc', linestyle=':', linewidth=lineWidth)
plt.show() | Plot bar graphs with given X labels and Y values lists, this function also supports other optional
parameters as shown below.
:param x: a list of X labels for the graphs
:param y: a list of Y coordinates for the bar graphs
:param title: overall title of the graph
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,
purple, darkred, orange, brown, pink and teal)
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical/horizontal spacing index
:return: None | Quanlse/Utils/Plot.py | plotPop | baidu/Quanlse | 33 | python | def plotPop(x: List[Any], y: List[float], title: str=, xLabel: str=, yLabel: str=, color: str='purple', lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1) -> None:
'\n Plot bar graphs with given X labels and Y values lists, this function also supports other optional\n parameters as shown below.\n\n :param x: a list of X labels for the graphs\n :param y: a list of Y coordinates for the bar graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,\n purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical/horizontal spacing index\n :return: None\n '
cMap = colorMap()
xList = numpy.arange(len(y))
plt.figure(1, (15, 10))
plt.rcParams['figure.figsize'] = (15, 10)
plt.rcParams['axes.linewidth'] = (lineWidth * 2)
if (title is not None):
plt.title(title, size=int((fontSize * 1.4)), weight='bold')
if (xLabel != ):
plt.xlabel(xLabel, size=int((fontSize * 1.2)), weight='bold')
if (yLabel != ):
plt.ylabel(yLabel, size=int((fontSize * 1.2)), weight='bold')
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
plt.xlim([(min(xList) - ((max(xList) - min(xList)) * spacing)), (max(xList) + ((max(xList) - min(xList)) * spacing))])
if (min(y) >= 0):
plt.ylim([0, 1])
else:
plt.ylim([(min(y) - ((max(y) - min(y)) * spacing)), (max(y) + ((max(y) - min(y)) * spacing))])
if (color is None):
plt.bar(xList, y, alpha=0.7, linewidth=lineWidth)
else:
for aColor in cMap:
if (aColor[0] == color):
plt.bar(xList, y, color=aColor[1], alpha=1, linewidth=lineWidth)
plt.xticks(xList, x)
plt.axhline(y=0, color='#ccc', linestyle=':', linewidth=lineWidth)
plt.show() | def plotPop(x: List[Any], y: List[float], title: str=, xLabel: str=, yLabel: str=, color: str='purple', lineWidth: float=1.0, fontSize: float=10, spacing: float=0.1) -> None:
'\n Plot bar graphs with given X labels and Y values lists, this function also supports other optional\n parameters as shown below.\n\n :param x: a list of X labels for the graphs\n :param y: a list of Y coordinates for the bar graphs\n :param title: overall title of the graph\n :param xLabel: label on X axis\n :param yLabel: label on Y axis\n :param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,\n purple, darkred, orange, brown, pink and teal)\n :param lineWidth: line width index\n :param fontSize: font size index\n :param spacing: vertical/horizontal spacing index\n :return: None\n '
cMap = colorMap()
xList = numpy.arange(len(y))
plt.figure(1, (15, 10))
plt.rcParams['figure.figsize'] = (15, 10)
plt.rcParams['axes.linewidth'] = (lineWidth * 2)
if (title is not None):
plt.title(title, size=int((fontSize * 1.4)), weight='bold')
if (xLabel != ):
plt.xlabel(xLabel, size=int((fontSize * 1.2)), weight='bold')
if (yLabel != ):
plt.ylabel(yLabel, size=int((fontSize * 1.2)), weight='bold')
plt.xticks(fontsize=fontSize, weight='bold')
plt.yticks(fontsize=fontSize, weight='bold')
plt.xlim([(min(xList) - ((max(xList) - min(xList)) * spacing)), (max(xList) + ((max(xList) - min(xList)) * spacing))])
if (min(y) >= 0):
plt.ylim([0, 1])
else:
plt.ylim([(min(y) - ((max(y) - min(y)) * spacing)), (max(y) + ((max(y) - min(y)) * spacing))])
if (color is None):
plt.bar(xList, y, alpha=0.7, linewidth=lineWidth)
else:
for aColor in cMap:
if (aColor[0] == color):
plt.bar(xList, y, color=aColor[1], alpha=1, linewidth=lineWidth)
plt.xticks(xList, x)
plt.axhline(y=0, color='#ccc', linestyle=':', linewidth=lineWidth)
plt.show()<|docstring|>Plot bar graphs with given X labels and Y values lists, this function also supports other optional
parameters as shown below.
:param x: a list of X labels for the graphs
:param y: a list of Y coordinates for the bar graphs
:param title: overall title of the graph
:param xLabel: label on X axis
:param yLabel: label on Y axis
:param color: a color for all bars, default at blue (from mint, blue, red, green, yellow, black, pink, cyan,
purple, darkred, orange, brown, pink and teal)
:param lineWidth: line width index
:param fontSize: font size index
:param spacing: vertical/horizontal spacing index
:return: None<|endoftext|> |
456c0ce38e57ae58245eebe557fcc93e7ae30923cbcba28727643ee8b29d8197 | def get_agenda(collection, dateformat, longdateformat, dates=[], width=45):
'returns a list of events scheduled for all days in daylist\n\n included are header "rows"\n :param collection:\n :type collection: khalendar.CalendarCollection\n :param dates: a list of all dates for which the events should be return,\n including what should be printed as a header\n :type collection: list(str)\n :returns: a list to be printed as the agenda for the given days\n :rtype: list(str)\n\n '
event_column = list()
if (dates == []):
today = datetime.date.today()
tomorrow = (today + datetime.timedelta(days=1))
daylist = [(today, 'Today:'), (tomorrow, 'Tomorrow:')]
else:
try:
daylist = [aux.datefstr(date, dateformat, longdateformat) for date in dates]
except aux.InvalidDate as error:
logging.fatal(error)
sys.exit(1)
daynames = [date.strftime(longdateformat) for date in daylist]
daylist = zip(daylist, daynames)
for (day, dayname) in daylist:
start = datetime.datetime.combine(day, datetime.time.min)
end = datetime.datetime.combine(day, datetime.time.max)
event_column.append(bstring(dayname))
all_day_events = collection.get_allday_by_time_range(day)
events = collection.get_datetime_by_time_range(start, end)
for event in all_day_events:
desc = textwrap.wrap(event.compact(day), width)
event_column.extend([colored(d, event.color) for d in desc])
events.sort(key=(lambda e: e.start))
for event in events:
desc = textwrap.wrap(event.compact(day), width)
event_column.extend([colored(d, event.color) for d in desc])
return event_column | returns a list of events scheduled for all days in daylist
included are header "rows"
:param collection:
:type collection: khalendar.CalendarCollection
:param dates: a list of all dates for which the events should be return,
including what should be printed as a header
:type collection: list(str)
:returns: a list to be printed as the agenda for the given days
:rtype: list(str) | khal/controllers.py | get_agenda | untitaker/khal | 0 | python | def get_agenda(collection, dateformat, longdateformat, dates=[], width=45):
'returns a list of events scheduled for all days in daylist\n\n included are header "rows"\n :param collection:\n :type collection: khalendar.CalendarCollection\n :param dates: a list of all dates for which the events should be return,\n including what should be printed as a header\n :type collection: list(str)\n :returns: a list to be printed as the agenda for the given days\n :rtype: list(str)\n\n '
event_column = list()
if (dates == []):
today = datetime.date.today()
tomorrow = (today + datetime.timedelta(days=1))
daylist = [(today, 'Today:'), (tomorrow, 'Tomorrow:')]
else:
try:
daylist = [aux.datefstr(date, dateformat, longdateformat) for date in dates]
except aux.InvalidDate as error:
logging.fatal(error)
sys.exit(1)
daynames = [date.strftime(longdateformat) for date in daylist]
daylist = zip(daylist, daynames)
for (day, dayname) in daylist:
start = datetime.datetime.combine(day, datetime.time.min)
end = datetime.datetime.combine(day, datetime.time.max)
event_column.append(bstring(dayname))
all_day_events = collection.get_allday_by_time_range(day)
events = collection.get_datetime_by_time_range(start, end)
for event in all_day_events:
desc = textwrap.wrap(event.compact(day), width)
event_column.extend([colored(d, event.color) for d in desc])
events.sort(key=(lambda e: e.start))
for event in events:
desc = textwrap.wrap(event.compact(day), width)
event_column.extend([colored(d, event.color) for d in desc])
return event_column | def get_agenda(collection, dateformat, longdateformat, dates=[], width=45):
'returns a list of events scheduled for all days in daylist\n\n included are header "rows"\n :param collection:\n :type collection: khalendar.CalendarCollection\n :param dates: a list of all dates for which the events should be return,\n including what should be printed as a header\n :type collection: list(str)\n :returns: a list to be printed as the agenda for the given days\n :rtype: list(str)\n\n '
event_column = list()
if (dates == []):
today = datetime.date.today()
tomorrow = (today + datetime.timedelta(days=1))
daylist = [(today, 'Today:'), (tomorrow, 'Tomorrow:')]
else:
try:
daylist = [aux.datefstr(date, dateformat, longdateformat) for date in dates]
except aux.InvalidDate as error:
logging.fatal(error)
sys.exit(1)
daynames = [date.strftime(longdateformat) for date in daylist]
daylist = zip(daylist, daynames)
for (day, dayname) in daylist:
start = datetime.datetime.combine(day, datetime.time.min)
end = datetime.datetime.combine(day, datetime.time.max)
event_column.append(bstring(dayname))
all_day_events = collection.get_allday_by_time_range(day)
events = collection.get_datetime_by_time_range(start, end)
for event in all_day_events:
desc = textwrap.wrap(event.compact(day), width)
event_column.extend([colored(d, event.color) for d in desc])
events.sort(key=(lambda e: e.start))
for event in events:
desc = textwrap.wrap(event.compact(day), width)
event_column.extend([colored(d, event.color) for d in desc])
return event_column<|docstring|>returns a list of events scheduled for all days in daylist
included are header "rows"
:param collection:
:type collection: khalendar.CalendarCollection
:param dates: a list of all dates for which the events should be return,
including what should be printed as a header
:type collection: list(str)
:returns: a list to be printed as the agenda for the given days
:rtype: list(str)<|endoftext|> |
4e879cbfc0ef90183f0b8f6064b2ae9346f73aea2d606ab2e53f6a4c87140f2e | def linear(x: float) -> float:
' Linear activation function (simply returns the input, unchanged). '
return x | Linear activation function (simply returns the input, unchanged). | nevopy/activations.py | linear | Talendar/nevo-py | 8 | python | def linear(x: float) -> float:
' '
return x | def linear(x: float) -> float:
' '
return x<|docstring|>Linear activation function (simply returns the input, unchanged).<|endoftext|> |
b2df48b25e251b34705bcfa570e08a96b9547b42619711e7804d9d9115e3ca9d | def sigmoid(x: float, clip_value: int=64) -> float:
' Numeric stable implementation of the sigmoid function.\n\n Estimated lower-bound precision with a clip value of 64: 10^(-28).\n '
x = np.clip(x, (- clip_value), clip_value)
return (1 / (1 + np.exp((- x)))) | Numeric stable implementation of the sigmoid function.
Estimated lower-bound precision with a clip value of 64: 10^(-28). | nevopy/activations.py | sigmoid | Talendar/nevo-py | 8 | python | def sigmoid(x: float, clip_value: int=64) -> float:
' Numeric stable implementation of the sigmoid function.\n\n Estimated lower-bound precision with a clip value of 64: 10^(-28).\n '
x = np.clip(x, (- clip_value), clip_value)
return (1 / (1 + np.exp((- x)))) | def sigmoid(x: float, clip_value: int=64) -> float:
' Numeric stable implementation of the sigmoid function.\n\n Estimated lower-bound precision with a clip value of 64: 10^(-28).\n '
x = np.clip(x, (- clip_value), clip_value)
return (1 / (1 + np.exp((- x))))<|docstring|>Numeric stable implementation of the sigmoid function.
Estimated lower-bound precision with a clip value of 64: 10^(-28).<|endoftext|> |
77195001b70ab7ca46a3498a694dd5fd894af7535f2c56f80a75780da4a71a5f | def steepened_sigmoid(x: float, step: float=4.9) -> float:
' Steepened version of the sigmoid function.\n\n The original NEAT paper used a steepened version of the sigmoid function\n with a step value of 4.9.\n\n "We used a modified sigmoidal transfer function,\n ϕ(x) = 1 / (1 + exp(−4.9x)), at all nodes. The steepened sigmoid allows more\n fine tuning at extreme activations. It is optimized to be close to linear\n during its steepest ascent between activations −0.5 and 0.5."\n - :cite:`stanley:ec02`\n '
return sigmoid((x * step)) | Steepened version of the sigmoid function.
The original NEAT paper used a steepened version of the sigmoid function
with a step value of 4.9.
"We used a modified sigmoidal transfer function,
ϕ(x) = 1 / (1 + exp(−4.9x)), at all nodes. The steepened sigmoid allows more
fine tuning at extreme activations. It is optimized to be close to linear
during its steepest ascent between activations −0.5 and 0.5."
- :cite:`stanley:ec02` | nevopy/activations.py | steepened_sigmoid | Talendar/nevo-py | 8 | python | def steepened_sigmoid(x: float, step: float=4.9) -> float:
' Steepened version of the sigmoid function.\n\n The original NEAT paper used a steepened version of the sigmoid function\n with a step value of 4.9.\n\n "We used a modified sigmoidal transfer function,\n ϕ(x) = 1 / (1 + exp(−4.9x)), at all nodes. The steepened sigmoid allows more\n fine tuning at extreme activations. It is optimized to be close to linear\n during its steepest ascent between activations −0.5 and 0.5."\n - :cite:`stanley:ec02`\n '
return sigmoid((x * step)) | def steepened_sigmoid(x: float, step: float=4.9) -> float:
' Steepened version of the sigmoid function.\n\n The original NEAT paper used a steepened version of the sigmoid function\n with a step value of 4.9.\n\n "We used a modified sigmoidal transfer function,\n ϕ(x) = 1 / (1 + exp(−4.9x)), at all nodes. The steepened sigmoid allows more\n fine tuning at extreme activations. It is optimized to be close to linear\n during its steepest ascent between activations −0.5 and 0.5."\n - :cite:`stanley:ec02`\n '
return sigmoid((x * step))<|docstring|>Steepened version of the sigmoid function.
The original NEAT paper used a steepened version of the sigmoid function
with a step value of 4.9.
"We used a modified sigmoidal transfer function,
ϕ(x) = 1 / (1 + exp(−4.9x)), at all nodes. The steepened sigmoid allows more
fine tuning at extreme activations. It is optimized to be close to linear
during its steepest ascent between activations −0.5 and 0.5."
- :cite:`stanley:ec02`<|endoftext|> |
8e812d04d7da674206f26425d062d38741acadda5446836dd0578b1f8eba6142 | def _normalize(v, desired_segments=0):
'\n :param v: Input string of the form "#.#.#" or "#.#.#.#"\n :param desired_segments: If greater than 0, and if v has fewer segments this parameter, will pad v with segments\n containing "0" until the desired segments is reached.\n :return: Returns a list of integers representing the segments of the version\n '
v_list = v.split('.')
if ((desired_segments > 0) and (len(v_list) < desired_segments)):
v_list = (v_list + ((desired_segments - len(v_list)) * ['0']))
return [int(x) for x in v_list] | :param v: Input string of the form "#.#.#" or "#.#.#.#"
:param desired_segments: If greater than 0, and if v has fewer segments this parameter, will pad v with segments
containing "0" until the desired segments is reached.
:return: Returns a list of integers representing the segments of the version | ambari-common/src/main/python/resource_management/libraries/functions/version.py | _normalize | MacgradyHuang/ApacheAmbari | 25 | python | def _normalize(v, desired_segments=0):
'\n :param v: Input string of the form "#.#.#" or "#.#.#.#"\n :param desired_segments: If greater than 0, and if v has fewer segments this parameter, will pad v with segments\n containing "0" until the desired segments is reached.\n :return: Returns a list of integers representing the segments of the version\n '
v_list = v.split('.')
if ((desired_segments > 0) and (len(v_list) < desired_segments)):
v_list = (v_list + ((desired_segments - len(v_list)) * ['0']))
return [int(x) for x in v_list] | def _normalize(v, desired_segments=0):
'\n :param v: Input string of the form "#.#.#" or "#.#.#.#"\n :param desired_segments: If greater than 0, and if v has fewer segments this parameter, will pad v with segments\n containing "0" until the desired segments is reached.\n :return: Returns a list of integers representing the segments of the version\n '
v_list = v.split('.')
if ((desired_segments > 0) and (len(v_list) < desired_segments)):
v_list = (v_list + ((desired_segments - len(v_list)) * ['0']))
return [int(x) for x in v_list]<|docstring|>:param v: Input string of the form "#.#.#" or "#.#.#.#"
:param desired_segments: If greater than 0, and if v has fewer segments this parameter, will pad v with segments
containing "0" until the desired segments is reached.
:return: Returns a list of integers representing the segments of the version<|endoftext|> |
16ea18da8c09d05ef560f029ab2dea8108c9e0c3d99ab2e411f96c7bbf3b0e3d | def format_stack_version(value):
'\n :param value: Input string, e.g. "2.2" or "GlusterFS", or "2.0.6.GlusterFS", or "2.2.0.1-885"\n :return: Returns a well-formatted HDP stack version of the form #.#.#.# as a string.\n '
if value:
if ('-' in value):
first_occurrence = value.find('-')
last_occurence = value.rfind('-')
if (first_occurrence == last_occurence):
if value[0].isalpha():
value = value[(first_occurrence + 1):]
else:
value = value[:first_occurrence]
else:
value = value[(first_occurrence + 1):last_occurence]
value = re.sub('^\\D+', '', value)
value = re.sub('\\D+$', '', value)
value = value.strip('.')
strip_dots = value.replace('.', '')
if strip_dots.isdigit():
normalized = _normalize(str(value))
if (len(normalized) == 2):
normalized = (normalized + [0, 0])
elif (len(normalized) == 3):
normalized = (normalized + [0])
normalized = [str(x) for x in normalized]
return '.'.join(normalized)
return '' | :param value: Input string, e.g. "2.2" or "GlusterFS", or "2.0.6.GlusterFS", or "2.2.0.1-885"
:return: Returns a well-formatted HDP stack version of the form #.#.#.# as a string. | ambari-common/src/main/python/resource_management/libraries/functions/version.py | format_stack_version | MacgradyHuang/ApacheAmbari | 25 | python | def format_stack_version(value):
'\n :param value: Input string, e.g. "2.2" or "GlusterFS", or "2.0.6.GlusterFS", or "2.2.0.1-885"\n :return: Returns a well-formatted HDP stack version of the form #.#.#.# as a string.\n '
if value:
if ('-' in value):
first_occurrence = value.find('-')
last_occurence = value.rfind('-')
if (first_occurrence == last_occurence):
if value[0].isalpha():
value = value[(first_occurrence + 1):]
else:
value = value[:first_occurrence]
else:
value = value[(first_occurrence + 1):last_occurence]
value = re.sub('^\\D+', , value)
value = re.sub('\\D+$', , value)
value = value.strip('.')
strip_dots = value.replace('.', )
if strip_dots.isdigit():
normalized = _normalize(str(value))
if (len(normalized) == 2):
normalized = (normalized + [0, 0])
elif (len(normalized) == 3):
normalized = (normalized + [0])
normalized = [str(x) for x in normalized]
return '.'.join(normalized)
return | def format_stack_version(value):
'\n :param value: Input string, e.g. "2.2" or "GlusterFS", or "2.0.6.GlusterFS", or "2.2.0.1-885"\n :return: Returns a well-formatted HDP stack version of the form #.#.#.# as a string.\n '
if value:
if ('-' in value):
first_occurrence = value.find('-')
last_occurence = value.rfind('-')
if (first_occurrence == last_occurence):
if value[0].isalpha():
value = value[(first_occurrence + 1):]
else:
value = value[:first_occurrence]
else:
value = value[(first_occurrence + 1):last_occurence]
value = re.sub('^\\D+', , value)
value = re.sub('\\D+$', , value)
value = value.strip('.')
strip_dots = value.replace('.', )
if strip_dots.isdigit():
normalized = _normalize(str(value))
if (len(normalized) == 2):
normalized = (normalized + [0, 0])
elif (len(normalized) == 3):
normalized = (normalized + [0])
normalized = [str(x) for x in normalized]
return '.'.join(normalized)
return <|docstring|>:param value: Input string, e.g. "2.2" or "GlusterFS", or "2.0.6.GlusterFS", or "2.2.0.1-885"
:return: Returns a well-formatted HDP stack version of the form #.#.#.# as a string.<|endoftext|> |
9e26b17f5173223814c4330796634c8f32b09bc895b999ae3bb12d4ce181d0fe | def compare_versions(version1, version2, format=False):
'\n Used to compare either Ambari Versions, or Stack versions\n E.g., Ambari version 1.6.1 vs 1.7.0,\n Stack Version 2.0.6.0 vs 2.2.0.0\n :param version1: First parameter for version\n :param version2: Second parameter for version\n :param format: optionally format the versions via format_stack_version before comparing them\n :return: Returns -1 if version1 is before version2, 0 if they are equal, and 1 if version1 is after version2\n '
v1 = (version1 if (not format) else format_stack_version(version1))
v2 = (version2 if (not format) else format_stack_version(version2))
max_segments = max(len(v1.split('.')), len(v2.split('.')))
return cmp(_normalize(v1, desired_segments=max_segments), _normalize(v2, desired_segments=max_segments)) | Used to compare either Ambari Versions, or Stack versions
E.g., Ambari version 1.6.1 vs 1.7.0,
Stack Version 2.0.6.0 vs 2.2.0.0
:param version1: First parameter for version
:param version2: Second parameter for version
:param format: optionally format the versions via format_stack_version before comparing them
:return: Returns -1 if version1 is before version2, 0 if they are equal, and 1 if version1 is after version2 | ambari-common/src/main/python/resource_management/libraries/functions/version.py | compare_versions | MacgradyHuang/ApacheAmbari | 25 | python | def compare_versions(version1, version2, format=False):
'\n Used to compare either Ambari Versions, or Stack versions\n E.g., Ambari version 1.6.1 vs 1.7.0,\n Stack Version 2.0.6.0 vs 2.2.0.0\n :param version1: First parameter for version\n :param version2: Second parameter for version\n :param format: optionally format the versions via format_stack_version before comparing them\n :return: Returns -1 if version1 is before version2, 0 if they are equal, and 1 if version1 is after version2\n '
v1 = (version1 if (not format) else format_stack_version(version1))
v2 = (version2 if (not format) else format_stack_version(version2))
max_segments = max(len(v1.split('.')), len(v2.split('.')))
return cmp(_normalize(v1, desired_segments=max_segments), _normalize(v2, desired_segments=max_segments)) | def compare_versions(version1, version2, format=False):
'\n Used to compare either Ambari Versions, or Stack versions\n E.g., Ambari version 1.6.1 vs 1.7.0,\n Stack Version 2.0.6.0 vs 2.2.0.0\n :param version1: First parameter for version\n :param version2: Second parameter for version\n :param format: optionally format the versions via format_stack_version before comparing them\n :return: Returns -1 if version1 is before version2, 0 if they are equal, and 1 if version1 is after version2\n '
v1 = (version1 if (not format) else format_stack_version(version1))
v2 = (version2 if (not format) else format_stack_version(version2))
max_segments = max(len(v1.split('.')), len(v2.split('.')))
return cmp(_normalize(v1, desired_segments=max_segments), _normalize(v2, desired_segments=max_segments))<|docstring|>Used to compare either Ambari Versions, or Stack versions
E.g., Ambari version 1.6.1 vs 1.7.0,
Stack Version 2.0.6.0 vs 2.2.0.0
:param version1: First parameter for version
:param version2: Second parameter for version
:param format: optionally format the versions via format_stack_version before comparing them
:return: Returns -1 if version1 is before version2, 0 if they are equal, and 1 if version1 is after version2<|endoftext|> |
3578631d0bfea2021fec1635ad5822862e68b41dc89a421062338799d97b7e75 | def get_major_version(full_version):
'\n :param input: Input string, e.g. "2.1.3.0" or "2.2.0.1-885" and other similar\n :return: Returns a well-formatted HDP major stack version of the form #.# as a string. If can\'t get major version\n return None\n '
pattern = re.compile('^[0-9]+\\.[0-9]+')
major_version = None
m = pattern.search(full_version)
if m:
major_version = m.group()
return major_version | :param input: Input string, e.g. "2.1.3.0" or "2.2.0.1-885" and other similar
:return: Returns a well-formatted HDP major stack version of the form #.# as a string. If can't get major version
return None | ambari-common/src/main/python/resource_management/libraries/functions/version.py | get_major_version | MacgradyHuang/ApacheAmbari | 25 | python | def get_major_version(full_version):
'\n :param input: Input string, e.g. "2.1.3.0" or "2.2.0.1-885" and other similar\n :return: Returns a well-formatted HDP major stack version of the form #.# as a string. If can\'t get major version\n return None\n '
pattern = re.compile('^[0-9]+\\.[0-9]+')
major_version = None
m = pattern.search(full_version)
if m:
major_version = m.group()
return major_version | def get_major_version(full_version):
'\n :param input: Input string, e.g. "2.1.3.0" or "2.2.0.1-885" and other similar\n :return: Returns a well-formatted HDP major stack version of the form #.# as a string. If can\'t get major version\n return None\n '
pattern = re.compile('^[0-9]+\\.[0-9]+')
major_version = None
m = pattern.search(full_version)
if m:
major_version = m.group()
return major_version<|docstring|>:param input: Input string, e.g. "2.1.3.0" or "2.2.0.1-885" and other similar
:return: Returns a well-formatted HDP major stack version of the form #.# as a string. If can't get major version
return None<|endoftext|> |
30f2d425238f5ab93507c0b68c9a83a57b9fe99867de3b6ef9113be9ab1d98e1 | @cached_method
def get_hctl(self):
'Returns a `infi.dtypes.hctl.HCTL` object'
proc = execute_assert_success(['/usr/sbin/lsdev', '-F', 'parent', '-l', self._name])
driver = proc.get_stdout().decode().strip()
host = self._get_host_by_driver(driver)
proc = execute_assert_success(['/usr/sbin/lsattr', '-F', 'value', '-a', 'ww_name', '-a', 'lun_id', '-E', '-l', self._name])
(target, lun) = proc.get_stdout().decode().strip().split('\n')
target = int(target, 16)
lun = (int(lun, 16) >> 48)
return HCTL(host, 0, target, lun) | Returns a `infi.dtypes.hctl.HCTL` object | src/infi/storagemodel/aix/scsi.py | get_hctl | Infinidat/infi.storagemodel | 6 | python | @cached_method
def get_hctl(self):
proc = execute_assert_success(['/usr/sbin/lsdev', '-F', 'parent', '-l', self._name])
driver = proc.get_stdout().decode().strip()
host = self._get_host_by_driver(driver)
proc = execute_assert_success(['/usr/sbin/lsattr', '-F', 'value', '-a', 'ww_name', '-a', 'lun_id', '-E', '-l', self._name])
(target, lun) = proc.get_stdout().decode().strip().split('\n')
target = int(target, 16)
lun = (int(lun, 16) >> 48)
return HCTL(host, 0, target, lun) | @cached_method
def get_hctl(self):
proc = execute_assert_success(['/usr/sbin/lsdev', '-F', 'parent', '-l', self._name])
driver = proc.get_stdout().decode().strip()
host = self._get_host_by_driver(driver)
proc = execute_assert_success(['/usr/sbin/lsattr', '-F', 'value', '-a', 'ww_name', '-a', 'lun_id', '-E', '-l', self._name])
(target, lun) = proc.get_stdout().decode().strip().split('\n')
target = int(target, 16)
lun = (int(lun, 16) >> 48)
return HCTL(host, 0, target, lun)<|docstring|>Returns a `infi.dtypes.hctl.HCTL` object<|endoftext|> |
8ff2c845fc4240dcc875e3d4012f1f050f41da59af98b3f8b39d5cb62db77c95 | @cached_method
def get_display_name(self):
'Returns a friendly device name'
return self._name | Returns a friendly device name | src/infi/storagemodel/aix/scsi.py | get_display_name | Infinidat/infi.storagemodel | 6 | python | @cached_method
def get_display_name(self):
return self._name | @cached_method
def get_display_name(self):
return self._name<|docstring|>Returns a friendly device name<|endoftext|> |
402f95a44ffed682de575c8b987f354bb0162172d058c09c229d4e69c29994f0 | @cached_method
def get_scsi_access_path(self):
'Returns a string path for the device'
return ('/dev/' + self._name) | Returns a string path for the device | src/infi/storagemodel/aix/scsi.py | get_scsi_access_path | Infinidat/infi.storagemodel | 6 | python | @cached_method
def get_scsi_access_path(self):
return ('/dev/' + self._name) | @cached_method
def get_scsi_access_path(self):
return ('/dev/' + self._name)<|docstring|>Returns a string path for the device<|endoftext|> |
6d461dd1288b4cdc14380f0dd15221c0fad9a4be8215c0d0dedb26c8456e07a6 | @cached_method
def get_all_scsi_block_devices(self):
'Returns a list of all `infi.storagemodel.aix.scsi.SCSIBlockDevice`.'
disks = [AixSCSIBlockDevice(dev) for dev in self._get_dev_by_class('disk')]
multipath_devices = self._get_multipath_devices()
result = []
for disk in disks:
if (disk.get_display_name() in multipath_devices):
continue
controller = self._is_disk_a_controller(disk)
if ((controller is None) or controller):
continue
result.append(disk)
return result | Returns a list of all `infi.storagemodel.aix.scsi.SCSIBlockDevice`. | src/infi/storagemodel/aix/scsi.py | get_all_scsi_block_devices | Infinidat/infi.storagemodel | 6 | python | @cached_method
def get_all_scsi_block_devices(self):
disks = [AixSCSIBlockDevice(dev) for dev in self._get_dev_by_class('disk')]
multipath_devices = self._get_multipath_devices()
result = []
for disk in disks:
if (disk.get_display_name() in multipath_devices):
continue
controller = self._is_disk_a_controller(disk)
if ((controller is None) or controller):
continue
result.append(disk)
return result | @cached_method
def get_all_scsi_block_devices(self):
disks = [AixSCSIBlockDevice(dev) for dev in self._get_dev_by_class('disk')]
multipath_devices = self._get_multipath_devices()
result = []
for disk in disks:
if (disk.get_display_name() in multipath_devices):
continue
controller = self._is_disk_a_controller(disk)
if ((controller is None) or controller):
continue
result.append(disk)
return result<|docstring|>Returns a list of all `infi.storagemodel.aix.scsi.SCSIBlockDevice`.<|endoftext|> |
30d3bca4540b7941b623665ff7607285088cb87ddd71dffa382e620f02a48bd1 | @cached_method
def get_all_storage_controller_devices(self):
'Returns a list of all `infi.storagemodel.aix.scsi.SCSIStorageController` objects.'
controllers = [AixSCSIStorageController(dev) for dev in self._get_dev_by_class('dac')]
disks = [AixSCSIStorageController(dev) for dev in self._get_dev_by_class('disk')]
controllers.extend([disk for disk in disks if self._is_disk_a_controller(disk)])
multipath_devices = self._get_multipath_devices()
controllers = [controller for controller in controllers if (controller.get_display_name() not in multipath_devices)]
return controllers | Returns a list of all `infi.storagemodel.aix.scsi.SCSIStorageController` objects. | src/infi/storagemodel/aix/scsi.py | get_all_storage_controller_devices | Infinidat/infi.storagemodel | 6 | python | @cached_method
def get_all_storage_controller_devices(self):
controllers = [AixSCSIStorageController(dev) for dev in self._get_dev_by_class('dac')]
disks = [AixSCSIStorageController(dev) for dev in self._get_dev_by_class('disk')]
controllers.extend([disk for disk in disks if self._is_disk_a_controller(disk)])
multipath_devices = self._get_multipath_devices()
controllers = [controller for controller in controllers if (controller.get_display_name() not in multipath_devices)]
return controllers | @cached_method
def get_all_storage_controller_devices(self):
controllers = [AixSCSIStorageController(dev) for dev in self._get_dev_by_class('dac')]
disks = [AixSCSIStorageController(dev) for dev in self._get_dev_by_class('disk')]
controllers.extend([disk for disk in disks if self._is_disk_a_controller(disk)])
multipath_devices = self._get_multipath_devices()
controllers = [controller for controller in controllers if (controller.get_display_name() not in multipath_devices)]
return controllers<|docstring|>Returns a list of all `infi.storagemodel.aix.scsi.SCSIStorageController` objects.<|endoftext|> |
f8ef967249db5562e4f0466a7225f847b6f613b8b8b0c2649667f8387c0b2e00 | def __init__(self, connection, work_package, filters, query, work_package_type):
'Constructor for class FindRelationCandidates, from WorkPackageCommand\n :param connection: The connection data\n :param work_package: The work package\n :param filters: The filters parameter\n :param query: The query parameter\n :param work_package_type: The work_package type as parameter\n '
super().__init__(connection)
self.work_package = work_package
self.filters = filters
self.query = query
self.type = work_package_type | Constructor for class FindRelationCandidates, from WorkPackageCommand
:param connection: The connection data
:param work_package: The work package
:param filters: The filters parameter
:param query: The query parameter
:param work_package_type: The work_package type as parameter | pyopenproject/business/services/command/work_package/find_relation_candidates.py | __init__ | webu/pyopenproject | 5 | python | def __init__(self, connection, work_package, filters, query, work_package_type):
'Constructor for class FindRelationCandidates, from WorkPackageCommand\n :param connection: The connection data\n :param work_package: The work package\n :param filters: The filters parameter\n :param query: The query parameter\n :param work_package_type: The work_package type as parameter\n '
super().__init__(connection)
self.work_package = work_package
self.filters = filters
self.query = query
self.type = work_package_type | def __init__(self, connection, work_package, filters, query, work_package_type):
'Constructor for class FindRelationCandidates, from WorkPackageCommand\n :param connection: The connection data\n :param work_package: The work package\n :param filters: The filters parameter\n :param query: The query parameter\n :param work_package_type: The work_package type as parameter\n '
super().__init__(connection)
self.work_package = work_package
self.filters = filters
self.query = query
self.type = work_package_type<|docstring|>Constructor for class FindRelationCandidates, from WorkPackageCommand
:param connection: The connection data
:param work_package: The work package
:param filters: The filters parameter
:param query: The query parameter
:param work_package_type: The work_package type as parameter<|endoftext|> |
546201b3a879c37b9527e87a9548a516f91c37a102a44549381f8b6445161a3e | def fully_pooled(at_bats, hits):
'\n Number of hits in $K$ at bats for each player has a Binomial\n distribution with a common probability of success, $\\phi$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
phi_prior = Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits) | Number of hits in $K$ at bats for each player has a Binomial
distribution with a common probability of success, $\phi$.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model. | examples/baseball.py | fully_pooled | hesenp/pyro | 0 | python | def fully_pooled(at_bats, hits):
'\n Number of hits in $K$ at bats for each player has a Binomial\n distribution with a common probability of success, $\\phi$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
phi_prior = Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits) | def fully_pooled(at_bats, hits):
'\n Number of hits in $K$ at bats for each player has a Binomial\n distribution with a common probability of success, $\\phi$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
phi_prior = Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits)<|docstring|>Number of hits in $K$ at bats for each player has a Binomial
distribution with a common probability of success, $\phi$.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model.<|endoftext|> |
b6eda8d79e5df0b59b098c10befb89c7edf1a14d4dfcbaf6a680d1437fc85c55 | def not_pooled(at_bats, hits):
'\n Number of hits in $K$ at bats for each player has a Binomial\n distribution with independent probability of success, $\\phi_i$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
with pyro.plate('num_players', num_players):
phi_prior = Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits) | Number of hits in $K$ at bats for each player has a Binomial
distribution with independent probability of success, $\phi_i$.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model. | examples/baseball.py | not_pooled | hesenp/pyro | 0 | python | def not_pooled(at_bats, hits):
'\n Number of hits in $K$ at bats for each player has a Binomial\n distribution with independent probability of success, $\\phi_i$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
with pyro.plate('num_players', num_players):
phi_prior = Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits) | def not_pooled(at_bats, hits):
'\n Number of hits in $K$ at bats for each player has a Binomial\n distribution with independent probability of success, $\\phi_i$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
with pyro.plate('num_players', num_players):
phi_prior = Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits)<|docstring|>Number of hits in $K$ at bats for each player has a Binomial
distribution with independent probability of success, $\phi_i$.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model.<|endoftext|> |
bf4aa9396907d3b9f162e81e6bc4c92dc6fa3fc2e59c67c24342f7fc4a4563f0 | def partially_pooled(at_bats, hits):
'\n Number of hits has a Binomial distribution with independent\n probability of success, $\\phi_i$. Each $\\phi_i$ follows a Beta\n distribution with concentration parameters $c_1$ and $c_2$, where\n $c_1 = m * kappa$, $c_2 = (1 - m) * kappa$, $m ~ Uniform(0, 1)$,\n and $kappa ~ Pareto(1, 1.5)$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
m = pyro.sample('m', Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1)))
kappa = pyro.sample('kappa', Pareto(at_bats.new_tensor(1), at_bats.new_tensor(1.5)))
with pyro.plate('num_players', num_players):
phi_prior = Beta((m * kappa), ((1 - m) * kappa))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits) | Number of hits has a Binomial distribution with independent
probability of success, $\phi_i$. Each $\phi_i$ follows a Beta
distribution with concentration parameters $c_1$ and $c_2$, where
$c_1 = m * kappa$, $c_2 = (1 - m) * kappa$, $m ~ Uniform(0, 1)$,
and $kappa ~ Pareto(1, 1.5)$.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model. | examples/baseball.py | partially_pooled | hesenp/pyro | 0 | python | def partially_pooled(at_bats, hits):
'\n Number of hits has a Binomial distribution with independent\n probability of success, $\\phi_i$. Each $\\phi_i$ follows a Beta\n distribution with concentration parameters $c_1$ and $c_2$, where\n $c_1 = m * kappa$, $c_2 = (1 - m) * kappa$, $m ~ Uniform(0, 1)$,\n and $kappa ~ Pareto(1, 1.5)$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
m = pyro.sample('m', Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1)))
kappa = pyro.sample('kappa', Pareto(at_bats.new_tensor(1), at_bats.new_tensor(1.5)))
with pyro.plate('num_players', num_players):
phi_prior = Beta((m * kappa), ((1 - m) * kappa))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits) | def partially_pooled(at_bats, hits):
'\n Number of hits has a Binomial distribution with independent\n probability of success, $\\phi_i$. Each $\\phi_i$ follows a Beta\n distribution with concentration parameters $c_1$ and $c_2$, where\n $c_1 = m * kappa$, $c_2 = (1 - m) * kappa$, $m ~ Uniform(0, 1)$,\n and $kappa ~ Pareto(1, 1.5)$.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
m = pyro.sample('m', Uniform(at_bats.new_tensor(0), at_bats.new_tensor(1)))
kappa = pyro.sample('kappa', Pareto(at_bats.new_tensor(1), at_bats.new_tensor(1.5)))
with pyro.plate('num_players', num_players):
phi_prior = Beta((m * kappa), ((1 - m) * kappa))
phi = pyro.sample('phi', phi_prior)
return pyro.sample('obs', Binomial(at_bats, phi), obs=hits)<|docstring|>Number of hits has a Binomial distribution with independent
probability of success, $\phi_i$. Each $\phi_i$ follows a Beta
distribution with concentration parameters $c_1$ and $c_2$, where
$c_1 = m * kappa$, $c_2 = (1 - m) * kappa$, $m ~ Uniform(0, 1)$,
and $kappa ~ Pareto(1, 1.5)$.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model.<|endoftext|> |
dcfad93df05b184f12ee87212fc6a633109568617e8116ea0974112881f5da32 | def partially_pooled_with_logit(at_bats, hits):
'\n Number of hits has a Binomial distribution with a logit link function.\n The logits $\\alpha$ for each player is normally distributed with the\n mean and scale parameters sharing a common prior.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
loc = pyro.sample('loc', Normal(at_bats.new_tensor((- 1)), at_bats.new_tensor(1)))
scale = pyro.sample('scale', HalfCauchy(scale=at_bats.new_tensor(1)))
with pyro.plate('num_players', num_players):
alpha = pyro.sample('alpha', Normal(loc, scale))
return pyro.sample('obs', Binomial(at_bats, logits=alpha), obs=hits) | Number of hits has a Binomial distribution with a logit link function.
The logits $\alpha$ for each player is normally distributed with the
mean and scale parameters sharing a common prior.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model. | examples/baseball.py | partially_pooled_with_logit | hesenp/pyro | 0 | python | def partially_pooled_with_logit(at_bats, hits):
'\n Number of hits has a Binomial distribution with a logit link function.\n The logits $\\alpha$ for each player is normally distributed with the\n mean and scale parameters sharing a common prior.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
loc = pyro.sample('loc', Normal(at_bats.new_tensor((- 1)), at_bats.new_tensor(1)))
scale = pyro.sample('scale', HalfCauchy(scale=at_bats.new_tensor(1)))
with pyro.plate('num_players', num_players):
alpha = pyro.sample('alpha', Normal(loc, scale))
return pyro.sample('obs', Binomial(at_bats, logits=alpha), obs=hits) | def partially_pooled_with_logit(at_bats, hits):
'\n Number of hits has a Binomial distribution with a logit link function.\n The logits $\\alpha$ for each player is normally distributed with the\n mean and scale parameters sharing a common prior.\n\n :param (torch.Tensor) at_bats: Number of at bats for each player.\n :param (torch.Tensor) hits: Number of hits for the given at bats.\n :return: Number of hits predicted by the model.\n '
num_players = at_bats.shape[0]
loc = pyro.sample('loc', Normal(at_bats.new_tensor((- 1)), at_bats.new_tensor(1)))
scale = pyro.sample('scale', HalfCauchy(scale=at_bats.new_tensor(1)))
with pyro.plate('num_players', num_players):
alpha = pyro.sample('alpha', Normal(loc, scale))
return pyro.sample('obs', Binomial(at_bats, logits=alpha), obs=hits)<|docstring|>Number of hits has a Binomial distribution with a logit link function.
The logits $\alpha$ for each player is normally distributed with the
mean and scale parameters sharing a common prior.
:param (torch.Tensor) at_bats: Number of at bats for each player.
:param (torch.Tensor) hits: Number of hits for the given at bats.
:return: Number of hits predicted by the model.<|endoftext|> |
105c520446c3bacc475cd792646db6948f685fc59c0976e0965af4e44728a326 | def get_site_stats(array, player_names):
'\n Return the summarized statistics for a given array corresponding\n to the values sampled for a latent or response site.\n '
if (len(array.shape) == 1):
df = pd.DataFrame(array).transpose()
else:
df = pd.DataFrame(array, columns=player_names).transpose()
return df.apply(pd.Series.describe, axis=1)[['mean', 'std', '25%', '50%', '75%']] | Return the summarized statistics for a given array corresponding
to the values sampled for a latent or response site. | examples/baseball.py | get_site_stats | hesenp/pyro | 0 | python | def get_site_stats(array, player_names):
'\n Return the summarized statistics for a given array corresponding\n to the values sampled for a latent or response site.\n '
if (len(array.shape) == 1):
df = pd.DataFrame(array).transpose()
else:
df = pd.DataFrame(array, columns=player_names).transpose()
return df.apply(pd.Series.describe, axis=1)[['mean', 'std', '25%', '50%', '75%']] | def get_site_stats(array, player_names):
'\n Return the summarized statistics for a given array corresponding\n to the values sampled for a latent or response site.\n '
if (len(array.shape) == 1):
df = pd.DataFrame(array).transpose()
else:
df = pd.DataFrame(array, columns=player_names).transpose()
return df.apply(pd.Series.describe, axis=1)[['mean', 'std', '25%', '50%', '75%']]<|docstring|>Return the summarized statistics for a given array corresponding
to the values sampled for a latent or response site.<|endoftext|> |
ac59c612f9e8d36033b014ec559894f55a61243bb6d1a7dd501486de3f9d72c8 | def summary(trace_posterior, sites, player_names, transforms={}, diagnostics=True):
'\n Return summarized statistics for each of the ``sites`` in the\n traces corresponding to the approximate posterior.\n '
marginal = trace_posterior.marginal(sites)
site_stats = {}
for site_name in sites:
marginal_site = marginal.support(flatten=True)[site_name]
if (site_name in transforms):
marginal_site = transforms[site_name](marginal_site)
site_stats[site_name] = get_site_stats(marginal_site.cpu().numpy(), player_names)
if (diagnostics and (trace_posterior.num_chains > 1)):
diag = marginal.diagnostics()[site_name]
site_stats[site_name] = site_stats[site_name].assign(n_eff=diag['n_eff'].cpu().numpy(), r_hat=diag['r_hat'].cpu().numpy())
return site_stats | Return summarized statistics for each of the ``sites`` in the
traces corresponding to the approximate posterior. | examples/baseball.py | summary | hesenp/pyro | 0 | python | def summary(trace_posterior, sites, player_names, transforms={}, diagnostics=True):
'\n Return summarized statistics for each of the ``sites`` in the\n traces corresponding to the approximate posterior.\n '
marginal = trace_posterior.marginal(sites)
site_stats = {}
for site_name in sites:
marginal_site = marginal.support(flatten=True)[site_name]
if (site_name in transforms):
marginal_site = transforms[site_name](marginal_site)
site_stats[site_name] = get_site_stats(marginal_site.cpu().numpy(), player_names)
if (diagnostics and (trace_posterior.num_chains > 1)):
diag = marginal.diagnostics()[site_name]
site_stats[site_name] = site_stats[site_name].assign(n_eff=diag['n_eff'].cpu().numpy(), r_hat=diag['r_hat'].cpu().numpy())
return site_stats | def summary(trace_posterior, sites, player_names, transforms={}, diagnostics=True):
'\n Return summarized statistics for each of the ``sites`` in the\n traces corresponding to the approximate posterior.\n '
marginal = trace_posterior.marginal(sites)
site_stats = {}
for site_name in sites:
marginal_site = marginal.support(flatten=True)[site_name]
if (site_name in transforms):
marginal_site = transforms[site_name](marginal_site)
site_stats[site_name] = get_site_stats(marginal_site.cpu().numpy(), player_names)
if (diagnostics and (trace_posterior.num_chains > 1)):
diag = marginal.diagnostics()[site_name]
site_stats[site_name] = site_stats[site_name].assign(n_eff=diag['n_eff'].cpu().numpy(), r_hat=diag['r_hat'].cpu().numpy())
return site_stats<|docstring|>Return summarized statistics for each of the ``sites`` in the
traces corresponding to the approximate posterior.<|endoftext|> |
b7e5246447b5e92778bef82415114fd275f5c8112147c735ebe85e2c8fb4c57c | def train_test_split(pd_dataframe):
'\n Training data - 45 initial at-bats and hits for each player.\n Validation data - Full season at-bats and hits for each player.\n '
device = torch.Tensor().device
train_data = torch.tensor(pd_dataframe[['At-Bats', 'Hits']].values, dtype=torch.float, device=device)
test_data = torch.tensor(pd_dataframe[['SeasonAt-Bats', 'SeasonHits']].values, dtype=torch.float, device=device)
first_name = pd_dataframe['FirstName'].values
last_name = pd_dataframe['LastName'].values
player_names = [' '.join([first, last]) for (first, last) in zip(first_name, last_name)]
return (train_data, test_data, player_names) | Training data - 45 initial at-bats and hits for each player.
Validation data - Full season at-bats and hits for each player. | examples/baseball.py | train_test_split | hesenp/pyro | 0 | python | def train_test_split(pd_dataframe):
'\n Training data - 45 initial at-bats and hits for each player.\n Validation data - Full season at-bats and hits for each player.\n '
device = torch.Tensor().device
train_data = torch.tensor(pd_dataframe[['At-Bats', 'Hits']].values, dtype=torch.float, device=device)
test_data = torch.tensor(pd_dataframe[['SeasonAt-Bats', 'SeasonHits']].values, dtype=torch.float, device=device)
first_name = pd_dataframe['FirstName'].values
last_name = pd_dataframe['LastName'].values
player_names = [' '.join([first, last]) for (first, last) in zip(first_name, last_name)]
return (train_data, test_data, player_names) | def train_test_split(pd_dataframe):
'\n Training data - 45 initial at-bats and hits for each player.\n Validation data - Full season at-bats and hits for each player.\n '
device = torch.Tensor().device
train_data = torch.tensor(pd_dataframe[['At-Bats', 'Hits']].values, dtype=torch.float, device=device)
test_data = torch.tensor(pd_dataframe[['SeasonAt-Bats', 'SeasonHits']].values, dtype=torch.float, device=device)
first_name = pd_dataframe['FirstName'].values
last_name = pd_dataframe['LastName'].values
player_names = [' '.join([first, last]) for (first, last) in zip(first_name, last_name)]
return (train_data, test_data, player_names)<|docstring|>Training data - 45 initial at-bats and hits for each player.
Validation data - Full season at-bats and hits for each player.<|endoftext|> |
99538e19aafa5a33acb1e6ea7ce1331805a56b8d6f3be66463bbf0fe1786f414 | def sample_posterior_predictive(posterior_predictive, baseball_dataset):
'\n Generate samples from posterior predictive distribution.\n '
(train, test, player_names) = train_test_split(baseball_dataset)
at_bats = train[(:, 0)]
at_bats_season = test[(:, 0)]
logging.Formatter('%(message)s')
logging.info('\nPosterior Predictive:')
logging.info('Hit Rate - Initial 45 At Bats')
logging.info('-----------------------------')
train_predict = posterior_predictive.run(at_bats, None)
train_summary = summary(train_predict, sites=['obs'], player_names=player_names, diagnostics=False)['obs']
train_summary = train_summary.assign(ActualHits=baseball_dataset[['Hits']].values)
logging.info(train_summary)
logging.info('\nHit Rate - Season Predictions')
logging.info('-----------------------------')
test_predict = posterior_predictive.run(at_bats_season, None)
test_summary = summary(test_predict, sites=['obs'], player_names=player_names, diagnostics=False)['obs']
test_summary = test_summary.assign(ActualHits=baseball_dataset[['SeasonHits']].values)
logging.info(test_summary) | Generate samples from posterior predictive distribution. | examples/baseball.py | sample_posterior_predictive | hesenp/pyro | 0 | python | def sample_posterior_predictive(posterior_predictive, baseball_dataset):
'\n \n '
(train, test, player_names) = train_test_split(baseball_dataset)
at_bats = train[(:, 0)]
at_bats_season = test[(:, 0)]
logging.Formatter('%(message)s')
logging.info('\nPosterior Predictive:')
logging.info('Hit Rate - Initial 45 At Bats')
logging.info('-----------------------------')
train_predict = posterior_predictive.run(at_bats, None)
train_summary = summary(train_predict, sites=['obs'], player_names=player_names, diagnostics=False)['obs']
train_summary = train_summary.assign(ActualHits=baseball_dataset[['Hits']].values)
logging.info(train_summary)
logging.info('\nHit Rate - Season Predictions')
logging.info('-----------------------------')
test_predict = posterior_predictive.run(at_bats_season, None)
test_summary = summary(test_predict, sites=['obs'], player_names=player_names, diagnostics=False)['obs']
test_summary = test_summary.assign(ActualHits=baseball_dataset[['SeasonHits']].values)
logging.info(test_summary) | def sample_posterior_predictive(posterior_predictive, baseball_dataset):
'\n \n '
(train, test, player_names) = train_test_split(baseball_dataset)
at_bats = train[(:, 0)]
at_bats_season = test[(:, 0)]
logging.Formatter('%(message)s')
logging.info('\nPosterior Predictive:')
logging.info('Hit Rate - Initial 45 At Bats')
logging.info('-----------------------------')
train_predict = posterior_predictive.run(at_bats, None)
train_summary = summary(train_predict, sites=['obs'], player_names=player_names, diagnostics=False)['obs']
train_summary = train_summary.assign(ActualHits=baseball_dataset[['Hits']].values)
logging.info(train_summary)
logging.info('\nHit Rate - Season Predictions')
logging.info('-----------------------------')
test_predict = posterior_predictive.run(at_bats_season, None)
test_summary = summary(test_predict, sites=['obs'], player_names=player_names, diagnostics=False)['obs']
test_summary = test_summary.assign(ActualHits=baseball_dataset[['SeasonHits']].values)
logging.info(test_summary)<|docstring|>Generate samples from posterior predictive distribution.<|endoftext|> |
3b3cc39478d8bd84b3171661d033a9decc7d9056e2cdd7167181898644591944 | def evaluate_log_predictive_density(posterior_predictive, baseball_dataset):
'\n Evaluate the log probability density of observing the unseen data (season hits)\n given a model and empirical distribution over the parameters.\n '
(_, test, player_names) = train_test_split(baseball_dataset)
(at_bats_season, hits_season) = (test[(:, 0)], test[(:, 1)])
test_eval = posterior_predictive.run(at_bats_season, hits_season)
trace_log_pdf = []
for tr in test_eval.exec_traces:
trace_log_pdf.append(tr.log_prob_sum())
posterior_pred_density = (logsumexp(torch.stack(trace_log_pdf), dim=(- 1)) - math.log(len(trace_log_pdf)))
logging.info('\nLog posterior predictive density')
logging.info('--------------------------------')
logging.info('{:.4f}\n'.format(posterior_pred_density)) | Evaluate the log probability density of observing the unseen data (season hits)
given a model and empirical distribution over the parameters. | examples/baseball.py | evaluate_log_predictive_density | hesenp/pyro | 0 | python | def evaluate_log_predictive_density(posterior_predictive, baseball_dataset):
'\n Evaluate the log probability density of observing the unseen data (season hits)\n given a model and empirical distribution over the parameters.\n '
(_, test, player_names) = train_test_split(baseball_dataset)
(at_bats_season, hits_season) = (test[(:, 0)], test[(:, 1)])
test_eval = posterior_predictive.run(at_bats_season, hits_season)
trace_log_pdf = []
for tr in test_eval.exec_traces:
trace_log_pdf.append(tr.log_prob_sum())
posterior_pred_density = (logsumexp(torch.stack(trace_log_pdf), dim=(- 1)) - math.log(len(trace_log_pdf)))
logging.info('\nLog posterior predictive density')
logging.info('--------------------------------')
logging.info('{:.4f}\n'.format(posterior_pred_density)) | def evaluate_log_predictive_density(posterior_predictive, baseball_dataset):
'\n Evaluate the log probability density of observing the unseen data (season hits)\n given a model and empirical distribution over the parameters.\n '
(_, test, player_names) = train_test_split(baseball_dataset)
(at_bats_season, hits_season) = (test[(:, 0)], test[(:, 1)])
test_eval = posterior_predictive.run(at_bats_season, hits_season)
trace_log_pdf = []
for tr in test_eval.exec_traces:
trace_log_pdf.append(tr.log_prob_sum())
posterior_pred_density = (logsumexp(torch.stack(trace_log_pdf), dim=(- 1)) - math.log(len(trace_log_pdf)))
logging.info('\nLog posterior predictive density')
logging.info('--------------------------------')
logging.info('{:.4f}\n'.format(posterior_pred_density))<|docstring|>Evaluate the log probability density of observing the unseen data (season hits)
given a model and empirical distribution over the parameters.<|endoftext|> |
0cc09ca379511c4d12e587d1c3fcbbe3d68414b7036f63eec168312b84d4dda1 | def red_leds_on(sleep_speed):
'\n Lights up the red LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(13, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(7, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(1, LED_BRIGHTNESS)
sleep(sleep_speed) | Lights up the red LEDs one at a time | Programs/inside_out_3.py | red_leds_on | ShineTop/PiGlow | 5 | python | def red_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(13, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(7, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(1, LED_BRIGHTNESS)
sleep(sleep_speed) | def red_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(13, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(7, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(1, LED_BRIGHTNESS)
sleep(sleep_speed)<|docstring|>Lights up the red LEDs one at a time<|endoftext|> |
a89ad8e067b5d67553d6453ed4e92a2a70b3458c70b1038510d3f26255c95810 | def red_leds_off(sleep_speed):
'\n Turns off the red LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(13, 0)
sleep(sleep_speed)
PYGLOW.led(7, 0)
sleep(sleep_speed)
PYGLOW.led(1, 0)
sleep(sleep_speed) | Turns off the red LEDs one at a time | Programs/inside_out_3.py | red_leds_off | ShineTop/PiGlow | 5 | python | def red_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(13, 0)
sleep(sleep_speed)
PYGLOW.led(7, 0)
sleep(sleep_speed)
PYGLOW.led(1, 0)
sleep(sleep_speed) | def red_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(13, 0)
sleep(sleep_speed)
PYGLOW.led(7, 0)
sleep(sleep_speed)
PYGLOW.led(1, 0)
sleep(sleep_speed)<|docstring|>Turns off the red LEDs one at a time<|endoftext|> |
d5f7961e8ddca65e1352d1d841c64dde3cc4b44f46e86ef4b39b462f790f088a | def orange_leds_on(sleep_speed):
'\n Lights up the orange LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(14, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(8, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(2, LED_BRIGHTNESS)
sleep(sleep_speed) | Lights up the orange LEDs one at a time | Programs/inside_out_3.py | orange_leds_on | ShineTop/PiGlow | 5 | python | def orange_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(14, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(8, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(2, LED_BRIGHTNESS)
sleep(sleep_speed) | def orange_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(14, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(8, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(2, LED_BRIGHTNESS)
sleep(sleep_speed)<|docstring|>Lights up the orange LEDs one at a time<|endoftext|> |
e2b146fdf247d2193ec0eab2d94abff53eeda57eb563ee37ebb1410b78617a67 | def orange_leds_off(sleep_speed):
'\n Turns off the orange LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(14, 0)
sleep(sleep_speed)
PYGLOW.led(8, 0)
sleep(sleep_speed)
PYGLOW.led(2, 0)
sleep(sleep_speed) | Turns off the orange LEDs one at a time | Programs/inside_out_3.py | orange_leds_off | ShineTop/PiGlow | 5 | python | def orange_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(14, 0)
sleep(sleep_speed)
PYGLOW.led(8, 0)
sleep(sleep_speed)
PYGLOW.led(2, 0)
sleep(sleep_speed) | def orange_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(14, 0)
sleep(sleep_speed)
PYGLOW.led(8, 0)
sleep(sleep_speed)
PYGLOW.led(2, 0)
sleep(sleep_speed)<|docstring|>Turns off the orange LEDs one at a time<|endoftext|> |
166490814784be3d85420f3ab4ba086d4ea3fc54f3632fbe6a33b3917a2511b2 | def yellow_leds_on(sleep_speed):
'\n Lights up the yellow LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(15, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(9, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(3, LED_BRIGHTNESS)
sleep(sleep_speed) | Lights up the yellow LEDs one at a time | Programs/inside_out_3.py | yellow_leds_on | ShineTop/PiGlow | 5 | python | def yellow_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(15, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(9, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(3, LED_BRIGHTNESS)
sleep(sleep_speed) | def yellow_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(15, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(9, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(3, LED_BRIGHTNESS)
sleep(sleep_speed)<|docstring|>Lights up the yellow LEDs one at a time<|endoftext|> |
6d099979cf2506740039222f54e8ea2fdc1e2f6e51e93b4aae9873d23b07abc9 | def yellow_leds_off(sleep_speed):
'\n Turns off the yellow LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(15, 0)
sleep(sleep_speed)
PYGLOW.led(9, 0)
sleep(sleep_speed)
PYGLOW.led(3, 0)
sleep(sleep_speed) | Turns off the yellow LEDs one at a time | Programs/inside_out_3.py | yellow_leds_off | ShineTop/PiGlow | 5 | python | def yellow_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(15, 0)
sleep(sleep_speed)
PYGLOW.led(9, 0)
sleep(sleep_speed)
PYGLOW.led(3, 0)
sleep(sleep_speed) | def yellow_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(15, 0)
sleep(sleep_speed)
PYGLOW.led(9, 0)
sleep(sleep_speed)
PYGLOW.led(3, 0)
sleep(sleep_speed)<|docstring|>Turns off the yellow LEDs one at a time<|endoftext|> |
d08dfa1d170ac6467eb049ccad1e2b675baad28765c458c7e98463b222a83de9 | def green_leds_on(sleep_speed):
'\n Lights up the green LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(16, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(10, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(4, LED_BRIGHTNESS)
sleep(sleep_speed) | Lights up the green LEDs one at a time | Programs/inside_out_3.py | green_leds_on | ShineTop/PiGlow | 5 | python | def green_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(16, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(10, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(4, LED_BRIGHTNESS)
sleep(sleep_speed) | def green_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(16, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(10, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(4, LED_BRIGHTNESS)
sleep(sleep_speed)<|docstring|>Lights up the green LEDs one at a time<|endoftext|> |
c55fdb080e6918a13ac11deab70abd5fc48f6feabba9ebc863a7dcaa831b25db | def green_leds_off(sleep_speed):
'\n Turns off the green LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(16, 0)
sleep(sleep_speed)
PYGLOW.led(10, 0)
sleep(sleep_speed)
PYGLOW.led(4, 0)
sleep(sleep_speed) | Turns off the green LEDs one at a time | Programs/inside_out_3.py | green_leds_off | ShineTop/PiGlow | 5 | python | def green_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(16, 0)
sleep(sleep_speed)
PYGLOW.led(10, 0)
sleep(sleep_speed)
PYGLOW.led(4, 0)
sleep(sleep_speed) | def green_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(16, 0)
sleep(sleep_speed)
PYGLOW.led(10, 0)
sleep(sleep_speed)
PYGLOW.led(4, 0)
sleep(sleep_speed)<|docstring|>Turns off the green LEDs one at a time<|endoftext|> |
3400cf946c4fcf2b7ba25acdc588c4b7984301950a154b0b7046341cbc16c25d | def blue_leds_on(sleep_speed):
'\n Lights up the blue LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(17, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(11, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(5, LED_BRIGHTNESS)
sleep(sleep_speed) | Lights up the blue LEDs one at a time | Programs/inside_out_3.py | blue_leds_on | ShineTop/PiGlow | 5 | python | def blue_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(17, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(11, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(5, LED_BRIGHTNESS)
sleep(sleep_speed) | def blue_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(17, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(11, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(5, LED_BRIGHTNESS)
sleep(sleep_speed)<|docstring|>Lights up the blue LEDs one at a time<|endoftext|> |
aab26eb456e19f5e361ee261decf500d887fbfd0ab7dfbd160145f7e3527e87f | def blue_leds_off(sleep_speed):
'\n Turns off the blue LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(17, 0)
sleep(sleep_speed)
PYGLOW.led(11, 0)
sleep(sleep_speed)
PYGLOW.led(5, 0)
sleep(sleep_speed) | Turns off the blue LEDs one at a time | Programs/inside_out_3.py | blue_leds_off | ShineTop/PiGlow | 5 | python | def blue_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(17, 0)
sleep(sleep_speed)
PYGLOW.led(11, 0)
sleep(sleep_speed)
PYGLOW.led(5, 0)
sleep(sleep_speed) | def blue_leds_off(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(17, 0)
sleep(sleep_speed)
PYGLOW.led(11, 0)
sleep(sleep_speed)
PYGLOW.led(5, 0)
sleep(sleep_speed)<|docstring|>Turns off the blue LEDs one at a time<|endoftext|> |
f741c0842382bdac8611dd4f419fc9fcc892ce051a07c564ee6868f6708918be | def white_leds_on(sleep_speed):
'\n Lights up the white LEDs one at a time\n '
sleep_speed = sleep_speed
PYGLOW.led(18, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(12, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(6, LED_BRIGHTNESS)
sleep(sleep_speed) | Lights up the white LEDs one at a time | Programs/inside_out_3.py | white_leds_on | ShineTop/PiGlow | 5 | python | def white_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(18, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(12, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(6, LED_BRIGHTNESS)
sleep(sleep_speed) | def white_leds_on(sleep_speed):
'\n \n '
sleep_speed = sleep_speed
PYGLOW.led(18, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(12, LED_BRIGHTNESS)
sleep(sleep_speed)
PYGLOW.led(6, LED_BRIGHTNESS)
sleep(sleep_speed)<|docstring|>Lights up the white LEDs one at a time<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.