The userdata for when starting an instance from a created AMI.
776972
function getUserdataForAmi_(username, upNamespace, envVars_, origUsername) {
  var envVars = cleanEnvVars(upNamespace, envVars_);

  var script  = [
                "#!/bin/bash -ex",
                ""
  ];
  _.each(envVars, function(value, key) {
    script.push("/usr/local/bin/yoshi-set-env "+key+" "+value);
  });
  script.push(  "");

  console.error(script);
  return script;
}
668219
def store_user_data(user=None, group=None,data_kind=DINGOS_USER_DATA_TYPE_NAME,user_data=None,iobject_name=None):
        

        if not user_data:
            user_data = {}

        if not user.is_authenticated():
            user = None

        user_config,created =  UserData.objects.get_or_create(user=user,group=group,data_kind=data_kind)
        return user_config.store(user_data,iobject_type_name=data_kind,iobject_name=iobject_name)
743763
def prepare(self):
        
        # Maybe the Brok is a old daemon one or was already prepared
        # if so, the data is already ok
        if hasattr(self, 'prepared') and not self.prepared:
            self.data = unserialize(self.data)
            if self.instance_id:
                self.data['instance_id'] = self.instance_id
        self.prepared = True
437305
public static void main(final String[] args) {
        /*-
         * use one of the pre-defined amis
         * (all amis are pre-defined in aws-mock-default.properties or aws-mock.properties)
         */
        String imageId = "ami-12345678";
        final int runCount = 10;

        List<Instance> startedInstances = runInstances(imageId, runCount);

        System.out.println("Started instances: ");

        for (Instance i : startedInstances) {
            System.out.println(i.getInstanceId() + " - " + i.getState().getName());
        }
    }
164711
def _post_init(self):
        
        if not hasattr(self, '_buffer'):
            # only set _buffer if model was not specified in the __init__
            self._buffer = TreeBuffer()
        self.read_branches_on_demand = False
        self._branch_cache = {}
        self._current_entry = 0
        self._always_read = []
        self.userdata = UserData()
        self._inited = True
1233262
void setInitializationData(Bundle contributingBundle, ServiceReference<?> urlConverterSR) {
		if (this.contributingBundle != null || this.urlConverterSR != null) {
			throw new IllegalStateException();
		}
		this.contributingBundle = contributingBundle;
		this.urlConverterSR = urlConverterSR;
	}
941201
public function buildData()
    {
        $token = $this->security->getToken();
        $user  = $token->getUser();

        if ($user instanceof UserInterface) {
            $user = $user->getUsername();
        }

        $tokenClass = is_object($token) ? get_class($token) : 'N/A';
        $userClass  = is_object($token->getUser()) ? get_class($token->getUser()) : 'N/A';

        $this->data = [
            'token'      => $token,
            'tokenClass' => $tokenClass,
            'user'       => $user,
            'userClass'  => $userClass
        ];
    }
979222
def init_user():
    
    if not os.path.exists(USER_CONFIG_DIR):
        if rapport.config.get_int("rapport", "verbosity") >= 1:
            print("Create user directory {0}".format(USER_CONFIG_DIR))
        os.makedirs(USER_CONFIG_DIR)
    for subdir in ["plugins", "reports", "templates/plugin", "templates/email", "templates/web"]:
        user_conf_subdir = os.path.join(USER_CONFIG_DIR, subdir)
        if not os.path.exists(user_conf_subdir):
            if rapport.config.get_int("rapport", "verbosity") >= 1:
                print("Create user directory {0}".format(user_conf_subdir))
            os.makedirs(user_conf_subdir)
        if subdir == "reports" and not (os.stat(user_conf_subdir).st_mode & 0o777) == 0o700:
            if rapport.config.get_int("rapport", "verbosity") >= 1:
                print("Set secure directory permissions for {0}".format(user_conf_subdir))
            os.chmod(user_conf_subdir, 0o700)
    if not os.path.exists(USER_CONFIG_FILE):
        if rapport.config.get_int("rapport", "verbosity") >= 1:
            print("Create user configuration {0}".format(USER_CONFIG_FILE))
        default_config = os.path.abspath(os.path.join(os.path.splitext(__file__)[0], "rapport.conf"))
        shutil.copyfile(default_config, USER_CONFIG_FILE)

    if not (os.stat(USER_CONFIG_FILE).st_mode & 0o777) == 0o600:
        if rapport.config.get_int("rapport", "verbosity") >= 1:
            print("Set secure file permissions for {0}".format(USER_CONFIG_FILE))
        os.chmod(USER_CONFIG_FILE, 0o600)
543522
private function initUserData() {
		$this->user_data[ $this->cache_key ] = (object) [
			'continent'   => new \StdClass(),
			'country'     => new \StdClass(),
			'state'       => new \StdClass(),
			'city'        => new \StdClass(),
			'geolocation' => new \StdClass(),
		];
	}
123888
def get_context_data(cls, instance):
        '''
        
        '''

        context_engine_id = None
        context_name = ''

        if "user" in instance:
            if 'context_engine_id' in instance:
                context_engine_id = OctetString(instance['context_engine_id'])
            if 'context_name' in instance:
                context_name = instance['context_name']

        return context_engine_id, context_name
1096563
def get_user_data(self, subid, params=None):
        ''' 
        '''
        params = update_params(params, {'SUBID': subid})
        return self.request('/v1/server/get_user_data', params, 'GET')
1172476
protected void initAcceptData() {

        // read the current users agreement values
        CmsUser user = getCms().getRequestContext().getCurrentUser();
        String result = (String)user.getAdditionalInfo(CmsUserSettings.LOGIN_USERAGREEMENT_ACCEPTED);
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(result)) {
            // read JSON data structure that is stored in the user additional info
            try {
                JSONObject jsonData = new JSONObject(result);
                m_acceptedVersion = jsonData.getDouble(KEY_ACCEPTED_VERSION);
                m_acceptedCount = jsonData.getInt(KEY_ACCEPTED_COUNT);
            } catch (JSONException e) {
                LOG.error(e);
            }
        }
    }
1073415
private void initializeData(ULocale locale)
    {
        String key = locale.toString();
        DateIntervalInfo dii = DIICACHE.get(key);
        if ( dii == null ) {
            // initialize data from scratch
            setup(locale);
            // Marking fIntervalPatterns read-only makes cloning cheaper.
            fIntervalPatternsReadOnly = true;
            // We freeze what goes in the cache without freezing this object.
            DIICACHE.put(key, ((DateIntervalInfo) clone()).freeze());
        } else {
            initializeFromReadOnlyPatterns(dii);
        }
    }
397965
def _loadData(self, data):
        
        self._data = data
        self.id = utils.cast(int, data.attrib.get('id'))
        self.serverId = utils.cast(int, data.attrib.get('serverId'))
        self.machineIdentifier = data.attrib.get('machineIdentifier')
        self.name = data.attrib.get('name')
        self.lastSeenAt = utils.toDatetime(data.attrib.get('lastSeenAt'))
        self.numLibraries = utils.cast(int, data.attrib.get('numLibraries'))
        self.allLibraries = utils.cast(bool, data.attrib.get('allLibraries'))
        self.owned = utils.cast(bool, data.attrib.get('owned'))
        self.pending = utils.cast(bool, data.attrib.get('pending'))
1189133
async def get_user_data(self):
        """"""
        userdata = {}
        sessions = self.session_data.get('sessions', {})
        try:
            async with async_timeout.timeout(8, loop=self._loop):
                for username in self.tautulli_users:
                    userdata[username] = {}
                    userdata[username]['Activity'] = None
                    for session in sessions:
                        if session['username'].lower() == username.lower():
                            userdata[username]['Activity'] = session['state']
                            for key in session:
                                if key != 'Username':
                                    userdata[username][key] = session[key]
                            break

            self.tautulli_user_data = userdata
        except (asyncio.TimeoutError, aiohttp.ClientError, KeyError):
            msg = "Can not load data from Tautulli."
            logger(msg, 40)
687908
def _initialize(self):
        """"""

        payload = {
            'apikey': self.session.cookies.get('apikey'),
            'source': self.session.cookies.get('source')
            }

        if self.fm_user.logged_in:
            payload['logintoken'] = self.session.cookies.get('logintoken')

        payload.update(self.transfer_info)

        method, url = get_URL('init')

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

        if res.status_code == 200:
            for key in ['transferid', 'transferkey', 'transferurl']:
                self.transfer_info[key] = res.json().get(key)

        else:
            hellraiser(res)
87787
public void create() {
        RunInstancesRequest runInstancesRequest =
                        new RunInstancesRequest().withImageId(amiId).withInstanceType(size).withKeyName(keyPair)
                                        .withMinCount(1).withSecurityGroupIds(securityGroupId).withMaxCount(numBoxes);
        AmazonEC2 ec2 = getEc2();
        ec2.setRegion(com.amazonaws.regions.Region.getRegion(regions));
        List<Instance> boxes = ec2.runInstances(runInstancesRequest).getReservation().getInstances();
        if (boxesCreated == null) {
            boxesCreated = new ArrayList<>();
            for (Instance i : boxes)
                boxesCreated.add(i.getInstanceId());



            log.info("Boxes created " + boxesCreated);
        } else {
            blowupBoxes();
            boxesCreated.clear();
            for (Instance i : boxes)
                boxesCreated.add(i.getInstanceId());

        }
    }