hexsha
stringlengths
40
40
repo
stringlengths
7
114
path
stringlengths
4
124
license
listlengths
1
9
language
stringclasses
1 value
identifier
stringlengths
1
71
return_type
stringlengths
1
749
original_string
stringlengths
76
22.7k
original_docstring
stringlengths
16
7.61k
docstring
stringlengths
16
2.47k
docstring_tokens
listlengths
6
477
code
stringlengths
14
10.2k
code_tokens
listlengths
6
996
short_docstring
stringlengths
2
644
short_docstring_tokens
listlengths
1
116
comment
listlengths
1
89
parameters
listlengths
0
64
docstring_params
dict
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
read_coils
<not_specific>
def read_coils(self, starting_address, quantity): """ Read Coils from Master device (Function code 1) starting_address: First coil to be read quantity: Numer of coils to be read returns: Boolean Array [0..quantity-1] which contains the coils """ logging.info("Re...
Read Coils from Master device (Function code 1) starting_address: First coil to be read quantity: Numer of coils to be read returns: Boolean Array [0..quantity-1] which contains the coils
Read Coils from Master device (Function code 1) starting_address: First coil to be read quantity: Numer of coils to be read returns: Boolean Array [0..quantity-1] which contains the coils
[ "Read", "Coils", "from", "Master", "device", "(", "Function", "code", "1", ")", "starting_address", ":", "First", "coil", "to", "be", "read", "quantity", ":", "Numer", "of", "coils", "to", "be", "read", "returns", ":", "Boolean", "Array", "[", "0", "..",...
def read_coils(self, starting_address, quantity): logging.info("Request to read coils (FC01), starting address: {0}, quantity: {1}" .format(str(starting_address), str(quantity))) self.__transactionIdentifier += 1 if self.__ser is not None: if self.__ser.closed: ...
[ "def", "read_coils", "(", "self", ",", "starting_address", ",", "quantity", ")", ":", "logging", ".", "info", "(", "\"Request to read coils (FC01), starting address: {0}, quantity: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ",", "str", "(", "qu...
Read Coils from Master device (Function code 1) starting_address: First coil to be read quantity: Numer of coils to be read returns: Boolean Array [0..quantity-1] which contains the coils
[ "Read", "Coils", "from", "Master", "device", "(", "Function", "code", "1", ")", "starting_address", ":", "First", "coil", "to", "be", "read", "quantity", ":", "Numer", "of", "coils", "to", "be", "read", "returns", ":", "Boolean", "Array", "[", "0", "..",...
[ "\"\"\"\n Read Coils from Master device (Function code 1)\n starting_address: First coil to be read\n quantity: Numer of coils to be read\n returns: Boolean Array [0..quantity-1] which contains the coils\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "quantity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
read_holdingregisters
<not_specific>
def read_holdingregisters(self, starting_address, quantity): """ Read Holding Registers from Master device (Function code 3) starting_address: First holding register to be read quantity: Number of holding registers to be read returns: Int Array [0..quantity-1] which contains th...
Read Holding Registers from Master device (Function code 3) starting_address: First holding register to be read quantity: Number of holding registers to be read returns: Int Array [0..quantity-1] which contains the holding registers
Read Holding Registers from Master device (Function code 3) starting_address: First holding register to be read quantity: Number of holding registers to be read returns: Int Array [0..quantity-1] which contains the holding registers
[ "Read", "Holding", "Registers", "from", "Master", "device", "(", "Function", "code", "3", ")", "starting_address", ":", "First", "holding", "register", "to", "be", "read", "quantity", ":", "Number", "of", "holding", "registers", "to", "be", "read", "returns", ...
def read_holdingregisters(self, starting_address, quantity): logging.info("Request to read holding registers (FC03), starting address: {0}, quantity: {1}" .format(str(starting_address), str(quantity))) self.__transactionIdentifier += 1 if self.__ser is not None: ...
[ "def", "read_holdingregisters", "(", "self", ",", "starting_address", ",", "quantity", ")", ":", "logging", ".", "info", "(", "\"Request to read holding registers (FC03), starting address: {0}, quantity: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ","...
Read Holding Registers from Master device (Function code 3) starting_address: First holding register to be read quantity: Number of holding registers to be read returns: Int Array [0..quantity-1] which contains the holding registers
[ "Read", "Holding", "Registers", "from", "Master", "device", "(", "Function", "code", "3", ")", "starting_address", ":", "First", "holding", "register", "to", "be", "read", "quantity", ":", "Number", "of", "holding", "registers", "to", "be", "read", "returns", ...
[ "\"\"\"\n Read Holding Registers from Master device (Function code 3)\n starting_address: First holding register to be read\n quantity: Number of holding registers to be read\n returns: Int Array [0..quantity-1] which contains the holding registers\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "quantity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
read_inputregisters
<not_specific>
def read_inputregisters(self, starting_address, quantity): """ Read Input Registers from Master device (Function code 4) starting_address : First input register to be read quantity: Number of input registers to be read returns: Int Array [0..quantity-1] which contains the inpu...
Read Input Registers from Master device (Function code 4) starting_address : First input register to be read quantity: Number of input registers to be read returns: Int Array [0..quantity-1] which contains the input registers
Read Input Registers from Master device (Function code 4) starting_address : First input register to be read quantity: Number of input registers to be read returns: Int Array [0..quantity-1] which contains the input registers
[ "Read", "Input", "Registers", "from", "Master", "device", "(", "Function", "code", "4", ")", "starting_address", ":", "First", "input", "register", "to", "be", "read", "quantity", ":", "Number", "of", "input", "registers", "to", "be", "read", "returns", ":",...
def read_inputregisters(self, starting_address, quantity): logging.info("Request to read input registers (FC04), starting address: {0}, quantity: {1}" .format(str(starting_address), str(quantity))) self.__transactionIdentifier += 1 if self.__ser is not None: if s...
[ "def", "read_inputregisters", "(", "self", ",", "starting_address", ",", "quantity", ")", ":", "logging", ".", "info", "(", "\"Request to read input registers (FC04), starting address: {0}, quantity: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ",", ...
Read Input Registers from Master device (Function code 4) starting_address : First input register to be read quantity: Number of input registers to be read returns: Int Array [0..quantity-1] which contains the input registers
[ "Read", "Input", "Registers", "from", "Master", "device", "(", "Function", "code", "4", ")", "starting_address", ":", "First", "input", "register", "to", "be", "read", "quantity", ":", "Number", "of", "input", "registers", "to", "be", "read", "returns", ":",...
[ "\"\"\"\n Read Input Registers from Master device (Function code 4)\n starting_address : First input register to be read\n quantity: Number of input registers to be read\n returns: Int Array [0..quantity-1] which contains the input registers\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "quantity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
write_single_coil
<not_specific>
def write_single_coil(self, starting_address, value): """ Write single Coil to Master device (Function code 5) starting_address: Coil to be written value: Coil Value to be written """ logging.info("Request to write single coil (FC05), starting address: {0}, value: {1}" ...
Write single Coil to Master device (Function code 5) starting_address: Coil to be written value: Coil Value to be written
Write single Coil to Master device (Function code 5) starting_address: Coil to be written value: Coil Value to be written
[ "Write", "single", "Coil", "to", "Master", "device", "(", "Function", "code", "5", ")", "starting_address", ":", "Coil", "to", "be", "written", "value", ":", "Coil", "Value", "to", "be", "written" ]
def write_single_coil(self, starting_address, value): logging.info("Request to write single coil (FC05), starting address: {0}, value: {1}" .format(str(starting_address), str(value))) self.__transactionIdentifier += 1 if self.__ser is not None: if self.__ser.clos...
[ "def", "write_single_coil", "(", "self", ",", "starting_address", ",", "value", ")", ":", "logging", ".", "info", "(", "\"Request to write single coil (FC05), starting address: {0}, value: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ",", "str", "(...
Write single Coil to Master device (Function code 5) starting_address: Coil to be written value: Coil Value to be written
[ "Write", "single", "Coil", "to", "Master", "device", "(", "Function", "code", "5", ")", "starting_address", ":", "Coil", "to", "be", "written", "value", ":", "Coil", "Value", "to", "be", "written" ]
[ "\"\"\"\n Write single Coil to Master device (Function code 5)\n starting_address: Coil to be written\n value: Coil Value to be written\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "value", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
write_single_register
<not_specific>
def write_single_register(self, starting_address, value): """ Write single Register to Master device (Function code 6) starting_address: Register to be written value: Register Value to be written """ logging.info("Request to write single register (FC06), starting address...
Write single Register to Master device (Function code 6) starting_address: Register to be written value: Register Value to be written
Write single Register to Master device (Function code 6) starting_address: Register to be written value: Register Value to be written
[ "Write", "single", "Register", "to", "Master", "device", "(", "Function", "code", "6", ")", "starting_address", ":", "Register", "to", "be", "written", "value", ":", "Register", "Value", "to", "be", "written" ]
def write_single_register(self, starting_address, value): logging.info("Request to write single register (FC06), starting address: {0}, value: {1}" .format(str(starting_address), str(value))) self.__transactionIdentifier += 1 if self.__ser is not None: if self.__...
[ "def", "write_single_register", "(", "self", ",", "starting_address", ",", "value", ")", ":", "logging", ".", "info", "(", "\"Request to write single register (FC06), starting address: {0}, value: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ",", "st...
Write single Register to Master device (Function code 6) starting_address: Register to be written value: Register Value to be written
[ "Write", "single", "Register", "to", "Master", "device", "(", "Function", "code", "6", ")", "starting_address", ":", "Register", "to", "be", "written", "value", ":", "Register", "Value", "to", "be", "written" ]
[ "\"\"\"\n Write single Register to Master device (Function code 6)\n starting_address: Register to be written\n value: Register Value to be written\n \"\"\"", "# Check for Exception" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "value", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
write_multiple_coils
<not_specific>
def write_multiple_coils(self, starting_address, values): """ Write multiple coils to Master device (Function code 15) starting_address : First coil to be written values: Coil Values [0..quantity-1] to be written """ logging.info("Request to write multiple coil (FC15), ...
Write multiple coils to Master device (Function code 15) starting_address : First coil to be written values: Coil Values [0..quantity-1] to be written
Write multiple coils to Master device (Function code 15) starting_address : First coil to be written values: Coil Values [0..quantity-1] to be written
[ "Write", "multiple", "coils", "to", "Master", "device", "(", "Function", "code", "15", ")", "starting_address", ":", "First", "coil", "to", "be", "written", "values", ":", "Coil", "Values", "[", "0", "..", "quantity", "-", "1", "]", "to", "be", "written"...
def write_multiple_coils(self, starting_address, values): logging.info("Request to write multiple coil (FC15), starting address: {0}, values: {1}" .format(str(starting_address), str(values))) self.__transactionIdentifier += 1 if self.__ser is not None: if self.__...
[ "def", "write_multiple_coils", "(", "self", ",", "starting_address", ",", "values", ")", ":", "logging", ".", "info", "(", "\"Request to write multiple coil (FC15), starting address: {0}, values: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ",", "str...
Write multiple coils to Master device (Function code 15) starting_address : First coil to be written values: Coil Values [0..quantity-1] to be written
[ "Write", "multiple", "coils", "to", "Master", "device", "(", "Function", "code", "15", ")", "starting_address", ":", "First", "coil", "to", "be", "written", "values", ":", "Coil", "Values", "[", "0", "..", "quantity", "-", "1", "]", "to", "be", "written"...
[ "\"\"\"\n Write multiple coils to Master device (Function code 15)\n starting_address : First coil to be written\n values: Coil Values [0..quantity-1] to be written\n \"\"\"", "# Bytecount", "# Bytecount" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "values", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
write_multiple_registers
<not_specific>
def write_multiple_registers(self, starting_address, values): """ Write multiple registers to Master device (Function code 16) starting_address: First register to be written values: Register Values [0..quantity-1] to be written """ logging.info("Request to write multiple...
Write multiple registers to Master device (Function code 16) starting_address: First register to be written values: Register Values [0..quantity-1] to be written
Write multiple registers to Master device (Function code 16) starting_address: First register to be written values: Register Values [0..quantity-1] to be written
[ "Write", "multiple", "registers", "to", "Master", "device", "(", "Function", "code", "16", ")", "starting_address", ":", "First", "register", "to", "be", "written", "values", ":", "Register", "Values", "[", "0", "..", "quantity", "-", "1", "]", "to", "be",...
def write_multiple_registers(self, starting_address, values): logging.info("Request to write multiple registers (FC16), starting address: {0}, values: {1}" .format(str(starting_address), str(values))) self.__transactionIdentifier += 1 if self.__ser is not None: i...
[ "def", "write_multiple_registers", "(", "self", ",", "starting_address", ",", "values", ")", ":", "logging", ".", "info", "(", "\"Request to write multiple registers (FC16), starting address: {0}, values: {1}\"", ".", "format", "(", "str", "(", "starting_address", ")", ",...
Write multiple registers to Master device (Function code 16) starting_address: First register to be written values: Register Values [0..quantity-1] to be written
[ "Write", "multiple", "registers", "to", "Master", "device", "(", "Function", "code", "16", ")", "starting_address", ":", "First", "register", "to", "be", "written", "values", ":", "Register", "Values", "[", "0", "..", "quantity", "-", "1", "]", "to", "be",...
[ "\"\"\"\n Write multiple registers to Master device (Function code 16)\n starting_address: First register to be written\n values: Register Values [0..quantity-1] to be written\n \"\"\"", "# Bytecount", "# Bytecount" ]
[ { "param": "self", "type": null }, { "param": "starting_address", "type": null }, { "param": "values", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "starting_address", "type": null, "docstring": null, "docstrin...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
port
null
def port(self, port): """ Sets the Port were the Modbus-TCP Server is reachable (Standard is 502) """ self.__port = port
Sets the Port were the Modbus-TCP Server is reachable (Standard is 502)
Sets the Port were the Modbus-TCP Server is reachable (Standard is 502)
[ "Sets", "the", "Port", "were", "the", "Modbus", "-", "TCP", "Server", "is", "reachable", "(", "Standard", "is", "502", ")" ]
def port(self, port): self.__port = port
[ "def", "port", "(", "self", ",", "port", ")", ":", "self", ".", "__port", "=", "port" ]
Sets the Port were the Modbus-TCP Server is reachable (Standard is 502)
[ "Sets", "the", "Port", "were", "the", "Modbus", "-", "TCP", "Server", "is", "reachable", "(", "Standard", "is", "502", ")" ]
[ "\"\"\"\n Sets the Port were the Modbus-TCP Server is reachable (Standard is 502)\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "port", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "port", "type": null, "docstring": null, "docstring_tokens": [...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
ipaddress
null
def ipaddress(self, ipAddress): """ Sets the IP-Address of the Server to be connected """ self.__ipAddress = ipAddress
Sets the IP-Address of the Server to be connected
Sets the IP-Address of the Server to be connected
[ "Sets", "the", "IP", "-", "Address", "of", "the", "Server", "to", "be", "connected" ]
def ipaddress(self, ipAddress): self.__ipAddress = ipAddress
[ "def", "ipaddress", "(", "self", ",", "ipAddress", ")", ":", "self", ".", "__ipAddress", "=", "ipAddress" ]
Sets the IP-Address of the Server to be connected
[ "Sets", "the", "IP", "-", "Address", "of", "the", "Server", "to", "be", "connected" ]
[ "\"\"\"\n Sets the IP-Address of the Server to be connected\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "ipAddress", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "ipAddress", "type": null, "docstring": null, "docstring_token...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
unitidentifier
<not_specific>
def unitidentifier(self): """ Gets the Unit identifier in case of serial connection (Default = 1) """ return self.__unitIdentifier
Gets the Unit identifier in case of serial connection (Default = 1)
Gets the Unit identifier in case of serial connection (Default = 1)
[ "Gets", "the", "Unit", "identifier", "in", "case", "of", "serial", "connection", "(", "Default", "=", "1", ")" ]
def unitidentifier(self): return self.__unitIdentifier
[ "def", "unitidentifier", "(", "self", ")", ":", "return", "self", ".", "__unitIdentifier" ]
Gets the Unit identifier in case of serial connection (Default = 1)
[ "Gets", "the", "Unit", "identifier", "in", "case", "of", "serial", "connection", "(", "Default", "=", "1", ")" ]
[ "\"\"\"\n Gets the Unit identifier in case of serial connection (Default = 1)\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
unitidentifier
null
def unitidentifier(self, unitIdentifier): """ Sets the Unit identifier in case of serial connection (Default = 1) """ self.__unitIdentifier = unitIdentifier
Sets the Unit identifier in case of serial connection (Default = 1)
Sets the Unit identifier in case of serial connection (Default = 1)
[ "Sets", "the", "Unit", "identifier", "in", "case", "of", "serial", "connection", "(", "Default", "=", "1", ")" ]
def unitidentifier(self, unitIdentifier): self.__unitIdentifier = unitIdentifier
[ "def", "unitidentifier", "(", "self", ",", "unitIdentifier", ")", ":", "self", ".", "__unitIdentifier", "=", "unitIdentifier" ]
Sets the Unit identifier in case of serial connection (Default = 1)
[ "Sets", "the", "Unit", "identifier", "in", "case", "of", "serial", "connection", "(", "Default", "=", "1", ")" ]
[ "\"\"\"\n Sets the Unit identifier in case of serial connection (Default = 1)\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "unitIdentifier", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "unitIdentifier", "type": null, "docstring": null, "docstring_...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
baudrate
<not_specific>
def baudrate(self): """ Gets the Baudrate for serial connection (Default = 9600) """ return self.__baudrate
Gets the Baudrate for serial connection (Default = 9600)
Gets the Baudrate for serial connection (Default = 9600)
[ "Gets", "the", "Baudrate", "for", "serial", "connection", "(", "Default", "=", "9600", ")" ]
def baudrate(self): return self.__baudrate
[ "def", "baudrate", "(", "self", ")", ":", "return", "self", ".", "__baudrate" ]
Gets the Baudrate for serial connection (Default = 9600)
[ "Gets", "the", "Baudrate", "for", "serial", "connection", "(", "Default", "=", "9600", ")" ]
[ "\"\"\"\n Gets the Baudrate for serial connection (Default = 9600)\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
baudrate
null
def baudrate(self, baudrate): """ Sets the Baudrate for serial connection (Default = 9600) """ self.__baudrate = baudrate
Sets the Baudrate for serial connection (Default = 9600)
Sets the Baudrate for serial connection (Default = 9600)
[ "Sets", "the", "Baudrate", "for", "serial", "connection", "(", "Default", "=", "9600", ")" ]
def baudrate(self, baudrate): self.__baudrate = baudrate
[ "def", "baudrate", "(", "self", ",", "baudrate", ")", ":", "self", ".", "__baudrate", "=", "baudrate" ]
Sets the Baudrate for serial connection (Default = 9600)
[ "Sets", "the", "Baudrate", "for", "serial", "connection", "(", "Default", "=", "9600", ")" ]
[ "\"\"\"\n Sets the Baudrate for serial connection (Default = 9600)\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "baudrate", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "baudrate", "type": null, "docstring": null, "docstring_tokens...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
parity
<not_specific>
def parity(self): """ Gets the of Parity in case of serial connection """ return self.__parity
Gets the of Parity in case of serial connection
Gets the of Parity in case of serial connection
[ "Gets", "the", "of", "Parity", "in", "case", "of", "serial", "connection" ]
def parity(self): return self.__parity
[ "def", "parity", "(", "self", ")", ":", "return", "self", ".", "__parity" ]
Gets the of Parity in case of serial connection
[ "Gets", "the", "of", "Parity", "in", "case", "of", "serial", "connection" ]
[ "\"\"\"\n Gets the of Parity in case of serial connection\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
parity
null
def parity(self, parity): """ Sets the of Parity in case of serial connection Example modbusClient.Parity = Parity.even """ self.__parity = parity
Sets the of Parity in case of serial connection Example modbusClient.Parity = Parity.even
Sets the of Parity in case of serial connection Example modbusClient.Parity = Parity.even
[ "Sets", "the", "of", "Parity", "in", "case", "of", "serial", "connection", "Example", "modbusClient", ".", "Parity", "=", "Parity", ".", "even" ]
def parity(self, parity): self.__parity = parity
[ "def", "parity", "(", "self", ",", "parity", ")", ":", "self", ".", "__parity", "=", "parity" ]
Sets the of Parity in case of serial connection Example modbusClient.Parity = Parity.even
[ "Sets", "the", "of", "Parity", "in", "case", "of", "serial", "connection", "Example", "modbusClient", ".", "Parity", "=", "Parity", ".", "even" ]
[ "\"\"\"\n Sets the of Parity in case of serial connection\n Example modbusClient.Parity = Parity.even\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "parity", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "parity", "type": null, "docstring": null, "docstring_tokens":...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
stopbits
<not_specific>
def stopbits(self): """ Gets the number of stopbits in case of serial connection """ return self.__stopbits
Gets the number of stopbits in case of serial connection
Gets the number of stopbits in case of serial connection
[ "Gets", "the", "number", "of", "stopbits", "in", "case", "of", "serial", "connection" ]
def stopbits(self): return self.__stopbits
[ "def", "stopbits", "(", "self", ")", ":", "return", "self", ".", "__stopbits" ]
Gets the number of stopbits in case of serial connection
[ "Gets", "the", "number", "of", "stopbits", "in", "case", "of", "serial", "connection" ]
[ "\"\"\"\n Gets the number of stopbits in case of serial connection\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
stopbits
null
def stopbits(self, stopbits): """ Sets the number of stopbits in case of serial connection Example: modbusClient.Stopbits = Stopbits.one """ self.__stopbits = stopbits
Sets the number of stopbits in case of serial connection Example: modbusClient.Stopbits = Stopbits.one
Sets the number of stopbits in case of serial connection Example: modbusClient.Stopbits = Stopbits.one
[ "Sets", "the", "number", "of", "stopbits", "in", "case", "of", "serial", "connection", "Example", ":", "modbusClient", ".", "Stopbits", "=", "Stopbits", ".", "one" ]
def stopbits(self, stopbits): self.__stopbits = stopbits
[ "def", "stopbits", "(", "self", ",", "stopbits", ")", ":", "self", ".", "__stopbits", "=", "stopbits" ]
Sets the number of stopbits in case of serial connection Example: modbusClient.Stopbits = Stopbits.one
[ "Sets", "the", "number", "of", "stopbits", "in", "case", "of", "serial", "connection", "Example", ":", "modbusClient", ".", "Stopbits", "=", "Stopbits", ".", "one" ]
[ "\"\"\"\n Sets the number of stopbits in case of serial connection\n Example: modbusClient.Stopbits = Stopbits.one\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "stopbits", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "stopbits", "type": null, "docstring": null, "docstring_tokens...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
logging_level
<not_specific>
def logging_level(self): """ Sets the logging level - Default is logging.INFO """ return self.__logging_level
Sets the logging level - Default is logging.INFO
Sets the logging level - Default is logging.INFO
[ "Sets", "the", "logging", "level", "-", "Default", "is", "logging", ".", "INFO" ]
def logging_level(self): return self.__logging_level
[ "def", "logging_level", "(", "self", ")", ":", "return", "self", ".", "__logging_level" ]
Sets the logging level - Default is logging.INFO
[ "Sets", "the", "logging", "level", "-", "Default", "is", "logging", ".", "INFO" ]
[ "\"\"\"\n Sets the logging level - Default is logging.INFO\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
logging_level
null
def logging_level(self, logging_level): """ Sets the logging level - Default is logging.INFO """ self.__logging_level = logging_level logging.getLogger().setLevel(self.__logging_level)
Sets the logging level - Default is logging.INFO
Sets the logging level - Default is logging.INFO
[ "Sets", "the", "logging", "level", "-", "Default", "is", "logging", ".", "INFO" ]
def logging_level(self, logging_level): self.__logging_level = logging_level logging.getLogger().setLevel(self.__logging_level)
[ "def", "logging_level", "(", "self", ",", "logging_level", ")", ":", "self", ".", "__logging_level", "=", "logging_level", "logging", ".", "getLogger", "(", ")", ".", "setLevel", "(", "self", ".", "__logging_level", ")" ]
Sets the logging level - Default is logging.INFO
[ "Sets", "the", "logging", "level", "-", "Default", "is", "logging", ".", "INFO" ]
[ "\"\"\"\n Sets the logging level - Default is logging.INFO\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "logging_level", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "logging_level", "type": null, "docstring": null, "docstring_t...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
convert_double_to_two_registers
<not_specific>
def convert_double_to_two_registers(doubleValue, register_order=RegisterOrder.lowHigh): """ Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue: Value to be converted register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHi...
Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue: Value to be converted register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh return: 16 Bit Register values int[]
Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue: Value to be converted register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh return: 16 Bit Register values int[]
[ "Convert", "32", "Bit", "Value", "to", "two", "16", "Bit", "Value", "to", "send", "as", "Modbus", "Registers", "doubleValue", ":", "Value", "to", "be", "converted", "register_order", ":", "Desired", "Word", "Order", "(", "Low", "Register", "first", "or", "...
def convert_double_to_two_registers(doubleValue, register_order=RegisterOrder.lowHigh): myList = list() myList.append(int(doubleValue & 0x0000FFFF)) myList.append(int((doubleValue & 0xFFFF0000) >> 16)) if register_order == RegisterOrder.highLow: myList[0] = int((doubleValue & 0xFFFF0000) >> ...
[ "def", "convert_double_to_two_registers", "(", "doubleValue", ",", "register_order", "=", "RegisterOrder", ".", "lowHigh", ")", ":", "myList", "=", "list", "(", ")", "myList", ".", "append", "(", "int", "(", "doubleValue", "&", "0x0000FFFF", ")", ")", "myList"...
Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers doubleValue: Value to be converted register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh return: 16 Bit Register values int[]
[ "Convert", "32", "Bit", "Value", "to", "two", "16", "Bit", "Value", "to", "send", "as", "Modbus", "Registers", "doubleValue", ":", "Value", "to", "be", "converted", "register_order", ":", "Desired", "Word", "Order", "(", "Low", "Register", "first", "or", "...
[ "\"\"\"\n Convert 32 Bit Value to two 16 Bit Value to send as Modbus Registers\n doubleValue: Value to be converted\n register_order: Desired Word Order (Low Register first or High Register first - Default: RegisterOrder.lowHigh\n return: 16 Bit Register values int[]\n \"\"\"", "# Append Least Sign...
[ { "param": "doubleValue", "type": null }, { "param": "register_order", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "doubleValue", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "register_order", "type": null, "docstring": null, "doc...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
convert_float_to_two_registers
<not_specific>
def convert_float_to_two_registers(floatValue, register_order=RegisterOrder.lowHigh): """ Convert 32 Bit real Value to two 16 Bit Value to send as Modbus Registers floatValue: Value to be converted return: 16 Bit Register values int[] """ myList = list() s = bytearray(struct.pack('<f', float...
Convert 32 Bit real Value to two 16 Bit Value to send as Modbus Registers floatValue: Value to be converted return: 16 Bit Register values int[]
Convert 32 Bit real Value to two 16 Bit Value to send as Modbus Registers floatValue: Value to be converted return: 16 Bit Register values int[]
[ "Convert", "32", "Bit", "real", "Value", "to", "two", "16", "Bit", "Value", "to", "send", "as", "Modbus", "Registers", "floatValue", ":", "Value", "to", "be", "converted", "return", ":", "16", "Bit", "Register", "values", "int", "[]" ]
def convert_float_to_two_registers(floatValue, register_order=RegisterOrder.lowHigh): myList = list() s = bytearray(struct.pack('<f', floatValue)) myList.append(s[0] | (s[1] << 8)) myList.append(s[2] | (s[3] << 8)) if register_order == RegisterOrder.highLow: myList[0] = s[2] | (s[3] <<...
[ "def", "convert_float_to_two_registers", "(", "floatValue", ",", "register_order", "=", "RegisterOrder", ".", "lowHigh", ")", ":", "myList", "=", "list", "(", ")", "s", "=", "bytearray", "(", "struct", ".", "pack", "(", "'<f'", ",", "floatValue", ")", ")", ...
Convert 32 Bit real Value to two 16 Bit Value to send as Modbus Registers floatValue: Value to be converted return: 16 Bit Register values int[]
[ "Convert", "32", "Bit", "real", "Value", "to", "two", "16", "Bit", "Value", "to", "send", "as", "Modbus", "Registers", "floatValue", ":", "Value", "to", "be", "converted", "return", ":", "16", "Bit", "Register", "values", "int", "[]" ]
[ "\"\"\"\n Convert 32 Bit real Value to two 16 Bit Value to send as Modbus Registers\n floatValue: Value to be converted\n return: 16 Bit Register values int[]\n \"\"\"", "# little endian", "# Append Least Significant Word", "# Append Most Significant Word" ]
[ { "param": "floatValue", "type": null }, { "param": "register_order", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "floatValue", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "register_order", "type": null, "docstring": null, "docs...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
convert_registers_to_double
<not_specific>
def convert_registers_to_double(registers, register_order=RegisterOrder.lowHigh): """ Convert two 16 Bit Registers to 32 Bit long value - Used to receive 32 Bit values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value """ returnValue = (int(registers...
Convert two 16 Bit Registers to 32 Bit long value - Used to receive 32 Bit values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value
Convert two 16 Bit Registers to 32 Bit long value - Used to receive 32 Bit values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value
[ "Convert", "two", "16", "Bit", "Registers", "to", "32", "Bit", "long", "value", "-", "Used", "to", "receive", "32", "Bit", "values", "from", "Modbus", "(", "Modbus", "Registers", "are", "16", "Bit", "long", ")", "registers", ":", "16", "Bit", "Registers"...
def convert_registers_to_double(registers, register_order=RegisterOrder.lowHigh): returnValue = (int(registers[0]) & 0x0000FFFF) | (int((registers[1]) << 16) & 0xFFFF0000) if register_order == RegisterOrder.highLow: returnValue = (int(registers[1]) & 0x0000FFFF) | (int((registers[0]) << 16) & 0xFFFF0000...
[ "def", "convert_registers_to_double", "(", "registers", ",", "register_order", "=", "RegisterOrder", ".", "lowHigh", ")", ":", "returnValue", "=", "(", "int", "(", "registers", "[", "0", "]", ")", "&", "0x0000FFFF", ")", "|", "(", "int", "(", "(", "registe...
Convert two 16 Bit Registers to 32 Bit long value - Used to receive 32 Bit values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value
[ "Convert", "two", "16", "Bit", "Registers", "to", "32", "Bit", "long", "value", "-", "Used", "to", "receive", "32", "Bit", "values", "from", "Modbus", "(", "Modbus", "Registers", "are", "16", "Bit", "long", ")", "registers", ":", "16", "Bit", "Registers"...
[ "\"\"\"\n Convert two 16 Bit Registers to 32 Bit long value - Used to receive 32 Bit values from Modbus (Modbus Registers are 16 Bit long)\n registers: 16 Bit Registers\n return: 32 bit value\n \"\"\"" ]
[ { "param": "registers", "type": null }, { "param": "register_order", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "registers", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "register_order", "type": null, "docstring": null, "docst...
9a6e5702de9e8b6ac854dc423821f29c05f3d303
rossmann-engineering/EasyModbusTCP.PY
easymodbus/modbusClient.py
[ "MIT" ]
Python
convert_registers_to_float
<not_specific>
def convert_registers_to_float(registers, register_order=RegisterOrder.lowHigh): """ Convert two 16 Bit Registers to 32 Bit real value - Used to receive float values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value real """ b = bytearray(4) b[0]...
Convert two 16 Bit Registers to 32 Bit real value - Used to receive float values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value real
Convert two 16 Bit Registers to 32 Bit real value - Used to receive float values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value real
[ "Convert", "two", "16", "Bit", "Registers", "to", "32", "Bit", "real", "value", "-", "Used", "to", "receive", "float", "values", "from", "Modbus", "(", "Modbus", "Registers", "are", "16", "Bit", "long", ")", "registers", ":", "16", "Bit", "Registers", "r...
def convert_registers_to_float(registers, register_order=RegisterOrder.lowHigh): b = bytearray(4) b[0] = registers[0] & 0xff b[1] = (registers[0] & 0xff00) >> 8 b[2] = (registers[1] & 0xff) b[3] = (registers[1] & 0xff00) >> 8 if register_order == RegisterOrder.highLow: b[2] = registers[0...
[ "def", "convert_registers_to_float", "(", "registers", ",", "register_order", "=", "RegisterOrder", ".", "lowHigh", ")", ":", "b", "=", "bytearray", "(", "4", ")", "b", "[", "0", "]", "=", "registers", "[", "0", "]", "&", "0xff", "b", "[", "1", "]", ...
Convert two 16 Bit Registers to 32 Bit real value - Used to receive float values from Modbus (Modbus Registers are 16 Bit long) registers: 16 Bit Registers return: 32 bit value real
[ "Convert", "two", "16", "Bit", "Registers", "to", "32", "Bit", "real", "value", "-", "Used", "to", "receive", "float", "values", "from", "Modbus", "(", "Modbus", "Registers", "are", "16", "Bit", "long", ")", "registers", ":", "16", "Bit", "Registers", "r...
[ "\"\"\"\n Convert two 16 Bit Registers to 32 Bit real value - Used to receive float values from Modbus (Modbus Registers are 16 Bit long)\n registers: 16 Bit Registers\n return: 32 bit value real\n \"\"\"", "# little Endian" ]
[ { "param": "registers", "type": null }, { "param": "register_order", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "registers", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "register_order", "type": null, "docstring": null, "docst...
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
load_state
<not_specific>
def load_state(self, state): """Restore state about spawned single-user server after a hub restart. Local processes only need the process id. """ super(SSHSpawner, self).load_state(state) if state == {}: return self.pid = state.get("pid", 0) self.ssh...
Restore state about spawned single-user server after a hub restart. Local processes only need the process id.
Restore state about spawned single-user server after a hub restart. Local processes only need the process id.
[ "Restore", "state", "about", "spawned", "single", "-", "user", "server", "after", "a", "hub", "restart", ".", "Local", "processes", "only", "need", "the", "process", "id", "." ]
def load_state(self, state): super(SSHSpawner, self).load_state(state) if state == {}: return self.pid = state.get("pid", 0) self.ssh_target = state.get("ssh_target", "") self.port = state.get("port", "") cmd = self.cmd[self.ssh_target] proc_found = Fa...
[ "def", "load_state", "(", "self", ",", "state", ")", ":", "super", "(", "SSHSpawner", ",", "self", ")", ".", "load_state", "(", "state", ")", "if", "state", "==", "{", "}", ":", "return", "self", ".", "pid", "=", "state", ".", "get", "(", "\"pid\""...
Restore state about spawned single-user server after a hub restart.
[ "Restore", "state", "about", "spawned", "single", "-", "user", "server", "after", "a", "hub", "restart", "." ]
[ "\"\"\"Restore state about spawned single-user server after a hub restart.\n\n Local processes only need the process id.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "state", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "state", "type": null, "docstring": null, "docstring_tokens": ...
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
clear_state
null
def clear_state(self): """clear any state (called after shutdown)""" super().clear_state() self.pid = 0 self.ssh_target = "" self.port = 0
clear any state (called after shutdown)
clear any state (called after shutdown)
[ "clear", "any", "state", "(", "called", "after", "shutdown", ")" ]
def clear_state(self): super().clear_state() self.pid = 0 self.ssh_target = "" self.port = 0
[ "def", "clear_state", "(", "self", ")", ":", "super", "(", ")", ".", "clear_state", "(", ")", "self", ".", "pid", "=", "0", "self", ".", "ssh_target", "=", "\"\"", "self", ".", "port", "=", "0" ]
clear any state (called after shutdown)
[ "clear", "any", "state", "(", "called", "after", "shutdown", ")" ]
[ "\"\"\"clear any state (called after shutdown)\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
_options_form
<not_specific>
def _options_form(self): """Populate a list of ssh targets on the pre_spawn form""" hosts = self.get_user_ssh_hosts() if not hosts: return """ <label for="host">Input host for notebook launch:</label> <input type="text" name="host" class="form-control"> ...
Populate a list of ssh targets on the pre_spawn form
Populate a list of ssh targets on the pre_spawn form
[ "Populate", "a", "list", "of", "ssh", "targets", "on", "the", "pre_spawn", "form" ]
def _options_form(self): hosts = self.get_user_ssh_hosts() if not hosts: return """ <label for="host">Input host for notebook launch:</label> <input type="text" name="host" class="form-control"> """ if self.ssh_host_prefix: options = ""...
[ "def", "_options_form", "(", "self", ")", ":", "hosts", "=", "self", ".", "get_user_ssh_hosts", "(", ")", "if", "not", "hosts", ":", "return", "\"\"\"\n <label for=\"host\">Input host for notebook launch:</label>\n <input type=\"text\" name=\"host\" class=\"...
Populate a list of ssh targets on the pre_spawn form
[ "Populate", "a", "list", "of", "ssh", "targets", "on", "the", "pre_spawn", "form" ]
[ "\"\"\"Populate a list of ssh targets on the pre_spawn form\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
options_from_form
<not_specific>
def options_from_form(self, formdata): """Turn html formdata from `options_form` into a dict for later use""" options = {} options["host"] = pipes.quote(formdata.get("host", [""])[0].strip()) return options
Turn html formdata from `options_form` into a dict for later use
Turn html formdata from `options_form` into a dict for later use
[ "Turn", "html", "formdata", "from", "`", "options_form", "`", "into", "a", "dict", "for", "later", "use" ]
def options_from_form(self, formdata): options = {} options["host"] = pipes.quote(formdata.get("host", [""])[0].strip()) return options
[ "def", "options_from_form", "(", "self", ",", "formdata", ")", ":", "options", "=", "{", "}", "options", "[", "\"host\"", "]", "=", "pipes", ".", "quote", "(", "formdata", ".", "get", "(", "\"host\"", ",", "[", "\"\"", "]", ")", "[", "0", "]", ".",...
Turn html formdata from `options_form` into a dict for later use
[ "Turn", "html", "formdata", "from", "`", "options_form", "`", "into", "a", "dict", "for", "later", "use" ]
[ "\"\"\"Turn html formdata from `options_form` into a dict for later use\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "formdata", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "formdata", "type": null, "docstring": null, "docstring_tokens...
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
ssh_opts
<not_specific>
def ssh_opts(self, persist=180, known_hosts="", batch_mode=True, other_opts=None): """Default set of options to attach to ssh commands The minimum arguments are a good, known_hosts file and enabling batch mode. The known_hosts file avoids user's known_hosts files which may not trust oth...
Default set of options to attach to ssh commands The minimum arguments are a good, known_hosts file and enabling batch mode. The known_hosts file avoids user's known_hosts files which may not trust other hosts. Batch mode will cause ssh to fail on prompting for a password. This...
Default set of options to attach to ssh commands The minimum arguments are a good, known_hosts file and enabling batch mode. The known_hosts file avoids user's known_hosts files which may not trust other hosts. Batch mode will cause ssh to fail on prompting for a password. This implementation also uses ssh ControlMast...
[ "Default", "set", "of", "options", "to", "attach", "to", "ssh", "commands", "The", "minimum", "arguments", "are", "a", "good", "known_hosts", "file", "and", "enabling", "batch", "mode", ".", "The", "known_hosts", "file", "avoids", "user", "'", "s", "known_ho...
def ssh_opts(self, persist=180, known_hosts="", batch_mode=True, other_opts=None): opts = { "ControlMaster": "auto", "ControlPath": "/tmp/sshspawner-%u@%n", "ControlPersist": persist, "BatchMode": batch_mode, } if known_hosts: opts["Use...
[ "def", "ssh_opts", "(", "self", ",", "persist", "=", "180", ",", "known_hosts", "=", "\"\"", ",", "batch_mode", "=", "True", ",", "other_opts", "=", "None", ")", ":", "opts", "=", "{", "\"ControlMaster\"", ":", "\"auto\"", ",", "\"ControlPath\"", ":", "\...
Default set of options to attach to ssh commands The minimum arguments are a good, known_hosts file and enabling batch mode.
[ "Default", "set", "of", "options", "to", "attach", "to", "ssh", "commands", "The", "minimum", "arguments", "are", "a", "good", "known_hosts", "file", "and", "enabling", "batch", "mode", "." ]
[ "\"\"\"Default set of options to attach to ssh commands\n\n The minimum arguments are a good, known_hosts file and enabling\n batch mode. The known_hosts file avoids user's known_hosts files\n which may not trust other hosts. Batch mode will cause ssh to fail\n on prompting for a passwor...
[ { "param": "self", "type": null }, { "param": "persist", "type": null }, { "param": "known_hosts", "type": null }, { "param": "batch_mode", "type": null }, { "param": "other_opts", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "persist", "type": null, "docstring": null, "docstring_tokens"...
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
spawn_as_user
<not_specific>
def spawn_as_user(self, cmd, timeout=15): """Run pexpect as the user spawning the notebook This method attaches kerberos credentials to the command env if they exist. """ user = pwd.getpwnam(self.user.name) uid = user.pw_uid env = os.environ krb_files = ...
Run pexpect as the user spawning the notebook This method attaches kerberos credentials to the command env if they exist.
Run pexpect as the user spawning the notebook This method attaches kerberos credentials to the command env if they exist.
[ "Run", "pexpect", "as", "the", "user", "spawning", "the", "notebook", "This", "method", "attaches", "kerberos", "credentials", "to", "the", "command", "env", "if", "they", "exist", "." ]
def spawn_as_user(self, cmd, timeout=15): user = pwd.getpwnam(self.user.name) uid = user.pw_uid env = os.environ krb_files = glob(f"/tmp/krb5cc_{uid}*") if krb_files: env["KRB5CCNAME"] = max(krb_files, key=os.path.getctime) popen_kwargs = dict( env...
[ "def", "spawn_as_user", "(", "self", ",", "cmd", ",", "timeout", "=", "15", ")", ":", "user", "=", "pwd", ".", "getpwnam", "(", "self", ".", "user", ".", "name", ")", "uid", "=", "user", ".", "pw_uid", "env", "=", "os", ".", "environ", "krb_files",...
Run pexpect as the user spawning the notebook This method attaches kerberos credentials to the command env if they exist.
[ "Run", "pexpect", "as", "the", "user", "spawning", "the", "notebook", "This", "method", "attaches", "kerberos", "credentials", "to", "the", "command", "env", "if", "they", "exist", "." ]
[ "\"\"\"Run pexpect as the user spawning the notebook\n\n This method attaches kerberos credentials to the command env if they\n exist.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "cmd", "type": null }, { "param": "timeout", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "cmd", "type": null, "docstring": null, "docstring_tokens": []...
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
env_str_to_dict
<not_specific>
def env_str_to_dict(output): "Convert the output of `env` into a dict" d = {} lines = output.split("\n") for line in lines: divided = line.split("=") if len(divided) == 2: var, val = divided d[var] =...
Convert the output of `env` into a dict
Convert the output of `env` into a dict
[ "Convert", "the", "output", "of", "`", "env", "`", "into", "a", "dict" ]
def env_str_to_dict(output): d = {} lines = output.split("\n") for line in lines: divided = line.split("=") if len(divided) == 2: var, val = divided d[var] = val elif len(divided) == 1: ...
[ "def", "env_str_to_dict", "(", "output", ")", ":", "d", "=", "{", "}", "lines", "=", "output", ".", "split", "(", "\"\\n\"", ")", "for", "line", "in", "lines", ":", "divided", "=", "line", ".", "split", "(", "\"=\"", ")", "if", "len", "(", "divided...
Convert the output of `env` into a dict
[ "Convert", "the", "output", "of", "`", "env", "`", "into", "a", "dict" ]
[ "\"Convert the output of `env` into a dict\"" ]
[ { "param": "output", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "output", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
stop
<not_specific>
async def stop(self, now=False): """Stop the remote single-user server process for the current user. For the SSHSpawner, this means first attempting to stop the remote notebook and then killing the tunnel process (which should die once the notebook does). The `jupyterhub-single...
Stop the remote single-user server process for the current user. For the SSHSpawner, this means first attempting to stop the remote notebook and then killing the tunnel process (which should die once the notebook does). The `jupyterhub-singleuser` command has been modified to periodica...
Stop the remote single-user server process for the current user. For the SSHSpawner, this means first attempting to stop the remote notebook and then killing the tunnel process (which should die once the notebook does). The `jupyterhub-singleuser` command has been modified to periodically poll the hub for contact and ...
[ "Stop", "the", "remote", "single", "-", "user", "server", "process", "for", "the", "current", "user", ".", "For", "the", "SSHSpawner", "this", "means", "first", "attempting", "to", "stop", "the", "remote", "notebook", "and", "then", "killing", "the", "tunnel...
async def stop(self, now=False): status = await self.poll() if status is not None and status != 255: return self.log.info( f"Stopping user {self.user.name}'s notebook at port {self.port} on host {self.ssh_target}" ) self.log.debug(f"{self.resource_path}") ...
[ "async", "def", "stop", "(", "self", ",", "now", "=", "False", ")", ":", "status", "=", "await", "self", ".", "poll", "(", ")", "if", "status", "is", "not", "None", "and", "status", "!=", "255", ":", "return", "self", ".", "log", ".", "info", "("...
Stop the remote single-user server process for the current user.
[ "Stop", "the", "remote", "single", "-", "user", "server", "process", "for", "the", "current", "user", "." ]
[ "\"\"\"Stop the remote single-user server process for the current user.\n\n For the SSHSpawner, this means first attempting to stop the remote\n notebook and then killing the tunnel process (which should die once\n the notebook does).\n\n The `jupyterhub-singleuser` command has been modi...
[ { "param": "self", "type": null }, { "param": "now", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "now", "type": null, "docstring": null, "docstring_tokens": []...
7f09fc09f14f801f2c11bd13931a59b010495f03
VIB-CBD/SSHSpawner
sshspawner/sshspawner.py
[ "BSD-3-Clause" ]
Python
poll
<not_specific>
async def poll(self): """Poll the spawned process to see if it is still running and reachable If the process is still running, and we can connect to the remote singleuser server over the tunnel, we return None. If it is not running, or unreachable we return the exit code of the process ...
Poll the spawned process to see if it is still running and reachable If the process is still running, and we can connect to the remote singleuser server over the tunnel, we return None. If it is not running, or unreachable we return the exit code of the process if we have access to it, ...
Poll the spawned process to see if it is still running and reachable If the process is still running, and we can connect to the remote singleuser server over the tunnel, we return None. If it is not running, or unreachable we return the exit code of the process if we have access to it, or 0 otherwise.
[ "Poll", "the", "spawned", "process", "to", "see", "if", "it", "is", "still", "running", "and", "reachable", "If", "the", "process", "is", "still", "running", "and", "we", "can", "connect", "to", "the", "remote", "singleuser", "server", "over", "the", "tunn...
async def poll(self): status = await super().poll() if status is not None: if status == 255 and not self._stopping: self._stopping = True await self.stop() return status elif not os.path.exists(self.ssh_socket) and not self._started: ...
[ "async", "def", "poll", "(", "self", ")", ":", "status", "=", "await", "super", "(", ")", ".", "poll", "(", ")", "if", "status", "is", "not", "None", ":", "if", "status", "==", "255", "and", "not", "self", ".", "_stopping", ":", "self", ".", "_st...
Poll the spawned process to see if it is still running and reachable If the process is still running, and we can connect to the remote singleuser server over the tunnel, we return None.
[ "Poll", "the", "spawned", "process", "to", "see", "if", "it", "is", "still", "running", "and", "reachable", "If", "the", "process", "is", "still", "running", "and", "we", "can", "connect", "to", "the", "remote", "singleuser", "server", "over", "the", "tunn...
[ "\"\"\"Poll the spawned process to see if it is still running and reachable\n\n If the process is still running, and we can connect to the remote\n singleuser server over the tunnel, we return None. If it is not\n running, or unreachable we return the exit code of the process if we\n hav...
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
54f034fdd39fa30ba87b62e369dd469043937a1f
OLC-LOC-Bioinformatics/IRIDA_Retrieve
Sequence_File.py
[ "MIT" ]
Python
add_nas_seqid_path
null
def add_nas_seqid_path(self, seqid_path): """ This will add the path of the current SEQ-ID in the nas to the seqid_path list. This method ensures that no more than 2 sequence paths are ever added to the list and moved to the drive. If more than 2 files are found, throw an error since thi...
This will add the path of the current SEQ-ID in the nas to the seqid_path list. This method ensures that no more than 2 sequence paths are ever added to the list and moved to the drive. If more than 2 files are found, throw an error since this should never happen and there is a major problem. ...
This will add the path of the current SEQ-ID in the nas to the seqid_path list. This method ensures that no more than 2 sequence paths are ever added to the list and moved to the drive. If more than 2 files are found, throw an error since this should never happen and there is a major problem.
[ "This", "will", "add", "the", "path", "of", "the", "current", "SEQ", "-", "ID", "in", "the", "nas", "to", "the", "seqid_path", "list", ".", "This", "method", "ensures", "that", "no", "more", "than", "2", "sequence", "paths", "are", "ever", "added", "to...
def add_nas_seqid_path(self, seqid_path): if len(self.seqid_paths) is 1: self.both_exist = True self.seqid_paths.append(seqid_path) elif len(self.seqid_paths) is 0: self.seqid_paths.append(seqid_path) else: raise ImportWarning("More than 2 files...
[ "def", "add_nas_seqid_path", "(", "self", ",", "seqid_path", ")", ":", "if", "len", "(", "self", ".", "seqid_paths", ")", "is", "1", ":", "self", ".", "both_exist", "=", "True", "self", ".", "seqid_paths", ".", "append", "(", "seqid_path", ")", "elif", ...
This will add the path of the current SEQ-ID in the nas to the seqid_path list.
[ "This", "will", "add", "the", "path", "of", "the", "current", "SEQ", "-", "ID", "in", "the", "nas", "to", "the", "seqid_path", "list", "." ]
[ "\"\"\"\n This will add the path of the current SEQ-ID in the nas to the seqid_path list.\n This method ensures that no more than 2 sequence paths are ever added to the list and moved to the drive.\n If more than 2 files are found, throw an error since this should never happen and there is a ma...
[ { "param": "self", "type": null }, { "param": "seqid_path", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "seqid_path", "type": null, "docstring": "Path in the nas where the ...
54f034fdd39fa30ba87b62e369dd469043937a1f
OLC-LOC-Bioinformatics/IRIDA_Retrieve
Sequence_File.py
[ "MIT" ]
Python
add_sample_sheet
null
def add_sample_sheet(self, nas_sheet_dir): """ Add the path of the SampleSheet in the nas for the SEQ-ID pair :param nas_sheet_dir: the directory of the SampleSheet in the nas """ # Create the paths for both a .csv and .bak SampleSheet csv_sheet_path = os.path.join(nas_sh...
Add the path of the SampleSheet in the nas for the SEQ-ID pair :param nas_sheet_dir: the directory of the SampleSheet in the nas
Add the path of the SampleSheet in the nas for the SEQ-ID pair
[ "Add", "the", "path", "of", "the", "SampleSheet", "in", "the", "nas", "for", "the", "SEQ", "-", "ID", "pair" ]
def add_sample_sheet(self, nas_sheet_dir): csv_sheet_path = os.path.join(nas_sheet_dir, SequencePair.csv_sheet) bak_sheet_path = os.path.join(nas_sheet_dir, SequencePair.bak_sheet) if os.path.exists(csv_sheet_path): self.nas_sample_sheet_path = csv_sheet_path elif os.path.exi...
[ "def", "add_sample_sheet", "(", "self", ",", "nas_sheet_dir", ")", ":", "csv_sheet_path", "=", "os", ".", "path", ".", "join", "(", "nas_sheet_dir", ",", "SequencePair", ".", "csv_sheet", ")", "bak_sheet_path", "=", "os", ".", "path", ".", "join", "(", "na...
Add the path of the SampleSheet in the nas for the SEQ-ID pair
[ "Add", "the", "path", "of", "the", "SampleSheet", "in", "the", "nas", "for", "the", "SEQ", "-", "ID", "pair" ]
[ "\"\"\"\n Add the path of the SampleSheet in the nas for the SEQ-ID pair\n :param nas_sheet_dir: the directory of the SampleSheet in the nas\n \"\"\"", "# Create the paths for both a .csv and .bak SampleSheet", "# Check if the SampleSheet is a .csv file as is the default", "# Check if the...
[ { "param": "self", "type": null }, { "param": "nas_sheet_dir", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "nas_sheet_dir", "type": null, "docstring": "the directory of the Sa...
9d88121222eb14edccc0c87f98f22b68650823d3
OLC-LOC-Bioinformatics/IRIDA_Retrieve
Extract_Files.py
[ "MIT" ]
Python
mount_seqid_files
<not_specific>
def mount_seqid_files(self, sequence_pair): """ Put the sequence pair referenced in the sequence_files onto the drive - with specific path "drivepath/Data/Intensities/BaseCalls" :param sequence_pair: All information for a pair of SEQ-IDs """ # Figure out if which file is...
Put the sequence pair referenced in the sequence_files onto the drive - with specific path "drivepath/Data/Intensities/BaseCalls" :param sequence_pair: All information for a pair of SEQ-IDs
Put the sequence pair referenced in the sequence_files onto the drive - with specific path "drivepath/Data/Intensities/BaseCalls"
[ "Put", "the", "sequence", "pair", "referenced", "in", "the", "sequence_files", "onto", "the", "drive", "-", "with", "specific", "path", "\"", "drivepath", "/", "Data", "/", "Intensities", "/", "BaseCalls", "\"" ]
def mount_seqid_files(self, sequence_pair): if len(sequence_pair.seqid_paths) != 2: self.missing.append(sequence_pair.seqid_info.sample_name) return if '_R1' in sequence_pair.seqid_paths[0]: forward_reads = sequence_pair.seqid_paths[0] reverse_reads = sequ...
[ "def", "mount_seqid_files", "(", "self", ",", "sequence_pair", ")", ":", "if", "len", "(", "sequence_pair", ".", "seqid_paths", ")", "!=", "2", ":", "self", ".", "missing", ".", "append", "(", "sequence_pair", ".", "seqid_info", ".", "sample_name", ")", "r...
Put the sequence pair referenced in the sequence_files onto the drive - with specific path "drivepath/Data/Intensities/BaseCalls"
[ "Put", "the", "sequence", "pair", "referenced", "in", "the", "sequence_files", "onto", "the", "drive", "-", "with", "specific", "path", "\"", "drivepath", "/", "Data", "/", "Intensities", "/", "BaseCalls", "\"" ]
[ "\"\"\"\n Put the sequence pair referenced in the sequence_files onto the drive - with specific path \n \"drivepath/Data/Intensities/BaseCalls\"\n :param sequence_pair: All information for a pair of SEQ-IDs\n \"\"\"", "# Figure out if which file is forward/reverse reads.", "# Check g...
[ { "param": "self", "type": null }, { "param": "sequence_pair", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "sequence_pair", "type": null, "docstring": "All information for a p...
a066768c603a7842df9f9728b446f213492cbf50
NCAR/cesm2-le-aws
zarrification/helpers.py
[ "Apache-2.0" ]
Python
zarr_store
<not_specific>
def zarr_store( experiment, component, frequency, forcing_variant, variable, write=False, dirout='/glade/scratch/mgrover/data/lens2-aws', ): """ Create zarr store name/path """ path = f'{dirout}/{component}/{frequency}/cesm2LE-{experiment}-{forcing_variant}-{variable}.zarr' i...
Create zarr store name/path
Create zarr store name/path
[ "Create", "zarr", "store", "name", "/", "path" ]
def zarr_store( experiment, component, frequency, forcing_variant, variable, write=False, dirout='/glade/scratch/mgrover/data/lens2-aws', ): path = f'{dirout}/{component}/{frequency}/cesm2LE-{experiment}-{forcing_variant}-{variable}.zarr' if write and os.path.exists(path): sh...
[ "def", "zarr_store", "(", "experiment", ",", "component", ",", "frequency", ",", "forcing_variant", ",", "variable", ",", "write", "=", "False", ",", "dirout", "=", "'/glade/scratch/mgrover/data/lens2-aws'", ",", ")", ":", "path", "=", "f'{dirout}/{component}/{frequ...
Create zarr store name/path
[ "Create", "zarr", "store", "name", "/", "path" ]
[ "\"\"\" Create zarr store name/path\n \"\"\"" ]
[ { "param": "experiment", "type": null }, { "param": "component", "type": null }, { "param": "frequency", "type": null }, { "param": "forcing_variant", "type": null }, { "param": "variable", "type": null }, { "param": "write", "type": null }, { ...
{ "returns": [], "raises": [], "params": [ { "identifier": "experiment", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "component", "type": null, "docstring": null, "docstring...
19f72e03a680a90e0da476c1c91fa269685f19ee
suchkultur/gimlet
backend/api.py
[ "MIT" ]
Python
on_get
null
def on_get(self, req, resp): """Handles GET requests for this ressource""" content = { 'salutation': 'Hello there, this is a simple in-memory Blogging system with a falcon-based API', 'falconHome': 'http://falconframework.org/', 'falconDocs': 'http://falcon.readthedoc...
Handles GET requests for this ressource
Handles GET requests for this ressource
[ "Handles", "GET", "requests", "for", "this", "ressource" ]
def on_get(self, req, resp): content = { 'salutation': 'Hello there, this is a simple in-memory Blogging system with a falcon-based API', 'falconHome': 'http://falconframework.org/', 'falconDocs': 'http://falcon.readthedocs.org/' } resp.body = json.dumps(conte...
[ "def", "on_get", "(", "self", ",", "req", ",", "resp", ")", ":", "content", "=", "{", "'salutation'", ":", "'Hello there, this is a simple in-memory Blogging system with a falcon-based API'", ",", "'falconHome'", ":", "'http://falconframework.org/'", ",", "'falconDocs'", ...
Handles GET requests for this ressource
[ "Handles", "GET", "requests", "for", "this", "ressource" ]
[ "\"\"\"Handles GET requests for this ressource\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "req", "type": null }, { "param": "resp", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "req", "type": null, "docstring": null, "docstring_tokens": []...
19f72e03a680a90e0da476c1c91fa269685f19ee
suchkultur/gimlet
backend/api.py
[ "MIT" ]
Python
on_put
null
def on_put(self, req, resp, article_uuid): """Update an article with url params using PUT""" # .decode() seems mandantory when running this in python3 # See: http://stackoverflow.com/questions/6862770/python-3-let-json-object-accept-bytes-or-let-urlopen-output-strings req_body = json.lo...
Update an article with url params using PUT
Update an article with url params using PUT
[ "Update", "an", "article", "with", "url", "params", "using", "PUT" ]
def on_put(self, req, resp, article_uuid): req_body = json.loads(req.stream.read().decode('utf-8')) title = req_body['title'] subtitle = req_body['subtitle'] body = req_body['body'] if title: blog.update_article(article_id=article_uuid, title=title) if subtitle: blog.upda...
[ "def", "on_put", "(", "self", ",", "req", ",", "resp", ",", "article_uuid", ")", ":", "req_body", "=", "json", ".", "loads", "(", "req", ".", "stream", ".", "read", "(", ")", ".", "decode", "(", "'utf-8'", ")", ")", "title", "=", "req_body", "[", ...
Update an article with url params using PUT
[ "Update", "an", "article", "with", "url", "params", "using", "PUT" ]
[ "\"\"\"Update an article with url params using PUT\"\"\"", "# .decode() seems mandantory when running this in python3", "# See: http://stackoverflow.com/questions/6862770/python-3-let-json-object-accept-bytes-or-let-urlopen-output-strings" ]
[ { "param": "self", "type": null }, { "param": "req", "type": null }, { "param": "resp", "type": null }, { "param": "article_uuid", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "req", "type": null, "docstring": null, "docstring_tokens": []...
19f72e03a680a90e0da476c1c91fa269685f19ee
suchkultur/gimlet
backend/api.py
[ "MIT" ]
Python
on_post
null
def on_post(self, req, resp): """Creates a new article using POST""" req_body = json.loads(req.stream.read().decode('utf-8')) title = req_body['title'] subtitle = req_body['subtitle'] body = req_body['body'] blog.create_article(title, subtitle, body) resp.status =...
Creates a new article using POST
Creates a new article using POST
[ "Creates", "a", "new", "article", "using", "POST" ]
def on_post(self, req, resp): req_body = json.loads(req.stream.read().decode('utf-8')) title = req_body['title'] subtitle = req_body['subtitle'] body = req_body['body'] blog.create_article(title, subtitle, body) resp.status = falcon.HTTP_200
[ "def", "on_post", "(", "self", ",", "req", ",", "resp", ")", ":", "req_body", "=", "json", ".", "loads", "(", "req", ".", "stream", ".", "read", "(", ")", ".", "decode", "(", "'utf-8'", ")", ")", "title", "=", "req_body", "[", "'title'", "]", "su...
Creates a new article using POST
[ "Creates", "a", "new", "article", "using", "POST" ]
[ "\"\"\"Creates a new article using POST\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "req", "type": null }, { "param": "resp", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "req", "type": null, "docstring": null, "docstring_tokens": []...
96a607f27189e6c088f30b8f88be5affb69e5da5
suchkultur/gimlet
backend/blog.py
[ "MIT" ]
Python
fetch_article
<not_specific>
def fetch_article(self, article_id): """ `R` Returns one article identified by an uuid """ for post in self.content['postings']: if post['id'] == article_id: return post
`R` Returns one article identified by an uuid
`R` Returns one article identified by an uuid
[ "`", "R", "`", "Returns", "one", "article", "identified", "by", "an", "uuid" ]
def fetch_article(self, article_id): for post in self.content['postings']: if post['id'] == article_id: return post
[ "def", "fetch_article", "(", "self", ",", "article_id", ")", ":", "for", "post", "in", "self", ".", "content", "[", "'postings'", "]", ":", "if", "post", "[", "'id'", "]", "==", "article_id", ":", "return", "post" ]
`R` Returns one article identified by an uuid
[ "`", "R", "`", "Returns", "one", "article", "identified", "by", "an", "uuid" ]
[ "\"\"\"\n `R`\n Returns one article identified by an uuid\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "article_id", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "article_id", "type": null, "docstring": null, "docstring_toke...
96a607f27189e6c088f30b8f88be5affb69e5da5
suchkultur/gimlet
backend/blog.py
[ "MIT" ]
Python
delete_article
null
def delete_article(self, article_id): """ `D` Deletes an article identified by an uuid """ for idx, post in enumerate(self.content['postings']): if post['id'] == article_id: self.content['postings'].pop(idx)
`D` Deletes an article identified by an uuid
`D` Deletes an article identified by an uuid
[ "`", "D", "`", "Deletes", "an", "article", "identified", "by", "an", "uuid" ]
def delete_article(self, article_id): for idx, post in enumerate(self.content['postings']): if post['id'] == article_id: self.content['postings'].pop(idx)
[ "def", "delete_article", "(", "self", ",", "article_id", ")", ":", "for", "idx", ",", "post", "in", "enumerate", "(", "self", ".", "content", "[", "'postings'", "]", ")", ":", "if", "post", "[", "'id'", "]", "==", "article_id", ":", "self", ".", "con...
`D` Deletes an article identified by an uuid
[ "`", "D", "`", "Deletes", "an", "article", "identified", "by", "an", "uuid" ]
[ "\"\"\"\n `D`\n Deletes an article identified by an uuid\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "article_id", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "article_id", "type": null, "docstring": null, "docstring_toke...
1a59bdcaa47e7c2c99698a109add397726bfc8a1
cassidylaidlaw/django-puppeteer-pdf
puppeteer_pdf/tests/tests.py
[ "BSD-2-Clause" ]
Python
_render_file
<not_specific>
def _render_file(self, template, context): """Helper method for testing rendered file deleted/persists tests.""" render = RenderedFile(template=template, context=context) render.temporary_file.seek(0) saved_content = smart_str(render.temporary_file.read()) return (saved_content,...
Helper method for testing rendered file deleted/persists tests.
Helper method for testing rendered file deleted/persists tests.
[ "Helper", "method", "for", "testing", "rendered", "file", "deleted", "/", "persists", "tests", "." ]
def _render_file(self, template, context): render = RenderedFile(template=template, context=context) render.temporary_file.seek(0) saved_content = smart_str(render.temporary_file.read()) return (saved_content, render.filename)
[ "def", "_render_file", "(", "self", ",", "template", ",", "context", ")", ":", "render", "=", "RenderedFile", "(", "template", "=", "template", ",", "context", "=", "context", ")", "render", ".", "temporary_file", ".", "seek", "(", "0", ")", "saved_content...
Helper method for testing rendered file deleted/persists tests.
[ "Helper", "method", "for", "testing", "rendered", "file", "deleted", "/", "persists", "tests", "." ]
[ "\"\"\"Helper method for testing rendered file deleted/persists tests.\"\"\"" ]
[ { "param": "self", "type": null }, { "param": "template", "type": null }, { "param": "context", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "template", "type": null, "docstring": null, "docstring_tokens...
4e7f5d5cc54a1a3f1eccce7e0eb1ea4220f6b81c
ShaunKulesa/Texture-Atlas
Texture_Atlas/texture_atlas.py
[ "MIT" ]
Python
remove_texture
null
def remove_texture(self, image_path: str): ''' Removes a specific texture from the texture atlas. * image_path: string ''' self.textures.pop(image_path, None) self._organise()
Removes a specific texture from the texture atlas. * image_path: string
Removes a specific texture from the texture atlas.
[ "Removes", "a", "specific", "texture", "from", "the", "texture", "atlas", "." ]
def remove_texture(self, image_path: str): self.textures.pop(image_path, None) self._organise()
[ "def", "remove_texture", "(", "self", ",", "image_path", ":", "str", ")", ":", "self", ".", "textures", ".", "pop", "(", "image_path", ",", "None", ")", "self", ".", "_organise", "(", ")" ]
Removes a specific texture from the texture atlas.
[ "Removes", "a", "specific", "texture", "from", "the", "texture", "atlas", "." ]
[ "'''\r\n Removes a specific texture from the texture atlas.\r\n * image_path: string\r\n '''" ]
[ { "param": "self", "type": null }, { "param": "image_path", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "image_path", "type": "str", "docstring": null, "docstring_tok...
4e7f5d5cc54a1a3f1eccce7e0eb1ea4220f6b81c
ShaunKulesa/Texture-Atlas
Texture_Atlas/texture_atlas.py
[ "MIT" ]
Python
remove_textures
null
def remove_textures(self, textures: list): ''' Removes multiple specific textures from the texture atlas. * textures: [texture_name: string] ''' for texture in textures: self.textures.pop(texture, None)
Removes multiple specific textures from the texture atlas. * textures: [texture_name: string]
Removes multiple specific textures from the texture atlas.
[ "Removes", "multiple", "specific", "textures", "from", "the", "texture", "atlas", "." ]
def remove_textures(self, textures: list): for texture in textures: self.textures.pop(texture, None)
[ "def", "remove_textures", "(", "self", ",", "textures", ":", "list", ")", ":", "for", "texture", "in", "textures", ":", "self", ".", "textures", ".", "pop", "(", "texture", ",", "None", ")" ]
Removes multiple specific textures from the texture atlas.
[ "Removes", "multiple", "specific", "textures", "from", "the", "texture", "atlas", "." ]
[ "'''\r\n Removes multiple specific textures from the texture atlas.\r\n * textures: [texture_name: string]\r\n '''" ]
[ { "param": "self", "type": null }, { "param": "textures", "type": "list" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "textures", "type": "list", "docstring": null, "docstring_toke...
4e7f5d5cc54a1a3f1eccce7e0eb1ea4220f6b81c
ShaunKulesa/Texture-Atlas
Texture_Atlas/texture_atlas.py
[ "MIT" ]
Python
resize_texture
null
def resize_texture(self, image_path: str, width: int, height: int): ''' Resizes a specific texture in the texture atlas. * image_path: string * width: integer * height: integer ''' if image_path in self.textures: self.textures[im...
Resizes a specific texture in the texture atlas. * image_path: string * width: integer * height: integer
Resizes a specific texture in the texture atlas. image_path: string width: integer height: integer
[ "Resizes", "a", "specific", "texture", "in", "the", "texture", "atlas", ".", "image_path", ":", "string", "width", ":", "integer", "height", ":", "integer" ]
def resize_texture(self, image_path: str, width: int, height: int): if image_path in self.textures: self.textures[image_path][2] = width self.textures[image_path][3] = height self._organise()
[ "def", "resize_texture", "(", "self", ",", "image_path", ":", "str", ",", "width", ":", "int", ",", "height", ":", "int", ")", ":", "if", "image_path", "in", "self", ".", "textures", ":", "self", ".", "textures", "[", "image_path", "]", "[", "2", "]"...
Resizes a specific texture in the texture atlas.
[ "Resizes", "a", "specific", "texture", "in", "the", "texture", "atlas", "." ]
[ "'''\r\n Resizes a specific texture in the texture atlas.\r\n * image_path: string\r\n * width: integer \r\n * height: integer\r\n '''" ]
[ { "param": "self", "type": null }, { "param": "image_path", "type": "str" }, { "param": "width", "type": "int" }, { "param": "height", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "image_path", "type": "str", "docstring": null, "docstring_tok...
4e7f5d5cc54a1a3f1eccce7e0eb1ea4220f6b81c
ShaunKulesa/Texture-Atlas
Texture_Atlas/texture_atlas.py
[ "MIT" ]
Python
resize
null
def resize(self, width: int, height: int): ''' Resizes the texture atlas. * width: integer * height: integer ''' self.width = width self.height = height self._organise()
Resizes the texture atlas. * width: integer * height: integer
Resizes the texture atlas. width: integer height: integer
[ "Resizes", "the", "texture", "atlas", ".", "width", ":", "integer", "height", ":", "integer" ]
def resize(self, width: int, height: int): self.width = width self.height = height self._organise()
[ "def", "resize", "(", "self", ",", "width", ":", "int", ",", "height", ":", "int", ")", ":", "self", ".", "width", "=", "width", "self", ".", "height", "=", "height", "self", ".", "_organise", "(", ")" ]
Resizes the texture atlas.
[ "Resizes", "the", "texture", "atlas", "." ]
[ "'''\r\n Resizes the texture atlas.\r\n * width: integer\r\n * height: integer\r\n '''" ]
[ { "param": "self", "type": null }, { "param": "width", "type": "int" }, { "param": "height", "type": "int" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "width", "type": "int", "docstring": null, "docstring_tokens":...
4e7f5d5cc54a1a3f1eccce7e0eb1ea4220f6b81c
ShaunKulesa/Texture-Atlas
Texture_Atlas/texture_atlas.py
[ "MIT" ]
Python
all_texture_positions
<not_specific>
def all_texture_positions(self): ''' Returns a dictionary of all the textures and their positions. ''' return self.textures
Returns a dictionary of all the textures and their positions.
Returns a dictionary of all the textures and their positions.
[ "Returns", "a", "dictionary", "of", "all", "the", "textures", "and", "their", "positions", "." ]
def all_texture_positions(self): return self.textures
[ "def", "all_texture_positions", "(", "self", ")", ":", "return", "self", ".", "textures" ]
Returns a dictionary of all the textures and their positions.
[ "Returns", "a", "dictionary", "of", "all", "the", "textures", "and", "their", "positions", "." ]
[ "'''\r\n Returns a dictionary of all the textures and their positions.\r\n '''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4e7f5d5cc54a1a3f1eccce7e0eb1ea4220f6b81c
ShaunKulesa/Texture-Atlas
Texture_Atlas/texture_atlas.py
[ "MIT" ]
Python
save_as
null
def save_as(self, output_name: str): ''' Saves the texture atlas as an image file. * output_name: string ''' self.atlas.save(output_name)
Saves the texture atlas as an image file. * output_name: string
Saves the texture atlas as an image file.
[ "Saves", "the", "texture", "atlas", "as", "an", "image", "file", "." ]
def save_as(self, output_name: str): self.atlas.save(output_name)
[ "def", "save_as", "(", "self", ",", "output_name", ":", "str", ")", ":", "self", ".", "atlas", ".", "save", "(", "output_name", ")" ]
Saves the texture atlas as an image file.
[ "Saves", "the", "texture", "atlas", "as", "an", "image", "file", "." ]
[ "'''\r\n Saves the texture atlas as an image file.\r\n * output_name: string\r\n '''" ]
[ { "param": "self", "type": null }, { "param": "output_name", "type": "str" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "output_name", "type": "str", "docstring": null, "docstring_to...
4e7f5d5cc54a1a3f1eccce7e0eb1ea4220f6b81c
ShaunKulesa/Texture-Atlas
Texture_Atlas/texture_atlas.py
[ "MIT" ]
Python
clear
null
def clear(self): ''' Clears all textures from the texture atlas. ''' self.atlas.close() self.atlas = Image.new("RGBA", (self.width, self.height))
Clears all textures from the texture atlas.
Clears all textures from the texture atlas.
[ "Clears", "all", "textures", "from", "the", "texture", "atlas", "." ]
def clear(self): self.atlas.close() self.atlas = Image.new("RGBA", (self.width, self.height))
[ "def", "clear", "(", "self", ")", ":", "self", ".", "atlas", ".", "close", "(", ")", "self", ".", "atlas", "=", "Image", ".", "new", "(", "\"RGBA\"", ",", "(", "self", ".", "width", ",", "self", ".", "height", ")", ")" ]
Clears all textures from the texture atlas.
[ "Clears", "all", "textures", "from", "the", "texture", "atlas", "." ]
[ "'''\r\n Clears all textures from the texture atlas.\r\n '''" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f9841bb79b776f27ba65dd348de8b07f2834b656
fyqqyf/UC-Berkeley-CS188-2020
project2_multiagent/multiagent/multiAgents.py
[ "MIT" ]
Python
evaluationFunction
<not_specific>
def evaluationFunction(self, currentGameState, action): """ Design a better evaluation function here. The evaluation function takes in the current and proposed successor GameStates (pacman.py) and returns a number, where higher numbers are better. The code below extracts some u...
Design a better evaluation function here. The evaluation function takes in the current and proposed successor GameStates (pacman.py) and returns a number, where higher numbers are better. The code below extracts some useful information from the state, like the remaining food (...
Design a better evaluation function here. The evaluation function takes in the current and proposed successor GameStates (pacman.py) and returns a number, where higher numbers are better. The code below extracts some useful information from the state, like the remaining food (newFood) and Pacman position after moving ...
[ "Design", "a", "better", "evaluation", "function", "here", ".", "The", "evaluation", "function", "takes", "in", "the", "current", "and", "proposed", "successor", "GameStates", "(", "pacman", ".", "py", ")", "and", "returns", "a", "number", "where", "higher", ...
def evaluationFunction(self, currentGameState, action): successorGameState = currentGameState.generatePacmanSuccessor(action) newPos = successorGameState.getPacmanPosition() newFood = successorGameState.getFood() newGhostStates = successorGameState.getGhostStates() newScaredTimes...
[ "def", "evaluationFunction", "(", "self", ",", "currentGameState", ",", "action", ")", ":", "successorGameState", "=", "currentGameState", ".", "generatePacmanSuccessor", "(", "action", ")", "newPos", "=", "successorGameState", ".", "getPacmanPosition", "(", ")", "n...
Design a better evaluation function here.
[ "Design", "a", "better", "evaluation", "function", "here", "." ]
[ "\"\"\"\n Design a better evaluation function here.\n\n The evaluation function takes in the current and proposed successor\n GameStates (pacman.py) and returns a number, where higher numbers are better.\n\n The code below extracts some useful information from the state, like the\n ...
[ { "param": "self", "type": null }, { "param": "currentGameState", "type": null }, { "param": "action", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "currentGameState", "type": null, "docstring": null, "docstrin...
f3f94a6430f8030b77b8b7a847923a96ed9b6f84
fyqqyf/UC-Berkeley-CS188-2020
project1_search/search/search.py
[ "MIT" ]
Python
depthFirstSearch
<not_specific>
def depthFirstSearch(problem): """ Search the deepest nodes in the search tree first. Your search algorithm needs to return a list of actions that reaches the goal. Make sure to implement a graph search algorithm. To get started, you might want to try some of these simple commands to understan...
Search the deepest nodes in the search tree first. Your search algorithm needs to return a list of actions that reaches the goal. Make sure to implement a graph search algorithm. To get started, you might want to try some of these simple commands to understand the search problem that is being pas...
Search the deepest nodes in the search tree first. Your search algorithm needs to return a list of actions that reaches the goal. Make sure to implement a graph search algorithm. To get started, you might want to try some of these simple commands to understand the search problem that is being passed in.
[ "Search", "the", "deepest", "nodes", "in", "the", "search", "tree", "first", ".", "Your", "search", "algorithm", "needs", "to", "return", "a", "list", "of", "actions", "that", "reaches", "the", "goal", ".", "Make", "sure", "to", "implement", "a", "graph", ...
def depthFirstSearch(problem): fringe = util.Stack() start = [problem.getStartState(), 0, []] fringe.push(start) closed = [] while not fringe.isEmpty(): [node, cost, path] = fringe.pop() if problem.isGoalState(node): return path if not node in closed: ...
[ "def", "depthFirstSearch", "(", "problem", ")", ":", "fringe", "=", "util", ".", "Stack", "(", ")", "start", "=", "[", "problem", ".", "getStartState", "(", ")", ",", "0", ",", "[", "]", "]", "fringe", ".", "push", "(", "start", ")", "closed", "=",...
Search the deepest nodes in the search tree first.
[ "Search", "the", "deepest", "nodes", "in", "the", "search", "tree", "first", "." ]
[ "\"\"\"\n Search the deepest nodes in the search tree first.\n\n Your search algorithm needs to return a list of actions that reaches the\n goal. Make sure to implement a graph search algorithm.\n\n To get started, you might want to try some of these simple commands to\n understand the search problem...
[ { "param": "problem", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "problem", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f3f94a6430f8030b77b8b7a847923a96ed9b6f84
fyqqyf/UC-Berkeley-CS188-2020
project1_search/search/search.py
[ "MIT" ]
Python
breadthFirstSearch
<not_specific>
def breadthFirstSearch(problem): """Search the shallowest nodes in the search tree first.""" fringe = util.Queue() start = [problem.getStartState(), 0, []] fringe.push(start) closed = [] while not fringe.isEmpty(): [node, cost, path] = fringe.pop() if problem.isGoalState(node): ...
Search the shallowest nodes in the search tree first.
Search the shallowest nodes in the search tree first.
[ "Search", "the", "shallowest", "nodes", "in", "the", "search", "tree", "first", "." ]
def breadthFirstSearch(problem): fringe = util.Queue() start = [problem.getStartState(), 0, []] fringe.push(start) closed = [] while not fringe.isEmpty(): [node, cost, path] = fringe.pop() if problem.isGoalState(node): return path if not node in closed: ...
[ "def", "breadthFirstSearch", "(", "problem", ")", ":", "fringe", "=", "util", ".", "Queue", "(", ")", "start", "=", "[", "problem", ".", "getStartState", "(", ")", ",", "0", ",", "[", "]", "]", "fringe", ".", "push", "(", "start", ")", "closed", "=...
Search the shallowest nodes in the search tree first.
[ "Search", "the", "shallowest", "nodes", "in", "the", "search", "tree", "first", "." ]
[ "\"\"\"Search the shallowest nodes in the search tree first.\"\"\"" ]
[ { "param": "problem", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "problem", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f3f94a6430f8030b77b8b7a847923a96ed9b6f84
fyqqyf/UC-Berkeley-CS188-2020
project1_search/search/search.py
[ "MIT" ]
Python
uniformCostSearch
<not_specific>
def uniformCostSearch(problem): """Search the node of least total cost first.""" fringe = util.PriorityQueue() start = [problem.getStartState(), 0, []] fringe.push(start, 0) closed = [] while not fringe.isEmpty(): [node, cost, path] = fringe.pop() if problem.isGoalState(node): ...
Search the node of least total cost first.
Search the node of least total cost first.
[ "Search", "the", "node", "of", "least", "total", "cost", "first", "." ]
def uniformCostSearch(problem): fringe = util.PriorityQueue() start = [problem.getStartState(), 0, []] fringe.push(start, 0) closed = [] while not fringe.isEmpty(): [node, cost, path] = fringe.pop() if problem.isGoalState(node): return path if not node in closed: ...
[ "def", "uniformCostSearch", "(", "problem", ")", ":", "fringe", "=", "util", ".", "PriorityQueue", "(", ")", "start", "=", "[", "problem", ".", "getStartState", "(", ")", ",", "0", ",", "[", "]", "]", "fringe", ".", "push", "(", "start", ",", "0", ...
Search the node of least total cost first.
[ "Search", "the", "node", "of", "least", "total", "cost", "first", "." ]
[ "\"\"\"Search the node of least total cost first.\"\"\"" ]
[ { "param": "problem", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "problem", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
f3f94a6430f8030b77b8b7a847923a96ed9b6f84
fyqqyf/UC-Berkeley-CS188-2020
project1_search/search/search.py
[ "MIT" ]
Python
aStarSearch
<not_specific>
def aStarSearch(problem, heuristic=nullHeuristic): """Search the node that has the lowest combined cost and heuristic first.""" fringe = util.PriorityQueue() start = [problem.getStartState(), 0, []] p = 0 fringe.push(start, p) closed = [] while not fringe.isEmpty(): [node, cost, path...
Search the node that has the lowest combined cost and heuristic first.
Search the node that has the lowest combined cost and heuristic first.
[ "Search", "the", "node", "that", "has", "the", "lowest", "combined", "cost", "and", "heuristic", "first", "." ]
def aStarSearch(problem, heuristic=nullHeuristic): fringe = util.PriorityQueue() start = [problem.getStartState(), 0, []] p = 0 fringe.push(start, p) closed = [] while not fringe.isEmpty(): [node, cost, path] = fringe.pop() if problem.isGoalState(node): return path ...
[ "def", "aStarSearch", "(", "problem", ",", "heuristic", "=", "nullHeuristic", ")", ":", "fringe", "=", "util", ".", "PriorityQueue", "(", ")", "start", "=", "[", "problem", ".", "getStartState", "(", ")", ",", "0", ",", "[", "]", "]", "p", "=", "0", ...
Search the node that has the lowest combined cost and heuristic first.
[ "Search", "the", "node", "that", "has", "the", "lowest", "combined", "cost", "and", "heuristic", "first", "." ]
[ "\"\"\"Search the node that has the lowest combined cost and heuristic first.\"\"\"", "#pay attention to the priority!" ]
[ { "param": "problem", "type": null }, { "param": "heuristic", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "problem", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "heuristic", "type": null, "docstring": null, "docstring_to...
1d7db5b935e5241a976638b3e90564deea38f575
fyqqyf/UC-Berkeley-CS188-2020
project5_machine_learning/machinelearning/models.py
[ "MIT" ]
Python
run
<not_specific>
def run(self, x): """ Calculates the score assigned by the perceptron to a data point x. Inputs: x: a node with shape (1 x dimensions) Returns: a node containing a single number (the score) """ "*** YOUR CODE HERE ***" return nn.DotProduct(self.w, x)
Calculates the score assigned by the perceptron to a data point x. Inputs: x: a node with shape (1 x dimensions) Returns: a node containing a single number (the score)
Calculates the score assigned by the perceptron to a data point x. Inputs: x: a node with shape (1 x dimensions) Returns: a node containing a single number (the score)
[ "Calculates", "the", "score", "assigned", "by", "the", "perceptron", "to", "a", "data", "point", "x", ".", "Inputs", ":", "x", ":", "a", "node", "with", "shape", "(", "1", "x", "dimensions", ")", "Returns", ":", "a", "node", "containing", "a", "single"...
def run(self, x): return nn.DotProduct(self.w, x)
[ "def", "run", "(", "self", ",", "x", ")", ":", "\"*** YOUR CODE HERE ***\"", "return", "nn", ".", "DotProduct", "(", "self", ".", "w", ",", "x", ")" ]
Calculates the score assigned by the perceptron to a data point x. Inputs: x: a node with shape (1 x dimensions) Returns: a node containing a single number (the score)
[ "Calculates", "the", "score", "assigned", "by", "the", "perceptron", "to", "a", "data", "point", "x", ".", "Inputs", ":", "x", ":", "a", "node", "with", "shape", "(", "1", "x", "dimensions", ")", "Returns", ":", "a", "node", "containing", "a", "single"...
[ "\"\"\"\n Calculates the score assigned by the perceptron to a data point x.\n\n Inputs:\n x: a node with shape (1 x dimensions)\n Returns: a node containing a single number (the score)\n \"\"\"", "\"*** YOUR CODE HERE ***\"" ]
[ { "param": "self", "type": null }, { "param": "x", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
1d7db5b935e5241a976638b3e90564deea38f575
fyqqyf/UC-Berkeley-CS188-2020
project5_machine_learning/machinelearning/models.py
[ "MIT" ]
Python
train
null
def train(self, dataset): """ Train the perceptron until convergence. """ "*** YOUR CODE HERE ***" while True: flag = True batchsize = 1 for x, y in dataset.iterate_once(batchsize): y = nn.as_scalar(y) if self.ge...
Train the perceptron until convergence.
Train the perceptron until convergence.
[ "Train", "the", "perceptron", "until", "convergence", "." ]
def train(self, dataset): while True: flag = True batchsize = 1 for x, y in dataset.iterate_once(batchsize): y = nn.as_scalar(y) if self.get_prediction(x) != y: flag = False self.w.update(x, y) ...
[ "def", "train", "(", "self", ",", "dataset", ")", ":", "\"*** YOUR CODE HERE ***\"", "while", "True", ":", "flag", "=", "True", "batchsize", "=", "1", "for", "x", ",", "y", "in", "dataset", ".", "iterate_once", "(", "batchsize", ")", ":", "y", "=", "nn...
Train the perceptron until convergence.
[ "Train", "the", "perceptron", "until", "convergence", "." ]
[ "\"\"\"\n Train the perceptron until convergence.\n \"\"\"", "\"*** YOUR CODE HERE ***\"" ]
[ { "param": "self", "type": null }, { "param": "dataset", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "dataset", "type": null, "docstring": null, "docstring_tokens"...
1d7db5b935e5241a976638b3e90564deea38f575
fyqqyf/UC-Berkeley-CS188-2020
project5_machine_learning/machinelearning/models.py
[ "MIT" ]
Python
run
<not_specific>
def run(self, x): """ Runs the model for a batch of examples. Your model should predict a node with shape (batch_size x 10), containing scores. Higher scores correspond to greater probability of the image belonging to a particular class. Inputs: x: a node wi...
Runs the model for a batch of examples. Your model should predict a node with shape (batch_size x 10), containing scores. Higher scores correspond to greater probability of the image belonging to a particular class. Inputs: x: a node with shape (batch_size x 784) ...
Runs the model for a batch of examples. Your model should predict a node with shape (batch_size x 10), containing scores. Higher scores correspond to greater probability of the image belonging to a particular class. a node with shape (batch_size x 784) Output: A node with shape (batch_size x 10) containing predicted s...
[ "Runs", "the", "model", "for", "a", "batch", "of", "examples", ".", "Your", "model", "should", "predict", "a", "node", "with", "shape", "(", "batch_size", "x", "10", ")", "containing", "scores", ".", "Higher", "scores", "correspond", "to", "greater", "prob...
def run(self, x): layer1 = nn.ReLU(nn.AddBias(nn.Linear(x, self.w1), self.b1)) layer2 = nn.ReLU(nn.AddBias(nn.Linear(layer1, self.w2), self.b2)) layer3 = nn.AddBias(nn.Linear(layer2, self.w3), self.b3) return layer3
[ "def", "run", "(", "self", ",", "x", ")", ":", "\"*** YOUR CODE HERE ***\"", "layer1", "=", "nn", ".", "ReLU", "(", "nn", ".", "AddBias", "(", "nn", ".", "Linear", "(", "x", ",", "self", ".", "w1", ")", ",", "self", ".", "b1", ")", ")", "layer2",...
Runs the model for a batch of examples.
[ "Runs", "the", "model", "for", "a", "batch", "of", "examples", "." ]
[ "\"\"\"\n Runs the model for a batch of examples.\n\n Your model should predict a node with shape (batch_size x 10),\n containing scores. Higher scores correspond to greater probability of\n the image belonging to a particular class.\n\n Inputs:\n x: a node with shape (...
[ { "param": "self", "type": null }, { "param": "x", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "x", "type": null, "docstring": null, "docstring_tokens": [], ...
1d7db5b935e5241a976638b3e90564deea38f575
fyqqyf/UC-Berkeley-CS188-2020
project5_machine_learning/machinelearning/models.py
[ "MIT" ]
Python
run
<not_specific>
def run(self, xs): """ Runs the model for a batch of examples. Although words have different lengths, our data processing guarantees that within a single batch, all words will be of the same length (L). Here `xs` will be a list of length L. Each element of `xs` will be a ...
Runs the model for a batch of examples. Although words have different lengths, our data processing guarantees that within a single batch, all words will be of the same length (L). Here `xs` will be a list of length L. Each element of `xs` will be a node with shape (batch_size ...
Runs the model for a batch of examples. Although words have different lengths, our data processing guarantees that within a single batch, all words will be of the same length (L). Here `xs` will be a list of length L. Each element of `xs` will be a node with shape (batch_size x self.num_chars), where every row in the ...
[ "Runs", "the", "model", "for", "a", "batch", "of", "examples", ".", "Although", "words", "have", "different", "lengths", "our", "data", "processing", "guarantees", "that", "within", "a", "single", "batch", "all", "words", "will", "be", "of", "the", "same", ...
def run(self, xs): h_i = nn.ReLU(nn.AddBias(nn.Linear(xs[0], self.i_w), self.i_b)) for char in xs[1:]: h_i = nn.ReLU(nn.AddBias(nn.Add(nn.Linear(char, self.x_w),nn.Linear(h_i, self.h_w)), self.b)) output = nn.AddBias(nn.Linear(h_i, self.out_w), self.out_b) return output
[ "def", "run", "(", "self", ",", "xs", ")", ":", "\"*** YOUR CODE HERE ***\"", "h_i", "=", "nn", ".", "ReLU", "(", "nn", ".", "AddBias", "(", "nn", ".", "Linear", "(", "xs", "[", "0", "]", ",", "self", ".", "i_w", ")", ",", "self", ".", "i_b", "...
Runs the model for a batch of examples.
[ "Runs", "the", "model", "for", "a", "batch", "of", "examples", "." ]
[ "\"\"\"\n Runs the model for a batch of examples.\n\n Although words have different lengths, our data processing guarantees\n that within a single batch, all words will be of the same length (L).\n\n Here `xs` will be a list of length L. Each element of `xs` will be a\n node with ...
[ { "param": "self", "type": null }, { "param": "xs", "type": null } ]
{ "returns": [ { "docstring": "A node with shape (batch_size x 5) containing predicted scores\n(also called logits)", "docstring_tokens": [ "A", "node", "with", "shape", "(", "batch_size", "x", "5", ")", "containing", ...
c7da1bdd2a13f23e643e6e1efda4b1e61935c6a3
fyqqyf/UC-Berkeley-CS188-2020
project3_RL/reinforcement/valueIterationAgents.py
[ "MIT" ]
Python
computeQValueFromValues
<not_specific>
def computeQValueFromValues(self, state, action): """ Compute the Q-value of action in state from the value function stored in self.values. """ "*** YOUR CODE HERE ***" Qvalue = 0 for nextstate, prob in self.mdp.getTransitionStatesAndProbs(state, action): ...
Compute the Q-value of action in state from the value function stored in self.values.
Compute the Q-value of action in state from the value function stored in self.values.
[ "Compute", "the", "Q", "-", "value", "of", "action", "in", "state", "from", "the", "value", "function", "stored", "in", "self", ".", "values", "." ]
def computeQValueFromValues(self, state, action): Qvalue = 0 for nextstate, prob in self.mdp.getTransitionStatesAndProbs(state, action): Qvalue+= prob*(self.mdp.getReward(state, action, nextstate)+self.discount*self.getValue(nextstate)) return Qvalue
[ "def", "computeQValueFromValues", "(", "self", ",", "state", ",", "action", ")", ":", "\"*** YOUR CODE HERE ***\"", "Qvalue", "=", "0", "for", "nextstate", ",", "prob", "in", "self", ".", "mdp", ".", "getTransitionStatesAndProbs", "(", "state", ",", "action", ...
Compute the Q-value of action in state from the value function stored in self.values.
[ "Compute", "the", "Q", "-", "value", "of", "action", "in", "state", "from", "the", "value", "function", "stored", "in", "self", ".", "values", "." ]
[ "\"\"\"\n Compute the Q-value of action in state from the\n value function stored in self.values.\n \"\"\"", "\"*** YOUR CODE HERE ***\"" ]
[ { "param": "self", "type": null }, { "param": "state", "type": null }, { "param": "action", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "state", "type": null, "docstring": null, "docstring_tokens": ...
c7da1bdd2a13f23e643e6e1efda4b1e61935c6a3
fyqqyf/UC-Berkeley-CS188-2020
project3_RL/reinforcement/valueIterationAgents.py
[ "MIT" ]
Python
computeActionFromValues
<not_specific>
def computeActionFromValues(self, state): """ The policy is the best action in the given state according to the values currently stored in self.values. You may break ties any way you see fit. Note that if there are no legal actions, which is the case at the te...
The policy is the best action in the given state according to the values currently stored in self.values. You may break ties any way you see fit. Note that if there are no legal actions, which is the case at the terminal state, you should return None.
The policy is the best action in the given state according to the values currently stored in self.values. You may break ties any way you see fit. Note that if there are no legal actions, which is the case at the terminal state, you should return None.
[ "The", "policy", "is", "the", "best", "action", "in", "the", "given", "state", "according", "to", "the", "values", "currently", "stored", "in", "self", ".", "values", ".", "You", "may", "break", "ties", "any", "way", "you", "see", "fit", ".", "Note", "...
def computeActionFromValues(self, state): policy = util.Counter() for action in self.mdp.getPossibleActions(state): policy[action] = self.getQValue(state, action) return policy.argMax()
[ "def", "computeActionFromValues", "(", "self", ",", "state", ")", ":", "\"*** YOUR CODE HERE ***\"", "policy", "=", "util", ".", "Counter", "(", ")", "for", "action", "in", "self", ".", "mdp", ".", "getPossibleActions", "(", "state", ")", ":", "policy", "[",...
The policy is the best action in the given state according to the values currently stored in self.values.
[ "The", "policy", "is", "the", "best", "action", "in", "the", "given", "state", "according", "to", "the", "values", "currently", "stored", "in", "self", ".", "values", "." ]
[ "\"\"\"\n The policy is the best action in the given state\n according to the values currently stored in self.values.\n\n You may break ties any way you see fit. Note that if\n there are no legal actions, which is the case at the\n terminal state, you should return None...
[ { "param": "self", "type": null }, { "param": "state", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "state", "type": null, "docstring": null, "docstring_tokens": ...
0223a36a45d0d7156eb0937a421ae3a8ee6bae7a
dev-pipeline/devpipeline-core
lib/devpipeline_core/plugin.py
[ "BSD-2-Clause" ]
Python
query_plugins
<not_specific>
def query_plugins(entry_point_name): """ Find everything with a specific entry_point. Results will be returned as a dictionary, with the name as the key and the entry_point itself as the value. Arguments: entry_point_name - the name of the entry_point to populate """ entries = {} f...
Find everything with a specific entry_point. Results will be returned as a dictionary, with the name as the key and the entry_point itself as the value. Arguments: entry_point_name - the name of the entry_point to populate
Find everything with a specific entry_point. Results will be returned as a dictionary, with the name as the key and the entry_point itself as the value. the name of the entry_point to populate
[ "Find", "everything", "with", "a", "specific", "entry_point", ".", "Results", "will", "be", "returned", "as", "a", "dictionary", "with", "the", "name", "as", "the", "key", "and", "the", "entry_point", "itself", "as", "the", "value", ".", "the", "name", "of...
def query_plugins(entry_point_name): entries = {} for entry_point in pkg_resources.iter_entry_points(entry_point_name): entries[entry_point.name] = entry_point.load() return entries
[ "def", "query_plugins", "(", "entry_point_name", ")", ":", "entries", "=", "{", "}", "for", "entry_point", "in", "pkg_resources", ".", "iter_entry_points", "(", "entry_point_name", ")", ":", "entries", "[", "entry_point", ".", "name", "]", "=", "entry_point", ...
Find everything with a specific entry_point.
[ "Find", "everything", "with", "a", "specific", "entry_point", "." ]
[ "\"\"\"\n Find everything with a specific entry_point. Results will be returned as a\n dictionary, with the name as the key and the entry_point itself as the\n value.\n\n Arguments:\n entry_point_name - the name of the entry_point to populate\n \"\"\"" ]
[ { "param": "entry_point_name", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "entry_point_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
01f375023ec13d28e6f14a217eecb73b65a4208e
dev-pipeline/devpipeline-core
lib/devpipeline_core/sanitizer.py
[ "BSD-2-Clause" ]
Python
sanitize
null
def sanitize(configuration, error_fn): """ Run all availalbe sanitizers across a configuration. Arguments: configuration - a full project configuration error_fn - A function to call if a sanitizer check fails. The function takes a single argument: a description of the problem; provi...
Run all availalbe sanitizers across a configuration. Arguments: configuration - a full project configuration error_fn - A function to call if a sanitizer check fails. The function takes a single argument: a description of the problem; provide specifics if possible, inclu...
Run all availalbe sanitizers across a configuration. Arguments: configuration - a full project configuration error_fn - A function to call if a sanitizer check fails. The function takes a single argument: a description of the problem; provide specifics if possible, including the componnet, the part of the configuratio...
[ "Run", "all", "availalbe", "sanitizers", "across", "a", "configuration", ".", "Arguments", ":", "configuration", "-", "a", "full", "project", "configuration", "error_fn", "-", "A", "function", "to", "call", "if", "a", "sanitizer", "check", "fails", ".", "The",...
def sanitize(configuration, error_fn): for name, sanitize_fn in _SANITIZERS.items(): sanitize_fn(configuration, lambda warning, n=name: error_fn(n, warning))
[ "def", "sanitize", "(", "configuration", ",", "error_fn", ")", ":", "for", "name", ",", "sanitize_fn", "in", "_SANITIZERS", ".", "items", "(", ")", ":", "sanitize_fn", "(", "configuration", ",", "lambda", "warning", ",", "n", "=", "name", ":", "error_fn", ...
Run all availalbe sanitizers across a configuration.
[ "Run", "all", "availalbe", "sanitizers", "across", "a", "configuration", "." ]
[ "\"\"\"\n Run all availalbe sanitizers across a configuration.\n\n Arguments:\n configuration - a full project configuration\n error_fn - A function to call if a sanitizer check fails. The function\n takes a single argument: a description of the problem; provide\n specifics ...
[ { "param": "configuration", "type": null }, { "param": "error_fn", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "configuration", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "error_fn", "type": null, "docstring": null, "docstri...
8c1ffc6a6499b102a2d991903fd7c67716f080a1
dev-pipeline/devpipeline-core
lib/devpipeline_core/configinfo.py
[ "BSD-2-Clause" ]
Python
config
<not_specific>
def config(self): """ Retrieve the configuration for the component being processed. """ return self._current_config
Retrieve the configuration for the component being processed.
Retrieve the configuration for the component being processed.
[ "Retrieve", "the", "configuration", "for", "the", "component", "being", "processed", "." ]
def config(self): return self._current_config
[ "def", "config", "(", "self", ")", ":", "return", "self", ".", "_current_config" ]
Retrieve the configuration for the component being processed.
[ "Retrieve", "the", "configuration", "for", "the", "component", "being", "processed", "." ]
[ "\"\"\"\n Retrieve the configuration for the component being processed.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8c1ffc6a6499b102a2d991903fd7c67716f080a1
dev-pipeline/devpipeline-core
lib/devpipeline_core/configinfo.py
[ "BSD-2-Clause" ]
Python
config
null
def config(self, config): """ Set the currently processed component's configuration. """ self._current_config = config
Set the currently processed component's configuration.
Set the currently processed component's configuration.
[ "Set", "the", "currently", "processed", "component", "'", "s", "configuration", "." ]
def config(self, config): self._current_config = config
[ "def", "config", "(", "self", ",", "config", ")", ":", "self", ".", "_current_config", "=", "config" ]
Set the currently processed component's configuration.
[ "Set", "the", "currently", "processed", "component", "'", "s", "configuration", "." ]
[ "\"\"\"\n Set the currently processed component's configuration.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "config", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "config", "type": null, "docstring": null, "docstring_tokens":...
8c1ffc6a6499b102a2d991903fd7c67716f080a1
dev-pipeline/devpipeline-core
lib/devpipeline_core/configinfo.py
[ "BSD-2-Clause" ]
Python
env
<not_specific>
def env(self): """ Retrieve the processed environment settings for the current component; the enviornment is a dictionary-like object. """ return self._current_env
Retrieve the processed environment settings for the current component; the enviornment is a dictionary-like object.
Retrieve the processed environment settings for the current component; the enviornment is a dictionary-like object.
[ "Retrieve", "the", "processed", "environment", "settings", "for", "the", "current", "component", ";", "the", "enviornment", "is", "a", "dictionary", "-", "like", "object", "." ]
def env(self): return self._current_env
[ "def", "env", "(", "self", ")", ":", "return", "self", ".", "_current_env" ]
Retrieve the processed environment settings for the current component; the enviornment is a dictionary-like object.
[ "Retrieve", "the", "processed", "environment", "settings", "for", "the", "current", "component", ";", "the", "enviornment", "is", "a", "dictionary", "-", "like", "object", "." ]
[ "\"\"\"\n Retrieve the processed environment settings for the current component;\n the enviornment is a dictionary-like object.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
8c1ffc6a6499b102a2d991903fd7c67716f080a1
dev-pipeline/devpipeline-core
lib/devpipeline_core/configinfo.py
[ "BSD-2-Clause" ]
Python
env
null
def env(self, env): """ Set the current componnet's processed environment variables. """ self._current_env = env
Set the current componnet's processed environment variables.
Set the current componnet's processed environment variables.
[ "Set", "the", "current", "componnet", "'", "s", "processed", "environment", "variables", "." ]
def env(self, env): self._current_env = env
[ "def", "env", "(", "self", ",", "env", ")", ":", "self", ".", "_current_env", "=", "env" ]
Set the current componnet's processed environment variables.
[ "Set", "the", "current", "componnet", "'", "s", "processed", "environment", "variables", "." ]
[ "\"\"\"\n Set the current componnet's processed environment variables.\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "env", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "env", "type": null, "docstring": null, "docstring_tokens": []...
3d3f11f3f5730fff674074b3241f83d98a9fd646
dev-pipeline/devpipeline-core
lib/devpipeline_core/toolsupport.py
[ "BSD-2-Clause" ]
Python
choose_tool_key
<not_specific>
def choose_tool_key(full_configuration, keys): """ Select the key for a tool from a list of supported tools. This function is designed to help when multiple keys can be used to specify an option (e.g., during migration from one name to another). The values in keys should be ordered based on prefer...
Select the key for a tool from a list of supported tools. This function is designed to help when multiple keys can be used to specify an option (e.g., during migration from one name to another). The values in keys should be ordered based on preference, as that's the order they'll be checked. If ...
Select the key for a tool from a list of supported tools. This function is designed to help when multiple keys can be used to specify an option . The values in keys should be ordered based on preference, as that's the order they'll be checked. If anything other than the first entry is selected, a warning will be disp...
[ "Select", "the", "key", "for", "a", "tool", "from", "a", "list", "of", "supported", "tools", ".", "This", "function", "is", "designed", "to", "help", "when", "multiple", "keys", "can", "be", "used", "to", "specify", "an", "option", ".", "The", "values", ...
def choose_tool_key(full_configuration, keys): tool_key = _choose_key(full_configuration.config, keys) if tool_key != keys[0]: full_configuration.executor.warning( "{} is deprecated; migrate to {}".format(tool_key, keys[0]) ) return tool_key
[ "def", "choose_tool_key", "(", "full_configuration", ",", "keys", ")", ":", "tool_key", "=", "_choose_key", "(", "full_configuration", ".", "config", ",", "keys", ")", "if", "tool_key", "!=", "keys", "[", "0", "]", ":", "full_configuration", ".", "executor", ...
Select the key for a tool from a list of supported tools.
[ "Select", "the", "key", "for", "a", "tool", "from", "a", "list", "of", "supported", "tools", "." ]
[ "\"\"\"\n Select the key for a tool from a list of supported tools.\n\n This function is designed to help when multiple keys can be used to specify\n an option (e.g., during migration from one name to another). The values in\n keys should be ordered based on preference, as that's the order they'll be\n...
[ { "param": "full_configuration", "type": null }, { "param": "keys", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "full_configuration", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "keys", "type": null, "docstring": null, "docstr...
3d3f11f3f5730fff674074b3241f83d98a9fd646
dev-pipeline/devpipeline-core
lib/devpipeline_core/toolsupport.py
[ "BSD-2-Clause" ]
Python
tool_builder
<not_specific>
def tool_builder(component, key, tool_map, *args): """This helper function initializes a tool with the given args.""" # pylint: disable=protected-access tool_name = component.get(key) if tool_name: tool_fn = tool_map.get(tool_name) if tool_fn: return tool_fn[0](*args) ...
This helper function initializes a tool with the given args.
This helper function initializes a tool with the given args.
[ "This", "helper", "function", "initializes", "a", "tool", "with", "the", "given", "args", "." ]
def tool_builder(component, key, tool_map, *args): tool_name = component.get(key) if tool_name: tool_fn = tool_map.get(tool_name) if tool_fn: return tool_fn[0](*args) raise Exception("Unknown {} '{}' for {}".format(key, tool_name, component.name)) raise MissingToolKey(key...
[ "def", "tool_builder", "(", "component", ",", "key", ",", "tool_map", ",", "*", "args", ")", ":", "tool_name", "=", "component", ".", "get", "(", "key", ")", "if", "tool_name", ":", "tool_fn", "=", "tool_map", ".", "get", "(", "tool_name", ")", "if", ...
This helper function initializes a tool with the given args.
[ "This", "helper", "function", "initializes", "a", "tool", "with", "the", "given", "args", "." ]
[ "\"\"\"This helper function initializes a tool with the given args.\"\"\"", "# pylint: disable=protected-access" ]
[ { "param": "component", "type": null }, { "param": "key", "type": null }, { "param": "tool_map", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "component", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "key", "type": null, "docstring": null, "docstring_tokens...
3d3f11f3f5730fff674074b3241f83d98a9fd646
dev-pipeline/devpipeline-core
lib/devpipeline_core/toolsupport.py
[ "BSD-2-Clause" ]
Python
join
<not_specific>
def join(self, vals): """ Either return the non-list value or raise an Exception. Arguments: vals - a list of values to process """ if len(vals) == 1: return vals[0] raise Exception( "Too many values for {}:{}".format(self._component_name,...
Either return the non-list value or raise an Exception. Arguments: vals - a list of values to process
Either return the non-list value or raise an Exception. Arguments: vals - a list of values to process
[ "Either", "return", "the", "non", "-", "list", "value", "or", "raise", "an", "Exception", ".", "Arguments", ":", "vals", "-", "a", "list", "of", "values", "to", "process" ]
def join(self, vals): if len(vals) == 1: return vals[0] raise Exception( "Too many values for {}:{}".format(self._component_name, self._key) )
[ "def", "join", "(", "self", ",", "vals", ")", ":", "if", "len", "(", "vals", ")", "==", "1", ":", "return", "vals", "[", "0", "]", "raise", "Exception", "(", "\"Too many values for {}:{}\"", ".", "format", "(", "self", ".", "_component_name", ",", "sel...
Either return the non-list value or raise an Exception.
[ "Either", "return", "the", "non", "-", "list", "value", "or", "raise", "an", "Exception", "." ]
[ "\"\"\"\n Either return the non-list value or raise an Exception.\n\n Arguments:\n vals - a list of values to process\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "vals", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "vals", "type": null, "docstring": null, "docstring_tokens": [...
3d3f11f3f5730fff674074b3241f83d98a9fd646
dev-pipeline/devpipeline-core
lib/devpipeline_core/toolsupport.py
[ "BSD-2-Clause" ]
Python
args_builder
null
def args_builder(prefix, current_target, args_dict, value_found_fn): """ Process arguments a tool cares about. Since most tools require configuration, this function helps deal with the boilerplate. Each option will be processed based on all modifications supported by dev-pipeline (i.e., profiles a...
Process arguments a tool cares about. Since most tools require configuration, this function helps deal with the boilerplate. Each option will be processed based on all modifications supported by dev-pipeline (i.e., profiles and overrides) in the proper order. Arguments: prefix -- The pre...
Process arguments a tool cares about. Since most tools require configuration, this function helps deal with the boilerplate. Each option will be processed based on all modifications supported by dev-pipeline in the proper order. - The prefix for each argument. This will be applied to everything in args_dict. curren...
[ "Process", "arguments", "a", "tool", "cares", "about", ".", "Since", "most", "tools", "require", "configuration", "this", "function", "helps", "deal", "with", "the", "boilerplate", ".", "Each", "option", "will", "be", "processed", "based", "on", "all", "modifi...
def args_builder(prefix, current_target, args_dict, value_found_fn): current_config = current_target.config for key, separator in args_dict.items(): option = "{}.{}".format(prefix, key) value = current_config.get_list(option) if value: if separator is None: se...
[ "def", "args_builder", "(", "prefix", ",", "current_target", ",", "args_dict", ",", "value_found_fn", ")", ":", "current_config", "=", "current_target", ".", "config", "for", "key", ",", "separator", "in", "args_dict", ".", "items", "(", ")", ":", "option", ...
Process arguments a tool cares about.
[ "Process", "arguments", "a", "tool", "cares", "about", "." ]
[ "\"\"\"\n Process arguments a tool cares about.\n\n Since most tools require configuration, this function helps deal with the\n boilerplate. Each option will be processed based on all modifications\n supported by dev-pipeline (i.e., profiles and overrides) in the proper\n order.\n\n Arguments:\n ...
[ { "param": "prefix", "type": null }, { "param": "current_target", "type": null }, { "param": "args_dict", "type": null }, { "param": "value_found_fn", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "prefix", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "current_target", "type": null, "docstring": null, "docstrin...
3d3f11f3f5730fff674074b3241f83d98a9fd646
dev-pipeline/devpipeline-core
lib/devpipeline_core/toolsupport.py
[ "BSD-2-Clause" ]
Python
build_flex_args_keys
<not_specific>
def build_flex_args_keys(components): """ Helper function to build a list of options. Some tools require require variations of the same options (e.g., cflags for debug vs release builds), but manually creating those options is cumbersome and error-prone. This function handles that work by combinin...
Helper function to build a list of options. Some tools require require variations of the same options (e.g., cflags for debug vs release builds), but manually creating those options is cumbersome and error-prone. This function handles that work by combining all possible comintations of the values...
Helper function to build a list of options. Some tools require require variations of the same options , but manually creating those options is cumbersome and error-prone. This function handles that work by combining all possible comintations of the values in components. Arguments components -- A list of lists that sh...
[ "Helper", "function", "to", "build", "a", "list", "of", "options", ".", "Some", "tools", "require", "require", "variations", "of", "the", "same", "options", "but", "manually", "creating", "those", "options", "is", "cumbersome", "and", "error", "-", "prone", ...
def build_flex_args_keys(components): def _prepend_first(components, sub_components): ret = [] for first in components[0]: for sub_component in sub_components: ret.append("{}.{}".format(first, sub_component)) return ret if len(components) > 1: sub_comp...
[ "def", "build_flex_args_keys", "(", "components", ")", ":", "def", "_prepend_first", "(", "components", ",", "sub_components", ")", ":", "ret", "=", "[", "]", "for", "first", "in", "components", "[", "0", "]", ":", "for", "sub_component", "in", "sub_componen...
Helper function to build a list of options.
[ "Helper", "function", "to", "build", "a", "list", "of", "options", "." ]
[ "\"\"\"\n Helper function to build a list of options.\n\n Some tools require require variations of the same options (e.g., cflags\n for debug vs release builds), but manually creating those options is\n cumbersome and error-prone. This function handles that work by combining\n all possible comintati...
[ { "param": "components", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "components", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
5bec0542b63c79d43d18d57bb25f5a5d6eeb75d3
dev-pipeline/devpipeline-core
lib/devpipeline_core/env.py
[ "BSD-2-Clause" ]
Python
create_environment
<not_specific>
def create_environment(component_config): """ Create a modified environment. Arguments component_config - The configuration for a component. """ ret = os.environ.copy() for env in component_config.get_list("dp.env_list"): real_env = env.upper() value = os.environ.get(real_en...
Create a modified environment. Arguments component_config - The configuration for a component.
Create a modified environment. Arguments component_config - The configuration for a component.
[ "Create", "a", "modified", "environment", ".", "Arguments", "component_config", "-", "The", "configuration", "for", "a", "component", "." ]
def create_environment(component_config): ret = os.environ.copy() for env in component_config.get_list("dp.env_list"): real_env = env.upper() value = os.environ.get(real_env) value = _prepend_env(component_config, env, value) value = _append_env(component_config, env, value) ...
[ "def", "create_environment", "(", "component_config", ")", ":", "ret", "=", "os", ".", "environ", ".", "copy", "(", ")", "for", "env", "in", "component_config", ".", "get_list", "(", "\"dp.env_list\"", ")", ":", "real_env", "=", "env", ".", "upper", "(", ...
Create a modified environment.
[ "Create", "a", "modified", "environment", "." ]
[ "\"\"\"\n Create a modified environment.\n\n Arguments\n component_config - The configuration for a component.\n \"\"\"" ]
[ { "param": "component_config", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "component_config", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
7c183d5332d94c51f7e636e7a16b1487e99a7647
dev-pipeline/devpipeline-core
lib/devpipeline_core/paths.py
[ "BSD-2-Clause" ]
Python
make_path
<not_specific>
def make_path(config, *endings): """ Create a path based on component configuration. All paths are relative to the component's configuration directory; usually this will be the same for an entire session, but this function supuports component-specific configuration directories. Arguments: ...
Create a path based on component configuration. All paths are relative to the component's configuration directory; usually this will be the same for an entire session, but this function supuports component-specific configuration directories. Arguments: config - the configuration object for a ...
Create a path based on component configuration. All paths are relative to the component's configuration directory; usually this will be the same for an entire session, but this function supuports component-specific configuration directories. the configuration object for a component endings - a list of file paths to ap...
[ "Create", "a", "path", "based", "on", "component", "configuration", ".", "All", "paths", "are", "relative", "to", "the", "component", "'", "s", "configuration", "directory", ";", "usually", "this", "will", "be", "the", "same", "for", "an", "entire", "session...
def make_path(config, *endings): config_dir = config.get("dp.config_dir") return os.path.join(config_dir, *endings)
[ "def", "make_path", "(", "config", ",", "*", "endings", ")", ":", "config_dir", "=", "config", ".", "get", "(", "\"dp.config_dir\"", ")", "return", "os", ".", "path", ".", "join", "(", "config_dir", ",", "*", "endings", ")" ]
Create a path based on component configuration.
[ "Create", "a", "path", "based", "on", "component", "configuration", "." ]
[ "\"\"\"\n Create a path based on component configuration.\n\n All paths are relative to the component's configuration directory; usually\n this will be the same for an entire session, but this function supuports\n component-specific configuration directories.\n\n Arguments:\n config - the configur...
[ { "param": "config", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "config", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0ef39da0a2a76db33b95e6884b59ab0af069f248
dev-pipeline/devpipeline-core
lib/devpipeline_core/executor.py
[ "BSD-2-Clause" ]
Python
message
null
def message(self, msg): # pylint: disable=no-self-use """ Display a message to the user. Arguments msg - the message to display """ print(msg)
Display a message to the user. Arguments msg - the message to display
Display a message to the user. Arguments msg - the message to display
[ "Display", "a", "message", "to", "the", "user", ".", "Arguments", "msg", "-", "the", "message", "to", "display" ]
def message(self, msg): print(msg)
[ "def", "message", "(", "self", ",", "msg", ")", ":", "print", "(", "msg", ")" ]
Display a message to the user.
[ "Display", "a", "message", "to", "the", "user", "." ]
[ "# pylint: disable=no-self-use", "\"\"\"\n Display a message to the user.\n\n Arguments\n msg - the message to display\n \"\"\"" ]
[ { "param": "self", "type": null }, { "param": "msg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "msg", "type": null, "docstring": null, "docstring_tokens": []...
0ef39da0a2a76db33b95e6884b59ab0af069f248
dev-pipeline/devpipeline-core
lib/devpipeline_core/executor.py
[ "BSD-2-Clause" ]
Python
error
null
def error(self, msg): # pylint: disable=no-self-use """ Display an error message to the user. An error means a critical failure has occurred and the tool that raised it cannot recover. In most cases, errors mean termination will cease. Arguments msg - the error...
Display an error message to the user. An error means a critical failure has occurred and the tool that raised it cannot recover. In most cases, errors mean termination will cease. Arguments msg - the error message
Display an error message to the user. An error means a critical failure has occurred and the tool that raised it cannot recover. In most cases, errors mean termination will cease. Arguments msg - the error message
[ "Display", "an", "error", "message", "to", "the", "user", ".", "An", "error", "means", "a", "critical", "failure", "has", "occurred", "and", "the", "tool", "that", "raised", "it", "cannot", "recover", ".", "In", "most", "cases", "errors", "mean", "terminat...
def error(self, msg): print("ERROR: {}".format(msg))
[ "def", "error", "(", "self", ",", "msg", ")", ":", "print", "(", "\"ERROR: {}\"", ".", "format", "(", "msg", ")", ")" ]
Display an error message to the user.
[ "Display", "an", "error", "message", "to", "the", "user", "." ]
[ "# pylint: disable=no-self-use", "\"\"\"\n Display an error message to the user.\n\n An error means a critical failure has occurred and the tool that raised\n it cannot recover. In most cases, errors mean termination will cease.\n\n Arguments\n msg - the error message\n ...
[ { "param": "self", "type": null }, { "param": "msg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "msg", "type": null, "docstring": null, "docstring_tokens": []...
0ef39da0a2a76db33b95e6884b59ab0af069f248
dev-pipeline/devpipeline-core
lib/devpipeline_core/executor.py
[ "BSD-2-Clause" ]
Python
warning
null
def warning(self, msg): # pylint: disable=no-self-use """ Display an warning message to the user. Warnings are used to convey problems that occurred, but don't represent a critical failure. In most cases, warnings won't prevent regular execution. Arguments ...
Display an warning message to the user. Warnings are used to convey problems that occurred, but don't represent a critical failure. In most cases, warnings won't prevent regular execution. Arguments msg - the warning message
Display an warning message to the user. Warnings are used to convey problems that occurred, but don't represent a critical failure. In most cases, warnings won't prevent regular execution. Arguments msg - the warning message
[ "Display", "an", "warning", "message", "to", "the", "user", ".", "Warnings", "are", "used", "to", "convey", "problems", "that", "occurred", "but", "don", "'", "t", "represent", "a", "critical", "failure", ".", "In", "most", "cases", "warnings", "won", "'",...
def warning(self, msg): print("WARNING: {}".format(msg))
[ "def", "warning", "(", "self", ",", "msg", ")", ":", "print", "(", "\"WARNING: {}\"", ".", "format", "(", "msg", ")", ")" ]
Display an warning message to the user.
[ "Display", "an", "warning", "message", "to", "the", "user", "." ]
[ "# pylint: disable=no-self-use", "\"\"\"\n Display an warning message to the user.\n\n Warnings are used to convey problems that occurred, but don't represent\n a critical failure. In most cases, warnings won't prevent regular\n execution.\n\n Arguments\n msg - the warni...
[ { "param": "self", "type": null }, { "param": "msg", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "msg", "type": null, "docstring": null, "docstring_tokens": []...
0ef39da0a2a76db33b95e6884b59ab0af069f248
dev-pipeline/devpipeline-core
lib/devpipeline_core/executor.py
[ "BSD-2-Clause" ]
Python
execute
null
def execute(self, environment, *args): # pylint: disable=no-self-use """ Execute a series of commands. Arguments: environment - a dictionary-like object containing the environment commands should be executed in args - A list of dictionaries to pass ...
Execute a series of commands. Arguments: environment - a dictionary-like object containing the environment commands should be executed in args - A list of dictionaries to pass to subprocess calls.
Execute a series of commands. Arguments: environment - a dictionary-like object containing the environment commands should be executed in args - A list of dictionaries to pass to subprocess calls.
[ "Execute", "a", "series", "of", "commands", ".", "Arguments", ":", "environment", "-", "a", "dictionary", "-", "like", "object", "containing", "the", "environment", "commands", "should", "be", "executed", "in", "args", "-", "A", "list", "of", "dictionaries", ...
def execute(self, environment, *args): for cmd in args: _execute_single(environment, **cmd)
[ "def", "execute", "(", "self", ",", "environment", ",", "*", "args", ")", ":", "for", "cmd", "in", "args", ":", "_execute_single", "(", "environment", ",", "**", "cmd", ")" ]
Execute a series of commands.
[ "Execute", "a", "series", "of", "commands", "." ]
[ "# pylint: disable=no-self-use", "\"\"\"\n Execute a series of commands.\n\n Arguments:\n environment - a dictionary-like object containing the environment\n commands should be executed in\n args - A list of dictionaries to pass to subprocess calls.\n \"\"\"...
[ { "param": "self", "type": null }, { "param": "environment", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "environment", "type": null, "docstring": null, "docstring_tok...
044bd898ea0e5bf9ebf809d899b837c371138d8e
jambonsw/django-url-checks
src/url_checks/apps.py
[ "BSD-2-Clause" ]
Python
ready
null
def ready(self): """Import checks once apps are loaded Note that the register decorator does the actual work of informing Django about the check. """ from .checks import check_url
Import checks once apps are loaded Note that the register decorator does the actual work of informing Django about the check.
Import checks once apps are loaded Note that the register decorator does the actual work of informing Django about the check.
[ "Import", "checks", "once", "apps", "are", "loaded", "Note", "that", "the", "register", "decorator", "does", "the", "actual", "work", "of", "informing", "Django", "about", "the", "check", "." ]
def ready(self): from .checks import check_url
[ "def", "ready", "(", "self", ")", ":", "from", ".", "checks", "import", "check_url" ]
Import checks once apps are loaded Note that the register decorator does the actual work of informing Django about the check.
[ "Import", "checks", "once", "apps", "are", "loaded", "Note", "that", "the", "register", "decorator", "does", "the", "actual", "work", "of", "informing", "Django", "about", "the", "check", "." ]
[ "\"\"\"Import checks once apps are loaded\n\n Note that the register decorator does the actual work of\n informing Django about the check.\n \"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
847c3e3c9c44054e7f9bbef9f6b86a86cac0d108
jambonsw/django-url-checks
src/url_checks/messages.py
[ "BSD-2-Clause" ]
Python
build_messages
<not_specific>
def build_messages(app_name, Message, message_list): """Build messages dictionary of specific type""" letter = get_message_letter(Message) return { msg.var: partial( Message, id=f"{app_name}.{letter}{i:0{3}}", **omit_keys("var", msg._asdict()), ) f...
Build messages dictionary of specific type
Build messages dictionary of specific type
[ "Build", "messages", "dictionary", "of", "specific", "type" ]
def build_messages(app_name, Message, message_list): letter = get_message_letter(Message) return { msg.var: partial( Message, id=f"{app_name}.{letter}{i:0{3}}", **omit_keys("var", msg._asdict()), ) for i, msg in enumerate(message_list, start=1) }
[ "def", "build_messages", "(", "app_name", ",", "Message", ",", "message_list", ")", ":", "letter", "=", "get_message_letter", "(", "Message", ")", "return", "{", "msg", ".", "var", ":", "partial", "(", "Message", ",", "id", "=", "f\"{app_name}.{letter}{i:0{3}}...
Build messages dictionary of specific type
[ "Build", "messages", "dictionary", "of", "specific", "type" ]
[ "\"\"\"Build messages dictionary of specific type\"\"\"" ]
[ { "param": "app_name", "type": null }, { "param": "Message", "type": null }, { "param": "message_list", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "app_name", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "Message", "type": null, "docstring": null, "docstring_tok...
bd08e5e520fe44445e9cbc6e821d9af3cac1622c
jambonsw/django-url-checks
src/url_checks/checks.py
[ "BSD-2-Clause" ]
Python
_get_url_tree
<not_specific>
def _get_url_tree(): """Get Root URL Configuration for project""" try: url_mod_dot_path = settings.ROOT_URLCONF except AttributeError: return (None, [MESSAGES.URLCONF_NOT_DEFINED()]) try: url_mod = import_module(url_mod_dot_path) except AttributeError: return (None, [...
Get Root URL Configuration for project
Get Root URL Configuration for project
[ "Get", "Root", "URL", "Configuration", "for", "project" ]
def _get_url_tree(): try: url_mod_dot_path = settings.ROOT_URLCONF except AttributeError: return (None, [MESSAGES.URLCONF_NOT_DEFINED()]) try: url_mod = import_module(url_mod_dot_path) except AttributeError: return (None, [MESSAGES.URLCONF_WRONG_FORMAT()]) except Modu...
[ "def", "_get_url_tree", "(", ")", ":", "try", ":", "url_mod_dot_path", "=", "settings", ".", "ROOT_URLCONF", "except", "AttributeError", ":", "return", "(", "None", ",", "[", "MESSAGES", ".", "URLCONF_NOT_DEFINED", "(", ")", "]", ")", "try", ":", "url_mod", ...
Get Root URL Configuration for project
[ "Get", "Root", "URL", "Configuration", "for", "project" ]
[ "\"\"\"Get Root URL Configuration for project\"\"\"" ]
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
bd08e5e520fe44445e9cbc6e821d9af3cac1622c
jambonsw/django-url-checks
src/url_checks/checks.py
[ "BSD-2-Clause" ]
Python
_check_path
<not_specific>
def _check_path(path, namespace): """Verify that a single path ends with a slash""" pattern = str(path.pattern) if len(pattern) > 0 and not pattern.endswith(("/", "/$")): name = f"{namespace}:{path.name}" if namespace else path.name return MESSAGES.NO_SLASH_PATTERN( hint=f'Add sl...
Verify that a single path ends with a slash
Verify that a single path ends with a slash
[ "Verify", "that", "a", "single", "path", "ends", "with", "a", "slash" ]
def _check_path(path, namespace): pattern = str(path.pattern) if len(pattern) > 0 and not pattern.endswith(("/", "/$")): name = f"{namespace}:{path.name}" if namespace else path.name return MESSAGES.NO_SLASH_PATTERN( hint=f'Add slash to end of path "{pattern}", named "{name}"' ...
[ "def", "_check_path", "(", "path", ",", "namespace", ")", ":", "pattern", "=", "str", "(", "path", ".", "pattern", ")", "if", "len", "(", "pattern", ")", ">", "0", "and", "not", "pattern", ".", "endswith", "(", "(", "\"/\"", ",", "\"/$\"", ")", ")"...
Verify that a single path ends with a slash
[ "Verify", "that", "a", "single", "path", "ends", "with", "a", "slash" ]
[ "\"\"\"Verify that a single path ends with a slash\"\"\"" ]
[ { "param": "path", "type": null }, { "param": "namespace", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "namespace", "type": null, "docstring": null, "docstring_token...
bd08e5e520fe44445e9cbc6e821d9af3cac1622c
jambonsw/django-url-checks
src/url_checks/checks.py
[ "BSD-2-Clause" ]
Python
_check_resolver
<not_specific>
def _check_resolver(path, namespace): """Verify that an include path ends with a slash""" pattern = str(path.pattern) if len(pattern) > 0 and not pattern.endswith(("/", "/$")): return MESSAGES.NO_SLASH_RESOLVER( hint=f'Add slash to end of include path "{pattern}"' )
Verify that an include path ends with a slash
Verify that an include path ends with a slash
[ "Verify", "that", "an", "include", "path", "ends", "with", "a", "slash" ]
def _check_resolver(path, namespace): pattern = str(path.pattern) if len(pattern) > 0 and not pattern.endswith(("/", "/$")): return MESSAGES.NO_SLASH_RESOLVER( hint=f'Add slash to end of include path "{pattern}"' )
[ "def", "_check_resolver", "(", "path", ",", "namespace", ")", ":", "pattern", "=", "str", "(", "path", ".", "pattern", ")", "if", "len", "(", "pattern", ")", ">", "0", "and", "not", "pattern", ".", "endswith", "(", "(", "\"/\"", ",", "\"/$\"", ")", ...
Verify that an include path ends with a slash
[ "Verify", "that", "an", "include", "path", "ends", "with", "a", "slash" ]
[ "\"\"\"Verify that an include path ends with a slash\"\"\"" ]
[ { "param": "path", "type": null }, { "param": "namespace", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "path", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "namespace", "type": null, "docstring": null, "docstring_token...
bd08e5e520fe44445e9cbc6e821d9af3cac1622c
jambonsw/django-url-checks
src/url_checks/checks.py
[ "BSD-2-Clause" ]
Python
_check_path_tree
<not_specific>
def _check_path_tree(url_tree, namespace=None): """Provide error for each URI pattern missing a / at end""" errors = [] for path in url_tree: if isinstance(path, URLPattern): msg = _check_path(path, namespace) if msg: errors.append(msg) elif isinstance...
Provide error for each URI pattern missing a / at end
Provide error for each URI pattern missing a / at end
[ "Provide", "error", "for", "each", "URI", "pattern", "missing", "a", "/", "at", "end" ]
def _check_path_tree(url_tree, namespace=None): errors = [] for path in url_tree: if isinstance(path, URLPattern): msg = _check_path(path, namespace) if msg: errors.append(msg) elif isinstance(path, URLResolver): new_namespace = ( ...
[ "def", "_check_path_tree", "(", "url_tree", ",", "namespace", "=", "None", ")", ":", "errors", "=", "[", "]", "for", "path", "in", "url_tree", ":", "if", "isinstance", "(", "path", ",", "URLPattern", ")", ":", "msg", "=", "_check_path", "(", "path", ",...
Provide error for each URI pattern missing a / at end
[ "Provide", "error", "for", "each", "URI", "pattern", "missing", "a", "/", "at", "end" ]
[ "\"\"\"Provide error for each URI pattern missing a / at end\"\"\"" ]
[ { "param": "url_tree", "type": null }, { "param": "namespace", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "url_tree", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "namespace", "type": null, "docstring": null, "docstring_t...
be2ddea0171bb69043893433c4e267e9349918c4
lilianluong/demessifyme
demessifyme/doc2vec.py
[ "MIT" ]
Python
tokenize
<not_specific>
def tokenize(text): """ Split text into tokens, removing punctuation and replacing numbers with $number tokens. :param text: text to tokenize :return: list of tokens """ for punc in punctuation: text = text.replace(punc, " ") # for number in "0123456789": # text = text.repla...
Split text into tokens, removing punctuation and replacing numbers with $number tokens. :param text: text to tokenize :return: list of tokens
Split text into tokens, removing punctuation and replacing numbers with $number tokens.
[ "Split", "text", "into", "tokens", "removing", "punctuation", "and", "replacing", "numbers", "with", "$number", "tokens", "." ]
def tokenize(text): for punc in punctuation: text = text.replace(punc, " ") tokens = [("$number" if s.isnumeric() else s) for s in text.lower().split()] return tokens
[ "def", "tokenize", "(", "text", ")", ":", "for", "punc", "in", "punctuation", ":", "text", "=", "text", ".", "replace", "(", "punc", ",", "\" \"", ")", "tokens", "=", "[", "(", "\"$number\"", "if", "s", ".", "isnumeric", "(", ")", "else", "s", ")",...
Split text into tokens, removing punctuation and replacing numbers with $number tokens.
[ "Split", "text", "into", "tokens", "removing", "punctuation", "and", "replacing", "numbers", "with", "$number", "tokens", "." ]
[ "\"\"\"\n Split text into tokens, removing punctuation and replacing numbers with $number tokens.\n\n :param text: text to tokenize\n :return: list of tokens\n \"\"\"", "# for number in \"0123456789\":", "# text = text.replace(number, \" number \")", "# tokens = word_tokenize(text)" ]
[ { "param": "text", "type": null } ]
{ "returns": [ { "docstring": "list of tokens", "docstring_tokens": [ "list", "of", "tokens" ], "type": null } ], "raises": [], "params": [ { "identifier": "text", "type": null, "docstring": "text to tokenize", "docstring_tokens...
be2ddea0171bb69043893433c4e267e9349918c4
lilianluong/demessifyme
demessifyme/doc2vec.py
[ "MIT" ]
Python
embed_document
<not_specific>
def embed_document(text): """ Return a 300-dim embedding of text. :param text: String, text to embed :return: numpy array with shape=(300,), dtype=np.float """ tokens = tokenize(text) embedding = np.zeros((300,)) num_tokens = 0 for token in tokens: if token in eng_stopwords:...
Return a 300-dim embedding of text. :param text: String, text to embed :return: numpy array with shape=(300,), dtype=np.float
Return a 300-dim embedding of text.
[ "Return", "a", "300", "-", "dim", "embedding", "of", "text", "." ]
def embed_document(text): tokens = tokenize(text) embedding = np.zeros((300,)) num_tokens = 0 for token in tokens: if token in eng_stopwords: continue num_tokens += 1 if token not in model: if token not in custom_model: custom_model[token] ...
[ "def", "embed_document", "(", "text", ")", ":", "tokens", "=", "tokenize", "(", "text", ")", "embedding", "=", "np", ".", "zeros", "(", "(", "300", ",", ")", ")", "num_tokens", "=", "0", "for", "token", "in", "tokens", ":", "if", "token", "in", "en...
Return a 300-dim embedding of text.
[ "Return", "a", "300", "-", "dim", "embedding", "of", "text", "." ]
[ "\"\"\"\n Return a 300-dim embedding of text.\n\n :param text: String, text to embed\n :return: numpy array with shape=(300,), dtype=np.float\n \"\"\"", "# token doesn't exist in the model, for now skip", "# future approach: generate random vector and save it", "# print(token)" ]
[ { "param": "text", "type": null } ]
{ "returns": [ { "docstring": "numpy array with shape=(300,), dtype=np.float", "docstring_tokens": [ "numpy", "array", "with", "shape", "=", "(", "300", ")", "dtype", "=", "np", ".", "float" ]...
db694bf53f840103bbeceda4150adf7b233993c5
OCESS/cs493
orbitx/physics/electroconstants.py
[ "MIT" ]
Python
_use_orbitv_constants
null
def _use_orbitv_constants(name: str, hab_component: bool, power_inefficiency: float, passive_heat_loss: float, secondary_loop_conductivity: float, primary_loop_conductivity: float, resting_temperature: float): """Helper only for use in this file. Values here were ...
Helper only for use in this file. Values here were just imported from obitsej.txt. That's why this function is allowed to be so ugly.
Helper only for use in this file. Values here were just imported from obitsej.txt. That's why this function is allowed to be so ugly.
[ "Helper", "only", "for", "use", "in", "this", "file", ".", "Values", "here", "were", "just", "imported", "from", "obitsej", ".", "txt", ".", "That", "'", "s", "why", "this", "function", "is", "allowed", "to", "be", "so", "ugly", "." ]
def _use_orbitv_constants(name: str, hab_component: bool, power_inefficiency: float, passive_heat_loss: float, secondary_loop_conductivity: float, primary_loop_conductivity: float, resting_temperature: float): POWER_INEFFICIENCY[strings.COMPONENT_NAMES.index(name)...
[ "def", "_use_orbitv_constants", "(", "name", ":", "str", ",", "hab_component", ":", "bool", ",", "power_inefficiency", ":", "float", ",", "passive_heat_loss", ":", "float", ",", "secondary_loop_conductivity", ":", "float", ",", "primary_loop_conductivity", ":", "flo...
Helper only for use in this file.
[ "Helper", "only", "for", "use", "in", "this", "file", "." ]
[ "\"\"\"Helper only for use in this file. Values here were just imported from obitsej.txt.\n That's why this function is allowed to be so ugly.\"\"\"", "# Note: we're modifying globals here. We don't need a `global` statement", "# since we're only modifying elements of an array, but just pointing it out.", ...
[ { "param": "name", "type": "str" }, { "param": "hab_component", "type": "bool" }, { "param": "power_inefficiency", "type": "float" }, { "param": "passive_heat_loss", "type": "float" }, { "param": "secondary_loop_conductivity", "type": "float" }, { "par...
{ "returns": [], "raises": [], "params": [ { "identifier": "name", "type": "str", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "hab_component", "type": "bool", "docstring": null, "docstrin...
619b62c671920486bb1ced046eba8c4786ce0ee5
OCESS/cs493
orbitx/physics/electrofunctions.py
[ "MIT" ]
Python
bus_electricity
OhmicVars
def bus_electricity(component_resistances: np.ndarray) -> OhmicVars: """Given resistances for each component, calculate the V, I, R for the electrical bus as a whole.""" # Calculate 1/resistance for each component, then sum them all up into a single scalar. # We shouldn't have to guard against divide-by-ze...
Given resistances for each component, calculate the V, I, R for the electrical bus as a whole.
Given resistances for each component, calculate the V, I, R for the electrical bus as a whole.
[ "Given", "resistances", "for", "each", "component", "calculate", "the", "V", "I", "R", "for", "the", "electrical", "bus", "as", "a", "whole", "." ]
def bus_electricity(component_resistances: np.ndarray) -> OhmicVars: sum_of_reciprocals = np.sum(np.reciprocal(component_resistances)) if sum_of_reciprocals == 0: return OhmicVars(resistance=np.inf, current=0, voltage=electroconstants.NOMINAL_BUS_VOLTAGE) bus_resistance = 1/sum_of_reciprocals bu...
[ "def", "bus_electricity", "(", "component_resistances", ":", "np", ".", "ndarray", ")", "->", "OhmicVars", ":", "sum_of_reciprocals", "=", "np", ".", "sum", "(", "np", ".", "reciprocal", "(", "component_resistances", ")", ")", "if", "sum_of_reciprocals", "==", ...
Given resistances for each component, calculate the V, I, R for the electrical bus as a whole.
[ "Given", "resistances", "for", "each", "component", "calculate", "the", "V", "I", "R", "for", "the", "electrical", "bus", "as", "a", "whole", "." ]
[ "\"\"\"Given resistances for each component, calculate the V, I, R for the electrical bus as a whole.\"\"\"", "# Calculate 1/resistance for each component, then sum them all up into a single scalar.", "# We shouldn't have to guard against divide-by-zero here, because resistances shouldn't", "# be zero. If we ...
[ { "param": "component_resistances", "type": "np.ndarray" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "component_resistances", "type": "np.ndarray", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
619b62c671920486bb1ced046eba8c4786ce0ee5
OCESS/cs493
orbitx/physics/electrofunctions.py
[ "MIT" ]
Python
component_resistances
np.ndarray
def component_resistances(y: EngineeringState) -> np.ndarray: """Returns an array of each component's effective resistance. If a component is not connected to the bus, or it has been set to 0% capacity, it will have infinite resistance.""" # This is a per-component list of scalars. # A value of 1 m...
Returns an array of each component's effective resistance. If a component is not connected to the bus, or it has been set to 0% capacity, it will have infinite resistance.
Returns an array of each component's effective resistance. If a component is not connected to the bus, or it has been set to 0% capacity, it will have infinite resistance.
[ "Returns", "an", "array", "of", "each", "component", "'", "s", "effective", "resistance", ".", "If", "a", "component", "is", "not", "connected", "to", "the", "bus", "or", "it", "has", "been", "set", "to", "0%", "capacity", "it", "will", "have", "infinite...
def component_resistances(y: EngineeringState) -> np.ndarray: component_capacities = y.components.Connected() * y.components.Capacities() component_resistances_assuming_full_capacity = ( electroconstants.BASE_COMPONENT_RESISTANCES + electroconstants.ALPHA_RESIST_GAIN * y.components.Temperatures(...
[ "def", "component_resistances", "(", "y", ":", "EngineeringState", ")", "->", "np", ".", "ndarray", ":", "component_capacities", "=", "y", ".", "components", ".", "Connected", "(", ")", "*", "y", ".", "components", ".", "Capacities", "(", ")", "component_res...
Returns an array of each component's effective resistance.
[ "Returns", "an", "array", "of", "each", "component", "'", "s", "effective", "resistance", "." ]
[ "\"\"\"Returns an array of each component's effective resistance.\n If a component is not connected to the bus, or it has been set\n to 0% capacity, it will have infinite resistance.\"\"\"", "# This is a per-component list of scalars.", "# A value of 1 means a component is 'on' and at 100% capacity.", "...
[ { "param": "y", "type": "EngineeringState" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "y", "type": "EngineeringState", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
c5821919ad28e7f7f52b5b49f050b046f68e773e
OCESS/cs493
orbitx/physics/ode_solver.py
[ "MIT" ]
Python
simulation_differential_function
np.ndarray
def simulation_differential_function( t: float, y_1d: np.ndarray, pass_through_state: PhysicalState, masses: np.ndarray, artificials: np.ndarray ) -> np.ndarray: """ Given the state of a simulation, calculate its instantaneous rate-of-change. This function is probably one of the most important ...
Given the state of a simulation, calculate its instantaneous rate-of-change. This function is probably one of the most important ones in OrbitX :) Everything from "an object with a velocity will change position" to "the habitat reactor heats up when it's being used" is encoded here. This function...
Given the state of a simulation, calculate its instantaneous rate-of-change. This function is probably one of the most important ones in OrbitX :) Everything from "an object with a velocity will change position" to "the habitat reactor heats up when it's being used" is encoded here. This function is used by scipy.solv...
[ "Given", "the", "state", "of", "a", "simulation", "calculate", "its", "instantaneous", "rate", "-", "of", "-", "change", ".", "This", "function", "is", "probably", "one", "of", "the", "most", "important", "ones", "in", "OrbitX", ":", ")", "Everything", "fr...
def simulation_differential_function( t: float, y_1d: np.ndarray, pass_through_state: PhysicalState, masses: np.ndarray, artificials: np.ndarray ) -> np.ndarray: y = PhysicsState(y_1d, pass_through_state) acc_matrix = calc.grav_acc(y.X, y.Y, masses, y.Fuel) zeros = np.zeros(y._n) fuel_cons =...
[ "def", "simulation_differential_function", "(", "t", ":", "float", ",", "y_1d", ":", "np", ".", "ndarray", ",", "pass_through_state", ":", "PhysicalState", ",", "masses", ":", "np", ".", "ndarray", ",", "artificials", ":", "np", ".", "ndarray", ")", "->", ...
Given the state of a simulation, calculate its instantaneous rate-of-change.
[ "Given", "the", "state", "of", "a", "simulation", "calculate", "its", "instantaneous", "rate", "-", "of", "-", "change", "." ]
[ "\"\"\"\n Given the state of a simulation, calculate its instantaneous rate-of-change.\n\n This function is probably one of the most important ones in OrbitX :)\n Everything from \"an object with a velocity will change position\" to\n \"the habitat reactor heats up when it's being used\" is encoded here...
[ { "param": "t", "type": "float" }, { "param": "y_1d", "type": "np.ndarray" }, { "param": "pass_through_state", "type": "PhysicalState" }, { "param": "masses", "type": "np.ndarray" }, { "param": "artificials", "type": "np.ndarray" } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "t", "type": "float", "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "y_1d", "type": "np.ndarray", "docstring": null, "docstring_to...
4b1e42b5697512886c0cbb400d945f5a9d0a0c12
OCESS/cs493
orbitx/data_structures.py
[ "MIT" ]
Python
CoolantConnectionMatrix
np.ndarray
def CoolantConnectionMatrix(self) -> np.ndarray: """Returns a matrix of dimensions 3xN_COMPONENTS', containing coolant connection status for each component/coolant loop combination.""" list_hab_one = self._component_array[3 * N_COMPONENTS:4 * N_COMPONENTS] list_hab_two = ...
Returns a matrix of dimensions 3xN_COMPONENTS', containing coolant connection status for each component/coolant loop combination.
Returns a matrix of dimensions 3xN_COMPONENTS', containing coolant connection status for each component/coolant loop combination.
[ "Returns", "a", "matrix", "of", "dimensions", "3xN_COMPONENTS", "'", "containing", "coolant", "connection", "status", "for", "each", "component", "/", "coolant", "loop", "combination", "." ]
def CoolantConnectionMatrix(self) -> np.ndarray: list_hab_one = self._component_array[3 * N_COMPONENTS:4 * N_COMPONENTS] list_hab_two = self._component_array[4 * N_COMPONENTS:5 * N_COMPONENTS] list_ayse = self._component_array[5 * N_COMPONENTS:6 * N_COMPONENTS] return np....
[ "def", "CoolantConnectionMatrix", "(", "self", ")", "->", "np", ".", "ndarray", ":", "list_hab_one", "=", "self", ".", "_component_array", "[", "3", "*", "N_COMPONENTS", ":", "4", "*", "N_COMPONENTS", "]", "list_hab_two", "=", "self", ".", "_component_array", ...
Returns a matrix of dimensions 3xN_COMPONENTS', containing coolant connection status for each component/coolant loop combination.
[ "Returns", "a", "matrix", "of", "dimensions", "3xN_COMPONENTS", "'", "containing", "coolant", "connection", "status", "for", "each", "component", "/", "coolant", "loop", "combination", "." ]
[ "\"\"\"Returns a matrix of dimensions 3xN_COMPONENTS', containing coolant\n connection status for each component/coolant loop combination.\"\"\"" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
4b1e42b5697512886c0cbb400d945f5a9d0a0c12
OCESS/cs493
orbitx/data_structures.py
[ "MIT" ]
Python
as_proto
protos.EngineeringState
def as_proto(self) -> protos.EngineeringState: """Returns a deep copy of this EngineeringState as a protobuf.""" # If the ordering of component fields, change here too #Y_VECTOR_CHANGESITE constructed_protobuf = protos.EngineeringState() constructed_protobuf.CopyFrom(self._proto_state) ...
Returns a deep copy of this EngineeringState as a protobuf.
Returns a deep copy of this EngineeringState as a protobuf.
[ "Returns", "a", "deep", "copy", "of", "this", "EngineeringState", "as", "a", "protobuf", "." ]
def as_proto(self) -> protos.EngineeringState: constructed_protobuf = protos.EngineeringState() constructed_protobuf.CopyFrom(self._proto_state) for component_data, component in zip(self.components, constructed_protobuf.components): ( component.connected, component.ca...
[ "def", "as_proto", "(", "self", ")", "->", "protos", ".", "EngineeringState", ":", "constructed_protobuf", "=", "protos", ".", "EngineeringState", "(", ")", "constructed_protobuf", ".", "CopyFrom", "(", "self", ".", "_proto_state", ")", "for", "component_data", ...
Returns a deep copy of this EngineeringState as a protobuf.
[ "Returns", "a", "deep", "copy", "of", "this", "EngineeringState", "as", "a", "protobuf", "." ]
[ "\"\"\"Returns a deep copy of this EngineeringState as a protobuf.\"\"\"", "# If the ordering of component fields, change here too #Y_VECTOR_CHANGESITE" ]
[ { "param": "self", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
0b97e2b5cc41cde278a871f360fe4e2971a0e982
calculus2uk/udacity_ItemCatalog
application.py
[ "Unlicense" ]
Python
fbconnect
<not_specific>
def fbconnect(): if request.args.get('state') != login_session['state']: response = make_response(json.dumps('Invalid state parameter.'), 401) response.headers['Content-Type'] = 'application/json' return response access_token = request.data print "access token received %s " % access_...
Due to the formatting for the result from the server token exchange we have to split the token first on commas and select the first index which gives us the key : value for the server access token then we split it on colons to pull out the actual token value and replace the ...
Due to the formatting for the result from the server token exchange we have to split the token first on commas and select the first index which gives us the key : value for the server access token then we split it on colons to pull out the actual token value and replace the remaining quotes with nothing so that it can ...
[ "Due", "to", "the", "formatting", "for", "the", "result", "from", "the", "server", "token", "exchange", "we", "have", "to", "split", "the", "token", "first", "on", "commas", "and", "select", "the", "first", "index", "which", "gives", "us", "the", "key", ...
def fbconnect(): if request.args.get('state') != login_session['state']: response = make_response(json.dumps('Invalid state parameter.'), 401) response.headers['Content-Type'] = 'application/json' return response access_token = request.data print "access token received %s " % access_...
[ "def", "fbconnect", "(", ")", ":", "if", "request", ".", "args", ".", "get", "(", "'state'", ")", "!=", "login_session", "[", "'state'", "]", ":", "response", "=", "make_response", "(", "json", ".", "dumps", "(", "'Invalid state parameter.'", ")", ",", "...
Due to the formatting for the result from the server token exchange we have to split the token first on commas and select the first index which gives us the key : value for the server access token then we split it on colons to pull out the actual token value and replace the remaining quotes with nothing so that it can ...
[ "Due", "to", "the", "formatting", "for", "the", "result", "from", "the", "server", "token", "exchange", "we", "have", "to", "split", "the", "token", "first", "on", "commas", "and", "select", "the", "first", "index", "which", "gives", "us", "the", "key", ...
[ "# noqa", "# Use token to get user info from API", "'''\n Due to the formatting for the result from the server token\n exchange we have to split the token first on commas and\n select the first index which gives us the key : value\n for the server access token then we split it on col...
[]
{ "returns": [], "raises": [], "params": [], "outlier_params": [], "others": [] }
47f6668847ab54977bf8960569eeff8bf9c8f590
shiragcv/rezcontroller
src/rezcontroller/project.py
[ "MIT" ]
Python
create_context
<not_specific>
def create_context(name): """ Create a context for given project Args: name (str): Name of the project Returns: ResolvedContext: Resolved context object """ return context.create(requests=get_requests(name=name))
Create a context for given project Args: name (str): Name of the project Returns: ResolvedContext: Resolved context object
Create a context for given project
[ "Create", "a", "context", "for", "given", "project" ]
def create_context(name): return context.create(requests=get_requests(name=name))
[ "def", "create_context", "(", "name", ")", ":", "return", "context", ".", "create", "(", "requests", "=", "get_requests", "(", "name", "=", "name", ")", ")" ]
Create a context for given project
[ "Create", "a", "context", "for", "given", "project" ]
[ "\"\"\"\n Create a context for given project\n\n Args:\n name (str): Name of the project\n\n Returns:\n ResolvedContext: Resolved context object\n \"\"\"" ]
[ { "param": "name", "type": null } ]
{ "returns": [ { "docstring": "Resolved context object", "docstring_tokens": [ "Resolved", "context", "object" ], "type": "ResolvedContext" } ], "raises": [], "params": [ { "identifier": "name", "type": null, "docstring": "Name of the...
c4e13e3e11f090fecc024f3b6552d68c3988f2a2
shiragcv/rezcontroller
src/rezcontroller/context.py
[ "MIT" ]
Python
create
<not_specific>
def create(requests): """ Create a rez context from given packages Args: requests (list): List of package requests Returns: ResolvedContext: Resolved context object """ packages = [] for request in requests: packages.append(package.get(request=request)) retur...
Create a rez context from given packages Args: requests (list): List of package requests Returns: ResolvedContext: Resolved context object
Create a rez context from given packages
[ "Create", "a", "rez", "context", "from", "given", "packages" ]
def create(requests): packages = [] for request in requests: packages.append(package.get(request=request)) return resolved_context.ResolvedContext(package_requests=packages)
[ "def", "create", "(", "requests", ")", ":", "packages", "=", "[", "]", "for", "request", "in", "requests", ":", "packages", ".", "append", "(", "package", ".", "get", "(", "request", "=", "request", ")", ")", "return", "resolved_context", ".", "ResolvedC...
Create a rez context from given packages
[ "Create", "a", "rez", "context", "from", "given", "packages" ]
[ "\"\"\"\n Create a rez context from given packages\n\n Args:\n requests (list): List of package requests\n\n Returns:\n ResolvedContext: Resolved context object\n \"\"\"" ]
[ { "param": "requests", "type": null } ]
{ "returns": [ { "docstring": "Resolved context object", "docstring_tokens": [ "Resolved", "context", "object" ], "type": "ResolvedContext" } ], "raises": [], "params": [ { "identifier": "requests", "type": null, "docstring": "List of...
2cc3e8dcc2b62c80b429d23af92532896a11599c
AlanCoding/scm-inventory-paths
fox_house/where_i_keep_plugins/fox.py
[ "MIT" ]
Python
parse
null
def parse(self, inventory, loader, host_list, cache=True): ''' doesnt parse the inventory file, but claims it did anyway ''' super(InventoryModule, self).parse(inventory, loader, host_list) self.inventory.add_host('fox') # could be used to test rollback ancient_mystery()
doesnt parse the inventory file, but claims it did anyway
doesnt parse the inventory file, but claims it did anyway
[ "doesnt", "parse", "the", "inventory", "file", "but", "claims", "it", "did", "anyway" ]
def parse(self, inventory, loader, host_list, cache=True): super(InventoryModule, self).parse(inventory, loader, host_list) self.inventory.add_host('fox') ancient_mystery()
[ "def", "parse", "(", "self", ",", "inventory", ",", "loader", ",", "host_list", ",", "cache", "=", "True", ")", ":", "super", "(", "InventoryModule", ",", "self", ")", ".", "parse", "(", "inventory", ",", "loader", ",", "host_list", ")", "self", ".", ...
doesnt parse the inventory file, but claims it did anyway
[ "doesnt", "parse", "the", "inventory", "file", "but", "claims", "it", "did", "anyway" ]
[ "''' doesnt parse the inventory file, but claims it did anyway '''", "# could be used to test rollback" ]
[ { "param": "self", "type": null }, { "param": "inventory", "type": null }, { "param": "loader", "type": null }, { "param": "host_list", "type": null }, { "param": "cache", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "self", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "inventory", "type": null, "docstring": null, "docstring_token...
e467f39b98398ab8023262d092416df96a30d3ee
opentargets-archive/library-api
main.py
[ "Apache-2.0" ]
Python
token_sort_ratio
<not_specific>
def token_sort_ratio(str1, str2): """ Measure of similarity between two strings based on minimal edit distance, where ordering of words in each string is normalized before comparing. Args: str1 (str) str2 (str) Returns: float: similarity between ``str1`` and ``str2`` in the...
Measure of similarity between two strings based on minimal edit distance, where ordering of words in each string is normalized before comparing. Args: str1 (str) str2 (str) Returns: float: similarity between ``str1`` and ``str2`` in the interval [0.0, 1.0], where l...
Measure of similarity between two strings based on minimal edit distance, where ordering of words in each string is normalized before comparing. str1 (str) str2 (str)
[ "Measure", "of", "similarity", "between", "two", "strings", "based", "on", "minimal", "edit", "distance", "where", "ordering", "of", "words", "in", "each", "string", "is", "normalized", "before", "comparing", ".", "str1", "(", "str", ")", "str2", "(", "str",...
def token_sort_ratio(str1, str2): if not str1 or not str2: return 0 str1 = _force_unicode(str1) str2 = _force_unicode(str2) str1_proc = _process_and_sort(str1) str2_proc = _process_and_sort(str2) return _ratio(str1_proc, str2_proc)
[ "def", "token_sort_ratio", "(", "str1", ",", "str2", ")", ":", "if", "not", "str1", "or", "not", "str2", ":", "return", "0", "str1", "=", "_force_unicode", "(", "str1", ")", "str2", "=", "_force_unicode", "(", "str2", ")", "str1_proc", "=", "_process_and...
Measure of similarity between two strings based on minimal edit distance, where ordering of words in each string is normalized before comparing.
[ "Measure", "of", "similarity", "between", "two", "strings", "based", "on", "minimal", "edit", "distance", "where", "ordering", "of", "words", "in", "each", "string", "is", "normalized", "before", "comparing", "." ]
[ "\"\"\"\n Measure of similarity between two strings based on minimal edit distance,\n where ordering of words in each string is normalized before comparing.\n\n Args:\n str1 (str)\n str2 (str)\n\n Returns:\n float: similarity between ``str1`` and ``str2`` in the interval [0.0, 1.0],...
[ { "param": "str1", "type": null }, { "param": "str2", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "str1", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "str2", "type": null, "docstring": null, "docstring_tokens": [...
e467f39b98398ab8023262d092416df96a30d3ee
opentargets-archive/library-api
main.py
[ "Apache-2.0" ]
Python
aggregate_term_variants
<not_specific>
def aggregate_term_variants(terms, acro_defs=None, fuzzy_dedupe=True): """ Take a set of unique terms and aggregate terms that are symbolic, lexical, and ordering variants of each other, as well as acronyms and fuzzy string matches. Args: ...
Take a set of unique terms and aggregate terms that are symbolic, lexical, and ordering variants of each other, as well as acronyms and fuzzy string matches. Args: terms (Set[str]): set of unique terms with potential duplicates acro_defs (dict): if not None, terms that are acronyms will be...
Take a set of unique terms and aggregate terms that are symbolic, lexical, and ordering variants of each other, as well as acronyms and fuzzy string matches.
[ "Take", "a", "set", "of", "unique", "terms", "and", "aggregate", "terms", "that", "are", "symbolic", "lexical", "and", "ordering", "variants", "of", "each", "other", "as", "well", "as", "acronyms", "and", "fuzzy", "string", "matches", "." ]
def aggregate_term_variants(terms, acro_defs=None, fuzzy_dedupe=True): agg_terms = [] seen_terms = set() for term in sorted(terms, key=len, reverse=True): if term in seen_terms: continue variants = set([term]) seen_t...
[ "def", "aggregate_term_variants", "(", "terms", ",", "acro_defs", "=", "None", ",", "fuzzy_dedupe", "=", "True", ")", ":", "agg_terms", "=", "[", "]", "seen_terms", "=", "set", "(", ")", "for", "term", "in", "sorted", "(", "terms", ",", "key", "=", "le...
Take a set of unique terms and aggregate terms that are symbolic, lexical, and ordering variants of each other, as well as acronyms and fuzzy string matches.
[ "Take", "a", "set", "of", "unique", "terms", "and", "aggregate", "terms", "that", "are", "symbolic", "lexical", "and", "ordering", "variants", "of", "each", "other", "as", "well", "as", "acronyms", "and", "fuzzy", "string", "matches", "." ]
[ "\"\"\"\n Take a set of unique terms and aggregate terms that are symbolic, lexical,\n and ordering variants of each other, as well as acronyms and fuzzy string matches.\n\n Args:\n terms (Set[str]): set of unique terms with potential duplicates\n acro_defs (dict): if not None, terms that are...
[ { "param": "terms", "type": null }, { "param": "acro_defs", "type": null }, { "param": "fuzzy_dedupe", "type": null } ]
{ "returns": [ { "docstring": "each item is a set of aggregated terms", "docstring_tokens": [ "each", "item", "is", "a", "set", "of", "aggregated", "terms" ], "type": "List[Set[str]]" } ], "raises": [], "params": [ ...
e467f39b98398ab8023262d092416df96a30d3ee
opentargets-archive/library-api
main.py
[ "Apache-2.0" ]
Python
_process
<not_specific>
def _process(s): """ Remove all characters but letters and numbers, strip whitespace, and force everything to lower-case. """ if not s: return '' return NONWORDCHARS_REGEX.sub(' ', s).lower().strip()
Remove all characters but letters and numbers, strip whitespace, and force everything to lower-case.
Remove all characters but letters and numbers, strip whitespace, and force everything to lower-case.
[ "Remove", "all", "characters", "but", "letters", "and", "numbers", "strip", "whitespace", "and", "force", "everything", "to", "lower", "-", "case", "." ]
def _process(s): if not s: return '' return NONWORDCHARS_REGEX.sub(' ', s).lower().strip()
[ "def", "_process", "(", "s", ")", ":", "if", "not", "s", ":", "return", "''", "return", "NONWORDCHARS_REGEX", ".", "sub", "(", "' '", ",", "s", ")", ".", "lower", "(", ")", ".", "strip", "(", ")" ]
Remove all characters but letters and numbers, strip whitespace, and force everything to lower-case.
[ "Remove", "all", "characters", "but", "letters", "and", "numbers", "strip", "whitespace", "and", "force", "everything", "to", "lower", "-", "case", "." ]
[ "\"\"\"\n Remove all characters but letters and numbers, strip whitespace,\n and force everything to lower-case.\n \"\"\"" ]
[ { "param": "s", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "s", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null } ], "outlier_params": [], "others": [] }
e467f39b98398ab8023262d092416df96a30d3ee
opentargets-archive/library-api
main.py
[ "Apache-2.0" ]
Python
build_graph
<not_specific>
def build_graph(data): ''' builds a networkX graph from a response of the elasticsearch Ghraph API :param data: :return: ''' if data and data['vertices']: '''build graph''' G = nx.Graph() node_names = {} node_class = [] node_classes = [] gene_nodes...
builds a networkX graph from a response of the elasticsearch Ghraph API :param data: :return:
builds a networkX graph from a response of the elasticsearch Ghraph API
[ "builds", "a", "networkX", "graph", "from", "a", "response", "of", "the", "elasticsearch", "Ghraph", "API" ]
def build_graph(data): if data and data['vertices']: G = nx.Graph() node_names = {} node_class = [] node_classes = [] gene_nodes = [] for i, vertex in enumerate(data['vertices']): G.add_node(i, term=vertex['term'], ...
[ "def", "build_graph", "(", "data", ")", ":", "if", "data", "and", "data", "[", "'vertices'", "]", ":", "'''build graph'''", "G", "=", "nx", ".", "Graph", "(", ")", "node_names", "=", "{", "}", "node_class", "=", "[", "]", "node_classes", "=", "[", "]...
builds a networkX graph from a response of the elasticsearch Ghraph API
[ "builds", "a", "networkX", "graph", "from", "a", "response", "of", "the", "elasticsearch", "Ghraph", "API" ]
[ "'''\n builds a networkX graph from a response of the elasticsearch Ghraph API\n :param data:\n :return:\n '''", "'''build graph'''", "# weight=edge['weight']," ]
[ { "param": "data", "type": null } ]
{ "returns": [ { "docstring": null, "docstring_tokens": [ "None" ], "type": null } ], "raises": [], "params": [ { "identifier": "data", "type": null, "docstring": null, "docstring_tokens": [ "None" ], "default": null, ...
e467f39b98398ab8023262d092416df96a30d3ee
opentargets-archive/library-api
main.py
[ "Apache-2.0" ]
Python
clean_valid_ids
null
def clean_valid_ids(valid_ids, valid_ids_lables): '''remove concepts with same label as entity and phenotypes with same label as disease''' valid_ids_lower = [i.lower() for i in valid_ids.keys()] disease_labels = [] for ent in valid_ids.values(): if ent['category'] == 'DISEASE': dise...
remove concepts with same label as entity and phenotypes with same label as disease
remove concepts with same label as entity and phenotypes with same label as disease
[ "remove", "concepts", "with", "same", "label", "as", "entity", "and", "phenotypes", "with", "same", "label", "as", "disease" ]
def clean_valid_ids(valid_ids, valid_ids_lables): valid_ids_lower = [i.lower() for i in valid_ids.keys()] disease_labels = [] for ent in valid_ids.values(): if ent['category'] == 'DISEASE': disease_labels.append(ent['label'].lower()) disease_labels.append(ent['label'].lower()...
[ "def", "clean_valid_ids", "(", "valid_ids", ",", "valid_ids_lables", ")", ":", "valid_ids_lower", "=", "[", "i", ".", "lower", "(", ")", "for", "i", "in", "valid_ids", ".", "keys", "(", ")", "]", "disease_labels", "=", "[", "]", "for", "ent", "in", "va...
remove concepts with same label as entity and phenotypes with same label as disease
[ "remove", "concepts", "with", "same", "label", "as", "entity", "and", "phenotypes", "with", "same", "label", "as", "disease" ]
[ "'''remove concepts with same label as entity and phenotypes with same label as disease'''", "# if v['label'] != lower_label and lower_label in valid_ids_lower and k in valid_ids:", "# valid_ids.pop(k)" ]
[ { "param": "valid_ids", "type": null }, { "param": "valid_ids_lables", "type": null } ]
{ "returns": [], "raises": [], "params": [ { "identifier": "valid_ids", "type": null, "docstring": null, "docstring_tokens": [], "default": null, "is_optional": null }, { "identifier": "valid_ids_lables", "type": null, "docstring": null, "doc...