Get an import task.
327996
public RESTImportTask getRESTImportTask(Integer importJobId, Integer taskId) throws
        Exception {
        Response httpResponse = HttpUtil.get(
            this.addEndPoint(importJobId + "/tasks/" + taskId),
            this.username,
            this.password
        );

        return (RESTImportTask) this.asEntity(httpResponse.getBody(), RESTImportTask.class);
    }
1344923
def import_tasks(self, path):
        
        for zz in os.walk(path):
            for module in zz[2]:

                if module.endswith('.py'):

                    import importlib

                    # from tasks.message_popup import *



                    importlib.import_module('tasks.' + module[:-3])

                    print 'imported', module
1336793
def get_source_import(self):
        
        import_header = {"Accept": Consts.mediaTypeImportPreview}
        headers, data = self._requester.requestJsonAndCheck(
            "GET",
            self.url + "/import",
            headers=import_header,
        )
        if not data:
            return None
        else:
            return github.SourceImport.SourceImport(self._requester, headers, data, completed=True)
478303
def getTaskHelp(_Task):
  
  """
  Ret = []

  for k in ['name', 'desc']:
    v = _Task.Config.get(k)

    if v is not None:
      Ret.append('%s: %s' % (k, v))

  Args = _Task.Args

  if Args:
    Ret.append('\nArgs:')

    for argName, Arg in Args.items():
      Ret.append('  %s: %s' % (argName, Arg.get('desc', Arg['type_str'])))

    Ret.append('')

  return '\n'.join(Ret).rstrip()
972911
def OnImport(self, event):
        """"""

        # Get filepath from user

        wildcards = get_filetypes2wildcards(["csv", "txt"]).values()
        wildcard = "|".join(wildcards)

        message = _("Choose file to import.")
        style = wx.OPEN
        filepath, filterindex = \
            self.interfaces.get_filepath_findex_from_user(wildcard, message,
                                                          style)

        if filepath is None:
            return

        # Get generator of import data
        import_data = self.main_window.actions.import_file(filepath,
                                                           filterindex)

        if import_data is None:
            return

        # Paste import data to grid
        grid = self.main_window.grid
        tl_cell = grid.GetGridCursorRow(), grid.GetGridCursorCol()

        grid.actions.paste(tl_cell, import_data)

        self.main_window.grid.ForceRefresh()
1028563
def refactor_froms_to_imports(self, offset):
        """"""
        refactor = ImportOrganizer(self.project)
        changes = refactor.froms_to_imports(self.resource, offset)
        return translate_changes(changes)
823238
def _get_task(name):
	''''''
	matches = [x for x in TASKS if x.match(name)]
	if matches:
		return matches[0]
682757
def import_package(name):
    """"""
    import zipimport
    try:
        mod = __import__(name)
    except ImportError:
        clear_zipimport_cache()
        mod = __import__(name)

    components = name.split('.')
    for comp in components[1:]:
        mod = getattr(mod, comp)
    return mod
461770
def get_task_cls(cls, name):
        
        task_cls = cls._get_reg().get(name)
        if not task_cls:
            raise TaskClassNotFoundException(cls._missing_task_msg(name))

        if task_cls == cls.AMBIGUOUS_CLASS:
            raise TaskClassAmbigiousException('Task %r is ambiguous' % name)
        return task_cls
819642
def _task_to_dict(task):
    """"""
    payload = task.payload
    if payload and task.content_type == 'application/json':
        payload = json.loads(payload)

    return dict(
        task_id=task.task_id,
        queue_name=task.queue_name,
        eta=_datetime_to_epoch_seconds(task.eta),
        source=task.source,
        created=_datetime_to_epoch_seconds(task.created),
        lease_attempts=task.lease_attempts,
        last_lease=_datetime_to_epoch_seconds(task.last_lease),
        payload=payload,
        content_type=task.content_type)
1181853
def import_module(module_name):
    """"""
    import sys, os
    import importlib
    sys.path.append(os.path.dirname(__file__))
    return importlib.import_module(module_name)
239212
def get_objects(self, force=None, last_update=None, flush=False):
        '''
        
        '''
        return self._run_object_import(force=force, last_update=last_update,
                                       flush=flush, full_history=False)
1226559
public RESTData getDataOfImportTask(Integer importJobId, Integer taskId)
        throws Exception {
        final DeserializationFeature unwrapRootValueFeature = DeserializationFeature.UNWRAP_ROOT_VALUE;
        boolean unwrapRootValueFeatureIsEnabled = mapper.isEnabled(unwrapRootValueFeature);

        Response httpResponse = HttpUtil.get(
            this.addEndPoint(importJobId + "/tasks/" + taskId + "/data"),
            this.username,
            this.password
        );

        // we have to disable the feature. otherwise deserialize would not work here
        mapper.disable(unwrapRootValueFeature);

        final RESTData resultEntity = (RESTData) this.asEntity(httpResponse.getBody(), RESTData.class);

        if (unwrapRootValueFeatureIsEnabled) {
            mapper.enable(unwrapRootValueFeature);
        }

        return resultEntity;
    }
620110
def load_tasks(self, cmd, params, args):
        """"""
        return generate_tasks('taskname that shows up in log', self._gen_tasks()), self.DOIT_CONFIG
269703
def load_class_by_path(taskpath):
    

    return getattr(
        importlib.import_module(
            re.sub(
                r"\.[^.]+$",
                "",
                taskpath)),
        re.sub(
            r"^.*\.",
            "",
            taskpath))
1230890
def get_task(self, task_id):
        
        task = self.request_single('GetTask', {'id': task_id})

        if task:
            return zobjects.Task.from_dict(task)
        else:
            return None
1170917
def get_async(self, **ctx_options):
    
    from . import model, tasklets
    ctx = tasklets.get_context()
    cls = model.Model._kind_map.get(self.kind())
    if cls:
      cls._pre_get_hook(self)
    fut = ctx.get(self, **ctx_options)
    if cls:
      post_hook = cls._post_get_hook
      if not cls._is_default_hook(model.Model._default_post_get_hook,
                                  post_hook):
        fut.add_immediate_callback(post_hook, self, fut)
    return fut