repo stringlengths 7 55 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 19 28.4k | docstring stringlengths 1 46.9k | docstring_tokens listlengths 1 1.97k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 3
values | summary stringlengths 4 350 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
ShadowBlip/Neteria | neteria/core.py | unserialize_data | def unserialize_data(data, compression=False, encryption=False):
"""Unserializes the packet data and converts it from json format to normal
Python datatypes.
If you choose to enable encryption and/or compression when serializing
data, you MUST enable the same options when unserializing data.
Args:... | python | def unserialize_data(data, compression=False, encryption=False):
"""Unserializes the packet data and converts it from json format to normal
Python datatypes.
If you choose to enable encryption and/or compression when serializing
data, you MUST enable the same options when unserializing data.
Args:... | [
"def",
"unserialize_data",
"(",
"data",
",",
"compression",
"=",
"False",
",",
"encryption",
"=",
"False",
")",
":",
"try",
":",
"if",
"encryption",
":",
"data",
"=",
"encryption",
".",
"decrypt",
"(",
"data",
")",
"except",
"Exception",
"as",
"err",
":"... | Unserializes the packet data and converts it from json format to normal
Python datatypes.
If you choose to enable encryption and/or compression when serializing
data, you MUST enable the same options when unserializing data.
Args:
data (str): The raw, serialized packet data delivered from the tr... | [
"Unserializes",
"the",
"packet",
"data",
"and",
"converts",
"it",
"from",
"json",
"format",
"to",
"normal",
"Python",
"datatypes",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L78-L119 | train | Unserializes the packet data and converts it to normal Python datatypes. |
ShadowBlip/Neteria | neteria/core.py | ListenerUDP.listen | def listen(self):
"""Starts the listen loop. If threading is enabled, then the loop will
be started in its own thread.
Args:
None
Returns:
None
"""
self.listening = True
if self.threading:
from threading import Thread
... | python | def listen(self):
"""Starts the listen loop. If threading is enabled, then the loop will
be started in its own thread.
Args:
None
Returns:
None
"""
self.listening = True
if self.threading:
from threading import Thread
... | [
"def",
"listen",
"(",
"self",
")",
":",
"self",
".",
"listening",
"=",
"True",
"if",
"self",
".",
"threading",
":",
"from",
"threading",
"import",
"Thread",
"self",
".",
"listen_thread",
"=",
"Thread",
"(",
"target",
"=",
"self",
".",
"listen_loop",
")",... | Starts the listen loop. If threading is enabled, then the loop will
be started in its own thread.
Args:
None
Returns:
None | [
"Starts",
"the",
"listen",
"loop",
".",
"If",
"threading",
"is",
"enabled",
"then",
"the",
"loop",
"will",
"be",
"started",
"in",
"its",
"own",
"thread",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L192-L216 | train | Starts the listen loop. If threading is enabled then the listen loop will be started in its own thread. If scheduler is enabled then the listen loop will be started in its own thread. |
ShadowBlip/Neteria | neteria/core.py | ListenerUDP.listen_loop | def listen_loop(self):
"""Starts the listen loop and executes the receieve_datagram method
whenever a packet is receieved.
Args:
None
Returns:
None
"""
while self.listening:
try:
data, address = self.sock.recvfrom(self.b... | python | def listen_loop(self):
"""Starts the listen loop and executes the receieve_datagram method
whenever a packet is receieved.
Args:
None
Returns:
None
"""
while self.listening:
try:
data, address = self.sock.recvfrom(self.b... | [
"def",
"listen_loop",
"(",
"self",
")",
":",
"while",
"self",
".",
"listening",
":",
"try",
":",
"data",
",",
"address",
"=",
"self",
".",
"sock",
".",
"recvfrom",
"(",
"self",
".",
"bufsize",
")",
"self",
".",
"receive_datagram",
"(",
"data",
",",
"... | Starts the listen loop and executes the receieve_datagram method
whenever a packet is receieved.
Args:
None
Returns:
None | [
"Starts",
"the",
"listen",
"loop",
"and",
"executes",
"the",
"receieve_datagram",
"method",
"whenever",
"a",
"packet",
"is",
"receieved",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L218-L242 | train | Starts the listen loop and executes the receive_datagram method
. |
ShadowBlip/Neteria | neteria/core.py | ListenerUDP.scheduler | def scheduler(self, sleep_time=0.2):
"""Starts the scheduler to check for scheduled calls and execute them
at the correct time.
Args:
sleep_time (float): The amount of time to wait in seconds between
each loop iteration. This prevents the scheduler from consuming
... | python | def scheduler(self, sleep_time=0.2):
"""Starts the scheduler to check for scheduled calls and execute them
at the correct time.
Args:
sleep_time (float): The amount of time to wait in seconds between
each loop iteration. This prevents the scheduler from consuming
... | [
"def",
"scheduler",
"(",
"self",
",",
"sleep_time",
"=",
"0.2",
")",
":",
"while",
"self",
".",
"listening",
":",
"# If we have any scheduled calls, execute them and remove them from",
"# our list of scheduled calls.",
"if",
"self",
".",
"scheduled_calls",
":",
"timestamp... | Starts the scheduler to check for scheduled calls and execute them
at the correct time.
Args:
sleep_time (float): The amount of time to wait in seconds between
each loop iteration. This prevents the scheduler from consuming
100% of the host's CPU. Defaults to 0.2 secon... | [
"Starts",
"the",
"scheduler",
"to",
"check",
"for",
"scheduled",
"calls",
"and",
"execute",
"them",
"at",
"the",
"correct",
"time",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L244-L267 | train | Starts the scheduler to check for scheduled calls and execute them at the correct time. |
ShadowBlip/Neteria | neteria/core.py | ListenerUDP.call_later | def call_later(self, time_seconds, callback, arguments):
"""Schedules a function to be run x number of seconds from now.
The call_later method is primarily used to resend messages if we
haven't received a confirmation message from the receiving host.
We can wait x number of seconds for ... | python | def call_later(self, time_seconds, callback, arguments):
"""Schedules a function to be run x number of seconds from now.
The call_later method is primarily used to resend messages if we
haven't received a confirmation message from the receiving host.
We can wait x number of seconds for ... | [
"def",
"call_later",
"(",
"self",
",",
"time_seconds",
",",
"callback",
",",
"arguments",
")",
":",
"scheduled_call",
"=",
"{",
"'ts'",
":",
"time",
".",
"time",
"(",
")",
"+",
"time_seconds",
",",
"'callback'",
":",
"callback",
",",
"'args'",
":",
"argu... | Schedules a function to be run x number of seconds from now.
The call_later method is primarily used to resend messages if we
haven't received a confirmation message from the receiving host.
We can wait x number of seconds for a response and then try
sending the message again.
... | [
"Schedules",
"a",
"function",
"to",
"be",
"run",
"x",
"number",
"of",
"seconds",
"from",
"now",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L269-L292 | train | Schedules a function to be run at the time of the given time_seconds. |
ShadowBlip/Neteria | neteria/core.py | ListenerUDP.time_reached | def time_reached(self, current_time, scheduled_call):
"""Checks to see if it's time to run a scheduled call or not.
If it IS time to run a scheduled call, this function will execute the
method associated with that call.
Args:
current_time (float): Current timestamp from time.... | python | def time_reached(self, current_time, scheduled_call):
"""Checks to see if it's time to run a scheduled call or not.
If it IS time to run a scheduled call, this function will execute the
method associated with that call.
Args:
current_time (float): Current timestamp from time.... | [
"def",
"time_reached",
"(",
"self",
",",
"current_time",
",",
"scheduled_call",
")",
":",
"if",
"current_time",
">=",
"scheduled_call",
"[",
"'ts'",
"]",
":",
"scheduled_call",
"[",
"'callback'",
"]",
"(",
"scheduled_call",
"[",
"'args'",
"]",
")",
"return",
... | Checks to see if it's time to run a scheduled call or not.
If it IS time to run a scheduled call, this function will execute the
method associated with that call.
Args:
current_time (float): Current timestamp from time.time().
scheduled_call (dict): A scheduled call diction... | [
"Checks",
"to",
"see",
"if",
"it",
"s",
"time",
"to",
"run",
"a",
"scheduled",
"call",
"or",
"not",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L294-L322 | train | Checks to see if the current time is reached by the scheduled call. |
ShadowBlip/Neteria | neteria/core.py | ListenerUDP.send_datagram | def send_datagram(self, message, address, message_type="unicast"):
"""Sends a UDP datagram packet to the requested address.
Datagrams can be sent as a "unicast", "multicast", or "broadcast"
message. Unicast messages are messages that will be sent to a single
host, multicast messages wil... | python | def send_datagram(self, message, address, message_type="unicast"):
"""Sends a UDP datagram packet to the requested address.
Datagrams can be sent as a "unicast", "multicast", or "broadcast"
message. Unicast messages are messages that will be sent to a single
host, multicast messages wil... | [
"def",
"send_datagram",
"(",
"self",
",",
"message",
",",
"address",
",",
"message_type",
"=",
"\"unicast\"",
")",
":",
"if",
"self",
".",
"bufsize",
"is",
"not",
"0",
"and",
"len",
"(",
"message",
")",
">",
"self",
".",
"bufsize",
":",
"raise",
"Excep... | Sends a UDP datagram packet to the requested address.
Datagrams can be sent as a "unicast", "multicast", or "broadcast"
message. Unicast messages are messages that will be sent to a single
host, multicast messages will be delivered to all hosts listening for
multicast messages, and broa... | [
"Sends",
"a",
"UDP",
"datagram",
"packet",
"to",
"the",
"requested",
"address",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L324-L360 | train | Sends a datagram to the requested address. |
ShadowBlip/Neteria | neteria/core.py | ListenerUDP.receive_datagram | def receive_datagram(self, data, address):
"""Executes when UDP data has been received and sends the packet data
to our app to process the request.
Args:
data (str): The raw serialized packet data received.
address (tuple): The address and port of the origin of the received
... | python | def receive_datagram(self, data, address):
"""Executes when UDP data has been received and sends the packet data
to our app to process the request.
Args:
data (str): The raw serialized packet data received.
address (tuple): The address and port of the origin of the received
... | [
"def",
"receive_datagram",
"(",
"self",
",",
"data",
",",
"address",
")",
":",
"# If we do not specify an application, just print the data.",
"if",
"not",
"self",
".",
"app",
":",
"logger",
".",
"debug",
"(",
"\"Packet received\"",
",",
"address",
",",
"data",
")"... | Executes when UDP data has been received and sends the packet data
to our app to process the request.
Args:
data (str): The raw serialized packet data received.
address (tuple): The address and port of the origin of the received
packet. E.g. (address, port).
Ret... | [
"Executes",
"when",
"UDP",
"data",
"has",
"been",
"received",
"and",
"sends",
"the",
"packet",
"data",
"to",
"our",
"app",
"to",
"process",
"the",
"request",
"."
] | 1a8c976eb2beeca0a5a272a34ac58b2c114495a4 | https://github.com/ShadowBlip/Neteria/blob/1a8c976eb2beeca0a5a272a34ac58b2c114495a4/neteria/core.py#L362-L394 | train | Executes when UDP data has been received and sends the packet to the application to process the request. |
sprockets/sprockets.mixins.metrics | examples/statsd.py | make_application | def make_application():
"""
Create a application configured to send metrics.
Metrics will be sent to localhost:8125 namespaced with
``webapps``. Run netcat or a similar listener then run this
example. HTTP GETs will result in a metric like::
webapps.SimpleHandler.GET.204:255.24497032165527... | python | def make_application():
"""
Create a application configured to send metrics.
Metrics will be sent to localhost:8125 namespaced with
``webapps``. Run netcat or a similar listener then run this
example. HTTP GETs will result in a metric like::
webapps.SimpleHandler.GET.204:255.24497032165527... | [
"def",
"make_application",
"(",
")",
":",
"settings",
"=",
"{",
"}",
"application",
"=",
"web",
".",
"Application",
"(",
"[",
"web",
".",
"url",
"(",
"'/'",
",",
"SimpleHandler",
")",
"]",
",",
"*",
"*",
"settings",
")",
"statsd",
".",
"install",
"("... | Create a application configured to send metrics.
Metrics will be sent to localhost:8125 namespaced with
``webapps``. Run netcat or a similar listener then run this
example. HTTP GETs will result in a metric like::
webapps.SimpleHandler.GET.204:255.24497032165527|ms | [
"Create",
"a",
"application",
"configured",
"to",
"send",
"metrics",
"."
] | 0b17d5f0c09a2be9db779e17e6789d3d5ff9a0d0 | https://github.com/sprockets/sprockets.mixins.metrics/blob/0b17d5f0c09a2be9db779e17e6789d3d5ff9a0d0/examples/statsd.py#L34-L48 | train | Create a web application configured to send metrics. |
ehansis/ozelot | examples/leonardo/leonardo/common/analysis.py | plots_html_page | def plots_html_page(query_module):
"""Generate analysis output as html page
Args:
query_module (module): module to use for querying data for the
desired model/pipeline variant, e.g. leonardo.standard.queries
"""
# page template
template = jenv.get_template("analysis.html")
... | python | def plots_html_page(query_module):
"""Generate analysis output as html page
Args:
query_module (module): module to use for querying data for the
desired model/pipeline variant, e.g. leonardo.standard.queries
"""
# page template
template = jenv.get_template("analysis.html")
... | [
"def",
"plots_html_page",
"(",
"query_module",
")",
":",
"# page template",
"template",
"=",
"jenv",
".",
"get_template",
"(",
"\"analysis.html\"",
")",
"# container for template context",
"context",
"=",
"dict",
"(",
"extended",
"=",
"config",
".",
"EXTENDED",
")",... | Generate analysis output as html page
Args:
query_module (module): module to use for querying data for the
desired model/pipeline variant, e.g. leonardo.standard.queries | [
"Generate",
"analysis",
"output",
"as",
"html",
"page"
] | 948675e02eb6fca940450f5cb814f53e97159e5b | https://github.com/ehansis/ozelot/blob/948675e02eb6fca940450f5cb814f53e97159e5b/examples/leonardo/leonardo/common/analysis.py#L50-L113 | train | Generate analysis output as html page |
fkarb/xltable | xltable/worksheet.py | _to_pywintypes | def _to_pywintypes(row):
"""convert values in a row to types accepted by excel"""
def _pywintype(x):
if isinstance(x, dt.date):
return dt.datetime(x.year, x.month, x.day, tzinfo=dt.timezone.utc)
elif isinstance(x, (dt.datetime, pa.Timestamp)):
if x.tzinfo is None:
... | python | def _to_pywintypes(row):
"""convert values in a row to types accepted by excel"""
def _pywintype(x):
if isinstance(x, dt.date):
return dt.datetime(x.year, x.month, x.day, tzinfo=dt.timezone.utc)
elif isinstance(x, (dt.datetime, pa.Timestamp)):
if x.tzinfo is None:
... | [
"def",
"_to_pywintypes",
"(",
"row",
")",
":",
"def",
"_pywintype",
"(",
"x",
")",
":",
"if",
"isinstance",
"(",
"x",
",",
"dt",
".",
"date",
")",
":",
"return",
"dt",
".",
"datetime",
"(",
"x",
".",
"year",
",",
"x",
".",
"month",
",",
"x",
".... | convert values in a row to types accepted by excel | [
"convert",
"values",
"in",
"a",
"row",
"to",
"types",
"accepted",
"by",
"excel"
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L640-L666 | train | converts values in a row to types accepted by excel |
fkarb/xltable | xltable/worksheet.py | Worksheet.add_table | def add_table(self, table, row=None, col=0, row_spaces=1):
"""
Adds a table to the worksheet at (row, col).
Return the (row, col) where the table has been put.
:param xltable.Table table: Table to add to the worksheet.
:param int row: Row to start the table at (defaults to the n... | python | def add_table(self, table, row=None, col=0, row_spaces=1):
"""
Adds a table to the worksheet at (row, col).
Return the (row, col) where the table has been put.
:param xltable.Table table: Table to add to the worksheet.
:param int row: Row to start the table at (defaults to the n... | [
"def",
"add_table",
"(",
"self",
",",
"table",
",",
"row",
"=",
"None",
",",
"col",
"=",
"0",
",",
"row_spaces",
"=",
"1",
")",
":",
"name",
"=",
"table",
".",
"name",
"assert",
"name",
"is",
"not",
"None",
",",
"\"Tables must have a name\"",
"assert",... | Adds a table to the worksheet at (row, col).
Return the (row, col) where the table has been put.
:param xltable.Table table: Table to add to the worksheet.
:param int row: Row to start the table at (defaults to the next free row).
:param int col: Column to start the table at.
:p... | [
"Adds",
"a",
"table",
"to",
"the",
"worksheet",
"at",
"(",
"row",
"col",
")",
".",
"Return",
"the",
"(",
"row",
"col",
")",
"where",
"the",
"table",
"has",
"been",
"put",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L43-L60 | train | Adds a table to the worksheet at the specified row and column. |
fkarb/xltable | xltable/worksheet.py | Worksheet.add_value | def add_value(self, value, row, col):
"""
Adds a single value (cell) to a worksheet at (row, col).
Return the (row, col) where the value has been put.
:param value: Value to write to the sheet.
:param row: Row where the value should be written.
:param col: Column where t... | python | def add_value(self, value, row, col):
"""
Adds a single value (cell) to a worksheet at (row, col).
Return the (row, col) where the value has been put.
:param value: Value to write to the sheet.
:param row: Row where the value should be written.
:param col: Column where t... | [
"def",
"add_value",
"(",
"self",
",",
"value",
",",
"row",
",",
"col",
")",
":",
"self",
".",
"__values",
"[",
"(",
"row",
",",
"col",
")",
"]",
"=",
"value"
] | Adds a single value (cell) to a worksheet at (row, col).
Return the (row, col) where the value has been put.
:param value: Value to write to the sheet.
:param row: Row where the value should be written.
:param col: Column where the value should be written. | [
"Adds",
"a",
"single",
"value",
"(",
"cell",
")",
"to",
"a",
"worksheet",
"at",
"(",
"row",
"col",
")",
".",
"Return",
"the",
"(",
"row",
"col",
")",
"where",
"the",
"value",
"has",
"been",
"put",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L62-L71 | train | Adds a single value to a worksheet at the specified row and column. |
fkarb/xltable | xltable/worksheet.py | Worksheet.add_chart | def add_chart(self, chart, row, col):
"""
Adds a chart to the worksheet at (row, col).
:param xltable.Chart Chart: chart to add to the workbook.
:param int row: Row to add the chart at.
"""
self.__charts.append((chart, (row, col))) | python | def add_chart(self, chart, row, col):
"""
Adds a chart to the worksheet at (row, col).
:param xltable.Chart Chart: chart to add to the workbook.
:param int row: Row to add the chart at.
"""
self.__charts.append((chart, (row, col))) | [
"def",
"add_chart",
"(",
"self",
",",
"chart",
",",
"row",
",",
"col",
")",
":",
"self",
".",
"__charts",
".",
"append",
"(",
"(",
"chart",
",",
"(",
"row",
",",
"col",
")",
")",
")"
] | Adds a chart to the worksheet at (row, col).
:param xltable.Chart Chart: chart to add to the workbook.
:param int row: Row to add the chart at. | [
"Adds",
"a",
"chart",
"to",
"the",
"worksheet",
"at",
"(",
"row",
"col",
")",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L73-L80 | train | Adds a chart to the worksheet at the specified row and col. |
fkarb/xltable | xltable/worksheet.py | Worksheet.add_row_group | def add_row_group(self, tables, collapsed=True):
"""
Adds a group over all the given tables (will include any rows between the first row over all
tables, and the last row over all tables)
Initially collapsed if collapsed is True (True by default)
"""
self.__groups.append(... | python | def add_row_group(self, tables, collapsed=True):
"""
Adds a group over all the given tables (will include any rows between the first row over all
tables, and the last row over all tables)
Initially collapsed if collapsed is True (True by default)
"""
self.__groups.append(... | [
"def",
"add_row_group",
"(",
"self",
",",
"tables",
",",
"collapsed",
"=",
"True",
")",
":",
"self",
".",
"__groups",
".",
"append",
"(",
"(",
"tables",
",",
"collapsed",
")",
")"
] | Adds a group over all the given tables (will include any rows between the first row over all
tables, and the last row over all tables)
Initially collapsed if collapsed is True (True by default) | [
"Adds",
"a",
"group",
"over",
"all",
"the",
"given",
"tables",
"(",
"will",
"include",
"any",
"rows",
"between",
"the",
"first",
"row",
"over",
"all",
"tables",
"and",
"the",
"last",
"row",
"over",
"all",
"tables",
")",
"Initially",
"collapsed",
"if",
"c... | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L82-L88 | train | Adds a group over all the given tables. |
fkarb/xltable | xltable/worksheet.py | Worksheet.get_table_pos | def get_table_pos(self, tablename):
"""
:param str tablename: Name of table to get position of.
:return: Upper left (row, col) coordinate of the named table.
"""
_table, (row, col) = self.__tables[tablename]
return (row, col) | python | def get_table_pos(self, tablename):
"""
:param str tablename: Name of table to get position of.
:return: Upper left (row, col) coordinate of the named table.
"""
_table, (row, col) = self.__tables[tablename]
return (row, col) | [
"def",
"get_table_pos",
"(",
"self",
",",
"tablename",
")",
":",
"_table",
",",
"(",
"row",
",",
"col",
")",
"=",
"self",
".",
"__tables",
"[",
"tablename",
"]",
"return",
"(",
"row",
",",
"col",
")"
] | :param str tablename: Name of table to get position of.
:return: Upper left (row, col) coordinate of the named table. | [
":",
"param",
"str",
"tablename",
":",
"Name",
"of",
"table",
"to",
"get",
"position",
"of",
".",
":",
"return",
":",
"Upper",
"left",
"(",
"row",
"col",
")",
"coordinate",
"of",
"the",
"named",
"table",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L99-L105 | train | Get the upper left coordinate of the named table. |
fkarb/xltable | xltable/worksheet.py | Worksheet.get_table | def get_table(self, tablename):
"""
:param str tablename: Name of table to find.
:return: A :py:class:`xltable.Table` instance from the table name.
"""
table, (_row, _col) = self.__tables[tablename]
return table | python | def get_table(self, tablename):
"""
:param str tablename: Name of table to find.
:return: A :py:class:`xltable.Table` instance from the table name.
"""
table, (_row, _col) = self.__tables[tablename]
return table | [
"def",
"get_table",
"(",
"self",
",",
"tablename",
")",
":",
"table",
",",
"(",
"_row",
",",
"_col",
")",
"=",
"self",
".",
"__tables",
"[",
"tablename",
"]",
"return",
"table"
] | :param str tablename: Name of table to find.
:return: A :py:class:`xltable.Table` instance from the table name. | [
":",
"param",
"str",
"tablename",
":",
"Name",
"of",
"table",
"to",
"find",
".",
":",
"return",
":",
"A",
":",
"py",
":",
"class",
":",
"xltable",
".",
"Table",
"instance",
"from",
"the",
"table",
"name",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L107-L113 | train | Returns the table instance for the given table name. |
fkarb/xltable | xltable/worksheet.py | Worksheet.iterrows | def iterrows(self, workbook=None):
"""
Yield rows as lists of data.
The data is exactly as it is in the source pandas DataFrames and
any formulas are not resolved.
"""
resolved_tables = []
max_height = 0
max_width = 0
# while yielding rows __form... | python | def iterrows(self, workbook=None):
"""
Yield rows as lists of data.
The data is exactly as it is in the source pandas DataFrames and
any formulas are not resolved.
"""
resolved_tables = []
max_height = 0
max_width = 0
# while yielding rows __form... | [
"def",
"iterrows",
"(",
"self",
",",
"workbook",
"=",
"None",
")",
":",
"resolved_tables",
"=",
"[",
"]",
"max_height",
"=",
"0",
"max_width",
"=",
"0",
"# while yielding rows __formula_values is updated with any formula values set on Expressions",
"self",
".",
"__formu... | Yield rows as lists of data.
The data is exactly as it is in the source pandas DataFrames and
any formulas are not resolved. | [
"Yield",
"rows",
"as",
"lists",
"of",
"data",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L115-L169 | train | Yields the rows of the table in the source pandas DataFrames and returns a list of tuples of data. Each tuple contains the name data the upper left and right data and the formula values. |
fkarb/xltable | xltable/worksheet.py | Worksheet._get_column_widths | def _get_column_widths(self):
"""return a dictionary of {col -> width}"""
col_widths = {}
for table, (row, col) in self.__tables.values():
for colname, width in table.column_widths.items():
ic = col + table.get_column_offset(colname)
current_width = co... | python | def _get_column_widths(self):
"""return a dictionary of {col -> width}"""
col_widths = {}
for table, (row, col) in self.__tables.values():
for colname, width in table.column_widths.items():
ic = col + table.get_column_offset(colname)
current_width = co... | [
"def",
"_get_column_widths",
"(",
"self",
")",
":",
"col_widths",
"=",
"{",
"}",
"for",
"table",
",",
"(",
"row",
",",
"col",
")",
"in",
"self",
".",
"__tables",
".",
"values",
"(",
")",
":",
"for",
"colname",
",",
"width",
"in",
"table",
".",
"col... | return a dictionary of {col -> width} | [
"return",
"a",
"dictionary",
"of",
"{",
"col",
"-",
">",
"width",
"}"
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L179-L187 | train | return a dictionary of column - > width |
fkarb/xltable | xltable/worksheet.py | Worksheet._get_all_styles | def _get_all_styles(self):
"""
return a dictionary of {(row, col) -> CellStyle}
for all cells that use a non-default style.
"""
_styles = {}
def _get_style(bold=False, bg_col=None, border=None):
if (bold, bg_col, border) not in _styles:
_styles... | python | def _get_all_styles(self):
"""
return a dictionary of {(row, col) -> CellStyle}
for all cells that use a non-default style.
"""
_styles = {}
def _get_style(bold=False, bg_col=None, border=None):
if (bold, bg_col, border) not in _styles:
_styles... | [
"def",
"_get_all_styles",
"(",
"self",
")",
":",
"_styles",
"=",
"{",
"}",
"def",
"_get_style",
"(",
"bold",
"=",
"False",
",",
"bg_col",
"=",
"None",
",",
"border",
"=",
"None",
")",
":",
"if",
"(",
"bold",
",",
"bg_col",
",",
"border",
")",
"not"... | return a dictionary of {(row, col) -> CellStyle}
for all cells that use a non-default style. | [
"return",
"a",
"dictionary",
"of",
"{",
"(",
"row",
"col",
")",
"-",
">",
"CellStyle",
"}",
"for",
"all",
"cells",
"that",
"use",
"a",
"non",
"-",
"default",
"style",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L189-L278 | train | Returns a dictionary of all cells that use a non - default style. |
fkarb/xltable | xltable/worksheet.py | Worksheet.to_excel | def to_excel(self,
workbook=None,
worksheet=None,
xl_app=None,
clear=True,
rename=True,
resize_columns=True):
"""
Writes worksheet to an Excel Worksheet COM object.
Requires :py:module:`pywin32`... | python | def to_excel(self,
workbook=None,
worksheet=None,
xl_app=None,
clear=True,
rename=True,
resize_columns=True):
"""
Writes worksheet to an Excel Worksheet COM object.
Requires :py:module:`pywin32`... | [
"def",
"to_excel",
"(",
"self",
",",
"workbook",
"=",
"None",
",",
"worksheet",
"=",
"None",
",",
"xl_app",
"=",
"None",
",",
"clear",
"=",
"True",
",",
"rename",
"=",
"True",
",",
"resize_columns",
"=",
"True",
")",
":",
"from",
"win32com",
".",
"cl... | Writes worksheet to an Excel Worksheet COM object.
Requires :py:module:`pywin32` to be installed.
:param workbook: xltable.Workbook this sheet belongs to.
:param worksheet: Excel COM Worksheet instance to write to.
:param xl_app: Excel COM Excel Application to write to.
:param b... | [
"Writes",
"worksheet",
"to",
"an",
"Excel",
"Worksheet",
"COM",
"object",
".",
"Requires",
":",
"py",
":",
"module",
":",
"pywin32",
"to",
"be",
"installed",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L280-L431 | train | Writes this object to an Excel Worksheet COM object. |
fkarb/xltable | xltable/worksheet.py | Worksheet.to_xlsx | def to_xlsx(self, filename=None, workbook=None):
"""
Write worksheet to a .xlsx file using xlsxwriter.
:param str filename: Filename to write to. If None no file is written.
:param xltable.Workbook: Workbook this sheet belongs to. If None a new workbook
will be created with this... | python | def to_xlsx(self, filename=None, workbook=None):
"""
Write worksheet to a .xlsx file using xlsxwriter.
:param str filename: Filename to write to. If None no file is written.
:param xltable.Workbook: Workbook this sheet belongs to. If None a new workbook
will be created with this... | [
"def",
"to_xlsx",
"(",
"self",
",",
"filename",
"=",
"None",
",",
"workbook",
"=",
"None",
")",
":",
"from",
".",
"workbook",
"import",
"Workbook",
"if",
"not",
"workbook",
":",
"workbook",
"=",
"Workbook",
"(",
"filename",
"=",
"filename",
")",
"workboo... | Write worksheet to a .xlsx file using xlsxwriter.
:param str filename: Filename to write to. If None no file is written.
:param xltable.Workbook: Workbook this sheet belongs to. If None a new workbook
will be created with this worksheet as the only sheet.
:return: :py:class:`xlsxwriter.... | [
"Write",
"worksheet",
"to",
"a",
".",
"xlsx",
"file",
"using",
"xlsxwriter",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/worksheet.py#L433-L630 | train | Write this worksheet to a. xlsx file using xlsxwriter. |
redhat-cip/python-dciclient | dciclient/v1/api/file.py | create | def create(context, name, content=None, file_path=None, mime='text/plain',
jobstate_id=None, md5=None, job_id=None, test_id=None):
"""Method to create a file on the Control-Server
This method allows one to upload a file to the Control-Server. The file
to be uploaded can be specified in two diffe... | python | def create(context, name, content=None, file_path=None, mime='text/plain',
jobstate_id=None, md5=None, job_id=None, test_id=None):
"""Method to create a file on the Control-Server
This method allows one to upload a file to the Control-Server. The file
to be uploaded can be specified in two diffe... | [
"def",
"create",
"(",
"context",
",",
"name",
",",
"content",
"=",
"None",
",",
"file_path",
"=",
"None",
",",
"mime",
"=",
"'text/plain'",
",",
"jobstate_id",
"=",
"None",
",",
"md5",
"=",
"None",
",",
"job_id",
"=",
"None",
",",
"test_id",
"=",
"No... | Method to create a file on the Control-Server
This method allows one to upload a file to the Control-Server. The file
to be uploaded can be specified in two different ways either by specifying
its content directly or or by specifying the file_path where the file is
located.
content can be in the f... | [
"Method",
"to",
"create",
"a",
"file",
"on",
"the",
"Control",
"-",
"Server"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/api/file.py#L26-L65 | train | Method to create a new file on the Control - Server |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | register_formatter | def register_formatter(field_typestr):
"""Decorate a configuration field formatter function to register it with
the `get_field_formatter` accessor.
This decorator also performs common helpers for the formatter functions:
- Does type checking on the field argument passed to a formatter.
- Assembles... | python | def register_formatter(field_typestr):
"""Decorate a configuration field formatter function to register it with
the `get_field_formatter` accessor.
This decorator also performs common helpers for the formatter functions:
- Does type checking on the field argument passed to a formatter.
- Assembles... | [
"def",
"register_formatter",
"(",
"field_typestr",
")",
":",
"def",
"decorator_register",
"(",
"formatter",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"formatter",
")",
"def",
"wrapped_formatter",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"f... | Decorate a configuration field formatter function to register it with
the `get_field_formatter` accessor.
This decorator also performs common helpers for the formatter functions:
- Does type checking on the field argument passed to a formatter.
- Assembles a section node from the nodes returned by the... | [
"Decorate",
"a",
"configuration",
"field",
"formatter",
"function",
"to",
"register",
"it",
"with",
"the",
"get_field_formatter",
"accessor",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L281-L319 | train | Decorator to register a configuration field formatter function to be used with the get_field_formatter accessor. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_configurablefield_nodes | def format_configurablefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigurableField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``l... | python | def format_configurablefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigurableField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``l... | [
"def",
"format_configurablefield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Custom default target definition list that links to Task topics",
"default_item",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"def... | Create a section node that documents a ConfigurableField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.ConfigurableField``
A configuration field.
field_id : `str`
... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"ConfigurableField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L380-L424 | train | Create a section node that documents a ConfigurableField. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_listfield_nodes | def format_listfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ListField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.L... | python | def format_listfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ListField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.L... | [
"def",
"format_listfield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# ListField's store their item types in the itemtype attribute",
"itemtype_node",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"itemtype_node... | Create a section node that documents a ListField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.ListField``
A configuration field.
field_id : `str`
Unique i... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"ListField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L428-L529 | train | Create a section node that documents a ListField config field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_choicefield_nodes | def format_choicefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ChoiceField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.conf... | python | def format_choicefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ChoiceField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.conf... | [
"def",
"format_choicefield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Create a definition list for the choices",
"choice_dl",
"=",
"nodes",
".",
"definition_list",
"(",
")",
"for",
"choice_value",
",",
"choice... | Create a section node that documents a ChoiceField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.ChoiceField``
A configuration field.
field_id : `str`
Uniq... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"ChoiceField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L533-L605 | train | Create a section node that documents a ChoiceField config field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_rangefield_nodes | def format_rangefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a RangeField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config... | python | def format_rangefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a RangeField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config... | [
"def",
"format_rangefield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Field type",
"field_type_item",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"field_type_item",
".",
"append",
"(",
"nodes",
"."... | Create a section node that documents a RangeField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.RangeField``
A configuration field.
field_id : `str`
Unique... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"RangeField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L609-L670 | train | Create a section node that documents a RangeField config field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_dictfield_nodes | def format_dictfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a DictField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.D... | python | def format_dictfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a DictField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.D... | [
"def",
"format_dictfield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Custom value type field for definition list",
"valuetype_item",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"valuetype_item",
"=",
"no... | Create a section node that documents a DictField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.DictField``
A configuration field.
field_id : `str`
Unique i... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"DictField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L674-L720 | train | Create a section node that documents a DictField config field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_configfield_nodes | def format_configfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.conf... | python | def format_configfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.conf... | [
"def",
"format_configfield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Default data type node",
"dtype_node",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"dtype_node",
"=",
"nodes",
".",
"term",
"(... | Create a section node that documents a ConfigField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.ConfigField``
A configuration field.
field_id : `str`
Uniq... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"ConfigField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L724-L768 | train | Create a section node that documents a ConfigField config field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_configchoicefield_nodes | def format_configchoicefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigChoiceField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``l... | python | def format_configchoicefield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigChoiceField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``l... | [
"def",
"format_configchoicefield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Create a definition list for the choices",
"choice_dl",
"=",
"nodes",
".",
"definition_list",
"(",
")",
"for",
"choice_value",
",",
"... | Create a section node that documents a ConfigChoiceField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.ConfigChoiceField``
A configuration field.
field_id : `str`
... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"ConfigChoiceField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L772-L846 | train | Create a section node that documents a ConfigChoiceField config field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_configdictfield_nodes | def format_configdictfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigDictField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.... | python | def format_configdictfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a ConfigDictField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.... | [
"def",
"format_configdictfield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Valuetype links to a Config task topic",
"value_item",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"value_item",
"+=",
"nodes",
... | Create a section node that documents a ConfigDictField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.ConfigDictField``
A configuration field.
field_id : `str`
... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"ConfigDictField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L850-L895 | train | Create a section node that documents a ConfigDictField. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | format_registryfield_nodes | def format_registryfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a RegistryField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.... | python | def format_registryfield_nodes(field_name, field, field_id, state, lineno):
"""Create a section node that documents a RegistryField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.... | [
"def",
"format_registryfield_nodes",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"from",
"lsst",
".",
"pex",
".",
"config",
".",
"registry",
"import",
"ConfigurableWrapper",
"# Create a definition list for the choices",
"... | Create a section node that documents a RegistryField config field.
Parameters
----------
field_name : `str`
Name of the configuration field (the attribute name of on the config
class).
field : ``lsst.pex.config.RegistryField``
A configuration field.
field_id : `str`
... | [
"Create",
"a",
"section",
"node",
"that",
"documents",
"a",
"RegistryField",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L899-L990 | train | Create a section node that documents a RegistryField config field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | create_field_type_item_node | def create_field_type_item_node(field, state):
"""Create a definition list item node that describes a field's type.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``state`` attribute.
... | python | def create_field_type_item_node(field, state):
"""Create a definition list item node that describes a field's type.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``state`` attribute.
... | [
"def",
"create_field_type_item_node",
"(",
"field",
",",
"state",
")",
":",
"type_item",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"type_item",
".",
"append",
"(",
"nodes",
".",
"term",
"(",
"text",
"=",
"\"Field type\"",
")",
")",
"type_item_conten... | Create a definition list item node that describes a field's type.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``state`` attribute.
Returns
-------
``docutils.nodes.definition_... | [
"Create",
"a",
"definition",
"list",
"item",
"node",
"that",
"describes",
"a",
"field",
"s",
"type",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L993-L1020 | train | Create a definition list item node that describes a field s type. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | create_default_item_node | def create_default_item_node(field, state):
"""Create a definition list item node that describes the default value
of a Field config.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``... | python | def create_default_item_node(field, state):
"""Create a definition list item node that describes the default value
of a Field config.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``... | [
"def",
"create_default_item_node",
"(",
"field",
",",
"state",
")",
":",
"default_item",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"default_item",
".",
"append",
"(",
"nodes",
".",
"term",
"(",
"text",
"=",
"\"Default\"",
")",
")",
"default_item_con... | Create a definition list item node that describes the default value
of a Field config.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``state`` attribute.
Returns
-------
``d... | [
"Create",
"a",
"definition",
"list",
"item",
"node",
"that",
"describes",
"the",
"default",
"value",
"of",
"a",
"Field",
"config",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L1023-L1047 | train | Create a definition list item node that describes the default value of a ConfigurableField config. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | create_keytype_item_node | def create_keytype_item_node(field, state):
"""Create a definition list item node that describes the key type
of a dict-type config field.
Parameters
----------
field : ``lsst.pex.config.Field``
A ``lsst.pex.config.DictField`` or ``lsst.pex.config.DictConfigField``.
state : ``docutils.s... | python | def create_keytype_item_node(field, state):
"""Create a definition list item node that describes the key type
of a dict-type config field.
Parameters
----------
field : ``lsst.pex.config.Field``
A ``lsst.pex.config.DictField`` or ``lsst.pex.config.DictConfigField``.
state : ``docutils.s... | [
"def",
"create_keytype_item_node",
"(",
"field",
",",
"state",
")",
":",
"keytype_node",
"=",
"nodes",
".",
"definition_list_item",
"(",
")",
"keytype_node",
"=",
"nodes",
".",
"term",
"(",
"text",
"=",
"'Key type'",
")",
"keytype_def",
"=",
"nodes",
".",
"d... | Create a definition list item node that describes the key type
of a dict-type config field.
Parameters
----------
field : ``lsst.pex.config.Field``
A ``lsst.pex.config.DictField`` or ``lsst.pex.config.DictConfigField``.
state : ``docutils.statemachine.State``
Usually the directive's... | [
"Create",
"a",
"definition",
"list",
"item",
"node",
"that",
"describes",
"the",
"key",
"type",
"of",
"a",
"dict",
"-",
"type",
"config",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L1050-L1074 | train | Create a definition list item node that describes the key type for the given field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | create_description_node | def create_description_node(field, state):
"""Creates docutils nodes for the Field's description, built from the
field's ``doc`` and ``optional`` attributes.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Us... | python | def create_description_node(field, state):
"""Creates docutils nodes for the Field's description, built from the
field's ``doc`` and ``optional`` attributes.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Us... | [
"def",
"create_description_node",
"(",
"field",
",",
"state",
")",
":",
"doc_container_node",
"=",
"nodes",
".",
"container",
"(",
")",
"doc_container_node",
"+=",
"parse_rst_content",
"(",
"field",
".",
"doc",
",",
"state",
")",
"return",
"doc_container_node"
] | Creates docutils nodes for the Field's description, built from the
field's ``doc`` and ``optional`` attributes.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``state`` attribute.
Re... | [
"Creates",
"docutils",
"nodes",
"for",
"the",
"Field",
"s",
"description",
"built",
"from",
"the",
"field",
"s",
"doc",
"and",
"optional",
"attributes",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L1077-L1096 | train | Creates a node that represents the description of the given field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | create_title_node | def create_title_node(field_name, field, field_id, state, lineno):
"""Create docutils nodes for the configuration field's title and
reference target node.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usual... | python | def create_title_node(field_name, field, field_id, state, lineno):
"""Create docutils nodes for the configuration field's title and
reference target node.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usual... | [
"def",
"create_title_node",
"(",
"field_name",
",",
"field",
",",
"field_id",
",",
"state",
",",
"lineno",
")",
":",
"# Reference target",
"env",
"=",
"state",
".",
"document",
".",
"settings",
".",
"env",
"ref_target",
"=",
"create_configfield_ref_target_node",
... | Create docutils nodes for the configuration field's title and
reference target node.
Parameters
----------
field : ``lsst.pex.config.Field``
A configuration field.
state : ``docutils.statemachine.State``
Usually the directive's ``state`` attribute.
Returns
-------
``doc... | [
"Create",
"docutils",
"nodes",
"for",
"the",
"configuration",
"field",
"s",
"title",
"and",
"reference",
"target",
"node",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L1099-L1124 | train | Create docutils nodes for the configuration field s title and reference target node. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | create_configfield_ref_target_node | def create_configfield_ref_target_node(target_id, env, lineno):
"""Create a ``target`` node that marks a configuration field.
Internally, this also adds to the ``lsst_configfields`` attribute of the
environment that is consumed by `documenteer.sphinxext.lssttasks.
crossrefs.process_pending_configfield_... | python | def create_configfield_ref_target_node(target_id, env, lineno):
"""Create a ``target`` node that marks a configuration field.
Internally, this also adds to the ``lsst_configfields`` attribute of the
environment that is consumed by `documenteer.sphinxext.lssttasks.
crossrefs.process_pending_configfield_... | [
"def",
"create_configfield_ref_target_node",
"(",
"target_id",
",",
"env",
",",
"lineno",
")",
":",
"target_node",
"=",
"nodes",
".",
"target",
"(",
"''",
",",
"''",
",",
"ids",
"=",
"[",
"target_id",
"]",
")",
"# Store these task/configurable topic nodes in the e... | Create a ``target`` node that marks a configuration field.
Internally, this also adds to the ``lsst_configfields`` attribute of the
environment that is consumed by `documenteer.sphinxext.lssttasks.
crossrefs.process_pending_configfield_xref_nodes`.
See also
--------
`documenteer.sphinxext.lsst... | [
"Create",
"a",
"target",
"node",
"that",
"marks",
"a",
"configuration",
"field",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L1127-L1150 | train | Create a target node that marks a configuration field. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | ConfigFieldListingDirective.run | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
from lsst.pex.config import ConfigurableField, RegistryField
logger = getLogger(__name__)
try:
task_class_name = self.a... | python | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
from lsst.pex.config import ConfigurableField, RegistryField
logger = getLogger(__name__)
try:
task_class_name = self.a... | [
"def",
"run",
"(",
"self",
")",
":",
"from",
"lsst",
".",
"pex",
".",
"config",
"import",
"ConfigurableField",
",",
"RegistryField",
"logger",
"=",
"getLogger",
"(",
"__name__",
")",
"try",
":",
"task_class_name",
"=",
"self",
".",
"arguments",
"[",
"0",
... | Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree. | [
"Main",
"entrypoint",
"method",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L48-L100 | train | Main entrypoint method. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | SubtaskListingDirective.run | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
logger = getLogger(__name__)
try:
task_class_name = self.arguments[0]
except IndexError:
raise SphinxError(
... | python | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
logger = getLogger(__name__)
try:
task_class_name = self.arguments[0]
except IndexError:
raise SphinxError(
... | [
"def",
"run",
"(",
"self",
")",
":",
"logger",
"=",
"getLogger",
"(",
"__name__",
")",
"try",
":",
"task_class_name",
"=",
"self",
".",
"arguments",
"[",
"0",
"]",
"except",
"IndexError",
":",
"raise",
"SphinxError",
"(",
"'{} directive requires a Task class n... | Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree. | [
"Main",
"entrypoint",
"method",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L129-L174 | train | Main entrypoint method. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/configfieldlists.py | StandaloneConfigFieldsDirective.run | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
logger = getLogger(__name__)
try:
config_class_name = self.arguments[0]
except IndexError:
raise SphinxError... | python | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
logger = getLogger(__name__)
try:
config_class_name = self.arguments[0]
except IndexError:
raise SphinxError... | [
"def",
"run",
"(",
"self",
")",
":",
"logger",
"=",
"getLogger",
"(",
"__name__",
")",
"try",
":",
"config_class_name",
"=",
"self",
".",
"arguments",
"[",
"0",
"]",
"except",
"IndexError",
":",
"raise",
"SphinxError",
"(",
"'{} directive requires a Config cla... | Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree. | [
"Main",
"entrypoint",
"method",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/configfieldlists.py#L191-L239 | train | Main entrypoint method. |
mojaie/chorus | chorus/patty.py | assign_type | def assign_type(mol, force_recalc=False):
""" PATTY [Bush et al. J. Inf. Comput. Sci 33 (1993) 756-762]
TODO: not yet implemented
1:cation 2:anion 3:donor 4:acceptor
5:polar 6:hydrophobe 7:others
"""
if "PATTY" in mol.descriptors and not force_recalc:
return
mol.require("Phys_charge... | python | def assign_type(mol, force_recalc=False):
""" PATTY [Bush et al. J. Inf. Comput. Sci 33 (1993) 756-762]
TODO: not yet implemented
1:cation 2:anion 3:donor 4:acceptor
5:polar 6:hydrophobe 7:others
"""
if "PATTY" in mol.descriptors and not force_recalc:
return
mol.require("Phys_charge... | [
"def",
"assign_type",
"(",
"mol",
",",
"force_recalc",
"=",
"False",
")",
":",
"if",
"\"PATTY\"",
"in",
"mol",
".",
"descriptors",
"and",
"not",
"force_recalc",
":",
"return",
"mol",
".",
"require",
"(",
"\"Phys_charge\"",
")",
"for",
"i",
",",
"atom",
"... | PATTY [Bush et al. J. Inf. Comput. Sci 33 (1993) 756-762]
TODO: not yet implemented
1:cation 2:anion 3:donor 4:acceptor
5:polar 6:hydrophobe 7:others | [
"PATTY",
"[",
"Bush",
"et",
"al",
".",
"J",
".",
"Inf",
".",
"Comput",
".",
"Sci",
"33",
"(",
"1993",
")",
"756",
"-",
"762",
"]",
"TODO",
":",
"not",
"yet",
"implemented"
] | fc7fe23a0272554c67671645ab07830b315eeb1b | https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/patty.py#L7-L50 | train | Assign type to all atoms in the current molecule. |
Paradoxis/PIP-Module-Scanner | pip_module_scanner/__main__.py | main | def main():
"""
Main entry point of the scanner
:return: void
"""
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--out", help="Output results to a file instead of stdout", default=None)
parser.add_argument("-p", "--path", help="Specifies the target directory to search in", def... | python | def main():
"""
Main entry point of the scanner
:return: void
"""
parser = argparse.ArgumentParser()
parser.add_argument("-o", "--out", help="Output results to a file instead of stdout", default=None)
parser.add_argument("-p", "--path", help="Specifies the target directory to search in", def... | [
"def",
"main",
"(",
")",
":",
"parser",
"=",
"argparse",
".",
"ArgumentParser",
"(",
")",
"parser",
".",
"add_argument",
"(",
"\"-o\"",
",",
"\"--out\"",
",",
"help",
"=",
"\"Output results to a file instead of stdout\"",
",",
"default",
"=",
"None",
")",
"par... | Main entry point of the scanner
:return: void | [
"Main",
"entry",
"point",
"of",
"the",
"scanner",
":",
"return",
":",
"void"
] | 168c62050b8217df0167b7d59405dcb1421cf50d | https://github.com/Paradoxis/PIP-Module-Scanner/blob/168c62050b8217df0167b7d59405dcb1421cf50d/pip_module_scanner/__main__.py#L8-L25 | train | Entry point of the scanner
|
bgyori/pykqml | kqml/kqml_module.py | translate_argv | def translate_argv(raw_args):
"""Enables conversion from system arguments.
Parameters
----------
raw_args : list
Arguments taken raw from the system input.
Returns
-------
kwargs : dict
The input arguments formatted as a kwargs dict.
To use as input, simply use `KQM... | python | def translate_argv(raw_args):
"""Enables conversion from system arguments.
Parameters
----------
raw_args : list
Arguments taken raw from the system input.
Returns
-------
kwargs : dict
The input arguments formatted as a kwargs dict.
To use as input, simply use `KQM... | [
"def",
"translate_argv",
"(",
"raw_args",
")",
":",
"kwargs",
"=",
"{",
"}",
"def",
"get_parameter",
"(",
"param_str",
")",
":",
"for",
"i",
",",
"a",
"in",
"enumerate",
"(",
"raw_args",
")",
":",
"if",
"a",
"==",
"param_str",
":",
"assert",
"len",
"... | Enables conversion from system arguments.
Parameters
----------
raw_args : list
Arguments taken raw from the system input.
Returns
-------
kwargs : dict
The input arguments formatted as a kwargs dict.
To use as input, simply use `KQMLModule(**kwargs)`. | [
"Enables",
"conversion",
"from",
"system",
"arguments",
"."
] | c18b39868626215deb634567c6bd7c0838e443c0 | https://github.com/bgyori/pykqml/blob/c18b39868626215deb634567c6bd7c0838e443c0/kqml/kqml_module.py#L22-L75 | train | Enables conversion from system arguments. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/topiclists.py | process_task_topic_list | def process_task_topic_list(app, doctree, fromdocname):
"""Process the ``task_topic_list`` node to generate a rendered listing of
Task, Configurable, or Config topics (as determined by the types
key of the ``task_topic_list`` node).
This is called during the "doctree-resolved" phase so that the
``l... | python | def process_task_topic_list(app, doctree, fromdocname):
"""Process the ``task_topic_list`` node to generate a rendered listing of
Task, Configurable, or Config topics (as determined by the types
key of the ``task_topic_list`` node).
This is called during the "doctree-resolved" phase so that the
``l... | [
"def",
"process_task_topic_list",
"(",
"app",
",",
"doctree",
",",
"fromdocname",
")",
":",
"logger",
"=",
"getLogger",
"(",
"__name__",
")",
"logger",
".",
"debug",
"(",
"'Started process_task_list'",
")",
"env",
"=",
"app",
".",
"builder",
".",
"env",
"for... | Process the ``task_topic_list`` node to generate a rendered listing of
Task, Configurable, or Config topics (as determined by the types
key of the ``task_topic_list`` node).
This is called during the "doctree-resolved" phase so that the
``lsst_task_topcs`` environment attribute is fully set. | [
"Process",
"the",
"task_topic_list",
"node",
"to",
"generate",
"a",
"rendered",
"listing",
"of",
"Task",
"Configurable",
"or",
"Config",
"topics",
"(",
"as",
"determined",
"by",
"the",
"types",
"key",
"of",
"the",
"task_topic_list",
"node",
")",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/topiclists.py#L176-L257 | train | Processes the task_topic_list node and generates a rendered listing of all the tasks that are defined by the topics in the task_topic_list environment attribute. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/topiclists.py | BaseTopicListDirective.run | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
self._env = self.state.document.settings.env
nodes = []
if 'toctree' in self.options:
# Insert a hidden toctree
... | python | def run(self):
"""Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree.
"""
self._env = self.state.document.settings.env
nodes = []
if 'toctree' in self.options:
# Insert a hidden toctree
... | [
"def",
"run",
"(",
"self",
")",
":",
"self",
".",
"_env",
"=",
"self",
".",
"state",
".",
"document",
".",
"settings",
".",
"env",
"nodes",
"=",
"[",
"]",
"if",
"'toctree'",
"in",
"self",
".",
"options",
":",
"# Insert a hidden toctree",
"toctree_node",
... | Main entrypoint method.
Returns
-------
new_nodes : `list`
Nodes to add to the doctree. | [
"Main",
"entrypoint",
"method",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/topiclists.py#L49-L72 | train | Main entrypoint method. |
lsst-sqre/documenteer | documenteer/sphinxext/lssttasks/topiclists.py | BaseTopicListDirective._build_toctree | def _build_toctree(self):
"""Create a hidden toctree node with the contents of a directory
prefixed by the directory name specified by the `toctree` directive
option.
"""
dirname = posixpath.dirname(self._env.docname)
tree_prefix = self.options['toctree'].strip()
... | python | def _build_toctree(self):
"""Create a hidden toctree node with the contents of a directory
prefixed by the directory name specified by the `toctree` directive
option.
"""
dirname = posixpath.dirname(self._env.docname)
tree_prefix = self.options['toctree'].strip()
... | [
"def",
"_build_toctree",
"(",
"self",
")",
":",
"dirname",
"=",
"posixpath",
".",
"dirname",
"(",
"self",
".",
"_env",
".",
"docname",
")",
"tree_prefix",
"=",
"self",
".",
"options",
"[",
"'toctree'",
"]",
".",
"strip",
"(",
")",
"root",
"=",
"posixpa... | Create a hidden toctree node with the contents of a directory
prefixed by the directory name specified by the `toctree` directive
option. | [
"Create",
"a",
"hidden",
"toctree",
"node",
"with",
"the",
"contents",
"of",
"a",
"directory",
"prefixed",
"by",
"the",
"directory",
"name",
"specified",
"by",
"the",
"toctree",
"directive",
"option",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/lssttasks/topiclists.py#L74-L104 | train | Create a hidden toctree node with the contents of a directory
prefixed by the directory name specified by the toctree directive
option. |
mojaie/chorus | chorus/util/iterator.py | consecutive | def consecutive(iterable, n):
"""
consecutive('ABCDEF', 3) --> ABC BCD CDE DEF
consecutive(itertools.cycle(iter), n) to get looped sequence
"""
iterators = itertools.tee(iterable, n)
for i, it in enumerate(iterators):
for _ in range(i):
next(it, None)
return zip(*iterator... | python | def consecutive(iterable, n):
"""
consecutive('ABCDEF', 3) --> ABC BCD CDE DEF
consecutive(itertools.cycle(iter), n) to get looped sequence
"""
iterators = itertools.tee(iterable, n)
for i, it in enumerate(iterators):
for _ in range(i):
next(it, None)
return zip(*iterator... | [
"def",
"consecutive",
"(",
"iterable",
",",
"n",
")",
":",
"iterators",
"=",
"itertools",
".",
"tee",
"(",
"iterable",
",",
"n",
")",
"for",
"i",
",",
"it",
"in",
"enumerate",
"(",
"iterators",
")",
":",
"for",
"_",
"in",
"range",
"(",
"i",
")",
... | consecutive('ABCDEF', 3) --> ABC BCD CDE DEF
consecutive(itertools.cycle(iter), n) to get looped sequence | [
"consecutive",
"(",
"ABCDEF",
"3",
")",
"--",
">",
"ABC",
"BCD",
"CDE",
"DEF",
"consecutive",
"(",
"itertools",
".",
"cycle",
"(",
"iter",
")",
"n",
")",
"to",
"get",
"looped",
"sequence"
] | fc7fe23a0272554c67671645ab07830b315eeb1b | https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/util/iterator.py#L10-L19 | train | get consecutive sequence of objects |
mojaie/chorus | chorus/util/iterator.py | chunk | def chunk(iterable, size):
"""
chunk('ABCDEFG', 3) --> ABC DEF G
"""
# TODO: only used in gui.mainwindow(deprecated)
iterator = iter(iterable)
while size:
result = []
try:
for i in range(size):
elem = next(iterator)
result.append(elem)
... | python | def chunk(iterable, size):
"""
chunk('ABCDEFG', 3) --> ABC DEF G
"""
# TODO: only used in gui.mainwindow(deprecated)
iterator = iter(iterable)
while size:
result = []
try:
for i in range(size):
elem = next(iterator)
result.append(elem)
... | [
"def",
"chunk",
"(",
"iterable",
",",
"size",
")",
":",
"# TODO: only used in gui.mainwindow(deprecated)",
"iterator",
"=",
"iter",
"(",
"iterable",
")",
"while",
"size",
":",
"result",
"=",
"[",
"]",
"try",
":",
"for",
"i",
"in",
"range",
"(",
"size",
")"... | chunk('ABCDEFG', 3) --> ABC DEF G | [
"chunk",
"(",
"ABCDEFG",
"3",
")",
"--",
">",
"ABC",
"DEF",
"G"
] | fc7fe23a0272554c67671645ab07830b315eeb1b | https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/util/iterator.py#L31-L47 | train | Yields size elements from iterable |
mojaie/chorus | chorus/util/iterator.py | chunk_fill | def chunk_fill(iterable, size, fillvalue=None):
"""
chunk_fill('ABCDEFG', 3, 'x') --> ABC DEF Gxx
"""
# TODO: not used
args = [iter(iterable)] * size
return itertools.zip_longest(*args, fillvalue=fillvalue) | python | def chunk_fill(iterable, size, fillvalue=None):
"""
chunk_fill('ABCDEFG', 3, 'x') --> ABC DEF Gxx
"""
# TODO: not used
args = [iter(iterable)] * size
return itertools.zip_longest(*args, fillvalue=fillvalue) | [
"def",
"chunk_fill",
"(",
"iterable",
",",
"size",
",",
"fillvalue",
"=",
"None",
")",
":",
"# TODO: not used",
"args",
"=",
"[",
"iter",
"(",
"iterable",
")",
"]",
"*",
"size",
"return",
"itertools",
".",
"zip_longest",
"(",
"*",
"args",
",",
"fillvalue... | chunk_fill('ABCDEFG', 3, 'x') --> ABC DEF Gxx | [
"chunk_fill",
"(",
"ABCDEFG",
"3",
"x",
")",
"--",
">",
"ABC",
"DEF",
"Gxx"
] | fc7fe23a0272554c67671645ab07830b315eeb1b | https://github.com/mojaie/chorus/blob/fc7fe23a0272554c67671645ab07830b315eeb1b/chorus/util/iterator.py#L59-L65 | train | Returns a generator that yields a chunk of size with fillvalue. |
mastro35/flows | flows/Actions/WebserverAction.py | MyServerRequestHandler.do_GET | def do_GET(self):
"""
Handle GET WebMethod
"""
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(bytes(json.dumps(self.message), "utf-8")) | python | def do_GET(self):
"""
Handle GET WebMethod
"""
self.send_response(200)
self.send_header("Content-type", "text/html")
self.end_headers()
self.wfile.write(bytes(json.dumps(self.message), "utf-8")) | [
"def",
"do_GET",
"(",
"self",
")",
":",
"self",
".",
"send_response",
"(",
"200",
")",
"self",
".",
"send_header",
"(",
"\"Content-type\"",
",",
"\"text/html\"",
")",
"self",
".",
"end_headers",
"(",
")",
"self",
".",
"wfile",
".",
"write",
"(",
"bytes",... | Handle GET WebMethod | [
"Handle",
"GET",
"WebMethod"
] | 05e488385673a69597b5b39c7728795aa4d5eb18 | https://github.com/mastro35/flows/blob/05e488385673a69597b5b39c7728795aa4d5eb18/flows/Actions/WebserverAction.py#L76-L84 | train | Handle GET WebMethod
|
mastro35/flows | flows/Actions/WebserverAction.py | DannyHTTPServer.serve_forever | def serve_forever(self, poll_interval=0.5):
"""
Cycle for webserer
"""
while self.is_alive:
self.handle_request()
time.sleep(poll_interval) | python | def serve_forever(self, poll_interval=0.5):
"""
Cycle for webserer
"""
while self.is_alive:
self.handle_request()
time.sleep(poll_interval) | [
"def",
"serve_forever",
"(",
"self",
",",
"poll_interval",
"=",
"0.5",
")",
":",
"while",
"self",
".",
"is_alive",
":",
"self",
".",
"handle_request",
"(",
")",
"time",
".",
"sleep",
"(",
"poll_interval",
")"
] | Cycle for webserer | [
"Cycle",
"for",
"webserer"
] | 05e488385673a69597b5b39c7728795aa4d5eb18 | https://github.com/mastro35/flows/blob/05e488385673a69597b5b39c7728795aa4d5eb18/flows/Actions/WebserverAction.py#L100-L106 | train | Start serving for the current request. |
mastro35/flows | flows/Actions/WebserverAction.py | DannyHTTPServer.stop | def stop(self):
"""
Stop the webserver
"""
self.is_alive = False
self.server_close()
flows.Global.LOGGER.info("Server Stops " + (str(self.server_address))) | python | def stop(self):
"""
Stop the webserver
"""
self.is_alive = False
self.server_close()
flows.Global.LOGGER.info("Server Stops " + (str(self.server_address))) | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"is_alive",
"=",
"False",
"self",
".",
"server_close",
"(",
")",
"flows",
".",
"Global",
".",
"LOGGER",
".",
"info",
"(",
"\"Server Stops \"",
"+",
"(",
"str",
"(",
"self",
".",
"server_address",
")",
... | Stop the webserver | [
"Stop",
"the",
"webserver"
] | 05e488385673a69597b5b39c7728795aa4d5eb18 | https://github.com/mastro35/flows/blob/05e488385673a69597b5b39c7728795aa4d5eb18/flows/Actions/WebserverAction.py#L108-L114 | train | Stop the webserver. |
yymao/generic-catalog-reader | GCR/query.py | GCRQuery.check_scalar | def check_scalar(self, scalar_dict):
"""
check if `scalar_dict` satisfy query
"""
table = {k: np.array([v]) for k, v in scalar_dict.items()}
return self.mask(table)[0] | python | def check_scalar(self, scalar_dict):
"""
check if `scalar_dict` satisfy query
"""
table = {k: np.array([v]) for k, v in scalar_dict.items()}
return self.mask(table)[0] | [
"def",
"check_scalar",
"(",
"self",
",",
"scalar_dict",
")",
":",
"table",
"=",
"{",
"k",
":",
"np",
".",
"array",
"(",
"[",
"v",
"]",
")",
"for",
"k",
",",
"v",
"in",
"scalar_dict",
".",
"items",
"(",
")",
"}",
"return",
"self",
".",
"mask",
"... | check if `scalar_dict` satisfy query | [
"check",
"if",
"scalar_dict",
"satisfy",
"query"
] | bc6267ac41b9f68106ed6065184469ac13fdc0b6 | https://github.com/yymao/generic-catalog-reader/blob/bc6267ac41b9f68106ed6065184469ac13fdc0b6/GCR/query.py#L28-L33 | train | check if scalar_dict satisfy query
|
untwisted/untwisted | untwisted/stdin.py | Stdin.dumpfile | def dumpfile(self, fd):
"""
Dump a file through a Spin instance.
"""
self.start()
dump = DumpFile(fd)
self.queue.append(dump) | python | def dumpfile(self, fd):
"""
Dump a file through a Spin instance.
"""
self.start()
dump = DumpFile(fd)
self.queue.append(dump) | [
"def",
"dumpfile",
"(",
"self",
",",
"fd",
")",
":",
"self",
".",
"start",
"(",
")",
"dump",
"=",
"DumpFile",
"(",
"fd",
")",
"self",
".",
"queue",
".",
"append",
"(",
"dump",
")"
] | Dump a file through a Spin instance. | [
"Dump",
"a",
"file",
"through",
"a",
"Spin",
"instance",
"."
] | 8a8d9c8a8d0f3452d5de67cd760297bb5759f637 | https://github.com/untwisted/untwisted/blob/8a8d9c8a8d0f3452d5de67cd760297bb5759f637/untwisted/stdin.py#L62-L69 | train | Dump a file through a Spin instance. |
lsst-sqre/documenteer | documenteer/sphinxext/remotecodeblock.py | RemoteCodeBlock.run | def run(self):
"""Run the ``remote-code-block`` directive.
"""
document = self.state.document
if not document.settings.file_insertion_enabled:
return [document.reporter.warning('File insertion disabled',
line=self.lineno)]
... | python | def run(self):
"""Run the ``remote-code-block`` directive.
"""
document = self.state.document
if not document.settings.file_insertion_enabled:
return [document.reporter.warning('File insertion disabled',
line=self.lineno)]
... | [
"def",
"run",
"(",
"self",
")",
":",
"document",
"=",
"self",
".",
"state",
".",
"document",
"if",
"not",
"document",
".",
"settings",
".",
"file_insertion_enabled",
":",
"return",
"[",
"document",
".",
"reporter",
".",
"warning",
"(",
"'File insertion disab... | Run the ``remote-code-block`` directive. | [
"Run",
"the",
"remote",
"-",
"code",
"-",
"block",
"directive",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/remotecodeblock.py#L75-L124 | train | Run the remote - code - block directive. |
lsst-sqre/documenteer | documenteer/sphinxext/remotecodeblock.py | RemoteCodeBlockReader.read_file | def read_file(self, url, location=None):
"""Read content from the web by overriding
`LiteralIncludeReader.read_file`.
"""
response = requests_retry_session().get(url, timeout=10.0)
response.raise_for_status()
text = response.text
if 'tab-width' in self.options:
... | python | def read_file(self, url, location=None):
"""Read content from the web by overriding
`LiteralIncludeReader.read_file`.
"""
response = requests_retry_session().get(url, timeout=10.0)
response.raise_for_status()
text = response.text
if 'tab-width' in self.options:
... | [
"def",
"read_file",
"(",
"self",
",",
"url",
",",
"location",
"=",
"None",
")",
":",
"response",
"=",
"requests_retry_session",
"(",
")",
".",
"get",
"(",
"url",
",",
"timeout",
"=",
"10.0",
")",
"response",
".",
"raise_for_status",
"(",
")",
"text",
"... | Read content from the web by overriding
`LiteralIncludeReader.read_file`. | [
"Read",
"content",
"from",
"the",
"web",
"by",
"overriding",
"LiteralIncludeReader",
".",
"read_file",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/sphinxext/remotecodeblock.py#L131-L141 | train | Read content from the web by overriding
. read_file. |
mastro35/flows | flows/Actions/PassOnInterval.py | PassOnInterval.verify_time | def verify_time(self, now):
'''Verify the time'''
return now.time() >= self.start_time and now.time() <= self.end_time | python | def verify_time(self, now):
'''Verify the time'''
return now.time() >= self.start_time and now.time() <= self.end_time | [
"def",
"verify_time",
"(",
"self",
",",
"now",
")",
":",
"return",
"now",
".",
"time",
"(",
")",
">=",
"self",
".",
"start_time",
"and",
"now",
".",
"time",
"(",
")",
"<=",
"self",
".",
"end_time"
] | Verify the time | [
"Verify",
"the",
"time"
] | 05e488385673a69597b5b39c7728795aa4d5eb18 | https://github.com/mastro35/flows/blob/05e488385673a69597b5b39c7728795aa4d5eb18/flows/Actions/PassOnInterval.py#L63-L65 | train | Verify the time |
mastro35/flows | flows/Actions/PassOnInterval.py | PassOnInterval.verify_weekday | def verify_weekday(self, now):
'''Verify the weekday'''
return self.weekdays == "*" or str(now.weekday()) in self.weekdays.split(" ") | python | def verify_weekday(self, now):
'''Verify the weekday'''
return self.weekdays == "*" or str(now.weekday()) in self.weekdays.split(" ") | [
"def",
"verify_weekday",
"(",
"self",
",",
"now",
")",
":",
"return",
"self",
".",
"weekdays",
"==",
"\"*\"",
"or",
"str",
"(",
"now",
".",
"weekday",
"(",
")",
")",
"in",
"self",
".",
"weekdays",
".",
"split",
"(",
"\" \"",
")"
] | Verify the weekday | [
"Verify",
"the",
"weekday"
] | 05e488385673a69597b5b39c7728795aa4d5eb18 | https://github.com/mastro35/flows/blob/05e488385673a69597b5b39c7728795aa4d5eb18/flows/Actions/PassOnInterval.py#L67-L69 | train | Verify the weekday |
mastro35/flows | flows/Actions/PassOnInterval.py | PassOnInterval.verify_day | def verify_day(self, now):
'''Verify the day'''
return self.day == "*" or str(now.day) in self.day.split(" ") | python | def verify_day(self, now):
'''Verify the day'''
return self.day == "*" or str(now.day) in self.day.split(" ") | [
"def",
"verify_day",
"(",
"self",
",",
"now",
")",
":",
"return",
"self",
".",
"day",
"==",
"\"*\"",
"or",
"str",
"(",
"now",
".",
"day",
")",
"in",
"self",
".",
"day",
".",
"split",
"(",
"\" \"",
")"
] | Verify the day | [
"Verify",
"the",
"day"
] | 05e488385673a69597b5b39c7728795aa4d5eb18 | https://github.com/mastro35/flows/blob/05e488385673a69597b5b39c7728795aa4d5eb18/flows/Actions/PassOnInterval.py#L71-L73 | train | Verify the day |
mastro35/flows | flows/Actions/PassOnInterval.py | PassOnInterval.verify_month | def verify_month(self, now):
'''Verify the month'''
return self.month == "*" or str(now.month) in self.month.split(" ") | python | def verify_month(self, now):
'''Verify the month'''
return self.month == "*" or str(now.month) in self.month.split(" ") | [
"def",
"verify_month",
"(",
"self",
",",
"now",
")",
":",
"return",
"self",
".",
"month",
"==",
"\"*\"",
"or",
"str",
"(",
"now",
".",
"month",
")",
"in",
"self",
".",
"month",
".",
"split",
"(",
"\" \"",
")"
] | Verify the month | [
"Verify",
"the",
"month"
] | 05e488385673a69597b5b39c7728795aa4d5eb18 | https://github.com/mastro35/flows/blob/05e488385673a69597b5b39c7728795aa4d5eb18/flows/Actions/PassOnInterval.py#L75-L77 | train | Verify the month |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.aggregate_duplicates | def aggregate_duplicates(X, Y, aggregator="mean", precision=precision):
""" A function that will attempt to collapse duplicates in
domain space, X, by aggregating values over the range space,
Y.
@ In, X, an m-by-n array of values specifying m
n-dimensional samples... | python | def aggregate_duplicates(X, Y, aggregator="mean", precision=precision):
""" A function that will attempt to collapse duplicates in
domain space, X, by aggregating values over the range space,
Y.
@ In, X, an m-by-n array of values specifying m
n-dimensional samples... | [
"def",
"aggregate_duplicates",
"(",
"X",
",",
"Y",
",",
"aggregator",
"=",
"\"mean\"",
",",
"precision",
"=",
"precision",
")",
":",
"if",
"callable",
"(",
"aggregator",
")",
":",
"pass",
"elif",
"\"min\"",
"in",
"aggregator",
".",
"lower",
"(",
")",
":"... | A function that will attempt to collapse duplicates in
domain space, X, by aggregating values over the range space,
Y.
@ In, X, an m-by-n array of values specifying m
n-dimensional samples
@ In, Y, a m vector of values specifying the output
respons... | [
"A",
"function",
"that",
"will",
"attempt",
"to",
"collapse",
"duplicates",
"in",
"domain",
"space",
"X",
"by",
"aggregating",
"values",
"over",
"the",
"range",
"space",
"Y",
"."
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L19-L94 | train | A function that will attempt to collapse duplicates in the domain space X and Y by aggregating values over the range space Y. |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.reset | def reset(self):
"""
Empties all internal storage containers
"""
self.X = []
self.Y = []
self.w = []
self.Xnorm = []
self.graph_rep = None | python | def reset(self):
"""
Empties all internal storage containers
"""
self.X = []
self.Y = []
self.w = []
self.Xnorm = []
self.graph_rep = None | [
"def",
"reset",
"(",
"self",
")",
":",
"self",
".",
"X",
"=",
"[",
"]",
"self",
".",
"Y",
"=",
"[",
"]",
"self",
".",
"w",
"=",
"[",
"]",
"self",
".",
"Xnorm",
"=",
"[",
"]",
"self",
".",
"graph_rep",
"=",
"None"
] | Empties all internal storage containers | [
"Empties",
"all",
"internal",
"storage",
"containers"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L156-L166 | train | Resets all internal storage containers to their initial state. |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.__set_data | def __set_data(self, X, Y, w=None):
""" Internally assigns the input data and normalizes it
according to the user's specifications
@ In, X, an m-by-n array of values specifying m
n-dimensional samples
@ In, Y, a m vector of values specifying the output
... | python | def __set_data(self, X, Y, w=None):
""" Internally assigns the input data and normalizes it
according to the user's specifications
@ In, X, an m-by-n array of values specifying m
n-dimensional samples
@ In, Y, a m vector of values specifying the output
... | [
"def",
"__set_data",
"(",
"self",
",",
"X",
",",
"Y",
",",
"w",
"=",
"None",
")",
":",
"self",
".",
"X",
"=",
"X",
"self",
".",
"Y",
"=",
"Y",
"self",
".",
"check_duplicates",
"(",
")",
"if",
"w",
"is",
"not",
"None",
":",
"self",
".",
"w",
... | Internally assigns the input data and normalizes it
according to the user's specifications
@ In, X, an m-by-n array of values specifying m
n-dimensional samples
@ In, Y, a m vector of values specifying the output
responses corresponding to the m samples specif... | [
"Internally",
"assigns",
"the",
"input",
"data",
"and",
"normalizes",
"it",
"according",
"to",
"the",
"user",
"s",
"specifications"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L168-L198 | train | Internally assigns the input data and normalizes the output data according to the user s specifications. |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.build | def build(self, X, Y, w=None, edges=None):
""" Assigns data to this object and builds the requested topological
structure
@ In, X, an m-by-n array of values specifying m
n-dimensional samples
@ In, Y, a m vector of values specifying the output
response... | python | def build(self, X, Y, w=None, edges=None):
""" Assigns data to this object and builds the requested topological
structure
@ In, X, an m-by-n array of values specifying m
n-dimensional samples
@ In, Y, a m vector of values specifying the output
response... | [
"def",
"build",
"(",
"self",
",",
"X",
",",
"Y",
",",
"w",
"=",
"None",
",",
"edges",
"=",
"None",
")",
":",
"self",
".",
"reset",
"(",
")",
"if",
"X",
"is",
"None",
"or",
"Y",
"is",
"None",
":",
"return",
"self",
".",
"__set_data",
"(",
"X",... | Assigns data to this object and builds the requested topological
structure
@ In, X, an m-by-n array of values specifying m
n-dimensional samples
@ In, Y, a m vector of values specifying the output
responses corresponding to the m samples specified by X
... | [
"Assigns",
"data",
"to",
"this",
"object",
"and",
"builds",
"the",
"requested",
"topological",
"structure"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L200-L234 | train | Builds the topological sequence of a single entry in the database. |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.load_data_and_build | def load_data_and_build(self, filename, delimiter=","):
""" Convenience function for directly working with a data file.
This opens a file and reads the data into an array, sets the
data as an nparray and list of dimnames
@ In, filename, string representing the data file
... | python | def load_data_and_build(self, filename, delimiter=","):
""" Convenience function for directly working with a data file.
This opens a file and reads the data into an array, sets the
data as an nparray and list of dimnames
@ In, filename, string representing the data file
... | [
"def",
"load_data_and_build",
"(",
"self",
",",
"filename",
",",
"delimiter",
"=",
"\",\"",
")",
":",
"data",
"=",
"np",
".",
"genfromtxt",
"(",
"filename",
",",
"dtype",
"=",
"float",
",",
"delimiter",
"=",
"delimiter",
",",
"names",
"=",
"True",
")",
... | Convenience function for directly working with a data file.
This opens a file and reads the data into an array, sets the
data as an nparray and list of dimnames
@ In, filename, string representing the data file | [
"Convenience",
"function",
"for",
"directly",
"working",
"with",
"a",
"data",
"file",
".",
"This",
"opens",
"a",
"file",
"and",
"reads",
"the",
"data",
"into",
"an",
"array",
"sets",
"the",
"data",
"as",
"an",
"nparray",
"and",
"list",
"of",
"dimnames"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L236-L250 | train | This method is used to load the data from a file and build the object. |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.get_normed_x | def get_normed_x(self, rows=None, cols=None):
""" Returns the normalized input data requested by the user
@ In, rows, a list of non-negative integers specifying the
row indices to return
@ In, cols, a list of non-negative integers specifying the
column indices to ... | python | def get_normed_x(self, rows=None, cols=None):
""" Returns the normalized input data requested by the user
@ In, rows, a list of non-negative integers specifying the
row indices to return
@ In, cols, a list of non-negative integers specifying the
column indices to ... | [
"def",
"get_normed_x",
"(",
"self",
",",
"rows",
"=",
"None",
",",
"cols",
"=",
"None",
")",
":",
"if",
"rows",
"is",
"None",
":",
"rows",
"=",
"list",
"(",
"range",
"(",
"0",
",",
"self",
".",
"get_sample_size",
"(",
")",
")",
")",
"if",
"cols",... | Returns the normalized input data requested by the user
@ In, rows, a list of non-negative integers specifying the
row indices to return
@ In, cols, a list of non-negative integers specifying the
column indices to return
@ Out, a matrix of floating point value... | [
"Returns",
"the",
"normalized",
"input",
"data",
"requested",
"by",
"the",
"user"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L252-L272 | train | Returns the normalized input data requested by the user
. |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.get_x | def get_x(self, rows=None, cols=None):
""" Returns the input data requested by the user
@ In, rows, a list of non-negative integers specifying the
row indices to return
@ In, cols, a list of non-negative integers specifying the
column indices to return
... | python | def get_x(self, rows=None, cols=None):
""" Returns the input data requested by the user
@ In, rows, a list of non-negative integers specifying the
row indices to return
@ In, cols, a list of non-negative integers specifying the
column indices to return
... | [
"def",
"get_x",
"(",
"self",
",",
"rows",
"=",
"None",
",",
"cols",
"=",
"None",
")",
":",
"if",
"rows",
"is",
"None",
":",
"rows",
"=",
"list",
"(",
"range",
"(",
"0",
",",
"self",
".",
"get_sample_size",
"(",
")",
")",
")",
"if",
"cols",
"is"... | Returns the input data requested by the user
@ In, rows, a list of non-negative integers specifying the
row indices to return
@ In, cols, a list of non-negative integers specifying the
column indices to return
@ Out, a matrix of floating point values specifyin... | [
"Returns",
"the",
"input",
"data",
"requested",
"by",
"the",
"user"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L274-L295 | train | Returns the input data requested by the user
|
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.get_y | def get_y(self, indices=None):
""" Returns the output data requested by the user
@ In, indices, a list of non-negative integers specifying
the row indices to return
@ Out, an nparray of floating point values specifying the output
data values filtered by the indice... | python | def get_y(self, indices=None):
""" Returns the output data requested by the user
@ In, indices, a list of non-negative integers specifying
the row indices to return
@ Out, an nparray of floating point values specifying the output
data values filtered by the indice... | [
"def",
"get_y",
"(",
"self",
",",
"indices",
"=",
"None",
")",
":",
"if",
"indices",
"is",
"None",
":",
"indices",
"=",
"list",
"(",
"range",
"(",
"0",
",",
"self",
".",
"get_sample_size",
"(",
")",
")",
")",
"else",
":",
"if",
"not",
"hasattr",
... | Returns the output data requested by the user
@ In, indices, a list of non-negative integers specifying
the row indices to return
@ Out, an nparray of floating point values specifying the output
data values filtered by the indices input parameter. | [
"Returns",
"the",
"output",
"data",
"requested",
"by",
"the",
"user"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L297-L313 | train | Returns the output data requested by the user
. |
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.get_weights | def get_weights(self, indices=None):
""" Returns the weights requested by the user
@ In, indices, a list of non-negative integers specifying
the row indices to return
@ Out, a list of floating point values specifying the
weights associated to the input data rows f... | python | def get_weights(self, indices=None):
""" Returns the weights requested by the user
@ In, indices, a list of non-negative integers specifying
the row indices to return
@ Out, a list of floating point values specifying the
weights associated to the input data rows f... | [
"def",
"get_weights",
"(",
"self",
",",
"indices",
"=",
"None",
")",
":",
"if",
"indices",
"is",
"None",
":",
"indices",
"=",
"list",
"(",
"range",
"(",
"0",
",",
"self",
".",
"get_sample_size",
"(",
")",
")",
")",
"else",
":",
"indices",
"=",
"sor... | Returns the weights requested by the user
@ In, indices, a list of non-negative integers specifying
the row indices to return
@ Out, a list of floating point values specifying the
weights associated to the input data rows filtered by the
indices input paramete... | [
"Returns",
"the",
"weights",
"requested",
"by",
"the",
"user"
] | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L315-L330 | train | Returns the weights requested by the user
|
maljovec/topopy | topopy/TopologicalObject.py | TopologicalObject.check_duplicates | def check_duplicates(self):
""" Function to test whether duplicates exist in the input or
output space. First, if an aggregator function has been
specified, the domain space duplicates will be consolidated
using the function to generate a new range value for that
... | python | def check_duplicates(self):
""" Function to test whether duplicates exist in the input or
output space. First, if an aggregator function has been
specified, the domain space duplicates will be consolidated
using the function to generate a new range value for that
... | [
"def",
"check_duplicates",
"(",
"self",
")",
":",
"if",
"self",
".",
"aggregator",
"is",
"not",
"None",
":",
"X",
",",
"Y",
"=",
"TopologicalObject",
".",
"aggregate_duplicates",
"(",
"self",
".",
"X",
",",
"self",
".",
"Y",
",",
"self",
".",
"aggregat... | Function to test whether duplicates exist in the input or
output space. First, if an aggregator function has been
specified, the domain space duplicates will be consolidated
using the function to generate a new range value for that
shared point. Otherwise, it will raise a... | [
"Function",
"to",
"test",
"whether",
"duplicates",
"exist",
"in",
"the",
"input",
"or",
"output",
"space",
".",
"First",
"if",
"an",
"aggregator",
"function",
"has",
"been",
"specified",
"the",
"domain",
"space",
"duplicates",
"will",
"be",
"consolidated",
"us... | 4be598d51c4e4043b73d4ad44beed6d289e2f088 | https://github.com/maljovec/topopy/blob/4be598d51c4e4043b73d4ad44beed6d289e2f088/topopy/TopologicalObject.py#L353-L392 | train | Function to test whether duplicates exist in the input or the output domain space. |
bskinn/pent | pent/utils.py | column_stack_2d | def column_stack_2d(data):
"""Perform column-stacking on a list of 2d data blocks."""
return list(list(itt.chain.from_iterable(_)) for _ in zip(*data)) | python | def column_stack_2d(data):
"""Perform column-stacking on a list of 2d data blocks."""
return list(list(itt.chain.from_iterable(_)) for _ in zip(*data)) | [
"def",
"column_stack_2d",
"(",
"data",
")",
":",
"return",
"list",
"(",
"list",
"(",
"itt",
".",
"chain",
".",
"from_iterable",
"(",
"_",
")",
")",
"for",
"_",
"in",
"zip",
"(",
"*",
"data",
")",
")"
] | Perform column-stacking on a list of 2d data blocks. | [
"Perform",
"column",
"-",
"stacking",
"on",
"a",
"list",
"of",
"2d",
"data",
"blocks",
"."
] | 7a81e55f46bc3aed3f09d96449d59a770b4730c2 | https://github.com/bskinn/pent/blob/7a81e55f46bc3aed3f09d96449d59a770b4730c2/pent/utils.py#L30-L32 | train | Perform column - stacking on a list of 2d data blocks. |
lsst-sqre/documenteer | documenteer/stackdocs/rootdiscovery.py | discover_package_doc_dir | def discover_package_doc_dir(initial_dir):
"""Discover the ``doc/`` dir of a package given an initial directory.
Parameters
----------
initial_dir : `str`
The inititial directory to search from. In practice, this is often the
directory that the user is running the package-docs CLI from.... | python | def discover_package_doc_dir(initial_dir):
"""Discover the ``doc/`` dir of a package given an initial directory.
Parameters
----------
initial_dir : `str`
The inititial directory to search from. In practice, this is often the
directory that the user is running the package-docs CLI from.... | [
"def",
"discover_package_doc_dir",
"(",
"initial_dir",
")",
":",
"# Create an absolute Path to work with",
"initial_dir",
"=",
"pathlib",
".",
"Path",
"(",
"initial_dir",
")",
".",
"resolve",
"(",
")",
"# Check if this is the doc/ dir already with a conf.py",
"if",
"_has_co... | Discover the ``doc/`` dir of a package given an initial directory.
Parameters
----------
initial_dir : `str`
The inititial directory to search from. In practice, this is often the
directory that the user is running the package-docs CLI from. This
directory needs to be somewhere insi... | [
"Discover",
"the",
"doc",
"/",
"dir",
"of",
"a",
"package",
"given",
"an",
"initial",
"directory",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/stackdocs/rootdiscovery.py#L9-L48 | train | Discover the doc dir of a package given an initial directory. |
lsst-sqre/documenteer | documenteer/stackdocs/rootdiscovery.py | discover_conf_py_directory | def discover_conf_py_directory(initial_dir):
"""Discover the directory containing the conf.py file.
This function is useful for building stack docs since it will look in
the current working directory and all parents.
Parameters
----------
initial_dir : `str`
The inititial directory to ... | python | def discover_conf_py_directory(initial_dir):
"""Discover the directory containing the conf.py file.
This function is useful for building stack docs since it will look in
the current working directory and all parents.
Parameters
----------
initial_dir : `str`
The inititial directory to ... | [
"def",
"discover_conf_py_directory",
"(",
"initial_dir",
")",
":",
"# Create an absolute Path to work with",
"initial_dir",
"=",
"pathlib",
".",
"Path",
"(",
"initial_dir",
")",
".",
"resolve",
"(",
")",
"# Search upwards until a conf.py is found",
"try",
":",
"return",
... | Discover the directory containing the conf.py file.
This function is useful for building stack docs since it will look in
the current working directory and all parents.
Parameters
----------
initial_dir : `str`
The inititial directory to search from. In practice, this is often the
... | [
"Discover",
"the",
"directory",
"containing",
"the",
"conf",
".",
"py",
"file",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/stackdocs/rootdiscovery.py#L51-L81 | train | Discover the directory containing the conf. py file. |
lsst-sqre/documenteer | documenteer/stackdocs/rootdiscovery.py | _search_parents | def _search_parents(initial_dir):
"""Search the initial and parent directories for a ``conf.py`` Sphinx
configuration file that represents the root of a Sphinx project.
Returns
-------
root_dir : `pathlib.Path`
Directory path containing a ``conf.py`` file.
Raises
------
FileNot... | python | def _search_parents(initial_dir):
"""Search the initial and parent directories for a ``conf.py`` Sphinx
configuration file that represents the root of a Sphinx project.
Returns
-------
root_dir : `pathlib.Path`
Directory path containing a ``conf.py`` file.
Raises
------
FileNot... | [
"def",
"_search_parents",
"(",
"initial_dir",
")",
":",
"root_paths",
"=",
"(",
"'.'",
",",
"'/'",
")",
"parent",
"=",
"pathlib",
".",
"Path",
"(",
"initial_dir",
")",
"while",
"True",
":",
"if",
"_has_conf_py",
"(",
"parent",
")",
":",
"return",
"parent... | Search the initial and parent directories for a ``conf.py`` Sphinx
configuration file that represents the root of a Sphinx project.
Returns
-------
root_dir : `pathlib.Path`
Directory path containing a ``conf.py`` file.
Raises
------
FileNotFoundError
Raised if a ``conf.py`... | [
"Search",
"the",
"initial",
"and",
"parent",
"directories",
"for",
"a",
"conf",
".",
"py",
"Sphinx",
"configuration",
"file",
"that",
"represents",
"the",
"root",
"of",
"a",
"Sphinx",
"project",
"."
] | 75f02901a80042b28d074df1cc1dca32eb8e38c8 | https://github.com/lsst-sqre/documenteer/blob/75f02901a80042b28d074df1cc1dca32eb8e38c8/documenteer/stackdocs/rootdiscovery.py#L91-L118 | train | Search the initial and parent directories for a conf. py Sphinx
configuration file that represents the root of a Sphinx project. |
zsimic/runez | src/runez/system.py | abort | def abort(*args, **kwargs):
"""
Usage:
return abort("...") => will sys.exit() by default
return abort("...", fatal=True) => Will sys.exit()
# Not fatal, but will log/print message:
return abort("...", fatal=False) => Will return False
return abort("...", fatal=(False, No... | python | def abort(*args, **kwargs):
"""
Usage:
return abort("...") => will sys.exit() by default
return abort("...", fatal=True) => Will sys.exit()
# Not fatal, but will log/print message:
return abort("...", fatal=False) => Will return False
return abort("...", fatal=(False, No... | [
"def",
"abort",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"code",
"=",
"kwargs",
".",
"pop",
"(",
"\"code\"",
",",
"1",
")",
"logger",
"=",
"kwargs",
".",
"pop",
"(",
"\"logger\"",
",",
"LOG",
".",
"error",
"if",
"code",
"else",
"LOG",... | Usage:
return abort("...") => will sys.exit() by default
return abort("...", fatal=True) => Will sys.exit()
# Not fatal, but will log/print message:
return abort("...", fatal=False) => Will return False
return abort("...", fatal=(False, None)) => Will return None
return ... | [
"Usage",
":",
"return",
"abort",
"(",
"...",
")",
"=",
">",
"will",
"sys",
".",
"exit",
"()",
"by",
"default",
"return",
"abort",
"(",
"...",
"fatal",
"=",
"True",
")",
"=",
">",
"Will",
"sys",
".",
"exit",
"()"
] | 14363b719a1aae1528859a501a22d075ce0abfcc | https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/system.py#L21-L66 | train | This function will return a value that indicates failure to the current user. |
zsimic/runez | src/runez/system.py | get_version | def get_version(mod, default="0.0.0"):
"""
:param module|str mod: Module, or module name to find version for (pass either calling module, or its .__name__)
:param str default: Value to return if version determination fails
:return str: Determined version
"""
name = mod
if hasattr(mod, "__nam... | python | def get_version(mod, default="0.0.0"):
"""
:param module|str mod: Module, or module name to find version for (pass either calling module, or its .__name__)
:param str default: Value to return if version determination fails
:return str: Determined version
"""
name = mod
if hasattr(mod, "__nam... | [
"def",
"get_version",
"(",
"mod",
",",
"default",
"=",
"\"0.0.0\"",
")",
":",
"name",
"=",
"mod",
"if",
"hasattr",
"(",
"mod",
",",
"\"__name__\"",
")",
":",
"name",
"=",
"mod",
".",
"__name__",
"try",
":",
"import",
"pkg_resources",
"return",
"pkg_resou... | :param module|str mod: Module, or module name to find version for (pass either calling module, or its .__name__)
:param str default: Value to return if version determination fails
:return str: Determined version | [
":",
"param",
"module|str",
"mod",
":",
"Module",
"or",
"module",
"name",
"to",
"find",
"version",
"for",
"(",
"pass",
"either",
"calling",
"module",
"or",
"its",
".",
"__name__",
")",
":",
"param",
"str",
"default",
":",
"Value",
"to",
"return",
"if",
... | 14363b719a1aae1528859a501a22d075ce0abfcc | https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/system.py#L99-L116 | train | Get version of the current version of the current module. |
zsimic/runez | src/runez/system.py | set_dryrun | def set_dryrun(dryrun):
"""
:param bool dryrun: New value for runez.DRYRUN
:return bool: Old value
"""
r = _get_runez()
old = r.DRYRUN
r.DRYRUN = bool(dryrun)
return old | python | def set_dryrun(dryrun):
"""
:param bool dryrun: New value for runez.DRYRUN
:return bool: Old value
"""
r = _get_runez()
old = r.DRYRUN
r.DRYRUN = bool(dryrun)
return old | [
"def",
"set_dryrun",
"(",
"dryrun",
")",
":",
"r",
"=",
"_get_runez",
"(",
")",
"old",
"=",
"r",
".",
"DRYRUN",
"r",
".",
"DRYRUN",
"=",
"bool",
"(",
"dryrun",
")",
"return",
"old"
] | :param bool dryrun: New value for runez.DRYRUN
:return bool: Old value | [
":",
"param",
"bool",
"dryrun",
":",
"New",
"value",
"for",
"runez",
".",
"DRYRUN",
":",
"return",
"bool",
":",
"Old",
"value"
] | 14363b719a1aae1528859a501a22d075ce0abfcc | https://github.com/zsimic/runez/blob/14363b719a1aae1528859a501a22d075ce0abfcc/src/runez/system.py#L136-L144 | train | Set dryrun flag for the node. |
micolous/python-slackrealtime | src/slackrealtime/session.py | transform_metadata | def transform_metadata(blob):
"""
Transforms metadata types about channels / users / bots / etc. into a dict
rather than a list in order to enable faster lookup.
"""
o = {}
for e in blob:
i = e[u'id']
o[i] = e
return o | python | def transform_metadata(blob):
"""
Transforms metadata types about channels / users / bots / etc. into a dict
rather than a list in order to enable faster lookup.
"""
o = {}
for e in blob:
i = e[u'id']
o[i] = e
return o | [
"def",
"transform_metadata",
"(",
"blob",
")",
":",
"o",
"=",
"{",
"}",
"for",
"e",
"in",
"blob",
":",
"i",
"=",
"e",
"[",
"u'id'",
"]",
"o",
"[",
"i",
"]",
"=",
"e",
"return",
"o"
] | Transforms metadata types about channels / users / bots / etc. into a dict
rather than a list in order to enable faster lookup. | [
"Transforms",
"metadata",
"types",
"about",
"channels",
"/",
"users",
"/",
"bots",
"/",
"etc",
".",
"into",
"a",
"dict",
"rather",
"than",
"a",
"list",
"in",
"order",
"to",
"enable",
"faster",
"lookup",
"."
] | e9c94416f979a6582110ebba09c147de2bfe20a1 | https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/session.py#L24-L34 | train | Transforms metadata types about channels users and bots into a dict that can be used to lookup the metadata. |
micolous/python-slackrealtime | src/slackrealtime/session.py | request_session | def request_session(token, url=None):
"""
Requests a WebSocket session for the Real-Time Messaging API.
Returns a SessionMetadata object containing the information retrieved from
the API call.
"""
if url is None:
api = SlackApi()
else:
api = SlackApi(url)
response = api.rtm.start(token=token)
return Ses... | python | def request_session(token, url=None):
"""
Requests a WebSocket session for the Real-Time Messaging API.
Returns a SessionMetadata object containing the information retrieved from
the API call.
"""
if url is None:
api = SlackApi()
else:
api = SlackApi(url)
response = api.rtm.start(token=token)
return Ses... | [
"def",
"request_session",
"(",
"token",
",",
"url",
"=",
"None",
")",
":",
"if",
"url",
"is",
"None",
":",
"api",
"=",
"SlackApi",
"(",
")",
"else",
":",
"api",
"=",
"SlackApi",
"(",
"url",
")",
"response",
"=",
"api",
".",
"rtm",
".",
"start",
"... | Requests a WebSocket session for the Real-Time Messaging API.
Returns a SessionMetadata object containing the information retrieved from
the API call. | [
"Requests",
"a",
"WebSocket",
"session",
"for",
"the",
"Real",
"-",
"Time",
"Messaging",
"API",
".",
"Returns",
"a",
"SessionMetadata",
"object",
"containing",
"the",
"information",
"retrieved",
"from",
"the",
"API",
"call",
"."
] | e9c94416f979a6582110ebba09c147de2bfe20a1 | https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/session.py#L208-L221 | train | Requests a WebSocket session for the Real - Time Messaging API. |
micolous/python-slackrealtime | src/slackrealtime/session.py | SessionMetadata._find_resource_by_key | def _find_resource_by_key(self, resource_list, key, value):
"""
Finds a resource by key, first case insensitive match.
Returns tuple of (key, resource)
Raises KeyError if the given key cannot be found.
"""
original = value
value = unicode(value.upper())
for k, resource in resource_list.iteritems():
... | python | def _find_resource_by_key(self, resource_list, key, value):
"""
Finds a resource by key, first case insensitive match.
Returns tuple of (key, resource)
Raises KeyError if the given key cannot be found.
"""
original = value
value = unicode(value.upper())
for k, resource in resource_list.iteritems():
... | [
"def",
"_find_resource_by_key",
"(",
"self",
",",
"resource_list",
",",
"key",
",",
"value",
")",
":",
"original",
"=",
"value",
"value",
"=",
"unicode",
"(",
"value",
".",
"upper",
"(",
")",
")",
"for",
"k",
",",
"resource",
"in",
"resource_list",
".",
... | Finds a resource by key, first case insensitive match.
Returns tuple of (key, resource)
Raises KeyError if the given key cannot be found. | [
"Finds",
"a",
"resource",
"by",
"key",
"first",
"case",
"insensitive",
"match",
"."
] | e9c94416f979a6582110ebba09c147de2bfe20a1 | https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/session.py#L61-L75 | train | Find a resource by key first case insensitive match. |
micolous/python-slackrealtime | src/slackrealtime/session.py | SessionMetadata.find_im_by_user_name | def find_im_by_user_name(self, name, auto_create=True):
"""
Finds the ID of the IM with a particular user by name, with the option
to automatically create a new channel if it doesn't exist.
"""
uid = self.find_user_by_name(name)[0]
try:
return self.find_im_by_user_id(uid)
except KeyError:
# IM does ... | python | def find_im_by_user_name(self, name, auto_create=True):
"""
Finds the ID of the IM with a particular user by name, with the option
to automatically create a new channel if it doesn't exist.
"""
uid = self.find_user_by_name(name)[0]
try:
return self.find_im_by_user_id(uid)
except KeyError:
# IM does ... | [
"def",
"find_im_by_user_name",
"(",
"self",
",",
"name",
",",
"auto_create",
"=",
"True",
")",
":",
"uid",
"=",
"self",
".",
"find_user_by_name",
"(",
"name",
")",
"[",
"0",
"]",
"try",
":",
"return",
"self",
".",
"find_im_by_user_id",
"(",
"uid",
")",
... | Finds the ID of the IM with a particular user by name, with the option
to automatically create a new channel if it doesn't exist. | [
"Finds",
"the",
"ID",
"of",
"the",
"IM",
"with",
"a",
"particular",
"user",
"by",
"name",
"with",
"the",
"option",
"to",
"automatically",
"create",
"a",
"new",
"channel",
"if",
"it",
"doesn",
"t",
"exist",
"."
] | e9c94416f979a6582110ebba09c147de2bfe20a1 | https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/session.py#L92-L106 | train | Finds the ID of the IM with a particular user by name. |
micolous/python-slackrealtime | src/slackrealtime/session.py | SessionMetadata.update | def update(self, event):
"""
All messages from the Protocol get passed through this method. This
allows the client to have an up-to-date state for the client.
However, this method doesn't actually update right away. Instead, the
acutal update happens in another thread, potentially later, in order to
al... | python | def update(self, event):
"""
All messages from the Protocol get passed through this method. This
allows the client to have an up-to-date state for the client.
However, this method doesn't actually update right away. Instead, the
acutal update happens in another thread, potentially later, in order to
al... | [
"def",
"update",
"(",
"self",
",",
"event",
")",
":",
"# Create our own copy of the event data, as we'll be pushing that to",
"# another data structure and we don't want it mangled by user code later",
"# on.",
"event",
"=",
"event",
".",
"copy",
"(",
")",
"# Now just defer the w... | All messages from the Protocol get passed through this method. This
allows the client to have an up-to-date state for the client.
However, this method doesn't actually update right away. Instead, the
acutal update happens in another thread, potentially later, in order to
allow user code to handle the event... | [
"All",
"messages",
"from",
"the",
"Protocol",
"get",
"passed",
"through",
"this",
"method",
".",
"This",
"allows",
"the",
"client",
"to",
"have",
"an",
"up",
"-",
"to",
"-",
"date",
"state",
"for",
"the",
"client",
".",
"However",
"this",
"method",
"does... | e9c94416f979a6582110ebba09c147de2bfe20a1 | https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/session.py#L108-L125 | train | This method is called by the protocol to update the state of the event. |
micolous/python-slackrealtime | src/slackrealtime/session.py | SessionMetadata._update_deferred | def _update_deferred(self, event):
"""
This does the actual work of updating channel metadata. This is called
by the update(), and runs this method in another thread.
"""
if isinstance(event, ChannelCreated):
i = event.channel[u'id']
event.channel[u'is_archived'] = event.channel[u'is_member'] = False
... | python | def _update_deferred(self, event):
"""
This does the actual work of updating channel metadata. This is called
by the update(), and runs this method in another thread.
"""
if isinstance(event, ChannelCreated):
i = event.channel[u'id']
event.channel[u'is_archived'] = event.channel[u'is_member'] = False
... | [
"def",
"_update_deferred",
"(",
"self",
",",
"event",
")",
":",
"if",
"isinstance",
"(",
"event",
",",
"ChannelCreated",
")",
":",
"i",
"=",
"event",
".",
"channel",
"[",
"u'id'",
"]",
"event",
".",
"channel",
"[",
"u'is_archived'",
"]",
"=",
"event",
... | This does the actual work of updating channel metadata. This is called
by the update(), and runs this method in another thread. | [
"This",
"does",
"the",
"actual",
"work",
"of",
"updating",
"channel",
"metadata",
".",
"This",
"is",
"called",
"by",
"the",
"update",
"()",
"and",
"runs",
"this",
"method",
"in",
"another",
"thread",
"."
] | e9c94416f979a6582110ebba09c147de2bfe20a1 | https://github.com/micolous/python-slackrealtime/blob/e9c94416f979a6582110ebba09c147de2bfe20a1/src/slackrealtime/session.py#L127-L205 | train | This method is called when the event is received from the broker. It is called when the event is received from the broker. It is called when the event is received from the broker. |
fkarb/xltable | xltable/chart.py | Chart.add_series | def add_series(self, values, **kwargs):
"""
Adds a series to the chart.
:param values: A :py:class:`xltable.Expression` object that evaluates to the data series.
:param categories: A :py:class:`xltable.Expression` object that evaluates to the data series.
:param name: Na... | python | def add_series(self, values, **kwargs):
"""
Adds a series to the chart.
:param values: A :py:class:`xltable.Expression` object that evaluates to the data series.
:param categories: A :py:class:`xltable.Expression` object that evaluates to the data series.
:param name: Na... | [
"def",
"add_series",
"(",
"self",
",",
"values",
",",
"*",
"*",
"kwargs",
")",
":",
"series",
"=",
"{",
"\"values\"",
":",
"values",
"}",
"series",
".",
"update",
"(",
"kwargs",
")",
"self",
".",
"__series",
".",
"append",
"(",
"series",
")"
] | Adds a series to the chart.
:param values: A :py:class:`xltable.Expression` object that evaluates to the data series.
:param categories: A :py:class:`xltable.Expression` object that evaluates to the data series.
:param name: Name to show in the legend for the series
:param line:... | [
"Adds",
"a",
"series",
"to",
"the",
"chart",
".",
":",
"param",
"values",
":",
"A",
":",
"py",
":",
"class",
":",
"xltable",
".",
"Expression",
"object",
"that",
"evaluates",
"to",
"the",
"data",
"series",
".",
":",
"param",
"categories",
":",
"A",
"... | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/chart.py#L70-L83 | train | Adds a series to the chart. |
fkarb/xltable | xltable/chart.py | Chart.iter_series | def iter_series(self, workbook, row, col):
"""
Yield series dictionaries with values resolved to the final excel formulas.
"""
for series in self.__series:
series = dict(series)
series["values"] = series["values"].get_formula(workbook, row, col)
if "ca... | python | def iter_series(self, workbook, row, col):
"""
Yield series dictionaries with values resolved to the final excel formulas.
"""
for series in self.__series:
series = dict(series)
series["values"] = series["values"].get_formula(workbook, row, col)
if "ca... | [
"def",
"iter_series",
"(",
"self",
",",
"workbook",
",",
"row",
",",
"col",
")",
":",
"for",
"series",
"in",
"self",
".",
"__series",
":",
"series",
"=",
"dict",
"(",
"series",
")",
"series",
"[",
"\"values\"",
"]",
"=",
"series",
"[",
"\"values\"",
... | Yield series dictionaries with values resolved to the final excel formulas. | [
"Yield",
"series",
"dictionaries",
"with",
"values",
"resolved",
"to",
"the",
"final",
"excel",
"formulas",
"."
] | 7a592642d27ad5ee90d2aa8c26338abaa9d84bea | https://github.com/fkarb/xltable/blob/7a592642d27ad5ee90d2aa8c26338abaa9d84bea/xltable/chart.py#L85-L94 | train | Yields series dictionaries with values resolved to the final excel formulas. |
gmdzy2010/dingtalk_sdk_gmdzy2010 | dingtalk_sdk_gmdzy2010/user_request.py | DeptUserRequest.get_userinfo | def get_userinfo(self):
"""Method to get current user's name, mobile, email and position."""
wanted_fields = ["name", "mobile", "orgEmail", "position", "avatar"]
userinfo = {k: self.json_response.get(k, None) for k in wanted_fields}
return userinfo | python | def get_userinfo(self):
"""Method to get current user's name, mobile, email and position."""
wanted_fields = ["name", "mobile", "orgEmail", "position", "avatar"]
userinfo = {k: self.json_response.get(k, None) for k in wanted_fields}
return userinfo | [
"def",
"get_userinfo",
"(",
"self",
")",
":",
"wanted_fields",
"=",
"[",
"\"name\"",
",",
"\"mobile\"",
",",
"\"orgEmail\"",
",",
"\"position\"",
",",
"\"avatar\"",
"]",
"userinfo",
"=",
"{",
"k",
":",
"self",
".",
"json_response",
".",
"get",
"(",
"k",
... | Method to get current user's name, mobile, email and position. | [
"Method",
"to",
"get",
"current",
"user",
"s",
"name",
"mobile",
"email",
"and",
"position",
"."
] | b06cb1f78f89be9554dcb6101af8bc72718a9ecd | https://github.com/gmdzy2010/dingtalk_sdk_gmdzy2010/blob/b06cb1f78f89be9554dcb6101af8bc72718a9ecd/dingtalk_sdk_gmdzy2010/user_request.py#L30-L34 | train | Method to get current user s name mobile email and position. |
gmdzy2010/dingtalk_sdk_gmdzy2010 | dingtalk_sdk_gmdzy2010/user_request.py | AdminUsersRequest.get_admin_ids | def get_admin_ids(self):
"""Method to get the administrator id list."""
admins = self.json_response.get("admin_list", None)
admin_ids = [admin_id for admin_id in admins["userid"]]
return admin_ids | python | def get_admin_ids(self):
"""Method to get the administrator id list."""
admins = self.json_response.get("admin_list", None)
admin_ids = [admin_id for admin_id in admins["userid"]]
return admin_ids | [
"def",
"get_admin_ids",
"(",
"self",
")",
":",
"admins",
"=",
"self",
".",
"json_response",
".",
"get",
"(",
"\"admin_list\"",
",",
"None",
")",
"admin_ids",
"=",
"[",
"admin_id",
"for",
"admin_id",
"in",
"admins",
"[",
"\"userid\"",
"]",
"]",
"return",
... | Method to get the administrator id list. | [
"Method",
"to",
"get",
"the",
"administrator",
"id",
"list",
"."
] | b06cb1f78f89be9554dcb6101af8bc72718a9ecd | https://github.com/gmdzy2010/dingtalk_sdk_gmdzy2010/blob/b06cb1f78f89be9554dcb6101af8bc72718a9ecd/dingtalk_sdk_gmdzy2010/user_request.py#L54-L58 | train | Method to get the administrator id list. |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | list | def list(context, topic_id, sort, limit, where, verbose):
"""list(context, topic_id, sort, limit, where, verbose)
List all components.
>>> dcictl component-list [OPTIONS]
:param string topic_id: The topic ID for the list of components to return
[required]
:param string... | python | def list(context, topic_id, sort, limit, where, verbose):
"""list(context, topic_id, sort, limit, where, verbose)
List all components.
>>> dcictl component-list [OPTIONS]
:param string topic_id: The topic ID for the list of components to return
[required]
:param string... | [
"def",
"list",
"(",
"context",
",",
"topic_id",
",",
"sort",
",",
"limit",
",",
"where",
",",
"verbose",
")",
":",
"components",
"=",
"topic",
".",
"list_components",
"(",
"context",
",",
"id",
"=",
"topic_id",
",",
"sort",
"=",
"sort",
",",
"limit",
... | list(context, topic_id, sort, limit, where, verbose)
List all components.
>>> dcictl component-list [OPTIONS]
:param string topic_id: The topic ID for the list of components to return
[required]
:param string sort: Field to apply sort
:param integer limit: Max number o... | [
"list",
"(",
"context",
"topic_id",
"sort",
"limit",
"where",
"verbose",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L35-L51 | train | list - List all components in a topic |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | create | def create(context, name, type, canonical_project_name, data,
title, message, url, topic_id, export_control, active):
"""create(context, name, type, canonical_project_name, data, title, message, url, topic_id, export_control, active) # noqa
Create a component.
>>> dcictl component-create [OPTI... | python | def create(context, name, type, canonical_project_name, data,
title, message, url, topic_id, export_control, active):
"""create(context, name, type, canonical_project_name, data, title, message, url, topic_id, export_control, active) # noqa
Create a component.
>>> dcictl component-create [OPTI... | [
"def",
"create",
"(",
"context",
",",
"name",
",",
"type",
",",
"canonical_project_name",
",",
"data",
",",
"title",
",",
"message",
",",
"url",
",",
"topic_id",
",",
"export_control",
",",
"active",
")",
":",
"state",
"=",
"utils",
".",
"active_string",
... | create(context, name, type, canonical_project_name, data, title, message, url, topic_id, export_control, active) # noqa
Create a component.
>>> dcictl component-create [OPTIONS]
:param string name: Name of the component [required]
:param string type: Type of the component [required]
:param strin... | [
"create",
"(",
"context",
"name",
"type",
"canonical_project_name",
"data",
"title",
"message",
"url",
"topic_id",
"export_control",
"active",
")",
"#",
"noqa"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L68-L97 | train | Create a new component. |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | delete | def delete(context, id):
"""delete(context, id)
Delete a component.
>>> dcictl component-delete [OPTIONS]
:param string id: ID of the component to delete [required]
"""
result = component.delete(context, id=id)
if result.status_code == 204:
utils.print_json({'id': id, 'message': '... | python | def delete(context, id):
"""delete(context, id)
Delete a component.
>>> dcictl component-delete [OPTIONS]
:param string id: ID of the component to delete [required]
"""
result = component.delete(context, id=id)
if result.status_code == 204:
utils.print_json({'id': id, 'message': '... | [
"def",
"delete",
"(",
"context",
",",
"id",
")",
":",
"result",
"=",
"component",
".",
"delete",
"(",
"context",
",",
"id",
"=",
"id",
")",
"if",
"result",
".",
"status_code",
"==",
"204",
":",
"utils",
".",
"print_json",
"(",
"{",
"'id'",
":",
"id... | delete(context, id)
Delete a component.
>>> dcictl component-delete [OPTIONS]
:param string id: ID of the component to delete [required] | [
"delete",
"(",
"context",
"id",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L103-L116 | train | Delete a node from the hierarchy |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | file_upload | def file_upload(context, id, path):
"""file_upload(context, id, path)
Upload a file in a component
>>> dcictl component-file-upload [OPTIONS]
:param string id: ID of the component to attach file [required]
:param string path: Path to the file to upload [required]
"""
result = component.fi... | python | def file_upload(context, id, path):
"""file_upload(context, id, path)
Upload a file in a component
>>> dcictl component-file-upload [OPTIONS]
:param string id: ID of the component to attach file [required]
:param string path: Path to the file to upload [required]
"""
result = component.fi... | [
"def",
"file_upload",
"(",
"context",
",",
"id",
",",
"path",
")",
":",
"result",
"=",
"component",
".",
"file_upload",
"(",
"context",
",",
"id",
"=",
"id",
",",
"file_path",
"=",
"path",
")",
"utils",
".",
"format_output",
"(",
"result",
",",
"contex... | file_upload(context, id, path)
Upload a file in a component
>>> dcictl component-file-upload [OPTIONS]
:param string id: ID of the component to attach file [required]
:param string path: Path to the file to upload [required] | [
"file_upload",
"(",
"context",
"id",
"path",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L139-L150 | train | Upload a file in a availabe tree |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | file_show | def file_show(context, id, file_id):
"""file_show(context, id, path)
Show a component file
>>> dcictl component-file-show [OPTIONS]
:param string id: ID of the component to show files [required]
:param string file_id: ID of the file to show up [required]
"""
result = component.file_get(co... | python | def file_show(context, id, file_id):
"""file_show(context, id, path)
Show a component file
>>> dcictl component-file-show [OPTIONS]
:param string id: ID of the component to show files [required]
:param string file_id: ID of the file to show up [required]
"""
result = component.file_get(co... | [
"def",
"file_show",
"(",
"context",
",",
"id",
",",
"file_id",
")",
":",
"result",
"=",
"component",
".",
"file_get",
"(",
"context",
",",
"id",
"=",
"id",
",",
"file_id",
"=",
"file_id",
")",
"utils",
".",
"format_output",
"(",
"result",
",",
"context... | file_show(context, id, path)
Show a component file
>>> dcictl component-file-show [OPTIONS]
:param string id: ID of the component to show files [required]
:param string file_id: ID of the file to show up [required] | [
"file_show",
"(",
"context",
"id",
"path",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L157-L168 | train | Show a file in a availabe tree |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | file_download | def file_download(context, id, file_id, target):
"""file_download(context, id, path)
Download a component file
>>> dcictl component-file-download [OPTIONS]
:param string id: ID of the component to download file [required]
:param string file_id: ID of the component file to download [required]
... | python | def file_download(context, id, file_id, target):
"""file_download(context, id, path)
Download a component file
>>> dcictl component-file-download [OPTIONS]
:param string id: ID of the component to download file [required]
:param string file_id: ID of the component file to download [required]
... | [
"def",
"file_download",
"(",
"context",
",",
"id",
",",
"file_id",
",",
"target",
")",
":",
"component",
".",
"file_download",
"(",
"context",
",",
"id",
"=",
"id",
",",
"file_id",
"=",
"file_id",
",",
"target",
"=",
"target",
")"
] | file_download(context, id, path)
Download a component file
>>> dcictl component-file-download [OPTIONS]
:param string id: ID of the component to download file [required]
:param string file_id: ID of the component file to download [required]
:param string target: Destination file [required] | [
"file_download",
"(",
"context",
"id",
"path",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L176-L187 | train | File download a file in a node |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | file_list | def file_list(context, id, sort, limit, where, verbose):
"""file_list(context, id, path)
List component files
>>> dcictl component-file-list [OPTIONS]
:param string id: ID of the component to list files [required]
:param string sort: Field to apply sort
:param integer limit: Max number of row... | python | def file_list(context, id, sort, limit, where, verbose):
"""file_list(context, id, path)
List component files
>>> dcictl component-file-list [OPTIONS]
:param string id: ID of the component to list files [required]
:param string sort: Field to apply sort
:param integer limit: Max number of row... | [
"def",
"file_list",
"(",
"context",
",",
"id",
",",
"sort",
",",
"limit",
",",
"where",
",",
"verbose",
")",
":",
"result",
"=",
"component",
".",
"file_list",
"(",
"context",
",",
"id",
"=",
"id",
",",
"sort",
"=",
"sort",
",",
"limit",
"=",
"limi... | file_list(context, id, path)
List component files
>>> dcictl component-file-list [OPTIONS]
:param string id: ID of the component to list files [required]
:param string sort: Field to apply sort
:param integer limit: Max number of rows to return
:param string where: An optional filter criteria... | [
"file_list",
"(",
"context",
"id",
"path",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L199-L214 | train | File list of a single file |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | file_delete | def file_delete(context, id, file_id):
"""file_delete(context, id, path)
Delete a component file
>>> dcictl component-file-delete [OPTIONS]
:param string id: ID of the component to delete file [required]
:param string file_id: ID for the file to delete [required]
"""
component.file_delete... | python | def file_delete(context, id, file_id):
"""file_delete(context, id, path)
Delete a component file
>>> dcictl component-file-delete [OPTIONS]
:param string id: ID of the component to delete file [required]
:param string file_id: ID for the file to delete [required]
"""
component.file_delete... | [
"def",
"file_delete",
"(",
"context",
",",
"id",
",",
"file_id",
")",
":",
"component",
".",
"file_delete",
"(",
"context",
",",
"id",
"=",
"id",
",",
"file_id",
"=",
"file_id",
")"
] | file_delete(context, id, path)
Delete a component file
>>> dcictl component-file-delete [OPTIONS]
:param string id: ID of the component to delete file [required]
:param string file_id: ID for the file to delete [required] | [
"file_delete",
"(",
"context",
"id",
"path",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L221-L231 | train | File delete a file |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | update | def update(context, id, export_control, active):
"""update(context, id, export_control, active)
Update a component
>>> dcictl component-update [OPTIONS]
:param string id: ID of the component [required]
:param boolean export-control: Set the component visible for users
:param boolean active: S... | python | def update(context, id, export_control, active):
"""update(context, id, export_control, active)
Update a component
>>> dcictl component-update [OPTIONS]
:param string id: ID of the component [required]
:param boolean export-control: Set the component visible for users
:param boolean active: S... | [
"def",
"update",
"(",
"context",
",",
"id",
",",
"export_control",
",",
"active",
")",
":",
"component_info",
"=",
"component",
".",
"get",
"(",
"context",
",",
"id",
"=",
"id",
")",
"etag",
"=",
"component_info",
".",
"json",
"(",
")",
"[",
"'componen... | update(context, id, export_control, active)
Update a component
>>> dcictl component-update [OPTIONS]
:param string id: ID of the component [required]
:param boolean export-control: Set the component visible for users
:param boolean active: Set the component in the active state | [
"update",
"(",
"context",
"id",
"export_control",
"active",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L239-L259 | train | Update a component in the nationale |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | attach_issue | def attach_issue(context, id, url):
"""attach_issue(context, id, url)
Attach an issue to a component.
>>> dcictl component-attach-issue [OPTIONS]
:param string id: ID of the component to attach the issue to [required]
:param string url: URL of the issue to attach to the component[required]
""... | python | def attach_issue(context, id, url):
"""attach_issue(context, id, url)
Attach an issue to a component.
>>> dcictl component-attach-issue [OPTIONS]
:param string id: ID of the component to attach the issue to [required]
:param string url: URL of the issue to attach to the component[required]
""... | [
"def",
"attach_issue",
"(",
"context",
",",
"id",
",",
"url",
")",
":",
"result",
"=",
"component",
".",
"attach_issue",
"(",
"context",
",",
"id",
"=",
"id",
",",
"url",
"=",
"url",
")",
"if",
"result",
".",
"status_code",
"==",
"201",
":",
"utils",... | attach_issue(context, id, url)
Attach an issue to a component.
>>> dcictl component-attach-issue [OPTIONS]
:param string id: ID of the component to attach the issue to [required]
:param string url: URL of the issue to attach to the component[required] | [
"attach_issue",
"(",
"context",
"id",
"url",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L266-L281 | train | Attach an issue to a base component |
redhat-cip/python-dciclient | dciclient/v1/shell_commands/component.py | list_issues | def list_issues(context, id, sort, limit):
"""list_issues(context, id)
List all component attached issues.
>>> dcictl component-list-issue [OPTIONS]
:param string id: ID of the component to retrieve issues from [required]
"""
result = component.list_issues(context, id=id, sort=sort, limit=li... | python | def list_issues(context, id, sort, limit):
"""list_issues(context, id)
List all component attached issues.
>>> dcictl component-list-issue [OPTIONS]
:param string id: ID of the component to retrieve issues from [required]
"""
result = component.list_issues(context, id=id, sort=sort, limit=li... | [
"def",
"list_issues",
"(",
"context",
",",
"id",
",",
"sort",
",",
"limit",
")",
":",
"result",
"=",
"component",
".",
"list_issues",
"(",
"context",
",",
"id",
"=",
"id",
",",
"sort",
"=",
"sort",
",",
"limit",
"=",
"limit",
")",
"headers",
"=",
"... | list_issues(context, id)
List all component attached issues.
>>> dcictl component-list-issue [OPTIONS]
:param string id: ID of the component to retrieve issues from [required] | [
"list_issues",
"(",
"context",
"id",
")"
] | a4aa5899062802bbe4c30a075d8447f8d222d214 | https://github.com/redhat-cip/python-dciclient/blob/a4aa5899062802bbe4c30a075d8447f8d222d214/dciclient/v1/shell_commands/component.py#L313-L325 | train | List all issues attached to a specific component |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.