partition stringclasses 3
values | func_name stringlengths 1 134 | docstring stringlengths 1 46.9k | path stringlengths 4 223 | original_string stringlengths 75 104k | code stringlengths 75 104k | docstring_tokens listlengths 1 1.97k | repo stringlengths 7 55 | language stringclasses 1
value | url stringlengths 87 315 | code_tokens listlengths 19 28.4k | sha stringlengths 40 40 |
|---|---|---|---|---|---|---|---|---|---|---|---|
train | setup_logging | Setup logging | ehforwarderbot/__main__.py | def setup_logging(args, conf):
"""Setup logging"""
logging_format = "%(asctime)s [%(levelname)s]: %(name)s (%(module)s.%(funcName)s; " \
"%(filename)s:%(lineno)d)\n %(message)s"
if getattr(args, "verbose", None):
debug_logger = logging.StreamHandler(sys.stdout)
debug... | def setup_logging(args, conf):
"""Setup logging"""
logging_format = "%(asctime)s [%(levelname)s]: %(name)s (%(module)s.%(funcName)s; " \
"%(filename)s:%(lineno)d)\n %(message)s"
if getattr(args, "verbose", None):
debug_logger = logging.StreamHandler(sys.stdout)
debug... | [
"Setup",
"logging"
] | blueset/ehForwarderBot | python | https://github.com/blueset/ehForwarderBot/blob/62e8fcfe77b2993aba91623f538f404a90f59f1d/ehforwarderbot/__main__.py#L141-L159 | [
"def",
"setup_logging",
"(",
"args",
",",
"conf",
")",
":",
"logging_format",
"=",
"\"%(asctime)s [%(levelname)s]: %(name)s (%(module)s.%(funcName)s; \"",
"\"%(filename)s:%(lineno)d)\\n %(message)s\"",
"if",
"getattr",
"(",
"args",
",",
"\"verbose\"",
",",
"None",
")",
"... | 62e8fcfe77b2993aba91623f538f404a90f59f1d |
train | setup_telemetry | Setup telemetry
EH Forwarder Bot Framework includes NO code that uploads your log
or any other data to anywhere.
To enable telemetry functionality, additional modules need to be
installed manually. See :doc:`telemetry` for details. | ehforwarderbot/__main__.py | def setup_telemetry(key: str):
"""
Setup telemetry
EH Forwarder Bot Framework includes NO code that uploads your log
or any other data to anywhere.
To enable telemetry functionality, additional modules need to be
installed manually. See :doc:`telemetry` for details.
"""
if not isinsta... | def setup_telemetry(key: str):
"""
Setup telemetry
EH Forwarder Bot Framework includes NO code that uploads your log
or any other data to anywhere.
To enable telemetry functionality, additional modules need to be
installed manually. See :doc:`telemetry` for details.
"""
if not isinsta... | [
"Setup",
"telemetry"
] | blueset/ehForwarderBot | python | https://github.com/blueset/ehForwarderBot/blob/62e8fcfe77b2993aba91623f538f404a90f59f1d/ehforwarderbot/__main__.py#L167-L200 | [
"def",
"setup_telemetry",
"(",
"key",
":",
"str",
")",
":",
"if",
"not",
"isinstance",
"(",
"key",
",",
"str",
")",
":",
"return",
"if",
"key",
"not",
"in",
"(",
"CAPTURE_EXCEPTIONS",
",",
"CAPTURE_LOG",
",",
"CAPTURE_LOG_ANALYSIS",
")",
":",
"return",
"... | 62e8fcfe77b2993aba91623f538f404a90f59f1d |
train | get_connection | Connects to the db using pymapd
https://pymapd.readthedocs.io/en/latest/usage.html#connecting
Kwargs:
db_user(str): DB username
db_passwd(str): DB password
db_server(str): DB host
db_port(int): DB port
db_name(str): DB name
Returns:
con(class): Connect... | Benchmarks/run-benchmark.py | def get_connection(**kwargs):
"""
Connects to the db using pymapd
https://pymapd.readthedocs.io/en/latest/usage.html#connecting
Kwargs:
db_user(str): DB username
db_passwd(str): DB password
db_server(str): DB host
db_port(int): DB port
db_name(str): DB name... | def get_connection(**kwargs):
"""
Connects to the db using pymapd
https://pymapd.readthedocs.io/en/latest/usage.html#connecting
Kwargs:
db_user(str): DB username
db_passwd(str): DB password
db_server(str): DB host
db_port(int): DB port
db_name(str): DB name... | [
"Connects",
"to",
"the",
"db",
"using",
"pymapd",
"https",
":",
"//",
"pymapd",
".",
"readthedocs",
".",
"io",
"/",
"en",
"/",
"latest",
"/",
"usage",
".",
"html#connecting"
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/Benchmarks/run-benchmark.py#L16-L45 | [
"def",
"get_connection",
"(",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"logging",
".",
"debug",
"(",
"\"Connecting to mapd db...\"",
")",
"con",
"=",
"pymapd",
".",
"connect",
"(",
"user",
"=",
"kwargs",
"[",
"\"db_user\"",
"]",
",",
"password",
"=",
"k... | 83e87035696968748a61ff561c19631d55a3b902 |
train | execute_query | Executes a query against the connected db using pymapd
https://pymapd.readthedocs.io/en/latest/usage.html#querying
Kwargs:
query_name(str): Name of query
query_mapdql(str): Query to run
iteration(int): Iteration number
Returns:
query_execution(dict):::
resul... | Benchmarks/run-benchmark.py | def execute_query(**kwargs):
"""
Executes a query against the connected db using pymapd
https://pymapd.readthedocs.io/en/latest/usage.html#querying
Kwargs:
query_name(str): Name of query
query_mapdql(str): Query to run
iteration(int): Iteration number
Returns:
... | def execute_query(**kwargs):
"""
Executes a query against the connected db using pymapd
https://pymapd.readthedocs.io/en/latest/usage.html#querying
Kwargs:
query_name(str): Name of query
query_mapdql(str): Query to run
iteration(int): Iteration number
Returns:
... | [
"Executes",
"a",
"query",
"against",
"the",
"connected",
"db",
"using",
"pymapd",
"https",
":",
"//",
"pymapd",
".",
"readthedocs",
".",
"io",
"/",
"en",
"/",
"latest",
"/",
"usage",
".",
"html#querying"
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/Benchmarks/run-benchmark.py#L70-L148 | [
"def",
"execute_query",
"(",
"*",
"*",
"kwargs",
")",
":",
"start_time",
"=",
"timeit",
".",
"default_timer",
"(",
")",
"try",
":",
"# Run the query",
"query_result",
"=",
"con",
".",
"execute",
"(",
"kwargs",
"[",
"\"query_mapdql\"",
"]",
")",
"logging",
... | 83e87035696968748a61ff561c19631d55a3b902 |
train | calculate_query_times | Calculates aggregate query times from all iteration times
Kwargs:
total_times(list): List of total time calculations
execution_times(list): List of execution_time calculations
results_iter_times(list): List of results_iter_time calculations
connect_times(list): List of connect_tim... | Benchmarks/run-benchmark.py | def calculate_query_times(**kwargs):
"""
Calculates aggregate query times from all iteration times
Kwargs:
total_times(list): List of total time calculations
execution_times(list): List of execution_time calculations
results_iter_times(list): List of results_iter_time calculatio... | def calculate_query_times(**kwargs):
"""
Calculates aggregate query times from all iteration times
Kwargs:
total_times(list): List of total time calculations
execution_times(list): List of execution_time calculations
results_iter_times(list): List of results_iter_time calculatio... | [
"Calculates",
"aggregate",
"query",
"times",
"from",
"all",
"iteration",
"times"
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/Benchmarks/run-benchmark.py#L151-L198 | [
"def",
"calculate_query_times",
"(",
"*",
"*",
"kwargs",
")",
":",
"return",
"{",
"\"total_time_avg\"",
":",
"round",
"(",
"numpy",
".",
"mean",
"(",
"kwargs",
"[",
"\"total_times\"",
"]",
")",
",",
"1",
")",
",",
"\"total_time_min\"",
":",
"round",
"(",
... | 83e87035696968748a61ff561c19631d55a3b902 |
train | get_mem_usage | Calculates memory statistics from mapd_server _client.get_memory call
Kwargs:
con(class 'pymapd.connection.Connection'): Mapd connection
mem_type(str): [gpu, cpu] Type of memory to gather metrics for
Returns:
ramusage(dict):::
usedram(float): Amount of memory (in MB) used... | Benchmarks/run-benchmark.py | def get_mem_usage(**kwargs):
"""
Calculates memory statistics from mapd_server _client.get_memory call
Kwargs:
con(class 'pymapd.connection.Connection'): Mapd connection
mem_type(str): [gpu, cpu] Type of memory to gather metrics for
Returns:
ramusage(dict):::
us... | def get_mem_usage(**kwargs):
"""
Calculates memory statistics from mapd_server _client.get_memory call
Kwargs:
con(class 'pymapd.connection.Connection'): Mapd connection
mem_type(str): [gpu, cpu] Type of memory to gather metrics for
Returns:
ramusage(dict):::
us... | [
"Calculates",
"memory",
"statistics",
"from",
"mapd_server",
"_client",
".",
"get_memory",
"call"
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/Benchmarks/run-benchmark.py#L201-L247 | [
"def",
"get_mem_usage",
"(",
"*",
"*",
"kwargs",
")",
":",
"try",
":",
"con_mem_data_list",
"=",
"con",
".",
"_client",
".",
"get_memory",
"(",
"session",
"=",
"kwargs",
"[",
"\"con\"",
"]",
".",
"_session",
",",
"memory_level",
"=",
"kwargs",
"[",
"\"me... | 83e87035696968748a61ff561c19631d55a3b902 |
train | find_compilation_database | Adjusts the directory until a compilation database is found. | ThirdParty/clang/run-clang-tidy.py | def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
result = './'
while not os.path.isfile(os.path.join(result, path)):
if os.path.realpath(result) == '/':
print('Error: could not find compilation database.')
sys.exit(1)
result += '../'
ret... | def find_compilation_database(path):
"""Adjusts the directory until a compilation database is found."""
result = './'
while not os.path.isfile(os.path.join(result, path)):
if os.path.realpath(result) == '/':
print('Error: could not find compilation database.')
sys.exit(1)
result += '../'
ret... | [
"Adjusts",
"the",
"directory",
"until",
"a",
"compilation",
"database",
"is",
"found",
"."
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/ThirdParty/clang/run-clang-tidy.py#L60-L68 | [
"def",
"find_compilation_database",
"(",
"path",
")",
":",
"result",
"=",
"'./'",
"while",
"not",
"os",
".",
"path",
".",
"isfile",
"(",
"os",
".",
"path",
".",
"join",
"(",
"result",
",",
"path",
")",
")",
":",
"if",
"os",
".",
"path",
".",
"realp... | 83e87035696968748a61ff561c19631d55a3b902 |
train | get_tidy_invocation | Gets a command line for clang-tidy. | ThirdParty/clang/run-clang-tidy.py | def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
header_filter, extra_arg, extra_arg_before, quiet,
config):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
if header_filter is not None:
start.append('-header-filter... | def get_tidy_invocation(f, clang_tidy_binary, checks, tmpdir, build_path,
header_filter, extra_arg, extra_arg_before, quiet,
config):
"""Gets a command line for clang-tidy."""
start = [clang_tidy_binary]
if header_filter is not None:
start.append('-header-filter... | [
"Gets",
"a",
"command",
"line",
"for",
"clang",
"-",
"tidy",
"."
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/ThirdParty/clang/run-clang-tidy.py#L77-L106 | [
"def",
"get_tidy_invocation",
"(",
"f",
",",
"clang_tidy_binary",
",",
"checks",
",",
"tmpdir",
",",
"build_path",
",",
"header_filter",
",",
"extra_arg",
",",
"extra_arg_before",
",",
"quiet",
",",
"config",
")",
":",
"start",
"=",
"[",
"clang_tidy_binary",
"... | 83e87035696968748a61ff561c19631d55a3b902 |
train | merge_replacement_files | Merge all replacement files in a directory into a single file | ThirdParty/clang/run-clang-tidy.py | def merge_replacement_files(tmpdir, mergefile):
"""Merge all replacement files in a directory into a single file"""
# The fixes suggested by clang-tidy >= 4.0.0 are given under
# the top level key 'Diagnostics' in the output yaml files
mergekey="Diagnostics"
merged=[]
for replacefile in glob.iglob(os.path.j... | def merge_replacement_files(tmpdir, mergefile):
"""Merge all replacement files in a directory into a single file"""
# The fixes suggested by clang-tidy >= 4.0.0 are given under
# the top level key 'Diagnostics' in the output yaml files
mergekey="Diagnostics"
merged=[]
for replacefile in glob.iglob(os.path.j... | [
"Merge",
"all",
"replacement",
"files",
"in",
"a",
"directory",
"into",
"a",
"single",
"file"
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/ThirdParty/clang/run-clang-tidy.py#L109-L131 | [
"def",
"merge_replacement_files",
"(",
"tmpdir",
",",
"mergefile",
")",
":",
"# The fixes suggested by clang-tidy >= 4.0.0 are given under",
"# the top level key 'Diagnostics' in the output yaml files",
"mergekey",
"=",
"\"Diagnostics\"",
"merged",
"=",
"[",
"]",
"for",
"replacef... | 83e87035696968748a61ff561c19631d55a3b902 |
train | check_clang_apply_replacements_binary | Checks if invoking supplied clang-apply-replacements binary works. | ThirdParty/clang/run-clang-tidy.py | def check_clang_apply_replacements_binary(args):
"""Checks if invoking supplied clang-apply-replacements binary works."""
try:
subprocess.check_call([args.clang_apply_replacements_binary, '--version'])
except:
print('Unable to run clang-apply-replacements. Is clang-apply-replacements '
'binary c... | def check_clang_apply_replacements_binary(args):
"""Checks if invoking supplied clang-apply-replacements binary works."""
try:
subprocess.check_call([args.clang_apply_replacements_binary, '--version'])
except:
print('Unable to run clang-apply-replacements. Is clang-apply-replacements '
'binary c... | [
"Checks",
"if",
"invoking",
"supplied",
"clang",
"-",
"apply",
"-",
"replacements",
"binary",
"works",
"."
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/ThirdParty/clang/run-clang-tidy.py#L134-L142 | [
"def",
"check_clang_apply_replacements_binary",
"(",
"args",
")",
":",
"try",
":",
"subprocess",
".",
"check_call",
"(",
"[",
"args",
".",
"clang_apply_replacements_binary",
",",
"'--version'",
"]",
")",
"except",
":",
"print",
"(",
"'Unable to run clang-apply-replace... | 83e87035696968748a61ff561c19631d55a3b902 |
train | apply_fixes | Calls clang-apply-fixes on a given directory. | ThirdParty/clang/run-clang-tidy.py | def apply_fixes(args, tmpdir):
"""Calls clang-apply-fixes on a given directory."""
invocation = [args.clang_apply_replacements_binary]
if args.format:
invocation.append('-format')
if args.style:
invocation.append('-style=' + args.style)
invocation.append(tmpdir)
subprocess.call(invocation) | def apply_fixes(args, tmpdir):
"""Calls clang-apply-fixes on a given directory."""
invocation = [args.clang_apply_replacements_binary]
if args.format:
invocation.append('-format')
if args.style:
invocation.append('-style=' + args.style)
invocation.append(tmpdir)
subprocess.call(invocation) | [
"Calls",
"clang",
"-",
"apply",
"-",
"fixes",
"on",
"a",
"given",
"directory",
"."
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/ThirdParty/clang/run-clang-tidy.py#L145-L153 | [
"def",
"apply_fixes",
"(",
"args",
",",
"tmpdir",
")",
":",
"invocation",
"=",
"[",
"args",
".",
"clang_apply_replacements_binary",
"]",
"if",
"args",
".",
"format",
":",
"invocation",
".",
"append",
"(",
"'-format'",
")",
"if",
"args",
".",
"style",
":",
... | 83e87035696968748a61ff561c19631d55a3b902 |
train | run_tidy | Takes filenames out of queue and runs clang-tidy on them. | ThirdParty/clang/run-clang-tidy.py | def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks,
tmpdir, build_path, args.header_f... | def run_tidy(args, tmpdir, build_path, queue, lock, failed_files):
"""Takes filenames out of queue and runs clang-tidy on them."""
while True:
name = queue.get()
invocation = get_tidy_invocation(name, args.clang_tidy_binary, args.checks,
tmpdir, build_path, args.header_f... | [
"Takes",
"filenames",
"out",
"of",
"queue",
"and",
"runs",
"clang",
"-",
"tidy",
"on",
"them",
"."
] | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/ThirdParty/clang/run-clang-tidy.py#L156-L174 | [
"def",
"run_tidy",
"(",
"args",
",",
"tmpdir",
",",
"build_path",
",",
"queue",
",",
"lock",
",",
"failed_files",
")",
":",
"while",
"True",
":",
"name",
"=",
"queue",
".",
"get",
"(",
")",
"invocation",
"=",
"get_tidy_invocation",
"(",
"name",
",",
"a... | 83e87035696968748a61ff561c19631d55a3b902 |
train | main | Rewrite Thrift-generated Python clients to handle recursive structs. For
more details see: https://issues.apache.org/jira/browse/THRIFT-2642.
Requires package `RedBaron`, available via pip:
$ pip install redbaron
To use:
$ thrift -gen py mapd.thrift
$ mv gen-py/mapd/ttypes.py gen-py/mapd/ttyp... | SampleCode/fix_recursive_structs.py | def main():
"""Rewrite Thrift-generated Python clients to handle recursive structs. For
more details see: https://issues.apache.org/jira/browse/THRIFT-2642.
Requires package `RedBaron`, available via pip:
$ pip install redbaron
To use:
$ thrift -gen py mapd.thrift
$ mv gen-py/mapd/ttypes.... | def main():
"""Rewrite Thrift-generated Python clients to handle recursive structs. For
more details see: https://issues.apache.org/jira/browse/THRIFT-2642.
Requires package `RedBaron`, available via pip:
$ pip install redbaron
To use:
$ thrift -gen py mapd.thrift
$ mv gen-py/mapd/ttypes.... | [
"Rewrite",
"Thrift",
"-",
"generated",
"Python",
"clients",
"to",
"handle",
"recursive",
"structs",
".",
"For",
"more",
"details",
"see",
":",
"https",
":",
"//",
"issues",
".",
"apache",
".",
"org",
"/",
"jira",
"/",
"browse",
"/",
"THRIFT",
"-",
"2642"... | omnisci/mapd-core | python | https://github.com/omnisci/mapd-core/blob/83e87035696968748a61ff561c19631d55a3b902/SampleCode/fix_recursive_structs.py#L7-L37 | [
"def",
"main",
"(",
")",
":",
"in_file",
"=",
"open",
"(",
"sys",
".",
"argv",
"[",
"1",
"]",
",",
"'r'",
")",
"out_file",
"=",
"open",
"(",
"sys",
".",
"argv",
"[",
"2",
"]",
",",
"'w'",
")",
"red_ast",
"=",
"RedBaron",
"(",
"in_file",
".",
... | 83e87035696968748a61ff561c19631d55a3b902 |
train | RTMClient.run_on | A decorator to store and link a callback to an event. | slack/rtm/client.py | def run_on(*, event: str):
"""A decorator to store and link a callback to an event."""
def decorator(callback):
@functools.wraps(callback)
def decorator_wrapper():
RTMClient.on(event=event, callback=callback)
return decorator_wrapper()
retur... | def run_on(*, event: str):
"""A decorator to store and link a callback to an event."""
def decorator(callback):
@functools.wraps(callback)
def decorator_wrapper():
RTMClient.on(event=event, callback=callback)
return decorator_wrapper()
retur... | [
"A",
"decorator",
"to",
"store",
"and",
"link",
"a",
"callback",
"to",
"an",
"event",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L140-L150 | [
"def",
"run_on",
"(",
"*",
",",
"event",
":",
"str",
")",
":",
"def",
"decorator",
"(",
"callback",
")",
":",
"@",
"functools",
".",
"wraps",
"(",
"callback",
")",
"def",
"decorator_wrapper",
"(",
")",
":",
"RTMClient",
".",
"on",
"(",
"event",
"=",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient.on | Stores and links the callback(s) to the event.
Args:
event (str): A string that specifies a Slack or websocket event.
e.g. 'channel_joined' or 'open'
callback (Callable): Any object or a list of objects that can be called.
e.g. <function say_hello at 0x10... | slack/rtm/client.py | def on(cls, *, event: str, callback: Callable):
"""Stores and links the callback(s) to the event.
Args:
event (str): A string that specifies a Slack or websocket event.
e.g. 'channel_joined' or 'open'
callback (Callable): Any object or a list of objects that can ... | def on(cls, *, event: str, callback: Callable):
"""Stores and links the callback(s) to the event.
Args:
event (str): A string that specifies a Slack or websocket event.
e.g. 'channel_joined' or 'open'
callback (Callable): Any object or a list of objects that can ... | [
"Stores",
"and",
"links",
"the",
"callback",
"(",
"s",
")",
"to",
"the",
"event",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L153-L174 | [
"def",
"on",
"(",
"cls",
",",
"*",
",",
"event",
":",
"str",
",",
"callback",
":",
"Callable",
")",
":",
"if",
"isinstance",
"(",
"callback",
",",
"list",
")",
":",
"for",
"cb",
"in",
"callback",
":",
"cls",
".",
"_validate_callback",
"(",
"cb",
")... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient.start | Starts an RTM Session with Slack.
Makes an authenticated call to Slack's RTM API to retrieve
a websocket URL and then connects to the message server.
As events stream-in we run any associated callbacks stored
on the client.
If 'auto_reconnect' is specified we
retrieve a... | slack/rtm/client.py | def start(self) -> asyncio.Future:
"""Starts an RTM Session with Slack.
Makes an authenticated call to Slack's RTM API to retrieve
a websocket URL and then connects to the message server.
As events stream-in we run any associated callbacks stored
on the client.
If 'auto... | def start(self) -> asyncio.Future:
"""Starts an RTM Session with Slack.
Makes an authenticated call to Slack's RTM API to retrieve
a websocket URL and then connects to the message server.
As events stream-in we run any associated callbacks stored
on the client.
If 'auto... | [
"Starts",
"an",
"RTM",
"Session",
"with",
"Slack",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L176-L202 | [
"def",
"start",
"(",
"self",
")",
"->",
"asyncio",
".",
"Future",
":",
"# TODO: Add Windows support for graceful shutdowns.",
"if",
"os",
".",
"name",
"!=",
"\"nt\"",
":",
"signals",
"=",
"(",
"signal",
".",
"SIGHUP",
",",
"signal",
".",
"SIGTERM",
",",
"sig... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient.stop | Closes the websocket connection and ensures it won't reconnect. | slack/rtm/client.py | def stop(self):
"""Closes the websocket connection and ensures it won't reconnect."""
self._logger.debug("The Slack RTMClient is shutting down.")
self._stopped = True
self._close_websocket() | def stop(self):
"""Closes the websocket connection and ensures it won't reconnect."""
self._logger.debug("The Slack RTMClient is shutting down.")
self._stopped = True
self._close_websocket() | [
"Closes",
"the",
"websocket",
"connection",
"and",
"ensures",
"it",
"won",
"t",
"reconnect",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L204-L208 | [
"def",
"stop",
"(",
"self",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"The Slack RTMClient is shutting down.\"",
")",
"self",
".",
"_stopped",
"=",
"True",
"self",
".",
"_close_websocket",
"(",
")"
] | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient.send_over_websocket | Sends a message to Slack over the WebSocket connection.
Note:
The RTM API only supports posting simple messages formatted using
our default message formatting mode. It does not support
attachments or other message formatting modes. For this reason
we recommend us... | slack/rtm/client.py | def send_over_websocket(self, *, payload: dict):
"""Sends a message to Slack over the WebSocket connection.
Note:
The RTM API only supports posting simple messages formatted using
our default message formatting mode. It does not support
attachments or other message f... | def send_over_websocket(self, *, payload: dict):
"""Sends a message to Slack over the WebSocket connection.
Note:
The RTM API only supports posting simple messages formatted using
our default message formatting mode. It does not support
attachments or other message f... | [
"Sends",
"a",
"message",
"to",
"Slack",
"over",
"the",
"WebSocket",
"connection",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L210-L242 | [
"def",
"send_over_websocket",
"(",
"self",
",",
"*",
",",
"payload",
":",
"dict",
")",
":",
"if",
"self",
".",
"_websocket",
"is",
"None",
"or",
"self",
".",
"_event_loop",
"is",
"None",
":",
"raise",
"client_err",
".",
"SlackClientNotConnectedError",
"(",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient.typing | Sends a typing indicator to the specified channel.
This indicates that this app is currently
writing a message to send to a channel.
Args:
channel (str): The channel id. e.g. 'C024BE91L'
Raises:
SlackClientNotConnectedError: Websocket connection is closed. | slack/rtm/client.py | def typing(self, *, channel: str):
"""Sends a typing indicator to the specified channel.
This indicates that this app is currently
writing a message to send to a channel.
Args:
channel (str): The channel id. e.g. 'C024BE91L'
Raises:
SlackClientNotConnec... | def typing(self, *, channel: str):
"""Sends a typing indicator to the specified channel.
This indicates that this app is currently
writing a message to send to a channel.
Args:
channel (str): The channel id. e.g. 'C024BE91L'
Raises:
SlackClientNotConnec... | [
"Sends",
"a",
"typing",
"indicator",
"to",
"the",
"specified",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L256-L269 | [
"def",
"typing",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
")",
":",
"payload",
"=",
"{",
"\"id\"",
":",
"self",
".",
"_next_msg_id",
"(",
")",
",",
"\"type\"",
":",
"\"typing\"",
",",
"\"channel\"",
":",
"channel",
"}",
"self",
".",
"send_o... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._validate_callback | Checks if the specified callback is callable and accepts a kwargs param.
Args:
callback (obj): Any object or a list of objects that can be called.
e.g. <function say_hello at 0x101234567>
Raises:
SlackClientError: The specified callback is not callable.
... | slack/rtm/client.py | def _validate_callback(callback):
"""Checks if the specified callback is callable and accepts a kwargs param.
Args:
callback (obj): Any object or a list of objects that can be called.
e.g. <function say_hello at 0x101234567>
Raises:
SlackClientError: The... | def _validate_callback(callback):
"""Checks if the specified callback is callable and accepts a kwargs param.
Args:
callback (obj): Any object or a list of objects that can be called.
e.g. <function say_hello at 0x101234567>
Raises:
SlackClientError: The... | [
"Checks",
"if",
"the",
"specified",
"callback",
"is",
"callable",
"and",
"accepts",
"a",
"kwargs",
"param",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L272-L295 | [
"def",
"_validate_callback",
"(",
"callback",
")",
":",
"cb_name",
"=",
"callback",
".",
"__name__",
"if",
"hasattr",
"(",
"callback",
",",
"\"__name__\"",
")",
"else",
"callback",
"if",
"not",
"callable",
"(",
"callback",
")",
":",
"msg",
"=",
"\"The specif... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._connect_and_read | Retreives and connects to Slack's RTM API.
Makes an authenticated call to Slack's RTM API to retrieve
a websocket URL. Then connects to the message server and
reads event messages as they come in.
If 'auto_reconnect' is specified we
retrieve a new url and reconnect any time the... | slack/rtm/client.py | async def _connect_and_read(self):
"""Retreives and connects to Slack's RTM API.
Makes an authenticated call to Slack's RTM API to retrieve
a websocket URL. Then connects to the message server and
reads event messages as they come in.
If 'auto_reconnect' is specified we
... | async def _connect_and_read(self):
"""Retreives and connects to Slack's RTM API.
Makes an authenticated call to Slack's RTM API to retrieve
a websocket URL. Then connects to the message server and
reads event messages as they come in.
If 'auto_reconnect' is specified we
... | [
"Retreives",
"and",
"connects",
"to",
"Slack",
"s",
"RTM",
"API",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L309-L357 | [
"async",
"def",
"_connect_and_read",
"(",
"self",
")",
":",
"while",
"not",
"self",
".",
"_stopped",
":",
"try",
":",
"self",
".",
"_connection_attempts",
"+=",
"1",
"async",
"with",
"aiohttp",
".",
"ClientSession",
"(",
"loop",
"=",
"self",
".",
"_event_l... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._read_messages | Process messages received on the WebSocket connection.
Iteration terminates when the client is stopped or it disconnects. | slack/rtm/client.py | async def _read_messages(self):
"""Process messages received on the WebSocket connection.
Iteration terminates when the client is stopped or it disconnects.
"""
while not self._stopped and self._websocket is not None:
async for message in self._websocket:
if ... | async def _read_messages(self):
"""Process messages received on the WebSocket connection.
Iteration terminates when the client is stopped or it disconnects.
"""
while not self._stopped and self._websocket is not None:
async for message in self._websocket:
if ... | [
"Process",
"messages",
"received",
"on",
"the",
"WebSocket",
"connection",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L359-L371 | [
"async",
"def",
"_read_messages",
"(",
"self",
")",
":",
"while",
"not",
"self",
".",
"_stopped",
"and",
"self",
".",
"_websocket",
"is",
"not",
"None",
":",
"async",
"for",
"message",
"in",
"self",
".",
"_websocket",
":",
"if",
"message",
".",
"type",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._dispatch_event | Dispatches the event and executes any associated callbacks.
Note: To prevent the app from crashing due to callback errors. We
catch all exceptions and send all data to the logger.
Args:
event (str): The type of event. e.g. 'bot_added'
data (dict): The data Slack sent. e... | slack/rtm/client.py | def _dispatch_event(self, event, data=None):
"""Dispatches the event and executes any associated callbacks.
Note: To prevent the app from crashing due to callback errors. We
catch all exceptions and send all data to the logger.
Args:
event (str): The type of event. e.g. 'bo... | def _dispatch_event(self, event, data=None):
"""Dispatches the event and executes any associated callbacks.
Note: To prevent the app from crashing due to callback errors. We
catch all exceptions and send all data to the logger.
Args:
event (str): The type of event. e.g. 'bo... | [
"Dispatches",
"the",
"event",
"and",
"executes",
"any",
"associated",
"callbacks",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L373-L411 | [
"def",
"_dispatch_event",
"(",
"self",
",",
"event",
",",
"data",
"=",
"None",
")",
":",
"for",
"callback",
"in",
"self",
".",
"_callbacks",
"[",
"event",
"]",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"Running %s callbacks for event: '%s'\"",
",",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._execute_callback_async | Execute the callback asynchronously.
If the callback is not a coroutine, convert it.
Note: The WebClient passed into the callback is running in "async" mode.
This means all responses will be futures. | slack/rtm/client.py | def _execute_callback_async(self, callback, data):
"""Execute the callback asynchronously.
If the callback is not a coroutine, convert it.
Note: The WebClient passed into the callback is running in "async" mode.
This means all responses will be futures.
"""
if asyncio.i... | def _execute_callback_async(self, callback, data):
"""Execute the callback asynchronously.
If the callback is not a coroutine, convert it.
Note: The WebClient passed into the callback is running in "async" mode.
This means all responses will be futures.
"""
if asyncio.i... | [
"Execute",
"the",
"callback",
"asynchronously",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L413-L430 | [
"def",
"_execute_callback_async",
"(",
"self",
",",
"callback",
",",
"data",
")",
":",
"if",
"asyncio",
".",
"iscoroutine",
"(",
"callback",
")",
":",
"asyncio",
".",
"ensure_future",
"(",
"callback",
"(",
"rtm_client",
"=",
"self",
",",
"web_client",
"=",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._execute_callback | Execute the callback in another thread. Wait for and return the results. | slack/rtm/client.py | def _execute_callback(self, callback, data):
"""Execute the callback in another thread. Wait for and return the results."""
web_client = WebClient(
token=self.token, base_url=self.base_url, ssl=self.ssl, proxy=self.proxy
)
with concurrent.futures.ThreadPoolExecutor(max_worker... | def _execute_callback(self, callback, data):
"""Execute the callback in another thread. Wait for and return the results."""
web_client = WebClient(
token=self.token, base_url=self.base_url, ssl=self.ssl, proxy=self.proxy
)
with concurrent.futures.ThreadPoolExecutor(max_worker... | [
"Execute",
"the",
"callback",
"in",
"another",
"thread",
".",
"Wait",
"for",
"and",
"return",
"the",
"results",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L432-L446 | [
"def",
"_execute_callback",
"(",
"self",
",",
"callback",
",",
"data",
")",
":",
"web_client",
"=",
"WebClient",
"(",
"token",
"=",
"self",
".",
"token",
",",
"base_url",
"=",
"self",
".",
"base_url",
",",
"ssl",
"=",
"self",
".",
"ssl",
",",
"proxy",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._retreive_websocket_info | Retreives the WebSocket info from Slack.
Returns:
A tuple of websocket information.
e.g.
(
"wss://...",
{
"self": {"id": "U01234ABC","name": "robotoverlord"},
"team": {
"domain": ... | slack/rtm/client.py | async def _retreive_websocket_info(self):
"""Retreives the WebSocket info from Slack.
Returns:
A tuple of websocket information.
e.g.
(
"wss://...",
{
"self": {"id": "U01234ABC","name": "robotoverlord"},
... | async def _retreive_websocket_info(self):
"""Retreives the WebSocket info from Slack.
Returns:
A tuple of websocket information.
e.g.
(
"wss://...",
{
"self": {"id": "U01234ABC","name": "robotoverlord"},
... | [
"Retreives",
"the",
"WebSocket",
"info",
"from",
"Slack",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L448-L488 | [
"async",
"def",
"_retreive_websocket_info",
"(",
"self",
")",
":",
"if",
"self",
".",
"_web_client",
"is",
"None",
":",
"self",
".",
"_web_client",
"=",
"WebClient",
"(",
"token",
"=",
"self",
".",
"token",
",",
"base_url",
"=",
"self",
".",
"base_url",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._wait_exponentially | Wait exponentially longer for each connection attempt.
Calculate the number of seconds to wait and then add
a random number of milliseconds to avoid coincendental
synchronized client retries. Wait up to the maximium amount
of wait time specified via 'max_wait_time'. However,
if ... | slack/rtm/client.py | async def _wait_exponentially(self, exception, max_wait_time=300):
"""Wait exponentially longer for each connection attempt.
Calculate the number of seconds to wait and then add
a random number of milliseconds to avoid coincendental
synchronized client retries. Wait up to the maximium a... | async def _wait_exponentially(self, exception, max_wait_time=300):
"""Wait exponentially longer for each connection attempt.
Calculate the number of seconds to wait and then add
a random number of milliseconds to avoid coincendental
synchronized client retries. Wait up to the maximium a... | [
"Wait",
"exponentially",
"longer",
"for",
"each",
"connection",
"attempt",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L490-L507 | [
"async",
"def",
"_wait_exponentially",
"(",
"self",
",",
"exception",
",",
"max_wait_time",
"=",
"300",
")",
":",
"wait_time",
"=",
"min",
"(",
"(",
"2",
"**",
"self",
".",
"_connection_attempts",
")",
"+",
"random",
".",
"random",
"(",
")",
",",
"max_wa... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | RTMClient._close_websocket | Closes the websocket connection. | slack/rtm/client.py | def _close_websocket(self):
"""Closes the websocket connection."""
close_method = getattr(self._websocket, "close", None)
if callable(close_method):
asyncio.ensure_future(close_method(), loop=self._event_loop)
self._websocket = None
self._dispatch_event(event="close") | def _close_websocket(self):
"""Closes the websocket connection."""
close_method = getattr(self._websocket, "close", None)
if callable(close_method):
asyncio.ensure_future(close_method(), loop=self._event_loop)
self._websocket = None
self._dispatch_event(event="close") | [
"Closes",
"the",
"websocket",
"connection",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/rtm/client.py#L509-L515 | [
"def",
"_close_websocket",
"(",
"self",
")",
":",
"close_method",
"=",
"getattr",
"(",
"self",
".",
"_websocket",
",",
"\"close\"",
",",
"None",
")",
"if",
"callable",
"(",
"close_method",
")",
":",
"asyncio",
".",
"ensure_future",
"(",
"close_method",
"(",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | update_emoji | Update the onboarding welcome message after recieving a "reaction_added"
event from Slack. Update timestamp for welcome message as well. | tutorial/PythOnBoardingBot/async_app.py | async def update_emoji(**payload):
"""Update the onboarding welcome message after recieving a "reaction_added"
event from Slack. Update timestamp for welcome message as well.
"""
data = payload["data"]
web_client = payload["web_client"]
channel_id = data["item"]["channel"]
user_id = data["us... | async def update_emoji(**payload):
"""Update the onboarding welcome message after recieving a "reaction_added"
event from Slack. Update timestamp for welcome message as well.
"""
data = payload["data"]
web_client = payload["web_client"]
channel_id = data["item"]["channel"]
user_id = data["us... | [
"Update",
"the",
"onboarding",
"welcome",
"message",
"after",
"recieving",
"a",
"reaction_added",
"event",
"from",
"Slack",
".",
"Update",
"timestamp",
"for",
"welcome",
"message",
"as",
"well",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/tutorial/PythOnBoardingBot/async_app.py#L66-L88 | [
"async",
"def",
"update_emoji",
"(",
"*",
"*",
"payload",
")",
":",
"data",
"=",
"payload",
"[",
"\"data\"",
"]",
"web_client",
"=",
"payload",
"[",
"\"web_client\"",
"]",
"channel_id",
"=",
"data",
"[",
"\"item\"",
"]",
"[",
"\"channel\"",
"]",
"user_id",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | update_pin | Update the onboarding welcome message after recieving a "pin_added"
event from Slack. Update timestamp for welcome message as well. | tutorial/PythOnBoardingBot/async_app.py | async def update_pin(**payload):
"""Update the onboarding welcome message after recieving a "pin_added"
event from Slack. Update timestamp for welcome message as well.
"""
data = payload["data"]
web_client = payload["web_client"]
channel_id = data["channel_id"]
user_id = data["user"]
# ... | async def update_pin(**payload):
"""Update the onboarding welcome message after recieving a "pin_added"
event from Slack. Update timestamp for welcome message as well.
"""
data = payload["data"]
web_client = payload["web_client"]
channel_id = data["channel_id"]
user_id = data["user"]
# ... | [
"Update",
"the",
"onboarding",
"welcome",
"message",
"after",
"recieving",
"a",
"pin_added",
"event",
"from",
"Slack",
".",
"Update",
"timestamp",
"for",
"welcome",
"message",
"as",
"well",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/tutorial/PythOnBoardingBot/async_app.py#L95-L117 | [
"async",
"def",
"update_pin",
"(",
"*",
"*",
"payload",
")",
":",
"data",
"=",
"payload",
"[",
"\"data\"",
"]",
"web_client",
"=",
"payload",
"[",
"\"web_client\"",
"]",
"channel_id",
"=",
"data",
"[",
"\"channel_id\"",
"]",
"user_id",
"=",
"data",
"[",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | message | Display the onboarding welcome message after receiving a message
that contains "start". | tutorial/PythOnBoardingBot/async_app.py | async def message(**payload):
"""Display the onboarding welcome message after receiving a message
that contains "start".
"""
data = payload["data"]
web_client = payload["web_client"]
channel_id = data.get("channel")
user_id = data.get("user")
text = data.get("text")
if text and text... | async def message(**payload):
"""Display the onboarding welcome message after receiving a message
that contains "start".
"""
data = payload["data"]
web_client = payload["web_client"]
channel_id = data.get("channel")
user_id = data.get("user")
text = data.get("text")
if text and text... | [
"Display",
"the",
"onboarding",
"welcome",
"message",
"after",
"receiving",
"a",
"message",
"that",
"contains",
"start",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/tutorial/PythOnBoardingBot/async_app.py#L124-L135 | [
"async",
"def",
"message",
"(",
"*",
"*",
"payload",
")",
":",
"data",
"=",
"payload",
"[",
"\"data\"",
"]",
"web_client",
"=",
"payload",
"[",
"\"web_client\"",
"]",
"channel_id",
"=",
"data",
".",
"get",
"(",
"\"channel\"",
")",
"user_id",
"=",
"data",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.channels_rename | Renames a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
name (str): The new channel name. e.g. 'newchannel' | slack/web/client.py | def channels_rename(self, *, channel: str, name: str, **kwargs) -> SlackResponse:
"""Renames a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
name (str): The new channel name. e.g. 'newchannel'
"""
self._validate_xoxp_token()
kwargs.upda... | def channels_rename(self, *, channel: str, name: str, **kwargs) -> SlackResponse:
"""Renames a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
name (str): The new channel name. e.g. 'newchannel'
"""
self._validate_xoxp_token()
kwargs.upda... | [
"Renames",
"a",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L178-L187 | [
"def",
"channels_rename",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"name",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"channel... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.channels_replies | Retrieve a thread of messages posted to a channel
Args:
channel (str): The channel id. e.g. 'C1234567890'
thread_ts (str): The timestamp of an existing message with 0 or more replies.
e.g. '1234567890.123456' | slack/web/client.py | def channels_replies(self, *, channel: str, thread_ts: str, **kwargs) -> SlackResponse:
"""Retrieve a thread of messages posted to a channel
Args:
channel (str): The channel id. e.g. 'C1234567890'
thread_ts (str): The timestamp of an existing message with 0 or more replies.
... | def channels_replies(self, *, channel: str, thread_ts: str, **kwargs) -> SlackResponse:
"""Retrieve a thread of messages posted to a channel
Args:
channel (str): The channel id. e.g. 'C1234567890'
thread_ts (str): The timestamp of an existing message with 0 or more replies.
... | [
"Retrieve",
"a",
"thread",
"of",
"messages",
"posted",
"to",
"a",
"channel"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L189-L198 | [
"def",
"channels_replies",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"thread_ts",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"thread_ts\"",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.channels_unarchive | Unarchives a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890' | slack/web/client.py | def channels_unarchive(self, *, channel: str, **kwargs) -> SlackResponse:
"""Unarchives a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
"""
self._validate_xoxp_token()
kwargs.update({"channel": channel})
return self.api_call("channels.unarc... | def channels_unarchive(self, *, channel: str, **kwargs) -> SlackResponse:
"""Unarchives a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
"""
self._validate_xoxp_token()
kwargs.update({"channel": channel})
return self.api_call("channels.unarc... | [
"Unarchives",
"a",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L222-L230 | [
"def",
"channels_unarchive",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
"}"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.chat_delete | Deletes a message.
Args:
channel (str): Channel containing the message to be deleted. e.g. 'C1234567890'
ts (str): Timestamp of the message to be deleted. e.g. '1234567890.123456' | slack/web/client.py | def chat_delete(self, *, channel: str, ts: str, **kwargs) -> SlackResponse:
"""Deletes a message.
Args:
channel (str): Channel containing the message to be deleted. e.g. 'C1234567890'
ts (str): Timestamp of the message to be deleted. e.g. '1234567890.123456'
"""
... | def chat_delete(self, *, channel: str, ts: str, **kwargs) -> SlackResponse:
"""Deletes a message.
Args:
channel (str): Channel containing the message to be deleted. e.g. 'C1234567890'
ts (str): Timestamp of the message to be deleted. e.g. '1234567890.123456'
"""
... | [
"Deletes",
"a",
"message",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L232-L240 | [
"def",
"chat_delete",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"ts",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"ts\"",
":",
"ts",
"}... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.chat_getPermalink | Retrieve a permalink URL for a specific extant message
Args:
channel (str): The channel id. e.g. 'C1234567890'
message_ts (str): The timestamp. e.g. '1234567890.123456' | slack/web/client.py | def chat_getPermalink(
self, *, channel: str, message_ts: str, **kwargs
) -> SlackResponse:
"""Retrieve a permalink URL for a specific extant message
Args:
channel (str): The channel id. e.g. 'C1234567890'
message_ts (str): The timestamp. e.g. '1234567890.123456'
... | def chat_getPermalink(
self, *, channel: str, message_ts: str, **kwargs
) -> SlackResponse:
"""Retrieve a permalink URL for a specific extant message
Args:
channel (str): The channel id. e.g. 'C1234567890'
message_ts (str): The timestamp. e.g. '1234567890.123456'
... | [
"Retrieve",
"a",
"permalink",
"URL",
"for",
"a",
"specific",
"extant",
"message"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L242-L252 | [
"def",
"chat_getPermalink",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"message_ts",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"message_ts\"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.chat_meMessage | Share a me message into a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
text (str): The message you'd like to share. e.g. 'Hello world' | slack/web/client.py | def chat_meMessage(self, *, channel: str, text: str, **kwargs) -> SlackResponse:
"""Share a me message into a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
text (str): The message you'd like to share. e.g. 'Hello world'
"""
kwargs.update({"chan... | def chat_meMessage(self, *, channel: str, text: str, **kwargs) -> SlackResponse:
"""Share a me message into a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
text (str): The message you'd like to share. e.g. 'Hello world'
"""
kwargs.update({"chan... | [
"Share",
"a",
"me",
"message",
"into",
"a",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L254-L262 | [
"def",
"chat_meMessage",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"text",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"text\"",
":",
"te... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.chat_postEphemeral | Sends an ephemeral message to a user in a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
user (str): The id of user who should see the message. e.g. 'U0BPQUNTA'
text (str): The message you'd like to share. e.g. 'Hello world'
text is not requ... | slack/web/client.py | def chat_postEphemeral(self, *, channel: str, user: str, **kwargs) -> SlackResponse:
"""Sends an ephemeral message to a user in a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
user (str): The id of user who should see the message. e.g. 'U0BPQUNTA'
... | def chat_postEphemeral(self, *, channel: str, user: str, **kwargs) -> SlackResponse:
"""Sends an ephemeral message to a user in a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
user (str): The id of user who should see the message. e.g. 'U0BPQUNTA'
... | [
"Sends",
"an",
"ephemeral",
"message",
"to",
"a",
"user",
"in",
"a",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L264-L277 | [
"def",
"chat_postEphemeral",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"user",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"user\"",
":",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.chat_unfurl | Provide custom unfurl behavior for user-posted URLs.
Args:
channel (str): The Channel ID of the message. e.g. 'C1234567890'
ts (str): Timestamp of the message to add unfurl behavior to. e.g. '1234567890.123456'
unfurls (dict): a dict of the specific URLs you're offering an u... | slack/web/client.py | def chat_unfurl(
self, *, channel: str, ts: str, unfurls: dict, **kwargs
) -> SlackResponse:
"""Provide custom unfurl behavior for user-posted URLs.
Args:
channel (str): The Channel ID of the message. e.g. 'C1234567890'
ts (str): Timestamp of the message to add unfur... | def chat_unfurl(
self, *, channel: str, ts: str, unfurls: dict, **kwargs
) -> SlackResponse:
"""Provide custom unfurl behavior for user-posted URLs.
Args:
channel (str): The Channel ID of the message. e.g. 'C1234567890'
ts (str): Timestamp of the message to add unfur... | [
"Provide",
"custom",
"unfurl",
"behavior",
"for",
"user",
"-",
"posted",
"URLs",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L293-L306 | [
"def",
"chat_unfurl",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"ts",
":",
"str",
",",
"unfurls",
":",
"dict",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"upda... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.conversations_invite | Invites users to a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
users (list): An list of user id's to invite. e.g. ['U2345678901', 'U3456789012'] | slack/web/client.py | def conversations_invite(
self, *, channel: str, users: List[str], **kwargs
) -> SlackResponse:
"""Invites users to a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
users (list): An list of user id's to invite. e.g. ['U2345678901', 'U3456789012']
... | def conversations_invite(
self, *, channel: str, users: List[str], **kwargs
) -> SlackResponse:
"""Invites users to a channel.
Args:
channel (str): The channel id. e.g. 'C1234567890'
users (list): An list of user id's to invite. e.g. ['U2345678901', 'U3456789012']
... | [
"Invites",
"users",
"to",
"a",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L370-L381 | [
"def",
"conversations_invite",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"users",
":",
"List",
"[",
"str",
"]",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"updat... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.conversations_replies | Retrieve a thread of messages posted to a conversation
Args:
channel (str): Conversation ID to fetch thread from. e.g. 'C1234567890'
ts (str): Unique identifier of a thread's parent message. e.g. '1234567890.123456' | slack/web/client.py | def conversations_replies(self, *, channel: str, ts: str, **kwargs) -> SlackResponse:
"""Retrieve a thread of messages posted to a conversation
Args:
channel (str): Conversation ID to fetch thread from. e.g. 'C1234567890'
ts (str): Unique identifier of a thread's parent message.... | def conversations_replies(self, *, channel: str, ts: str, **kwargs) -> SlackResponse:
"""Retrieve a thread of messages posted to a conversation
Args:
channel (str): Conversation ID to fetch thread from. e.g. 'C1234567890'
ts (str): Unique identifier of a thread's parent message.... | [
"Retrieve",
"a",
"thread",
"of",
"messages",
"posted",
"to",
"a",
"conversation"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L442-L450 | [
"def",
"conversations_replies",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"ts",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"ts\"",
":",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.conversations_setTopic | Sets the topic for a conversation.
Args:
channel (str): The channel id. e.g. 'C1234567890'
topic (str): The new topic for the channel. e.g. 'My Topic' | slack/web/client.py | def conversations_setTopic(
self, *, channel: str, topic: str, **kwargs
) -> SlackResponse:
"""Sets the topic for a conversation.
Args:
channel (str): The channel id. e.g. 'C1234567890'
topic (str): The new topic for the channel. e.g. 'My Topic'
"""
k... | def conversations_setTopic(
self, *, channel: str, topic: str, **kwargs
) -> SlackResponse:
"""Sets the topic for a conversation.
Args:
channel (str): The channel id. e.g. 'C1234567890'
topic (str): The new topic for the channel. e.g. 'My Topic'
"""
k... | [
"Sets",
"the",
"topic",
"for",
"a",
"conversation",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L464-L474 | [
"def",
"conversations_setTopic",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"topic",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"topic\"",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.dialog_open | Open a dialog with a user.
Args:
dialog (dict): A dictionary of dialog arguments.
{
"callback_id": "46eh782b0",
"title": "Request something",
"submit_label": "Request",
"state": "Max",
... | slack/web/client.py | def dialog_open(self, *, dialog: dict, trigger_id: str, **kwargs) -> SlackResponse:
"""Open a dialog with a user.
Args:
dialog (dict): A dictionary of dialog arguments.
{
"callback_id": "46eh782b0",
"title": "Request something",
... | def dialog_open(self, *, dialog: dict, trigger_id: str, **kwargs) -> SlackResponse:
"""Open a dialog with a user.
Args:
dialog (dict): A dictionary of dialog arguments.
{
"callback_id": "46eh782b0",
"title": "Request something",
... | [
"Open",
"a",
"dialog",
"with",
"a",
"user",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L486-L513 | [
"def",
"dialog_open",
"(",
"self",
",",
"*",
",",
"dialog",
":",
"dict",
",",
"trigger_id",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"dialog\"",
":",
"dialog",
",",
"\"trigger_id\"",
":"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.dnd_endDnd | Ends the current user's Do Not Disturb session immediately. | slack/web/client.py | def dnd_endDnd(self, **kwargs) -> SlackResponse:
"""Ends the current user's Do Not Disturb session immediately."""
self._validate_xoxp_token()
return self.api_call("dnd.endDnd", json=kwargs) | def dnd_endDnd(self, **kwargs) -> SlackResponse:
"""Ends the current user's Do Not Disturb session immediately."""
self._validate_xoxp_token()
return self.api_call("dnd.endDnd", json=kwargs) | [
"Ends",
"the",
"current",
"user",
"s",
"Do",
"Not",
"Disturb",
"session",
"immediately",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L515-L518 | [
"def",
"dnd_endDnd",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"dnd.endDnd\"",
",",
"json",
"=",
"kwargs",
")"
] | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.dnd_endSnooze | Ends the current user's snooze mode immediately. | slack/web/client.py | def dnd_endSnooze(self, **kwargs) -> SlackResponse:
"""Ends the current user's snooze mode immediately."""
self._validate_xoxp_token()
return self.api_call("dnd.endSnooze", json=kwargs) | def dnd_endSnooze(self, **kwargs) -> SlackResponse:
"""Ends the current user's snooze mode immediately."""
self._validate_xoxp_token()
return self.api_call("dnd.endSnooze", json=kwargs) | [
"Ends",
"the",
"current",
"user",
"s",
"snooze",
"mode",
"immediately",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L520-L523 | [
"def",
"dnd_endSnooze",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"dnd.endSnooze\"",
",",
"json",
"=",
"kwargs",
")"
] | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.dnd_setSnooze | Turns on Do Not Disturb mode for the current user, or changes its duration.
Args:
num_minutes (int): The snooze duration. e.g. 60 | slack/web/client.py | def dnd_setSnooze(self, *, num_minutes: int, **kwargs) -> SlackResponse:
"""Turns on Do Not Disturb mode for the current user, or changes its duration.
Args:
num_minutes (int): The snooze duration. e.g. 60
"""
self._validate_xoxp_token()
kwargs.update({"num_minutes":... | def dnd_setSnooze(self, *, num_minutes: int, **kwargs) -> SlackResponse:
"""Turns on Do Not Disturb mode for the current user, or changes its duration.
Args:
num_minutes (int): The snooze duration. e.g. 60
"""
self._validate_xoxp_token()
kwargs.update({"num_minutes":... | [
"Turns",
"on",
"Do",
"Not",
"Disturb",
"mode",
"for",
"the",
"current",
"user",
"or",
"changes",
"its",
"duration",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L529-L537 | [
"def",
"dnd_setSnooze",
"(",
"self",
",",
"*",
",",
"num_minutes",
":",
"int",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"num_minutes\"",
":",
"num_minutes"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_comments_add | Add a comment to an existing file.
Args:
comment (str): The body of the comment.
e.g. 'Everyone should take a moment to read this file.'
file (str): The file id. e.g. 'F1234467890' | slack/web/client.py | def files_comments_add(self, *, comment: str, file: str, **kwargs) -> SlackResponse:
"""Add a comment to an existing file.
Args:
comment (str): The body of the comment.
e.g. 'Everyone should take a moment to read this file.'
file (str): The file id. e.g. 'F123446... | def files_comments_add(self, *, comment: str, file: str, **kwargs) -> SlackResponse:
"""Add a comment to an existing file.
Args:
comment (str): The body of the comment.
e.g. 'Everyone should take a moment to read this file.'
file (str): The file id. e.g. 'F123446... | [
"Add",
"a",
"comment",
"to",
"an",
"existing",
"file",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L547-L556 | [
"def",
"files_comments_add",
"(",
"self",
",",
"*",
",",
"comment",
":",
"str",
",",
"file",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"comment\"",
":",
"comment",
",",
"\"file\"",
":",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_comments_delete | Deletes an existing comment on a file.
Args:
file (str): The file id. e.g. 'F1234467890'
id (str): The file comment id. e.g. 'Fc1234567890' | slack/web/client.py | def files_comments_delete(self, *, file: str, id: str, **kwargs) -> SlackResponse:
"""Deletes an existing comment on a file.
Args:
file (str): The file id. e.g. 'F1234467890'
id (str): The file comment id. e.g. 'Fc1234567890'
"""
kwargs.update({"file": file, "id"... | def files_comments_delete(self, *, file: str, id: str, **kwargs) -> SlackResponse:
"""Deletes an existing comment on a file.
Args:
file (str): The file id. e.g. 'F1234467890'
id (str): The file comment id. e.g. 'Fc1234567890'
"""
kwargs.update({"file": file, "id"... | [
"Deletes",
"an",
"existing",
"comment",
"on",
"a",
"file",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L558-L566 | [
"def",
"files_comments_delete",
"(",
"self",
",",
"*",
",",
"file",
":",
"str",
",",
"id",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"file\"",
":",
"file",
",",
"\"id\"",
":",
"id",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_comments_edit | Edit an existing file comment.
Args:
comment (str): The body of the comment.
e.g. 'Everyone should take a moment to read this file.'
file (str): The file id. e.g. 'F1234467890'
id (str): The file comment id. e.g. 'Fc1234567890' | slack/web/client.py | def files_comments_edit(
self, *, comment: str, file: str, id: str, **kwargs
) -> SlackResponse:
"""Edit an existing file comment.
Args:
comment (str): The body of the comment.
e.g. 'Everyone should take a moment to read this file.'
file (str): The fi... | def files_comments_edit(
self, *, comment: str, file: str, id: str, **kwargs
) -> SlackResponse:
"""Edit an existing file comment.
Args:
comment (str): The body of the comment.
e.g. 'Everyone should take a moment to read this file.'
file (str): The fi... | [
"Edit",
"an",
"existing",
"file",
"comment",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L568-L580 | [
"def",
"files_comments_edit",
"(",
"self",
",",
"*",
",",
"comment",
":",
"str",
",",
"file",
":",
"str",
",",
"id",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"comment\"",
":",
"comment... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_delete | Deletes a file.
Args:
id (str): The file id. e.g. 'F1234467890' | slack/web/client.py | def files_delete(self, *, id: str, **kwargs) -> SlackResponse:
"""Deletes a file.
Args:
id (str): The file id. e.g. 'F1234467890'
"""
kwargs.update({"id": id})
return self.api_call("files.delete", json=kwargs) | def files_delete(self, *, id: str, **kwargs) -> SlackResponse:
"""Deletes a file.
Args:
id (str): The file id. e.g. 'F1234467890'
"""
kwargs.update({"id": id})
return self.api_call("files.delete", json=kwargs) | [
"Deletes",
"a",
"file",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L582-L589 | [
"def",
"files_delete",
"(",
"self",
",",
"*",
",",
"id",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"id\"",
":",
"id",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"\"files.delete\"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_info | Gets information about a team file.
Args:
id (str): The file id. e.g. 'F1234467890' | slack/web/client.py | def files_info(self, *, id: str, **kwargs) -> SlackResponse:
"""Gets information about a team file.
Args:
id (str): The file id. e.g. 'F1234467890'
"""
kwargs.update({"id": id})
return self.api_call("files.info", http_verb="GET", params=kwargs) | def files_info(self, *, id: str, **kwargs) -> SlackResponse:
"""Gets information about a team file.
Args:
id (str): The file id. e.g. 'F1234467890'
"""
kwargs.update({"id": id})
return self.api_call("files.info", http_verb="GET", params=kwargs) | [
"Gets",
"information",
"about",
"a",
"team",
"file",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L591-L598 | [
"def",
"files_info",
"(",
"self",
",",
"*",
",",
"id",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"id\"",
":",
"id",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"\"files.info\"",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_list | Lists & filters team files. | slack/web/client.py | def files_list(self, **kwargs) -> SlackResponse:
"""Lists & filters team files."""
self._validate_xoxp_token()
return self.api_call("files.list", http_verb="GET", params=kwargs) | def files_list(self, **kwargs) -> SlackResponse:
"""Lists & filters team files."""
self._validate_xoxp_token()
return self.api_call("files.list", http_verb="GET", params=kwargs) | [
"Lists",
"&",
"filters",
"team",
"files",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L600-L603 | [
"def",
"files_list",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"files.list\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
"=",
"kwar... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_sharedPublicURL | Enables a file for public/external sharing.
Args:
id (str): The file id. e.g. 'F1234467890' | slack/web/client.py | def files_sharedPublicURL(self, *, id: str, **kwargs) -> SlackResponse:
"""Enables a file for public/external sharing.
Args:
id (str): The file id. e.g. 'F1234467890'
"""
self._validate_xoxp_token()
kwargs.update({"id": id})
return self.api_call("files.shared... | def files_sharedPublicURL(self, *, id: str, **kwargs) -> SlackResponse:
"""Enables a file for public/external sharing.
Args:
id (str): The file id. e.g. 'F1234467890'
"""
self._validate_xoxp_token()
kwargs.update({"id": id})
return self.api_call("files.shared... | [
"Enables",
"a",
"file",
"for",
"public",
"/",
"external",
"sharing",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L615-L623 | [
"def",
"files_sharedPublicURL",
"(",
"self",
",",
"*",
",",
"id",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"id\"",
":",
"id",
"}",
")",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.files_upload | Uploads or creates a file.
Args:
file (str): Supply a file path.
when you'd like to upload a specific file. e.g. 'dramacat.gif'
content (str): Supply content when you'd like to create an
editable text file containing the specified text. e.g. 'launch plan'... | slack/web/client.py | def files_upload(
self, *, file: Union[str, IOBase] = None, content: str = None, **kwargs
) -> SlackResponse:
"""Uploads or creates a file.
Args:
file (str): Supply a file path.
when you'd like to upload a specific file. e.g. 'dramacat.gif'
content (s... | def files_upload(
self, *, file: Union[str, IOBase] = None, content: str = None, **kwargs
) -> SlackResponse:
"""Uploads or creates a file.
Args:
file (str): Supply a file path.
when you'd like to upload a specific file. e.g. 'dramacat.gif'
content (s... | [
"Uploads",
"or",
"creates",
"a",
"file",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L625-L650 | [
"def",
"files_upload",
"(",
"self",
",",
"*",
",",
"file",
":",
"Union",
"[",
"str",
",",
"IOBase",
"]",
"=",
"None",
",",
"content",
":",
"str",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"if",
"file",
"is",
"None",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.groups_createChild | Clones and archives a private channel.
Args:
channel (str): The group id. e.g. 'G1234567890' | slack/web/client.py | def groups_createChild(self, *, channel: str, **kwargs) -> SlackResponse:
"""Clones and archives a private channel.
Args:
channel (str): The group id. e.g. 'G1234567890'
"""
self._validate_xoxp_token()
kwargs.update({"channel": channel})
return self.api_call(... | def groups_createChild(self, *, channel: str, **kwargs) -> SlackResponse:
"""Clones and archives a private channel.
Args:
channel (str): The group id. e.g. 'G1234567890'
"""
self._validate_xoxp_token()
kwargs.update({"channel": channel})
return self.api_call(... | [
"Clones",
"and",
"archives",
"a",
"private",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L672-L680 | [
"def",
"groups_createChild",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
"}"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.groups_invite | Invites a user to a private channel.
Args:
channel (str): The group id. e.g. 'G1234567890'
user (str): The user id. e.g. 'U1234567890' | slack/web/client.py | def groups_invite(self, *, channel: str, user: str, **kwargs) -> SlackResponse:
"""Invites a user to a private channel.
Args:
channel (str): The group id. e.g. 'G1234567890'
user (str): The user id. e.g. 'U1234567890'
"""
self._validate_xoxp_token()
kwarg... | def groups_invite(self, *, channel: str, user: str, **kwargs) -> SlackResponse:
"""Invites a user to a private channel.
Args:
channel (str): The group id. e.g. 'G1234567890'
user (str): The user id. e.g. 'U1234567890'
"""
self._validate_xoxp_token()
kwarg... | [
"Invites",
"a",
"user",
"to",
"a",
"private",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L700-L709 | [
"def",
"groups_invite",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"user",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.groups_replies | Retrieve a thread of messages posted to a private channel
Args:
channel (str): The channel id. e.g. 'C1234567890'
thread_ts (str): The timestamp of an existing message with 0 or more replies.
e.g. '1234567890.123456' | slack/web/client.py | def groups_replies(self, *, channel: str, thread_ts: str, **kwargs) -> SlackResponse:
"""Retrieve a thread of messages posted to a private channel
Args:
channel (str): The channel id. e.g. 'C1234567890'
thread_ts (str): The timestamp of an existing message with 0 or more replies... | def groups_replies(self, *, channel: str, thread_ts: str, **kwargs) -> SlackResponse:
"""Retrieve a thread of messages posted to a private channel
Args:
channel (str): The channel id. e.g. 'C1234567890'
thread_ts (str): The timestamp of an existing message with 0 or more replies... | [
"Retrieve",
"a",
"thread",
"of",
"messages",
"posted",
"to",
"a",
"private",
"channel"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L766-L776 | [
"def",
"groups_replies",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"thread_ts",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"cha... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.groups_setPurpose | Sets the purpose for a private channel.
Args:
channel (str): The channel id. e.g. 'G1234567890'
purpose (str): The new purpose for the channel. e.g. 'My Purpose' | slack/web/client.py | def groups_setPurpose(self, *, channel: str, purpose: str, **kwargs) -> SlackResponse:
"""Sets the purpose for a private channel.
Args:
channel (str): The channel id. e.g. 'G1234567890'
purpose (str): The new purpose for the channel. e.g. 'My Purpose'
"""
kwargs.... | def groups_setPurpose(self, *, channel: str, purpose: str, **kwargs) -> SlackResponse:
"""Sets the purpose for a private channel.
Args:
channel (str): The channel id. e.g. 'G1234567890'
purpose (str): The new purpose for the channel. e.g. 'My Purpose'
"""
kwargs.... | [
"Sets",
"the",
"purpose",
"for",
"a",
"private",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L778-L786 | [
"def",
"groups_setPurpose",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"purpose",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
",",
"\"purpose\"",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.im_open | Opens a direct message channel.
Args:
user (str): The user id to open a DM with. e.g. 'W1234567890' | slack/web/client.py | def im_open(self, *, user: str, **kwargs) -> SlackResponse:
"""Opens a direct message channel.
Args:
user (str): The user id to open a DM with. e.g. 'W1234567890'
"""
kwargs.update({"user": user})
return self.api_call("im.open", json=kwargs) | def im_open(self, *, user: str, **kwargs) -> SlackResponse:
"""Opens a direct message channel.
Args:
user (str): The user id to open a DM with. e.g. 'W1234567890'
"""
kwargs.update({"user": user})
return self.api_call("im.open", json=kwargs) | [
"Opens",
"a",
"direct",
"message",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L840-L847 | [
"def",
"im_open",
"(",
"self",
",",
"*",
",",
"user",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"user\"",
":",
"user",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"\"im.open\"",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.migration_exchange | For Enterprise Grid workspaces, map local user IDs to global user IDs
Args:
users (list): A list of user ids, up to 400 per request.
e.g. ['W1234567890', 'U2345678901', 'U3456789012'] | slack/web/client.py | def migration_exchange(self, *, users: List[str], **kwargs) -> SlackResponse:
"""For Enterprise Grid workspaces, map local user IDs to global user IDs
Args:
users (list): A list of user ids, up to 400 per request.
e.g. ['W1234567890', 'U2345678901', 'U3456789012']
""... | def migration_exchange(self, *, users: List[str], **kwargs) -> SlackResponse:
"""For Enterprise Grid workspaces, map local user IDs to global user IDs
Args:
users (list): A list of user ids, up to 400 per request.
e.g. ['W1234567890', 'U2345678901', 'U3456789012']
""... | [
"For",
"Enterprise",
"Grid",
"workspaces",
"map",
"local",
"user",
"IDs",
"to",
"global",
"user",
"IDs"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L860-L868 | [
"def",
"migration_exchange",
"(",
"self",
",",
"*",
",",
"users",
":",
"List",
"[",
"str",
"]",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"users\"",
":",
"users",
"}",
")",
"return",
"self",
".",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.mpim_close | Closes a multiparty direct message channel.
Args:
channel (str): Multiparty Direct message channel to close. e.g. 'G1234567890' | slack/web/client.py | def mpim_close(self, *, channel: str, **kwargs) -> SlackResponse:
"""Closes a multiparty direct message channel.
Args:
channel (str): Multiparty Direct message channel to close. e.g. 'G1234567890'
"""
kwargs.update({"channel": channel})
return self.api_call("mpim.clo... | def mpim_close(self, *, channel: str, **kwargs) -> SlackResponse:
"""Closes a multiparty direct message channel.
Args:
channel (str): Multiparty Direct message channel to close. e.g. 'G1234567890'
"""
kwargs.update({"channel": channel})
return self.api_call("mpim.clo... | [
"Closes",
"a",
"multiparty",
"direct",
"message",
"channel",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L870-L877 | [
"def",
"mpim_close",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"\"m... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.mpim_history | Fetches history of messages and events from a multiparty direct message.
Args:
channel (str): Multiparty direct message to fetch history for. e.g. 'G1234567890' | slack/web/client.py | def mpim_history(self, *, channel: str, **kwargs) -> SlackResponse:
"""Fetches history of messages and events from a multiparty direct message.
Args:
channel (str): Multiparty direct message to fetch history for. e.g. 'G1234567890'
"""
kwargs.update({"channel": channel})
... | def mpim_history(self, *, channel: str, **kwargs) -> SlackResponse:
"""Fetches history of messages and events from a multiparty direct message.
Args:
channel (str): Multiparty direct message to fetch history for. e.g. 'G1234567890'
"""
kwargs.update({"channel": channel})
... | [
"Fetches",
"history",
"of",
"messages",
"and",
"events",
"from",
"a",
"multiparty",
"direct",
"message",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L879-L886 | [
"def",
"mpim_history",
"(",
"self",
",",
"*",
",",
"channel",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"channel\"",
":",
"channel",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"\... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.mpim_open | This method opens a multiparty direct message.
Args:
users (list): A lists of user ids. The ordering of the users
is preserved whenever a MPIM group is returned.
e.g. ['W1234567890', 'U2345678901', 'U3456789012'] | slack/web/client.py | def mpim_open(self, *, users: List[str], **kwargs) -> SlackResponse:
"""This method opens a multiparty direct message.
Args:
users (list): A lists of user ids. The ordering of the users
is preserved whenever a MPIM group is returned.
e.g. ['W1234567890', 'U23... | def mpim_open(self, *, users: List[str], **kwargs) -> SlackResponse:
"""This method opens a multiparty direct message.
Args:
users (list): A lists of user ids. The ordering of the users
is preserved whenever a MPIM group is returned.
e.g. ['W1234567890', 'U23... | [
"This",
"method",
"opens",
"a",
"multiparty",
"direct",
"message",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L904-L913 | [
"def",
"mpim_open",
"(",
"self",
",",
"*",
",",
"users",
":",
"List",
"[",
"str",
"]",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"users\"",
":",
"users",
"}",
")",
"return",
"self",
".",
"api_cal... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.oauth_access | Exchanges a temporary OAuth verifier code for an access token.
Args:
client_id (str): Issued when you created your application. e.g. '4b39e9-752c4'
client_secret (str): Issued when you created your application. e.g. '33fea0113f5b1'
code (str): The code param returned via the... | slack/web/client.py | def oauth_access(
self, *, client_id: str, client_secret: str, code: str, **kwargs
) -> SlackResponse:
"""Exchanges a temporary OAuth verifier code for an access token.
Args:
client_id (str): Issued when you created your application. e.g. '4b39e9-752c4'
client_secret... | def oauth_access(
self, *, client_id: str, client_secret: str, code: str, **kwargs
) -> SlackResponse:
"""Exchanges a temporary OAuth verifier code for an access token.
Args:
client_id (str): Issued when you created your application. e.g. '4b39e9-752c4'
client_secret... | [
"Exchanges",
"a",
"temporary",
"OAuth",
"verifier",
"code",
"for",
"an",
"access",
"token",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L928-L941 | [
"def",
"oauth_access",
"(",
"self",
",",
"*",
",",
"client_id",
":",
"str",
",",
"client_secret",
":",
"str",
",",
"code",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"client_id\"",
":",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.reactions_add | Adds a reaction to an item.
Args:
name (str): Reaction (emoji) name. e.g. 'thumbsup'
channel (str): Channel where the message to add reaction to was posted.
e.g. 'C1234567890'
timestamp (str): Timestamp of the message to add reaction to. e.g. '1234567890.1234... | slack/web/client.py | def reactions_add(self, *, name: str, **kwargs) -> SlackResponse:
"""Adds a reaction to an item.
Args:
name (str): Reaction (emoji) name. e.g. 'thumbsup'
channel (str): Channel where the message to add reaction to was posted.
e.g. 'C1234567890'
timest... | def reactions_add(self, *, name: str, **kwargs) -> SlackResponse:
"""Adds a reaction to an item.
Args:
name (str): Reaction (emoji) name. e.g. 'thumbsup'
channel (str): Channel where the message to add reaction to was posted.
e.g. 'C1234567890'
timest... | [
"Adds",
"a",
"reaction",
"to",
"an",
"item",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L976-L986 | [
"def",
"reactions_add",
"(",
"self",
",",
"*",
",",
"name",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"name\"",
":",
"name",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"\"reactio... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.reminders_add | Creates a reminder.
Args:
text (str): The content of the reminder. e.g. 'eat a banana'
time (str): When this reminder should happen:
the Unix timestamp (up to five years from now e.g. '1602288000'),
the number of seconds until the reminder (if within 24 h... | slack/web/client.py | def reminders_add(self, *, text: str, time: str, **kwargs) -> SlackResponse:
"""Creates a reminder.
Args:
text (str): The content of the reminder. e.g. 'eat a banana'
time (str): When this reminder should happen:
the Unix timestamp (up to five years from now e.g.... | def reminders_add(self, *, text: str, time: str, **kwargs) -> SlackResponse:
"""Creates a reminder.
Args:
text (str): The content of the reminder. e.g. 'eat a banana'
time (str): When this reminder should happen:
the Unix timestamp (up to five years from now e.g.... | [
"Creates",
"a",
"reminder",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1005-L1017 | [
"def",
"reminders_add",
"(",
"self",
",",
"*",
",",
"text",
":",
"str",
",",
"time",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"text\"",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.reminders_complete | Marks a reminder as complete.
Args:
reminder (str): The ID of the reminder to be marked as complete.
e.g. 'Rm12345678' | slack/web/client.py | def reminders_complete(self, *, reminder: str, **kwargs) -> SlackResponse:
"""Marks a reminder as complete.
Args:
reminder (str): The ID of the reminder to be marked as complete.
e.g. 'Rm12345678'
"""
self._validate_xoxp_token()
kwargs.update({"remind... | def reminders_complete(self, *, reminder: str, **kwargs) -> SlackResponse:
"""Marks a reminder as complete.
Args:
reminder (str): The ID of the reminder to be marked as complete.
e.g. 'Rm12345678'
"""
self._validate_xoxp_token()
kwargs.update({"remind... | [
"Marks",
"a",
"reminder",
"as",
"complete",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1019-L1028 | [
"def",
"reminders_complete",
"(",
"self",
",",
"*",
",",
"reminder",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"reminder\"",
":",
"reminder",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.reminders_info | Gets information about a reminder.
Args:
reminder (str): The ID of the reminder. e.g. 'Rm12345678' | slack/web/client.py | def reminders_info(self, *, reminder: str, **kwargs) -> SlackResponse:
"""Gets information about a reminder.
Args:
reminder (str): The ID of the reminder. e.g. 'Rm12345678'
"""
self._validate_xoxp_token()
kwargs.update({"reminder": reminder})
return self.api_... | def reminders_info(self, *, reminder: str, **kwargs) -> SlackResponse:
"""Gets information about a reminder.
Args:
reminder (str): The ID of the reminder. e.g. 'Rm12345678'
"""
self._validate_xoxp_token()
kwargs.update({"reminder": reminder})
return self.api_... | [
"Gets",
"information",
"about",
"a",
"reminder",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1040-L1048 | [
"def",
"reminders_info",
"(",
"self",
",",
"*",
",",
"reminder",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"reminder\"",
":",
"reminder",
"}",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.reminders_list | Lists all reminders created by or for a given user. | slack/web/client.py | def reminders_list(self, **kwargs) -> SlackResponse:
"""Lists all reminders created by or for a given user."""
self._validate_xoxp_token()
return self.api_call("reminders.list", http_verb="GET", params=kwargs) | def reminders_list(self, **kwargs) -> SlackResponse:
"""Lists all reminders created by or for a given user."""
self._validate_xoxp_token()
return self.api_call("reminders.list", http_verb="GET", params=kwargs) | [
"Lists",
"all",
"reminders",
"created",
"by",
"or",
"for",
"a",
"given",
"user",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1050-L1053 | [
"def",
"reminders_list",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"reminders.list\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
"=",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.search_messages | Searches for messages matching a query.
Args:
query (str): Search query. May contains booleans, etc.
e.g. 'pickleface' | slack/web/client.py | def search_messages(self, *, query: str, **kwargs) -> SlackResponse:
"""Searches for messages matching a query.
Args:
query (str): Search query. May contains booleans, etc.
e.g. 'pickleface'
"""
self._validate_xoxp_token()
kwargs.update({"query": quer... | def search_messages(self, *, query: str, **kwargs) -> SlackResponse:
"""Searches for messages matching a query.
Args:
query (str): Search query. May contains booleans, etc.
e.g. 'pickleface'
"""
self._validate_xoxp_token()
kwargs.update({"query": quer... | [
"Searches",
"for",
"messages",
"matching",
"a",
"query",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1085-L1094 | [
"def",
"search_messages",
"(",
"self",
",",
"*",
",",
"query",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"query\"",
":",
"query",
"}",
")",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.stars_list | Lists stars for a user. | slack/web/client.py | def stars_list(self, **kwargs) -> SlackResponse:
"""Lists stars for a user."""
self._validate_xoxp_token()
return self.api_call("stars.list", http_verb="GET", params=kwargs) | def stars_list(self, **kwargs) -> SlackResponse:
"""Lists stars for a user."""
self._validate_xoxp_token()
return self.api_call("stars.list", http_verb="GET", params=kwargs) | [
"Lists",
"stars",
"for",
"a",
"user",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1108-L1111 | [
"def",
"stars_list",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"stars.list\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
"=",
"kwar... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.team_accessLogs | Gets the access logs for the current team. | slack/web/client.py | def team_accessLogs(self, **kwargs) -> SlackResponse:
"""Gets the access logs for the current team."""
self._validate_xoxp_token()
return self.api_call("team.accessLogs", http_verb="GET", params=kwargs) | def team_accessLogs(self, **kwargs) -> SlackResponse:
"""Gets the access logs for the current team."""
self._validate_xoxp_token()
return self.api_call("team.accessLogs", http_verb="GET", params=kwargs) | [
"Gets",
"the",
"access",
"logs",
"for",
"the",
"current",
"team",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1125-L1128 | [
"def",
"team_accessLogs",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"team.accessLogs\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
"=... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.team_billableInfo | Gets billable users information for the current team. | slack/web/client.py | def team_billableInfo(self, **kwargs) -> SlackResponse:
"""Gets billable users information for the current team."""
self._validate_xoxp_token()
return self.api_call("team.billableInfo", http_verb="GET", params=kwargs) | def team_billableInfo(self, **kwargs) -> SlackResponse:
"""Gets billable users information for the current team."""
self._validate_xoxp_token()
return self.api_call("team.billableInfo", http_verb="GET", params=kwargs) | [
"Gets",
"billable",
"users",
"information",
"for",
"the",
"current",
"team",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1130-L1133 | [
"def",
"team_billableInfo",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"team.billableInfo\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.team_integrationLogs | Gets the integration logs for the current team. | slack/web/client.py | def team_integrationLogs(self, **kwargs) -> SlackResponse:
"""Gets the integration logs for the current team."""
self._validate_xoxp_token()
return self.api_call("team.integrationLogs", http_verb="GET", params=kwargs) | def team_integrationLogs(self, **kwargs) -> SlackResponse:
"""Gets the integration logs for the current team."""
self._validate_xoxp_token()
return self.api_call("team.integrationLogs", http_verb="GET", params=kwargs) | [
"Gets",
"the",
"integration",
"logs",
"for",
"the",
"current",
"team",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1139-L1142 | [
"def",
"team_integrationLogs",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"team.integrationLogs\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"par... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.team_profile_get | Retrieve a team's profile. | slack/web/client.py | def team_profile_get(self, **kwargs) -> SlackResponse:
"""Retrieve a team's profile."""
self._validate_xoxp_token()
return self.api_call("team.profile.get", http_verb="GET", params=kwargs) | def team_profile_get(self, **kwargs) -> SlackResponse:
"""Retrieve a team's profile."""
self._validate_xoxp_token()
return self.api_call("team.profile.get", http_verb="GET", params=kwargs) | [
"Retrieve",
"a",
"team",
"s",
"profile",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1144-L1147 | [
"def",
"team_profile_get",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"team.profile.get\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.usergroups_create | Create a User Group
Args:
name (str): A name for the User Group. Must be unique among User Groups.
e.g. 'My Test Team' | slack/web/client.py | def usergroups_create(self, *, name: str, **kwargs) -> SlackResponse:
"""Create a User Group
Args:
name (str): A name for the User Group. Must be unique among User Groups.
e.g. 'My Test Team'
"""
self._validate_xoxp_token()
kwargs.update({"name": name... | def usergroups_create(self, *, name: str, **kwargs) -> SlackResponse:
"""Create a User Group
Args:
name (str): A name for the User Group. Must be unique among User Groups.
e.g. 'My Test Team'
"""
self._validate_xoxp_token()
kwargs.update({"name": name... | [
"Create",
"a",
"User",
"Group"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1149-L1158 | [
"def",
"usergroups_create",
"(",
"self",
",",
"*",
",",
"name",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"name\"",
":",
"name",
"}",
")",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.usergroups_disable | Disable an existing User Group
Args:
usergroup (str): The encoded ID of the User Group to disable.
e.g. 'S0604QSJC' | slack/web/client.py | def usergroups_disable(self, *, usergroup: str, **kwargs) -> SlackResponse:
"""Disable an existing User Group
Args:
usergroup (str): The encoded ID of the User Group to disable.
e.g. 'S0604QSJC'
"""
self._validate_xoxp_token()
kwargs.update({"usergrou... | def usergroups_disable(self, *, usergroup: str, **kwargs) -> SlackResponse:
"""Disable an existing User Group
Args:
usergroup (str): The encoded ID of the User Group to disable.
e.g. 'S0604QSJC'
"""
self._validate_xoxp_token()
kwargs.update({"usergrou... | [
"Disable",
"an",
"existing",
"User",
"Group"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1160-L1169 | [
"def",
"usergroups_disable",
"(",
"self",
",",
"*",
",",
"usergroup",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"usergroup\"",
":",
"usergroup",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.usergroups_list | List all User Groups for a team | slack/web/client.py | def usergroups_list(self, **kwargs) -> SlackResponse:
"""List all User Groups for a team"""
self._validate_xoxp_token()
return self.api_call("usergroups.list", http_verb="GET", params=kwargs) | def usergroups_list(self, **kwargs) -> SlackResponse:
"""List all User Groups for a team"""
self._validate_xoxp_token()
return self.api_call("usergroups.list", http_verb="GET", params=kwargs) | [
"List",
"all",
"User",
"Groups",
"for",
"a",
"team"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1182-L1185 | [
"def",
"usergroups_list",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"usergroups.list\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
"=... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.usergroups_users_list | List all users in a User Group
Args:
usergroup (str): The encoded ID of the User Group to update.
e.g. 'S0604QSJC' | slack/web/client.py | def usergroups_users_list(self, *, usergroup: str, **kwargs) -> SlackResponse:
"""List all users in a User Group
Args:
usergroup (str): The encoded ID of the User Group to update.
e.g. 'S0604QSJC'
"""
self._validate_xoxp_token()
kwargs.update({"usergr... | def usergroups_users_list(self, *, usergroup: str, **kwargs) -> SlackResponse:
"""List all users in a User Group
Args:
usergroup (str): The encoded ID of the User Group to update.
e.g. 'S0604QSJC'
"""
self._validate_xoxp_token()
kwargs.update({"usergr... | [
"List",
"all",
"users",
"in",
"a",
"User",
"Group"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1198-L1207 | [
"def",
"usergroups_users_list",
"(",
"self",
",",
"*",
",",
"usergroup",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"update",
"(",
"{",
"\"usergroup\"",
":",
"usergrou... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.usergroups_users_update | Update the list of users for a User Group
Args:
usergroup (str): The encoded ID of the User Group to update.
e.g. 'S0604QSJC'
users (list): A list user IDs that represent the entire list of
users for the User Group. e.g. ['U060R4BJ4', 'U060RNRCZ'] | slack/web/client.py | def usergroups_users_update(
self, *, usergroup: str, users: List[str], **kwargs
) -> SlackResponse:
"""Update the list of users for a User Group
Args:
usergroup (str): The encoded ID of the User Group to update.
e.g. 'S0604QSJC'
users (list): A list ... | def usergroups_users_update(
self, *, usergroup: str, users: List[str], **kwargs
) -> SlackResponse:
"""Update the list of users for a User Group
Args:
usergroup (str): The encoded ID of the User Group to update.
e.g. 'S0604QSJC'
users (list): A list ... | [
"Update",
"the",
"list",
"of",
"users",
"for",
"a",
"User",
"Group"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1209-L1222 | [
"def",
"usergroups_users_update",
"(",
"self",
",",
"*",
",",
"usergroup",
":",
"str",
",",
"users",
":",
"List",
"[",
"str",
"]",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"kwargs",
".",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_deletePhoto | Delete the user profile photo | slack/web/client.py | def users_deletePhoto(self, **kwargs) -> SlackResponse:
"""Delete the user profile photo"""
self._validate_xoxp_token()
return self.api_call("users.deletePhoto", http_verb="GET", params=kwargs) | def users_deletePhoto(self, **kwargs) -> SlackResponse:
"""Delete the user profile photo"""
self._validate_xoxp_token()
return self.api_call("users.deletePhoto", http_verb="GET", params=kwargs) | [
"Delete",
"the",
"user",
"profile",
"photo"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1228-L1231 | [
"def",
"users_deletePhoto",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"users.deletePhoto\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_getPresence | Gets user presence information.
Args:
user (str): User to get presence info on. Defaults to the authed user.
e.g. 'W1234567890' | slack/web/client.py | def users_getPresence(self, *, user: str, **kwargs) -> SlackResponse:
"""Gets user presence information.
Args:
user (str): User to get presence info on. Defaults to the authed user.
e.g. 'W1234567890'
"""
kwargs.update({"user": user})
return self.api_... | def users_getPresence(self, *, user: str, **kwargs) -> SlackResponse:
"""Gets user presence information.
Args:
user (str): User to get presence info on. Defaults to the authed user.
e.g. 'W1234567890'
"""
kwargs.update({"user": user})
return self.api_... | [
"Gets",
"user",
"presence",
"information",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1233-L1241 | [
"def",
"users_getPresence",
"(",
"self",
",",
"*",
",",
"user",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"user\"",
":",
"user",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"\"use... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_identity | Get a user's identity. | slack/web/client.py | def users_identity(self, **kwargs) -> SlackResponse:
"""Get a user's identity."""
self._validate_xoxp_token()
return self.api_call("users.identity", http_verb="GET", params=kwargs) | def users_identity(self, **kwargs) -> SlackResponse:
"""Get a user's identity."""
self._validate_xoxp_token()
return self.api_call("users.identity", http_verb="GET", params=kwargs) | [
"Get",
"a",
"user",
"s",
"identity",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1243-L1246 | [
"def",
"users_identity",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"users.identity\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
"=",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_lookupByEmail | Find a user with an email address.
Args:
email (str): An email address belonging to a user in the workspace.
e.g. 'spengler@ghostbusters.example.com' | slack/web/client.py | def users_lookupByEmail(self, *, email: str, **kwargs) -> SlackResponse:
"""Find a user with an email address.
Args:
email (str): An email address belonging to a user in the workspace.
e.g. 'spengler@ghostbusters.example.com'
"""
kwargs.update({"email": email... | def users_lookupByEmail(self, *, email: str, **kwargs) -> SlackResponse:
"""Find a user with an email address.
Args:
email (str): An email address belonging to a user in the workspace.
e.g. 'spengler@ghostbusters.example.com'
"""
kwargs.update({"email": email... | [
"Find",
"a",
"user",
"with",
"an",
"email",
"address",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1262-L1270 | [
"def",
"users_lookupByEmail",
"(",
"self",
",",
"*",
",",
"email",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"email\"",
":",
"email",
"}",
")",
"return",
"self",
".",
"api_call",
"(",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_setPhoto | Set the user profile photo
Args:
image (str): Supply the path of the image you'd like to upload.
e.g. 'myimage.png' | slack/web/client.py | def users_setPhoto(self, *, image: Union[str, IOBase], **kwargs) -> SlackResponse:
"""Set the user profile photo
Args:
image (str): Supply the path of the image you'd like to upload.
e.g. 'myimage.png'
"""
self._validate_xoxp_token()
return self.api_c... | def users_setPhoto(self, *, image: Union[str, IOBase], **kwargs) -> SlackResponse:
"""Set the user profile photo
Args:
image (str): Supply the path of the image you'd like to upload.
e.g. 'myimage.png'
"""
self._validate_xoxp_token()
return self.api_c... | [
"Set",
"the",
"user",
"profile",
"photo"
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1272-L1280 | [
"def",
"users_setPhoto",
"(",
"self",
",",
"*",
",",
"image",
":",
"Union",
"[",
"str",
",",
"IOBase",
"]",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_setPresence | Manually sets user presence.
Args:
presence (str): Either 'auto' or 'away'. | slack/web/client.py | def users_setPresence(self, *, presence: str, **kwargs) -> SlackResponse:
"""Manually sets user presence.
Args:
presence (str): Either 'auto' or 'away'.
"""
kwargs.update({"presence": presence})
return self.api_call("users.setPresence", json=kwargs) | def users_setPresence(self, *, presence: str, **kwargs) -> SlackResponse:
"""Manually sets user presence.
Args:
presence (str): Either 'auto' or 'away'.
"""
kwargs.update({"presence": presence})
return self.api_call("users.setPresence", json=kwargs) | [
"Manually",
"sets",
"user",
"presence",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1282-L1289 | [
"def",
"users_setPresence",
"(",
"self",
",",
"*",
",",
"presence",
":",
"str",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"kwargs",
".",
"update",
"(",
"{",
"\"presence\"",
":",
"presence",
"}",
")",
"return",
"self",
".",
"api_call",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_profile_get | Retrieves a user's profile information. | slack/web/client.py | def users_profile_get(self, **kwargs) -> SlackResponse:
"""Retrieves a user's profile information."""
self._validate_xoxp_token()
return self.api_call("users.profile.get", http_verb="GET", params=kwargs) | def users_profile_get(self, **kwargs) -> SlackResponse:
"""Retrieves a user's profile information."""
self._validate_xoxp_token()
return self.api_call("users.profile.get", http_verb="GET", params=kwargs) | [
"Retrieves",
"a",
"user",
"s",
"profile",
"information",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1291-L1294 | [
"def",
"users_profile_get",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"users.profile.get\"",
",",
"http_verb",
"=",
"\"GET\"",
",",
"params",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | WebClient.users_profile_set | Set the profile information for a user. | slack/web/client.py | def users_profile_set(self, **kwargs) -> SlackResponse:
"""Set the profile information for a user."""
self._validate_xoxp_token()
return self.api_call("users.profile.set", json=kwargs) | def users_profile_set(self, **kwargs) -> SlackResponse:
"""Set the profile information for a user."""
self._validate_xoxp_token()
return self.api_call("users.profile.set", json=kwargs) | [
"Set",
"the",
"profile",
"information",
"for",
"a",
"user",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/client.py#L1296-L1299 | [
"def",
"users_profile_set",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
"->",
"SlackResponse",
":",
"self",
".",
"_validate_xoxp_token",
"(",
")",
"return",
"self",
".",
"api_call",
"(",
"\"users.profile.set\"",
",",
"json",
"=",
"kwargs",
")"
] | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | BaseClient.api_call | Create a request and execute the API call to Slack.
Args:
api_method (str): The target Slack API method.
e.g. 'chat.postMessage'
http_verb (str): HTTP Verb. e.g. 'POST'
files (dict): Files to multipart upload.
e.g. {imageORfile: file_objectORf... | slack/web/base_client.py | def api_call(
self,
api_method: str,
*,
http_verb: str = "POST",
files: dict = None,
data: dict = None,
params: dict = None,
json: dict = None,
):
"""Create a request and execute the API call to Slack.
Args:
api_method (str... | def api_call(
self,
api_method: str,
*,
http_verb: str = "POST",
files: dict = None,
data: dict = None,
params: dict = None,
json: dict = None,
):
"""Create a request and execute the API call to Slack.
Args:
api_method (str... | [
"Create",
"a",
"request",
"and",
"execute",
"the",
"API",
"call",
"to",
"Slack",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/base_client.py#L52-L135 | [
"def",
"api_call",
"(",
"self",
",",
"api_method",
":",
"str",
",",
"*",
",",
"http_verb",
":",
"str",
"=",
"\"POST\"",
",",
"files",
":",
"dict",
"=",
"None",
",",
"data",
":",
"dict",
"=",
"None",
",",
"params",
":",
"dict",
"=",
"None",
",",
"... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | BaseClient._validate_xoxp_token | Ensures that an xoxp token is used when the specified method is called.
Raises:
BotUserAccessError: If the API method is called with a Bot User OAuth Access Token. | slack/web/base_client.py | def _validate_xoxp_token(self):
"""Ensures that an xoxp token is used when the specified method is called.
Raises:
BotUserAccessError: If the API method is called with a Bot User OAuth Access Token.
"""
if self.token.startswith("xoxb"):
method_name = inspect.sta... | def _validate_xoxp_token(self):
"""Ensures that an xoxp token is used when the specified method is called.
Raises:
BotUserAccessError: If the API method is called with a Bot User OAuth Access Token.
"""
if self.token.startswith("xoxb"):
method_name = inspect.sta... | [
"Ensures",
"that",
"an",
"xoxp",
"token",
"is",
"used",
"when",
"the",
"specified",
"method",
"is",
"called",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/base_client.py#L137-L149 | [
"def",
"_validate_xoxp_token",
"(",
"self",
")",
":",
"if",
"self",
".",
"token",
".",
"startswith",
"(",
"\"xoxb\"",
")",
":",
"method_name",
"=",
"inspect",
".",
"stack",
"(",
")",
"[",
"1",
"]",
"[",
"3",
"]",
"msg",
"=",
"\"The method '{}' cannot be ... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | BaseClient._send | Sends the request out for transmission.
Args:
http_verb (str): The HTTP verb. e.g. 'GET' or 'POST'.
api_url (str): The Slack API url. e.g. 'https://slack.com/api/chat.postMessage'
req_args (dict): The request arguments to be attached to the request.
e.g.
... | slack/web/base_client.py | async def _send(self, http_verb, api_url, req_args):
"""Sends the request out for transmission.
Args:
http_verb (str): The HTTP verb. e.g. 'GET' or 'POST'.
api_url (str): The Slack API url. e.g. 'https://slack.com/api/chat.postMessage'
req_args (dict): The request ar... | async def _send(self, http_verb, api_url, req_args):
"""Sends the request out for transmission.
Args:
http_verb (str): The HTTP verb. e.g. 'GET' or 'POST'.
api_url (str): The Slack API url. e.g. 'https://slack.com/api/chat.postMessage'
req_args (dict): The request ar... | [
"Sends",
"the",
"request",
"out",
"for",
"transmission",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/base_client.py#L163-L189 | [
"async",
"def",
"_send",
"(",
"self",
",",
"http_verb",
",",
"api_url",
",",
"req_args",
")",
":",
"res",
"=",
"await",
"self",
".",
"_request",
"(",
"http_verb",
"=",
"http_verb",
",",
"api_url",
"=",
"api_url",
",",
"req_args",
"=",
"req_args",
")",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | BaseClient._request | Submit the HTTP request with the running session or a new session.
Returns:
A dictionary of the response data. | slack/web/base_client.py | async def _request(self, *, http_verb, api_url, req_args):
"""Submit the HTTP request with the running session or a new session.
Returns:
A dictionary of the response data.
"""
if self.session and not self.session.closed:
async with self.session.request(http_verb,... | async def _request(self, *, http_verb, api_url, req_args):
"""Submit the HTTP request with the running session or a new session.
Returns:
A dictionary of the response data.
"""
if self.session and not self.session.closed:
async with self.session.request(http_verb,... | [
"Submit",
"the",
"HTTP",
"request",
"with",
"the",
"running",
"session",
"or",
"a",
"new",
"session",
".",
"Returns",
":",
"A",
"dictionary",
"of",
"the",
"response",
"data",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/base_client.py#L191-L213 | [
"async",
"def",
"_request",
"(",
"self",
",",
"*",
",",
"http_verb",
",",
"api_url",
",",
"req_args",
")",
":",
"if",
"self",
".",
"session",
"and",
"not",
"self",
".",
"session",
".",
"closed",
":",
"async",
"with",
"self",
".",
"session",
".",
"req... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | BaseClient._get_user_agent | Construct the user-agent header with the package info,
Python version and OS version.
Returns:
The user agent string.
e.g. 'Python/3.6.7 slack/2.0.0 Darwin/17.7.0' | slack/web/base_client.py | def _get_user_agent():
"""Construct the user-agent header with the package info,
Python version and OS version.
Returns:
The user agent string.
e.g. 'Python/3.6.7 slack/2.0.0 Darwin/17.7.0'
"""
# __name__ returns all classes, we only want the client
... | def _get_user_agent():
"""Construct the user-agent header with the package info,
Python version and OS version.
Returns:
The user agent string.
e.g. 'Python/3.6.7 slack/2.0.0 Darwin/17.7.0'
"""
# __name__ returns all classes, we only want the client
... | [
"Construct",
"the",
"user",
"-",
"agent",
"header",
"with",
"the",
"package",
"info",
"Python",
"version",
"and",
"OS",
"version",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/base_client.py#L216-L231 | [
"def",
"_get_user_agent",
"(",
")",
":",
"# __name__ returns all classes, we only want the client",
"client",
"=",
"\"{0}/{1}\"",
".",
"format",
"(",
"__name__",
".",
"split",
"(",
"\".\"",
")",
"[",
"0",
"]",
",",
"ver",
".",
"__version__",
")",
"python_version",... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | SlackResponse.validate | Check if the response from Slack was successful.
Returns:
(SlackResponse)
This method returns it's own object. e.g. 'self'
Raises:
SlackApiError: The request to the Slack API failed. | slack/web/slack_response.py | def validate(self):
"""Check if the response from Slack was successful.
Returns:
(SlackResponse)
This method returns it's own object. e.g. 'self'
Raises:
SlackApiError: The request to the Slack API failed.
"""
if self.status_code == 200 a... | def validate(self):
"""Check if the response from Slack was successful.
Returns:
(SlackResponse)
This method returns it's own object. e.g. 'self'
Raises:
SlackApiError: The request to the Slack API failed.
"""
if self.status_code == 200 a... | [
"Check",
"if",
"the",
"response",
"from",
"Slack",
"was",
"successful",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/slack/web/slack_response.py#L160-L174 | [
"def",
"validate",
"(",
"self",
")",
":",
"if",
"self",
".",
"status_code",
"==",
"200",
"and",
"self",
".",
"data",
".",
"get",
"(",
"\"ok\"",
",",
"False",
")",
":",
"self",
".",
"_logger",
".",
"debug",
"(",
"\"Received the following response: %s\"",
... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | onboarding_message | Create and send an onboarding welcome message to new users. Save the
time stamp of this message so we can update this message in the future. | tutorial/PythOnBoardingBot/app.py | def onboarding_message(**payload):
"""Create and send an onboarding welcome message to new users. Save the
time stamp of this message so we can update this message in the future.
"""
# Get WebClient so you can communicate back to Slack.
web_client = payload["web_client"]
# Get the id of the Sla... | def onboarding_message(**payload):
"""Create and send an onboarding welcome message to new users. Save the
time stamp of this message so we can update this message in the future.
"""
# Get WebClient so you can communicate back to Slack.
web_client = payload["web_client"]
# Get the id of the Sla... | [
"Create",
"and",
"send",
"an",
"onboarding",
"welcome",
"message",
"to",
"new",
"users",
".",
"Save",
"the",
"time",
"stamp",
"of",
"this",
"message",
"so",
"we",
"can",
"update",
"this",
"message",
"in",
"the",
"future",
"."
] | slackapi/python-slackclient | python | https://github.com/slackapi/python-slackclient/blob/901341c0284fd81e6d2719d6a0502308760d83e4/tutorial/PythOnBoardingBot/app.py#L38-L53 | [
"def",
"onboarding_message",
"(",
"*",
"*",
"payload",
")",
":",
"# Get WebClient so you can communicate back to Slack.",
"web_client",
"=",
"payload",
"[",
"\"web_client\"",
"]",
"# Get the id of the Slack user associated with the incoming event",
"user_id",
"=",
"payload",
"[... | 901341c0284fd81e6d2719d6a0502308760d83e4 |
train | log_time | Log the time it takes to run a function. It's sort of like timeit, but
prettier. | sapp/sapp/decorators.py | def log_time(func: Callable[..., Any]) -> Callable[..., Any]:
"""Log the time it takes to run a function. It's sort of like timeit, but
prettier.
"""
def wrapper(*args, **kwargs):
start_time = time.time()
log.info("%s starting...", func.__name__.title())
ret = func(*args, **kwar... | def log_time(func: Callable[..., Any]) -> Callable[..., Any]:
"""Log the time it takes to run a function. It's sort of like timeit, but
prettier.
"""
def wrapper(*args, **kwargs):
start_time = time.time()
log.info("%s starting...", func.__name__.title())
ret = func(*args, **kwar... | [
"Log",
"the",
"time",
"it",
"takes",
"to",
"run",
"a",
"function",
".",
"It",
"s",
"sort",
"of",
"like",
"timeit",
"but",
"prettier",
"."
] | facebook/pyre-check | python | https://github.com/facebook/pyre-check/blob/4a9604d943d28ef20238505a51acfb1f666328d7/sapp/sapp/decorators.py#L41-L57 | [
"def",
"log_time",
"(",
"func",
":",
"Callable",
"[",
"...",
",",
"Any",
"]",
")",
"->",
"Callable",
"[",
"...",
",",
"Any",
"]",
":",
"def",
"wrapper",
"(",
"*",
"args",
",",
"*",
"*",
"kwargs",
")",
":",
"start_time",
"=",
"time",
".",
"time",
... | 4a9604d943d28ef20238505a51acfb1f666328d7 |
train | WatchmanSubscriber.daemonize | We double-fork here to detach the daemon process from the parent.
If we were to just fork the child as a daemon, we'd have to worry about the
parent process exiting zombifying the daemon. | client/watchman_subscriber.py | def daemonize(self) -> None:
"""We double-fork here to detach the daemon process from the parent.
If we were to just fork the child as a daemon, we'd have to worry about the
parent process exiting zombifying the daemon."""
if os.fork() == 0:
pid = os.fork()
... | def daemonize(self) -> None:
"""We double-fork here to detach the daemon process from the parent.
If we were to just fork the child as a daemon, we'd have to worry about the
parent process exiting zombifying the daemon."""
if os.fork() == 0:
pid = os.fork()
... | [
"We",
"double",
"-",
"fork",
"here",
"to",
"detach",
"the",
"daemon",
"process",
"from",
"the",
"parent",
".",
"If",
"we",
"were",
"to",
"just",
"fork",
"the",
"child",
"as",
"a",
"daemon",
"we",
"d",
"have",
"to",
"worry",
"about",
"the",
"parent",
... | facebook/pyre-check | python | https://github.com/facebook/pyre-check/blob/4a9604d943d28ef20238505a51acfb1f666328d7/client/watchman_subscriber.py#L130-L148 | [
"def",
"daemonize",
"(",
"self",
")",
"->",
"None",
":",
"if",
"os",
".",
"fork",
"(",
")",
"==",
"0",
":",
"pid",
"=",
"os",
".",
"fork",
"(",
")",
"if",
"pid",
"==",
"0",
":",
"try",
":",
"# Closing the sys.stdout and stderr file descriptors here cause... | 4a9604d943d28ef20238505a51acfb1f666328d7 |
train | TrimmedTraceGraph.populate_from_trace_graph | Populates this graph from the given one based on affected_files | sapp/sapp/trimmed_trace_graph.py | def populate_from_trace_graph(self, graph: TraceGraph) -> None:
"""Populates this graph from the given one based on affected_files
"""
# Track which trace frames have been visited as we populate the full
# traces of the graph.
self._visited_trace_frame_ids: Set[int] = set()
... | def populate_from_trace_graph(self, graph: TraceGraph) -> None:
"""Populates this graph from the given one based on affected_files
"""
# Track which trace frames have been visited as we populate the full
# traces of the graph.
self._visited_trace_frame_ids: Set[int] = set()
... | [
"Populates",
"this",
"graph",
"from",
"the",
"given",
"one",
"based",
"on",
"affected_files"
] | facebook/pyre-check | python | https://github.com/facebook/pyre-check/blob/4a9604d943d28ef20238505a51acfb1f666328d7/sapp/sapp/trimmed_trace_graph.py#L25-L80 | [
"def",
"populate_from_trace_graph",
"(",
"self",
",",
"graph",
":",
"TraceGraph",
")",
"->",
"None",
":",
"# Track which trace frames have been visited as we populate the full",
"# traces of the graph.",
"self",
".",
"_visited_trace_frame_ids",
":",
"Set",
"[",
"int",
"]",
... | 4a9604d943d28ef20238505a51acfb1f666328d7 |
train | TrimmedTraceGraph._populate_affected_issues | Populates the trimmed graph with issues whose locations are in
affected_files based on data in the input graph. Since these issues
exist in the affected files, all traces are copied as well. | sapp/sapp/trimmed_trace_graph.py | def _populate_affected_issues(self, graph: TraceGraph) -> None:
"""Populates the trimmed graph with issues whose locations are in
affected_files based on data in the input graph. Since these issues
exist in the affected files, all traces are copied as well.
"""
affected_instance_... | def _populate_affected_issues(self, graph: TraceGraph) -> None:
"""Populates the trimmed graph with issues whose locations are in
affected_files based on data in the input graph. Since these issues
exist in the affected files, all traces are copied as well.
"""
affected_instance_... | [
"Populates",
"the",
"trimmed",
"graph",
"with",
"issues",
"whose",
"locations",
"are",
"in",
"affected_files",
"based",
"on",
"data",
"in",
"the",
"input",
"graph",
".",
"Since",
"these",
"issues",
"exist",
"in",
"the",
"affected",
"files",
"all",
"traces",
... | facebook/pyre-check | python | https://github.com/facebook/pyre-check/blob/4a9604d943d28ef20238505a51acfb1f666328d7/sapp/sapp/trimmed_trace_graph.py#L82-L98 | [
"def",
"_populate_affected_issues",
"(",
"self",
",",
"graph",
":",
"TraceGraph",
")",
"->",
"None",
":",
"affected_instance_ids",
"=",
"[",
"instance",
".",
"id",
".",
"local_id",
"for",
"instance",
"in",
"graph",
".",
"_issue_instances",
".",
"values",
"(",
... | 4a9604d943d28ef20238505a51acfb1f666328d7 |
train | TrimmedTraceGraph._populate_issues_from_affected_trace_frames | TraceFrames found in affected_files should be reachable via some
issue instance. Follow traces of graph to find them and
populate this TrimmedGraph with it. | sapp/sapp/trimmed_trace_graph.py | def _populate_issues_from_affected_trace_frames(self, graph: TraceGraph) -> None:
"""TraceFrames found in affected_files should be reachable via some
issue instance. Follow traces of graph to find them and
populate this TrimmedGraph with it.
"""
initial_trace_frames = [
... | def _populate_issues_from_affected_trace_frames(self, graph: TraceGraph) -> None:
"""TraceFrames found in affected_files should be reachable via some
issue instance. Follow traces of graph to find them and
populate this TrimmedGraph with it.
"""
initial_trace_frames = [
... | [
"TraceFrames",
"found",
"in",
"affected_files",
"should",
"be",
"reachable",
"via",
"some",
"issue",
"instance",
".",
"Follow",
"traces",
"of",
"graph",
"to",
"find",
"them",
"and",
"populate",
"this",
"TrimmedGraph",
"with",
"it",
"."
] | facebook/pyre-check | python | https://github.com/facebook/pyre-check/blob/4a9604d943d28ef20238505a51acfb1f666328d7/sapp/sapp/trimmed_trace_graph.py#L123-L167 | [
"def",
"_populate_issues_from_affected_trace_frames",
"(",
"self",
",",
"graph",
":",
"TraceGraph",
")",
"->",
"None",
":",
"initial_trace_frames",
"=",
"[",
"trace_frame",
"for",
"trace_frame",
"in",
"graph",
".",
"_trace_frames",
".",
"values",
"(",
")",
"if",
... | 4a9604d943d28ef20238505a51acfb1f666328d7 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.