_id stringlengths 2 6 | title stringlengths 9 130 | partition stringclasses 3
values | text stringlengths 30 4.3k | language stringclasses 1
value | meta_information dict |
|---|---|---|---|---|---|
q17800 | Sfn.Cache.get_local_storage | train | def get_local_storage(data_type, full_name, args = {})
@storage ||= {}
@storage[full_name] ||= case data_type.to_sym
when :array
[]
when :hash
{}
when :va... | ruby | {
"resource": ""
} |
q17801 | Sfn.Cache.time_check_allow? | train | def time_check_allow?(key, stamp)
Time.now.to_i - | ruby | {
"resource": ""
} |
q17802 | Sfn.Cache.apply_limit | train | def apply_limit(kind, seconds = nil)
@apply_limit ||= {}
if seconds
@apply_limit[kind.to_sym] | ruby | {
"resource": ""
} |
q17803 | Sfn.Cache.locked_action | train | def locked_action(lock_name, raise_on_locked = false)
begin
self[lock_name].lock do
yield
end
rescue => e
if e.class.to_s.end_with?("Timeout")
| ruby | {
"resource": ""
} |
q17804 | HashDiff.LinearCompareArray.index_of_match_after_additions | train | def index_of_match_after_additions
return unless expected_additions > 0
(1..expected_additions).each do |i|
next_difference = item_difference(
old_array[old_index],
new_array[new_index + i],
| ruby | {
"resource": ""
} |
q17805 | HashDiff.LinearCompareArray.index_of_match_after_deletions | train | def index_of_match_after_deletions
return unless expected_additions < 0
(1..(expected_additions.abs)).each do |i|
next_difference = item_difference( | ruby | {
"resource": ""
} |
q17806 | MySQLBinUUID.Type.cast | train | def cast(value)
if value.is_a?(MySQLBinUUID::Type::Data)
# It could be a Data object, in which case we should add dashes to the
# string value from there.
add_dashes(value.to_s)
elsif value.is_a?(String) && value.encoding == Encoding::ASCII_8BIT && strip_dashes(value).length != 32
... | ruby | {
"resource": ""
} |
q17807 | MySQLBinUUID.Type.serialize | train | def serialize(value)
return if value.nil?
undashed_uuid = strip_dashes(value)
# To avoid SQL injection, verify that it looks like a UUID. ActiveRecord
# does not explicity escape the | ruby | {
"resource": ""
} |
q17808 | MySQLBinUUID.Type.add_dashes | train | def add_dashes(uuid)
return uuid if uuid =~ /\-/
[uuid[0..7], uuid[8..11], | ruby | {
"resource": ""
} |
q17809 | Oath.ControllerHelpers.sign_in | train | def sign_in user
Oath.config.sign_in_service.new(user, warden).perform.tap do |status|
| ruby | {
"resource": ""
} |
q17810 | Oath.ControllerHelpers.sign_up | train | def sign_up user_params
Oath.config.sign_up_service.new(user_params).perform.tap do |status|
| ruby | {
"resource": ""
} |
q17811 | Oath.ControllerHelpers.authenticate_session | train | def authenticate_session session_params, field_map = nil
token_field = Oath.config.user_token_field
params_hash = Oath.transform_params(session_params).symbolize_keys
| ruby | {
"resource": ""
} |
q17812 | Oath.ControllerHelpers.authenticate | train | def authenticate user, password
Oath.co | ruby | {
"resource": ""
} |
q17813 | Oath.ControllerHelpers.reset_password | train | def reset_password user, password
Oath.c | ruby | {
"resource": ""
} |
q17814 | Oath.ParamTransformer.to_h | train | def to_h
sanitized_params.each_with_object({}) do |(key, value), hash|
| ruby | {
"resource": ""
} |
q17815 | GoogleDistanceMatrix.Client.get | train | def get(url, instrumentation: {}, **_options)
uri = URI.parse url
response = ActiveSupport::Notifications.instrument(
'client_request_matrix_data.google_distance_matrix', instrumentation
) do
Net::HTTP.get_response | ruby | {
"resource": ""
} |
q17816 | GoogleDistanceMatrix.PolylineEncoder.encode | train | def encode
return @encoded if @encoded
deltas = @delta.deltas_rounded @array_of_lat_lng_pairs
chars_array = deltas.map | ruby | {
"resource": ""
} |
q17817 | RocketJobMissionControl.Query.unsorted_query | train | def unsorted_query
records = scope
# Text Search
if search_term
escaped = Regexp.escape(search_term)
regexp = Regexp.new(escaped, Regexp::IGNORECASE)
if search_columns.size == 1
records = records.where(search_columns.first => regexp)
else
cols = ... | ruby | {
"resource": ""
} |
q17818 | RocketJobMissionControl.ApplicationHelper.editable_field_html | train | def editable_field_html(klass, field_name, value, f, include_nil_selectors = false)
# When editing a job the values are of the correct type.
# When editing a dirmon entry values are strings.
field = klass.fields[field_name.to_s]
return unless field && field.type
placeholder = field.defaul... | ruby | {
"resource": ""
} |
q17819 | RocketJobMissionControl.JobsDatatable.map | train | def map(job)
index = 0
h = {}
@columns.each do |column|
h[index.to_s] = send(column[:value], | ruby | {
"resource": ""
} |
q17820 | OoxmlParser.SharedStringTable.parse | train | def parse(file)
return nil unless File.exist?(file)
document = parse_xml(file)
node = document.xpath('*').first
node.attributes.each do |key, value|
case key
when 'count'
@count = value.value.to_i
when 'uniqueCount'
@unique_count = value.value.to_i
... | ruby | {
"resource": ""
} |
q17821 | OoxmlParser.OldDocxGroup.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'shape'
element = OldDocxGroupElement.new(:shape)
element.object = OldDocxShape.new(parent: self).parse(node_child)
@elements << element
when 'wrap'
@properties.wrap = nod... | ruby | {
"resource": ""
} |
q17822 | OoxmlParser.PlotArea.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'barChart'
@bar_chart = CommonChartData.new(parent: self).parse(node_child)
when 'lineChart'
@line_chart = CommonChartData.new(parent: self).parse(node_child)
when 'areaChart'
... | ruby | {
"resource": ""
} |
q17823 | OoxmlParser.DisplayLabelsProperties.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'dLblPos'
@position = value_to_symbol(node_child.attribute('val'))
when 'showLegendKey'
@show_legend_key = true if node_child.attribute('val').value == '1'
when 'showVal'
@s... | ruby | {
"resource": ""
} |
q17824 | OoxmlParser.DocxPatternFill.parse | train | def parse(node)
@preset = node.attribute('prst').value.to_sym
node.xpath('*').each do |node_child|
case node_child.name
when 'fgClr'
| ruby | {
"resource": ""
} |
q17825 | OoxmlParser.OldDocxShapeFill.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'id'
@file_reference = FileReference.new(parent: self).parse(node)
when 'type'
@stretching_type = case value.value
when 'frame'
:stretch
| ruby | {
"resource": ""
} |
q17826 | OoxmlParser.ParagraphBorders.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'bottom'
@bottom = BordersProperties.new(parent: self).parse(node_child)
when 'left'
@left = BordersProperties.new(parent: self).parse(node_child)
when 'top'
@top = BordersP... | ruby | {
"resource": ""
} |
q17827 | OoxmlParser.PresentationAlternateContent.parse | train | def parse(node)
node.xpath('mc:Choice/*', 'xmlns:mc' => 'http://schemas.openxmlformats.org/markup-compatibility/2006').each do |node_child|
case node_child.name
when 'timing'
@timing = Timing.new(parent: self).parse(node_child)
when 'transition'
@transition = | ruby | {
"resource": ""
} |
q17828 | OoxmlParser.DocxColorScheme.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'solidFill'
@type = :solid
@color = Color.new(parent: self).parse_color_model(node_child)
when 'gradFill'
@type = :gradient
| ruby | {
"resource": ""
} |
q17829 | OoxmlParser.DocumentBackground.parse | train | def parse(node)
@color1 = Color.new(parent: self).parse_hex_string(node.attribute('color').value)
node.xpath('v:background').each do |second_color|
@size = second_color.attribute('targetscreensize').value.sub(',', 'x') unless second_color.attribute('targetscreensize').nil?
second_color.xpath... | ruby | {
"resource": ""
} |
q17830 | OoxmlParser.OleObjects.parse | train | def parse(node)
list = []
node.xpath('*').each do |node_child|
case node_child.name
when 'AlternateContent'
| ruby | {
"resource": ""
} |
q17831 | OoxmlParser.DocumentStyle.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'type'
@type = value.value.to_sym
when 'styleId'
@style_id = value.value
when 'default'
@default = attribute_enabled?(value.value)
end
end
node.xpath('*').each do |s... | ruby | {
"resource": ""
} |
q17832 | OoxmlParser.Worksheet.parse_drawing | train | def parse_drawing
drawing_node = parse_xml(OOXMLDocumentObject.current_xml)
drawing_node.xpath('xdr:wsDr/*').each do |drawing_node_child|
| ruby | {
"resource": ""
} |
q17833 | OoxmlParser.Worksheet.parse_comments | train | def parse_comments
return unless relationships
comments_target = relationships.target_by_type('comment')
return if comments_target.empty?
comments_file = | ruby | {
"resource": ""
} |
q17834 | OoxmlParser.StringIndex.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 't'
| ruby | {
"resource": ""
} |
q17835 | OoxmlParser.BookmarkStart.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'id'
@id = value.value.to_i
| ruby | {
"resource": ""
} |
q17836 | OoxmlParser.Behavior.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'cTn'
@common_time_node = CommonTiming.new(parent: self).parse(node_child)
when 'tgtEl'
| ruby | {
"resource": ""
} |
q17837 | OoxmlParser.AbstractNumbering.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'abstractNumId'
@id = value.value.to_f
end
end
node.xpath('*').each do |numbering_child_node|
| ruby | {
"resource": ""
} |
q17838 | OoxmlParser.XlsxRow.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'customHeight'
@custom_height = option_enabled?(node, 'customHeight')
when 'ht'
@height = OoxmlSize.new(value.value.to_f, :point)
when 'hidden'
@hidden = option_enabled?(node, 'hidden')... | ruby | {
"resource": ""
} |
q17839 | OoxmlParser.Accent.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'accPr'
node_child.xpath('*').each do |node_child_child|
case node_child_child.name
when 'chr'
| ruby | {
"resource": ""
} |
q17840 | OoxmlParser.Color.looks_like? | train | def looks_like?(color_to_check = nil, delta = 8)
color_to_check = color_to_check.converted_color if color_to_check.is_a?(SchemeColor)
color_to_check = color_to_check.pattern_fill.foreground_folor if color_to_check.is_a?(Fill)
color_to_check = color_to_check.color.converted_color if color_to_check.is_a... | ruby | {
"resource": ""
} |
q17841 | OoxmlParser.ChartCellsRange.parse | train | def parse(node)
@list = node.xpath('c:f')[0].text.split('!').first
coordinates = Coordinates.parser_coordinates_range(node.xpath('c:f')[0].text) # .split('!')[1].gsub('$', ''))
return self unless coordinates
node.xpath('c:numCache/c:pt').each_with_index do |point_node, index|
| ruby | {
"resource": ""
} |
q17842 | OoxmlParser.XlsxAlignment.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'horizontal'
@horizontal = value.value.to_sym
@wrap_text = true if @horizontal == :justify
when 'vertical'
@vertical = value.value.to_sym
when 'wrapText'
| ruby | {
"resource": ""
} |
q17843 | OoxmlParser.TableStyle.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'styleId'
@id = value.value.to_s
when 'styleName'
@name = value.value.to_s
when 'val'
@value = value.value.to_s
end
end
node.xpath('*').each do |style_node_child|
... | ruby | {
"resource": ""
} |
q17844 | OoxmlParser.ParagraphRun.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'rPr'
@properties = RunProperties.new(parent: self).parse(node_child)
when 't'
@t = Text.new(parent: self).parse(node_child)
@text = | ruby | {
"resource": ""
} |
q17845 | OoxmlParser.XLSXWorkbook.all_formula_values | train | def all_formula_values(precision = 14)
formulas = []
worksheets.each do |c_sheet|
next unless c_sheet
c_sheet.rows.each do |c_row|
next unless c_row
c_row.cells.each do |c_cell|
next unless c_cell
next unless c_cell.formula
next if c_... | ruby | {
"resource": ""
} |
q17846 | OoxmlParser.XLSXWorkbook.parse_shared_strings | train | def parse_shared_strings
shared_strings_target = relationships.target_by_type('sharedString')
return if shared_strings_target.empty?
shared_string_file = | ruby | {
"resource": ""
} |
q17847 | OoxmlParser.TablePosition.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'leftFromText'
@left = OoxmlSize.new(value.value.to_f)
when 'rightFromText'
@right = OoxmlSize.new(value.value.to_f)
when 'topFromText'
@top = OoxmlSize.new(value.value.to_f)
wh... | ruby | {
"resource": ""
} |
q17848 | OoxmlParser.Shape.parse | train | def parse(node, type)
@type = type
node.attribute('style').value.to_s.split(';').each do |property|
if property.include?('margin-top')
@properties.margins.top = property.split(':').last
elsif property.include?('margin-left')
@properties.margins.left = property.split(':').... | ruby | {
"resource": ""
} |
q17849 | OoxmlParser.TextField.parse | train | def parse(node)
@id = node.attribute('id').value
@type = node.attribute('type').value
node.xpath('*').each do |text_field_node_child|
case text_field_node_child.name
| ruby | {
"resource": ""
} |
q17850 | OoxmlParser.DocxColor.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'blipFill'
@type = :picture
@value = DocxBlip.new(parent: self).parse(node_child)
node_child.xpath('*').each do |fill_type_node_child|
case fill_type_node_child.name
... | ruby | {
"resource": ""
} |
q17851 | OoxmlParser.PageProperties.parse | train | def parse(node, default_paragraph, default_character)
node.xpath('*').each do |pg_size_subnode|
case pg_size_subnode.name
when 'pgSz'
@size = PageSize.new.parse(pg_size_subnode)
when 'pgBorders'
page_borders = Borders.new
page_borders.display = pg_size_subnode... | ruby | {
"resource": ""
} |
q17852 | OoxmlParser.ChartAxisTitle.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'tx'
node_child.xpath('c:rich/*').each do |rich_node_child|
case rich_node_child.name
when 'p'
root_object.default_font_style = FontStyle.new(true) # Default font style fo... | ruby | {
"resource": ""
} |
q17853 | OoxmlParser.XlsxDrawing.parse | train | def parse(node)
node.xpath('*').each do |child_node|
case child_node.name
when 'from'
@from = XlsxDrawingPositionParameters.new(parent: self).parse(child_node)
when 'to'
@to = XlsxDrawingPositionParameters.new(parent: self).parse(child_node)
when 'sp'
... | ruby | {
"resource": ""
} |
q17854 | OoxmlParser.Borders.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'lnL', 'left'
@left = TableCellLine.new(parent: self).parse(node_child)
when 'lnR', 'right'
@right = TableCellLine.new(parent: self).parse(node_child)
when 'lnT', 'top'
@top... | ruby | {
"resource": ""
} |
q17855 | OoxmlParser.SlideHelper.transform_of_object | train | def transform_of_object(object)
case object
when :image
elements.find { |e| e.is_a? Picture }.properties.transform
when :chart
elements.find { |e| e.is_a? GraphicFrame }.transform
when :table
elements.find { |e| e.is_a? GraphicFrame }.transform
when :shape
| ruby | {
"resource": ""
} |
q17856 | OoxmlParser.BlipFill.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'blip'
@blip = Blip.new(parent: self).parse(node_child)
when 'stretch'
| ruby | {
"resource": ""
} |
q17857 | OoxmlParser.OldDocxShapeProperties.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'fillcolor'
@fill_color = Color.new(parent: self).parse_hex_string(value.value.delete('#'))
when 'opacity'
@opacity = value.value.to_f
when 'strokecolor'
| ruby | {
"resource": ""
} |
q17858 | OoxmlParser.Slide.parse | train | def parse
OOXMLDocumentObject.add_to_xmls_stack(@xml_path)
@name = File.basename(@xml_path, '.*')
node = parse_xml(OOXMLDocumentObject.current_xml)
node.xpath('//p:sld/*').each do |node_child|
case node_child.name
when 'cSld'
@common_slide_data = CommonSlideData.new(par... | ruby | {
"resource": ""
} |
q17859 | OoxmlParser.DocxPicture.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'blipFill'
@path_to_image = DocxBlip.new(parent: self).parse(node_child)
when 'spPr'
@properties = DocxShapeProperties.new(parent: self).parse(node_child)
when 'nvPicPr'
| ruby | {
"resource": ""
} |
q17860 | OoxmlParser.GradientColor.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'gsLst'
node_child.xpath('*').each do |gradient_stop_node|
@gradient_stops << GradientStop.new(parent: self).parse(gradient_stop_node)
end
when 'path'
@path = | ruby | {
"resource": ""
} |
q17861 | OoxmlParser.Tab.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'algn', 'val'
@value = value_to_symbol(value)
when 'leader'
@leader = value_to_symbol(value)
when 'pos'
| ruby | {
"resource": ""
} |
q17862 | OoxmlParser.TableStyleInfo.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'name'
@name = value.value.to_s
when 'showColumnStripes'
@show_column_stripes = attribute_enabled?(value)
when 'showFirstColumn'
@show_first_column = attribute_enabled?(value)
w... | ruby | {
"resource": ""
} |
q17863 | OoxmlParser.FieldSimple.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'instr'
@instruction = value.value.to_s
end
end
node.xpath('*').each do |node_child|
case node_child.name
| ruby | {
"resource": ""
} |
q17864 | OoxmlParser.PresentationPattern.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'prst'
@preset = value.value.to_sym
end
end
node.xpath('*').each do |color_node|
case color_node.name
when 'fgClr'
@foreground_color = Color.new(parent: self).parse_color(col... | ruby | {
"resource": ""
} |
q17865 | OoxmlParser.DocumentSettings.parse | train | def parse
settings_path = OOXMLDocumentObject.path_to_folder + 'word/settings.xml'
return nil unless File.exist?(settings_path)
doc = parse_xml(settings_path)
doc.xpath('w:settings/*').each do |node_child|
case | ruby | {
"resource": ""
} |
q17866 | OoxmlParser.LineJoin.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'round', 'bevel'
@type = node_child.name.to_sym
when 'miter'
@type = :miter
| ruby | {
"resource": ""
} |
q17867 | OoxmlParser.ExtensionList.parse | train | def parse(node)
node.xpath('*').each do |column_node|
case column_node.name
when 'ext'
| ruby | {
"resource": ""
} |
q17868 | OoxmlParser.XlsxCell.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 's'
@style_index = value.value.to_i
when 't'
@type = value.value.to_s
end
end
node.xpath('*').each do |node_child|
case node_child.name
when 'f'
| ruby | {
"resource": ""
} |
q17869 | OoxmlParser.XlsxCell.get_shared_string | train | def get_shared_string(value)
return '' if value == ''
string = root_object.shared_strings_table.string_indexes[value.to_i]
| ruby | {
"resource": ""
} |
q17870 | OoxmlParser.ShapeTree.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'sp'
@elements << DocxShape.new(parent: self).parse(node_child).dup
when 'pic'
@elements << DocxPicture.new(parent: self).parse(node_child)
when 'graphicFrame'
@elements << ... | ruby | {
"resource": ""
} |
q17871 | OoxmlParser.PresentationNotes.parse | train | def parse(file)
node = parse_xml(file)
node.xpath('p:notes/*').each do |node_child|
case node_child.name
when 'cSld'
| ruby | {
"resource": ""
} |
q17872 | OoxmlParser.TargetElement.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'sldTgt'
@type = :slide
when 'sndTgt'
@type = :sound
@name = node_child.attribute('name').value
@built_in = node_child.attribute('builtIn').value ? StringHelper.to_bool(no... | ruby | {
"resource": ""
} |
q17873 | OoxmlParser.Table.parse | train | def parse(node,
number = 0,
default_table_properties = TableProperties.new)
table_properties = default_table_properties.dup
table_properties.jc = :left
node.xpath('*').each do |node_child|
case node_child.name
when 'tblGrid'
@grid = TableGrid.new(p... | ruby | {
"resource": ""
} |
q17874 | OoxmlParser.Matrix.parse | train | def parse(node)
columns_count = 1
j = 0
node.xpath('m:mPr').each do |m_pr|
m_pr.xpath('m:mcs').each do |mcs|
mcs.xpath('m:mc').each do |mc|
mc.xpath('m:mcPr').each do |mc_pr|
mc_pr.xpath('m:count').each do |count|
columns_count = count.attrib... | ruby | {
"resource": ""
} |
q17875 | OoxmlParser.SDTProperties.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'alias'
@alias = ValuedChild.new(:string, parent: self).parse(node_child)
| ruby | {
"resource": ""
} |
q17876 | OoxmlParser.TextBody.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'p'
@paragraphs << Paragraph.new(parent: self).parse(node_child)
when 'bodyPr'
| ruby | {
"resource": ""
} |
q17877 | OoxmlParser.AnimationEffect.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'transition'
@transition = value.value
when 'filter'
@filter = value.value
end
end
node.xpath('*').each do |node_child|
| ruby | {
"resource": ""
} |
q17878 | OoxmlParser.Xf.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'applyFont'
@apply_font = attribute_enabled?(value)
when 'applyBorder'
@apply_border = attribute_enabled?(value)
when 'applyFill'
@apply_fill = attribute_enabled?(value)
when 'a... | ruby | {
"resource": ""
} |
q17879 | OoxmlParser.Pane.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'state'
@state = value.value.to_sym
when 'topLeftCell'
| ruby | {
"resource": ""
} |
q17880 | OoxmlParser.PresentationComment.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'authorId'
@author_id = value.value.to_i
end
end
node.xpath('*').each do |node_child| | ruby | {
"resource": ""
} |
q17881 | OoxmlParser.TableStylePropertiesHelper.fill_empty_table_styles | train | def fill_empty_table_styles
TABLE_STYLES_NAMES_HASH.each_value do |current_table_style|
style_exist = false
@table_style_properties_list.each do |existing_style|
style_exist = true if existing_style.type == current_table_style
end
| ruby | {
"resource": ""
} |
q17882 | OoxmlParser.FilterColumn.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'showButton'
@show_button = attribute_enabled?(value)
end
end
node.xpath('*').each do |node_child|
case node_child.name
| ruby | {
"resource": ""
} |
q17883 | OoxmlParser.TableCell.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'gridSpan'
@grid_span = value.value.to_i
when 'hMerge'
@horizontal_merge = value.value.to_i
when 'vMerge'
@vertical_merge = value.value.to_i
end
end
node.xpath('*')... | ruby | {
"resource": ""
} |
q17884 | OoxmlParser.Delimiter.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'dPr'
node_child.xpath('*').each do |node_child_child|
case node_child_child.name
when 'begChr'
@begin_character = ValuedChild.new(:string, parent: self).parse(node_child_... | ruby | {
"resource": ""
} |
q17885 | OoxmlParser.ChartAxis.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'delete'
@display = false if node_child.attribute('val').value == '1'
when 'title'
@title = ChartAxisTitle.new(parent: self).parse(node_child)
when 'majorGridlines'
@major_g... | ruby | {
"resource": ""
} |
q17886 | OoxmlParser.ChartLegend.parse | train | def parse(node)
node.xpath('*').each do |child_node|
case child_node.name
when 'legendPos'
@position = value_to_symbol(child_node.attribute('val'))
when 'overlay'
| ruby | {
"resource": ""
} |
q17887 | OoxmlParser.PresentationComments.parse | train | def parse(file = "#{OOXMLDocumentObject.path_to_folder}/#{OOXMLDocumentObject.root_subfolder}/comments/comment1.xml")
return nil unless File.exist?(file)
document = parse_xml(File.open(file))
node = document.xpath('*').first
node.xpath('*').each do | ruby | {
"resource": ""
} |
q17888 | OoxmlParser.OoxmlSize.to_base_unit | train | def to_base_unit
case @unit
when :centimeter
OoxmlSize.new(@value * 360_000)
when :point
OoxmlSize.new(@value * 12_700)
when :half_point
OoxmlSize.new(@value * (12_700 / 2))
when :one_eighth_point
OoxmlSize.new(@value * (12_700 / 8))
when :one_100th_po... | ruby | {
"resource": ""
} |
q17889 | OoxmlParser.DocumentProperties.parse | train | def parse
properties_file = "#{OOXMLDocumentObject.path_to_folder}docProps/app.xml"
unless File.exist?(properties_file)
warn "There is no 'docProps/app.xml' in docx. It may be some problem with it"
return self
end
node = parse_xml(properties_file)
| ruby | {
"resource": ""
} |
q17890 | OoxmlParser.CommonNonVisualProperties.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'name'
@name = value.value
when 'id'
@id = value.value
when 'title'
@title = value.value
when 'descr'
| ruby | {
"resource": ""
} |
q17891 | OoxmlParser.HSLColor.to_rgb | train | def to_rgb
chroma = (1 - (2 * @l - 1).abs) * @s
x = chroma * (1 - ((@h / 60.0) % 2.0 - 1).abs)
m = @l - chroma / 2.0
rgb = if @h.zero?
Color.new(0, 0, 0)
elsif @h > 0 && @h < 60
Color.new(chroma, x, 0)
elsif @h > 60 && @h < 120
C... | ruby | {
"resource": ""
} |
q17892 | OoxmlParser.TransitionProperties.parse | train | def parse(node)
@type = node.name.to_sym
case node.name
when 'blinds', 'checker', 'comb', 'cover', 'pull', 'push', 'randomBar', 'strips', 'wipe', 'zoom', 'warp'
@direction = value_to_symbol(node.attribute('dir')) if node.attribute('dir')
when 'cut', 'fade'
@through_black = option... | ruby | {
"resource": ""
} |
q17893 | OoxmlParser.Inserted.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'id'
@id = value.value.to_i
when 'author'
@author = value.value.to_s
when 'date'
@date = parse_date(value.value.to_s)
when 'oouserid'
@user_id = value.value.to_s
... | ruby | {
"resource": ""
} |
q17894 | OoxmlParser.TableStyleProperties.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'type'
@type = value.value.to_sym
end
end
node.xpath('*').each do |node_child|
case node_child.name
when 'rPr'
@run_properties = RunProperties.new(parent: self).parse(node_ch... | ruby | {
"resource": ""
} |
q17895 | OoxmlParser.Background.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'bgPr'
@properties = BackgroundProperties.new(parent: self).parse(node_child)
end
| ruby | {
"resource": ""
} |
q17896 | OoxmlParser.StructuredDocumentTag.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'sdtContent'
@sdt_content = SDTContent.new(parent: self).parse(node_child)
when 'sdtPr'
| ruby | {
"resource": ""
} |
q17897 | OoxmlParser.Autofilter.parse | train | def parse(node)
node.attributes.each do |key, value|
case key
when 'ref'
@ref = Coordinates.parser_coordinates_range(value.value)
end
end
node.xpath('*').each do |node_child|
case node_child.name | ruby | {
"resource": ""
} |
q17898 | OoxmlParser.Paragraph.parse | train | def parse(node)
node.xpath('*').each do |node_child|
case node_child.name
when 'pPr'
@properties = ParagraphProperties.new(parent: self).parse(node_child)
when 'fld'
@text_field = TextField.new(parent: self).parse(node_child)
when 'r'
@runs << Paragrap... | ruby | {
"resource": ""
} |
q17899 | OoxmlParser.Extension.parse | train | def parse(node)
node.xpath('*').each do |column_node|
case column_node.name
when 'table'
@table = X14Table.new(parent: self).parse(column_node)
when 'sparklineGroups'
| ruby | {
"resource": ""
} |
Subsets and Splits
SQL Console for CoIR-Retrieval/CodeSearchNet-ccr-ruby-queries-corpus
Retrieves a large number of entries in the 'ruby' language, providing basic information but limited analytical value.