pull data into this OR.SHEET from a real book/sheet in Origin
180451
def pull(self,bookName=None,sheetName=None):
        """"""

        # tons of validation
        if bookName is None and self.bookName: bookName=self.bookName
        if sheetName is None and self.sheetName: sheetName=self.sheetName
        if bookName is None: bookName=OR.activeBook()
        if bookName and sheetName is None: sheetName=OR.activeSheet()
        if not bookName or not sheetName:
            print("can't figure out where to pull from! [%s]%s"%(bookName,sheetName))
            return

        # finally doing the thing
        poSheet=OR.getSheet(bookName,sheetName)
        self.bookName=bookName
        self.sheetName=sheetName
        self.desc=poSheet.GetLongName()
        self.colNames=[poCol.GetName() for poCol in poSheet.Columns()]
        self.colDesc=[poCol.GetLongName() for poCol in poSheet.Columns()]
        self.colUnits=[poCol.GetUnits() for poCol in poSheet.Columns()]
        self.colComments=[poCol.GetComments() for poCol in poSheet.Columns()]
        self.colTypes=[poCol.GetType() for poCol in poSheet.Columns()]
        self.colData=[poCol.GetData() for poCol in poSheet.Columns()]
228452
def << sheet=Workbook::Sheet.new
      sheet = Workbook::Sheet.new(sheet) unless sheet.is_a? Workbook::Sheet
      super(sheet)
      sheet.book=(self)
    end
25155
def main():
    
    # Helper function.
    def _draw_and_save(title, subtitle, author, filename):
        """
        Draw a cover and write it to a file. Note that only PNG is supported.
        """
        cover_image = draw(title, subtitle, author)
        if filename == "-":
            assert not "Implement."
        else:
            _, ext = os.path.splitext(os.path.basename(filename))
            if ext.upper() == ".PNG":
                try:
                    with open(filename, "wb") as f:
                        cover_image.save(f)
                except FileNotFoundError:
                    print("Error opening target file " + filename)
                    return 1
            else:
                print("Unsupported image file format '" + ext + "', use PNG")
                return 1
        return 0

    # Set up and parse the command line arguments passed to the program.
    usage = "Python implementation of the 10PRINT Cover image generator."
    parser = argparse.ArgumentParser(usage=usage)

    parser.add_argument("-t", "--title", dest="title", help="Book title")
    parser.add_argument("-s", "--subtitle", dest="subtitle", help="Book subtitle", default="")
    parser.add_argument("-a", "--author", dest="author", help="Author(s) of the book")
    parser.add_argument("-o", "--cover", dest="outfile", help="Filename of the cover image in PNG format")
    parser.add_argument("-j", "--json-covers", dest="json_covers", help="JSON file containing cover information")
    args = parser.parse_args()

    # A JSON file is given as command line parameter; ignore the other ones.
    # Read the file line by line and use the given information to generate the
    # book covers. The file contains lines of JSON maps of the format
    #
    #   {"authors": "..", "identifier": "..", "subtitle": null, "title": "..",
    #    "identifier_type": "Gutenberg ID", "filename": ".."}
    if args.json_covers:
        try:
            with open(args.json_covers, "r") as f:
                for line in f:
                    data = json.loads(line)
                    print("Generating cover for " + data["identifier"])
                    status = _draw_and_save(
                        data["title"],
                        data["subtitle"],
                        data["authors"],
                        data["filename"]
                    )
                    if status:
                        print("Error generating book cover image, skipping")
            return 0
        except ValueError:
            print("Error reading from JSON file, exiting")
        except FileNotFoundError:
            print("JSON cover file does not exist: " + args.json_covers)

    # Generate only a single cover based on the given command line arguments.
    else:
        if not args.title or not args.author:
            print("Missing --title or --author argument, exiting")
        elif not args.outfile:
            print("No outfile specified, exiting")
        else:
            return _draw_and_save(args.title, args.subtitle, args.author, args.outfile)
    return 1
50335
def from_file(cls, fn, *args, **kwargs):
        
        return AmiraHeader(get_parsed_data(fn, *args, **kwargs))
893823
function sheetifySass (filename, source, options, done) {
  const sassOpts = extend({
    data: source,
    file: filename,
    indentedSyntax: /\.sass$/i.test(filename)
  }, options)

  sass.render(sassOpts, function (err, res) {
    if (err) return done(err)
    done(null, {
      css: String(res.css),
      files: res.stats.includedFiles
    })
  })
}
1221626
def get_context_from_xlsx(self):
        
        if re.search('^(http|https)://', self.project.CONTEXT_SOURCE_FILE):
            resp = requests.get(self.project.CONTEXT_SOURCE_FILE)
            content = resp.content
        else:
            try:
                with open(self.project.CONTEXT_SOURCE_FILE) as xlsxfile:
                    content = xlsxfile.read()
            except IOError:
                filepath = "%s/%s" % (
                    os.path.abspath(self.path),
                    self.project.CONTEXT_SOURCE_FILE)
                with open(filepath) as xlsxfile:
                    content = xlsxfile.read()

        data = process_xlsx(content)
        if 'values' in data:
            data = copy_global_values(data)

        return data
1326478
def _load(self, filename=None):
        """"""
        if not filename:
            filename = self.aatsr_path

        wb_ = open_workbook(filename)

        for sheet in wb_.sheets():
            ch_name = sheet.name.strip()
            if ch_name == 'aatsr_' + self.bandname:

                data = np.array([s.split() for s in
                                 sheet.col_values(0,
                                                  start_rowx=3, end_rowx=258)])
                data = data.astype('f')
                wvl = data[:, 0]
                resp = data[:, 1]

                self.rsr = {'wavelength': wvl, 'response': resp}
141951
def extract_books
      booklist = []
      if @doc.count != 0
        @doc.each do |book_data|
          book = {}
          book['title'] = book_data['titleMain']
          book['book_url'] = BOOK_URL + book_data['prodId']
          book['crt_time'] = book_data['crtTime'].split(' ')[0]
          booklist << book
        end
      end
      booklist
    end
127132
def sheet_collection(sheetarr, options)
      if options[:include].nil?; options[:include]=[]; end
      if options[:include].to_a.size>0
        sheetarr.keep_if{|item| options[:include].to_a.detect{|d| d==item}}
      end
      sheetarr=sheetarr-options[:exclude].to_a
      @sheets.keep_if{|item| sheetarr.detect{|d| d==item[:name]}}
      @sheets.uniq!
    end
306699
function sheetInfoResponse(rawData) {
    var feed = rawData.feed;

    return {
        title: g(feed.title),
        updated: g(feed.updated),
        workSheets: feed.entry.map(worksheetData),
        authors: feed.author.map(item => ({ name: g(item.name), email: g(item.email) }))
    };
}
1302849
def open(options={})
      f=IO.read(@destination + '/xl/workbook.xml')
      a=Ox::load(f)

      sheetdata(a, options); commentsrel; shstrings;

      @styles = Styles.new()
      File.open(@destination + '/xl/styles.xml', 'r') do |f|
        Ox.sax_parse(@styles, f)
      end

      @styles.temparray.sort_by!{|st| st[:numFmtId].to_i}
      add_custom_formats @styles.temparray
      @styles.styleary.map!{|s| Numformats::Formatarray[s.to_i][:id].to_i}
    end
1159262
def get_data(self, path):
        """"""
        return LineCacheNotebookDecoder(
            code=self.code, raw=self.raw, markdown=self.markdown
        ).decode(self.decode(), self.path)
1225610
function() {
		var doc = getDocument();

		// create the sheet to be re-used until limit is reached
		if (!CSSModule.cssCount) {
			CSSModule.currentStyleSheet = doc.createStyleSheet();
		}

		CSSModule.cssCount += 1;
		CSSModule.currentStyleSheet.cssText += this.source;

		// reset the count to force the creation of a new stylesheet
		if (CSSModule.cssCount === CSSModule.ie9MaxStyleSheets) {
			CSSModule.cssCount = 0;
		}
	}
443502
def from_data(data):
    
    if len(data) == 0:  # pragma: no cover
        return None
    else:
        ptable = PrettyTable()
        ptable.field_names = data[0].keys()
        for row in data:
            ptable.add_row(row)
        return ptable
906397
def getcols(sheetMatch=None,colMatch="Decay"):
    """"""
    book=BOOK()
    if sheetMatch is None:
        matchingSheets=book.sheetNames
        print('all %d sheets selected '%(len(matchingSheets)))
    else:
        matchingSheets=[x for x in book.sheetNames if sheetMatch in x]
        print('%d of %d sheets selected matching "%s"'%(len(matchingSheets),len(book.sheetNames),sheetMatch))
    matchingSheetsWithCol=[]
    for sheetName in matchingSheets:
        i = book.sheetNames.index(sheetName) # index of that sheet
        for j,colName in enumerate(book.sheets[i].colDesc):
            if colMatch in colName:
                matchingSheetsWithCol.append((sheetName,j))
                break
        else:
            print("  no match in [%s]%s"%(book.bookName,sheetName))
    print("%d of %d of those have your column"%(len(matchingSheetsWithCol),len(matchingSheets)))
    for item in matchingSheetsWithCol:
        print(item,item[0],item[1])
470788
def select(cls, symbol, start_date, end_date):
        """"""
        instance = cls(symbol, start_date, end_date)

        return instance.data
876524
def load_data(self, filename, *args, **kwargs):
        
        # load parameterized data
        data = super(ParameterizedXLS, self).load_data(filename)
        # add parameter to data
        parameter_name = self.parameterization['parameter']['name']
        parameter_values = self.parameterization['parameter']['values']
        parameter_units = str(self.parameterization['parameter']['units'])
        data[parameter_name] = parameter_values * UREG(parameter_units)
        # number of sheets
        num_sheets = len(self.parameterization['parameter']['sheets'])
        # parse and concatenate parameterized data
        for key in self.parameterization['data']:
            units = str(self.parameterization['data'][key].get('units')) or ''
            datalist = []
            for n in xrange(num_sheets):
                k = key + '_' + str(n)
                datalist.append(data[k].reshape((1, -1)))
                data.pop(k)  # remove unused data keys
            data[key] = np.concatenate(datalist, axis=0) * UREG(units)
        return data