Returns a softimage object given its fullname.
191089
def siget(fullname=""):
    """"""
    fullname = str(fullname)
    if not len(fullname):
        return None
    return sidict.GetObject(fullname, False)
4220
def image_from(from_value):
    
    regex = re.compile(r"""(?xi)     # readable, case-insensitive regex
        \s*                          # ignore leading whitespace
        (?P<image> \S+ )             # image and optional tag
        (?:                          # optional "AS name" clause for stage
            \s+ AS \s+
            (?P<name> \S+ )
        )?
        """)
    match = re.match(regex, from_value)
    return match.group('image', 'name') if match else (None, None)
472377
public TiffObject get(String name) {
    TiffObject result = null;
    String container = null;

    ArrayList<TiffObject> found = new ArrayList<>();
    if (contains(name)) {
      // Find objects with this exact name
      if (metadata.get(name).getObjectList().size() == 1) {
        found.add(getFirst(name));
      } else {
        for (TiffObject to : metadata.get(name).getObjectList()) {
          found.add(to);
        }
      }
    } else {
      // Find objects with similar or equivalent name
      for (String key : metadata.keySet()) {
        boolean similar = key.toLowerCase().equals(name.toLowerCase());
        if (!similar) similar = name.toLowerCase().equals("date") && key.toLowerCase().equals("datetime");
        if (!similar) similar = name.toLowerCase().equals("date") && key.toLowerCase().equals("creatordate");
        if (!similar) similar = name.toLowerCase().equals("description") && key.toLowerCase().equals("imagedescription");
        if (!similar) similar = name.toLowerCase().equals("creator") && key.toLowerCase().equals("artist");
        if (!similar) similar = name.toLowerCase().equals("creator") && key.toLowerCase().equals("creatortool");
        if (similar) {
          for (TiffObject to : metadata.get(key).getObjectList()) {
            found.add(to);
          }
        }
      }
    }

    // Return the most prioritary result
    if (found.size()==1) {
      result = found.get(0);
    } else {
      for (TiffObject to : found) {
        if (result == null) {
          result = to;
          container = to.getContainer();
        } else if (to.getContainer() != null) {
          // Preferences in (descending) order: EXIF, XMP, IPTC, Tiff tag
          if (container == null || to.getContainer().equals("EXIF")
              || (to.getContainer().equals("XMP") && container.equals("IPTC"))) {
            result = to;
            container = to.getContainer();
          }
        }
      }
    }

    return result;
  }
1187706
def inside_softimage():
    """"""
    try:
        import maya
        return False
    except ImportError:
        pass
    try:
        from win32com.client import Dispatch as disp
        disp('XSI.Application')
        return True
    except:
        return False
1103002
def image_name(self):
        
        if getattr(self, "_image_name", NotSpecified) is NotSpecified:
            self._image_name = self.prefixed_image_name

            if self.image_index:
                self._image_name = "{0}{1}".format(self.image_index, self._image_name)

            if "EXTRA_IMAGE_NAME" in os.environ:
                self._image_name = "{0}{1}".format(self._image_name, os.environ["EXTRA_IMAGE_NAME"])
        return self._image_name
465887
def get_full_name(self):
        """"""
        if self.first_name and self.last_name:
            return "{} {}".format(self.first_name, self.last_name)
        return self.email
1320461
def load_image(name, n, m=None, gpu=None, square=None):
    """"""
    if m is None:
        m = n
    if gpu is None:
        gpu = 0
    if square is None:
        square = 0
    command = ('Shearlab.load_image("{}", {}, {}, {}, {})'.format(name,
               n, m, gpu, square))
    return j.eval(command)
526472
def _get_imsize(self, im_name):
        
        img = cv2.imread(im_name)
        return (img.shape[0], img.shape[1])
572984
def size_from_name(size, sizes):

    """"""

    by_name = [s for s in sizes if s.name == size]
    if len(by_name) > 1:
        raise Exception('more than one image named %s exists' % size)
    return by_name[0]
94753
def get_image(cls, url):
        
        from PIL.ImageFile import Parser as PILParser

        length = 0
        raw_image = None
        with closing(request.get(url, stream=True)) as response:
            response.raise_for_status()
            response_url = response.url
            parser = PILParser()
            for chunk in response.iter_content(config.CHUNK_SIZE):
                length += len(chunk)
                if length > config.IMAGE_MAX_BYTESIZE:
                    del parser
                    raise cls.MaxBytesException
                parser.feed(chunk)
                # comment this to get the whole file
                if parser.image and parser.image.size:
                    raw_image = parser.image
                    del parser # free some memory
                    break
            # or this to get just the size and format
            # raw_image = parser.close()
        if length == 0:
            raise cls.ZeroBytesException
        if not raw_image:
            raise cls.NoImageException
        image = Image(response_url, raw_image.size, raw_image.format)
        return image
565591
def getFullName(obj):
    '''
    
    '''
    if hasattr(obj, 'firstName') and hasattr(obj, 'lastName'):
        return ' '.join([obj.firstName or '', obj.lastName or ''])
    return ' '.join([getattr(obj, 'first_name', ''),getattr(obj, 'last_name', '')])
980494
def get_image(self, digest, blob, mime_type, index, size=500):
        """"""
        # Special case, for now (XXX).
        if mime_type.startswith("image/"):
            return ""

        cache_key = f"img:{index}:{size}:{digest}"
        return self.cache.get(cache_key)
319159
def full_name(self):
        
        full_name = self.first_name
        if self.last_name:
            full_name += ' ' + self.last_name
        return full_name
992122
def parse_image_name(self, image):
        '''
             

        '''
        self._image = image
        self.uri = self.get_uri(image)
        self.image = self.remove_uri(image)
492550
def get_image_layer(self, image_id):
        """"""
        return self._http_call(self.IMAGE_JSON, get, image_id=image_id)
38300
def from_dict(raw_data):
        """"""
        url = None
        width = None
        height = None
        try:
            url = raw_data['url']
            width = raw_data['width']
            height = raw_data['height']
        except KeyError:
            raise ValueError('Unexpected image json structure')
        except TypeError:
            # Happens when raw_data is None, i.e. when a term has no image:
            pass
        return Image(url, width, height)
1076204
def __get_image(conn, vm_):
    '''
    
    '''
    img = config.get_cloud_config_value(
        'image', vm_, __opts__, default='debian-7', search_global=False)
    return conn.ex_get_image(img)