Create a dict with all kwargs of the `copy_file` or `link_file` method of the super class and add it to
        the queue for later processing.
331983
def file_handler(self, handler_type, path, prefixed_path, source_storage):
        
        if self.faster:
            if prefixed_path not in self.found_files:
                self.found_files[prefixed_path] = (source_storage, path)

            self.task_queue.put({
                'handler_type': handler_type,
                'path': path,
                'prefixed_path': prefixed_path,
                'source_storage': source_storage
            })
            self.counter += 1
        else:
            if handler_type == 'link':
                super(Command, self).link_file(path, prefixed_path, source_storage)
            else:
                super(Command, self).copy_file(path, prefixed_path, source_storage)
774718
def add_object_file(self, obj_file):
        
        if isinstance(obj_file, str):
            obj_file = object_file.ObjectFileRef.from_path(obj_file)

        ffi.lib.LLVMPY_MCJITAddObjectFile(self, obj_file)
52839
def _copy_params(self):
        
        cls = type(self)
        src_name_attrs = [(x, getattr(cls, x)) for x in dir(cls)]
        src_params = list(filter(lambda nameAttr: isinstance(nameAttr[1], Param), src_name_attrs))
        for name, param in src_params:
            setattr(self, name, param._copy_new_parent(self))
1088228
def build(self, filenames, cl_args=None, link_args=None,
              x64=False, out_dir=''):
        
        if not cl_args:
            cl_args = []
        if not link_args:
            link_args = []
        msvc, lib = self.vc.get_bin_and_lib(x64)
        lib = self.make_lib(lib)
        if out_dir:
            cl_args.append('/Fo:' + out_dir + '\\')
        include = self.make_inc(self.vc.inc + self.sdk.inc)
        cl_args.extend(include + filenames)
        try:
            msvc.run_cl('/c', *cl_args)
        except CalledProcessError as error:
            logging.error(_('failed to compile: %s'), filenames)
            logging.error(_('cl.exe returned:\n%s'), error.output)
            return False
        link_args.extend(lib + self.make_objs(filenames, out_dir))
        try:
            msvc.run_link(*link_args)
        except CalledProcessError as error:
            logging.error(_('failed to link: %s'), filenames)
            logging.error(_('link.exe returned:\n%s'), error.output)
            return False
        return True
1024158
def copy_file(self, src_path, file_name, key=None):
        
        path = os.path.join(self._directories[key], file_name)
        shutil.copyfile(src_path, path)
913897
def get_form_kwargs(self):
        
        kwargs = {
            'initial':  self.get_initial(),
            'prefix':   self.get_prefix(),
        }

        #noinspection PyUnresolvedReferences
        if self.request.method in ('POST', 'PUT'):
            #noinspection PyUnresolvedReferences
            kwargs.update({
                'data':     self.request.POST,
                'files':    self.request.FILES,
            })

        if hasattr(self, 'object'):
            kwargs.update({'instance': self.object})

        return kwargs
954796
def load_files(filenames,multiproc=False,**kwargs):
    
    filenames = np.atleast_1d(filenames)
    logger.debug("Loading %s files..."%len(filenames))

    kwargs = [dict(filename=f,**kwargs) for f in filenames]

    if multiproc:
        from multiprocessing import Pool
        processes = multiproc if multiproc > 0 else None
        p = Pool(processes,maxtasksperchild=1)
        out = p.map(load_file,kwargs)
    else:
        out = [load_file(kw) for kw in kwargs]

    dtype = out[0].dtype
    for i,d in enumerate(out):
        if d.dtype != dtype: 
            # ADW: Not really safe...
            logger.warn("Casting input data to same type.")
            out[i] = d.astype(dtype,copy=False)

    logger.debug('Concatenating arrays...')
    return np.concatenate(out)
1343827
def serialize(self, as_dict=False, sort=None):
        
        files = getattr(self, 'files', self.run())

        if as_dict:
            return dict((fn, p.to_dict()) for fn, p in files.items())

        # generate a list
        data = (p.to_dict() for p in files.values())

        if callable(sort):
            return sorted(data, key=sort)

        elif sort is True:
            return sorted(data)

        return list(data)
1176376
def make_copy(self, copy_to):
        

        for attr, value in self.__dict__.items():
            if attr.startswith('__') and attr.endswith('__'):
                continue
            setattr(copy_to, attr, value)
1065294
def _perform_chunking(func_, *args, **kwargs):
    
    obj_dict = args[0]
    start_point = 0
    file_count = 0
    new_dict = {}
    resp_dict = Counter({})
    file_list = []
    while start_point < len(obj_dict[CONTENT_FIELD]):
        file_count += 1
        chunk_fn = CHUNK_POSTFIX.format(obj_dict[PRIMARY_FIELD],
                                        str(file_count).zfill(CHUNK_ZPAD))
        new_dict[PRIMARY_FIELD] = chunk_fn
        file_list.append(new_dict[PRIMARY_FIELD])
        new_dict[CONTENTTYPE_FIELD] = obj_dict[CONTENTTYPE_FIELD]
        new_dict[TIMESTAMP_FIELD] = obj_dict[TIMESTAMP_FIELD]
        end_point = file_count * MAX_PUT
        sliced = obj_dict[CONTENT_FIELD][start_point: end_point]
        new_dict[CONTENT_FIELD] = sliced
        new_dict[PART_FIELD] = True
        new_dict[PARENT_FIELD] = obj_dict[PRIMARY_FIELD]
        start_point = end_point
        new_args = (new_dict, args[1])
        resp_dict += Counter(func_(*new_args, **kwargs))

    obj_dict[CONTENT_FIELD] = b""
    obj_dict[PARTS_FIELD] = file_list
    obj_dict[PART_FIELD] = False
    new_args = (obj_dict, args[1])
    resp_dict += Counter(func_(*new_args, **kwargs))
    return resp_dict
1296624
def copy_from_scratch(file_mapping, dry_run=True):
        
        for key, value in file_mapping.items():
            if dry_run:
                print ("copy %s %s" % (value, key))
            else:
                try:
                    outdir = os.path.dirname(key)
                    os.makedirs(outdir)
                except OSError:
                    pass
                print ("copy %s %s" % (value, key))
                copyfile(value, key)
        return file_mapping
476739
def copy(self, **kwargs):
        """"""
        msg = Message(self.encode(), self.gateway)
        for key, val in kwargs.items():
            setattr(msg, key, val)
        return msg
325682
def concretize(self, **kwargs):
        
        return (self._read_file.concretize(**kwargs), self._write_file.concretize(**kwargs))
518948
def clone(self, klass=None, memo=None, **kwargs):
        
        obj = Empty()
        obj.__class__ = klass or self.__class__

        obj.resource = self.resource

        obj.filters = self.filters.copy()
        obj.order_by = self.order_by

        obj.low_mark = self.low_mark
        obj.high_mark = self.high_mark

        obj.__dict__.update(kwargs)

        return obj
1047401
def get_form_kwargs(self):
        
        kwargs = {'initial': self.get_initial(),
                  'instance': self.object}

        if self.request.method in ('POST', 'PUT') and self.can_submit:
            kwargs.update({
                'data': self.request.POST,
                'files': self.request.FILES
            })
        return kwargs
739423
def copy_contents(self, fileinstance, progress_callback=None,
                      chunk_size=None, **kwargs):
        """"""
        if not fileinstance.readable:
            raise ValueError('Source file instance is not readable.')
        if not self.size == 0:
            raise ValueError('File instance has data.')

        self.set_uri(
            *self.storage(**kwargs).copy(
                fileinstance.storage(**kwargs),
                chunk_size=chunk_size,
                progress_callback=progress_callback))
277055
def apply_all_link_refs(
    bytecode: bytes, link_refs: List[Dict[str, Any]], attr_dict: Dict[str, str]
) -> bytes:
    
    if link_refs is None:
        return bytecode
    link_fns = (
        apply_link_ref(offset, ref["length"], attr_dict[ref["name"]])
        for ref in link_refs
        for offset in ref["offsets"]
    )
    linked_bytecode = pipe(bytecode, *link_fns)
    return linked_bytecode