PageRenderTime 201ms queryTime 40ms sortTime 4ms getByIdsTime 73ms findMatchingLines 24ms

100+ results results for 'deepcopy' (201 ms)

Not the results you expected?
test_trustregion.py https://github.com/matthew-brett/scipy.git | Python | 108 lines
                    
8import itertools
                    
9from copy import deepcopy
                    
10import numpy as np
                    
                
bucket_policy.py https://gitlab.com/pgeorgiev_vmw/idem-aws | Python | 258 lines
                    
120                new_policy = new_policy_ret.get("Policy") if new_policy_ret else None
                    
121                after = copy.deepcopy(before)
                    
122                after["policy"] = new_policy
                    
130        else:
                    
131            result["new_state"] = copy.deepcopy(before)
                    
132            result["comment"] = f"No changes were made to policy"
                    
206            result["comment"] = f"{e.__class__.__name__}: {e}"
                    
207        after = copy.deepcopy(before)
                    
208        after["policy"] = None
                    
                
base.py https://bitbucket.org/jmargeta/scikit-learn.git | Python | 396 lines
                    
27    safe: boolean, optional
                    
28        If safe is false, clone will fall back to a deepcopy on objects
                    
29        that are not estimators.
                    
37        if not safe:
                    
38            return copy.deepcopy(estimator)
                    
39        else:
                    
                
base.py https://gitlab.com/gregtyka/ka-lite | Python | 240 lines
                    
154                if child_denormed_data:
                    
155                    node["children"].append(copy.deepcopy(dict(child_denormed_data)))
                    
156            except KeyError:
                    
232    if render_type in hierarchy:
                    
233        node_copy = copy.deepcopy(dict(node))
                    
234        for child in node_copy.get("children", []):
                    
                
command.py https://github.com/kylebittinger/flactrac.git | Python | 178 lines
                    
117    def set_converted_tags(self, converted_fp, tags):
                    
118        tags = copy.deepcopy(tags)
                    
119        f = mutagen.easyid3.EasyID3(converted_fp)
                    
                
test_key.py https://gitlab.com/hyingzhi/idem-vault | Python | 116 lines
                    
22    value = "secret-value"
                    
23    test_ctx = copy.deepcopy(ctx)
                    
24    test_ctx["test"] = True
                    
                
guess_language.py https://github.com/jishnu7/silpa.git | Python | 572 lines
                    
67            return type(self)(self.default_factory, self)
                    
68        def __deepcopy__(self, memo):
                    
69            import copy
                    
70            return type(self)(self.default_factory,
                    
71                              copy.deepcopy(self.items()))
                    
72        def __repr__(self):
                    
                
filterset.py https://bitbucket.org/atn9/django-filter.git | Python | 297 lines
                    
1from copy import deepcopy
                    
2
                    
209
                    
210        self.filters = deepcopy(self.base_filters)
                    
211        # propagate the model being used through the filters
                    
                
utils.py https://github.com/plone/plone.app.blocks.git | Python | 390 lines
                    
2from App.config import getConfiguration
                    
3from copy import deepcopy
                    
4from diazo import compiler
                    
368    rules_doc = etree.ElementTree(etree.fromstring(rules_doc))
                    
369    compiled = compile_theme(rules_doc, etree.ElementTree(deepcopy(theme_node)))
                    
370    transform = etree.XSLT(compiled)
                    
                
test_metricspace.py https://gitlab.com/tadh/zhang-shasha | Python | 215 lines
                    
201        for A in (randtree(5, repeat=3, width=2) for x in range(N*4)):
                    
202            B = copy.deepcopy(A)
                    
203            node = random.choice([n for n in B.iter()])
                    
                
shape.py https://gitlab.com/Ferraresi/TestAcademiadaCarne | Python | 413 lines
                    
93        # Copy the user defined properties since they will be modified.
                    
94        line = copy.deepcopy(line)
                    
95
                    
131        # Copy the user defined properties since they will be modified.
                    
132        fill = copy.deepcopy(fill)
                    
133
                    
145        # Copy the user defined properties since they will be modified.
                    
146        pattern = copy.deepcopy(pattern)
                    
147
                    
226        # Copy the user defined properties since they will be modified.
                    
227        gradient = copy.deepcopy(gradient)
                    
228
                    
378        # Copy the user defined properties since they will be modified.
                    
379        align = copy.deepcopy(align)
                    
380
                    
                
buffering.py https://github.com/dkiela/thesis.git | Python | 409 lines
                    
47     '__copy__',
                    
48     '__deepcopy__',
                    
49     '__delattr__',
                    
                
fake.py https://github.com/santhoshkumartw/openstack-nova.git | Python | 187 lines
                    
103        """Returns list of images."""
                    
104        return copy.deepcopy(self.images.values())
                    
105
                    
107        """Return list of detailed image information."""
                    
108        return copy.deepcopy(self.images.values())
                    
109
                    
117        if image:
                    
118            return copy.deepcopy(image)
                    
119        LOG.warn('Unable to find image id %s.  Have images: %s',
                    
124        """Returns a dict containing image data for the given name."""
                    
125        images = copy.deepcopy(self.images.values())
                    
126        for image in images:
                    
150        metadata['id'] = image_id
                    
151        self.images[image_id] = copy.deepcopy(metadata)
                    
152        return self.images[image_id]
                    
                
test_pickling.py https://github.com/Grahack/geophar.git | Python | 410 lines
                    
35    #FIXME-py3k: Add support for protocol 3.
                    
36    for protocol in [0, 1, 2, copy.copy, copy.deepcopy]:
                    
37        if callable(protocol):
                    
                
change_signature.py https://gitlab.com/vim-IDE/python-mode | Python | 340 lines
                    
151        for changer in self.changers:
                    
152            definition_info = copy.deepcopy(definition_info)
                    
153            changer.change_definition_info(definition_info)
                    
                
claims.py https://github.com/markmc/nova.git | Python | 256 lines
                    
81        else:
                    
82            # This does not use copy.deepcopy() because it could be
                    
83            # a sqlalchemy model, and it's best to make sure we have
                    
                
permissionadmin.py https://github.com/keimlink/django-cms.git | Python | 228 lines
                    
1# -*- coding: utf-8 -*-
                    
2from copy import deepcopy
                    
3from django.contrib import admin
                    
151            threshold = False
                    
152        filter_copy = deepcopy(self.list_filter)
                    
153        if threshold:
                    
184        """
                    
185        fieldsets = deepcopy(self.fieldsets)
                    
186        perm_models = (
                    
                
block_function.py https://gitlab.com/multiphenics/multiphenics | Python | 344 lines
                    
105            original_sub = sub_function.sub
                    
106            def sub(self_, j, deepcopy=False):
                    
107                output = original_sub(j, deepcopy)
                    
186
                    
187    def sub(self, i, deepcopy=False):
                    
188        """
                    
204
                    
205        assert deepcopy is False # no usage envisioned for the other case
                    
206
                    
208
                    
209    def block_split(self, deepcopy=False):
                    
210        """
                    
217        *Arguments*
                    
218            deepcopy
                    
219                Copy sub function vector instead of sharing
                    
                
_test_mech_agent.py https://github.com/openstack/neutron.git | Python | 374 lines
                    
68        if self._original:
                    
69            ret_value = copy.deepcopy(self.original)
                    
70            ret_value.update(current_data)
                    
                
policy.py https://gitlab.com/pgeorgiev_vmw/idem-aws | Python | 325 lines
                    
112            result["comment"] = (f"'{name}' already exists",)
                    
113            plan_state = copy.deepcopy(result["old_state"])
                    
114            # Update policy document if needed
                    
200        elif before and update_ret is None:
                    
201            result["new_state"] = copy.deepcopy(result["old_state"])
                    
202        else:
                    
                
__init__.py https://gitlab.com/JigmeDatse/synapse | Python | 182 lines
                    
138        # Signatures is a dict of dicts, and this is faster than doing a
                    
139        # copy.deepcopy
                    
140        signatures = {
                    
                
mine.py https://bitbucket.org/dtim/icfpc2012.git | Python | 186 lines
                    
54    def clone(self):
                    
55        return copy.deepcopy(self)
                    
56    
                    
                
archive.py https://gitlab.com/noc0lour/mailman | Python | 105 lines
                    
90                continue
                    
91            msg_copy = copy.deepcopy(msg)
                    
92            if _should_clobber(msg, msgdata, archiver.name):
                    
                
tilequadtree.py https://github.com/totycro/unknown-horizons-quadtree.git | Python | 166 lines
                    
82		self._fillTree(tree)
                    
83		coords = copy.deepcopy(self.default_fill_coords)
                    
84		for tile in tree:
                    
                
order.py https://bitbucket.org/cadosolutions/cadoshop.git | Python | 246 lines
                    
33
                    
34        style = copy.deepcopy(self.pdf.style.normal)
                    
35        style.fontSize = 1.5 * style.fontSize
                    
                
__init__.py https://github.com/junalmeida/Sick-Beard.git | Python | 199 lines
                    
4
                    
5from copy import deepcopy
                    
6from time import sleep
                    
77
                    
78        cloudflare_kwargs = deepcopy(original_kwargs)
                    
79        params = cloudflare_kwargs.setdefault("params", {})
                    
                
fields.py https://github.com/plone/plone.schemaeditor.git | Python | 301 lines
                    
41    def __call__(self, *args, **kw):
                    
42        kwargs = copy.deepcopy(self.kw)
                    
43        kwargs.update(**kw)
                    
                
resolution_matrix.py https://github.com/mne-tools/mne-python.git | Python | 420 lines
                    
5# License: BSD-3-Clause
                    
6from copy import deepcopy
                    
7
                    
323    # because this has all the correct projector information
                    
324    info = deepcopy(inverse_operator['info'])
                    
325    with info._unlock():
                    
                
HHH.py https://bitbucket.org/lavanyaj/hhh.git | Python | 293 lines
                    
122        packets_counted = sum(TCAMDict.values())
                    
123        MyTCAMDict = copy.deepcopy(TCAMDict) # copy
                    
124        TCAMSet = set(TCAMDict.keys())
                    
                
move_nanmax.py https://github.com/fhal/bottleneck.git | Python | 349 lines
                    
2
                    
3from copy import deepcopy
                    
4import bottleneck as bn
                    
210
                    
211ints = deepcopy(floats)
                    
212ints['reuse_non_nan_func'] = True
                    
                
utils.py https://github.com/agramfort/mne-python.git | Python | 373 lines
                    
13import math
                    
14from copy import deepcopy
                    
15from functools import partial
                    
67        if v is not None:
                    
68            this_mapping = deepcopy(DEFAULTS[k])
                    
69            this_mapping.update(v)
                    
                
mkhtml.py git://github.com/lxml/lxml.git | Python | 332 lines
                    
86def merge_menu(tree, menu, name):
                    
87    menu_root = copy.deepcopy(menu)
                    
88    tree.getroot()[1][0].insert(0, menu_root)  # html->body->div[class=document]
                    
302    '''))
                    
303    sitemap_menu = copy.deepcopy(menu)
                    
304    SubElement(SubElement(sitemap_menu[-1], 'li'), 'a', href='http://lxml.de/files/').text = 'Download files'
                    
                
test_lazyobject.py git://github.com/django/django.git | Python | 458 lines
                    
254
                    
255    def test_deepcopy_list(self):
                    
256        # Deep copying a list works and returns the correct objects.
                    
260        len(lst)  # forces evaluation
                    
261        obj2 = copy.deepcopy(obj)
                    
262
                    
266
                    
267    def test_deepcopy_list_no_evaluation(self):
                    
268        # Deep copying doesn't force evaluation.
                    
271        obj = self.lazy_wrap(lst)
                    
272        obj2 = copy.deepcopy(obj)
                    
273
                    
277
                    
278    def test_deepcopy_class(self):
                    
279        # Deep copying a class works and returns the correct objects.
                    
                
suitemaker.py https://gitlab.com/martynbristow/gabbi | Python | 270 lines
                    
62        """
                    
63        test = copy.deepcopy(self.test_defaults)
                    
64        try:
                    
208    # Merge global with per-suite defaults
                    
209    default_test_dict = copy.deepcopy(case.HTTPTestCase.base_test)
                    
210    for handler in handlers:
                    
                
query_utils.py https://github.com/jcrobak/hue.git | Python | 244 lines
                    
9import weakref
                    
10from copy import deepcopy
                    
11
                    
153            raise TypeError(other)
                    
154        obj = deepcopy(self)
                    
155        obj.add(other, conn)
                    
164    def __invert__(self):
                    
165        obj = deepcopy(self)
                    
166        obj.negate()
                    
                
tests.py https://github.com/theosp/google_appengine.git | Python | 194 lines
                    
111            # with the flush operation in other tests.
                    
112            old_app_models = copy.deepcopy(cache.app_models)
                    
113            old_app_store = copy.deepcopy(cache.app_store)
                    
138            # with the flush operation in other tests.
                    
139            old_app_models = copy.deepcopy(cache.app_models)
                    
140            old_app_store = copy.deepcopy(cache.app_store)
                    
169            # with the flush operation in other tests.
                    
170            old_app_models = copy.deepcopy(cache.app_models)
                    
171            old_app_store = copy.deepcopy(cache.app_store)
                    
                
qt_unittest.py https://gitlab.com/x33n/phantomjs | Python | 126 lines
                    
30import os
                    
31from copy import deepcopy
                    
32
                    
89        for case in self.search_paths_cases:
                    
90            expectations_case = deepcopy(case)
                    
91            if expectations_case['use_webkit2']:
                    
                
test_extended_hypervisors.py git://github.com/openstack/nova.git | Python | 117 lines
                    
48class ExtendedHypervisorsTestV21(test.NoDBTestCase):
                    
49    DETAIL_HYPERS_DICTS = copy.deepcopy(test_hypervisors.TEST_HYPERS)
                    
50    del DETAIL_HYPERS_DICTS[0]['service_id']
                    
103class ExtendedHypervisorsTestV2(ExtendedHypervisorsTestV21):
                    
104    DETAIL_HYPERS_DICTS = copy.deepcopy(test_hypervisors.TEST_HYPERS)
                    
105    del DETAIL_HYPERS_DICTS[0]['service_id']
                    
                
tree.py https://github.com/txm/potato.git | Python | 153 lines
                    
5
                    
6from django.utils.copycompat import deepcopy
                    
7
                    
54
                    
55    def __deepcopy__(self, memodict):
                    
56        """
                    
56        """
                    
57        Utility method used by copy.deepcopy().
                    
58        """
                    
60        obj.__class__ = self.__class__
                    
61        obj.children = deepcopy(self.children, memodict)
                    
62        obj.subtree_parents = deepcopy(self.subtree_parents, memodict)
                    
                
options.py https://github.com/markmc/nova.git | Python | 171 lines
                    
170    """
                    
171    return [('database', copy.deepcopy(database_opts))]
                    
172
                    
                
delete_model.py https://github.com/abstract-open-solutions/ScrumDo.git | Python | 131 lines
                    
42# Delete a Model
                    
43>>> end_sig = copy.deepcopy(start_sig)
                    
44>>> _ = end_sig['tests'].pop('BasicModel')
                    
44>>> _ = end_sig['tests'].pop('BasicModel')
                    
45>>> end = copy.deepcopy(start)
                    
46>>> _ = end.pop('basicmodel')
                    
51
                    
52>>> test_sig = copy.deepcopy(start_sig)
                    
53>>> test_sql = []
                    
64# Delete a model with an m2m field
                    
65>>> end_sig = copy.deepcopy(start_sig)
                    
66>>> _ = end_sig['tests'].pop('BasicWithM2MModel')
                    
66>>> _ = end_sig['tests'].pop('BasicWithM2MModel')
                    
67>>> end = copy.deepcopy(start)
                    
68>>> _ = end.pop('basicwithm2mmodel')
                    
                
dataproc.py https://github.com/davidmarin/mrjob.git | Python | 405 lines
                    
17# see case.py for definition of mock_clusters and mock_gcs_fs
                    
18from copy import deepcopy
                    
19
                    
251
                    
252        result = deepcopy(cluster)
                    
253        self._simulate_progress(project_id, region, cluster_name)
                    
312
                    
313        return deepcopy(job)
                    
314
                    
324
                    
325        result = deepcopy(job)
                    
326        self._simulate_progress(job)
                    
356
                    
357            yield deepcopy(job)
                    
358
                    
                
case.py https://github.com/dimagi/commcare-hq.git | Python | 185 lines
                    
30def transform_case_for_elasticsearch(doc_dict):
                    
31    doc_ret = copy.deepcopy(doc_dict)
                    
32    if not doc_ret.get("owner_id"):
                    
                
testFunctional.py https://github.com/eaudeweb/Naaya.git | Python | 201 lines
                    
21from unittest import TestSuite, makeSuite
                    
22from copy import deepcopy
                    
23
                    
33        self.portal.manage_install_pluggableitem(self.contact_metatype)
                    
34        add_content_permissions = deepcopy(self.portal.acl_users.getPermission('Add content'))
                    
35        add_content_permissions['permissions'].append(self.contact_permission)
                    
38    def contact_uninstall(self):
                    
39        add_content_permissions = deepcopy(self.portal.acl_users.getPermission('Add content'))
                    
40        add_content_permissions['permissions'].remove(self.contact_permission)
                    
                
__init__.py https://gitlab.com/rendoaw/exabgp | Python | 252 lines
                    
10import socket
                    
11from copy import deepcopy
                    
12
                    
238				# XXX: FIXME: Ok, it works but it takes LOTS of memory ..
                    
239				m_neighbor = deepcopy(neighbor)
                    
240				m_neighbor.make_rib()
                    
                
PickleJar.py https://github.com/davidmorrison/indico.git | Python | 263 lines
                    
27def functional_append(list, element):
                    
28    newlist = copy.deepcopy(list)
                    
29    newlist.append(element)
                    
                
_stage.py https://github.com/adai/LTLMoP.git | Python | 261 lines
                    
11from numpy import *
                    
12from copy import deepcopy
                    
13
                    
78        bitmap = wx.EmptyBitmap(640,480)
                    
79        temp_rfi = deepcopy(self.proj.rfi)
                    
80
                    
                
MockDbsApi.py https://github.com/dmwm/WMCore.git | Python | 143 lines
                    
65        if 'logical_file_name' in kwargs and len(kwargs['logical_file_name']) > 1:
                    
66            origArgs = copy.deepcopy(kwargs)
                    
67            returnDicts = []
                    
88        if 'logical_file_name' in kwargs and len(kwargs['logical_file_name']) > 1:
                    
89            origArgs = copy.deepcopy(kwargs)
                    
90            returnDicts = []
                    
                
__init__.py https://github.com/davidmiller/celery.git | Python | 388 lines
                    
64
                    
65    def __deepcopy__(self, memo):
                    
66        memo[id(self)] = self
                    
                
font.py https://github.com/pib/enable.git | Python | 161 lines
                    
138        """
                    
139        return copy.deepcopy(self)
                    
140
                    
                
hostustreamtv.py https://gitlab.com/Ghoz/iptvplayer-for-e2 | Python | 328 lines
                    
100        for item in tab:
                    
101            params = copy.deepcopy( cItem )
                    
102            params['category'] = category
                    
                
transforms.py https://github.com/ericliang/matplotlib.git | Python | 437 lines
                    
68  scale(sx,sy)        - scale the bbox by sx, sy
                    
69  deepcopy()          - return a deep copy of self (pointers are lost)
                    
70
                    
                
test_commands.py https://gitlab.com/wenchiching/BigchainDB | Python | 315 lines
                    
90    value = {}
                    
91    expected_config = copy.deepcopy(bigchaindb._config)
                    
92    expected_config['keypair']['public'] = 'pubkey'
                    
                
catalog.py https://github.com/miracle2k/babel.git | Python | 293 lines
                    
244        template = catalog.Catalog()
                    
245        localized_catalog = copy.deepcopy(template)
                    
246        localized_catalog.locale = 'de_DE'
                    
258        template = catalog.Catalog()
                    
259        localized_catalog = copy.deepcopy(template)
                    
260        localized_catalog.locale = 'de_DE'
                    
                
test_contour.py https://github.com/fspaolo/code.git | Python | 183 lines
                    
167
                    
168        # Now deepcopy the source and replace the existing one with
                    
169        # the copy.  This basically simulates cutting/copying the
                    
171        # view, and pasting the copy back.
                    
172        source1 = copy.deepcopy(source)
                    
173        s.children[0] = source1
                    
                
cache.py https://github.com/goldenboy/skiheilw2p.git | Python | 430 lines
                    
163        Attention! cache.ram does not copy the cached object. It just stores a reference to it.
                    
164        Turns out the deepcopying the object has some problems:
                    
165        1) would break backward compatibility
                    
166        2) would be limiting because people may want to cache live objects
                    
167        3) would work unless we deepcopy no storage and retrival which would make things slow.
                    
168        Anyway. You can deepcopy explicitly in the function generating the value to be cached.
                    
                
forms.py https://github.com/alexvas/upupupdate.git | Python | 342 lines
                    
1from copy import deepcopy
                    
2import re
                    
                
testFunctional.py https://github.com/bogtan/Naaya.git | Python | 205 lines
                    
21from unittest import TestSuite, makeSuite
                    
22from copy import deepcopy
                    
23from StringIO import StringIO
                    
                
common.py https://bitbucket.org/pombredanne/nuitka.git | Python | 240 lines
                    
116        for k in env.keys():
                    
117            normenv[k] = copy.deepcopy(env[k]).encode('mbcs')
                    
118
                    
                
Backup.py https://bitbucket.org/mdavid/cherokee-webserver-svnclone.git | Python | 327 lines
                    
104                cfg._parse (cfg_str)
                    
105                CTK.cfg.root = copy.deepcopy(cfg.root)
                    
106            except socket.error, (value, message):
                    
                
role_policy.py https://gitlab.com/pgeorgiev_vmw/idem-aws | Python | 299 lines
                    
88        ] = hub.tool.aws.iam.conversion_utils.convert_raw_role_policy_to_present(before)
                    
89        result["new_state"] = copy.deepcopy(result["old_state"])
                    
90        result["comment"] = (
                    
                
__init__.py https://github.com/sajty/atlas-cpp.git | Python | 191 lines
                    
24import atlas.analyse
                    
25from copy import deepcopy
                    
26from atlas.util.minmax import MinMaxVector
                    
135            if hasattr(obj, "polyline"):
                    
136                obj._polyline = deepcopy(obj.polyline)
                    
137                resolve_list_position(obj, obj._polyline)
                    
138            if hasattr(obj, "area"):
                    
139                obj._area = deepcopy(obj.area)
                    
140                resolve_list_position2(obj, obj._area)
                    
147        limits = MinMaxVector()
                    
148##        last_limits = deepcopy(limits)
                    
149        for obj in self.objects.values():
                    
159##                                print "area", obj.id, limits
                    
160##                                last_limits = deepcopy(limits)
                    
161                elif obj._polyline:
                    
                
framework.py https://bitbucket.org/christian_oreilly/pyblockwork.git | Python | 311 lines
                    
9from abc import ABCMeta, abstractmethod 
                    
10from copy import deepcopy
                    
11import sys
                    
248                                    for nextInput in nextInputs:
                    
249                                        copyNI = deepcopy(nextInput)
                    
250                                        copyNI[inputKey] = item
                    
272                    # it as many times as required. 
                    
273                    newblock = deepcopy(block)
                    
274                    newblock.fromPreviousOutput = nextInput                           
                    
                
test_copy.py https://gitlab.com/doublebits/waterbutler | Python | 187 lines
                    
110
                    
111        copy.copy(cp.deepcopy(src_bundle), cp.deepcopy(dest_bundle), '', {'auth': {}})
                    
112
                    
128        with pytest.raises(Exception):
                    
129            copy.copy(cp.deepcopy(src_bundle), cp.deepcopy(dest_bundle), '', {'auth': {}})
                    
130
                    
146
                    
147        ret1, ret2 = copy.copy(cp.deepcopy(src_bundle), cp.deepcopy(dest_bundle), 'Test.com', {'auth': {'user': 'name'}})
                    
148
                    
175        stamp = FAKE_TIME
                    
176        copy.copy(cp.deepcopy(src_bundle), cp.deepcopy(dest_bundle), '', {'auth': {}}, start_time=stamp-100)
                    
177        copy.copy(cp.deepcopy(src_bundle), cp.deepcopy(dest_bundle), '', {'auth': {}}, start_time=stamp+100)
                    
                
detector.py https://gitlab.com/pgeorgiev_vmw/idem-aws | Python | 304 lines
                    
136            )
                    
137            plan_state = copy.deepcopy(result["old_state"])
                    
138            update_ret = await hub.exec.aws.guardduty.detector.update_detector(
                    
193        else:
                    
194            result["new_state"] = copy.deepcopy(result["old_state"])
                    
195    except Exception as e:
                    
                
utils.py https://bitbucket.org/chrisfranklinuk/gamecology.git | Python | 277 lines
                    
4from contextlib import contextmanager
                    
5from copy import deepcopy
                    
6from fudge.patcher import with_patched_object
                    
37        # Copy env, output for restoration in teardown
                    
38        self.previous_env = copy.deepcopy(env)
                    
39        # Deepcopy doesn't work well on AliasDicts; but they're only one layer
                    
                
bandstructureparser.py https://github.com/danmichaelo/oppvasp.git | Python | 307 lines
                    
76    #        S = self.reciprocalAxes
                    
77    #        b = copy.deepcopy(self.bandstructure)
                    
78    #        for kpoint in b:                
                    
                
test_xml_dom_minicompat.py https://github.com/albertz/CPython.git | Python | 138 lines
                    
119
                    
120    def test_nodelist_deepcopy(self):
                    
121        # Empty NodeList.
                    
122        node_list = NodeList()
                    
123        copied = copy.deepcopy(node_list)
                    
124        self.assertIsNot(copied, node_list)
                    
129        node_list.append([2])
                    
130        copied = copy.deepcopy(node_list)
                    
131        self.assertIsNot(copied, node_list)
                    
                
utils.py https://github.com/dimagi/commcare-hq.git | Python | 372 lines
                    
2from collections import defaultdict, namedtuple
                    
3from copy import deepcopy
                    
4from datetime import datetime
                    
82            instance_generator_fn = _import_class_or_function(self.instance_generator)
                    
83            params = deepcopy(self.params)  # parameters defined in settings file
                    
84            params.update(kwargs)  # parameters passed in via run_ptop
                    
                
cloud_server.py https://gitlab.com/syjulian/poc-heat-mversion | Python | 310 lines
                    
78
                    
79    properties_schema = copy.deepcopy(server.Server.properties_schema)
                    
80    properties_schema.update(
                    
233
                    
234        nets = copy.deepcopy(server.addresses)
                    
235        nova_ext = self.client().os_virtual_interfacesv2_python_novaclient_ext
                    
                
base.py https://github.com/mitmproxy/mitmproxy.git | Python | 454 lines
                    
256    ) -> None:
                    
257        value = self.data_in(copy.deepcopy(value))
                    
258        self.master = master
                    
                
web.py https://github.com/intelchen/bibserver.git | Python | 293 lines
                    
6import subprocess
                    
7from copy import deepcopy
                    
8from datetime import datetime
                    
                
test_common.py https://gitlab.com/sim6/switching | Python | 313 lines
                    
14from .test_helpers import get_data
                    
15from copy import copy, deepcopy
                    
16
                    
                
__init__.py https://github.com/Nizy/biopython.git | Python | 355 lines
                    
27"""
                    
28from copy import deepcopy
                    
29
                    
162            gp_pop.comment_line = self.comment_line
                    
163            gp_pop.loci_list = deepcopy(self.loci_list)
                    
164            gp_pop.populations = [deepcopy(self.populations[i])]
                    
                
test_update_restricted.py https://gitlab.com/unofficial-mirrors/openstack-heat | Python | 168 lines
                    
60
                    
61        update_template = copy.deepcopy(test_template)
                    
62        props = update_template['resources']['bar']['properties']
                    
97
                    
98        update_template = copy.deepcopy(test_template)
                    
99        props = update_template['resources']['bar']['properties']
                    
135
                    
136        update_template = copy.deepcopy(test_template)
                    
137        rsrc = update_template['resources']['bar']
                    
                
test_multigraph.py https://gitlab.com/Tenm4/ScanPie | Python | 230 lines
                    
129                        
                    
130    def deepcopy_edge_attr(self,H,G):
                    
131        assert_equal(G[1][2][0]['foo'],H[1][2][0]['foo'])
                    
179        H=G.to_undirected()
                    
180        self.is_deepcopy(H,G)
                    
181
                    
187        H=G.to_directed()
                    
188        self.is_deepcopy(H,G)
                    
189
                    
                
ak47wiimote.py https://github.com/vranki/wiishooter.git | Python | 333 lines
                    
136        self.center_point()
                    
137        temp_pos = copy.deepcopy(self.cpoint)
                    
138        
                    
                
gaia_test.py https://gitlab.com/astian/build-mozharness | Python | 235 lines
                    
75         }
                    
76    ]] + copy.deepcopy(testing_config_options) + \
                    
77        copy.deepcopy(blobupload_config_options) + \
                    
77        copy.deepcopy(blobupload_config_options) + \
                    
78        copy.deepcopy(gaia_config_options)
                    
79
                    
                
timeout.py https://gitlab.com/abhi1tb/build | Python | 258 lines
                    
179        """
                    
180        # We can't use copy.deepcopy because that will also create a new object
                    
181        # for _GLOBAL_DEFAULT_TIMEOUT, which socket.py uses as a sentinel to
                    
                
data.py https://gitlab.com/lbennett/zipline | Python | 392 lines
                    
15import datetime
                    
16from copy import deepcopy
                    
17
                    
206
                    
207        major_axis = pd.DatetimeIndex(deepcopy(current_dates), tz='utc')
                    
208        if values.ndim == 3:
                    
226        where = slice(self._start_index, self._pos)
                    
227        return pd.DatetimeIndex(deepcopy(self.date_buf[where]), tz='utc')
                    
228
                    
300        where = slice(self._oldest_frame_idx(), self._pos)
                    
301        major_axis = pd.DatetimeIndex(deepcopy(self.date_buf[where]), tz='utc')
                    
302        return pd.Panel(self.buffer.values[:, where, :], self.items,
                    
315        where = slice(self._oldest_frame_idx(), self._pos)
                    
316        return pd.DatetimeIndex(deepcopy(self.date_buf[where]), tz='utc')
                    
317
                    
                
check_nodal_quadrature.py https://github.com/davidshepherd7/oomph-lib-micromagnetics.git | Python | 450 lines
                    
285    for n in ele.nodes:
                    
286        n.mprev = copy.deepcopy(func(n.x))
                    
287        n.m = copy.deepcopy(func(n.x))
                    
392        for new_m_node, n in zip(new_m, ele.nodes):
                    
393            n.mprev = array(copy.deepcopy(n.m))
                    
394            n.m = array(copy.deepcopy(new_m_node))
                    
                
PackageBuildDataGenerator.py https://gitlab.com/unofficial-mirrors/vmware-photon | Python | 288 lines
                    
177        if package is None:
                    
178            dependentPackages=copy.deepcopy(dependencyGraph)
                    
179        else:
                    
                
internet_gateway.py https://gitlab.com/pgeorgiev_vmw/idem-aws | Python | 294 lines
                    
84        )
                    
85        plan_state = copy.deepcopy(result["old_state"])
                    
86        gateway_resource = before["ret"]["InternetGateways"][0]
                    
181        else:
                    
182            result["new_state"] = copy.deepcopy(result["old_state"])
                    
183    except Exception as e:
                    
                
forms.py https://github.com/ixc/django-form-utils.git | Python | 239 lines
                    
6"""
                    
7from copy import deepcopy
                    
8
                    
102def _mark_row_attrs(bf, form):
                    
103    row_attrs = deepcopy(form._row_attrs.get(bf.name, {}))
                    
104    if bf.field.required:
                    
183    def __init__(self, *args, **kwargs):
                    
184        self._fieldsets = deepcopy(self.base_fieldsets)
                    
185        self._row_attrs = deepcopy(self.base_row_attrs)
                    
                
tempeval2.py https://github.com/cnorthwood/ternip.git | Python | 178 lines
                    
82        """
                    
83        return copy.deepcopy(self._sents)
                    
84
                    
100        """
                    
101        self._sents = copy.deepcopy(sents)
                    
102
                    
                
_objectify.py https://bitbucket.org/stacklet/stacklet | Python | 340 lines
                    
8from cStringIO import StringIO
                    
9from copy import deepcopy
                    
10
                    
163        elif self._parser == DOM:
                    
164            return deepcopy(getattr(self._PyObject, py_name(self._root)))
                    
165        else:
                    
                
Styles.py https://github.com/goldenboy/skiheilw2p.git | Python | 93 lines
                    
17    def Copy( self ) :
                    
18        return deepcopy( self )
                    
19
                    
52    def Copy( self ) :
                    
53        return deepcopy( self )
                    
54
                    
                
compat.py https://bitbucket.org/pyinstaller/pyinstaller-cleanup.git | Python | 189 lines
                    
164
                    
165        def __deepcopy__(self, memo={}):
                    
166            from copy import deepcopy
                    
168            memo[id(self)] = result
                    
169            result.__init__(deepcopy(tuple(self), memo))
                    
170            return result
                    
                
stdlib.py https://bitbucket.org/tetonedge/linux.git | Python | 131 lines
                    
124        'copy': _return_first_param,
                    
125        'deepcopy': _return_first_param,
                    
126    },
                    
                
resolution_matrix.py https://github.com/slew/mne-python.git | Python | 419 lines
                    
5# License: BSD (3-clause)
                    
6from copy import deepcopy
                    
7
                    
323    # because this has all the correct projector information
                    
324    info = deepcopy(inverse_operator['info'])
                    
325    info['sfreq'] = 1000.  # necessary
                    
                
test_neutron_net.py https://gitlab.com/unofficial-mirrors/openstack-heat | Python | 350 lines
                    
110        }}
                    
111        net_info_active = copy.deepcopy(net_info_build)
                    
112        net_info_active['network'].update({'status': 'ACTIVE'})
                    
                
support.py https://gitlab.com/pmuontains/Odoo | Python | 221 lines
                    
7import sysconfig
                    
8from copy import deepcopy
                    
9import warnings
                    
133        super(EnvironGuard, self).setUp()
                    
134        self.old_environ = deepcopy(os.environ)
                    
135
                    
                
proxy.py https://gitlab.com/pranith/gem5 | Python | 246 lines
                    
143        # parameter
                    
144        new_self = copy.deepcopy(self)
                    
145        new_self._modifiers.append(attr)
                    
153            raise AttributeError, "Index operation on bound proxy"
                    
154        new_self = copy.deepcopy(self)
                    
155        new_self._modifiers.append(key)
                    
                
lane.py git://github.com/chapmanb/bcbb.git | Python | 92 lines
                    
81                   "SNP calling": ["SNP calling", "variant"]}
                    
82    config = copy.deepcopy(config)
                    
83    base_name = lane_info.get("analysis")
                    
                
orderedpersistentmapping.py https://github.com/socialplanning/topp.utils.git | Python | 201 lines
                    
109
                    
110    def __deepcopy__(self, memo):
                    
111        from copy import deepcopy
                    
111        from copy import deepcopy
                    
112        return self.__class__([(key, deepcopy(value, memo))
                    
113                               for key, value in self.iteritems()])
                    
                
form.py https://github.com/edrads/webpy.git | Python | 370 lines
                    
29    def __call__(self, x=None):
                    
30        o = copy.deepcopy(self)
                    
31        if x: o.validates(x)
                    
95    def __getattr__(self, name):
                    
96        # don't interfere with deepcopy
                    
97        inputs = self.__dict__.get('inputs') or []
                    
351class Validator:
                    
352    def __deepcopy__(self, memo): return copy.copy(self)
                    
353    def __init__(self, msg, test, jstest=None): utils.autoassign(self, locals())
                    
                
transforms.py https://github.com/mluessi/mne-python.git | Python | 235 lines
                    
12    """
                    
13    itrans = copy.deepcopy(trans)
                    
14    aux = itrans['from']
                    
178#
                    
179#     res = copy.deepcopy(chs)
                    
180#
                    
211#     """
                    
212#     res = copy.deepcopy(chs)
                    
213#
                    
                
datastructures.py https://github.com/theosp/google_appengine.git | Python | 473 lines
                    
2
                    
3from django.utils.copycompat import deepcopy
                    
4
                    
107
                    
108    def __deepcopy__(self, memo):
                    
109        return self.__class__([(key, deepcopy(value, memo))
                    
246
                    
247    def __deepcopy__(self, memo=None):
                    
248        import django.utils.copycompat as copy
                    
253        for key, value in dict.items(self):
                    
254            dict.__setitem__(result, copy.deepcopy(key, memo),
                    
255                             copy.deepcopy(value, memo))
                    
343        """Returns a copy of this object."""
                    
344        return self.__deepcopy__()
                    
345
                    
                
copy.py https://github.com/hsablonniere/play.git | Python | 415 lines
                    
7        x = copy.copy(y)        # make a shallow copy of y
                    
8        x = copy.deepcopy(y)    # make a deep copy of y
                    
9
                    
62
                    
63__all__ = ["Error", "copy", "deepcopy"]
                    
64
                    
143
                    
144def deepcopy(x, memo=None, _nil=[]):
                    
145    """Deep copy operation on arbitrary Python objects.
                    
159
                    
160    copier = _deepcopy_dispatch.get(cls)
                    
161    if copier:
                    
254    for key, value in x.iteritems():
                    
255        y[deepcopy(key, memo)] = deepcopy(value, memo)
                    
256    return y
                    
                
glpidb_broker.py https://github.com/sduchesneau/shinken.git | Python | 238 lines
                    
103    def preprocess(self, type, brok, checkst):
                    
104        new_brok = copy.deepcopy(brok)        
                    
105        #Only preprocess if we can apply a mapping
                    
190        #logger.log("GLPI : data in DB %s " % b)
                    
191        new_data = copy.deepcopy(b.data)
                    
192        new_data['last_check'] = time.strftime('%Y-%m-%d %H:%M:%S')
                    
218        logger.log("GLPI : data in DB %s " % b.data)
                    
219        new_data = copy.deepcopy(b.data)
                    
220        new_data['last_check'] = time.strftime('%Y-%m-%d %H:%M:%S')
                    
                
test_rh_subscription.py https://gitlab.com/bertjwregeer/cloud-init | Python | 234 lines
                    
72    def test_update_repos_disable_with_none(self, m_get_repos, m_sman_cli):
                    
73        cfg = copy.deepcopy(self.config)
                    
74        m_get_repos.return_value = ([], ['repo1'])
                    
                
test_views.py https://github.com/keimlink/django-cms.git | Python | 285 lines
                    
1from copy import deepcopy
                    
2import re
                    
215        original_context = {'TEMPLATES': settings.TEMPLATES}
                    
216        override = {'TEMPLATES': deepcopy(settings.TEMPLATES)}
                    
217        override['TEMPLATES'][0]['OPTIONS']['context_processors'].remove("cms.context_processors.cms_settings")
                    
                
dictdb.py https://gitlab.com/pooja043/Globus_Docker_4 | Python | 317 lines
                    
45
                    
46from copy import deepcopy as copy
                    
47from datetime import datetime
                    
                
tests.py https://github.com/theosp/google_appengine.git | Python | 362 lines
                    
154            # with the flush operation in other tests.
                    
155            old_app_models = copy.deepcopy(cache.app_models)
                    
156            old_app_store = copy.deepcopy(cache.app_store)
                    
                
policy_attachment.py https://gitlab.com/pgeorgiev_vmw/idem-aws | Python | 266 lines
                    
96        result["old_state"] = before_ret["ret"]
                    
97        result["new_state"] = copy.deepcopy(before_ret["ret"])
                    
98        result["comment"] = f"'{name}' already exists"
                    
                
tests.py https://github.com/theosp/google_appengine.git | Python | 266 lines
                    
198        self.assertEqual(copy.copy(q).encoding , 'rot_13' )
                    
199        self.assertEqual(copy.deepcopy(q).encoding , 'rot_13')
                    
200
                    
                
__init__.py https://github.com/MorganBorman/cxsbs.git | Python | 405 lines
                    
150		
                    
151		self.__gamevars = copy.deepcopy(self.__manager.game_vars_template)
                    
152		self.__sessionvars = copy.deepcopy(self.__manager.session_vars_template)
                    
363		'''Reset game variables'''
                    
364		self.__gamevars = copy.deepcopy(self.__manager.game_vars_template)
                    
365	def logAction(self, action, level='info'):
                    
                
nanvar.py https://github.com/fhal/bottleneck.git | Python | 428 lines
                    
2
                    
3from copy import deepcopy
                    
4import bottleneck as bn
                    
77
                    
78floats_None = deepcopy(floats)
                    
79floats_None['axisNone'] = True
                    
142
                    
143ints = deepcopy(floats)
                    
144ints['dtypes'] = INT_DTYPES 
                    
194
                    
195ints_None = deepcopy(ints) 
                    
196ints_None['top'] = ints['top'] + "    cdef Py_ssize_t size\n"
                    
                
CGIHTTPServer.py https://gitlab.com/dahbearz/CRYENGINE | Python | 374 lines
                    
157        # XXX Much of the following could be prepared ahead of time!
                    
158        env = copy.deepcopy(os.environ)
                    
159        env['SERVER_SOFTWARE'] = self.version_string()
                    
                
test_tumbler.py https://gitlab.com/yenny.prathivi/joinmarket | Python | 189 lines
                    
128
                    
129    tx_list2 = copy.deepcopy(tx_list)
                    
130    tx_dict = {}
                    
                
Config.py https://bitbucket.org/mdavid/ctk.git | Python | 484 lines
                    
218        # Original copy
                    
219        self.root_orig = copy.deepcopy (self.root)
                    
220
                    
263            return True
                    
264        copied = copy.deepcopy (self[path_old])
                    
265        self.set_sub_node (path_new, copied)
                    
401        # Update the original tree
                    
402        self.root_orig = copy.deepcopy (self.root)
                    
403
                    
470        was saved to the configuration file."""
                    
471        root = copy.deepcopy (self.root)
                    
472        orig = copy.deepcopy (self.root_orig)
                    
                
boto_s3_bucket_test.py https://gitlab.com/ricardo.hernandez/salt | Python | 386 lines
                    
5from distutils.version import LooseVersion  # pylint: disable=import-error,no-name-in-module
                    
6from copy import deepcopy
                    
7import random
                    
312        self.conn.head_bucket.side_effect = [not_found_error, None]
                    
313        self.conn.list_buckets.return_value = deepcopy(list_ret)
                    
314        self.conn.create_bucket.return_value = bucket_ret
                    
315        for key, value in config_ret.iteritems():
                    
316            getattr(self.conn, key).return_value = deepcopy(value)
                    
317        with patch.dict(funcs, {'boto_iam.get_account_id': MagicMock(return_value='111111222222')}):
                    
327    def test_present_when_bucket_exists_no_mods(self):
                    
328        self.conn.list_buckets.return_value = deepcopy(list_ret)
                    
329        for key, value in config_ret.iteritems():
                    
329        for key, value in config_ret.iteritems():
                    
330            getattr(self.conn, key).return_value = deepcopy(value)
                    
331        with patch.dict(funcs, {'boto_iam.get_account_id': MagicMock(return_value='111111222222')}):
                    
                
test_instance_actions.py https://github.com/markmc/nova.git | Python | 226 lines
                    
118        self.controller = server_actions.ServerActionsController()
                    
119        self.fake_actions = copy.deepcopy(fake_server_actions.FAKE_ACTIONS)
                    
120        self.fake_events = copy.deepcopy(fake_server_actions.FAKE_EVENTS)
                    
                
db_subnet_group.py https://gitlab.com/pgeorgiev_vmw/idem-aws | Python | 336 lines
                    
109                return result
                    
110            plan_state = copy.deepcopy(old_db_subnet_group)
                    
111            if ctx.get("test", False):
                    
200        else:
                    
201            new_db_subnet_group = copy.deepcopy(old_db_subnet_group)
                    
202
                    
                
test_api.py https://github.com/neurodebian/pandas.git | Python | 453 lines
                    
7# pylint: disable-msg=W0612,E1101
                    
8from copy import deepcopy
                    
9import sys
                    
366
                    
367    def test_deepcopy(self):
                    
368        cp = deepcopy(self.frame)
                    
                
Logger.py https://github.com/ab/bcfg2-old.git | Python | 264 lines
                    
126            while msgdata:
                    
127                newrec = copy.deepcopy(record)
                    
128                newrec.msg = msgdata[:250]
                    
                
forum_serializer.py https://gitlab.com/bplatta/proto-api | Python | 264 lines
                    
1from copy import deepcopy
                    
2from functools import partial
                    
81        """
                    
82        init_data = deepcopy(data)
                    
83
                    
                
iptvmoviemetadata.py https://gitlab.com/mustinet/iptvplayer-for-e2 | Python | 296 lines
                    
15except: import simplejson as json
                    
16from copy import deepcopy
                    
17###################################################
                    
60        self.filePath = GetMovieMetaDataDir( RemoveDisallowedFilenameChars( fileName ) )
                    
61        self.data = deepcopy( self.META_DATA )
                    
62        self.data.update( {"host":host, "title":title, "file_path":filePath} )
                    
159            for item in self.data['tracks']['subtitles']['tracks']:
                    
160                track = deepcopy( self.SUBTITLE_TRACK )
                    
161                track.update(item)
                    
223        try:
                    
224            track = deepcopy( self.SUBTITLE_TRACK )
                    
225            track.update(subtitlesTrack)
                    
                
fake.py https://github.com/comstud/nova.git | Python | 253 lines
                    
161        """Return list of detailed image information."""
                    
162        return copy.deepcopy(self.images.values())
                    
163
                    
175        if image:
                    
176            return copy.deepcopy(image)
                    
177        LOG.warn('Unable to find image id %s.  Have images: %s',
                    
190            raise exception.Duplicate()
                    
191        self.images[image_id] = copy.deepcopy(metadata)
                    
192        if data:
                    
205        if purge_props:
                    
206            self.images[image_id] = copy.deepcopy(metadata)
                    
207        else:
                    
                
priority_queue_test.py https://gitlab.com/admin-github-cloud/tensorflow | Python | 306 lines
                    
110          q.enqueue_many((values, values)) for values in enqueue_values]
                    
111      shuffled_counts = copy.deepcopy(enqueue_counts)
                    
112      random.shuffle(shuffled_counts)
                    
154          q.enqueue_many((values, values)) for values in enqueue_values]
                    
155      shuffled_counts = copy.deepcopy(enqueue_counts)
                    
156      random.shuffle(shuffled_counts)
                    
                
file_format_root.py https://github.com/theosp/google_appengine.git | Python | 361 lines
                    
86    if shard_size >= size_per_shard:
                    
87      roots.append(FileFormatRoot(copy.deepcopy(parsed_formats), inputs))
                    
88      inputs = []
                    
91  if inputs:
                    
92    roots.append(FileFormatRoot(copy.deepcopy(parsed_formats), inputs))
                    
93
                    
124
                    
125          roots.append(FileFormatRoot(copy.deepcopy(parsed_formats), inputs))
                    
126          size_left = size_per_shard
                    
138  if inputs:
                    
139    roots.append(FileFormatRoot(copy.deepcopy(parsed_formats), inputs))
                    
140
                    
                
gaussian.py https://gitlab.com/gkastlun/ase | Python | 138 lines
                    
52        calc_old = self.atoms.calc
                    
53        params_old = copy.deepcopy(self.calc.parameters)
                    
54
                    
                
 

Source

Language