_id stringlengths 2 7 | title stringlengths 1 88 | partition stringclasses 3
values | text stringlengths 31 13.1k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q20200 | GetFile | train | def GetFile(message=None, title=None, directory=None, fileName=None,
allowsMultipleSelection=False, fileTypes=None):
"""
An get file dialog.
Optionally a `message`, `title`, `directory`, `fileName` and
`allowsMultipleSelection` can be provided.
::
from fontParts.ui import GetFile
print(GetFile())
| python | {
"resource": ""
} |
q20201 | Message | train | def Message(message, title='FontParts', informativeText=""):
"""
An message dialog.
Optionally a `message`, `title` and `informativeText` can be provided.
::
from fontParts.ui import Message
print(Message("This is a message"))
| python | {
"resource": ""
} |
q20202 | SearchList | train | def SearchList(items, message="Select an item:", title='FontParts'):
"""
A dialgo to search a given list.
Optionally a `message`, `title` and `allFonts` can be | python | {
"resource": ""
} |
q20203 | SelectFont | train | def SelectFont(message="Select a font:", title='FontParts', allFonts=None):
"""
Select a font from all open fonts.
Optionally a `message`, `title` and `allFonts` can be provided.
If `allFonts` is `None` it will list all open fonts.
::
from fontParts.ui import SelectFont
| python | {
"resource": ""
} |
q20204 | SelectGlyph | train | def SelectGlyph(aFont, message="Select a glyph:", title='FontParts'):
"""
Select a glyph for a given font.
Optionally a `message` and `title` can be provided.
::
from fontParts.ui import SelectGlyph
font = CurrentFont()
| python | {
"resource": ""
} |
q20205 | ProgressBar | train | def ProgressBar(title="RoboFab...", ticks=None, label=""):
"""
A progess bar dialog.
Optionally a `title`, `ticks` and `label` can be provided.
::
from fontParts.ui import ProgressBar
bar = ProgressBar()
| python | {
"resource": ""
} |
q20206 | BasePoint._get_index | train | def _get_index(self):
"""
Get the point's index.
This must return an ``int``.
Subclasses may override | python | {
"resource": ""
} |
q20207 | BaseObject.copy | train | def copy(self):
"""
Copy this object into a new object of the same type.
The returned object will not have a parent object.
"""
copyClass = self.copyClass
if copyClass is None:
| python | {
"resource": ""
} |
q20208 | BaseObject.copyData | train | def copyData(self, source):
"""
Subclasses may override this method.
If so, they should call the super.
"""
for attr in self.copyAttributes:
selfValue = getattr(self, attr)
sourceValue = getattr(source, attr)
| python | {
"resource": ""
} |
q20209 | TransformationMixin.transformBy | train | def transformBy(self, matrix, origin=None):
"""
Transform the object.
>>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0))
>>> obj.transformBy((0.5, 0, 0, 2.0, 10, 0), origin=(500, 500))
**matrix** must be a :ref:`type-transformation`.
**origin** defines the point at with the transformation
should originate. It must be a :ref:`type-coordinate`
or ``None``. The default is ``(0, 0)``.
"""
matrix = normalizers.normalizeTransformationMatrix(matrix)
if origin is None:
origin = (0, 0)
| python | {
"resource": ""
} |
q20210 | TransformationMixin.moveBy | train | def moveBy(self, value):
"""
Move the object.
>>> obj.transformBy((10, 0))
**value** must be an iterable containing two
:ref:`type-int-float` values defining the x and y
| python | {
"resource": ""
} |
q20211 | TransformationMixin.scaleBy | train | def scaleBy(self, value, origin=None):
"""
Scale the object.
>>> obj.transformBy(2.0)
>>> obj.transformBy((0.5, 2.0), origin=(500, 500))
**value** must be an iterable containing two
:ref:`type-int-float` values defining the x and y
| python | {
"resource": ""
} |
q20212 | TransformationMixin.rotateBy | train | def rotateBy(self, value, origin=None):
"""
Rotate the object.
>>> obj.transformBy(45)
>>> obj.transformBy(45, origin=(500, 500))
**value** must be a :ref:`type-int-float` values
defining the angle to rotate the object by. **origin**
| python | {
"resource": ""
} |
q20213 | TransformationMixin.skewBy | train | def skewBy(self, value, origin=None):
"""
Skew the object.
>>> obj.skewBy(11)
>>> obj.skewBy((25, 10), origin=(500, 500))
**value** must be rone of the following:
* single :ref:`type-int-float` indicating the
value to skew the x direction by.
* iterable cointaining type :ref:`type-int-float`
| python | {
"resource": ""
} |
q20214 | BaseInfo.fromMathInfo | train | def fromMathInfo(self, mathInfo, guidelines=True):
"""
Replaces the contents of this info object with the contents of ``mathInfo``.
| python | {
"resource": ""
} |
q20215 | BaseInfo.interpolate | train | def interpolate(self, factor, minInfo, maxInfo, round=True, suppressError=True):
"""
Interpolate all pairs between minInfo and maxInfo.
The interpolation occurs on a 0 to 1.0 range where minInfo
is located at 0 and maxInfo is located at 1.0.
factor is the interpolation value. It may be less than 0
and greater than 1.0. It may be a number (integer, float)
or a tuple of two numbers. If it is a tuple, the first
number indicates the x factor and the second number
indicates the y factor.
round indicates if the result should be rounded to integers.
suppressError indicates if incompatible data should be ignored
or if an error should be raised when such incompatibilities are found.
"""
factor = normalizers.normalizeInterpolationFactor(factor)
if not isinstance(minInfo, BaseInfo):
raise TypeError(("Interpolation to an instance of %r can not be "
"performed from an instance of %r.") %
(self.__class__.__name__, | python | {
"resource": ""
} |
q20216 | autoprefixCSS | train | def autoprefixCSS(sassPath):
'''
Take CSS file and automatically add browser prefixes with postCSS autoprefixer
'''
print("Autoprefixing CSS")
cssPath = os.path.splitext(sassPath)[0] + ".css"
command = "postcss --use | python | {
"resource": ""
} |
q20217 | BaseFont.generate | train | def generate(self, format, path=None, **environmentOptions):
"""
Generate the font to another format.
>>> font.generate("otfcff")
>>> font.generate("otfcff", "/path/to/my/font.otf")
**format** defines the file format to output.
Standard format identifiers can be found in :attr:`BaseFont.generateFormatToExtension`:
Environments are not required to support all of these
and environments may define their own format types.
**path** defines the location where the new file should
be created. If a file already exists at that location,
it will be overwritten by the new file. If **path** defines
a directory, the file will be output as the current
file name, with the appropriate suffix for the format,
into the given directory. If no **path** is given, the
file will be output into the same directory as the source
font with the file named with the current file name,
with the appropriate suffix for the format.
Environments may allow unique keyword arguments in this
method. For example, if a tool allows decomposing | python | {
"resource": ""
} |
q20218 | BaseFont.appendGuideline | train | def appendGuideline(self, position=None, angle=None, name=None, color=None, guideline=None):
"""
Append a new guideline to the font.
>>> guideline = font.appendGuideline((50, 0), 90)
>>> guideline = font.appendGuideline((0, 540), 0, name="overshoot",
>>> color=(0, 0, 0, 0.2))
**position** must be a :ref:`type-coordinate`
indicating the position of the guideline.
**angle** indicates the :ref:`type-angle` of
the guideline. **name** indicates the name
for the guideline. This must be a :ref:`type-string`
or ``None``. **color** indicates the color for
the guideline. This must be a :ref:`type-color`
or ``None``. This will return the newly created
:class:`BaseGuidline` object.
``guideline`` may be a :class:`BaseGuideline` object from which
attribute values will be copied. If ``position``, ``angle``, ``name``
or ``color`` are specified as | python | {
"resource": ""
} |
q20219 | BaseFont.interpolate | train | def interpolate(self, factor, minFont, maxFont,
round=True, suppressError=True):
"""
Interpolate all possible data in the font.
>>> font.interpolate(0.5, otherFont1, otherFont2)
>>> font.interpolate((0.5, 2.0), otherFont1, otherFont2, round=False)
The interpolation occurs on a 0 to 1.0 range where **minFont**
is located at 0 and **maxFont** is located at 1.0. **factor**
is the interpolation value. It may be less than 0 and greater
than 1.0. It may be a :ref:`type-int-float` or a tuple of
two :ref:`type-int-float`. If it is a tuple, the first
number indicates the x factor and the second number indicates
the y factor. **round** indicates if the result should be
rounded to integers. **suppressError** indicates if incompatible
data should be ignored or if an error should be raised when
such incompatibilities are found.
"""
factor = normalizers.normalizeInterpolationFactor(factor)
if not isinstance(minFont, BaseFont):
raise TypeError(("Interpolation to an instance of %r can not be "
"performed from an instance of %r.")
| python | {
"resource": ""
} |
q20220 | BaseContour.getIdentifierForPoint | train | def getIdentifierForPoint(self, point):
"""
Create a unique identifier for and assign it to ``point``.
If the point already has an identifier, the existing
identifier will be returned.
>>> contour.getIdentifierForPoint(point)
'ILHGJlygfds'
| python | {
"resource": ""
} |
q20221 | BaseContour.contourInside | train | def contourInside(self, otherContour):
"""
Determine if ``otherContour`` is in the black or white of this contour.
>>> contour.contourInside(otherContour)
True
``contour`` must be a :class:`BaseContour`.
""" | python | {
"resource": ""
} |
q20222 | BaseContour.appendSegment | train | def appendSegment(self, type=None, points=None, smooth=False, segment=None):
"""
Append a segment to the contour.
"""
if segment is not None:
if type is not None:
type = segment.type
if points is None:
points = [(point.x, point.y) for point in segment.points]
smooth = segment.smooth
type = normalizers.normalizeSegmentType(type)
pts = []
for pt in points:
| python | {
"resource": ""
} |
q20223 | BaseContour.insertSegment | train | def insertSegment(self, index, type=None, points=None, smooth=False, segment=None):
"""
Insert a segment into the contour.
"""
if segment is not None:
if type is not None:
type = segment.type
if points is None:
points = [(point.x, point.y) for point in segment.points]
smooth = segment.smooth
index = normalizers.normalizeIndex(index)
type = normalizers.normalizeSegmentType(type)
pts = []
for pt in points:
| python | {
"resource": ""
} |
q20224 | BaseContour.removeSegment | train | def removeSegment(self, segment, preserveCurve=False):
"""
Remove segment from the contour.
If ``preserveCurve`` is set to ``True`` an attempt
will be made to preserve the shape of the curve
if the environment supports that functionality.
"""
if not isinstance(segment, int):
segment = self.segments.index(segment) | python | {
"resource": ""
} |
q20225 | BaseContour._removeSegment | train | def _removeSegment(self, segment, preserveCurve, **kwargs):
"""
segment will be a valid segment index.
preserveCurve will be a boolean.
Subclasses may override this method.
"""
segment | python | {
"resource": ""
} |
q20226 | BaseContour.setStartSegment | train | def setStartSegment(self, segment):
"""
Set the first segment on the contour.
segment can be a segment object or an index.
"""
segments = self.segments
if not isinstance(segment, int):
segmentIndex = segments.index(segment)
else:
segmentIndex = segment
if len(self.segments) < 2:
return
if segmentIndex == 0:
| python | {
"resource": ""
} |
q20227 | BaseContour.appendBPoint | train | def appendBPoint(self, type=None, anchor=None, bcpIn=None, bcpOut=None, bPoint=None):
"""
Append a bPoint to the contour.
"""
if bPoint is not None:
if type is None:
type = bPoint.type
if anchor is None:
anchor = bPoint.anchor
if bcpIn is None:
bcpIn = bPoint.bcpIn
if bcpOut is None:
bcpOut = bPoint.bcpOut
type = normalizers.normalizeBPointType(type)
anchor = | python | {
"resource": ""
} |
q20228 | BaseContour.insertBPoint | train | def insertBPoint(self, index, type=None, anchor=None, bcpIn=None, bcpOut=None, bPoint=None):
"""
Insert a bPoint at index in the contour.
"""
if bPoint is not None:
if type is None:
type = bPoint.type
if anchor is None:
anchor = bPoint.anchor
if bcpIn is None:
bcpIn = bPoint.bcpIn
if bcpOut is None:
bcpOut = bPoint.bcpOut
index = normalizers.normalizeIndex(index)
type = normalizers.normalizeBPointType(type)
anchor = normalizers.normalizeCoordinateTuple(anchor)
| python | {
"resource": ""
} |
q20229 | BaseContour.removeBPoint | train | def removeBPoint(self, bPoint):
"""
Remove the bpoint from the contour.
bpoint can be a point object or an index.
"""
if not isinstance(bPoint, int):
bPoint = bPoint.index
bPoint = normalizers.normalizeIndex(bPoint)
if | python | {
"resource": ""
} |
q20230 | BaseContour._removeBPoint | train | def _removeBPoint(self, index, **kwargs):
"""
index will be a valid index.
Subclasses may override this method.
"""
bPoint = self.bPoints[index]
nextSegment = bPoint._nextSegment
offCurves = nextSegment.offCurve
if offCurves:
offCurve = offCurves[0]
| python | {
"resource": ""
} |
q20231 | BaseContour.appendPoint | train | def appendPoint(self, position=None, type="line", smooth=False, name=None, identifier=None, point=None):
"""
Append a point to the contour.
"""
if point is not None:
if position is None:
position = point.position
type = point.type
smooth = point.smooth
if name is None:
name = point.name
| python | {
"resource": ""
} |
q20232 | BaseContour.insertPoint | train | def insertPoint(self, index, position=None, type="line", smooth=False, name=None, identifier=None, point=None):
"""
Insert a point into the contour.
"""
if point is not None:
if position is None:
position = point.position
type = point.type
smooth = point.smooth
if name is None:
name = point.name
if identifier is not None:
identifier = point.identifier
index = normalizers.normalizeIndex(index)
position = normalizers.normalizeCoordinateTuple(position)
type = normalizers.normalizePointType(type)
smooth = normalizers.normalizeBoolean(smooth)
if | python | {
"resource": ""
} |
q20233 | BaseContour.removePoint | train | def removePoint(self, point, preserveCurve=False):
"""
Remove the point from the contour.
point can be a point object or an index.
If ``preserveCurve`` is set to ``True`` an attempt
will be made to preserve the shape of the curve
if the environment supports that functionality.
"""
if not isinstance(point, int):
| python | {
"resource": ""
} |
q20234 | BaseKerning.asDict | train | def asDict(self, returnIntegers=True):
"""
Return the Kerning as a ``dict``.
This is a backwards compatibility method.
"""
d = {}
for k, v in self.items():
| python | {
"resource": ""
} |
q20235 | BaseSimpleType.validate_float | train | def validate_float(cls, value):
"""
Note that int values are accepted.
"""
if not isinstance(value, (int, float)):
| python | {
"resource": ""
} |
q20236 | ST_Angle.convert_to_xml | train | def convert_to_xml(cls, value):
"""
Convert signed angle float like -42.42 to int 60000 per degree,
normalized to positive value.
"""
| python | {
"resource": ""
} |
q20237 | ST_PositiveFixedAngle.convert_to_xml | train | def convert_to_xml(cls, degrees):
"""Convert signed angle float like -427.42 to int 60000 per degree.
Value is normalized to a positive value less than 360 degrees.
"""
if degrees < 0.0:
| python | {
"resource": ""
} |
q20238 | LayoutPlaceholder._base_placeholder | train | def _base_placeholder(self):
"""
Return the master placeholder this layout placeholder inherits from.
"""
base_ph_type = {
PP_PLACEHOLDER.BODY: PP_PLACEHOLDER.BODY,
PP_PLACEHOLDER.CHART: PP_PLACEHOLDER.BODY,
PP_PLACEHOLDER.BITMAP: PP_PLACEHOLDER.BODY,
PP_PLACEHOLDER.CENTER_TITLE: PP_PLACEHOLDER.TITLE,
PP_PLACEHOLDER.ORG_CHART: PP_PLACEHOLDER.BODY,
PP_PLACEHOLDER.DATE: PP_PLACEHOLDER.DATE,
PP_PLACEHOLDER.FOOTER: PP_PLACEHOLDER.FOOTER,
PP_PLACEHOLDER.MEDIA_CLIP: PP_PLACEHOLDER.BODY,
PP_PLACEHOLDER.OBJECT: PP_PLACEHOLDER.BODY,
| python | {
"resource": ""
} |
q20239 | NotesSlidePlaceholder._base_placeholder | train | def _base_placeholder(self):
"""
Return the notes master placeholder this notes slide placeholder
inherits from, or |None| if no placeholder of the matching type is
present.
"""
notes_master = | python | {
"resource": ""
} |
q20240 | GroupShape.shapes | train | def shapes(self):
"""|GroupShapes| object for this group.
The |GroupShapes| object provides access to the group's member shapes | python | {
"resource": ""
} |
q20241 | load_adjustment_values | train | def load_adjustment_values():
"""load adjustment values and their default values from XML"""
# parse XML --------------------------------------------
thisdir = os.path.split(__file__)[0]
prst_defs_relpath = (
'ISO-IEC-29500-1/schemas/dml-geometries/OfficeOpenXML-DrawingMLGeomet'
'ries/presetShapeDefinitions.xml'
)
prst_defs_path = os.path.join(thisdir, prst_defs_relpath)
presetShapeDefinitions = objectify.parse(prst_defs_path).getroot()
# load individual records into tuples to return --------
ns = 'http://schemas.openxmlformats.org/drawingml/2006/main'
avLst_qn = '{%s}avLst' % ns
adjustment_values = []
for shapedef in presetShapeDefinitions.iterchildren():
prst = shapedef.tag
try:
| python | {
"resource": ""
} |
q20242 | print_mso_auto_shape_type_spec | train | def print_mso_auto_shape_type_spec():
"""print spec dictionary for msoAutoShapeType"""
auto_shape_types = MsoAutoShapeTypeCollection.load(sort='const_name')
| python | {
"resource": ""
} |
q20243 | render_desc | train | def render_desc(desc):
"""calculate desc string, wrapped if too long"""
desc = desc + '.'
desc_lines = split_len(desc, 54)
if len(desc_lines) > 1:
join_str = "'\n%s'" % (' | python | {
"resource": ""
} |
q20244 | parse_args | train | def parse_args(spectypes):
"""
Return arguments object formed by parsing the command line used to launch
the program.
"""
arg_parser = argparse.ArgumentParser()
arg_parser.add_argument(
"-c", "--constants",
help="emit constants instead of spec dict",
action="store_true"
| python | {
"resource": ""
} |
q20245 | MsoAutoShapeTypeCollection.load_adjustment_values | train | def load_adjustment_values(self, c):
"""load adjustment values for auto shape types in self"""
# retrieve auto shape types in const_name order --------
for mast in self:
# retriev adj vals for this auto shape type --------
c.execute(
' SELECT name, val\n'
' FROM adjustment_values\n'
| python | {
"resource": ""
} |
q20246 | _required_attribute | train | def _required_attribute(element, name, default):
"""
Add attribute with default value | python | {
"resource": ""
} |
q20247 | ComplexType.add_element | train | def add_element(self, element):
"""
Add an element to this ComplexType and also append it to | python | {
"resource": ""
} |
q20248 | NotesSlide.notes_placeholder | train | def notes_placeholder(self):
"""
Return the notes placeholder on this notes slide, the shape that
contains the actual notes text. Return |None| if no notes placeholder
is present; while this is probably uncommon, it can happen if the
notes master does not have a body placeholder, or if the notes
placeholder has | python | {
"resource": ""
} |
q20249 | SlideLayout.iter_cloneable_placeholders | train | def iter_cloneable_placeholders(self):
"""
Generate a reference to each layout placeholder on this slide layout
that should be cloned to a slide when the layout is applied to that
slide.
"""
latent_ph_types = (
| python | {
"resource": ""
} |
q20250 | SlideLayout.used_by_slides | train | def used_by_slides(self):
"""Tuple of slide objects based on this slide layout."""
# ---getting Slides collection requires | python | {
"resource": ""
} |
q20251 | Presentation.slides | train | def slides(self):
"""
|Slides| object containing the slides in this presentation.
"""
sldIdLst = self._element.get_or_add_sldIdLst()
| python | {
"resource": ""
} |
q20252 | FreeformBuilder.new | train | def new(cls, shapes, start_x, start_y, x_scale, y_scale):
"""Return a new |FreeformBuilder| object.
The initial pen location is specified | python | {
"resource": ""
} |
q20253 | FreeformBuilder.convert_to_shape | train | def convert_to_shape(self, origin_x=0, origin_y=0):
"""Return new freeform shape positioned relative to specified offset.
*origin_x* and *origin_y* locate the origin of the local coordinate
system in slide coordinates (EMU), perhaps most conveniently by use
| python | {
"resource": ""
} |
q20254 | FreeformBuilder.shape_offset_x | train | def shape_offset_x(self):
"""Return x distance of shape origin from local coordinate origin.
The returned integer represents the leftmost extent of the freeform
shape, in local coordinates. Note that the bounding box of the shape
need not start at the local origin.
"""
| python | {
"resource": ""
} |
q20255 | FreeformBuilder.shape_offset_y | train | def shape_offset_y(self):
"""Return y distance of shape origin from local coordinate origin.
The returned integer represents the topmost extent of the freeform
shape, in local coordinates. Note that the bounding box of the shape
need not start at the local origin.
"""
| python | {
"resource": ""
} |
q20256 | FreeformBuilder._add_line_segment | train | def _add_line_segment(self, x, y):
"""Add a |_LineSegment| operation to the drawing sequence."""
| python | {
"resource": ""
} |
q20257 | FreeformBuilder._dx | train | def _dx(self):
"""Return integer width of this shape's path in local units."""
min_x = max_x = self._start_x
for drawing_operation in self:
if hasattr(drawing_operation, 'x'):
min_x = min(min_x, | python | {
"resource": ""
} |
q20258 | FreeformBuilder._dy | train | def _dy(self):
"""Return integer height of this shape's path in local units."""
min_y = max_y = self._start_y
for drawing_operation in self:
if hasattr(drawing_operation, 'y'):
min_y = min(min_y, | python | {
"resource": ""
} |
q20259 | FreeformBuilder._local_to_shape | train | def _local_to_shape(self, local_x, local_y):
"""Translate local coordinates point to shape coordinates.
Shape coordinates have the same unit as local coordinates, but are
offset such that the origin of the shape coordinate system (0, 0) is
located at the top-left corner of | python | {
"resource": ""
} |
q20260 | FillFormat.background | train | def background(self):
"""
Sets the fill type to noFill, i.e. transparent.
"""
| python | {
"resource": ""
} |
q20261 | FillFormat.gradient | train | def gradient(self):
"""Sets the fill type to gradient.
If the fill is not already a gradient, a default gradient is added.
The default gradient corresponds to the default in the built-in
PowerPoint "White" template. This gradient is linear at angle
90-degrees (upward), with two stops. The first stop is Accent-1 with
tint 100%, | python | {
"resource": ""
} |
q20262 | FillFormat.gradient_stops | train | def gradient_stops(self):
"""|GradientStops| object providing access to stops of this gradient.
Raises |TypeError| when fill is not gradient (call `fill.gradient()`
first). Each stop represents a color between which the gradient
smoothly transitions.
| python | {
"resource": ""
} |
q20263 | FillFormat.patterned | train | def patterned(self):
"""Selects the pattern fill type.
Note that calling this method does not by itself set a foreground or
background color of the pattern. Rather it enables subsequent
assignments to properties | python | {
"resource": ""
} |
q20264 | FillFormat.solid | train | def solid(self):
"""
Sets the fill type to solid, i.e. a solid color. Note that calling
this method does not set a color or by itself cause the shape to
| python | {
"resource": ""
} |
q20265 | Point.format | train | def format(self):
"""
The |ChartFormat| object providing access to the shape formatting
| python | {
"resource": ""
} |
q20266 | Point.marker | train | def marker(self):
"""
The |Marker| instance for this point, providing access to the visual
properties of the data point marker, such as fill and line. Setting
these properties overrides | python | {
"resource": ""
} |
q20267 | CT_GroupShape.recalculate_extents | train | def recalculate_extents(self):
"""Adjust x, y, cx, and cy to incorporate all contained shapes.
This would typically be called when a contained shape is added,
removed, or its position or size updated.
This method is recursive "upwards" since a change in a group shape
can change the position and size of its containing group.
"""
if not self.tag == qn('p:grpSp'):
return
x, y, cx, cy | python | {
"resource": ""
} |
q20268 | CT_GroupShape._next_shape_id | train | def _next_shape_id(self):
"""Return unique shape id suitable for use with a new shape element.
The returned id is the next available positive integer drawing object
id in shape tree, starting from 1 and making use of any gaps in
numbering. In practice, the minimum id is 2 because the spTree
element itself is always assigned id="1".
| python | {
"resource": ""
} |
q20269 | CT_PlotArea.iter_xCharts | train | def iter_xCharts(self):
"""
Generate each xChart child element in document.
"""
plot_tags = (
qn('c:area3DChart'), qn('c:areaChart'), qn('c:bar3DChart'),
qn('c:barChart'), qn('c:bubbleChart'), qn('c:doughnutChart'),
qn('c:line3DChart'), qn('c:lineChart'), qn('c:ofPieChart'),
qn('c:pie3DChart'), qn('c:pieChart'), qn('c:radarChart'),
| python | {
"resource": ""
} |
q20270 | LineFormat.color | train | def color(self):
"""
The |ColorFormat| instance that provides access to the color settings
for this line. Essentially a shortcut for ``line.fill.fore_color``.
As a side-effect, accessing this property causes the line fill type
to be set to ``MSO_FILL.SOLID``. If this sounds risky for your use
case, use | python | {
"resource": ""
} |
q20271 | GraphicFrame.chart_part | train | def chart_part(self):
"""
The |ChartPart| object containing the chart in this graphic frame.
"""
| python | {
"resource": ""
} |
q20272 | GraphicFrame.table | train | def table(self):
"""
The |Table| object contained in this graphic frame. Raises
|ValueError| if this graphic frame does not contain a table.
"""
if not self.has_table:
| python | {
"resource": ""
} |
q20273 | TextFitter._fits_inside_predicate | train | def _fits_inside_predicate(self):
"""
Return a function taking an integer point size argument that returns
|True| if the text in this fitter can be wrapped to fit entirely
within its extents when rendered at that point size.
"""
def predicate(point_size):
"""
Return |True| if the text in *line_source* can be wrapped to fit
entirely within *extents* when rendered at *point_size* using the
font defined in | python | {
"resource": ""
} |
q20274 | Categories.levels | train | def levels(self):
"""
Return a sequence of |CategoryLevel| objects representing the
hierarchy of this category collection. The sequence is empty when the
category collection is not hierarchical, that is, contains only
leaf-level categories. The levels are ordered from the leaf level to
the root level; so the first level | python | {
"resource": ""
} |
q20275 | FontFiles._font_directories | train | def _font_directories(cls):
"""
Return a sequence of directory paths likely to contain fonts on the
current platform.
"""
if sys.platform.startswith('darwin'):
return | python | {
"resource": ""
} |
q20276 | FontFiles._os_x_font_directories | train | def _os_x_font_directories(cls):
"""
Return a sequence of directory paths on a Mac in which fonts are
likely to be located.
"""
os_x_font_dirs = [
'/Library/Fonts',
| python | {
"resource": ""
} |
q20277 | CT_TableCell.is_merge_origin | train | def is_merge_origin(self):
"""True if cell is top-left in merged cell range."""
if self.gridSpan > 1 and not self.vMerge:
return | python | {
"resource": ""
} |
q20278 | CT_TableCell.text | train | def text(self):
"""str text contained in cell"""
# ---note this shadows lxml _Element.text---
txBody = self.txBody
| python | {
"resource": ""
} |
q20279 | CT_TableCell._get_marX | train | def _get_marX(self, attr_name, default):
"""
Generalized method to get margin values.
| python | {
"resource": ""
} |
q20280 | TcRange.from_merge_origin | train | def from_merge_origin(cls, tc):
"""Return instance created from merge-origin tc element."""
other_tc = tc.tbl.tc(
| python | {
"resource": ""
} |
q20281 | TcRange.contains_merged_cell | train | def contains_merged_cell(self):
"""True if one or more cells in range are part of a merged cell."""
for tc in self.iter_tcs():
if tc.gridSpan > 1:
| python | {
"resource": ""
} |
q20282 | TcRange.in_same_table | train | def in_same_table(self):
"""True if both cells provided to constructor are | python | {
"resource": ""
} |
q20283 | TcRange.move_content_to_origin | train | def move_content_to_origin(self):
"""Move all paragraphs in range to origin cell."""
tcs = list(self.iter_tcs())
origin_tc = | python | {
"resource": ""
} |
q20284 | TcRange._bottom | train | def _bottom(self):
"""Index of row following last row | python | {
"resource": ""
} |
q20285 | TcRange._right | train | def _right(self):
"""Index of column following the last column in range"""
| python | {
"resource": ""
} |
q20286 | DataLabels.font | train | def font(self):
"""
The |Font| object that provides access to the text properties for
| python | {
"resource": ""
} |
q20287 | DataLabel.font | train | def font(self):
"""The |Font| object providing text formatting for this data label.
This font object is used to customize the appearance of automatically
inserted text, such as the data point value. The font applies to the
entire data label. More granular control of the appearance of custom
data label text is controlled by a | python | {
"resource": ""
} |
q20288 | Legend.include_in_layout | train | def include_in_layout(self):
"""|True| if legend should be located inside plot area.
Read/write boolean specifying whether legend should be placed inside
the plot area. In many cases this will cause it to be superimposed on
the chart itself. Assigning |None| to this property causes any
`c:overlay` element to be removed, which is interpreted the same as
| python | {
"resource": ""
} |
q20289 | PresentationPart.notes_master_part | train | def notes_master_part(self):
"""
Return the |NotesMasterPart| object for this presentation. If the
presentation does not have a notes master, one is created from
a default template. The same single instance is returned | python | {
"resource": ""
} |
q20290 | Movie.poster_frame | train | def poster_frame(self):
"""Return |Image| object containing poster frame for this movie.
Returns |None| if this movie has no poster frame (uncommon).
"""
| python | {
"resource": ""
} |
q20291 | Picture.auto_shape_type | train | def auto_shape_type(self):
"""Member of MSO_SHAPE indicating masking shape.
A picture can be masked by any of the so-called "auto-shapes"
available in PowerPoint, such as an ellipse or triangle. When
a picture is masked by a shape, the shape assumes the same dimensions
as the picture and the portion of the picture outside the shape
boundaries does not appear. Note the default value for
a newly-inserted picture is `MSO_AUTO_SHAPE_TYPE.RECTANGLE`, which
performs no cropping because the extents of the rectangle exactly
correspond to the extents of the picture.
The available shapes correspond to the members of
:ref:`MsoAutoShapeType`.
The return value can also be |None|, indicating the picture either
| python | {
"resource": ""
} |
q20292 | Picture.image | train | def image(self):
"""
An |Image| object providing access to the properties and bytes of the
image in this picture shape.
| python | {
"resource": ""
} |
q20293 | _BaseSeries.name | train | def name(self):
"""
The string label given to this series, appears as the title of the
column for this series in the Excel worksheet. It also appears as the
label for this series in the legend.
"""
| python | {
"resource": ""
} |
q20294 | _BaseCategorySeries.values | train | def values(self):
"""
Read-only. A sequence containing the float values for this series, in
the order they appear on the chart.
"""
def iter_values():
val = self._element.val
| python | {
"resource": ""
} |
q20295 | TextFrame.clear | train | def clear(self):
"""
Remove all paragraphs except one empty one.
"""
for p in self._txBody.p_lst[1:]:
| python | {
"resource": ""
} |
q20296 | TextFrame.fit_text | train | def fit_text(self, font_family='Calibri', max_size=18, bold=False,
italic=False, font_file=None):
"""Fit text-frame text entirely within bounds of its shape.
Make the text in this text frame fit entirely within the bounds of
its shape by setting word wrap on and applying the "best-fit" font
size to all the text it contains. :attr:`TextFrame.auto_size` is set
to :attr:`MSO_AUTO_SIZE.NONE`. The font size will not be set larger
than *max_size* points. If the path to a matching TrueType font is
provided as *font_file*, that font file will be used for the font
metrics. If *font_file* is |None|, best efforts are made to locate
a font file with | python | {
"resource": ""
} |
q20297 | TextFrame.paragraphs | train | def paragraphs(self):
"""
Immutable sequence of |_Paragraph| instances corresponding to the
paragraphs in this text frame. A text frame always contains at least
| python | {
"resource": ""
} |
q20298 | TextFrame.word_wrap | train | def word_wrap(self):
"""
Read-write setting determining whether lines of text in this shape
are wrapped to fit within the shape's width. Valid values are True,
False, or None. True and False turn word wrap on and off,
respectively. Assigning None to word wrap causes any word wrap
setting to be removed from the text frame, causing it to inherit this
| python | {
"resource": ""
} |
q20299 | _Paragraph.clear | train | def clear(self):
"""
Remove all content from this paragraph. Paragraph properties are
preserved. Content includes runs, line breaks, and fields.
"""
| python | {
"resource": ""
} |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.