e56f91c9b60f561712d28faae3e4d047adc67760,mathics/builtin/importexport.py,Import,apply,#Import#Any#Any#Any#,415

Before Change


        elements = [el.get_string_value() for el in elements]

        // Determine file type
        for el in elements:
            if el in IMPORTERS.keys():
                filetype = el
                elements.remove(el)
                break
        else:
            filetype = Expression("FileFormat", findfile).evaluate(
                evaluation=evaluation).get_string_value()

        return self._import(findfile, filetype, elements, evaluation)

    def _import(self, findfile, filetype, elements, evaluation):
        if filetype not in IMPORTERS.keys():

After Change


        // Download via URL
        if isinstance(filename, String):
            url = filename.get_string_value()
            if any(url.startswith(prefix) for prefix in ("http://", "https://", "ftp://")):
                import tempfile
                import os
                temp_handle, temp_path = tempfile.mkstemp(suffix="")
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 6

Instances


Project Name: mathics/Mathics
Commit Name: e56f91c9b60f561712d28faae3e4d047adc67760
Time: 2016-09-14
Author: Bernhard.Liebl@gmx.org
File Name: mathics/builtin/importexport.py
Class Name: Import
Method Name: apply


Project Name: ray-project/ray
Commit Name: 195f8182247ea2c1aef6b1bcf74aff9bcc3f466f
Time: 2021-04-07
Author: ed.nmi.oakes@gmail.com
File Name: python/ray/serve/endpoint_state.py
Class Name: EndpointState
Method Name: delete_endpoint


Project Name: GoogleCloudPlatform/PerfKitBenchmarker
Commit Name: eb687adc7f6451c9c5fa8a474af6ba759ab4fea2
Time: 2016-02-15
Author: carlos.torres@rackspace.com
File Name: perfkitbenchmarker/providers/rackspace/rackspace_virtual_machine.py
Class Name: RackspaceVirtualMachine
Method Name: _GetBootDevice


Project Name: pyinstaller/pyinstaller
Commit Name: 336638affd7687ffa272ea75a4a6f838dc9c598a
Time: 2015-10-25
Author: h.goebel@crazy-compilers.com
File Name: PyInstaller/depend/utils.py
Class Name:
Method Name: _resolveCtypesImports