set a group name base on the hash across all group instructions and fields
160843
private synchronized void name(InstructionGroup group, ParserClassNode classNode) {
        // generate an MD5 hash across the buffer, use only the first 96 bit
        MD5Digester digester = new MD5Digester(classNode.name);
        group.getInstructions().accept(digester);
        for (FieldNode field: group.getFields()) digester.visitField(field);
        byte[] hash = digester.getMD5Hash();
        byte[] hash96 = new byte[12];
        System.arraycopy(hash, 0, hash96, 0, 12);

        // generate a name for the group based on the hash
        String name = group.getRoot().isActionRoot() ? "Action$" : "VarInit$";
        name += CUSTOM_BASE64.encodeToString(hash96, false);
        group.setName(name);
    }
354385
def hset(self, key, field, value):
        """"""
        return self.execute(b'HSET', key, field, value)
831678
def cli(ctx, group_id, new_name):
    
    return ctx.gi.groups.update_group(group_id, new_name)
1169730
def resolve_name(target)
      if (group = @group_lookup[target])
        group.node_names
      else
        # Try to wildcard match nodes in inventory
        # Ignore case because hostnames are generally case-insensitive
        regexp = Regexp.new("^#{Regexp.escape(target).gsub('\*', '.*?')}$", Regexp::IGNORECASE)

        nodes = @groups.node_names.select { |node| node =~ regexp }
        nodes += @groups.node_aliases.select { |target_alias, _node| target_alias =~ regexp }.values

        if nodes.empty?
          raise(WildcardError, target) if target.include?('*')
          [target]
        else
          nodes
        end
      end
    end
534688
function _setFileName($id, $group)
    {
        
        if ($this->_fileNameProtection) {
            $suffix = 'cache_'.md5($group).'_'.md5($id);
        } else {
            $suffix = 'cache_'.$group.'_'.$id;
        }
        $root = $this->_cacheDir;
        if ($this->_hashedDirectoryLevel>0) {
            $hash = md5($suffix);
            for ($i=0 ; $i<$this->_hashedDirectoryLevel ; $i++) {
                $root = $root . 'cache_' . substr($hash, 0, $i + 1) . '/';
            }   
        }
        $this->_fileName = $suffix;
        $this->_file = $root.$suffix;
    }
254878
def set_monitoring_transaction_name(name, group=None, priority=None):
    
    if not newrelic:
        return
    newrelic.agent.set_transaction_name(name, group, priority)
459098
def create_record_set_group(self, name, g_dict):
        """"""
        rs = route53.RecordSetGroup.from_dict(name, g_dict)
        rs = add_hosted_zone_id_if_missing(rs, self.hosted_zone_id)
        rs = self.add_hosted_zone_id_for_alias_target_if_missing(rs)
        return self.template.add_resource(rs)
542059
def set_id(self, id='$'):
        
        accum = {}
        for key in self.keys:
            accum[key] = self.database.xgroup_setid(key, self.name, id)
        return accum
770426
def resp_set_group(self, resp, group=None):
        
        if group:
            self.group=group
        elif resp:
            self.group=resp.label.decode().replace("\x00", "")
1221305
def index_field(self, index=Index()):
        
        # Set field index
        # Note: Updates the field alignment offset as well
        self.index = index

        # Bit offset for the next field
        byte, bit, address, base, update = index
        bit += self.bit_size

        # Field group size
        group_size, offset = divmod(bit, 8)

        # End of field group?
        if self.alignment.byte_size == group_size:
            # Bad aligned field group?
            if offset is not 0:
                raise FieldGroupSizeError(self, index,
                                          Alignment(group_size + 1,
                                                    self.alignment.bit_offset))
            else:
                # Move byte index for the next field group
                byte += self.alignment.byte_size
                # Reset bit offset for the next field group
                bit = 0
                # Move address for the next field group
                address += self.alignment.byte_size
        # Index for the next field
        return Index(byte, bit, address, base, update)
279232
def create_or_update_groups(self):
        

        for name in self.group_names:
            try:
                Group.objects.get(name=name)
            except ObjectDoesNotExist:
                Group.objects.create(name=name)
        Group.objects.exclude(name__in=self.group_names).delete()

        if self.verbose:
            names = [obj.name for obj in Group.objects.all().order_by("name")]
            sys.stdout.write(f"  Groups are: {', '.join(names)}\n")
1307285
def xack(self, name, groupname, *ids):
        
        return self.execute_command('XACK', name, groupname, *ids)
1364775
def define_group_reader(group_name)
      class_eval <<-EOT, __FILE__, __LINE__ + 1
      def #{group_name}_group_messages          # def base_group_messages
        @error_messages[:#{group_name}]         #   @error_messages[:base]
      end                                       # end

      def #{group_name}_group_name              # def base_group_name
        @group_names[:#{group_name}]            #   @group_names[:base]
      end                                       # end
      EOT
    end
1245197
def set_attrs(hash, clobber = true, target = nil)
      target ||= @attrs
      if clobber
        target.merge!(hash)
        hash
      else
        hash.each do |k, v|
          if v.is_a?(Hash)
            set_attrs(v, clobber, target[k])
          else
            target[k] = v
          end
        end
      end
    end
659983
def prepare_regions_hash(rdo)
      res = {}
      rdo.each do |region|
        region.dealers.each do |dealer|
          dealer.offices.each do |office|
            if res[region.id].nil?
              res[region.id] = { id:region.id, title:region.title }
            else
              break
            end
          end
        end
      end
      res
    end
852495
def group(prefix, name, options = {})
      subtree = self.class.new
      yield(subtree) if block_given?

      merge(subtree, prefix, name, options)
    end
511272
def rename_group(self, group, newname):
        

        if isinstance(group, basestring):
            group = self.get_contact(group)

        method, url = get_URL('group_update')

        payload = {
            'apikey': self.config.get('apikey'),
            'logintoken': self.session.cookies.get('logintoken'),
            'contactgroupid': group['contactgroupid'],
            'name': newname
            }

        res = getattr(self.session, method)(url, params=payload)

        if res.status_code == 200:
            return True

        hellraiser(res)