copy dicts pattern designed
973338
function(src,dest, isfile){
                //console.log('test');
                
                if (isfile){
                    grunt.file.copy(src,dest+'/'+src,{});
                    console.log('File has been created as '+dest+'/'+src);
                    return;
                }
                
                grunt.file.recurse(src, function(abspath, rootdir, subdir, filename){
                    var _ref3=(typeof subdir=='undefined'?'':(subdir+'/'));
                    grunt.file.copy(abspath,dest+'/'+src+'/'+_ref3+filename, {});
                    console.log('File has been created as '+dest+'/'+src+'/'+filename);
                });
                
            }
972555
def _merge_two_dicts(x, y):
    
    z = x.copy()
    z.update(y)
    return z
400782
function copyPattern (pattern) {
  return Object.assign(
    function (context) {
      return function (prevConfig) {
        context.copyPlugin = context.copyPlugin || {patterns: []}

        // Merge the provided advanced pattern into the config
        context.copyPlugin = _extends({}, context.copyPlugin, {
          patterns: [].concat(context.copyPlugin.patterns, [pattern]),
        })

        // Don't alter the config yet
        return prevConfig
      }
    },
    {post: postConfig}
  )
}
232962
def copy_config(config, mutable_config_keys=MUTABLE_CONFIG_KEYS):
    

    cloned_config = copy(config)
    # Apply ``copy`` function to mutable config values
    for key in mutable_config_keys:
        cloned_config[key] = copy(config[key])
    return cloned_config
411772
def pickle_dict(items):
    '''
    '''
    ret = {}
    pickled_keys = []
    for key, val in items.items():
        if isinstance(val, basestring):
            ret[key] = val
        else:
            pickled_keys.append(key)
            ret[key] = pickle.dumps(val)
    if pickled_keys:
        ret['_pickled'] = ','.join(pickled_keys)
    return ret
98749
def copy(self):
        
        dup = type(self)()
        dup._indices = OrderedDict(
            (k, list(v)) for k,v in six.iteritems(self._indices)
        )
        dup._lines = self._lines.copy()
        return dup
336858
def pick(dct, *keys):
    
    copy = dict()
    for key in keys:
        if key in dct.keys():
            copy[key] = dct[key]
    return copy
630989
def make_dict_hash(o):
    
    if isinstance(o, (set, tuple, list)):
        return tuple([make_dict_hash(e) for e in o])
    elif not isinstance(o, dict):
        return hash(o)

    new_o = copy.deepcopy(o)
    for k, v in new_o.items():
        new_o[k] = make_dict_hash(v)

    return hash(tuple(frozenset(sorted(new_o.items()))))
814793
def merge_dicts(base, updates):
    
    if not base:
        base = dict()
    if not updates:
        updates = dict()
    z = base.copy()
    z.update(updates)
    return z
109746
def _to_dict(self, serialize=False):
        
        copy_dict = self.__dict__.copy()
        for key, value in vars(self).items():
            # We want to send all ids to Zendesk always
            if serialize and key == 'id':
                continue

            # If this is a Zenpy object, convert it to a dict.
            if not serialize and isinstance(value, BaseObject):
                copy_dict[key] = copy_dict.pop(key).to_dict()

            # This object has a flag indicating it has been dirtied, so we want to send it off.
            elif serialize and getattr(value, '_dirty', False):
                continue

            # Here we have an attribute that should always be sent to Zendesk.
            elif serialize and key in self._always_dirty:
                continue

            # These are for internal tracking, so just delete.
            elif key in ('api', '_dirty_attributes', '_always_dirty', '_dirty_callback', '_dirty'):
                del copy_dict[key]

            # If the attribute has not been modified, do not send it.
            elif serialize and key not in self._dirty_attributes:
                del copy_dict[key]

            # Some reserved words are prefixed with an underscore, remove it here.
            elif key.startswith('_'):
                copy_dict[key[1:]] = copy_dict[key]
                del copy_dict[key]
        return copy_dict
1098336
def dump_dict(cfg, f, indent=0):
    ''''''

    for key in cfg:
        if not isstr(key):
            raise ConfigSerializeError("Dict keys must be strings: %r" %
                                       (key,))
        dump_value(key, cfg[key], f, indent)
        f.write(u';\n')
1095979
function copyObject(source) {
  var target = {};
  for (var key in source)
    target[key] = source[key];
  return target;
}
1366429
def _unique(list_of_dicts):
    '''
    
    '''
    unique_list = []
    for ele in list_of_dicts:
        if ele not in unique_list:
            unique_list.append(ele)
    return unique_list
959585
def merge_dictionaries(current, new, only_defaults=False, template_special_case=False):
    '''
    

    '''
    changes = 0
    for key, value in new.items():
        if key not in current:
            if hasattr(global_settings, key):
                current[key] = getattr(global_settings, key)
                LOGGER.debug("Set %r to global default %r.", key, current[key])
            else:
                current[key] = copy.copy(value)
                LOGGER.debug("Set %r to %r.", key, current[key])
                changes += 1
                continue
        elif only_defaults:
            continue
        current_value = current[key]
        if hasattr(current_value, 'items'):
            changes += merge_dictionaries(current_value, value)
        elif isinstance(current_value, (list, tuple)):
            for element in value:
                if element not in current_value:
                    if template_special_case and key == 'TEMPLATES':
                        existing_matches = [
                            template for template in current_value if template['BACKEND'] == element['BACKEND']
                        ]
                        if existing_matches:
                            changes += merge_dictionaries(existing_matches[0], element)
                        else:
                            current[key] = list(current_value) + [element]
                            LOGGER.debug("Added %r to %r.", element, key)
                            changes += 1
                    else:
                        current[key] = list(current_value) + [element]
                        LOGGER.debug("Added %r to %r.", element, key)
                        changes += 1
        elif isinstance(current_value, Promise) or isinstance(value, Promise):
            # If we don't know what to do with it, replace it.
            if current_value is not value:
                current[key] = value
                LOGGER.debug("Set %r to %r.", key, current[key])
                changes += 1
        else:
            # If we don't know what to do with it, replace it.
            if current_value != value:
                current[key] = value
                LOGGER.debug("Set %r to %r.", key, current[key])
                changes += 1
    return changes
903244
def copy(self):
        """"""
        content = [(k, v) for k, v in self.items()]

        intidx = [(k, v) for k, v in content if isinstance(k, int)]
        args = [v for k, v in sorted(intidx)]

        kwargs = {k: v
                  for k, v in content
                  if not isinstance(k, int) and not self.is_special(k)}
        return self.__class__(*args, **kwargs)
94000
def _prepare_patterns(self, pattern_dict):
        """"""
        dict_compiled = {}
        dict_text = {}
        dict_dscr = {}
        for platform, patterns in pattern_dict.items():
            dict_text[platform] = {}
            dict_compiled[platform] = {}
            dict_dscr[platform] = {}

            for key, pattern in patterns.items():
                try:
                    text_pattern = None
                    compiled_pattern = None
                    description_pattern = None

                    if isinstance(pattern, str):
                        text_pattern = pattern
                        compiled_pattern = re.compile(text_pattern, re.MULTILINE)
                        description_pattern = key

                    elif isinstance(pattern, dict):
                        text_pattern = pattern['pattern']
                        compiled_pattern = re.compile(text_pattern, re.MULTILINE)
                        description_pattern = pattern['description']

                    elif isinstance(pattern, list):
                        text_pattern = self._concatenate_patterns(key, pattern)
                        compiled_pattern = re.compile(text_pattern, re.MULTILINE)
                        description_pattern = key

                    dict_text[platform][key] = text_pattern
                    dict_compiled[platform][key] = compiled_pattern
                    dict_dscr[platform][key] = description_pattern

                except re.error as e:
                    raise RuntimeError("Pattern compile error: {} ({}:{})".format(e.message, platform, key))

        return dict_compiled, dict_text, dict_dscr
1074324
def merge_dicts(dicts):
        
        merged = {}
        for d in reversed(dicts):
            merged.update(d)
        return merged