repo stringlengths 7 54 | path stringlengths 4 223 | func_name stringlengths 1 134 | original_string stringlengths 75 104k | language stringclasses 1
value | code stringlengths 75 104k | code_tokens listlengths 20 28.4k | docstring stringlengths 1 46.3k | docstring_tokens listlengths 1 1.66k | sha stringlengths 40 40 | url stringlengths 87 315 | partition stringclasses 1
value | summary stringlengths 4 350 | obf_code stringlengths 7.85k 764k |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
python-openxml/python-docx | docx/oxml/xmlchemy.py | _BaseChildElement._add_list_getter | def _add_list_getter(self):
"""
Add a read-only ``{prop_name}_lst`` property to the element class to
retrieve a list of child elements matching this type.
"""
prop_name = '%s_lst' % self._prop_name
property_ = property(self._list_getter, None, None)
setattr(self._... | python | def _add_list_getter(self):
"""
Add a read-only ``{prop_name}_lst`` property to the element class to
retrieve a list of child elements matching this type.
"""
prop_name = '%s_lst' % self._prop_name
property_ = property(self._list_getter, None, None)
setattr(self._... | [
"def",
"_add_list_getter",
"(",
"self",
")",
":",
"prop_name",
"=",
"'%s_lst'",
"%",
"self",
".",
"_prop_name",
"property_",
"=",
"property",
"(",
"self",
".",
"_list_getter",
",",
"None",
",",
"None",
")",
"setattr",
"(",
"self",
".",
"_element_cls",
",",... | Add a read-only ``{prop_name}_lst`` property to the element class to
retrieve a list of child elements matching this type. | [
"Add",
"a",
"read",
"-",
"only",
"{",
"prop_name",
"}",
"_lst",
"property",
"to",
"the",
"element",
"class",
"to",
"retrieve",
"a",
"list",
"of",
"child",
"elements",
"matching",
"this",
"type",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L320-L327 | train | Add a read - only property to the element class to retrieve a list of child elements matching this type. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | _BaseChildElement._add_public_adder | def _add_public_adder(self):
"""
Add a public ``add_x()`` method to the parent element class.
"""
def add_child(obj):
private_add_method = getattr(obj, self._add_method_name)
child = private_add_method()
return child
add_child.__doc__ = (
... | python | def _add_public_adder(self):
"""
Add a public ``add_x()`` method to the parent element class.
"""
def add_child(obj):
private_add_method = getattr(obj, self._add_method_name)
child = private_add_method()
return child
add_child.__doc__ = (
... | [
"def",
"_add_public_adder",
"(",
"self",
")",
":",
"def",
"add_child",
"(",
"obj",
")",
":",
"private_add_method",
"=",
"getattr",
"(",
"obj",
",",
"self",
".",
"_add_method_name",
")",
"child",
"=",
"private_add_method",
"(",
")",
"return",
"child",
"add_ch... | Add a public ``add_x()`` method to the parent element class. | [
"Add",
"a",
"public",
"add_x",
"()",
"method",
"to",
"the",
"parent",
"element",
"class",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L333-L346 | train | Add a public add_x method to the parent element class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | _BaseChildElement._add_to_class | def _add_to_class(self, name, method):
"""
Add *method* to the target class as *name*, unless *name* is already
defined on the class.
"""
if hasattr(self._element_cls, name):
return
setattr(self._element_cls, name, method) | python | def _add_to_class(self, name, method):
"""
Add *method* to the target class as *name*, unless *name* is already
defined on the class.
"""
if hasattr(self._element_cls, name):
return
setattr(self._element_cls, name, method) | [
"def",
"_add_to_class",
"(",
"self",
",",
"name",
",",
"method",
")",
":",
"if",
"hasattr",
"(",
"self",
".",
"_element_cls",
",",
"name",
")",
":",
"return",
"setattr",
"(",
"self",
".",
"_element_cls",
",",
"name",
",",
"method",
")"
] | Add *method* to the target class as *name*, unless *name* is already
defined on the class. | [
"Add",
"*",
"method",
"*",
"to",
"the",
"target",
"class",
"as",
"*",
"name",
"*",
"unless",
"*",
"name",
"*",
"is",
"already",
"defined",
"on",
"the",
"class",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L348-L355 | train | Add a method to the target class. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | _BaseChildElement._getter | def _getter(self):
"""
Return a function object suitable for the "get" side of the property
descriptor. This default getter returns the child element with
matching tag name or |None| if not present.
"""
def get_child_element(obj):
return obj.find(qn(self._nspt... | python | def _getter(self):
"""
Return a function object suitable for the "get" side of the property
descriptor. This default getter returns the child element with
matching tag name or |None| if not present.
"""
def get_child_element(obj):
return obj.find(qn(self._nspt... | [
"def",
"_getter",
"(",
"self",
")",
":",
"def",
"get_child_element",
"(",
"obj",
")",
":",
"return",
"obj",
".",
"find",
"(",
"qn",
"(",
"self",
".",
"_nsptagname",
")",
")",
"get_child_element",
".",
"__doc__",
"=",
"(",
"'``<%s>`` child element or |None| i... | Return a function object suitable for the "get" side of the property
descriptor. This default getter returns the child element with
matching tag name or |None| if not present. | [
"Return",
"a",
"function",
"object",
"suitable",
"for",
"the",
"get",
"side",
"of",
"the",
"property",
"descriptor",
".",
"This",
"default",
"getter",
"returns",
"the",
"child",
"element",
"with",
"matching",
"tag",
"name",
"or",
"|None|",
"if",
"not",
"pres... | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L368-L380 | train | Return a function object suitable for the get side of the property
descriptor. This default getter returns the child element with the specified tag name or |None| if not present. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | _BaseChildElement._list_getter | def _list_getter(self):
"""
Return a function object suitable for the "get" side of a list
property descriptor.
"""
def get_child_element_list(obj):
return obj.findall(qn(self._nsptagname))
get_child_element_list.__doc__ = (
'A list containing each... | python | def _list_getter(self):
"""
Return a function object suitable for the "get" side of a list
property descriptor.
"""
def get_child_element_list(obj):
return obj.findall(qn(self._nsptagname))
get_child_element_list.__doc__ = (
'A list containing each... | [
"def",
"_list_getter",
"(",
"self",
")",
":",
"def",
"get_child_element_list",
"(",
"obj",
")",
":",
"return",
"obj",
".",
"findall",
"(",
"qn",
"(",
"self",
".",
"_nsptagname",
")",
")",
"get_child_element_list",
".",
"__doc__",
"=",
"(",
"'A list containin... | Return a function object suitable for the "get" side of a list
property descriptor. | [
"Return",
"a",
"function",
"object",
"suitable",
"for",
"the",
"get",
"side",
"of",
"a",
"list",
"property",
"descriptor",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L387-L398 | train | Return a function object suitable for the get side of a list
property descriptor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | Choice.populate_class_members | def populate_class_members(
self, element_cls, group_prop_name, successors):
"""
Add the appropriate methods to *element_cls*.
"""
self._element_cls = element_cls
self._group_prop_name = group_prop_name
self._successors = successors
self._add_getter()... | python | def populate_class_members(
self, element_cls, group_prop_name, successors):
"""
Add the appropriate methods to *element_cls*.
"""
self._element_cls = element_cls
self._group_prop_name = group_prop_name
self._successors = successors
self._add_getter()... | [
"def",
"populate_class_members",
"(",
"self",
",",
"element_cls",
",",
"group_prop_name",
",",
"successors",
")",
":",
"self",
".",
"_element_cls",
"=",
"element_cls",
"self",
".",
"_group_prop_name",
"=",
"group_prop_name",
"self",
".",
"_successors",
"=",
"succe... | Add the appropriate methods to *element_cls*. | [
"Add",
"the",
"appropriate",
"methods",
"to",
"*",
"element_cls",
"*",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L428-L441 | train | Populates the internal state of the object with the appropriate methods to the class members. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | Choice._add_get_or_change_to_method | def _add_get_or_change_to_method(self):
"""
Add a ``get_or_change_to_x()`` method to the element class for this
child element.
"""
def get_or_change_to_child(obj):
child = getattr(obj, self._prop_name)
if child is not None:
return child
... | python | def _add_get_or_change_to_method(self):
"""
Add a ``get_or_change_to_x()`` method to the element class for this
child element.
"""
def get_or_change_to_child(obj):
child = getattr(obj, self._prop_name)
if child is not None:
return child
... | [
"def",
"_add_get_or_change_to_method",
"(",
"self",
")",
":",
"def",
"get_or_change_to_child",
"(",
"obj",
")",
":",
"child",
"=",
"getattr",
"(",
"obj",
",",
"self",
".",
"_prop_name",
")",
"if",
"child",
"is",
"not",
"None",
":",
"return",
"child",
"remo... | Add a ``get_or_change_to_x()`` method to the element class for this
child element. | [
"Add",
"a",
"get_or_change_to_x",
"()",
"method",
"to",
"the",
"element",
"class",
"for",
"this",
"child",
"element",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L443-L466 | train | Add a get_or_change_to_x method to the element class for thisCOOKIE. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | Choice._prop_name | def _prop_name(self):
"""
Calculate property name from tag name, e.g. a:schemeClr -> schemeClr.
"""
if ':' in self._nsptagname:
start = self._nsptagname.index(':') + 1
else:
start = 0
return self._nsptagname[start:] | python | def _prop_name(self):
"""
Calculate property name from tag name, e.g. a:schemeClr -> schemeClr.
"""
if ':' in self._nsptagname:
start = self._nsptagname.index(':') + 1
else:
start = 0
return self._nsptagname[start:] | [
"def",
"_prop_name",
"(",
"self",
")",
":",
"if",
"':'",
"in",
"self",
".",
"_nsptagname",
":",
"start",
"=",
"self",
".",
"_nsptagname",
".",
"index",
"(",
"':'",
")",
"+",
"1",
"else",
":",
"start",
"=",
"0",
"return",
"self",
".",
"_nsptagname",
... | Calculate property name from tag name, e.g. a:schemeClr -> schemeClr. | [
"Calculate",
"property",
"name",
"from",
"tag",
"name",
"e",
".",
"g",
".",
"a",
":",
"schemeClr",
"-",
">",
"schemeClr",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L469-L477 | train | Calculate property name from tag name e. g. a : schemeClr | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | OneAndOnlyOne.populate_class_members | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(OneAndOnlyOne, self).populate_class_members(
element_cls, prop_name
)
self._add_getter() | python | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(OneAndOnlyOne, self).populate_class_members(
element_cls, prop_name
)
self._add_getter() | [
"def",
"populate_class_members",
"(",
"self",
",",
"element_cls",
",",
"prop_name",
")",
":",
"super",
"(",
"OneAndOnlyOne",
",",
"self",
")",
".",
"populate_class_members",
"(",
"element_cls",
",",
"prop_name",
")",
"self",
".",
"_add_getter",
"(",
")"
] | Add the appropriate methods to *element_cls*. | [
"Add",
"the",
"appropriate",
"methods",
"to",
"*",
"element_cls",
"*",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L495-L502 | train | Add the appropriate methods to element_cls. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | OneOrMore.populate_class_members | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(OneOrMore, self).populate_class_members(
element_cls, prop_name
)
self._add_list_getter()
self._add_creator()
self._add_insert... | python | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(OneOrMore, self).populate_class_members(
element_cls, prop_name
)
self._add_list_getter()
self._add_creator()
self._add_insert... | [
"def",
"populate_class_members",
"(",
"self",
",",
"element_cls",
",",
"prop_name",
")",
":",
"super",
"(",
"OneOrMore",
",",
"self",
")",
".",
"populate_class_members",
"(",
"element_cls",
",",
"prop_name",
")",
"self",
".",
"_add_list_getter",
"(",
")",
"sel... | Add the appropriate methods to *element_cls*. | [
"Add",
"the",
"appropriate",
"methods",
"to",
"*",
"element_cls",
"*",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L531-L543 | train | Add the appropriate methods to element_cls. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | ZeroOrOne.populate_class_members | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(ZeroOrOne, self).populate_class_members(element_cls, prop_name)
self._add_getter()
self._add_creator()
self._add_inserter()
self._add_adde... | python | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(ZeroOrOne, self).populate_class_members(element_cls, prop_name)
self._add_getter()
self._add_creator()
self._add_inserter()
self._add_adde... | [
"def",
"populate_class_members",
"(",
"self",
",",
"element_cls",
",",
"prop_name",
")",
":",
"super",
"(",
"ZeroOrOne",
",",
"self",
")",
".",
"populate_class_members",
"(",
"element_cls",
",",
"prop_name",
")",
"self",
".",
"_add_getter",
"(",
")",
"self",
... | Add the appropriate methods to *element_cls*. | [
"Add",
"the",
"appropriate",
"methods",
"to",
"*",
"element_cls",
"*",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L569-L579 | train | Add the appropriate methods to element_cls. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | ZeroOrOne._add_get_or_adder | def _add_get_or_adder(self):
"""
Add a ``get_or_add_x()`` method to the element class for this
child element.
"""
def get_or_add_child(obj):
child = getattr(obj, self._prop_name)
if child is None:
add_method = getattr(obj, self._add_method_... | python | def _add_get_or_adder(self):
"""
Add a ``get_or_add_x()`` method to the element class for this
child element.
"""
def get_or_add_child(obj):
child = getattr(obj, self._prop_name)
if child is None:
add_method = getattr(obj, self._add_method_... | [
"def",
"_add_get_or_adder",
"(",
"self",
")",
":",
"def",
"get_or_add_child",
"(",
"obj",
")",
":",
"child",
"=",
"getattr",
"(",
"obj",
",",
"self",
".",
"_prop_name",
")",
"if",
"child",
"is",
"None",
":",
"add_method",
"=",
"getattr",
"(",
"obj",
",... | Add a ``get_or_add_x()`` method to the element class for this
child element. | [
"Add",
"a",
"get_or_add_x",
"()",
"method",
"to",
"the",
"element",
"class",
"for",
"this",
"child",
"element",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L581-L595 | train | Add a get_or_add_x method to the element class for thisCOOKIE. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | ZeroOrOne._add_remover | def _add_remover(self):
"""
Add a ``_remove_x()`` method to the element class for this child
element.
"""
def _remove_child(obj):
obj.remove_all(self._nsptagname)
_remove_child.__doc__ = (
'Remove all ``<%s>`` child elements.'
) % self._nsp... | python | def _add_remover(self):
"""
Add a ``_remove_x()`` method to the element class for this child
element.
"""
def _remove_child(obj):
obj.remove_all(self._nsptagname)
_remove_child.__doc__ = (
'Remove all ``<%s>`` child elements.'
) % self._nsp... | [
"def",
"_add_remover",
"(",
"self",
")",
":",
"def",
"_remove_child",
"(",
"obj",
")",
":",
"obj",
".",
"remove_all",
"(",
"self",
".",
"_nsptagname",
")",
"_remove_child",
".",
"__doc__",
"=",
"(",
"'Remove all ``<%s>`` child elements.'",
")",
"%",
"self",
... | Add a ``_remove_x()`` method to the element class for this child
element. | [
"Add",
"a",
"_remove_x",
"()",
"method",
"to",
"the",
"element",
"class",
"for",
"this",
"child",
"element",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L597-L607 | train | Add a remove_all method to the element class for this childCOOKIE. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | ZeroOrOneChoice.populate_class_members | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(ZeroOrOneChoice, self).populate_class_members(
element_cls, prop_name
)
self._add_choice_getter()
for choice in self._choices:
... | python | def populate_class_members(self, element_cls, prop_name):
"""
Add the appropriate methods to *element_cls*.
"""
super(ZeroOrOneChoice, self).populate_class_members(
element_cls, prop_name
)
self._add_choice_getter()
for choice in self._choices:
... | [
"def",
"populate_class_members",
"(",
"self",
",",
"element_cls",
",",
"prop_name",
")",
":",
"super",
"(",
"ZeroOrOneChoice",
",",
"self",
")",
".",
"populate_class_members",
"(",
"element_cls",
",",
"prop_name",
")",
"self",
".",
"_add_choice_getter",
"(",
")"... | Add the appropriate methods to *element_cls*. | [
"Add",
"the",
"appropriate",
"methods",
"to",
"*",
"element_cls",
"*",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L623-L635 | train | Add the appropriate methods to element_cls. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | ZeroOrOneChoice._add_choice_getter | def _add_choice_getter(self):
"""
Add a read-only ``{prop_name}`` property to the element class that
returns the present member of this group, or |None| if none are
present.
"""
property_ = property(self._choice_getter, None, None)
# assign unconditionally to over... | python | def _add_choice_getter(self):
"""
Add a read-only ``{prop_name}`` property to the element class that
returns the present member of this group, or |None| if none are
present.
"""
property_ = property(self._choice_getter, None, None)
# assign unconditionally to over... | [
"def",
"_add_choice_getter",
"(",
"self",
")",
":",
"property_",
"=",
"property",
"(",
"self",
".",
"_choice_getter",
",",
"None",
",",
"None",
")",
"# assign unconditionally to overwrite element name definition",
"setattr",
"(",
"self",
".",
"_element_cls",
",",
"s... | Add a read-only ``{prop_name}`` property to the element class that
returns the present member of this group, or |None| if none are
present. | [
"Add",
"a",
"read",
"-",
"only",
"{",
"prop_name",
"}",
"property",
"to",
"the",
"element",
"class",
"that",
"returns",
"the",
"present",
"member",
"of",
"this",
"group",
"or",
"|None|",
"if",
"none",
"are",
"present",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L637-L645 | train | Add a read - only getter property to the element class that returns the present member of this group or None if none are
present. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | ZeroOrOneChoice._add_group_remover | def _add_group_remover(self):
"""
Add a ``_remove_eg_x()`` method to the element class for this choice
group.
"""
def _remove_choice_group(obj):
for tagname in self._member_nsptagnames:
obj.remove_all(tagname)
_remove_choice_group.__doc__ = (
... | python | def _add_group_remover(self):
"""
Add a ``_remove_eg_x()`` method to the element class for this choice
group.
"""
def _remove_choice_group(obj):
for tagname in self._member_nsptagnames:
obj.remove_all(tagname)
_remove_choice_group.__doc__ = (
... | [
"def",
"_add_group_remover",
"(",
"self",
")",
":",
"def",
"_remove_choice_group",
"(",
"obj",
")",
":",
"for",
"tagname",
"in",
"self",
".",
"_member_nsptagnames",
":",
"obj",
".",
"remove_all",
"(",
"tagname",
")",
"_remove_choice_group",
".",
"__doc__",
"="... | Add a ``_remove_eg_x()`` method to the element class for this choice
group. | [
"Add",
"a",
"_remove_eg_x",
"()",
"method",
"to",
"the",
"element",
"class",
"for",
"this",
"choice",
"group",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L647-L661 | train | Add a remove_eg_x method to the element class for this choice
group. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | ZeroOrOneChoice._choice_getter | def _choice_getter(self):
"""
Return a function object suitable for the "get" side of the property
descriptor.
"""
def get_group_member_element(obj):
return obj.first_child_found_in(*self._member_nsptagnames)
get_group_member_element.__doc__ = (
'R... | python | def _choice_getter(self):
"""
Return a function object suitable for the "get" side of the property
descriptor.
"""
def get_group_member_element(obj):
return obj.first_child_found_in(*self._member_nsptagnames)
get_group_member_element.__doc__ = (
'R... | [
"def",
"_choice_getter",
"(",
"self",
")",
":",
"def",
"get_group_member_element",
"(",
"obj",
")",
":",
"return",
"obj",
".",
"first_child_found_in",
"(",
"*",
"self",
".",
"_member_nsptagnames",
")",
"get_group_member_element",
".",
"__doc__",
"=",
"(",
"'Retu... | Return a function object suitable for the "get" side of the property
descriptor. | [
"Return",
"a",
"function",
"object",
"suitable",
"for",
"the",
"get",
"side",
"of",
"the",
"property",
"descriptor",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L664-L675 | train | Return a function object suitable for the get side of the property
descriptor. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | _OxmlElementBase.first_child_found_in | def first_child_found_in(self, *tagnames):
"""
Return the first child found with tag in *tagnames*, or None if
not found.
"""
for tagname in tagnames:
child = self.find(qn(tagname))
if child is not None:
return child
return None | python | def first_child_found_in(self, *tagnames):
"""
Return the first child found with tag in *tagnames*, or None if
not found.
"""
for tagname in tagnames:
child = self.find(qn(tagname))
if child is not None:
return child
return None | [
"def",
"first_child_found_in",
"(",
"self",
",",
"*",
"tagnames",
")",
":",
"for",
"tagname",
"in",
"tagnames",
":",
"child",
"=",
"self",
".",
"find",
"(",
"qn",
"(",
"tagname",
")",
")",
"if",
"child",
"is",
"not",
"None",
":",
"return",
"child",
"... | Return the first child found with tag in *tagnames*, or None if
not found. | [
"Return",
"the",
"first",
"child",
"found",
"with",
"tag",
"in",
"*",
"tagnames",
"*",
"or",
"None",
"if",
"not",
"found",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L705-L714 | train | Return the first child found with tag in tagnames. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | _OxmlElementBase.remove_all | def remove_all(self, *tagnames):
"""
Remove all child elements whose tagname (e.g. 'a:p') appears in
*tagnames*.
"""
for tagname in tagnames:
matching = self.findall(qn(tagname))
for child in matching:
self.remove(child) | python | def remove_all(self, *tagnames):
"""
Remove all child elements whose tagname (e.g. 'a:p') appears in
*tagnames*.
"""
for tagname in tagnames:
matching = self.findall(qn(tagname))
for child in matching:
self.remove(child) | [
"def",
"remove_all",
"(",
"self",
",",
"*",
"tagnames",
")",
":",
"for",
"tagname",
"in",
"tagnames",
":",
"matching",
"=",
"self",
".",
"findall",
"(",
"qn",
"(",
"tagname",
")",
")",
"for",
"child",
"in",
"matching",
":",
"self",
".",
"remove",
"("... | Remove all child elements whose tagname (e.g. 'a:p') appears in
*tagnames*. | [
"Remove",
"all",
"child",
"elements",
"whose",
"tagname",
"(",
"e",
".",
"g",
".",
"a",
":",
"p",
")",
"appears",
"in",
"*",
"tagnames",
"*",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L724-L732 | train | Remove all child elements whose tagname appears in tagnames*. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/oxml/xmlchemy.py | _OxmlElementBase.xpath | def xpath(self, xpath_str):
"""
Override of ``lxml`` _Element.xpath() method to provide standard Open
XML namespace mapping (``nsmap``) in centralized location.
"""
return super(BaseOxmlElement, self).xpath(
xpath_str, namespaces=nsmap
) | python | def xpath(self, xpath_str):
"""
Override of ``lxml`` _Element.xpath() method to provide standard Open
XML namespace mapping (``nsmap``) in centralized location.
"""
return super(BaseOxmlElement, self).xpath(
xpath_str, namespaces=nsmap
) | [
"def",
"xpath",
"(",
"self",
",",
"xpath_str",
")",
":",
"return",
"super",
"(",
"BaseOxmlElement",
",",
"self",
")",
".",
"xpath",
"(",
"xpath_str",
",",
"namespaces",
"=",
"nsmap",
")"
] | Override of ``lxml`` _Element.xpath() method to provide standard Open
XML namespace mapping (``nsmap``) in centralized location. | [
"Override",
"of",
"lxml",
"_Element",
".",
"xpath",
"()",
"method",
"to",
"provide",
"standard",
"Open",
"XML",
"namespace",
"mapping",
"(",
"nsmap",
")",
"in",
"centralized",
"location",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/oxml/xmlchemy.py#L743-L750 | train | Override of lxml. _Element. xpath method to provide standard Open
XML namespace mapping. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/dml/color.py | ColorFormat.rgb | def rgb(self):
"""
An |RGBColor| value or |None| if no RGB color is specified.
When :attr:`type` is `MSO_COLOR_TYPE.RGB`, the value of this property
will always be an |RGBColor| value. It may also be an |RGBColor|
value if :attr:`type` is `MSO_COLOR_TYPE.THEME`, as Word writes t... | python | def rgb(self):
"""
An |RGBColor| value or |None| if no RGB color is specified.
When :attr:`type` is `MSO_COLOR_TYPE.RGB`, the value of this property
will always be an |RGBColor| value. It may also be an |RGBColor|
value if :attr:`type` is `MSO_COLOR_TYPE.THEME`, as Word writes t... | [
"def",
"rgb",
"(",
"self",
")",
":",
"color",
"=",
"self",
".",
"_color",
"if",
"color",
"is",
"None",
":",
"return",
"None",
"if",
"color",
".",
"val",
"==",
"ST_HexColorAuto",
".",
"AUTO",
":",
"return",
"None",
"return",
"color",
".",
"val"
] | An |RGBColor| value or |None| if no RGB color is specified.
When :attr:`type` is `MSO_COLOR_TYPE.RGB`, the value of this property
will always be an |RGBColor| value. It may also be an |RGBColor|
value if :attr:`type` is `MSO_COLOR_TYPE.THEME`, as Word writes the
current value of a theme... | [
"An",
"|RGBColor|",
"value",
"or",
"|None|",
"if",
"no",
"RGB",
"color",
"is",
"specified",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/dml/color.py#L28-L51 | train | Return the value of the RGB color property of the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/dml/color.py | ColorFormat.theme_color | def theme_color(self):
"""
A member of :ref:`MsoThemeColorIndex` or |None| if no theme color is
specified. When :attr:`type` is `MSO_COLOR_TYPE.THEME`, the value of
this property will always be a member of :ref:`MsoThemeColorIndex`.
When :attr:`type` has any other value, the valu... | python | def theme_color(self):
"""
A member of :ref:`MsoThemeColorIndex` or |None| if no theme color is
specified. When :attr:`type` is `MSO_COLOR_TYPE.THEME`, the value of
this property will always be a member of :ref:`MsoThemeColorIndex`.
When :attr:`type` has any other value, the valu... | [
"def",
"theme_color",
"(",
"self",
")",
":",
"color",
"=",
"self",
".",
"_color",
"if",
"color",
"is",
"None",
"or",
"color",
".",
"themeColor",
"is",
"None",
":",
"return",
"None",
"return",
"color",
".",
"themeColor"
] | A member of :ref:`MsoThemeColorIndex` or |None| if no theme color is
specified. When :attr:`type` is `MSO_COLOR_TYPE.THEME`, the value of
this property will always be a member of :ref:`MsoThemeColorIndex`.
When :attr:`type` has any other value, the value of this property is
|None|.
... | [
"A",
"member",
"of",
":",
"ref",
":",
"MsoThemeColorIndex",
"or",
"|None|",
"if",
"no",
"theme",
"color",
"is",
"specified",
".",
"When",
":",
"attr",
":",
"type",
"is",
"MSO_COLOR_TYPE",
".",
"THEME",
"the",
"value",
"of",
"this",
"property",
"will",
"a... | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/dml/color.py#L63-L80 | train | Returns the value of the themeColor property of the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/dml/color.py | ColorFormat.type | def type(self):
"""
Read-only. A member of :ref:`MsoColorType`, one of RGB, THEME, or
AUTO, corresponding to the way this color is defined. Its value is
|None| if no color is applied at this level, which causes the
effective color to be inherited from the style hierarchy.
... | python | def type(self):
"""
Read-only. A member of :ref:`MsoColorType`, one of RGB, THEME, or
AUTO, corresponding to the way this color is defined. Its value is
|None| if no color is applied at this level, which causes the
effective color to be inherited from the style hierarchy.
... | [
"def",
"type",
"(",
"self",
")",
":",
"color",
"=",
"self",
".",
"_color",
"if",
"color",
"is",
"None",
":",
"return",
"None",
"if",
"color",
".",
"themeColor",
"is",
"not",
"None",
":",
"return",
"MSO_COLOR_TYPE",
".",
"THEME",
"if",
"color",
".",
"... | Read-only. A member of :ref:`MsoColorType`, one of RGB, THEME, or
AUTO, corresponding to the way this color is defined. Its value is
|None| if no color is applied at this level, which causes the
effective color to be inherited from the style hierarchy. | [
"Read",
"-",
"only",
".",
"A",
"member",
"of",
":",
"ref",
":",
"MsoColorType",
"one",
"of",
"RGB",
"THEME",
"or",
"AUTO",
"corresponding",
"to",
"the",
"way",
"this",
"color",
"is",
"defined",
".",
"Its",
"value",
"is",
"|None|",
"if",
"no",
"color",
... | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/dml/color.py#L91-L105 | train | Read - only. A member of MsoColorType one of RGB THEME or MSO_COLOR_TYPE. AUTO or MSO_COLOR_TYPE. RGB or MSO_COLOR_TYPE. THEME or MSO_COLOR_TYPE. AUTO. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
python-openxml/python-docx | docx/shape.py | InlineShape.type | def type(self):
"""
The type of this inline shape as a member of
``docx.enum.shape.WD_INLINE_SHAPE``, e.g. ``LINKED_PICTURE``.
Read-only.
"""
graphicData = self._inline.graphic.graphicData
uri = graphicData.uri
if uri == nsmap['pic']:
blip = gr... | python | def type(self):
"""
The type of this inline shape as a member of
``docx.enum.shape.WD_INLINE_SHAPE``, e.g. ``LINKED_PICTURE``.
Read-only.
"""
graphicData = self._inline.graphic.graphicData
uri = graphicData.uri
if uri == nsmap['pic']:
blip = gr... | [
"def",
"type",
"(",
"self",
")",
":",
"graphicData",
"=",
"self",
".",
"_inline",
".",
"graphic",
".",
"graphicData",
"uri",
"=",
"graphicData",
".",
"uri",
"if",
"uri",
"==",
"nsmap",
"[",
"'pic'",
"]",
":",
"blip",
"=",
"graphicData",
".",
"pic",
"... | The type of this inline shape as a member of
``docx.enum.shape.WD_INLINE_SHAPE``, e.g. ``LINKED_PICTURE``.
Read-only. | [
"The",
"type",
"of",
"this",
"inline",
"shape",
"as",
"a",
"member",
"of",
"docx",
".",
"enum",
".",
"shape",
".",
"WD_INLINE_SHAPE",
"e",
".",
"g",
".",
"LINKED_PICTURE",
".",
"Read",
"-",
"only",
"."
] | 6756f6cd145511d3eb6d1d188beea391b1ddfd53 | https://github.com/python-openxml/python-docx/blob/6756f6cd145511d3eb6d1d188beea391b1ddfd53/docx/shape.py#L73-L90 | train | Returns the type of this inline shape as a member of WD_INLINE_SHAPE. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/extract.py | to_df | def to_df(figure):
"""
Extracts the data from a Plotly Figure
Parameters
----------
figure : plotly_figure
Figure from which data will be
extracted
Returns a DataFrame or list of DataFrame
"""
dfs=[]
for trace in figure['data']:
if '... | python | def to_df(figure):
"""
Extracts the data from a Plotly Figure
Parameters
----------
figure : plotly_figure
Figure from which data will be
extracted
Returns a DataFrame or list of DataFrame
"""
dfs=[]
for trace in figure['data']:
if '... | [
"def",
"to_df",
"(",
"figure",
")",
":",
"dfs",
"=",
"[",
"]",
"for",
"trace",
"in",
"figure",
"[",
"'data'",
"]",
":",
"if",
"'scatter'",
"in",
"trace",
"[",
"'type'",
"]",
":",
"try",
":",
"if",
"type",
"(",
"trace",
"[",
"'x'",
"]",
"[",
"0"... | Extracts the data from a Plotly Figure
Parameters
----------
figure : plotly_figure
Figure from which data will be
extracted
Returns a DataFrame or list of DataFrame | [
"Extracts",
"the",
"data",
"from",
"a",
"Plotly",
"Figure"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/extract.py#L4-L69 | train | Extracts the data from a Plotly Figure and returns a DataFrame or list of DataFrame objects. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | to_rgba | def to_rgba(color, alpha):
"""
Converts from hex|rgb to rgba
Parameters:
-----------
color : string
Color representation on hex or rgb
alpha : float
Value from 0 to 1.0 that represents the
alpha value.
Example:
... | python | def to_rgba(color, alpha):
"""
Converts from hex|rgb to rgba
Parameters:
-----------
color : string
Color representation on hex or rgb
alpha : float
Value from 0 to 1.0 that represents the
alpha value.
Example:
... | [
"def",
"to_rgba",
"(",
"color",
",",
"alpha",
")",
":",
"if",
"type",
"(",
"color",
")",
"==",
"tuple",
":",
"color",
",",
"alpha",
"=",
"color",
"color",
"=",
"color",
".",
"lower",
"(",
")",
"if",
"'rgba'",
"in",
"color",
":",
"cl",
"=",
"list"... | Converts from hex|rgb to rgba
Parameters:
-----------
color : string
Color representation on hex or rgb
alpha : float
Value from 0 to 1.0 that represents the
alpha value.
Example:
to_rgba('#E1E5ED',0.6)
... | [
"Converts",
"from",
"hex|rgb",
"to",
"rgba"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L23-L52 | train | Converts from hex or rgb to rgba | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | hex_to_rgb | def hex_to_rgb(color):
"""
Converts from hex to rgb
Parameters:
-----------
color : string
Color representation on hex or rgb
Example:
hex_to_rgb('#E1E5ED')
hex_to_rgb('#f03')
"""
color = normalize(color)
color = color[1:]
# r... | python | def hex_to_rgb(color):
"""
Converts from hex to rgb
Parameters:
-----------
color : string
Color representation on hex or rgb
Example:
hex_to_rgb('#E1E5ED')
hex_to_rgb('#f03')
"""
color = normalize(color)
color = color[1:]
# r... | [
"def",
"hex_to_rgb",
"(",
"color",
")",
":",
"color",
"=",
"normalize",
"(",
"color",
")",
"color",
"=",
"color",
"[",
"1",
":",
"]",
"# return 'rgb'+str(tuple(ord(c) for c in color.decode('hex')))",
"return",
"'rgb'",
"+",
"str",
"(",
"(",
"int",
"(",
"color"... | Converts from hex to rgb
Parameters:
-----------
color : string
Color representation on hex or rgb
Example:
hex_to_rgb('#E1E5ED')
hex_to_rgb('#f03') | [
"Converts",
"from",
"hex",
"to",
"rgb"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L55-L71 | train | Converts from hex to rgb | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | normalize | def normalize(color):
"""
Returns an hex color
Parameters:
-----------
color : string
Color representation in rgba|rgb|hex
Example:
normalize('#f03')
"""
if type(color) == tuple:
color = to_rgba(*color)
if 'rgba' in color:
ret... | python | def normalize(color):
"""
Returns an hex color
Parameters:
-----------
color : string
Color representation in rgba|rgb|hex
Example:
normalize('#f03')
"""
if type(color) == tuple:
color = to_rgba(*color)
if 'rgba' in color:
ret... | [
"def",
"normalize",
"(",
"color",
")",
":",
"if",
"type",
"(",
"color",
")",
"==",
"tuple",
":",
"color",
"=",
"to_rgba",
"(",
"*",
"color",
")",
"if",
"'rgba'",
"in",
"color",
":",
"return",
"rgb_to_hex",
"(",
"rgba_to_rgb",
"(",
"color",
")",
")",
... | Returns an hex color
Parameters:
-----------
color : string
Color representation in rgba|rgb|hex
Example:
normalize('#f03') | [
"Returns",
"an",
"hex",
"color"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L74-L102 | train | Normalizes a string in rgba or rgb format | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | rgb_to_hex | def rgb_to_hex(color):
"""
Converts from rgb to hex
Parameters:
-----------
color : string
Color representation on hex or rgb
Example:
rgb_to_hex('rgb(23,25,24)')
"""
rgb = eval(color.replace('rgb', ''))
# return '#'+''.join(map(chr, rgb)).en... | python | def rgb_to_hex(color):
"""
Converts from rgb to hex
Parameters:
-----------
color : string
Color representation on hex or rgb
Example:
rgb_to_hex('rgb(23,25,24)')
"""
rgb = eval(color.replace('rgb', ''))
# return '#'+''.join(map(chr, rgb)).en... | [
"def",
"rgb_to_hex",
"(",
"color",
")",
":",
"rgb",
"=",
"eval",
"(",
"color",
".",
"replace",
"(",
"'rgb'",
",",
"''",
")",
")",
"# return '#'+''.join(map(chr, rgb)).encode('hex')",
"return",
"'#'",
"+",
"''",
".",
"join",
"(",
"[",
"'{0:02x}'",
".",
"for... | Converts from rgb to hex
Parameters:
-----------
color : string
Color representation on hex or rgb
Example:
rgb_to_hex('rgb(23,25,24)') | [
"Converts",
"from",
"rgb",
"to",
"hex"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L105-L119 | train | Converts from rgb to hex | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | rgba_to_rgb | def rgba_to_rgb(color, bg='rgb(255,255,255)'):
"""
Converts from rgba to rgb
Parameters:
-----------
color : string
Color representation in rgba
bg : string
Color representation in rgb
Example:
rgba_to_rgb('rgb(23,25,24,.4... | python | def rgba_to_rgb(color, bg='rgb(255,255,255)'):
"""
Converts from rgba to rgb
Parameters:
-----------
color : string
Color representation in rgba
bg : string
Color representation in rgb
Example:
rgba_to_rgb('rgb(23,25,24,.4... | [
"def",
"rgba_to_rgb",
"(",
"color",
",",
"bg",
"=",
"'rgb(255,255,255)'",
")",
":",
"def",
"c_tup",
"(",
"c",
")",
":",
"return",
"eval",
"(",
"c",
"[",
"c",
".",
"find",
"(",
"'('",
")",
":",
"]",
")",
"color",
"=",
"c_tup",
"(",
"color",
")",
... | Converts from rgba to rgb
Parameters:
-----------
color : string
Color representation in rgba
bg : string
Color representation in rgb
Example:
rgba_to_rgb('rgb(23,25,24,.4)'' | [
"Converts",
"from",
"rgba",
"to",
"rgb"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L122-L143 | train | Converts from rgba to rgb | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | hex_to_hsv | def hex_to_hsv(color):
"""
Converts from hex to hsv
Parameters:
-----------
color : string
Color representation on color
Example:
hex_to_hsv('#ff9933')
"""
color = normalize(color)
color = color[1:]
# color=tuple(ord(c)/255.0 for c in col... | python | def hex_to_hsv(color):
"""
Converts from hex to hsv
Parameters:
-----------
color : string
Color representation on color
Example:
hex_to_hsv('#ff9933')
"""
color = normalize(color)
color = color[1:]
# color=tuple(ord(c)/255.0 for c in col... | [
"def",
"hex_to_hsv",
"(",
"color",
")",
":",
"color",
"=",
"normalize",
"(",
"color",
")",
"color",
"=",
"color",
"[",
"1",
":",
"]",
"# color=tuple(ord(c)/255.0 for c in color.decode('hex'))",
"color",
"=",
"(",
"int",
"(",
"color",
"[",
"0",
":",
"2",
"]... | Converts from hex to hsv
Parameters:
-----------
color : string
Color representation on color
Example:
hex_to_hsv('#ff9933') | [
"Converts",
"from",
"hex",
"to",
"hsv"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L146-L163 | train | Converts from hex to hsv | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | color_range | def color_range(color, N=20):
"""
Generates a scale of colours from a base colour
Parameters:
-----------
color : string
Color representation in hex
N : int
number of colours to generate
Example:
color_range('#ff9933',20... | python | def color_range(color, N=20):
"""
Generates a scale of colours from a base colour
Parameters:
-----------
color : string
Color representation in hex
N : int
number of colours to generate
Example:
color_range('#ff9933',20... | [
"def",
"color_range",
"(",
"color",
",",
"N",
"=",
"20",
")",
":",
"color",
"=",
"normalize",
"(",
"color",
")",
"org",
"=",
"color",
"color",
"=",
"hex_to_hsv",
"(",
"color",
")",
"HSV_tuples",
"=",
"[",
"(",
"color",
"[",
"0",
"]",
",",
"x",
",... | Generates a scale of colours from a base colour
Parameters:
-----------
color : string
Color representation in hex
N : int
number of colours to generate
Example:
color_range('#ff9933',20) | [
"Generates",
"a",
"scale",
"of",
"colours",
"from",
"a",
"base",
"colour"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L166-L195 | train | Generates a scale of colours from a base colour. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | color_table | def color_table(color, N=1, sort=False, sort_values=False, inline=False, as_html=False):
"""
Generates a colour table
Parameters:
-----------
color : string | list | dict
Color representation in rgba|rgb|hex
If a list of colors is passed then these
... | python | def color_table(color, N=1, sort=False, sort_values=False, inline=False, as_html=False):
"""
Generates a colour table
Parameters:
-----------
color : string | list | dict
Color representation in rgba|rgb|hex
If a list of colors is passed then these
... | [
"def",
"color_table",
"(",
"color",
",",
"N",
"=",
"1",
",",
"sort",
"=",
"False",
",",
"sort_values",
"=",
"False",
",",
"inline",
"=",
"False",
",",
"as_html",
"=",
"False",
")",
":",
"if",
"isinstance",
"(",
"color",
",",
"list",
")",
":",
"c_",... | Generates a colour table
Parameters:
-----------
color : string | list | dict
Color representation in rgba|rgb|hex
If a list of colors is passed then these
are displayed in a table
N : int
number of colou... | [
"Generates",
"a",
"colour",
"table"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L198-L281 | train | Generates a colour table for a single or multi - line color. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | colorgen | def colorgen(colors=None, n=None, scale=None, theme=None):
"""
Returns a generator with a list of colors
and gradients of those colors
Parameters:
-----------
colors : list(colors)
List of colors to use
Example:
colorgen()
colorgen(['blue... | python | def colorgen(colors=None, n=None, scale=None, theme=None):
"""
Returns a generator with a list of colors
and gradients of those colors
Parameters:
-----------
colors : list(colors)
List of colors to use
Example:
colorgen()
colorgen(['blue... | [
"def",
"colorgen",
"(",
"colors",
"=",
"None",
",",
"n",
"=",
"None",
",",
"scale",
"=",
"None",
",",
"theme",
"=",
"None",
")",
":",
"from",
".",
"themes",
"import",
"THEMES",
"step",
"=",
".1",
"if",
"not",
"colors",
":",
"if",
"not",
"scale",
... | Returns a generator with a list of colors
and gradients of those colors
Parameters:
-----------
colors : list(colors)
List of colors to use
Example:
colorgen()
colorgen(['blue','red','pink'])
colorgen(['#f03','rgb(23,25,25)']) | [
"Returns",
"a",
"generator",
"with",
"a",
"list",
"of",
"colors",
"and",
"gradients",
"of",
"those",
"colors"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L284-L316 | train | Generates a generator that yields a list of colors and gradients of those colors. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | scales | def scales(scale=None):
"""
Displays a color scale (HTML)
Parameters:
-----------
scale : str
Color scale name
If no scale name is provided then all scales are returned
(max number for each scale)
If sca... | python | def scales(scale=None):
"""
Displays a color scale (HTML)
Parameters:
-----------
scale : str
Color scale name
If no scale name is provided then all scales are returned
(max number for each scale)
If sca... | [
"def",
"scales",
"(",
"scale",
"=",
"None",
")",
":",
"if",
"scale",
":",
"if",
"scale",
"==",
"'all'",
":",
"display",
"(",
"HTML",
"(",
"cl",
".",
"to_html",
"(",
"_scales",
")",
")",
")",
"else",
":",
"display",
"(",
"HTML",
"(",
"cl",
".",
... | Displays a color scale (HTML)
Parameters:
-----------
scale : str
Color scale name
If no scale name is provided then all scales are returned
(max number for each scale)
If scale='all' then all scale combinations... | [
"Displays",
"a",
"color",
"scale",
"(",
"HTML",
")"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L594-L625 | train | Displays a list of available color scales for the current locale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | get_scales | def get_scales(scale=None, n=None):
"""
Returns a color scale
Parameters:
-----------
scale : str
Color scale name
If the color name is preceded by a minus (-)
then the scale is inversed
n : int
Nu... | python | def get_scales(scale=None, n=None):
"""
Returns a color scale
Parameters:
-----------
scale : str
Color scale name
If the color name is preceded by a minus (-)
then the scale is inversed
n : int
Nu... | [
"def",
"get_scales",
"(",
"scale",
"=",
"None",
",",
"n",
"=",
"None",
")",
":",
"if",
"scale",
":",
"is_reverse",
"=",
"False",
"if",
"scale",
"[",
"0",
"]",
"==",
"'-'",
":",
"scale",
"=",
"scale",
"[",
"1",
":",
"]",
"is_reverse",
"=",
"True",... | Returns a color scale
Parameters:
-----------
scale : str
Color scale name
If the color name is preceded by a minus (-)
then the scale is inversed
n : int
Number of colors
If n < numbe... | [
"Returns",
"a",
"color",
"scale"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L667-L714 | train | Returns a list of colors available for a given scale. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/colors.py | get_colorscale | def get_colorscale(scale):
"""
Returns a color scale to be used for a plotly figure
Parameters:
-----------
scale : str or list
Color scale name
If the color name is preceded by a minus (-)
then the scale is inversed.
... | python | def get_colorscale(scale):
"""
Returns a color scale to be used for a plotly figure
Parameters:
-----------
scale : str or list
Color scale name
If the color name is preceded by a minus (-)
then the scale is inversed.
... | [
"def",
"get_colorscale",
"(",
"scale",
")",
":",
"if",
"type",
"(",
"scale",
")",
"in",
"string_types",
":",
"scale",
"=",
"get_scales",
"(",
"scale",
")",
"else",
":",
"if",
"type",
"(",
"scale",
")",
"!=",
"list",
":",
"raise",
"Exception",
"(",
"\... | Returns a color scale to be used for a plotly figure
Parameters:
-----------
scale : str or list
Color scale name
If the color name is preceded by a minus (-)
then the scale is inversed.
Also accepts a list of colors (... | [
"Returns",
"a",
"color",
"scale",
"to",
"be",
"used",
"for",
"a",
"plotly",
"figure"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/colors.py#L717-L743 | train | Returns a color scale to be used for a plotly figure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/plotlytools.py | _to_iplot | def _to_iplot(self,colors=None,colorscale=None,kind='scatter',mode='lines',interpolation='linear',symbol='dot',size='12',fill=False,
width=3,dash='solid',sortbars=False,keys=False,bestfit=False,bestfit_colors=None,opacity=0.6,
mean=False,mean_colors=None,asDates=False,asTimestamp=False,text=None,**kwargs):
"""
Ge... | python | def _to_iplot(self,colors=None,colorscale=None,kind='scatter',mode='lines',interpolation='linear',symbol='dot',size='12',fill=False,
width=3,dash='solid',sortbars=False,keys=False,bestfit=False,bestfit_colors=None,opacity=0.6,
mean=False,mean_colors=None,asDates=False,asTimestamp=False,text=None,**kwargs):
"""
Ge... | [
"def",
"_to_iplot",
"(",
"self",
",",
"colors",
"=",
"None",
",",
"colorscale",
"=",
"None",
",",
"kind",
"=",
"'scatter'",
",",
"mode",
"=",
"'lines'",
",",
"interpolation",
"=",
"'linear'",
",",
"symbol",
"=",
"'dot'",
",",
"size",
"=",
"'12'",
",",
... | Generates a plotly Data object
Parameters
----------
colors : list or dict
{key:color} to specify the color for each column
[colors] to use the colors in the defined order
colorscale : str
Color scale name
Only valid if 'colors' is null
See cufflinks.colors.scales() for available scales
kind :... | [
"Generates",
"a",
"plotly",
"Data",
"object"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L37-L198 | train | This function returns a string that can be used to create a plotly object for the given object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/plotlytools.py | _iplot | def _iplot(self,kind='scatter',data=None,layout=None,filename='',sharing=None,title='',xTitle='',yTitle='',zTitle='',theme=None,colors=None,colorscale=None,fill=False,width=None,
dash='solid',mode='',interpolation='linear',symbol='circle',size=12,barmode='',sortbars=False,bargap=None,bargroupgap=None,bins=None,histn... | python | def _iplot(self,kind='scatter',data=None,layout=None,filename='',sharing=None,title='',xTitle='',yTitle='',zTitle='',theme=None,colors=None,colorscale=None,fill=False,width=None,
dash='solid',mode='',interpolation='linear',symbol='circle',size=12,barmode='',sortbars=False,bargap=None,bargroupgap=None,bins=None,histn... | [
"def",
"_iplot",
"(",
"self",
",",
"kind",
"=",
"'scatter'",
",",
"data",
"=",
"None",
",",
"layout",
"=",
"None",
",",
"filename",
"=",
"''",
",",
"sharing",
"=",
"None",
",",
"title",
"=",
"''",
",",
"xTitle",
"=",
"''",
",",
"yTitle",
"=",
"''... | Returns a plotly chart either as inline chart, image of Figure object
Parameters:
-----------
kind : string
Kind of chart
scatter
bar
box
spread
ratio
heatmap
surface
histogram
bubble
bubble3d
scatter3d
scattergeo
ohlc
candle
pie
choroplet
data... | [
"Returns",
"a",
"plotly",
"chart",
"either",
"as",
"inline",
"chart",
"image",
"of",
"Figure",
"object"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L200-L1217 | train | Function to plot a series of objects in the DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/plotlytools.py | get_items_as_list | def get_items_as_list(items,keys,items_names='styles'):
"""
Returns a dict with an item per key
Parameters:
-----------
items : string, list or dict
Items (ie line styles)
keys: list
List of keys
items_names : string
Name of items
"""
if type(items)!=dict:
if type(items)==list:
if len(items... | python | def get_items_as_list(items,keys,items_names='styles'):
"""
Returns a dict with an item per key
Parameters:
-----------
items : string, list or dict
Items (ie line styles)
keys: list
List of keys
items_names : string
Name of items
"""
if type(items)!=dict:
if type(items)==list:
if len(items... | [
"def",
"get_items_as_list",
"(",
"items",
",",
"keys",
",",
"items_names",
"=",
"'styles'",
")",
":",
"if",
"type",
"(",
"items",
")",
"!=",
"dict",
":",
"if",
"type",
"(",
"items",
")",
"==",
"list",
":",
"if",
"len",
"(",
"items",
")",
"!=",
"len... | Returns a dict with an item per key
Parameters:
-----------
items : string, list or dict
Items (ie line styles)
keys: list
List of keys
items_names : string
Name of items | [
"Returns",
"a",
"dict",
"with",
"an",
"item",
"per",
"key"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L1234-L1255 | train | Returns a dict with an item per key | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/plotlytools.py | _scatter_matrix | def _scatter_matrix(self,theme=None,bins=10,color='grey',size=2, asFigure=False, **iplot_kwargs):
"""
Displays a matrix with scatter plot for each pair of
Series in the DataFrame.
The diagonal shows a histogram for each of the Series
Parameters:
-----------
df : DataFrame
Pandas DataFrame
theme : string
... | python | def _scatter_matrix(self,theme=None,bins=10,color='grey',size=2, asFigure=False, **iplot_kwargs):
"""
Displays a matrix with scatter plot for each pair of
Series in the DataFrame.
The diagonal shows a histogram for each of the Series
Parameters:
-----------
df : DataFrame
Pandas DataFrame
theme : string
... | [
"def",
"_scatter_matrix",
"(",
"self",
",",
"theme",
"=",
"None",
",",
"bins",
"=",
"10",
",",
"color",
"=",
"'grey'",
",",
"size",
"=",
"2",
",",
"asFigure",
"=",
"False",
",",
"*",
"*",
"iplot_kwargs",
")",
":",
"sm",
"=",
"tools",
".",
"scatter_... | Displays a matrix with scatter plot for each pair of
Series in the DataFrame.
The diagonal shows a histogram for each of the Series
Parameters:
-----------
df : DataFrame
Pandas DataFrame
theme : string
Theme to be used (if not the default)
bins : int
Number of bins to use for histogram
color : s... | [
"Displays",
"a",
"matrix",
"with",
"scatter",
"plot",
"for",
"each",
"pair",
"of",
"Series",
"in",
"the",
"DataFrame",
".",
"The",
"diagonal",
"shows",
"a",
"histogram",
"for",
"each",
"of",
"the",
"Series"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L1258-L1283 | train | Displays a matrix with scatter plot for each pair of
Series in the DataFrame. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/plotlytools.py | iplot | def iplot(figure,validate=True,sharing=None,filename='',
online=None,asImage=False,asUrl=False,asPlot=False,
dimensions=None,display_image=True,**kwargs):
"""
Plots a figure in IPython, creates an HTML or generates an Image
figure : figure
Plotly figure to be charted
validate : bool
If True then all va... | python | def iplot(figure,validate=True,sharing=None,filename='',
online=None,asImage=False,asUrl=False,asPlot=False,
dimensions=None,display_image=True,**kwargs):
"""
Plots a figure in IPython, creates an HTML or generates an Image
figure : figure
Plotly figure to be charted
validate : bool
If True then all va... | [
"def",
"iplot",
"(",
"figure",
",",
"validate",
"=",
"True",
",",
"sharing",
"=",
"None",
",",
"filename",
"=",
"''",
",",
"online",
"=",
"None",
",",
"asImage",
"=",
"False",
",",
"asUrl",
"=",
"False",
",",
"asPlot",
"=",
"False",
",",
"dimensions"... | Plots a figure in IPython, creates an HTML or generates an Image
figure : figure
Plotly figure to be charted
validate : bool
If True then all values are validated before
it is charted
sharing : string
Sets the sharing level permission
public - anyone can see this chart
private - only you can see this... | [
"Plots",
"a",
"figure",
"in",
"IPython",
"creates",
"an",
"HTML",
"or",
"generates",
"an",
"Image"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L1321-L1463 | train | This function is used to plot a figure in IPython notebook. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/plotlytools.py | _ta_plot | def _ta_plot(self,study,periods=14,column=None,include=True,str='{name}({period})',detail=False,
theme=None,sharing=None,filename='',asFigure=False,**iplot_kwargs):
"""
Generates a Technical Study Chart
Parameters:
-----------
study : string
Technical Study to be charted
sma - 'Simple Moving Averag... | python | def _ta_plot(self,study,periods=14,column=None,include=True,str='{name}({period})',detail=False,
theme=None,sharing=None,filename='',asFigure=False,**iplot_kwargs):
"""
Generates a Technical Study Chart
Parameters:
-----------
study : string
Technical Study to be charted
sma - 'Simple Moving Averag... | [
"def",
"_ta_plot",
"(",
"self",
",",
"study",
",",
"periods",
"=",
"14",
",",
"column",
"=",
"None",
",",
"include",
"=",
"True",
",",
"str",
"=",
"'{name}({period})'",
",",
"detail",
"=",
"False",
",",
"theme",
"=",
"None",
",",
"sharing",
"=",
"Non... | Generates a Technical Study Chart
Parameters:
-----------
study : string
Technical Study to be charted
sma - 'Simple Moving Average'
rsi - 'R Strength Indicator'
periods : int
Number of periods
column : string
Name of the column on which the
study will be done
include : bool
... | [
"Generates",
"a",
"Technical",
"Study",
"Chart"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L1480-L1655 | train | This function generates a TA chart for the given study and periods. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/plotlytools.py | _fig_iplot | def _fig_iplot(self,validate=True,sharing=None,filename='',
online=None,asImage=False,asUrl=False,asPlot=False,
dimensions=None,display_image=True,**kwargs):
"""
Plots a figure in IPython
figure : figure
Plotly figure to be charted
validate : bool
If True then all values are validated before
it is c... | python | def _fig_iplot(self,validate=True,sharing=None,filename='',
online=None,asImage=False,asUrl=False,asPlot=False,
dimensions=None,display_image=True,**kwargs):
"""
Plots a figure in IPython
figure : figure
Plotly figure to be charted
validate : bool
If True then all values are validated before
it is c... | [
"def",
"_fig_iplot",
"(",
"self",
",",
"validate",
"=",
"True",
",",
"sharing",
"=",
"None",
",",
"filename",
"=",
"''",
",",
"online",
"=",
"None",
",",
"asImage",
"=",
"False",
",",
"asUrl",
"=",
"False",
",",
"asPlot",
"=",
"False",
",",
"dimensio... | Plots a figure in IPython
figure : figure
Plotly figure to be charted
validate : bool
If True then all values are validated before
it is charted
sharing : string
Sets the sharing level permission
public - anyone can see this chart
private - only you can see this chart
secret - only people with the... | [
"Plots",
"a",
"figure",
"in",
"IPython"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/plotlytools.py#L1657-L1715 | train | Function that returns a figure in IPython notebook. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/auth.py | ensure_local_files | def ensure_local_files():
"""
Ensure that filesystem is setup/filled out in a valid way
"""
if _file_permissions:
if not os.path.isdir(AUTH_DIR):
os.mkdir(AUTH_DIR)
for fn in [CONFIG_FILE]:
contents = load_json_dict(fn)
for key, val in list(_FILE_CONTENT[fn].items()):
if key not in contents:
c... | python | def ensure_local_files():
"""
Ensure that filesystem is setup/filled out in a valid way
"""
if _file_permissions:
if not os.path.isdir(AUTH_DIR):
os.mkdir(AUTH_DIR)
for fn in [CONFIG_FILE]:
contents = load_json_dict(fn)
for key, val in list(_FILE_CONTENT[fn].items()):
if key not in contents:
c... | [
"def",
"ensure_local_files",
"(",
")",
":",
"if",
"_file_permissions",
":",
"if",
"not",
"os",
".",
"path",
".",
"isdir",
"(",
"AUTH_DIR",
")",
":",
"os",
".",
"mkdir",
"(",
"AUTH_DIR",
")",
"for",
"fn",
"in",
"[",
"CONFIG_FILE",
"]",
":",
"contents",
... | Ensure that filesystem is setup/filled out in a valid way | [
"Ensure",
"that",
"filesystem",
"is",
"setup",
"/",
"filled",
"out",
"in",
"a",
"valid",
"way"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/auth.py#L64-L83 | train | Ensure that all local files are set in a valid way. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/auth.py | set_config_file | def set_config_file(sharing=None,theme=None,colorscale=None,offline=None,offline_connected=None,
offline_url=None,offline_show_link=None,offline_link_text=None,
offline_config=None,
datagen_mode=None,**kwargs):
"""
Set the keyword-value pairs in `~/.config`.
sharing : string
Sets the sharing level... | python | def set_config_file(sharing=None,theme=None,colorscale=None,offline=None,offline_connected=None,
offline_url=None,offline_show_link=None,offline_link_text=None,
offline_config=None,
datagen_mode=None,**kwargs):
"""
Set the keyword-value pairs in `~/.config`.
sharing : string
Sets the sharing level... | [
"def",
"set_config_file",
"(",
"sharing",
"=",
"None",
",",
"theme",
"=",
"None",
",",
"colorscale",
"=",
"None",
",",
"offline",
"=",
"None",
",",
"offline_connected",
"=",
"None",
",",
"offline_url",
"=",
"None",
",",
"offline_show_link",
"=",
"None",
",... | Set the keyword-value pairs in `~/.config`.
sharing : string
Sets the sharing level permission
public - anyone can see this chart
private - only you can see this chart
secret - only people with the link can see the chart
theme : string
Sets the default theme
See cufflinks.getThemes() for availab... | [
"Set",
"the",
"keyword",
"-",
"value",
"pairs",
"in",
"~",
"/",
".",
"config",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/auth.py#L86-L174 | train | Set the config file for the current chart. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/auth.py | load_json_dict | def load_json_dict(filename, *args):
"""Checks if file exists. Returns {} if something fails."""
data = {}
if os.path.exists(filename):
with open(filename, "r") as f:
try:
data = json.load(f)
if not isinstance(data, dict):
data = {}
except:
pass
if args:
return {key: data[key] for key ... | python | def load_json_dict(filename, *args):
"""Checks if file exists. Returns {} if something fails."""
data = {}
if os.path.exists(filename):
with open(filename, "r") as f:
try:
data = json.load(f)
if not isinstance(data, dict):
data = {}
except:
pass
if args:
return {key: data[key] for key ... | [
"def",
"load_json_dict",
"(",
"filename",
",",
"*",
"args",
")",
":",
"data",
"=",
"{",
"}",
"if",
"os",
".",
"path",
".",
"exists",
"(",
"filename",
")",
":",
"with",
"open",
"(",
"filename",
",",
"\"r\"",
")",
"as",
"f",
":",
"try",
":",
"data"... | Checks if file exists. Returns {} if something fails. | [
"Checks",
"if",
"file",
"exists",
".",
"Returns",
"{}",
"if",
"something",
"fails",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/auth.py#L193-L206 | train | Checks if file exists. Returns {} if something fails. Returns {} if something fails. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/auth.py | save_json_dict | def save_json_dict(filename, json_dict):
"""Will error if filename is not appropriate, but it's checked elsewhere.
"""
if isinstance(json_dict, dict):
with open(filename, "w") as f:
f.write(json.dumps(json_dict, indent=4))
else:
raise TypeError("json_dict was not a dictionay. couldn't save.") | python | def save_json_dict(filename, json_dict):
"""Will error if filename is not appropriate, but it's checked elsewhere.
"""
if isinstance(json_dict, dict):
with open(filename, "w") as f:
f.write(json.dumps(json_dict, indent=4))
else:
raise TypeError("json_dict was not a dictionay. couldn't save.") | [
"def",
"save_json_dict",
"(",
"filename",
",",
"json_dict",
")",
":",
"if",
"isinstance",
"(",
"json_dict",
",",
"dict",
")",
":",
"with",
"open",
"(",
"filename",
",",
"\"w\"",
")",
"as",
"f",
":",
"f",
".",
"write",
"(",
"json",
".",
"dumps",
"(",
... | Will error if filename is not appropriate, but it's checked elsewhere. | [
"Will",
"error",
"if",
"filename",
"is",
"not",
"appropriate",
"but",
"it",
"s",
"checked",
"elsewhere",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/auth.py#L209-L216 | train | Will error if filename is not appropriate but it s checked elsewhere. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig._get_schema | def _get_schema(self):
"""
Returns a dictionary with the schema for a QuantFigure
"""
d={}
layout_kwargs=dict((_,'') for _ in get_layout_kwargs())
for _ in ('data','layout','theme','panels'):
d[_]={}
for __ in eval('__QUANT_FIGURE_{0}'.format(_.upper())):
layout_kwargs.pop(__,None)
d[_][__]=N... | python | def _get_schema(self):
"""
Returns a dictionary with the schema for a QuantFigure
"""
d={}
layout_kwargs=dict((_,'') for _ in get_layout_kwargs())
for _ in ('data','layout','theme','panels'):
d[_]={}
for __ in eval('__QUANT_FIGURE_{0}'.format(_.upper())):
layout_kwargs.pop(__,None)
d[_][__]=N... | [
"def",
"_get_schema",
"(",
"self",
")",
":",
"d",
"=",
"{",
"}",
"layout_kwargs",
"=",
"dict",
"(",
"(",
"_",
",",
"''",
")",
"for",
"_",
"in",
"get_layout_kwargs",
"(",
")",
")",
"for",
"_",
"in",
"(",
"'data'",
",",
"'layout'",
",",
"'theme'",
... | Returns a dictionary with the schema for a QuantFigure | [
"Returns",
"a",
"dictionary",
"with",
"the",
"schema",
"for",
"a",
"QuantFigure"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L107-L124 | train | Returns a dictionary with the schema for a QuantFigure
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig._get_sliced | def _get_sliced(self,slice,df=None):
"""
Returns a sliced DataFrame
Parameters
----------
slice : tuple(from,to)
from : str
to : str
States the 'from' and 'to' values which
will get rendered as df.ix[from:to]
df : DataFrame
If omitted then the QuantFigure.DataFrame is resampled.
... | python | def _get_sliced(self,slice,df=None):
"""
Returns a sliced DataFrame
Parameters
----------
slice : tuple(from,to)
from : str
to : str
States the 'from' and 'to' values which
will get rendered as df.ix[from:to]
df : DataFrame
If omitted then the QuantFigure.DataFrame is resampled.
... | [
"def",
"_get_sliced",
"(",
"self",
",",
"slice",
",",
"df",
"=",
"None",
")",
":",
"df",
"=",
"self",
".",
"df",
".",
"copy",
"(",
")",
"if",
"df",
"==",
"None",
"else",
"df",
"if",
"type",
"(",
"slice",
")",
"not",
"in",
"(",
"list",
",",
"t... | Returns a sliced DataFrame
Parameters
----------
slice : tuple(from,to)
from : str
to : str
States the 'from' and 'to' values which
will get rendered as df.ix[from:to]
df : DataFrame
If omitted then the QuantFigure.DataFrame is resampled. | [
"Returns",
"a",
"sliced",
"DataFrame"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L126-L149 | train | Returns a sliced DataFrame | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig._get_resampled | def _get_resampled(self,rule,how={'ohlc':'last','volume':'sum'},df=None,**kwargs):
"""
Returns a resampled DataFrame
Parameters
----------
rule : str
the offset string or object representing target conversion
for all aliases available see http://pandas.pydata.org/pandas-docs/stable/timeseries.html#o... | python | def _get_resampled(self,rule,how={'ohlc':'last','volume':'sum'},df=None,**kwargs):
"""
Returns a resampled DataFrame
Parameters
----------
rule : str
the offset string or object representing target conversion
for all aliases available see http://pandas.pydata.org/pandas-docs/stable/timeseries.html#o... | [
"def",
"_get_resampled",
"(",
"self",
",",
"rule",
",",
"how",
"=",
"{",
"'ohlc'",
":",
"'last'",
",",
"'volume'",
":",
"'sum'",
"}",
",",
"df",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"df",
"=",
"self",
".",
"df",
".",
"copy",
"(",
")"... | Returns a resampled DataFrame
Parameters
----------
rule : str
the offset string or object representing target conversion
for all aliases available see http://pandas.pydata.org/pandas-docs/stable/timeseries.html#offset-aliases
how : str or dict
states the form in which the resampling will be done... | [
"Returns",
"a",
"resampled",
"DataFrame"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L151-L184 | train | Returns a resampled DataFrame with the given rule | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.update | def update(self,**kwargs):
"""
Updates the values for a QuantFigure
The key-values are automatically assigned to the correct
section of the QuantFigure
"""
if 'columns' in kwargs:
self._d=ta._ohlc_dict(self.df,columns=kwargs.pop('columns',None))
schema=self._get_schema()
annotations=kwargs.pop('anno... | python | def update(self,**kwargs):
"""
Updates the values for a QuantFigure
The key-values are automatically assigned to the correct
section of the QuantFigure
"""
if 'columns' in kwargs:
self._d=ta._ohlc_dict(self.df,columns=kwargs.pop('columns',None))
schema=self._get_schema()
annotations=kwargs.pop('anno... | [
"def",
"update",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"'columns'",
"in",
"kwargs",
":",
"self",
".",
"_d",
"=",
"ta",
".",
"_ohlc_dict",
"(",
"self",
".",
"df",
",",
"columns",
"=",
"kwargs",
".",
"pop",
"(",
"'columns'",
",",
"N... | Updates the values for a QuantFigure
The key-values are automatically assigned to the correct
section of the QuantFigure | [
"Updates",
"the",
"values",
"for",
"a",
"QuantFigure",
"The",
"key",
"-",
"values",
"are",
"automatically",
"assigned",
"to",
"the",
"correct",
"section",
"of",
"the",
"QuantFigure"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L186-L203 | train | Updates the values for a QuantFigure
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.delete | def delete(self,*args):
"""
Deletes the values for a QuantFigure
The key-values are automatically deleted from the correct
section of the QuantFigure
"""
if args:
args=args[0] if utils.is_list(args[0]) else args
path=utils.dict_path(self.__dict__)
for _ in args:
if _ in self.__dict__.keys():
... | python | def delete(self,*args):
"""
Deletes the values for a QuantFigure
The key-values are automatically deleted from the correct
section of the QuantFigure
"""
if args:
args=args[0] if utils.is_list(args[0]) else args
path=utils.dict_path(self.__dict__)
for _ in args:
if _ in self.__dict__.keys():
... | [
"def",
"delete",
"(",
"self",
",",
"*",
"args",
")",
":",
"if",
"args",
":",
"args",
"=",
"args",
"[",
"0",
"]",
"if",
"utils",
".",
"is_list",
"(",
"args",
"[",
"0",
"]",
")",
"else",
"args",
"path",
"=",
"utils",
".",
"dict_path",
"(",
"self"... | Deletes the values for a QuantFigure
The key-values are automatically deleted from the correct
section of the QuantFigure | [
"Deletes",
"the",
"values",
"for",
"a",
"QuantFigure",
"The",
"key",
"-",
"values",
"are",
"automatically",
"deleted",
"from",
"the",
"correct",
"section",
"of",
"the",
"QuantFigure"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L205-L227 | train | Deletes the values for a QuantFigure
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig._panel_domains | def _panel_domains(self,n=2,min_panel_size=.15,spacing=0.08,top_margin=1,bottom_margin=0):
"""
Returns the panel domains for each axis
"""
d={}
for _ in range(n+1,1,-1):
lower=round(bottom_margin+(min_panel_size+spacing)*(n+1-_),2)
d['yaxis{0}'.format(_)]=dict(domain=(lower,lower+min_panel_size))
... | python | def _panel_domains(self,n=2,min_panel_size=.15,spacing=0.08,top_margin=1,bottom_margin=0):
"""
Returns the panel domains for each axis
"""
d={}
for _ in range(n+1,1,-1):
lower=round(bottom_margin+(min_panel_size+spacing)*(n+1-_),2)
d['yaxis{0}'.format(_)]=dict(domain=(lower,lower+min_panel_size))
... | [
"def",
"_panel_domains",
"(",
"self",
",",
"n",
"=",
"2",
",",
"min_panel_size",
"=",
".15",
",",
"spacing",
"=",
"0.08",
",",
"top_margin",
"=",
"1",
",",
"bottom_margin",
"=",
"0",
")",
":",
"d",
"=",
"{",
"}",
"for",
"_",
"in",
"range",
"(",
"... | Returns the panel domains for each axis | [
"Returns",
"the",
"panel",
"domains",
"for",
"each",
"axis"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L239-L251 | train | Returns the panel domains for each axis. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig._get_trendline | def _get_trendline(self,date0=None,date1=None,on=None,kind='trend',to_strfmt='%Y-%m-%d',from_strfmt='%d%b%y',**kwargs):
"""
Returns a trendline (line), support or resistance
Parameters:
date0 : string
Trendline starting date
date1 : string
Trendline end date
on : string
Indicate the data... | python | def _get_trendline(self,date0=None,date1=None,on=None,kind='trend',to_strfmt='%Y-%m-%d',from_strfmt='%d%b%y',**kwargs):
"""
Returns a trendline (line), support or resistance
Parameters:
date0 : string
Trendline starting date
date1 : string
Trendline end date
on : string
Indicate the data... | [
"def",
"_get_trendline",
"(",
"self",
",",
"date0",
"=",
"None",
",",
"date1",
"=",
"None",
",",
"on",
"=",
"None",
",",
"kind",
"=",
"'trend'",
",",
"to_strfmt",
"=",
"'%Y-%m-%d'",
",",
"from_strfmt",
"=",
"'%d%b%y'",
",",
"*",
"*",
"kwargs",
")",
"... | Returns a trendline (line), support or resistance
Parameters:
date0 : string
Trendline starting date
date1 : string
Trendline end date
on : string
Indicate the data series in which the
trendline should be based.
'close'
'high'
'low'
'open'
kind : string
Def... | [
"Returns",
"a",
"trendline",
"(",
"line",
")",
"support",
"or",
"resistance"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L253-L340 | train | Returns a trendline object | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_trendline | def add_trendline(self,date0,date1,on='close',text=None,**kwargs):
"""
Adds a trendline to the QuantFigure.
Given 2 dates, the trendline is connected on the data points
that correspond to those dates.
Parameters:
date0 : string
Trendline starting date
date1 : string
Trendline end date
on ... | python | def add_trendline(self,date0,date1,on='close',text=None,**kwargs):
"""
Adds a trendline to the QuantFigure.
Given 2 dates, the trendline is connected on the data points
that correspond to those dates.
Parameters:
date0 : string
Trendline starting date
date1 : string
Trendline end date
on ... | [
"def",
"add_trendline",
"(",
"self",
",",
"date0",
",",
"date1",
",",
"on",
"=",
"'close'",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"d",
"=",
"{",
"'kind'",
":",
"'trend'",
",",
"'date0'",
":",
"date0",
",",
"'date1'",
":",
"... | Adds a trendline to the QuantFigure.
Given 2 dates, the trendline is connected on the data points
that correspond to those dates.
Parameters:
date0 : string
Trendline starting date
date1 : string
Trendline end date
on : string
Indicate the data series in which the
trendline should be... | [
"Adds",
"a",
"trendline",
"to",
"the",
"QuantFigure",
".",
"Given",
"2",
"dates",
"the",
"trendline",
"is",
"connected",
"on",
"the",
"data",
"points",
"that",
"correspond",
"to",
"those",
"dates",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L342-L377 | train | Adds a trendline to the QuantFigure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_support | def add_support(self,date,on='low',mode='starttoend',text=None,**kwargs):
"""
Adds a support line to the QuantFigure
Parameters:
date0 : string
The support line will be drawn at the 'y' level
value that corresponds to this date.
on : string
Indicate the data series in which the
support l... | python | def add_support(self,date,on='low',mode='starttoend',text=None,**kwargs):
"""
Adds a support line to the QuantFigure
Parameters:
date0 : string
The support line will be drawn at the 'y' level
value that corresponds to this date.
on : string
Indicate the data series in which the
support l... | [
"def",
"add_support",
"(",
"self",
",",
"date",
",",
"on",
"=",
"'low'",
",",
"mode",
"=",
"'starttoend'",
",",
"text",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"d",
"=",
"{",
"'kind'",
":",
"'support'",
",",
"'date'",
":",
"date",
",",
"'... | Adds a support line to the QuantFigure
Parameters:
date0 : string
The support line will be drawn at the 'y' level
value that corresponds to this date.
on : string
Indicate the data series in which the
support line should be based.
'close'
'high'
'low'
'open'
mode : str... | [
"Adds",
"a",
"support",
"line",
"to",
"the",
"QuantFigure"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L379-L417 | train | Adds a support line to the QuantFigure object. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_annotations | def add_annotations(self,annotations,**kwargs):
"""
Add an annotation to the QuantFigure.
Parameters:
annotations : dict or list(dict,)
Annotations can be on the form form of
{'date' : 'text'}
and the text will automatically be placed at the
right level on the chart
or
A Plotly... | python | def add_annotations(self,annotations,**kwargs):
"""
Add an annotation to the QuantFigure.
Parameters:
annotations : dict or list(dict,)
Annotations can be on the form form of
{'date' : 'text'}
and the text will automatically be placed at the
right level on the chart
or
A Plotly... | [
"def",
"add_annotations",
"(",
"self",
",",
"annotations",
",",
"*",
"*",
"kwargs",
")",
":",
"ann_kwargs",
"=",
"utils",
".",
"check_kwargs",
"(",
"kwargs",
",",
"get_annotation_kwargs",
"(",
")",
",",
"{",
"}",
",",
"clean_origin",
"=",
"True",
")",
"i... | Add an annotation to the QuantFigure.
Parameters:
annotations : dict or list(dict,)
Annotations can be on the form form of
{'date' : 'text'}
and the text will automatically be placed at the
right level on the chart
or
A Plotly fully defined annotation
kwargs :
fontcolor : st... | [
"Add",
"an",
"annotation",
"to",
"the",
"QuantFigure",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L459-L489 | train | Adds an annotation to the QuantFigure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_shapes | def add_shapes(self,**kwargs):
"""
Add a shape to the QuantFigure.
kwargs :
hline : int, list or dict
Draws a horizontal line at the
indicated y position(s)
Extra parameters can be passed in
the form of a dictionary (see shapes)
vline : int, list or dict
Draws a vertical line at the
... | python | def add_shapes(self,**kwargs):
"""
Add a shape to the QuantFigure.
kwargs :
hline : int, list or dict
Draws a horizontal line at the
indicated y position(s)
Extra parameters can be passed in
the form of a dictionary (see shapes)
vline : int, list or dict
Draws a vertical line at the
... | [
"def",
"add_shapes",
"(",
"self",
",",
"*",
"*",
"kwargs",
")",
":",
"kwargs",
"=",
"utils",
".",
"check_kwargs",
"(",
"kwargs",
",",
"get_shapes_kwargs",
"(",
")",
",",
"{",
"}",
",",
"clean_origin",
"=",
"True",
")",
"for",
"k",
",",
"v",
"in",
"... | Add a shape to the QuantFigure.
kwargs :
hline : int, list or dict
Draws a horizontal line at the
indicated y position(s)
Extra parameters can be passed in
the form of a dictionary (see shapes)
vline : int, list or dict
Draws a vertical line at the
indicated x position(s)
Extra pa... | [
"Add",
"a",
"shape",
"to",
"the",
"QuantFigure",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L491-L531 | train | Adds a shape to the QuantFigure. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig._add_study | def _add_study(self,study):
"""
Adds a study to QuantFigure.studies
Parameters:
study : dict
{'kind':study_kind,
'params':study_parameters,
'display':display_parameters}
"""
str='{study} {name}({period})' if study['params'].get('str',None)==None else study['params']['str']
study['params'][... | python | def _add_study(self,study):
"""
Adds a study to QuantFigure.studies
Parameters:
study : dict
{'kind':study_kind,
'params':study_parameters,
'display':display_parameters}
"""
str='{study} {name}({period})' if study['params'].get('str',None)==None else study['params']['str']
study['params'][... | [
"def",
"_add_study",
"(",
"self",
",",
"study",
")",
":",
"str",
"=",
"'{study} {name}({period})'",
"if",
"study",
"[",
"'params'",
"]",
".",
"get",
"(",
"'str'",
",",
"None",
")",
"==",
"None",
"else",
"study",
"[",
"'params'",
"]",
"[",
"'str'",
"]",... | Adds a study to QuantFigure.studies
Parameters:
study : dict
{'kind':study_kind,
'params':study_parameters,
'display':display_parameters} | [
"Adds",
"a",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L542-L580 | train | Adds a study to QuantFigure. studyies
if | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_volume | def add_volume(self,colorchange=True,column=None,name='',str='{name}',**kwargs):
"""
Add 'volume' study to QuantFigure.studies
Parameters:
colorchange : bool
If True then each volume bar will have a fill color
depending on if 'base' had a positive or negative
change compared to the previous value... | python | def add_volume(self,colorchange=True,column=None,name='',str='{name}',**kwargs):
"""
Add 'volume' study to QuantFigure.studies
Parameters:
colorchange : bool
If True then each volume bar will have a fill color
depending on if 'base' had a positive or negative
change compared to the previous value... | [
"def",
"add_volume",
"(",
"self",
",",
"colorchange",
"=",
"True",
",",
"column",
"=",
"None",
",",
"name",
"=",
"''",
",",
"str",
"=",
"'{name}'",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"column",
":",
"column",
"=",
"self",
".",
"_d",
"... | Add 'volume' study to QuantFigure.studies
Parameters:
colorchange : bool
If True then each volume bar will have a fill color
depending on if 'base' had a positive or negative
change compared to the previous value
If False then each volume bar will have a fill color
depending on if the volume... | [
"Add",
"volume",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L582-L627 | train | Add a volume study to QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_macd | def add_macd(self,fast_period=12,slow_period=26,signal_period=9,column=None,
name='',str=None,**kwargs):
"""
Add Moving Average Convergence Divergence (MACD) study to QuantFigure.studies
Parameters:
fast_period : int
MACD Fast Period
slow_period : int
MACD Slow Period
signal_period : int
... | python | def add_macd(self,fast_period=12,slow_period=26,signal_period=9,column=None,
name='',str=None,**kwargs):
"""
Add Moving Average Convergence Divergence (MACD) study to QuantFigure.studies
Parameters:
fast_period : int
MACD Fast Period
slow_period : int
MACD Slow Period
signal_period : int
... | [
"def",
"add_macd",
"(",
"self",
",",
"fast_period",
"=",
"12",
",",
"slow_period",
"=",
"26",
",",
"signal_period",
"=",
"9",
",",
"column",
"=",
"None",
",",
"name",
"=",
"''",
",",
"str",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"n... | Add Moving Average Convergence Divergence (MACD) study to QuantFigure.studies
Parameters:
fast_period : int
MACD Fast Period
slow_period : int
MACD Slow Period
signal_period : int
MACD Signal Period
column :string
Defines the data column name that contains the
data over which the stu... | [
"Add",
"Moving",
"Average",
"Convergence",
"Divergence",
"(",
"MACD",
")",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L629-L671 | train | Adds a MACD study to QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_sma | def add_sma(self,periods=20,column=None,name='',
str=None,**kwargs):
"""
Add Simple Moving Average (SMA) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
column :string
Defines the data column name that contains the
data over which the study will be ap... | python | def add_sma(self,periods=20,column=None,name='',
str=None,**kwargs):
"""
Add Simple Moving Average (SMA) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
column :string
Defines the data column name that contains the
data over which the study will be ap... | [
"def",
"add_sma",
"(",
"self",
",",
"periods",
"=",
"20",
",",
"column",
"=",
"None",
",",
"name",
"=",
"''",
",",
"str",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"not",
"column",
":",
"column",
"=",
"self",
".",
"_d",
"[",
"'close... | Add Simple Moving Average (SMA) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
column :string
Defines the data column name that contains the
data over which the study will be applied.
Default: 'close'
name : string
Name given to the study
str :... | [
"Add",
"Simple",
"Moving",
"Average",
"(",
"SMA",
")",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L674-L709 | train | Add a simple moving average study to QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_rsi | def add_rsi(self,periods=20,rsi_upper=70,rsi_lower=30,showbands=True,column=None,
name='',str=None,**kwargs):
"""
Add Relative Strength Indicator (RSI) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
rsi_upper : int
bounds [0,100]
Upper (overbough... | python | def add_rsi(self,periods=20,rsi_upper=70,rsi_lower=30,showbands=True,column=None,
name='',str=None,**kwargs):
"""
Add Relative Strength Indicator (RSI) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
rsi_upper : int
bounds [0,100]
Upper (overbough... | [
"def",
"add_rsi",
"(",
"self",
",",
"periods",
"=",
"20",
",",
"rsi_upper",
"=",
"70",
",",
"rsi_lower",
"=",
"30",
",",
"showbands",
"=",
"True",
",",
"column",
"=",
"None",
",",
"name",
"=",
"''",
",",
"str",
"=",
"None",
",",
"*",
"*",
"kwargs... | Add Relative Strength Indicator (RSI) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
rsi_upper : int
bounds [0,100]
Upper (overbought) level
rsi_lower : int
bounds [0,100]
Lower (oversold) level
showbands : boolean
If True, then the rsi_uppe... | [
"Add",
"Relative",
"Strength",
"Indicator",
"(",
"RSI",
")",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L711-L758 | train | Add Relative Strength Indicator to QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_bollinger_bands | def add_bollinger_bands(self,periods=20,boll_std=2,fill=True,column=None,name='',
str='{name}({column},{period})',**kwargs):
"""
Add Bollinger Bands (BOLL) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
boll_std : int
Number of standard deviations for... | python | def add_bollinger_bands(self,periods=20,boll_std=2,fill=True,column=None,name='',
str='{name}({column},{period})',**kwargs):
"""
Add Bollinger Bands (BOLL) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
boll_std : int
Number of standard deviations for... | [
"def",
"add_bollinger_bands",
"(",
"self",
",",
"periods",
"=",
"20",
",",
"boll_std",
"=",
"2",
",",
"fill",
"=",
"True",
",",
"column",
"=",
"None",
",",
"name",
"=",
"''",
",",
"str",
"=",
"'{name}({column},{period})'",
",",
"*",
"*",
"kwargs",
")",... | Add Bollinger Bands (BOLL) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
boll_std : int
Number of standard deviations for
the bollinger upper and lower bands
fill : boolean
If True, then the innner area of the
bands will filled
column :string
... | [
"Add",
"Bollinger",
"Bands",
"(",
"BOLL",
")",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L760-L805 | train | Adds a Bollinger Bands to the QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_cci | def add_cci(self,periods=14,cci_upper=100,cci_lower=-100,
showbands=True,str=None,name='',**kwargs):
"""
Commodity Channel Indicator study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
cci_upper : int
Upper bands level
default : 100
cci_lower : int
... | python | def add_cci(self,periods=14,cci_upper=100,cci_lower=-100,
showbands=True,str=None,name='',**kwargs):
"""
Commodity Channel Indicator study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
cci_upper : int
Upper bands level
default : 100
cci_lower : int
... | [
"def",
"add_cci",
"(",
"self",
",",
"periods",
"=",
"14",
",",
"cci_upper",
"=",
"100",
",",
"cci_lower",
"=",
"-",
"100",
",",
"showbands",
"=",
"True",
",",
"str",
"=",
"None",
",",
"name",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"study",... | Commodity Channel Indicator study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
cci_upper : int
Upper bands level
default : 100
cci_lower : int
Lower band level
default : -100
showbands : boolean
If True, then the cci_upper and
cci_lower level... | [
"Commodity",
"Channel",
"Indicator",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L844-L883 | train | Add a new CCI column to QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_ptps | def add_ptps(self,periods=14,af=0.2,initial='long',str=None,name='',**kwargs):
"""
Add Parabolic SAR (PTPS) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
af : float
acceleration factor
initial : 'long' or 'short'
Iniital position
default: long
n... | python | def add_ptps(self,periods=14,af=0.2,initial='long',str=None,name='',**kwargs):
"""
Add Parabolic SAR (PTPS) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
af : float
acceleration factor
initial : 'long' or 'short'
Iniital position
default: long
n... | [
"def",
"add_ptps",
"(",
"self",
",",
"periods",
"=",
"14",
",",
"af",
"=",
"0.2",
",",
"initial",
"=",
"'long'",
",",
"str",
"=",
"None",
",",
"name",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"study",
"=",
"{",
"'kind'",
":",
"'ptps'",
","... | Add Parabolic SAR (PTPS) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
af : float
acceleration factor
initial : 'long' or 'short'
Iniital position
default: long
name : string
Name given to the study
str : string
Label factory for studies
... | [
"Add",
"Parabolic",
"SAR",
"(",
"PTPS",
")",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L915-L948 | train | This method adds a Parabolic SAR study to QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/quant_figure.py | QuantFig.add_atr | def add_atr(self,periods=14,str=None,name='',**kwargs):
"""
Add Average True Range (ATR) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
name : string
Name given to the study
str : string
Label factory for studies
The following wildcards can be used:... | python | def add_atr(self,periods=14,str=None,name='',**kwargs):
"""
Add Average True Range (ATR) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
name : string
Name given to the study
str : string
Label factory for studies
The following wildcards can be used:... | [
"def",
"add_atr",
"(",
"self",
",",
"periods",
"=",
"14",
",",
"str",
"=",
"None",
",",
"name",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"study",
"=",
"{",
"'kind'",
":",
"'atr'",
",",
"'name'",
":",
"name",
",",
"'params'",
":",
"{",
"'pe... | Add Average True Range (ATR) study to QuantFigure.studies
Parameters:
periods : int or list(int)
Number of periods
name : string
Name given to the study
str : string
Label factory for studies
The following wildcards can be used:
{name} : Name of the column
{study} : Name of the stu... | [
"Add",
"Average",
"True",
"Range",
"(",
"ATR",
")",
"study",
"to",
"QuantFigure",
".",
"studies"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/quant_figure.py#L950-L978 | train | This method adds an ATR study to QuantFigure. studies
| Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/offline.py | go_offline | def go_offline(connected=None):
"""
connected : bool
If True, the plotly.js library will be loaded
from an online CDN. If False, the plotly.js library will be loaded locally
from the plotly python package
"""
from .auth import get_config_file
if connected is None:
try... | python | def go_offline(connected=None):
"""
connected : bool
If True, the plotly.js library will be loaded
from an online CDN. If False, the plotly.js library will be loaded locally
from the plotly python package
"""
from .auth import get_config_file
if connected is None:
try... | [
"def",
"go_offline",
"(",
"connected",
"=",
"None",
")",
":",
"from",
".",
"auth",
"import",
"get_config_file",
"if",
"connected",
"is",
"None",
":",
"try",
":",
"connected",
"=",
"True",
"if",
"get_config_file",
"(",
")",
"[",
"'offline_connected'",
"]",
... | connected : bool
If True, the plotly.js library will be loaded
from an online CDN. If False, the plotly.js library will be loaded locally
from the plotly python package | [
"connected",
":",
"bool",
"If",
"True",
"the",
"plotly",
".",
"js",
"library",
"will",
"be",
"loaded",
"from",
"an",
"online",
"CDN",
".",
"If",
"False",
"the",
"plotly",
".",
"js",
"library",
"will",
"be",
"loaded",
"locally",
"from",
"the",
"plotly",
... | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/offline.py#L13-L32 | train | Goes offline mode. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/pandastools.py | _screen | def _screen(self,include=True,**kwargs):
"""
Filters a DataFrame for columns that contain the given strings.
Parameters:
-----------
include : bool
If False then it will exclude items that match
the given filters.
This is the same as passing a regex ^keyword
kwargs :
Key value pairs that indicate... | python | def _screen(self,include=True,**kwargs):
"""
Filters a DataFrame for columns that contain the given strings.
Parameters:
-----------
include : bool
If False then it will exclude items that match
the given filters.
This is the same as passing a regex ^keyword
kwargs :
Key value pairs that indicate... | [
"def",
"_screen",
"(",
"self",
",",
"include",
"=",
"True",
",",
"*",
"*",
"kwargs",
")",
":",
"df",
"=",
"self",
".",
"copy",
"(",
")",
"for",
"k",
",",
"v",
"in",
"list",
"(",
"kwargs",
".",
"items",
"(",
")",
")",
":",
"v",
"=",
"[",
"v"... | Filters a DataFrame for columns that contain the given strings.
Parameters:
-----------
include : bool
If False then it will exclude items that match
the given filters.
This is the same as passing a regex ^keyword
kwargs :
Key value pairs that indicate the column and
value to screen for
Examp... | [
"Filters",
"a",
"DataFrame",
"for",
"columns",
"that",
"contain",
"the",
"given",
"strings",
".",
"Parameters",
":",
"-----------",
"include",
":",
"bool",
"If",
"False",
"then",
"it",
"will",
"exclude",
"items",
"that",
"match",
"the",
"given",
"filters",
"... | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/pandastools.py#L6-L29 | train | Returns a DataFrame that contains the given strings in the screen. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/pandastools.py | bestfit | def bestfit(self):
"""
Returns a series with the bestfit values.
Example:
Series.bestfit()
Returns: series
The returned series contains a parameter
called 'formula' which includes the string representation
of the bestfit line.
"""
# statsmodel cannot be included on requirements.txt
# see https://g... | python | def bestfit(self):
"""
Returns a series with the bestfit values.
Example:
Series.bestfit()
Returns: series
The returned series contains a parameter
called 'formula' which includes the string representation
of the bestfit line.
"""
# statsmodel cannot be included on requirements.txt
# see https://g... | [
"def",
"bestfit",
"(",
"self",
")",
":",
"# statsmodel cannot be included on requirements.txt",
"# see https://github.com/scikit-learn/scikit-learn/issues/4164",
"# which shares the same issue as statsmodel",
"try",
":",
"import",
"statsmodels",
".",
"api",
"as",
"sm",
"except",
... | Returns a series with the bestfit values.
Example:
Series.bestfit()
Returns: series
The returned series contains a parameter
called 'formula' which includes the string representation
of the bestfit line. | [
"Returns",
"a",
"series",
"with",
"the",
"bestfit",
"values",
".",
"Example",
":",
"Series",
".",
"bestfit",
"()"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/pandastools.py#L44-L76 | train | Returns a series with the bestfit values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/pandastools.py | normalize | def normalize(self,asOf=None,multiplier=100):
"""
Returns a normalized series or DataFrame
Example:
Series.normalize()
Returns: series of DataFrame
Parameters:
-----------
asOf : string
Date format
'2015-02-29'
multiplier : int
Factor by which the results will be adjusted
"""
if not asOf:
... | python | def normalize(self,asOf=None,multiplier=100):
"""
Returns a normalized series or DataFrame
Example:
Series.normalize()
Returns: series of DataFrame
Parameters:
-----------
asOf : string
Date format
'2015-02-29'
multiplier : int
Factor by which the results will be adjusted
"""
if not asOf:
... | [
"def",
"normalize",
"(",
"self",
",",
"asOf",
"=",
"None",
",",
"multiplier",
"=",
"100",
")",
":",
"if",
"not",
"asOf",
":",
"x0",
"=",
"self",
".",
"ix",
"[",
"0",
"]",
"else",
":",
"x0",
"=",
"self",
".",
"ix",
"[",
"asOf",
"]",
"return",
... | Returns a normalized series or DataFrame
Example:
Series.normalize()
Returns: series of DataFrame
Parameters:
-----------
asOf : string
Date format
'2015-02-29'
multiplier : int
Factor by which the results will be adjusted | [
"Returns",
"a",
"normalized",
"series",
"or",
"DataFrame",
"Example",
":",
"Series",
".",
"normalize",
"()"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/pandastools.py#L78-L99 | train | Returns a normalized series or DataFrame | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/utils.py | merge_dict | def merge_dict(d1,d2):
"""
d1 <-- d2
"""
d=copy.deepcopy(d2)
for k,v in list(d1.items()):
if k not in d:
d[k]=v
else:
if isinstance(v,dict):
d[k]=merge_dict(d1[k],d[k])
return d | python | def merge_dict(d1,d2):
"""
d1 <-- d2
"""
d=copy.deepcopy(d2)
for k,v in list(d1.items()):
if k not in d:
d[k]=v
else:
if isinstance(v,dict):
d[k]=merge_dict(d1[k],d[k])
return d | [
"def",
"merge_dict",
"(",
"d1",
",",
"d2",
")",
":",
"d",
"=",
"copy",
".",
"deepcopy",
"(",
"d2",
")",
"for",
"k",
",",
"v",
"in",
"list",
"(",
"d1",
".",
"items",
"(",
")",
")",
":",
"if",
"k",
"not",
"in",
"d",
":",
"d",
"[",
"k",
"]",... | d1 <-- d2 | [
"d1",
"<",
"--",
"d2"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/utils.py#L24-L35 | train | Merge two dictionaries. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/utils.py | pp | def pp(el,preString=''):
"""
Formats (prettyprint) a concatenated dictionary
"""
tab=' '*4
if isinstance(el,dict):
keys=list(el.keys())
keys.sort()
for key in keys:
val=el[key]
if isinstance(val,dict) or isinstance(val,list):
print('%s%s :' % (preString,key))
pp(val,preString+tab)
else:
... | python | def pp(el,preString=''):
"""
Formats (prettyprint) a concatenated dictionary
"""
tab=' '*4
if isinstance(el,dict):
keys=list(el.keys())
keys.sort()
for key in keys:
val=el[key]
if isinstance(val,dict) or isinstance(val,list):
print('%s%s :' % (preString,key))
pp(val,preString+tab)
else:
... | [
"def",
"pp",
"(",
"el",
",",
"preString",
"=",
"''",
")",
":",
"tab",
"=",
"' '",
"*",
"4",
"if",
"isinstance",
"(",
"el",
",",
"dict",
")",
":",
"keys",
"=",
"list",
"(",
"el",
".",
"keys",
"(",
")",
")",
"keys",
".",
"sort",
"(",
")",
"fo... | Formats (prettyprint) a concatenated dictionary | [
"Formats",
"(",
"prettyprint",
")",
"a",
"concatenated",
"dictionary"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/utils.py#L76-L109 | train | prettyprint a concatenated dictionary | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/utils.py | inverseDict | def inverseDict(d):
"""
Returns a dictionay indexed by values {value_k:key_k}
Parameters:
-----------
d : dictionary
"""
dt={}
for k,v in list(d.items()):
if type(v) in (list,tuple):
for i in v:
dt[i]=k
else:
dt[v]=k
return dt | python | def inverseDict(d):
"""
Returns a dictionay indexed by values {value_k:key_k}
Parameters:
-----------
d : dictionary
"""
dt={}
for k,v in list(d.items()):
if type(v) in (list,tuple):
for i in v:
dt[i]=k
else:
dt[v]=k
return dt | [
"def",
"inverseDict",
"(",
"d",
")",
":",
"dt",
"=",
"{",
"}",
"for",
"k",
",",
"v",
"in",
"list",
"(",
"d",
".",
"items",
"(",
")",
")",
":",
"if",
"type",
"(",
"v",
")",
"in",
"(",
"list",
",",
"tuple",
")",
":",
"for",
"i",
"in",
"v",
... | Returns a dictionay indexed by values {value_k:key_k}
Parameters:
-----------
d : dictionary | [
"Returns",
"a",
"dictionay",
"indexed",
"by",
"values",
"{",
"value_k",
":",
"key_k",
"}",
"Parameters",
":",
"-----------",
"d",
":",
"dictionary"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/utils.py#L111-L125 | train | Returns a dictionay indexed by values { value_k : key_k } | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/utils.py | kwargs_from_keyword | def kwargs_from_keyword(from_kwargs,to_kwargs,keyword,clean_origin=True):
"""
Looks for keys of the format keyword_value.
And return a dictionary with {keyword:value} format
Parameters:
-----------
from_kwargs : dict
Original dictionary
to_kwargs : dict
Dictionary where the items will be appended
key... | python | def kwargs_from_keyword(from_kwargs,to_kwargs,keyword,clean_origin=True):
"""
Looks for keys of the format keyword_value.
And return a dictionary with {keyword:value} format
Parameters:
-----------
from_kwargs : dict
Original dictionary
to_kwargs : dict
Dictionary where the items will be appended
key... | [
"def",
"kwargs_from_keyword",
"(",
"from_kwargs",
",",
"to_kwargs",
",",
"keyword",
",",
"clean_origin",
"=",
"True",
")",
":",
"for",
"k",
"in",
"list",
"(",
"from_kwargs",
".",
"keys",
"(",
")",
")",
":",
"if",
"'{0}_'",
".",
"format",
"(",
"keyword",
... | Looks for keys of the format keyword_value.
And return a dictionary with {keyword:value} format
Parameters:
-----------
from_kwargs : dict
Original dictionary
to_kwargs : dict
Dictionary where the items will be appended
keyword : string
Keyword to look for in the orginal dictionary
clean_origin : ... | [
"Looks",
"for",
"keys",
"of",
"the",
"format",
"keyword_value",
".",
"And",
"return",
"a",
"dictionary",
"with",
"{",
"keyword",
":",
"value",
"}",
"format"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/utils.py#L129-L151 | train | This function takes a dictionary with keyword_value and returns a dictionary with keyword_value pairs. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/utils.py | deep_update | def deep_update(d,d_update):
"""
Updates the values (deep form) of a given dictionary
Parameters:
-----------
d : dict
dictionary that contains the values to update
d_update : dict
dictionary to be updated
"""
for k,v in list(d_update.items()):
if isinstance(v,dict):
if k in d:
deep_update(d[k... | python | def deep_update(d,d_update):
"""
Updates the values (deep form) of a given dictionary
Parameters:
-----------
d : dict
dictionary that contains the values to update
d_update : dict
dictionary to be updated
"""
for k,v in list(d_update.items()):
if isinstance(v,dict):
if k in d:
deep_update(d[k... | [
"def",
"deep_update",
"(",
"d",
",",
"d_update",
")",
":",
"for",
"k",
",",
"v",
"in",
"list",
"(",
"d_update",
".",
"items",
"(",
")",
")",
":",
"if",
"isinstance",
"(",
"v",
",",
"dict",
")",
":",
"if",
"k",
"in",
"d",
":",
"deep_update",
"("... | Updates the values (deep form) of a given dictionary
Parameters:
-----------
d : dict
dictionary that contains the values to update
d_update : dict
dictionary to be updated | [
"Updates",
"the",
"values",
"(",
"deep",
"form",
")",
"of",
"a",
"given",
"dictionary"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/utils.py#L203-L224 | train | Updates the values of a given dictionary d with the values of d_update. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/utils.py | read_google | def read_google(self,url,**kwargs):
"""
Reads a google sheet
"""
if url[-1]!='/':
url+='/'
return self.read_csv(url+'export?gid=0&format=csv',**kwargs) | python | def read_google(self,url,**kwargs):
"""
Reads a google sheet
"""
if url[-1]!='/':
url+='/'
return self.read_csv(url+'export?gid=0&format=csv',**kwargs) | [
"def",
"read_google",
"(",
"self",
",",
"url",
",",
"*",
"*",
"kwargs",
")",
":",
"if",
"url",
"[",
"-",
"1",
"]",
"!=",
"'/'",
":",
"url",
"+=",
"'/'",
"return",
"self",
".",
"read_csv",
"(",
"url",
"+",
"'export?gid=0&format=csv'",
",",
"*",
"*",... | Reads a google sheet | [
"Reads",
"a",
"google",
"sheet"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/utils.py#L226-L232 | train | Reads a google sheet from the specified URL. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/date_tools.py | getDateFromToday | def getDateFromToday(delta,strfmt='%Y%m%d'):
""" Returns a string that represents a date n numbers of days from today.
Parameters:
-----------
delta : int
number of days
strfmt : string
format in which the date will be represented
"""
return (dt.date.today() + dt.timedelta(delta)).strftime(strfmt) | python | def getDateFromToday(delta,strfmt='%Y%m%d'):
""" Returns a string that represents a date n numbers of days from today.
Parameters:
-----------
delta : int
number of days
strfmt : string
format in which the date will be represented
"""
return (dt.date.today() + dt.timedelta(delta)).strftime(strfmt) | [
"def",
"getDateFromToday",
"(",
"delta",
",",
"strfmt",
"=",
"'%Y%m%d'",
")",
":",
"return",
"(",
"dt",
".",
"date",
".",
"today",
"(",
")",
"+",
"dt",
".",
"timedelta",
"(",
"delta",
")",
")",
".",
"strftime",
"(",
"strfmt",
")"
] | Returns a string that represents a date n numbers of days from today.
Parameters:
-----------
delta : int
number of days
strfmt : string
format in which the date will be represented | [
"Returns",
"a",
"string",
"that",
"represents",
"a",
"date",
"n",
"numbers",
"of",
"days",
"from",
"today",
".",
"Parameters",
":",
"-----------",
"delta",
":",
"int",
"number",
"of",
"days",
"strfmt",
":",
"string",
"format",
"in",
"which",
"the",
"date",... | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/date_tools.py#L9-L18 | train | Returns a string that represents a date n numbers of days from today. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/ta.py | _ohlc_dict | def _ohlc_dict(df_or_figure,open='',high='',low='',close='',volume='',
validate='',**kwargs):
"""
Returns a dictionary with the actual column names that
correspond to each of the OHLCV values.
df_or_figure : DataFrame or Figure
open : string
Column name to be used for OPEN values
high : string
Column... | python | def _ohlc_dict(df_or_figure,open='',high='',low='',close='',volume='',
validate='',**kwargs):
"""
Returns a dictionary with the actual column names that
correspond to each of the OHLCV values.
df_or_figure : DataFrame or Figure
open : string
Column name to be used for OPEN values
high : string
Column... | [
"def",
"_ohlc_dict",
"(",
"df_or_figure",
",",
"open",
"=",
"''",
",",
"high",
"=",
"''",
",",
"low",
"=",
"''",
",",
"close",
"=",
"''",
",",
"volume",
"=",
"''",
",",
"validate",
"=",
"''",
",",
"*",
"*",
"kwargs",
")",
":",
"c_dir",
"=",
"{"... | Returns a dictionary with the actual column names that
correspond to each of the OHLCV values.
df_or_figure : DataFrame or Figure
open : string
Column name to be used for OPEN values
high : string
Column name to be used for HIGH values
low : string
Column name to be used for LOW values
close : string
C... | [
"Returns",
"a",
"dictionary",
"with",
"the",
"actual",
"column",
"names",
"that",
"correspond",
"to",
"each",
"of",
"the",
"OHLCV",
"values",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/ta.py#L12-L78 | train | Returns a dictionary with the actual column names that correspond to each of the OHLCV values. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/ta.py | correl | def correl(df,periods=21,columns=None,include=True,str=None,detail=False,how='value',**correl_kwargs):
"""
how : string
value
pct_chg
diff
"""
def _correl(df,periods=21,columns=None,include=True,str=None,detail=False,**correl_kwargs):
study='CORREL'
df,_df,columns=validate(df,columns)
_df['CORREL']... | python | def correl(df,periods=21,columns=None,include=True,str=None,detail=False,how='value',**correl_kwargs):
"""
how : string
value
pct_chg
diff
"""
def _correl(df,periods=21,columns=None,include=True,str=None,detail=False,**correl_kwargs):
study='CORREL'
df,_df,columns=validate(df,columns)
_df['CORREL']... | [
"def",
"correl",
"(",
"df",
",",
"periods",
"=",
"21",
",",
"columns",
"=",
"None",
",",
"include",
"=",
"True",
",",
"str",
"=",
"None",
",",
"detail",
"=",
"False",
",",
"how",
"=",
"'value'",
",",
"*",
"*",
"correl_kwargs",
")",
":",
"def",
"_... | how : string
value
pct_chg
diff | [
"how",
":",
"string",
"value",
"pct_chg",
"diff"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/ta.py#L409-L436 | train | Correlate a DataFrame to a set of periods. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | scattergeo | def scattergeo():
"""
Returns
"""
path=os.path.join(os.path.dirname(__file__), '../data/scattergeo.csv')
df=pd.read_csv(path)
del df['Unnamed: 0']
df['text'] = df['airport'] + ' ' + df['city'] + ', ' + df['state'] + ' ' + 'Arrivals: ' + df['cnt'].astype(str)
df=df.rename(columns={'cnt':'z','long':'lon'})
retu... | python | def scattergeo():
"""
Returns
"""
path=os.path.join(os.path.dirname(__file__), '../data/scattergeo.csv')
df=pd.read_csv(path)
del df['Unnamed: 0']
df['text'] = df['airport'] + ' ' + df['city'] + ', ' + df['state'] + ' ' + 'Arrivals: ' + df['cnt'].astype(str)
df=df.rename(columns={'cnt':'z','long':'lon'})
retu... | [
"def",
"scattergeo",
"(",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
",",
"'../data/scattergeo.csv'",
")",
"df",
"=",
"pd",
".",
"read_csv",
"(",
"path",
")",
"del",
"df",
"[... | Returns | [
"Returns"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L11-L20 | train | Returns a DataFrame with the data from the scattergeo. csv file | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | choropleth | def choropleth():
"""
Returns
"""
path=os.path.join(os.path.dirname(__file__), '../data/choropleth.csv')
df=pd.read_csv(path)
del df['Unnamed: 0']
df['z']=[np.random.randint(0,100) for _ in range(len(df))]
return df | python | def choropleth():
"""
Returns
"""
path=os.path.join(os.path.dirname(__file__), '../data/choropleth.csv')
df=pd.read_csv(path)
del df['Unnamed: 0']
df['z']=[np.random.randint(0,100) for _ in range(len(df))]
return df | [
"def",
"choropleth",
"(",
")",
":",
"path",
"=",
"os",
".",
"path",
".",
"join",
"(",
"os",
".",
"path",
".",
"dirname",
"(",
"__file__",
")",
",",
"'../data/choropleth.csv'",
")",
"df",
"=",
"pd",
".",
"read_csv",
"(",
"path",
")",
"del",
"df",
"[... | Returns | [
"Returns"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L22-L30 | train | Returns a DataFrame with the choropleth data. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | pie | def pie(n_labels=5,mode=None):
"""
Returns a DataFrame with the required format for
a pie plot
Parameters:
-----------
n_labels : int
Number of labels
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock names
"""
return pd.DataFrame({'values':np.random.ra... | python | def pie(n_labels=5,mode=None):
"""
Returns a DataFrame with the required format for
a pie plot
Parameters:
-----------
n_labels : int
Number of labels
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock names
"""
return pd.DataFrame({'values':np.random.ra... | [
"def",
"pie",
"(",
"n_labels",
"=",
"5",
",",
"mode",
"=",
"None",
")",
":",
"return",
"pd",
".",
"DataFrame",
"(",
"{",
"'values'",
":",
"np",
".",
"random",
".",
"randint",
"(",
"1",
",",
"100",
",",
"n_labels",
")",
",",
"'labels'",
":",
"getN... | Returns a DataFrame with the required format for
a pie plot
Parameters:
-----------
n_labels : int
Number of labels
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock names | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"pie",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L114-L129 | train | Returns a DataFrame with the required format for
a pie plot
Parameters : | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | scatter | def scatter(n_categories=5,n=10,prefix='category',mode=None):
"""
Returns a DataFrame with the required format for
a scatter plot
Parameters:
-----------
n_categories : int
Number of categories
n : int
Number of points for each category
prefix : string
Name for each category
mode : string
Fo... | python | def scatter(n_categories=5,n=10,prefix='category',mode=None):
"""
Returns a DataFrame with the required format for
a scatter plot
Parameters:
-----------
n_categories : int
Number of categories
n : int
Number of points for each category
prefix : string
Name for each category
mode : string
Fo... | [
"def",
"scatter",
"(",
"n_categories",
"=",
"5",
",",
"n",
"=",
"10",
",",
"prefix",
"=",
"'category'",
",",
"mode",
"=",
"None",
")",
":",
"categories",
"=",
"[",
"]",
"for",
"i",
"in",
"range",
"(",
"n_categories",
")",
":",
"categories",
".",
"e... | Returns a DataFrame with the required format for
a scatter plot
Parameters:
-----------
n_categories : int
Number of categories
n : int
Number of points for each category
prefix : string
Name for each category
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for r... | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"scatter",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L131-L155 | train | Returns a DataFrame with the required format for
a scatter plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | heatmap | def heatmap(n_x=5,n_y=10):
"""
Returns a DataFrame with the required format for
a heatmap plot
Parameters:
-----------
n_x : int
Number of x categories
n_y : int
Number of y categories
"""
x=['x_'+str(_) for _ in range(n_x)]
y=['y_'+str(_) for _ in range(n_y)]
return pd.DataFrame(surface(n_x-1,n_y... | python | def heatmap(n_x=5,n_y=10):
"""
Returns a DataFrame with the required format for
a heatmap plot
Parameters:
-----------
n_x : int
Number of x categories
n_y : int
Number of y categories
"""
x=['x_'+str(_) for _ in range(n_x)]
y=['y_'+str(_) for _ in range(n_y)]
return pd.DataFrame(surface(n_x-1,n_y... | [
"def",
"heatmap",
"(",
"n_x",
"=",
"5",
",",
"n_y",
"=",
"10",
")",
":",
"x",
"=",
"[",
"'x_'",
"+",
"str",
"(",
"_",
")",
"for",
"_",
"in",
"range",
"(",
"n_x",
")",
"]",
"y",
"=",
"[",
"'y_'",
"+",
"str",
"(",
"_",
")",
"for",
"_",
"i... | Returns a DataFrame with the required format for
a heatmap plot
Parameters:
-----------
n_x : int
Number of x categories
n_y : int
Number of y categories | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"heatmap",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L157-L171 | train | Returns a DataFrame with the required format for
a heatmap plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | lines | def lines(n_traces=5,n=100,columns=None,dateIndex=True,mode=None):
"""
Returns a DataFrame with the required format for
a scatter (lines) plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
columns : [str]
List of column names
dateIndex : bool
... | python | def lines(n_traces=5,n=100,columns=None,dateIndex=True,mode=None):
"""
Returns a DataFrame with the required format for
a scatter (lines) plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
columns : [str]
List of column names
dateIndex : bool
... | [
"def",
"lines",
"(",
"n_traces",
"=",
"5",
",",
"n",
"=",
"100",
",",
"columns",
"=",
"None",
",",
"dateIndex",
"=",
"True",
",",
"mode",
"=",
"None",
")",
":",
"index",
"=",
"pd",
".",
"date_range",
"(",
"'1/1/15'",
",",
"periods",
"=",
"n",
")"... | Returns a DataFrame with the required format for
a scatter (lines) plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
columns : [str]
List of column names
dateIndex : bool
If True it will return a datetime index
if False it will return a enu... | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"scatter",
"(",
"lines",
")",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L173-L197 | train | Returns a DataFrame with the required format for
a scatter plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | bars | def bars(n=3,n_categories=3,prefix='category',columns=None,mode='abc'):
"""
Returns a DataFrame with the required format for
a bar plot
Parameters:
-----------
n : int
Number of points for each trace
n_categories : int
Number of categories for each point
prefix : string
Name for each category
co... | python | def bars(n=3,n_categories=3,prefix='category',columns=None,mode='abc'):
"""
Returns a DataFrame with the required format for
a bar plot
Parameters:
-----------
n : int
Number of points for each trace
n_categories : int
Number of categories for each point
prefix : string
Name for each category
co... | [
"def",
"bars",
"(",
"n",
"=",
"3",
",",
"n_categories",
"=",
"3",
",",
"prefix",
"=",
"'category'",
",",
"columns",
"=",
"None",
",",
"mode",
"=",
"'abc'",
")",
":",
"categories",
"=",
"[",
"]",
"if",
"not",
"columns",
":",
"columns",
"=",
"getName... | Returns a DataFrame with the required format for
a bar plot
Parameters:
-----------
n : int
Number of points for each trace
n_categories : int
Number of categories for each point
prefix : string
Name for each category
columns : [str]
List of column names
mode : string
Format for each item
... | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"bar",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L199-L225 | train | Returns a DataFrame with the required format for
a bar plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | ohlc | def ohlc(n=100):
"""
Returns a DataFrame with the required format for
a candlestick or ohlc plot
df[['open','high','low','close']]
Parameters:
-----------
n : int
Number of ohlc points
"""
index=pd.date_range('1/1/15',periods=n*288,freq='5min',tz='utc')
data=np.random.randn(n*288)
data[0]=np.array(... | python | def ohlc(n=100):
"""
Returns a DataFrame with the required format for
a candlestick or ohlc plot
df[['open','high','low','close']]
Parameters:
-----------
n : int
Number of ohlc points
"""
index=pd.date_range('1/1/15',periods=n*288,freq='5min',tz='utc')
data=np.random.randn(n*288)
data[0]=np.array(... | [
"def",
"ohlc",
"(",
"n",
"=",
"100",
")",
":",
"index",
"=",
"pd",
".",
"date_range",
"(",
"'1/1/15'",
",",
"periods",
"=",
"n",
"*",
"288",
",",
"freq",
"=",
"'5min'",
",",
"tz",
"=",
"'utc'",
")",
"data",
"=",
"np",
".",
"random",
".",
"randn... | Returns a DataFrame with the required format for
a candlestick or ohlc plot
df[['open','high','low','close']]
Parameters:
-----------
n : int
Number of ohlc points | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"candlestick",
"or",
"ohlc",
"plot",
"df",
"[[",
"open",
"high",
"low",
"close",
"]]"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L227-L248 | train | Returns a DataFrame with the required format for
a candlestick or ohlc plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | ohlcv | def ohlcv(n=100):
"""
Returns a DataFrame with the required format for
a candlestick or ohlc plot
df[['open','high','low','close','volume']
Parameters:
-----------
n : int
Number of ohlc points
"""
df=ohlc()
df['volume']=[np.random.randint(1000,10000) for _ in range(len(df))]
return df | python | def ohlcv(n=100):
"""
Returns a DataFrame with the required format for
a candlestick or ohlc plot
df[['open','high','low','close','volume']
Parameters:
-----------
n : int
Number of ohlc points
"""
df=ohlc()
df['volume']=[np.random.randint(1000,10000) for _ in range(len(df))]
return df | [
"def",
"ohlcv",
"(",
"n",
"=",
"100",
")",
":",
"df",
"=",
"ohlc",
"(",
")",
"df",
"[",
"'volume'",
"]",
"=",
"[",
"np",
".",
"random",
".",
"randint",
"(",
"1000",
",",
"10000",
")",
"for",
"_",
"in",
"range",
"(",
"len",
"(",
"df",
")",
"... | Returns a DataFrame with the required format for
a candlestick or ohlc plot
df[['open','high','low','close','volume']
Parameters:
-----------
n : int
Number of ohlc points | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"candlestick",
"or",
"ohlc",
"plot",
"df",
"[[",
"open",
"high",
"low",
"close",
"volume",
"]"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L250-L264 | train | Returns a DataFrame with the required format for
a candlestick or ohlc plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | box | def box(n_traces=5,n=100,mode=None):
"""
Returns a DataFrame with the required format for
a box plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock name... | python | def box(n_traces=5,n=100,mode=None):
"""
Returns a DataFrame with the required format for
a box plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock name... | [
"def",
"box",
"(",
"n_traces",
"=",
"5",
",",
"n",
"=",
"100",
",",
"mode",
"=",
"None",
")",
":",
"df",
"=",
"pd",
".",
"DataFrame",
"(",
"[",
"np",
".",
"random",
".",
"chisquare",
"(",
"np",
".",
"random",
".",
"randint",
"(",
"2",
",",
"1... | Returns a DataFrame with the required format for
a box plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock names | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"box",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L266-L284 | train | Returns a DataFrame with the required format for
a box plot
n | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | histogram | def histogram(n_traces=1,n=500,dispersion=2,mode=None):
"""
Returns a DataFrame with the required format for
a histogram plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
'stoc... | python | def histogram(n_traces=1,n=500,dispersion=2,mode=None):
"""
Returns a DataFrame with the required format for
a histogram plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
'stoc... | [
"def",
"histogram",
"(",
"n_traces",
"=",
"1",
",",
"n",
"=",
"500",
",",
"dispersion",
"=",
"2",
",",
"mode",
"=",
"None",
")",
":",
"df",
"=",
"pd",
".",
"DataFrame",
"(",
"np",
".",
"transpose",
"(",
"[",
"np",
".",
"random",
".",
"randn",
"... | Returns a DataFrame with the required format for
a histogram plot
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock names | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"histogram",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L286-L304 | train | Returns a DataFrame with the required format for
a histogram plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | distplot | def distplot(n_traces=1,n=500,dispersion=3,mode=None):
"""
Returns a DataFrame with the required format for
a distribution plot (distplot)
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet colu... | python | def distplot(n_traces=1,n=500,dispersion=3,mode=None):
"""
Returns a DataFrame with the required format for
a distribution plot (distplot)
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet colu... | [
"def",
"distplot",
"(",
"n_traces",
"=",
"1",
",",
"n",
"=",
"500",
",",
"dispersion",
"=",
"3",
",",
"mode",
"=",
"None",
")",
":",
"return",
"histogram",
"(",
"n_traces",
",",
"n",
",",
"dispersion",
",",
"mode",
")"
] | Returns a DataFrame with the required format for
a distribution plot (distplot)
Parameters:
-----------
n_traces : int
Number of traces
n : int
Number of points for each trace
mode : string
Format for each item
'abc' for alphabet columns
'stocks' for random stock names | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"distribution",
"plot",
"(",
"distplot",
")"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L306-L322 | train | Returns a DataFrame with the required format for
a distribution plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | violin | def violin(n=500,dispersion=3,categories=True,n_categories=5):
"""
Returns a DataFrame with the required format for
a distribution plot (distplot)
Parameters:
-----------
n : int
Number of points
categories : bool or int
If True, then a column with categories is added
n_categories : int
Number of... | python | def violin(n=500,dispersion=3,categories=True,n_categories=5):
"""
Returns a DataFrame with the required format for
a distribution plot (distplot)
Parameters:
-----------
n : int
Number of points
categories : bool or int
If True, then a column with categories is added
n_categories : int
Number of... | [
"def",
"violin",
"(",
"n",
"=",
"500",
",",
"dispersion",
"=",
"3",
",",
"categories",
"=",
"True",
",",
"n_categories",
"=",
"5",
")",
":",
"df",
"=",
"histogram",
"(",
"1",
",",
"n",
",",
"dispersion",
",",
"'abc'",
")",
"df",
"=",
"df",
".",
... | Returns a DataFrame with the required format for
a distribution plot (distplot)
Parameters:
-----------
n : int
Number of points
categories : bool or int
If True, then a column with categories is added
n_categories : int
Number of categories | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"distribution",
"plot",
"(",
"distplot",
")"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L324-L342 | train | Returns a DataFrame with the required format for INDRA points in the distribution plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | surface | def surface(n_x=20,n_y=20):
"""
Returns a DataFrame with the required format for
a surface plot
Parameters:
-----------
n_x : int
Number of points along the X axis
n_y : int
Number of points along the Y axis
"""
x=[float(np.random.randint(0,100))]
for i in range(n_x):
x.append(x[:1][0]+np.random.... | python | def surface(n_x=20,n_y=20):
"""
Returns a DataFrame with the required format for
a surface plot
Parameters:
-----------
n_x : int
Number of points along the X axis
n_y : int
Number of points along the Y axis
"""
x=[float(np.random.randint(0,100))]
for i in range(n_x):
x.append(x[:1][0]+np.random.... | [
"def",
"surface",
"(",
"n_x",
"=",
"20",
",",
"n_y",
"=",
"20",
")",
":",
"x",
"=",
"[",
"float",
"(",
"np",
".",
"random",
".",
"randint",
"(",
"0",
",",
"100",
")",
")",
"]",
"for",
"i",
"in",
"range",
"(",
"n_x",
")",
":",
"x",
".",
"a... | Returns a DataFrame with the required format for
a surface plot
Parameters:
-----------
n_x : int
Number of points along the X axis
n_y : int
Number of points along the Y axis | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"surface",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L344-L362 | train | Returns a DataFrame with the required format for
a surface plot | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/datagen.py | sinwave | def sinwave(n=4,inc=.25):
"""
Returns a DataFrame with the required format for
a surface (sine wave) plot
Parameters:
-----------
n : int
Ranges for X and Y axis (-n,n)
n_y : int
Size of increment along the axis
"""
x=np.arange(-n,n,inc)
y=np.arange(-n,n,inc)
X,Y=np.meshgrid(x,y)
R = np.sqrt(X**2... | python | def sinwave(n=4,inc=.25):
"""
Returns a DataFrame with the required format for
a surface (sine wave) plot
Parameters:
-----------
n : int
Ranges for X and Y axis (-n,n)
n_y : int
Size of increment along the axis
"""
x=np.arange(-n,n,inc)
y=np.arange(-n,n,inc)
X,Y=np.meshgrid(x,y)
R = np.sqrt(X**2... | [
"def",
"sinwave",
"(",
"n",
"=",
"4",
",",
"inc",
"=",
".25",
")",
":",
"x",
"=",
"np",
".",
"arange",
"(",
"-",
"n",
",",
"n",
",",
"inc",
")",
"y",
"=",
"np",
".",
"arange",
"(",
"-",
"n",
",",
"n",
",",
"inc",
")",
"X",
",",
"Y",
"... | Returns a DataFrame with the required format for
a surface (sine wave) plot
Parameters:
-----------
n : int
Ranges for X and Y axis (-n,n)
n_y : int
Size of increment along the axis | [
"Returns",
"a",
"DataFrame",
"with",
"the",
"required",
"format",
"for",
"a",
"surface",
"(",
"sine",
"wave",
")",
"plot"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/datagen.py#L364-L381 | train | Returns a DataFrame with the required format for
a surface ( sine wave ) plot. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/tools.py | getTheme | def getTheme(theme=None):
"""
Returns a theme definition.
To see the colors translated (hex) use
cufflinks.getLayout(theme) instead.
"""
if not theme:
theme = auth.get_config_file()['theme']
if theme in THEMES:
return updateColors(copy.deepcopy(THEMES[theme]))
else:
raise Exception("Invalid Theme: {0}".... | python | def getTheme(theme=None):
"""
Returns a theme definition.
To see the colors translated (hex) use
cufflinks.getLayout(theme) instead.
"""
if not theme:
theme = auth.get_config_file()['theme']
if theme in THEMES:
return updateColors(copy.deepcopy(THEMES[theme]))
else:
raise Exception("Invalid Theme: {0}".... | [
"def",
"getTheme",
"(",
"theme",
"=",
"None",
")",
":",
"if",
"not",
"theme",
":",
"theme",
"=",
"auth",
".",
"get_config_file",
"(",
")",
"[",
"'theme'",
"]",
"if",
"theme",
"in",
"THEMES",
":",
"return",
"updateColors",
"(",
"copy",
".",
"deepcopy",
... | Returns a theme definition.
To see the colors translated (hex) use
cufflinks.getLayout(theme) instead. | [
"Returns",
"a",
"theme",
"definition",
"."
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/tools.py#L54-L67 | train | Returns a theme definition. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/tools.py | getLayout | def getLayout(kind=None,theme=None,title='',xTitle='',yTitle='',zTitle='',barmode='',bargap=None,bargroupgap=None,
margin=None, dimensions=None, width=None, height=None,
annotations=None,is3d=False,**kwargs):
"""
Generates a plotly Layout
Parameters:
-----------
theme : string
Layout Theme
solar... | python | def getLayout(kind=None,theme=None,title='',xTitle='',yTitle='',zTitle='',barmode='',bargap=None,bargroupgap=None,
margin=None, dimensions=None, width=None, height=None,
annotations=None,is3d=False,**kwargs):
"""
Generates a plotly Layout
Parameters:
-----------
theme : string
Layout Theme
solar... | [
"def",
"getLayout",
"(",
"kind",
"=",
"None",
",",
"theme",
"=",
"None",
",",
"title",
"=",
"''",
",",
"xTitle",
"=",
"''",
",",
"yTitle",
"=",
"''",
",",
"zTitle",
"=",
"''",
",",
"barmode",
"=",
"''",
",",
"bargap",
"=",
"None",
",",
"bargroupg... | Generates a plotly Layout
Parameters:
-----------
theme : string
Layout Theme
solar
pearl
white
title : string
Chart Title
xTitle : string
X Axis Title
yTitle : string
Y Axis Title
zTitle : string
Z Axis Title
Applicable only for 3d charts
barmode : string
Mode when displ... | [
"Generates",
"a",
"plotly",
"Layout"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/tools.py#L92-L455 | train | This function returns a string that can be used to create a plotly layout. | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/tools.py | get_annotations | def get_annotations(df,annotations,kind='lines',theme=None,**kwargs):
"""
Generates an annotations object
Parameters:
-----------
df : DataFrame
Original DataFrame of values
annotations : dict or list
Dictionary of annotations
{x_point : text}
or
List of Plotly annotations
"""
for key in ... | python | def get_annotations(df,annotations,kind='lines',theme=None,**kwargs):
"""
Generates an annotations object
Parameters:
-----------
df : DataFrame
Original DataFrame of values
annotations : dict or list
Dictionary of annotations
{x_point : text}
or
List of Plotly annotations
"""
for key in ... | [
"def",
"get_annotations",
"(",
"df",
",",
"annotations",
",",
"kind",
"=",
"'lines'",
",",
"theme",
"=",
"None",
",",
"*",
"*",
"kwargs",
")",
":",
"for",
"key",
"in",
"list",
"(",
"kwargs",
".",
"keys",
"(",
")",
")",
":",
"if",
"key",
"not",
"i... | Generates an annotations object
Parameters:
-----------
df : DataFrame
Original DataFrame of values
annotations : dict or list
Dictionary of annotations
{x_point : text}
or
List of Plotly annotations | [
"Generates",
"an",
"annotations",
"object"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/tools.py#L458-L561 | train | Generates an annotation dictionary for a DataFrame | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
santosjorge/cufflinks | cufflinks/tools.py | get_base_layout | def get_base_layout(figs):
"""
Generates a layout with the union of all properties of multiple
figures' layouts
Parameters:
-----------
fig : list(Figures)
List of Plotly Figures
"""
layout={}
for fig in figs:
if not isinstance(fig,dict):
fig=fig.to_dict()
for k,v in list(fig['layout'].items()):
... | python | def get_base_layout(figs):
"""
Generates a layout with the union of all properties of multiple
figures' layouts
Parameters:
-----------
fig : list(Figures)
List of Plotly Figures
"""
layout={}
for fig in figs:
if not isinstance(fig,dict):
fig=fig.to_dict()
for k,v in list(fig['layout'].items()):
... | [
"def",
"get_base_layout",
"(",
"figs",
")",
":",
"layout",
"=",
"{",
"}",
"for",
"fig",
"in",
"figs",
":",
"if",
"not",
"isinstance",
"(",
"fig",
",",
"dict",
")",
":",
"fig",
"=",
"fig",
".",
"to_dict",
"(",
")",
"for",
"k",
",",
"v",
"in",
"l... | Generates a layout with the union of all properties of multiple
figures' layouts
Parameters:
-----------
fig : list(Figures)
List of Plotly Figures | [
"Generates",
"a",
"layout",
"with",
"the",
"union",
"of",
"all",
"properties",
"of",
"multiple",
"figures",
"layouts"
] | ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a | https://github.com/santosjorge/cufflinks/blob/ca1cbf93998dc793d0b1f8ac30fe1f2bd105f63a/cufflinks/tools.py#L579-L595 | train | Generates a layout with the union of all properties of multiple
figures | Pu7Z6IJCgH3a,vcEHXBQXuDuh,sHOWSIAKtU58,ZVWAAMjVVHHl,qRin5pdYOdbB,IySsVMyKT3tF,FwEHNICjJCy0,yISIa0MMKKfB,GAtvbI59wr0o,OmNM6rT0Sgul,gu1MSKhYvigU,S2TTo9DhhiSh,aaLV7ZjAfkcR,ker4pIJmdvxf,WaQEaQCVMQ03,xV97BFGi0hY9,YnM1HtHE4j7G,X5FyJb4ToTo6,jLmadlzMdunT,GGFwFLsDF9Fv,prtR0Uw1GMh5,oNamnshN4dFG,QZzQeAYvsoum,VHAt7CcYKC2T,cKsTbNGL... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.