Run translation operations
171582
function (pinchDown, touches, transform, selectionMarker, clip, lastValidTouch) {
            if (this.zoomHor || this.pinchHor) {
                this.pinchTranslateDirection(true, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
            }
            if (this.zoomVert || this.pinchVert) {
                this.pinchTranslateDirection(false, pinchDown, touches, transform, selectionMarker, clip, lastValidTouch);
            }
        }
141299
function run(params) {

  var options = extract_options(params || process.argv.slice(2))

  literapi.withDefaultPlugins(options).runWithFiles(options.files, function(err, results) {
    if (err) throw err

    var status = 0
    if (results.broken) status += 1
    if (results.errored) status += 2
    process.exit(status)
  })
}
890515
function translate (content, contentTypes) {
  let output = {}
  content.forEach(each => {
    const base = path.parse(each.file).base
    if (base === 'index.md') {
      const type = each.dir.split('/').pop()
      const contentTypeTranslation = contentTypes.find(contentType => contentType[type])
      if (contentTypeTranslation && contentTypeTranslation[type]) {
        output[type] = contentTypeTranslation[type](content, type)
      }
    }
  })
  return output
}
1252463
def run(self, command):
        
        if isinstance(command, basestring):
            command = command.split()
        else:
            command = list(command)
        self.external.omero_cli(command)
1297620
public function run()
    {
        Model::unguard();

        $config = config('netcore.module-translate.menu');

        $menuItems = [
            'leftAdminMenu' => [
                [
                    'name'            => 'Translate',
                    'icon'            => 'fa fa-globe',
                    'type'            => 'url',
                    'value'           => '#',
                    'module'          => 'Translate',
                    'is_active'       => 1,
                    'active_resolver' => 'admin.translations.*,admin.languages.*',
                    'parameters'      => json_encode([]),
                    'children'        => [
                        [
                            'name'            => 'Translations',
                            'type'            => 'route',
                            'value'           => 'admin.translations.index',
                            'module'          => '',
                            'is_active'       => 1,
                            'active_resolver' => 'admin.translations.*',
                            'parameters'      => json_encode([])
                        ],
                        [
                            'name'            => 'Languages',
                            'type'            => 'route',
                            'value'           => 'admin.languages.index',
                            'module'          => '',
                            'is_active'       => 1,
                            'active_resolver' => 'admin.languages.*',
                            'parameters'      => json_encode([])
                        ],
                    ]
                ],
            ]
        ];

        foreach ($menuItems as $key => $items) {
            $menu = Menu::firstOrCreate([
                'key' => $key
            ]);

            $translations = [];
            foreach (TransHelper::getAllLanguages() as $language) {
                $translations[$language->iso_code] = [
                    'name' => ucwords(preg_replace(array('/(?<=[^A-Z])([A-Z])/', '/(?<=[^0-9])([0-9])/'), ' $0', $key))
                ];
            }
            $menu->updateTranslations($translations);

            foreach ($items as $item) {
                $row = $menu->items()->firstOrCreate(array_except($item, ['name', 'value', 'parameters', 'children']));

                $translations = [];
                foreach (TransHelper::getAllLanguages() as $language) {
                    $translations[$language->iso_code] = [
                        'name'       => $item['name'],
                        'value'      => $item['value'],
                        'parameters' => $item['parameters']
                    ];
                }
                $row->updateTranslations($translations);

                foreach ($item['children'] as $child) {
                    $child['menu_id'] = $menu->id;

                    if ((!$config['translations'] && $child['name'] == 'Translations') || (!$config['languages'] && $child['name'] == 'Languages')) {
                        continue;
                    }

                    $c = $row->children()->firstOrCreate(array_except($child, ['name', 'value', 'parameters']));
                    $translations = [];
                    foreach (TransHelper::getAllLanguages() as $language) {
                        $translations[$language->iso_code] = [
                            'name'       => $child['name'],
                            'value'      => $child['value'],
                            'parameters' => $child['parameters']
                        ];
                    }
                    $c->updateTranslations($translations);
                }
            }
        }
    }
314641
def run(self):
        '''
        
        '''

        # Parse the stdin into a global event object
        stdin = self.read_stdin()
        self.event = self.read_event(stdin)

        # Prepare global settings
        self.settings = get_settings()
        self.api_settings = self.get_api_settings()

        # Prepare command line arguments and
        self.parser = argparse.ArgumentParser()

        # set up the 2.x to 1.x event mapping argument
        self.parser.add_argument("--map-v2-event-into-v1",
                                 action="store_true",
                                 default=False,
                                 dest="v2event")

        if hasattr(self, 'setup'):
            self.setup()
        (self.options, self.remain) = self.parser.parse_known_args()

        # map the event if required
        if (self.options.v2event or
                os.environ.get("SENSU_MAP_V2_EVENT_INTO_V1")):
            self.event = map_v2_event_into_v1(self.event)

        # Filter (deprecated) and handle
        self.filter()
        self.handle()
1022876
def run_tesseract(input_filename, output_filename_base, lang=None, boxes=False):
    '''
    

    '''

    command = [tesseract_cmd, input_filename, output_filename_base]

    if lang is not None:
        command += ['-l', lang]

    if boxes:
        command += ['batch.nochop', 'makebox']

    proc = subprocess.Popen(command,
                            stderr=subprocess.PIPE)
    return (proc.wait(), proc.stderr.read())
1297388
def translate(self):
        """"""

        value = super().translate()
        if value is None or (isinstance(value, str) and value.strip() == ''):
            return None

        return int(value)
937171
def run(state, command, args):
    """"""
    from ..core import do_run
    do_run(
        command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror
    )
109377
def lrun(command, *args, **kwargs):
    ''''''
    return run('cd {0} && {1}'.format(ROOT, command), *args, **kwargs)
905882
def _run(method, cmd, cwd=None, shell=True, universal_newlines=True,
             stderr=STDOUT):
        """"""
        if not cmd:
            error_msg = 'Passed empty text or list'
            raise AttributeError(error_msg)
        if isinstance(cmd, six.string_types):
            cmd = str(cmd)
        if shell:
            if isinstance(cmd, list):
                cmd = ' '.join(cmd)
        else:
            if isinstance(cmd, str):
                cmd = cmd.strip().split()
        out = method(cmd, shell=shell, cwd=cwd, stderr=stderr,
                     universal_newlines=universal_newlines)
        if isinstance(out, bytes):
            out = out.decode('utf-8')
        return str(out).strip()
328553
def run(self, args):  # pylint: disable=unused-argument
        
        logging.basicConfig(stream=sys.stdout, level=logging.INFO)

        # This is used as a tool only to segment translation files when adding a
        # new segment.  In the regular workflow, the work is done by the extract
        # phase calling the functions above.
        locales = args.locale or []
        for locale in locales:
            segment_pofiles(self.configuration, locale)
261159
function runTransforms(transforms, upgradeFile, ref, data, locals) {
  log('debug', `Running ${transforms.length} transforms`);
  return bluebird.reduce(transforms, function (acc, val) {
    var key = val.toString();

    // Parsefloat strips decimals with `.0` leaving just the int,
    // let's add them back in
    if (!_.includes(key, '.')) {
      key += '.0';
    }

    return bluebird.try(upgradeFile[key].bind(null, ref, acc, locals))
      .catch(e => {
        log('error', `Error upgrading ${ref} to version ${key}: ${e.message}`, {
          errStack: e.stack,
          cmptData: JSON.stringify(acc)
        });
        return bluebird.reject(e);
      });
  }, data)
    .then(function (resp) {
      // Assign the version number automatically
      resp._version = transforms[transforms.length - 1];
      return resp;
    });
}
541187
def translations(context: Context, pull=False, push=False):
    
    if not (pull or push):
        raise TaskError('Specify whether to push or pull translations')
    if pull:
        context.shell('tx', 'pull')
        make_messages(context, javascript=False)
        make_messages(context, javascript=True)
    if push:
        context.shell('tx', 'push', '--source', '--no-interactive')
754770
def run_steps(spec, language="en"):
    

    # The way this works is a little exotic, but I couldn't think of a better way to work around
    # the fact that this has to be a global function and therefore cannot know about which step
    # runner to use (other than making step runner global)
    
    # Find the step runner that is currently running and use it to run the given steps
    fr = inspect.currentframe()
    while fr:
        if "self" in fr.f_locals:
            f_self = fr.f_locals['self']
            if isinstance(f_self, StepsRunner):
                return f_self.run_steps_from_string(spec, language)
        fr = fr.f_back
1005097
def _translate(self, input_filename, output_filename):
        """"""
        command = [
            self.translate_binary,
            '-f', 'GeoJSON',
            output_filename,
            input_filename
        ]

        result = self._runcommand(command)
        self.log('Result (Translate): ', result, lvl=debug)
643002
function translate(key, options, hasOwnOptions) {

			var lng = options.lng || 'auto';

			if (!translations[lng]) {
				translations[lng] = {};
			}

			if (!t) {
				translations[lng][key] = key;
			} else if (!translations[lng][key] || hasOwnOptions) {
				translations[lng][key] = t(key, options);
			}

		}