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 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
sepandhaghighi/pycm | pycm/pycm_overall_func.py | cross_entropy_calc | def cross_entropy_calc(TOP, P, POP):
"""
Calculate cross entropy.
:param TOP: test outcome positive
:type TOP : dict
:param P: condition positive
:type P : dict
:param POP: population
:type POP : dict
:return: cross entropy as float
"""
try:
result = 0
for i ... | python | def cross_entropy_calc(TOP, P, POP):
"""
Calculate cross entropy.
:param TOP: test outcome positive
:type TOP : dict
:param P: condition positive
:type P : dict
:param POP: population
:type POP : dict
:return: cross entropy as float
"""
try:
result = 0
for i ... | [
"def",
"cross_entropy_calc",
"(",
"TOP",
",",
"P",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"for",
"i",
"in",
"TOP",
".",
"keys",
"(",
")",
":",
"reference_likelihood",
"=",
"P",
"[",
"i",
"]",
"/",
"POP",
"[",
"i",
"]",
"response_li... | Calculate cross entropy.
:param TOP: test outcome positive
:type TOP : dict
:param P: condition positive
:type P : dict
:param POP: population
:type POP : dict
:return: cross entropy as float | [
"Calculate",
"cross",
"entropy",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L327-L349 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | joint_entropy_calc | def joint_entropy_calc(classes, table, POP):
"""
Calculate joint entropy.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param POP: population
:type POP : dict
:return: joint entropy as float
"""
try:
... | python | def joint_entropy_calc(classes, table, POP):
"""
Calculate joint entropy.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param POP: population
:type POP : dict
:return: joint entropy as float
"""
try:
... | [
"def",
"joint_entropy_calc",
"(",
"classes",
",",
"table",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"for",
"i",
"in",
"classes",
":",
"for",
"index",
",",
"j",
"in",
"enumerate",
"(",
"classes",
")",
":",
"p_prime",
"=",
"table",
"[",
... | Calculate joint entropy.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param POP: population
:type POP : dict
:return: joint entropy as float | [
"Calculate",
"joint",
"entropy",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L352-L373 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | conditional_entropy_calc | def conditional_entropy_calc(classes, table, P, POP):
"""
Calculate conditional entropy.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param P: condition positive
:type P : dict
:param POP: population
:type... | python | def conditional_entropy_calc(classes, table, P, POP):
"""
Calculate conditional entropy.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param P: condition positive
:type P : dict
:param POP: population
:type... | [
"def",
"conditional_entropy_calc",
"(",
"classes",
",",
"table",
",",
"P",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"for",
"i",
"in",
"classes",
":",
"temp",
"=",
"0",
"for",
"index",
",",
"j",
"in",
"enumerate",
"(",
"classes",
")",
"... | Calculate conditional entropy.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param P: condition positive
:type P : dict
:param POP: population
:type POP : dict
:return: conditional entropy as float | [
"Calculate",
"conditional",
"entropy",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L376-L403 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | lambda_B_calc | def lambda_B_calc(classes, table, TOP, POP):
"""
Calculate Goodman and Kruskal's lambda B.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
... | python | def lambda_B_calc(classes, table, TOP, POP):
"""
Calculate Goodman and Kruskal's lambda B.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
... | [
"def",
"lambda_B_calc",
"(",
"classes",
",",
"table",
",",
"TOP",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"length",
"=",
"POP",
"maxresponse",
"=",
"max",
"(",
"list",
"(",
"TOP",
".",
"values",
"(",
")",
")",
")",
"for",
"i",
"in",... | Calculate Goodman and Kruskal's lambda B.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
:type POP : int
:return: Goodman and Kruskal's la... | [
"Calculate",
"Goodman",
"and",
"Kruskal",
"s",
"lambda",
"B",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L446-L469 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | lambda_A_calc | def lambda_A_calc(classes, table, P, POP):
"""
Calculate Goodman and Kruskal's lambda A.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param P: condition positive
:type P : dict
:param POP: population
:type... | python | def lambda_A_calc(classes, table, P, POP):
"""
Calculate Goodman and Kruskal's lambda A.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param P: condition positive
:type P : dict
:param POP: population
:type... | [
"def",
"lambda_A_calc",
"(",
"classes",
",",
"table",
",",
"P",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"maxreference",
"=",
"max",
"(",
"list",
"(",
"P",
".",
"values",
"(",
")",
")",
")",
"length",
"=",
"POP",
"for",
"i",
"in",
... | Calculate Goodman and Kruskal's lambda A.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param P: condition positive
:type P : dict
:param POP: population
:type POP : int
:return: Goodman and Kruskal's lambda A ... | [
"Calculate",
"Goodman",
"and",
"Kruskal",
"s",
"lambda",
"A",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L472-L498 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | chi_square_calc | def chi_square_calc(classes, table, TOP, P, POP):
"""
Calculate chi-squared.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param TOP: test outcome positive
:type TOP : dict
:param P: condition positive
:typ... | python | def chi_square_calc(classes, table, TOP, P, POP):
"""
Calculate chi-squared.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param TOP: test outcome positive
:type TOP : dict
:param P: condition positive
:typ... | [
"def",
"chi_square_calc",
"(",
"classes",
",",
"table",
",",
"TOP",
",",
"P",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"for",
"i",
"in",
"classes",
":",
"for",
"index",
",",
"j",
"in",
"enumerate",
"(",
"classes",
")",
":",
"expected",... | Calculate chi-squared.
:param classes: confusion matrix classes
:type classes : list
:param table: confusion matrix table
:type table : dict
:param TOP: test outcome positive
:type TOP : dict
:param P: condition positive
:type P : dict
:param POP: population
:type POP : dict
... | [
"Calculate",
"chi",
"-",
"squared",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L501-L525 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | kappa_se_calc | def kappa_se_calc(PA, PE, POP):
"""
Calculate kappa standard error.
:param PA: observed agreement among raters (overall accuracy)
:type PA : float
:param PE: hypothetical probability of chance agreement (random accuracy)
:type PE : float
:param POP: population
:type POP:int
:return... | python | def kappa_se_calc(PA, PE, POP):
"""
Calculate kappa standard error.
:param PA: observed agreement among raters (overall accuracy)
:type PA : float
:param PE: hypothetical probability of chance agreement (random accuracy)
:type PE : float
:param POP: population
:type POP:int
:return... | [
"def",
"kappa_se_calc",
"(",
"PA",
",",
"PE",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"math",
".",
"sqrt",
"(",
"(",
"PA",
"*",
"(",
"1",
"-",
"PA",
")",
")",
"/",
"(",
"POP",
"*",
"(",
"(",
"1",
"-",
"PE",
")",
"**",
"2",
")",
... | Calculate kappa standard error.
:param PA: observed agreement among raters (overall accuracy)
:type PA : float
:param PE: hypothetical probability of chance agreement (random accuracy)
:type PE : float
:param POP: population
:type POP:int
:return: kappa standard error as float | [
"Calculate",
"kappa",
"standard",
"error",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L591-L607 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | micro_calc | def micro_calc(TP, item):
"""
Calculate PPV_Micro and TPR_Micro.
:param TP: true positive
:type TP:dict
:param item: FN or FP
:type item : dict
:return: PPV_Micro or TPR_Micro as float
"""
try:
TP_sum = sum(TP.values())
item_sum = sum(item.values())
return TP... | python | def micro_calc(TP, item):
"""
Calculate PPV_Micro and TPR_Micro.
:param TP: true positive
:type TP:dict
:param item: FN or FP
:type item : dict
:return: PPV_Micro or TPR_Micro as float
"""
try:
TP_sum = sum(TP.values())
item_sum = sum(item.values())
return TP... | [
"def",
"micro_calc",
"(",
"TP",
",",
"item",
")",
":",
"try",
":",
"TP_sum",
"=",
"sum",
"(",
"TP",
".",
"values",
"(",
")",
")",
"item_sum",
"=",
"sum",
"(",
"item",
".",
"values",
"(",
")",
")",
"return",
"TP_sum",
"/",
"(",
"TP_sum",
"+",
"i... | Calculate PPV_Micro and TPR_Micro.
:param TP: true positive
:type TP:dict
:param item: FN or FP
:type item : dict
:return: PPV_Micro or TPR_Micro as float | [
"Calculate",
"PPV_Micro",
"and",
"TPR_Micro",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L648-L663 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | macro_calc | def macro_calc(item):
"""
Calculate PPV_Macro and TPR_Macro.
:param item: PPV or TPR
:type item:dict
:return: PPV_Macro or TPR_Macro as float
"""
try:
item_sum = sum(item.values())
item_len = len(item.values())
return item_sum / item_len
except Exception:
... | python | def macro_calc(item):
"""
Calculate PPV_Macro and TPR_Macro.
:param item: PPV or TPR
:type item:dict
:return: PPV_Macro or TPR_Macro as float
"""
try:
item_sum = sum(item.values())
item_len = len(item.values())
return item_sum / item_len
except Exception:
... | [
"def",
"macro_calc",
"(",
"item",
")",
":",
"try",
":",
"item_sum",
"=",
"sum",
"(",
"item",
".",
"values",
"(",
")",
")",
"item_len",
"=",
"len",
"(",
"item",
".",
"values",
"(",
")",
")",
"return",
"item_sum",
"/",
"item_len",
"except",
"Exception"... | Calculate PPV_Macro and TPR_Macro.
:param item: PPV or TPR
:type item:dict
:return: PPV_Macro or TPR_Macro as float | [
"Calculate",
"PPV_Macro",
"and",
"TPR_Macro",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L666-L679 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | PC_PI_calc | def PC_PI_calc(P, TOP, POP):
"""
Calculate percent chance agreement for Scott's Pi.
:param P: condition positive
:type P : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
:type POP:dict
:return: percent chance agreement as float
"""
try:
... | python | def PC_PI_calc(P, TOP, POP):
"""
Calculate percent chance agreement for Scott's Pi.
:param P: condition positive
:type P : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
:type POP:dict
:return: percent chance agreement as float
"""
try:
... | [
"def",
"PC_PI_calc",
"(",
"P",
",",
"TOP",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"for",
"i",
"in",
"P",
".",
"keys",
"(",
")",
":",
"result",
"+=",
"(",
"(",
"P",
"[",
"i",
"]",
"+",
"TOP",
"[",
"i",
"]",
")",
"/",
"(",
... | Calculate percent chance agreement for Scott's Pi.
:param P: condition positive
:type P : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
:type POP:dict
:return: percent chance agreement as float | [
"Calculate",
"percent",
"chance",
"agreement",
"for",
"Scott",
"s",
"Pi",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L682-L700 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | PC_AC1_calc | def PC_AC1_calc(P, TOP, POP):
"""
Calculate percent chance agreement for Gwet's AC1.
:param P: condition positive
:type P : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
:type POP:dict
:return: percent chance agreement as float
"""
try:
... | python | def PC_AC1_calc(P, TOP, POP):
"""
Calculate percent chance agreement for Gwet's AC1.
:param P: condition positive
:type P : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
:type POP:dict
:return: percent chance agreement as float
"""
try:
... | [
"def",
"PC_AC1_calc",
"(",
"P",
",",
"TOP",
",",
"POP",
")",
":",
"try",
":",
"result",
"=",
"0",
"classes",
"=",
"list",
"(",
"P",
".",
"keys",
"(",
")",
")",
"for",
"i",
"in",
"classes",
":",
"pi",
"=",
"(",
"(",
"P",
"[",
"i",
"]",
"+",
... | Calculate percent chance agreement for Gwet's AC1.
:param P: condition positive
:type P : dict
:param TOP: test outcome positive
:type TOP : dict
:param POP: population
:type POP:dict
:return: percent chance agreement as float | [
"Calculate",
"percent",
"chance",
"agreement",
"for",
"Gwet",
"s",
"AC1",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L703-L724 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | overall_jaccard_index_calc | def overall_jaccard_index_calc(jaccard_list):
"""
Calculate overall jaccard index.
:param jaccard_list : list of jaccard index for each class
:type jaccard_list : list
:return: (jaccard_sum , jaccard_mean) as tuple
"""
try:
jaccard_sum = sum(jaccard_list)
jaccard_mean = jacc... | python | def overall_jaccard_index_calc(jaccard_list):
"""
Calculate overall jaccard index.
:param jaccard_list : list of jaccard index for each class
:type jaccard_list : list
:return: (jaccard_sum , jaccard_mean) as tuple
"""
try:
jaccard_sum = sum(jaccard_list)
jaccard_mean = jacc... | [
"def",
"overall_jaccard_index_calc",
"(",
"jaccard_list",
")",
":",
"try",
":",
"jaccard_sum",
"=",
"sum",
"(",
"jaccard_list",
")",
"jaccard_mean",
"=",
"jaccard_sum",
"/",
"len",
"(",
"jaccard_list",
")",
"return",
"(",
"jaccard_sum",
",",
"jaccard_mean",
")",... | Calculate overall jaccard index.
:param jaccard_list : list of jaccard index for each class
:type jaccard_list : list
:return: (jaccard_sum , jaccard_mean) as tuple | [
"Calculate",
"overall",
"jaccard",
"index",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L741-L754 | train |
sepandhaghighi/pycm | pycm/pycm_overall_func.py | overall_accuracy_calc | def overall_accuracy_calc(TP, POP):
"""
Calculate overall accuracy.
:param TP: true positive
:type TP : dict
:param POP: population
:type POP:int
:return: overall_accuracy as float
"""
try:
overall_accuracy = sum(TP.values()) / POP
return overall_accuracy
except ... | python | def overall_accuracy_calc(TP, POP):
"""
Calculate overall accuracy.
:param TP: true positive
:type TP : dict
:param POP: population
:type POP:int
:return: overall_accuracy as float
"""
try:
overall_accuracy = sum(TP.values()) / POP
return overall_accuracy
except ... | [
"def",
"overall_accuracy_calc",
"(",
"TP",
",",
"POP",
")",
":",
"try",
":",
"overall_accuracy",
"=",
"sum",
"(",
"TP",
".",
"values",
"(",
")",
")",
"/",
"POP",
"return",
"overall_accuracy",
"except",
"Exception",
":",
"return",
"\"None\""
] | Calculate overall accuracy.
:param TP: true positive
:type TP : dict
:param POP: population
:type POP:int
:return: overall_accuracy as float | [
"Calculate",
"overall",
"accuracy",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_overall_func.py#L757-L771 | train |
sepandhaghighi/pycm | pycm/pycm_interpret.py | AUC_analysis | def AUC_analysis(AUC):
"""
Analysis AUC with interpretation table.
:param AUC: area under the ROC curve
:type AUC : float
:return: interpretation result as str
"""
try:
if AUC == "None":
return "None"
if AUC < 0.6:
return "Poor"
if AUC >= 0.6 ... | python | def AUC_analysis(AUC):
"""
Analysis AUC with interpretation table.
:param AUC: area under the ROC curve
:type AUC : float
:return: interpretation result as str
"""
try:
if AUC == "None":
return "None"
if AUC < 0.6:
return "Poor"
if AUC >= 0.6 ... | [
"def",
"AUC_analysis",
"(",
"AUC",
")",
":",
"try",
":",
"if",
"AUC",
"==",
"\"None\"",
":",
"return",
"\"None\"",
"if",
"AUC",
"<",
"0.6",
":",
"return",
"\"Poor\"",
"if",
"AUC",
">=",
"0.6",
"and",
"AUC",
"<",
"0.7",
":",
"return",
"\"Fair\"",
"if"... | Analysis AUC with interpretation table.
:param AUC: area under the ROC curve
:type AUC : float
:return: interpretation result as str | [
"Analysis",
"AUC",
"with",
"interpretation",
"table",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L50-L71 | train |
sepandhaghighi/pycm | pycm/pycm_interpret.py | kappa_analysis_cicchetti | def kappa_analysis_cicchetti(kappa):
"""
Analysis kappa number with Cicchetti benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str
"""
try:
if kappa < 0.4:
return "Poor"
if kappa >= 0.4 and kappa < 0.59:
retu... | python | def kappa_analysis_cicchetti(kappa):
"""
Analysis kappa number with Cicchetti benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str
"""
try:
if kappa < 0.4:
return "Poor"
if kappa >= 0.4 and kappa < 0.59:
retu... | [
"def",
"kappa_analysis_cicchetti",
"(",
"kappa",
")",
":",
"try",
":",
"if",
"kappa",
"<",
"0.4",
":",
"return",
"\"Poor\"",
"if",
"kappa",
">=",
"0.4",
"and",
"kappa",
"<",
"0.59",
":",
"return",
"\"Fair\"",
"if",
"kappa",
">=",
"0.59",
"and",
"kappa",
... | Analysis kappa number with Cicchetti benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str | [
"Analysis",
"kappa",
"number",
"with",
"Cicchetti",
"benchmark",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L74-L93 | train |
sepandhaghighi/pycm | pycm/pycm_interpret.py | kappa_analysis_koch | def kappa_analysis_koch(kappa):
"""
Analysis kappa number with Landis-Koch benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str
"""
try:
if kappa < 0:
return "Poor"
if kappa >= 0 and kappa < 0.2:
return "Slig... | python | def kappa_analysis_koch(kappa):
"""
Analysis kappa number with Landis-Koch benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str
"""
try:
if kappa < 0:
return "Poor"
if kappa >= 0 and kappa < 0.2:
return "Slig... | [
"def",
"kappa_analysis_koch",
"(",
"kappa",
")",
":",
"try",
":",
"if",
"kappa",
"<",
"0",
":",
"return",
"\"Poor\"",
"if",
"kappa",
">=",
"0",
"and",
"kappa",
"<",
"0.2",
":",
"return",
"\"Slight\"",
"if",
"kappa",
">=",
"0.20",
"and",
"kappa",
"<",
... | Analysis kappa number with Landis-Koch benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str | [
"Analysis",
"kappa",
"number",
"with",
"Landis",
"-",
"Koch",
"benchmark",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L96-L119 | train |
sepandhaghighi/pycm | pycm/pycm_interpret.py | kappa_analysis_altman | def kappa_analysis_altman(kappa):
"""
Analysis kappa number with Altman benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str
"""
try:
if kappa < 0.2:
return "Poor"
if kappa >= 0.20 and kappa < 0.4:
return "Fa... | python | def kappa_analysis_altman(kappa):
"""
Analysis kappa number with Altman benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str
"""
try:
if kappa < 0.2:
return "Poor"
if kappa >= 0.20 and kappa < 0.4:
return "Fa... | [
"def",
"kappa_analysis_altman",
"(",
"kappa",
")",
":",
"try",
":",
"if",
"kappa",
"<",
"0.2",
":",
"return",
"\"Poor\"",
"if",
"kappa",
">=",
"0.20",
"and",
"kappa",
"<",
"0.4",
":",
"return",
"\"Fair\"",
"if",
"kappa",
">=",
"0.40",
"and",
"kappa",
"... | Analysis kappa number with Altman benchmark.
:param kappa: kappa number
:type kappa : float
:return: strength of agreement as str | [
"Analysis",
"kappa",
"number",
"with",
"Altman",
"benchmark",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_interpret.py#L141-L162 | train |
sepandhaghighi/pycm | setup.py | get_requires | def get_requires():
"""Read requirements.txt."""
requirements = open("requirements.txt", "r").read()
return list(filter(lambda x: x != "", requirements.split())) | python | def get_requires():
"""Read requirements.txt."""
requirements = open("requirements.txt", "r").read()
return list(filter(lambda x: x != "", requirements.split())) | [
"def",
"get_requires",
"(",
")",
":",
"requirements",
"=",
"open",
"(",
"\"requirements.txt\"",
",",
"\"r\"",
")",
".",
"read",
"(",
")",
"return",
"list",
"(",
"filter",
"(",
"lambda",
"x",
":",
"x",
"!=",
"\"\"",
",",
"requirements",
".",
"split",
"(... | Read requirements.txt. | [
"Read",
"requirements",
".",
"txt",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/setup.py#L9-L12 | train |
sepandhaghighi/pycm | setup.py | read_description | def read_description():
"""Read README.md and CHANGELOG.md."""
try:
with open("README.md") as r:
description = "\n"
description += r.read()
with open("CHANGELOG.md") as c:
description += "\n"
description += c.read()
return description
e... | python | def read_description():
"""Read README.md and CHANGELOG.md."""
try:
with open("README.md") as r:
description = "\n"
description += r.read()
with open("CHANGELOG.md") as c:
description += "\n"
description += c.read()
return description
e... | [
"def",
"read_description",
"(",
")",
":",
"try",
":",
"with",
"open",
"(",
"\"README.md\"",
")",
"as",
"r",
":",
"description",
"=",
"\"\\n\"",
"description",
"+=",
"r",
".",
"read",
"(",
")",
"with",
"open",
"(",
"\"CHANGELOG.md\"",
")",
"as",
"c",
":... | Read README.md and CHANGELOG.md. | [
"Read",
"README",
".",
"md",
"and",
"CHANGELOG",
".",
"md",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/setup.py#L15-L33 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.print_matrix | def print_matrix(self, one_vs_all=False, class_name=None):
"""
Print confusion matrix.
:param one_vs_all : One-Vs-All mode flag
:type one_vs_all : bool
:param class_name : target class name for One-Vs-All mode
:type class_name : any valid type
:return: None
... | python | def print_matrix(self, one_vs_all=False, class_name=None):
"""
Print confusion matrix.
:param one_vs_all : One-Vs-All mode flag
:type one_vs_all : bool
:param class_name : target class name for One-Vs-All mode
:type class_name : any valid type
:return: None
... | [
"def",
"print_matrix",
"(",
"self",
",",
"one_vs_all",
"=",
"False",
",",
"class_name",
"=",
"None",
")",
":",
"classes",
"=",
"self",
".",
"classes",
"table",
"=",
"self",
".",
"table",
"if",
"one_vs_all",
":",
"[",
"classes",
",",
"table",
"]",
"=",
... | Print confusion matrix.
:param one_vs_all : One-Vs-All mode flag
:type one_vs_all : bool
:param class_name : target class name for One-Vs-All mode
:type class_name : any valid type
:return: None | [
"Print",
"confusion",
"matrix",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L94-L109 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.stat | def stat(self, overall_param=None, class_param=None, class_name=None):
"""
Print statistical measures table.
:param overall_param : overall parameters list for print, Example : ["Kappa","Scott PI]
:type overall_param : list
:param class_param : class parameters list for print, E... | python | def stat(self, overall_param=None, class_param=None, class_name=None):
"""
Print statistical measures table.
:param overall_param : overall parameters list for print, Example : ["Kappa","Scott PI]
:type overall_param : list
:param class_param : class parameters list for print, E... | [
"def",
"stat",
"(",
"self",
",",
"overall_param",
"=",
"None",
",",
"class_param",
"=",
"None",
",",
"class_name",
"=",
"None",
")",
":",
"classes",
"=",
"class_filter",
"(",
"self",
".",
"classes",
",",
"class_name",
")",
"print",
"(",
"stat_print",
"("... | Print statistical measures table.
:param overall_param : overall parameters list for print, Example : ["Kappa","Scott PI]
:type overall_param : list
:param class_param : class parameters list for print, Example : ["TPR","TNR","AUC"]
:type class_param : list
:param class_name : c... | [
"Print",
"statistical",
"measures",
"table",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L129-L147 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.save_html | def save_html(
self,
name,
address=True,
overall_param=None,
class_param=None,
class_name=None, color=(0, 0, 0), normalize=False):
"""
Save ConfusionMatrix in HTML file.
:param name: filename
:type name : str
... | python | def save_html(
self,
name,
address=True,
overall_param=None,
class_param=None,
class_name=None, color=(0, 0, 0), normalize=False):
"""
Save ConfusionMatrix in HTML file.
:param name: filename
:type name : str
... | [
"def",
"save_html",
"(",
"self",
",",
"name",
",",
"address",
"=",
"True",
",",
"overall_param",
"=",
"None",
",",
"class_param",
"=",
"None",
",",
"class_name",
"=",
"None",
",",
"color",
"=",
"(",
"0",
",",
"0",
",",
"0",
")",
",",
"normalize",
"... | Save ConfusionMatrix in HTML file.
:param name: filename
:type name : str
:param address: flag for address return
:type address : bool
:param overall_param : overall parameters list for save, Example : ["Kappa","Scott PI]
:type overall_param : list
:param class_p... | [
"Save",
"ConfusionMatrix",
"in",
"HTML",
"file",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L212-L267 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.save_csv | def save_csv(
self,
name,
address=True,
class_param=None,
class_name=None,
matrix_save=True,
normalize=False):
"""
Save ConfusionMatrix in CSV file.
:param name: filename
:type name : str
:param ... | python | def save_csv(
self,
name,
address=True,
class_param=None,
class_name=None,
matrix_save=True,
normalize=False):
"""
Save ConfusionMatrix in CSV file.
:param name: filename
:type name : str
:param ... | [
"def",
"save_csv",
"(",
"self",
",",
"name",
",",
"address",
"=",
"True",
",",
"class_param",
"=",
"None",
",",
"class_name",
"=",
"None",
",",
"matrix_save",
"=",
"True",
",",
"normalize",
"=",
"False",
")",
":",
"try",
":",
"message",
"=",
"None",
... | Save ConfusionMatrix in CSV file.
:param name: filename
:type name : str
:param address: flag for address return
:type address : bool
:param class_param : class parameters list for save, Example : ["TPR","TNR","AUC"]
:type class_param : list
:param class_name : c... | [
"Save",
"ConfusionMatrix",
"in",
"CSV",
"file",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L269-L315 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.save_obj | def save_obj(self, name, address=True):
"""
Save ConfusionMatrix in .obj file.
:param name: filename
:type name : str
:param address: flag for address return
:type address : bool
:return: saving Status as dict {"Status":bool , "Message":str}
"""
t... | python | def save_obj(self, name, address=True):
"""
Save ConfusionMatrix in .obj file.
:param name: filename
:type name : str
:param address: flag for address return
:type address : bool
:return: saving Status as dict {"Status":bool , "Message":str}
"""
t... | [
"def",
"save_obj",
"(",
"self",
",",
"name",
",",
"address",
"=",
"True",
")",
":",
"try",
":",
"message",
"=",
"None",
"obj_file",
"=",
"open",
"(",
"name",
"+",
"\".obj\"",
",",
"\"w\"",
")",
"actual_vector_temp",
"=",
"self",
".",
"actual_vector",
"... | Save ConfusionMatrix in .obj file.
:param name: filename
:type name : str
:param address: flag for address return
:type address : bool
:return: saving Status as dict {"Status":bool , "Message":str} | [
"Save",
"ConfusionMatrix",
"in",
".",
"obj",
"file",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L317-L350 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.F_beta | def F_beta(self, beta):
"""
Calculate FBeta score.
:param beta: beta parameter
:type beta : float
:return: FBeta score for classes as dict
"""
try:
F_dict = {}
for i in self.TP.keys():
F_dict[i] = F_calc(
... | python | def F_beta(self, beta):
"""
Calculate FBeta score.
:param beta: beta parameter
:type beta : float
:return: FBeta score for classes as dict
"""
try:
F_dict = {}
for i in self.TP.keys():
F_dict[i] = F_calc(
... | [
"def",
"F_beta",
"(",
"self",
",",
"beta",
")",
":",
"try",
":",
"F_dict",
"=",
"{",
"}",
"for",
"i",
"in",
"self",
".",
"TP",
".",
"keys",
"(",
")",
":",
"F_dict",
"[",
"i",
"]",
"=",
"F_calc",
"(",
"TP",
"=",
"self",
".",
"TP",
"[",
"i",
... | Calculate FBeta score.
:param beta: beta parameter
:type beta : float
:return: FBeta score for classes as dict | [
"Calculate",
"FBeta",
"score",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L352-L370 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.IBA_alpha | def IBA_alpha(self, alpha):
"""
Calculate IBA_alpha score.
:param alpha: alpha parameter
:type alpha: float
:return: IBA_alpha score for classes as dict
"""
try:
IBA_dict = {}
for i in self.classes:
IBA_dict[i] = IBA_calc(s... | python | def IBA_alpha(self, alpha):
"""
Calculate IBA_alpha score.
:param alpha: alpha parameter
:type alpha: float
:return: IBA_alpha score for classes as dict
"""
try:
IBA_dict = {}
for i in self.classes:
IBA_dict[i] = IBA_calc(s... | [
"def",
"IBA_alpha",
"(",
"self",
",",
"alpha",
")",
":",
"try",
":",
"IBA_dict",
"=",
"{",
"}",
"for",
"i",
"in",
"self",
".",
"classes",
":",
"IBA_dict",
"[",
"i",
"]",
"=",
"IBA_calc",
"(",
"self",
".",
"TPR",
"[",
"i",
"]",
",",
"self",
".",... | Calculate IBA_alpha score.
:param alpha: alpha parameter
:type alpha: float
:return: IBA_alpha score for classes as dict | [
"Calculate",
"IBA_alpha",
"score",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L372-L386 | train |
sepandhaghighi/pycm | pycm/pycm_obj.py | ConfusionMatrix.relabel | def relabel(self, mapping):
"""
Rename ConfusionMatrix classes.
:param mapping: mapping dictionary
:type mapping : dict
:return: None
"""
if not isinstance(mapping, dict):
raise pycmMatrixError(MAPPING_FORMAT_ERROR)
if self.classes != list(map... | python | def relabel(self, mapping):
"""
Rename ConfusionMatrix classes.
:param mapping: mapping dictionary
:type mapping : dict
:return: None
"""
if not isinstance(mapping, dict):
raise pycmMatrixError(MAPPING_FORMAT_ERROR)
if self.classes != list(map... | [
"def",
"relabel",
"(",
"self",
",",
"mapping",
")",
":",
"if",
"not",
"isinstance",
"(",
"mapping",
",",
"dict",
")",
":",
"raise",
"pycmMatrixError",
"(",
"MAPPING_FORMAT_ERROR",
")",
"if",
"self",
".",
"classes",
"!=",
"list",
"(",
"mapping",
".",
"key... | Rename ConfusionMatrix classes.
:param mapping: mapping dictionary
:type mapping : dict
:return: None | [
"Rename",
"ConfusionMatrix",
"classes",
"."
] | cb03258afd6a821d10acba73c965aaac174bedcd | https://github.com/sepandhaghighi/pycm/blob/cb03258afd6a821d10acba73c965aaac174bedcd/pycm/pycm_obj.py#L426-L462 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | ToolbarBase.add_tools | def add_tools(self):
"""Adds tools from self.toolbardata to self"""
for data in self.toolbardata:
# tool type is in data[0]
if data[0] == "T":
# Simple tool
_, msg_type, label, tool_tip = data
icon = icons[label]
... | python | def add_tools(self):
"""Adds tools from self.toolbardata to self"""
for data in self.toolbardata:
# tool type is in data[0]
if data[0] == "T":
# Simple tool
_, msg_type, label, tool_tip = data
icon = icons[label]
... | [
"def",
"add_tools",
"(",
"self",
")",
":",
"for",
"data",
"in",
"self",
".",
"toolbardata",
":",
"if",
"data",
"[",
"0",
"]",
"==",
"\"T\"",
":",
"_",
",",
"msg_type",
",",
"label",
",",
"tool_tip",
"=",
"data",
"icon",
"=",
"icons",
"[",
"label",
... | Adds tools from self.toolbardata to self | [
"Adds",
"tools",
"from",
"self",
".",
"toolbardata",
"to",
"self"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L96-L146 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | ToolbarBase.OnTool | def OnTool(self, event):
"""Toolbar event handler"""
msgtype = self.ids_msgs[event.GetId()]
post_command_event(self, msgtype) | python | def OnTool(self, event):
"""Toolbar event handler"""
msgtype = self.ids_msgs[event.GetId()]
post_command_event(self, msgtype) | [
"def",
"OnTool",
"(",
"self",
",",
"event",
")",
":",
"msgtype",
"=",
"self",
".",
"ids_msgs",
"[",
"event",
".",
"GetId",
"(",
")",
"]",
"post_command_event",
"(",
"self",
",",
"msgtype",
")"
] | Toolbar event handler | [
"Toolbar",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L148-L152 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | MainToolbar.OnToggleTool | def OnToggleTool(self, event):
"""Tool event handler"""
config["check_spelling"] = str(event.IsChecked())
toggle_id = self.parent.menubar.FindMenuItem(_("View"),
_("Check spelling"))
if toggle_id != -1:
# Check may fail if... | python | def OnToggleTool(self, event):
"""Tool event handler"""
config["check_spelling"] = str(event.IsChecked())
toggle_id = self.parent.menubar.FindMenuItem(_("View"),
_("Check spelling"))
if toggle_id != -1:
# Check may fail if... | [
"def",
"OnToggleTool",
"(",
"self",
",",
"event",
")",
":",
"config",
"[",
"\"check_spelling\"",
"]",
"=",
"str",
"(",
"event",
".",
"IsChecked",
"(",
")",
")",
"toggle_id",
"=",
"self",
".",
"parent",
".",
"menubar",
".",
"FindMenuItem",
"(",
"_",
"("... | Tool event handler | [
"Tool",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L209-L223 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | WidgetToolbar._get_button_label | def _get_button_label(self):
"""Gets Button label from user and returns string"""
dlg = wx.TextEntryDialog(self, _('Button label:'))
if dlg.ShowModal() == wx.ID_OK:
label = dlg.GetValue()
else:
label = ""
dlg.Destroy()
return label | python | def _get_button_label(self):
"""Gets Button label from user and returns string"""
dlg = wx.TextEntryDialog(self, _('Button label:'))
if dlg.ShowModal() == wx.ID_OK:
label = dlg.GetValue()
else:
label = ""
dlg.Destroy()
return label | [
"def",
"_get_button_label",
"(",
"self",
")",
":",
"dlg",
"=",
"wx",
".",
"TextEntryDialog",
"(",
"self",
",",
"_",
"(",
"'Button label:'",
")",
")",
"if",
"dlg",
".",
"ShowModal",
"(",
")",
"==",
"wx",
".",
"ID_OK",
":",
"label",
"=",
"dlg",
".",
... | Gets Button label from user and returns string | [
"Gets",
"Button",
"label",
"from",
"user",
"and",
"returns",
"string"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L303-L315 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | WidgetToolbar.OnButtonCell | def OnButtonCell(self, event):
"""Event handler for cell button toggle button"""
if self.button_cell_button_id == event.GetId():
if event.IsChecked():
label = self._get_button_label()
post_command_event(self, self.ButtonCellMsg, text=label)
else:
... | python | def OnButtonCell(self, event):
"""Event handler for cell button toggle button"""
if self.button_cell_button_id == event.GetId():
if event.IsChecked():
label = self._get_button_label()
post_command_event(self, self.ButtonCellMsg, text=label)
else:
... | [
"def",
"OnButtonCell",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"button_cell_button_id",
"==",
"event",
".",
"GetId",
"(",
")",
":",
"if",
"event",
".",
"IsChecked",
"(",
")",
":",
"label",
"=",
"self",
".",
"_get_button_label",
"(",
")"... | Event handler for cell button toggle button | [
"Event",
"handler",
"for",
"cell",
"button",
"toggle",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L317-L327 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | WidgetToolbar.OnVideoCell | def OnVideoCell(self, event):
"""Event handler for video cell toggle button"""
if self.video_cell_button_id == event.GetId():
if event.IsChecked():
wildcard = _("Media files") + " (*.*)|*.*"
videofile, __ = self.get_filepath_findex_from_user(
... | python | def OnVideoCell(self, event):
"""Event handler for video cell toggle button"""
if self.video_cell_button_id == event.GetId():
if event.IsChecked():
wildcard = _("Media files") + " (*.*)|*.*"
videofile, __ = self.get_filepath_findex_from_user(
... | [
"def",
"OnVideoCell",
"(",
"self",
",",
"event",
")",
":",
"if",
"self",
".",
"video_cell_button_id",
"==",
"event",
".",
"GetId",
"(",
")",
":",
"if",
"event",
".",
"IsChecked",
"(",
")",
":",
"wildcard",
"=",
"_",
"(",
"\"Media files\"",
")",
"+",
... | Event handler for video cell toggle button | [
"Event",
"handler",
"for",
"video",
"cell",
"toggle",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L329-L342 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | FindToolbar.make_menu | def make_menu(self):
"""Creates the search menu"""
menu = wx.Menu()
item = menu.Append(-1, "Recent Searches")
item.Enable(False)
for __id, txt in enumerate(self.search_history):
menu.Append(__id, txt)
return menu | python | def make_menu(self):
"""Creates the search menu"""
menu = wx.Menu()
item = menu.Append(-1, "Recent Searches")
item.Enable(False)
for __id, txt in enumerate(self.search_history):
menu.Append(__id, txt)
return menu | [
"def",
"make_menu",
"(",
"self",
")",
":",
"menu",
"=",
"wx",
".",
"Menu",
"(",
")",
"item",
"=",
"menu",
".",
"Append",
"(",
"-",
"1",
",",
"\"Recent Searches\"",
")",
"item",
".",
"Enable",
"(",
"False",
")",
"for",
"__id",
",",
"txt",
"in",
"e... | Creates the search menu | [
"Creates",
"the",
"search",
"menu"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L427-L436 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | FindToolbar.OnMenu | def OnMenu(self, event):
"""Search history has been selected"""
__id = event.GetId()
try:
menuitem = event.GetEventObject().FindItemById(__id)
selected_text = menuitem.GetItemLabel()
self.search.SetValue(selected_text)
except AttributeError:
... | python | def OnMenu(self, event):
"""Search history has been selected"""
__id = event.GetId()
try:
menuitem = event.GetEventObject().FindItemById(__id)
selected_text = menuitem.GetItemLabel()
self.search.SetValue(selected_text)
except AttributeError:
... | [
"def",
"OnMenu",
"(",
"self",
",",
"event",
")",
":",
"__id",
"=",
"event",
".",
"GetId",
"(",
")",
"try",
":",
"menuitem",
"=",
"event",
".",
"GetEventObject",
"(",
")",
".",
"FindItemById",
"(",
"__id",
")",
"selected_text",
"=",
"menuitem",
".",
"... | Search history has been selected | [
"Search",
"history",
"has",
"been",
"selected"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L438-L448 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | FindToolbar.OnSearch | def OnSearch(self, event):
"""Event handler for starting the search"""
search_string = self.search.GetValue()
if search_string not in self.search_history:
self.search_history.append(search_string)
if len(self.search_history) > 10:
self.search_history.pop(0)
... | python | def OnSearch(self, event):
"""Event handler for starting the search"""
search_string = self.search.GetValue()
if search_string not in self.search_history:
self.search_history.append(search_string)
if len(self.search_history) > 10:
self.search_history.pop(0)
... | [
"def",
"OnSearch",
"(",
"self",
",",
"event",
")",
":",
"search_string",
"=",
"self",
".",
"search",
".",
"GetValue",
"(",
")",
"if",
"search_string",
"not",
"in",
"self",
".",
"search_history",
":",
"self",
".",
"search_history",
".",
"append",
"(",
"se... | Event handler for starting the search | [
"Event",
"handler",
"for",
"starting",
"the",
"search"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L450-L468 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | FindToolbar.OnSearchDirectionButton | def OnSearchDirectionButton(self, event):
"""Event handler for search direction toggle button"""
if "DOWN" in self.search_options:
flag_index = self.search_options.index("DOWN")
self.search_options[flag_index] = "UP"
elif "UP" in self.search_options:
flag_ind... | python | def OnSearchDirectionButton(self, event):
"""Event handler for search direction toggle button"""
if "DOWN" in self.search_options:
flag_index = self.search_options.index("DOWN")
self.search_options[flag_index] = "UP"
elif "UP" in self.search_options:
flag_ind... | [
"def",
"OnSearchDirectionButton",
"(",
"self",
",",
"event",
")",
":",
"if",
"\"DOWN\"",
"in",
"self",
".",
"search_options",
":",
"flag_index",
"=",
"self",
".",
"search_options",
".",
"index",
"(",
"\"DOWN\"",
")",
"self",
".",
"search_options",
"[",
"flag... | Event handler for search direction toggle button | [
"Event",
"handler",
"for",
"search",
"direction",
"toggle",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L470-L482 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | FindToolbar.OnSearchFlag | def OnSearchFlag(self, event):
"""Event handler for search flag toggle buttons"""
for label in self.search_options_buttons:
button_id = self.label2id[label]
if button_id == event.GetId():
if event.IsChecked():
self.search_options.append(label)... | python | def OnSearchFlag(self, event):
"""Event handler for search flag toggle buttons"""
for label in self.search_options_buttons:
button_id = self.label2id[label]
if button_id == event.GetId():
if event.IsChecked():
self.search_options.append(label)... | [
"def",
"OnSearchFlag",
"(",
"self",
",",
"event",
")",
":",
"for",
"label",
"in",
"self",
".",
"search_options_buttons",
":",
"button_id",
"=",
"self",
".",
"label2id",
"[",
"label",
"]",
"if",
"button_id",
"==",
"event",
".",
"GetId",
"(",
")",
":",
"... | Event handler for search flag toggle buttons | [
"Event",
"handler",
"for",
"search",
"flag",
"toggle",
"buttons"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L484-L496 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_font_choice_combo | def _create_font_choice_combo(self):
"""Creates font choice combo box"""
self.fonts = get_font_list()
self.font_choice_combo = \
_widgets.FontChoiceCombobox(self, choices=self.fonts,
style=wx.CB_READONLY, size=(125, -1))
self.font_cho... | python | def _create_font_choice_combo(self):
"""Creates font choice combo box"""
self.fonts = get_font_list()
self.font_choice_combo = \
_widgets.FontChoiceCombobox(self, choices=self.fonts,
style=wx.CB_READONLY, size=(125, -1))
self.font_cho... | [
"def",
"_create_font_choice_combo",
"(",
"self",
")",
":",
"self",
".",
"fonts",
"=",
"get_font_list",
"(",
")",
"self",
".",
"font_choice_combo",
"=",
"_widgets",
".",
"FontChoiceCombobox",
"(",
"self",
",",
"choices",
"=",
"self",
".",
"fonts",
",",
"style... | Creates font choice combo box | [
"Creates",
"font",
"choice",
"combo",
"box"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L561-L574 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_font_size_combo | def _create_font_size_combo(self):
"""Creates font size combo box"""
self.std_font_sizes = config["font_default_sizes"]
font_size = str(get_default_font().GetPointSize())
self.font_size_combo = \
wx.ComboBox(self, -1, value=font_size, size=(60, -1),
c... | python | def _create_font_size_combo(self):
"""Creates font size combo box"""
self.std_font_sizes = config["font_default_sizes"]
font_size = str(get_default_font().GetPointSize())
self.font_size_combo = \
wx.ComboBox(self, -1, value=font_size, size=(60, -1),
c... | [
"def",
"_create_font_size_combo",
"(",
"self",
")",
":",
"self",
".",
"std_font_sizes",
"=",
"config",
"[",
"\"font_default_sizes\"",
"]",
"font_size",
"=",
"str",
"(",
"get_default_font",
"(",
")",
".",
"GetPointSize",
"(",
")",
")",
"self",
".",
"font_size_c... | Creates font size combo box | [
"Creates",
"font",
"size",
"combo",
"box"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L576-L590 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_font_face_buttons | def _create_font_face_buttons(self):
"""Creates font face buttons"""
font_face_buttons = [
(wx.FONTFLAG_BOLD, "OnBold", "FormatTextBold", _("Bold")),
(wx.FONTFLAG_ITALIC, "OnItalics", "FormatTextItalic",
_("Italics")),
(wx.FONTFLAG_UNDERLINED, "OnUnderli... | python | def _create_font_face_buttons(self):
"""Creates font face buttons"""
font_face_buttons = [
(wx.FONTFLAG_BOLD, "OnBold", "FormatTextBold", _("Bold")),
(wx.FONTFLAG_ITALIC, "OnItalics", "FormatTextItalic",
_("Italics")),
(wx.FONTFLAG_UNDERLINED, "OnUnderli... | [
"def",
"_create_font_face_buttons",
"(",
"self",
")",
":",
"font_face_buttons",
"=",
"[",
"(",
"wx",
".",
"FONTFLAG_BOLD",
",",
"\"OnBold\"",
",",
"\"FormatTextBold\"",
",",
"_",
"(",
"\"Bold\"",
")",
")",
",",
"(",
"wx",
".",
"FONTFLAG_ITALIC",
",",
"\"OnIt... | Creates font face buttons | [
"Creates",
"font",
"face",
"buttons"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L592-L612 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_textrotation_button | def _create_textrotation_button(self):
"""Create text rotation toggle button"""
iconnames = ["TextRotate270", "TextRotate0", "TextRotate90",
"TextRotate180"]
bmplist = [icons[iconname] for iconname in iconnames]
self.rotation_tb = _widgets.BitmapToggleButton(self, ... | python | def _create_textrotation_button(self):
"""Create text rotation toggle button"""
iconnames = ["TextRotate270", "TextRotate0", "TextRotate90",
"TextRotate180"]
bmplist = [icons[iconname] for iconname in iconnames]
self.rotation_tb = _widgets.BitmapToggleButton(self, ... | [
"def",
"_create_textrotation_button",
"(",
"self",
")",
":",
"iconnames",
"=",
"[",
"\"TextRotate270\"",
",",
"\"TextRotate0\"",
",",
"\"TextRotate90\"",
",",
"\"TextRotate180\"",
"]",
"bmplist",
"=",
"[",
"icons",
"[",
"iconname",
"]",
"for",
"iconname",
"in",
... | Create text rotation toggle button | [
"Create",
"text",
"rotation",
"toggle",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L614-L624 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_justification_button | def _create_justification_button(self):
"""Creates horizontal justification button"""
iconnames = ["JustifyLeft", "JustifyCenter", "JustifyRight"]
bmplist = [icons[iconname] for iconname in iconnames]
self.justify_tb = _widgets.BitmapToggleButton(self, bmplist)
self.justify_tb.S... | python | def _create_justification_button(self):
"""Creates horizontal justification button"""
iconnames = ["JustifyLeft", "JustifyCenter", "JustifyRight"]
bmplist = [icons[iconname] for iconname in iconnames]
self.justify_tb = _widgets.BitmapToggleButton(self, bmplist)
self.justify_tb.S... | [
"def",
"_create_justification_button",
"(",
"self",
")",
":",
"iconnames",
"=",
"[",
"\"JustifyLeft\"",
",",
"\"JustifyCenter\"",
",",
"\"JustifyRight\"",
"]",
"bmplist",
"=",
"[",
"icons",
"[",
"iconname",
"]",
"for",
"iconname",
"in",
"iconnames",
"]",
"self",... | Creates horizontal justification button | [
"Creates",
"horizontal",
"justification",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L626-L634 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_alignment_button | def _create_alignment_button(self):
"""Creates vertical alignment button"""
iconnames = ["AlignTop", "AlignCenter", "AlignBottom"]
bmplist = [icons[iconname] for iconname in iconnames]
self.alignment_tb = _widgets.BitmapToggleButton(self, bmplist)
self.alignment_tb.SetToolTipSt... | python | def _create_alignment_button(self):
"""Creates vertical alignment button"""
iconnames = ["AlignTop", "AlignCenter", "AlignBottom"]
bmplist = [icons[iconname] for iconname in iconnames]
self.alignment_tb = _widgets.BitmapToggleButton(self, bmplist)
self.alignment_tb.SetToolTipSt... | [
"def",
"_create_alignment_button",
"(",
"self",
")",
":",
"iconnames",
"=",
"[",
"\"AlignTop\"",
",",
"\"AlignCenter\"",
",",
"\"AlignBottom\"",
"]",
"bmplist",
"=",
"[",
"icons",
"[",
"iconname",
"]",
"for",
"iconname",
"in",
"iconnames",
"]",
"self",
".",
... | Creates vertical alignment button | [
"Creates",
"vertical",
"alignment",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L636-L645 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_borderchoice_combo | def _create_borderchoice_combo(self):
"""Create border choice combo box"""
choices = [c[0] for c in self.border_toggles]
self.borderchoice_combo = \
_widgets.BorderEditChoice(self, choices=choices,
style=wx.CB_READONLY, size=(50, -1))
s... | python | def _create_borderchoice_combo(self):
"""Create border choice combo box"""
choices = [c[0] for c in self.border_toggles]
self.borderchoice_combo = \
_widgets.BorderEditChoice(self, choices=choices,
style=wx.CB_READONLY, size=(50, -1))
s... | [
"def",
"_create_borderchoice_combo",
"(",
"self",
")",
":",
"choices",
"=",
"[",
"c",
"[",
"0",
"]",
"for",
"c",
"in",
"self",
".",
"border_toggles",
"]",
"self",
".",
"borderchoice_combo",
"=",
"_widgets",
".",
"BorderEditChoice",
"(",
"self",
",",
"choic... | Create border choice combo box | [
"Create",
"border",
"choice",
"combo",
"box"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L647-L665 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_penwidth_combo | def _create_penwidth_combo(self):
"""Create pen width combo box"""
choices = map(unicode, xrange(12))
self.pen_width_combo = \
_widgets.PenWidthComboBox(self, choices=choices,
style=wx.CB_READONLY, size=(50, -1))
self.pen_width_combo.Se... | python | def _create_penwidth_combo(self):
"""Create pen width combo box"""
choices = map(unicode, xrange(12))
self.pen_width_combo = \
_widgets.PenWidthComboBox(self, choices=choices,
style=wx.CB_READONLY, size=(50, -1))
self.pen_width_combo.Se... | [
"def",
"_create_penwidth_combo",
"(",
"self",
")",
":",
"choices",
"=",
"map",
"(",
"unicode",
",",
"xrange",
"(",
"12",
")",
")",
"self",
".",
"pen_width_combo",
"=",
"_widgets",
".",
"PenWidthComboBox",
"(",
"self",
",",
"choices",
"=",
"choices",
",",
... | Create pen width combo box | [
"Create",
"pen",
"width",
"combo",
"box"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L667-L677 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_color_buttons | def _create_color_buttons(self):
"""Create color choice buttons"""
button_size = (30, 30)
button_style = wx.NO_BORDER
try:
self.linecolor_choice = \
csel.ColourSelect(self, -1, unichr(0x2500), (0, 0, 0),
size=button_size, st... | python | def _create_color_buttons(self):
"""Create color choice buttons"""
button_size = (30, 30)
button_style = wx.NO_BORDER
try:
self.linecolor_choice = \
csel.ColourSelect(self, -1, unichr(0x2500), (0, 0, 0),
size=button_size, st... | [
"def",
"_create_color_buttons",
"(",
"self",
")",
":",
"button_size",
"=",
"(",
"30",
",",
"30",
")",
"button_style",
"=",
"wx",
".",
"NO_BORDER",
"try",
":",
"self",
".",
"linecolor_choice",
"=",
"csel",
".",
"ColourSelect",
"(",
"self",
",",
"-",
"1",
... | Create color choice buttons | [
"Create",
"color",
"choice",
"buttons"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L679-L712 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._create_merge_button | def _create_merge_button(self):
"""Create merge button"""
bmp = icons["Merge"]
self.mergetool_id = wx.NewId()
self.AddCheckTool(self.mergetool_id, "Merge", bmp, bmp,
short_help_string=_("Merge cells"))
self.Bind(wx.EVT_TOOL, self.OnMerge, id=self.merget... | python | def _create_merge_button(self):
"""Create merge button"""
bmp = icons["Merge"]
self.mergetool_id = wx.NewId()
self.AddCheckTool(self.mergetool_id, "Merge", bmp, bmp,
short_help_string=_("Merge cells"))
self.Bind(wx.EVT_TOOL, self.OnMerge, id=self.merget... | [
"def",
"_create_merge_button",
"(",
"self",
")",
":",
"bmp",
"=",
"icons",
"[",
"\"Merge\"",
"]",
"self",
".",
"mergetool_id",
"=",
"wx",
".",
"NewId",
"(",
")",
"self",
".",
"AddCheckTool",
"(",
"self",
".",
"mergetool_id",
",",
"\"Merge\"",
",",
"bmp",... | Create merge button | [
"Create",
"merge",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L714-L721 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_font | def _update_font(self, textfont):
"""Updates text font widget
Parameters
----------
textfont: String
\tFont name
"""
try:
fontface_id = self.fonts.index(textfont)
except ValueError:
fontface_id = 0
self.font_choice_comb... | python | def _update_font(self, textfont):
"""Updates text font widget
Parameters
----------
textfont: String
\tFont name
"""
try:
fontface_id = self.fonts.index(textfont)
except ValueError:
fontface_id = 0
self.font_choice_comb... | [
"def",
"_update_font",
"(",
"self",
",",
"textfont",
")",
":",
"try",
":",
"fontface_id",
"=",
"self",
".",
"fonts",
".",
"index",
"(",
"textfont",
")",
"except",
"ValueError",
":",
"fontface_id",
"=",
"0",
"self",
".",
"font_choice_combo",
".",
"Select",
... | Updates text font widget
Parameters
----------
textfont: String
\tFont name | [
"Updates",
"text",
"font",
"widget"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L726-L742 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_font_weight | def _update_font_weight(self, font_weight):
"""Updates font weight widget
Parameters
----------
font_weight: Integer
\tButton down iif font_weight == wx.FONTWEIGHT_BOLD
"""
toggle_state = font_weight & wx.FONTWEIGHT_BOLD == wx.FONTWEIGHT_BOLD
self.Tog... | python | def _update_font_weight(self, font_weight):
"""Updates font weight widget
Parameters
----------
font_weight: Integer
\tButton down iif font_weight == wx.FONTWEIGHT_BOLD
"""
toggle_state = font_weight & wx.FONTWEIGHT_BOLD == wx.FONTWEIGHT_BOLD
self.Tog... | [
"def",
"_update_font_weight",
"(",
"self",
",",
"font_weight",
")",
":",
"toggle_state",
"=",
"font_weight",
"&",
"wx",
".",
"FONTWEIGHT_BOLD",
"==",
"wx",
".",
"FONTWEIGHT_BOLD",
"self",
".",
"ToggleTool",
"(",
"wx",
".",
"FONTFLAG_BOLD",
",",
"toggle_state",
... | Updates font weight widget
Parameters
----------
font_weight: Integer
\tButton down iif font_weight == wx.FONTWEIGHT_BOLD | [
"Updates",
"font",
"weight",
"widget"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L757-L770 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_font_style | def _update_font_style(self, font_style):
"""Updates font style widget
Parameters
----------
font_style: Integer
\tButton down iif font_style == wx.FONTSTYLE_ITALIC
"""
toggle_state = font_style & wx.FONTSTYLE_ITALIC == wx.FONTSTYLE_ITALIC
self.Toggle... | python | def _update_font_style(self, font_style):
"""Updates font style widget
Parameters
----------
font_style: Integer
\tButton down iif font_style == wx.FONTSTYLE_ITALIC
"""
toggle_state = font_style & wx.FONTSTYLE_ITALIC == wx.FONTSTYLE_ITALIC
self.Toggle... | [
"def",
"_update_font_style",
"(",
"self",
",",
"font_style",
")",
":",
"toggle_state",
"=",
"font_style",
"&",
"wx",
".",
"FONTSTYLE_ITALIC",
"==",
"wx",
".",
"FONTSTYLE_ITALIC",
"self",
".",
"ToggleTool",
"(",
"wx",
".",
"FONTFLAG_ITALIC",
",",
"toggle_state",
... | Updates font style widget
Parameters
----------
font_style: Integer
\tButton down iif font_style == wx.FONTSTYLE_ITALIC | [
"Updates",
"font",
"style",
"widget"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L772-L785 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_frozencell | def _update_frozencell(self, frozen):
"""Updates frozen cell widget
Parameters
----------
frozen: Bool or string
\tUntoggled iif False
"""
toggle_state = frozen is not False
self.ToggleTool(wx.FONTFLAG_MASK, toggle_state) | python | def _update_frozencell(self, frozen):
"""Updates frozen cell widget
Parameters
----------
frozen: Bool or string
\tUntoggled iif False
"""
toggle_state = frozen is not False
self.ToggleTool(wx.FONTFLAG_MASK, toggle_state) | [
"def",
"_update_frozencell",
"(",
"self",
",",
"frozen",
")",
":",
"toggle_state",
"=",
"frozen",
"is",
"not",
"False",
"self",
".",
"ToggleTool",
"(",
"wx",
".",
"FONTFLAG_MASK",
",",
"toggle_state",
")"
] | Updates frozen cell widget
Parameters
----------
frozen: Bool or string
\tUntoggled iif False | [
"Updates",
"frozen",
"cell",
"widget"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L787-L800 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_textrotation | def _update_textrotation(self, angle):
"""Updates text rotation toggle button"""
states = {0: 0, -90: 1, 180: 2, 90: 3}
try:
self.rotation_tb.state = states[round(angle)]
except KeyError:
self.rotation_tb.state = 0
self.rotation_tb.toggle(None)
... | python | def _update_textrotation(self, angle):
"""Updates text rotation toggle button"""
states = {0: 0, -90: 1, 180: 2, 90: 3}
try:
self.rotation_tb.state = states[round(angle)]
except KeyError:
self.rotation_tb.state = 0
self.rotation_tb.toggle(None)
... | [
"def",
"_update_textrotation",
"(",
"self",
",",
"angle",
")",
":",
"states",
"=",
"{",
"0",
":",
"0",
",",
"-",
"90",
":",
"1",
",",
"180",
":",
"2",
",",
"90",
":",
"3",
"}",
"try",
":",
"self",
".",
"rotation_tb",
".",
"state",
"=",
"states"... | Updates text rotation toggle button | [
"Updates",
"text",
"rotation",
"toggle",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L854-L865 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_justification | def _update_justification(self, justification):
"""Updates horizontal text justification button
Parameters
----------
justification: String in ["left", "center", "right"]
\tSwitches button to untoggled if False and toggled if True
"""
states = {"left": 2, "cen... | python | def _update_justification(self, justification):
"""Updates horizontal text justification button
Parameters
----------
justification: String in ["left", "center", "right"]
\tSwitches button to untoggled if False and toggled if True
"""
states = {"left": 2, "cen... | [
"def",
"_update_justification",
"(",
"self",
",",
"justification",
")",
":",
"states",
"=",
"{",
"\"left\"",
":",
"2",
",",
"\"center\"",
":",
"0",
",",
"\"right\"",
":",
"1",
"}",
"self",
".",
"justify_tb",
".",
"state",
"=",
"states",
"[",
"justificati... | Updates horizontal text justification button
Parameters
----------
justification: String in ["left", "center", "right"]
\tSwitches button to untoggled if False and toggled if True | [
"Updates",
"horizontal",
"text",
"justification",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L867-L883 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_alignment | def _update_alignment(self, alignment):
"""Updates vertical text alignment button
Parameters
----------
alignment: String in ["top", "middle", "right"]
\tSwitches button to untoggled if False and toggled if True
"""
states = {"top": 2, "middle": 0, "bottom": 1... | python | def _update_alignment(self, alignment):
"""Updates vertical text alignment button
Parameters
----------
alignment: String in ["top", "middle", "right"]
\tSwitches button to untoggled if False and toggled if True
"""
states = {"top": 2, "middle": 0, "bottom": 1... | [
"def",
"_update_alignment",
"(",
"self",
",",
"alignment",
")",
":",
"states",
"=",
"{",
"\"top\"",
":",
"2",
",",
"\"middle\"",
":",
"0",
",",
"\"bottom\"",
":",
"1",
"}",
"self",
".",
"alignment_tb",
".",
"state",
"=",
"states",
"[",
"alignment",
"]"... | Updates vertical text alignment button
Parameters
----------
alignment: String in ["top", "middle", "right"]
\tSwitches button to untoggled if False and toggled if True | [
"Updates",
"vertical",
"text",
"alignment",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L885-L901 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar._update_fontcolor | def _update_fontcolor(self, fontcolor):
"""Updates text font color button
Parameters
----------
fontcolor: Integer
\tText color in integer RGB format
"""
textcolor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
textcolor.SetRGB(fontcolor)
... | python | def _update_fontcolor(self, fontcolor):
"""Updates text font color button
Parameters
----------
fontcolor: Integer
\tText color in integer RGB format
"""
textcolor = wx.SystemSettings_GetColour(wx.SYS_COLOUR_WINDOWTEXT)
textcolor.SetRGB(fontcolor)
... | [
"def",
"_update_fontcolor",
"(",
"self",
",",
"fontcolor",
")",
":",
"textcolor",
"=",
"wx",
".",
"SystemSettings_GetColour",
"(",
"wx",
".",
"SYS_COLOUR_WINDOWTEXT",
")",
"textcolor",
".",
"SetRGB",
"(",
"fontcolor",
")",
"self",
".",
"textcolor_choice",
".",
... | Updates text font color button
Parameters
----------
fontcolor: Integer
\tText color in integer RGB format | [
"Updates",
"text",
"font",
"color",
"button"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L903-L917 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar.OnBorderChoice | def OnBorderChoice(self, event):
"""Change the borders that are affected by color and width changes"""
choicelist = event.GetEventObject().GetItems()
self.borderstate = choicelist[event.GetInt()] | python | def OnBorderChoice(self, event):
"""Change the borders that are affected by color and width changes"""
choicelist = event.GetEventObject().GetItems()
self.borderstate = choicelist[event.GetInt()] | [
"def",
"OnBorderChoice",
"(",
"self",
",",
"event",
")",
":",
"choicelist",
"=",
"event",
".",
"GetEventObject",
"(",
")",
".",
"GetItems",
"(",
")",
"self",
".",
"borderstate",
"=",
"choicelist",
"[",
"event",
".",
"GetInt",
"(",
")",
"]"
] | Change the borders that are affected by color and width changes | [
"Change",
"the",
"borders",
"that",
"are",
"affected",
"by",
"color",
"and",
"width",
"changes"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L975-L979 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar.OnLineColor | def OnLineColor(self, event):
"""Line color choice event handler"""
color = event.GetValue().GetRGB()
borders = self.bordermap[self.borderstate]
post_command_event(self, self.BorderColorMsg, color=color,
borders=borders) | python | def OnLineColor(self, event):
"""Line color choice event handler"""
color = event.GetValue().GetRGB()
borders = self.bordermap[self.borderstate]
post_command_event(self, self.BorderColorMsg, color=color,
borders=borders) | [
"def",
"OnLineColor",
"(",
"self",
",",
"event",
")",
":",
"color",
"=",
"event",
".",
"GetValue",
"(",
")",
".",
"GetRGB",
"(",
")",
"borders",
"=",
"self",
".",
"bordermap",
"[",
"self",
".",
"borderstate",
"]",
"post_command_event",
"(",
"self",
","... | Line color choice event handler | [
"Line",
"color",
"choice",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L981-L988 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar.OnLineWidth | def OnLineWidth(self, event):
"""Line width choice event handler"""
linewidth_combobox = event.GetEventObject()
idx = event.GetInt()
width = int(linewidth_combobox.GetString(idx))
borders = self.bordermap[self.borderstate]
post_command_event(self, self.BorderWidthMsg, w... | python | def OnLineWidth(self, event):
"""Line width choice event handler"""
linewidth_combobox = event.GetEventObject()
idx = event.GetInt()
width = int(linewidth_combobox.GetString(idx))
borders = self.bordermap[self.borderstate]
post_command_event(self, self.BorderWidthMsg, w... | [
"def",
"OnLineWidth",
"(",
"self",
",",
"event",
")",
":",
"linewidth_combobox",
"=",
"event",
".",
"GetEventObject",
"(",
")",
"idx",
"=",
"event",
".",
"GetInt",
"(",
")",
"width",
"=",
"int",
"(",
"linewidth_combobox",
".",
"GetString",
"(",
"idx",
")... | Line width choice event handler | [
"Line",
"width",
"choice",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L990-L999 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar.OnBGColor | def OnBGColor(self, event):
"""Background color choice event handler"""
color = event.GetValue().GetRGB()
post_command_event(self, self.BackgroundColorMsg, color=color) | python | def OnBGColor(self, event):
"""Background color choice event handler"""
color = event.GetValue().GetRGB()
post_command_event(self, self.BackgroundColorMsg, color=color) | [
"def",
"OnBGColor",
"(",
"self",
",",
"event",
")",
":",
"color",
"=",
"event",
".",
"GetValue",
"(",
")",
".",
"GetRGB",
"(",
")",
"post_command_event",
"(",
"self",
",",
"self",
".",
"BackgroundColorMsg",
",",
"color",
"=",
"color",
")"
] | Background color choice event handler | [
"Background",
"color",
"choice",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L1001-L1006 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar.OnTextColor | def OnTextColor(self, event):
"""Text color choice event handler"""
color = event.GetValue().GetRGB()
post_command_event(self, self.TextColorMsg, color=color) | python | def OnTextColor(self, event):
"""Text color choice event handler"""
color = event.GetValue().GetRGB()
post_command_event(self, self.TextColorMsg, color=color) | [
"def",
"OnTextColor",
"(",
"self",
",",
"event",
")",
":",
"color",
"=",
"event",
".",
"GetValue",
"(",
")",
".",
"GetRGB",
"(",
")",
"post_command_event",
"(",
"self",
",",
"self",
".",
"TextColorMsg",
",",
"color",
"=",
"color",
")"
] | Text color choice event handler | [
"Text",
"color",
"choice",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L1008-L1013 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar.OnTextFont | def OnTextFont(self, event):
"""Text font choice event handler"""
fontchoice_combobox = event.GetEventObject()
idx = event.GetInt()
try:
font_string = fontchoice_combobox.GetString(idx)
except AttributeError:
font_string = event.GetString()
post... | python | def OnTextFont(self, event):
"""Text font choice event handler"""
fontchoice_combobox = event.GetEventObject()
idx = event.GetInt()
try:
font_string = fontchoice_combobox.GetString(idx)
except AttributeError:
font_string = event.GetString()
post... | [
"def",
"OnTextFont",
"(",
"self",
",",
"event",
")",
":",
"fontchoice_combobox",
"=",
"event",
".",
"GetEventObject",
"(",
")",
"idx",
"=",
"event",
".",
"GetInt",
"(",
")",
"try",
":",
"font_string",
"=",
"fontchoice_combobox",
".",
"GetString",
"(",
"idx... | Text font choice event handler | [
"Text",
"font",
"choice",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L1015-L1026 | train |
manns/pyspread | pyspread/src/gui/_toolbars.py | AttributesToolbar.OnTextSize | def OnTextSize(self, event):
"""Text size combo text event handler"""
try:
size = int(event.GetString())
except Exception:
size = get_default_font().GetPointSize()
post_command_event(self, self.FontSizeMsg, size=size) | python | def OnTextSize(self, event):
"""Text size combo text event handler"""
try:
size = int(event.GetString())
except Exception:
size = get_default_font().GetPointSize()
post_command_event(self, self.FontSizeMsg, size=size) | [
"def",
"OnTextSize",
"(",
"self",
",",
"event",
")",
":",
"try",
":",
"size",
"=",
"int",
"(",
"event",
".",
"GetString",
"(",
")",
")",
"except",
"Exception",
":",
"size",
"=",
"get_default_font",
"(",
")",
".",
"GetPointSize",
"(",
")",
"post_command... | Text size combo text event handler | [
"Text",
"size",
"combo",
"text",
"event",
"handler"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/gui/_toolbars.py#L1028-L1037 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.set_code | def set_code(self, key, code):
"""Sets code of cell key, marks grid as changed"""
old_code = self.grid.code_array(key)
try:
old_code = unicode(old_code, encoding="utf-8")
except TypeError:
pass
if code == old_code:
return
if not (o... | python | def set_code(self, key, code):
"""Sets code of cell key, marks grid as changed"""
old_code = self.grid.code_array(key)
try:
old_code = unicode(old_code, encoding="utf-8")
except TypeError:
pass
if code == old_code:
return
if not (o... | [
"def",
"set_code",
"(",
"self",
",",
"key",
",",
"code",
")",
":",
"old_code",
"=",
"self",
".",
"grid",
".",
"code_array",
"(",
"key",
")",
"try",
":",
"old_code",
"=",
"unicode",
"(",
"old_code",
",",
"encoding",
"=",
"\"utf-8\"",
")",
"except",
"T... | Sets code of cell key, marks grid as changed | [
"Sets",
"code",
"of",
"cell",
"key",
"marks",
"grid",
"as",
"changed"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L50-L69 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.quote_code | def quote_code(self, key):
"""Returns string quoted code """
code = self.grid.code_array(key)
quoted_code = quote(code)
if quoted_code is not None:
self.set_code(key, quoted_code) | python | def quote_code(self, key):
"""Returns string quoted code """
code = self.grid.code_array(key)
quoted_code = quote(code)
if quoted_code is not None:
self.set_code(key, quoted_code) | [
"def",
"quote_code",
"(",
"self",
",",
"key",
")",
":",
"code",
"=",
"self",
".",
"grid",
".",
"code_array",
"(",
"key",
")",
"quoted_code",
"=",
"quote",
"(",
"code",
")",
"if",
"quoted_code",
"is",
"not",
"None",
":",
"self",
".",
"set_code",
"(",
... | Returns string quoted code | [
"Returns",
"string",
"quoted",
"code"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L71-L78 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.delete_cell | def delete_cell(self, key):
"""Deletes key cell"""
try:
self.code_array.pop(key)
except KeyError:
pass
self.grid.code_array.result_cache.clear() | python | def delete_cell(self, key):
"""Deletes key cell"""
try:
self.code_array.pop(key)
except KeyError:
pass
self.grid.code_array.result_cache.clear() | [
"def",
"delete_cell",
"(",
"self",
",",
"key",
")",
":",
"try",
":",
"self",
".",
"code_array",
".",
"pop",
"(",
"key",
")",
"except",
"KeyError",
":",
"pass",
"self",
".",
"grid",
".",
"code_array",
".",
"result_cache",
".",
"clear",
"(",
")"
] | Deletes key cell | [
"Deletes",
"key",
"cell"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L80-L89 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.append_reference_code | def append_reference_code(self, key, ref_key, ref_type="absolute"):
"""Appends reference code to cell code.
Replaces existing reference.
Parameters
----------
key: 3-tuple of Integer
\tKey of cell that gets the reference
ref_key: 3-tuple of Integer
\tKey... | python | def append_reference_code(self, key, ref_key, ref_type="absolute"):
"""Appends reference code to cell code.
Replaces existing reference.
Parameters
----------
key: 3-tuple of Integer
\tKey of cell that gets the reference
ref_key: 3-tuple of Integer
\tKey... | [
"def",
"append_reference_code",
"(",
"self",
",",
"key",
",",
"ref_key",
",",
"ref_type",
"=",
"\"absolute\"",
")",
":",
"if",
"ref_type",
"==",
"\"absolute\"",
":",
"code",
"=",
"self",
".",
"_get_absolute_reference",
"(",
"ref_key",
")",
"elif",
"ref_type",
... | Appends reference code to cell code.
Replaces existing reference.
Parameters
----------
key: 3-tuple of Integer
\tKey of cell that gets the reference
ref_key: 3-tuple of Integer
\tKey of cell that is referenced
ref_type: Sting in ["absolute", "relative"]... | [
"Appends",
"reference",
"code",
"to",
"cell",
"code",
"."
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L145-L184 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions._set_cell_attr | def _set_cell_attr(self, selection, table, attr):
"""Sets cell attr for key cell and mark grid content as changed
Parameters
----------
attr: dict
\tContains cell attribute keys
\tkeys in ["borderwidth_bottom", "borderwidth_right",
\t"bordercolor_bottom", "borde... | python | def _set_cell_attr(self, selection, table, attr):
"""Sets cell attr for key cell and mark grid content as changed
Parameters
----------
attr: dict
\tContains cell attribute keys
\tkeys in ["borderwidth_bottom", "borderwidth_right",
\t"bordercolor_bottom", "borde... | [
"def",
"_set_cell_attr",
"(",
"self",
",",
"selection",
",",
"table",
",",
"attr",
")",
":",
"post_command_event",
"(",
"self",
".",
"main_window",
",",
"self",
".",
"ContentChangedMsg",
")",
"if",
"selection",
"is",
"not",
"None",
":",
"self",
".",
"code_... | Sets cell attr for key cell and mark grid content as changed
Parameters
----------
attr: dict
\tContains cell attribute keys
\tkeys in ["borderwidth_bottom", "borderwidth_right",
\t"bordercolor_bottom", "bordercolor_right",
\t"bgcolor", "textfont",
\t"po... | [
"Sets",
"cell",
"attr",
"for",
"key",
"cell",
"and",
"mark",
"grid",
"content",
"as",
"changed"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L186-L207 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.set_attr | def set_attr(self, attr, value, selection=None):
"""Sets attr of current selection to value"""
if selection is None:
selection = self.grid.selection
if not selection:
# Add current cell to selection so that it gets changed
selection.cells.append(self.grid.ac... | python | def set_attr(self, attr, value, selection=None):
"""Sets attr of current selection to value"""
if selection is None:
selection = self.grid.selection
if not selection:
# Add current cell to selection so that it gets changed
selection.cells.append(self.grid.ac... | [
"def",
"set_attr",
"(",
"self",
",",
"attr",
",",
"value",
",",
"selection",
"=",
"None",
")",
":",
"if",
"selection",
"is",
"None",
":",
"selection",
"=",
"self",
".",
"grid",
".",
"selection",
"if",
"not",
"selection",
":",
"selection",
".",
"cells",... | Sets attr of current selection to value | [
"Sets",
"attr",
"of",
"current",
"selection",
"to",
"value"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L209-L224 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.set_border_attr | def set_border_attr(self, attr, value, borders):
"""Sets border attribute by adjusting selection to borders
Parameters
----------
attr: String in ["borderwidth", "bordercolor"]
\tBorder attribute that shall be changed
value: wx.Colour or Integer
\tAttribute value... | python | def set_border_attr(self, attr, value, borders):
"""Sets border attribute by adjusting selection to borders
Parameters
----------
attr: String in ["borderwidth", "bordercolor"]
\tBorder attribute that shall be changed
value: wx.Colour or Integer
\tAttribute value... | [
"def",
"set_border_attr",
"(",
"self",
",",
"attr",
",",
"value",
",",
"borders",
")",
":",
"selection",
"=",
"self",
".",
"grid",
".",
"selection",
"if",
"not",
"selection",
":",
"selection",
".",
"cells",
".",
"append",
"(",
"self",
".",
"grid",
".",... | Sets border attribute by adjusting selection to borders
Parameters
----------
attr: String in ["borderwidth", "bordercolor"]
\tBorder attribute that shall be changed
value: wx.Colour or Integer
\tAttribute value dependent on attribute type
borders: Iterable over ... | [
"Sets",
"border",
"attribute",
"by",
"adjusting",
"selection",
"to",
"borders"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L226-L286 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.toggle_attr | def toggle_attr(self, attr):
"""Toggles an attribute attr for current selection"""
selection = self.grid.selection
# Selection or single cell access?
if selection:
value = self.get_new_selection_attr_state(selection, attr)
else:
value = self.get_new_ce... | python | def toggle_attr(self, attr):
"""Toggles an attribute attr for current selection"""
selection = self.grid.selection
# Selection or single cell access?
if selection:
value = self.get_new_selection_attr_state(selection, attr)
else:
value = self.get_new_ce... | [
"def",
"toggle_attr",
"(",
"self",
",",
"attr",
")",
":",
"selection",
"=",
"self",
".",
"grid",
".",
"selection",
"if",
"selection",
":",
"value",
"=",
"self",
".",
"get_new_selection_attr_state",
"(",
"selection",
",",
"attr",
")",
"else",
":",
"value",
... | Toggles an attribute attr for current selection | [
"Toggles",
"an",
"attribute",
"attr",
"for",
"current",
"selection"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L288-L304 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.change_frozen_attr | def change_frozen_attr(self):
"""Changes frozen state of cell if there is no selection"""
# Selections are not supported
if self.grid.selection:
statustext = _("Freezing selections is not supported.")
post_command_event(self.main_window, self.StatusBarMsg,
... | python | def change_frozen_attr(self):
"""Changes frozen state of cell if there is no selection"""
# Selections are not supported
if self.grid.selection:
statustext = _("Freezing selections is not supported.")
post_command_event(self.main_window, self.StatusBarMsg,
... | [
"def",
"change_frozen_attr",
"(",
"self",
")",
":",
"if",
"self",
".",
"grid",
".",
"selection",
":",
"statustext",
"=",
"_",
"(",
"\"Freezing selections is not supported.\"",
")",
"post_command_event",
"(",
"self",
".",
"main_window",
",",
"self",
".",
"StatusB... | Changes frozen state of cell if there is no selection | [
"Changes",
"frozen",
"state",
"of",
"cell",
"if",
"there",
"is",
"no",
"selection"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L308-L337 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.unmerge | def unmerge(self, unmerge_area, tab):
"""Unmerges all cells in unmerge_area"""
top, left, bottom, right = unmerge_area
selection = Selection([(top, left)], [(bottom, right)], [], [], [])
attr = {"merge_area": None, "locked": False}
self._set_cell_attr(selection, tab, attr) | python | def unmerge(self, unmerge_area, tab):
"""Unmerges all cells in unmerge_area"""
top, left, bottom, right = unmerge_area
selection = Selection([(top, left)], [(bottom, right)], [], [], [])
attr = {"merge_area": None, "locked": False}
self._set_cell_attr(selection, tab, attr) | [
"def",
"unmerge",
"(",
"self",
",",
"unmerge_area",
",",
"tab",
")",
":",
"top",
",",
"left",
",",
"bottom",
",",
"right",
"=",
"unmerge_area",
"selection",
"=",
"Selection",
"(",
"[",
"(",
"top",
",",
"left",
")",
"]",
",",
"[",
"(",
"bottom",
","... | Unmerges all cells in unmerge_area | [
"Unmerges",
"all",
"cells",
"in",
"unmerge_area"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L339-L346 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.merge | def merge(self, merge_area, tab):
"""Merges top left cell with all cells until bottom_right"""
top, left, bottom, right = merge_area
cursor = self.grid.actions.cursor
top_left_code = self.code_array((top, left, cursor[2]))
selection = Selection([(top, left)], [(bottom, right)]... | python | def merge(self, merge_area, tab):
"""Merges top left cell with all cells until bottom_right"""
top, left, bottom, right = merge_area
cursor = self.grid.actions.cursor
top_left_code = self.code_array((top, left, cursor[2]))
selection = Selection([(top, left)], [(bottom, right)]... | [
"def",
"merge",
"(",
"self",
",",
"merge_area",
",",
"tab",
")",
":",
"top",
",",
"left",
",",
"bottom",
",",
"right",
"=",
"merge_area",
"cursor",
"=",
"self",
".",
"grid",
".",
"actions",
".",
"cursor",
"top_left_code",
"=",
"self",
".",
"code_array"... | Merges top left cell with all cells until bottom_right | [
"Merges",
"top",
"left",
"cell",
"with",
"all",
"cells",
"until",
"bottom_right"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L348-L380 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.merge_selected_cells | def merge_selected_cells(self, selection):
"""Merges or unmerges cells that are in the selection bounding box
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
"""
tab = self.grid.current_table
# Get ... | python | def merge_selected_cells(self, selection):
"""Merges or unmerges cells that are in the selection bounding box
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
"""
tab = self.grid.current_table
# Get ... | [
"def",
"merge_selected_cells",
"(",
"self",
",",
"selection",
")",
":",
"tab",
"=",
"self",
".",
"grid",
".",
"current_table",
"bbox",
"=",
"selection",
".",
"get_bbox",
"(",
")",
"if",
"bbox",
"is",
"None",
":",
"row",
",",
"col",
",",
"tab",
"=",
"... | Merges or unmerges cells that are in the selection bounding box
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned | [
"Merges",
"or",
"unmerges",
"cells",
"that",
"are",
"in",
"the",
"selection",
"bounding",
"box"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L382-L410 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.get_new_cell_attr_state | def get_new_cell_attr_state(self, key, attr_key):
"""Returns new attr cell state for toggles
Parameters
----------
key: 3-Tuple
\tCell for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key
"""
cell_attributes = self.grid.cod... | python | def get_new_cell_attr_state(self, key, attr_key):
"""Returns new attr cell state for toggles
Parameters
----------
key: 3-Tuple
\tCell for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key
"""
cell_attributes = self.grid.cod... | [
"def",
"get_new_cell_attr_state",
"(",
"self",
",",
"key",
",",
"attr_key",
")",
":",
"cell_attributes",
"=",
"self",
".",
"grid",
".",
"code_array",
".",
"cell_attributes",
"attr_values",
"=",
"self",
".",
"attr_toggle_values",
"[",
"attr_key",
"]",
"attr_map",... | Returns new attr cell state for toggles
Parameters
----------
key: 3-Tuple
\tCell for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key | [
"Returns",
"new",
"attr",
"cell",
"state",
"for",
"toggles"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L425-L445 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.get_new_selection_attr_state | def get_new_selection_attr_state(self, selection, attr_key):
"""Toggles new attr selection state and returns it
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key
"""
... | python | def get_new_selection_attr_state(self, selection, attr_key):
"""Toggles new attr selection state and returns it
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key
"""
... | [
"def",
"get_new_selection_attr_state",
"(",
"self",
",",
"selection",
",",
"attr_key",
")",
":",
"cell_attributes",
"=",
"self",
".",
"grid",
".",
"code_array",
".",
"cell_attributes",
"attr_values",
"=",
"self",
".",
"attr_toggle_values",
"[",
"attr_key",
"]",
... | Toggles new attr selection state and returns it
Parameters
----------
selection: Selection object
\tSelection for which attr toggle shall be returned
attr_key: Hashable
\tAttribute key | [
"Toggles",
"new",
"attr",
"selection",
"state",
"and",
"returns",
"it"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L447-L477 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.refresh_frozen_cell | def refresh_frozen_cell(self, key):
"""Refreshes a frozen cell"""
code = self.grid.code_array(key)
result = self.grid.code_array._eval_cell(key, code)
self.grid.code_array.frozen_cache[repr(key)] = result | python | def refresh_frozen_cell(self, key):
"""Refreshes a frozen cell"""
code = self.grid.code_array(key)
result = self.grid.code_array._eval_cell(key, code)
self.grid.code_array.frozen_cache[repr(key)] = result | [
"def",
"refresh_frozen_cell",
"(",
"self",
",",
"key",
")",
":",
"code",
"=",
"self",
".",
"grid",
".",
"code_array",
"(",
"key",
")",
"result",
"=",
"self",
".",
"grid",
".",
"code_array",
".",
"_eval_cell",
"(",
"key",
",",
"code",
")",
"self",
"."... | Refreshes a frozen cell | [
"Refreshes",
"a",
"frozen",
"cell"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L479-L484 | train |
manns/pyspread | pyspread/src/actions/_grid_cell_actions.py | CellActions.refresh_selected_frozen_cells | def refresh_selected_frozen_cells(self, selection=None):
"""Refreshes content of frozen cells that are currently selected
If there is no selection, the cell at the cursor is updated.
Parameters
----------
selection: Selection, defaults to None
\tIf not None then use thi... | python | def refresh_selected_frozen_cells(self, selection=None):
"""Refreshes content of frozen cells that are currently selected
If there is no selection, the cell at the cursor is updated.
Parameters
----------
selection: Selection, defaults to None
\tIf not None then use thi... | [
"def",
"refresh_selected_frozen_cells",
"(",
"self",
",",
"selection",
"=",
"None",
")",
":",
"if",
"selection",
"is",
"None",
":",
"selection",
"=",
"self",
".",
"grid",
".",
"selection",
"if",
"not",
"selection",
":",
"selection",
".",
"cells",
".",
"app... | Refreshes content of frozen cells that are currently selected
If there is no selection, the cell at the cursor is updated.
Parameters
----------
selection: Selection, defaults to None
\tIf not None then use this selection instead of the grid selection | [
"Refreshes",
"content",
"of",
"frozen",
"cells",
"that",
"are",
"currently",
"selected"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_grid_cell_actions.py#L486-L523 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ExchangeActions._import_csv | def _import_csv(self, path):
"""CSV import workflow"""
# If path is not set, do nothing
if not path:
return
# Get csv info
try:
dialect, has_header, digest_types, encoding = \
self.main_window.interfaces.get_csv_import_info(path)
... | python | def _import_csv(self, path):
"""CSV import workflow"""
# If path is not set, do nothing
if not path:
return
# Get csv info
try:
dialect, has_header, digest_types, encoding = \
self.main_window.interfaces.get_csv_import_info(path)
... | [
"def",
"_import_csv",
"(",
"self",
",",
"path",
")",
":",
"if",
"not",
"path",
":",
"return",
"try",
":",
"dialect",
",",
"has_header",
",",
"digest_types",
",",
"encoding",
"=",
"self",
".",
"main_window",
".",
"interfaces",
".",
"get_csv_import_info",
"(... | CSV import workflow | [
"CSV",
"import",
"workflow"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L88-L110 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ExchangeActions.import_file | def import_file(self, filepath, filterindex):
"""Imports external file
Parameters
----------
filepath: String
\tPath of import file
filterindex: Integer
\tIndex for type of file, 0: csv, 1: tab-delimited text file
"""
# Mark content as changed
... | python | def import_file(self, filepath, filterindex):
"""Imports external file
Parameters
----------
filepath: String
\tPath of import file
filterindex: Integer
\tIndex for type of file, 0: csv, 1: tab-delimited text file
"""
# Mark content as changed
... | [
"def",
"import_file",
"(",
"self",
",",
"filepath",
",",
"filterindex",
")",
":",
"post_command_event",
"(",
"self",
".",
"main_window",
",",
"self",
".",
"ContentChangedMsg",
")",
"if",
"filterindex",
"==",
"0",
":",
"return",
"self",
".",
"_import_csv",
"(... | Imports external file
Parameters
----------
filepath: String
\tPath of import file
filterindex: Integer
\tIndex for type of file, 0: csv, 1: tab-delimited text file | [
"Imports",
"external",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L117-L144 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ExchangeActions._export_csv | def _export_csv(self, filepath, data, preview_data):
"""CSV export of code_array results
Parameters
----------
filepath: String
\tPath of export file
data: Object
\tCode array result object slice, i. e. one object or iterable of
\tsuch objects
""... | python | def _export_csv(self, filepath, data, preview_data):
"""CSV export of code_array results
Parameters
----------
filepath: String
\tPath of export file
data: Object
\tCode array result object slice, i. e. one object or iterable of
\tsuch objects
""... | [
"def",
"_export_csv",
"(",
"self",
",",
"filepath",
",",
"data",
",",
"preview_data",
")",
":",
"csv_info",
"=",
"self",
".",
"main_window",
".",
"interfaces",
".",
"get_csv_export_info",
"(",
"preview_data",
")",
"if",
"csv_info",
"is",
"None",
":",
"return... | CSV export of code_array results
Parameters
----------
filepath: String
\tPath of export file
data: Object
\tCode array result object slice, i. e. one object or iterable of
\tsuch objects | [
"CSV",
"export",
"of",
"code_array",
"results"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L146-L185 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ExchangeActions._export_figure | def _export_figure(self, filepath, data, format):
"""Export of single cell that contains a matplotlib figure
Parameters
----------
filepath: String
\tPath of export file
data: Matplotlib Figure
\tMatplotlib figure that is eported
format: String in ["png",... | python | def _export_figure(self, filepath, data, format):
"""Export of single cell that contains a matplotlib figure
Parameters
----------
filepath: String
\tPath of export file
data: Matplotlib Figure
\tMatplotlib figure that is eported
format: String in ["png",... | [
"def",
"_export_figure",
"(",
"self",
",",
"filepath",
",",
"data",
",",
"format",
")",
":",
"formats",
"=",
"[",
"\"svg\"",
",",
"\"eps\"",
",",
"\"ps\"",
",",
"\"pdf\"",
",",
"\"png\"",
"]",
"assert",
"format",
"in",
"formats",
"data",
"=",
"fig2x",
... | Export of single cell that contains a matplotlib figure
Parameters
----------
filepath: String
\tPath of export file
data: Matplotlib Figure
\tMatplotlib figure that is eported
format: String in ["png", "pdf", "ps", "eps", "svg"] | [
"Export",
"of",
"single",
"cell",
"that",
"contains",
"a",
"matplotlib",
"figure"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L187-L217 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ExchangeActions.export_file | def export_file(self, filepath, __filter, data, preview_data=None):
"""Export data for other applications
Parameters
----------
filepath: String
\tPath of export file
__filter: String
\tImport filter
data: Object
\tCode array result object slice, ... | python | def export_file(self, filepath, __filter, data, preview_data=None):
"""Export data for other applications
Parameters
----------
filepath: String
\tPath of export file
__filter: String
\tImport filter
data: Object
\tCode array result object slice, ... | [
"def",
"export_file",
"(",
"self",
",",
"filepath",
",",
"__filter",
",",
"data",
",",
"preview_data",
"=",
"None",
")",
":",
"if",
"__filter",
".",
"startswith",
"(",
"\"cell_\"",
")",
":",
"self",
".",
"_export_figure",
"(",
"filepath",
",",
"data",
",... | Export data for other applications
Parameters
----------
filepath: String
\tPath of export file
__filter: String
\tImport filter
data: Object
\tCode array result object slice, i. e. one object or iterable of
\tsuch objects | [
"Export",
"data",
"for",
"other",
"applications"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L219-L241 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ExchangeActions.get_print_rect | def get_print_rect(self, grid_rect):
"""Returns wx.Rect that is correctly positioned on the print canvas"""
grid = self.grid
rect_x = grid_rect.x - \
grid.GetScrollPos(wx.HORIZONTAL) * grid.GetScrollLineX()
rect_y = grid_rect.y - \
grid.GetScrollPos(wx.VERTICAL)... | python | def get_print_rect(self, grid_rect):
"""Returns wx.Rect that is correctly positioned on the print canvas"""
grid = self.grid
rect_x = grid_rect.x - \
grid.GetScrollPos(wx.HORIZONTAL) * grid.GetScrollLineX()
rect_y = grid_rect.y - \
grid.GetScrollPos(wx.VERTICAL)... | [
"def",
"get_print_rect",
"(",
"self",
",",
"grid_rect",
")",
":",
"grid",
"=",
"self",
".",
"grid",
"rect_x",
"=",
"grid_rect",
".",
"x",
"-",
"grid",
".",
"GetScrollPos",
"(",
"wx",
".",
"HORIZONTAL",
")",
"*",
"grid",
".",
"GetScrollLineX",
"(",
")",... | Returns wx.Rect that is correctly positioned on the print canvas | [
"Returns",
"wx",
".",
"Rect",
"that",
"is",
"correctly",
"positioned",
"on",
"the",
"print",
"canvas"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L243-L253 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ExchangeActions.export_cairo | def export_cairo(self, filepath, filetype):
"""Exports grid to the PDF file filepath
Parameters
----------
filepath: String
\tPath of file to export
filetype in ["pdf", "svg"]
\tType of file to export
"""
if cairo is None:
return
... | python | def export_cairo(self, filepath, filetype):
"""Exports grid to the PDF file filepath
Parameters
----------
filepath: String
\tPath of file to export
filetype in ["pdf", "svg"]
\tType of file to export
"""
if cairo is None:
return
... | [
"def",
"export_cairo",
"(",
"self",
",",
"filepath",
",",
"filetype",
")",
":",
"if",
"cairo",
"is",
"None",
":",
"return",
"export_info",
"=",
"self",
".",
"main_window",
".",
"interfaces",
".",
"get_cairo_export_info",
"(",
"filetype",
")",
"if",
"export_i... | Exports grid to the PDF file filepath
Parameters
----------
filepath: String
\tPath of file to export
filetype in ["pdf", "svg"]
\tType of file to export | [
"Exports",
"grid",
"to",
"the",
"PDF",
"file",
"filepath"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L255-L319 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | PrintActions.print_preview | def print_preview(self, print_area, print_data):
"""Launch print preview"""
if cairo is None:
return
print_info = \
self.main_window.interfaces.get_cairo_export_info("Print")
if print_info is None:
# Dialog has been canceled
return
... | python | def print_preview(self, print_area, print_data):
"""Launch print preview"""
if cairo is None:
return
print_info = \
self.main_window.interfaces.get_cairo_export_info("Print")
if print_info is None:
# Dialog has been canceled
return
... | [
"def",
"print_preview",
"(",
"self",
",",
"print_area",
",",
"print_data",
")",
":",
"if",
"cairo",
"is",
"None",
":",
"return",
"print_info",
"=",
"self",
".",
"main_window",
".",
"interfaces",
".",
"get_cairo_export_info",
"(",
"\"Print\"",
")",
"if",
"pri... | Launch print preview | [
"Launch",
"print",
"preview"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L325-L353 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | PrintActions.printout | def printout(self, print_area, print_data):
"""Print out print area
See:
http://aspn.activestate.com/ASPN/Mail/Message/wxpython-users/3471083
"""
print_info = \
self.main_window.interfaces.get_cairo_export_info("Print")
if print_info is None:
#... | python | def printout(self, print_area, print_data):
"""Print out print area
See:
http://aspn.activestate.com/ASPN/Mail/Message/wxpython-users/3471083
"""
print_info = \
self.main_window.interfaces.get_cairo_export_info("Print")
if print_info is None:
#... | [
"def",
"printout",
"(",
"self",
",",
"print_area",
",",
"print_data",
")",
":",
"print_info",
"=",
"self",
".",
"main_window",
".",
"interfaces",
".",
"get_cairo_export_info",
"(",
"\"Print\"",
")",
"if",
"print_info",
"is",
"None",
":",
"return",
"pdd",
"="... | Print out print area
See:
http://aspn.activestate.com/ASPN/Mail/Message/wxpython-users/3471083 | [
"Print",
"out",
"print",
"area"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L355-L379 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ClipboardActions.copy | def copy(self, selection, getter=None, delete=False):
"""Returns code from selection in a tab separated string
Cells that are not in selection are included as empty.
Parameters
----------
selection: Selection object
\tSelection of cells in current table that shall be c... | python | def copy(self, selection, getter=None, delete=False):
"""Returns code from selection in a tab separated string
Cells that are not in selection are included as empty.
Parameters
----------
selection: Selection object
\tSelection of cells in current table that shall be c... | [
"def",
"copy",
"(",
"self",
",",
"selection",
",",
"getter",
"=",
"None",
",",
"delete",
"=",
"False",
")",
":",
"if",
"getter",
"is",
"None",
":",
"getter",
"=",
"self",
".",
"_get_code",
"tab",
"=",
"self",
".",
"grid",
".",
"current_table",
"selec... | Returns code from selection in a tab separated string
Cells that are not in selection are included as empty.
Parameters
----------
selection: Selection object
\tSelection of cells in current table that shall be copied
getter: Function, defaults to _get_code
\tG... | [
"Returns",
"code",
"from",
"selection",
"in",
"a",
"tab",
"separated",
"string"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L416-L481 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ClipboardActions.img2code | def img2code(self, key, img):
"""Pastes wx.Image into single cell"""
code_template = \
"wx.ImageFromData({width}, {height}, " + \
"bz2.decompress(base64.b64decode('{data}'))).ConvertToBitmap()"
code_alpha_template = \
"wx.ImageFromDataWithAlpha({width}, {hei... | python | def img2code(self, key, img):
"""Pastes wx.Image into single cell"""
code_template = \
"wx.ImageFromData({width}, {height}, " + \
"bz2.decompress(base64.b64decode('{data}'))).ConvertToBitmap()"
code_alpha_template = \
"wx.ImageFromDataWithAlpha({width}, {hei... | [
"def",
"img2code",
"(",
"self",
",",
"key",
",",
"img",
")",
":",
"code_template",
"=",
"\"wx.ImageFromData({width}, {height}, \"",
"+",
"\"bz2.decompress(base64.b64decode('{data}'))).ConvertToBitmap()\"",
"code_alpha_template",
"=",
"\"wx.ImageFromDataWithAlpha({width}, {height}, ... | Pastes wx.Image into single cell | [
"Pastes",
"wx",
".",
"Image",
"into",
"single",
"cell"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L555-L578 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ClipboardActions._get_paste_data_gen | def _get_paste_data_gen(self, key, data):
"""Generator for paste data
Can be used in grid.actions.paste
"""
if type(data) is wx._gdi.Bitmap:
code_str = self.bmp2code(key, data)
return [[code_str]]
else:
return (line.split("\t") for line in d... | python | def _get_paste_data_gen(self, key, data):
"""Generator for paste data
Can be used in grid.actions.paste
"""
if type(data) is wx._gdi.Bitmap:
code_str = self.bmp2code(key, data)
return [[code_str]]
else:
return (line.split("\t") for line in d... | [
"def",
"_get_paste_data_gen",
"(",
"self",
",",
"key",
",",
"data",
")",
":",
"if",
"type",
"(",
"data",
")",
"is",
"wx",
".",
"_gdi",
".",
"Bitmap",
":",
"code_str",
"=",
"self",
".",
"bmp2code",
"(",
"key",
",",
"data",
")",
"return",
"[",
"[",
... | Generator for paste data
Can be used in grid.actions.paste | [
"Generator",
"for",
"paste",
"data"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L585-L596 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ClipboardActions.paste | def paste(self, key, data):
"""Pastes data into grid
Parameters
----------
key: 2-Tuple of Integer
\tTop left cell
data: String or wx.Bitmap
\tTab separated string of paste data
\tor paste data image
"""
data_gen = self._get_paste_data_g... | python | def paste(self, key, data):
"""Pastes data into grid
Parameters
----------
key: 2-Tuple of Integer
\tTop left cell
data: String or wx.Bitmap
\tTab separated string of paste data
\tor paste data image
"""
data_gen = self._get_paste_data_g... | [
"def",
"paste",
"(",
"self",
",",
"key",
",",
"data",
")",
":",
"data_gen",
"=",
"self",
".",
"_get_paste_data_gen",
"(",
"key",
",",
"data",
")",
"self",
".",
"grid",
".",
"actions",
".",
"paste",
"(",
"key",
"[",
":",
"2",
"]",
",",
"data_gen",
... | Pastes data into grid
Parameters
----------
key: 2-Tuple of Integer
\tTop left cell
data: String or wx.Bitmap
\tTab separated string of paste data
\tor paste data image | [
"Pastes",
"data",
"into",
"grid"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L598-L615 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ClipboardActions._get_pasteas_data | def _get_pasteas_data(self, dim, obj):
"""Returns list of lists of obj than has dimensionality dim
Parameters
----------
dim: Integer
\tDimensionality of obj
obj: Object
\tIterable object of dimensionality dim
"""
if dim == 0:
return... | python | def _get_pasteas_data(self, dim, obj):
"""Returns list of lists of obj than has dimensionality dim
Parameters
----------
dim: Integer
\tDimensionality of obj
obj: Object
\tIterable object of dimensionality dim
"""
if dim == 0:
return... | [
"def",
"_get_pasteas_data",
"(",
"self",
",",
"dim",
",",
"obj",
")",
":",
"if",
"dim",
"==",
"0",
":",
"return",
"[",
"[",
"repr",
"(",
"obj",
")",
"]",
"]",
"elif",
"dim",
"==",
"1",
":",
"return",
"[",
"[",
"repr",
"(",
"o",
")",
"]",
"for... | Returns list of lists of obj than has dimensionality dim
Parameters
----------
dim: Integer
\tDimensionality of obj
obj: Object
\tIterable object of dimensionality dim | [
"Returns",
"list",
"of",
"lists",
"of",
"obj",
"than",
"has",
"dimensionality",
"dim"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L617-L634 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | ClipboardActions.paste_as | def paste_as(self, key, data):
"""Paste and transform data
Data may be given as a Python code as well as a tab separated
multi-line strings similar to paste.
"""
def error_msg(err):
msg = _("Error evaluating data: ") + str(err)
post_command_event(self.m... | python | def paste_as(self, key, data):
"""Paste and transform data
Data may be given as a Python code as well as a tab separated
multi-line strings similar to paste.
"""
def error_msg(err):
msg = _("Error evaluating data: ") + str(err)
post_command_event(self.m... | [
"def",
"paste_as",
"(",
"self",
",",
"key",
",",
"data",
")",
":",
"def",
"error_msg",
"(",
"err",
")",
":",
"msg",
"=",
"_",
"(",
"\"Error evaluating data: \"",
")",
"+",
"str",
"(",
"err",
")",
"post_command_event",
"(",
"self",
".",
"main_window",
"... | Paste and transform data
Data may be given as a Python code as well as a tab separated
multi-line strings similar to paste. | [
"Paste",
"and",
"transform",
"data"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L636-L684 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | MacroActions.execute_macros | def execute_macros(self):
"""Executes macros and marks grid as changed"""
# Mark content as changed
post_command_event(self.main_window, self.ContentChangedMsg)
(result, err) = self.grid.code_array.execute_macros()
# Post event to macro dialog
post_command_event(self.m... | python | def execute_macros(self):
"""Executes macros and marks grid as changed"""
# Mark content as changed
post_command_event(self.main_window, self.ContentChangedMsg)
(result, err) = self.grid.code_array.execute_macros()
# Post event to macro dialog
post_command_event(self.m... | [
"def",
"execute_macros",
"(",
"self",
")",
":",
"post_command_event",
"(",
"self",
".",
"main_window",
",",
"self",
".",
"ContentChangedMsg",
")",
"(",
"result",
",",
"err",
")",
"=",
"self",
".",
"grid",
".",
"code_array",
".",
"execute_macros",
"(",
")",... | Executes macros and marks grid as changed | [
"Executes",
"macros",
"and",
"marks",
"grid",
"as",
"changed"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L695-L705 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | MacroActions.open_macros | def open_macros(self, filepath):
"""Loads macros from file and marks grid as changed
Parameters
----------
filepath: String
\tPath to macro file
"""
try:
wx.BeginBusyCursor()
self.main_window.grid.Disable()
with open(filepat... | python | def open_macros(self, filepath):
"""Loads macros from file and marks grid as changed
Parameters
----------
filepath: String
\tPath to macro file
"""
try:
wx.BeginBusyCursor()
self.main_window.grid.Disable()
with open(filepat... | [
"def",
"open_macros",
"(",
"self",
",",
"filepath",
")",
":",
"try",
":",
"wx",
".",
"BeginBusyCursor",
"(",
")",
"self",
".",
"main_window",
".",
"grid",
".",
"Disable",
"(",
")",
"with",
"open",
"(",
"filepath",
")",
"as",
"macro_infile",
":",
"self"... | Loads macros from file and marks grid as changed
Parameters
----------
filepath: String
\tPath to macro file | [
"Loads",
"macros",
"from",
"file",
"and",
"marks",
"grid",
"as",
"changed"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L707-L751 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | MacroActions.save_macros | def save_macros(self, filepath, macros):
"""Saves macros to file
Parameters
----------
filepath: String
\tPath to macro file
macros: String
\tMacro code
"""
io_error_text = _("Error writing to file {filepath}.")
io_error_text = io_error_... | python | def save_macros(self, filepath, macros):
"""Saves macros to file
Parameters
----------
filepath: String
\tPath to macro file
macros: String
\tMacro code
"""
io_error_text = _("Error writing to file {filepath}.")
io_error_text = io_error_... | [
"def",
"save_macros",
"(",
"self",
",",
"filepath",
",",
"macros",
")",
":",
"io_error_text",
"=",
"_",
"(",
"\"Error writing to file {filepath}.\"",
")",
"io_error_text",
"=",
"io_error_text",
".",
"format",
"(",
"filepath",
"=",
"filepath",
")",
"tmpfile",
"="... | Saves macros to file
Parameters
----------
filepath: String
\tPath to macro file
macros: String
\tMacro code | [
"Saves",
"macros",
"to",
"file"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L753-L797 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | HelpActions.launch_help | def launch_help(self, helpname, filename):
"""Generic help launcher
Launches HTMLWindow that shows content of filename
or the Internet page with the filename url
Parameters
----------
filename: String
\thtml file or url
"""
# Set up window
... | python | def launch_help(self, helpname, filename):
"""Generic help launcher
Launches HTMLWindow that shows content of filename
or the Internet page with the filename url
Parameters
----------
filename: String
\thtml file or url
"""
# Set up window
... | [
"def",
"launch_help",
"(",
"self",
",",
"helpname",
",",
"filename",
")",
":",
"position",
"=",
"config",
"[",
"\"help_window_position\"",
"]",
"size",
"=",
"config",
"[",
"\"help_window_size\"",
"]",
"self",
".",
"help_window",
"=",
"wx",
".",
"Frame",
"(",... | Generic help launcher
Launches HTMLWindow that shows content of filename
or the Internet page with the filename url
Parameters
----------
filename: String
\thtml file or url | [
"Generic",
"help",
"launcher"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L803-L853 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | HelpActions.OnHelpMove | def OnHelpMove(self, event):
"""Help window move event handler stores position in config"""
position = event.GetPosition()
config["help_window_position"] = repr((position.x, position.y))
event.Skip() | python | def OnHelpMove(self, event):
"""Help window move event handler stores position in config"""
position = event.GetPosition()
config["help_window_position"] = repr((position.x, position.y))
event.Skip() | [
"def",
"OnHelpMove",
"(",
"self",
",",
"event",
")",
":",
"position",
"=",
"event",
".",
"GetPosition",
"(",
")",
"config",
"[",
"\"help_window_position\"",
"]",
"=",
"repr",
"(",
"(",
"position",
".",
"x",
",",
"position",
".",
"y",
")",
")",
"event",... | Help window move event handler stores position in config | [
"Help",
"window",
"move",
"event",
"handler",
"stores",
"position",
"in",
"config"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L861-L867 | train |
manns/pyspread | pyspread/src/actions/_main_window_actions.py | HelpActions.OnHelpSize | def OnHelpSize(self, event):
"""Help window size event handler stores size in config"""
size = event.GetSize()
config["help_window_size"] = repr((size.width, size.height))
event.Skip() | python | def OnHelpSize(self, event):
"""Help window size event handler stores size in config"""
size = event.GetSize()
config["help_window_size"] = repr((size.width, size.height))
event.Skip() | [
"def",
"OnHelpSize",
"(",
"self",
",",
"event",
")",
":",
"size",
"=",
"event",
".",
"GetSize",
"(",
")",
"config",
"[",
"\"help_window_size\"",
"]",
"=",
"repr",
"(",
"(",
"size",
".",
"width",
",",
"size",
".",
"height",
")",
")",
"event",
".",
"... | Help window size event handler stores size in config | [
"Help",
"window",
"size",
"event",
"handler",
"stores",
"size",
"in",
"config"
] | 0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0 | https://github.com/manns/pyspread/blob/0e2fd44c2e0f06605efc3058c20a43a8c1f9e7e0/pyspread/src/actions/_main_window_actions.py#L869-L875 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.