generate motigoma
490379
def make_hand(str)
      # Kifu for iPhoneは半角スペース区切り
      ret = { "FU" => 0, "KY" => 0, "KE" => 0, "GI" => 0, "KI" => 0, "KA" => 0, "HI" => 0 }
      return ret if str.empty?

      str.split(/[ 　]/).each do |kind|
        next if kind.empty?
        ret[kind2csa(kind[0])] = kind.length == 1 ? 1 : kan2n2(kind[1..-1])
      end

      ret
    end
1200265
def cut!
      create_backup_copy
      MiniMagick::Tool::Mogrify.new do |mogrify|
        mogrify.resize(max_size)
        mogrify.strip
        if jpeg?
          mogrify.colorspace(Kirigami.config.jpeg_colorspace)
          mogrify.sampling_factor(Kirigami.config.jpeg_sampling_factor)
          mogrify.interlace(Kirigami.config.jpeg_interlacing)
          mogrify.quality(Kirigami.config.jpeg_compression_quality)
        end
        mogrify << target_filepath
      end
    end
1186764
function _generateManifest(siteChecksums, presignedPosts) {
  return Utils.reduce(siteChecksums, (memo, checksum, path) => {
    /* eslint-disable-next-line no-param-reassign */
    memo[path] = presignedPosts[path].digest;
    return memo;
  }, {});
}
1185630
public static function msgfmt($po, $mo = null)
    {
        $stringset = Po::fromFile($po);
        if ($mo === null) {
            $mo = substr($po, 0, -3) . '.mo';
        }
        Mo::toFile($stringset, $mo);
    }
74834
def generate(size, output, schema):
    """"""
    pii_data = randomnames.NameList(size)

    if schema is not None:
        raise NotImplementedError

    randomnames.save_csv(
        pii_data.names,
        [f.identifier for f in pii_data.SCHEMA.fields],
        output)
983501
function bootModel(trinte, schema, file) {
    if (/\.js$/i.test(file)) {
        var name = file.replace(/\.js$/i, '');
        var modelDir = path.resolve(__dirname, '../app/models');
        trinte.models[name] = require(modelDir + '/' + name)(schema);// Include the mongoose file
        global[name] = trinte.models[name];
    }
}
235115
def GenerarPDF(self, archivo="", dest="F"):
        ""
        try:
            self.template.render(archivo, dest=dest)
            return True
        except Exception, e:
            self.Excepcion = str(e)
            return False
1197040
function generateDirective(originalName) {
    var template = args.t || args.template || "html";
    var name = originalName.split("/").pop();
    var obj = {
        name: name,
        original_name: originalName,
        template_extension: template,
    };
    var gen = {
        json: templates.generator.config(),
        js: templates.generator.js(),
        scss: templates.generator.scss(),
    };

    gen[template] = templates.generator[template]();

    return Object.keys(gen).reduce(function (files, ext) {
        files[originalName + "/" + name + "." + ext] = replaceText(gen[ext], obj);
        return files;
    }, {});
}
825612
function generateModelOpenApiSchema(schema, definitionName) {
    var oaSchema = {
      required: [],
      properties: {}
    };
    mergePaths(oaSchema, schema.paths, definitionName);
    mergePaths(oaSchema, schema.virtuals, definitionName);

    //remove empty arrays -> OpenAPI 3.0 validates 
    if (oaSchema.required.length === 0) {
      delete(oaSchema.required);
    }
    if (oaSchema.properties.length === 0) {
      delete(oaSchema.properties);
    }
    return oaSchema;
  }
622375
function makeMongoCollectionName(modelName) {
    if (modelName !== modelName.toLowerCase()) {
        throw new Error('expect lowercase, was ' + modelName);
    }
    if (modelName.charAt(modelName.length - 1) !== 's') {
        return modelName + 's';
    }
    return modelName;
}
989123
function generateModelDefinition () {
    var definition = {};
    var schema = controller.model().schema;

    definition.id = capitalize(controller.model().singular());
    definition.properties = {};

    Object.keys(schema.paths).forEach(function (name) {
      var path = schema.paths[name];
      var property = generatePropertyDefinition(name, path);
      definition.properties[name] = property;
    });

    Object.keys(schema.virtuals).forEach(function (name) {
      var path = schema.virtuals[name];
      var property = generatePropertyDefinition(name, path);
      definition.properties[name] = property;
    });

    return definition;
  }
279866
function generateTableSchema( $table, $tableDef, $params )
    {
        return $this->OtherSchema->generateTableSchema( $table, $tableDef, $params );
    }
1168211
function generateTableSchema( $tableName, $table, $params )
    {
        return $this->generateTableSQL( $tableName, $table, $params, false, false );
    }
790685
function generateFakeDataForSchema(schemaName) {
  return new RSVP.Promise(function (resolve, reject) {
    agolSchemas.getSchema(schemaName).then(function (schema) {
      // Generate fake data
      var fakeData = jsf(schema);
      // return fake data
      resolve(fakeData);
    });
  });
}
488448
def _gen_mods(self, action, records, existing_rrsets):
        '''
        
        '''
        return [r.mod(action, existing_rrsets) for r in records]
1036771
function getMagic() {

	var mmmagic;

	if (magic || magic === false) {
		return magic;
	}

	// Get mmmagic module
	mmmagic = alchemy.use('mmmagic')

	if (mmmagic) {
		magic = new mmmagic.Magic(mmmagic.MAGIC_MIME_TYPE);
	} else {
		log.error('Could not load mmmagic module');
		magic = false;
	}

	return magic;
}
883531
def generate(self, step, params):
        """"""
        # Recurse into a DictFactory: allows users to have some params depending
        # on others.
        params = step.recurse(base.DictFactory, params, force_sequence=step.sequence)
        filename, content = self._make_content(params)
        return django_files.File(content.file, filename)