repository_name
stringlengths
7
55
func_path_in_repository
stringlengths
4
223
func_name
stringlengths
1
134
whole_func_string
stringlengths
75
104k
language
stringclasses
1 value
func_code_string
stringlengths
75
104k
func_code_tokens
listlengths
19
28.4k
func_documentation_string
stringlengths
1
46.9k
func_documentation_tokens
listlengths
1
1.97k
split_name
stringclasses
1 value
func_code_url
stringlengths
87
315
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_dev_run_config
def get_dev_run_config(devId): """ 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 contai...
python
def get_dev_run_config(devId): """ 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 contai...
[ "def", "get_dev_run_config", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_run_url", "=", "\"/imcrs/icc/deviceCfg/\""...
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 ...
[ "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",...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L357-L384
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_dev_start_config
def get_dev_start_config(devId): """ 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 cont...
python
def get_dev_start_config(devId): """ 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 cont...
[ "def", "get_dev_start_config", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_run_url", "=", "\"/imcrs/icc/deviceCfg/\...
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 ...
[ "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",...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L387-L410
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_dev_alarms
def get_dev_alarms(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device """ # checks to see i...
python
def get_dev_alarms(devId): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device """ # checks to see i...
[ "def", "get_dev_alarms", "(", "devId", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_dev_alarm_url", "=", "\"/imcrs/fault/alarm?operato...
function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device
[ "function", "takes", "the", "devId", "of", "a", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "current", "alarms", "for", "the", "target", "device", ".", ":", "param", "devId", ":", "int", "or", "str", "value", "of", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L413-L435
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_real_time_locate
def get_real_time_locate(ipAddress): """ 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. :param ipAddress: str value valid IPv4 IP address :return: dictionary containing hostIp, devId, deviceIP,...
python
def get_real_time_locate(ipAddress): """ 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. :param ipAddress: str value valid IPv4 IP address :return: dictionary containing hostIp, devId, deviceIP,...
[ "def", "get_real_time_locate", "(", "ipAddress", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "real_time_locate_url", "=", "\"/imcrs/res/access/realtimeLocate...
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. :param ipAddress: str value valid IPv4 IP address :return: dictionary containing hostIp, devId, deviceIP, ifDesc, ifIndex
[ "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", ".", ":", "param", "ip...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L441-L458
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_ip_mac_arp_list
def get_ip_mac_arp_list(devId): """ function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list from the target device. :param devId: int or str value of the target device. :return: list of dictionaries containing the IP/MAC/ARP list of the target device. """ if ...
python
def get_ip_mac_arp_list(devId): """ function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list from the target device. :param devId: int or str value of the target device. :return: list of dictionaries containing the IP/MAC/ARP list of the target device. """ if ...
[ "def", "get_ip_mac_arp_list", "(", "devId", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "ip_mac_arp_list_url", "=", "\"/imcrs/res/access/ipMacArp/\"", "+",...
function takes devid of specific device and issues a RESTFUL call to get the IP/MAC/ARP list from the target device. :param devId: int or str value of the target device. :return: list of dictionaries containing the IP/MAC/ARP list of the target device.
[ "function", "takes", "devid", "of", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "IP", "/", "MAC", "/", "ARP", "list", "from", "the", "target", "device", ".", ":", "param", "devId", ":", "int", "or", "str", "value"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L461-L481
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_custom_views
def get_custom_views(name=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 dictionaries containing attrib...
python
def get_custom_views(name=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 dictionaries containing attrib...
[ "def", "get_custom_views", "(", "name", "=", "None", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "if", "name", "is", "None", ":", "get_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.
[ "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...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L488-L512
HPENetworking/PYHPEIMC
archived/pyhpimc.py
create_custom_views
def create_custom_views(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 dictionarie...
python
def create_custom_views(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 dictionarie...
[ "def", "create_custom_views", "(", "name", "=", "None", ",", "upperview", "=", "None", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "create_custom_vie...
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.
[ "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...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L514-L538
HPENetworking/PYHPEIMC
archived/pyhpimc.py
create_dev_vlan
def create_dev_vlan(devid, vlanid, vlan_name): """ 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 ...
python
def create_dev_vlan(devid, vlanid, vlan_name): """ 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 ...
[ "def", "create_dev_vlan", "(", "devid", ",", "vlanid", ",", "vlan_name", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "create_dev_vlan_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 target device :param vlanid:int or str value of target 802.1q 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"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L543-L566
HPENetworking/PYHPEIMC
archived/pyhpimc.py
delete_dev_vlans
def delete_dev_vlans(devid, vlanid): """ 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 n...
python
def delete_dev_vlans(devid, vlanid): """ 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 n...
[ "def", "delete_dev_vlans", "(", "devid", ",", "vlanid", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "remove_dev_vlan_url", "=", "\"/imcrs/vlan/delvlan?de...
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.
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L569-L592
HPENetworking/PYHPEIMC
archived/pyhpimc.py
set_inteface_down
def set_inteface_down(devid, ifindex): """ 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 interfa...
python
def set_inteface_down(devid, ifindex): """ 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 interfa...
[ "def", "set_inteface_down", "(", "devid", ",", "ifindex", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "set_int_down_url", "=", "\"/imcrs/plat/res/device/...
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 :return: HTTP status code 204 with no values...
[ "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", ":", "...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L598-L617
HPENetworking/PYHPEIMC
archived/pyhpimc.py
set_inteface_up
def set_inteface_up(devid, ifindex): """ 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 inter...
python
def set_inteface_up(devid, ifindex): """ 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 inter...
[ "def", "set_inteface_up", "(", "devid", ",", "ifindex", ")", ":", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "set_int_up_url", "=", "\"/imcrs/plat/res/device/\"",...
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...
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L620-L639
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_vm_host_info
def get_vm_host_info(hostId): """ function takes hostId as input to RESTFUL call to HP IMC :param hostId: int or string of HostId of Hypervisor host :return:list of dictionatires contraining the VM Host information for the target hypervisor """ global r if auth is None or url is None: # che...
python
def get_vm_host_info(hostId): """ function takes hostId as input to RESTFUL call to HP IMC :param hostId: int or string of HostId of Hypervisor host :return:list of dictionatires contraining the VM Host information for the target hypervisor """ global r if auth is None or url is None: # che...
[ "def", "get_vm_host_info", "(", "hostId", ")", ":", "global", "r", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "# checks to see if the imc credentials are already available", "set_imc_creds", "(", ")", "get_vm_host_info_url", "=", "\"/imcrs/vrm/host?host...
function takes hostId as input to RESTFUL call to HP IMC :param hostId: int or string of HostId of Hypervisor host :return:list of dictionatires contraining the VM Host information for the target hypervisor
[ "function", "takes", "hostId", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC", ":", "param", "hostId", ":", "int", "or", "string", "of", "HostId", "of", "Hypervisor", "host", ":", "return", ":", "list", "of", "dictionatires", "contraining", "the...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L642-L664
HPENetworking/PYHPEIMC
archived/pyhpimc.py
get_trap_definitions
def get_trap_definitions(): """Takes in no param as input to fetch SNMP TRAP definitions from HP IMC RESTFUL API :param None :return: object of type list containing the device asset details """ # checks to see if the imc credentials are already available if auth is None or url is None: s...
python
def get_trap_definitions(): """Takes in no param as input to fetch SNMP TRAP definitions from HP IMC RESTFUL API :param None :return: object of type list containing the device asset details """ # checks to see if the imc credentials are already available if auth is None or url is None: s...
[ "def", "get_trap_definitions", "(", ")", ":", "# checks to see if the imc credentials are already available", "if", "auth", "is", "None", "or", "url", "is", "None", ":", "set_imc_creds", "(", ")", "global", "r", "get_trap_def_url", "=", "\"/imcrs/fault/trapDefine/sync/que...
Takes in no param as input to fetch SNMP TRAP definitions from HP IMC RESTFUL API :param None :return: object of type list containing the device asset details
[ "Takes", "in", "no", "param", "as", "input", "to", "fetch", "SNMP", "TRAP", "definitions", "from", "HP", "IMC", "RESTFUL", "API", ":", "param", "None", ":", "return", ":", "object", "of", "type", "list", "containing", "the", "device", "asset", "details" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/archived/pyhpimc.py#L741-L760
housecanary/hc-api-python
housecanary/exceptions.py
RateLimitException.rate_limits
def rate_limits(self): """Returns list of rate limit information from the response""" if not self._rate_limits: self._rate_limits = utilities.get_rate_limits(self._response) return self._rate_limits
python
def rate_limits(self): """Returns list of rate limit information from the response""" if not self._rate_limits: self._rate_limits = utilities.get_rate_limits(self._response) return self._rate_limits
[ "def", "rate_limits", "(", "self", ")", ":", "if", "not", "self", ".", "_rate_limits", ":", "self", ".", "_rate_limits", "=", "utilities", ".", "get_rate_limits", "(", "self", ".", "_response", ")", "return", "self", ".", "_rate_limits" ]
Returns list of rate limit information from the response
[ "Returns", "list", "of", "rate", "limit", "information", "from", "the", "response" ]
train
https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/exceptions.py#L30-L34
HPENetworking/PYHPEIMC
pyhpeimc/plat/groups.py
get_custom_views
def get_custom_views(auth, url, name=None): """ 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 :param auth: requests auth objec...
python
def get_custom_views(auth, url, name=None): """ 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 :param auth: requests auth objec...
[ "def", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "None", ")", ":", "get_custom_view_url", "=", "None", "if", "name", "is", "None", ":", "get_custom_view_url", "=", "'/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false'", "'&total=false'"...
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 :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
[ "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", "...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L23-L77
HPENetworking/PYHPEIMC
pyhpeimc/plat/groups.py
get_custom_view_details
def get_custom_view_details(name, auth, url): """ 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 :param auth: requests auth obj...
python
def get_custom_view_details(name, auth, url): """ 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 :param auth: requests auth obj...
[ "def", "get_custom_view_details", "(", "name", ",", "auth", ",", "url", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "name", ")", "if", "view_id", "is", "None", ":", "return", "view_id", "view_id", "=", "get_cu...
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 :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
[ "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", "...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L80-L127
HPENetworking/PYHPEIMC
pyhpeimc/plat/groups.py
create_custom_views
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. Optional Name input will return only the specified view. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
python
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. Optional Name input will return only the specified view. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class ...
[ "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", "+", "...
function takes no input and issues a RESTFUL call to get a list of custom views from HPE IMC. Optional Name input will return only the specified view. :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...
[ "function", "takes", "no", "input", "and", "issues", "a", "RESTFUL", "call", "to", "get", "a", "list", "of", "custom", "views", "from", "HPE", "IMC", ".", "Optional", "Name", "input", "will", "return", "only", "the", "specified", "view", "." ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L130-L195
HPENetworking/PYHPEIMC
pyhpeimc/plat/groups.py
add_devs_custom_views
def add_devs_custom_views(custom_view_name, dev_list, auth, url): """ function takes a list of devIDs from devices discovered in the HPE IMC platform and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param custom_view_name: str of the target custom view name...
python
def add_devs_custom_views(custom_view_name, dev_list, auth, url): """ function takes a list of devIDs from devices discovered in the HPE IMC platform and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param custom_view_name: str of the target custom view name...
[ "def", "add_devs_custom_views", "(", "custom_view_name", ",", "dev_list", ",", "auth", ",", "url", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", "=", "custom_view_name", ")", "if", "view_id", "is", "None", ":", "print", ...
function takes a list of devIDs from devices discovered in the HPE IMC platform and issues a RESTFUL call to add the list of devices to a specific custom views from HPE IMC. :param custom_view_name: str of the target custom view name :param dev_list: list containing the devID of all devices to be containe...
[ "function", "takes", "a", "list", "of", "devIDs", "from", "devices", "discovered", "in", "the", "HPE", "IMC", "platform", "and", "issues", "a", "RESTFUL", "call", "to", "add", "the", "list", "of", "devices", "to", "a", "specific", "custom", "views", "from"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L200-L241
HPENetworking/PYHPEIMC
pyhpeimc/plat/groups.py
delete_custom_view
def delete_custom_view(auth, url, name): """ function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth ...
python
def delete_custom_view(auth, url, name): """ function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth ...
[ "def", "delete_custom_view", "(", "auth", ",", "url", ",", "name", ")", ":", "view_id", "=", "get_custom_views", "(", "auth", ",", "url", ",", "name", ")", "if", "view_id", "is", "None", ":", "print", "(", "\"View \"", "+", "name", "+", "\" doesn't exist...
function takes input of auth, url, and name and issues a RESTFUL call to delete a specific of custom views from HPE IMC. :param name: string containg the name of the desired custom view :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC ...
[ "function", "takes", "input", "of", "auth", "url", "and", "name", "and", "issues", "a", "RESTFUL", "call", "to", "delete", "a", "specific", "of", "custom", "views", "from", "HPE", "IMC", ".", ":", "param", "name", ":", "string", "containg", "the", "name"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/groups.py#L244-L295
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator._get_token
def _get_token(self): """ Get token for make request. The The data obtained herein are used in the variable header. Returns: To perform the request, receive in return a dictionary with several keys. With this method only return the tok...
python
def _get_token(self): """ Get token for make request. The The data obtained herein are used in the variable header. Returns: To perform the request, receive in return a dictionary with several keys. With this method only return the tok...
[ "def", "_get_token", "(", "self", ")", ":", "informations", "=", "self", ".", "_set_format_oauth", "(", ")", "oauth_url", "=", "\"https://datamarket.accesscontrol.windows.net/v2/OAuth2-13\"", "token", "=", "requests", ".", "post", "(", "oauth_url", ",", "informations"...
Get token for make request. The The data obtained herein are used in the variable header. Returns: To perform the request, receive in return a dictionary with several keys. With this method only return the token as it will use it for subseq...
[ "Get", "token", "for", "make", "request", ".", "The", "The", "data", "obtained", "herein", "are", "used", "in", "the", "variable", "header", ".", "Returns", ":", "To", "perform", "the", "request", "receive", "in", "return", "a", "dictionary", "with", "seve...
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L35-L49
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator._set_format_oauth
def _set_format_oauth(self): """ Format and encode dict for make authentication on microsoft servers. """ format_oauth = urllib.parse.urlencode({ 'client_id': self._client_id, 'client_secret': self._client_secret, 'scope': self...
python
def _set_format_oauth(self): """ Format and encode dict for make authentication on microsoft servers. """ format_oauth = urllib.parse.urlencode({ 'client_id': self._client_id, 'client_secret': self._client_secret, 'scope': self...
[ "def", "_set_format_oauth", "(", "self", ")", ":", "format_oauth", "=", "urllib", ".", "parse", ".", "urlencode", "(", "{", "'client_id'", ":", "self", ".", "_client_id", ",", "'client_secret'", ":", "self", ".", "_client_secret", ",", "'scope'", ":", "self"...
Format and encode dict for make authentication on microsoft servers.
[ "Format", "and", "encode", "dict", "for", "make", "authentication", "on", "microsoft", "servers", "." ]
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L51-L62
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator._make_request
def _make_request(self, params, translation_url, headers): """ This is the final step, where the request is made, the data is retrieved and returned. """ resp = requests.get(translation_url, params=params, headers=headers) resp.encoding = "UTF-8-sig" ...
python
def _make_request(self, params, translation_url, headers): """ This is the final step, where the request is made, the data is retrieved and returned. """ resp = requests.get(translation_url, params=params, headers=headers) resp.encoding = "UTF-8-sig" ...
[ "def", "_make_request", "(", "self", ",", "params", ",", "translation_url", ",", "headers", ")", ":", "resp", "=", "requests", ".", "get", "(", "translation_url", ",", "params", "=", "params", ",", "headers", "=", "headers", ")", "resp", ".", "encoding", ...
This is the final step, where the request is made, the data is retrieved and returned.
[ "This", "is", "the", "final", "step", "where", "the", "request", "is", "made", "the", "data", "is", "retrieved", "and", "returned", "." ]
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L64-L72
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator._get_content
def _get_content(self, params, mode_translate): """ This method gets the token and makes the header variable that will be used in connection authentication. After that, calls the _make_request() method to return the desired data. """ token = self._get_...
python
def _get_content(self, params, mode_translate): """ This method gets the token and makes the header variable that will be used in connection authentication. After that, calls the _make_request() method to return the desired data. """ token = self._get_...
[ "def", "_get_content", "(", "self", ",", "params", ",", "mode_translate", ")", ":", "token", "=", "self", ".", "_get_token", "(", ")", "headers", "=", "{", "'Authorization'", ":", "'Bearer '", "+", "token", "}", "parameters", "=", "params", "translation_url"...
This method gets the token and makes the header variable that will be used in connection authentication. After that, calls the _make_request() method to return the desired data.
[ "This", "method", "gets", "the", "token", "and", "makes", "the", "header", "variable", "that", "will", "be", "used", "in", "connection", "authentication", ".", "After", "that", "calls", "the", "_make_request", "()", "method", "to", "return", "the", "desired", ...
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L74-L84
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator.detect_language
def detect_language(self, text): """ Params: ::text = Text for identify language. Returns: Returns language present on text. """ infos_translate = TextDetectLanguageModel(text).to_dict() mode_translate = Transl...
python
def detect_language(self, text): """ Params: ::text = Text for identify language. Returns: Returns language present on text. """ infos_translate = TextDetectLanguageModel(text).to_dict() mode_translate = Transl...
[ "def", "detect_language", "(", "self", ",", "text", ")", ":", "infos_translate", "=", "TextDetectLanguageModel", "(", "text", ")", ".", "to_dict", "(", ")", "mode_translate", "=", "TranslatorMode", ".", "Detect", ".", "value", "return", "self", ".", "_get_cont...
Params: ::text = Text for identify language. Returns: Returns language present on text.
[ "Params", ":", "::", "text", "=", "Text", "for", "identify", "language", ".", "Returns", ":", "Returns", "language", "present", "on", "text", "." ]
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L100-L110
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator.detect_languages
def detect_languages(self, texts): """ Params: ::texts = Array of texts for detect languages Returns: Returns language present on array of text. """ text_list = TextUtils.format_list_to_send(texts) infos_translate = TextDe...
python
def detect_languages(self, texts): """ Params: ::texts = Array of texts for detect languages Returns: Returns language present on array of text. """ text_list = TextUtils.format_list_to_send(texts) infos_translate = TextDe...
[ "def", "detect_languages", "(", "self", ",", "texts", ")", ":", "text_list", "=", "TextUtils", ".", "format_list_to_send", "(", "texts", ")", "infos_translate", "=", "TextDetectLanguageModel", "(", "text_list", ")", ".", "to_dict", "(", ")", "texts_for_detect", ...
Params: ::texts = Array of texts for detect languages Returns: Returns language present on array of text.
[ "Params", ":", "::", "texts", "=", "Array", "of", "texts", "for", "detect", "languages", "Returns", ":", "Returns", "language", "present", "on", "array", "of", "text", "." ]
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L112-L125
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator.translate
def translate(self, text, to_lang, from_lang=None, content_type="text/plain", category=None): """ This method takes as a parameter the desired text to be translated and the language to which should be translated. To find the code for each language just ...
python
def translate(self, text, to_lang, from_lang=None, content_type="text/plain", category=None): """ This method takes as a parameter the desired text to be translated and the language to which should be translated. To find the code for each language just ...
[ "def", "translate", "(", "self", ",", "text", ",", "to_lang", ",", "from_lang", "=", "None", ",", "content_type", "=", "\"text/plain\"", ",", "category", "=", "None", ")", ":", "infos_translate", "=", "TextModel", "(", "text", ",", "to_lang", ",", "from_la...
This method takes as a parameter the desired text to be translated and the language to which should be translated. To find the code for each language just go to the library home page. The parameter ::from_lang:: is optional because the api microsoft recognizes the l...
[ "This", "method", "takes", "as", "a", "parameter", "the", "desired", "text", "to", "be", "translated", "and", "the", "language", "to", "which", "should", "be", "translated", ".", "To", "find", "the", "code", "for", "each", "language", "just", "go", "to", ...
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L127-L143
wilfilho/BingTranslator
BingTranslator/__init__.py
Translator.speak_phrase
def speak_phrase(self, text, language, format_audio=None, option=None): """ This method is very similar to the above, the difference between them is that this method creates an object of class TranslateSpeak(having therefore different attributes) and use a...
python
def speak_phrase(self, text, language, format_audio=None, option=None): """ This method is very similar to the above, the difference between them is that this method creates an object of class TranslateSpeak(having therefore different attributes) and use a...
[ "def", "speak_phrase", "(", "self", ",", "text", ",", "language", ",", "format_audio", "=", "None", ",", "option", "=", "None", ")", ":", "infos_speak_translate", "=", "SpeakModel", "(", "text", ",", "language", ",", "format_audio", ",", "option", ")", "."...
This method is very similar to the above, the difference between them is that this method creates an object of class TranslateSpeak(having therefore different attributes) and use another url, as we see the presence of SpeakMode enumerator instead of Translate. ...
[ "This", "method", "is", "very", "similar", "to", "the", "above", "the", "difference", "between", "them", "is", "that", "this", "method", "creates", "an", "object", "of", "class", "TranslateSpeak", "(", "having", "therefore", "different", "attributes", ")", "an...
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/__init__.py#L179-L201
HPENetworking/PYHPEIMC
pyhpeimc/plat/vrm.py
get_vm_host_info
def get_vm_host_info(hostip, auth, url): """ function takes hostId as input to RESTFUL call to HP IMC :param hostip: int or string of hostip of Hypervisor host :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually aut...
python
def get_vm_host_info(hostip, auth, url): """ function takes hostId as input to RESTFUL call to HP IMC :param hostip: int or string of hostip of Hypervisor host :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually aut...
[ "def", "get_vm_host_info", "(", "hostip", ",", "auth", ",", "url", ")", ":", "hostid", "=", "get_dev_details", "(", "hostip", ",", "auth", ",", "url", ")", "[", "'id'", "]", "f_url", "=", "url", "+", "\"/imcrs/vrm/host?hostId=\"", "+", "str", "(", "hosti...
function takes hostId as input to RESTFUL call to HP IMC :param hostip: int or string of hostip of Hypervisor host :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: Dict...
[ "function", "takes", "hostId", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/vrm.py#L21-L79
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/operator.py
get_plat_operator
def get_plat_operator(auth, url,headers=HEADERS): ''' Funtion takes no inputs and returns a list of dictionaties of all of the operators currently configured on the HPE IMC system :return: list of dictionaries ''' get_operator_url = '/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&t...
python
def get_plat_operator(auth, url,headers=HEADERS): ''' Funtion takes no inputs and returns a list of dictionaties of all of the operators currently configured on the HPE IMC system :return: list of dictionaries ''' get_operator_url = '/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&t...
[ "def", "get_plat_operator", "(", "auth", ",", "url", ",", "headers", "=", "HEADERS", ")", ":", "get_operator_url", "=", "'/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&total=false'", "f_url", "=", "url", "+", "get_operator_url", "try", ":", "r", "=", "r...
Funtion takes no inputs and returns a list of dictionaties of all of the operators currently configured on the HPE IMC system :return: list of dictionaries
[ "Funtion", "takes", "no", "inputs", "and", "returns", "a", "list", "of", "dictionaties", "of", "all", "of", "the", "operators", "currently", "configured", "on", "the", "HPE", "IMC", "system", ":", "return", ":", "list", "of", "dictionaries" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/operator.py#L115-L129
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/operator.py
delete_plat_operator
def delete_plat_operator(operator,auth, url, headers=HEADERS): """ Function to set the password of an existing operator :param operator: str Name of the operator account :param password: str New password :param url: str url of IMC server, see requests library docs for more info :param auth: str ...
python
def delete_plat_operator(operator,auth, url, headers=HEADERS): """ Function to set the password of an existing operator :param operator: str Name of the operator account :param password: str New password :param url: str url of IMC server, see requests library docs for more info :param auth: str ...
[ "def", "delete_plat_operator", "(", "operator", ",", "auth", ",", "url", ",", "headers", "=", "HEADERS", ")", ":", "#oper_id = None", "plat_oper_list", "=", "get_plat_operator", "(", "auth", ",", "url", ")", "for", "i", "in", "plat_oper_list", ":", "if", "op...
Function to set the password of an existing operator :param operator: str Name of the operator account :param password: str New password :param url: str url of IMC server, see requests library docs for more info :param auth: str see requests library docs for more info :param headers: json formated s...
[ "Function", "to", "set", "the", "password", "of", "an", "existing", "operator", ":", "param", "operator", ":", "str", "Name", "of", "the", "operator", "account", ":", "param", "password", ":", "str", "New", "password", ":", "param", "url", ":", "str", "u...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/operator.py#L131-L158
Tygs/ww
src/ww/wrappers/tuples.py
TupleWrapper.index
def index(self, value): """ Args: value: index Returns: index of the values Raises: ValueError: value is not in list """ for i, x in enumerate(self): if x == value: return i raise ValueError("{} is not in lis...
python
def index(self, value): """ Args: value: index Returns: index of the values Raises: ValueError: value is not in list """ for i, x in enumerate(self): if x == value: return i raise ValueError("{} is not in lis...
[ "def", "index", "(", "self", ",", "value", ")", ":", "for", "i", ",", "x", "in", "enumerate", "(", "self", ")", ":", "if", "x", "==", "value", ":", "return", "i", "raise", "ValueError", "(", "\"{} is not in list\"", ".", "format", "(", "value", ")", ...
Args: value: index Returns: index of the values Raises: ValueError: value is not in list
[ "Args", ":", "value", ":", "index" ]
train
https://github.com/Tygs/ww/blob/6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4/src/ww/wrappers/tuples.py#L33-L48
Tygs/ww
src/ww/wrappers/tuples.py
TupleWrapper.to_d
def to_d(self): """ Args: self Returns: a d that stems from self Raises: ValueError: dictionary update sequence element #index has length len(tuple); 2 is required TypeError: cannot convert dictionary update sequence element #index to a ...
python
def to_d(self): """ Args: self Returns: a d that stems from self Raises: ValueError: dictionary update sequence element #index has length len(tuple); 2 is required TypeError: cannot convert dictionary update sequence element #index to a ...
[ "def", "to_d", "(", "self", ")", ":", "try", ":", "return", "ww", ".", "d", "(", "self", ")", "except", "(", "TypeError", ",", "ValueError", ")", ":", "for", "i", ",", "element", "in", "enumerate", "(", "self", ")", ":", "try", ":", "iter", "(", ...
Args: self Returns: a d that stems from self Raises: ValueError: dictionary update sequence element #index has length len(tuple); 2 is required TypeError: cannot convert dictionary update sequence element #index to a sequence
[ "Args", ":", "self" ]
train
https://github.com/Tygs/ww/blob/6a4b85141c9b74026abe8f3fa9bc7021f3c99fd4/src/ww/wrappers/tuples.py#L59-L101
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/icc.py
get_cfg_template
def get_cfg_template(auth, url, folder = None): ''' Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :p...
python
def get_cfg_template(auth, url, folder = None): ''' Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :p...
[ "def", "get_cfg_template", "(", "auth", ",", "url", ",", "folder", "=", "None", ")", ":", "if", "folder", "==", "None", ":", "get_cfg_template_url", "=", "\"/imcrs/icc/confFile/list\"", "else", ":", "folder_id", "=", "get_folder_id", "(", "folder", ",", "auth"...
Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url fro...
[ "Function", "takes", "no", "input", "and", "returns", "a", "list", "of", "dictionaries", "containing", "the", "configuration", "templates", "in", "the", "root", "folder", "of", "the", "icc", "configuration", "template", "library", "." ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L17-L67
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/icc.py
create_cfg_segment
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 :param...
python
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 :param...
[ "def", "create_cfg_segment", "(", "filename", ",", "filecontent", ",", "description", ",", "auth", ",", "url", ")", ":", "payload", "=", "{", "\"confFileName\"", ":", "filename", ",", "\"confFileType\"", ":", "\"2\"", ",", "\"cfgFileParent\"", ":", "\"-1\"", "...
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 fileco...
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L71-L117
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/icc.py
get_template_id
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 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 R...
python
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 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 R...
[ "def", "get_template_id", "(", "template_name", ",", "auth", ",", "url", ")", ":", "object_list", "=", "get_cfg_template", "(", "auth", "=", "auth", ",", "url", "=", "url", ")", "for", "object", "in", "object_list", ":", "if", "object", "[", "'confFileName...
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 ...
[ "Helper", "function", "takes", "str", "input", "of", "folder", "name", "and", "returns", "str", "numerical", "id", "of", "the", "folder", ".", ":", "param", "folder_name", ":", "str", "name", "of", "the", "folder" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L120-L148
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/icc.py
delete_cfg_template
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 #...
python
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", ")", ":", "file_id", "=", "get_template_id", "(", "template_name", ",", "auth", ",", "url", ")", "delete_cfg_template_url", "=", "\"/imcrs/icc/confFile/\"", "+", "str", "(", "file_id", ...
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...
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L151-L187
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/icc.py
get_folder_id
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...
python
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", ")", ":", "object_list", "=", "get_cfg_template", "(", "auth", "=", "auth", ",", "url", "=", "url", ")", "for", "object", "in", "object_list", ":", "if", "object", "[", "'confFileName'", ...
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 ...
[ "Helper", "function", "takes", "str", "input", "of", "folder", "name", "and", "returns", "str", "numerical", "id", "of", "the", "folder", ".", ":", "param", "folder_name", ":", "str", "name", "of", "the", "folder" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/icc.py#L189-L217
lablup/backend.ai-client-py
src/ai/backend/client/cli/pretty.py
bold
def bold(text: str) -> str: ''' Wraps the given text with bold enable/disable ANSI sequences. ''' return (style(text, bold=True, reset=False) + style('', bold=False, reset=False))
python
def bold(text: str) -> str: ''' Wraps the given text with bold enable/disable ANSI sequences. ''' return (style(text, bold=True, reset=False) + style('', bold=False, reset=False))
[ "def", "bold", "(", "text", ":", "str", ")", "->", "str", ":", "return", "(", "style", "(", "text", ",", "bold", "=", "True", ",", "reset", "=", "False", ")", "+", "style", "(", "''", ",", "bold", "=", "False", ",", "reset", "=", "False", ")", ...
Wraps the given text with bold enable/disable ANSI sequences.
[ "Wraps", "the", "given", "text", "with", "bold", "enable", "/", "disable", "ANSI", "sequences", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/pretty.py#L28-L33
lablup/backend.ai-client-py
src/ai/backend/client/manager.py
Manager.status
async def status(cls): ''' Returns the current status of the configured API server. ''' rqst = Request(cls.session, 'GET', '/manager/status') rqst.set_json({ 'status': 'running', }) async with rqst.fetch() as resp: return await resp.json()
python
async def status(cls): ''' Returns the current status of the configured API server. ''' rqst = Request(cls.session, 'GET', '/manager/status') rqst.set_json({ 'status': 'running', }) async with rqst.fetch() as resp: return await resp.json()
[ "async", "def", "status", "(", "cls", ")", ":", "rqst", "=", "Request", "(", "cls", ".", "session", ",", "'GET'", ",", "'/manager/status'", ")", "rqst", ".", "set_json", "(", "{", "'status'", ":", "'running'", ",", "}", ")", "async", "with", "rqst", ...
Returns the current status of the configured API server.
[ "Returns", "the", "current", "status", "of", "the", "configured", "API", "server", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/manager.py#L18-L27
lablup/backend.ai-client-py
src/ai/backend/client/manager.py
Manager.freeze
async def freeze(cls, force_kill: bool = False): ''' Freezes the configured API server. Any API clients will no longer be able to create new compute sessions nor create and modify vfolders/keypairs/etc. This is used to enter the maintenance mode of the server for unobtrusive ...
python
async def freeze(cls, force_kill: bool = False): ''' Freezes the configured API server. Any API clients will no longer be able to create new compute sessions nor create and modify vfolders/keypairs/etc. This is used to enter the maintenance mode of the server for unobtrusive ...
[ "async", "def", "freeze", "(", "cls", ",", "force_kill", ":", "bool", "=", "False", ")", ":", "rqst", "=", "Request", "(", "cls", ".", "session", ",", "'PUT'", ",", "'/manager/status'", ")", "rqst", ".", "set_json", "(", "{", "'status'", ":", "'frozen'...
Freezes the configured API server. Any API clients will no longer be able to create new compute sessions nor create and modify vfolders/keypairs/etc. This is used to enter the maintenance mode of the server for unobtrusive manager and/or agent upgrades. :param force_kill: If set...
[ "Freezes", "the", "configured", "API", "server", ".", "Any", "API", "clients", "will", "no", "longer", "be", "able", "to", "create", "new", "compute", "sessions", "nor", "create", "and", "modify", "vfolders", "/", "keypairs", "/", "etc", ".", "This", "is",...
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/manager.py#L31-L50
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/alarms.py
get_dev_alarms
def get_dev_alarms(devId, auth=auth.creds, url=auth.url): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this devic...
python
def get_dev_alarms(devId, auth=auth.creds, url=auth.url): """ function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this devic...
[ "def", "get_dev_alarms", "(", "devId", ",", "auth", "=", "auth", ".", "creds", ",", "url", "=", "auth", ".", "url", ")", ":", "# checks to see if the imc credentials are already available", "get_dev_alarm_url", "=", "\"/imcrs/fault/alarm?operatorName=admin&deviceId=\"", "...
function takes the devId of a specific device and issues a RESTFUL call to get the current alarms for the target device. :param devId: int or str value of the target device :return:list of dictionaries containing the alarms for this device
[ "function", "takes", "the", "devId", "of", "a", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "current", "alarms", "for", "the", "target", "device", ".", ":", "param", "devId", ":", "int", "or", "str", "value", "of", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/alarms.py#L43-L64
lablup/backend.ai-client-py
src/ai/backend/client/cli/files.py
upload
def upload(sess_id_or_alias, files): """ Upload files to user's home folder. \b SESSID: Session ID or its alias given when creating the session. FILES: Path to upload. """ if len(files) < 1: return with Session() as session: try: print_wait('Uploading files.....
python
def upload(sess_id_or_alias, files): """ Upload files to user's home folder. \b SESSID: Session ID or its alias given when creating the session. FILES: Path to upload. """ if len(files) < 1: return with Session() as session: try: print_wait('Uploading files.....
[ "def", "upload", "(", "sess_id_or_alias", ",", "files", ")", ":", "if", "len", "(", "files", ")", "<", "1", ":", "return", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "print_wait", "(", "'Uploading files...'", ")", "kernel", "=", "se...
Upload files to user's home folder. \b SESSID: Session ID or its alias given when creating the session. FILES: Path to upload.
[ "Upload", "files", "to", "user", "s", "home", "folder", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/files.py#L17-L35
lablup/backend.ai-client-py
src/ai/backend/client/cli/files.py
download
def download(sess_id_or_alias, files, dest): """ Download files from a running container. \b SESSID: Session ID or its alias given when creating the session. FILES: Paths inside container. """ if len(files) < 1: return with Session() as session: try: print_wa...
python
def download(sess_id_or_alias, files, dest): """ Download files from a running container. \b SESSID: Session ID or its alias given when creating the session. FILES: Paths inside container. """ if len(files) < 1: return with Session() as session: try: print_wa...
[ "def", "download", "(", "sess_id_or_alias", ",", "files", ",", "dest", ")", ":", "if", "len", "(", "files", ")", "<", "1", ":", "return", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "print_wait", "(", "'Downloading file(s) from {}...'", ...
Download files from a running container. \b SESSID: Session ID or its alias given when creating the session. FILES: Paths inside container.
[ "Download", "files", "from", "a", "running", "container", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/files.py#L43-L62
lablup/backend.ai-client-py
src/ai/backend/client/cli/files.py
ls
def ls(sess_id_or_alias, path): """ List files in a path of a running container. \b SESSID: Session ID or its alias given when creating the session. PATH: Path inside container. """ with Session() as session: try: print_wait('Retrieving list of files in "{}"...'.format(p...
python
def ls(sess_id_or_alias, path): """ List files in a path of a running container. \b SESSID: Session ID or its alias given when creating the session. PATH: Path inside container. """ with Session() as session: try: print_wait('Retrieving list of files in "{}"...'.format(p...
[ "def", "ls", "(", "sess_id_or_alias", ",", "path", ")", ":", "with", "Session", "(", ")", "as", "session", ":", "try", ":", "print_wait", "(", "'Retrieving list of files in \"{}\"...'", ".", "format", "(", "path", ")", ")", "kernel", "=", "session", ".", "...
List files in a path of a running container. \b SESSID: Session ID or its alias given when creating the session. PATH: Path inside container.
[ "List", "files", "in", "a", "path", "of", "a", "running", "container", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/files.py#L68-L99
AoiKuiyuyou/AoikLiveReload
src/aoiklivereload/demo/sanic_demo.py
main
def main(): """ Main function. :return: None. """ try: # Get the `src` directory's absolute path src_path = os.path.dirname( # `aoiklivereload` directory's absolute path os.path.dirname( # `demo` directory's absolute path ...
python
def main(): """ Main function. :return: None. """ try: # Get the `src` directory's absolute path src_path = os.path.dirname( # `aoiklivereload` directory's absolute path os.path.dirname( # `demo` directory's absolute path ...
[ "def", "main", "(", ")", ":", "try", ":", "# Get the `src` directory's absolute path", "src_path", "=", "os", ".", "path", ".", "dirname", "(", "# `aoiklivereload` directory's absolute path", "os", ".", "path", ".", "dirname", "(", "# `demo` directory's absolute path", ...
Main function. :return: None.
[ "Main", "function", "." ]
train
https://github.com/AoiKuiyuyou/AoikLiveReload/blob/0d5adb12118a33749e6690a8165fdb769cff7d5c/src/aoiklivereload/demo/sanic_demo.py#L16-L94
HPENetworking/PYHPEIMC
pyhpeimc/plat/icc.py
get_cfg_template
def get_cfg_template(auth, url, folder=None): """ Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :par...
python
def get_cfg_template(auth, url, folder=None): """ Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :par...
[ "def", "get_cfg_template", "(", "auth", ",", "url", ",", "folder", "=", "None", ")", ":", "if", "folder", "is", "None", ":", "get_cfg_template_url", "=", "\"/imcrs/icc/confFile/list\"", "else", ":", "folder_id", "=", "get_folder_id", "(", "folder", ",", "auth"...
Function takes no input and returns a list of dictionaries containing the configuration templates in the root folder of the icc configuration template library. :param auth: requests auth object #usually auth.creds from auth pyhpeimc.auth.class :param url: base url of IMC RS interface #usually auth.url fro...
[ "Function", "takes", "no", "input", "and", "returns", "a", "list", "of", "dictionaries", "containing", "the", "configuration", "templates", "in", "the", "root", "folder", "of", "the", "icc", "configuration", "template", "library", "." ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L19-L74
HPENetworking/PYHPEIMC
pyhpeimc/plat/icc.py
create_cfg_segment
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...
python
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", ")", ":", "payload", "=", "{", "\"confFileName\"", ":", "filename", ",", "\"confFileType\"", ":", "\"2\"", ",", "\"cfgFileParent\"", ":", "\"-1\"", "...
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...
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L77-L130
HPENetworking/PYHPEIMC
pyhpeimc/plat/icc.py
get_template_id
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...
python
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", ")", ":", "object_list", "=", "get_cfg_template", "(", "auth", "=", "auth", ",", "url", "=", "url", ")", "for", "template", "in", "object_list", ":", "if", "template", "[", "'confFile...
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...
[ "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" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L133-L161
HPENetworking/PYHPEIMC
pyhpeimc/plat/icc.py
get_folder_id
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...
python
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", ")", ":", "object_list", "=", "get_cfg_template", "(", "auth", "=", "auth", ",", "url", "=", "url", ")", "for", "template", "in", "object_list", ":", "if", "template", "[", "'confFileName...
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 ...
[ "Helper", "function", "takes", "str", "input", "of", "folder", "name", "and", "returns", "str", "numerical", "id", "of", "the", "folder", ".", ":", "param", "folder_name", ":", "str", "name", "of", "the", "folder" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L164-L192
HPENetworking/PYHPEIMC
pyhpeimc/plat/icc.py
delete_cfg_template
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 #...
python
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", ")", ":", "file_id", "=", "get_template_id", "(", "template_name", ",", "auth", ",", "url", ")", "f_url", "=", "url", "+", "\"/imcrs/icc/confFile/\"", "+", "str", "(", "file_id", ")...
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...
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L195-L226
HPENetworking/PYHPEIMC
pyhpeimc/plat/icc.py
get_template_details
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:...
python
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", ")", ":", "file_id", "=", "get_template_id", "(", "template_name", ",", "auth", ",", "url", ")", "if", "isinstance", "(", "file_id", ",", "str", ")", ":", "return", "file_id", "f...
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...
[ "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"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/icc.py#L229-L272
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/vlanm.py
get_dev_vlans
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 ...
python
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", ")", ":", "# 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", ...
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
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L35-L55
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/vlanm.py
get_trunk_interfaces
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"...
python
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", ")", ":", "# 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...
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("...
[ "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...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L57-L81
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/vlanm.py
get_device_access_interfaces
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...
python
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", ")", ":", "# checks to see if the imc credentials are already available", "get_access_interface_vlan_url", "=", "\"/imcrs/vlan/access?devId=\"", "+", "str", "(", "devId", ")", "+", "\"&start=1&size=...
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
[ "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"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L86-L107
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/vlanm.py
create_dev_vlan
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...
python
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", ")", ":", "create_dev_vlan_url", "=", "\"/imcrs/vlan?devId=\"", "+", "str", "(", "devid", ")", "f_url", "=", "url", "+", "create_dev_vlan_url", "payload", "=", ...
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 ...
[ "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"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L119-L142
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/vlanm.py
delete_dev_vlans
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...
python
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", ")", ":", "remove_dev_vlan_url", "=", "\"/imcrs/vlan/delvlan?devId=\"", "+", "str", "(", "devid", ")", "+", "\"&vlanId=\"", "+", "str", "(", "vlanid", ")", "f_url", "=", "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 204 with no values.
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/vlanm.py#L145-L166
HPENetworking/PYHPEIMC
pyhpeimc/plat/operator.py
create_operator
def create_operator(operator, auth, url): """ Function takes input of dictionary operator with the following keys operator = { "fullName" : "" , "sessionTimeout" : "", "password" : "", "operatorGroupId" : "", "name" : "", "desc" : "", ...
python
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", ")", ":", "f_url", "=", "url", "+", "'/imcrs/plat/operator'", "payload", "=", "json", ".", "dumps", "(", "operator", ",", "indent", "=", "4", ")", "response", "=", "requests", ".", "post...
Function takes input of dictionary operator with the following keys operator = { "fullName" : "" , "sessionTimeout" : "", "password" : "", "operatorGroupId" : "", "name" : "", "desc" : "", "defaultAcl" : "", "authType" : ...
[ "Function", "takes", "input", "of", "dictionary", "operator", "with", "the", "following", "keys", "operator", "=", "{", "fullName", ":", "sessionTimeout", ":", "password", ":", "operatorGroupId", ":", "name", ":", "desc", ":", "defaultAcl", ":", "authType", ":...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L22-L84
HPENetworking/PYHPEIMC
pyhpeimc/plat/operator.py
set_operator_password
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...
python
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", ")", ":", "if", "operator", "is", "None", ":", "operator", "=", "input", "(", "'''\\n What is the username you wish to change the password?'''", ")", "oper_id", "=", "''", "...
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...
[ "Function", "to", "set", "the", "password", "of", "an", "existing", "operator" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L87-L148
HPENetworking/PYHPEIMC
pyhpeimc/plat/operator.py
get_plat_operator
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 ...
python
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", ")", ":", "f_url", "=", "url", "+", "'/imcrs/plat/operator?start=0&size=1000&orderBy=id&desc=false&total=false'", "try", ":", "response", "=", "requests", ".", "get", "(", "f_url", ",", "auth", "=", "auth", ",",...
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...
[ "Funtion", "takes", "no", "inputs", "and", "returns", "a", "list", "of", "dictionaties", "of", "all", "of", "the", "operators", "currently", "configured", "on", "the", "HPE", "IMC", "system" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L151-L187
HPENetworking/PYHPEIMC
pyhpeimc/plat/operator.py
delete_plat_operator
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...
python
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", ")", ":", "oper_id", "=", "None", "plat_oper_list", "=", "get_plat_operator", "(", "auth", ",", "url", ")", "for", "i", "in", "plat_oper_list", ":", "if", "operator", "==", "i", "[", ...
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...
[ "Function", "to", "set", "the", "password", "of", "an", "existing", "operator", ":", "param", "operator", ":", "str", "Name", "of", "the", "operator", "account" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/operator.py#L190-L240
housecanary/hc-api-python
housecanary/requestclient.py
RequestClient.execute_request
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...
python
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", ")", ":", "response", "=", "requests", ".", "request", "(", "http_method", ",", "url", ",", "params", "=", "query_params", ",", "auth", "=", "self...
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...
[ "Makes", "a", "request", "to", "the", "specified", "url", "endpoint", "with", "the", "specified", "http", "method", "params", "and", "post", "data", "." ]
train
https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/requestclient.py#L32-L59
housecanary/hc-api-python
housecanary/requestclient.py
RequestClient.post
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 ...
python
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", ")", ":", "if", "query_params", "is", "None", ":", "query_params", "=", "{", "}", "return", "self", ".", "execute_request", "(", "url", ",", "\"POST\"", ",", "q...
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...
[ "Makes", "a", "POST", "request", "to", "the", "specified", "url", "endpoint", "." ]
train
https://github.com/housecanary/hc-api-python/blob/2bb9e2208b34e8617575de45934357ee33b8531c/housecanary/requestclient.py#L76-L93
HPENetworking/PYHPEIMC
examples/HPE IMC Custom Views.py
import_custom_views
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...
python
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", ")", ":", "with", "open", "(", "filename", ")", "as", "csvfile", ":", "# decodes file as csv as a python dictionary", "reader", "=", "csv", ".", "DictReader", "(", "csvfile", ")", "for", "view", "in", "reader", ":",...
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...
[ "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"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/examples/HPE IMC Custom Views.py#L8-L25
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
get_real_time_locate
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...
python
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", ")", ":", "f_url", "=", "url", "+", "\"/imcrs/res/access/realtimeLocate?type=2&value=\"", "+", "str", "(", "host_ipaddress", ")", "+", "\"&total=false\"", "response", "=", "requests", "."...
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...
[ "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...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L23-L83
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
get_ip_mac_arp_list
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...
python
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", ")", ":", "if", "devip", "is", "not", "None", ":", "dev_details", "=", "get_dev_details", "(", "devip", ",", "auth", ",", "url", ")", "if", "...
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...
[ "function", "takes", "devid", "of", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "get", "the", "IP", "/", "MAC", "/", "ARP", "list", "from", "the", "target", "device", "." ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L86-L135
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
get_ip_scope
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 ...
python
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", ",", ")", ":", "if", "scopeid", "is", "None", ":", "get_ip_scope_url", "=", "\"/imcrs/res/access/assignedIpScope\"", "else", ":", "get_ip_scope_url", "=", "\"/imcrs/res/access/assignedIpSco...
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...
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L143-L187
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
add_ip_scope
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...
python
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", ")", ":", "if", "network_address", "is", "not", "None", ":", "nw_address", "=", ...
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...
[ "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" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L233-L295
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
delete_ip_scope
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...
python
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", ")", ":", "scope_id", "=", "get_scope_id", "(", "network_address", ",", "auth", ",", "url", ")", "if", "scope_id", "==", "\"Scope Doesn't Exist\"", ":", "return", "scope_id", "f_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 = IMCAuth("http://", "10.101.0.203", "8080", "admin", "admin") ...
[ "Function", "to", "delete", "an", "entire", "IP", "segment", "from", "the", "IMC", "IP", "Address", "management", "under", "terminal", "access", ":", "param", "network_address", ":", "param", "auth", ":", "param", "url" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L357-L386
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
add_scope_ip
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 ...
python
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", ")", ":", "if", "network_address", "is", "not", "None", ":", "scopeid", "=", "get_scope...
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...
[ "Function", "to", "add", "new", "host", "IP", "address", "allocation", "to", "existing", "scope", "ID" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L391-L440
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
remove_scope_ip
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...
python
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", ")", ":", "f_url", "=", "url", "+", "'/imcrs/res/access/assignedIpScope/ip/'", "+", "str", "(", "hostid", ")", "response", "=", "requests", ".", "delete", "(", "f_url", ",", "auth", "=", "au...
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...
[ "Function", "to", "add", "remove", "IP", "address", "allocation" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L443-L486
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
get_ip_scope_hosts
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...
python
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", ")", ":", "if", "network_address", "is", "not", "None", ":", "scopeid", "=", "get_scope_id", "(", "network_address", ",", "auth", ",", "...
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...
[ "Function", "requires", "input", "of", "scope", "ID", "and", "returns", "list", "of", "allocated", "IP", "address", "for", "the", "specified", "scope" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L489-L546
HPENetworking/PYHPEIMC
pyhpeimc/plat/termaccess.py
delete_host_from_segment
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...
python
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", ")", ":", "host_id", "=", "get_host_id", "(", "hostipaddress", ",", "networkaddress", ",", "auth", ",", "url", ")", "delete_host", "=", "remove_scope_ip", "(...
: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...
[ ":", "param", "hostipaddress", ":", "str", "ipv4", "address", "of", "the", "target", "host", "to", "be", "deleted" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/pyhpeimc/plat/termaccess.py#L578-L595
landscapeio/pylint-common
pylint_common/augmentations.py
allow_attribute_comments
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...
python
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", ")", ":", "# TODO: find the relevant citation for why this is the correct way to comment attributes", "if", "isinstance", "(", "node", ".", "previous_sibling", "(", ")", ",", "astroid", ".", "Assign", ")", "and...
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 '''
[ "This", "augmentation", "is", "to", "allow", "comments", "on", "class", "attributes", "for", "example", ":" ]
train
https://github.com/landscapeio/pylint-common/blob/c4d492ec25dca42e78508bf30dcfdac7ed71898f/pylint_common/augmentations.py#L12-L28
wilfilho/BingTranslator
BingTranslator/utils.py
DownloadAudio.download
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...
python
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", ")", ":", "if", "path", "is", "not", "None", ":", "with", "open", "(", "str", "(", "path", "+", "name_audio", ")", ",", "'wb'", ")", "as", "handle", ":", "response", "=", ...
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...
[ "Params", ":" ]
train
https://github.com/wilfilho/BingTranslator/blob/6bada6fe1ac4177cc7dc62ff16dab561ba714534/BingTranslator/utils.py#L39-L61
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/netassets.py
get_dev_asset_details
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...
python
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", ")", ":", "get_dev_asset_url", "=", "\"/imcrs/netasset/asset?assetDevice.ip=\"", "+", "str", "(", "ipaddress", ")", "f_url", "=", "url", "+", "get_dev_asset_url", "# creates the URL using the pay...
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...
[ "Takes", "in", "ipaddress", "as", "input", "to", "fetch", "device", "assett", "details", "from", "HP", "IMC", "RESTFUL", "API" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/netassets.py#L17-L59
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/netassets.py
get_dev_asset_details_all
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 ...
python
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", ")", ":", "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...
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...
[ "Takes", "no", "input", "to", "fetch", "device", "assett", "details", "from", "HP", "IMC", "RESTFUL", "API" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/netassets.py#L61-L95
mozilla-services/python-dockerflow
src/dockerflow/flask/checks/__init__.py
check_database_connected
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`...
python
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", ")", ":", "from", "sqlalchemy", ".", "exc", "import", "DBAPIError", ",", "SQLAlchemyError", "errors", "=", "[", "]", "try", ":", "with", "db", ".", "engine", ".", "connect", "(", ")", "as", "connection", ":", ...
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.:: ...
[ "A", "built", "-", "in", "check", "to", "see", "if", "connecting", "to", "the", "configured", "default", "database", "backend", "succeeds", "." ]
train
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/checks/__init__.py#L14-L46
mozilla-services/python-dockerflow
src/dockerflow/flask/checks/__init__.py
check_migrations_applied
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...
python
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", ")", ":", "errors", "=", "[", "]", "from", "alembic", ".", "migration", "import", "MigrationContext", "from", "alembic", ".", "script", "import", "ScriptDirectory", "from", "sqlalchemy", ".", "exc", "import", "D...
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.:: ...
[ "A", "built", "-", "in", "check", "to", "see", "if", "all", "migrations", "have", "been", "applied", "correctly", "." ]
train
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/checks/__init__.py#L49-L93
mozilla-services/python-dockerflow
src/dockerflow/flask/checks/__init__.py
check_redis_connected
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....
python
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", ")", ":", "import", "redis", "errors", "=", "[", "]", "try", ":", "result", "=", "client", ".", "ping", "(", ")", "except", "redis", ".", "ConnectionError", "as", "e", ":", "msg", "=", "'Could not connect to r...
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...
[ "A", "built", "-", "in", "check", "to", "connect", "to", "Redis", "using", "the", "given", "client", "and", "see", "if", "it", "responds", "to", "the", "PING", "command", "." ]
train
https://github.com/mozilla-services/python-dockerflow/blob/43703c5e8934ba6901b0a1520d6da4ed6457208c/src/dockerflow/flask/checks/__init__.py#L96-L145
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/groups.py
get_custom_views
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...
python
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", ")", ":", "if", "name", "is", "None", ":", "get_custom_view_url", "=", "'/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false&total=false'", "elif"...
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
[ "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", "...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/groups.py#L42-L64
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/groups.py
create_custom_views
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...
python
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", ")", ":", "create_custom_views_url", "=", "'/imcrs/plat/res/view/custom?resPrivilegeFilter=false&desc=false&total=false'", "f_url", "=", "url", "+", "create_c...
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.
[ "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...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/groups.py#L67-L90
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/device.py
get_dev_run_config
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...
python
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", ")", ":", "# checks to see if the imc credentials are already available", "get_dev_run_url", "=", "\"/imcrs/icc/deviceCfg/\"", "+", "str", "(", "devid", ")", "+", "\"/currentRun\"", "f_url", "=", "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 which contains the entire content of the target device ...
[ "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",...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/device.py#L91-L114
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/device.py
get_dev_start_config
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...
python
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", ")", ":", "# checks to see if the imc credentials are already available", "get_dev_run_url", "=", "\"/imcrs/icc/deviceCfg/\"", "+", "str", "(", "devId", ")", "+", "\"/currentStart\"", "f_url", "=", "u...
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 ...
[ "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",...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/device.py#L117-L140
HPENetworking/PYHPEIMC
build/lib/pyhpimc/plat/device.py
set_inteface_up
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...
python
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", ")", ":", "set_int_up_url", "=", "\"/imcrs/plat/res/device/\"", "+", "str", "(", "devid", ")", "+", "\"/interface/\"", "+", "str", "(", "ifindex", ")", "+", "\"/up\"", "f_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 target interface :return: HTTP status code 204 with no va...
[ "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", ...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpimc/plat/device.py#L186-L202
lablup/backend.ai-client-py
src/ai/backend/client/cli/admin/vfolders.py
vfolders
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...
python
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", ")", ":", "fields", "=", "[", "(", "'Name'", ",", "'name'", ")", ",", "(", "'Created At'", ",", "'created_at'", ")", ",", "(", "'Last Used'", ",", "'last_used'", ")", ",", "(", "'Max Files'", ",", "'max_files'", ")",...
List and manage virtual folders.
[ "List", "and", "manage", "virtual", "folders", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/admin/vfolders.py#L15-L39
lablup/backend.ai-client-py
src/ai/backend/client/cli/config.py
config
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...
python
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", "(", ")", ":", "config", "=", "get_config", "(", ")", "print", "(", "'Client version: {0}'", ".", "format", "(", "click", ".", "style", "(", "__version__", ",", "bold", "=", "True", ")", ")", ")", "print", "(", "'API endpoint: {0}'", "."...
Shows the current configuration.
[ "Shows", "the", "current", "configuration", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/cli/config.py#L9-L23
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_system_vendors
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 ...
python
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", ")", ":", "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...
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 ...
[ "Takes", "string", "no", "input", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", "\\", "n" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L22-L57
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_system_category
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...
python
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", ")", ":", "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...
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 ...
[ "Takes", "string", "no", "input", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", "\\", "n" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L60-L95
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_system_device_models
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...
python
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", ")", ":", "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...
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 ...
[ "Takes", "string", "no", "input", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", "\\", "n" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L98-L132
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_system_series
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...
python
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", ")", ":", "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...
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 ...
[ "Takes", "string", "no", "input", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", "\\", "n" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L135-L171
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_all_devs
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...
python
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", ")", ":", "if", "network_address", "!=", "None", ":", "get_all_devs_url", "=", "\"/imcrs/plat/res/device?resPrivilegeFilter=false&ip=\"", "+", "str", "(", "network_address", ")", "+...
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...
[ "Takes", "string", "input", "of", "IP", "address", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", "\\", "n" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L177-L224
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_dev_details
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 ...
python
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", ")", ":", "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",...
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...
[ "Takes", "string", "input", "of", "IP", "address", "to", "issue", "RESTUL", "call", "to", "HP", "IMC", "\\", "n" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L227-L280
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_dev_interface
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...
python
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", ")", ":", "get_dev_interface_url", "=", "\"/imcrs/plat/res/device/\"", "+", "str", "(", "devid", ")", "+", "\"/interface?start=0&size=1000&desc=false&total=false\"", "f_url", "=", "url", "+", "get_dev_...
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...
[ "Function", "takes", "devid", "as", "input", "to", "RESTFUL", "call", "to", "HP", "IMC", "platform", "and", "returns", "list", "of", "device", "interfaces" ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L283-L323
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_dev_mac_learn
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...
python
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", ")", ":", "get_dev_mac_learn_url", "=", "'/imcrs/res/access/ipMacLearn/'", "+", "str", "(", "devid", ")", "f_url", "=", "url", "+", "get_dev_mac_learn_url", "try", ":", "r", "=", "requests", "....
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...
[ "function", "takes", "devid", "of", "specific", "device", "and", "issues", "a", "RESTFUL", "call", "to", "gather", "the", "current", "IP", "-", "MAC", "learning", "entries", "on", "the", "target", "device", "." ]
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L416-L456
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
run_dev_cmd
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...
python
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", ")", ":", "run_dev_cmd_url", "=", "'/imcrs/icc/confFile/executeCmd'", "f_url", "=", "url", "+", "run_dev_cmd_url", "cmd_list", "=", "_make_cmd_list", "(", "cmd_list", ")", "payload", "...
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...
[ "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...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L459-L501
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_all_interface_details
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: ...
python
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", ")", ":", "get_all_interface_details_url", "=", "\"/imcrs/plat/res/device/\"", "+", "str", "(", "devId", ")", "+", "\"/interface/?start=0&size=1000&desc=false&total=false\"", "f_url", "=", "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: int or str value of the devId of the target device :par...
[ "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"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L509-L551
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
get_interface_details
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...
python
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", ")", ":", "get_interface_details_url", "=", "\"/imcrs/plat/res/device/\"", "+", "str", "(", "devId", ")", "+", "\"/interface/\"", "+", "str", "(", "ifIndex", ")", "f_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: int or str value of the devId of the target device :par...
[ "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"...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L554-L597
HPENetworking/PYHPEIMC
build/lib/pyhpeimc/plat/device.py
set_interface_down
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...
python
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", ")", ":", "set_int_down_url", "=", "\"/imcrs/plat/res/device/\"", "+", "str", "(", "devid", ")", "+", "\"/interface/\"", "+", "str", "(", "ifindex", ")", "+", "\"/down\"", "f...
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...
[ "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", ":", "...
train
https://github.com/HPENetworking/PYHPEIMC/blob/4fba31827573587e03a6233c7db60f188038c8e5/build/lib/pyhpeimc/plat/device.py#L600-L638
lablup/backend.ai-client-py
src/ai/backend/client/resource_policy.py
ResourcePolicy.create
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:...
python
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",...
Creates a new keypair resource policy with the given options. You need an admin privilege for this operation.
[ "Creates", "a", "new", "keypair", "resource", "policy", "with", "the", "given", "options", ".", "You", "need", "an", "admin", "privilege", "for", "this", "operation", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/resource_policy.py#L23-L66
lablup/backend.ai-client-py
src/ai/backend/client/resource_policy.py
ResourcePolicy.list
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'...
python
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", "]", ":", "if", "fields", "is", "None", ":", "fields", "=", "(", "'name'", ",", "'created_at'", ",", "'total_resourc...
Lists the keypair resource policies. You need an admin privilege for this operation.
[ "Lists", "the", "keypair", "resource", "policies", ".", "You", "need", "an", "admin", "privilege", "for", "this", "operation", "." ]
train
https://github.com/lablup/backend.ai-client-py/blob/a063d774fea6f4350b89498c40d3c837ec3029a7/src/ai/backend/client/resource_policy.py#L138-L162