Create a new named (sid) Seed from a list of seed URLs

        :param sid: the name to assign to the new seed list
        :param seedList: the list of seeds to use
        :return: the created Seed object
166156
def create(self, sid, seedList):
        

        seedUrl = lambda uid, url: {"id": uid, "url": url}

        if not isinstance(seedList,tuple):
            seedList = (seedList,)

        seedListData = {
            "id": "12345",
            "name": sid,
            "seedUrls": [seedUrl(uid, url) for uid, url in enumerate(seedList)]
        }

        # As per resolution of https://issues.apache.org/jira/browse/NUTCH-2123
        seedPath = self.server.call('post', "/seed/create", seedListData, TextAcceptHeader)
        new_seed = Seed(sid, seedPath, self.server)
        return new_seed
1060536
def sidpath(self, sid):
        
        sid_subdir = _sid_subdir_path(sid)
        return join(self._rootdir, sid_subdir)
58788
def _generate_unique_name(seed, existing_names):
        '''
        
        '''
        if seed == '':
            raise ValueError('Name seed must be an non-empty string')

        # Make the seed meet C-style naming convention
        seed = re.sub('[^0-9a-zA-Z]', '_', seed)  # Only alphabets and numbers are allowed
        if re.match('^[0-9]', seed):  # The first symbol cannot be a number
            seed = '_' + seed

        # If seed has never been seen, we return it as it is. Otherwise, we will append an number to make it unique.
        if seed not in existing_names:
            existing_names.add(seed)
            return seed
        else:
            i = 1
            while seed + str(i) in existing_names:
                i += 1
            new_name = seed + str(i)
            existing_names.add(new_name)
            return new_name
248025
async def reseed_init(self, next_seed: str = None) -> str:
        

        LOGGER.debug('Wallet.reseed_init >>> next_seed: [SEED]')

        if not self.handle:
            LOGGER.debug('Wallet.reseed_init <!< Wallet %s is closed', self.name)
            raise WalletState('Wallet {} is closed'.format(self.name))

        rv = await did.replace_keys_start(self.handle, self.did, json.dumps({'seed': next_seed} if next_seed else {}))
        LOGGER.debug('Wallet.reseed_init <<< %s', rv)
        return rv
1177175
def from_sid(cls, sid):
        
        record = json.loads(request(sid, 'sid', 'substance').read().decode())['PC_Substances'][0]
        return cls(record)
555510
def create_daily_trade_source(sids,
                              sim_params,
                              asset_finder,
                              trading_calendar):
    
    return create_trade_source(
        sids,
        timedelta(days=1),
        sim_params,
        asset_finder,
        trading_calendar=trading_calendar,
    )
1053808
def Create(self,name,description=None):
		

		if not description:  description = name

		r = clc.v2.API.Call(
			'POST',
			'groups/%s' % (self.alias),
			{'name': name, 'description': description, 'parentGroupId': self.id},
			session=self.session)
		return(Group(id=r['id'],alias=self.alias,group_obj=r,session=self.session))
915501
def initialize(self, seed=None):
        
        self.seed = seed or os.urandom(32)  # Generate new seed if not provided
        signing_key = SigningKey(self.seed)
        verifying_key = signing_key.get_verifying_key()
        self._auth_private = signing_key.to_seed()
        self._auth_public = verifying_key.to_bytes()
        log_binary(_LOGGER,
                   'Authentication keys',
                   Private=self._auth_private,
                   Public=self._auth_public)
248021
def seed(self, path, name):
        
        t = self.transloads[name] = Transload(self.addr, self, name,
                                              None, path,
                                              self.ui.startTransload(name,
                                                                     self.addr),
                                              seed=True)
        return t
1350902
def seed(self):
        
        form = self.request.form
        prefix = form.get('prefix', None)
        if prefix is None:
            return 'No prefix provided'
        seed = form.get('seed', None)
        if seed is None:
            return 'No seed provided'
        if not seed.isdigit():
            return 'Seed must be a digit'
        seed = int(seed)
        if seed < 0:
            return 'Seed cannot be negative'

        new_seq = self.set_seed(prefix, seed)
        return 'IDServerView: "%s" seeded to %s' % (prefix, new_seq)
895365
def get(self, sid):
        
        return SyncListContext(self._version, service_sid=self._solution['service_sid'], sid=sid, )
769168
def create_list_item(self, new_data):
        

        url = self.build_url(self._endpoints.get('get_items'))

        response = self.con.post(url, {'fields': new_data})
        if not response:
            return False

        data = response.json()

        return self.list_item_constructor(parent=self, **{self._cloud_data_key: data})
1245704
def seed(self, x=None, *args):
        
        if x is None:
            # Use same random seed code copied from Python's random.Random
            try:
                x = long(_hexlify(_urandom(16)), 16)
            except NotImplementedError:
                import time
                x = long(time.time() * 256) # use fractional seconds
        elif not isinstance(x, _Integral):
            # Use the hash of the input seed object. Note this does not give
            # consistent results cross-platform--between Python versions or
            # between 32-bit and 64-bit systems.
            x = hash(x)
        self.rng_iterator.seed(x, *args, mix_extras=True)
566409
def _add_new_reset_method(cls):
    

    #
    # Create and assign automatically generated reset() method
    #


    def new_reset_method(self, seed=None):
        logger.debug(f'[EEE] Inside automatically generated reset() method for {self} (seed={seed})')

        if seed is not None:
            self.seed_generator.reset(seed)
            for name, gen in self.field_gens.items():
                next_seed = next(self.seed_generator)
                gen.reset(next_seed)

            # TODO: the following should be covered by the newly added
            # reset() method in IndependentGeneratorMeta. However, for
            # some reason we can't call this via the usual `orig_reset()`
            # pattern, so we have to duplicate this here. Not ideal...
            for c in self._clones:
                c.reset_clone(seed)

        return self

    cls.reset = new_reset_method
499070
def _seed(self):
        """"""
        for name in self.__slots__:
            value = getattr(self, name, UNSET)
            if value is UNSET:
                setattr(self, name, self.__class__._default)
718540
def _new_stream(self, idx):
        '''
        '''
        # Choose the stream index from the candidate pool
        self.stream_idxs_[idx] = self.rng.choice(
            self.n_streams, p=self.distribution_)

        # Activate the Streamer, and get the weights
        self.streams_[idx], self.stream_weights_[idx] = self._activate_stream(
            self.stream_idxs_[idx])

        # Reset the sample count to zero
        self.stream_counts_[idx] = 0
80876
public static SID newInstance(final byte[] identifier) {
        final SID sid = new SID();
        sid.setRevision((byte) 0x01);
        sid.setIdentifierAuthority(identifier);
        return sid;
    }