id int32 0 252k | repo stringlengths 7 55 | path stringlengths 4 127 | func_name stringlengths 1 88 | original_string stringlengths 75 19.8k | language stringclasses 1
value | code stringlengths 75 19.8k | code_tokens list | docstring stringlengths 3 17.3k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 87 242 |
|---|---|---|---|---|---|---|---|---|---|---|---|
5,800 | tyarkoni/pliers | pliers/diagnostics/diagnostics.py | correlation_matrix | def correlation_matrix(df):
'''
Returns a pandas DataFrame with the pair-wise correlations of the columns.
Args:
df: pandas DataFrame with columns to run diagnostics on
'''
columns = df.columns.tolist()
corr = pd.DataFrame(
np.corrcoef(df, rowvar=0), columns=columns, index=colum... | python | def correlation_matrix(df):
'''
Returns a pandas DataFrame with the pair-wise correlations of the columns.
Args:
df: pandas DataFrame with columns to run diagnostics on
'''
columns = df.columns.tolist()
corr = pd.DataFrame(
np.corrcoef(df, rowvar=0), columns=columns, index=colum... | [
"def",
"correlation_matrix",
"(",
"df",
")",
":",
"columns",
"=",
"df",
".",
"columns",
".",
"tolist",
"(",
")",
"corr",
"=",
"pd",
".",
"DataFrame",
"(",
"np",
".",
"corrcoef",
"(",
"df",
",",
"rowvar",
"=",
"0",
")",
",",
"columns",
"=",
"columns... | Returns a pandas DataFrame with the pair-wise correlations of the columns.
Args:
df: pandas DataFrame with columns to run diagnostics on | [
"Returns",
"a",
"pandas",
"DataFrame",
"with",
"the",
"pair",
"-",
"wise",
"correlations",
"of",
"the",
"columns",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/diagnostics/diagnostics.py#L12-L22 |
5,801 | tyarkoni/pliers | pliers/diagnostics/diagnostics.py | eigenvalues | def eigenvalues(df):
'''
Returns a pandas Series with eigenvalues of the correlation matrix.
Args:
df: pandas DataFrame with columns to run diagnostics on
'''
corr = np.corrcoef(df, rowvar=0)
eigvals = np.linalg.eigvals(corr)
return pd.Series(eigvals, df.columns, name='Eigenvalue') | python | def eigenvalues(df):
'''
Returns a pandas Series with eigenvalues of the correlation matrix.
Args:
df: pandas DataFrame with columns to run diagnostics on
'''
corr = np.corrcoef(df, rowvar=0)
eigvals = np.linalg.eigvals(corr)
return pd.Series(eigvals, df.columns, name='Eigenvalue') | [
"def",
"eigenvalues",
"(",
"df",
")",
":",
"corr",
"=",
"np",
".",
"corrcoef",
"(",
"df",
",",
"rowvar",
"=",
"0",
")",
"eigvals",
"=",
"np",
".",
"linalg",
".",
"eigvals",
"(",
"corr",
")",
"return",
"pd",
".",
"Series",
"(",
"eigvals",
",",
"df... | Returns a pandas Series with eigenvalues of the correlation matrix.
Args:
df: pandas DataFrame with columns to run diagnostics on | [
"Returns",
"a",
"pandas",
"Series",
"with",
"eigenvalues",
"of",
"the",
"correlation",
"matrix",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/diagnostics/diagnostics.py#L25-L34 |
5,802 | tyarkoni/pliers | pliers/diagnostics/diagnostics.py | condition_indices | def condition_indices(df):
'''
Returns a pandas Series with condition indices of the df columns.
Args:
df: pandas DataFrame with columns to run diagnostics on
'''
eigvals = eigenvalues(df)
cond_idx = np.sqrt(eigvals.max() / eigvals)
return pd.Series(cond_idx, df.columns, name='Condi... | python | def condition_indices(df):
'''
Returns a pandas Series with condition indices of the df columns.
Args:
df: pandas DataFrame with columns to run diagnostics on
'''
eigvals = eigenvalues(df)
cond_idx = np.sqrt(eigvals.max() / eigvals)
return pd.Series(cond_idx, df.columns, name='Condi... | [
"def",
"condition_indices",
"(",
"df",
")",
":",
"eigvals",
"=",
"eigenvalues",
"(",
"df",
")",
"cond_idx",
"=",
"np",
".",
"sqrt",
"(",
"eigvals",
".",
"max",
"(",
")",
"/",
"eigvals",
")",
"return",
"pd",
".",
"Series",
"(",
"cond_idx",
",",
"df",
... | Returns a pandas Series with condition indices of the df columns.
Args:
df: pandas DataFrame with columns to run diagnostics on | [
"Returns",
"a",
"pandas",
"Series",
"with",
"condition",
"indices",
"of",
"the",
"df",
"columns",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/diagnostics/diagnostics.py#L37-L46 |
5,803 | tyarkoni/pliers | pliers/diagnostics/diagnostics.py | mahalanobis_distances | def mahalanobis_distances(df, axis=0):
'''
Returns a pandas Series with Mahalanobis distances for each sample on the
axis.
Note: does not work well when # of observations < # of dimensions
Will either return NaN in answer
or (in the extreme case) fail with a Singular Matrix LinAlgError
Arg... | python | def mahalanobis_distances(df, axis=0):
'''
Returns a pandas Series with Mahalanobis distances for each sample on the
axis.
Note: does not work well when # of observations < # of dimensions
Will either return NaN in answer
or (in the extreme case) fail with a Singular Matrix LinAlgError
Arg... | [
"def",
"mahalanobis_distances",
"(",
"df",
",",
"axis",
"=",
"0",
")",
":",
"df",
"=",
"df",
".",
"transpose",
"(",
")",
"if",
"axis",
"==",
"1",
"else",
"df",
"means",
"=",
"df",
".",
"mean",
"(",
")",
"try",
":",
"inv_cov",
"=",
"np",
".",
"l... | Returns a pandas Series with Mahalanobis distances for each sample on the
axis.
Note: does not work well when # of observations < # of dimensions
Will either return NaN in answer
or (in the extreme case) fail with a Singular Matrix LinAlgError
Args:
df: pandas DataFrame with columns to run... | [
"Returns",
"a",
"pandas",
"Series",
"with",
"Mahalanobis",
"distances",
"for",
"each",
"sample",
"on",
"the",
"axis",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/diagnostics/diagnostics.py#L63-L87 |
5,804 | tyarkoni/pliers | pliers/diagnostics/diagnostics.py | Diagnostics.summary | def summary(self, stdout=True, plot=False):
'''
Displays diagnostics to the user
Args:
stdout (bool): print results to the console
plot (bool): use Seaborn to plot results
'''
if stdout:
print('Collinearity summary:')
print(pd.conc... | python | def summary(self, stdout=True, plot=False):
'''
Displays diagnostics to the user
Args:
stdout (bool): print results to the console
plot (bool): use Seaborn to plot results
'''
if stdout:
print('Collinearity summary:')
print(pd.conc... | [
"def",
"summary",
"(",
"self",
",",
"stdout",
"=",
"True",
",",
"plot",
"=",
"False",
")",
":",
"if",
"stdout",
":",
"print",
"(",
"'Collinearity summary:'",
")",
"print",
"(",
"pd",
".",
"concat",
"(",
"[",
"self",
".",
"results",
"[",
"'Eigenvalues'"... | Displays diagnostics to the user
Args:
stdout (bool): print results to the console
plot (bool): use Seaborn to plot results | [
"Displays",
"diagnostics",
"to",
"the",
"user"
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/diagnostics/diagnostics.py#L128-L161 |
5,805 | tyarkoni/pliers | pliers/graph.py | Graph.add_nodes | def add_nodes(self, nodes, parent=None, mode='horizontal'):
''' Adds one or more nodes to the current graph.
Args:
nodes (list): A list of nodes to add. Each element must be one of
the following:
* A dict containing keyword args to pass onto to the Node init... | python | def add_nodes(self, nodes, parent=None, mode='horizontal'):
''' Adds one or more nodes to the current graph.
Args:
nodes (list): A list of nodes to add. Each element must be one of
the following:
* A dict containing keyword args to pass onto to the Node init... | [
"def",
"add_nodes",
"(",
"self",
",",
"nodes",
",",
"parent",
"=",
"None",
",",
"mode",
"=",
"'horizontal'",
")",
":",
"for",
"n",
"in",
"nodes",
":",
"node_args",
"=",
"self",
".",
"_parse_node_args",
"(",
"n",
")",
"if",
"mode",
"==",
"'horizontal'",... | Adds one or more nodes to the current graph.
Args:
nodes (list): A list of nodes to add. Each element must be one of
the following:
* A dict containing keyword args to pass onto to the Node init.
* An iterable containing 1 - 3 elements. The first ele... | [
"Adds",
"one",
"or",
"more",
"nodes",
"to",
"the",
"current",
"graph",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/graph.py#L107-L144 |
5,806 | tyarkoni/pliers | pliers/graph.py | Graph.add_node | def add_node(self, transformer, name=None, children=None, parent=None,
parameters={}, return_node=False):
''' Adds a node to the current graph.
Args:
transformer (str, Transformer): The pliers Transformer to use at
the to-be-added node. Either a case-insensi... | python | def add_node(self, transformer, name=None, children=None, parent=None,
parameters={}, return_node=False):
''' Adds a node to the current graph.
Args:
transformer (str, Transformer): The pliers Transformer to use at
the to-be-added node. Either a case-insensi... | [
"def",
"add_node",
"(",
"self",
",",
"transformer",
",",
"name",
"=",
"None",
",",
"children",
"=",
"None",
",",
"parent",
"=",
"None",
",",
"parameters",
"=",
"{",
"}",
",",
"return_node",
"=",
"False",
")",
":",
"node",
"=",
"Node",
"(",
"transform... | Adds a node to the current graph.
Args:
transformer (str, Transformer): The pliers Transformer to use at
the to-be-added node. Either a case-insensitive string giving
the name of a Transformer class, or an initialized Transformer
instance.
... | [
"Adds",
"a",
"node",
"to",
"the",
"current",
"graph",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/graph.py#L154-L192 |
5,807 | tyarkoni/pliers | pliers/graph.py | Graph.run | def run(self, stim, merge=True, **merge_kwargs):
''' Executes the graph by calling all Transformers in sequence.
Args:
stim (str, Stim, list): One or more valid inputs to any
Transformer's 'transform' call.
merge (bool): If True, all results are merged into a sin... | python | def run(self, stim, merge=True, **merge_kwargs):
''' Executes the graph by calling all Transformers in sequence.
Args:
stim (str, Stim, list): One or more valid inputs to any
Transformer's 'transform' call.
merge (bool): If True, all results are merged into a sin... | [
"def",
"run",
"(",
"self",
",",
"stim",
",",
"merge",
"=",
"True",
",",
"*",
"*",
"merge_kwargs",
")",
":",
"results",
"=",
"list",
"(",
"chain",
"(",
"*",
"[",
"self",
".",
"run_node",
"(",
"n",
",",
"stim",
")",
"for",
"n",
"in",
"self",
".",... | Executes the graph by calling all Transformers in sequence.
Args:
stim (str, Stim, list): One or more valid inputs to any
Transformer's 'transform' call.
merge (bool): If True, all results are merged into a single pandas
DataFrame before being returned. I... | [
"Executes",
"the",
"graph",
"by",
"calling",
"all",
"Transformers",
"in",
"sequence",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/graph.py#L194-L210 |
5,808 | tyarkoni/pliers | pliers/graph.py | Graph.run_node | def run_node(self, node, stim):
''' Executes the Transformer at a specific node.
Args:
node (str, Node): If a string, the name of the Node in the current
Graph. Otherwise the Node instance to execute.
stim (str, stim, list): Any valid input to the Transformer sto... | python | def run_node(self, node, stim):
''' Executes the Transformer at a specific node.
Args:
node (str, Node): If a string, the name of the Node in the current
Graph. Otherwise the Node instance to execute.
stim (str, stim, list): Any valid input to the Transformer sto... | [
"def",
"run_node",
"(",
"self",
",",
"node",
",",
"stim",
")",
":",
"if",
"isinstance",
"(",
"node",
",",
"string_types",
")",
":",
"node",
"=",
"self",
".",
"nodes",
"[",
"node",
"]",
"result",
"=",
"node",
".",
"transformer",
".",
"transform",
"(",... | Executes the Transformer at a specific node.
Args:
node (str, Node): If a string, the name of the Node in the current
Graph. Otherwise the Node instance to execute.
stim (str, stim, list): Any valid input to the Transformer stored
at the target node. | [
"Executes",
"the",
"Transformer",
"at",
"a",
"specific",
"node",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/graph.py#L214-L235 |
5,809 | tyarkoni/pliers | pliers/graph.py | Graph.draw | def draw(self, filename, color=True):
''' Render a plot of the graph via pygraphviz.
Args:
filename (str): Path to save the generated image to.
color (bool): If True, will color graph nodes based on their type,
otherwise will draw a black-and-white graph.
... | python | def draw(self, filename, color=True):
''' Render a plot of the graph via pygraphviz.
Args:
filename (str): Path to save the generated image to.
color (bool): If True, will color graph nodes based on their type,
otherwise will draw a black-and-white graph.
... | [
"def",
"draw",
"(",
"self",
",",
"filename",
",",
"color",
"=",
"True",
")",
":",
"verify_dependencies",
"(",
"[",
"'pgv'",
"]",
")",
"if",
"not",
"hasattr",
"(",
"self",
",",
"'_results'",
")",
":",
"raise",
"RuntimeError",
"(",
"\"Graph cannot be drawn b... | Render a plot of the graph via pygraphviz.
Args:
filename (str): Path to save the generated image to.
color (bool): If True, will color graph nodes based on their type,
otherwise will draw a black-and-white graph. | [
"Render",
"a",
"plot",
"of",
"the",
"graph",
"via",
"pygraphviz",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/graph.py#L237-L298 |
5,810 | tyarkoni/pliers | pliers/graph.py | Graph.to_json | def to_json(self):
''' Returns the JSON representation of this graph. '''
roots = []
for r in self.roots:
roots.append(r.to_json())
return {'roots': roots} | python | def to_json(self):
''' Returns the JSON representation of this graph. '''
roots = []
for r in self.roots:
roots.append(r.to_json())
return {'roots': roots} | [
"def",
"to_json",
"(",
"self",
")",
":",
"roots",
"=",
"[",
"]",
"for",
"r",
"in",
"self",
".",
"roots",
":",
"roots",
".",
"append",
"(",
"r",
".",
"to_json",
"(",
")",
")",
"return",
"{",
"'roots'",
":",
"roots",
"}"
] | Returns the JSON representation of this graph. | [
"Returns",
"the",
"JSON",
"representation",
"of",
"this",
"graph",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/graph.py#L300-L305 |
5,811 | tyarkoni/pliers | pliers/utils/base.py | flatten | def flatten(l):
''' Flatten an iterable. '''
for el in l:
if isinstance(el, collections.Iterable) and not isinstance(el, string_types):
for sub in flatten(el):
yield sub
else:
yield el | python | def flatten(l):
''' Flatten an iterable. '''
for el in l:
if isinstance(el, collections.Iterable) and not isinstance(el, string_types):
for sub in flatten(el):
yield sub
else:
yield el | [
"def",
"flatten",
"(",
"l",
")",
":",
"for",
"el",
"in",
"l",
":",
"if",
"isinstance",
"(",
"el",
",",
"collections",
".",
"Iterable",
")",
"and",
"not",
"isinstance",
"(",
"el",
",",
"string_types",
")",
":",
"for",
"sub",
"in",
"flatten",
"(",
"e... | Flatten an iterable. | [
"Flatten",
"an",
"iterable",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/utils/base.py#L20-L27 |
5,812 | tyarkoni/pliers | pliers/utils/base.py | set_iterable_type | def set_iterable_type(obj):
''' Returns either a generator or a list depending on config-level
settings. Should be used to wrap almost every internal iterable return.
Also inspects elements recursively in the case of list returns, to
ensure that there are no nested generators. '''
if not isiterable(... | python | def set_iterable_type(obj):
''' Returns either a generator or a list depending on config-level
settings. Should be used to wrap almost every internal iterable return.
Also inspects elements recursively in the case of list returns, to
ensure that there are no nested generators. '''
if not isiterable(... | [
"def",
"set_iterable_type",
"(",
"obj",
")",
":",
"if",
"not",
"isiterable",
"(",
"obj",
")",
":",
"return",
"obj",
"if",
"config",
".",
"get_option",
"(",
"'use_generators'",
")",
":",
"return",
"obj",
"if",
"isgenerator",
"(",
"obj",
")",
"else",
"(",
... | Returns either a generator or a list depending on config-level
settings. Should be used to wrap almost every internal iterable return.
Also inspects elements recursively in the case of list returns, to
ensure that there are no nested generators. | [
"Returns",
"either",
"a",
"generator",
"or",
"a",
"list",
"depending",
"on",
"config",
"-",
"level",
"settings",
".",
"Should",
"be",
"used",
"to",
"wrap",
"almost",
"every",
"internal",
"iterable",
"return",
".",
"Also",
"inspects",
"elements",
"recursively",... | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/utils/base.py#L55-L66 |
5,813 | tyarkoni/pliers | pliers/utils/base.py | isgenerator | def isgenerator(obj):
''' Returns True if object is a generator, or a generator wrapped by a
tqdm object. '''
return isinstance(obj, GeneratorType) or (hasattr(obj, 'iterable') and
isinstance(getattr(obj, 'iterable'), GeneratorType)) | python | def isgenerator(obj):
''' Returns True if object is a generator, or a generator wrapped by a
tqdm object. '''
return isinstance(obj, GeneratorType) or (hasattr(obj, 'iterable') and
isinstance(getattr(obj, 'iterable'), GeneratorType)) | [
"def",
"isgenerator",
"(",
"obj",
")",
":",
"return",
"isinstance",
"(",
"obj",
",",
"GeneratorType",
")",
"or",
"(",
"hasattr",
"(",
"obj",
",",
"'iterable'",
")",
"and",
"isinstance",
"(",
"getattr",
"(",
"obj",
",",
"'iterable'",
")",
",",
"GeneratorT... | Returns True if object is a generator, or a generator wrapped by a
tqdm object. | [
"Returns",
"True",
"if",
"object",
"is",
"a",
"generator",
"or",
"a",
"generator",
"wrapped",
"by",
"a",
"tqdm",
"object",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/utils/base.py#L85-L89 |
5,814 | tyarkoni/pliers | pliers/utils/base.py | progress_bar_wrapper | def progress_bar_wrapper(iterable, **kwargs):
''' Wrapper that applies tqdm progress bar conditional on config settings.
'''
return tqdm(iterable, **kwargs) if (config.get_option('progress_bar')
and not isinstance(iterable, tqdm)) else iterable | python | def progress_bar_wrapper(iterable, **kwargs):
''' Wrapper that applies tqdm progress bar conditional on config settings.
'''
return tqdm(iterable, **kwargs) if (config.get_option('progress_bar')
and not isinstance(iterable, tqdm)) else iterable | [
"def",
"progress_bar_wrapper",
"(",
"iterable",
",",
"*",
"*",
"kwargs",
")",
":",
"return",
"tqdm",
"(",
"iterable",
",",
"*",
"*",
"kwargs",
")",
"if",
"(",
"config",
".",
"get_option",
"(",
"'progress_bar'",
")",
"and",
"not",
"isinstance",
"(",
"iter... | Wrapper that applies tqdm progress bar conditional on config settings. | [
"Wrapper",
"that",
"applies",
"tqdm",
"progress",
"bar",
"conditional",
"on",
"config",
"settings",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/utils/base.py#L92-L96 |
5,815 | tyarkoni/pliers | pliers/stimuli/video.py | VideoFrameCollectionStim.get_frame | def get_frame(self, index):
''' Get video frame at the specified index.
Args:
index (int): Positional index of the desired frame.
'''
frame_num = self.frame_index[index]
onset = float(frame_num) / self.fps
if index < self.n_frames - 1:
next_fram... | python | def get_frame(self, index):
''' Get video frame at the specified index.
Args:
index (int): Positional index of the desired frame.
'''
frame_num = self.frame_index[index]
onset = float(frame_num) / self.fps
if index < self.n_frames - 1:
next_fram... | [
"def",
"get_frame",
"(",
"self",
",",
"index",
")",
":",
"frame_num",
"=",
"self",
".",
"frame_index",
"[",
"index",
"]",
"onset",
"=",
"float",
"(",
"frame_num",
")",
"/",
"self",
".",
"fps",
"if",
"index",
"<",
"self",
".",
"n_frames",
"-",
"1",
... | Get video frame at the specified index.
Args:
index (int): Positional index of the desired frame. | [
"Get",
"video",
"frame",
"at",
"the",
"specified",
"index",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/stimuli/video.py#L94-L114 |
5,816 | tyarkoni/pliers | pliers/stimuli/video.py | VideoFrameCollectionStim.save | def save(self, path):
''' Save source video to file.
Args:
path (str): Filename to save to.
Notes: Saves entire source video to file, not just currently selected
frames.
'''
# IMPORTANT WARNING: saves entire source video
self.clip.write_videofile... | python | def save(self, path):
''' Save source video to file.
Args:
path (str): Filename to save to.
Notes: Saves entire source video to file, not just currently selected
frames.
'''
# IMPORTANT WARNING: saves entire source video
self.clip.write_videofile... | [
"def",
"save",
"(",
"self",
",",
"path",
")",
":",
"# IMPORTANT WARNING: saves entire source video",
"self",
".",
"clip",
".",
"write_videofile",
"(",
"path",
",",
"audio_fps",
"=",
"self",
".",
"clip",
".",
"audio",
".",
"fps",
")"
] | Save source video to file.
Args:
path (str): Filename to save to.
Notes: Saves entire source video to file, not just currently selected
frames. | [
"Save",
"source",
"video",
"to",
"file",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/stimuli/video.py#L125-L135 |
5,817 | tyarkoni/pliers | pliers/stimuli/video.py | VideoStim.get_frame | def get_frame(self, index=None, onset=None):
''' Overrides the default behavior by giving access to the onset
argument.
Args:
index (int): Positional index of the desired frame.
onset (float): Onset (in seconds) of the desired frame.
'''
if onset:
... | python | def get_frame(self, index=None, onset=None):
''' Overrides the default behavior by giving access to the onset
argument.
Args:
index (int): Positional index of the desired frame.
onset (float): Onset (in seconds) of the desired frame.
'''
if onset:
... | [
"def",
"get_frame",
"(",
"self",
",",
"index",
"=",
"None",
",",
"onset",
"=",
"None",
")",
":",
"if",
"onset",
":",
"index",
"=",
"int",
"(",
"onset",
"*",
"self",
".",
"fps",
")",
"return",
"super",
"(",
"VideoStim",
",",
"self",
")",
".",
"get... | Overrides the default behavior by giving access to the onset
argument.
Args:
index (int): Positional index of the desired frame.
onset (float): Onset (in seconds) of the desired frame. | [
"Overrides",
"the",
"default",
"behavior",
"by",
"giving",
"access",
"to",
"the",
"onset",
"argument",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/stimuli/video.py#L159-L170 |
5,818 | tyarkoni/pliers | pliers/utils/updater.py | hash_data | def hash_data(data, blocksize=65536):
"""" Hashes list of data, strings or data """
data = pickle.dumps(data)
hasher = hashlib.sha1()
hasher.update(data)
return hasher.hexdigest() | python | def hash_data(data, blocksize=65536):
"""" Hashes list of data, strings or data """
data = pickle.dumps(data)
hasher = hashlib.sha1()
hasher.update(data)
return hasher.hexdigest() | [
"def",
"hash_data",
"(",
"data",
",",
"blocksize",
"=",
"65536",
")",
":",
"data",
"=",
"pickle",
".",
"dumps",
"(",
"data",
")",
"hasher",
"=",
"hashlib",
".",
"sha1",
"(",
")",
"hasher",
".",
"update",
"(",
"data",
")",
"return",
"hasher",
".",
"... | Hashes list of data, strings or data | [
"Hashes",
"list",
"of",
"data",
"strings",
"or",
"data"
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/utils/updater.py#L13-L20 |
5,819 | tyarkoni/pliers | pliers/utils/updater.py | check_updates | def check_updates(transformers, datastore=None, stimuli=None):
""" Run transformers through a battery of stimuli, and check if output has
changed. Store results in csv file for comparison.
Args:
transformers (list): A list of tuples of transformer names and
dictionary of parameters to i... | python | def check_updates(transformers, datastore=None, stimuli=None):
""" Run transformers through a battery of stimuli, and check if output has
changed. Store results in csv file for comparison.
Args:
transformers (list): A list of tuples of transformer names and
dictionary of parameters to i... | [
"def",
"check_updates",
"(",
"transformers",
",",
"datastore",
"=",
"None",
",",
"stimuli",
"=",
"None",
")",
":",
"# Find datastore file",
"datastore",
"=",
"datastore",
"or",
"expanduser",
"(",
"'~/.pliers_updates'",
")",
"prior_data",
"=",
"pd",
".",
"read_cs... | Run transformers through a battery of stimuli, and check if output has
changed. Store results in csv file for comparison.
Args:
transformers (list): A list of tuples of transformer names and
dictionary of parameters to instantiate with (or empty dict).
datastore (str): Filepath of C... | [
"Run",
"transformers",
"through",
"a",
"battery",
"of",
"stimuli",
"and",
"check",
"if",
"output",
"has",
"changed",
".",
"Store",
"results",
"in",
"csv",
"file",
"for",
"comparison",
"."
] | 5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b | https://github.com/tyarkoni/pliers/blob/5b3385960ebd8c6ef1e86dd5e1be0080b2cb7f2b/pliers/utils/updater.py#L23-L95 |
5,820 | open-homeautomation/miflora | demo.py | scan | def scan(args):
"""Scan for sensors."""
backend = _get_backend(args)
print('Scanning for 10 seconds...')
devices = miflora_scanner.scan(backend, 10)
print('Found {} devices:'.format(len(devices)))
for device in devices:
print(' {}'.format(device)) | python | def scan(args):
"""Scan for sensors."""
backend = _get_backend(args)
print('Scanning for 10 seconds...')
devices = miflora_scanner.scan(backend, 10)
print('Found {} devices:'.format(len(devices)))
for device in devices:
print(' {}'.format(device)) | [
"def",
"scan",
"(",
"args",
")",
":",
"backend",
"=",
"_get_backend",
"(",
"args",
")",
"print",
"(",
"'Scanning for 10 seconds...'",
")",
"devices",
"=",
"miflora_scanner",
".",
"scan",
"(",
"backend",
",",
"10",
")",
"print",
"(",
"'Found {} devices:'",
".... | Scan for sensors. | [
"Scan",
"for",
"sensors",
"."
] | 916606e7edc70bdc017dfbe681bc81771e0df7f3 | https://github.com/open-homeautomation/miflora/blob/916606e7edc70bdc017dfbe681bc81771e0df7f3/demo.py#L37-L44 |
5,821 | open-homeautomation/miflora | demo.py | _get_backend | def _get_backend(args):
"""Extract the backend class from the command line arguments."""
if args.backend == 'gatttool':
backend = GatttoolBackend
elif args.backend == 'bluepy':
backend = BluepyBackend
elif args.backend == 'pygatt':
backend = PygattBackend
else:
raise ... | python | def _get_backend(args):
"""Extract the backend class from the command line arguments."""
if args.backend == 'gatttool':
backend = GatttoolBackend
elif args.backend == 'bluepy':
backend = BluepyBackend
elif args.backend == 'pygatt':
backend = PygattBackend
else:
raise ... | [
"def",
"_get_backend",
"(",
"args",
")",
":",
"if",
"args",
".",
"backend",
"==",
"'gatttool'",
":",
"backend",
"=",
"GatttoolBackend",
"elif",
"args",
".",
"backend",
"==",
"'bluepy'",
":",
"backend",
"=",
"BluepyBackend",
"elif",
"args",
".",
"backend",
... | Extract the backend class from the command line arguments. | [
"Extract",
"the",
"backend",
"class",
"from",
"the",
"command",
"line",
"arguments",
"."
] | 916606e7edc70bdc017dfbe681bc81771e0df7f3 | https://github.com/open-homeautomation/miflora/blob/916606e7edc70bdc017dfbe681bc81771e0df7f3/demo.py#L47-L57 |
5,822 | open-homeautomation/miflora | demo.py | list_backends | def list_backends(_):
"""List all available backends."""
backends = [b.__name__ for b in available_backends()]
print('\n'.join(backends)) | python | def list_backends(_):
"""List all available backends."""
backends = [b.__name__ for b in available_backends()]
print('\n'.join(backends)) | [
"def",
"list_backends",
"(",
"_",
")",
":",
"backends",
"=",
"[",
"b",
".",
"__name__",
"for",
"b",
"in",
"available_backends",
"(",
")",
"]",
"print",
"(",
"'\\n'",
".",
"join",
"(",
"backends",
")",
")"
] | List all available backends. | [
"List",
"all",
"available",
"backends",
"."
] | 916606e7edc70bdc017dfbe681bc81771e0df7f3 | https://github.com/open-homeautomation/miflora/blob/916606e7edc70bdc017dfbe681bc81771e0df7f3/demo.py#L60-L63 |
5,823 | open-homeautomation/miflora | miflora/miflora_scanner.py | scan | def scan(backend, timeout=10):
"""Scan for miflora devices.
Note: this must be run as root!
"""
result = []
for (mac, name) in backend.scan_for_devices(timeout):
if (name is not None and name.lower() in VALID_DEVICE_NAMES) or \
mac is not None and mac.upper().startswith(DEVI... | python | def scan(backend, timeout=10):
"""Scan for miflora devices.
Note: this must be run as root!
"""
result = []
for (mac, name) in backend.scan_for_devices(timeout):
if (name is not None and name.lower() in VALID_DEVICE_NAMES) or \
mac is not None and mac.upper().startswith(DEVI... | [
"def",
"scan",
"(",
"backend",
",",
"timeout",
"=",
"10",
")",
":",
"result",
"=",
"[",
"]",
"for",
"(",
"mac",
",",
"name",
")",
"in",
"backend",
".",
"scan_for_devices",
"(",
"timeout",
")",
":",
"if",
"(",
"name",
"is",
"not",
"None",
"and",
"... | Scan for miflora devices.
Note: this must be run as root! | [
"Scan",
"for",
"miflora",
"devices",
"."
] | 916606e7edc70bdc017dfbe681bc81771e0df7f3 | https://github.com/open-homeautomation/miflora/blob/916606e7edc70bdc017dfbe681bc81771e0df7f3/miflora/miflora_scanner.py#L10-L20 |
5,824 | open-homeautomation/miflora | miflora/miflora_poller.py | MiFloraPoller.parameter_value | def parameter_value(self, parameter, read_cached=True):
"""Return a value of one of the monitored paramaters.
This method will try to retrieve the data from cache and only
request it by bluetooth if no cached value is stored or the cache is
expired.
This behaviour can be overwri... | python | def parameter_value(self, parameter, read_cached=True):
"""Return a value of one of the monitored paramaters.
This method will try to retrieve the data from cache and only
request it by bluetooth if no cached value is stored or the cache is
expired.
This behaviour can be overwri... | [
"def",
"parameter_value",
"(",
"self",
",",
"parameter",
",",
"read_cached",
"=",
"True",
")",
":",
"# Special handling for battery attribute",
"if",
"parameter",
"==",
"MI_BATTERY",
":",
"return",
"self",
".",
"battery_level",
"(",
")",
"# Use the lock to make sure t... | Return a value of one of the monitored paramaters.
This method will try to retrieve the data from cache and only
request it by bluetooth if no cached value is stored or the cache is
expired.
This behaviour can be overwritten by the "read_cached" parameter. | [
"Return",
"a",
"value",
"of",
"one",
"of",
"the",
"monitored",
"paramaters",
"."
] | 916606e7edc70bdc017dfbe681bc81771e0df7f3 | https://github.com/open-homeautomation/miflora/blob/916606e7edc70bdc017dfbe681bc81771e0df7f3/miflora/miflora_poller.py#L115-L141 |
5,825 | halcy/Mastodon.py | mastodon/Mastodon.py | parse_version_string | def parse_version_string(version_string):
"""Parses a semver version string, stripping off "rc" stuff if present."""
string_parts = version_string.split(".")
version_parts = [
int(re.match("([0-9]*)", string_parts[0]).group(0)),
int(re.match("([0-9]*)", string_parts[1]).group(0)),
i... | python | def parse_version_string(version_string):
"""Parses a semver version string, stripping off "rc" stuff if present."""
string_parts = version_string.split(".")
version_parts = [
int(re.match("([0-9]*)", string_parts[0]).group(0)),
int(re.match("([0-9]*)", string_parts[1]).group(0)),
i... | [
"def",
"parse_version_string",
"(",
"version_string",
")",
":",
"string_parts",
"=",
"version_string",
".",
"split",
"(",
"\".\"",
")",
"version_parts",
"=",
"[",
"int",
"(",
"re",
".",
"match",
"(",
"\"([0-9]*)\"",
",",
"string_parts",
"[",
"0",
"]",
")",
... | Parses a semver version string, stripping off "rc" stuff if present. | [
"Parses",
"a",
"semver",
"version",
"string",
"stripping",
"off",
"rc",
"stuff",
"if",
"present",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L42-L50 |
5,826 | halcy/Mastodon.py | mastodon/Mastodon.py | bigger_version | def bigger_version(version_string_a, version_string_b):
"""Returns the bigger version of two version strings."""
major_a, minor_a, patch_a = parse_version_string(version_string_a)
major_b, minor_b, patch_b = parse_version_string(version_string_b)
if major_a > major_b:
return version_string_a
... | python | def bigger_version(version_string_a, version_string_b):
"""Returns the bigger version of two version strings."""
major_a, minor_a, patch_a = parse_version_string(version_string_a)
major_b, minor_b, patch_b = parse_version_string(version_string_b)
if major_a > major_b:
return version_string_a
... | [
"def",
"bigger_version",
"(",
"version_string_a",
",",
"version_string_b",
")",
":",
"major_a",
",",
"minor_a",
",",
"patch_a",
"=",
"parse_version_string",
"(",
"version_string_a",
")",
"major_b",
",",
"minor_b",
",",
"patch_b",
"=",
"parse_version_string",
"(",
... | Returns the bigger version of two version strings. | [
"Returns",
"the",
"bigger",
"version",
"of",
"two",
"version",
"strings",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L52-L63 |
5,827 | halcy/Mastodon.py | mastodon/Mastodon.py | api_version | def api_version(created_ver, last_changed_ver, return_value_ver):
"""Version check decorator. Currently only checks Bigger Than."""
def api_min_version_decorator(function):
def wrapper(function, self, *args, **kwargs):
if not self.version_check_mode == "none":
if self.v... | python | def api_version(created_ver, last_changed_ver, return_value_ver):
"""Version check decorator. Currently only checks Bigger Than."""
def api_min_version_decorator(function):
def wrapper(function, self, *args, **kwargs):
if not self.version_check_mode == "none":
if self.v... | [
"def",
"api_version",
"(",
"created_ver",
",",
"last_changed_ver",
",",
"return_value_ver",
")",
":",
"def",
"api_min_version_decorator",
"(",
"function",
")",
":",
"def",
"wrapper",
"(",
"function",
",",
"self",
",",
"*",
"args",
",",
"*",
"*",
"kwargs",
")... | Version check decorator. Currently only checks Bigger Than. | [
"Version",
"check",
"decorator",
".",
"Currently",
"only",
"checks",
"Bigger",
"Than",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L65-L85 |
5,828 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.verify_minimum_version | def verify_minimum_version(self, version_str):
"""
Update version info from server and verify that at least the specified version is present.
Returns True if version requirement is satisfied, False if not.
"""
self.retrieve_mastodon_version()
major, minor, patch ... | python | def verify_minimum_version(self, version_str):
"""
Update version info from server and verify that at least the specified version is present.
Returns True if version requirement is satisfied, False if not.
"""
self.retrieve_mastodon_version()
major, minor, patch ... | [
"def",
"verify_minimum_version",
"(",
"self",
",",
"version_str",
")",
":",
"self",
".",
"retrieve_mastodon_version",
"(",
")",
"major",
",",
"minor",
",",
"patch",
"=",
"parse_version_string",
"(",
"version_str",
")",
"if",
"major",
">",
"self",
".",
"mastodo... | Update version info from server and verify that at least the specified version is present.
Returns True if version requirement is satisfied, False if not. | [
"Update",
"version",
"info",
"from",
"server",
"and",
"verify",
"that",
"at",
"least",
"the",
"specified",
"version",
"is",
"present",
".",
"Returns",
"True",
"if",
"version",
"requirement",
"is",
"satisfied",
"False",
"if",
"not",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L359-L373 |
5,829 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.log_in | def log_in(self, username=None, password=None,
code=None, redirect_uri="urn:ietf:wg:oauth:2.0:oob", refresh_token=None,
scopes=__DEFAULT_SCOPES, to_file=None):
"""
Get the access token for a user.
The username is the e-mail used to log in into mastodon.
... | python | def log_in(self, username=None, password=None,
code=None, redirect_uri="urn:ietf:wg:oauth:2.0:oob", refresh_token=None,
scopes=__DEFAULT_SCOPES, to_file=None):
"""
Get the access token for a user.
The username is the e-mail used to log in into mastodon.
... | [
"def",
"log_in",
"(",
"self",
",",
"username",
"=",
"None",
",",
"password",
"=",
"None",
",",
"code",
"=",
"None",
",",
"redirect_uri",
"=",
"\"urn:ietf:wg:oauth:2.0:oob\"",
",",
"refresh_token",
"=",
"None",
",",
"scopes",
"=",
"__DEFAULT_SCOPES",
",",
"to... | Get the access token for a user.
The username is the e-mail used to log in into mastodon.
Can persist access token to file `to_file`, to be used in the constructor.
Handles password and OAuth-based authorization.
Will throw a `MastodonIllegalArgumentError` if the OAut... | [
"Get",
"the",
"access",
"token",
"for",
"a",
"user",
".",
"The",
"username",
"is",
"the",
"e",
"-",
"mail",
"used",
"to",
"log",
"in",
"into",
"mastodon",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L414-L481 |
5,830 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.timeline_list | def timeline_list(self, id, max_id=None, min_id=None, since_id=None, limit=None):
"""
Fetches a timeline containing all the toots by users in a given list.
Returns a list of `toot dicts`_.
"""
id = self.__unpack_id(id)
return self.timeline('list/{0}'.format(id), max_id=m... | python | def timeline_list(self, id, max_id=None, min_id=None, since_id=None, limit=None):
"""
Fetches a timeline containing all the toots by users in a given list.
Returns a list of `toot dicts`_.
"""
id = self.__unpack_id(id)
return self.timeline('list/{0}'.format(id), max_id=m... | [
"def",
"timeline_list",
"(",
"self",
",",
"id",
",",
"max_id",
"=",
"None",
",",
"min_id",
"=",
"None",
",",
"since_id",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"return",
"self",
".",... | Fetches a timeline containing all the toots by users in a given list.
Returns a list of `toot dicts`_. | [
"Fetches",
"a",
"timeline",
"containing",
"all",
"the",
"toots",
"by",
"users",
"in",
"a",
"given",
"list",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L709-L717 |
5,831 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.conversations | def conversations(self, max_id=None, min_id=None, since_id=None, limit=None):
"""
Fetches a users conversations.
Returns a list of `conversation dicts`_.
"""
if max_id != None:
max_id = self.__unpack_id(max_id)
if min_id != None:
... | python | def conversations(self, max_id=None, min_id=None, since_id=None, limit=None):
"""
Fetches a users conversations.
Returns a list of `conversation dicts`_.
"""
if max_id != None:
max_id = self.__unpack_id(max_id)
if min_id != None:
... | [
"def",
"conversations",
"(",
"self",
",",
"max_id",
"=",
"None",
",",
"min_id",
"=",
"None",
",",
"since_id",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"if",
"max_id",
"!=",
"None",
":",
"max_id",
"=",
"self",
".",
"__unpack_id",
"(",
"max_id... | Fetches a users conversations.
Returns a list of `conversation dicts`_. | [
"Fetches",
"a",
"users",
"conversations",
".",
"Returns",
"a",
"list",
"of",
"conversation",
"dicts",
"_",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L720-L736 |
5,832 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status | def status(self, id):
"""
Fetch information about a single toot.
Does not require authentication for publicly visible statuses.
Returns a `toot dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}'.format(str(id))
return self.__api_request('... | python | def status(self, id):
"""
Fetch information about a single toot.
Does not require authentication for publicly visible statuses.
Returns a `toot dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}'.format(str(id))
return self.__api_request('... | [
"def",
"status",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'GET'",
",",... | Fetch information about a single toot.
Does not require authentication for publicly visible statuses.
Returns a `toot dict`_. | [
"Fetch",
"information",
"about",
"a",
"single",
"toot",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L742-L752 |
5,833 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_context | def status_context(self, id):
"""
Fetch information about ancestors and descendants of a toot.
Does not require authentication for publicly visible statuses.
Returns a `context dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/context'.format(str... | python | def status_context(self, id):
"""
Fetch information about ancestors and descendants of a toot.
Does not require authentication for publicly visible statuses.
Returns a `context dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/context'.format(str... | [
"def",
"status_context",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/context'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
... | Fetch information about ancestors and descendants of a toot.
Does not require authentication for publicly visible statuses.
Returns a `context dict`_. | [
"Fetch",
"information",
"about",
"ancestors",
"and",
"descendants",
"of",
"a",
"toot",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L769-L779 |
5,834 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_reblogged_by | def status_reblogged_by(self, id):
"""
Fetch a list of users that have reblogged a status.
Does not require authentication for publicly visible statuses.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/reblogged_by'.for... | python | def status_reblogged_by(self, id):
"""
Fetch a list of users that have reblogged a status.
Does not require authentication for publicly visible statuses.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/reblogged_by'.for... | [
"def",
"status_reblogged_by",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/reblogged_by'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request"... | Fetch a list of users that have reblogged a status.
Does not require authentication for publicly visible statuses.
Returns a list of `user dicts`_. | [
"Fetch",
"a",
"list",
"of",
"users",
"that",
"have",
"reblogged",
"a",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L782-L792 |
5,835 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_favourited_by | def status_favourited_by(self, id):
"""
Fetch a list of users that have favourited a status.
Does not require authentication for publicly visible statuses.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/favourited_by'.... | python | def status_favourited_by(self, id):
"""
Fetch a list of users that have favourited a status.
Does not require authentication for publicly visible statuses.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/favourited_by'.... | [
"def",
"status_favourited_by",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/favourited_by'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_reques... | Fetch a list of users that have favourited a status.
Does not require authentication for publicly visible statuses.
Returns a list of `user dicts`_. | [
"Fetch",
"a",
"list",
"of",
"users",
"that",
"have",
"favourited",
"a",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L795-L805 |
5,836 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.scheduled_status | def scheduled_status(self, id):
"""
Fetch information about the scheduled status with the given id.
Returns a `scheduled toot dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
return self.__api_request('GET', url) | python | def scheduled_status(self, id):
"""
Fetch information about the scheduled status with the given id.
Returns a `scheduled toot dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
return self.__api_request('GET', url) | [
"def",
"scheduled_status",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/scheduled_statuses/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(... | Fetch information about the scheduled status with the given id.
Returns a `scheduled toot dict`_. | [
"Fetch",
"information",
"about",
"the",
"scheduled",
"status",
"with",
"the",
"given",
"id",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L820-L828 |
5,837 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.poll | def poll(self, id):
"""
Fetch information about the poll with the given id
Returns a `poll dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/polls/{0}'.format(str(id))
return self.__api_request('GET', url) | python | def poll(self, id):
"""
Fetch information about the poll with the given id
Returns a `poll dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/polls/{0}'.format(str(id))
return self.__api_request('GET', url) | [
"def",
"poll",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/polls/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'GET'",
",",
"u... | Fetch information about the poll with the given id
Returns a `poll dict`_. | [
"Fetch",
"information",
"about",
"the",
"poll",
"with",
"the",
"given",
"id"
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L834-L842 |
5,838 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account | def account(self, id):
"""
Fetch account information by user `id`.
Does not require authentication.
Returns a `user dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}'.format(str(id))
return self.__api_request('GET', url) | python | def account(self, id):
"""
Fetch account information by user `id`.
Does not require authentication.
Returns a `user dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}'.format(str(id))
return self.__api_request('GET', url) | [
"def",
"account",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/accounts/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'GET'",
","... | Fetch account information by user `id`.
Does not require authentication.
Returns a `user dict`_. | [
"Fetch",
"account",
"information",
"by",
"user",
"id",
".",
"Does",
"not",
"require",
"authentication",
".",
"Returns",
"a",
"user",
"dict",
"_",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L878-L888 |
5,839 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account_following | def account_following(self, id, max_id=None, min_id=None, since_id=None, limit=None):
"""
Fetch users the given user is following.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(id)
if max_id != None:
max_id = self.__unpack_id(max_id)
... | python | def account_following(self, id, max_id=None, min_id=None, since_id=None, limit=None):
"""
Fetch users the given user is following.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(id)
if max_id != None:
max_id = self.__unpack_id(max_id)
... | [
"def",
"account_following",
"(",
"self",
",",
"id",
",",
"max_id",
"=",
"None",
",",
"min_id",
"=",
"None",
",",
"since_id",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"if",
"max_id",
"!... | Fetch users the given user is following.
Returns a list of `user dicts`_. | [
"Fetch",
"users",
"the",
"given",
"user",
"is",
"following",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L938-L956 |
5,840 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account_lists | def account_lists(self, id):
"""
Get all of the logged-in users lists which the specified user is
a member of.
Returns a list of `list dicts`_.
"""
id = self.__unpack_id(id)
params = self.__generate_params(locals(), ['id'])
url = '/api/v1/accounts... | python | def account_lists(self, id):
"""
Get all of the logged-in users lists which the specified user is
a member of.
Returns a list of `list dicts`_.
"""
id = self.__unpack_id(id)
params = self.__generate_params(locals(), ['id'])
url = '/api/v1/accounts... | [
"def",
"account_lists",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
",",
"[",
"'id'",
"]",
")",
"url",
"=",
"'/api/v1/accounts/{0}/li... | Get all of the logged-in users lists which the specified user is
a member of.
Returns a list of `list dicts`_. | [
"Get",
"all",
"of",
"the",
"logged",
"-",
"in",
"users",
"lists",
"which",
"the",
"specified",
"user",
"is",
"a",
"member",
"of",
".",
"Returns",
"a",
"list",
"of",
"list",
"dicts",
"_",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1009-L1019 |
5,841 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.filter | def filter(self, id):
"""
Fetches information about the filter with the specified `id`.
Returns a `filter dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/filters/{0}'.format(str(id))
return self.__api_request('GET', url) | python | def filter(self, id):
"""
Fetches information about the filter with the specified `id`.
Returns a `filter dict`_.
"""
id = self.__unpack_id(id)
url = '/api/v1/filters/{0}'.format(str(id))
return self.__api_request('GET', url) | [
"def",
"filter",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/filters/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'GET'",
",",
... | Fetches information about the filter with the specified `id`.
Returns a `filter dict`_. | [
"Fetches",
"information",
"about",
"the",
"filter",
"with",
"the",
"specified",
"id",
".",
"Returns",
"a",
"filter",
"dict",
"_",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1034-L1042 |
5,842 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.search | def search(self, q, resolve=True, result_type=None, account_id=None, offset=None, min_id=None, max_id=None):
"""
Fetch matching hashtags, accounts and statuses. Will perform webfinger
lookups if resolve is True. Full-text search is only enabled if
the instance supports it, and is restric... | python | def search(self, q, resolve=True, result_type=None, account_id=None, offset=None, min_id=None, max_id=None):
"""
Fetch matching hashtags, accounts and statuses. Will perform webfinger
lookups if resolve is True. Full-text search is only enabled if
the instance supports it, and is restric... | [
"def",
"search",
"(",
"self",
",",
"q",
",",
"resolve",
"=",
"True",
",",
"result_type",
"=",
"None",
",",
"account_id",
"=",
"None",
",",
"offset",
"=",
"None",
",",
"min_id",
"=",
"None",
",",
"max_id",
"=",
"None",
")",
":",
"return",
"self",
".... | Fetch matching hashtags, accounts and statuses. Will perform webfinger
lookups if resolve is True. Full-text search is only enabled if
the instance supports it, and is restricted to statuses the logged-in
user wrote or was mentioned in.
`result_type` can be one of "accounts", "h... | [
"Fetch",
"matching",
"hashtags",
"accounts",
"and",
"statuses",
".",
"Will",
"perform",
"webfinger",
"lookups",
"if",
"resolve",
"is",
"True",
".",
"Full",
"-",
"text",
"search",
"is",
"only",
"enabled",
"if",
"the",
"instance",
"supports",
"it",
"and",
"is"... | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1110-L1127 |
5,843 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.list | def list(self, id):
"""
Fetch info about a specific list.
Returns a `list dict`_.
"""
id = self.__unpack_id(id)
return self.__api_request('GET', '/api/v1/lists/{0}'.format(id)) | python | def list(self, id):
"""
Fetch info about a specific list.
Returns a `list dict`_.
"""
id = self.__unpack_id(id)
return self.__api_request('GET', '/api/v1/lists/{0}'.format(id)) | [
"def",
"list",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"return",
"self",
".",
"__api_request",
"(",
"'GET'",
",",
"'/api/v1/lists/{0}'",
".",
"format",
"(",
"id",
")",
")"
] | Fetch info about a specific list.
Returns a `list dict`_. | [
"Fetch",
"info",
"about",
"a",
"specific",
"list",
".",
"Returns",
"a",
"list",
"dict",
"_",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1174-L1181 |
5,844 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.list_accounts | def list_accounts(self, id, max_id=None, min_id=None, since_id=None, limit=None):
"""
Get the accounts that are on the given list. A `limit` of 0 can
be specified to get all accounts without pagination.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(i... | python | def list_accounts(self, id, max_id=None, min_id=None, since_id=None, limit=None):
"""
Get the accounts that are on the given list. A `limit` of 0 can
be specified to get all accounts without pagination.
Returns a list of `user dicts`_.
"""
id = self.__unpack_id(i... | [
"def",
"list_accounts",
"(",
"self",
",",
"id",
",",
"max_id",
"=",
"None",
",",
"min_id",
"=",
"None",
",",
"since_id",
"=",
"None",
",",
"limit",
"=",
"None",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"if",
"max_id",
"!=",
... | Get the accounts that are on the given list. A `limit` of 0 can
be specified to get all accounts without pagination.
Returns a list of `user dicts`_. | [
"Get",
"the",
"accounts",
"that",
"are",
"on",
"the",
"given",
"list",
".",
"A",
"limit",
"of",
"0",
"can",
"be",
"specified",
"to",
"get",
"all",
"accounts",
"without",
"pagination",
".",
"Returns",
"a",
"list",
"of",
"user",
"dicts",
"_",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1184-L1203 |
5,845 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_reply | def status_reply(self, to_status, status, media_ids=None, sensitive=False, visibility=None,
spoiler_text=None, language=None, idempotency_key=None, content_type=None,
scheduled_at=None, poll=None, untag=False):
"""
Helper function - acts like status_post, but p... | python | def status_reply(self, to_status, status, media_ids=None, sensitive=False, visibility=None,
spoiler_text=None, language=None, idempotency_key=None, content_type=None,
scheduled_at=None, poll=None, untag=False):
"""
Helper function - acts like status_post, but p... | [
"def",
"status_reply",
"(",
"self",
",",
"to_status",
",",
"status",
",",
"media_ids",
"=",
"None",
",",
"sensitive",
"=",
"False",
",",
"visibility",
"=",
"None",
",",
"spoiler_text",
"=",
"None",
",",
"language",
"=",
"None",
",",
"idempotency_key",
"=",... | Helper function - acts like status_post, but prepends the name of all
the users that are being replied to to the status text and retains
CW and visibility if not explicitly overridden.
Set `untag` to True if you want the reply to only go to the user you
are replying to, removing... | [
"Helper",
"function",
"-",
"acts",
"like",
"status_post",
"but",
"prepends",
"the",
"name",
"of",
"all",
"the",
"users",
"that",
"are",
"being",
"replied",
"to",
"to",
"the",
"status",
"text",
"and",
"retains",
"CW",
"and",
"visibility",
"if",
"not",
"expl... | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1506-L1541 |
5,846 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_delete | def status_delete(self, id):
"""
Delete a status
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}'.format(str(id))
self.__api_request('DELETE', url) | python | def status_delete(self, id):
"""
Delete a status
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}'.format(str(id))
self.__api_request('DELETE', url) | [
"def",
"status_delete",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"self",
".",
"__api_request",
"(",
"'DELETE'",
",",
... | Delete a status | [
"Delete",
"a",
"status"
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1558-L1564 |
5,847 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_unreblog | def status_unreblog(self, id):
"""
Un-reblog a status.
Returns a `toot dict`_ with the status that used to be reblogged.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unreblog'.format(str(id))
return self.__api_request('POST', url) | python | def status_unreblog(self, id):
"""
Un-reblog a status.
Returns a `toot dict`_ with the status that used to be reblogged.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unreblog'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"status_unreblog",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/unreblog'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",... | Un-reblog a status.
Returns a `toot dict`_ with the status that used to be reblogged. | [
"Un",
"-",
"reblog",
"a",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1589-L1597 |
5,848 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_favourite | def status_favourite(self, id):
"""
Favourite a status.
Returns a `toot dict`_ with the favourited status.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/favourite'.format(str(id))
return self.__api_request('POST', url) | python | def status_favourite(self, id):
"""
Favourite a status.
Returns a `toot dict`_ with the favourited status.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/favourite'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"status_favourite",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/favourite'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(... | Favourite a status.
Returns a `toot dict`_ with the favourited status. | [
"Favourite",
"a",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1600-L1608 |
5,849 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_unfavourite | def status_unfavourite(self, id):
"""
Un-favourite a status.
Returns a `toot dict`_ with the un-favourited status.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unfavourite'.format(str(id))
return self.__api_request('POST', url) | python | def status_unfavourite(self, id):
"""
Un-favourite a status.
Returns a `toot dict`_ with the un-favourited status.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unfavourite'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"status_unfavourite",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/unfavourite'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
... | Un-favourite a status.
Returns a `toot dict`_ with the un-favourited status. | [
"Un",
"-",
"favourite",
"a",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1611-L1619 |
5,850 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_mute | def status_mute(self, id):
"""
Mute notifications for a status.
Returns a `toot dict`_ with the now muted status
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/mute'.format(str(id))
return self.__api_request('POST', url) | python | def status_mute(self, id):
"""
Mute notifications for a status.
Returns a `toot dict`_ with the now muted status
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/mute'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"status_mute",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/mute'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'POS... | Mute notifications for a status.
Returns a `toot dict`_ with the now muted status | [
"Mute",
"notifications",
"for",
"a",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1622-L1630 |
5,851 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_unmute | def status_unmute(self, id):
"""
Unmute notifications for a status.
Returns a `toot dict`_ with the status that used to be muted.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unmute'.format(str(id))
return self.__api_request('POST', url) | python | def status_unmute(self, id):
"""
Unmute notifications for a status.
Returns a `toot dict`_ with the status that used to be muted.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unmute'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"status_unmute",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/unmute'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"... | Unmute notifications for a status.
Returns a `toot dict`_ with the status that used to be muted. | [
"Unmute",
"notifications",
"for",
"a",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1633-L1641 |
5,852 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_pin | def status_pin(self, id):
"""
Pin a status for the logged-in user.
Returns a `toot dict`_ with the now pinned status
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/pin'.format(str(id))
return self.__api_request('POST', url) | python | def status_pin(self, id):
"""
Pin a status for the logged-in user.
Returns a `toot dict`_ with the now pinned status
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/pin'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"status_pin",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/pin'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'POST'... | Pin a status for the logged-in user.
Returns a `toot dict`_ with the now pinned status | [
"Pin",
"a",
"status",
"for",
"the",
"logged",
"-",
"in",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1644-L1652 |
5,853 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.status_unpin | def status_unpin(self, id):
"""
Unpin a pinned status for the logged-in user.
Returns a `toot dict`_ with the status that used to be pinned.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unpin'.format(str(id))
return self.__api_request('POST', url) | python | def status_unpin(self, id):
"""
Unpin a pinned status for the logged-in user.
Returns a `toot dict`_ with the status that used to be pinned.
"""
id = self.__unpack_id(id)
url = '/api/v1/statuses/{0}/unpin'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"status_unpin",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/statuses/{0}/unpin'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'P... | Unpin a pinned status for the logged-in user.
Returns a `toot dict`_ with the status that used to be pinned. | [
"Unpin",
"a",
"pinned",
"status",
"for",
"the",
"logged",
"-",
"in",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1655-L1663 |
5,854 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.scheduled_status_update | def scheduled_status_update(self, id, scheduled_at):
"""
Update the scheduled time of a scheduled status.
New time must be at least 5 minutes into the future.
Returns a `scheduled toot dict`_
"""
scheduled_at = self.__consistent_isoformat_utc(scheduled_a... | python | def scheduled_status_update(self, id, scheduled_at):
"""
Update the scheduled time of a scheduled status.
New time must be at least 5 minutes into the future.
Returns a `scheduled toot dict`_
"""
scheduled_at = self.__consistent_isoformat_utc(scheduled_a... | [
"def",
"scheduled_status_update",
"(",
"self",
",",
"id",
",",
"scheduled_at",
")",
":",
"scheduled_at",
"=",
"self",
".",
"__consistent_isoformat_utc",
"(",
"scheduled_at",
")",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"params",
"=",
"self",
"... | Update the scheduled time of a scheduled status.
New time must be at least 5 minutes into the future.
Returns a `scheduled toot dict`_ | [
"Update",
"the",
"scheduled",
"time",
"of",
"a",
"scheduled",
"status",
".",
"New",
"time",
"must",
"be",
"at",
"least",
"5",
"minutes",
"into",
"the",
"future",
".",
"Returns",
"a",
"scheduled",
"toot",
"dict",
"_"
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1669-L1681 |
5,855 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.scheduled_status_delete | def scheduled_status_delete(self, id):
"""
Deletes a scheduled status.
"""
id = self.__unpack_id(id)
url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
self.__api_request('DELETE', url) | python | def scheduled_status_delete(self, id):
"""
Deletes a scheduled status.
"""
id = self.__unpack_id(id)
url = '/api/v1/scheduled_statuses/{0}'.format(str(id))
self.__api_request('DELETE', url) | [
"def",
"scheduled_status_delete",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/scheduled_statuses/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"self",
".",
"__api_request",
"(",
... | Deletes a scheduled status. | [
"Deletes",
"a",
"scheduled",
"status",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1684-L1690 |
5,856 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.poll_vote | def poll_vote(self, id, choices):
"""
Vote in the given poll.
`choices` is the index of the choice you wish to register a vote for
(i.e. its index in the corresponding polls `options` field. In case
of a poll that allows selection of more than one option, a list of
... | python | def poll_vote(self, id, choices):
"""
Vote in the given poll.
`choices` is the index of the choice you wish to register a vote for
(i.e. its index in the corresponding polls `options` field. In case
of a poll that allows selection of more than one option, a list of
... | [
"def",
"poll_vote",
"(",
"self",
",",
"id",
",",
"choices",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"if",
"not",
"isinstance",
"(",
"choices",
",",
"list",
")",
":",
"choices",
"=",
"[",
"choices",
"]",
"params",
"=",
"self... | Vote in the given poll.
`choices` is the index of the choice you wish to register a vote for
(i.e. its index in the corresponding polls `options` field. In case
of a poll that allows selection of more than one option, a list of
indices can be passed.
You can o... | [
"Vote",
"in",
"the",
"given",
"poll",
".",
"choices",
"is",
"the",
"index",
"of",
"the",
"choice",
"you",
"wish",
"to",
"register",
"a",
"vote",
"for",
"(",
"i",
".",
"e",
".",
"its",
"index",
"in",
"the",
"corresponding",
"polls",
"options",
"field",
... | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1696-L1717 |
5,857 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.notifications_dismiss | def notifications_dismiss(self, id):
"""
Deletes a single notification
"""
id = self.__unpack_id(id)
params = self.__generate_params(locals())
self.__api_request('POST', '/api/v1/notifications/dismiss', params) | python | def notifications_dismiss(self, id):
"""
Deletes a single notification
"""
id = self.__unpack_id(id)
params = self.__generate_params(locals())
self.__api_request('POST', '/api/v1/notifications/dismiss', params) | [
"def",
"notifications_dismiss",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
")",
"self",
".",
"__api_request",
"(",
"'POST'",
",",
"'... | Deletes a single notification | [
"Deletes",
"a",
"single",
"notification"
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1732-L1738 |
5,858 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account_block | def account_block(self, id):
"""
Block a user.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}/block'.format(str(id))
return self.__api_request('POST', url) | python | def account_block(self, id):
"""
Block a user.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}/block'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"account_block",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/accounts/{0}/block'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'... | Block a user.
Returns a `relationship dict`_ containing the updated relationship to the user. | [
"Block",
"a",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1801-L1809 |
5,859 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account_unblock | def account_unblock(self, id):
"""
Unblock a user.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}/unblock'.format(str(id))
return self.__api_request('POST', url) | python | def account_unblock(self, id):
"""
Unblock a user.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}/unblock'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"account_unblock",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/accounts/{0}/unblock'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
... | Unblock a user.
Returns a `relationship dict`_ containing the updated relationship to the user. | [
"Unblock",
"a",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1812-L1820 |
5,860 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account_mute | def account_mute(self, id, notifications=True):
"""
Mute a user.
Set `notifications` to False to receive notifications even though the user is
muted from timelines.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__u... | python | def account_mute(self, id, notifications=True):
"""
Mute a user.
Set `notifications` to False to receive notifications even though the user is
muted from timelines.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__u... | [
"def",
"account_mute",
"(",
"self",
",",
"id",
",",
"notifications",
"=",
"True",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
",",
"[",
"'id'",
"]",
")",
... | Mute a user.
Set `notifications` to False to receive notifications even though the user is
muted from timelines.
Returns a `relationship dict`_ containing the updated relationship to the user. | [
"Mute",
"a",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1823-L1835 |
5,861 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account_unmute | def account_unmute(self, id):
"""
Unmute a user.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}/unmute'.format(str(id))
return self.__api_request('POST', url) | python | def account_unmute(self, id):
"""
Unmute a user.
Returns a `relationship dict`_ containing the updated relationship to the user.
"""
id = self.__unpack_id(id)
url = '/api/v1/accounts/{0}/unmute'.format(str(id))
return self.__api_request('POST', url) | [
"def",
"account_unmute",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/accounts/{0}/unmute'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
... | Unmute a user.
Returns a `relationship dict`_ containing the updated relationship to the user. | [
"Unmute",
"a",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1838-L1846 |
5,862 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.account_update_credentials | def account_update_credentials(self, display_name=None, note=None,
avatar=None, avatar_mime_type=None,
header=None, header_mime_type=None,
locked=None, fields=None):
"""
Update the profile for the c... | python | def account_update_credentials(self, display_name=None, note=None,
avatar=None, avatar_mime_type=None,
header=None, header_mime_type=None,
locked=None, fields=None):
"""
Update the profile for the c... | [
"def",
"account_update_credentials",
"(",
"self",
",",
"display_name",
"=",
"None",
",",
"note",
"=",
"None",
",",
"avatar",
"=",
"None",
",",
"avatar_mime_type",
"=",
"None",
",",
"header",
"=",
"None",
",",
"header_mime_type",
"=",
"None",
",",
"locked",
... | Update the profile for the currently logged-in user.
'note' is the user's bio.
'avatar' and 'header' are images. As with media uploads, it is possible to either
pass image data and a mime type, or a filename of an image file, for either.
'locked' specifies whether the user nee... | [
"Update",
"the",
"profile",
"for",
"the",
"currently",
"logged",
"-",
"in",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1849-L1913 |
5,863 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.filter_create | def filter_create(self, phrase, context, irreversible = False, whole_word = True, expires_in = None):
"""
Creates a new keyword filter. `phrase` is the phrase that should be
filtered out, `context` specifies from where to filter the keywords.
Valid contexts are 'home', 'notifications', '... | python | def filter_create(self, phrase, context, irreversible = False, whole_word = True, expires_in = None):
"""
Creates a new keyword filter. `phrase` is the phrase that should be
filtered out, `context` specifies from where to filter the keywords.
Valid contexts are 'home', 'notifications', '... | [
"def",
"filter_create",
"(",
"self",
",",
"phrase",
",",
"context",
",",
"irreversible",
"=",
"False",
",",
"whole_word",
"=",
"True",
",",
"expires_in",
"=",
"None",
")",
":",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
")"... | Creates a new keyword filter. `phrase` is the phrase that should be
filtered out, `context` specifies from where to filter the keywords.
Valid contexts are 'home', 'notifications', 'public' and 'thread'.
Set `irreversible` to True if you want the filter to just delete statuses
s... | [
"Creates",
"a",
"new",
"keyword",
"filter",
".",
"phrase",
"is",
"the",
"phrase",
"that",
"should",
"be",
"filtered",
"out",
"context",
"specifies",
"from",
"where",
"to",
"filter",
"the",
"keywords",
".",
"Valid",
"contexts",
"are",
"home",
"notifications",
... | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1942-L1965 |
5,864 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.filter_delete | def filter_delete(self, id):
"""
Deletes the filter with the given `id`.
"""
id = self.__unpack_id(id)
url = '/api/v1/filters/{0}'.format(str(id))
self.__api_request('DELETE', url) | python | def filter_delete(self, id):
"""
Deletes the filter with the given `id`.
"""
id = self.__unpack_id(id)
url = '/api/v1/filters/{0}'.format(str(id))
self.__api_request('DELETE', url) | [
"def",
"filter_delete",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/filters/{0}'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"self",
".",
"__api_request",
"(",
"'DELETE'",
",",
... | Deletes the filter with the given `id`. | [
"Deletes",
"the",
"filter",
"with",
"the",
"given",
"id",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1981-L1987 |
5,865 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.suggestion_delete | def suggestion_delete(self, account_id):
"""
Remove the user with the given `account_id` from the follow suggestions.
"""
account_id = self.__unpack_id(account_id)
url = '/api/v1/suggestions/{0}'.format(str(account_id))
self.__api_request('DELETE', url) | python | def suggestion_delete(self, account_id):
"""
Remove the user with the given `account_id` from the follow suggestions.
"""
account_id = self.__unpack_id(account_id)
url = '/api/v1/suggestions/{0}'.format(str(account_id))
self.__api_request('DELETE', url) | [
"def",
"suggestion_delete",
"(",
"self",
",",
"account_id",
")",
":",
"account_id",
"=",
"self",
".",
"__unpack_id",
"(",
"account_id",
")",
"url",
"=",
"'/api/v1/suggestions/{0}'",
".",
"format",
"(",
"str",
"(",
"account_id",
")",
")",
"self",
".",
"__api_... | Remove the user with the given `account_id` from the follow suggestions. | [
"Remove",
"the",
"user",
"with",
"the",
"given",
"account_id",
"from",
"the",
"follow",
"suggestions",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L1993-L1999 |
5,866 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.list_create | def list_create(self, title):
"""
Create a new list with the given `title`.
Returns the `list dict`_ of the created list.
"""
params = self.__generate_params(locals())
return self.__api_request('POST', '/api/v1/lists', params) | python | def list_create(self, title):
"""
Create a new list with the given `title`.
Returns the `list dict`_ of the created list.
"""
params = self.__generate_params(locals())
return self.__api_request('POST', '/api/v1/lists', params) | [
"def",
"list_create",
"(",
"self",
",",
"title",
")",
":",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
")",
"return",
"self",
".",
"__api_request",
"(",
"'POST'",
",",
"'/api/v1/lists'",
",",
"params",
")"
] | Create a new list with the given `title`.
Returns the `list dict`_ of the created list. | [
"Create",
"a",
"new",
"list",
"with",
"the",
"given",
"title",
".",
"Returns",
"the",
"list",
"dict",
"_",
"of",
"the",
"created",
"list",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2005-L2012 |
5,867 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.list_update | def list_update(self, id, title):
"""
Update info about a list, where "info" is really the lists `title`.
Returns the `list dict`_ of the modified list.
"""
id = self.__unpack_id(id)
params = self.__generate_params(locals(), ['id'])
return self.__api_requ... | python | def list_update(self, id, title):
"""
Update info about a list, where "info" is really the lists `title`.
Returns the `list dict`_ of the modified list.
"""
id = self.__unpack_id(id)
params = self.__generate_params(locals(), ['id'])
return self.__api_requ... | [
"def",
"list_update",
"(",
"self",
",",
"id",
",",
"title",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
",",
"[",
"'id'",
"]",
")",
"return",
"self",
"."... | Update info about a list, where "info" is really the lists `title`.
Returns the `list dict`_ of the modified list. | [
"Update",
"info",
"about",
"a",
"list",
"where",
"info",
"is",
"really",
"the",
"lists",
"title",
".",
"Returns",
"the",
"list",
"dict",
"_",
"of",
"the",
"modified",
"list",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2015-L2023 |
5,868 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.list_delete | def list_delete(self, id):
"""
Delete a list.
"""
id = self.__unpack_id(id)
self.__api_request('DELETE', '/api/v1/lists/{0}'.format(id)) | python | def list_delete(self, id):
"""
Delete a list.
"""
id = self.__unpack_id(id)
self.__api_request('DELETE', '/api/v1/lists/{0}'.format(id)) | [
"def",
"list_delete",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"self",
".",
"__api_request",
"(",
"'DELETE'",
",",
"'/api/v1/lists/{0}'",
".",
"format",
"(",
"id",
")",
")"
] | Delete a list. | [
"Delete",
"a",
"list",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2026-L2031 |
5,869 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.report | def report(self, account_id, status_ids = None, comment = None, forward = False):
"""
Report statuses to the instances administrators.
Accepts a list of toot IDs associated with the report, and a comment.
Set forward to True to forward a report of a remote user to that users
... | python | def report(self, account_id, status_ids = None, comment = None, forward = False):
"""
Report statuses to the instances administrators.
Accepts a list of toot IDs associated with the report, and a comment.
Set forward to True to forward a report of a remote user to that users
... | [
"def",
"report",
"(",
"self",
",",
"account_id",
",",
"status_ids",
"=",
"None",
",",
"comment",
"=",
"None",
",",
"forward",
"=",
"False",
")",
":",
"account_id",
"=",
"self",
".",
"__unpack_id",
"(",
"account_id",
")",
"if",
"not",
"status_ids",
"is",
... | Report statuses to the instances administrators.
Accepts a list of toot IDs associated with the report, and a comment.
Set forward to True to forward a report of a remote user to that users
instance as well as sending it to the instance local administrators.
Returns a `report ... | [
"Report",
"statuses",
"to",
"the",
"instances",
"administrators",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2065-L2088 |
5,870 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.follow_request_authorize | def follow_request_authorize(self, id):
"""
Accept an incoming follow request.
"""
id = self.__unpack_id(id)
url = '/api/v1/follow_requests/{0}/authorize'.format(str(id))
self.__api_request('POST', url) | python | def follow_request_authorize(self, id):
"""
Accept an incoming follow request.
"""
id = self.__unpack_id(id)
url = '/api/v1/follow_requests/{0}/authorize'.format(str(id))
self.__api_request('POST', url) | [
"def",
"follow_request_authorize",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/follow_requests/{0}/authorize'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"self",
".",
"__api_request",
... | Accept an incoming follow request. | [
"Accept",
"an",
"incoming",
"follow",
"request",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2094-L2100 |
5,871 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.follow_request_reject | def follow_request_reject(self, id):
"""
Reject an incoming follow request.
"""
id = self.__unpack_id(id)
url = '/api/v1/follow_requests/{0}/reject'.format(str(id))
self.__api_request('POST', url) | python | def follow_request_reject(self, id):
"""
Reject an incoming follow request.
"""
id = self.__unpack_id(id)
url = '/api/v1/follow_requests/{0}/reject'.format(str(id))
self.__api_request('POST', url) | [
"def",
"follow_request_reject",
"(",
"self",
",",
"id",
")",
":",
"id",
"=",
"self",
".",
"__unpack_id",
"(",
"id",
")",
"url",
"=",
"'/api/v1/follow_requests/{0}/reject'",
".",
"format",
"(",
"str",
"(",
"id",
")",
")",
"self",
".",
"__api_request",
"(",
... | Reject an incoming follow request. | [
"Reject",
"an",
"incoming",
"follow",
"request",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2103-L2109 |
5,872 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.domain_block | def domain_block(self, domain=None):
"""
Add a block for all statuses originating from the specified domain for the logged-in user.
"""
params = self.__generate_params(locals())
self.__api_request('POST', '/api/v1/domain_blocks', params) | python | def domain_block(self, domain=None):
"""
Add a block for all statuses originating from the specified domain for the logged-in user.
"""
params = self.__generate_params(locals())
self.__api_request('POST', '/api/v1/domain_blocks', params) | [
"def",
"domain_block",
"(",
"self",
",",
"domain",
"=",
"None",
")",
":",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
")",
"self",
".",
"__api_request",
"(",
"'POST'",
",",
"'/api/v1/domain_blocks'",
",",
"params",
")"
] | Add a block for all statuses originating from the specified domain for the logged-in user. | [
"Add",
"a",
"block",
"for",
"all",
"statuses",
"originating",
"from",
"the",
"specified",
"domain",
"for",
"the",
"logged",
"-",
"in",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2174-L2179 |
5,873 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.domain_unblock | def domain_unblock(self, domain=None):
"""
Remove a domain block for the logged-in user.
"""
params = self.__generate_params(locals())
self.__api_request('DELETE', '/api/v1/domain_blocks', params) | python | def domain_unblock(self, domain=None):
"""
Remove a domain block for the logged-in user.
"""
params = self.__generate_params(locals())
self.__api_request('DELETE', '/api/v1/domain_blocks', params) | [
"def",
"domain_unblock",
"(",
"self",
",",
"domain",
"=",
"None",
")",
":",
"params",
"=",
"self",
".",
"__generate_params",
"(",
"locals",
"(",
")",
")",
"self",
".",
"__api_request",
"(",
"'DELETE'",
",",
"'/api/v1/domain_blocks'",
",",
"params",
")"
] | Remove a domain block for the logged-in user. | [
"Remove",
"a",
"domain",
"block",
"for",
"the",
"logged",
"-",
"in",
"user",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2182-L2187 |
5,874 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.push_subscription_update | def push_subscription_update(self, follow_events=None,
favourite_events=None, reblog_events=None,
mention_events=None):
"""
Modifies what kind of events the app wishes to subscribe to.
Returns the updated `push subscription d... | python | def push_subscription_update(self, follow_events=None,
favourite_events=None, reblog_events=None,
mention_events=None):
"""
Modifies what kind of events the app wishes to subscribe to.
Returns the updated `push subscription d... | [
"def",
"push_subscription_update",
"(",
"self",
",",
"follow_events",
"=",
"None",
",",
"favourite_events",
"=",
"None",
",",
"reblog_events",
"=",
"None",
",",
"mention_events",
"=",
"None",
")",
":",
"params",
"=",
"{",
"}",
"if",
"follow_events",
"!=",
"N... | Modifies what kind of events the app wishes to subscribe to.
Returns the updated `push subscription dict`_. | [
"Modifies",
"what",
"kind",
"of",
"events",
"the",
"app",
"wishes",
"to",
"subscribe",
"to",
".",
"Returns",
"the",
"updated",
"push",
"subscription",
"dict",
"_",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2235-L2257 |
5,875 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.stream_user | def stream_user(self, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
"""
Streams events that are relevant to the authorized user, i.e. home
timeline and notifications.
"""
return s... | python | def stream_user(self, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
"""
Streams events that are relevant to the authorized user, i.e. home
timeline and notifications.
"""
return s... | [
"def",
"stream_user",
"(",
"self",
",",
"listener",
",",
"run_async",
"=",
"False",
",",
"timeout",
"=",
"__DEFAULT_STREAM_TIMEOUT",
",",
"reconnect_async",
"=",
"False",
",",
"reconnect_async_wait_sec",
"=",
"__DEFAULT_STREAM_RECONNECT_WAIT_SEC",
")",
":",
"return",
... | Streams events that are relevant to the authorized user, i.e. home
timeline and notifications. | [
"Streams",
"events",
"that",
"are",
"relevant",
"to",
"the",
"authorized",
"user",
"i",
".",
"e",
".",
"home",
"timeline",
"and",
"notifications",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2393-L2398 |
5,876 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.stream_hashtag | def stream_hashtag(self, tag, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
"""
Stream for all public statuses for the hashtag 'tag' seen by the connected
instance.
"""
if tag.sta... | python | def stream_hashtag(self, tag, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
"""
Stream for all public statuses for the hashtag 'tag' seen by the connected
instance.
"""
if tag.sta... | [
"def",
"stream_hashtag",
"(",
"self",
",",
"tag",
",",
"listener",
",",
"run_async",
"=",
"False",
",",
"timeout",
"=",
"__DEFAULT_STREAM_TIMEOUT",
",",
"reconnect_async",
"=",
"False",
",",
"reconnect_async_wait_sec",
"=",
"__DEFAULT_STREAM_RECONNECT_WAIT_SEC",
")",
... | Stream for all public statuses for the hashtag 'tag' seen by the connected
instance. | [
"Stream",
"for",
"all",
"public",
"statuses",
"for",
"the",
"hashtag",
"tag",
"seen",
"by",
"the",
"connected",
"instance",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2415-L2422 |
5,877 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.stream_list | def stream_list(self, id, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
"""
Stream events for the current user, restricted to accounts on the given
list.
"""
id = self.__unpack_... | python | def stream_list(self, id, listener, run_async=False, timeout=__DEFAULT_STREAM_TIMEOUT, reconnect_async=False, reconnect_async_wait_sec=__DEFAULT_STREAM_RECONNECT_WAIT_SEC):
"""
Stream events for the current user, restricted to accounts on the given
list.
"""
id = self.__unpack_... | [
"def",
"stream_list",
"(",
"self",
",",
"id",
",",
"listener",
",",
"run_async",
"=",
"False",
",",
"timeout",
"=",
"__DEFAULT_STREAM_TIMEOUT",
",",
"reconnect_async",
"=",
"False",
",",
"reconnect_async_wait_sec",
"=",
"__DEFAULT_STREAM_RECONNECT_WAIT_SEC",
")",
":... | Stream events for the current user, restricted to accounts on the given
list. | [
"Stream",
"events",
"for",
"the",
"current",
"user",
"restricted",
"to",
"accounts",
"on",
"the",
"given",
"list",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2425-L2431 |
5,878 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__datetime_to_epoch | def __datetime_to_epoch(self, date_time):
"""
Converts a python datetime to unix epoch, accounting for
time zones and such.
Assumes UTC if timezone is not given.
"""
date_time_utc = None
if date_time.tzinfo is None:
date_time_utc = date_time.replace(t... | python | def __datetime_to_epoch(self, date_time):
"""
Converts a python datetime to unix epoch, accounting for
time zones and such.
Assumes UTC if timezone is not given.
"""
date_time_utc = None
if date_time.tzinfo is None:
date_time_utc = date_time.replace(t... | [
"def",
"__datetime_to_epoch",
"(",
"self",
",",
"date_time",
")",
":",
"date_time_utc",
"=",
"None",
"if",
"date_time",
".",
"tzinfo",
"is",
"None",
":",
"date_time_utc",
"=",
"date_time",
".",
"replace",
"(",
"tzinfo",
"=",
"pytz",
".",
"utc",
")",
"else"... | Converts a python datetime to unix epoch, accounting for
time zones and such.
Assumes UTC if timezone is not given. | [
"Converts",
"a",
"python",
"datetime",
"to",
"unix",
"epoch",
"accounting",
"for",
"time",
"zones",
"and",
"such",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2443-L2458 |
5,879 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__get_logged_in_id | def __get_logged_in_id(self):
"""
Fetch the logged in users ID, with caching. ID is reset on calls to log_in.
"""
if self.__logged_in_id == None:
self.__logged_in_id = self.account_verify_credentials().id
return self.__logged_in_id | python | def __get_logged_in_id(self):
"""
Fetch the logged in users ID, with caching. ID is reset on calls to log_in.
"""
if self.__logged_in_id == None:
self.__logged_in_id = self.account_verify_credentials().id
return self.__logged_in_id | [
"def",
"__get_logged_in_id",
"(",
"self",
")",
":",
"if",
"self",
".",
"__logged_in_id",
"==",
"None",
":",
"self",
".",
"__logged_in_id",
"=",
"self",
".",
"account_verify_credentials",
"(",
")",
".",
"id",
"return",
"self",
".",
"__logged_in_id"
] | Fetch the logged in users ID, with caching. ID is reset on calls to log_in. | [
"Fetch",
"the",
"logged",
"in",
"users",
"ID",
"with",
"caching",
".",
"ID",
"is",
"reset",
"on",
"calls",
"to",
"log_in",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2460-L2466 |
5,880 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__json_date_parse | def __json_date_parse(json_object):
"""
Parse dates in certain known json fields, if possible.
"""
known_date_fields = ["created_at", "week", "day", "expires_at", "scheduled_at"]
for k, v in json_object.items():
if k in known_date_fields:
if v != None:... | python | def __json_date_parse(json_object):
"""
Parse dates in certain known json fields, if possible.
"""
known_date_fields = ["created_at", "week", "day", "expires_at", "scheduled_at"]
for k, v in json_object.items():
if k in known_date_fields:
if v != None:... | [
"def",
"__json_date_parse",
"(",
"json_object",
")",
":",
"known_date_fields",
"=",
"[",
"\"created_at\"",
",",
"\"week\"",
",",
"\"day\"",
",",
"\"expires_at\"",
",",
"\"scheduled_at\"",
"]",
"for",
"k",
",",
"v",
"in",
"json_object",
".",
"items",
"(",
")",
... | Parse dates in certain known json fields, if possible. | [
"Parse",
"dates",
"in",
"certain",
"known",
"json",
"fields",
"if",
"possible",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2480-L2495 |
5,881 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__json_strnum_to_bignum | def __json_strnum_to_bignum(json_object):
"""
Converts json string numerals to native python bignums.
"""
for key in ('id', 'week', 'in_reply_to_id', 'in_reply_to_account_id', 'logins', 'registrations', 'statuses'):
if (key in json_object and isinstance(json_object[key], six.... | python | def __json_strnum_to_bignum(json_object):
"""
Converts json string numerals to native python bignums.
"""
for key in ('id', 'week', 'in_reply_to_id', 'in_reply_to_account_id', 'logins', 'registrations', 'statuses'):
if (key in json_object and isinstance(json_object[key], six.... | [
"def",
"__json_strnum_to_bignum",
"(",
"json_object",
")",
":",
"for",
"key",
"in",
"(",
"'id'",
",",
"'week'",
",",
"'in_reply_to_id'",
",",
"'in_reply_to_account_id'",
",",
"'logins'",
",",
"'registrations'",
",",
"'statuses'",
")",
":",
"if",
"(",
"key",
"i... | Converts json string numerals to native python bignums. | [
"Converts",
"json",
"string",
"numerals",
"to",
"native",
"python",
"bignums",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2511-L2522 |
5,882 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__json_hooks | def __json_hooks(json_object):
"""
All the json hooks. Used in request parsing.
"""
json_object = Mastodon.__json_strnum_to_bignum(json_object)
json_object = Mastodon.__json_date_parse(json_object)
json_object = Mastodon.__json_truefalse_parse(json_object)
... | python | def __json_hooks(json_object):
"""
All the json hooks. Used in request parsing.
"""
json_object = Mastodon.__json_strnum_to_bignum(json_object)
json_object = Mastodon.__json_date_parse(json_object)
json_object = Mastodon.__json_truefalse_parse(json_object)
... | [
"def",
"__json_hooks",
"(",
"json_object",
")",
":",
"json_object",
"=",
"Mastodon",
".",
"__json_strnum_to_bignum",
"(",
"json_object",
")",
"json_object",
"=",
"Mastodon",
".",
"__json_date_parse",
"(",
"json_object",
")",
"json_object",
"=",
"Mastodon",
".",
"_... | All the json hooks. Used in request parsing. | [
"All",
"the",
"json",
"hooks",
".",
"Used",
"in",
"request",
"parsing",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2525-L2533 |
5,883 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__consistent_isoformat_utc | def __consistent_isoformat_utc(datetime_val):
"""
Function that does what isoformat does but it actually does the same
every time instead of randomly doing different things on some systems
and also it represents that time as the equivalent UTC time.
"""
isotime = datetime... | python | def __consistent_isoformat_utc(datetime_val):
"""
Function that does what isoformat does but it actually does the same
every time instead of randomly doing different things on some systems
and also it represents that time as the equivalent UTC time.
"""
isotime = datetime... | [
"def",
"__consistent_isoformat_utc",
"(",
"datetime_val",
")",
":",
"isotime",
"=",
"datetime_val",
".",
"astimezone",
"(",
"pytz",
".",
"utc",
")",
".",
"strftime",
"(",
"\"%Y-%m-%dT%H:%M:%S%z\"",
")",
"if",
"isotime",
"[",
"-",
"2",
"]",
"!=",
"\":\"",
":"... | Function that does what isoformat does but it actually does the same
every time instead of randomly doing different things on some systems
and also it represents that time as the equivalent UTC time. | [
"Function",
"that",
"does",
"what",
"isoformat",
"does",
"but",
"it",
"actually",
"does",
"the",
"same",
"every",
"time",
"instead",
"of",
"randomly",
"doing",
"different",
"things",
"on",
"some",
"systems",
"and",
"also",
"it",
"represents",
"that",
"time",
... | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2536-L2545 |
5,884 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__generate_params | def __generate_params(self, params, exclude=[]):
"""
Internal named-parameters-to-dict helper.
Note for developers: If called with locals() as params,
as is the usual practice in this code, the __generate_params call
(or at least the locals() call) should generally be the first ... | python | def __generate_params(self, params, exclude=[]):
"""
Internal named-parameters-to-dict helper.
Note for developers: If called with locals() as params,
as is the usual practice in this code, the __generate_params call
(or at least the locals() call) should generally be the first ... | [
"def",
"__generate_params",
"(",
"self",
",",
"params",
",",
"exclude",
"=",
"[",
"]",
")",
":",
"params",
"=",
"collections",
".",
"OrderedDict",
"(",
"params",
")",
"del",
"params",
"[",
"'self'",
"]",
"param_keys",
"=",
"list",
"(",
"params",
".",
"... | Internal named-parameters-to-dict helper.
Note for developers: If called with locals() as params,
as is the usual practice in this code, the __generate_params call
(or at least the locals() call) should generally be the first thing
in your function. | [
"Internal",
"named",
"-",
"parameters",
"-",
"to",
"-",
"dict",
"helper",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2867-L2896 |
5,885 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__decode_webpush_b64 | def __decode_webpush_b64(self, data):
"""
Re-pads and decodes urlsafe base64.
"""
missing_padding = len(data) % 4
if missing_padding != 0:
data += '=' * (4 - missing_padding)
return base64.urlsafe_b64decode(data) | python | def __decode_webpush_b64(self, data):
"""
Re-pads and decodes urlsafe base64.
"""
missing_padding = len(data) % 4
if missing_padding != 0:
data += '=' * (4 - missing_padding)
return base64.urlsafe_b64decode(data) | [
"def",
"__decode_webpush_b64",
"(",
"self",
",",
"data",
")",
":",
"missing_padding",
"=",
"len",
"(",
"data",
")",
"%",
"4",
"if",
"missing_padding",
"!=",
"0",
":",
"data",
"+=",
"'='",
"*",
"(",
"4",
"-",
"missing_padding",
")",
"return",
"base64",
... | Re-pads and decodes urlsafe base64. | [
"Re",
"-",
"pads",
"and",
"decodes",
"urlsafe",
"base64",
"."
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2911-L2918 |
5,886 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__set_token_expired | def __set_token_expired(self, value):
"""Internal helper for oauth code"""
self._token_expired = datetime.datetime.now() + datetime.timedelta(seconds=value)
return | python | def __set_token_expired(self, value):
"""Internal helper for oauth code"""
self._token_expired = datetime.datetime.now() + datetime.timedelta(seconds=value)
return | [
"def",
"__set_token_expired",
"(",
"self",
",",
"value",
")",
":",
"self",
".",
"_token_expired",
"=",
"datetime",
".",
"datetime",
".",
"now",
"(",
")",
"+",
"datetime",
".",
"timedelta",
"(",
"seconds",
"=",
"value",
")",
"return"
] | Internal helper for oauth code | [
"Internal",
"helper",
"for",
"oauth",
"code"
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2924-L2927 |
5,887 | halcy/Mastodon.py | mastodon/Mastodon.py | Mastodon.__protocolize | def __protocolize(base_url):
"""Internal add-protocol-to-url helper"""
if not base_url.startswith("http://") and not base_url.startswith("https://"):
base_url = "https://" + base_url
# Some API endpoints can't handle extra /'s in path requests
base_url = base_url.rstrip("/")... | python | def __protocolize(base_url):
"""Internal add-protocol-to-url helper"""
if not base_url.startswith("http://") and not base_url.startswith("https://"):
base_url = "https://" + base_url
# Some API endpoints can't handle extra /'s in path requests
base_url = base_url.rstrip("/")... | [
"def",
"__protocolize",
"(",
"base_url",
")",
":",
"if",
"not",
"base_url",
".",
"startswith",
"(",
"\"http://\"",
")",
"and",
"not",
"base_url",
".",
"startswith",
"(",
"\"https://\"",
")",
":",
"base_url",
"=",
"\"https://\"",
"+",
"base_url",
"# Some API en... | Internal add-protocol-to-url helper | [
"Internal",
"add",
"-",
"protocol",
"-",
"to",
"-",
"url",
"helper"
] | 35c43562dd3d34d6ebf7a0f757c09e8fcccc957c | https://github.com/halcy/Mastodon.py/blob/35c43562dd3d34d6ebf7a0f757c09e8fcccc957c/mastodon/Mastodon.py#L2939-L2946 |
5,888 | faucamp/python-gsmmodem | gsmmodem/modem.py | SentSms.status | def status(self):
""" Status of this SMS. Can be ENROUTE, DELIVERED or FAILED
The actual status report object may be accessed via the 'report' attribute
if status is 'DELIVERED' or 'FAILED'
"""
if self.report == None:
return SentSms.ENROUTE
else:
... | python | def status(self):
""" Status of this SMS. Can be ENROUTE, DELIVERED or FAILED
The actual status report object may be accessed via the 'report' attribute
if status is 'DELIVERED' or 'FAILED'
"""
if self.report == None:
return SentSms.ENROUTE
else:
... | [
"def",
"status",
"(",
"self",
")",
":",
"if",
"self",
".",
"report",
"==",
"None",
":",
"return",
"SentSms",
".",
"ENROUTE",
"else",
":",
"return",
"SentSms",
".",
"DELIVERED",
"if",
"self",
".",
"report",
".",
"deliveryStatus",
"==",
"StatusReport",
"."... | Status of this SMS. Can be ENROUTE, DELIVERED or FAILED
The actual status report object may be accessed via the 'report' attribute
if status is 'DELIVERED' or 'FAILED' | [
"Status",
"of",
"this",
"SMS",
".",
"Can",
"be",
"ENROUTE",
"DELIVERED",
"or",
"FAILED",
"The",
"actual",
"status",
"report",
"object",
"may",
"be",
"accessed",
"via",
"the",
"report",
"attribute",
"if",
"status",
"is",
"DELIVERED",
"or",
"FAILED"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L76-L85 |
5,889 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem.write | def write(self, data, waitForResponse=True, timeout=5, parseError=True, writeTerm='\r', expectedResponseTermSeq=None):
""" Write data to the modem.
This method adds the ``\\r\\n`` end-of-line sequence to the data parameter, and
writes it to the modem.
:param data: Command/data to be wr... | python | def write(self, data, waitForResponse=True, timeout=5, parseError=True, writeTerm='\r', expectedResponseTermSeq=None):
""" Write data to the modem.
This method adds the ``\\r\\n`` end-of-line sequence to the data parameter, and
writes it to the modem.
:param data: Command/data to be wr... | [
"def",
"write",
"(",
"self",
",",
"data",
",",
"waitForResponse",
"=",
"True",
",",
"timeout",
"=",
"5",
",",
"parseError",
"=",
"True",
",",
"writeTerm",
"=",
"'\\r'",
",",
"expectedResponseTermSeq",
"=",
"None",
")",
":",
"self",
".",
"log",
".",
"de... | Write data to the modem.
This method adds the ``\\r\\n`` end-of-line sequence to the data parameter, and
writes it to the modem.
:param data: Command/data to be written to the modem
:type data: str
:param waitForResponse: Whether this method should block and return the response... | [
"Write",
"data",
"to",
"the",
"modem",
"."
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L387-L446 |
5,890 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem.smsTextMode | def smsTextMode(self, textMode):
""" Set to True for the modem to use text mode for SMS, or False for it to use PDU mode """
if textMode != self._smsTextMode:
if self.alive:
self.write('AT+CMGF={0}'.format(1 if textMode else 0))
self._smsTextMode = textMode
... | python | def smsTextMode(self, textMode):
""" Set to True for the modem to use text mode for SMS, or False for it to use PDU mode """
if textMode != self._smsTextMode:
if self.alive:
self.write('AT+CMGF={0}'.format(1 if textMode else 0))
self._smsTextMode = textMode
... | [
"def",
"smsTextMode",
"(",
"self",
",",
"textMode",
")",
":",
"if",
"textMode",
"!=",
"self",
".",
"_smsTextMode",
":",
"if",
"self",
".",
"alive",
":",
"self",
".",
"write",
"(",
"'AT+CMGF={0}'",
".",
"format",
"(",
"1",
"if",
"textMode",
"else",
"0",... | Set to True for the modem to use text mode for SMS, or False for it to use PDU mode | [
"Set",
"to",
"True",
"for",
"the",
"modem",
"to",
"use",
"text",
"mode",
"for",
"SMS",
"or",
"False",
"for",
"it",
"to",
"use",
"PDU",
"mode"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L524-L530 |
5,891 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem._compileSmsRegexes | def _compileSmsRegexes(self):
""" Compiles regular expression used for parsing SMS messages based on current mode """
if self._smsTextMode:
if self.CMGR_SM_DELIVER_REGEX_TEXT == None:
self.CMGR_SM_DELIVER_REGEX_TEXT = re.compile(r'^\+CMGR: "([^"]+)","([^"]+)",[^,]*,"([^"]+)"$... | python | def _compileSmsRegexes(self):
""" Compiles regular expression used for parsing SMS messages based on current mode """
if self._smsTextMode:
if self.CMGR_SM_DELIVER_REGEX_TEXT == None:
self.CMGR_SM_DELIVER_REGEX_TEXT = re.compile(r'^\+CMGR: "([^"]+)","([^"]+)",[^,]*,"([^"]+)"$... | [
"def",
"_compileSmsRegexes",
"(",
"self",
")",
":",
"if",
"self",
".",
"_smsTextMode",
":",
"if",
"self",
".",
"CMGR_SM_DELIVER_REGEX_TEXT",
"==",
"None",
":",
"self",
".",
"CMGR_SM_DELIVER_REGEX_TEXT",
"=",
"re",
".",
"compile",
"(",
"r'^\\+CMGR: \"([^\"]+)\",\"(... | Compiles regular expression used for parsing SMS messages based on current mode | [
"Compiles",
"regular",
"expression",
"used",
"for",
"parsing",
"SMS",
"messages",
"based",
"on",
"current",
"mode"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L545-L552 |
5,892 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem.smsc | def smsc(self, smscNumber):
""" Set the default SMSC number to use when sending SMS messages """
if smscNumber != self._smscNumber:
if self.alive:
self.write('AT+CSCA="{0}"'.format(smscNumber))
self._smscNumber = smscNumber | python | def smsc(self, smscNumber):
""" Set the default SMSC number to use when sending SMS messages """
if smscNumber != self._smscNumber:
if self.alive:
self.write('AT+CSCA="{0}"'.format(smscNumber))
self._smscNumber = smscNumber | [
"def",
"smsc",
"(",
"self",
",",
"smscNumber",
")",
":",
"if",
"smscNumber",
"!=",
"self",
".",
"_smscNumber",
":",
"if",
"self",
".",
"alive",
":",
"self",
".",
"write",
"(",
"'AT+CSCA=\"{0}\"'",
".",
"format",
"(",
"smscNumber",
")",
")",
"self",
"."... | Set the default SMSC number to use when sending SMS messages | [
"Set",
"the",
"default",
"SMSC",
"number",
"to",
"use",
"when",
"sending",
"SMS",
"messages"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L568-L573 |
5,893 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem.dial | def dial(self, number, timeout=5, callStatusUpdateCallbackFunc=None):
""" Calls the specified phone number using a voice phone call
:param number: The phone number to dial
:param timeout: Maximum time to wait for the call to be established
:param callStatusUpdateCallbackFunc: Callback f... | python | def dial(self, number, timeout=5, callStatusUpdateCallbackFunc=None):
""" Calls the specified phone number using a voice phone call
:param number: The phone number to dial
:param timeout: Maximum time to wait for the call to be established
:param callStatusUpdateCallbackFunc: Callback f... | [
"def",
"dial",
"(",
"self",
",",
"number",
",",
"timeout",
"=",
"5",
",",
"callStatusUpdateCallbackFunc",
"=",
"None",
")",
":",
"if",
"self",
".",
"_waitForCallInitUpdate",
":",
"# Wait for the \"call originated\" notification message",
"self",
".",
"_dialEvent",
"... | Calls the specified phone number using a voice phone call
:param number: The phone number to dial
:param timeout: Maximum time to wait for the call to be established
:param callStatusUpdateCallbackFunc: Callback function that is executed if the call's status changes due to
remote... | [
"Calls",
"the",
"specified",
"phone",
"number",
"using",
"a",
"voice",
"phone",
"call"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L701-L742 |
5,894 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem._handleCallInitiated | def _handleCallInitiated(self, regexMatch, callId=None, callType=1):
""" Handler for "outgoing call initiated" event notification line """
if self._dialEvent:
if regexMatch:
groups = regexMatch.groups()
# Set self._dialReponse to (callId, callType)
... | python | def _handleCallInitiated(self, regexMatch, callId=None, callType=1):
""" Handler for "outgoing call initiated" event notification line """
if self._dialEvent:
if regexMatch:
groups = regexMatch.groups()
# Set self._dialReponse to (callId, callType)
... | [
"def",
"_handleCallInitiated",
"(",
"self",
",",
"regexMatch",
",",
"callId",
"=",
"None",
",",
"callType",
"=",
"1",
")",
":",
"if",
"self",
".",
"_dialEvent",
":",
"if",
"regexMatch",
":",
"groups",
"=",
"regexMatch",
".",
"groups",
"(",
")",
"# Set se... | Handler for "outgoing call initiated" event notification line | [
"Handler",
"for",
"outgoing",
"call",
"initiated",
"event",
"notification",
"line"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L935-L947 |
5,895 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem._handleCallAnswered | def _handleCallAnswered(self, regexMatch, callId=None):
""" Handler for "outgoing call answered" event notification line """
if regexMatch:
groups = regexMatch.groups()
if len(groups) > 1:
callId = int(groups[0])
self.activeCalls[callId].answered =... | python | def _handleCallAnswered(self, regexMatch, callId=None):
""" Handler for "outgoing call answered" event notification line """
if regexMatch:
groups = regexMatch.groups()
if len(groups) > 1:
callId = int(groups[0])
self.activeCalls[callId].answered =... | [
"def",
"_handleCallAnswered",
"(",
"self",
",",
"regexMatch",
",",
"callId",
"=",
"None",
")",
":",
"if",
"regexMatch",
":",
"groups",
"=",
"regexMatch",
".",
"groups",
"(",
")",
"if",
"len",
"(",
"groups",
")",
">",
"1",
":",
"callId",
"=",
"int",
"... | Handler for "outgoing call answered" event notification line | [
"Handler",
"for",
"outgoing",
"call",
"answered",
"event",
"notification",
"line"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L949-L964 |
5,896 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem._handleSmsReceived | def _handleSmsReceived(self, notificationLine):
""" Handler for "new SMS" unsolicited notification line """
self.log.debug('SMS message received')
cmtiMatch = self.CMTI_REGEX.match(notificationLine)
if cmtiMatch:
msgMemory = cmtiMatch.group(1)
msgIndex = cmtiMatch... | python | def _handleSmsReceived(self, notificationLine):
""" Handler for "new SMS" unsolicited notification line """
self.log.debug('SMS message received')
cmtiMatch = self.CMTI_REGEX.match(notificationLine)
if cmtiMatch:
msgMemory = cmtiMatch.group(1)
msgIndex = cmtiMatch... | [
"def",
"_handleSmsReceived",
"(",
"self",
",",
"notificationLine",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"'SMS message received'",
")",
"cmtiMatch",
"=",
"self",
".",
"CMTI_REGEX",
".",
"match",
"(",
"notificationLine",
")",
"if",
"cmtiMatch",
":",
... | Handler for "new SMS" unsolicited notification line | [
"Handler",
"for",
"new",
"SMS",
"unsolicited",
"notification",
"line"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L991-L1000 |
5,897 | faucamp/python-gsmmodem | gsmmodem/modem.py | GsmModem._handleSmsStatusReport | def _handleSmsStatusReport(self, notificationLine):
""" Handler for SMS status reports """
self.log.debug('SMS status report received')
cdsiMatch = self.CDSI_REGEX.match(notificationLine)
if cdsiMatch:
msgMemory = cdsiMatch.group(1)
msgIndex = cdsiMatch.group(2)
... | python | def _handleSmsStatusReport(self, notificationLine):
""" Handler for SMS status reports """
self.log.debug('SMS status report received')
cdsiMatch = self.CDSI_REGEX.match(notificationLine)
if cdsiMatch:
msgMemory = cdsiMatch.group(1)
msgIndex = cdsiMatch.group(2)
... | [
"def",
"_handleSmsStatusReport",
"(",
"self",
",",
"notificationLine",
")",
":",
"self",
".",
"log",
".",
"debug",
"(",
"'SMS status report received'",
")",
"cdsiMatch",
"=",
"self",
".",
"CDSI_REGEX",
".",
"match",
"(",
"notificationLine",
")",
"if",
"cdsiMatch... | Handler for SMS status reports | [
"Handler",
"for",
"SMS",
"status",
"reports"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L1002-L1019 |
5,898 | faucamp/python-gsmmodem | gsmmodem/modem.py | Call.hangup | def hangup(self):
""" End the phone call.
Does nothing if the call is already inactive.
"""
if self.active:
self._gsmModem.write('ATH')
self.answered = False
self.active = False
if self.id in self._gsmModem.activeCalls:
del... | python | def hangup(self):
""" End the phone call.
Does nothing if the call is already inactive.
"""
if self.active:
self._gsmModem.write('ATH')
self.answered = False
self.active = False
if self.id in self._gsmModem.activeCalls:
del... | [
"def",
"hangup",
"(",
"self",
")",
":",
"if",
"self",
".",
"active",
":",
"self",
".",
"_gsmModem",
".",
"write",
"(",
"'ATH'",
")",
"self",
".",
"answered",
"=",
"False",
"self",
".",
"active",
"=",
"False",
"if",
"self",
".",
"id",
"in",
"self",
... | End the phone call.
Does nothing if the call is already inactive. | [
"End",
"the",
"phone",
"call",
".",
"Does",
"nothing",
"if",
"the",
"call",
"is",
"already",
"inactive",
"."
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/gsmmodem/modem.py#L1272-L1282 |
5,899 | faucamp/python-gsmmodem | tools/gsmtermlib/terminal.py | GsmTerm._color | def _color(self, color, msg):
""" Converts a message to be printed to the user's terminal in red """
if self.useColor:
return '{0}{1}{2}'.format(color, msg, self.RESET_SEQ)
else:
return msg | python | def _color(self, color, msg):
""" Converts a message to be printed to the user's terminal in red """
if self.useColor:
return '{0}{1}{2}'.format(color, msg, self.RESET_SEQ)
else:
return msg | [
"def",
"_color",
"(",
"self",
",",
"color",
",",
"msg",
")",
":",
"if",
"self",
".",
"useColor",
":",
"return",
"'{0}{1}{2}'",
".",
"format",
"(",
"color",
",",
"msg",
",",
"self",
".",
"RESET_SEQ",
")",
"else",
":",
"return",
"msg"
] | Converts a message to be printed to the user's terminal in red | [
"Converts",
"a",
"message",
"to",
"be",
"printed",
"to",
"the",
"user",
"s",
"terminal",
"in",
"red"
] | 834c68b1387ca2c91e2210faa8f75526b39723b5 | https://github.com/faucamp/python-gsmmodem/blob/834c68b1387ca2c91e2210faa8f75526b39723b5/tools/gsmtermlib/terminal.py#L216-L221 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.