Given a data_source, return its hash.

        :param data_source: The data_source name from a layer.
        :type data_source: str

        :returns: An md5 hash for the data source name.
        :rtype: str
497110
def hash_for_datasource(data_source):
        
        import hashlib
        hash_value = hashlib.md5()
        hash_value.update(data_source.encode('utf-8'))
        hash_value = hash_value.hexdigest()
        return hash_value
1212864
def decode_source(source_bytes):
    
    # source_bytes_readline = io.BytesIO(source_bytes).readline
    # encoding, _ = detect_encoding(source_bytes_readline)
    newline_decoder = io.IncrementalNewlineDecoder(None, True)
    return newline_decoder.decode(source_to_unicode(source_bytes))
1330206
def config_md5(self, source_config):
        """"""
        file_contents = source_config + "\n"  # Cisco IOS automatically adds this
        file_contents = file_contents.encode("UTF-8")
        return hashlib.md5(file_contents).hexdigest()
96444
def identifier_md5(self):
        
        as_int = (self.identifier * 1e4).astype(np.int64)
        hashed = util.md5_object(as_int.tostring(order='C'))
        return hashed
693566
def _file_md5(file_):
    
    md5 = hashlib.md5()
    chunk_size = 128 * md5.block_size
    for chunk in iter(lambda: file_.read(chunk_size), b''):
        md5.update(chunk)
    file_.seek(0)
    byte_digest = md5.digest()
    return base64.b64encode(byte_digest).decode()
1265425
def source_lookup(request):
    
    source = request.GET['source']
    source_slug = slugify(source.strip())
    source_candidates = Dataset.objects.values('source').filter(
        source_slug__startswith=source_slug
    )
    sources = json.dumps([cand['source'] for cand in source_candidates])

    return HttpResponse(sources, content_type='application/json')
1212965
def get_data_object(data_id, use_data_config=True):
    
    normalized_data_reference = normalize_data_name(data_id, use_data_config=use_data_config)
    client = DataClient()
    data_obj = client.get(normalized_data_reference)

    # Try with the raw ID
    if not data_obj and data_id != normalized_data_reference:
        data_obj = client.get(data_id)

    return data_obj
736312
def get_md5_file_hash(filename):
    
    import hashlib
    BLOCKSIZE = 65536
    hasher = hashlib.md5()
    with open(filename, 'rb') as afile:
        buf = afile.read(BLOCKSIZE)
        while len(buf) > 0:
            hasher.update(buf)
            buf = afile.read(BLOCKSIZE)
    return hasher.hexdigest()
162858
def getData(datadictionary_id)
      # /DataDictionaries/{ID}|{Name}/data
      parameter = { basic_auth: @auth }

      response = self.class.get("/datadictionaries/#{datadictionary_id}/data", parameter)
      if response.success?
        response['Data']
      else
        raise response.response
      end
    end
762174
def md5(self):
        
        # first MD5 the points in every entity
        target = '{}{}'.format(
            util.md5_object(bytes().join(e._bytes()
                                         for e in self.entities)),
            self.vertices.md5())

        return target
122065
def get_md5(self, filename):
        
        with open(filename, 'rb') as f:
            m = hashlib.md5(f.read())
        return m.hexdigest()
724427
def meta_data_hash(self, obj_hash=None):
        
        if obj_hash is None:
            obj_hash = hashlib.sha256()
        self.update_meta_data_hash(obj_hash)
        return obj_hash
1253007
def file_md5(self, file_name):
        """"""
        with open(file_name, "rb") as f:
            file_contents = f.read()
            file_hash = hashlib.md5(file_contents).hexdigest()
        return file_hash
797130
def Md5(depends_on, encoder=ENC_STR_DEFAULT, fuzzable=False, name=None):
    '''
    
    '''
    return Hash(depends_on=depends_on, algorithm='md5', encoder=encoder, fuzzable=fuzzable, name=name)
799059
def source_get(method_name):
    

    def source_get(_value, context, **_params):
        method = getattr(context["model"].source, method_name)
        return _get(method, context["key"], (), {})

    return source_get
993498
def get_cache_key(self, offset=0, limit=0, order=None, post_slug=''):
        
        return hashlib.sha1(
            '.'.join([
                str(self._get_data_source_url()),
                str(offset),
                str(limit),
                str(order),
                str(post_slug),
                ])
        ).hexdigest()
229616
def _create_md5_dict(self):
        
        self.sbo_md5 = {}
        md5_lists = SBoGrep(self.prgnam).checksum()
        for src, md5 in zip(self.sources, md5_lists):
            self.sbo_md5[src] = md5