partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | create_cfg_segment | Takes a str into var filecontent which represents the entire content of a configuration
segment, or partial configuration file. Takes a str into var description which represents the
description of the configuration segment
:param filename: str containing the name of the configuration segment.
:param fi... | pyhpeimc/plat/icc.py | def create_cfg_segment(filename, filecontent, description, auth, url):
"""
Takes a str into var filecontent which represents the entire content of a configuration
segment, or partial configuration file. Takes a str into var description which represents the
description of the configuration segment
:p... | def create_cfg_segment(filename, filecontent, description, auth, url):
"""
Takes a str into var filecontent which represents the entire content of a configuration
segment, or partial configuration file. Takes a str into var description which represents the
description of the configuration segment
:p... | [
"Takes",
"a",
"str",
"into",
"var",
"filecontent",
"which",
"represents",
"the",
"entire",
"content",
"of",
"a",
"configuration",
"segment",
"or",
"partial",
"configuration",
"file",
".",
"Takes",
"a",
"str",
"into",
"var",
"description",
"which",
"represents",
... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L77-L130 | [
"def",
"create_cfg_segment",
"(",
"filename",
",",
"filecontent",
",",
"description",
",",
"auth",
",",
"url",
")",
":",
"payload",
"=",
"{",
"\"confFileName\"",
":",
"filename",
",",
"\"confFileType\"",
":",
"\"2\"",
",",
"\"cfgFileParent\"",
":",
"\"-1\"",
"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_template_id | Helper function takes str input of folder name and returns str numerical id of the folder.
:param template_name: str name of the target template
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth... | pyhpeimc/plat/icc.py | def get_template_id(template_name, auth, url):
"""
Helper function takes str input of folder name and returns str numerical id of the folder.
:param template_name: str name of the target template
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base u... | def get_template_id(template_name, auth, url):
"""
Helper function takes str input of folder name and returns str numerical id of the folder.
:param template_name: str name of the target template
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base u... | [
"Helper",
"function",
"takes",
"str",
"input",
"of",
"folder",
"name",
"and",
"returns",
"str",
"numerical",
"id",
"of",
"the",
"folder",
".",
":",
"param",
"template_name",
":",
"str",
"name",
"of",
"the",
"target",
"template"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L133-L161 | [
"def",
"get_template_id",
"(",
"template_name",
",",
"auth",
",",
"url",
")",
":",
"object_list",
"=",
"get_cfg_template",
"(",
"auth",
"=",
"auth",
",",
"url",
"=",
"url",
")",
"for",
"template",
"in",
"object_list",
":",
"if",
"template",
"[",
"'confFile... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_folder_id | Helper function takes str input of folder name and returns str numerical id of the folder.
:param folder_name: str name of the folder
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
... | pyhpeimc/plat/icc.py | def get_folder_id(folder_name, auth, url):
"""
Helper function takes str input of folder name and returns str numerical id of the folder.
:param folder_name: str name of the folder
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS in... | def get_folder_id(folder_name, auth, url):
"""
Helper function takes str input of folder name and returns str numerical id of the folder.
:param folder_name: str name of the folder
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS in... | [
"Helper",
"function",
"takes",
"str",
"input",
"of",
"folder",
"name",
"and",
"returns",
"str",
"numerical",
"id",
"of",
"the",
"folder",
".",
":",
"param",
"folder_name",
":",
"str",
"name",
"of",
"the",
"folder"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L164-L192 | [
"def",
"get_folder_id",
"(",
"folder_name",
",",
"auth",
",",
"url",
")",
":",
"object_list",
"=",
"get_cfg_template",
"(",
"auth",
"=",
"auth",
",",
"url",
"=",
"url",
")",
"for",
"template",
"in",
"object_list",
":",
"if",
"template",
"[",
"'confFileName... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | delete_cfg_template | Uses the get_template_id() funct to gather the template_id
to craft a url which is sent to the IMC server using a Delete Method
:param template_name: str containing the entire contents of the configuration segment
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:par... | pyhpeimc/plat/icc.py | def delete_cfg_template(template_name, auth, url):
"""Uses the get_template_id() funct to gather the template_id
to craft a url which is sent to the IMC server using a Delete Method
:param template_name: str containing the entire contents of the configuration segment
:param auth: requests auth object #... | def delete_cfg_template(template_name, auth, url):
"""Uses the get_template_id() funct to gather the template_id
to craft a url which is sent to the IMC server using a Delete Method
:param template_name: str containing the entire contents of the configuration segment
:param auth: requests auth object #... | [
"Uses",
"the",
"get_template_id",
"()",
"funct",
"to",
"gather",
"the",
"template_id",
"to",
"craft",
"a",
"url",
"which",
"is",
"sent",
"to",
"the",
"IMC",
"server",
"using",
"a",
"Delete",
"Method",
":",
"param",
"template_name",
":",
"str",
"containing",
... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L195-L226 | [
"def",
"delete_cfg_template",
"(",
"template_name",
",",
"auth",
",",
"url",
")",
":",
"file_id",
"=",
"get_template_id",
"(",
"template_name",
",",
"auth",
",",
"url",
")",
"f_url",
"=",
"url",
"+",
"\"/imcrs/icc/confFile/\"",
"+",
"str",
"(",
"file_id",
")... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_template_details | Uses the get_template_id() funct to gather the template_id to craft a
get_template_details_url which is sent to the IMC server using
a get Method
:param template_name: str containing the entire contents of the configuration segment
:param auth: requests auth object #usually auth.creds from auth pyhpeim... | pyhpeimc/plat/icc.py | def get_template_details(template_name, auth, url):
"""Uses the get_template_id() funct to gather the template_id to craft a
get_template_details_url which is sent to the IMC server using
a get Method
:param template_name: str containing the entire contents of the configuration segment
:param auth:... | def get_template_details(template_name, auth, url):
"""Uses the get_template_id() funct to gather the template_id to craft a
get_template_details_url which is sent to the IMC server using
a get Method
:param template_name: str containing the entire contents of the configuration segment
:param auth:... | [
"Uses",
"the",
"get_template_id",
"()",
"funct",
"to",
"gather",
"the",
"template_id",
"to",
"craft",
"a",
"get_template_details_url",
"which",
"is",
"sent",
"to",
"the",
"IMC",
"server",
"using",
"a",
"get",
"Method",
":",
"param",
"template_name",
":",
"str"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L229-L272 | [
"def",
"get_template_details",
"(",
"template_name",
",",
"auth",
",",
"url",
")",
":",
"file_id",
"=",
"get_template_id",
"(",
"template_name",
",",
"auth",
",",
"url",
")",
"if",
"isinstance",
"(",
"file_id",
",",
"str",
")",
":",
"return",
"file_id",
"f... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_dev_vlans | Function takes input of devID to issue RESTUL call to HP IMC
:param devid: requires devId as the only input parameter
:return: dictionary of existing vlans on the devices. Device must be supported in HP IMC platform VLAN manager module | build/lib/pyhpimc/plat/vlanm.py | def get_dev_vlans(devid, auth, url):
"""Function takes input of devID to issue RESTUL call to HP IMC
:param devid: requires devId as the only input parameter
:return: dictionary of existing vlans on the devices. Device must be supported in HP IMC platform VLAN manager module
"""
# checks to see if ... | def get_dev_vlans(devid, auth, url):
"""Function takes input of devID to issue RESTUL call to HP IMC
:param devid: requires devId as the only input parameter
:return: dictionary of existing vlans on the devices. Device must be supported in HP IMC platform VLAN manager module
"""
# checks to see if ... | [
"Function",
"takes",
"input",
"of",
"devID",
"to",
"issue",
"RESTUL",
"call",
"to",
"HP",
"IMC",
":",
"param",
"devid",
":",
"requires",
"devId",
"as",
"the",
"only",
"input",
"parameter",
":",
"return",
":",
"dictionary",
"of",
"existing",
"vlans",
"on",
... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L35-L55 | [
"def",
"get_dev_vlans",
"(",
"devid",
",",
"auth",
",",
"url",
")",
":",
"# checks to see if the imc credentials are already available",
"get_dev_vlans_url",
"=",
"\"/imcrs/vlan?devId=\"",
"+",
"str",
"(",
"devid",
")",
"+",
"\"&start=0&size=5000&total=false\"",
"f_url",
... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_trunk_interfaces | Function takes devId as input to RESTFULL call to HP IMC platform
:param devId: output of get_dev_details
:return: list of dictionaries containing of interfaces configured as an 802.1q trunk
Example:
auth = IMCAuth("http://", "10.101.0.203", "8080", "admin", "admin")
get_dev_asset_details("... | build/lib/pyhpimc/plat/vlanm.py | def get_trunk_interfaces(devId, auth, url):
"""Function takes devId as input to RESTFULL call to HP IMC platform
:param devId: output of get_dev_details
:return: list of dictionaries containing of interfaces configured as an 802.1q trunk
Example:
auth = IMCAuth("http://", "10.101.0.203", "8080"... | def get_trunk_interfaces(devId, auth, url):
"""Function takes devId as input to RESTFULL call to HP IMC platform
:param devId: output of get_dev_details
:return: list of dictionaries containing of interfaces configured as an 802.1q trunk
Example:
auth = IMCAuth("http://", "10.101.0.203", "8080"... | [
"Function",
"takes",
"devId",
"as",
"input",
"to",
"RESTFULL",
"call",
"to",
"HP",
"IMC",
"platform",
":",
"param",
"devId",
":",
"output",
"of",
"get_dev_details",
":",
"return",
":",
"list",
"of",
"dictionaries",
"containing",
"of",
"interfaces",
"configured... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L57-L81 | [
"def",
"get_trunk_interfaces",
"(",
"devId",
",",
"auth",
",",
"url",
")",
":",
"# checks to see if the imc credentials are already available",
"get_trunk_interfaces_url",
"=",
"\"/imcrs/vlan/trunk?devId=\"",
"+",
"str",
"(",
"devId",
")",
"+",
"\"&start=1&size=5000&total=fal... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_device_access_interfaces | Function takes devId as input to RESTFUL call to HP IMC platform
:param devId: requires deviceID as the only input parameter
:return: list of dictionaries containing interfaces configured as access ports | build/lib/pyhpimc/plat/vlanm.py | def get_device_access_interfaces(devId, auth, url):
"""Function takes devId as input to RESTFUL call to HP IMC platform
:param devId: requires deviceID as the only input parameter
:return: list of dictionaries containing interfaces configured as access ports
"""
# checks to see if the imc credential... | def get_device_access_interfaces(devId, auth, url):
"""Function takes devId as input to RESTFUL call to HP IMC platform
:param devId: requires deviceID as the only input parameter
:return: list of dictionaries containing interfaces configured as access ports
"""
# checks to see if the imc credential... | [
"Function",
"takes",
"devId",
"as",
"input",
"to",
"RESTFUL",
"call",
"to",
"HP",
"IMC",
"platform",
":",
"param",
"devId",
":",
"requires",
"deviceID",
"as",
"the",
"only",
"input",
"parameter",
":",
"return",
":",
"list",
"of",
"dictionaries",
"containing"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L86-L107 | [
"def",
"get_device_access_interfaces",
"(",
"devId",
",",
"auth",
",",
"url",
")",
":",
"# checks to see if the imc credentials are already available",
"get_access_interface_vlan_url",
"=",
"\"/imcrs/vlan/access?devId=\"",
"+",
"str",
"(",
"devId",
")",
"+",
"\"&start=1&size=... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | create_dev_vlan | function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the
specified VLAN from the target device. VLAN Name MUST be valid on target device.
:param devid: int or str value of the target device
:param vlanid:int or str value of target 802.1q VLAN
... | build/lib/pyhpimc/plat/vlanm.py | def create_dev_vlan(devid, vlanid, vlan_name, auth, url):
"""
function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the
specified VLAN from the target device. VLAN Name MUST be valid on target device.
:param devid: int or str value of the targe... | def create_dev_vlan(devid, vlanid, vlan_name, auth, url):
"""
function takes devid and vlanid vlan_name of specific device and 802.1q VLAN tag and issues a RESTFUL call to add the
specified VLAN from the target device. VLAN Name MUST be valid on target device.
:param devid: int or str value of the targe... | [
"function",
"takes",
"devid",
"and",
"vlanid",
"vlan_name",
"of",
"specific",
"device",
"and",
"802",
".",
"1q",
"VLAN",
"tag",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"add",
"the",
"specified",
"VLAN",
"from",
"the",
"target",
"device",
".",
"VLAN"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L119-L142 | [
"def",
"create_dev_vlan",
"(",
"devid",
",",
"vlanid",
",",
"vlan_name",
",",
"auth",
",",
"url",
")",
":",
"create_dev_vlan_url",
"=",
"\"/imcrs/vlan?devId=\"",
"+",
"str",
"(",
"devid",
")",
"f_url",
"=",
"url",
"+",
"create_dev_vlan_url",
"payload",
"=",
... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | delete_dev_vlans | function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the
specified VLAN from the target device.
:param devid: int or str value of the target device
:param vlanid:
:return:HTTP Status code of 204 with no values. | build/lib/pyhpimc/plat/vlanm.py | def delete_dev_vlans(devid, vlanid, auth, url):
"""
function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the
specified VLAN from the target device.
:param devid: int or str value of the target device
:param vlanid:
:return:HTTP Status code of... | def delete_dev_vlans(devid, vlanid, auth, url):
"""
function takes devid and vlanid of specific device and 802.1q VLAN tag and issues a RESTFUL call to remove the
specified VLAN from the target device.
:param devid: int or str value of the target device
:param vlanid:
:return:HTTP Status code of... | [
"function",
"takes",
"devid",
"and",
"vlanid",
"of",
"specific",
"device",
"and",
"802",
".",
"1q",
"VLAN",
"tag",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"remove",
"the",
"specified",
"VLAN",
"from",
"the",
"target",
"device",
".",
":",
"param",
... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L145-L166 | [
"def",
"delete_dev_vlans",
"(",
"devid",
",",
"vlanid",
",",
"auth",
",",
"url",
")",
":",
"remove_dev_vlan_url",
"=",
"\"/imcrs/vlan/delvlan?devId=\"",
"+",
"str",
"(",
"devid",
")",
"+",
"\"&vlanId=\"",
"+",
"str",
"(",
"vlanid",
")",
"f_url",
"=",
"url",
... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | create_operator | Function takes input of dictionary operator with the following keys
operator = { "fullName" : "" ,
"sessionTimeout" : "",
"password" : "",
"operatorGroupId" : "",
"name" : "",
"desc" : "",
"defaultAcl" : "",
"authType" : ... | pyhpeimc/plat/operator.py | def create_operator(operator, auth, url):
"""
Function takes input of dictionary operator with the following keys
operator = { "fullName" : "" ,
"sessionTimeout" : "",
"password" : "",
"operatorGroupId" : "",
"name" : "",
"desc" : "",
... | def create_operator(operator, auth, url):
"""
Function takes input of dictionary operator with the following keys
operator = { "fullName" : "" ,
"sessionTimeout" : "",
"password" : "",
"operatorGroupId" : "",
"name" : "",
"desc" : "",
... | [
"Function",
"takes",
"input",
"of",
"dictionary",
"operator",
"with",
"the",
"following",
"keys",
"operator",
"=",
"{",
"fullName",
":",
"sessionTimeout",
":",
"password",
":",
"operatorGroupId",
":",
"name",
":",
"desc",
":",
"defaultAcl",
":",
"authType",
":... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L22-L84 | [
"def",
"create_operator",
"(",
"operator",
",",
"auth",
",",
"url",
")",
":",
"f_url",
"=",
"url",
"+",
"'/imcrs/plat/operator'",
"payload",
"=",
"json",
".",
"dumps",
"(",
"operator",
",",
"indent",
"=",
"4",
")",
"response",
"=",
"requests",
".",
"post... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | set_operator_password | Function to set the password of an existing operator
:param operator: str Name of the operator account
:param password: str New password
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.a... | pyhpeimc/plat/operator.py | def set_operator_password(operator, password, auth, url):
"""
Function to set the password of an existing operator
:param operator: str Name of the operator account
:param password: str New password
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param ur... | def set_operator_password(operator, password, auth, url):
"""
Function to set the password of an existing operator
:param operator: str Name of the operator account
:param password: str New password
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param ur... | [
"Function",
"to",
"set",
"the",
"password",
"of",
"an",
"existing",
"operator"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L87-L148 | [
"def",
"set_operator_password",
"(",
"operator",
",",
"password",
",",
"auth",
",",
"url",
")",
":",
"if",
"operator",
"is",
"None",
":",
"operator",
"=",
"input",
"(",
"'''\\n What is the username you wish to change the password?'''",
")",
"oper_id",
"=",
"''",
"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_plat_operator | Funtion takes no inputs and returns a list of dictionaties of all of the operators currently
configured on the HPE IMC system
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:re... | pyhpeimc/plat/operator.py | def get_plat_operator(auth, url):
"""
Funtion takes no inputs and returns a list of dictionaties of all of the operators currently
configured on the HPE IMC system
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually ... | def get_plat_operator(auth, url):
"""
Funtion takes no inputs and returns a list of dictionaties of all of the operators currently
configured on the HPE IMC system
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually ... | [
"Funtion",
"takes",
"no",
"inputs",
"and",
"returns",
"a",
"list",
"of",
"dictionaties",
"of",
"all",
"of",
"the",
"operators",
"currently",
"configured",
"on",
"the",
"HPE",
"IMC",
"system"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L151-L187 | [
"def",
"get_plat_operator",
"(",
"auth",
",",
"url",
")",
":",
"f_url",
"=",
"url",
"+",
"'/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&total=false'",
"try",
":",
"response",
"=",
"requests",
".",
"get",
"(",
"f_url",
",",
"auth",
"=",
"auth",
",",... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | delete_plat_operator | Function to set the password of an existing operator
:param operator: str Name of the operator account
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: int of 204 if suc... | pyhpeimc/plat/operator.py | def delete_plat_operator(operator, auth, url):
"""
Function to set the password of an existing operator
:param operator: str Name of the operator account
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url f... | def delete_plat_operator(operator, auth, url):
"""
Function to set the password of an existing operator
:param operator: str Name of the operator account
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url f... | [
"Function",
"to",
"set",
"the",
"password",
"of",
"an",
"existing",
"operator",
":",
"param",
"operator",
":",
"str",
"Name",
"of",
"the",
"operator",
"account"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L190-L240 | [
"def",
"delete_plat_operator",
"(",
"operator",
",",
"auth",
",",
"url",
")",
":",
"oper_id",
"=",
"None",
"plat_oper_list",
"=",
"get_plat_operator",
"(",
"auth",
",",
"url",
")",
"for",
"i",
"in",
"plat_oper_list",
":",
"if",
"operator",
"==",
"i",
"[",
... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | RequestClient.execute_request | Makes a request to the specified url endpoint with the
specified http method, params and post data.
Args:
url (string): The url to the API without query params.
Example: "https://api.housecanary.com/v2/property/value"
http_method (string): The http meth... | housecanary/requestclient.py | def execute_request(self, url, http_method, query_params, post_data):
"""Makes a request to the specified url endpoint with the
specified http method, params and post data.
Args:
url (string): The url to the API without query params.
Example: "https://api.h... | def execute_request(self, url, http_method, query_params, post_data):
"""Makes a request to the specified url endpoint with the
specified http method, params and post data.
Args:
url (string): The url to the API without query params.
Example: "https://api.h... | [
"Makes",
"a",
"request",
"to",
"the",
"specified",
"url",
"endpoint",
"with",
"the",
"specified",
"http",
"method",
"params",
"and",
"post",
"data",
"."
] | housecanary/hc-api-python | python | https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/requestclient.py#L32-L59 | [
"def",
"execute_request",
"(",
"self",
",",
"url",
",",
"http_method",
",",
"query_params",
",",
"post_data",
")",
":",
"response",
"=",
"requests",
".",
"request",
"(",
"http_method",
",",
"url",
",",
"params",
"=",
"query_params",
",",
"auth",
"=",
"self... | 2bb9e2208b34e8617575de45934357ee33b8531c |
train | RequestClient.post | Makes a POST request to the specified url endpoint.
Args:
url (string): The url to the API without query params.
Example: "https://api.housecanary.com/v2/property/value"
post_data: Json post data to send in the body of the request.
query_params (dic... | housecanary/requestclient.py | def post(self, url, post_data, query_params=None):
"""Makes a POST request to the specified url endpoint.
Args:
url (string): The url to the API without query params.
Example: "https://api.housecanary.com/v2/property/value"
post_data: Json post data to ... | def post(self, url, post_data, query_params=None):
"""Makes a POST request to the specified url endpoint.
Args:
url (string): The url to the API without query params.
Example: "https://api.housecanary.com/v2/property/value"
post_data: Json post data to ... | [
"Makes",
"a",
"POST",
"request",
"to",
"the",
"specified",
"url",
"endpoint",
"."
] | housecanary/hc-api-python | python | https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/requestclient.py#L76-L93 | [
"def",
"post",
"(",
"self",
",",
"url",
",",
"post_data",
",",
"query_params",
"=",
"None",
")",
":",
"if",
"query_params",
"is",
"None",
":",
"query_params",
"=",
"{",
"}",
"return",
"self",
".",
"execute_request",
"(",
"url",
",",
"\"POST\"",
",",
"q... | 2bb9e2208b34e8617575de45934357ee33b8531c |
train | import_custom_views | Function which takes in a csv files as input to the create_custom_views function from the pyhpeimc python module
available at https://github.com/HPNetworking/HP-Intelligent-Management-Center
:param filename: user-defined filename which contains two column named "name" and "upperview" as input into the
creat... | examples/HPE IMC Custom Views.py | def import_custom_views(filename):
"""
Function which takes in a csv files as input to the create_custom_views function from the pyhpeimc python module
available at https://github.com/HPNetworking/HP-Intelligent-Management-Center
:param filename: user-defined filename which contains two column named "na... | def import_custom_views(filename):
"""
Function which takes in a csv files as input to the create_custom_views function from the pyhpeimc python module
available at https://github.com/HPNetworking/HP-Intelligent-Management-Center
:param filename: user-defined filename which contains two column named "na... | [
"Function",
"which",
"takes",
"in",
"a",
"csv",
"files",
"as",
"input",
"to",
"the",
"create_custom_views",
"function",
"from",
"the",
"pyhpeimc",
"python",
"module",
"available",
"at",
"https",
":",
"//",
"github",
".",
"com",
"/",
"HPNetworking",
"/",
"HP"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/examples/HPE IMC Custom Views.py#L8-L25 | [
"def",
"import_custom_views",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
")",
"as",
"csvfile",
":",
"# decodes file as csv as a python dictionary",
"reader",
"=",
"csv",
".",
"DictReader",
"(",
"csvfile",
")",
"for",
"view",
"in",
"reader",
":",... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_real_time_locate | function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and
interface that the target host is currently connected to. Note: Although intended to return a
single location, Multiple locations may be returned for a single host due to a partially
discovered network or misconf... | pyhpeimc/plat/termaccess.py | def get_real_time_locate(host_ipaddress, auth, url):
"""
function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and
interface that the target host is currently connected to. Note: Although intended to return a
single location, Multiple locations may be returned for a... | def get_real_time_locate(host_ipaddress, auth, url):
"""
function takes the ipAddress of a specific host and issues a RESTFUL call to get the device and
interface that the target host is currently connected to. Note: Although intended to return a
single location, Multiple locations may be returned for a... | [
"function",
"takes",
"the",
"ipAddress",
"of",
"a",
"specific",
"host",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"get",
"the",
"device",
"and",
"interface",
"that",
"the",
"target",
"host",
"is",
"currently",
"connected",
"to",
".",
"Note",
":",
"Alt... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L23-L83 | [
"def",
"get_real_time_locate",
"(",
"host_ipaddress",
",",
"auth",
",",
"url",
")",
":",
"f_url",
"=",
"url",
"+",
"\"/imcrs/res/access/realtimeLocate?type=2&value=\"",
"+",
"str",
"(",
"host_ipaddress",
")",
"+",
"\"&total=false\"",
"response",
"=",
"requests",
"."... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_ip_mac_arp_list | function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list
from the target device.
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:param devid... | pyhpeimc/plat/termaccess.py | def get_ip_mac_arp_list(auth, url, devid=None, devip=None):
"""
function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list
from the target device.
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS in... | def get_ip_mac_arp_list(auth, url, devid=None, devip=None):
"""
function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list
from the target device.
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS in... | [
"function",
"takes",
"devid",
"of",
"specific",
"device",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"get",
"the",
"IP",
"/",
"MAC",
"/",
"ARP",
"list",
"from",
"the",
"target",
"device",
"."
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L86-L135 | [
"def",
"get_ip_mac_arp_list",
"(",
"auth",
",",
"url",
",",
"devid",
"=",
"None",
",",
"devip",
"=",
"None",
")",
":",
"if",
"devip",
"is",
"not",
"None",
":",
"dev_details",
"=",
"get_dev_details",
"(",
"devip",
",",
"auth",
",",
"url",
")",
"if",
"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_ip_scope | function requires no inputs and returns all IP address scopes currently configured on the HPE
IMC server. If the optional scopeid parameter is included, this will automatically return
only the desired scope id.
:param scopeid: integer of the desired scope id ( optional )
:param auth: requests auth obj... | pyhpeimc/plat/termaccess.py | def get_ip_scope(auth, url, scopeid=None, ):
"""
function requires no inputs and returns all IP address scopes currently configured on the HPE
IMC server. If the optional scopeid parameter is included, this will automatically return
only the desired scope id.
:param scopeid: integer of the desired ... | def get_ip_scope(auth, url, scopeid=None, ):
"""
function requires no inputs and returns all IP address scopes currently configured on the HPE
IMC server. If the optional scopeid parameter is included, this will automatically return
only the desired scope id.
:param scopeid: integer of the desired ... | [
"function",
"requires",
"no",
"inputs",
"and",
"returns",
"all",
"IP",
"address",
"scopes",
"currently",
"configured",
"on",
"the",
"HPE",
"IMC",
"server",
".",
"If",
"the",
"optional",
"scopeid",
"parameter",
"is",
"included",
"this",
"will",
"automatically",
... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L143-L187 | [
"def",
"get_ip_scope",
"(",
"auth",
",",
"url",
",",
"scopeid",
"=",
"None",
",",
")",
":",
"if",
"scopeid",
"is",
"None",
":",
"get_ip_scope_url",
"=",
"\"/imcrs/res/access/assignedIpScope\"",
"else",
":",
"get_ip_scope_url",
"=",
"\"/imcrs/res/access/assignedIpSco... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | add_ip_scope | Function takes input of four strings Start Ip, endIp, name, and description to add new Ip Scope
to terminal access in the HPE IMC base platform
:param name: str Name of the owner of this IP scope ex. 'admin'
:param description: str description of the Ip scope
:param auth: requests auth object #usual... | pyhpeimc/plat/termaccess.py | def add_ip_scope(name, description, auth, url, startip=None, endip=None, network_address=None):
"""
Function takes input of four strings Start Ip, endIp, name, and description to add new Ip Scope
to terminal access in the HPE IMC base platform
:param name: str Name of the owner of this IP scope ex. 'a... | def add_ip_scope(name, description, auth, url, startip=None, endip=None, network_address=None):
"""
Function takes input of four strings Start Ip, endIp, name, and description to add new Ip Scope
to terminal access in the HPE IMC base platform
:param name: str Name of the owner of this IP scope ex. 'a... | [
"Function",
"takes",
"input",
"of",
"four",
"strings",
"Start",
"Ip",
"endIp",
"name",
"and",
"description",
"to",
"add",
"new",
"Ip",
"Scope",
"to",
"terminal",
"access",
"in",
"the",
"HPE",
"IMC",
"base",
"platform"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L233-L295 | [
"def",
"add_ip_scope",
"(",
"name",
",",
"description",
",",
"auth",
",",
"url",
",",
"startip",
"=",
"None",
",",
"endip",
"=",
"None",
",",
"network_address",
"=",
"None",
")",
":",
"if",
"network_address",
"is",
"not",
"None",
":",
"nw_address",
"=",
... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | delete_ip_scope | Function to delete an entire IP segment from the IMC IP Address management under terminal access
:param network_address
:param auth
:param url
>>> from pyhpeimc.auth import *
>>> from pyhpeimc.plat.termaccess import *
>>> auth = IMCAuth("http://", "10.101.0.203", "8080", "admin", "admin")
... | pyhpeimc/plat/termaccess.py | def delete_ip_scope(network_address, auth, url):
"""
Function to delete an entire IP segment from the IMC IP Address management under terminal access
:param network_address
:param auth
:param url
>>> from pyhpeimc.auth import *
>>> from pyhpeimc.plat.termaccess import *
>>> auth = IMC... | def delete_ip_scope(network_address, auth, url):
"""
Function to delete an entire IP segment from the IMC IP Address management under terminal access
:param network_address
:param auth
:param url
>>> from pyhpeimc.auth import *
>>> from pyhpeimc.plat.termaccess import *
>>> auth = IMC... | [
"Function",
"to",
"delete",
"an",
"entire",
"IP",
"segment",
"from",
"the",
"IMC",
"IP",
"Address",
"management",
"under",
"terminal",
"access",
":",
"param",
"network_address",
":",
"param",
"auth",
":",
"param",
"url"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L357-L386 | [
"def",
"delete_ip_scope",
"(",
"network_address",
",",
"auth",
",",
"url",
")",
":",
"scope_id",
"=",
"get_scope_id",
"(",
"network_address",
",",
"auth",
",",
"url",
")",
"if",
"scope_id",
"==",
"\"Scope Doesn't Exist\"",
":",
"return",
"scope_id",
"f_url",
"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | add_scope_ip | Function to add new host IP address allocation to existing scope ID
:param hostipaddress: ipv4 address of the target host to be added to the target scope
:param name: name of the owner of this host
:param description: Description of the host
:param auth: requests auth object #usually auth.creds from... | pyhpeimc/plat/termaccess.py | def add_scope_ip(hostipaddress, name, description, auth, url, scopeid=None, network_address=None):
"""
Function to add new host IP address allocation to existing scope ID
:param hostipaddress: ipv4 address of the target host to be added to the target scope
:param name: name of the owner of this host
... | def add_scope_ip(hostipaddress, name, description, auth, url, scopeid=None, network_address=None):
"""
Function to add new host IP address allocation to existing scope ID
:param hostipaddress: ipv4 address of the target host to be added to the target scope
:param name: name of the owner of this host
... | [
"Function",
"to",
"add",
"new",
"host",
"IP",
"address",
"allocation",
"to",
"existing",
"scope",
"ID"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L391-L440 | [
"def",
"add_scope_ip",
"(",
"hostipaddress",
",",
"name",
",",
"description",
",",
"auth",
",",
"url",
",",
"scopeid",
"=",
"None",
",",
"network_address",
"=",
"None",
")",
":",
"if",
"network_address",
"is",
"not",
"None",
":",
"scopeid",
"=",
"get_scope... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | remove_scope_ip | Function to add remove IP address allocation
:param hostid: Host id of the host to be deleted
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: String of HTTP response c... | pyhpeimc/plat/termaccess.py | def remove_scope_ip(hostid, auth, url):
"""
Function to add remove IP address allocation
:param hostid: Host id of the host to be deleted
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.au... | def remove_scope_ip(hostid, auth, url):
"""
Function to add remove IP address allocation
:param hostid: Host id of the host to be deleted
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.au... | [
"Function",
"to",
"add",
"remove",
"IP",
"address",
"allocation"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L443-L486 | [
"def",
"remove_scope_ip",
"(",
"hostid",
",",
"auth",
",",
"url",
")",
":",
"f_url",
"=",
"url",
"+",
"'/imcrs/res/access/assignedIpScope/ip/'",
"+",
"str",
"(",
"hostid",
")",
"response",
"=",
"requests",
".",
"delete",
"(",
"f_url",
",",
"auth",
"=",
"au... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_ip_scope_hosts | Function requires input of scope ID and returns list of allocated IP address for the
specified scope
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:param scopeid: Integer of t... | pyhpeimc/plat/termaccess.py | def get_ip_scope_hosts(auth, url, scopeid=None, network_address=None):
"""
Function requires input of scope ID and returns list of allocated IP address for the
specified scope
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interfa... | def get_ip_scope_hosts(auth, url, scopeid=None, network_address=None):
"""
Function requires input of scope ID and returns list of allocated IP address for the
specified scope
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interfa... | [
"Function",
"requires",
"input",
"of",
"scope",
"ID",
"and",
"returns",
"list",
"of",
"allocated",
"IP",
"address",
"for",
"the",
"specified",
"scope"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L489-L546 | [
"def",
"get_ip_scope_hosts",
"(",
"auth",
",",
"url",
",",
"scopeid",
"=",
"None",
",",
"network_address",
"=",
"None",
")",
":",
"if",
"network_address",
"is",
"not",
"None",
":",
"scopeid",
"=",
"get_scope_id",
"(",
"network_address",
",",
"auth",
",",
"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | delete_host_from_segment | :param hostipaddress: str ipv4 address of the target host to be deleted
:param networkaddress: ipv4 network address + subnet bits of target scope
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.au... | pyhpeimc/plat/termaccess.py | def delete_host_from_segment(hostipaddress, networkaddress, auth, url):
"""
:param hostipaddress: str ipv4 address of the target host to be deleted
:param networkaddress: ipv4 network address + subnet bits of target scope
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.cl... | def delete_host_from_segment(hostipaddress, networkaddress, auth, url):
"""
:param hostipaddress: str ipv4 address of the target host to be deleted
:param networkaddress: ipv4 network address + subnet bits of target scope
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.cl... | [
":",
"param",
"hostipaddress",
":",
"str",
"ipv4",
"address",
"of",
"the",
"target",
"host",
"to",
"be",
"deleted"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L578-L595 | [
"def",
"delete_host_from_segment",
"(",
"hostipaddress",
",",
"networkaddress",
",",
"auth",
",",
"url",
")",
":",
"host_id",
"=",
"get_host_id",
"(",
"hostipaddress",
",",
"networkaddress",
",",
"auth",
",",
"url",
")",
"delete_host",
"=",
"remove_scope_ip",
"(... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | allow_attribute_comments | This augmentation is to allow comments on class attributes, for example:
class SomeClass(object):
some_attribute = 5
''' This is a docstring for the above attribute ''' | pylint_common/augmentations.py | def allow_attribute_comments(chain, node):
"""
This augmentation is to allow comments on class attributes, for example:
class SomeClass(object):
some_attribute = 5
''' This is a docstring for the above attribute '''
"""
# TODO: find the relevant citation for why this is the correct... | def allow_attribute_comments(chain, node):
"""
This augmentation is to allow comments on class attributes, for example:
class SomeClass(object):
some_attribute = 5
''' This is a docstring for the above attribute '''
"""
# TODO: find the relevant citation for why this is the correct... | [
"This",
"augmentation",
"is",
"to",
"allow",
"comments",
"on",
"class",
"attributes",
"for",
"example",
":"
] | landscapeio/pylint-common | python | https://github.com/landscapeio/pylint-common/blob/c4d492ec25dca42e78508bf30dcfdac7ed71898f/pylint_common/augmentations.py#L12-L28 | [
"def",
"allow_attribute_comments",
"(",
"chain",
",",
"node",
")",
":",
"# TODO: find the relevant citation for why this is the correct way to comment attributes",
"if",
"isinstance",
"(",
"node",
".",
"previous_sibling",
"(",
")",
",",
"astroid",
".",
"Assign",
")",
"and... | c4d492ec25dca42e78508bf30dcfdac7ed71898f |
train | DownloadAudio.download | Params:
::url = Comprises the url used to download the audio.
::path = Comprises the location where the file should be saved.
::name_audio = Is the name of the desired audio.
Definition:
Basically, we do a get with the requests modu... | BingTranslator/utils.py | def download(self, url, path, name_audio):
"""
Params:
::url = Comprises the url used to download the audio.
::path = Comprises the location where the file should be saved.
::name_audio = Is the name of the desired audio.
Def... | def download(self, url, path, name_audio):
"""
Params:
::url = Comprises the url used to download the audio.
::path = Comprises the location where the file should be saved.
::name_audio = Is the name of the desired audio.
Def... | [
"Params",
":"
] | wilfilho/BingTranslator | python | https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/utils.py#L39-L61 | [
"def",
"download",
"(",
"self",
",",
"url",
",",
"path",
",",
"name_audio",
")",
":",
"if",
"path",
"is",
"not",
"None",
":",
"with",
"open",
"(",
"str",
"(",
"path",
"+",
"name_audio",
")",
",",
"'wb'",
")",
"as",
"handle",
":",
"response",
"=",
... | 6bada6fe1ac4177cc7dc62ff16dab561ba714534 |
train | get_dev_asset_details | Takes in ipaddress as input to fetch device assett details from HP IMC RESTFUL API
:param ipaddress: IP address of the device you wish to gather the asset details
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url... | build/lib/pyhpeimc/plat/netassets.py | def get_dev_asset_details(ipaddress, auth, url):
"""Takes in ipaddress as input to fetch device assett details from HP IMC RESTFUL API
:param ipaddress: IP address of the device you wish to gather the asset details
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:p... | def get_dev_asset_details(ipaddress, auth, url):
"""Takes in ipaddress as input to fetch device assett details from HP IMC RESTFUL API
:param ipaddress: IP address of the device you wish to gather the asset details
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:p... | [
"Takes",
"in",
"ipaddress",
"as",
"input",
"to",
"fetch",
"device",
"assett",
"details",
"from",
"HP",
"IMC",
"RESTFUL",
"API"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/netassets.py#L17-L59 | [
"def",
"get_dev_asset_details",
"(",
"ipaddress",
",",
"auth",
",",
"url",
")",
":",
"get_dev_asset_url",
"=",
"\"/imcrs/netasset/asset?assetDevice.ip=\"",
"+",
"str",
"(",
"ipaddress",
")",
"f_url",
"=",
"url",
"+",
"get_dev_asset_url",
"# creates the URL using the pay... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_dev_asset_details_all | Takes no input to fetch device assett details from HP IMC RESTFUL API
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionatires containing the device asset deta... | build/lib/pyhpeimc/plat/netassets.py | def get_dev_asset_details_all(auth, url):
"""Takes no input to fetch device assett details from HP IMC RESTFUL API
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list ... | def get_dev_asset_details_all(auth, url):
"""Takes no input to fetch device assett details from HP IMC RESTFUL API
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list ... | [
"Takes",
"no",
"input",
"to",
"fetch",
"device",
"assett",
"details",
"from",
"HP",
"IMC",
"RESTFUL",
"API"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/netassets.py#L61-L95 | [
"def",
"get_dev_asset_details_all",
"(",
"auth",
",",
"url",
")",
":",
"get_dev_asset_details_all_url",
"=",
"\"/imcrs/netasset/asset?start=0&size=15000\"",
"f_url",
"=",
"url",
"+",
"get_dev_asset_details_all_url",
"# creates the URL using the payload variable as the contents",
"r... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | check_database_connected | A built-in check to see if connecting to the configured default
database backend succeeds.
It's automatically added to the list of Dockerflow checks if a
:class:`~flask_sqlalchemy.SQLAlchemy` object is passed
to the :class:`~dockerflow.flask.app.Dockerflow` class during
instantiation, e.g.::
... | src/dockerflow/flask/checks/__init__.py | def check_database_connected(db):
"""
A built-in check to see if connecting to the configured default
database backend succeeds.
It's automatically added to the list of Dockerflow checks if a
:class:`~flask_sqlalchemy.SQLAlchemy` object is passed
to the :class:`~dockerflow.flask.app.Dockerflow`... | def check_database_connected(db):
"""
A built-in check to see if connecting to the configured default
database backend succeeds.
It's automatically added to the list of Dockerflow checks if a
:class:`~flask_sqlalchemy.SQLAlchemy` object is passed
to the :class:`~dockerflow.flask.app.Dockerflow`... | [
"A",
"built",
"-",
"in",
"check",
"to",
"see",
"if",
"connecting",
"to",
"the",
"configured",
"default",
"database",
"backend",
"succeeds",
"."
] | mozilla-services/python-dockerflow | python | https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/checks/__init__.py#L14-L46 | [
"def",
"check_database_connected",
"(",
"db",
")",
":",
"from",
"sqlalchemy",
".",
"exc",
"import",
"DBAPIError",
",",
"SQLAlchemyError",
"errors",
"=",
"[",
"]",
"try",
":",
"with",
"db",
".",
"engine",
".",
"connect",
"(",
")",
"as",
"connection",
":",
... | 43703c5e8934ba6901b0a1520d6da4ed6457208c |
train | check_migrations_applied | A built-in check to see if all migrations have been applied correctly.
It's automatically added to the list of Dockerflow checks if a
`flask_migrate.Migrate <https://flask-migrate.readthedocs.io/>`_ object
is passed to the :class:`~dockerflow.flask.app.Dockerflow` class during
instantiation, e.g.::
... | src/dockerflow/flask/checks/__init__.py | def check_migrations_applied(migrate):
"""
A built-in check to see if all migrations have been applied correctly.
It's automatically added to the list of Dockerflow checks if a
`flask_migrate.Migrate <https://flask-migrate.readthedocs.io/>`_ object
is passed to the :class:`~dockerflow.flask.app.Doc... | def check_migrations_applied(migrate):
"""
A built-in check to see if all migrations have been applied correctly.
It's automatically added to the list of Dockerflow checks if a
`flask_migrate.Migrate <https://flask-migrate.readthedocs.io/>`_ object
is passed to the :class:`~dockerflow.flask.app.Doc... | [
"A",
"built",
"-",
"in",
"check",
"to",
"see",
"if",
"all",
"migrations",
"have",
"been",
"applied",
"correctly",
"."
] | mozilla-services/python-dockerflow | python | https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/checks/__init__.py#L49-L93 | [
"def",
"check_migrations_applied",
"(",
"migrate",
")",
":",
"errors",
"=",
"[",
"]",
"from",
"alembic",
".",
"migration",
"import",
"MigrationContext",
"from",
"alembic",
".",
"script",
"import",
"ScriptDirectory",
"from",
"sqlalchemy",
".",
"exc",
"import",
"D... | 43703c5e8934ba6901b0a1520d6da4ed6457208c |
train | check_redis_connected | A built-in check to connect to Redis using the given client and see
if it responds to the ``PING`` command.
It's automatically added to the list of Dockerflow checks if a
:class:`~redis.StrictRedis` instances is passed
to the :class:`~dockerflow.flask.app.Dockerflow` class during
instantiation, e.g... | src/dockerflow/flask/checks/__init__.py | def check_redis_connected(client):
"""
A built-in check to connect to Redis using the given client and see
if it responds to the ``PING`` command.
It's automatically added to the list of Dockerflow checks if a
:class:`~redis.StrictRedis` instances is passed
to the :class:`~dockerflow.flask.app.... | def check_redis_connected(client):
"""
A built-in check to connect to Redis using the given client and see
if it responds to the ``PING`` command.
It's automatically added to the list of Dockerflow checks if a
:class:`~redis.StrictRedis` instances is passed
to the :class:`~dockerflow.flask.app.... | [
"A",
"built",
"-",
"in",
"check",
"to",
"connect",
"to",
"Redis",
"using",
"the",
"given",
"client",
"and",
"see",
"if",
"it",
"responds",
"to",
"the",
"PING",
"command",
"."
] | mozilla-services/python-dockerflow | python | https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/checks/__init__.py#L96-L145 | [
"def",
"check_redis_connected",
"(",
"client",
")",
":",
"import",
"redis",
"errors",
"=",
"[",
"]",
"try",
":",
"result",
"=",
"client",
".",
"ping",
"(",
")",
"except",
"redis",
".",
"ConnectionError",
"as",
"e",
":",
"msg",
"=",
"'Could not connect to r... | 43703c5e8934ba6901b0a1520d6da4ed6457208c |
train | get_custom_views | function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name
argument will return only the specified view.
:param name: str containing the name of the desired custom view
:return: list of dictionaties containing attributes of the custom views | build/lib/pyhpimc/plat/groups.py | def get_custom_views(auth, url,name=None,headers=HEADERS):
"""
function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name
argument will return only the specified view.
:param name: str containing the name of the desired custom view
:return: list of d... | def get_custom_views(auth, url,name=None,headers=HEADERS):
"""
function requires no input and returns a list of dictionaries of custom views from an HPE IMC. Optional name
argument will return only the specified view.
:param name: str containing the name of the desired custom view
:return: list of d... | [
"function",
"requires",
"no",
"input",
"and",
"returns",
"a",
"list",
"of",
"dictionaries",
"of",
"custom",
"views",
"from",
"an",
"HPE",
"IMC",
".",
"Optional",
"name",
"argument",
"will",
"return",
"only",
"the",
"specified",
"view",
".",
":",
"param",
"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/groups.py#L42-L64 | [
"def",
"get_custom_views",
"(",
"auth",
",",
"url",
",",
"name",
"=",
"None",
",",
"headers",
"=",
"HEADERS",
")",
":",
"if",
"name",
"is",
"None",
":",
"get_custom_view_url",
"=",
"'/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false&total=false'",
"elif"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | create_custom_views | function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input
will return only the specified view.
:param name: string containg the name of the desired custom view
:return: list of dictionaries containing attributes of the custom views. | build/lib/pyhpimc/plat/groups.py | def create_custom_views(auth, url,name=None, upperview=None):
"""
function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input
will return only the specified view.
:param name: string containg the name of the desired custom view
:return: list of d... | def create_custom_views(auth, url,name=None, upperview=None):
"""
function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optioanl Name input
will return only the specified view.
:param name: string containg the name of the desired custom view
:return: list of d... | [
"function",
"takes",
"no",
"input",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"get",
"a",
"list",
"of",
"custom",
"views",
"from",
"HPE",
"IMC",
".",
"Optioanl",
"Name",
"input",
"will",
"return",
"only",
"the",
"specified",
"view",
".",
":",
"param... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/groups.py#L67-L90 | [
"def",
"create_custom_views",
"(",
"auth",
",",
"url",
",",
"name",
"=",
"None",
",",
"upperview",
"=",
"None",
")",
":",
"create_custom_views_url",
"=",
"'/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false&total=false'",
"f_url",
"=",
"url",
"+",
"create_c... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_dev_run_config | function takes the devId of a specific device and issues a RESTFUL call to get the most current running config
file as known by the HP IMC Base Platform ICC module for the target device.
:param devid: int or str value of the target device
:return: str which contains the entire content of the target device ... | build/lib/pyhpimc/plat/device.py | def get_dev_run_config(devid, auth, url):
"""
function takes the devId of a specific device and issues a RESTFUL call to get the most current running config
file as known by the HP IMC Base Platform ICC module for the target device.
:param devid: int or str value of the target device
:return: str w... | def get_dev_run_config(devid, auth, url):
"""
function takes the devId of a specific device and issues a RESTFUL call to get the most current running config
file as known by the HP IMC Base Platform ICC module for the target device.
:param devid: int or str value of the target device
:return: str w... | [
"function",
"takes",
"the",
"devId",
"of",
"a",
"specific",
"device",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"get",
"the",
"most",
"current",
"running",
"config",
"file",
"as",
"known",
"by",
"the",
"HP",
"IMC",
"Base",
"Platform",
"ICC",
"module",... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/device.py#L91-L114 | [
"def",
"get_dev_run_config",
"(",
"devid",
",",
"auth",
",",
"url",
")",
":",
"# checks to see if the imc credentials are already available",
"get_dev_run_url",
"=",
"\"/imcrs/icc/deviceCfg/\"",
"+",
"str",
"(",
"devid",
")",
"+",
"\"/currentRun\"",
"f_url",
"=",
"url",... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_dev_start_config | function takes the devId of a specific device and issues a RESTFUL call to get the most current startup config
file as known by the HP IMC Base Platform ICC module for the target device.
:param devId: int or str value of the target device
:return: str which contains the entire content of the target device ... | build/lib/pyhpimc/plat/device.py | def get_dev_start_config(devId, auth, url):
"""
function takes the devId of a specific device and issues a RESTFUL call to get the most current startup config
file as known by the HP IMC Base Platform ICC module for the target device.
:param devId: int or str value of the target device
:return: str... | def get_dev_start_config(devId, auth, url):
"""
function takes the devId of a specific device and issues a RESTFUL call to get the most current startup config
file as known by the HP IMC Base Platform ICC module for the target device.
:param devId: int or str value of the target device
:return: str... | [
"function",
"takes",
"the",
"devId",
"of",
"a",
"specific",
"device",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"get",
"the",
"most",
"current",
"startup",
"config",
"file",
"as",
"known",
"by",
"the",
"HP",
"IMC",
"Base",
"Platform",
"ICC",
"module",... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/device.py#L117-L140 | [
"def",
"get_dev_start_config",
"(",
"devId",
",",
"auth",
",",
"url",
")",
":",
"# checks to see if the imc credentials are already available",
"get_dev_run_url",
"=",
"\"/imcrs/icc/deviceCfg/\"",
"+",
"str",
"(",
"devId",
")",
"+",
"\"/currentStart\"",
"f_url",
"=",
"u... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | set_inteface_up | function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec
ified interface on the target device.
:param devid: int or str value of the target device
:param ifindex: int or str value of the target interface
:return: HTTP status code 204 with no va... | build/lib/pyhpimc/plat/device.py | def set_inteface_up(devid, ifindex, auth, url):
"""
function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec
ified interface on the target device.
:param devid: int or str value of the target device
:param ifindex: int or str value of the t... | def set_inteface_up(devid, ifindex, auth, url):
"""
function takest devid and ifindex of specific device and interface and issues a RESTFUL call to "undo shut" the spec
ified interface on the target device.
:param devid: int or str value of the target device
:param ifindex: int or str value of the t... | [
"function",
"takest",
"devid",
"and",
"ifindex",
"of",
"specific",
"device",
"and",
"interface",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"undo",
"shut",
"the",
"spec",
"ified",
"interface",
"on",
"the",
"target",
"device",
".",
":",
"param",
"devid",
... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/device.py#L186-L202 | [
"def",
"set_inteface_up",
"(",
"devid",
",",
"ifindex",
",",
"auth",
",",
"url",
")",
":",
"set_int_up_url",
"=",
"\"/imcrs/plat/res/device/\"",
"+",
"str",
"(",
"devid",
")",
"+",
"\"/interface/\"",
"+",
"str",
"(",
"ifindex",
")",
"+",
"\"/up\"",
"f_url",
... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | vfolders | List and manage virtual folders. | src/ai/backend/client/cli/admin/vfolders.py | def vfolders(access_key):
'''
List and manage virtual folders.
'''
fields = [
('Name', 'name'),
('Created At', 'created_at'),
('Last Used', 'last_used'),
('Max Files', 'max_files'),
('Max Size', 'max_size'),
]
if access_key is None:
q = 'query { vf... | def vfolders(access_key):
'''
List and manage virtual folders.
'''
fields = [
('Name', 'name'),
('Created At', 'created_at'),
('Last Used', 'last_used'),
('Max Files', 'max_files'),
('Max Size', 'max_size'),
]
if access_key is None:
q = 'query { vf... | [
"List",
"and",
"manage",
"virtual",
"folders",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/vfolders.py#L15-L39 | [
"def",
"vfolders",
"(",
"access_key",
")",
":",
"fields",
"=",
"[",
"(",
"'Name'",
",",
"'name'",
")",
",",
"(",
"'Created At'",
",",
"'created_at'",
")",
",",
"(",
"'Last Used'",
",",
"'last_used'",
")",
",",
"(",
"'Max Files'",
",",
"'max_files'",
")",... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | config | Shows the current configuration. | src/ai/backend/client/cli/config.py | def config():
'''
Shows the current configuration.
'''
config = get_config()
print('Client version: {0}'.format(click.style(__version__, bold=True)))
print('API endpoint: {0}'.format(click.style(str(config.endpoint), bold=True)))
print('API version: {0}'.format(click.style(config.version, bo... | def config():
'''
Shows the current configuration.
'''
config = get_config()
print('Client version: {0}'.format(click.style(__version__, bold=True)))
print('API endpoint: {0}'.format(click.style(str(config.endpoint), bold=True)))
print('API version: {0}'.format(click.style(config.version, bo... | [
"Shows",
"the",
"current",
"configuration",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/config.py#L9-L23 | [
"def",
"config",
"(",
")",
":",
"config",
"=",
"get_config",
"(",
")",
"print",
"(",
"'Client version: {0}'",
".",
"format",
"(",
"click",
".",
"style",
"(",
"__version__",
",",
"bold",
"=",
"True",
")",
")",
")",
"print",
"(",
"'API endpoint: {0}'",
"."... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | get_system_vendors | Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries where each dictionary represents a single ... | build/lib/pyhpeimc/plat/device.py | def get_system_vendors(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries ... | def get_system_vendors(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries ... | [
"Takes",
"string",
"no",
"input",
"to",
"issue",
"RESTUL",
"call",
"to",
"HP",
"IMC",
"\\",
"n"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L22-L57 | [
"def",
"get_system_vendors",
"(",
"auth",
",",
"url",
")",
":",
"get_system_vendors_url",
"=",
"'/imcrs/plat/res/vendor?start=0&size=10000&orderBy=id&desc=false&total=false'",
"f_url",
"=",
"url",
"+",
"get_system_vendors_url",
"# creates the URL using the payload variable as the con... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_system_category | Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries where each dictionary represents a single ... | build/lib/pyhpeimc/plat/device.py | def get_system_category(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries... | def get_system_category(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries... | [
"Takes",
"string",
"no",
"input",
"to",
"issue",
"RESTUL",
"call",
"to",
"HP",
"IMC",
"\\",
"n"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L60-L95 | [
"def",
"get_system_category",
"(",
"auth",
",",
"url",
")",
":",
"get_system_category_url",
"=",
"'/imcrs/plat/res/category?start=0&size=10000&orderBy=id&desc=false&total=false'",
"f_url",
"=",
"url",
"+",
"get_system_category_url",
"# creates the URL using the payload variable as th... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_system_device_models | Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries where each dictionary represents a single ... | build/lib/pyhpeimc/plat/device.py | def get_system_device_models(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of diction... | def get_system_device_models(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of diction... | [
"Takes",
"string",
"no",
"input",
"to",
"issue",
"RESTUL",
"call",
"to",
"HP",
"IMC",
"\\",
"n"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L98-L132 | [
"def",
"get_system_device_models",
"(",
"auth",
",",
"url",
")",
":",
"get_system_device_model_url",
"=",
"'/imcrs/plat/res/model?start=0&size=10000&orderBy=id&desc=false&total=false'",
"f_url",
"=",
"url",
"+",
"get_system_device_model_url",
"# creates the URL using the payload vari... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_system_series | Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries where each dictionary represents a single ... | build/lib/pyhpeimc/plat/device.py | def get_system_series(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries w... | def get_system_series(auth, url):
"""Takes string no input to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:return: list of dictionaries w... | [
"Takes",
"string",
"no",
"input",
"to",
"issue",
"RESTUL",
"call",
"to",
"HP",
"IMC",
"\\",
"n"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L135-L171 | [
"def",
"get_system_series",
"(",
"auth",
",",
"url",
")",
":",
"get_system_series_url",
"=",
"'/imcrs/plat/res/series?managedOnly=false&start=0&size=10000&orderBy=id&desc=false&total=false'",
"f_url",
"=",
"url",
"+",
"get_system_series_url",
"# creates the URL using the payload vari... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_all_devs | Takes string input of IP address to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:param network_address= str IPv4 Network Address
:return: dict... | build/lib/pyhpeimc/plat/device.py | def get_all_devs(auth, url, network_address= None):
"""Takes string input of IP address to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:param n... | def get_all_devs(auth, url, network_address= None):
"""Takes string input of IP address to issue RESTUL call to HP IMC\n
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.authclass
:param n... | [
"Takes",
"string",
"input",
"of",
"IP",
"address",
"to",
"issue",
"RESTUL",
"call",
"to",
"HP",
"IMC",
"\\",
"n"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L177-L224 | [
"def",
"get_all_devs",
"(",
"auth",
",",
"url",
",",
"network_address",
"=",
"None",
")",
":",
"if",
"network_address",
"!=",
"None",
":",
"get_all_devs_url",
"=",
"\"/imcrs/plat/res/device?resPrivilegeFilter=false&ip=\"",
"+",
"str",
"(",
"network_address",
")",
"+... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_dev_details | Takes string input of IP address to issue RESTUL call to HP IMC\n
:param ip_address: string object of dotted decimal notation of IPv4 address
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeimc.auth.a... | build/lib/pyhpeimc/plat/device.py | def get_dev_details(ip_address, auth, url):
"""Takes string input of IP address to issue RESTUL call to HP IMC\n
:param ip_address: string object of dotted decimal notation of IPv4 address
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC ... | def get_dev_details(ip_address, auth, url):
"""Takes string input of IP address to issue RESTUL call to HP IMC\n
:param ip_address: string object of dotted decimal notation of IPv4 address
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC ... | [
"Takes",
"string",
"input",
"of",
"IP",
"address",
"to",
"issue",
"RESTUL",
"call",
"to",
"HP",
"IMC",
"\\",
"n"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L227-L280 | [
"def",
"get_dev_details",
"(",
"ip_address",
",",
"auth",
",",
"url",
")",
":",
"get_dev_details_url",
"=",
"\"/imcrs/plat/res/device?resPrivilegeFilter=false&ip=\"",
"+",
"str",
"(",
"ip_address",
")",
"+",
"\"&start=0&size=1000&orderBy=id&desc=false&total=false\"",
"f_url",... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_dev_interface | Function takes devid as input to RESTFUL call to HP IMC platform and returns list of device interfaces
:param devid: requires devid as the only input
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interface #usually auth.url from pyhpeim... | build/lib/pyhpeimc/plat/device.py | def get_dev_interface(devid, auth, url):
"""
Function takes devid as input to RESTFUL call to HP IMC platform and returns list of device interfaces
:param devid: requires devid as the only input
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base u... | def get_dev_interface(devid, auth, url):
"""
Function takes devid as input to RESTFUL call to HP IMC platform and returns list of device interfaces
:param devid: requires devid as the only input
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base u... | [
"Function",
"takes",
"devid",
"as",
"input",
"to",
"RESTFUL",
"call",
"to",
"HP",
"IMC",
"platform",
"and",
"returns",
"list",
"of",
"device",
"interfaces"
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L283-L323 | [
"def",
"get_dev_interface",
"(",
"devid",
",",
"auth",
",",
"url",
")",
":",
"get_dev_interface_url",
"=",
"\"/imcrs/plat/res/device/\"",
"+",
"str",
"(",
"devid",
")",
"+",
"\"/interface?start=0&size=1000&desc=false&total=false\"",
"f_url",
"=",
"url",
"+",
"get_dev_... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_dev_mac_learn | function takes devid of specific device and issues a RESTFUL call to gather the current IP-MAC learning entries on
the target device.
:param devid: int value of the target device
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class
:param url: base url of IMC RS interfa... | build/lib/pyhpeimc/plat/device.py | def get_dev_mac_learn(devid, auth, url):
'''
function takes devid of specific device and issues a RESTFUL call to gather the current IP-MAC learning entries on
the target device.
:param devid: int value of the target device
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.a... | def get_dev_mac_learn(devid, auth, url):
'''
function takes devid of specific device and issues a RESTFUL call to gather the current IP-MAC learning entries on
the target device.
:param devid: int value of the target device
:param auth: requests auth object #usually auth.creds from auth pyhpeimc.a... | [
"function",
"takes",
"devid",
"of",
"specific",
"device",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"gather",
"the",
"current",
"IP",
"-",
"MAC",
"learning",
"entries",
"on",
"the",
"target",
"device",
"."
] | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L416-L456 | [
"def",
"get_dev_mac_learn",
"(",
"devid",
",",
"auth",
",",
"url",
")",
":",
"get_dev_mac_learn_url",
"=",
"'/imcrs/res/access/ipMacLearn/'",
"+",
"str",
"(",
"devid",
")",
"f_url",
"=",
"url",
"+",
"get_dev_mac_learn_url",
"try",
":",
"r",
"=",
"requests",
".... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | run_dev_cmd | Function takes devid of target device and a sequential list of strings which define the specific commands to be run
on the target device and returns a str object containing the output of the commands.
:param devid: int devid of the target device
:param cmd_list: list of strings
:return: str containing... | build/lib/pyhpeimc/plat/device.py | def run_dev_cmd(devid, cmd_list, auth, url):
'''
Function takes devid of target device and a sequential list of strings which define the specific commands to be run
on the target device and returns a str object containing the output of the commands.
:param devid: int devid of the target device
:par... | def run_dev_cmd(devid, cmd_list, auth, url):
'''
Function takes devid of target device and a sequential list of strings which define the specific commands to be run
on the target device and returns a str object containing the output of the commands.
:param devid: int devid of the target device
:par... | [
"Function",
"takes",
"devid",
"of",
"target",
"device",
"and",
"a",
"sequential",
"list",
"of",
"strings",
"which",
"define",
"the",
"specific",
"commands",
"to",
"be",
"run",
"on",
"the",
"target",
"device",
"and",
"returns",
"a",
"str",
"object",
"containi... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L459-L501 | [
"def",
"run_dev_cmd",
"(",
"devid",
",",
"cmd_list",
",",
"auth",
",",
"url",
")",
":",
"run_dev_cmd_url",
"=",
"'/imcrs/icc/confFile/executeCmd'",
"f_url",
"=",
"url",
"+",
"run_dev_cmd_url",
"cmd_list",
"=",
"_make_cmd_list",
"(",
"cmd_list",
")",
"payload",
"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_all_interface_details | function takes the devId of a specific device and the ifindex value assigned to a specific interface
and issues a RESTFUL call to get the interface details
file as known by the HP IMC Base Platform ICC module for the target device.
:param devId: int or str value of the devId of the target device
:par... | build/lib/pyhpeimc/plat/device.py | def get_all_interface_details(devId, auth, url):
"""
function takes the devId of a specific device and the ifindex value assigned to a specific interface
and issues a RESTFUL call to get the interface details
file as known by the HP IMC Base Platform ICC module for the target device.
:param devId: ... | def get_all_interface_details(devId, auth, url):
"""
function takes the devId of a specific device and the ifindex value assigned to a specific interface
and issues a RESTFUL call to get the interface details
file as known by the HP IMC Base Platform ICC module for the target device.
:param devId: ... | [
"function",
"takes",
"the",
"devId",
"of",
"a",
"specific",
"device",
"and",
"the",
"ifindex",
"value",
"assigned",
"to",
"a",
"specific",
"interface",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"get",
"the",
"interface",
"details",
"file",
"as",
"known"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L509-L551 | [
"def",
"get_all_interface_details",
"(",
"devId",
",",
"auth",
",",
"url",
")",
":",
"get_all_interface_details_url",
"=",
"\"/imcrs/plat/res/device/\"",
"+",
"str",
"(",
"devId",
")",
"+",
"\"/interface/?start=0&size=1000&desc=false&total=false\"",
"f_url",
"=",
"url",
... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | get_interface_details | function takes the devId of a specific device and the ifindex value assigned to a specific interface
and issues a RESTFUL call to get the interface details
file as known by the HP IMC Base Platform ICC module for the target device.
:param devId: int or str value of the devId of the target device
:par... | build/lib/pyhpeimc/plat/device.py | def get_interface_details(devId, ifIndex, auth, url):
"""
function takes the devId of a specific device and the ifindex value assigned to a specific interface
and issues a RESTFUL call to get the interface details
file as known by the HP IMC Base Platform ICC module for the target device.
:param de... | def get_interface_details(devId, ifIndex, auth, url):
"""
function takes the devId of a specific device and the ifindex value assigned to a specific interface
and issues a RESTFUL call to get the interface details
file as known by the HP IMC Base Platform ICC module for the target device.
:param de... | [
"function",
"takes",
"the",
"devId",
"of",
"a",
"specific",
"device",
"and",
"the",
"ifindex",
"value",
"assigned",
"to",
"a",
"specific",
"interface",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"get",
"the",
"interface",
"details",
"file",
"as",
"known"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L554-L597 | [
"def",
"get_interface_details",
"(",
"devId",
",",
"ifIndex",
",",
"auth",
",",
"url",
")",
":",
"get_interface_details_url",
"=",
"\"/imcrs/plat/res/device/\"",
"+",
"str",
"(",
"devId",
")",
"+",
"\"/interface/\"",
"+",
"str",
"(",
"ifIndex",
")",
"f_url",
"... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | set_interface_down | function takest devid and ifindex of specific device and interface and issues a RESTFUL call to " shut" the specifie
d interface on the target device.
:param devid: int or str value of the target device
:param ifindex: int or str value of the target interface
:param auth: requests auth object #usually... | build/lib/pyhpeimc/plat/device.py | def set_interface_down(devid, ifindex, auth, url):
"""
function takest devid and ifindex of specific device and interface and issues a RESTFUL call to " shut" the specifie
d interface on the target device.
:param devid: int or str value of the target device
:param ifindex: int or str value of the t... | def set_interface_down(devid, ifindex, auth, url):
"""
function takest devid and ifindex of specific device and interface and issues a RESTFUL call to " shut" the specifie
d interface on the target device.
:param devid: int or str value of the target device
:param ifindex: int or str value of the t... | [
"function",
"takest",
"devid",
"and",
"ifindex",
"of",
"specific",
"device",
"and",
"interface",
"and",
"issues",
"a",
"RESTFUL",
"call",
"to",
"shut",
"the",
"specifie",
"d",
"interface",
"on",
"the",
"target",
"device",
".",
":",
"param",
"devid",
":",
"... | HPENetworking/PYHPEIMC | python | https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L600-L638 | [
"def",
"set_interface_down",
"(",
"devid",
",",
"ifindex",
",",
"auth",
",",
"url",
")",
":",
"set_int_down_url",
"=",
"\"/imcrs/plat/res/device/\"",
"+",
"str",
"(",
"devid",
")",
"+",
"\"/interface/\"",
"+",
"str",
"(",
"ifindex",
")",
"+",
"\"/down\"",
"f... | 4fba31827573587e03a6233c7db60f188038c8e5 |
train | ResourcePolicy.create | Creates a new keypair resource policy with the given options.
You need an admin privilege for this operation. | src/ai/backend/client/resource_policy.py | async def create(cls, name: str,
default_for_unspecified: int,
total_resource_slots: int,
max_concurrent_sessions: int,
max_containers_per_session: int,
max_vfolder_count: int,
max_vfolder_size:... | async def create(cls, name: str,
default_for_unspecified: int,
total_resource_slots: int,
max_concurrent_sessions: int,
max_containers_per_session: int,
max_vfolder_count: int,
max_vfolder_size:... | [
"Creates",
"a",
"new",
"keypair",
"resource",
"policy",
"with",
"the",
"given",
"options",
".",
"You",
"need",
"an",
"admin",
"privilege",
"for",
"this",
"operation",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/resource_policy.py#L23-L66 | [
"async",
"def",
"create",
"(",
"cls",
",",
"name",
":",
"str",
",",
"default_for_unspecified",
":",
"int",
",",
"total_resource_slots",
":",
"int",
",",
"max_concurrent_sessions",
":",
"int",
",",
"max_containers_per_session",
":",
"int",
",",
"max_vfolder_count",... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | ResourcePolicy.list | Lists the keypair resource policies.
You need an admin privilege for this operation. | src/ai/backend/client/resource_policy.py | async def list(cls, fields: Iterable[str] = None) -> Sequence[dict]:
'''
Lists the keypair resource policies.
You need an admin privilege for this operation.
'''
if fields is None:
fields = (
'name', 'created_at',
'total_resource_slots'... | async def list(cls, fields: Iterable[str] = None) -> Sequence[dict]:
'''
Lists the keypair resource policies.
You need an admin privilege for this operation.
'''
if fields is None:
fields = (
'name', 'created_at',
'total_resource_slots'... | [
"Lists",
"the",
"keypair",
"resource",
"policies",
".",
"You",
"need",
"an",
"admin",
"privilege",
"for",
"this",
"operation",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/resource_policy.py#L138-L162 | [
"async",
"def",
"list",
"(",
"cls",
",",
"fields",
":",
"Iterable",
"[",
"str",
"]",
"=",
"None",
")",
"->",
"Sequence",
"[",
"dict",
"]",
":",
"if",
"fields",
"is",
"None",
":",
"fields",
"=",
"(",
"'name'",
",",
"'created_at'",
",",
"'total_resourc... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | keypair | Show the server-side information of the currently configured access key. | src/ai/backend/client/cli/admin/keypairs.py | def keypair():
'''
Show the server-side information of the currently configured access key.
'''
fields = [
('User ID', 'user_id'),
('Access Key', 'access_key'),
('Secret Key', 'secret_key'),
('Active?', 'is_active'),
('Admin?', 'is_admin'),
('Created At', ... | def keypair():
'''
Show the server-side information of the currently configured access key.
'''
fields = [
('User ID', 'user_id'),
('Access Key', 'access_key'),
('Secret Key', 'secret_key'),
('Active?', 'is_active'),
('Admin?', 'is_admin'),
('Created At', ... | [
"Show",
"the",
"server",
"-",
"side",
"information",
"of",
"the",
"currently",
"configured",
"access",
"key",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/keypairs.py#L12-L39 | [
"def",
"keypair",
"(",
")",
":",
"fields",
"=",
"[",
"(",
"'User ID'",
",",
"'user_id'",
")",
",",
"(",
"'Access Key'",
",",
"'access_key'",
")",
",",
"(",
"'Secret Key'",
",",
"'secret_key'",
")",
",",
"(",
"'Active?'",
",",
"'is_active'",
")",
",",
"... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | keypairs | List and manage keypairs.
To show all keypairs or other user's, your access key must have the admin
privilege.
(admin privilege required) | src/ai/backend/client/cli/admin/keypairs.py | def keypairs(ctx, user_id, is_active):
'''
List and manage keypairs.
To show all keypairs or other user's, your access key must have the admin
privilege.
(admin privilege required)
'''
if ctx.invoked_subcommand is not None:
return
fields = [
('User ID', 'user_id'),
... | def keypairs(ctx, user_id, is_active):
'''
List and manage keypairs.
To show all keypairs or other user's, your access key must have the admin
privilege.
(admin privilege required)
'''
if ctx.invoked_subcommand is not None:
return
fields = [
('User ID', 'user_id'),
... | [
"List",
"and",
"manage",
"keypairs",
".",
"To",
"show",
"all",
"keypairs",
"or",
"other",
"user",
"s",
"your",
"access",
"key",
"must",
"have",
"the",
"admin",
"privilege",
".",
"(",
"admin",
"privilege",
"required",
")"
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/keypairs.py#L48-L86 | [
"def",
"keypairs",
"(",
"ctx",
",",
"user_id",
",",
"is_active",
")",
":",
"if",
"ctx",
".",
"invoked_subcommand",
"is",
"not",
"None",
":",
"return",
"fields",
"=",
"[",
"(",
"'User ID'",
",",
"'user_id'",
")",
",",
"(",
"'Access Key'",
",",
"'access_ke... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | add | Add a new keypair.
USER_ID: User ID of a new key pair.
RESOURCE_POLICY: resource policy for new key pair. | src/ai/backend/client/cli/admin/keypairs.py | def add(user_id, resource_policy, admin, inactive, rate_limit):
'''
Add a new keypair.
USER_ID: User ID of a new key pair.
RESOURCE_POLICY: resource policy for new key pair.
'''
try:
user_id = int(user_id)
except ValueError:
pass # string-based user ID for Backend.AI v1.4+... | def add(user_id, resource_policy, admin, inactive, rate_limit):
'''
Add a new keypair.
USER_ID: User ID of a new key pair.
RESOURCE_POLICY: resource policy for new key pair.
'''
try:
user_id = int(user_id)
except ValueError:
pass # string-based user ID for Backend.AI v1.4+... | [
"Add",
"a",
"new",
"keypair",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/keypairs.py#L98-L125 | [
"def",
"add",
"(",
"user_id",
",",
"resource_policy",
",",
"admin",
",",
"inactive",
",",
"rate_limit",
")",
":",
"try",
":",
"user_id",
"=",
"int",
"(",
"user_id",
")",
"except",
"ValueError",
":",
"pass",
"# string-based user ID for Backend.AI v1.4+",
"with",
... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | update | Update an existing keypair.
ACCESS_KEY: Access key of an existing key pair. | src/ai/backend/client/cli/admin/keypairs.py | def update(access_key, resource_policy, is_admin, is_active, rate_limit):
'''
Update an existing keypair.
ACCESS_KEY: Access key of an existing key pair.
'''
with Session() as session:
try:
data = session.KeyPair.update(
access_key,
is_active=is_... | def update(access_key, resource_policy, is_admin, is_active, rate_limit):
'''
Update an existing keypair.
ACCESS_KEY: Access key of an existing key pair.
'''
with Session() as session:
try:
data = session.KeyPair.update(
access_key,
is_active=is_... | [
"Update",
"an",
"existing",
"keypair",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/keypairs.py#L134-L154 | [
"def",
"update",
"(",
"access_key",
",",
"resource_policy",
",",
"is_admin",
",",
"is_active",
",",
"rate_limit",
")",
":",
"with",
"Session",
"(",
")",
"as",
"session",
":",
"try",
":",
"data",
"=",
"session",
".",
"KeyPair",
".",
"update",
"(",
"access... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | delete | Delete an existing keypair.
ACCESSKEY: ACCESSKEY for a keypair to delete. | src/ai/backend/client/cli/admin/keypairs.py | def delete(access_key):
"""
Delete an existing keypair.
ACCESSKEY: ACCESSKEY for a keypair to delete.
"""
with Session() as session:
try:
data = session.KeyPair.delete(access_key)
except Exception as e:
print_error(e)
sys.exit(1)
if not da... | def delete(access_key):
"""
Delete an existing keypair.
ACCESSKEY: ACCESSKEY for a keypair to delete.
"""
with Session() as session:
try:
data = session.KeyPair.delete(access_key)
except Exception as e:
print_error(e)
sys.exit(1)
if not da... | [
"Delete",
"an",
"existing",
"keypair",
"."
] | lablup/backend.ai-client-py | python | https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/keypairs.py#L159-L174 | [
"def",
"delete",
"(",
"access_key",
")",
":",
"with",
"Session",
"(",
")",
"as",
"session",
":",
"try",
":",
"data",
"=",
"session",
".",
"KeyPair",
".",
"delete",
"(",
"access_key",
")",
"except",
"Exception",
"as",
"e",
":",
"print_error",
"(",
"e",
... | a063d774fea6f4350b89498c40d3c837ec3029a7 |
train | WebClient.login | perform API auth test returning user and team | slacksocket/webclient.py | def login(self):
""" perform API auth test returning user and team """
log.debug('performing auth test')
test = self._get(urls['test'])
user = User({ 'name': test['user'], 'id': test['user_id'] })
self._refresh()
return test['team'], user | def login(self):
""" perform API auth test returning user and team """
log.debug('performing auth test')
test = self._get(urls['test'])
user = User({ 'name': test['user'], 'id': test['user_id'] })
self._refresh()
return test['team'], user | [
"perform",
"API",
"auth",
"test",
"returning",
"user",
"and",
"team"
] | vektorlab/slacksocket | python | https://github.com/vektorlab/slacksocket/blob/8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f/slacksocket/webclient.py#L26-L32 | [
"def",
"login",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'performing auth test'",
")",
"test",
"=",
"self",
".",
"_get",
"(",
"urls",
"[",
"'test'",
"]",
")",
"user",
"=",
"User",
"(",
"{",
"'name'",
":",
"test",
"[",
"'user'",
"]",
",",
... | 8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f |
train | WebClient.user | Return User object for a given Slack ID or name | slacksocket/webclient.py | def user(self, match):
""" Return User object for a given Slack ID or name """
if len(match) == 9 and match[0] == 'U':
return self._lookup(User, 'id', match)
return self._lookup(User, 'name', match) | def user(self, match):
""" Return User object for a given Slack ID or name """
if len(match) == 9 and match[0] == 'U':
return self._lookup(User, 'id', match)
return self._lookup(User, 'name', match) | [
"Return",
"User",
"object",
"for",
"a",
"given",
"Slack",
"ID",
"or",
"name"
] | vektorlab/slacksocket | python | https://github.com/vektorlab/slacksocket/blob/8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f/slacksocket/webclient.py#L42-L46 | [
"def",
"user",
"(",
"self",
",",
"match",
")",
":",
"if",
"len",
"(",
"match",
")",
"==",
"9",
"and",
"match",
"[",
"0",
"]",
"==",
"'U'",
":",
"return",
"self",
".",
"_lookup",
"(",
"User",
",",
"'id'",
",",
"match",
")",
"return",
"self",
"."... | 8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f |
train | WebClient.channel | Return Channel object for a given Slack ID or name | slacksocket/webclient.py | def channel(self, match):
""" Return Channel object for a given Slack ID or name """
if len(match) == 9 and match[0] in ('C','G','D'):
return self._lookup(Channel, 'id', match)
return self._lookup(Channel, 'name', match) | def channel(self, match):
""" Return Channel object for a given Slack ID or name """
if len(match) == 9 and match[0] in ('C','G','D'):
return self._lookup(Channel, 'id', match)
return self._lookup(Channel, 'name', match) | [
"Return",
"Channel",
"object",
"for",
"a",
"given",
"Slack",
"ID",
"or",
"name"
] | vektorlab/slacksocket | python | https://github.com/vektorlab/slacksocket/blob/8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f/slacksocket/webclient.py#L48-L52 | [
"def",
"channel",
"(",
"self",
",",
"match",
")",
":",
"if",
"len",
"(",
"match",
")",
"==",
"9",
"and",
"match",
"[",
"0",
"]",
"in",
"(",
"'C'",
",",
"'G'",
",",
"'D'",
")",
":",
"return",
"self",
".",
"_lookup",
"(",
"Channel",
",",
"'id'",
... | 8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f |
train | WebClient._refresh | refresh internal directory cache | slacksocket/webclient.py | def _refresh(self):
""" refresh internal directory cache """
log.debug('refreshing directory cache')
self._users.update(list(self._user_gen()))
self._channels.update(list(self._channel_gen())) | def _refresh(self):
""" refresh internal directory cache """
log.debug('refreshing directory cache')
self._users.update(list(self._user_gen()))
self._channels.update(list(self._channel_gen())) | [
"refresh",
"internal",
"directory",
"cache"
] | vektorlab/slacksocket | python | https://github.com/vektorlab/slacksocket/blob/8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f/slacksocket/webclient.py#L122-L126 | [
"def",
"_refresh",
"(",
"self",
")",
":",
"log",
".",
"debug",
"(",
"'refreshing directory cache'",
")",
"self",
".",
"_users",
".",
"update",
"(",
"list",
"(",
"self",
".",
"_user_gen",
"(",
")",
")",
")",
"self",
".",
"_channels",
".",
"update",
"(",... | 8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f |
train | Directory.match | lookup object in directory with attribute matching value | slacksocket/webclient.py | def match(self, attr, val):
""" lookup object in directory with attribute matching value """
self._lock.acquire()
try:
for x in self:
if getattr(x, attr) == val:
return x
finally:
self._lock.release() | def match(self, attr, val):
""" lookup object in directory with attribute matching value """
self._lock.acquire()
try:
for x in self:
if getattr(x, attr) == val:
return x
finally:
self._lock.release() | [
"lookup",
"object",
"in",
"directory",
"with",
"attribute",
"matching",
"value"
] | vektorlab/slacksocket | python | https://github.com/vektorlab/slacksocket/blob/8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f/slacksocket/webclient.py#L155-L163 | [
"def",
"match",
"(",
"self",
",",
"attr",
",",
"val",
")",
":",
"self",
".",
"_lock",
".",
"acquire",
"(",
")",
"try",
":",
"for",
"x",
"in",
"self",
":",
"if",
"getattr",
"(",
"x",
",",
"attr",
")",
"==",
"val",
":",
"return",
"x",
"finally",
... | 8eb8b0f14fe80740217ea0aaf6feb7f736bdf57f |
train | _groups_of_size | Collect data into fixed-length chunks or blocks. | biggus/experimental/dask_engine.py | def _groups_of_size(iterable, n, fillvalue=None):
"""Collect data into fixed-length chunks or blocks."""
# _groups_of_size('ABCDEFG', 3, 'x') --> ABC DEF Gxx
args = [iter(iterable)] * n
return zip_longest(fillvalue=fillvalue, *args) | def _groups_of_size(iterable, n, fillvalue=None):
"""Collect data into fixed-length chunks or blocks."""
# _groups_of_size('ABCDEFG', 3, 'x') --> ABC DEF Gxx
args = [iter(iterable)] * n
return zip_longest(fillvalue=fillvalue, *args) | [
"Collect",
"data",
"into",
"fixed",
"-",
"length",
"chunks",
"or",
"blocks",
"."
] | SciTools/biggus | python | https://github.com/SciTools/biggus/blob/0a76fbe7806dd6295081cd399bcb76135d834d25/biggus/experimental/dask_engine.py#L94-L98 | [
"def",
"_groups_of_size",
"(",
"iterable",
",",
"n",
",",
"fillvalue",
"=",
"None",
")",
":",
"# _groups_of_size('ABCDEFG', 3, 'x') --> ABC DEF Gxx",
"args",
"=",
"[",
"iter",
"(",
"iterable",
")",
"]",
"*",
"n",
"return",
"zip_longest",
"(",
"fillvalue",
"=",
... | 0a76fbe7806dd6295081cd399bcb76135d834d25 |
train | slice_repr | Turn things like `slice(None, 2, -1)` into `:2:-1`. | biggus/experimental/dask_engine.py | def slice_repr(slice_instance):
"""
Turn things like `slice(None, 2, -1)` into `:2:-1`.
"""
if not isinstance(slice_instance, slice):
raise TypeError('Unhandled type {}'.format(type(slice_instance)))
start = slice_instance.start or ''
stop = slice_instance.stop or ''
step = slice_in... | def slice_repr(slice_instance):
"""
Turn things like `slice(None, 2, -1)` into `:2:-1`.
"""
if not isinstance(slice_instance, slice):
raise TypeError('Unhandled type {}'.format(type(slice_instance)))
start = slice_instance.start or ''
stop = slice_instance.stop or ''
step = slice_in... | [
"Turn",
"things",
"like",
"slice",
"(",
"None",
"2",
"-",
"1",
")",
"into",
":",
"2",
":",
"-",
"1",
"."
] | SciTools/biggus | python | https://github.com/SciTools/biggus/blob/0a76fbe7806dd6295081cd399bcb76135d834d25/biggus/experimental/dask_engine.py#L101-L119 | [
"def",
"slice_repr",
"(",
"slice_instance",
")",
":",
"if",
"not",
"isinstance",
"(",
"slice_instance",
",",
"slice",
")",
":",
"raise",
"TypeError",
"(",
"'Unhandled type {}'",
".",
"format",
"(",
"type",
"(",
"slice_instance",
")",
")",
")",
"start",
"=",
... | 0a76fbe7806dd6295081cd399bcb76135d834d25 |
train | DaskGroup.biggus_chunk | A function that lazily evaluates a biggus.Chunk. This is useful for
passing through as a dask task so that we don't have to compute the
chunk in order to compute the graph. | biggus/experimental/dask_engine.py | def biggus_chunk(chunk_key, biggus_array, masked):
"""
A function that lazily evaluates a biggus.Chunk. This is useful for
passing through as a dask task so that we don't have to compute the
chunk in order to compute the graph.
"""
if masked:
array = biggus_a... | def biggus_chunk(chunk_key, biggus_array, masked):
"""
A function that lazily evaluates a biggus.Chunk. This is useful for
passing through as a dask task so that we don't have to compute the
chunk in order to compute the graph.
"""
if masked:
array = biggus_a... | [
"A",
"function",
"that",
"lazily",
"evaluates",
"a",
"biggus",
".",
"Chunk",
".",
"This",
"is",
"useful",
"for",
"passing",
"through",
"as",
"a",
"dask",
"task",
"so",
"that",
"we",
"don",
"t",
"have",
"to",
"compute",
"the",
"chunk",
"in",
"order",
"t... | SciTools/biggus | python | https://github.com/SciTools/biggus/blob/0a76fbe7806dd6295081cd399bcb76135d834d25/biggus/experimental/dask_engine.py#L128-L140 | [
"def",
"biggus_chunk",
"(",
"chunk_key",
",",
"biggus_array",
",",
"masked",
")",
":",
"if",
"masked",
":",
"array",
"=",
"biggus_array",
".",
"masked_array",
"(",
")",
"else",
":",
"array",
"=",
"biggus_array",
".",
"ndarray",
"(",
")",
"return",
"biggus"... | 0a76fbe7806dd6295081cd399bcb76135d834d25 |
train | DaskGroup._make_stream_handler_nodes | Produce task graph entries for an array that comes from a biggus
StreamsHandler.
This is essentially every type of array that isn't already a thing on
disk/in-memory. StreamsHandler arrays include all aggregations and
elementwise operations. | biggus/experimental/dask_engine.py | def _make_stream_handler_nodes(self, dsk_graph, array, iteration_order,
masked):
"""
Produce task graph entries for an array that comes from a biggus
StreamsHandler.
This is essentially every type of array that isn't already a thing on
disk/in-... | def _make_stream_handler_nodes(self, dsk_graph, array, iteration_order,
masked):
"""
Produce task graph entries for an array that comes from a biggus
StreamsHandler.
This is essentially every type of array that isn't already a thing on
disk/in-... | [
"Produce",
"task",
"graph",
"entries",
"for",
"an",
"array",
"that",
"comes",
"from",
"a",
"biggus",
"StreamsHandler",
"."
] | SciTools/biggus | python | https://github.com/SciTools/biggus/blob/0a76fbe7806dd6295081cd399bcb76135d834d25/biggus/experimental/dask_engine.py#L160-L284 | [
"def",
"_make_stream_handler_nodes",
"(",
"self",
",",
"dsk_graph",
",",
"array",
",",
"iteration_order",
",",
"masked",
")",
":",
"nodes",
"=",
"{",
"}",
"handler",
"=",
"array",
".",
"streams_handler",
"(",
"masked",
")",
"input_iteration_order",
"=",
"handl... | 0a76fbe7806dd6295081cd399bcb76135d834d25 |
train | DaskGroup.lazy_chunk_creator | Create a lazy chunk creating function with a nice name that is suitable
for representation in a dask graph. | biggus/experimental/dask_engine.py | def lazy_chunk_creator(name):
"""
Create a lazy chunk creating function with a nice name that is suitable
for representation in a dask graph.
"""
# TODO: Could this become a LazyChunk class?
def biggus_chunk(chunk_key, biggus_array, masked):
"""
A... | def lazy_chunk_creator(name):
"""
Create a lazy chunk creating function with a nice name that is suitable
for representation in a dask graph.
"""
# TODO: Could this become a LazyChunk class?
def biggus_chunk(chunk_key, biggus_array, masked):
"""
A... | [
"Create",
"a",
"lazy",
"chunk",
"creating",
"function",
"with",
"a",
"nice",
"name",
"that",
"is",
"suitable",
"for",
"representation",
"in",
"a",
"dask",
"graph",
"."
] | SciTools/biggus | python | https://github.com/SciTools/biggus/blob/0a76fbe7806dd6295081cd399bcb76135d834d25/biggus/experimental/dask_engine.py#L287-L308 | [
"def",
"lazy_chunk_creator",
"(",
"name",
")",
":",
"# TODO: Could this become a LazyChunk class?",
"def",
"biggus_chunk",
"(",
"chunk_key",
",",
"biggus_array",
",",
"masked",
")",
":",
"\"\"\"\n A function that lazily evaluates a biggus.Chunk. This is useful for\n ... | 0a76fbe7806dd6295081cd399bcb76135d834d25 |
train | DaskGroup._make_nodes | Recursive function that returns the dask items for the given array.
NOTE: Currently assuming that all tasks are a tuple, with the second
item being the keys used to index the source of the respective input
array. | biggus/experimental/dask_engine.py | def _make_nodes(self, dsk_graph, array, iteration_order, masked,
top=False):
"""
Recursive function that returns the dask items for the given array.
NOTE: Currently assuming that all tasks are a tuple, with the second
item being the keys used to index the source of t... | def _make_nodes(self, dsk_graph, array, iteration_order, masked,
top=False):
"""
Recursive function that returns the dask items for the given array.
NOTE: Currently assuming that all tasks are a tuple, with the second
item being the keys used to index the source of t... | [
"Recursive",
"function",
"that",
"returns",
"the",
"dask",
"items",
"for",
"the",
"given",
"array",
"."
] | SciTools/biggus | python | https://github.com/SciTools/biggus/blob/0a76fbe7806dd6295081cd399bcb76135d834d25/biggus/experimental/dask_engine.py#L310-L351 | [
"def",
"_make_nodes",
"(",
"self",
",",
"dsk_graph",
",",
"array",
",",
"iteration_order",
",",
"masked",
",",
"top",
"=",
"False",
")",
":",
"cache_key",
"=",
"_array_id",
"(",
"array",
",",
"iteration_order",
",",
"masked",
")",
"# By the end of this functio... | 0a76fbe7806dd6295081cd399bcb76135d834d25 |
train | group_keys | Usecase: Two sets of chunks, one spans the whole of a dimension, the other
chunked it up. We need to know that we need to collect together the
chunked form, so that we can work with both sets at the same time.
Conceptually we have multiple source inputs, each with multiple key sets
for indexing.
... | biggus/experimental/key_grouper.py | def group_keys(shape, *inputs_keys):
"""
Usecase: Two sets of chunks, one spans the whole of a dimension, the other
chunked it up. We need to know that we need to collect together the
chunked form, so that we can work with both sets at the same time.
Conceptually we have multiple source inputs, ea... | def group_keys(shape, *inputs_keys):
"""
Usecase: Two sets of chunks, one spans the whole of a dimension, the other
chunked it up. We need to know that we need to collect together the
chunked form, so that we can work with both sets at the same time.
Conceptually we have multiple source inputs, ea... | [
"Usecase",
":",
"Two",
"sets",
"of",
"chunks",
"one",
"spans",
"the",
"whole",
"of",
"a",
"dimension",
"the",
"other",
"chunked",
"it",
"up",
".",
"We",
"need",
"to",
"know",
"that",
"we",
"need",
"to",
"collect",
"together",
"the",
"chunked",
"form",
... | SciTools/biggus | python | https://github.com/SciTools/biggus/blob/0a76fbe7806dd6295081cd399bcb76135d834d25/biggus/experimental/key_grouper.py#L123-L182 | [
"def",
"group_keys",
"(",
"shape",
",",
"*",
"inputs_keys",
")",
":",
"# Store the result as a slice mapping to a subset of the inputs_keys. We",
"# start with the assumption that there will be only one group, and",
"# subdivide when we find this not to be the case.",
"ndim",
"=",
"len",... | 0a76fbe7806dd6295081cd399bcb76135d834d25 |
train | get_password | <Purpose>
Return the password entered by the user. If 'confirm' is True, the user is
asked to enter the previously entered password once again. If they match,
the password is returned to the caller.
<Arguments>
prompt:
The text of the password prompt that is displayed to the user.
confir... | securesystemslib/interface.py | def get_password(prompt='Password: ', confirm=False):
"""
<Purpose>
Return the password entered by the user. If 'confirm' is True, the user is
asked to enter the previously entered password once again. If they match,
the password is returned to the caller.
<Arguments>
prompt:
The text of ... | def get_password(prompt='Password: ', confirm=False):
"""
<Purpose>
Return the password entered by the user. If 'confirm' is True, the user is
asked to enter the previously entered password once again. If they match,
the password is returned to the caller.
<Arguments>
prompt:
The text of ... | [
"<Purpose",
">",
"Return",
"the",
"password",
"entered",
"by",
"the",
"user",
".",
"If",
"confirm",
"is",
"True",
"the",
"user",
"is",
"asked",
"to",
"enter",
"the",
"previously",
"entered",
"password",
"once",
"again",
".",
"If",
"they",
"match",
"the",
... | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L81-L125 | [
"def",
"get_password",
"(",
"prompt",
"=",
"'Password: '",
",",
"confirm",
"=",
"False",
")",
":",
"# Are the arguments the expected type?",
"# If not, raise 'securesystemslib.exceptions.FormatError'.",
"securesystemslib",
".",
"formats",
".",
"TEXT_SCHEMA",
".",
"check_match... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | generate_and_write_rsa_keypair | <Purpose>
Generate an RSA key pair. The public portion of the generated RSA key is
saved to <'filepath'>.pub, whereas the private key portion is saved to
<'filepath'>. If no password is given, the user is prompted for one. If
the 'password' is an empty string, the private key is saved unencrypted to
... | securesystemslib/interface.py | def generate_and_write_rsa_keypair(filepath=None, bits=DEFAULT_RSA_KEY_BITS,
password=None):
"""
<Purpose>
Generate an RSA key pair. The public portion of the generated RSA key is
saved to <'filepath'>.pub, whereas the private key portion is saved to
<'filepath'>. If no password is given, the user... | def generate_and_write_rsa_keypair(filepath=None, bits=DEFAULT_RSA_KEY_BITS,
password=None):
"""
<Purpose>
Generate an RSA key pair. The public portion of the generated RSA key is
saved to <'filepath'>.pub, whereas the private key portion is saved to
<'filepath'>. If no password is given, the user... | [
"<Purpose",
">",
"Generate",
"an",
"RSA",
"key",
"pair",
".",
"The",
"public",
"portion",
"of",
"the",
"generated",
"RSA",
"key",
"is",
"saved",
"to",
"<",
"filepath",
">",
".",
"pub",
"whereas",
"the",
"private",
"key",
"portion",
"is",
"saved",
"to",
... | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L131-L234 | [
"def",
"generate_and_write_rsa_keypair",
"(",
"filepath",
"=",
"None",
",",
"bits",
"=",
"DEFAULT_RSA_KEY_BITS",
",",
"password",
"=",
"None",
")",
":",
"# Does 'bits' have the correct format?",
"# Raise 'securesystemslib.exceptions.FormatError' if there is a mismatch.",
"secures... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | import_rsa_privatekey_from_file | <Purpose>
Import the PEM file in 'filepath' containing the private key.
If password is passed use passed password for decryption.
If prompt is True use entered password for decryption.
If no password is passed and either prompt is False or if the password
entered at the prompt is an empty string, o... | securesystemslib/interface.py | def import_rsa_privatekey_from_file(filepath, password=None,
scheme='rsassa-pss-sha256', prompt=False):
"""
<Purpose>
Import the PEM file in 'filepath' containing the private key.
If password is passed use passed password for decryption.
If prompt is True use entered password for decryption.
If... | def import_rsa_privatekey_from_file(filepath, password=None,
scheme='rsassa-pss-sha256', prompt=False):
"""
<Purpose>
Import the PEM file in 'filepath' containing the private key.
If password is passed use passed password for decryption.
If prompt is True use entered password for decryption.
If... | [
"<Purpose",
">",
"Import",
"the",
"PEM",
"file",
"in",
"filepath",
"containing",
"the",
"private",
"key",
"."
] | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L239-L352 | [
"def",
"import_rsa_privatekey_from_file",
"(",
"filepath",
",",
"password",
"=",
"None",
",",
"scheme",
"=",
"'rsassa-pss-sha256'",
",",
"prompt",
"=",
"False",
")",
":",
"# Does 'filepath' have the correct format?",
"# Ensure the arguments have the appropriate number of object... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | import_rsa_publickey_from_file | <Purpose>
Import the RSA key stored in 'filepath'. The key object returned is in the
format 'securesystemslib.formats.RSAKEY_SCHEMA'. If the RSA PEM in
'filepath' contains a private key, it is discarded.
<Arguments>
filepath:
<filepath>.pub file, an RSA PEM file.
<Exceptions>
securesys... | securesystemslib/interface.py | def import_rsa_publickey_from_file(filepath):
"""
<Purpose>
Import the RSA key stored in 'filepath'. The key object returned is in the
format 'securesystemslib.formats.RSAKEY_SCHEMA'. If the RSA PEM in
'filepath' contains a private key, it is discarded.
<Arguments>
filepath:
<filepath>.pu... | def import_rsa_publickey_from_file(filepath):
"""
<Purpose>
Import the RSA key stored in 'filepath'. The key object returned is in the
format 'securesystemslib.formats.RSAKEY_SCHEMA'. If the RSA PEM in
'filepath' contains a private key, it is discarded.
<Arguments>
filepath:
<filepath>.pu... | [
"<Purpose",
">",
"Import",
"the",
"RSA",
"key",
"stored",
"in",
"filepath",
".",
"The",
"key",
"object",
"returned",
"is",
"in",
"the",
"format",
"securesystemslib",
".",
"formats",
".",
"RSAKEY_SCHEMA",
".",
"If",
"the",
"RSA",
"PEM",
"in",
"filepath",
"c... | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L358-L402 | [
"def",
"import_rsa_publickey_from_file",
"(",
"filepath",
")",
":",
"# Does 'filepath' have the correct format?",
"# Ensure the arguments have the appropriate number of objects and object",
"# types, and that all dict keys are properly named.",
"# Raise 'securesystemslib.exceptions.FormatError' if... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | generate_and_write_ed25519_keypair | <Purpose>
Generate an Ed25519 keypair, where the encrypted key (using 'password' as
the passphrase) is saved to <'filepath'>. The public key portion of the
generated Ed25519 key is saved to <'filepath'>.pub. If the filepath is not
given, the KEYID is used as the filename and the keypair saved to the
... | securesystemslib/interface.py | def generate_and_write_ed25519_keypair(filepath=None, password=None):
"""
<Purpose>
Generate an Ed25519 keypair, where the encrypted key (using 'password' as
the passphrase) is saved to <'filepath'>. The public key portion of the
generated Ed25519 key is saved to <'filepath'>.pub. If the filepath is n... | def generate_and_write_ed25519_keypair(filepath=None, password=None):
"""
<Purpose>
Generate an Ed25519 keypair, where the encrypted key (using 'password' as
the passphrase) is saved to <'filepath'>. The public key portion of the
generated Ed25519 key is saved to <'filepath'>.pub. If the filepath is n... | [
"<Purpose",
">",
"Generate",
"an",
"Ed25519",
"keypair",
"where",
"the",
"encrypted",
"key",
"(",
"using",
"password",
"as",
"the",
"passphrase",
")",
"is",
"saved",
"to",
"<",
"filepath",
">",
".",
"The",
"public",
"key",
"portion",
"of",
"the",
"generate... | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L408-L522 | [
"def",
"generate_and_write_ed25519_keypair",
"(",
"filepath",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"# Generate a new Ed25519 key object.",
"ed25519_key",
"=",
"securesystemslib",
".",
"keys",
".",
"generate_ed25519_key",
"(",
")",
"if",
"not",
"filepat... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | import_ed25519_publickey_from_file | <Purpose>
Load the ED25519 public key object (conformant to
'securesystemslib.formats.KEY_SCHEMA') stored in 'filepath'. Return
'filepath' in securesystemslib.formats.ED25519KEY_SCHEMA format.
If the key object in 'filepath' contains a private key, it is discarded.
<Arguments>
filepath:
<... | securesystemslib/interface.py | def import_ed25519_publickey_from_file(filepath):
"""
<Purpose>
Load the ED25519 public key object (conformant to
'securesystemslib.formats.KEY_SCHEMA') stored in 'filepath'. Return
'filepath' in securesystemslib.formats.ED25519KEY_SCHEMA format.
If the key object in 'filepath' contains a private ... | def import_ed25519_publickey_from_file(filepath):
"""
<Purpose>
Load the ED25519 public key object (conformant to
'securesystemslib.formats.KEY_SCHEMA') stored in 'filepath'. Return
'filepath' in securesystemslib.formats.ED25519KEY_SCHEMA format.
If the key object in 'filepath' contains a private ... | [
"<Purpose",
">",
"Load",
"the",
"ED25519",
"public",
"key",
"object",
"(",
"conformant",
"to",
"securesystemslib",
".",
"formats",
".",
"KEY_SCHEMA",
")",
"stored",
"in",
"filepath",
".",
"Return",
"filepath",
"in",
"securesystemslib",
".",
"formats",
".",
"ED... | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L527-L572 | [
"def",
"import_ed25519_publickey_from_file",
"(",
"filepath",
")",
":",
"# Does 'filepath' have the correct format?",
"# Ensure the arguments have the appropriate number of objects and object",
"# types, and that all dict keys are properly named.",
"# Raise 'securesystemslib.exceptions.FormatError... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | import_ed25519_privatekey_from_file | <Purpose>
Import the encrypted ed25519 key file in 'filepath', decrypt it, and return
the key object in 'securesystemslib.formats.ED25519KEY_SCHEMA' format.
The private key (may also contain the public part) is encrypted with AES
256 and CTR the mode of operation. The password is strengthened with
... | securesystemslib/interface.py | def import_ed25519_privatekey_from_file(filepath, password=None, prompt=False):
"""
<Purpose>
Import the encrypted ed25519 key file in 'filepath', decrypt it, and return
the key object in 'securesystemslib.formats.ED25519KEY_SCHEMA' format.
The private key (may also contain the public part) is encrypte... | def import_ed25519_privatekey_from_file(filepath, password=None, prompt=False):
"""
<Purpose>
Import the encrypted ed25519 key file in 'filepath', decrypt it, and return
the key object in 'securesystemslib.formats.ED25519KEY_SCHEMA' format.
The private key (may also contain the public part) is encrypte... | [
"<Purpose",
">",
"Import",
"the",
"encrypted",
"ed25519",
"key",
"file",
"in",
"filepath",
"decrypt",
"it",
"and",
"return",
"the",
"key",
"object",
"in",
"securesystemslib",
".",
"formats",
".",
"ED25519KEY_SCHEMA",
"format",
"."
] | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L578-L658 | [
"def",
"import_ed25519_privatekey_from_file",
"(",
"filepath",
",",
"password",
"=",
"None",
",",
"prompt",
"=",
"False",
")",
":",
"# Does 'filepath' have the correct format?",
"# Ensure the arguments have the appropriate number of objects and object",
"# types, and that all dict ke... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | generate_and_write_ecdsa_keypair | <Purpose>
Generate an ECDSA keypair, where the encrypted key (using 'password' as the
passphrase) is saved to <'filepath'>. The public key portion of the
generated ECDSA key is saved to <'filepath'>.pub. If the filepath is not
given, the KEYID is used as the filename and the keypair saved to the
c... | securesystemslib/interface.py | def generate_and_write_ecdsa_keypair(filepath=None, password=None):
"""
<Purpose>
Generate an ECDSA keypair, where the encrypted key (using 'password' as the
passphrase) is saved to <'filepath'>. The public key portion of the
generated ECDSA key is saved to <'filepath'>.pub. If the filepath is not
... | def generate_and_write_ecdsa_keypair(filepath=None, password=None):
"""
<Purpose>
Generate an ECDSA keypair, where the encrypted key (using 'password' as the
passphrase) is saved to <'filepath'>. The public key portion of the
generated ECDSA key is saved to <'filepath'>.pub. If the filepath is not
... | [
"<Purpose",
">",
"Generate",
"an",
"ECDSA",
"keypair",
"where",
"the",
"encrypted",
"key",
"(",
"using",
"password",
"as",
"the",
"passphrase",
")",
"is",
"saved",
"to",
"<",
"filepath",
">",
".",
"The",
"public",
"key",
"portion",
"of",
"the",
"generated"... | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L664-L767 | [
"def",
"generate_and_write_ecdsa_keypair",
"(",
"filepath",
"=",
"None",
",",
"password",
"=",
"None",
")",
":",
"# Generate a new ECDSA key object. The 'cryptography' library is currently",
"# supported and performs the actual cryptographic operations.",
"ecdsa_key",
"=",
"securesy... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | import_ecdsa_publickey_from_file | <Purpose>
Load the ECDSA public key object (conformant to
'securesystemslib.formats.KEY_SCHEMA') stored in 'filepath'. Return
'filepath' in securesystemslib.formats.ECDSAKEY_SCHEMA format.
If the key object in 'filepath' contains a private key, it is discarded.
<Arguments>
filepath:
<file... | securesystemslib/interface.py | def import_ecdsa_publickey_from_file(filepath):
"""
<Purpose>
Load the ECDSA public key object (conformant to
'securesystemslib.formats.KEY_SCHEMA') stored in 'filepath'. Return
'filepath' in securesystemslib.formats.ECDSAKEY_SCHEMA format.
If the key object in 'filepath' contains a private key, i... | def import_ecdsa_publickey_from_file(filepath):
"""
<Purpose>
Load the ECDSA public key object (conformant to
'securesystemslib.formats.KEY_SCHEMA') stored in 'filepath'. Return
'filepath' in securesystemslib.formats.ECDSAKEY_SCHEMA format.
If the key object in 'filepath' contains a private key, i... | [
"<Purpose",
">",
"Load",
"the",
"ECDSA",
"public",
"key",
"object",
"(",
"conformant",
"to",
"securesystemslib",
".",
"formats",
".",
"KEY_SCHEMA",
")",
"stored",
"in",
"filepath",
".",
"Return",
"filepath",
"in",
"securesystemslib",
".",
"formats",
".",
"ECDS... | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L772-L817 | [
"def",
"import_ecdsa_publickey_from_file",
"(",
"filepath",
")",
":",
"# Does 'filepath' have the correct format?",
"# Ensure the arguments have the appropriate number of objects and object",
"# types, and that all dict keys are properly named.",
"# Raise 'securesystemslib.exceptions.FormatError' ... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | import_ecdsa_privatekey_from_file | <Purpose>
Import the encrypted ECDSA key file in 'filepath', decrypt it, and return
the key object in 'securesystemslib.formats.ECDSAKEY_SCHEMA' format.
The 'cryptography' library is currently supported and performs the actual
cryptographic routine.
<Arguments>
filepath:
<filepath> file, a... | securesystemslib/interface.py | def import_ecdsa_privatekey_from_file(filepath, password=None):
"""
<Purpose>
Import the encrypted ECDSA key file in 'filepath', decrypt it, and return
the key object in 'securesystemslib.formats.ECDSAKEY_SCHEMA' format.
The 'cryptography' library is currently supported and performs the actual
cryp... | def import_ecdsa_privatekey_from_file(filepath, password=None):
"""
<Purpose>
Import the encrypted ECDSA key file in 'filepath', decrypt it, and return
the key object in 'securesystemslib.formats.ECDSAKEY_SCHEMA' format.
The 'cryptography' library is currently supported and performs the actual
cryp... | [
"<Purpose",
">",
"Import",
"the",
"encrypted",
"ECDSA",
"key",
"file",
"in",
"filepath",
"decrypt",
"it",
"and",
"return",
"the",
"key",
"object",
"in",
"securesystemslib",
".",
"formats",
".",
"ECDSAKEY_SCHEMA",
"format",
"."
] | secure-systems-lab/securesystemslib | python | https://github.com/secure-systems-lab/securesystemslib/blob/beb3109d5bb462e5a60eed88fb40ed1167bd354e/securesystemslib/interface.py#L823-L900 | [
"def",
"import_ecdsa_privatekey_from_file",
"(",
"filepath",
",",
"password",
"=",
"None",
")",
":",
"# Does 'filepath' have the correct format?",
"# Ensure the arguments have the appropriate number of objects and object",
"# types, and that all dict keys are properly named.",
"# Raise 'se... | beb3109d5bb462e5a60eed88fb40ed1167bd354e |
train | _keywords.wait_until_element_has_focus | Waits until the element identified by `locator` has focus.
You might rather want to use `Element Focus Should Be Set`
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| timeout | maximum time to wait before the function throws an element not found error (default=No... | src/Selenium2LibraryExtension/keywords/__init__.py | def wait_until_element_has_focus(self, locator, timeout=None):
"""Waits until the element identified by `locator` has focus.
You might rather want to use `Element Focus Should Be Set`
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| timeout | maximum time to wa... | def wait_until_element_has_focus(self, locator, timeout=None):
"""Waits until the element identified by `locator` has focus.
You might rather want to use `Element Focus Should Be Set`
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| timeout | maximum time to wa... | [
"Waits",
"until",
"the",
"element",
"identified",
"by",
"locator",
"has",
"focus",
".",
"You",
"might",
"rather",
"want",
"to",
"use",
"Element",
"Focus",
"Should",
"Be",
"Set"
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L18-L27 | [
"def",
"wait_until_element_has_focus",
"(",
"self",
",",
"locator",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"_info",
"(",
"\"Waiting for focus on '%s'\"",
"%",
"(",
"locator",
")",
")",
"self",
".",
"_wait_until_no_error",
"(",
"timeout",
",",
"sel... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.wait_until_element_does_not_have_focus | Waits until the element identified by `locator` doesn't have focus.
You might rather want to use `Element Focus Should Not Be Set`
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| timeout | maximum time to wait before the function throws an element not found erro... | src/Selenium2LibraryExtension/keywords/__init__.py | def wait_until_element_does_not_have_focus(self, locator, timeout=None):
"""Waits until the element identified by `locator` doesn't have focus.
You might rather want to use `Element Focus Should Not Be Set`
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| timeo... | def wait_until_element_does_not_have_focus(self, locator, timeout=None):
"""Waits until the element identified by `locator` doesn't have focus.
You might rather want to use `Element Focus Should Not Be Set`
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| timeo... | [
"Waits",
"until",
"the",
"element",
"identified",
"by",
"locator",
"doesn",
"t",
"have",
"focus",
".",
"You",
"might",
"rather",
"want",
"to",
"use",
"Element",
"Focus",
"Should",
"Not",
"Be",
"Set"
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L35-L44 | [
"def",
"wait_until_element_does_not_have_focus",
"(",
"self",
",",
"locator",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"_info",
"(",
"\"Waiting until '%s' does not have focus\"",
"%",
"(",
"locator",
")",
")",
"self",
".",
"_wait_until_no_error",
"(",
"... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.wait_until_element_value_is | Waits until the element identified by `locator` value is exactly the
expected value. You might want to use `Element Value Should Be` instead.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | My Name Is Slim Shady |
| strip | boolean,... | src/Selenium2LibraryExtension/keywords/__init__.py | def wait_until_element_value_is(self, locator, expected, strip=False, timeout=None):
"""Waits until the element identified by `locator` value is exactly the
expected value. You might want to use `Element Value Should Be` instead.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator... | def wait_until_element_value_is(self, locator, expected, strip=False, timeout=None):
"""Waits until the element identified by `locator` value is exactly the
expected value. You might want to use `Element Value Should Be` instead.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator... | [
"Waits",
"until",
"the",
"element",
"identified",
"by",
"locator",
"value",
"is",
"exactly",
"the",
"expected",
"value",
".",
"You",
"might",
"want",
"to",
"use",
"Element",
"Value",
"Should",
"Be",
"instead",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L52-L63 | [
"def",
"wait_until_element_value_is",
"(",
"self",
",",
"locator",
",",
"expected",
",",
"strip",
"=",
"False",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"_info",
"(",
"\"Waiting for '%s' value to be '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")"... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.wait_until_element_value_contains | Waits until the element identified by `locator` contains
the expected value. You might want to use `Element Value Should Contain` instead.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | Slim Shady |
| timeout | maximum time to wait... | src/Selenium2LibraryExtension/keywords/__init__.py | def wait_until_element_value_contains(self, locator, expected, timeout=None):
"""Waits until the element identified by `locator` contains
the expected value. You might want to use `Element Value Should Contain` instead.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_i... | def wait_until_element_value_contains(self, locator, expected, timeout=None):
"""Waits until the element identified by `locator` contains
the expected value. You might want to use `Element Value Should Contain` instead.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_i... | [
"Waits",
"until",
"the",
"element",
"identified",
"by",
"locator",
"contains",
"the",
"expected",
"value",
".",
"You",
"might",
"want",
"to",
"use",
"Element",
"Value",
"Should",
"Contain",
"instead",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L71-L81 | [
"def",
"wait_until_element_value_contains",
"(",
"self",
",",
"locator",
",",
"expected",
",",
"timeout",
"=",
"None",
")",
":",
"self",
".",
"_info",
"(",
"\"Waiting for '%s' value to contain '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")",
")",
"self",
".",... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.set_element_focus | Sets focus on the element identified by `locator`. Should
be used with elements meant to have focus only, such as
text fields. This keywords also waits for the focus to be
active by calling the `Wait Until Element Has Focus` keyword.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element l... | src/Selenium2LibraryExtension/keywords/__init__.py | def set_element_focus(self, locator):
"""Sets focus on the element identified by `locator`. Should
be used with elements meant to have focus only, such as
text fields. This keywords also waits for the focus to be
active by calling the `Wait Until Element Has Focus` keyword.
| *Argument* | *Description* | *Ex... | def set_element_focus(self, locator):
"""Sets focus on the element identified by `locator`. Should
be used with elements meant to have focus only, such as
text fields. This keywords also waits for the focus to be
active by calling the `Wait Until Element Has Focus` keyword.
| *Argument* | *Description* | *Ex... | [
"Sets",
"focus",
"on",
"the",
"element",
"identified",
"by",
"locator",
".",
"Should",
"be",
"used",
"with",
"elements",
"meant",
"to",
"have",
"focus",
"only",
"such",
"as",
"text",
"fields",
".",
"This",
"keywords",
"also",
"waits",
"for",
"the",
"focus"... | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L89-L103 | [
"def",
"set_element_focus",
"(",
"self",
",",
"locator",
")",
":",
"self",
".",
"_info",
"(",
"\"Setting focus on element '%s'\"",
"%",
"(",
"locator",
")",
")",
"element",
"=",
"self",
".",
"_element_find",
"(",
"locator",
",",
"True",
",",
"True",
")",
"... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.clear_input_field | Clears the text field identified by `locator`
The element.clear() method doesn't seem to work properly on
all browsers, so this keyword was created to offer alternatives.
The `method` argument defines the method it should use in order
to clear the target field.
0 = Uses the selenium method by doing element... | src/Selenium2LibraryExtension/keywords/__init__.py | def clear_input_field(self, locator, method=0):
"""Clears the text field identified by `locator`
The element.clear() method doesn't seem to work properly on
all browsers, so this keyword was created to offer alternatives.
The `method` argument defines the method it should use in order
to clear the target fi... | def clear_input_field(self, locator, method=0):
"""Clears the text field identified by `locator`
The element.clear() method doesn't seem to work properly on
all browsers, so this keyword was created to offer alternatives.
The `method` argument defines the method it should use in order
to clear the target fi... | [
"Clears",
"the",
"text",
"field",
"identified",
"by",
"locator"
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L111-L152 | [
"def",
"clear_input_field",
"(",
"self",
",",
"locator",
",",
"method",
"=",
"0",
")",
":",
"element",
"=",
"self",
".",
"_element_find",
"(",
"locator",
",",
"True",
",",
"True",
")",
"if",
"(",
"int",
"(",
"method",
")",
"==",
"0",
")",
":",
"sel... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_text_color_should_be | Verifies the element identified by `locator` has the expected
text color (it verifies the CSS attribute color). Color should be in
RGBA format.
Example of rgba format: rgba(RED, GREEN, BLUE, ALPHA)
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | ... | src/Selenium2LibraryExtension/keywords/__init__.py | def element_text_color_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
text color (it verifies the CSS attribute color). Color should be in
RGBA format.
Example of rgba format: rgba(RED, GREEN, BLUE, ALPHA)
| *Argument* | *Description* | *Example* |
| l... | def element_text_color_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
text color (it verifies the CSS attribute color). Color should be in
RGBA format.
Example of rgba format: rgba(RED, GREEN, BLUE, ALPHA)
| *Argument* | *Description* | *Example* |
| l... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"has",
"the",
"expected",
"text",
"color",
"(",
"it",
"verifies",
"the",
"CSS",
"attribute",
"color",
")",
".",
"Color",
"should",
"be",
"in",
"RGBA",
"format",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L160-L172 | [
"def",
"element_text_color_should_be",
"(",
"self",
",",
"locator",
",",
"expected",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' has text color '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")",
")",
"self",
".",
"_check_element_css_value",
"(",
... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_background_color_should_be | Verifies the element identified by `locator` has the expected
background color (it verifies the CSS attribute background-color). Color should
be in RGBA format.
Example of rgba format: rgba(RED, GREEN, BLUE, ALPHA)
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id ... | src/Selenium2LibraryExtension/keywords/__init__.py | def element_background_color_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
background color (it verifies the CSS attribute background-color). Color should
be in RGBA format.
Example of rgba format: rgba(RED, GREEN, BLUE, ALPHA)
| *Argument* | *Descripti... | def element_background_color_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
background color (it verifies the CSS attribute background-color). Color should
be in RGBA format.
Example of rgba format: rgba(RED, GREEN, BLUE, ALPHA)
| *Argument* | *Descripti... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"has",
"the",
"expected",
"background",
"color",
"(",
"it",
"verifies",
"the",
"CSS",
"attribute",
"background",
"-",
"color",
")",
".",
"Color",
"should",
"be",
"in",
"RGBA",
"format",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L180-L192 | [
"def",
"element_background_color_should_be",
"(",
"self",
",",
"locator",
",",
"expected",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' has background color '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")",
")",
"self",
".",
"_check_element_css_val... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_width_should_be | Verifies the element identified by `locator` has the expected
width. Expected width should be in pixels.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected width | 800 | | src/Selenium2LibraryExtension/keywords/__init__.py | def element_width_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
width. Expected width should be in pixels.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected width | 800 |"""
self._info... | def element_width_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
width. Expected width should be in pixels.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected width | 800 |"""
self._info... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"has",
"the",
"expected",
"width",
".",
"Expected",
"width",
"should",
"be",
"in",
"pixels",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L200-L209 | [
"def",
"element_width_should_be",
"(",
"self",
",",
"locator",
",",
"expected",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' width is '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")",
")",
"self",
".",
"_check_element_size",
"(",
"locator",
"... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_height_should_be | Verifies the element identified by `locator` has the expected
height. Expected height should be in pixels.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected height | 600 | | src/Selenium2LibraryExtension/keywords/__init__.py | def element_height_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
height. Expected height should be in pixels.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected height | 600 |"""
self._... | def element_height_should_be(self, locator, expected):
"""Verifies the element identified by `locator` has the expected
height. Expected height should be in pixels.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected height | 600 |"""
self._... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"has",
"the",
"expected",
"height",
".",
"Expected",
"height",
"should",
"be",
"in",
"pixels",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L217-L226 | [
"def",
"element_height_should_be",
"(",
"self",
",",
"locator",
",",
"expected",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' height is '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")",
")",
"self",
".",
"_check_element_size",
"(",
"locator",
... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_value_should_be | Verifies the element identified by `locator` has the expected value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | My Name Is Slim Shady |
| strip | Boolean, determines whether it should strip the field's value before comparison or ... | src/Selenium2LibraryExtension/keywords/__init__.py | def element_value_should_be(self, locator, expected, strip=False):
"""Verifies the element identified by `locator` has the expected value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | My Name Is Slim Shady |
| strip | Boolean, de... | def element_value_should_be(self, locator, expected, strip=False):
"""Verifies the element identified by `locator` has the expected value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | My Name Is Slim Shady |
| strip | Boolean, de... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"has",
"the",
"expected",
"value",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L234-L254 | [
"def",
"element_value_should_be",
"(",
"self",
",",
"locator",
",",
"expected",
",",
"strip",
"=",
"False",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' value is '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")",
")",
"element",
"=",
"self",... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_value_should_not_be | Verifies the element identified by `locator` is not the specified value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| value | value it should not be | My Name Is Slim Shady |
| strip | Boolean, determines whether it should strip the field's value before compa... | src/Selenium2LibraryExtension/keywords/__init__.py | def element_value_should_not_be(self, locator, value, strip=False):
"""Verifies the element identified by `locator` is not the specified value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| value | value it should not be | My Name Is Slim Shady |
| strip | B... | def element_value_should_not_be(self, locator, value, strip=False):
"""Verifies the element identified by `locator` is not the specified value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| value | value it should not be | My Name Is Slim Shady |
| strip | B... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"is",
"not",
"the",
"specified",
"value",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L262-L279 | [
"def",
"element_value_should_not_be",
"(",
"self",
",",
"locator",
",",
"value",
",",
"strip",
"=",
"False",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' value is not '%s'\"",
"%",
"(",
"locator",
",",
"value",
")",
")",
"element",
"=",
"self... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_value_should_contain | Verifies the element identified by `locator` contains the expected value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | Slim Shady | | src/Selenium2LibraryExtension/keywords/__init__.py | def element_value_should_contain(self, locator, expected):
"""Verifies the element identified by `locator` contains the expected value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | Slim Shady |"""
self._info("Verifying element '... | def element_value_should_contain(self, locator, expected):
"""Verifies the element identified by `locator` contains the expected value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| expected | expected value | Slim Shady |"""
self._info("Verifying element '... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"contains",
"the",
"expected",
"value",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L287-L303 | [
"def",
"element_value_should_contain",
"(",
"self",
",",
"locator",
",",
"expected",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' value contains '%s'\"",
"%",
"(",
"locator",
",",
"expected",
")",
")",
"element",
"=",
"self",
".",
"_element_find"... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_value_should_not_contain | Verifies the element identified by `locator` does not contain the specified value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| value | value it should not contain | Slim Shady | | src/Selenium2LibraryExtension/keywords/__init__.py | def element_value_should_not_contain(self, locator, value):
"""Verifies the element identified by `locator` does not contain the specified value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| value | value it should not contain | Slim Shady |"""
self._info(... | def element_value_should_not_contain(self, locator, value):
"""Verifies the element identified by `locator` does not contain the specified value.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| value | value it should not contain | Slim Shady |"""
self._info(... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"does",
"not",
"contain",
"the",
"specified",
"value",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L311-L324 | [
"def",
"element_value_should_not_contain",
"(",
"self",
",",
"locator",
",",
"value",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' value does not contain '%s'\"",
"%",
"(",
"locator",
",",
"value",
")",
")",
"element",
"=",
"self",
".",
"_element... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_focus_should_be_set | Verifies the element identified by `locator` has focus.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id | | src/Selenium2LibraryExtension/keywords/__init__.py | def element_focus_should_be_set(self, locator):
"""Verifies the element identified by `locator` has focus.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |"""
self._info("Verifying element '%s' focus is set" % locator)
self._check_element_focus(True, locator) | def element_focus_should_be_set(self, locator):
"""Verifies the element identified by `locator` has focus.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |"""
self._info("Verifying element '%s' focus is set" % locator)
self._check_element_focus(True, locator) | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"has",
"focus",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L332-L339 | [
"def",
"element_focus_should_be_set",
"(",
"self",
",",
"locator",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' focus is set\"",
"%",
"locator",
")",
"self",
".",
"_check_element_focus",
"(",
"True",
",",
"locator",
")"
] | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_focus_should_not_be_set | Verifies the element identified by `locator` does not have focus.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id | | src/Selenium2LibraryExtension/keywords/__init__.py | def element_focus_should_not_be_set(self, locator):
"""Verifies the element identified by `locator` does not have focus.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |"""
self._info("Verifying element '%s' focus is not set" % locator)
self._check_element_focus... | def element_focus_should_not_be_set(self, locator):
"""Verifies the element identified by `locator` does not have focus.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |"""
self._info("Verifying element '%s' focus is not set" % locator)
self._check_element_focus... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"does",
"not",
"have",
"focus",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L347-L354 | [
"def",
"element_focus_should_not_be_set",
"(",
"self",
",",
"locator",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' focus is not set\"",
"%",
"locator",
")",
"self",
".",
"_check_element_focus",
"(",
"False",
",",
"locator",
")"
] | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.element_css_attribute_should_be | Verifies the element identified by `locator` has the expected
value for the targeted `prop`.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| prop | targeted css attribute | background-color |
| expected | expected value | rgba(0, 128, 0, 1) | | src/Selenium2LibraryExtension/keywords/__init__.py | def element_css_attribute_should_be(self, locator, prop, expected):
"""Verifies the element identified by `locator` has the expected
value for the targeted `prop`.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| prop | targeted css attribute | background-color... | def element_css_attribute_should_be(self, locator, prop, expected):
"""Verifies the element identified by `locator` has the expected
value for the targeted `prop`.
| *Argument* | *Description* | *Example* |
| locator | Selenium 2 element locator | id=my_id |
| prop | targeted css attribute | background-color... | [
"Verifies",
"the",
"element",
"identified",
"by",
"locator",
"has",
"the",
"expected",
"value",
"for",
"the",
"targeted",
"prop",
"."
] | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L362-L372 | [
"def",
"element_css_attribute_should_be",
"(",
"self",
",",
"locator",
",",
"prop",
",",
"expected",
")",
":",
"self",
".",
"_info",
"(",
"\"Verifying element '%s' has css attribute '%s' with a value of '%s'\"",
"%",
"(",
"locator",
",",
"prop",
",",
"expected",
")",
... | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.wait_until_page_contains_elements | This is a copy of `Wait Until Page Contains Element` but it allows
multiple arguments in order to wait for more than one element.
| *Argument* | *Description* | *Example* |
| timeout | maximum time to wait, if set to ${None} it will use Selenium's default timeout | 5s |
| *locators | Selenium 2 element locat... | src/Selenium2LibraryExtension/keywords/__init__.py | def wait_until_page_contains_elements(self, timeout, *locators):
"""This is a copy of `Wait Until Page Contains Element` but it allows
multiple arguments in order to wait for more than one element.
| *Argument* | *Description* | *Example* |
| timeout | maximum time to wait, if set to ${None} it will use Sele... | def wait_until_page_contains_elements(self, timeout, *locators):
"""This is a copy of `Wait Until Page Contains Element` but it allows
multiple arguments in order to wait for more than one element.
| *Argument* | *Description* | *Example* |
| timeout | maximum time to wait, if set to ${None} it will use Sele... | [
"This",
"is",
"a",
"copy",
"of",
"Wait",
"Until",
"Page",
"Contains",
"Element",
"but",
"it",
"allows",
"multiple",
"arguments",
"in",
"order",
"to",
"wait",
"for",
"more",
"than",
"one",
"element",
".",
"|",
"*",
"Argument",
"*",
"|",
"*",
"Description"... | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L380-L388 | [
"def",
"wait_until_page_contains_elements",
"(",
"self",
",",
"timeout",
",",
"*",
"locators",
")",
":",
"self",
".",
"_wait_until_no_error",
"(",
"timeout",
",",
"self",
".",
"_wait_for_elements",
",",
"locators",
")"
] | 5ca3fa776063c6046dff317cb2575e4772d7541f |
train | _keywords.wait_until_page_contains_one_of_these_elements | Waits until at least one of the specified elements is found.
| *Argument* | *Description* | *Example* |
| timeout | maximum time to wait, if set to ${None} it will use Selenium's default timeout | 5s |
| *locators | Selenium 2 element locator(s) | id=MyId | | src/Selenium2LibraryExtension/keywords/__init__.py | def wait_until_page_contains_one_of_these_elements(self, timeout, *locators):
"""Waits until at least one of the specified elements is found.
| *Argument* | *Description* | *Example* |
| timeout | maximum time to wait, if set to ${None} it will use Selenium's default timeout | 5s |
| *locators | Selenium 2 e... | def wait_until_page_contains_one_of_these_elements(self, timeout, *locators):
"""Waits until at least one of the specified elements is found.
| *Argument* | *Description* | *Example* |
| timeout | maximum time to wait, if set to ${None} it will use Selenium's default timeout | 5s |
| *locators | Selenium 2 e... | [
"Waits",
"until",
"at",
"least",
"one",
"of",
"the",
"specified",
"elements",
"is",
"found",
".",
"|",
"*",
"Argument",
"*",
"|",
"*",
"Description",
"*",
"|",
"*",
"Example",
"*",
"|",
"|",
"timeout",
"|",
"maximum",
"time",
"to",
"wait",
"if",
"set... | ASKIDA/Selenium2LibraryExtension | python | https://github.com/ASKIDA/Selenium2LibraryExtension/blob/5ca3fa776063c6046dff317cb2575e4772d7541f/src/Selenium2LibraryExtension/keywords/__init__.py#L396-L403 | [
"def",
"wait_until_page_contains_one_of_these_elements",
"(",
"self",
",",
"timeout",
",",
"*",
"locators",
")",
":",
"self",
".",
"_wait_until_no_error",
"(",
"timeout",
",",
"self",
".",
"_wait_for_at_least_one_element",
",",
"locators",
")"
] | 5ca3fa776063c6046dff317cb2575e4772d7541f |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.