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 |
|---|---|---|---|---|---|---|---|---|---|
482480447b9214d8db97e7e53c42a8c83696bd7cc62190e06ccb61207fc7a5ed | @property
@pulumi.getter(name='eligibilityResult')
def eligibility_result(self) -> Optional['outputs.FailoverSetEligibilityResultResponseResult']:
'\n The eligibility result of the failover set, for failover.\n '
return pulumi.get(self, 'eligibility_result') | The eligibility result of the failover set, for failover. | sdk/python/pulumi_azure_native/storsimple/outputs.py | eligibility_result | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='eligibilityResult')
def eligibility_result(self) -> Optional['outputs.FailoverSetEligibilityResultResponseResult']:
'\n \n '
return pulumi.get(self, 'eligibility_result') | @property
@pulumi.getter(name='eligibilityResult')
def eligibility_result(self) -> Optional['outputs.FailoverSetEligibilityResultResponseResult']:
'\n \n '
return pulumi.get(self, 'eligibility_result')<|docstring|>The eligibility result of the failover set, for failover.<|endoftext|> |
8865b3417a4dd26d9b84bf20f06fb6c2a4e74ab670e0f4d5a660a1e164e04c2d | @property
@pulumi.getter(name='volumeContainers')
def volume_containers(self) -> Optional[Sequence['outputs.VolumeContainerFailoverMetadataResponseResult']]:
'\n The list of meta data of volume containers, which are part of the failover set.\n '
return pulumi.get(self, 'volume_containers') | The list of meta data of volume containers, which are part of the failover set. | sdk/python/pulumi_azure_native/storsimple/outputs.py | volume_containers | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='volumeContainers')
def volume_containers(self) -> Optional[Sequence['outputs.VolumeContainerFailoverMetadataResponseResult']]:
'\n \n '
return pulumi.get(self, 'volume_containers') | @property
@pulumi.getter(name='volumeContainers')
def volume_containers(self) -> Optional[Sequence['outputs.VolumeContainerFailoverMetadataResponseResult']]:
'\n \n '
return pulumi.get(self, 'volume_containers')<|docstring|>The list of meta data of volume containers, which are part of the failover... |
9b05f2b7e498acae1d814ca7b52607a11d58dcca3fe19acd24a62e7eae3cc9c7 | def __init__(__self__, *, available_local_storage_in_bytes: Optional[float]=None, available_tiered_storage_in_bytes: Optional[float]=None, data_containers_count: Optional[int]=None, device_id: Optional[str]=None, device_location: Optional[str]=None, device_software_version: Optional[str]=None, device_status: Optional[s... | Represents the eligibility of a device as a failover target device.
:param float available_local_storage_in_bytes: The amount of free local storage available on the device in bytes.
:param float available_tiered_storage_in_bytes: The amount of free tiered storage available for the device in bytes.
:param int data_conta... | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, available_local_storage_in_bytes: Optional[float]=None, available_tiered_storage_in_bytes: Optional[float]=None, data_containers_count: Optional[int]=None, device_id: Optional[str]=None, device_location: Optional[str]=None, device_software_version: Optional[str]=None, device_status: Optional[s... | def __init__(__self__, *, available_local_storage_in_bytes: Optional[float]=None, available_tiered_storage_in_bytes: Optional[float]=None, data_containers_count: Optional[int]=None, device_id: Optional[str]=None, device_location: Optional[str]=None, device_software_version: Optional[str]=None, device_status: Optional[s... |
ddb49e387fdaefe720a2a2c62e85bf20854efaa195bb0dcf0be070544532738c | @property
@pulumi.getter(name='availableLocalStorageInBytes')
def available_local_storage_in_bytes(self) -> Optional[float]:
'\n The amount of free local storage available on the device in bytes.\n '
return pulumi.get(self, 'available_local_storage_in_bytes') | The amount of free local storage available on the device in bytes. | sdk/python/pulumi_azure_native/storsimple/outputs.py | available_local_storage_in_bytes | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='availableLocalStorageInBytes')
def available_local_storage_in_bytes(self) -> Optional[float]:
'\n \n '
return pulumi.get(self, 'available_local_storage_in_bytes') | @property
@pulumi.getter(name='availableLocalStorageInBytes')
def available_local_storage_in_bytes(self) -> Optional[float]:
'\n \n '
return pulumi.get(self, 'available_local_storage_in_bytes')<|docstring|>The amount of free local storage available on the device in bytes.<|endoftext|> |
88cfd79fb8139b0b4d9b95100f1b3054653f6e6eda086ca32cc10a4bd0ad2bda | @property
@pulumi.getter(name='availableTieredStorageInBytes')
def available_tiered_storage_in_bytes(self) -> Optional[float]:
'\n The amount of free tiered storage available for the device in bytes.\n '
return pulumi.get(self, 'available_tiered_storage_in_bytes') | The amount of free tiered storage available for the device in bytes. | sdk/python/pulumi_azure_native/storsimple/outputs.py | available_tiered_storage_in_bytes | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='availableTieredStorageInBytes')
def available_tiered_storage_in_bytes(self) -> Optional[float]:
'\n \n '
return pulumi.get(self, 'available_tiered_storage_in_bytes') | @property
@pulumi.getter(name='availableTieredStorageInBytes')
def available_tiered_storage_in_bytes(self) -> Optional[float]:
'\n \n '
return pulumi.get(self, 'available_tiered_storage_in_bytes')<|docstring|>The amount of free tiered storage available for the device in bytes.<|endoftext|> |
af9fdae618b14b90cd2a0d94d4114c4d7ce5a64660ef8207902138c20299f3af | @property
@pulumi.getter(name='dataContainersCount')
def data_containers_count(self) -> Optional[int]:
'\n The count of data containers on the device.\n '
return pulumi.get(self, 'data_containers_count') | The count of data containers on the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | data_containers_count | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='dataContainersCount')
def data_containers_count(self) -> Optional[int]:
'\n \n '
return pulumi.get(self, 'data_containers_count') | @property
@pulumi.getter(name='dataContainersCount')
def data_containers_count(self) -> Optional[int]:
'\n \n '
return pulumi.get(self, 'data_containers_count')<|docstring|>The count of data containers on the device.<|endoftext|> |
b7508c81e10dc41d6a392650ae059afe4b82b6f4c19da3141c526859b4843109 | @property
@pulumi.getter(name='deviceId')
def device_id(self) -> Optional[str]:
'\n The path ID of the device.\n '
return pulumi.get(self, 'device_id') | The path ID of the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | device_id | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='deviceId')
def device_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_id') | @property
@pulumi.getter(name='deviceId')
def device_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_id')<|docstring|>The path ID of the device.<|endoftext|> |
e3db6a05564ebd60f44ebc08fe15f95758574e4988d33b775ae744bcc88c731a | @property
@pulumi.getter(name='deviceLocation')
def device_location(self) -> Optional[str]:
'\n The geo location (applicable only for cloud appliances) of the device.\n '
return pulumi.get(self, 'device_location') | The geo location (applicable only for cloud appliances) of the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | device_location | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='deviceLocation')
def device_location(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_location') | @property
@pulumi.getter(name='deviceLocation')
def device_location(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_location')<|docstring|>The geo location (applicable only for cloud appliances) of the device.<|endoftext|> |
84cd7b2a61d361d2c8fb942c4216b27da1f8f5d9b78a50d8dac0af838451dc6e | @property
@pulumi.getter(name='deviceSoftwareVersion')
def device_software_version(self) -> Optional[str]:
'\n The software version of the device.\n '
return pulumi.get(self, 'device_software_version') | The software version of the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | device_software_version | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='deviceSoftwareVersion')
def device_software_version(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_software_version') | @property
@pulumi.getter(name='deviceSoftwareVersion')
def device_software_version(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_software_version')<|docstring|>The software version of the device.<|endoftext|> |
8b7a6f47046c147a03a2396e0c30a14f4e2306016357d8f6adc411209ca85d23 | @property
@pulumi.getter(name='deviceStatus')
def device_status(self) -> Optional[str]:
'\n The status of the device.\n '
return pulumi.get(self, 'device_status') | The status of the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | device_status | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='deviceStatus')
def device_status(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_status') | @property
@pulumi.getter(name='deviceStatus')
def device_status(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'device_status')<|docstring|>The status of the device.<|endoftext|> |
8590b48e2259baa7531b18fd155b0968e0be577e5ec789ffc4c84aa2cd59a178 | @property
@pulumi.getter(name='eligibilityResult')
def eligibility_result(self) -> Optional['outputs.TargetEligibilityResultResponseResult']:
'\n The eligibility result of the device, as a failover target device.\n '
return pulumi.get(self, 'eligibility_result') | The eligibility result of the device, as a failover target device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | eligibility_result | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='eligibilityResult')
def eligibility_result(self) -> Optional['outputs.TargetEligibilityResultResponseResult']:
'\n \n '
return pulumi.get(self, 'eligibility_result') | @property
@pulumi.getter(name='eligibilityResult')
def eligibility_result(self) -> Optional['outputs.TargetEligibilityResultResponseResult']:
'\n \n '
return pulumi.get(self, 'eligibility_result')<|docstring|>The eligibility result of the device, as a failover target device.<|endoftext|> |
fb42597739749d3c4bd3a455d3d118690f8a46062503521f0252b0535aae5ca5 | @property
@pulumi.getter(name='friendlyDeviceSoftwareVersion')
def friendly_device_software_version(self) -> Optional[str]:
'\n The friendly name for the current version of software on the device.\n '
return pulumi.get(self, 'friendly_device_software_version') | The friendly name for the current version of software on the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | friendly_device_software_version | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='friendlyDeviceSoftwareVersion')
def friendly_device_software_version(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'friendly_device_software_version') | @property
@pulumi.getter(name='friendlyDeviceSoftwareVersion')
def friendly_device_software_version(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'friendly_device_software_version')<|docstring|>The friendly name for the current version of software on the device.<|endoftext|> |
5c30c245c1d891539a0bc2189d340ef1048ffe670978de3d325c8ba8332d17e1 | @property
@pulumi.getter(name='modelDescription')
def model_description(self) -> Optional[str]:
'\n The model number of the device.\n '
return pulumi.get(self, 'model_description') | The model number of the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | model_description | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='modelDescription')
def model_description(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'model_description') | @property
@pulumi.getter(name='modelDescription')
def model_description(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'model_description')<|docstring|>The model number of the device.<|endoftext|> |
61671061f2f593fb55aa81af76d3a521e6ab12892cde8b9762b6b3ab9f270b83 | @property
@pulumi.getter(name='volumesCount')
def volumes_count(self) -> Optional[int]:
'\n The count of volumes on the device.\n '
return pulumi.get(self, 'volumes_count') | The count of volumes on the device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | volumes_count | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='volumesCount')
def volumes_count(self) -> Optional[int]:
'\n \n '
return pulumi.get(self, 'volumes_count') | @property
@pulumi.getter(name='volumesCount')
def volumes_count(self) -> Optional[int]:
'\n \n '
return pulumi.get(self, 'volumes_count')<|docstring|>The count of volumes on the device.<|endoftext|> |
26d729da301911bacee1ec123c9f6f0e2435307f7a42f381e551e5ff7cc4bcbe | def __init__(__self__, *, type: str):
'\n Intrinsic settings which refers to the type of the StorSimple Manager.\n :param str type: The type of StorSimple Manager.\n '
pulumi.set(__self__, 'type', type) | Intrinsic settings which refers to the type of the StorSimple Manager.
:param str type: The type of StorSimple Manager. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, type: str):
'\n Intrinsic settings which refers to the type of the StorSimple Manager.\n :param str type: The type of StorSimple Manager.\n '
pulumi.set(__self__, 'type', type) | def __init__(__self__, *, type: str):
'\n Intrinsic settings which refers to the type of the StorSimple Manager.\n :param str type: The type of StorSimple Manager.\n '
pulumi.set(__self__, 'type', type)<|docstring|>Intrinsic settings which refers to the type of the StorSimple Manager.
:para... |
8ddce351640962a11263bd69844e0d19c8d78410d693ce83ecd0e6d4306c5f26 | @property
@pulumi.getter
def type(self) -> str:
'\n The type of StorSimple Manager.\n '
return pulumi.get(self, 'type') | The type of StorSimple Manager. | sdk/python/pulumi_azure_native/storsimple/outputs.py | type | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def type(self) -> str:
'\n \n '
return pulumi.get(self, 'type') | @property
@pulumi.getter
def type(self) -> str:
'\n \n '
return pulumi.get(self, 'type')<|docstring|>The type of StorSimple Manager.<|endoftext|> |
d49ea98dd215bd0f22083ff2a6d0294cda965381e844932ed4f1ac93335f7cc1 | def __init__(__self__, *, name: str):
'\n The Sku.\n :param str name: Refers to the sku name which should be "Standard"\n '
pulumi.set(__self__, 'name', name) | The Sku.
:param str name: Refers to the sku name which should be "Standard" | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, name: str):
'\n The Sku.\n :param str name: Refers to the sku name which should be "Standard"\n '
pulumi.set(__self__, 'name', name) | def __init__(__self__, *, name: str):
'\n The Sku.\n :param str name: Refers to the sku name which should be "Standard"\n '
pulumi.set(__self__, 'name', name)<|docstring|>The Sku.
:param str name: Refers to the sku name which should be "Standard"<|endoftext|> |
25ce39a3ae622b3923a94b8d7b09fe6e1d349fec9405d7a69d196aa68b104b83 | @property
@pulumi.getter
def name(self) -> str:
'\n Refers to the sku name which should be "Standard"\n '
return pulumi.get(self, 'name') | Refers to the sku name which should be "Standard" | sdk/python/pulumi_azure_native/storsimple/outputs.py | name | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def name(self) -> str:
'\n \n '
return pulumi.get(self, 'name') | @property
@pulumi.getter
def name(self) -> str:
'\n \n '
return pulumi.get(self, 'name')<|docstring|>Refers to the sku name which should be "Standard"<|endoftext|> |
c783474abc07d05961e730248721927cf134a0078adf5b1b9a698fc961695c51 | def __init__(__self__, *, recurrence_type: str, recurrence_value: int, weekly_days_list: Optional[Sequence[str]]=None):
"\n The schedule recurrence.\n :param str recurrence_type: The recurrence type.\n :param int recurrence_value: The recurrence value.\n :param Sequence[str] weekly_days_... | The schedule recurrence.
:param str recurrence_type: The recurrence type.
:param int recurrence_value: The recurrence value.
:param Sequence[str] weekly_days_list: The week days list. Applicable only for schedules of recurrence type 'weekly'. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, recurrence_type: str, recurrence_value: int, weekly_days_list: Optional[Sequence[str]]=None):
"\n The schedule recurrence.\n :param str recurrence_type: The recurrence type.\n :param int recurrence_value: The recurrence value.\n :param Sequence[str] weekly_days_... | def __init__(__self__, *, recurrence_type: str, recurrence_value: int, weekly_days_list: Optional[Sequence[str]]=None):
"\n The schedule recurrence.\n :param str recurrence_type: The recurrence type.\n :param int recurrence_value: The recurrence value.\n :param Sequence[str] weekly_days_... |
6036703e09b723831cf27c6ccfa16362dd127938ba8e5f95c55636555559ea2c | @property
@pulumi.getter(name='recurrenceType')
def recurrence_type(self) -> str:
'\n The recurrence type.\n '
return pulumi.get(self, 'recurrence_type') | The recurrence type. | sdk/python/pulumi_azure_native/storsimple/outputs.py | recurrence_type | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='recurrenceType')
def recurrence_type(self) -> str:
'\n \n '
return pulumi.get(self, 'recurrence_type') | @property
@pulumi.getter(name='recurrenceType')
def recurrence_type(self) -> str:
'\n \n '
return pulumi.get(self, 'recurrence_type')<|docstring|>The recurrence type.<|endoftext|> |
b69b5d666b214dc222a9eb422f08790e6bd156835a41b0210b4407ea3dc18202 | @property
@pulumi.getter(name='recurrenceValue')
def recurrence_value(self) -> int:
'\n The recurrence value.\n '
return pulumi.get(self, 'recurrence_value') | The recurrence value. | sdk/python/pulumi_azure_native/storsimple/outputs.py | recurrence_value | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='recurrenceValue')
def recurrence_value(self) -> int:
'\n \n '
return pulumi.get(self, 'recurrence_value') | @property
@pulumi.getter(name='recurrenceValue')
def recurrence_value(self) -> int:
'\n \n '
return pulumi.get(self, 'recurrence_value')<|docstring|>The recurrence value.<|endoftext|> |
55e1e21743a35f5d1de486c52d779d5529c021aa9051b0151e35bfdc5e4663e8 | @property
@pulumi.getter(name='weeklyDaysList')
def weekly_days_list(self) -> Optional[Sequence[str]]:
"\n The week days list. Applicable only for schedules of recurrence type 'weekly'.\n "
return pulumi.get(self, 'weekly_days_list') | The week days list. Applicable only for schedules of recurrence type 'weekly'. | sdk/python/pulumi_azure_native/storsimple/outputs.py | weekly_days_list | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='weeklyDaysList')
def weekly_days_list(self) -> Optional[Sequence[str]]:
"\n \n "
return pulumi.get(self, 'weekly_days_list') | @property
@pulumi.getter(name='weeklyDaysList')
def weekly_days_list(self) -> Optional[Sequence[str]]:
"\n \n "
return pulumi.get(self, 'weekly_days_list')<|docstring|>The week days list. Applicable only for schedules of recurrence type 'weekly'.<|endoftext|> |
dd4f3d4932de9e527a1a99a337e4ecfccda8235b277434fe60db35dcdb5b3d15 | def __init__(__self__, *, message: Optional[str]=None, resolution: Optional[str]=None, result_code: Optional[str]=None):
'\n The error/warning message due to which the device is ineligible as a failover target device.\n :param str message: The localized error message stating the reason why the device ... | The error/warning message due to which the device is ineligible as a failover target device.
:param str message: The localized error message stating the reason why the device is not eligible as a target device.
:param str resolution: The localized resolution message for the error.
:param str result_code: The result cod... | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, message: Optional[str]=None, resolution: Optional[str]=None, result_code: Optional[str]=None):
'\n The error/warning message due to which the device is ineligible as a failover target device.\n :param str message: The localized error message stating the reason why the device ... | def __init__(__self__, *, message: Optional[str]=None, resolution: Optional[str]=None, result_code: Optional[str]=None):
'\n The error/warning message due to which the device is ineligible as a failover target device.\n :param str message: The localized error message stating the reason why the device ... |
60fd4bc6be3effda2ad9d23c18c7d8bd4e05e3f59dcdd7ff9b0da2d9cd42f46a | @property
@pulumi.getter
def message(self) -> Optional[str]:
'\n The localized error message stating the reason why the device is not eligible as a target device.\n '
return pulumi.get(self, 'message') | The localized error message stating the reason why the device is not eligible as a target device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | message | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def message(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'message') | @property
@pulumi.getter
def message(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'message')<|docstring|>The localized error message stating the reason why the device is not eligible as a target device.<|endoftext|> |
ffb4f0d30a79c96d9a554158e0060a9d8ab4ae78fa07c2557f5d7aa3c6c328dc | @property
@pulumi.getter
def resolution(self) -> Optional[str]:
'\n The localized resolution message for the error.\n '
return pulumi.get(self, 'resolution') | The localized resolution message for the error. | sdk/python/pulumi_azure_native/storsimple/outputs.py | resolution | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def resolution(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'resolution') | @property
@pulumi.getter
def resolution(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'resolution')<|docstring|>The localized resolution message for the error.<|endoftext|> |
16319a2e4b5121f28a28ad566c3b27928d6de7c04f60df01a14c9483caec1785 | @property
@pulumi.getter(name='resultCode')
def result_code(self) -> Optional[str]:
'\n The result code for the error, due to which the device does not qualify as a failover target device.\n '
return pulumi.get(self, 'result_code') | The result code for the error, due to which the device does not qualify as a failover target device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | result_code | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='resultCode')
def result_code(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'result_code') | @property
@pulumi.getter(name='resultCode')
def result_code(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'result_code')<|docstring|>The result code for the error, due to which the device does not qualify as a failover target device.<|endoftext|> |
b0ecd09100f3cc6a7bcedb77310fab469ef10d6c85b6a76a8b41c9e1653f2a00 | def __init__(__self__, *, eligibility_status: Optional[str]=None, messages: Optional[Sequence['outputs.TargetEligibilityErrorMessageResponseResult']]=None):
"\n The eligibility result of device, as a failover target device.\n :param str eligibility_status: The eligibility status of device, as a failov... | The eligibility result of device, as a failover target device.
:param str eligibility_status: The eligibility status of device, as a failover target device.
:param Sequence['TargetEligibilityErrorMessageResponseArgs'] messages: The list of error messages, if a device does not qualify as a failover target device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, eligibility_status: Optional[str]=None, messages: Optional[Sequence['outputs.TargetEligibilityErrorMessageResponseResult']]=None):
"\n The eligibility result of device, as a failover target device.\n :param str eligibility_status: The eligibility status of device, as a failov... | def __init__(__self__, *, eligibility_status: Optional[str]=None, messages: Optional[Sequence['outputs.TargetEligibilityErrorMessageResponseResult']]=None):
"\n The eligibility result of device, as a failover target device.\n :param str eligibility_status: The eligibility status of device, as a failov... |
2515dda1b1a358d7d106316e43230165b34d2bdd02a54d9af09cf18f5734cdea | @property
@pulumi.getter(name='eligibilityStatus')
def eligibility_status(self) -> Optional[str]:
'\n The eligibility status of device, as a failover target device.\n '
return pulumi.get(self, 'eligibility_status') | The eligibility status of device, as a failover target device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | eligibility_status | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='eligibilityStatus')
def eligibility_status(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'eligibility_status') | @property
@pulumi.getter(name='eligibilityStatus')
def eligibility_status(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'eligibility_status')<|docstring|>The eligibility status of device, as a failover target device.<|endoftext|> |
a8c1cbc2e70b32176a43831de2db52fecedfbcf7ec412c4d587743ae25444f55 | @property
@pulumi.getter
def messages(self) -> Optional[Sequence['outputs.TargetEligibilityErrorMessageResponseResult']]:
'\n The list of error messages, if a device does not qualify as a failover target device.\n '
return pulumi.get(self, 'messages') | The list of error messages, if a device does not qualify as a failover target device. | sdk/python/pulumi_azure_native/storsimple/outputs.py | messages | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def messages(self) -> Optional[Sequence['outputs.TargetEligibilityErrorMessageResponseResult']]:
'\n \n '
return pulumi.get(self, 'messages') | @property
@pulumi.getter
def messages(self) -> Optional[Sequence['outputs.TargetEligibilityErrorMessageResponseResult']]:
'\n \n '
return pulumi.get(self, 'messages')<|docstring|>The list of error messages, if a device does not qualify as a failover target device.<|endoftext|> |
8ec6ed5a3a7ae677c5adcae4e1c014a4465e90dda3a34d3d1063f0a5744d166e | def __init__(__self__, *, hours: int, minutes: int, seconds: int):
'\n The time.\n :param int hours: The hour.\n :param int minutes: The minute.\n :param int seconds: The second.\n '
pulumi.set(__self__, 'hours', hours)
pulumi.set(__self__, 'minutes', minutes)
pulumi.s... | The time.
:param int hours: The hour.
:param int minutes: The minute.
:param int seconds: The second. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, hours: int, minutes: int, seconds: int):
'\n The time.\n :param int hours: The hour.\n :param int minutes: The minute.\n :param int seconds: The second.\n '
pulumi.set(__self__, 'hours', hours)
pulumi.set(__self__, 'minutes', minutes)
pulumi.s... | def __init__(__self__, *, hours: int, minutes: int, seconds: int):
'\n The time.\n :param int hours: The hour.\n :param int minutes: The minute.\n :param int seconds: The second.\n '
pulumi.set(__self__, 'hours', hours)
pulumi.set(__self__, 'minutes', minutes)
pulumi.s... |
826e5cd1f00d819afb9978827d5f2883f654eaeacdb6686b6a25351e9dd46870 | @property
@pulumi.getter
def hours(self) -> int:
'\n The hour.\n '
return pulumi.get(self, 'hours') | The hour. | sdk/python/pulumi_azure_native/storsimple/outputs.py | hours | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def hours(self) -> int:
'\n \n '
return pulumi.get(self, 'hours') | @property
@pulumi.getter
def hours(self) -> int:
'\n \n '
return pulumi.get(self, 'hours')<|docstring|>The hour.<|endoftext|> |
6cc687e3ab7ae03a84dcb0acac9cc4b796bcbb13268fe65a029ea98200f03812 | @property
@pulumi.getter
def minutes(self) -> int:
'\n The minute.\n '
return pulumi.get(self, 'minutes') | The minute. | sdk/python/pulumi_azure_native/storsimple/outputs.py | minutes | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def minutes(self) -> int:
'\n \n '
return pulumi.get(self, 'minutes') | @property
@pulumi.getter
def minutes(self) -> int:
'\n \n '
return pulumi.get(self, 'minutes')<|docstring|>The minute.<|endoftext|> |
5ccf3331f4dc272ac27bc0166438e4ef7f987c037061e0e1ab98b288676d405d | @property
@pulumi.getter
def seconds(self) -> int:
'\n The second.\n '
return pulumi.get(self, 'seconds') | The second. | sdk/python/pulumi_azure_native/storsimple/outputs.py | seconds | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def seconds(self) -> int:
'\n \n '
return pulumi.get(self, 'seconds') | @property
@pulumi.getter
def seconds(self) -> int:
'\n \n '
return pulumi.get(self, 'seconds')<|docstring|>The second.<|endoftext|> |
74e7dbd9fe75ad18d92080df9f6911f02db0e65b6381b017f243a74c3814cfa0 | def __init__(__self__, *, volume_container_id: Optional[str]=None, volumes: Optional[Sequence['outputs.VolumeFailoverMetadataResponseResult']]=None):
"\n The metadata of the volume container, that is being considered as part of a failover set.\n :param str volume_container_id: The path ID of the volum... | The metadata of the volume container, that is being considered as part of a failover set.
:param str volume_container_id: The path ID of the volume container.
:param Sequence['VolumeFailoverMetadataResponseArgs'] volumes: The list of metadata of volumes inside the volume container, which contains valid cloud snapshots. | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, volume_container_id: Optional[str]=None, volumes: Optional[Sequence['outputs.VolumeFailoverMetadataResponseResult']]=None):
"\n The metadata of the volume container, that is being considered as part of a failover set.\n :param str volume_container_id: The path ID of the volum... | def __init__(__self__, *, volume_container_id: Optional[str]=None, volumes: Optional[Sequence['outputs.VolumeFailoverMetadataResponseResult']]=None):
"\n The metadata of the volume container, that is being considered as part of a failover set.\n :param str volume_container_id: The path ID of the volum... |
9130d607fbbe60287e94de52882d2b6619e68d36060ea4e9b637bc244acad12c | @property
@pulumi.getter(name='volumeContainerId')
def volume_container_id(self) -> Optional[str]:
'\n The path ID of the volume container.\n '
return pulumi.get(self, 'volume_container_id') | The path ID of the volume container. | sdk/python/pulumi_azure_native/storsimple/outputs.py | volume_container_id | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='volumeContainerId')
def volume_container_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'volume_container_id') | @property
@pulumi.getter(name='volumeContainerId')
def volume_container_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'volume_container_id')<|docstring|>The path ID of the volume container.<|endoftext|> |
2a08ed2278df5ae5d8a84a670d610452194e6861dea745645f65210aed4a6cfb | @property
@pulumi.getter
def volumes(self) -> Optional[Sequence['outputs.VolumeFailoverMetadataResponseResult']]:
'\n The list of metadata of volumes inside the volume container, which contains valid cloud snapshots.\n '
return pulumi.get(self, 'volumes') | The list of metadata of volumes inside the volume container, which contains valid cloud snapshots. | sdk/python/pulumi_azure_native/storsimple/outputs.py | volumes | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter
def volumes(self) -> Optional[Sequence['outputs.VolumeFailoverMetadataResponseResult']]:
'\n \n '
return pulumi.get(self, 'volumes') | @property
@pulumi.getter
def volumes(self) -> Optional[Sequence['outputs.VolumeFailoverMetadataResponseResult']]:
'\n \n '
return pulumi.get(self, 'volumes')<|docstring|>The list of metadata of volumes inside the volume container, which contains valid cloud snapshots.<|endoftext|> |
4149cc3c4e8df3f1dce229cb5353bc6542d00c5099f4fb435f5179d06854ed6b | def __init__(__self__, *, backup_created_date: Optional[str]=None, backup_element_id: Optional[str]=None, backup_id: Optional[str]=None, backup_policy_id: Optional[str]=None, size_in_bytes: Optional[float]=None, volume_id: Optional[str]=None, volume_type: Optional[str]=None):
'\n The metadata of a volume tha... | The metadata of a volume that has valid cloud snapshot.
:param str backup_created_date: The date at which the snapshot was taken.
:param str backup_element_id: The path ID of the backup-element for this volume, inside the backup set.
:param str backup_id: The path ID of the backup set.
:param str backup_policy_id: The ... | sdk/python/pulumi_azure_native/storsimple/outputs.py | __init__ | pulumi-bot/pulumi-azure-native | 31 | python | def __init__(__self__, *, backup_created_date: Optional[str]=None, backup_element_id: Optional[str]=None, backup_id: Optional[str]=None, backup_policy_id: Optional[str]=None, size_in_bytes: Optional[float]=None, volume_id: Optional[str]=None, volume_type: Optional[str]=None):
'\n The metadata of a volume tha... | def __init__(__self__, *, backup_created_date: Optional[str]=None, backup_element_id: Optional[str]=None, backup_id: Optional[str]=None, backup_policy_id: Optional[str]=None, size_in_bytes: Optional[float]=None, volume_id: Optional[str]=None, volume_type: Optional[str]=None):
'\n The metadata of a volume tha... |
e8cc04be91b22502a264e98120854f9a5c79d0259338ffce081cfcdfd4078e82 | @property
@pulumi.getter(name='backupCreatedDate')
def backup_created_date(self) -> Optional[str]:
'\n The date at which the snapshot was taken.\n '
return pulumi.get(self, 'backup_created_date') | The date at which the snapshot was taken. | sdk/python/pulumi_azure_native/storsimple/outputs.py | backup_created_date | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='backupCreatedDate')
def backup_created_date(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_created_date') | @property
@pulumi.getter(name='backupCreatedDate')
def backup_created_date(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_created_date')<|docstring|>The date at which the snapshot was taken.<|endoftext|> |
dd2c9be7f04e21034808741696c7a34d45600e1d6f6aebba762d4ad95f7a961f | @property
@pulumi.getter(name='backupElementId')
def backup_element_id(self) -> Optional[str]:
'\n The path ID of the backup-element for this volume, inside the backup set.\n '
return pulumi.get(self, 'backup_element_id') | The path ID of the backup-element for this volume, inside the backup set. | sdk/python/pulumi_azure_native/storsimple/outputs.py | backup_element_id | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='backupElementId')
def backup_element_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_element_id') | @property
@pulumi.getter(name='backupElementId')
def backup_element_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_element_id')<|docstring|>The path ID of the backup-element for this volume, inside the backup set.<|endoftext|> |
f77689799457335a20979be6e6edf075cc20d005fb246794499c201abb2855b5 | @property
@pulumi.getter(name='backupId')
def backup_id(self) -> Optional[str]:
'\n The path ID of the backup set.\n '
return pulumi.get(self, 'backup_id') | The path ID of the backup set. | sdk/python/pulumi_azure_native/storsimple/outputs.py | backup_id | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='backupId')
def backup_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_id') | @property
@pulumi.getter(name='backupId')
def backup_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_id')<|docstring|>The path ID of the backup set.<|endoftext|> |
6a7e388241223b2269f4e47720523a99fde98a26f2cabc29230886d1b053df3a | @property
@pulumi.getter(name='backupPolicyId')
def backup_policy_id(self) -> Optional[str]:
'\n The path ID of the backup policy using which the snapshot was taken.\n '
return pulumi.get(self, 'backup_policy_id') | The path ID of the backup policy using which the snapshot was taken. | sdk/python/pulumi_azure_native/storsimple/outputs.py | backup_policy_id | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='backupPolicyId')
def backup_policy_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_policy_id') | @property
@pulumi.getter(name='backupPolicyId')
def backup_policy_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'backup_policy_id')<|docstring|>The path ID of the backup policy using which the snapshot was taken.<|endoftext|> |
e4c4c4c4a32432e0463d6bd623acc63066527fdd8e7ece6c218862f647e9869a | @property
@pulumi.getter(name='sizeInBytes')
def size_in_bytes(self) -> Optional[float]:
'\n The size of the volume in bytes at the time the snapshot was taken.\n '
return pulumi.get(self, 'size_in_bytes') | The size of the volume in bytes at the time the snapshot was taken. | sdk/python/pulumi_azure_native/storsimple/outputs.py | size_in_bytes | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='sizeInBytes')
def size_in_bytes(self) -> Optional[float]:
'\n \n '
return pulumi.get(self, 'size_in_bytes') | @property
@pulumi.getter(name='sizeInBytes')
def size_in_bytes(self) -> Optional[float]:
'\n \n '
return pulumi.get(self, 'size_in_bytes')<|docstring|>The size of the volume in bytes at the time the snapshot was taken.<|endoftext|> |
7ae538e2db7e49e0d8cd6e6fbc5fa5903fbfe103706748aa774eb4713d50f596 | @property
@pulumi.getter(name='volumeId')
def volume_id(self) -> Optional[str]:
'\n The path ID of the volume.\n '
return pulumi.get(self, 'volume_id') | The path ID of the volume. | sdk/python/pulumi_azure_native/storsimple/outputs.py | volume_id | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='volumeId')
def volume_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'volume_id') | @property
@pulumi.getter(name='volumeId')
def volume_id(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'volume_id')<|docstring|>The path ID of the volume.<|endoftext|> |
d6bac9f4f602b881919b550596d96c52bb445c8cc24f7904f1089f64db5a6660 | @property
@pulumi.getter(name='volumeType')
def volume_type(self) -> Optional[str]:
'\n The type of the volume.\n '
return pulumi.get(self, 'volume_type') | The type of the volume. | sdk/python/pulumi_azure_native/storsimple/outputs.py | volume_type | pulumi-bot/pulumi-azure-native | 31 | python | @property
@pulumi.getter(name='volumeType')
def volume_type(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'volume_type') | @property
@pulumi.getter(name='volumeType')
def volume_type(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'volume_type')<|docstring|>The type of the volume.<|endoftext|> |
8f85b7c3ee1a54e480dffa1879cf1802066680aa345216e42faec065c8533007 | def __init__(self, logpdf: Callable[([Tensor, Any], Tensor)], grad_logpdf: Callable[([Tensor, Any], Tensor)], device: torch.device, xi: Tensor, lb: float=(- infty), ub: float=infty, use_lower: bool=False, ns: int=50, **fargs: Any) -> None:
'\n initialize the upper (and if needed lower) hulls with the specifi... | initialize the upper (and if needed lower) hulls with the specified params
Parameters
==========
f: function that computes log(f(u,...)), for given u, where f(u) is proportional to the
density we want to sample from
fprima: d/du log(f(u,...))
xi: ordered vector of starting points in wich log(f(u,...) is defined
... | mt/mvae/distributions/ars.py | __init__ | macio232/mvae | 53 | python | def __init__(self, logpdf: Callable[([Tensor, Any], Tensor)], grad_logpdf: Callable[([Tensor, Any], Tensor)], device: torch.device, xi: Tensor, lb: float=(- infty), ub: float=infty, use_lower: bool=False, ns: int=50, **fargs: Any) -> None:
'\n initialize the upper (and if needed lower) hulls with the specifi... | def __init__(self, logpdf: Callable[([Tensor, Any], Tensor)], grad_logpdf: Callable[([Tensor, Any], Tensor)], device: torch.device, xi: Tensor, lb: float=(- infty), ub: float=infty, use_lower: bool=False, ns: int=50, **fargs: Any) -> None:
'\n initialize the upper (and if needed lower) hulls with the specifi... |
ab096b1d33f841a9fd383dcd6d0d057f4b6364ebe2e658045162228b97aeb217 | def sample(self, shape: torch.Size=torch.Size(), max_steps: int=1000.0) -> Tensor:
'Draw N samples and update upper and lower hulls accordingly.'
shape = (shape if isinstance(shape, torch.Size) else torch.Size([shape]))
samples = torch.ones(self.B, *shape).to(self.device)
bool_mask = (torch.ones(self.B,... | Draw N samples and update upper and lower hulls accordingly. | mt/mvae/distributions/ars.py | sample | macio232/mvae | 53 | python | def sample(self, shape: torch.Size=torch.Size(), max_steps: int=1000.0) -> Tensor:
shape = (shape if isinstance(shape, torch.Size) else torch.Size([shape]))
samples = torch.ones(self.B, *shape).to(self.device)
bool_mask = (torch.ones(self.B, *shape) == 1).to(self.device)
count = 0
while (bool_m... | def sample(self, shape: torch.Size=torch.Size(), max_steps: int=1000.0) -> Tensor:
shape = (shape if isinstance(shape, torch.Size) else torch.Size([shape]))
samples = torch.ones(self.B, *shape).to(self.device)
bool_mask = (torch.ones(self.B, *shape) == 1).to(self.device)
count = 0
while (bool_m... |
cdf7ec15a2a984590c0c4586feb1cb0846a2f66189d4b2d9bda67d4e4acfee07 | def recalculate_hull(self, nbnew: int=0, xnew: Optional[Tensor]=None, hnew: Optional[Tensor]=None, hprimenew: Optional[Tensor]=None) -> None:
'Recalculate hull from existing x, h, hprime.'
if (xnew is not None):
self.x[(:, self.K:(self.K + nbnew))] = xnew
(self.x, idx) = self.x.sort()
se... | Recalculate hull from existing x, h, hprime. | mt/mvae/distributions/ars.py | recalculate_hull | macio232/mvae | 53 | python | def recalculate_hull(self, nbnew: int=0, xnew: Optional[Tensor]=None, hnew: Optional[Tensor]=None, hprimenew: Optional[Tensor]=None) -> None:
if (xnew is not None):
self.x[(:, self.K:(self.K + nbnew))] = xnew
(self.x, idx) = self.x.sort()
self.h[(:, self.K:(self.K + nbnew))] = hnew
... | def recalculate_hull(self, nbnew: int=0, xnew: Optional[Tensor]=None, hnew: Optional[Tensor]=None, hprimenew: Optional[Tensor]=None) -> None:
if (xnew is not None):
self.x[(:, self.K:(self.K + nbnew))] = xnew
(self.x, idx) = self.x.sort()
self.h[(:, self.K:(self.K + nbnew))] = hnew
... |
f9c838d7c0915a7bd570764a21b2ad9cbc16513fea244f260101f5d1ec071440 | def sample_upper(self, shape: torch.Size=torch.Size()) -> Tuple[(Tensor, Tensor)]:
'Return a single value randomly sampled from the upper hull and index of segment.'
u = torch.rand(self.B, *shape, device=self.device)
i = ((self.cs / self.cu.unsqueeze((- 1))).unsqueeze((- 1)) <= u.unsqueeze(1).expand(*self.c... | Return a single value randomly sampled from the upper hull and index of segment. | mt/mvae/distributions/ars.py | sample_upper | macio232/mvae | 53 | python | def sample_upper(self, shape: torch.Size=torch.Size()) -> Tuple[(Tensor, Tensor)]:
u = torch.rand(self.B, *shape, device=self.device)
i = ((self.cs / self.cu.unsqueeze((- 1))).unsqueeze((- 1)) <= u.unsqueeze(1).expand(*self.cs.shape, *shape))
idx = (i.sum(1) - 1)
xt = (self.x.gather(1, idx) + (((- ... | def sample_upper(self, shape: torch.Size=torch.Size()) -> Tuple[(Tensor, Tensor)]:
u = torch.rand(self.B, *shape, device=self.device)
i = ((self.cs / self.cu.unsqueeze((- 1))).unsqueeze((- 1)) <= u.unsqueeze(1).expand(*self.cs.shape, *shape))
idx = (i.sum(1) - 1)
xt = (self.x.gather(1, idx) + (((- ... |
a51087f1621cb778b054e14857c83e3d46b443a304ede8e6194577f3a422a62b | def minimumMoves(self, grid):
'\n :type grid: List[List[int]]\n :rtype: int\n '
(level, q, lookup) = (0, [(0, 0, False)], set())
while q:
next_q = []
for (r, c, is_vertical) in q:
if ((r, c, is_vertical) in lookup):
continue
if ((r... | :type grid: List[List[int]]
:rtype: int | Python/minimum-moves-to-reach-target-with-rotations.py | minimumMoves | donaldcao/LeetCode-Solutions | 3,269 | python | def minimumMoves(self, grid):
'\n :type grid: List[List[int]]\n :rtype: int\n '
(level, q, lookup) = (0, [(0, 0, False)], set())
while q:
next_q = []
for (r, c, is_vertical) in q:
if ((r, c, is_vertical) in lookup):
continue
if ((r... | def minimumMoves(self, grid):
'\n :type grid: List[List[int]]\n :rtype: int\n '
(level, q, lookup) = (0, [(0, 0, False)], set())
while q:
next_q = []
for (r, c, is_vertical) in q:
if ((r, c, is_vertical) in lookup):
continue
if ((r... |
317bbef5b8fbb21c50fae6159e24d1cd5919b0a661b86f4e0ba46e011686dfcb | def bayesopt(key: Any, model: gp.GP, sub_dataset_key: Union[(int, str)], query_oracle: Callable[([Any], Any)], ac_func: Callable[(..., jnp.array)], iters: int, input_sampler: Callable[(..., jnp.array)]) -> SubDataset:
'Running simulated bayesopt on a set of pre-evaluated inputs x_queries.\n\n Args:\n key: Jax r... | Running simulated bayesopt on a set of pre-evaluated inputs x_queries.
Args:
key: Jax random state.
model: gp.GP.
sub_dataset_key: key of the sub_dataset for testing in dataset.
query_oracle: evaluation function.
ac_func: acquisition function handle (see acfun.py).
iters: number of iterations in BayesOpt s... | hyperbo/bo_utils/bayesopt.py | bayesopt | google-research/hyperbo | 3 | python | def bayesopt(key: Any, model: gp.GP, sub_dataset_key: Union[(int, str)], query_oracle: Callable[([Any], Any)], ac_func: Callable[(..., jnp.array)], iters: int, input_sampler: Callable[(..., jnp.array)]) -> SubDataset:
'Running simulated bayesopt on a set of pre-evaluated inputs x_queries.\n\n Args:\n key: Jax r... | def bayesopt(key: Any, model: gp.GP, sub_dataset_key: Union[(int, str)], query_oracle: Callable[([Any], Any)], ac_func: Callable[(..., jnp.array)], iters: int, input_sampler: Callable[(..., jnp.array)]) -> SubDataset:
'Running simulated bayesopt on a set of pre-evaluated inputs x_queries.\n\n Args:\n key: Jax r... |
c39b0febf4ab9486fa13f8f9d19800195f7787e61a583b00878de696bd087a4e | def simulated_bayesopt(model: gp.GP, sub_dataset_key: Union[(int, str)], queried_sub_dataset: SubDataset, ac_func: Callable[(..., jnp.array)], iters: int) -> SubDataset:
'Running simulated bayesopt on a set of pre-evaluated inputs x_queries.\n\n Args:\n model: gp.GP.\n sub_dataset_key: key of the sub_dataset... | Running simulated bayesopt on a set of pre-evaluated inputs x_queries.
Args:
model: gp.GP.
sub_dataset_key: key of the sub_dataset for testing in dataset.
queried_sub_dataset: sub_dataset that can be queried.
ac_func: acquisition function handle (see acfun.py).
iters: number of iterations in BayesOpt sequent... | hyperbo/bo_utils/bayesopt.py | simulated_bayesopt | google-research/hyperbo | 3 | python | def simulated_bayesopt(model: gp.GP, sub_dataset_key: Union[(int, str)], queried_sub_dataset: SubDataset, ac_func: Callable[(..., jnp.array)], iters: int) -> SubDataset:
'Running simulated bayesopt on a set of pre-evaluated inputs x_queries.\n\n Args:\n model: gp.GP.\n sub_dataset_key: key of the sub_dataset... | def simulated_bayesopt(model: gp.GP, sub_dataset_key: Union[(int, str)], queried_sub_dataset: SubDataset, ac_func: Callable[(..., jnp.array)], iters: int) -> SubDataset:
'Running simulated bayesopt on a set of pre-evaluated inputs x_queries.\n\n Args:\n model: gp.GP.\n sub_dataset_key: key of the sub_dataset... |
4234338bf259b6006783f32cd699128bee6b9d05b3daa1da52ab1c1fe3f495d7 | def run_synthetic(dataset, sub_dataset_key, queried_sub_dataset, mean_func, cov_func, init_params, ac_func, iters, warp_func=None, init_random_key=None, method='hyperbo', init_model=False, finite_search_space=True, data_loader_name='', params_save_file=None):
'Running bayesopt experiment with synthetic data.\n\n A... | Running bayesopt experiment with synthetic data.
Args:
dataset: a list of vx, vy pairs, i.e. [(vx, vy)_i], where vx is
m_points_historical x d and vy is m_points_historical x 1.
sub_dataset_key: key of the sub_dataset for testing in dataset.
queried_sub_dataset: sub_dataset that can be queried.
mean_func: ... | hyperbo/bo_utils/bayesopt.py | run_synthetic | google-research/hyperbo | 3 | python | def run_synthetic(dataset, sub_dataset_key, queried_sub_dataset, mean_func, cov_func, init_params, ac_func, iters, warp_func=None, init_random_key=None, method='hyperbo', init_model=False, finite_search_space=True, data_loader_name=, params_save_file=None):
'Running bayesopt experiment with synthetic data.\n\n Arg... | def run_synthetic(dataset, sub_dataset_key, queried_sub_dataset, mean_func, cov_func, init_params, ac_func, iters, warp_func=None, init_random_key=None, method='hyperbo', init_model=False, finite_search_space=True, data_loader_name=, params_save_file=None):
'Running bayesopt experiment with synthetic data.\n\n Arg... |
2032e433f5d151da5c7e244c41f916e8134ad3c492f576afe06c76141922fdbb | def _onehot_matrix(shape, idx) -> np.ndarray:
'Each row is a one-hot vector with idx-th element equal to 1.'
zeros = np.zeros(shape)
zeros[(:, idx)] = 1
return zeros | Each row is a one-hot vector with idx-th element equal to 1. | hyperbo/bo_utils/bayesopt.py | _onehot_matrix | google-research/hyperbo | 3 | python | def _onehot_matrix(shape, idx) -> np.ndarray:
zeros = np.zeros(shape)
zeros[(:, idx)] = 1
return zeros | def _onehot_matrix(shape, idx) -> np.ndarray:
zeros = np.zeros(shape)
zeros[(:, idx)] = 1
return zeros<|docstring|>Each row is a one-hot vector with idx-th element equal to 1.<|endoftext|> |
9e446bbfdeb1cc3a5b8e630b18d3c9d5df04b0ec9e68fcb094c5b7a7984b49b1 | def step(self):
'Step by the inner optimizer'
self.optimizer.step() | Step by the inner optimizer | spk_class.py | step | tomato1mule/Contrastive-Predictive-Coding-PyTorch | 339 | python | def step(self):
self.optimizer.step() | def step(self):
self.optimizer.step()<|docstring|>Step by the inner optimizer<|endoftext|> |
409f48052f1f118f2f55a2589246ac191cdecbdd31d11ae00558d8b6d622c269 | def zero_grad(self):
'Zero out the gradients by the inner optimizer'
self.optimizer.zero_grad() | Zero out the gradients by the inner optimizer | spk_class.py | zero_grad | tomato1mule/Contrastive-Predictive-Coding-PyTorch | 339 | python | def zero_grad(self):
self.optimizer.zero_grad() | def zero_grad(self):
self.optimizer.zero_grad()<|docstring|>Zero out the gradients by the inner optimizer<|endoftext|> |
52991d251be0b9295192095978b5008be1f9c16b752e21bec0e4543afebf8e4e | def update_learning_rate(self):
'Learning rate scheduling per step'
self.n_current_steps += self.delta
new_lr = (np.power(self.d_model, (- 0.5)) * np.min([np.power(self.n_current_steps, (- 0.5)), (np.power(self.n_warmup_steps, (- 1.5)) * self.n_current_steps)]))
for param_group in self.optimizer.param_g... | Learning rate scheduling per step | spk_class.py | update_learning_rate | tomato1mule/Contrastive-Predictive-Coding-PyTorch | 339 | python | def update_learning_rate(self):
self.n_current_steps += self.delta
new_lr = (np.power(self.d_model, (- 0.5)) * np.min([np.power(self.n_current_steps, (- 0.5)), (np.power(self.n_warmup_steps, (- 1.5)) * self.n_current_steps)]))
for param_group in self.optimizer.param_groups:
param_group['lr'] = ... | def update_learning_rate(self):
self.n_current_steps += self.delta
new_lr = (np.power(self.d_model, (- 0.5)) * np.min([np.power(self.n_current_steps, (- 0.5)), (np.power(self.n_warmup_steps, (- 1.5)) * self.n_current_steps)]))
for param_group in self.optimizer.param_groups:
param_group['lr'] = ... |
430eba8976177af3bfa92dff04bf6c0b9c81b984b3f3c019699dbe052d757916 | def save_section(self):
'Save the current custom section to a file.'
if (len(self.section.middle_line_points) > 1):
initial_pose = Pose(self.section.middle_line.interpolate_pose(0))
tf = Transform(initial_pose.position, initial_pose.orientation).inverse
self.section.middle_line_points = ... | Save the current custom section to a file. | simulation/src/simulation_groundtruth/src/scan/node.py | save_section | KITcar-Team/kitcar-gazebo-simulation | 13 | python | def save_section(self):
if (len(self.section.middle_line_points) > 1):
initial_pose = Pose(self.section.middle_line.interpolate_pose(0))
tf = Transform(initial_pose.position, initial_pose.orientation).inverse
self.section.middle_line_points = [(tf * p) for p in self.section.middle_line_... | def save_section(self):
if (len(self.section.middle_line_points) > 1):
initial_pose = Pose(self.section.middle_line.interpolate_pose(0))
tf = Transform(initial_pose.position, initial_pose.orientation).inverse
self.section.middle_line_points = [(tf * p) for p in self.section.middle_line_... |
429b4ba8361d525d209fda6fd854ac9042807737c8b99754a809a3f1652ae0be | def get_current_pose(self):
'Try to get the current pose from /tf.'
try:
tf_transform = self.listener.lookup_transform('odom', 'vehicle', rospy.Time.now(), timeout=rospy.Duration(0.01))
return Pose(tf_transform.transform)
except Exception as e:
rospy.logerr(f'Could not lookup transfo... | Try to get the current pose from /tf. | simulation/src/simulation_groundtruth/src/scan/node.py | get_current_pose | KITcar-Team/kitcar-gazebo-simulation | 13 | python | def get_current_pose(self):
try:
tf_transform = self.listener.lookup_transform('odom', 'vehicle', rospy.Time.now(), timeout=rospy.Duration(0.01))
return Pose(tf_transform.transform)
except Exception as e:
rospy.logerr(f'Could not lookup transform {e}')
return | def get_current_pose(self):
try:
tf_transform = self.listener.lookup_transform('odom', 'vehicle', rospy.Time.now(), timeout=rospy.Duration(0.01))
return Pose(tf_transform.transform)
except Exception as e:
rospy.logerr(f'Could not lookup transform {e}')
return<|docstring|>Try... |
5a34c3c5238bfd949955715744e90404e0f6543edce9a015c9565abc7326fb4b | def update_middle_line(self):
'Update the middle line using the current position.'
current_pose = self.get_current_pose()
if (current_pose is None):
return
middle_line_position = (current_pose.position + Vector(0, 0.2).rotated(current_pose.orientation).rotated((math.pi / 2)))
if ((len(self.s... | Update the middle line using the current position. | simulation/src/simulation_groundtruth/src/scan/node.py | update_middle_line | KITcar-Team/kitcar-gazebo-simulation | 13 | python | def update_middle_line(self):
current_pose = self.get_current_pose()
if (current_pose is None):
return
middle_line_position = (current_pose.position + Vector(0, 0.2).rotated(current_pose.orientation).rotated((math.pi / 2)))
if ((len(self.section.middle_line_points) == 0) or (middle_line_pos... | def update_middle_line(self):
current_pose = self.get_current_pose()
if (current_pose is None):
return
middle_line_position = (current_pose.position + Vector(0, 0.2).rotated(current_pose.orientation).rotated((math.pi / 2)))
if ((len(self.section.middle_line_points) == 0) or (middle_line_pos... |
038235c451155f082ada35e2575eda1a60fb5876fa9cad40511a01577414996c | def test_classification(classification_overview):
'Test aroma.utils.classification and ensure classifications come out the same.'
clf_overview_df = pd.read_table(classification_overview)
test_df = clf_overview_df[['edge_fract', 'csf_fract', 'max_RP_corr', 'HFC']]
(test_df, metadata) = utils.classificati... | Test aroma.utils.classification and ensure classifications come out the same. | aroma/tests/test_utils.py | test_classification | CesarCaballeroGaudes/aroma | 5 | python | def test_classification(classification_overview):
clf_overview_df = pd.read_table(classification_overview)
test_df = clf_overview_df[['edge_fract', 'csf_fract', 'max_RP_corr', 'HFC']]
(test_df, metadata) = utils.classification(test_df, {})
true_classifications = clf_overview_df['classification'].to... | def test_classification(classification_overview):
clf_overview_df = pd.read_table(classification_overview)
test_df = clf_overview_df[['edge_fract', 'csf_fract', 'max_RP_corr', 'HFC']]
(test_df, metadata) = utils.classification(test_df, {})
true_classifications = clf_overview_df['classification'].to... |
496b2ad97aa249b79f1ec8d2aabcbf22b77dd7651a938456004ffd730f66aaa0 | def test_load_motpars_manual(motion_parameters):
'Test aroma.utils.load_motpars with manual source determination.'
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
afni = utils.load_motpars(motion_parameters['AfNI'], source='afni')
spm = utils.load_motpars(motion_parameters['SPM'], sourc... | Test aroma.utils.load_motpars with manual source determination. | aroma/tests/test_utils.py | test_load_motpars_manual | CesarCaballeroGaudes/aroma | 5 | python | def test_load_motpars_manual(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
afni = utils.load_motpars(motion_parameters['AfNI'], source='afni')
spm = utils.load_motpars(motion_parameters['SPM'], source='spm')
fmriprep = utils.load_motpars(motion_parameters['fMR... | def test_load_motpars_manual(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
afni = utils.load_motpars(motion_parameters['AfNI'], source='afni')
spm = utils.load_motpars(motion_parameters['SPM'], source='spm')
fmriprep = utils.load_motpars(motion_parameters['fMR... |
3125093c0714e16da3a6b75638b93643c59ee7da7e784d19c100e9842032d6ad | def test_load_motpars_auto(motion_parameters):
'Test aroma.utils.load_motpars with automatic source determination.'
fsl = utils.load_motpars(motion_parameters['FSL'], source='auto')
afni = utils.load_motpars(motion_parameters['AfNI'], source='auto')
spm = utils.load_motpars(motion_parameters['SPM'], sou... | Test aroma.utils.load_motpars with automatic source determination. | aroma/tests/test_utils.py | test_load_motpars_auto | CesarCaballeroGaudes/aroma | 5 | python | def test_load_motpars_auto(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='auto')
afni = utils.load_motpars(motion_parameters['AfNI'], source='auto')
spm = utils.load_motpars(motion_parameters['SPM'], source='auto')
fmriprep = utils.load_motpars(motion_parameters['fMR... | def test_load_motpars_auto(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='auto')
afni = utils.load_motpars(motion_parameters['AfNI'], source='auto')
spm = utils.load_motpars(motion_parameters['SPM'], source='auto')
fmriprep = utils.load_motpars(motion_parameters['fMR... |
8a8f94d639fa2635ac8e09b2730895487d2dfefba5ad28fa9c2d33c9823a457d | def test_load_motpars_break(motion_parameters):
'Break aroma.utils.load_motpars.'
with pytest.raises(Exception):
utils.load_motpars('dog.dog', source='auto')
with pytest.raises(ValueError):
utils.load_motpars(motion_parameters['FSL'], source='dog') | Break aroma.utils.load_motpars. | aroma/tests/test_utils.py | test_load_motpars_break | CesarCaballeroGaudes/aroma | 5 | python | def test_load_motpars_break(motion_parameters):
with pytest.raises(Exception):
utils.load_motpars('dog.dog', source='auto')
with pytest.raises(ValueError):
utils.load_motpars(motion_parameters['FSL'], source='dog') | def test_load_motpars_break(motion_parameters):
with pytest.raises(Exception):
utils.load_motpars('dog.dog', source='auto')
with pytest.raises(ValueError):
utils.load_motpars(motion_parameters['FSL'], source='dog')<|docstring|>Break aroma.utils.load_motpars.<|endoftext|> |
5c88ffaafcfc67cca4eceb5987a10b8bc8753b2d859c1c36c100cd23824a2112 | def test_motpars_fmriprep2fsl(motion_parameters):
'Test aroma.utils.motpars_fmriprep2fsl.'
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
fmriprep = utils.motpars_fmriprep2fsl(motion_parameters['fMRIPrep'])
assert np.allclose(fsl, fmriprep)
with pytest.raises(ValueError):
u... | Test aroma.utils.motpars_fmriprep2fsl. | aroma/tests/test_utils.py | test_motpars_fmriprep2fsl | CesarCaballeroGaudes/aroma | 5 | python | def test_motpars_fmriprep2fsl(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
fmriprep = utils.motpars_fmriprep2fsl(motion_parameters['fMRIPrep'])
assert np.allclose(fsl, fmriprep)
with pytest.raises(ValueError):
utils.motpars_fmriprep2fsl(5)
bad_dat... | def test_motpars_fmriprep2fsl(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
fmriprep = utils.motpars_fmriprep2fsl(motion_parameters['fMRIPrep'])
assert np.allclose(fsl, fmriprep)
with pytest.raises(ValueError):
utils.motpars_fmriprep2fsl(5)
bad_dat... |
48a08f5bf6c4e6bed23c1343f3a75d62f8c5d74a48e2446cbdf41266cff4f2f8 | def test_motpars_spm2fsl(motion_parameters):
'Test aroma.utils.motpars_spm2fsl.'
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
spm = utils.motpars_spm2fsl(motion_parameters['SPM'])
assert np.allclose(fsl, spm)
with pytest.raises(ValueError):
utils.motpars_spm2fsl(5)
ba... | Test aroma.utils.motpars_spm2fsl. | aroma/tests/test_utils.py | test_motpars_spm2fsl | CesarCaballeroGaudes/aroma | 5 | python | def test_motpars_spm2fsl(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
spm = utils.motpars_spm2fsl(motion_parameters['SPM'])
assert np.allclose(fsl, spm)
with pytest.raises(ValueError):
utils.motpars_spm2fsl(5)
bad_data = np.random.random((200, 7))... | def test_motpars_spm2fsl(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
spm = utils.motpars_spm2fsl(motion_parameters['SPM'])
assert np.allclose(fsl, spm)
with pytest.raises(ValueError):
utils.motpars_spm2fsl(5)
bad_data = np.random.random((200, 7))... |
46470f9d13d42d0a3f8ece1548223fc9c988c5389fb11961796c47553a94edd7 | def test_motpars_afni2fsl(motion_parameters):
'Test aroma.utils.motpars_afni2fsl.'
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
afni = utils.motpars_afni2fsl(motion_parameters['AfNI'])
assert np.allclose(fsl, afni)
with pytest.raises(ValueError):
utils.motpars_afni2fsl(5)... | Test aroma.utils.motpars_afni2fsl. | aroma/tests/test_utils.py | test_motpars_afni2fsl | CesarCaballeroGaudes/aroma | 5 | python | def test_motpars_afni2fsl(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
afni = utils.motpars_afni2fsl(motion_parameters['AfNI'])
assert np.allclose(fsl, afni)
with pytest.raises(ValueError):
utils.motpars_afni2fsl(5)
bad_data = np.random.random((20... | def test_motpars_afni2fsl(motion_parameters):
fsl = utils.load_motpars(motion_parameters['FSL'], source='fsl')
afni = utils.motpars_afni2fsl(motion_parameters['AfNI'])
assert np.allclose(fsl, afni)
with pytest.raises(ValueError):
utils.motpars_afni2fsl(5)
bad_data = np.random.random((20... |
c7dafaa66f1e8a22fc714a0278b8c2b981b8f0e34886a9536d528d2ec4190887 | def test_cross_correlation():
'Test aroma.utils.cross_correlation.'
np.random.seed(5)
a = np.random.rand(4, 4)
b = np.random.rand(2, 4)
true_cross_corr = np.array([[(- 0.28624708), (- 0.62178458)], [0.37905408, (- 0.51091252)], [0.24162976, (- 0.13454275)], [0.69255319, 0.07156853]])
cross_corr ... | Test aroma.utils.cross_correlation. | aroma/tests/test_utils.py | test_cross_correlation | CesarCaballeroGaudes/aroma | 5 | python | def test_cross_correlation():
np.random.seed(5)
a = np.random.rand(4, 4)
b = np.random.rand(2, 4)
true_cross_corr = np.array([[(- 0.28624708), (- 0.62178458)], [0.37905408, (- 0.51091252)], [0.24162976, (- 0.13454275)], [0.69255319, 0.07156853]])
cross_corr = utils.cross_correlation(a.T, b.T)
... | def test_cross_correlation():
np.random.seed(5)
a = np.random.rand(4, 4)
b = np.random.rand(2, 4)
true_cross_corr = np.array([[(- 0.28624708), (- 0.62178458)], [0.37905408, (- 0.51091252)], [0.24162976, (- 0.13454275)], [0.69255319, 0.07156853]])
cross_corr = utils.cross_correlation(a.T, b.T)
... |
9ce87cddca23db4a17457542a8982369e4840323b450b28fb2584a08991e78ba | def get_search_space_updates():
'\n Search space updates to the task can be added using HyperparameterSearchSpaceUpdates\n Returns:\n HyperparameterSearchSpaceUpdates\n '
updates = HyperparameterSearchSpaceUpdates()
updates.append(node_name='data_loader', hyperparameter='batch_size', value_r... | Search space updates to the task can be added using HyperparameterSearchSpaceUpdates
Returns:
HyperparameterSearchSpaceUpdates | examples/40_advanced/example_custom_configuration_space.py | get_search_space_updates | maxpark/Auto-PyTorch | 1 | python | def get_search_space_updates():
'\n Search space updates to the task can be added using HyperparameterSearchSpaceUpdates\n Returns:\n HyperparameterSearchSpaceUpdates\n '
updates = HyperparameterSearchSpaceUpdates()
updates.append(node_name='data_loader', hyperparameter='batch_size', value_r... | def get_search_space_updates():
'\n Search space updates to the task can be added using HyperparameterSearchSpaceUpdates\n Returns:\n HyperparameterSearchSpaceUpdates\n '
updates = HyperparameterSearchSpaceUpdates()
updates.append(node_name='data_loader', hyperparameter='batch_size', value_r... |
d647fc34502a087a6ee62ac0055e963e107ddd7d4604245755568bc3ceca94f7 | def isNan(tensor):
'get a tensor and return True if it includes Nan'
return (tensor != tensor).any() | get a tensor and return True if it includes Nan | misc.py | isNan | minkyu-choi04/misc | 0 | python | def isNan(tensor):
return (tensor != tensor).any() | def isNan(tensor):
return (tensor != tensor).any()<|docstring|>get a tensor and return True if it includes Nan<|endoftext|> |
c3765d94ee19b5a72c6f4740062bac44ee5bf9e70196e0ee15d2e416e2ff2218 | def load_salicon(batch_size, server_type):
"In order to use this function, you need to move all the images in the ./test/ into ./test/1/. \n This is because the pytorch's imageFolder and Dataloader works in this way. \n "
if (server_type == 'libigpu1'):
path_dataset = os.path.expanduser('~/dataset... | In order to use this function, you need to move all the images in the ./test/ into ./test/1/.
This is because the pytorch's imageFolder and Dataloader works in this way. | misc.py | load_salicon | minkyu-choi04/misc | 0 | python | def load_salicon(batch_size, server_type):
"In order to use this function, you need to move all the images in the ./test/ into ./test/1/. \n This is because the pytorch's imageFolder and Dataloader works in this way. \n "
if (server_type == 'libigpu1'):
path_dataset = os.path.expanduser('~/dataset... | def load_salicon(batch_size, server_type):
"In order to use this function, you need to move all the images in the ./test/ into ./test/1/. \n This is because the pytorch's imageFolder and Dataloader works in this way. \n "
if (server_type == 'libigpu1'):
path_dataset = os.path.expanduser('~/dataset... |
5d6a62fe8f8219b1f09c194eb701cb72c1a0335fc67e4152f9ea39fd3589f576 | def load_MIE(batch_size, server_type, data_type):
"\n When I downloaded the corresponding dataset from https://www-percept.irisa.fr/asperger_to_kanner/, \n I unzip the file and changed file names from one digit to two digits by hand. >> 1.png --> 01.png \n And I also put a ./0 dir inside the MIE_Fo and MIE... | When I downloaded the corresponding dataset from https://www-percept.irisa.fr/asperger_to_kanner/,
I unzip the file and changed file names from one digit to two digits by hand. >> 1.png --> 01.png
And I also put a ./0 dir inside the MIE_Fo and MIE_No and moved all images into it.
data_type: 'fo' or 'no' | misc.py | load_MIE | minkyu-choi04/misc | 0 | python | def load_MIE(batch_size, server_type, data_type):
"\n When I downloaded the corresponding dataset from https://www-percept.irisa.fr/asperger_to_kanner/, \n I unzip the file and changed file names from one digit to two digits by hand. >> 1.png --> 01.png \n And I also put a ./0 dir inside the MIE_Fo and MIE... | def load_MIE(batch_size, server_type, data_type):
"\n When I downloaded the corresponding dataset from https://www-percept.irisa.fr/asperger_to_kanner/, \n I unzip the file and changed file names from one digit to two digits by hand. >> 1.png --> 01.png \n And I also put a ./0 dir inside the MIE_Fo and MIE... |
68f2e817ed439e831c45eb66bf4fec8420ce1bcbead9b7bd29ee5a13ecb42307 | def plot_samples_from_images(images, batch_size, plot_path, filename, isRange01=False):
' Plot images\n Changed 2020.11.23\n isRange01 is added to normalize image in different way. \n\n Args: \n images: (b, c, h, w), tensor in any range. (c=3 or 1)\n batch_size: int\n plot_path: st... | Plot images
Changed 2020.11.23
isRange01 is added to normalize image in different way.
Args:
images: (b, c, h, w), tensor in any range. (c=3 or 1)
batch_size: int
plot_path: string
filename: string
isRange01: True/False, Normalization will be different. | misc.py | plot_samples_from_images | minkyu-choi04/misc | 0 | python | def plot_samples_from_images(images, batch_size, plot_path, filename, isRange01=False):
' Plot images\n Changed 2020.11.23\n isRange01 is added to normalize image in different way. \n\n Args: \n images: (b, c, h, w), tensor in any range. (c=3 or 1)\n batch_size: int\n plot_path: st... | def plot_samples_from_images(images, batch_size, plot_path, filename, isRange01=False):
' Plot images\n Changed 2020.11.23\n isRange01 is added to normalize image in different way. \n\n Args: \n images: (b, c, h, w), tensor in any range. (c=3 or 1)\n batch_size: int\n plot_path: st... |
9ac58a8c4ae439d17a2757c8892bef929aedaf58ff23f1ab2a5e08670d55f6f2 | def accuracy(output, target, topk=(1,)):
'Computes the accuracy over the k top predictions for the specified values of k'
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
(_, pred) = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(targ... | Computes the accuracy over the k top predictions for the specified values of k | misc.py | accuracy | minkyu-choi04/misc | 0 | python | def accuracy(output, target, topk=(1,)):
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
(_, pred) = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, (- 1)).expand_as(pred))
res = []
for k in topk:
... | def accuracy(output, target, topk=(1,)):
with torch.no_grad():
maxk = max(topk)
batch_size = target.size(0)
(_, pred) = output.topk(maxk, 1, True, True)
pred = pred.t()
correct = pred.eq(target.view(1, (- 1)).expand_as(pred))
res = []
for k in topk:
... |
b665702a8c9cd79e77b2707affe1374371cdbe6e5249e67ef8dc145e77f1d71c | def get_PE_cart(batch_s, pe_s):
'\n\tGenerates cartesian Positional Encoding. \n\tArgs: \n\t\tbatch_s: int, batch size. \n\t\tpe_s: (int h, int w), size of Positional encoding feature \n\tReturn:\n\t\tpe: (batch_s, 2, pe_s[0], pe_s[1])\n\t'
lin_x = torch.unsqueeze(torch.linspace((- 1.0), 1.0, steps=pe_s[1], dev... | Generates cartesian Positional Encoding.
Args:
batch_s: int, batch size.
pe_s: (int h, int w), size of Positional encoding feature
Return:
pe: (batch_s, 2, pe_s[0], pe_s[1]) | misc.py | get_PE_cart | minkyu-choi04/misc | 0 | python | def get_PE_cart(batch_s, pe_s):
'\n\tGenerates cartesian Positional Encoding. \n\tArgs: \n\t\tbatch_s: int, batch size. \n\t\tpe_s: (int h, int w), size of Positional encoding feature \n\tReturn:\n\t\tpe: (batch_s, 2, pe_s[0], pe_s[1])\n\t'
lin_x = torch.unsqueeze(torch.linspace((- 1.0), 1.0, steps=pe_s[1], dev... | def get_PE_cart(batch_s, pe_s):
'\n\tGenerates cartesian Positional Encoding. \n\tArgs: \n\t\tbatch_s: int, batch size. \n\t\tpe_s: (int h, int w), size of Positional encoding feature \n\tReturn:\n\t\tpe: (batch_s, 2, pe_s[0], pe_s[1])\n\t'
lin_x = torch.unsqueeze(torch.linspace((- 1.0), 1.0, steps=pe_s[1], dev... |
ffca44e7b3f9b1917a0ace38f05bc86925c1d7bb585fd2e62bd10880fa508d2c | def get_coord_feature(batch_s, input_s, pe_s, polar_grid=None):
"\n 20201124\n Changed to have an option to return Cart PE. \n\n code from (base) min@libigpu1:~/research_mk/attention_model_biliniear_localGlobal_6_reinforce/detach_recurrency_group/rl_base_recon_corHM_absHM_corrREINFORCE_corInitRNN_detachTD_... | 20201124
Changed to have an option to return Cart PE.
code from (base) min@libigpu1:~/research_mk/attention_model_biliniear_localGlobal_6_reinforce/detach_recurrency_group/rl_base_recon_corHM_absHM_corrREINFORCE_corInitRNN_detachTD_hlr_lowResD_detachVD_removeBottleNeckV2I_conventionalResInc_contVer110
Generate Posit... | misc.py | get_coord_feature | minkyu-choi04/misc | 0 | python | def get_coord_feature(batch_s, input_s, pe_s, polar_grid=None):
"\n 20201124\n Changed to have an option to return Cart PE. \n\n code from (base) min@libigpu1:~/research_mk/attention_model_biliniear_localGlobal_6_reinforce/detach_recurrency_group/rl_base_recon_corHM_absHM_corrREINFORCE_corInitRNN_detachTD_... | def get_coord_feature(batch_s, input_s, pe_s, polar_grid=None):
"\n 20201124\n Changed to have an option to return Cart PE. \n\n code from (base) min@libigpu1:~/research_mk/attention_model_biliniear_localGlobal_6_reinforce/detach_recurrency_group/rl_base_recon_corHM_absHM_corrREINFORCE_corInitRNN_detachTD_... |
08078417495c24f6c1e4d224f244ae2d0a5efa09f5f80350159e1313753039f9 | def noralize_min_max(fms):
' Normalize input fms range from 0 to 1. \n Args: \n fms: (b, c, h, w)\n return: \n fms_norm: (b, c, h, w)\n '
fms_s = fms.size()
if (len(fms_s) == 3):
fms = fms.unsqueeze(1)
fms_s = fms.size()
min_val = torch.min(fms.view(fms_s[0], (- 1)... | Normalize input fms range from 0 to 1.
Args:
fms: (b, c, h, w)
return:
fms_norm: (b, c, h, w) | misc.py | noralize_min_max | minkyu-choi04/misc | 0 | python | def noralize_min_max(fms):
' Normalize input fms range from 0 to 1. \n Args: \n fms: (b, c, h, w)\n return: \n fms_norm: (b, c, h, w)\n '
fms_s = fms.size()
if (len(fms_s) == 3):
fms = fms.unsqueeze(1)
fms_s = fms.size()
min_val = torch.min(fms.view(fms_s[0], (- 1)... | def noralize_min_max(fms):
' Normalize input fms range from 0 to 1. \n Args: \n fms: (b, c, h, w)\n return: \n fms_norm: (b, c, h, w)\n '
fms_s = fms.size()
if (len(fms_s) == 3):
fms = fms.unsqueeze(1)
fms_s = fms.size()
min_val = torch.min(fms.view(fms_s[0], (- 1)... |
a78f056cc08fde3716adc43c5ff33cd4d797f5001171e1af777804b625e2304a | def mark_point(imgs, fixs, ds=7, isRed=True):
'\n Mark a point in the given image. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n '
img_s = imgs.size()
fixs = ((fixs + 1) / 2.0)
fix... | Mark a point in the given image.
Args:
imgs: (b, 3, h, w), tensor, any range
fixs: (b, 2), (float x, float y), tensor, -1~1
return:
img_marked: (b, 3, h, w) | misc.py | mark_point | minkyu-choi04/misc | 0 | python | def mark_point(imgs, fixs, ds=7, isRed=True):
'\n Mark a point in the given image. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n '
img_s = imgs.size()
fixs = ((fixs + 1) / 2.0)
fix... | def mark_point(imgs, fixs, ds=7, isRed=True):
'\n Mark a point in the given image. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n '
img_s = imgs.size()
fixs = ((fixs + 1) / 2.0)
fix... |
00398ff8b1397d10257676f4978d44d451d00f3b21c86d8b26e58e853f6bbf09 | def mark_fixations(imgs, fixs, ds=7, isRed=True):
'\n Mark fixation points in the given images. This function is used to mark a fixation. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n '
im... | Mark fixation points in the given images. This function is used to mark a fixation.
Args:
imgs: (b, 3, h, w), tensor, any range
fixs: (b, 2), (float x, float y), tensor, -1~1
return:
img_marked: (b, 3, h, w) | misc.py | mark_fixations | minkyu-choi04/misc | 0 | python | def mark_fixations(imgs, fixs, ds=7, isRed=True):
'\n Mark fixation points in the given images. This function is used to mark a fixation. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n '
im... | def mark_fixations(imgs, fixs, ds=7, isRed=True):
'\n Mark fixation points in the given images. This function is used to mark a fixation. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n '
im... |
ee65e70a24d6f05a1033c1b7419b1afc990d4b2eb0ee4f42ad0446a21849c07b | def mark_fixations_history(imgs, fixs_h, ds=7):
'\n Mark fixation history in the given images. This function is used to mark fixation history. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, step, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n ... | Mark fixation history in the given images. This function is used to mark fixation history.
Args:
imgs: (b, 3, h, w), tensor, any range
fixs: (b, step, 2), (float x, float y), tensor, -1~1
return:
img_marked: (b, 3, h, w) | misc.py | mark_fixations_history | minkyu-choi04/misc | 0 | python | def mark_fixations_history(imgs, fixs_h, ds=7):
'\n Mark fixation history in the given images. This function is used to mark fixation history. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, step, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n ... | def mark_fixations_history(imgs, fixs_h, ds=7):
'\n Mark fixation history in the given images. This function is used to mark fixation history. \n Args:\n imgs: (b, 3, h, w), tensor, any range\n fixs: (b, step, 2), (float x, float y), tensor, -1~1\n return:\n img_marked: (b, 3, h, w)\n ... |
7f5d04c9534a87649fdc70f25ad11621e18cf53126fdeef9eb067bb6614b2ea3 | def save_caption(captions, ref, epoch, step, vocab, isTrain=True):
' \n Convert predicted captions in idx to words\n ref: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/image_captioning/sample.py\n Args:\n captions: (batch, max_seq_length), list of list, in word idx, pr... | Convert predicted captions in idx to words
ref: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/image_captioning/sample.py
Args:
captions: (batch, max_seq_length), list of list, in word idx, predicted caption
ref: (batch, max_seq_length), list of list, in word idx, reference caption... | misc.py | save_caption | minkyu-choi04/misc | 0 | python | def save_caption(captions, ref, epoch, step, vocab, isTrain=True):
' \n Convert predicted captions in idx to words\n ref: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/image_captioning/sample.py\n Args:\n captions: (batch, max_seq_length), list of list, in word idx, pr... | def save_caption(captions, ref, epoch, step, vocab, isTrain=True):
' \n Convert predicted captions in idx to words\n ref: https://github.com/yunjey/pytorch-tutorial/blob/master/tutorials/03-advanced/image_captioning/sample.py\n Args:\n captions: (batch, max_seq_length), list of list, in word idx, pr... |
cb2accee9534e5f40d6ce4cfb78741b7236a20ce411a9cb51e83da0ae97fba11 | def convert_idx2word(caption, vocab):
'\n convert given sentence in idx to words.\n Args:\n caption: (length, ), numpy\n vocab: vocab\n return:\n words: string\n '
sentence = []
for word_id in caption:
word = vocab.idx2word[word_id]
sentence.append(word)
... | convert given sentence in idx to words.
Args:
caption: (length, ), numpy
vocab: vocab
return:
words: string | misc.py | convert_idx2word | minkyu-choi04/misc | 0 | python | def convert_idx2word(caption, vocab):
'\n convert given sentence in idx to words.\n Args:\n caption: (length, ), numpy\n vocab: vocab\n return:\n words: string\n '
sentence = []
for word_id in caption:
word = vocab.idx2word[word_id]
sentence.append(word)
... | def convert_idx2word(caption, vocab):
'\n convert given sentence in idx to words.\n Args:\n caption: (length, ), numpy\n vocab: vocab\n return:\n words: string\n '
sentence = []
for word_id in caption:
word = vocab.idx2word[word_id]
sentence.append(word)
... |
705fe6699937904041ffe7ceb271c8c7da31b290d31560ad3cdbfb03dd2c9cd2 | def remove_pads_sentence(caption, vocab):
'remove pads in a given sentence\n Args: \n captions: (max_seq_length), list, including word idx\n return:\n caption_clear: (seq_length_without_pad), list\n '
caption_clear = [w for w in caption if (w not in [0, 1, 2, 3])]
"for i, word_id in e... | remove pads in a given sentence
Args:
captions: (max_seq_length), list, including word idx
return:
caption_clear: (seq_length_without_pad), list | misc.py | remove_pads_sentence | minkyu-choi04/misc | 0 | python | def remove_pads_sentence(caption, vocab):
'remove pads in a given sentence\n Args: \n captions: (max_seq_length), list, including word idx\n return:\n caption_clear: (seq_length_without_pad), list\n '
caption_clear = [w for w in caption if (w not in [0, 1, 2, 3])]
"for i, word_id in e... | def remove_pads_sentence(caption, vocab):
'remove pads in a given sentence\n Args: \n captions: (max_seq_length), list, including word idx\n return:\n caption_clear: (seq_length_without_pad), list\n '
caption_clear = [w for w in caption if (w not in [0, 1, 2, 3])]
"for i, word_id in e... |
fe35e2ae05f54bf41a03214f2ff116f4d1cbcc3ed0fb75f79bd00329816a8ca9 | def remove_pads_batch(captions, vocab, isTarget=False):
'remove pads in a given sentence batch\n Args: \n captions: (batch, max_seq_length), numpy, including word idx\n return:\n captions_clear: (batch, varying seq_length_without_pad), list of list\n '
bs = len(captions)
captions_clea... | remove pads in a given sentence batch
Args:
captions: (batch, max_seq_length), numpy, including word idx
return:
captions_clear: (batch, varying seq_length_without_pad), list of list | misc.py | remove_pads_batch | minkyu-choi04/misc | 0 | python | def remove_pads_batch(captions, vocab, isTarget=False):
'remove pads in a given sentence batch\n Args: \n captions: (batch, max_seq_length), numpy, including word idx\n return:\n captions_clear: (batch, varying seq_length_without_pad), list of list\n '
bs = len(captions)
captions_clea... | def remove_pads_batch(captions, vocab, isTarget=False):
'remove pads in a given sentence batch\n Args: \n captions: (batch, max_seq_length), numpy, including word idx\n return:\n captions_clear: (batch, varying seq_length_without_pad), list of list\n '
bs = len(captions)
captions_clea... |
d4bb107939b62de295d2c764c83202cfd09d9d18cd964de5c273bd0cd7ea627c | def make_sequential_mask(lengths, device='cuda'):
' make sequential mask\n see http://juditacs.github.io/2018/12/27/masked-attention.html\n Args:\n lengths: (batch, ), including length of sequence\n return \n mask: (batch, max_seq_length)\n '
maxlen = np.max(lengths)
lengths = torc... | make sequential mask
see http://juditacs.github.io/2018/12/27/masked-attention.html
Args:
lengths: (batch, ), including length of sequence
return
mask: (batch, max_seq_length) | misc.py | make_sequential_mask | minkyu-choi04/misc | 0 | python | def make_sequential_mask(lengths, device='cuda'):
' make sequential mask\n see http://juditacs.github.io/2018/12/27/masked-attention.html\n Args:\n lengths: (batch, ), including length of sequence\n return \n mask: (batch, max_seq_length)\n '
maxlen = np.max(lengths)
lengths = torc... | def make_sequential_mask(lengths, device='cuda'):
' make sequential mask\n see http://juditacs.github.io/2018/12/27/masked-attention.html\n Args:\n lengths: (batch, ), including length of sequence\n return \n mask: (batch, max_seq_length)\n '
maxlen = np.max(lengths)
lengths = torc... |
c335680ea6c1e642aaefa0aab87f7938606266698f842a224e327c62dff04448 | def add_heatmap_on_image(heatmap, image):
'Visualize heatmap on image. This function is not based on batch.\n Args:\n heatmap: (h, w), 0~1 ranged numpy array\n image: (3, h, w), 0~1 ranged numpy array\n heatmap and image must be in the same size. \n return:\n hm_img: (h, w, 3), 0~2... | Visualize heatmap on image. This function is not based on batch.
Args:
heatmap: (h, w), 0~1 ranged numpy array
image: (3, h, w), 0~1 ranged numpy array
heatmap and image must be in the same size.
return:
hm_img: (h, w, 3), 0~255 ranged numy array | misc.py | add_heatmap_on_image | minkyu-choi04/misc | 0 | python | def add_heatmap_on_image(heatmap, image):
'Visualize heatmap on image. This function is not based on batch.\n Args:\n heatmap: (h, w), 0~1 ranged numpy array\n image: (3, h, w), 0~1 ranged numpy array\n heatmap and image must be in the same size. \n return:\n hm_img: (h, w, 3), 0~2... | def add_heatmap_on_image(heatmap, image):
'Visualize heatmap on image. This function is not based on batch.\n Args:\n heatmap: (h, w), 0~1 ranged numpy array\n image: (3, h, w), 0~1 ranged numpy array\n heatmap and image must be in the same size. \n return:\n hm_img: (h, w, 3), 0~2... |
c89cc5c9a654ede2908dc4a9c51930f1f0256135b65a1894817277af451ed852 | def add_heatmap_on_image_tensor(heatmap, image, resize_s=(112, 112), isNormHM=True, device='cpu'):
'Visualize heatmap on image. This function works based on batched tensors\n Args:\n heatmap: (b, h, w), any ranged tensor\n image: (b, 3, h, w), any ranged tensor\n resize_s: (int, int), heatma... | Visualize heatmap on image. This function works based on batched tensors
Args:
heatmap: (b, h, w), any ranged tensor
image: (b, 3, h, w), any ranged tensor
resize_s: (int, int), heatmap and image will be resized to this size
isNormHM: True/False, if True, heatmap will be normalized to 0~1
return:
hm... | misc.py | add_heatmap_on_image_tensor | minkyu-choi04/misc | 0 | python | def add_heatmap_on_image_tensor(heatmap, image, resize_s=(112, 112), isNormHM=True, device='cpu'):
'Visualize heatmap on image. This function works based on batched tensors\n Args:\n heatmap: (b, h, w), any ranged tensor\n image: (b, 3, h, w), any ranged tensor\n resize_s: (int, int), heatma... | def add_heatmap_on_image_tensor(heatmap, image, resize_s=(112, 112), isNormHM=True, device='cpu'):
'Visualize heatmap on image. This function works based on batched tensors\n Args:\n heatmap: (b, h, w), any ranged tensor\n image: (b, 3, h, w), any ranged tensor\n resize_s: (int, int), heatma... |
7d764a18fbb0fd5fd970ccefa1dcd19e169255adff08852033ac395cce4e497c | def check_gradients(model):
"20201124\n return model's gradient stats\n https://discuss.pytorch.org/t/get-the-gradient-of-the-network-parameters/50575\n "
max_max = 0
max_mean = 0
max_val = 0
for p in model.parameters():
mx = torch.max(torch.abs(p.grad))
if (max_max < mx):
... | 20201124
return model's gradient stats
https://discuss.pytorch.org/t/get-the-gradient-of-the-network-parameters/50575 | misc.py | check_gradients | minkyu-choi04/misc | 0 | python | def check_gradients(model):
"20201124\n return model's gradient stats\n https://discuss.pytorch.org/t/get-the-gradient-of-the-network-parameters/50575\n "
max_max = 0
max_mean = 0
max_val = 0
for p in model.parameters():
mx = torch.max(torch.abs(p.grad))
if (max_max < mx):
... | def check_gradients(model):
"20201124\n return model's gradient stats\n https://discuss.pytorch.org/t/get-the-gradient-of-the-network-parameters/50575\n "
max_max = 0
max_mean = 0
max_val = 0
for p in model.parameters():
mx = torch.max(torch.abs(p.grad))
if (max_max < mx):
... |
e4a8b20ca7fb2835656742d21053c41d1ee030d5b56a06ce4f926dceca70ead5 | @router.get('/all', response_model=List[schemas.Survey])
def read_all_surveys(db: Session=Depends(deps.get_db), skip: int=0, limit: int=100, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n Retrieve surveys.\n '
surveys = crud.survey.get_multi(db, skip=skip, limit=limit)
re... | Retrieve surveys. | Sistema/sisprel/backend/app/app/api/api_v1/endpoints/survey.py | read_all_surveys | JosueHernandezR/TTR | 0 | python | @router.get('/all', response_model=List[schemas.Survey])
def read_all_surveys(db: Session=Depends(deps.get_db), skip: int=0, limit: int=100, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
surveys = crud.survey.get_multi(db, skip=skip, limit=limit)
return surveys | @router.get('/all', response_model=List[schemas.Survey])
def read_all_surveys(db: Session=Depends(deps.get_db), skip: int=0, limit: int=100, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
surveys = crud.survey.get_multi(db, skip=skip, limit=limit)
return surveys<|doc... |
33a7f71b4aa88fe8801a18af3ae7f3c52efa610bf5af00eb2c50a5e33ff378bb | @router.put('/{id}', response_model=schemas.Survey)
def update_survey(*, db: Session=Depends(deps.get_db), id: int, survey_in: schemas.SurveyUpdate, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n Update an survey.\n '
weight_total = (len(crud.question.get_questions_by_survey(... | Update an survey. | Sistema/sisprel/backend/app/app/api/api_v1/endpoints/survey.py | update_survey | JosueHernandezR/TTR | 0 | python | @router.put('/{id}', response_model=schemas.Survey)
def update_survey(*, db: Session=Depends(deps.get_db), id: int, survey_in: schemas.SurveyUpdate, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
weight_total = (len(crud.question.get_questions_by_survey(db=db, survey_id=... | @router.put('/{id}', response_model=schemas.Survey)
def update_survey(*, db: Session=Depends(deps.get_db), id: int, survey_in: schemas.SurveyUpdate, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
weight_total = (len(crud.question.get_questions_by_survey(db=db, survey_id=... |
0a01a3b065de434e3285488e377092dafa64d255f34f783f059ae91ab2483b83 | @router.get('/{id}', response_model=schemas.Survey)
def read_survey(*, db: Session=Depends(deps.get_db), id: int, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n Get survey by ID.\n '
survey = crud.survey.get(db=db, id=id)
if (not survey):
raise HTTPException(statu... | Get survey by ID. | Sistema/sisprel/backend/app/app/api/api_v1/endpoints/survey.py | read_survey | JosueHernandezR/TTR | 0 | python | @router.get('/{id}', response_model=schemas.Survey)
def read_survey(*, db: Session=Depends(deps.get_db), id: int, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
survey = crud.survey.get(db=db, id=id)
if (not survey):
raise HTTPException(status_code=404, detai... | @router.get('/{id}', response_model=schemas.Survey)
def read_survey(*, db: Session=Depends(deps.get_db), id: int, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
survey = crud.survey.get(db=db, id=id)
if (not survey):
raise HTTPException(status_code=404, detai... |
002359a9c66d110d08f3453bfd5f6ee1c8df14c9ad956aa6ba4a712f670a0929 | @router.delete('/{id}', response_model=schemas.Survey)
def delete_survey(*, db: Session=Depends(deps.get_db), id: int, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n Delete an survey.\n '
survey = crud.survey.get(db=db, id=id)
if (not survey):
raise HTTPException(... | Delete an survey. | Sistema/sisprel/backend/app/app/api/api_v1/endpoints/survey.py | delete_survey | JosueHernandezR/TTR | 0 | python | @router.delete('/{id}', response_model=schemas.Survey)
def delete_survey(*, db: Session=Depends(deps.get_db), id: int, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
survey = crud.survey.get(db=db, id=id)
if (not survey):
raise HTTPException(status_code=404, ... | @router.delete('/{id}', response_model=schemas.Survey)
def delete_survey(*, db: Session=Depends(deps.get_db), id: int, current_user: models.User=Depends(deps.get_current_active_user)) -> Any:
'\n \n '
survey = crud.survey.get(db=db, id=id)
if (not survey):
raise HTTPException(status_code=404, ... |
8ea2952bf4788e3e7953e26a7c32e45c9e34dcf5db32ae1ed41a3efd80938ccd | @cached(cache)
def _sentence_embedding(sentences: tuple) -> np.ndarray:
'use sentences as a tuple is to be consistent with tf.hub'
sen_embedding = [_single_sentence(st) for st in sentences]
sen_embedding = np.array(sen_embedding)
return sen_embedding | use sentences as a tuple is to be consistent with tf.hub | gensim2/sentence_sim_w2v/sen_sim_spacy_punc.py | _sentence_embedding | arfu2016/DuReader | 0 | python | @cached(cache)
def _sentence_embedding(sentences: tuple) -> np.ndarray:
sen_embedding = [_single_sentence(st) for st in sentences]
sen_embedding = np.array(sen_embedding)
return sen_embedding | @cached(cache)
def _sentence_embedding(sentences: tuple) -> np.ndarray:
sen_embedding = [_single_sentence(st) for st in sentences]
sen_embedding = np.array(sen_embedding)
return sen_embedding<|docstring|>use sentences as a tuple is to be consistent with tf.hub<|endoftext|> |
8ee21bcba4bf41d345c2fd7ca62167dd70d65ebb4db70a3af37addd6893023f0 | def _vector_similarity(encode1: list, encode2: list) -> float:
'assume the length of encode1 and encode2 are n, time complexity is\n O(n), space complexity is O(n)\n '
sim_score = sum([(x * y) for (x, y) in zip(encode1, encode2)])
return sim_score | assume the length of encode1 and encode2 are n, time complexity is
O(n), space complexity is O(n) | gensim2/sentence_sim_w2v/sen_sim_spacy_punc.py | _vector_similarity | arfu2016/DuReader | 0 | python | def _vector_similarity(encode1: list, encode2: list) -> float:
'assume the length of encode1 and encode2 are n, time complexity is\n O(n), space complexity is O(n)\n '
sim_score = sum([(x * y) for (x, y) in zip(encode1, encode2)])
return sim_score | def _vector_similarity(encode1: list, encode2: list) -> float:
'assume the length of encode1 and encode2 are n, time complexity is\n O(n), space complexity is O(n)\n '
sim_score = sum([(x * y) for (x, y) in zip(encode1, encode2)])
return sim_score<|docstring|>assume the length of encode1 and encode2 a... |
615194b5a7e53cb968922d2e72f8a01bf6e30905fbabef8c736407f13ce9e436 | def _similarity_scores(training_vectors: np.ndarray, test_vector: list) -> list:
'Assume for training vectors, the number of vectors is m, and the\n length of each vector is n, then time complexity is O(mn) for single\n thread. But in numpy, this could be optimized. For multiprocessing, time\n is also redu... | Assume for training vectors, the number of vectors is m, and the
length of each vector is n, then time complexity is O(mn) for single
thread. But in numpy, this could be optimized. For multiprocessing, time
is also reduced. | gensim2/sentence_sim_w2v/sen_sim_spacy_punc.py | _similarity_scores | arfu2016/DuReader | 0 | python | def _similarity_scores(training_vectors: np.ndarray, test_vector: list) -> list:
'Assume for training vectors, the number of vectors is m, and the\n length of each vector is n, then time complexity is O(mn) for single\n thread. But in numpy, this could be optimized. For multiprocessing, time\n is also redu... | def _similarity_scores(training_vectors: np.ndarray, test_vector: list) -> list:
'Assume for training vectors, the number of vectors is m, and the\n length of each vector is n, then time complexity is O(mn) for single\n thread. But in numpy, this could be optimized. For multiprocessing, time\n is also redu... |
0595fbc1fb05fc928dc232ef3382debe8a6eb04e7bc0f9307fc68e7dbe789674 | def union(au, bu, area_intersection):
'\n\t并的区域就好求的多了:两个区域的总面积减去交面积就可以了\n\t'
area_a = ((au[2] - au[0]) * (au[3] - au[1]))
area_b = ((bu[2] - bu[0]) * (bu[3] - bu[1]))
area_union = ((area_a + area_b) - area_intersection)
return area_union | 并的区域就好求的多了:两个区域的总面积减去交面积就可以了 | keras_frcnn/data_generators.py | union | zouzhen/simple-faster-rcnn | 0 | python | def union(au, bu, area_intersection):
'\n\t\n\t'
area_a = ((au[2] - au[0]) * (au[3] - au[1]))
area_b = ((bu[2] - bu[0]) * (bu[3] - bu[1]))
area_union = ((area_a + area_b) - area_intersection)
return area_union | def union(au, bu, area_intersection):
'\n\t\n\t'
area_a = ((au[2] - au[0]) * (au[3] - au[1]))
area_b = ((bu[2] - bu[0]) * (bu[3] - bu[1]))
area_union = ((area_a + area_b) - area_intersection)
return area_union<|docstring|>并的区域就好求的多了:两个区域的总面积减去交面积就可以了<|endoftext|> |
8e559d2d8e7e6db96ed815409efbf1c73191388f943f4c3a3d727636dfba8469 | def intersection(ai, bi):
'\n\t得到交区域的左上和右下角坐标。如果右下坐标大于左上坐标则求交面积\n\t'
x = max(ai[0], bi[0])
y = max(ai[1], bi[1])
w = (min(ai[2], bi[2]) - x)
h = (min(ai[3], bi[3]) - y)
if ((w < 0) or (h < 0)):
return 0
return (w * h) | 得到交区域的左上和右下角坐标。如果右下坐标大于左上坐标则求交面积 | keras_frcnn/data_generators.py | intersection | zouzhen/simple-faster-rcnn | 0 | python | def intersection(ai, bi):
'\n\t\n\t'
x = max(ai[0], bi[0])
y = max(ai[1], bi[1])
w = (min(ai[2], bi[2]) - x)
h = (min(ai[3], bi[3]) - y)
if ((w < 0) or (h < 0)):
return 0
return (w * h) | def intersection(ai, bi):
'\n\t\n\t'
x = max(ai[0], bi[0])
y = max(ai[1], bi[1])
w = (min(ai[2], bi[2]) - x)
h = (min(ai[3], bi[3]) - y)
if ((w < 0) or (h < 0)):
return 0
return (w * h)<|docstring|>得到交区域的左上和右下角坐标。如果右下坐标大于左上坐标则求交面积<|endoftext|> |
5506c7e746d6102408847e7c2d530d258e5c83c21bca6936d73d3bb280126172 | def iou(a, b):
'\n\tif语句是要求右下角的点大于左上角的点,属于逻辑检查\n\tintersection:计算两个面积的交\n\tunion:计算两个面积的并\n\t最后返回交并并比【分母加上1e-6,是为了防止分母为0】\n\t'
if ((a[0] >= a[2]) or (a[1] >= a[3]) or (b[0] >= b[2]) or (b[1] >= b[3])):
return 0.0
area_i = intersection(a, b)
area_u = union(a, b, area_i)
return (float(area_i) ... | if语句是要求右下角的点大于左上角的点,属于逻辑检查
intersection:计算两个面积的交
union:计算两个面积的并
最后返回交并并比【分母加上1e-6,是为了防止分母为0】 | keras_frcnn/data_generators.py | iou | zouzhen/simple-faster-rcnn | 0 | python | def iou(a, b):
'\n\tif语句是要求右下角的点大于左上角的点,属于逻辑检查\n\tintersection:计算两个面积的交\n\tunion:计算两个面积的并\n\t最后返回交并并比【分母加上1e-6,是为了防止分母为0】\n\t'
if ((a[0] >= a[2]) or (a[1] >= a[3]) or (b[0] >= b[2]) or (b[1] >= b[3])):
return 0.0
area_i = intersection(a, b)
area_u = union(a, b, area_i)
return (float(area_i) ... | def iou(a, b):
'\n\tif语句是要求右下角的点大于左上角的点,属于逻辑检查\n\tintersection:计算两个面积的交\n\tunion:计算两个面积的并\n\t最后返回交并并比【分母加上1e-6,是为了防止分母为0】\n\t'
if ((a[0] >= a[2]) or (a[1] >= a[3]) or (b[0] >= b[2]) or (b[1] >= b[3])):
return 0.0
area_i = intersection(a, b)
area_u = union(a, b, area_i)
return (float(area_i) ... |
1e54cfc7180dd94bd4db99a79c4c49e9c86d1374ffc8727209cbeefd9286248e | def get_new_img_size(width, height, img_min_side=600):
'\n\t得到最短边,另一个边按比列缩放。\n\t'
if (width <= height):
f = (float(img_min_side) / width)
resized_height = int((f * height))
resized_width = img_min_side
else:
f = (float(img_min_side) / height)
resized_width = int((f * ... | 得到最短边,另一个边按比列缩放。 | keras_frcnn/data_generators.py | get_new_img_size | zouzhen/simple-faster-rcnn | 0 | python | def get_new_img_size(width, height, img_min_side=600):
'\n\t\n\t'
if (width <= height):
f = (float(img_min_side) / width)
resized_height = int((f * height))
resized_width = img_min_side
else:
f = (float(img_min_side) / height)
resized_width = int((f * width))
... | def get_new_img_size(width, height, img_min_side=600):
'\n\t\n\t'
if (width <= height):
f = (float(img_min_side) / width)
resized_height = int((f * height))
resized_width = img_min_side
else:
f = (float(img_min_side) / height)
resized_width = int((f * width))
... |
00b9f6e7cd1ed0ab5d3eed6f8861b93bc474a8862c1b34260018dcd7a61af8a1 | def calc_rpn(C, img_data, width, height, resized_width, resized_height, img_length_calc_function):
'\n\t函数输入:\n\t训练信息类(包含一张图片的路径,bbox的坐标和对应的分类)\n\t图片信息\n\t图片宽度\n\t图片高度(重新计算bboxes要用)\n\t规整化后图片宽度\n\t规整化后图片高度\n\t计算特征图大小函数\n\n\t函数输出:\n\t是否包含类\n\t相应的回归梯度\n\t'
downscale = float(C.rpn_stride)
anchor_sizes = C.anch... | 函数输入:
训练信息类(包含一张图片的路径,bbox的坐标和对应的分类)
图片信息
图片宽度
图片高度(重新计算bboxes要用)
规整化后图片宽度
规整化后图片高度
计算特征图大小函数
函数输出:
是否包含类
相应的回归梯度 | keras_frcnn/data_generators.py | calc_rpn | zouzhen/simple-faster-rcnn | 0 | python | def calc_rpn(C, img_data, width, height, resized_width, resized_height, img_length_calc_function):
'\n\t函数输入:\n\t训练信息类(包含一张图片的路径,bbox的坐标和对应的分类)\n\t图片信息\n\t图片宽度\n\t图片高度(重新计算bboxes要用)\n\t规整化后图片宽度\n\t规整化后图片高度\n\t计算特征图大小函数\n\n\t函数输出:\n\t是否包含类\n\t相应的回归梯度\n\t'
downscale = float(C.rpn_stride)
anchor_sizes = C.anch... | def calc_rpn(C, img_data, width, height, resized_width, resized_height, img_length_calc_function):
'\n\t函数输入:\n\t训练信息类(包含一张图片的路径,bbox的坐标和对应的分类)\n\t图片信息\n\t图片宽度\n\t图片高度(重新计算bboxes要用)\n\t规整化后图片宽度\n\t规整化后图片高度\n\t计算特征图大小函数\n\n\t函数输出:\n\t是否包含类\n\t相应的回归梯度\n\t'
downscale = float(C.rpn_stride)
anchor_sizes = C.anch... |
464c2d6b3ca5144f2266657521c6582119ae3c1e08bd726b0ec0248e7e674f1e | def threadsafe_generator(f):
'A decorator that takes a generator function and makes it thread-safe.\n\t'
def g(*a, **kw):
return threadsafe_iter(f(*a, **kw))
return g | A decorator that takes a generator function and makes it thread-safe. | keras_frcnn/data_generators.py | threadsafe_generator | zouzhen/simple-faster-rcnn | 0 | python | def threadsafe_generator(f):
'\n\t'
def g(*a, **kw):
return threadsafe_iter(f(*a, **kw))
return g | def threadsafe_generator(f):
'\n\t'
def g(*a, **kw):
return threadsafe_iter(f(*a, **kw))
return g<|docstring|>A decorator that takes a generator function and makes it thread-safe.<|endoftext|> |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.