body
stringlengths 26
98.2k
| body_hash
int64 -9,222,864,604,528,158,000
9,221,803,474B
| docstring
stringlengths 1
16.8k
| path
stringlengths 5
230
| name
stringlengths 1
96
| repository_name
stringlengths 7
89
| lang
stringclasses 1
value | body_without_docstring
stringlengths 20
98.2k
|
---|---|---|---|---|---|---|---|
@api_view(['GET'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated])
def get_active_user(request):
'\n Endpoint for getting the active user\n through the authtoken\n '
return Response(UserSerializer(request.user, context={'is_public_view': False}).data, status=status.HTTP_200_OK) | -7,766,746,519,056,333,000 | Endpoint for getting the active user
through the authtoken | server/ahj_app/views_users.py | get_active_user | SunSpecOrangeButton/ahj-registry | python | @api_view(['GET'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated])
def get_active_user(request):
'\n Endpoint for getting the active user\n through the authtoken\n '
return Response(UserSerializer(request.user, context={'is_public_view': False}).data, status=status.HTTP_200_OK) |
@api_view(['GET'])
def get_single_user(request, username):
'\n Function view for getting a single user with the specified Username = username\n '
context = {'is_public_view': True}
if ((request.auth is not None) and (request.user.Username == username)):
context['is_public_view'] = False
try:
user = User.objects.get(Username=username)
return Response(UserSerializer(user, context=context).data, status=status.HTTP_200_OK)
except Exception as e:
return Response(str(e), status=status.HTTP_400_BAD_REQUEST) | -1,989,491,119,875,037,400 | Function view for getting a single user with the specified Username = username | server/ahj_app/views_users.py | get_single_user | SunSpecOrangeButton/ahj-registry | python | @api_view(['GET'])
def get_single_user(request, username):
'\n \n '
context = {'is_public_view': True}
if ((request.auth is not None) and (request.user.Username == username)):
context['is_public_view'] = False
try:
user = User.objects.get(Username=username)
return Response(UserSerializer(user, context=context).data, status=status.HTTP_200_OK)
except Exception as e:
return Response(str(e), status=status.HTTP_400_BAD_REQUEST) |
@api_view(['POST'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated])
def user_update(request):
'\n Update the user profile associated with the requesting user.\n '
changeable_user_fields = {'Username', 'PersonalBio', 'URL', 'CompanyAffiliation'}
changeable_contact_fields = {'FirstName', 'LastName', 'URL', 'WorkPhone', 'PreferredContactMethod', 'Title'}
user_data = filter_dict_keys(request.data, changeable_user_fields)
contact_data = filter_dict_keys(request.data, changeable_contact_fields)
for field in ENUM_FIELDS.intersection(contact_data.keys()):
contact_data[field] = get_enum_value_row(field, contact_data[field])
user = request.user
User.objects.filter(UserID=user.UserID).update(**user_data)
Contact.objects.filter(ContactID=user.ContactID.ContactID).update(**contact_data)
return Response('Success', status=status.HTTP_200_OK) | 3,068,872,904,561,566,000 | Update the user profile associated with the requesting user. | server/ahj_app/views_users.py | user_update | SunSpecOrangeButton/ahj-registry | python | @api_view(['POST'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated])
def user_update(request):
'\n \n '
changeable_user_fields = {'Username', 'PersonalBio', 'URL', 'CompanyAffiliation'}
changeable_contact_fields = {'FirstName', 'LastName', 'URL', 'WorkPhone', 'PreferredContactMethod', 'Title'}
user_data = filter_dict_keys(request.data, changeable_user_fields)
contact_data = filter_dict_keys(request.data, changeable_contact_fields)
for field in ENUM_FIELDS.intersection(contact_data.keys()):
contact_data[field] = get_enum_value_row(field, contact_data[field])
user = request.user
User.objects.filter(UserID=user.UserID).update(**user_data)
Contact.objects.filter(ContactID=user.ContactID.ContactID).update(**contact_data)
return Response('Success', status=status.HTTP_200_OK) |
@api_view(['POST'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated, IsSuperuser])
def set_ahj_maintainer(request):
'\n View to assign a user as a data maintainer of an AHJ\n Expects a Username and a the primary key of an AHJ (AHJPK)\n '
try:
username = request.data['Username']
ahjpk = request.data['AHJPK']
user = User.objects.get(Username=username)
ahj = AHJ.objects.get(AHJPK=ahjpk)
maintainer_record = AHJUserMaintains.objects.filter(AHJPK=ahj, UserID=user)
if maintainer_record.exists():
maintainer_record.update(MaintainerStatus=True)
else:
AHJUserMaintains.objects.create(UserID=user, AHJPK=ahj, MaintainerStatus=True)
return Response(UserSerializer(user).data, status=status.HTTP_200_OK)
except Exception as e:
return Response(str(e), status=status.HTTP_400_BAD_REQUEST) | -1,984,510,763,303,905,800 | View to assign a user as a data maintainer of an AHJ
Expects a Username and a the primary key of an AHJ (AHJPK) | server/ahj_app/views_users.py | set_ahj_maintainer | SunSpecOrangeButton/ahj-registry | python | @api_view(['POST'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated, IsSuperuser])
def set_ahj_maintainer(request):
'\n View to assign a user as a data maintainer of an AHJ\n Expects a Username and a the primary key of an AHJ (AHJPK)\n '
try:
username = request.data['Username']
ahjpk = request.data['AHJPK']
user = User.objects.get(Username=username)
ahj = AHJ.objects.get(AHJPK=ahjpk)
maintainer_record = AHJUserMaintains.objects.filter(AHJPK=ahj, UserID=user)
if maintainer_record.exists():
maintainer_record.update(MaintainerStatus=True)
else:
AHJUserMaintains.objects.create(UserID=user, AHJPK=ahj, MaintainerStatus=True)
return Response(UserSerializer(user).data, status=status.HTTP_200_OK)
except Exception as e:
return Response(str(e), status=status.HTTP_400_BAD_REQUEST) |
@api_view(['POST'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated, IsSuperuser])
def remove_ahj_maintainer(request):
"\n View to revoke a user as a data maintainer of an AHJ\n Expects a user's webpage token and a the primary key of an AHJ (AHJPK)\n "
try:
username = request.data['Username']
ahjpk = request.data['AHJPK']
user = User.objects.get(Username=username)
ahj = AHJ.objects.get(AHJPK=ahjpk)
AHJUserMaintains.objects.filter(AHJPK=ahj, UserID=user).update(MaintainerStatus=False)
return Response(UserSerializer(user).data, status=status.HTTP_200_OK)
except Exception as e:
return Response(str(e), status=status.HTTP_400_BAD_REQUEST) | 2,412,252,387,613,865,500 | View to revoke a user as a data maintainer of an AHJ
Expects a user's webpage token and a the primary key of an AHJ (AHJPK) | server/ahj_app/views_users.py | remove_ahj_maintainer | SunSpecOrangeButton/ahj-registry | python | @api_view(['POST'])
@authentication_classes([WebpageTokenAuth])
@permission_classes([IsAuthenticated, IsSuperuser])
def remove_ahj_maintainer(request):
"\n View to revoke a user as a data maintainer of an AHJ\n Expects a user's webpage token and a the primary key of an AHJ (AHJPK)\n "
try:
username = request.data['Username']
ahjpk = request.data['AHJPK']
user = User.objects.get(Username=username)
ahj = AHJ.objects.get(AHJPK=ahjpk)
AHJUserMaintains.objects.filter(AHJPK=ahj, UserID=user).update(MaintainerStatus=False)
return Response(UserSerializer(user).data, status=status.HTTP_200_OK)
except Exception as e:
return Response(str(e), status=status.HTTP_400_BAD_REQUEST) |
def get_share(device_name: Optional[str]=None, name: Optional[str]=None, resource_group_name: Optional[str]=None, opts: Optional[pulumi.InvokeOptions]=None) -> AwaitableGetShareResult:
'\n Represents a share on the Data Box Edge/Gateway device.\n\n\n :param str device_name: The device name.\n :param str name: The share name.\n :param str resource_group_name: The resource group name.\n '
__args__ = dict()
__args__['deviceName'] = device_name
__args__['name'] = name
__args__['resourceGroupName'] = resource_group_name
if (opts is None):
opts = pulumi.InvokeOptions()
if (opts.version is None):
opts.version = _utilities.get_version()
__ret__ = pulumi.runtime.invoke('azure-native:databoxedge/v20201201:getShare', __args__, opts=opts, typ=GetShareResult).value
return AwaitableGetShareResult(access_protocol=__ret__.access_protocol, azure_container_info=__ret__.azure_container_info, client_access_rights=__ret__.client_access_rights, data_policy=__ret__.data_policy, description=__ret__.description, id=__ret__.id, monitoring_status=__ret__.monitoring_status, name=__ret__.name, refresh_details=__ret__.refresh_details, share_mappings=__ret__.share_mappings, share_status=__ret__.share_status, system_data=__ret__.system_data, type=__ret__.type, user_access_rights=__ret__.user_access_rights) | 6,460,495,586,124,756,000 | Represents a share on the Data Box Edge/Gateway device.
:param str device_name: The device name.
:param str name: The share name.
:param str resource_group_name: The resource group name. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | get_share | polivbr/pulumi-azure-native | python | def get_share(device_name: Optional[str]=None, name: Optional[str]=None, resource_group_name: Optional[str]=None, opts: Optional[pulumi.InvokeOptions]=None) -> AwaitableGetShareResult:
'\n Represents a share on the Data Box Edge/Gateway device.\n\n\n :param str device_name: The device name.\n :param str name: The share name.\n :param str resource_group_name: The resource group name.\n '
__args__ = dict()
__args__['deviceName'] = device_name
__args__['name'] = name
__args__['resourceGroupName'] = resource_group_name
if (opts is None):
opts = pulumi.InvokeOptions()
if (opts.version is None):
opts.version = _utilities.get_version()
__ret__ = pulumi.runtime.invoke('azure-native:databoxedge/v20201201:getShare', __args__, opts=opts, typ=GetShareResult).value
return AwaitableGetShareResult(access_protocol=__ret__.access_protocol, azure_container_info=__ret__.azure_container_info, client_access_rights=__ret__.client_access_rights, data_policy=__ret__.data_policy, description=__ret__.description, id=__ret__.id, monitoring_status=__ret__.monitoring_status, name=__ret__.name, refresh_details=__ret__.refresh_details, share_mappings=__ret__.share_mappings, share_status=__ret__.share_status, system_data=__ret__.system_data, type=__ret__.type, user_access_rights=__ret__.user_access_rights) |
@property
@pulumi.getter(name='accessProtocol')
def access_protocol(self) -> str:
'\n Access protocol to be used by the share.\n '
return pulumi.get(self, 'access_protocol') | 2,964,460,217,738,999,000 | Access protocol to be used by the share. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | access_protocol | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='accessProtocol')
def access_protocol(self) -> str:
'\n \n '
return pulumi.get(self, 'access_protocol') |
@property
@pulumi.getter(name='azureContainerInfo')
def azure_container_info(self) -> Optional['outputs.AzureContainerInfoResponse']:
'\n Azure container mapping for the share.\n '
return pulumi.get(self, 'azure_container_info') | -5,994,602,275,513,422,000 | Azure container mapping for the share. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | azure_container_info | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='azureContainerInfo')
def azure_container_info(self) -> Optional['outputs.AzureContainerInfoResponse']:
'\n \n '
return pulumi.get(self, 'azure_container_info') |
@property
@pulumi.getter(name='clientAccessRights')
def client_access_rights(self) -> Optional[Sequence['outputs.ClientAccessRightResponse']]:
'\n List of IP addresses and corresponding access rights on the share(required for NFS protocol).\n '
return pulumi.get(self, 'client_access_rights') | 1,452,515,564,736,675,600 | List of IP addresses and corresponding access rights on the share(required for NFS protocol). | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | client_access_rights | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='clientAccessRights')
def client_access_rights(self) -> Optional[Sequence['outputs.ClientAccessRightResponse']]:
'\n \n '
return pulumi.get(self, 'client_access_rights') |
@property
@pulumi.getter(name='dataPolicy')
def data_policy(self) -> Optional[str]:
'\n Data policy of the share.\n '
return pulumi.get(self, 'data_policy') | -8,355,152,545,751,391,000 | Data policy of the share. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | data_policy | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='dataPolicy')
def data_policy(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'data_policy') |
@property
@pulumi.getter
def description(self) -> Optional[str]:
'\n Description for the share.\n '
return pulumi.get(self, 'description') | -5,914,884,994,194,841,000 | Description for the share. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | description | polivbr/pulumi-azure-native | python | @property
@pulumi.getter
def description(self) -> Optional[str]:
'\n \n '
return pulumi.get(self, 'description') |
@property
@pulumi.getter
def id(self) -> str:
'\n The path ID that uniquely identifies the object.\n '
return pulumi.get(self, 'id') | -6,771,754,533,231,907,000 | The path ID that uniquely identifies the object. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | id | polivbr/pulumi-azure-native | python | @property
@pulumi.getter
def id(self) -> str:
'\n \n '
return pulumi.get(self, 'id') |
@property
@pulumi.getter(name='monitoringStatus')
def monitoring_status(self) -> str:
'\n Current monitoring status of the share.\n '
return pulumi.get(self, 'monitoring_status') | 710,137,425,693,497,500 | Current monitoring status of the share. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | monitoring_status | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='monitoringStatus')
def monitoring_status(self) -> str:
'\n \n '
return pulumi.get(self, 'monitoring_status') |
@property
@pulumi.getter
def name(self) -> str:
'\n The object name.\n '
return pulumi.get(self, 'name') | -7,796,363,731,564,207,000 | The object name. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | name | polivbr/pulumi-azure-native | python | @property
@pulumi.getter
def name(self) -> str:
'\n \n '
return pulumi.get(self, 'name') |
@property
@pulumi.getter(name='refreshDetails')
def refresh_details(self) -> Optional['outputs.RefreshDetailsResponse']:
'\n Details of the refresh job on this share.\n '
return pulumi.get(self, 'refresh_details') | -6,870,771,254,184,336,000 | Details of the refresh job on this share. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | refresh_details | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='refreshDetails')
def refresh_details(self) -> Optional['outputs.RefreshDetailsResponse']:
'\n \n '
return pulumi.get(self, 'refresh_details') |
@property
@pulumi.getter(name='shareMappings')
def share_mappings(self) -> Sequence['outputs.MountPointMapResponse']:
'\n Share mount point to the role.\n '
return pulumi.get(self, 'share_mappings') | 8,111,864,302,100,247,000 | Share mount point to the role. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | share_mappings | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='shareMappings')
def share_mappings(self) -> Sequence['outputs.MountPointMapResponse']:
'\n \n '
return pulumi.get(self, 'share_mappings') |
@property
@pulumi.getter(name='shareStatus')
def share_status(self) -> str:
'\n Current status of the share.\n '
return pulumi.get(self, 'share_status') | 3,913,237,950,887,486,500 | Current status of the share. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | share_status | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='shareStatus')
def share_status(self) -> str:
'\n \n '
return pulumi.get(self, 'share_status') |
@property
@pulumi.getter(name='systemData')
def system_data(self) -> 'outputs.SystemDataResponse':
'\n Share on ASE device\n '
return pulumi.get(self, 'system_data') | 8,427,296,142,996,478,000 | Share on ASE device | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | system_data | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='systemData')
def system_data(self) -> 'outputs.SystemDataResponse':
'\n \n '
return pulumi.get(self, 'system_data') |
@property
@pulumi.getter
def type(self) -> str:
'\n The hierarchical type of the object.\n '
return pulumi.get(self, 'type') | 4,356,878,507,110,328,300 | The hierarchical type of the object. | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | type | polivbr/pulumi-azure-native | python | @property
@pulumi.getter
def type(self) -> str:
'\n \n '
return pulumi.get(self, 'type') |
@property
@pulumi.getter(name='userAccessRights')
def user_access_rights(self) -> Optional[Sequence['outputs.UserAccessRightResponse']]:
'\n Mapping of users and corresponding access rights on the share (required for SMB protocol).\n '
return pulumi.get(self, 'user_access_rights') | -2,172,776,223,717,982,500 | Mapping of users and corresponding access rights on the share (required for SMB protocol). | sdk/python/pulumi_azure_native/databoxedge/v20201201/get_share.py | user_access_rights | polivbr/pulumi-azure-native | python | @property
@pulumi.getter(name='userAccessRights')
def user_access_rights(self) -> Optional[Sequence['outputs.UserAccessRightResponse']]:
'\n \n '
return pulumi.get(self, 'user_access_rights') |
def run_read_bin_and_llc_conversion_test(llc_grid_dir, llc_lons_fname='XC.data', llc_hfacc_fname='hFacC.data', llc=90, llc_grid_filetype='>f', make_plots=False):
"\n\n Runs test on the read_bin_llc and llc_conversion routines\n\n\n Parameters\n ----------\n llc_grid_dir : string\n A string with the directory of the binary file to open\n\n llc_lons_fname : string\n A string with the name of the XC grid file [XC.data]\n\n llc_hfacc_fname : string\n A string with the name of the hfacC grid file [hFacC.data]\n\n llc : int\n the size of the llc grid. For ECCO v4, we use the llc90 domain \n so `llc` would be `90`. \n Default: 90\n\n llc_grid_filetype: string\n the file type, default is big endian (>) 32 bit float (f)\n alternatively, ('<d') would be little endian (<) 64 bit float (d)\n Deafult: '>f'\n \n make_plots : boolean\n A boolean specifiying whether or not to make plots\n Deafult: False\n\n Returns\n -------\n 1 : all tests passed\n 0 : at least one test failed\n \n "
TEST_RESULT = 1
tmpXC_c = read_llc_to_compact(llc_grid_dir, llc_lons_fname, llc=llc, filetype=llc_grid_filetype)
tmpXC_f = read_llc_to_faces(llc_grid_dir, llc_lons_fname, llc=llc, filetype=llc_grid_filetype)
tmpXC_t = read_llc_to_tiles(llc_grid_dir, llc_lons_fname, llc=llc, filetype=llc_grid_filetype)
if make_plots:
for f in range(1, 6):
plt.figure()
plt.imshow(tmpXC_f[f])
plt.colorbar()
plot_tiles(tmpXC_t)
plt.draw()
raw_input('Press Enter to continue...')
tmpXC_cf = llc_compact_to_faces(tmpXC_c)
tmpXC_ct = llc_compact_to_tiles(tmpXC_c)
for f in range(1, 6):
tmp = np.unique((tmpXC_f[f] - tmpXC_cf[f]))
print('unique diffs CF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1b-1')
return TEST_RESULT
tmp = np.unique((tmpXC_ct - tmpXC_t))
print('unique diffs for CT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1b-2')
return TEST_RESULT
tmpXC_ft = llc_faces_to_tiles(tmpXC_f)
tmpXC_fc = llc_faces_to_compact(tmpXC_f)
tmp = np.unique((tmpXC_t - tmpXC_ft))
print('unique diffs for FT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1c-1')
return TEST_RESULT
tmp = np.unique((tmpXC_fc - tmpXC_c))
print('unique diffs FC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1c-2')
return TEST_RESULT
tmpXC_tf = llc_tiles_to_faces(tmpXC_t)
tmpXC_tc = llc_tiles_to_compact(tmpXC_t)
for f in range(1, 6):
tmp = np.unique((tmpXC_f[f] - tmpXC_tf[f]))
print('unique diffs for TF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1d-1')
return TEST_RESULT
tmp = np.unique((tmpXC_tc - tmpXC_c))
print('unique diffs TC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1d-2')
return TEST_RESULT
tmpXC_cftfc = llc_faces_to_compact(llc_tiles_to_faces(llc_faces_to_tiles(llc_compact_to_faces(tmpXC_c))))
tmp = np.unique((tmpXC_cftfc - tmpXC_c))
print('unique diffs CFTFC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1e')
return TEST_RESULT
tmpHF_c = read_llc_to_compact(llc_grid_dir, llc_hfacc_fname, llc=llc, nk=50, filetype=llc_grid_filetype)
tmpHF_f = read_llc_to_faces(llc_grid_dir, llc_hfacc_fname, llc=llc, nk=50, filetype=llc_grid_filetype)
tmpHF_t = read_llc_to_tiles(llc_grid_dir, llc_hfacc_fname, llc=llc, nk=50, filetype=llc_grid_filetype)
tmpHF_c.shape
if make_plots:
plt.imshow(tmpHF_c[0, :])
plt.colorbar()
plot_tiles(tmpHF_t[:, 0, :])
plot_tiles(tmpHF_t[:, 20, :])
plt.draw()
raw_input('Press Enter to continue...')
tmpHF_cf = llc_compact_to_faces(tmpHF_c)
tmpHF_ct = llc_compact_to_tiles(tmpHF_c)
for f in range(1, 6):
tmp = np.unique((tmpHF_f[f] - tmpHF_cf[f]))
print('unique diffs CF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2b-1')
return TEST_RESULT
tmp = np.unique((tmpHF_ct - tmpHF_t))
print('unique diffs CT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2b-2')
return TEST_RESULT
if make_plots:
for k in [0, 20]:
for f in range(1, 6):
plt.figure()
plt.imshow(tmpHF_cf[f][k, :], origin='lower')
plt.colorbar()
plt.draw()
raw_input('Press Enter to continue...')
tmpHF_ft = llc_faces_to_tiles(tmpHF_f)
tmpHF_fc = llc_faces_to_compact(tmpHF_f)
if make_plots:
plot_tiles(tmpHF_ft[:, 0, :])
plot_tiles(tmpHF_ft[:, 20, :])
plt.draw()
raw_input('Press Enter to continue...')
tmp = np.unique((tmpHF_t - tmpHF_ft))
print('unique diffs FT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2c-1')
return TEST_RESULT
tmp = np.unique((tmpHF_fc - tmpHF_c))
print('unique diffs FC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2c-2')
return TEST_RESULT
tmpHF_tf = llc_tiles_to_faces(tmpHF_t)
tmpHF_tc = llc_tiles_to_compact(tmpHF_t)
if make_plots:
for k in [0, 20]:
for f in range(1, 6):
plt.figure()
plt.imshow(tmpHF_tf[f][k, :], origin='lower')
plt.colorbar()
plt.draw()
raw_input('Press Enter to continue...')
for f in range(1, 6):
tmp = np.unique((tmpHF_f[f] - tmpHF_tf[f]))
print('unique diffs TF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2d-1')
return TEST_RESULT
tmp = np.unique((tmpHF_tc - tmpHF_c))
print('unique diffs TC ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2d-1')
return TEST_RESULT
tmpHF_cftfc = llc_faces_to_compact(llc_tiles_to_faces(llc_faces_to_tiles(llc_compact_to_faces(tmpHF_c))))
tmp = np.unique((tmpHF_cftfc - tmpHF_c))
print('unique diffs CFTFC ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2e')
return TEST_RESULT
print('YOU MADE IT THIS FAR, TESTS PASSED!')
return TEST_RESULT | -878,859,158,311,475,200 | Runs test on the read_bin_llc and llc_conversion routines
Parameters
----------
llc_grid_dir : string
A string with the directory of the binary file to open
llc_lons_fname : string
A string with the name of the XC grid file [XC.data]
llc_hfacc_fname : string
A string with the name of the hfacC grid file [hFacC.data]
llc : int
the size of the llc grid. For ECCO v4, we use the llc90 domain
so `llc` would be `90`.
Default: 90
llc_grid_filetype: string
the file type, default is big endian (>) 32 bit float (f)
alternatively, ('<d') would be little endian (<) 64 bit float (d)
Deafult: '>f'
make_plots : boolean
A boolean specifiying whether or not to make plots
Deafult: False
Returns
-------
1 : all tests passed
0 : at least one test failed | ecco_v4_py/test_llc_array_loading_and_conversion.py | run_read_bin_and_llc_conversion_test | cpatrizio88/ECCO_tools | python | def run_read_bin_and_llc_conversion_test(llc_grid_dir, llc_lons_fname='XC.data', llc_hfacc_fname='hFacC.data', llc=90, llc_grid_filetype='>f', make_plots=False):
"\n\n Runs test on the read_bin_llc and llc_conversion routines\n\n\n Parameters\n ----------\n llc_grid_dir : string\n A string with the directory of the binary file to open\n\n llc_lons_fname : string\n A string with the name of the XC grid file [XC.data]\n\n llc_hfacc_fname : string\n A string with the name of the hfacC grid file [hFacC.data]\n\n llc : int\n the size of the llc grid. For ECCO v4, we use the llc90 domain \n so `llc` would be `90`. \n Default: 90\n\n llc_grid_filetype: string\n the file type, default is big endian (>) 32 bit float (f)\n alternatively, ('<d') would be little endian (<) 64 bit float (d)\n Deafult: '>f'\n \n make_plots : boolean\n A boolean specifiying whether or not to make plots\n Deafult: False\n\n Returns\n -------\n 1 : all tests passed\n 0 : at least one test failed\n \n "
TEST_RESULT = 1
tmpXC_c = read_llc_to_compact(llc_grid_dir, llc_lons_fname, llc=llc, filetype=llc_grid_filetype)
tmpXC_f = read_llc_to_faces(llc_grid_dir, llc_lons_fname, llc=llc, filetype=llc_grid_filetype)
tmpXC_t = read_llc_to_tiles(llc_grid_dir, llc_lons_fname, llc=llc, filetype=llc_grid_filetype)
if make_plots:
for f in range(1, 6):
plt.figure()
plt.imshow(tmpXC_f[f])
plt.colorbar()
plot_tiles(tmpXC_t)
plt.draw()
raw_input('Press Enter to continue...')
tmpXC_cf = llc_compact_to_faces(tmpXC_c)
tmpXC_ct = llc_compact_to_tiles(tmpXC_c)
for f in range(1, 6):
tmp = np.unique((tmpXC_f[f] - tmpXC_cf[f]))
print('unique diffs CF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1b-1')
return TEST_RESULT
tmp = np.unique((tmpXC_ct - tmpXC_t))
print('unique diffs for CT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1b-2')
return TEST_RESULT
tmpXC_ft = llc_faces_to_tiles(tmpXC_f)
tmpXC_fc = llc_faces_to_compact(tmpXC_f)
tmp = np.unique((tmpXC_t - tmpXC_ft))
print('unique diffs for FT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1c-1')
return TEST_RESULT
tmp = np.unique((tmpXC_fc - tmpXC_c))
print('unique diffs FC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1c-2')
return TEST_RESULT
tmpXC_tf = llc_tiles_to_faces(tmpXC_t)
tmpXC_tc = llc_tiles_to_compact(tmpXC_t)
for f in range(1, 6):
tmp = np.unique((tmpXC_f[f] - tmpXC_tf[f]))
print('unique diffs for TF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1d-1')
return TEST_RESULT
tmp = np.unique((tmpXC_tc - tmpXC_c))
print('unique diffs TC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1d-2')
return TEST_RESULT
tmpXC_cftfc = llc_faces_to_compact(llc_tiles_to_faces(llc_faces_to_tiles(llc_compact_to_faces(tmpXC_c))))
tmp = np.unique((tmpXC_cftfc - tmpXC_c))
print('unique diffs CFTFC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 1e')
return TEST_RESULT
tmpHF_c = read_llc_to_compact(llc_grid_dir, llc_hfacc_fname, llc=llc, nk=50, filetype=llc_grid_filetype)
tmpHF_f = read_llc_to_faces(llc_grid_dir, llc_hfacc_fname, llc=llc, nk=50, filetype=llc_grid_filetype)
tmpHF_t = read_llc_to_tiles(llc_grid_dir, llc_hfacc_fname, llc=llc, nk=50, filetype=llc_grid_filetype)
tmpHF_c.shape
if make_plots:
plt.imshow(tmpHF_c[0, :])
plt.colorbar()
plot_tiles(tmpHF_t[:, 0, :])
plot_tiles(tmpHF_t[:, 20, :])
plt.draw()
raw_input('Press Enter to continue...')
tmpHF_cf = llc_compact_to_faces(tmpHF_c)
tmpHF_ct = llc_compact_to_tiles(tmpHF_c)
for f in range(1, 6):
tmp = np.unique((tmpHF_f[f] - tmpHF_cf[f]))
print('unique diffs CF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2b-1')
return TEST_RESULT
tmp = np.unique((tmpHF_ct - tmpHF_t))
print('unique diffs CT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2b-2')
return TEST_RESULT
if make_plots:
for k in [0, 20]:
for f in range(1, 6):
plt.figure()
plt.imshow(tmpHF_cf[f][k, :], origin='lower')
plt.colorbar()
plt.draw()
raw_input('Press Enter to continue...')
tmpHF_ft = llc_faces_to_tiles(tmpHF_f)
tmpHF_fc = llc_faces_to_compact(tmpHF_f)
if make_plots:
plot_tiles(tmpHF_ft[:, 0, :])
plot_tiles(tmpHF_ft[:, 20, :])
plt.draw()
raw_input('Press Enter to continue...')
tmp = np.unique((tmpHF_t - tmpHF_ft))
print('unique diffs FT ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2c-1')
return TEST_RESULT
tmp = np.unique((tmpHF_fc - tmpHF_c))
print('unique diffs FC', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2c-2')
return TEST_RESULT
tmpHF_tf = llc_tiles_to_faces(tmpHF_t)
tmpHF_tc = llc_tiles_to_compact(tmpHF_t)
if make_plots:
for k in [0, 20]:
for f in range(1, 6):
plt.figure()
plt.imshow(tmpHF_tf[f][k, :], origin='lower')
plt.colorbar()
plt.draw()
raw_input('Press Enter to continue...')
for f in range(1, 6):
tmp = np.unique((tmpHF_f[f] - tmpHF_tf[f]))
print('unique diffs TF ', f, tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2d-1')
return TEST_RESULT
tmp = np.unique((tmpHF_tc - tmpHF_c))
print('unique diffs TC ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2d-1')
return TEST_RESULT
tmpHF_cftfc = llc_faces_to_compact(llc_tiles_to_faces(llc_faces_to_tiles(llc_compact_to_faces(tmpHF_c))))
tmp = np.unique((tmpHF_cftfc - tmpHF_c))
print('unique diffs CFTFC ', tmp)
if ((len(tmp) != 1) or (tmp[0] != 0)):
TEST_RESULT = 0
print('failed on 2e')
return TEST_RESULT
print('YOU MADE IT THIS FAR, TESTS PASSED!')
return TEST_RESULT |
def _luong_local_compute_attention(attention_mechanism, cell_output, attention_state, attention_layer):
'Computes the attention and alignments for the Luong style local attention mechanism.'
(alignments, next_attention_state) = attention_mechanism(cell_output, state=attention_state)
expanded_alignments = tf.expand_dims(alignments, 1)
context_windows = []
padded_alignment_windows = []
window_start = attention_mechanism.window_start
window_stop = attention_mechanism.window_stop
pre_padding = attention_mechanism.window_pre_padding
post_padding = attention_mechanism.window_post_padding
full_pre_padding = attention_mechanism.full_seq_pre_padding
full_post_padding = attention_mechanism.full_seq_post_padding
for i in range(0, attention_mechanism.const_batch_size):
value_window = attention_mechanism.values[i, window_start[i][0]:window_stop[i][0], :]
value_window_paddings = [[pre_padding[i][0], post_padding[i][0]], [0, 0]]
value_window = tf.pad(value_window, value_window_paddings, 'CONSTANT')
value_window.set_shape((attention_mechanism.window_size, attention_mechanism._num_units))
context_window = tf.matmul(expanded_alignments[i], value_window)
context_windows.append(context_window)
if (attention_mechanism.force_gaussian is True):
point_dist = (tf.cast(tf.range(start=window_start[i][0], limit=window_stop[i][0], delta=1), dtype=tf.float32) - attention_mechanism.p[i][0])
gaussian_weights = tf.exp((((- (point_dist ** 2)) / 2) * ((attention_mechanism.d / 2) ** 2)))
__alignments = (alignments[i] * gaussian_weights)
else:
__alignments = alignments[i]
alignment_seq_paddings = [[full_pre_padding[i][0], full_post_padding[i][0]]]
__alignments = tf.pad(__alignments, alignment_seq_paddings, 'CONSTANT')
padded_alignment_windows.append(__alignments)
context = tf.stack(context_windows)
context = tf.squeeze(context, [1])
padded_alignment = tf.stack(padded_alignment_windows)
if (attention_layer is not None):
attention = attention_layer(tf.concat([cell_output, context], 1))
else:
attention = context
return (attention, padded_alignment, padded_alignment) | 8,026,928,542,167,554,000 | Computes the attention and alignments for the Luong style local attention mechanism. | tacotron/attention.py | _luong_local_compute_attention | yweweler/single-speaker-tts | python | def _luong_local_compute_attention(attention_mechanism, cell_output, attention_state, attention_layer):
(alignments, next_attention_state) = attention_mechanism(cell_output, state=attention_state)
expanded_alignments = tf.expand_dims(alignments, 1)
context_windows = []
padded_alignment_windows = []
window_start = attention_mechanism.window_start
window_stop = attention_mechanism.window_stop
pre_padding = attention_mechanism.window_pre_padding
post_padding = attention_mechanism.window_post_padding
full_pre_padding = attention_mechanism.full_seq_pre_padding
full_post_padding = attention_mechanism.full_seq_post_padding
for i in range(0, attention_mechanism.const_batch_size):
value_window = attention_mechanism.values[i, window_start[i][0]:window_stop[i][0], :]
value_window_paddings = [[pre_padding[i][0], post_padding[i][0]], [0, 0]]
value_window = tf.pad(value_window, value_window_paddings, 'CONSTANT')
value_window.set_shape((attention_mechanism.window_size, attention_mechanism._num_units))
context_window = tf.matmul(expanded_alignments[i], value_window)
context_windows.append(context_window)
if (attention_mechanism.force_gaussian is True):
point_dist = (tf.cast(tf.range(start=window_start[i][0], limit=window_stop[i][0], delta=1), dtype=tf.float32) - attention_mechanism.p[i][0])
gaussian_weights = tf.exp((((- (point_dist ** 2)) / 2) * ((attention_mechanism.d / 2) ** 2)))
__alignments = (alignments[i] * gaussian_weights)
else:
__alignments = alignments[i]
alignment_seq_paddings = [[full_pre_padding[i][0], full_post_padding[i][0]]]
__alignments = tf.pad(__alignments, alignment_seq_paddings, 'CONSTANT')
padded_alignment_windows.append(__alignments)
context = tf.stack(context_windows)
context = tf.squeeze(context, [1])
padded_alignment = tf.stack(padded_alignment_windows)
if (attention_layer is not None):
attention = attention_layer(tf.concat([cell_output, context], 1))
else:
attention = context
return (attention, padded_alignment, padded_alignment) |
def _luong_dot_score(query, keys, scale):
'\n Implements the Luong-style dot scoring function.\n\n This attention has two forms. The first is standard Luong attention, as described in:\n\n Minh-Thang Luong, Hieu Pham, Christopher D. Manning.\n "Effective Approaches to Attention-based Neural Machine Translation."\n EMNLP 2015. https://arxiv.org/abs/1508.04025\n\n The second is the scaled form inspired partly by the normalized form of\n Bahdanau attention.\n\n To enable the second form, call this function with `scale=True`.\n\n This implementation is derived from: `tensorflow.contrib.seq2seq.python.ops.attention_wrapper`\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n keys (tf.Tensor):\n Processed memory (usually the encoder states processed by the memory_layer).\n The shape is expected to be shape=(B, X, num_units) with B being the batch size\n and `num_units` being the output size of the memory_layer. X may be the\n maximal length of the encoder time domain or in the case of local attention the\n window size.\n\n scale (boolean):\n Whether to apply a scale to the score function.\n\n Returns:\n score (tf.Tensor):\n A tensor with shape=(B, X) containing the non-normalized score values.\n\n Raises:\n ValueError: If `key` and `query` depths do not match.\n\n '
depth = query.get_shape()[(- 1)]
key_units = keys.get_shape()[(- 1)]
if (depth != key_units):
raise ValueError(("Incompatible or unknown inner dimensions between query and keys. Query (%s) has units: %s. Keys (%s) have units: %s. Perhaps you need to set num_units to the keys' dimension (%s)?" % (query, depth, keys, key_units, key_units)))
dtype = query.dtype
query = tf.expand_dims(query, 1)
score = tf.matmul(query, keys, transpose_b=True)
score = tf.squeeze(score, [1])
if scale:
g = tf.get_variable('attention_g', dtype=dtype, initializer=tf.ones_initializer, shape=())
score = (g * score)
return score | 251,927,839,366,065,730 | Implements the Luong-style dot scoring function.
This attention has two forms. The first is standard Luong attention, as described in:
Minh-Thang Luong, Hieu Pham, Christopher D. Manning.
"Effective Approaches to Attention-based Neural Machine Translation."
EMNLP 2015. https://arxiv.org/abs/1508.04025
The second is the scaled form inspired partly by the normalized form of
Bahdanau attention.
To enable the second form, call this function with `scale=True`.
This implementation is derived from: `tensorflow.contrib.seq2seq.python.ops.attention_wrapper`
Arguments:
query (tf.Tensor):
Decoder cell outputs to compare to the keys (memory).
The shape is expected to be shape=(B, num_units) with B being the batch size
and `num_units` being the output size of the decoder_cell.
keys (tf.Tensor):
Processed memory (usually the encoder states processed by the memory_layer).
The shape is expected to be shape=(B, X, num_units) with B being the batch size
and `num_units` being the output size of the memory_layer. X may be the
maximal length of the encoder time domain or in the case of local attention the
window size.
scale (boolean):
Whether to apply a scale to the score function.
Returns:
score (tf.Tensor):
A tensor with shape=(B, X) containing the non-normalized score values.
Raises:
ValueError: If `key` and `query` depths do not match. | tacotron/attention.py | _luong_dot_score | yweweler/single-speaker-tts | python | def _luong_dot_score(query, keys, scale):
'\n Implements the Luong-style dot scoring function.\n\n This attention has two forms. The first is standard Luong attention, as described in:\n\n Minh-Thang Luong, Hieu Pham, Christopher D. Manning.\n "Effective Approaches to Attention-based Neural Machine Translation."\n EMNLP 2015. https://arxiv.org/abs/1508.04025\n\n The second is the scaled form inspired partly by the normalized form of\n Bahdanau attention.\n\n To enable the second form, call this function with `scale=True`.\n\n This implementation is derived from: `tensorflow.contrib.seq2seq.python.ops.attention_wrapper`\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n keys (tf.Tensor):\n Processed memory (usually the encoder states processed by the memory_layer).\n The shape is expected to be shape=(B, X, num_units) with B being the batch size\n and `num_units` being the output size of the memory_layer. X may be the\n maximal length of the encoder time domain or in the case of local attention the\n window size.\n\n scale (boolean):\n Whether to apply a scale to the score function.\n\n Returns:\n score (tf.Tensor):\n A tensor with shape=(B, X) containing the non-normalized score values.\n\n Raises:\n ValueError: If `key` and `query` depths do not match.\n\n '
depth = query.get_shape()[(- 1)]
key_units = keys.get_shape()[(- 1)]
if (depth != key_units):
raise ValueError(("Incompatible or unknown inner dimensions between query and keys. Query (%s) has units: %s. Keys (%s) have units: %s. Perhaps you need to set num_units to the keys' dimension (%s)?" % (query, depth, keys, key_units, key_units)))
dtype = query.dtype
query = tf.expand_dims(query, 1)
score = tf.matmul(query, keys, transpose_b=True)
score = tf.squeeze(score, [1])
if scale:
g = tf.get_variable('attention_g', dtype=dtype, initializer=tf.ones_initializer, shape=())
score = (g * score)
return score |
def _luong_general_score(query, keys):
'\n Implements the Luong-style general scoring function.\n\n - See [1]: Effective Approaches to Attention-based Neural Machine Translation,\n http://arxiv.org/abs/1508.04025\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n keys (tf.Tensor):\n Processed memory (usually the encoder states processed by the memory_layer).\n The shape is expected to be shape=(B, X, num_units) with B being the batch size\n and `num_units` being the output size of the memory_layer. X may be the\n maximal length of the encoder time domain or in the case of local attention the\n window size.\n\n Returns:\n score (tf.Tensor):\n A tensor with shape=(B, X) containing the non-normalized score values.\n '
raise NotImplementedError('Luong style general mode attention scoring is not implemented yet!') | 2,815,417,935,326,689,000 | Implements the Luong-style general scoring function.
- See [1]: Effective Approaches to Attention-based Neural Machine Translation,
http://arxiv.org/abs/1508.04025
Arguments:
query (tf.Tensor):
Decoder cell outputs to compare to the keys (memory).
The shape is expected to be shape=(B, num_units) with B being the batch size
and `num_units` being the output size of the decoder_cell.
keys (tf.Tensor):
Processed memory (usually the encoder states processed by the memory_layer).
The shape is expected to be shape=(B, X, num_units) with B being the batch size
and `num_units` being the output size of the memory_layer. X may be the
maximal length of the encoder time domain or in the case of local attention the
window size.
Returns:
score (tf.Tensor):
A tensor with shape=(B, X) containing the non-normalized score values. | tacotron/attention.py | _luong_general_score | yweweler/single-speaker-tts | python | def _luong_general_score(query, keys):
'\n Implements the Luong-style general scoring function.\n\n - See [1]: Effective Approaches to Attention-based Neural Machine Translation,\n http://arxiv.org/abs/1508.04025\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n keys (tf.Tensor):\n Processed memory (usually the encoder states processed by the memory_layer).\n The shape is expected to be shape=(B, X, num_units) with B being the batch size\n and `num_units` being the output size of the memory_layer. X may be the\n maximal length of the encoder time domain or in the case of local attention the\n window size.\n\n Returns:\n score (tf.Tensor):\n A tensor with shape=(B, X) containing the non-normalized score values.\n '
raise NotImplementedError('Luong style general mode attention scoring is not implemented yet!') |
def _luong_concat_score(query, keys):
'\n Implements the Luong-style concat scoring function.\n\n - See [1]: Effective Approaches to Attention-based Neural Machine Translation,\n http://arxiv.org/abs/1508.04025\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n keys (tf.Tensor):\n Processed memory (usually the encoder states processed by the memory_layer).\n The shape is expected to be shape=(B, X, num_units) with B being the batch size\n and `num_units` being the output size of the memory_layer. X may be the\n maximal length of the encoder time domain or in the case of local attention the\n window size.\n\n Returns:\n score (tf.Tensor):\n A tensor with shape=(B, X) containing the non-normalized score values.\n\n '
raise NotImplementedError('Luong style concat mode attention scoring is not implemented yet!') | -6,214,638,660,231,750,000 | Implements the Luong-style concat scoring function.
- See [1]: Effective Approaches to Attention-based Neural Machine Translation,
http://arxiv.org/abs/1508.04025
Arguments:
query (tf.Tensor):
Decoder cell outputs to compare to the keys (memory).
The shape is expected to be shape=(B, num_units) with B being the batch size
and `num_units` being the output size of the decoder_cell.
keys (tf.Tensor):
Processed memory (usually the encoder states processed by the memory_layer).
The shape is expected to be shape=(B, X, num_units) with B being the batch size
and `num_units` being the output size of the memory_layer. X may be the
maximal length of the encoder time domain or in the case of local attention the
window size.
Returns:
score (tf.Tensor):
A tensor with shape=(B, X) containing the non-normalized score values. | tacotron/attention.py | _luong_concat_score | yweweler/single-speaker-tts | python | def _luong_concat_score(query, keys):
'\n Implements the Luong-style concat scoring function.\n\n - See [1]: Effective Approaches to Attention-based Neural Machine Translation,\n http://arxiv.org/abs/1508.04025\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n keys (tf.Tensor):\n Processed memory (usually the encoder states processed by the memory_layer).\n The shape is expected to be shape=(B, X, num_units) with B being the batch size\n and `num_units` being the output size of the memory_layer. X may be the\n maximal length of the encoder time domain or in the case of local attention the\n window size.\n\n Returns:\n score (tf.Tensor):\n A tensor with shape=(B, X) containing the non-normalized score values.\n\n '
raise NotImplementedError('Luong style concat mode attention scoring is not implemented yet!') |
def __init__(self, num_units, memory, const_batch_size, memory_sequence_length=None, scale=False, probability_fn=None, score_mask_value=None, dtype=None, name='LocalLuongAttention', d=10, attention_mode=AttentionMode.MONOTONIC, score_mode=AttentionScore.DOT, force_gaussian=False):
'\n Arguments:\n num_units (int):\n The depth of the attention mechanism. This controls the number of units in the\n memory layer that processes the encoder states into the `keys`.\n\n memory (tf.Tensor):\n The memory to query; usually the output of an RNN encoder.\n The shape is expected to be shape=(batch_size, encoder_max_time, ...)\n\n const_batch_size (int):\n The constant batch size to expect from every batch. Every batch is expected to\n contain exactly `const_batch_size` samples.\n\n memory_sequence_length:\n (optional) Sequence lengths for the batch entries\n in memory. If provided, the memory tensor rows are masked with zeros\n for values past the respective sequence lengths.\n\n scale (boolean):\n Whether to scale the energy term.\n\n probability_fn:\n (optional) A `callable`. Converts the score to\n probabilities. The default is @{tf.nn.softmax}. Other options include\n @{tf.contrib.seq2seq.hardmax} and @{tf.contrib.sparsemax.sparsemax}.\n Its signature should be: `probabilities = probability_fn(score)`.\n\n score_mask_value:\n (optional) The mask value for score before passing into\n `probability_fn`. The default is -inf. Only used if\n `memory_sequence_length` is not None.\n\n dtype (tf.DType):\n The data type for the memory layer of the attention mechanism.\n\n name (string):\n Name to use when creating ops.\n\n d (int):\n D parameter controlling the window size and gaussian distribution.\n The window size is set to be `2D + 1`.\n\n attention_mode (AttentionMode):\n The attention mode to use. Can be either `MONOTONIC` or `PREDICTIVE`.\n\n score_mode (AttentionScore):\n The attention scoring function to use. Can either be `DOT`, `GENERAL` or `CONCAT`.\n\n force_gaussian (boolean):\n Force a gaussian distribution onto the scores in the attention window.\n Defaults to False.\n '
super().__init__(num_units=num_units, memory=memory, memory_sequence_length=memory_sequence_length, scale=scale, probability_fn=probability_fn, score_mask_value=score_mask_value, dtype=dtype, name=name)
self.time = 0
self.d = d
self.window_size = ((2 * self.d) + 1)
self.attention_mode = attention_mode
self.score_mode = score_mode
self.const_batch_size = const_batch_size
self.force_gaussian = force_gaussian | 3,749,976,848,804,298,000 | Arguments:
num_units (int):
The depth of the attention mechanism. This controls the number of units in the
memory layer that processes the encoder states into the `keys`.
memory (tf.Tensor):
The memory to query; usually the output of an RNN encoder.
The shape is expected to be shape=(batch_size, encoder_max_time, ...)
const_batch_size (int):
The constant batch size to expect from every batch. Every batch is expected to
contain exactly `const_batch_size` samples.
memory_sequence_length:
(optional) Sequence lengths for the batch entries
in memory. If provided, the memory tensor rows are masked with zeros
for values past the respective sequence lengths.
scale (boolean):
Whether to scale the energy term.
probability_fn:
(optional) A `callable`. Converts the score to
probabilities. The default is @{tf.nn.softmax}. Other options include
@{tf.contrib.seq2seq.hardmax} and @{tf.contrib.sparsemax.sparsemax}.
Its signature should be: `probabilities = probability_fn(score)`.
score_mask_value:
(optional) The mask value for score before passing into
`probability_fn`. The default is -inf. Only used if
`memory_sequence_length` is not None.
dtype (tf.DType):
The data type for the memory layer of the attention mechanism.
name (string):
Name to use when creating ops.
d (int):
D parameter controlling the window size and gaussian distribution.
The window size is set to be `2D + 1`.
attention_mode (AttentionMode):
The attention mode to use. Can be either `MONOTONIC` or `PREDICTIVE`.
score_mode (AttentionScore):
The attention scoring function to use. Can either be `DOT`, `GENERAL` or `CONCAT`.
force_gaussian (boolean):
Force a gaussian distribution onto the scores in the attention window.
Defaults to False. | tacotron/attention.py | __init__ | yweweler/single-speaker-tts | python | def __init__(self, num_units, memory, const_batch_size, memory_sequence_length=None, scale=False, probability_fn=None, score_mask_value=None, dtype=None, name='LocalLuongAttention', d=10, attention_mode=AttentionMode.MONOTONIC, score_mode=AttentionScore.DOT, force_gaussian=False):
'\n Arguments:\n num_units (int):\n The depth of the attention mechanism. This controls the number of units in the\n memory layer that processes the encoder states into the `keys`.\n\n memory (tf.Tensor):\n The memory to query; usually the output of an RNN encoder.\n The shape is expected to be shape=(batch_size, encoder_max_time, ...)\n\n const_batch_size (int):\n The constant batch size to expect from every batch. Every batch is expected to\n contain exactly `const_batch_size` samples.\n\n memory_sequence_length:\n (optional) Sequence lengths for the batch entries\n in memory. If provided, the memory tensor rows are masked with zeros\n for values past the respective sequence lengths.\n\n scale (boolean):\n Whether to scale the energy term.\n\n probability_fn:\n (optional) A `callable`. Converts the score to\n probabilities. The default is @{tf.nn.softmax}. Other options include\n @{tf.contrib.seq2seq.hardmax} and @{tf.contrib.sparsemax.sparsemax}.\n Its signature should be: `probabilities = probability_fn(score)`.\n\n score_mask_value:\n (optional) The mask value for score before passing into\n `probability_fn`. The default is -inf. Only used if\n `memory_sequence_length` is not None.\n\n dtype (tf.DType):\n The data type for the memory layer of the attention mechanism.\n\n name (string):\n Name to use when creating ops.\n\n d (int):\n D parameter controlling the window size and gaussian distribution.\n The window size is set to be `2D + 1`.\n\n attention_mode (AttentionMode):\n The attention mode to use. Can be either `MONOTONIC` or `PREDICTIVE`.\n\n score_mode (AttentionScore):\n The attention scoring function to use. Can either be `DOT`, `GENERAL` or `CONCAT`.\n\n force_gaussian (boolean):\n Force a gaussian distribution onto the scores in the attention window.\n Defaults to False.\n '
super().__init__(num_units=num_units, memory=memory, memory_sequence_length=memory_sequence_length, scale=scale, probability_fn=probability_fn, score_mask_value=score_mask_value, dtype=dtype, name=name)
self.time = 0
self.d = d
self.window_size = ((2 * self.d) + 1)
self.attention_mode = attention_mode
self.score_mode = score_mode
self.const_batch_size = const_batch_size
self.force_gaussian = force_gaussian |
def __call__(self, query, state):
'\n Calculate the alignments and next_state for the current decoder output.\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n state (tf.Tensor):\n In Luong attention the state is equal to the alignments. Therefore this will\n contain the alignments from the previous decoding step.\n\n Returns:\n (alignments, next_state):\n alignments (tf.Tensor):\n The normalized attention scores for the attention window. The shape is\n shape=(B, 2D+1), with B being the batch size and `2D+1` being the window size.\n next_state (tf.Tensor):\n In Luong attention this is equal to `alignments`.\n '
with tf.variable_scope(None, 'local_luong_attention', [query]):
num_units = self._keys.get_shape()[(- 1)]
source_seq_length = tf.shape(self._keys)[1]
if (self.attention_mode == AttentionMode.PREDICTIVE):
vp = tf.get_variable(name='local_v_p', shape=[num_units, 1], dtype=tf.float32)
wp = tf.get_variable(name='local_w_p', shape=[num_units, num_units], dtype=tf.float32)
_intermediate_result = tf.transpose(tf.tensordot(wp, query, [0, 1]))
_tmp = tf.transpose(tf.tensordot(vp, tf.tanh(_intermediate_result), [0, 1]))
self.p = (tf.cast(source_seq_length, tf.float32) * tf.sigmoid(_tmp))
elif (self.attention_mode == AttentionMode.MONOTONIC):
self.p = tf.tile([[self.time]], tf.convert_to_tensor([self.batch_size, 1]))
self.p = tf.maximum(self.p, self.d)
self.p = tf.minimum(self.p, (source_seq_length - (self.d + 1)))
self.p = tf.cast(self.p, dtype=tf.float32)
start_index = (tf.floor(self.p) - self.d)
start_index = tf.cast(start_index, dtype=tf.int32)
self.window_start = tf.maximum(0, start_index)
stop_index = ((tf.floor(self.p) + self.d) + 1)
stop_index = tf.cast(stop_index, dtype=tf.int32)
self.window_stop = tf.minimum(source_seq_length, stop_index)
self.full_seq_pre_padding = tf.abs(start_index)
self.full_seq_post_padding = tf.abs((stop_index - source_seq_length))
self.window_pre_padding = tf.abs((self.window_start - start_index))
self.window_post_padding = tf.abs((self.window_stop - stop_index))
with tf.variable_scope(None, 'window_extraction', [query]):
windows = []
for i in range(0, self.const_batch_size):
__window = self._keys[i, self.window_start[i][0]:self.window_stop[i][0], :]
paddings = [[self.window_pre_padding[i][0], self.window_post_padding[i][0]], [0, 0]]
__window = tf.pad(__window, paddings, 'CONSTANT')
windows.append(__window)
window = tf.stack(windows)
if (self.score_mode == AttentionScore.DOT):
score = _luong_dot_score(query, window, self._scale)
elif (self.score_mode == AttentionScore.GENERAL):
score = _luong_general_score(query, window)
elif (self.score_mode == AttentionScore.CONCAT):
score = _luong_concat_score(query, window)
else:
score = None
raise Exception('An invalid attention scoring mode was supplied.')
alignments = self._probability_fn(score, state)
next_state = alignments
return (alignments, next_state) | 5,188,351,230,933,922,000 | Calculate the alignments and next_state for the current decoder output.
Arguments:
query (tf.Tensor):
Decoder cell outputs to compare to the keys (memory).
The shape is expected to be shape=(B, num_units) with B being the batch size
and `num_units` being the output size of the decoder_cell.
state (tf.Tensor):
In Luong attention the state is equal to the alignments. Therefore this will
contain the alignments from the previous decoding step.
Returns:
(alignments, next_state):
alignments (tf.Tensor):
The normalized attention scores for the attention window. The shape is
shape=(B, 2D+1), with B being the batch size and `2D+1` being the window size.
next_state (tf.Tensor):
In Luong attention this is equal to `alignments`. | tacotron/attention.py | __call__ | yweweler/single-speaker-tts | python | def __call__(self, query, state):
'\n Calculate the alignments and next_state for the current decoder output.\n\n Arguments:\n query (tf.Tensor):\n Decoder cell outputs to compare to the keys (memory).\n The shape is expected to be shape=(B, num_units) with B being the batch size\n and `num_units` being the output size of the decoder_cell.\n\n state (tf.Tensor):\n In Luong attention the state is equal to the alignments. Therefore this will\n contain the alignments from the previous decoding step.\n\n Returns:\n (alignments, next_state):\n alignments (tf.Tensor):\n The normalized attention scores for the attention window. The shape is\n shape=(B, 2D+1), with B being the batch size and `2D+1` being the window size.\n next_state (tf.Tensor):\n In Luong attention this is equal to `alignments`.\n '
with tf.variable_scope(None, 'local_luong_attention', [query]):
num_units = self._keys.get_shape()[(- 1)]
source_seq_length = tf.shape(self._keys)[1]
if (self.attention_mode == AttentionMode.PREDICTIVE):
vp = tf.get_variable(name='local_v_p', shape=[num_units, 1], dtype=tf.float32)
wp = tf.get_variable(name='local_w_p', shape=[num_units, num_units], dtype=tf.float32)
_intermediate_result = tf.transpose(tf.tensordot(wp, query, [0, 1]))
_tmp = tf.transpose(tf.tensordot(vp, tf.tanh(_intermediate_result), [0, 1]))
self.p = (tf.cast(source_seq_length, tf.float32) * tf.sigmoid(_tmp))
elif (self.attention_mode == AttentionMode.MONOTONIC):
self.p = tf.tile([[self.time]], tf.convert_to_tensor([self.batch_size, 1]))
self.p = tf.maximum(self.p, self.d)
self.p = tf.minimum(self.p, (source_seq_length - (self.d + 1)))
self.p = tf.cast(self.p, dtype=tf.float32)
start_index = (tf.floor(self.p) - self.d)
start_index = tf.cast(start_index, dtype=tf.int32)
self.window_start = tf.maximum(0, start_index)
stop_index = ((tf.floor(self.p) + self.d) + 1)
stop_index = tf.cast(stop_index, dtype=tf.int32)
self.window_stop = tf.minimum(source_seq_length, stop_index)
self.full_seq_pre_padding = tf.abs(start_index)
self.full_seq_post_padding = tf.abs((stop_index - source_seq_length))
self.window_pre_padding = tf.abs((self.window_start - start_index))
self.window_post_padding = tf.abs((self.window_stop - stop_index))
with tf.variable_scope(None, 'window_extraction', [query]):
windows = []
for i in range(0, self.const_batch_size):
__window = self._keys[i, self.window_start[i][0]:self.window_stop[i][0], :]
paddings = [[self.window_pre_padding[i][0], self.window_post_padding[i][0]], [0, 0]]
__window = tf.pad(__window, paddings, 'CONSTANT')
windows.append(__window)
window = tf.stack(windows)
if (self.score_mode == AttentionScore.DOT):
score = _luong_dot_score(query, window, self._scale)
elif (self.score_mode == AttentionScore.GENERAL):
score = _luong_general_score(query, window)
elif (self.score_mode == AttentionScore.CONCAT):
score = _luong_concat_score(query, window)
else:
score = None
raise Exception('An invalid attention scoring mode was supplied.')
alignments = self._probability_fn(score, state)
next_state = alignments
return (alignments, next_state) |
def call(self, inputs, state):
"Perform a step of attention-wrapped RNN.\n\n - Step 1: Mix the `inputs` and previous step's `attention` output via\n `cell_input_fn`.\n - Step 2: Call the wrapped `cell` with this input and its previous state.\n - Step 3: Score the cell's output with `attention_mechanism`.\n - Step 4: Calculate the alignments by passing the score through the\n `normalizer`.\n - Step 5: Calculate the context vector as the inner product between the\n alignments and the attention_mechanism's values (memory).\n - Step 6: Calculate the attention output by concatenating the cell output\n and context through the attention layer (a linear layer with\n `attention_layer_size` outputs).\n\n Args:\n inputs: (Possibly nested tuple of) Tensor, the input at this time step.\n state: An instance of `AttentionWrapperState` containing\n tensors from the previous time step.\n\n Returns:\n A tuple `(attention_or_cell_output, next_state)`, where:\n\n - `attention_or_cell_output` depending on `output_attention`.\n - `next_state` is an instance of `AttentionWrapperState`\n containing the state calculated at this time step.\n\n Raises:\n TypeError: If `state` is not an instance of `AttentionWrapperState`.\n "
if (not isinstance(state, AttentionWrapperState)):
raise TypeError(('Expected state to be instance of AttentionWrapperState. Received type %s instead.' % type(state)))
cell_inputs = self._cell_input_fn(inputs, state.attention)
cell_state = state.cell_state
(cell_output, next_cell_state) = self._cell(cell_inputs, cell_state)
cell_batch_size = (cell_output.shape[0].value or tf.shape(cell_output)[0])
error_message = (('When applying AttentionWrapper %s: ' % self.name) + 'Non-matching batch sizes between the memory (encoder output) and the query (decoder output). Are you using the BeamSearchDecoder? You may need to tile your memory input via the tf.contrib.seq2seq.tile_batch function with argument multiple=beam_width.')
with tf.control_dependencies(self._batch_size_checks(cell_batch_size, error_message)):
cell_output = tf.identity(cell_output, name='checked_cell_output')
if self._is_multi:
previous_attention_state = state.attention_state
previous_alignment_history = state.alignment_history
else:
previous_attention_state = [state.attention_state]
previous_alignment_history = [state.alignment_history]
all_alignments = []
all_attentions = []
all_attention_states = []
maybe_all_histories = []
for (i, attention_mechanism) in enumerate(self._attention_mechanisms):
attention_mechanism.time = state.time
(attention, alignments, next_attention_state) = _luong_local_compute_attention(attention_mechanism, cell_output, previous_attention_state[i], (self._attention_layers[i] if self._attention_layers else None))
alignment_history = (previous_alignment_history[i].write(state.time, alignments) if self._alignment_history else ())
all_attention_states.append(next_attention_state)
all_alignments.append(alignments)
all_attentions.append(attention)
maybe_all_histories.append(alignment_history)
attention = tf.concat(all_attentions, 1)
next_state = AttentionWrapperState(time=(state.time + 1), cell_state=next_cell_state, attention=attention, attention_state=self._item_or_tuple(all_attention_states), alignments=self._item_or_tuple(all_alignments), alignment_history=self._item_or_tuple(maybe_all_histories))
if self._output_attention:
return (attention, next_state)
else:
return (cell_output, next_state) | 8,947,183,884,278,288,000 | Perform a step of attention-wrapped RNN.
- Step 1: Mix the `inputs` and previous step's `attention` output via
`cell_input_fn`.
- Step 2: Call the wrapped `cell` with this input and its previous state.
- Step 3: Score the cell's output with `attention_mechanism`.
- Step 4: Calculate the alignments by passing the score through the
`normalizer`.
- Step 5: Calculate the context vector as the inner product between the
alignments and the attention_mechanism's values (memory).
- Step 6: Calculate the attention output by concatenating the cell output
and context through the attention layer (a linear layer with
`attention_layer_size` outputs).
Args:
inputs: (Possibly nested tuple of) Tensor, the input at this time step.
state: An instance of `AttentionWrapperState` containing
tensors from the previous time step.
Returns:
A tuple `(attention_or_cell_output, next_state)`, where:
- `attention_or_cell_output` depending on `output_attention`.
- `next_state` is an instance of `AttentionWrapperState`
containing the state calculated at this time step.
Raises:
TypeError: If `state` is not an instance of `AttentionWrapperState`. | tacotron/attention.py | call | yweweler/single-speaker-tts | python | def call(self, inputs, state):
"Perform a step of attention-wrapped RNN.\n\n - Step 1: Mix the `inputs` and previous step's `attention` output via\n `cell_input_fn`.\n - Step 2: Call the wrapped `cell` with this input and its previous state.\n - Step 3: Score the cell's output with `attention_mechanism`.\n - Step 4: Calculate the alignments by passing the score through the\n `normalizer`.\n - Step 5: Calculate the context vector as the inner product between the\n alignments and the attention_mechanism's values (memory).\n - Step 6: Calculate the attention output by concatenating the cell output\n and context through the attention layer (a linear layer with\n `attention_layer_size` outputs).\n\n Args:\n inputs: (Possibly nested tuple of) Tensor, the input at this time step.\n state: An instance of `AttentionWrapperState` containing\n tensors from the previous time step.\n\n Returns:\n A tuple `(attention_or_cell_output, next_state)`, where:\n\n - `attention_or_cell_output` depending on `output_attention`.\n - `next_state` is an instance of `AttentionWrapperState`\n containing the state calculated at this time step.\n\n Raises:\n TypeError: If `state` is not an instance of `AttentionWrapperState`.\n "
if (not isinstance(state, AttentionWrapperState)):
raise TypeError(('Expected state to be instance of AttentionWrapperState. Received type %s instead.' % type(state)))
cell_inputs = self._cell_input_fn(inputs, state.attention)
cell_state = state.cell_state
(cell_output, next_cell_state) = self._cell(cell_inputs, cell_state)
cell_batch_size = (cell_output.shape[0].value or tf.shape(cell_output)[0])
error_message = (('When applying AttentionWrapper %s: ' % self.name) + 'Non-matching batch sizes between the memory (encoder output) and the query (decoder output). Are you using the BeamSearchDecoder? You may need to tile your memory input via the tf.contrib.seq2seq.tile_batch function with argument multiple=beam_width.')
with tf.control_dependencies(self._batch_size_checks(cell_batch_size, error_message)):
cell_output = tf.identity(cell_output, name='checked_cell_output')
if self._is_multi:
previous_attention_state = state.attention_state
previous_alignment_history = state.alignment_history
else:
previous_attention_state = [state.attention_state]
previous_alignment_history = [state.alignment_history]
all_alignments = []
all_attentions = []
all_attention_states = []
maybe_all_histories = []
for (i, attention_mechanism) in enumerate(self._attention_mechanisms):
attention_mechanism.time = state.time
(attention, alignments, next_attention_state) = _luong_local_compute_attention(attention_mechanism, cell_output, previous_attention_state[i], (self._attention_layers[i] if self._attention_layers else None))
alignment_history = (previous_alignment_history[i].write(state.time, alignments) if self._alignment_history else ())
all_attention_states.append(next_attention_state)
all_alignments.append(alignments)
all_attentions.append(attention)
maybe_all_histories.append(alignment_history)
attention = tf.concat(all_attentions, 1)
next_state = AttentionWrapperState(time=(state.time + 1), cell_state=next_cell_state, attention=attention, attention_state=self._item_or_tuple(all_attention_states), alignments=self._item_or_tuple(all_alignments), alignment_history=self._item_or_tuple(maybe_all_histories))
if self._output_attention:
return (attention, next_state)
else:
return (cell_output, next_state) |
def get_jwt_payload(self, obj):
'\n Define here, what data shall be encoded in JWT.\n By default, entire object will be encoded.\n '
return obj | -2,919,222,944,256,560,000 | Define here, what data shall be encoded in JWT.
By default, entire object will be encoded. | rest_social_auth/serializers.py | get_jwt_payload | silverlogic/django-rest-social-auth | python | def get_jwt_payload(self, obj):
'\n Define here, what data shall be encoded in JWT.\n By default, entire object will be encoded.\n '
return obj |
@abstractmethod
@dyndoc_insert(responses)
def __init__(self, accountID, orderID=None):
'Instantiate an Orders request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string\n id of the order to perform the request for.\n '
endpoint = self.ENDPOINT.format(accountID=accountID, orderID=orderID)
super(Orders, self).__init__(endpoint, method=self.METHOD, expected_status=self.EXPECTED_STATUS) | 5,683,344,200,435,835,000 | Instantiate an Orders request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
orderID : string
id of the order to perform the request for. | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @abstractmethod
@dyndoc_insert(responses)
def __init__(self, accountID, orderID=None):
'Instantiate an Orders request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string\n id of the order to perform the request for.\n '
endpoint = self.ENDPOINT.format(accountID=accountID, orderID=orderID)
super(Orders, self).__init__(endpoint, method=self.METHOD, expected_status=self.EXPECTED_STATUS) |
@dyndoc_insert(responses)
def __init__(self, accountID, data):
'Instantiate an OrderCreate request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n data : JSON (required)\n json orderbody to send\n\n\n Orderbody example::\n\n {_v3_accounts_accountID_orders_create_body}\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderCreate(accountID, data=data)\n >>> client.request(r)\n >>> print r.response\n\n ::\n\n {_v3_accounts_accountID_orders_create_resp}\n\n '
super(OrderCreate, self).__init__(accountID)
self.data = data | 2,512,598,491,482,841,000 | Instantiate an OrderCreate request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
data : JSON (required)
json orderbody to send
Orderbody example::
{_v3_accounts_accountID_orders_create_body}
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> r = orders.OrderCreate(accountID, data=data)
>>> client.request(r)
>>> print r.response
::
{_v3_accounts_accountID_orders_create_resp} | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @dyndoc_insert(responses)
def __init__(self, accountID, data):
'Instantiate an OrderCreate request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n data : JSON (required)\n json orderbody to send\n\n\n Orderbody example::\n\n {_v3_accounts_accountID_orders_create_body}\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderCreate(accountID, data=data)\n >>> client.request(r)\n >>> print r.response\n\n ::\n\n {_v3_accounts_accountID_orders_create_resp}\n\n '
super(OrderCreate, self).__init__(accountID)
self.data = data |
@dyndoc_insert(responses)
def __init__(self, accountID, params=None):
'Instantiate an OrderList request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n params : dict\n optional request query parameters, check developer.oanda.com\n for details\n\n\n Example::\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderList(accountID)\n >>> client.request(r)\n >>> print r.response\n\n\n Output::\n\n {_v3_accounts_accountID_orders_list_resp}\n\n '
super(OrderList, self).__init__(accountID)
self.params = params | -6,633,771,546,248,787,000 | Instantiate an OrderList request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
params : dict
optional request query parameters, check developer.oanda.com
for details
Example::
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> r = orders.OrderList(accountID)
>>> client.request(r)
>>> print r.response
Output::
{_v3_accounts_accountID_orders_list_resp} | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @dyndoc_insert(responses)
def __init__(self, accountID, params=None):
'Instantiate an OrderList request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n params : dict\n optional request query parameters, check developer.oanda.com\n for details\n\n\n Example::\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderList(accountID)\n >>> client.request(r)\n >>> print r.response\n\n\n Output::\n\n {_v3_accounts_accountID_orders_list_resp}\n\n '
super(OrderList, self).__init__(accountID)
self.params = params |
@dyndoc_insert(responses)
def __init__(self, accountID):
'Instantiate an OrdersPending request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n\n Example::\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrdersPending(accountID)\n >>> client.request(r)\n >>> print r.response\n\n\n Output::\n\n {_v3_accounts_accountID_orders_pending_resp}\n\n '
super(OrdersPending, self).__init__(accountID) | 3,658,857,972,760,194,600 | Instantiate an OrdersPending request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
Example::
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> r = orders.OrdersPending(accountID)
>>> client.request(r)
>>> print r.response
Output::
{_v3_accounts_accountID_orders_pending_resp} | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @dyndoc_insert(responses)
def __init__(self, accountID):
'Instantiate an OrdersPending request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n\n Example::\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrdersPending(accountID)\n >>> client.request(r)\n >>> print r.response\n\n\n Output::\n\n {_v3_accounts_accountID_orders_pending_resp}\n\n '
super(OrdersPending, self).__init__(accountID) |
@dyndoc_insert(responses)
def __init__(self, accountID, orderID):
'Instantiate an OrderDetails request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the order to perform the request on.\n\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderDetails(accountID=..., orderID=...)\n >>> client.request(r)\n >>> print r.response\n\n Output::\n\n {_v3_accounts_accountID_order_details_resp}\n\n '
super(OrderDetails, self).__init__(accountID, orderID) | -7,161,585,653,225,752,000 | Instantiate an OrderDetails request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
orderID : string (required)
id of the order to perform the request on.
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> r = orders.OrderDetails(accountID=..., orderID=...)
>>> client.request(r)
>>> print r.response
Output::
{_v3_accounts_accountID_order_details_resp} | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @dyndoc_insert(responses)
def __init__(self, accountID, orderID):
'Instantiate an OrderDetails request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the order to perform the request on.\n\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderDetails(accountID=..., orderID=...)\n >>> client.request(r)\n >>> print r.response\n\n Output::\n\n {_v3_accounts_accountID_order_details_resp}\n\n '
super(OrderDetails, self).__init__(accountID, orderID) |
@dyndoc_insert(responses)
def __init__(self, accountID, orderID, data):
'Instantiate an OrderReplace request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the order to perform the request on.\n\n data : JSON (required)\n json orderbody to send\n\n\n Orderbody example::\n\n {_v3_accounts_accountID_order_replace_body}\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> data = {_v3_accounts_accountID_order_replace_body}\n >>> r = orders.OrderReplace(accountID=..., orderID=..., data=data)\n >>> client.request(r)\n >>> print r.response\n\n Output::\n\n {_v3_accounts_accountID_order_replace_resp}\n\n '
super(OrderReplace, self).__init__(accountID, orderID)
self.data = data | 6,441,901,308,359,472,000 | Instantiate an OrderReplace request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
orderID : string (required)
id of the order to perform the request on.
data : JSON (required)
json orderbody to send
Orderbody example::
{_v3_accounts_accountID_order_replace_body}
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> data = {_v3_accounts_accountID_order_replace_body}
>>> r = orders.OrderReplace(accountID=..., orderID=..., data=data)
>>> client.request(r)
>>> print r.response
Output::
{_v3_accounts_accountID_order_replace_resp} | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @dyndoc_insert(responses)
def __init__(self, accountID, orderID, data):
'Instantiate an OrderReplace request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the order to perform the request on.\n\n data : JSON (required)\n json orderbody to send\n\n\n Orderbody example::\n\n {_v3_accounts_accountID_order_replace_body}\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> data = {_v3_accounts_accountID_order_replace_body}\n >>> r = orders.OrderReplace(accountID=..., orderID=..., data=data)\n >>> client.request(r)\n >>> print r.response\n\n Output::\n\n {_v3_accounts_accountID_order_replace_resp}\n\n '
super(OrderReplace, self).__init__(accountID, orderID)
self.data = data |
@dyndoc_insert(responses)
def __init__(self, accountID, orderID):
'Instantiate an OrdersCancel request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the account to perform the request on.\n\n\n Example::\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderCancel(accountID= ..., orderID=...)\n >>> client.request(r)\n >>> print r.response\n\n\n Output::\n\n {_v3_accounts_accountID_order_cancel_resp}\n\n '
super(OrderCancel, self).__init__(accountID, orderID) | -5,047,532,072,204,407,000 | Instantiate an OrdersCancel request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
orderID : string (required)
id of the account to perform the request on.
Example::
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> r = orders.OrderCancel(accountID= ..., orderID=...)
>>> client.request(r)
>>> print r.response
Output::
{_v3_accounts_accountID_order_cancel_resp} | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @dyndoc_insert(responses)
def __init__(self, accountID, orderID):
'Instantiate an OrdersCancel request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the account to perform the request on.\n\n\n Example::\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderCancel(accountID= ..., orderID=...)\n >>> client.request(r)\n >>> print r.response\n\n\n Output::\n\n {_v3_accounts_accountID_order_cancel_resp}\n\n '
super(OrderCancel, self).__init__(accountID, orderID) |
@dyndoc_insert(responses)
def __init__(self, accountID, orderID, data):
'Instantiate an OrderCreate request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the order to perform the request on.\n\n data : JSON (required)\n json orderbody to send\n\n\n Orderbody example::\n\n {_v3_accounts_accountID_order_clientextensions_body}\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderClientExtensions(accountID, orderID, data=data)\n >>> client.request(r)\n >>> print r.response\n\n ::\n\n {_v3_accounts_accountID_order_clientextensions_resp}\n\n '
super(OrderClientExtensions, self).__init__(accountID, orderID)
self.data = data | -7,689,243,906,922,399,000 | Instantiate an OrderCreate request.
Parameters
----------
accountID : string (required)
id of the account to perform the request on.
orderID : string (required)
id of the order to perform the request on.
data : JSON (required)
json orderbody to send
Orderbody example::
{_v3_accounts_accountID_order_clientextensions_body}
>>> import oandapyV20
>>> import oandapyV20.endpoints.orders as orders
>>> client = oandapyV20.API(access_token=...)
>>> r = orders.OrderClientExtensions(accountID, orderID, data=data)
>>> client.request(r)
>>> print r.response
::
{_v3_accounts_accountID_order_clientextensions_resp} | oandapyV20/endpoints/orders.py | __init__ | Milad137/oanda-api-v20 | python | @dyndoc_insert(responses)
def __init__(self, accountID, orderID, data):
'Instantiate an OrderCreate request.\n\n Parameters\n ----------\n accountID : string (required)\n id of the account to perform the request on.\n\n orderID : string (required)\n id of the order to perform the request on.\n\n data : JSON (required)\n json orderbody to send\n\n\n Orderbody example::\n\n {_v3_accounts_accountID_order_clientextensions_body}\n\n >>> import oandapyV20\n >>> import oandapyV20.endpoints.orders as orders\n >>> client = oandapyV20.API(access_token=...)\n >>> r = orders.OrderClientExtensions(accountID, orderID, data=data)\n >>> client.request(r)\n >>> print r.response\n\n ::\n\n {_v3_accounts_accountID_order_clientextensions_resp}\n\n '
super(OrderClientExtensions, self).__init__(accountID, orderID)
self.data = data |
def testFtrlWithL1_L2_L2Shrinkage(self):
'Test the new FTRL op with support for l2 shrinkage.\n\n The addition of this parameter which places a constant pressure on weights\n towards the origin causes the gradient descent trajectory to differ. The\n weights will tend to have smaller magnitudes with this parameter set.\n '
for dtype in self.float_types:
with self.test_session(), self.test_scope():
var0 = resource_variable_ops.ResourceVariable([1.0, 2.0], dtype=dtype)
var1 = resource_variable_ops.ResourceVariable([4.0, 3.0], dtype=dtype)
grads0 = constant_op.constant([0.1, 0.2], dtype=dtype)
grads1 = constant_op.constant([0.01, 0.02], dtype=dtype)
opt = ftrl.FtrlOptimizer(3.0, initial_accumulator_value=0.1, l1_regularization_strength=0.001, l2_regularization_strength=2.0, l2_shrinkage_regularization_strength=0.1)
ftrl_update = opt.apply_gradients(zip([grads0, grads1], [var0, var1]))
variables.global_variables_initializer().run()
self.assertAllClose([1.0, 2.0], var0.eval())
self.assertAllClose([4.0, 3.0], var1.eval())
for _ in range(10):
ftrl_update.run()
self.assertAllClose(np.array([(- 0.21931979), (- 0.40642974)]), var0.eval())
self.assertAllClose(np.array([(- 0.0282721), (- 0.07188385)]), var1.eval()) | -2,718,436,878,333,653,500 | Test the new FTRL op with support for l2 shrinkage.
The addition of this parameter which places a constant pressure on weights
towards the origin causes the gradient descent trajectory to differ. The
weights will tend to have smaller magnitudes with this parameter set. | tensorflow/compiler/tests/ftrl_test.py | testFtrlWithL1_L2_L2Shrinkage | 18802459097/tensorflow | python | def testFtrlWithL1_L2_L2Shrinkage(self):
'Test the new FTRL op with support for l2 shrinkage.\n\n The addition of this parameter which places a constant pressure on weights\n towards the origin causes the gradient descent trajectory to differ. The\n weights will tend to have smaller magnitudes with this parameter set.\n '
for dtype in self.float_types:
with self.test_session(), self.test_scope():
var0 = resource_variable_ops.ResourceVariable([1.0, 2.0], dtype=dtype)
var1 = resource_variable_ops.ResourceVariable([4.0, 3.0], dtype=dtype)
grads0 = constant_op.constant([0.1, 0.2], dtype=dtype)
grads1 = constant_op.constant([0.01, 0.02], dtype=dtype)
opt = ftrl.FtrlOptimizer(3.0, initial_accumulator_value=0.1, l1_regularization_strength=0.001, l2_regularization_strength=2.0, l2_shrinkage_regularization_strength=0.1)
ftrl_update = opt.apply_gradients(zip([grads0, grads1], [var0, var1]))
variables.global_variables_initializer().run()
self.assertAllClose([1.0, 2.0], var0.eval())
self.assertAllClose([4.0, 3.0], var1.eval())
for _ in range(10):
ftrl_update.run()
self.assertAllClose(np.array([(- 0.21931979), (- 0.40642974)]), var0.eval())
self.assertAllClose(np.array([(- 0.0282721), (- 0.07188385)]), var1.eval()) |
def get_kobo_params():
'Collect and validate request parameters and environment variables.'
kobo_username = getenv('KOBO_USERNAME')
if (kobo_username is None):
raise InternalServerError('Missing backend parameter: KOBO_USERNAME')
kobo_pw = getenv('KOBO_PW')
if (kobo_pw is None):
raise InternalServerError('Missing backend parameter: KOBO_PW')
form_name = request.args.get('formName')
if (form_name is None):
raise BadRequest('Missing query parameter: formName')
datetime_field = request.args.get('datetimeField')
if (datetime_field is None):
raise BadRequest('Missing parameter datetimeField')
geom_field = request.args.get('geomField')
if (geom_field is None):
raise BadRequest('Missing parameter: geomField')
filters = {}
filters_params = request.args.get('filters', None)
if (filters_params is not None):
filters = dict([f.split('=') for f in filters_params.split(',')])
form_fields = dict(name=form_name, datetime=datetime_field, geom=geom_field, filters=filters)
auth = (kobo_username, kobo_pw)
return (auth, form_fields) | -3,169,019,911,052,397,600 | Collect and validate request parameters and environment variables. | api-flask/app/kobo.py | get_kobo_params | tdlinh2712/prism-frontend | python | def get_kobo_params():
kobo_username = getenv('KOBO_USERNAME')
if (kobo_username is None):
raise InternalServerError('Missing backend parameter: KOBO_USERNAME')
kobo_pw = getenv('KOBO_PW')
if (kobo_pw is None):
raise InternalServerError('Missing backend parameter: KOBO_PW')
form_name = request.args.get('formName')
if (form_name is None):
raise BadRequest('Missing query parameter: formName')
datetime_field = request.args.get('datetimeField')
if (datetime_field is None):
raise BadRequest('Missing parameter datetimeField')
geom_field = request.args.get('geomField')
if (geom_field is None):
raise BadRequest('Missing parameter: geomField')
filters = {}
filters_params = request.args.get('filters', None)
if (filters_params is not None):
filters = dict([f.split('=') for f in filters_params.split(',')])
form_fields = dict(name=form_name, datetime=datetime_field, geom=geom_field, filters=filters)
auth = (kobo_username, kobo_pw)
return (auth, form_fields) |
def parse_form_field(value: str, field_type: str):
'Parse strings into type according to field_type provided.'
if (field_type == 'decimal'):
return float(value)
elif (field_type == 'integer'):
return int(value)
elif (field_type in ('datetime', 'date')):
return dtparser(value).astimezone(timezone.utc)
elif (field_type == 'geopoint'):
(lat, lon, _, _) = value.split(' ')
return {'lat': float(lat), 'lon': float(lon)}
else:
return value | -5,969,164,898,404,290,000 | Parse strings into type according to field_type provided. | api-flask/app/kobo.py | parse_form_field | tdlinh2712/prism-frontend | python | def parse_form_field(value: str, field_type: str):
if (field_type == 'decimal'):
return float(value)
elif (field_type == 'integer'):
return int(value)
elif (field_type in ('datetime', 'date')):
return dtparser(value).astimezone(timezone.utc)
elif (field_type == 'geopoint'):
(lat, lon, _, _) = value.split(' ')
return {'lat': float(lat), 'lon': float(lon)}
else:
return value |
def parse_form_response(form_dict: Dict[(str, str)], form_fields: Dict[(str, str)], labels: List[str]):
'Transform a Kobo form dictionary into a format that is used by the frontend.'
form_data = {k: parse_form_field(form_dict.get(k), v) for (k, v) in labels.items() if (k not in (form_fields.get('geom'), form_fields.get('datetime')))}
datetime_field = form_fields.get('datetime')
datetime_value = parse_form_field(form_dict.get(datetime_field), labels.get(datetime_field))
geom_field = form_fields.get('geom')
latlon_dict = parse_form_field(form_dict.get(geom_field), labels.get(geom_field))
status = form_dict.get('_validation_status').get('label', None)
form_data = {**form_data, **latlon_dict, 'date': datetime_value, 'status': status}
return form_data | -644,999,556,958,999,800 | Transform a Kobo form dictionary into a format that is used by the frontend. | api-flask/app/kobo.py | parse_form_response | tdlinh2712/prism-frontend | python | def parse_form_response(form_dict: Dict[(str, str)], form_fields: Dict[(str, str)], labels: List[str]):
form_data = {k: parse_form_field(form_dict.get(k), v) for (k, v) in labels.items() if (k not in (form_fields.get('geom'), form_fields.get('datetime')))}
datetime_field = form_fields.get('datetime')
datetime_value = parse_form_field(form_dict.get(datetime_field), labels.get(datetime_field))
geom_field = form_fields.get('geom')
latlon_dict = parse_form_field(form_dict.get(geom_field), labels.get(geom_field))
status = form_dict.get('_validation_status').get('label', None)
form_data = {**form_data, **latlon_dict, 'date': datetime_value, 'status': status}
return form_data |
def parse_datetime_params():
'Transform into datetime objects used for filtering form responses.'
begin_datetime_str = request.args.get('beginDateTime', '2000-01-01')
begin_datetime = dtparser(begin_datetime_str).replace(tzinfo=timezone.utc)
end_datetime_str = request.args.get('endDateTime')
if (end_datetime_str is not None):
end_datetime = dtparser(end_datetime_str)
else:
end_datetime = (datetime.now() + timedelta(days=(365 * 10)))
end_datetime = end_datetime.replace(tzinfo=timezone.utc)
if (end_datetime == begin_datetime):
end_datetime = (end_datetime + timedelta(days=1))
if (begin_datetime > end_datetime):
raise BadRequest('beginDateTime value must be lower than endDateTime')
return (begin_datetime, end_datetime) | -751,207,156,373,208,200 | Transform into datetime objects used for filtering form responses. | api-flask/app/kobo.py | parse_datetime_params | tdlinh2712/prism-frontend | python | def parse_datetime_params():
begin_datetime_str = request.args.get('beginDateTime', '2000-01-01')
begin_datetime = dtparser(begin_datetime_str).replace(tzinfo=timezone.utc)
end_datetime_str = request.args.get('endDateTime')
if (end_datetime_str is not None):
end_datetime = dtparser(end_datetime_str)
else:
end_datetime = (datetime.now() + timedelta(days=(365 * 10)))
end_datetime = end_datetime.replace(tzinfo=timezone.utc)
if (end_datetime == begin_datetime):
end_datetime = (end_datetime + timedelta(days=1))
if (begin_datetime > end_datetime):
raise BadRequest('beginDateTime value must be lower than endDateTime')
return (begin_datetime, end_datetime) |
def get_responses_from_kobo(auth, form_name):
'\n Request kobo api to collect all the information related to a form.\n\n Also, retrieve the form responses for parsing and filtering.\n '
form_url = request.args.get('koboUrl')
if (form_url is None):
raise BadRequest('Missing parameter koboUrl')
resp = requests.get(form_url, auth=auth)
resp.raise_for_status()
kobo_user_metadata = resp.json()
forms_iterator = (d for d in kobo_user_metadata.get('results') if (d.get('name') == form_name))
form_metadata = next(forms_iterator, None)
if (form_metadata is None):
raise NotFound('Form not found')
resp = requests.get(form_metadata.get('url'), auth=auth)
resp.raise_for_status()
form_metadata = resp.json()
form_labels = {f.get('$autoname'): f.get('type') for f in form_metadata.get('content').get('survey')}
resp = requests.get(form_metadata.get('data'), auth=auth)
resp.raise_for_status()
form_responses = resp.json().get('results')
return (form_responses, form_labels) | 1,817,375,612,146,250,800 | Request kobo api to collect all the information related to a form.
Also, retrieve the form responses for parsing and filtering. | api-flask/app/kobo.py | get_responses_from_kobo | tdlinh2712/prism-frontend | python | def get_responses_from_kobo(auth, form_name):
'\n Request kobo api to collect all the information related to a form.\n\n Also, retrieve the form responses for parsing and filtering.\n '
form_url = request.args.get('koboUrl')
if (form_url is None):
raise BadRequest('Missing parameter koboUrl')
resp = requests.get(form_url, auth=auth)
resp.raise_for_status()
kobo_user_metadata = resp.json()
forms_iterator = (d for d in kobo_user_metadata.get('results') if (d.get('name') == form_name))
form_metadata = next(forms_iterator, None)
if (form_metadata is None):
raise NotFound('Form not found')
resp = requests.get(form_metadata.get('url'), auth=auth)
resp.raise_for_status()
form_metadata = resp.json()
form_labels = {f.get('$autoname'): f.get('type') for f in form_metadata.get('content').get('survey')}
resp = requests.get(form_metadata.get('data'), auth=auth)
resp.raise_for_status()
form_responses = resp.json().get('results')
return (form_responses, form_labels) |
def get_form_responses(begin_datetime, end_datetime):
'Get all form responses using Kobo api.'
(auth, form_fields) = get_kobo_params()
(form_responses, form_labels) = get_responses_from_kobo(auth, form_fields.get('name'))
forms = [parse_form_response(f, form_fields, form_labels) for f in form_responses]
filtered_forms = []
for form in forms:
date_value = form.get('date')
conditions = [(form.get(k) == v) for (k, v) in form_fields.get('filters').items()]
conditions.append((begin_datetime <= date_value))
conditions.append((date_value < end_datetime))
if (all(conditions) is False):
continue
filtered_forms.append(form)
sorted_forms = sorted(filtered_forms, key=(lambda x: x.get('date')))
sorted_forms = [{**f, 'date': f.get('date').date().isoformat()} for f in sorted_forms]
return sorted_forms | 5,535,525,215,685,802,000 | Get all form responses using Kobo api. | api-flask/app/kobo.py | get_form_responses | tdlinh2712/prism-frontend | python | def get_form_responses(begin_datetime, end_datetime):
(auth, form_fields) = get_kobo_params()
(form_responses, form_labels) = get_responses_from_kobo(auth, form_fields.get('name'))
forms = [parse_form_response(f, form_fields, form_labels) for f in form_responses]
filtered_forms = []
for form in forms:
date_value = form.get('date')
conditions = [(form.get(k) == v) for (k, v) in form_fields.get('filters').items()]
conditions.append((begin_datetime <= date_value))
conditions.append((date_value < end_datetime))
if (all(conditions) is False):
continue
filtered_forms.append(form)
sorted_forms = sorted(filtered_forms, key=(lambda x: x.get('date')))
sorted_forms = [{**f, 'date': f.get('date').date().isoformat()} for f in sorted_forms]
return sorted_forms |
def _get_flow_id(self):
'\n Getter method for flow_id, mapped from YANG variable /openflow_state/flow_id/flow_id (uint32)\n\n YANG Description: Flow ID\n '
return self.__flow_id | -6,157,903,769,016,702,000 | Getter method for flow_id, mapped from YANG variable /openflow_state/flow_id/flow_id (uint32)
YANG Description: Flow ID | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_flow_id | extremenetworks/pybind | python | def _get_flow_id(self):
'\n Getter method for flow_id, mapped from YANG variable /openflow_state/flow_id/flow_id (uint32)\n\n YANG Description: Flow ID\n '
return self.__flow_id |
def _set_flow_id(self, v, load=False):
'\n Setter method for flow_id, mapped from YANG variable /openflow_state/flow_id/flow_id (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_flow_id is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_flow_id() directly.\n\n YANG Description: Flow ID\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='flow-id', rest_name='flow-id', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'flow_id must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="flow-id", rest_name="flow-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__flow_id = t
if hasattr(self, '_set'):
self._set() | -2,853,245,355,925,875,000 | Setter method for flow_id, mapped from YANG variable /openflow_state/flow_id/flow_id (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_flow_id is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_flow_id() directly.
YANG Description: Flow ID | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_flow_id | extremenetworks/pybind | python | def _set_flow_id(self, v, load=False):
'\n Setter method for flow_id, mapped from YANG variable /openflow_state/flow_id/flow_id (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_flow_id is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_flow_id() directly.\n\n YANG Description: Flow ID\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='flow-id', rest_name='flow-id', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'flow_id must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="flow-id", rest_name="flow-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__flow_id = t
if hasattr(self, '_set'):
self._set() |
def _get_priority(self):
'\n Getter method for priority, mapped from YANG variable /openflow_state/flow_id/priority (uint32)\n\n YANG Description: Priority\n '
return self.__priority | 632,960,764,056,654,000 | Getter method for priority, mapped from YANG variable /openflow_state/flow_id/priority (uint32)
YANG Description: Priority | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_priority | extremenetworks/pybind | python | def _get_priority(self):
'\n Getter method for priority, mapped from YANG variable /openflow_state/flow_id/priority (uint32)\n\n YANG Description: Priority\n '
return self.__priority |
def _set_priority(self, v, load=False):
'\n Setter method for priority, mapped from YANG variable /openflow_state/flow_id/priority (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_priority is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_priority() directly.\n\n YANG Description: Priority\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='priority', rest_name='priority', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'priority must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="priority", rest_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__priority = t
if hasattr(self, '_set'):
self._set() | -312,276,743,791,682,750 | Setter method for priority, mapped from YANG variable /openflow_state/flow_id/priority (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_priority is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_priority() directly.
YANG Description: Priority | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_priority | extremenetworks/pybind | python | def _set_priority(self, v, load=False):
'\n Setter method for priority, mapped from YANG variable /openflow_state/flow_id/priority (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_priority is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_priority() directly.\n\n YANG Description: Priority\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='priority', rest_name='priority', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'priority must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="priority", rest_name="priority", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__priority = t
if hasattr(self, '_set'):
self._set() |
def _get_status(self):
'\n Getter method for status, mapped from YANG variable /openflow_state/flow_id/status (flow-status)\n\n YANG Description: Status\n '
return self.__status | 7,149,983,244,379,752,000 | Getter method for status, mapped from YANG variable /openflow_state/flow_id/status (flow-status)
YANG Description: Status | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_status | extremenetworks/pybind | python | def _get_status(self):
'\n Getter method for status, mapped from YANG variable /openflow_state/flow_id/status (flow-status)\n\n YANG Description: Status\n '
return self.__status |
def _set_status(self, v, load=False):
'\n Setter method for status, mapped from YANG variable /openflow_state/flow_id/status (flow-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_status is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_status() directly.\n\n YANG Description: Status\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=unicode, restriction_type='dict_key', restriction_arg={u'dcm-flow-pending-modify': {'value': 3}, u'dcm-flow-programmed': {'value': 4}, u'dcm-flow-pending-add': {'value': 1}, u'dcm-flow-pending-delete': {'value': 2}, u'dcm-flow-not-programmed': {'value': 0}}), is_leaf=True, yang_name='status', rest_name='status', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='flow-status', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'status must be of a type compatible with flow-status', 'defined-type': 'brocade-openflow-operational:flow-status', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u\'dcm-flow-pending-modify\': {\'value\': 3}, u\'dcm-flow-programmed\': {\'value\': 4}, u\'dcm-flow-pending-add\': {\'value\': 1}, u\'dcm-flow-pending-delete\': {\'value\': 2}, u\'dcm-flow-not-programmed\': {\'value\': 0}},), is_leaf=True, yang_name="status", rest_name="status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'flow-status\', is_config=False)'})
self.__status = t
if hasattr(self, '_set'):
self._set() | 3,149,202,508,963,547,000 | Setter method for status, mapped from YANG variable /openflow_state/flow_id/status (flow-status)
If this variable is read-only (config: false) in the
source YANG file, then _set_status is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_status() directly.
YANG Description: Status | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_status | extremenetworks/pybind | python | def _set_status(self, v, load=False):
'\n Setter method for status, mapped from YANG variable /openflow_state/flow_id/status (flow-status)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_status is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_status() directly.\n\n YANG Description: Status\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=unicode, restriction_type='dict_key', restriction_arg={u'dcm-flow-pending-modify': {'value': 3}, u'dcm-flow-programmed': {'value': 4}, u'dcm-flow-pending-add': {'value': 1}, u'dcm-flow-pending-delete': {'value': 2}, u'dcm-flow-not-programmed': {'value': 0}}), is_leaf=True, yang_name='status', rest_name='status', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='flow-status', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'status must be of a type compatible with flow-status', 'defined-type': 'brocade-openflow-operational:flow-status', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=unicode, restriction_type="dict_key", restriction_arg={u\'dcm-flow-pending-modify\': {\'value\': 3}, u\'dcm-flow-programmed\': {\'value\': 4}, u\'dcm-flow-pending-add\': {\'value\': 1}, u\'dcm-flow-pending-delete\': {\'value\': 2}, u\'dcm-flow-not-programmed\': {\'value\': 0}},), is_leaf=True, yang_name="status", rest_name="status", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'flow-status\', is_config=False)'})
self.__status = t
if hasattr(self, '_set'):
self._set() |
def _get_in_port(self):
'\n Getter method for in_port, mapped from YANG variable /openflow_state/flow_id/in_port (string)\n\n YANG Description: In Port\n '
return self.__in_port | -8,342,870,334,417,851,000 | Getter method for in_port, mapped from YANG variable /openflow_state/flow_id/in_port (string)
YANG Description: In Port | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_in_port | extremenetworks/pybind | python | def _get_in_port(self):
'\n Getter method for in_port, mapped from YANG variable /openflow_state/flow_id/in_port (string)\n\n YANG Description: In Port\n '
return self.__in_port |
def _set_in_port(self, v, load=False):
'\n Setter method for in_port, mapped from YANG variable /openflow_state/flow_id/in_port (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_in_port is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_in_port() directly.\n\n YANG Description: In Port\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='in-port', rest_name='in-port', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'in_port must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="in-port", rest_name="in-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__in_port = t
if hasattr(self, '_set'):
self._set() | -6,384,135,164,691,268,000 | Setter method for in_port, mapped from YANG variable /openflow_state/flow_id/in_port (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_in_port is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_in_port() directly.
YANG Description: In Port | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_in_port | extremenetworks/pybind | python | def _set_in_port(self, v, load=False):
'\n Setter method for in_port, mapped from YANG variable /openflow_state/flow_id/in_port (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_in_port is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_in_port() directly.\n\n YANG Description: In Port\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='in-port', rest_name='in-port', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'in_port must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="in-port", rest_name="in-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__in_port = t
if hasattr(self, '_set'):
self._set() |
def _get_in_vlan(self):
'\n Getter method for in_vlan, mapped from YANG variable /openflow_state/flow_id/in_vlan (string)\n\n YANG Description: In Vlan\n '
return self.__in_vlan | -877,273,164,347,774,500 | Getter method for in_vlan, mapped from YANG variable /openflow_state/flow_id/in_vlan (string)
YANG Description: In Vlan | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_in_vlan | extremenetworks/pybind | python | def _get_in_vlan(self):
'\n Getter method for in_vlan, mapped from YANG variable /openflow_state/flow_id/in_vlan (string)\n\n YANG Description: In Vlan\n '
return self.__in_vlan |
def _set_in_vlan(self, v, load=False):
'\n Setter method for in_vlan, mapped from YANG variable /openflow_state/flow_id/in_vlan (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_in_vlan is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_in_vlan() directly.\n\n YANG Description: In Vlan\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='in-vlan', rest_name='in-vlan', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'in_vlan must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="in-vlan", rest_name="in-vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__in_vlan = t
if hasattr(self, '_set'):
self._set() | 2,444,345,414,555,727,000 | Setter method for in_vlan, mapped from YANG variable /openflow_state/flow_id/in_vlan (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_in_vlan is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_in_vlan() directly.
YANG Description: In Vlan | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_in_vlan | extremenetworks/pybind | python | def _set_in_vlan(self, v, load=False):
'\n Setter method for in_vlan, mapped from YANG variable /openflow_state/flow_id/in_vlan (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_in_vlan is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_in_vlan() directly.\n\n YANG Description: In Vlan\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='in-vlan', rest_name='in-vlan', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'in_vlan must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="in-vlan", rest_name="in-vlan", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__in_vlan = t
if hasattr(self, '_set'):
self._set() |
def _get_source_mac(self):
'\n Getter method for source_mac, mapped from YANG variable /openflow_state/flow_id/source_mac (string)\n\n YANG Description: Source Mac\n '
return self.__source_mac | -8,688,223,893,635,279,000 | Getter method for source_mac, mapped from YANG variable /openflow_state/flow_id/source_mac (string)
YANG Description: Source Mac | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_source_mac | extremenetworks/pybind | python | def _get_source_mac(self):
'\n Getter method for source_mac, mapped from YANG variable /openflow_state/flow_id/source_mac (string)\n\n YANG Description: Source Mac\n '
return self.__source_mac |
def _set_source_mac(self, v, load=False):
'\n Setter method for source_mac, mapped from YANG variable /openflow_state/flow_id/source_mac (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_mac is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_mac() directly.\n\n YANG Description: Source Mac\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-mac', rest_name='source-mac', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_mac must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-mac", rest_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_mac = t
if hasattr(self, '_set'):
self._set() | -2,431,568,166,369,310,000 | Setter method for source_mac, mapped from YANG variable /openflow_state/flow_id/source_mac (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_source_mac is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_source_mac() directly.
YANG Description: Source Mac | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_source_mac | extremenetworks/pybind | python | def _set_source_mac(self, v, load=False):
'\n Setter method for source_mac, mapped from YANG variable /openflow_state/flow_id/source_mac (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_mac is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_mac() directly.\n\n YANG Description: Source Mac\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-mac', rest_name='source-mac', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_mac must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-mac", rest_name="source-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_mac = t
if hasattr(self, '_set'):
self._set() |
def _get_destination_mac(self):
'\n Getter method for destination_mac, mapped from YANG variable /openflow_state/flow_id/destination_mac (string)\n\n YANG Description: Destination Mac\n '
return self.__destination_mac | -4,720,345,164,848,620,000 | Getter method for destination_mac, mapped from YANG variable /openflow_state/flow_id/destination_mac (string)
YANG Description: Destination Mac | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_destination_mac | extremenetworks/pybind | python | def _get_destination_mac(self):
'\n Getter method for destination_mac, mapped from YANG variable /openflow_state/flow_id/destination_mac (string)\n\n YANG Description: Destination Mac\n '
return self.__destination_mac |
def _set_destination_mac(self, v, load=False):
'\n Setter method for destination_mac, mapped from YANG variable /openflow_state/flow_id/destination_mac (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_mac is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_mac() directly.\n\n YANG Description: Destination Mac\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-mac', rest_name='destination-mac', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_mac must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-mac", rest_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_mac = t
if hasattr(self, '_set'):
self._set() | 3,574,629,460,439,213,600 | Setter method for destination_mac, mapped from YANG variable /openflow_state/flow_id/destination_mac (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_destination_mac is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_destination_mac() directly.
YANG Description: Destination Mac | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_destination_mac | extremenetworks/pybind | python | def _set_destination_mac(self, v, load=False):
'\n Setter method for destination_mac, mapped from YANG variable /openflow_state/flow_id/destination_mac (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_mac is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_mac() directly.\n\n YANG Description: Destination Mac\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-mac', rest_name='destination-mac', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_mac must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-mac", rest_name="destination-mac", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_mac = t
if hasattr(self, '_set'):
self._set() |
def _get_ether_type(self):
'\n Getter method for ether_type, mapped from YANG variable /openflow_state/flow_id/ether_type (string)\n\n YANG Description: Ether type\n '
return self.__ether_type | -444,336,225,625,308,740 | Getter method for ether_type, mapped from YANG variable /openflow_state/flow_id/ether_type (string)
YANG Description: Ether type | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_ether_type | extremenetworks/pybind | python | def _get_ether_type(self):
'\n Getter method for ether_type, mapped from YANG variable /openflow_state/flow_id/ether_type (string)\n\n YANG Description: Ether type\n '
return self.__ether_type |
def _set_ether_type(self, v, load=False):
'\n Setter method for ether_type, mapped from YANG variable /openflow_state/flow_id/ether_type (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ether_type is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ether_type() directly.\n\n YANG Description: Ether type\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='ether-type', rest_name='ether-type', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ether_type must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="ether-type", rest_name="ether-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__ether_type = t
if hasattr(self, '_set'):
self._set() | 4,291,829,622,368,241,000 | Setter method for ether_type, mapped from YANG variable /openflow_state/flow_id/ether_type (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_ether_type is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_ether_type() directly.
YANG Description: Ether type | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_ether_type | extremenetworks/pybind | python | def _set_ether_type(self, v, load=False):
'\n Setter method for ether_type, mapped from YANG variable /openflow_state/flow_id/ether_type (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ether_type is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ether_type() directly.\n\n YANG Description: Ether type\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='ether-type', rest_name='ether-type', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ether_type must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="ether-type", rest_name="ether-type", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__ether_type = t
if hasattr(self, '_set'):
self._set() |
def _get_ip_protocol(self):
'\n Getter method for ip_protocol, mapped from YANG variable /openflow_state/flow_id/ip_protocol (uint32)\n\n YANG Description: IP Protocol\n '
return self.__ip_protocol | -5,709,233,562,569,667,000 | Getter method for ip_protocol, mapped from YANG variable /openflow_state/flow_id/ip_protocol (uint32)
YANG Description: IP Protocol | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_ip_protocol | extremenetworks/pybind | python | def _get_ip_protocol(self):
'\n Getter method for ip_protocol, mapped from YANG variable /openflow_state/flow_id/ip_protocol (uint32)\n\n YANG Description: IP Protocol\n '
return self.__ip_protocol |
def _set_ip_protocol(self, v, load=False):
'\n Setter method for ip_protocol, mapped from YANG variable /openflow_state/flow_id/ip_protocol (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ip_protocol is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ip_protocol() directly.\n\n YANG Description: IP Protocol\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='ip-protocol', rest_name='ip-protocol', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ip_protocol must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="ip-protocol", rest_name="ip-protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__ip_protocol = t
if hasattr(self, '_set'):
self._set() | 2,429,333,674,418,785,000 | Setter method for ip_protocol, mapped from YANG variable /openflow_state/flow_id/ip_protocol (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_ip_protocol is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_ip_protocol() directly.
YANG Description: IP Protocol | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_ip_protocol | extremenetworks/pybind | python | def _set_ip_protocol(self, v, load=False):
'\n Setter method for ip_protocol, mapped from YANG variable /openflow_state/flow_id/ip_protocol (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ip_protocol is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ip_protocol() directly.\n\n YANG Description: IP Protocol\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='ip-protocol', rest_name='ip-protocol', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ip_protocol must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="ip-protocol", rest_name="ip-protocol", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__ip_protocol = t
if hasattr(self, '_set'):
self._set() |
def _get_ip_protocol_source_port(self):
'\n Getter method for ip_protocol_source_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_source_port (uint32)\n\n YANG Description: IP Protocol Source Port\n '
return self.__ip_protocol_source_port | -1,355,434,890,033,984,000 | Getter method for ip_protocol_source_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_source_port (uint32)
YANG Description: IP Protocol Source Port | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_ip_protocol_source_port | extremenetworks/pybind | python | def _get_ip_protocol_source_port(self):
'\n Getter method for ip_protocol_source_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_source_port (uint32)\n\n YANG Description: IP Protocol Source Port\n '
return self.__ip_protocol_source_port |
def _set_ip_protocol_source_port(self, v, load=False):
'\n Setter method for ip_protocol_source_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_source_port (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ip_protocol_source_port is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ip_protocol_source_port() directly.\n\n YANG Description: IP Protocol Source Port\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='ip-protocol-source-port', rest_name='ip-protocol-source-port', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ip_protocol_source_port must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="ip-protocol-source-port", rest_name="ip-protocol-source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__ip_protocol_source_port = t
if hasattr(self, '_set'):
self._set() | 974,157,560,077,153,200 | Setter method for ip_protocol_source_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_source_port (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_ip_protocol_source_port is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_ip_protocol_source_port() directly.
YANG Description: IP Protocol Source Port | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_ip_protocol_source_port | extremenetworks/pybind | python | def _set_ip_protocol_source_port(self, v, load=False):
'\n Setter method for ip_protocol_source_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_source_port (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ip_protocol_source_port is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ip_protocol_source_port() directly.\n\n YANG Description: IP Protocol Source Port\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='ip-protocol-source-port', rest_name='ip-protocol-source-port', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ip_protocol_source_port must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="ip-protocol-source-port", rest_name="ip-protocol-source-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__ip_protocol_source_port = t
if hasattr(self, '_set'):
self._set() |
def _get_ip_protocol_destination_port(self):
'\n Getter method for ip_protocol_destination_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_destination_port (uint32)\n\n YANG Description: IP Protocol Destination Port\n '
return self.__ip_protocol_destination_port | 8,928,770,330,786,560,000 | Getter method for ip_protocol_destination_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_destination_port (uint32)
YANG Description: IP Protocol Destination Port | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_ip_protocol_destination_port | extremenetworks/pybind | python | def _get_ip_protocol_destination_port(self):
'\n Getter method for ip_protocol_destination_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_destination_port (uint32)\n\n YANG Description: IP Protocol Destination Port\n '
return self.__ip_protocol_destination_port |
def _set_ip_protocol_destination_port(self, v, load=False):
'\n Setter method for ip_protocol_destination_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_destination_port (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ip_protocol_destination_port is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ip_protocol_destination_port() directly.\n\n YANG Description: IP Protocol Destination Port\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='ip-protocol-destination-port', rest_name='ip-protocol-destination-port', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ip_protocol_destination_port must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="ip-protocol-destination-port", rest_name="ip-protocol-destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__ip_protocol_destination_port = t
if hasattr(self, '_set'):
self._set() | 4,952,934,185,729,867,000 | Setter method for ip_protocol_destination_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_destination_port (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_ip_protocol_destination_port is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_ip_protocol_destination_port() directly.
YANG Description: IP Protocol Destination Port | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_ip_protocol_destination_port | extremenetworks/pybind | python | def _set_ip_protocol_destination_port(self, v, load=False):
'\n Setter method for ip_protocol_destination_port, mapped from YANG variable /openflow_state/flow_id/ip_protocol_destination_port (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_ip_protocol_destination_port is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_ip_protocol_destination_port() directly.\n\n YANG Description: IP Protocol Destination Port\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='ip-protocol-destination-port', rest_name='ip-protocol-destination-port', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'ip_protocol_destination_port must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="ip-protocol-destination-port", rest_name="ip-protocol-destination-port", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__ip_protocol_destination_port = t
if hasattr(self, '_set'):
self._set() |
def _get_source_ip(self):
'\n Getter method for source_ip, mapped from YANG variable /openflow_state/flow_id/source_ip (string)\n\n YANG Description: Source IPv4\n '
return self.__source_ip | -8,280,523,077,117,482,000 | Getter method for source_ip, mapped from YANG variable /openflow_state/flow_id/source_ip (string)
YANG Description: Source IPv4 | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_source_ip | extremenetworks/pybind | python | def _get_source_ip(self):
'\n Getter method for source_ip, mapped from YANG variable /openflow_state/flow_id/source_ip (string)\n\n YANG Description: Source IPv4\n '
return self.__source_ip |
def _set_source_ip(self, v, load=False):
'\n Setter method for source_ip, mapped from YANG variable /openflow_state/flow_id/source_ip (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_ip is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_ip() directly.\n\n YANG Description: Source IPv4\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-ip', rest_name='source-ip', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_ip must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-ip", rest_name="source-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_ip = t
if hasattr(self, '_set'):
self._set() | 2,223,453,135,218,639,400 | Setter method for source_ip, mapped from YANG variable /openflow_state/flow_id/source_ip (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_source_ip is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_source_ip() directly.
YANG Description: Source IPv4 | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_source_ip | extremenetworks/pybind | python | def _set_source_ip(self, v, load=False):
'\n Setter method for source_ip, mapped from YANG variable /openflow_state/flow_id/source_ip (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_ip is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_ip() directly.\n\n YANG Description: Source IPv4\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-ip', rest_name='source-ip', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_ip must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-ip", rest_name="source-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_ip = t
if hasattr(self, '_set'):
self._set() |
def _get_destination_ip(self):
'\n Getter method for destination_ip, mapped from YANG variable /openflow_state/flow_id/destination_ip (string)\n\n YANG Description: Destination IPv4\n '
return self.__destination_ip | -7,007,499,422,990,890,000 | Getter method for destination_ip, mapped from YANG variable /openflow_state/flow_id/destination_ip (string)
YANG Description: Destination IPv4 | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_destination_ip | extremenetworks/pybind | python | def _get_destination_ip(self):
'\n Getter method for destination_ip, mapped from YANG variable /openflow_state/flow_id/destination_ip (string)\n\n YANG Description: Destination IPv4\n '
return self.__destination_ip |
def _set_destination_ip(self, v, load=False):
'\n Setter method for destination_ip, mapped from YANG variable /openflow_state/flow_id/destination_ip (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_ip is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_ip() directly.\n\n YANG Description: Destination IPv4\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-ip', rest_name='destination-ip', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_ip must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-ip", rest_name="destination-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_ip = t
if hasattr(self, '_set'):
self._set() | 2,674,066,771,643,641,000 | Setter method for destination_ip, mapped from YANG variable /openflow_state/flow_id/destination_ip (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_destination_ip is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_destination_ip() directly.
YANG Description: Destination IPv4 | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_destination_ip | extremenetworks/pybind | python | def _set_destination_ip(self, v, load=False):
'\n Setter method for destination_ip, mapped from YANG variable /openflow_state/flow_id/destination_ip (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_ip is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_ip() directly.\n\n YANG Description: Destination IPv4\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-ip', rest_name='destination-ip', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_ip must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-ip", rest_name="destination-ip", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_ip = t
if hasattr(self, '_set'):
self._set() |
def _get_source_ipv6(self):
'\n Getter method for source_ipv6, mapped from YANG variable /openflow_state/flow_id/source_ipv6 (string)\n\n YANG Description: Source IPv6 Address\n '
return self.__source_ipv6 | -2,574,810,374,441,195,500 | Getter method for source_ipv6, mapped from YANG variable /openflow_state/flow_id/source_ipv6 (string)
YANG Description: Source IPv6 Address | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_source_ipv6 | extremenetworks/pybind | python | def _get_source_ipv6(self):
'\n Getter method for source_ipv6, mapped from YANG variable /openflow_state/flow_id/source_ipv6 (string)\n\n YANG Description: Source IPv6 Address\n '
return self.__source_ipv6 |
def _set_source_ipv6(self, v, load=False):
'\n Setter method for source_ipv6, mapped from YANG variable /openflow_state/flow_id/source_ipv6 (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_ipv6 is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_ipv6() directly.\n\n YANG Description: Source IPv6 Address\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-ipv6', rest_name='source-ipv6', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_ipv6 must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-ipv6", rest_name="source-ipv6", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_ipv6 = t
if hasattr(self, '_set'):
self._set() | 4,941,136,100,604,586,000 | Setter method for source_ipv6, mapped from YANG variable /openflow_state/flow_id/source_ipv6 (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_source_ipv6 is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_source_ipv6() directly.
YANG Description: Source IPv6 Address | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_source_ipv6 | extremenetworks/pybind | python | def _set_source_ipv6(self, v, load=False):
'\n Setter method for source_ipv6, mapped from YANG variable /openflow_state/flow_id/source_ipv6 (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_ipv6 is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_ipv6() directly.\n\n YANG Description: Source IPv6 Address\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-ipv6', rest_name='source-ipv6', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_ipv6 must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-ipv6", rest_name="source-ipv6", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_ipv6 = t
if hasattr(self, '_set'):
self._set() |
def _get_destination_ipv6(self):
'\n Getter method for destination_ipv6, mapped from YANG variable /openflow_state/flow_id/destination_ipv6 (string)\n\n YANG Description: Destination IPv6 Address\n '
return self.__destination_ipv6 | 6,918,354,571,444,669,000 | Getter method for destination_ipv6, mapped from YANG variable /openflow_state/flow_id/destination_ipv6 (string)
YANG Description: Destination IPv6 Address | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_destination_ipv6 | extremenetworks/pybind | python | def _get_destination_ipv6(self):
'\n Getter method for destination_ipv6, mapped from YANG variable /openflow_state/flow_id/destination_ipv6 (string)\n\n YANG Description: Destination IPv6 Address\n '
return self.__destination_ipv6 |
def _set_destination_ipv6(self, v, load=False):
'\n Setter method for destination_ipv6, mapped from YANG variable /openflow_state/flow_id/destination_ipv6 (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_ipv6 is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_ipv6() directly.\n\n YANG Description: Destination IPv6 Address\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-ipv6', rest_name='destination-ipv6', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_ipv6 must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-ipv6", rest_name="destination-ipv6", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_ipv6 = t
if hasattr(self, '_set'):
self._set() | -8,625,216,406,431,481,000 | Setter method for destination_ipv6, mapped from YANG variable /openflow_state/flow_id/destination_ipv6 (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_destination_ipv6 is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_destination_ipv6() directly.
YANG Description: Destination IPv6 Address | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_destination_ipv6 | extremenetworks/pybind | python | def _set_destination_ipv6(self, v, load=False):
'\n Setter method for destination_ipv6, mapped from YANG variable /openflow_state/flow_id/destination_ipv6 (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_ipv6 is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_ipv6() directly.\n\n YANG Description: Destination IPv6 Address\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-ipv6', rest_name='destination-ipv6', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_ipv6 must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-ipv6", rest_name="destination-ipv6", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_ipv6 = t
if hasattr(self, '_set'):
self._set() |
def _get_instructions(self):
'\n Getter method for instructions, mapped from YANG variable /openflow_state/flow_id/instructions (string)\n\n YANG Description: Instructions\n '
return self.__instructions | -8,994,117,927,952,133,000 | Getter method for instructions, mapped from YANG variable /openflow_state/flow_id/instructions (string)
YANG Description: Instructions | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_instructions | extremenetworks/pybind | python | def _get_instructions(self):
'\n Getter method for instructions, mapped from YANG variable /openflow_state/flow_id/instructions (string)\n\n YANG Description: Instructions\n '
return self.__instructions |
def _set_instructions(self, v, load=False):
'\n Setter method for instructions, mapped from YANG variable /openflow_state/flow_id/instructions (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_instructions is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_instructions() directly.\n\n YANG Description: Instructions\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='instructions', rest_name='instructions', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'instructions must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="instructions", rest_name="instructions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__instructions = t
if hasattr(self, '_set'):
self._set() | -7,356,461,651,462,580,000 | Setter method for instructions, mapped from YANG variable /openflow_state/flow_id/instructions (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_instructions is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_instructions() directly.
YANG Description: Instructions | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_instructions | extremenetworks/pybind | python | def _set_instructions(self, v, load=False):
'\n Setter method for instructions, mapped from YANG variable /openflow_state/flow_id/instructions (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_instructions is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_instructions() directly.\n\n YANG Description: Instructions\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='instructions', rest_name='instructions', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'instructions must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="instructions", rest_name="instructions", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__instructions = t
if hasattr(self, '_set'):
self._set() |
def _get_action_data(self):
'\n Getter method for action_data, mapped from YANG variable /openflow_state/flow_id/action_data (string)\n\n YANG Description: Action\n '
return self.__action_data | -2,758,257,760,480,369,700 | Getter method for action_data, mapped from YANG variable /openflow_state/flow_id/action_data (string)
YANG Description: Action | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_action_data | extremenetworks/pybind | python | def _get_action_data(self):
'\n Getter method for action_data, mapped from YANG variable /openflow_state/flow_id/action_data (string)\n\n YANG Description: Action\n '
return self.__action_data |
def _set_action_data(self, v, load=False):
'\n Setter method for action_data, mapped from YANG variable /openflow_state/flow_id/action_data (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_action_data is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_action_data() directly.\n\n YANG Description: Action\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='action-data', rest_name='action-data', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'action_data must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="action-data", rest_name="action-data", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__action_data = t
if hasattr(self, '_set'):
self._set() | -8,913,322,758,941,366,000 | Setter method for action_data, mapped from YANG variable /openflow_state/flow_id/action_data (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_action_data is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_action_data() directly.
YANG Description: Action | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_action_data | extremenetworks/pybind | python | def _set_action_data(self, v, load=False):
'\n Setter method for action_data, mapped from YANG variable /openflow_state/flow_id/action_data (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_action_data is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_action_data() directly.\n\n YANG Description: Action\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='action-data', rest_name='action-data', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'action_data must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="action-data", rest_name="action-data", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__action_data = t
if hasattr(self, '_set'):
self._set() |
def _get_meter_id(self):
'\n Getter method for meter_id, mapped from YANG variable /openflow_state/flow_id/meter_id (uint32)\n\n YANG Description: Meter id\n '
return self.__meter_id | -7,163,032,203,289,610,000 | Getter method for meter_id, mapped from YANG variable /openflow_state/flow_id/meter_id (uint32)
YANG Description: Meter id | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_meter_id | extremenetworks/pybind | python | def _get_meter_id(self):
'\n Getter method for meter_id, mapped from YANG variable /openflow_state/flow_id/meter_id (uint32)\n\n YANG Description: Meter id\n '
return self.__meter_id |
def _set_meter_id(self, v, load=False):
'\n Setter method for meter_id, mapped from YANG variable /openflow_state/flow_id/meter_id (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_meter_id is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_meter_id() directly.\n\n YANG Description: Meter id\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='meter-id', rest_name='meter-id', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'meter_id must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="meter-id", rest_name="meter-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__meter_id = t
if hasattr(self, '_set'):
self._set() | 327,952,477,212,025,660 | Setter method for meter_id, mapped from YANG variable /openflow_state/flow_id/meter_id (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_meter_id is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_meter_id() directly.
YANG Description: Meter id | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_meter_id | extremenetworks/pybind | python | def _set_meter_id(self, v, load=False):
'\n Setter method for meter_id, mapped from YANG variable /openflow_state/flow_id/meter_id (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_meter_id is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_meter_id() directly.\n\n YANG Description: Meter id\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='meter-id', rest_name='meter-id', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'meter_id must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="meter-id", rest_name="meter-id", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__meter_id = t
if hasattr(self, '_set'):
self._set() |
def _get_vlan_upbits(self):
'\n Getter method for vlan_upbits, mapped from YANG variable /openflow_state/flow_id/vlan_upbits (uint32)\n\n YANG Description: Vlan Priority\n '
return self.__vlan_upbits | 1,948,003,606,078,124,000 | Getter method for vlan_upbits, mapped from YANG variable /openflow_state/flow_id/vlan_upbits (uint32)
YANG Description: Vlan Priority | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_vlan_upbits | extremenetworks/pybind | python | def _get_vlan_upbits(self):
'\n Getter method for vlan_upbits, mapped from YANG variable /openflow_state/flow_id/vlan_upbits (uint32)\n\n YANG Description: Vlan Priority\n '
return self.__vlan_upbits |
def _set_vlan_upbits(self, v, load=False):
'\n Setter method for vlan_upbits, mapped from YANG variable /openflow_state/flow_id/vlan_upbits (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_vlan_upbits is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_vlan_upbits() directly.\n\n YANG Description: Vlan Priority\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='vlan-upbits', rest_name='vlan-upbits', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'vlan_upbits must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="vlan-upbits", rest_name="vlan-upbits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__vlan_upbits = t
if hasattr(self, '_set'):
self._set() | 7,719,256,718,277,205,000 | Setter method for vlan_upbits, mapped from YANG variable /openflow_state/flow_id/vlan_upbits (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_vlan_upbits is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_vlan_upbits() directly.
YANG Description: Vlan Priority | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_vlan_upbits | extremenetworks/pybind | python | def _set_vlan_upbits(self, v, load=False):
'\n Setter method for vlan_upbits, mapped from YANG variable /openflow_state/flow_id/vlan_upbits (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_vlan_upbits is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_vlan_upbits() directly.\n\n YANG Description: Vlan Priority\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='vlan-upbits', rest_name='vlan-upbits', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'vlan_upbits must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="vlan-upbits", rest_name="vlan-upbits", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__vlan_upbits = t
if hasattr(self, '_set'):
self._set() |
def _get_nw_tos(self):
'\n Getter method for nw_tos, mapped from YANG variable /openflow_state/flow_id/nw_tos (uint32)\n\n YANG Description: IP DSCP\n '
return self.__nw_tos | 7,471,850,070,572,988,000 | Getter method for nw_tos, mapped from YANG variable /openflow_state/flow_id/nw_tos (uint32)
YANG Description: IP DSCP | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_nw_tos | extremenetworks/pybind | python | def _get_nw_tos(self):
'\n Getter method for nw_tos, mapped from YANG variable /openflow_state/flow_id/nw_tos (uint32)\n\n YANG Description: IP DSCP\n '
return self.__nw_tos |
def _set_nw_tos(self, v, load=False):
'\n Setter method for nw_tos, mapped from YANG variable /openflow_state/flow_id/nw_tos (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_nw_tos is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_nw_tos() directly.\n\n YANG Description: IP DSCP\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='nw-tos', rest_name='nw-tos', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'nw_tos must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="nw-tos", rest_name="nw-tos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__nw_tos = t
if hasattr(self, '_set'):
self._set() | -1,019,855,765,956,523,900 | Setter method for nw_tos, mapped from YANG variable /openflow_state/flow_id/nw_tos (uint32)
If this variable is read-only (config: false) in the
source YANG file, then _set_nw_tos is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_nw_tos() directly.
YANG Description: IP DSCP | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_nw_tos | extremenetworks/pybind | python | def _set_nw_tos(self, v, load=False):
'\n Setter method for nw_tos, mapped from YANG variable /openflow_state/flow_id/nw_tos (uint32)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_nw_tos is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_nw_tos() directly.\n\n YANG Description: IP DSCP\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..4294967295']}, int_size=32), is_leaf=True, yang_name='nw-tos', rest_name='nw-tos', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint32', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'nw_tos must be of a type compatible with uint32', 'defined-type': 'uint32', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..4294967295\']}, int_size=32), is_leaf=True, yang_name="nw-tos", rest_name="nw-tos", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint32\', is_config=False)'})
self.__nw_tos = t
if hasattr(self, '_set'):
self._set() |
def _get_source_ip_mask(self):
'\n Getter method for source_ip_mask, mapped from YANG variable /openflow_state/flow_id/source_ip_mask (string)\n\n YANG Description: Source IPv4 Mask\n '
return self.__source_ip_mask | -51,624,655,546,769,384 | Getter method for source_ip_mask, mapped from YANG variable /openflow_state/flow_id/source_ip_mask (string)
YANG Description: Source IPv4 Mask | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_source_ip_mask | extremenetworks/pybind | python | def _get_source_ip_mask(self):
'\n Getter method for source_ip_mask, mapped from YANG variable /openflow_state/flow_id/source_ip_mask (string)\n\n YANG Description: Source IPv4 Mask\n '
return self.__source_ip_mask |
def _set_source_ip_mask(self, v, load=False):
'\n Setter method for source_ip_mask, mapped from YANG variable /openflow_state/flow_id/source_ip_mask (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_ip_mask is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_ip_mask() directly.\n\n YANG Description: Source IPv4 Mask\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-ip-mask', rest_name='source-ip-mask', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_ip_mask must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-ip-mask", rest_name="source-ip-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_ip_mask = t
if hasattr(self, '_set'):
self._set() | 3,063,224,481,659,544,600 | Setter method for source_ip_mask, mapped from YANG variable /openflow_state/flow_id/source_ip_mask (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_source_ip_mask is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_source_ip_mask() directly.
YANG Description: Source IPv4 Mask | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_source_ip_mask | extremenetworks/pybind | python | def _set_source_ip_mask(self, v, load=False):
'\n Setter method for source_ip_mask, mapped from YANG variable /openflow_state/flow_id/source_ip_mask (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_source_ip_mask is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_source_ip_mask() directly.\n\n YANG Description: Source IPv4 Mask\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='source-ip-mask', rest_name='source-ip-mask', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'source_ip_mask must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="source-ip-mask", rest_name="source-ip-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__source_ip_mask = t
if hasattr(self, '_set'):
self._set() |
def _get_destination_ip_mask(self):
'\n Getter method for destination_ip_mask, mapped from YANG variable /openflow_state/flow_id/destination_ip_mask (string)\n\n YANG Description: Destination IPv4 Mask\n '
return self.__destination_ip_mask | 2,633,321,571,595,034,600 | Getter method for destination_ip_mask, mapped from YANG variable /openflow_state/flow_id/destination_ip_mask (string)
YANG Description: Destination IPv4 Mask | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_destination_ip_mask | extremenetworks/pybind | python | def _get_destination_ip_mask(self):
'\n Getter method for destination_ip_mask, mapped from YANG variable /openflow_state/flow_id/destination_ip_mask (string)\n\n YANG Description: Destination IPv4 Mask\n '
return self.__destination_ip_mask |
def _set_destination_ip_mask(self, v, load=False):
'\n Setter method for destination_ip_mask, mapped from YANG variable /openflow_state/flow_id/destination_ip_mask (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_ip_mask is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_ip_mask() directly.\n\n YANG Description: Destination IPv4 Mask\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-ip-mask', rest_name='destination-ip-mask', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_ip_mask must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-ip-mask", rest_name="destination-ip-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_ip_mask = t
if hasattr(self, '_set'):
self._set() | -7,271,132,385,053,177,000 | Setter method for destination_ip_mask, mapped from YANG variable /openflow_state/flow_id/destination_ip_mask (string)
If this variable is read-only (config: false) in the
source YANG file, then _set_destination_ip_mask is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_destination_ip_mask() directly.
YANG Description: Destination IPv4 Mask | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_destination_ip_mask | extremenetworks/pybind | python | def _set_destination_ip_mask(self, v, load=False):
'\n Setter method for destination_ip_mask, mapped from YANG variable /openflow_state/flow_id/destination_ip_mask (string)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_destination_ip_mask is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_destination_ip_mask() directly.\n\n YANG Description: Destination IPv4 Mask\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=unicode, is_leaf=True, yang_name='destination-ip-mask', rest_name='destination-ip-mask', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='string', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'destination_ip_mask must be of a type compatible with string', 'defined-type': 'string', 'generated-type': 'YANGDynClass(base=unicode, is_leaf=True, yang_name="destination-ip-mask", rest_name="destination-ip-mask", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'string\', is_config=False)'})
self.__destination_ip_mask = t
if hasattr(self, '_set'):
self._set() |
def _get_total_packets(self):
'\n Getter method for total_packets, mapped from YANG variable /openflow_state/flow_id/total_packets (uint64)\n\n YANG Description: Total Packets\n '
return self.__total_packets | -7,904,570,503,155,040,000 | Getter method for total_packets, mapped from YANG variable /openflow_state/flow_id/total_packets (uint64)
YANG Description: Total Packets | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_total_packets | extremenetworks/pybind | python | def _get_total_packets(self):
'\n Getter method for total_packets, mapped from YANG variable /openflow_state/flow_id/total_packets (uint64)\n\n YANG Description: Total Packets\n '
return self.__total_packets |
def _set_total_packets(self, v, load=False):
'\n Setter method for total_packets, mapped from YANG variable /openflow_state/flow_id/total_packets (uint64)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_total_packets is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_total_packets() directly.\n\n YANG Description: Total Packets\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name='total-packets', rest_name='total-packets', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint64', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'total_packets must be of a type compatible with uint64', 'defined-type': 'uint64', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..18446744073709551615\']}, int_size=64), is_leaf=True, yang_name="total-packets", rest_name="total-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint64\', is_config=False)'})
self.__total_packets = t
if hasattr(self, '_set'):
self._set() | -2,498,688,631,761,961,000 | Setter method for total_packets, mapped from YANG variable /openflow_state/flow_id/total_packets (uint64)
If this variable is read-only (config: false) in the
source YANG file, then _set_total_packets is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_total_packets() directly.
YANG Description: Total Packets | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_total_packets | extremenetworks/pybind | python | def _set_total_packets(self, v, load=False):
'\n Setter method for total_packets, mapped from YANG variable /openflow_state/flow_id/total_packets (uint64)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_total_packets is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_total_packets() directly.\n\n YANG Description: Total Packets\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name='total-packets', rest_name='total-packets', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint64', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'total_packets must be of a type compatible with uint64', 'defined-type': 'uint64', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..18446744073709551615\']}, int_size=64), is_leaf=True, yang_name="total-packets", rest_name="total-packets", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint64\', is_config=False)'})
self.__total_packets = t
if hasattr(self, '_set'):
self._set() |
def _get_total_bytes(self):
'\n Getter method for total_bytes, mapped from YANG variable /openflow_state/flow_id/total_bytes (uint64)\n\n YANG Description: Total Bytes\n '
return self.__total_bytes | 805,648,943,730,033,300 | Getter method for total_bytes, mapped from YANG variable /openflow_state/flow_id/total_bytes (uint64)
YANG Description: Total Bytes | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_total_bytes | extremenetworks/pybind | python | def _get_total_bytes(self):
'\n Getter method for total_bytes, mapped from YANG variable /openflow_state/flow_id/total_bytes (uint64)\n\n YANG Description: Total Bytes\n '
return self.__total_bytes |
def _set_total_bytes(self, v, load=False):
'\n Setter method for total_bytes, mapped from YANG variable /openflow_state/flow_id/total_bytes (uint64)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_total_bytes is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_total_bytes() directly.\n\n YANG Description: Total Bytes\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name='total-bytes', rest_name='total-bytes', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint64', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'total_bytes must be of a type compatible with uint64', 'defined-type': 'uint64', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..18446744073709551615\']}, int_size=64), is_leaf=True, yang_name="total-bytes", rest_name="total-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint64\', is_config=False)'})
self.__total_bytes = t
if hasattr(self, '_set'):
self._set() | 2,194,781,502,162,096,600 | Setter method for total_bytes, mapped from YANG variable /openflow_state/flow_id/total_bytes (uint64)
If this variable is read-only (config: false) in the
source YANG file, then _set_total_bytes is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_total_bytes() directly.
YANG Description: Total Bytes | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_total_bytes | extremenetworks/pybind | python | def _set_total_bytes(self, v, load=False):
'\n Setter method for total_bytes, mapped from YANG variable /openflow_state/flow_id/total_bytes (uint64)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_total_bytes is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_total_bytes() directly.\n\n YANG Description: Total Bytes\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=RestrictedClassType(base_type=long, restriction_dict={'range': ['0..18446744073709551615']}, int_size=64), is_leaf=True, yang_name='total-bytes', rest_name='total-bytes', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='uint64', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'total_bytes must be of a type compatible with uint64', 'defined-type': 'uint64', 'generated-type': 'YANGDynClass(base=RestrictedClassType(base_type=long, restriction_dict={\'range\': [\'0..18446744073709551615\']}, int_size=64), is_leaf=True, yang_name="total-bytes", rest_name="total-bytes", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'uint64\', is_config=False)'})
self.__total_bytes = t
if hasattr(self, '_set'):
self._set() |
def _get_flow_action_list(self):
'\n Getter method for flow_action_list, mapped from YANG variable /openflow_state/flow_id/flow_action_list (list)\n\n YANG Description: Details of an action\n '
return self.__flow_action_list | -6,418,912,045,689,612,000 | Getter method for flow_action_list, mapped from YANG variable /openflow_state/flow_id/flow_action_list (list)
YANG Description: Details of an action | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _get_flow_action_list | extremenetworks/pybind | python | def _get_flow_action_list(self):
'\n Getter method for flow_action_list, mapped from YANG variable /openflow_state/flow_id/flow_action_list (list)\n\n YANG Description: Details of an action\n '
return self.__flow_action_list |
def _set_flow_action_list(self, v, load=False):
'\n Setter method for flow_action_list, mapped from YANG variable /openflow_state/flow_id/flow_action_list (list)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_flow_action_list is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_flow_action_list() directly.\n\n YANG Description: Details of an action\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=YANGListType('action_idx', flow_action_list.flow_action_list, yang_name='flow-action-list', rest_name='flow-action-list', parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='action-idx', extensions={u'tailf-common': {u'callpoint': u'openflow-flow-action', u'cli-suppress-show-path': None}}), is_container='list', yang_name='flow-action-list', rest_name='flow-action-list', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'callpoint': u'openflow-flow-action', u'cli-suppress-show-path': None}}, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='list', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'flow_action_list must be of a type compatible with list', 'defined-type': 'list', 'generated-type': 'YANGDynClass(base=YANGListType("action_idx",flow_action_list.flow_action_list, yang_name="flow-action-list", rest_name="flow-action-list", parent=self, is_container=\'list\', user_ordered=False, path_helper=self._path_helper, yang_keys=\'action-idx\', extensions={u\'tailf-common\': {u\'callpoint\': u\'openflow-flow-action\', u\'cli-suppress-show-path\': None}}), is_container=\'list\', yang_name="flow-action-list", rest_name="flow-action-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u\'tailf-common\': {u\'callpoint\': u\'openflow-flow-action\', u\'cli-suppress-show-path\': None}}, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'list\', is_config=False)'})
self.__flow_action_list = t
if hasattr(self, '_set'):
self._set() | -7,844,862,851,809,053,000 | Setter method for flow_action_list, mapped from YANG variable /openflow_state/flow_id/flow_action_list (list)
If this variable is read-only (config: false) in the
source YANG file, then _set_flow_action_list is considered as a private
method. Backends looking to populate this variable should
do so via calling thisObj._set_flow_action_list() directly.
YANG Description: Details of an action | pybind/slxos/v17r_1_01a/openflow_state/flow_id/__init__.py | _set_flow_action_list | extremenetworks/pybind | python | def _set_flow_action_list(self, v, load=False):
'\n Setter method for flow_action_list, mapped from YANG variable /openflow_state/flow_id/flow_action_list (list)\n If this variable is read-only (config: false) in the\n source YANG file, then _set_flow_action_list is considered as a private\n method. Backends looking to populate this variable should\n do so via calling thisObj._set_flow_action_list() directly.\n\n YANG Description: Details of an action\n '
if hasattr(v, '_utype'):
v = v._utype(v)
try:
t = YANGDynClass(v, base=YANGListType('action_idx', flow_action_list.flow_action_list, yang_name='flow-action-list', rest_name='flow-action-list', parent=self, is_container='list', user_ordered=False, path_helper=self._path_helper, yang_keys='action-idx', extensions={u'tailf-common': {u'callpoint': u'openflow-flow-action', u'cli-suppress-show-path': None}}), is_container='list', yang_name='flow-action-list', rest_name='flow-action-list', parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u'tailf-common': {u'callpoint': u'openflow-flow-action', u'cli-suppress-show-path': None}}, namespace='urn:brocade.com:mgmt:brocade-openflow-operational', defining_module='brocade-openflow-operational', yang_type='list', is_config=False)
except (TypeError, ValueError):
raise ValueError({'error-string': 'flow_action_list must be of a type compatible with list', 'defined-type': 'list', 'generated-type': 'YANGDynClass(base=YANGListType("action_idx",flow_action_list.flow_action_list, yang_name="flow-action-list", rest_name="flow-action-list", parent=self, is_container=\'list\', user_ordered=False, path_helper=self._path_helper, yang_keys=\'action-idx\', extensions={u\'tailf-common\': {u\'callpoint\': u\'openflow-flow-action\', u\'cli-suppress-show-path\': None}}), is_container=\'list\', yang_name="flow-action-list", rest_name="flow-action-list", parent=self, path_helper=self._path_helper, extmethods=self._extmethods, register_paths=True, extensions={u\'tailf-common\': {u\'callpoint\': u\'openflow-flow-action\', u\'cli-suppress-show-path\': None}}, namespace=\'urn:brocade.com:mgmt:brocade-openflow-operational\', defining_module=\'brocade-openflow-operational\', yang_type=\'list\', is_config=False)'})
self.__flow_action_list = t
if hasattr(self, '_set'):
self._set() |
def __init__(self, author=None, commiter=None, message=None, sha=None):
'WikiCommit - a model defined in Swagger'
self._author = None
self._commiter = None
self._message = None
self._sha = None
self.discriminator = None
if (author is not None):
self.author = author
if (commiter is not None):
self.commiter = commiter
if (message is not None):
self.message = message
if (sha is not None):
self.sha = sha | -5,596,803,985,568,891,000 | WikiCommit - a model defined in Swagger | gitea_api/models/wiki_commit.py | __init__ | r7l/python-gitea-api | python | def __init__(self, author=None, commiter=None, message=None, sha=None):
self._author = None
self._commiter = None
self._message = None
self._sha = None
self.discriminator = None
if (author is not None):
self.author = author
if (commiter is not None):
self.commiter = commiter
if (message is not None):
self.message = message
if (sha is not None):
self.sha = sha |
@property
def author(self):
'Gets the author of this WikiCommit. # noqa: E501\n\n\n :return: The author of this WikiCommit. # noqa: E501\n :rtype: CommitUser\n '
return self._author | -4,404,590,990,824,038,400 | Gets the author of this WikiCommit. # noqa: E501
:return: The author of this WikiCommit. # noqa: E501
:rtype: CommitUser | gitea_api/models/wiki_commit.py | author | r7l/python-gitea-api | python | @property
def author(self):
'Gets the author of this WikiCommit. # noqa: E501\n\n\n :return: The author of this WikiCommit. # noqa: E501\n :rtype: CommitUser\n '
return self._author |
@author.setter
def author(self, author):
'Sets the author of this WikiCommit.\n\n\n :param author: The author of this WikiCommit. # noqa: E501\n :type: CommitUser\n '
self._author = author | 2,049,683,057,487,430,100 | Sets the author of this WikiCommit.
:param author: The author of this WikiCommit. # noqa: E501
:type: CommitUser | gitea_api/models/wiki_commit.py | author | r7l/python-gitea-api | python | @author.setter
def author(self, author):
'Sets the author of this WikiCommit.\n\n\n :param author: The author of this WikiCommit. # noqa: E501\n :type: CommitUser\n '
self._author = author |
@property
def commiter(self):
'Gets the commiter of this WikiCommit. # noqa: E501\n\n\n :return: The commiter of this WikiCommit. # noqa: E501\n :rtype: CommitUser\n '
return self._commiter | 6,867,431,484,968,388,000 | Gets the commiter of this WikiCommit. # noqa: E501
:return: The commiter of this WikiCommit. # noqa: E501
:rtype: CommitUser | gitea_api/models/wiki_commit.py | commiter | r7l/python-gitea-api | python | @property
def commiter(self):
'Gets the commiter of this WikiCommit. # noqa: E501\n\n\n :return: The commiter of this WikiCommit. # noqa: E501\n :rtype: CommitUser\n '
return self._commiter |
@commiter.setter
def commiter(self, commiter):
'Sets the commiter of this WikiCommit.\n\n\n :param commiter: The commiter of this WikiCommit. # noqa: E501\n :type: CommitUser\n '
self._commiter = commiter | -7,921,428,604,777,179,000 | Sets the commiter of this WikiCommit.
:param commiter: The commiter of this WikiCommit. # noqa: E501
:type: CommitUser | gitea_api/models/wiki_commit.py | commiter | r7l/python-gitea-api | python | @commiter.setter
def commiter(self, commiter):
'Sets the commiter of this WikiCommit.\n\n\n :param commiter: The commiter of this WikiCommit. # noqa: E501\n :type: CommitUser\n '
self._commiter = commiter |
@property
def message(self):
'Gets the message of this WikiCommit. # noqa: E501\n\n\n :return: The message of this WikiCommit. # noqa: E501\n :rtype: str\n '
return self._message | 9,097,509,535,606,912,000 | Gets the message of this WikiCommit. # noqa: E501
:return: The message of this WikiCommit. # noqa: E501
:rtype: str | gitea_api/models/wiki_commit.py | message | r7l/python-gitea-api | python | @property
def message(self):
'Gets the message of this WikiCommit. # noqa: E501\n\n\n :return: The message of this WikiCommit. # noqa: E501\n :rtype: str\n '
return self._message |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.