Assert that any SID in ``sysmeta_pyxb`` can be assigned to a new standalone
    object.
973103
def is_valid_sid_for_new_standalone(sysmeta_pyxb):
    """"""
    sid = d1_common.xml.get_opt_val(sysmeta_pyxb, 'seriesId')
    if not d1_gmn.app.did.is_valid_sid_for_new_standalone(sid):
        raise d1_common.types.exceptions.IdentifierNotUnique(
            0,
            'Identifier is already in use as {}. did="{}"'.format(
                d1_gmn.app.did.classify_identifier(sid), sid
            ),
            identifier=sid,
        )
1372259
def _service_is_sysv(name):
    '''
    
    '''
    try:
        # Look for user-execute bit in file mode.
        return bool(os.stat(
            os.path.join('/etc/init.d', name)).st_mode & stat.S_IXUSR)
    except OSError:
        return False
316178
def _sysv_enable(name):
    '''
    
    '''
    if not _service_is_chkconfig(name) and not _chkconfig_add(name):
        return False
    cmd = '/sbin/chkconfig {0} on'.format(name)
    return not __salt__['cmd.retcode'](cmd, python_shell=False)
25229
private WSPKCSInKeyStore insertedAlready(String tokenlib) {
        WSPKCSInKeyStore pKS = null;
        WSPKCSInKeyStore rc = null;
        Enumeration<WSPKCSInKeyStore> e = theV.elements();

        while (null == rc && e.hasMoreElements()) {
            pKS = e.nextElement();

            if (tokenlib.equalsIgnoreCase(pKS.getlibName_key())) {
                rc = pKS;
            } else if (tokenlib.equalsIgnoreCase(pKS.getlibName_trust())) {
                rc = pKS;
            }
        }

        return rc;
    }
98057
function isObserving(oConfiguration, sType, sName) {
		// no configuration, listen to all types
		if (oConfiguration == null || !sType) {
			return false;
		}

		if (sType != "destroy" && sType != "parent" && !sName) {
			return false;
		}

		// either all (true) properties/aggregations/associations are relevant or a specific list or names is provided
		return oConfiguration[sType] === true || (Array.isArray(oConfiguration[sType]) && oConfiguration[sType].indexOf(sName) > -1);
	}
1273742
def get_sid(self):
        """"""
        base_url = u'%s/login_sid.lua' % self.__fritz_url
        get_challenge = None
        try:
            get_challenge = urllib2.urlopen(base_url).read().decode('ascii')
        except urllib2.HTTPError as exception:
            print('HTTPError = ' + str(exception.code))
        except urllib2.URLError as  exception:
            print('URLError = ' + str(exception.reason))
        except Exception as exception:
            print('generic exception: ' + str(exception))
            raise


        challenge = get_challenge.split(
            '<Challenge>')[1].split('</Challenge>')[0]
        challenge_b = (
            challenge + '-' + self.__password).encode().decode('iso-8859-1').encode('utf-16le')

        md5hash = hashlib.md5()
        md5hash.update(challenge_b)

        response_b = challenge + '-' + md5hash.hexdigest().lower()
        get_sid = urllib2.urlopen('%s?%sresponse=%s' % (base_url, self.__username_query, response_b)).read().decode('utf-8')
        self.sid = get_sid.split('<SID>')[1].split('</SID>')[0]
340229
def augassign_handle(self, tokens):
        """"""
        internal_assert(len(tokens) == 3, "invalid assignment tokens", tokens)
        name, op, item = tokens
        out = ""
        if op == "|>=":
            out += name + " = (" + item + ")(" + name + ")"
        elif op == "|*>=":
            out += name + " = (" + item + ")(*" + name + ")"
        elif op == "<|=":
            out += name + " = " + name + "((" + item + "))"
        elif op == "<*|=":
            out += name + " = " + name + "(*(" + item + "))"
        elif op == "..=" or op == "<..=":
            out += name + " = _coconut_forward_compose((" + item + "), " + name + ")"
        elif op == "..>=":
            out += name + " = _coconut_forward_compose(" + name + ", (" + item + "))"
        elif op == "<*..=":
            out += name + " = _coconut_forward_star_compose((" + item + "), " + name + ")"
        elif op == "..*>=":
            out += name + " = _coconut_forward_star_compose(" + name + ", (" + item + "))"
        elif op == "??=":
            out += name + " = " + item + " if " + name + " is None else " + name
        elif op == "::=":
            ichain_var = lazy_chain_var + "_" + str(self.ichain_count)
            self.ichain_count += 1
            # this is necessary to prevent a segfault caused by self-reference
            out += (
                ichain_var + " = " + name + "\n"
                + name + " = _coconut.itertools.chain.from_iterable(" + lazy_list_handle([ichain_var, "(" + item + ")"]) + ")"
            )
        else:
            out += name + " " + op + " " + item
        return out
185609
def set_sid_attrs(self, sid, **kwargs):
        
        table = self._ensure_ctable(sid)
        for k, v in kwargs.items():
            table.attrs[k] = v
951385
function (sid, callback) {
        var cb = callback || _.noop;

        // ensureIndex is already called on start-up
        mongooseModel.findOne(_applyProp(propSid, sid), function(err, doc) {

          if(err || !doc) { // exit immediately
            cb(err, null);
            return;
          }

          if(_checkExpiration(doc) && doc[propData] !== undefined) { // we're still valid:
            cb(null, unserializer(doc[propData]));
          }
          else { // needs clean-up
            me.destroy(sid, cb);
          }
        });
      }
257623
public static void assertLastOperationSuccess(String msg, SipActionObject op) {
    assertNotNull("Null assert object passed in", op);
    assertTrue(msg, op.getErrorMessage().length() == 0);
  }
452645
def from_any(cls, obj, bucket):
        
        if isinstance(obj, cls):
            return cls(obj.raw)

        return cls({
            'namespace_id': 'default',
            'keyspace_id': bucket,
            'name': obj if obj else N1QL_PRIMARY_INDEX,
            'using': 'gsi'
        })
889271
@Nonnull
  public static StubObject createForCurrentUserAndID (@Nonnull @Nonempty final String sID)
  {
    return new StubObject (sID, LoggedInUserManager.getInstance ().getCurrentUserID (), null);
  }
626060
def _null_sia(subsystem, phi=0.0):
    
    return SystemIrreducibilityAnalysis(subsystem=subsystem,
                                        cut_subsystem=subsystem,
                                        phi=phi,
                                        ces=_null_ces(subsystem),
                                        partitioned_ces=_null_ces(subsystem))
88128
def sigmask(self, sigsetsize=None):
        
        if self._sigmask is None:
            if sigsetsize is not None:
                sc = self.state.solver.eval(sigsetsize)
                self.state.add_constraints(sc == sigsetsize)
                self._sigmask = self.state.solver.BVS('initial_sigmask', sc*self.state.arch.byte_width, key=('initial_sigmask',), eternal=True)
            else:
                self._sigmask = self.state.solver.BVS('initial_sigmask', self.sigmask_bits, key=('initial_sigmask',), eternal=True)
        return self._sigmask
65730
def _service_is_sysv(name):
    '''
    
    '''
    script = '/etc/init.d/{0}'.format(name)
    return not _service_is_upstart(name) and os.access(script, os.X_OK)
1246604
def _ensure_ctable(self, sid):
        """"""
        sidpath = self.sidpath(sid)
        if not os.path.exists(sidpath):
            return self._init_ctable(sidpath)
        return bcolz.ctable(rootdir=sidpath, mode='a')
1331709
def _instantiate(cls, params):
    
    sig_params = inspect.signature(cls.__init__).parameters
    valid_params = dict()
    for key, value in params.items():
        if key in sig_params:
            valid_params[key] = value
        else:
            logger.debug('Type %s does not support parameter \'%s\'' % (cls.__name__, key))
    return cls(**valid_params)