Initializes from user specified dictionary.

    Args:
      dictionary: dict of user specified attributes
    Returns:
      GitkitUser object
178822
def FromDictionary(cls, dictionary):
    
    if 'user_id' in dictionary:
      raise errors.GitkitClientError('use localId instead')
    if 'localId' not in dictionary:
      raise errors.GitkitClientError('must specify localId')
    if 'email' not in dictionary:
      raise errors.GitkitClientError('must specify email')

    return cls(decode=False, **dictionary)
506617
@Initialize
    public void init() {
        logger.info("Initializing dictionary: {}", this);
        Datastore datastore = getDatastore();
        DatastoreConnection dataContextProvider = datastore.openConnection();
        getDatastoreConnections().add(dataContextProvider);
    }
1255374
async def init(self) -> None:
        ''''''

        if self.data:
            return

        if self.json_data:
            try:
                self.data = json.loads(self.json_data)

            except Exception:
                Log.exception('Falied to load raw configuration')

        else:
            try:
                with open(self.json_path, 'r') as f:
                    self.data = json.load(f)

            except Exception:
                Log.exception('Failed to load configuration from %s',
                              self.json_path)
                self.data = {}
281884
def init(self, app):
        
        cfg = app.config
        self.welcome_message = cfg.get('USER_SEND_WELCOME_MESSAGE')
        self.require_confirmation = cfg.get(
            'USER_ACCOUNTS_REQUIRE_CONFIRMATION'
        )

        subjects = cfg.get('USER_EMAIL_SUBJECTS')
        self.email_subjects = subjects if subjects else dict()

        self.jwt_secret = cfg.get('USER_JWT_SECRET')
        self.jwt_algo = cfg.get('USER_JWT_ALGO')
        self.jwt_lifetime = cfg.get('USER_JWT_LIFETIME_SECONDS')
        self.jwt_implementation = cfg.get('USER_JWT_IMPLEMENTATION')
        self.jwt_loader_implementation = cfg.get(
            'USER_JWT_LOADER_IMPLEMENTATION'
        )
239672
public void init(Path configFile) {
        String abspath = configFile.toAbsolutePath().toString();
        System.out.println("initialize user dictionary:" + abspath);
        synchronized (WordDictionary.class) {
            if (loadedPath.contains(abspath))
                return;
            
            DirectoryStream<Path> stream;
            try {
                stream = Files.newDirectoryStream(configFile, String.format(Locale.getDefault(), "*%s", USER_DICT_SUFFIX));
                for (Path path: stream){
                    System.err.println(String.format(Locale.getDefault(), "loading dict %s", path.toString()));
                    singleton.loadUserDict(path);
                }
                loadedPath.add(abspath);
            } catch (IOException e) {
                // TODO Auto-generated catch block
                // e.printStackTrace();
                System.err.println(String.format(Locale.getDefault(), "%s: load user dict failure!", configFile.toString()));
            }
        }
    }
126759
def init():
    
    global _INITIALIZED

    if _INITIALIZED:
        return

    global KW_DICT
    global KEYWORDS
    global KW_CACHE_PATH
    global KEYWORDS_LOWER

    KW_DICT = build_kw_dict(read_kw_file())
    KEYWORDS = sorted([k.decode("utf-8") for k in KW_DICT.keys()])
    KEYWORDS_LOWER = {
        k.lower(): k
        for k in KEYWORDS
    }
    keywords_json = json.dumps(KEYWORDS)
    KW_CACHE_PATH = "/tmp/wa_kat_cache_keywords.json"

    # create cached files
    with open(KW_CACHE_PATH, "w") as f:
        f.write(keywords_json)
    with open(KW_CACHE_PATH + ".gz", "w") as f:
        to_gzipped_file(keywords_json, out=f)

    _INITIALIZED = True
911381
def get_initial(self, *args, **kwargs):
        
        initial = {}
        for field in self.fields:
            value = None
            if hasattr(self.user, field):
                value = getattr(self.user, field)
            if hasattr(self.profile, field):
                value = getattr(self.profile, field)
            if value:
                initial.update({
                    field: value
                })

        if hasattr(self.profile, 'dob'):
            dob = self.profile.dob
            if dob:
                if 'dob_day' in self.fields:
                    initial.update({
                        'dob_day': dob.day
                    })
                if 'dob_month' in self.fields:
                    initial.update({
                        'dob_month': dob.month
                    })
                if 'dob_year' in self.fields:
                    initial.update({
                        'dob_year': dob.year
                    })

        return initial
1286211
def init_git_pillar(opts):
    '''
    
    '''
    ret = []
    for opts_dict in [x for x in opts.get('ext_pillar', [])]:
        if 'git' in opts_dict:
            try:
                pillar = salt.utils.gitfs.GitPillar(
                    opts,
                    opts_dict['git'],
                    per_remote_overrides=git_pillar.PER_REMOTE_OVERRIDES,
                    per_remote_only=git_pillar.PER_REMOTE_ONLY,
                    global_only=git_pillar.GLOBAL_ONLY)
                ret.append(pillar)
            except salt.exceptions.FileserverConfigError:
                if opts.get('git_pillar_verify_config', True):
                    raise
                else:
                    log.critical('Could not initialize git_pillar')
    return ret
943132
def vis_init(self):
        '''
        
        '''
        init_dict = {}
        init_dict['kind'] = 'init'
        assert len(self.want_file_pos) == len(self.heads_and_tails)
        init_dict['want_file_pos'] = self.want_file_pos
        init_dict['files'] = self.file_list
        init_dict['heads_and_tails'] = self.heads_and_tails
        init_dict['num_pieces'] = self.num_pieces
        self.broadcast(init_dict)
608507
def register(self, key, initializer: callable, param=None):
        ''''''
        if not callable(initializer):
            raise DependencyError('Initializer {0} is not callable'.format(initializer))
        if key not in self._initializers:
            self._initializers[key] = {}
        self._initializers[key][param] = initializer
892471
def fromdict(dict):
        
        index = dict['index']
        seed = hb_decode(dict['seed'])
        n = dict['n']
        root = hb_decode(dict['root'])
        hmac = hb_decode(dict['hmac'])
        timestamp = dict['timestamp']
        self = State(index, seed, n, root, hmac, timestamp)
        return self
326266
def initialize(self, *args):
        
        # number of observed users
        self.n_user = 0

        # store user data
        self.users = {}

        # number of observed items
        self.n_item = 0

        # store item data
        self.items = {}
152923
def prj_create_user(self, *args, **kwargs):
        
        if not self.cur_prj:
            return
        user = self.create_user(projects=[self.cur_prj])
        if user:
            userdata = djitemdata.UserItemData(user)
            treemodel.TreeItem(userdata, self.prj_user_model.root)
979085
def copy_from_dict(self, adict, parent=None):
        
        if not parent:
            parent = self
        for k,v in adict.items():
            if isinstance(v, dict):
                vDict = PYConf(v)
                self.copy_from_dict(v, vDict)
                parent[k] = vDict
            else:
                parent[k] = v
860290
def _set_attributes(self):
        
        # turn config dict into nested objects
        config = obj(self._config_dict)
        # set the attributes onto instance
        for k, v in self._config_dict.items():
            setattr(self, k, getattr(config, k))
510417
public GitkitUser updateUser(GitkitUser user)
      throws GitkitClientException, GitkitServerException {
    try {
      return jsonToUser(rpcHelper.updateAccount(user));
    } catch (JSONException e) {
      throw new GitkitServerException(e);
    }
  }
958701
def __do_init(self, dat_dict):
        
        for k, v in dat_dict.items():
            if isinstance(v, dict):
                self.cfg.init(k, v['val'], v['proto'])
            else:
                self.cfg.init(k, v)
        self.cfg.sync()