Raw Cell is the text from the csv file for this column

 method_name_or_ability_class is one of two things:
 1. the symbol for the method to call for this column
 2. The Class that represents this ability
184581
def mod_for_phrases(raw_cell, method_name_or_ability_class, card_to_setup)
      return unless raw_cell
      #puts [raw,cat,card_class,name].inspect
      raw_cell.split(/[,;]/).each do |raw_cell_part|
        p = make_parsed_phrase_obj(raw_cell_part,method_name_or_ability_class)
        p.mod_card(card_to_setup) if p
      end
    end
450542
Class<?> defineClass(String name, byte[] bytes) throws ClassFormatError {
		try {
			// Attempt to load the access class in the same loader, which makes
			// protected and default access members accessible.
			Method method = ClassLoader.class.getDeclaredMethod("defineClass", DEF_CLASS_SIG);
			method.setAccessible(true);
			return (Class<?>) method.invoke(getParent(), new Object[] { name, bytes, Integer.valueOf(0), Integer.valueOf(bytes.length) });
		} catch (Exception ignored) {
		}
		return defineClass(name, bytes, 0, bytes.length);
	}
1181624
def clean_cell(self, cell, cell_type):
        
        try:
            # Get rid of non-ASCII characters
            cell = cell.encode('ascii', 'ignore').decode()
            if cell_type == 'D':
                cell = datetime.strptime(cell, '%Y%m%d')
            elif cell_type == 'I':
                cell = int(cell)
            elif cell_type == 'N':
                cell = Decimal(cell)
            else:
                cell = cell.upper()

                if len(cell) > 50:
                    cell = cell[0:50]

                if not cell or cell in NULL_TERMS:
                    cell = None

        except:
            cell = None

        return cell
252521
async def on_raw_005(self, message):
        
        isupport = {}

        # Parse response.
        # Strip target (first argument) and 'are supported by this server' (last argument).
        for feature in message.params[1:-1]:
            if feature.startswith(FEATURE_DISABLED_PREFIX):
                value = False
            elif '=' in feature:
                feature, value = feature.split('=', 1)
            else:
                value = True
            isupport[feature.upper()] = value

        # Update internal dict first.
        self._isupport.update(isupport)

        # And have callbacks update other internals.
        for entry, value in isupport.items():
            if value != False:
                # A value of True technically means there was no value supplied; correct this for callbacks.
                if value == True:
                    value = None

                method = 'on_isupport_' + pydle.protocol.identifierify(entry)
                if hasattr(self, method):
                    await getattr(self, method)(value)
87631
function _convertRef2d($cell)
    {
        $class = 2; // as far as I know, this is magick.

        // Convert the cell reference
        $cell_array = $this->_cellToPackedRowcol($cell);
        if (PEAR::isError($cell_array)) {
            return $cell_array;
        }
        list($row, $col) = $cell_array;

        // The ptg value depends on the class of the ptg.
        if ($class == 0) {
            $ptgRef = pack("C", $this->ptg['ptgRef']);
        } elseif ($class == 1) {
            $ptgRef = pack("C", $this->ptg['ptgRefV']);
        } elseif ($class == 2) {
            $ptgRef = pack("C", $this->ptg['ptgRefA']);
        } else {
            // TODO: use real error codes
            return $this->raiseError("Unknown class $class");
        }
        return $ptgRef.$row.$col;
    }
887551
def undef_cell(name)
      method_name = name.gsub('-', '_')
      
      klass = class << self; self; end
      klass.class_eval do
        remove_method(method_name)
      end
    end
679087
public JMethod getMethod(String name, JClass []param)
  {
    return _rawClass.getMethod(name, param);
  }
784189
public void printMethodsDetails(ClassDoc classDoc) {
        MethodDoc[] methodDocs = TestAPIDoclet.getTestAPIComponentMethods(classDoc);
        if (methodDocs.length > 0) {
            mOut.println("&nbsp;<P>");
            mOut.println("<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">");
            mOut.println("<TR BGCOLOR=\"#CCCCFF\"><TH ALIGN=\"left\" COLSPAN=\"2\"><FONT SIZE=\"+2\"><B>Methods "
                  + "Detail</B></FONT></TH></TR>");
            mOut.println("</TABLE>");
            for (int m = 0; m < methodDocs.length; m++) {
                MethodDoc methodDoc = methodDocs[m];
                String methodName = methodDoc.name();

                // get return type
                String returnTypeString = getTypeString(methodDoc.returnType());
                int returnTypeLength = returnTypeString.replaceAll("<.*?>", "").replace("&lt;", "<").replace("&gt;", ">")
                      .length(); // length without HTML tags and &gt;/&lt; entities

                Parameter[] parameters = methodDoc.parameters();
                String[] parameterSignatures = new String[parameters.length];
                for (int i = 0; i < parameterSignatures.length; i++) {
                    Parameter parameter = parameters[i];
                    parameterSignatures[i] = getTypeString(parameter.type()) + " " + parameter.name();
                }
                String parameterSeparator = ",\n";
                for (int i = 0; i < returnTypeLength + methodName.length() + 2; i++) {
                    parameterSeparator += " ";
                }

                // begin output
                mOut.println("<A NAME=\"" + methodName + "\"><A NAME=\"" + methodName + methodDoc.flatSignature() + "\"> <H3>"
                      + methodName + "</H3></A></A>");
                mOut.print("<PRE>" + returnTypeString + " <B>" + methodName + "</B>(" + Strings
                      .join(parameterSignatures, parameterSeparator) + ")");

                Type[] exceptions = methodDoc.thrownExceptionTypes();
                if (exceptions.length > 0) {
                    String[] exceptionNames = new String[exceptions.length];
                    for (int i = 0; i < exceptions.length; i++) {
                        exceptionNames[i] = getTypeString(exceptions[i]);
                    }
                    mOut.print(parameterSeparator.substring(1, parameterSeparator.length() - 7) + "throws " + Strings
                          .join(exceptionNames, parameterSeparator));
                }
                mOut.println("</PRE>");
                mOut.print("<DL><DD>");
                printInlineTags(methodDoc.inlineTags(), classDoc);

                mOut.println("<P><DD><DL>");

                // param tags
                ParamTag[] paramTags = methodDoc.paramTags();
                if (parameters.length > 0) {
                    mOut.println("<DT><B>Parameters:</B></DT>");
                    for (Parameter parameter : parameters) {
                        ParamTag paramTag = null;
                        for (ParamTag tag : paramTags) {
                            if (tag.parameterName().equals(parameter.name())) {
                                paramTag = tag;
                            }
                        }
                        mOut.println("<DD><CODE>" + parameter.name() + "</CODE> - ");
                        if (paramTag != null) {
                            if (!paramTag.parameterComment().isEmpty()) {
                                printInlineTags(paramTag.inlineTags(), classDoc);
                            } else {
                                System.out.println(
                                      "No description in @param tag for " + parameter.name() + " in " + classDoc.name() + "."
                                            + methodDoc.name());
                            }
                        } else {
                            System.out.println(
                                  "No @param tag for " + parameter.name() + " in " + classDoc.name() + "." + methodDoc.name());
                        }
                        mOut.println("</DD>");
                    }
                }

                // return tag
                Tag[] returnTags = methodDoc.tags("@return");
                if (returnTags.length > 0) {
                    mOut.println("<DT><B>Returns:</B></DT>");
                    mOut.println("<DD>" + returnTags[0].text() + "</DD>");
                }

                // throws tag
                ThrowsTag[] throwsTags = methodDoc.throwsTags();
                if (throwsTags.length > 0) {
                    mOut.println("<DT><B>Throws:</B></DT>");
                    for (ThrowsTag throwsTag : throwsTags) {
                        String exceptionName = throwsTag.exceptionName();
                        // remove "com.qspin.qtaste.testsuite." prefix if any
                        if (exceptionName.startsWith("com.qspin.qtaste.testsuite.")) {
                            exceptionName = exceptionName.substring("com.qspin.qtaste.testsuite.".length());
                        }
                        mOut.println("<DD><CODE>" + exceptionName + "</CODE> - ");
                        printInlineTags(throwsTag.inlineTags(), classDoc);
                        mOut.println("</DD>");
                    }
                }

                mOut.println("</DL></DD></DL>");

                if (m != methodDocs.length - 1) {
                    mOut.println("<HR>");
                }
            }
        }
    }
695177
function(){
		this.decodeCell( function(cell,ca){
			if     (ca==="-"){ cell.qnum = -2;}
			else if(ca!=="."){ cell.qnum = +ca;}
		});
	}
1203108
private Column createColumnFromCell(Sheet sheet, Cell cell) {
    if (cell.getCellTypeEnum() == CellType.STRING) {
      return Column.create(
          cell.getStringCellValue(),
          cell.getColumnIndex(),
          getColumnDataFromSheet(sheet, cell.getColumnIndex()));
    } else {
      throw new MolgenisDataException(
          String.format(
              "Celltype [%s] is not supported for columnheaders", cell.getCellTypeEnum()));
    }
  }
920434
def process_raw_file(self, raw_file_name, field_names):
        
        #num_outouts = 0
        dist_vals = []
        group_dat = []
        events = []
        #facts = []
        
        with open(raw_file_name) as csvfile:
            reader = csv.DictReader(csvfile, fieldnames = field_names)
            for num_lines, row in enumerate(reader):
                #print('row = =',row)
                for col_num, fld in enumerate(field_names):
                    try:
                        #print('self.maps[', col_num, '] = ', self.maps[col_num])
                        if self.maps[col_num].val == 'group_distinct':
                            group_dat.append(str(row[fld]))
                        elif self.maps[col_num].val == 'event_date':
                            events.append(str(row[fld]))

                    except Exception as ex:
                        print('parsing error - shouldnt really be splitting using a comma anyway!', str(ex))
        
        dist_vals = sorted(list(set(group_dat)))
        
        return num_lines, dist_vals, group_dat, sorted(list(set(events)))
58848
def cv(row, col_name, arg, current_data_model, df, con):
    
    vocabulary = con.vocab.vocabularies
    cell_value = str(row[col_name])
    if not cell_value:
        return None
    elif cell_value == "None":
        return None
    cell_values = cell_value.split(":")
    cell_values = [c.strip() for c in cell_values]
    # get possible values for controlled vocabulary
    # exclude weird unicode
    possible_values = []
    for val in vocabulary[col_name]:
        try:
            possible_values.append(str(val).lower())
        except UnicodeEncodeError as ex:
            print(val, ex)
    for value in cell_values:
        if str(value).lower() == "nan":
            continue
        elif str(value).lower() in possible_values:
            continue
        elif value.lower() == "none":
            continue
        else:
            try:
                if str(float(value)) in possible_values:
                    continue
            except:
                pass
            return '"{}" is not in controlled vocabulary for {}'.format(value, arg)
    return None
419607
def method_missing(method_name, *args, &block)
      return @raw_data[method_name.to_s] if @raw_data.key?(method_name.to_s)
      return @raw_data.method(method_name.to_s).call(*args, &block) if @raw_data.respond_to?(method_name.to_s)
      super
    end
581994
private function get_column_info(stdClass $rawcolumn) {
        $rawcolumn = (object)$rawcolumn;
        $info = new stdClass();
        $info->name           = $rawcolumn->column_name;
        $info->type           = $rawcolumn->data_type;
        $info->meta_type      = $this->mysqltype2moodletype($rawcolumn->data_type);
        if ($this->has_breaking_change_quoted_defaults()) {
            $info->default_value = trim($rawcolumn->column_default, "'");
            if ($info->default_value === 'NULL') {
                $info->default_value = null;
            }
        } else {
            $info->default_value = $rawcolumn->column_default;
        }
        $info->has_default    = !is_null($info->default_value);
        $info->not_null       = ($rawcolumn->is_nullable === 'NO');
        $info->primary_key    = ($rawcolumn->column_key === 'PRI');
        $info->binary         = false;
        $info->unsigned       = null;
        $info->auto_increment = false;
        $info->unique         = null;
        $info->scale          = null;

        if ($info->meta_type === 'C') {
            $info->max_length = $rawcolumn->character_maximum_length;

        } else if ($info->meta_type === 'I') {
            if ($info->primary_key) {
                $info->meta_type = 'R';
                $info->unique    = true;
            }
            // Return number of decimals, not bytes here.
            $info->max_length    = $rawcolumn->numeric_precision;
            if (preg_match('/([a-z]*int[a-z]*)\((\d+)\)/i', $rawcolumn->column_type, $matches)) {
                $type = strtoupper($matches[1]);
                if ($type === 'BIGINT') {
                    $maxlength = 18;
                } else if ($type === 'INT' or $type === 'INTEGER') {
                    $maxlength = 9;
                } else if ($type === 'MEDIUMINT') {
                    $maxlength = 6;
                } else if ($type === 'SMALLINT') {
                    $maxlength = 4;
                } else if ($type === 'TINYINT') {
                    $maxlength = 2;
                } else {
                    // This should not happen.
                    $maxlength = 0;
                }
                // It is possible that display precision is different from storage type length,
                // always use the smaller value to make sure our data fits.
                if ($maxlength < $info->max_length) {
                    $info->max_length = $maxlength;
                }
            }
            $info->unsigned      = (stripos($rawcolumn->column_type, 'unsigned') !== false);
            $info->auto_increment= (strpos($rawcolumn->extra, 'auto_increment') !== false);

        } else if ($info->meta_type === 'N') {
            $info->max_length    = $rawcolumn->numeric_precision;
            $info->scale         = $rawcolumn->numeric_scale;
            $info->unsigned      = (stripos($rawcolumn->column_type, 'unsigned') !== false);

        } else if ($info->meta_type === 'X') {
            if ("$rawcolumn->character_maximum_length" === '4294967295') { // watch out for PHP max int limits!
                // means maximum moodle size for text column, in other drivers it may also mean unknown size
                $info->max_length = -1;
            } else {
                $info->max_length = $rawcolumn->character_maximum_length;
            }
            $info->primary_key   = false;

        } else if ($info->meta_type === 'B') {
            $info->max_length    = -1;
            $info->primary_key   = false;
            $info->binary        = true;
        }

        return $info;
    }
1264608
@Transformer
    public static RawData escapeCSV(Object o) {
        if (null == o) return RawData.NULL;
        if (o instanceof RawData) {
            return (RawData) o;
        }
        //return new RawData(StringEscapeUtils.escapeCsv(o.toString()));
        // fix https://github.com/greenlaw110/Rythm/issues/155
        return Escape.CSV.apply_(o.toString());
    }
20261
def bind_inum(column, enum_class, options = {})
      options = { prefix: column }.merge(options)
      options[:prefix] = options[:prefix] ? "#{options[:prefix]}_" : ''

      self.class_eval do
        define_method(column) do
          enum_class.parse(read_attribute(column))
        end

        define_method("#{column}=") do |value|
          enum_class.parse(value).tap do |enum|
            if enum
              write_attribute(column, enum.to_i)
            else
              write_attribute(column, nil)
            end
          end
        end

        enum_class.each do |enum|
          define_method("#{options[:prefix]}#{enum.to_s.underscore}?") do
            enum.eql?(read_attribute(column))
          end
        end
      end
    end
404873
static String retriveCellValue(Cell cell) {
        String cellValue = "";
        if (cell == null) {
            return cellValue;
        }
        try {
            switch (cell.getCellType()) {
                case Cell.CELL_TYPE_NUMERIC:
                    if (CellDateFormat.isDateCell(cell)) {
                        Date date = cell.getDateCellValue();
                        DateFormat dateFormat = CellDateFormat
                                .getFormat(cell.getCellStyle().getDataFormat()).getDateFormat();
                        cellValue = dateFormat.format(date);
                    } else {
                        cellValue = roundValue(cell.getNumericCellValue());
                    }
                    break;
                case Cell.CELL_TYPE_FORMULA:
                    cellValue = roundValue(cell.getSheet().getWorkbook().getCreationHelper()
                            .createFormulaEvaluator().evaluate(cell).formatAsString());
                    break;
                default:
                    cellValue = cell.getStringCellValue();
            }
        } catch (Exception e) {
            LOG.warn(MessageManager.getMessage("cell.fail"), cell.getRowIndex(),
                    cell.getColumnIndex(), e.getMessage());
        }

        return cellValue;
    }