creates a statment hash that contains default values for creating an impression.
979233
def direct_create_statement(query_params={},impressionable=nil)
      query_params.reverse_merge!(
        :impressionable_type => controller_name.singularize.camelize,
        :impressionable_id => impressionable.present? ? impressionable.id : params[:id]
        )
      associative_create_statement(query_params)
    end
647861
def __add_default_values(self):
        
        self.__sp.setdefault('assertionConsumerService', {})
        self.__sp['assertionConsumerService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_POST)

        self.__sp.setdefault('attributeConsumingService', {})

        self.__sp.setdefault('singleLogoutService', {})
        self.__sp['singleLogoutService'].setdefault('binding', OneLogin_Saml2_Constants.BINDING_HTTP_REDIRECT)

        # Related to nameID
        self.__sp.setdefault('NameIDFormat', OneLogin_Saml2_Constants.NAMEID_UNSPECIFIED)
        self.__security.setdefault('nameIdEncrypted', False)

        # Metadata format
        self.__security.setdefault('metadataValidUntil', None)  # None means use default
        self.__security.setdefault('metadataCacheDuration', None)  # None means use default

        # Sign provided
        self.__security.setdefault('authnRequestsSigned', False)
        self.__security.setdefault('logoutRequestSigned', False)
        self.__security.setdefault('logoutResponseSigned', False)
        self.__security.setdefault('signMetadata', False)

        # Sign expected
        self.__security.setdefault('wantMessagesSigned', False)
        self.__security.setdefault('wantAssertionsSigned', False)

        # NameID element expected
        self.__security.setdefault('wantNameId', True)

        # SAML responses with a InResponseTo attribute not rejected when requestId not passed
        self.__security.setdefault('rejectUnsolicitedResponsesWithInResponseTo', False)

        # Encrypt expected
        self.__security.setdefault('wantAssertionsEncrypted', False)
        self.__security.setdefault('wantNameIdEncrypted', False)

        # Signature Algorithm
        self.__security.setdefault('signatureAlgorithm', OneLogin_Saml2_Constants.RSA_SHA1)

        # Digest Algorithm
        self.__security.setdefault('digestAlgorithm', OneLogin_Saml2_Constants.SHA1)

        # AttributeStatement required by default
        self.__security.setdefault('wantAttributeStatement', True)

        self.__idp.setdefault('x509cert', '')
        self.__idp.setdefault('certFingerprint', '')
        self.__idp.setdefault('certFingerprintAlgorithm', 'sha1')

        self.__sp.setdefault('x509cert', '')
        self.__sp.setdefault('privateKey', '')

        self.__security.setdefault('requestedAuthnContext', True)
        self.__security.setdefault('failOnAuthnContextMismatch', False)
1234037
def set_defaults
      # Some UIDs should not be remapped even if uid anonymization has been requested:
      @static_uids = {
        # Private related:
        '0002,0100' => true,
        '0004,1432' => true,
        # Coding scheme related:
        '0008,010C' => true,
        '0008,010D' => true,
        # Transfer syntax related:
        '0002,0010' => true,
        '0400,0010' => true,
        '0400,0510' => true,
        '0004,1512' => true,
        # SOP class related:
        '0000,0002' => true,
        '0000,0003' => true,
        '0002,0002' => true,
        '0004,1510' => true,
        '0004,151A' => true,
        '0008,0016' => true,
        '0008,001A' => true,
        '0008,001B' => true,
        '0008,0062' => true,
        '0008,1150' => true,
        '0008,115A' => true
      }
      # Sets up default tags that will be anonymized, along with default replacement values and enumeration settings.
      # This data is stored in 3 separate instance arrays for tags, values and enumeration.
      data = [
        ['0008,0012', '20000101', false], # Instance Creation Date
        ['0008,0013', '000000.00', false], # Instance Creation Time
        ['0008,0020', '20000101', false], # Study Date
        ['0008,0021', '20000101', false], # Series Date
        ['0008,0022', '20000101', false], # Acquisition Date
        ['0008,0023', '20000101', false], # Image Date
        ['0008,0030', '000000.00', false], # Study Time
        ['0008,0031', '000000.00', false], # Series Time
        ['0008,0032', '000000.00', false], # Acquisition Time
        ['0008,0033', '000000.00', false], # Image Time
        ['0008,0050', '', true], # Accession Number
        ['0008,0080', 'Institution', true], # Institution name
        ['0008,0081', 'Address', true], # Institution Address
        ['0008,0090', 'Physician', true], # Referring Physician's name
        ['0008,1010', 'Station', true], # Station name
        ['0008,1040', 'Department', true], # Institutional Department name
        ['0008,1070', 'Operator', true], # Operator's Name
        ['0010,0010', 'Patient', true], # Patient's name
        ['0010,0020', 'ID', true], # Patient's ID
        ['0010,0030', '20000101', false], # Patient's Birth Date
        ['0010,0040', 'O', false], # Patient's Sex
        ['0010,1010', '', false], # Patient's Age
        ['0020,4000', '', false], # Image Comments
      ].transpose
      @tags = data[0]
      @values = data[1]
      @enumerations = data[2]
      # Tags to be deleted completely during anonymization:
      @delete = Hash.new
    end
890206
def hash_default(_, key)
      if @default != nil
        value = @default.respond_to?(:call) ? @default.call(key) : @default
        @journal << [key, value]
        @table[key] = value
      end
    end
1123515
def indifferent_hash
      Hash.new {|hash,key| hash[key.to_s] if Symbol === key }
    end
315916
def symbolize_keys hsh
      new_hsh = Hash.new
      
      hsh.each_pair do |k,v|
        v = symbolize_keys v if v.is_a?(Hash)
        new_hsh[k.downcase.to_sym] = v
      end
      
      new_hsh
    end
376490
public static function createDefault(): self
    {
        return new self([
            new Type("any", "[^/]+"),
            new Type("alnum", "[a-zA-Z0-9]+"),
            new Type("alpha", "[a-zA-Z]+"),
            new Type("date", "\d{4}-\d{2}-\d{2}"),
            new Type("digit", "\d"),
            new Type("number", "\d+"),
            new Type("word", "\w+"),
        ]);
    }
547171
def symbolize_hash(hash)
      return hash unless hash.is_a?(Hash)

      hash.inject({}){ |memo,(key,value)| memo[key.to_sym] = symbolize_hash(value); memo }
    end
979972
def create_hash(self, initial, capacity, error):
        
        self.hash = 0
        self.hashbits, self.num_hashes = self._optimal_size(capacity, error)

        if len(initial):
            if type(initial) == str:
                self.add(initial)
            else:
                for t in initial:
                    self.add(t)
679954
def symbolize_hash_keys(hash)
      hash.inject({}) do |new_hash, (key, value)|
        new_hash[(key.to_sym rescue key) || key] = value
        new_hash
      end
      hash
    end
294497
def generate_by_hash(hashcode):
    """"""
    img = Image.new(IMAGE_MODE, IMAGE_SIZE, BACKGROUND_COLOR)
    if len(hashcode) < 32:
        print ("hashcode must have lenght >= 32, %s" % hashcode)
        raise FalseHashError

    allowed = "0123456789abcdef"
    hashcheck = [c in allowed for c in hashcode]
    if False in hashcheck:
        print ("hashcode has not allowed structure %s" % hashcode)
        raise FalseHashError

    pixelmap = setup_pixelmap(hashcode)
    draw_image(pixelmap, img)
    return img
218155
def to_default
      default = {}
      each_pair do |key, config|
        default[key] = config.default
      end
      default
    end
658965
function init() {
    var stateFromHash = getStateFromHash();
    var stateChanged = false;

    if (typeof defaults === 'object' && defaults) {
      Object.keys(defaults).forEach(function(key) {
        if (key in stateFromHash) return;

        stateFromHash[key] = defaults[key]
        stateChanged = true;
      });
    }

    if (stateChanged) set(stateFromHash);
  }
1170958
def to_hash
      characteristics.inject({}) do |memo, (k, v)|
        memo[k] = v.value
        memo
      end
    end
1228810
def create_record(attribute_names = @attributes.keys)
      record_timestamps_hardcoded
      attributes_values = self.changes.values.map(&:last)

      row_hash = Hash[ [ self.changes.keys, attributes_values ].transpose ]
      new_id =  SecureRandom.hex
      @rows =   {"rows"=> [{
                            "insertId"=> Time.now.to_i.to_s,
                            "json"=> row_hash.merge("id"=> new_id)
                          }]
                }
      conn_cfg = self.class.connection_config
      result = BigBroda::TableData.create(conn_cfg[:project],
        conn_cfg[:database],
        self.class.table_name ,
        @rows )

      #raise result["error"]["errors"].map{|o| "[#{o['domain']}]: #{o['reason']} #{o['message']}" }.join(", ") if result["error"].present?
      #here we output the IN MEMORY id , because of the BQ latency
      self.id = new_id #||= new_id if self.class.primary_key

      @new_record = false
      id
    end
457958
def flat_hash(hash, keys = [])
      new_hash = {}

      hash.each do |key, val|
        new_hash[format_key(keys + [key])] = val unless
          val.is_a?(Array) || val.is_a?(Hash)
        new_hash.merge!(flat_hash(val, keys + [key])) if val.is_a? Hash

        if val.is_a? Array
          val.each do |v|
            if v.is_a? Hash
              new_hash.merge!(flat_hash(v, keys + [key])) do |key, f, s|
                Array(f) << s
              end
            else
              formatted_key = format_key(keys + [key])
              new_hash[formatted_key] =
                new_hash[formatted_key] ? (Array(new_hash[formatted_key]) << v) : v
            end
          end
        end
      end

      new_hash
    end
561564
def generate_default_schema(output):
    """"""
    original_path = os.path.join(os.path.dirname(__file__),
                                 'data',
                                 'randomnames-schema.json')
    shutil.copyfile(original_path, output)