Creates a Hash of AccountTracker objects, indexed by account name
967994
def create_trackers
      @trackers = Hash.new
      @accounts.each do |name, account|
        @log.debug "Setting up tracker for account #{name}"
        @trackers[name] = AccountTracker.new(name, account, {
            :delay => @delay, :error_callback => @error_proc, :logger => @log,
            :callback => Proc.new do |resources|
              # attach a QueryProcessor to all returned resources
              qp = FogTracker::Query::QueryProcessor.new(@trackers, :logger => @log)
              resources.each {|resource| resource._query_processor = qp}
              # now relay the resources back to the client software
              @callback.call(resources) if @callback
            end
          }
        )
      end
    end
540261
def get_by_name_from(self, root: Account, name: str) -> List[Account]:
        
        result = []

        if root.name == name:
            result.append(root)

        for child in root.children:
            child_results = self.get_by_name_from(child, name)
            result += child_results

        return result
560290
def listaccounts(ctx):
    
    t = PrettyTable(["Name", "Key", "Owner", "Active", "Memo"])
    for key in ctx.blockchain.wallet.getPublicKeys(True):
        for account in ctx.blockchain.wallet.getAccountsFromPublicKey(key):
            account = Account(account)
            is_owner = key in [x[0] for x in account["owner"]["key_auths"]]
            is_active = key in [x[0] for x in account["active"]["key_auths"]]
            is_memo = key == account["options"]["memo_key"]
            t.add_row(
                [
                    account["name"],
                    key,
                    "x" if is_owner else "",
                    "x" if is_active else "",
                    "x" if is_memo else "",
                ]
            )
    click.echo(t)
655054
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["id"] = id
            index_hash["account_id"] = account_id
            index_hash["asm_id"] = asm_id
            index_hash["org_id"] = org_id
            index_hash["disk_id"] = disk_id
            index_hash["size"] = size
            index_hash["status"] = status
            index_hash["created_at"] = created_at
            index_hash["some_msg"] = some_msg
            index_hash
        end
839412
def tracked_types
      types = connection.collections - (account[:exclude_resources] || [])
      types.map {|type| type.to_s}
    end
507883
def AddHashEntry(self, hash_entry, timestamp):
    """"""

    if timestamp in self._hash_entries:
      message = ("Duplicated hash entry write for path '%s' of type '%s' at "
                 "timestamp '%s'. Old: %s. New: %s.")
      message %= ("/".join(self._components), self._path_type, timestamp,
                  self._hash_entries[timestamp], hash_entry)
      raise db.Error(message)

    if timestamp not in self._path_infos:
      path_info = rdf_objects.PathInfo(
          path_type=self._path_type,
          components=self._components,
          timestamp=timestamp,
          hash_entry=hash_entry)
      self.AddPathInfo(path_info)
    else:
      self._path_infos[timestamp].hash_entry = hash_entry
1206869
def _buildPredicateHash(self, subject):  # XXX unmodified
        
        properties = {}
        for s, p, o in self.store.triples((subject, None, None)):
            oList = properties.get(p, [])
            oList.append(o)
            properties[p] = oList

        return properties
717913
def all_accounts
      all = []
      single_proxy("LIST_ACCOUNTS", {}, nil, true).each do |account|
        all << account
        sub_accounts = single_proxy("GET_SUB_ACCOUNTS_OF_ACCOUNT",
                             {
                                account_id: account["id"],
                                recursive: true,
                             },
                             nil,
                             true)
        all = all.concat(sub_accounts)
      end
      all
    end
175425
def [](name)
      name = name.to_s
      entries.detect { |entry| entry.name.to_s == name }
    end
1313750
def search(self, account_name):
        
        accounts = self.list()
        for a in accounts:
            if a['name'] == account_name:
                return a['id']
1204580
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["id"] = id
            index_hash["org_id"] = org_id
            index_hash["name"] = name
            index_hash["accounts_id"] = accounts_id
            index_hash["inputs"] = inputs
            index_hash["assemblies"] = assemblies
            index_hash["created_at"] = created_at
            index_hash["some_msg"] = some_msg
            index_hash
        end
1151827
def to_hash
            index_hash = {}
            index_hash['json_claz'] = self.class.name
            index_hash['id'] = id
            index_hash['org_id'] = org_id
            index_hash["account_id"] = account_id
            index_hash['name'] = name
            index_hash['repos'] = repos
            index_hash['status'] = status
            index_hash['inputs'] = inputs
            index_hash['created_at'] = created_at
            index_hash['updated_at'] = updated_at
            index_hash
        end
412212
def scope_to_hash(keys_case=:underscore)
				return {
					get_attribute_key('account_ids', keys_case) => {"ins0:long" => object_to_hash(scope[:account_ids], keys_case)},
					get_attribute_key('campaigns', keys_case) => 
						{ "CampaignReportScope" => object_to_hash(scope[:campaigns], keys_case) }
					}
			end
478214
def to_hash
            index_hash = Hash.new
            index_hash["json_claz"] = self.class.name
            index_hash["id"] = id
            index_hash["name"] = name
            index_hash["org_id"] = org_id
            index_hash["privatekey"] = privatekey
            index_hash["publickey"] = publickey
            index_hash["created_at"] = created_at
            index_hash
        end
53150
def accounts_spec(self):
        """"""
        formatted_account_id = formatted(valid_account_id(), MergedOptionStringFormatter, expected_type=string_types)
        return dictof(string_spec(), formatted_account_id)
770405
def to_hash
      index_hash = Hash.new
      index_hash["json_claz"] = self.class.name
      index_hash["id"] = id
      index_hash["name"] = name
      index_hash["accounts_id"] = accounts_id
      index_hash["related_orgs"] = related_orgs
      index_hash["created_at"] = created_at
      index_hash
    end
600696
def load_trackers
      tracker_hits_per_path_hashes = tracker_files.map do |full_path|
        JSON.parse(full_path.binread).transform_keys(&:to_sym).yield_self do |version:, tracker_hits_per_path:|
          raise "dump version mismatch: #{version}, currently #{VERSION}" unless version == VERSION
          tracker_hits_per_path
        end
      end

      self.class.merge_tracker_hits_per_paths(*tracker_hits_per_path_hashes)
    end