Check if we are on a Lyon machine
775652
def we_are_in_lyon():
    """"""
    import socket
    try:
        hostname = socket.gethostname()
        ip = socket.gethostbyname(hostname)
    except socket.gaierror:
        return False
    return ip.startswith("134.158.")
1225636
async def _check_perm(self, session) -> bool:
        
        return await perm.check_permission(session.bot, session.ctx,
                                           self.permission)
239538
def check(self):
        
        if self.fq_name:
            self['uuid'] = self._check_fq_name(self.fq_name)
        elif self.uuid:
            self['fq_name'] = self._check_uuid(self.uuid)
        return True
1134216
function checkOlderIE() {
  const ua = navigator.userAgent;
  const isIE = ua.indexOf('MSIE') !== -1 || ua.indexOf('Trident') !== -1;
  if (!isIE) {
    return false;
  }
  const version = ua.match(/(MSIE\s|Trident.*rv:)([\w.]+)/)[2];
  const versionNumber = parseFloat(version);
  if (versionNumber < 10) {
    return true;
  }
  return false;
}
577085
def fetch_check(self, master):
        ''''''
        if self.param_period.trigger():
            if master is None:
                return
            if len(self.mav_param_set) == 0:
                master.param_fetch_all()
            elif self.mav_param_count != 0 and len(self.mav_param_set) != self.mav_param_count:
                if master.time_since('PARAM_VALUE') >= 1:
                    diff = set(range(self.mav_param_count)).difference(self.mav_param_set)
                    count = 0
                    while len(diff) > 0 and count < 10:
                        idx = diff.pop()
                        master.param_fetch_one(idx)
                        count += 1
100466
def is_running(self, submissionid, user_check=True):
        
        submission = self.get_submission(submissionid, user_check)
        return submission["status"] == "waiting"
1070834
def check( state_engine, nameop, block_id, checked_ops ):
    

    sender = nameop['sender']
    sending_blockchain_id = None
    found = False
    blockchain_namerec = None

    for blockchain_id in state_engine.get_announce_ids():
        blockchain_namerec = state_engine.get_name( blockchain_id )
        if blockchain_namerec is None:
            # this name doesn't exist yet, or is expired or revoked
            continue

        if str(sender) == str(blockchain_namerec['sender']):
            # yup!
            found = True
            sending_blockchain_id = blockchain_id
            break

    if not found:
        log.warning("Announcement not sent from our whitelist of blockchain IDs")
        return False

    nameop['announcer_id'] = sending_blockchain_id
    process_announcement( blockchain_namerec, nameop, state_engine.working_dir )
    return True
1066116
def detectBlackBerry(self):
        
        return UAgentInfo.deviceBB in self.__userAgent \
            or UAgentInfo.vndRIM in self.__httpAccept
231004
def status(self, return_led=0):
        """"""
        status = self.hub.get_device_status(self.device_id, return_led)
        self.logger.info("Dimmer %s status: %s", self.device_id,
                         pprint.pformat(status))
        return status
284554
def _validate_machines(machines, add_error):
    
    if not machines:
        return
    for machine_id, machine in machines.items():
        if machine_id < 0:
            add_error(
                'machine {} has an invalid id, must be positive digit'
                ''.format(machine_id))
        if machine is None:
            continue
        elif not isdict(machine):
            add_error(
                'machine {} does not appear to be well-formed'
                ''.format(machine_id))
            continue
        label = 'machine {}'.format(machine_id)
        _validate_constraints(machine.get('constraints'), label, add_error)
        _validate_series(machine.get('series'), label, add_error)
        _validate_annotations(machine.get('annotations'), label, add_error)
1190767
function check() {
        if (done) {
          return;
        }
        checks--;
        if (checks <= 0) {
          return;
        }
        if (checks === 0) {
          done = true;
          finish(new Error('Machine unresponsive to STOP'));
          return;
        }
        var checkOptions = {
          method: 'GET',
          path: self.account + '/machines/' + serverId
        };

        self._request(checkOptions, function (err, body) {
          if (err) { return callback && callback(err) }
          if (body && body.state === 'stopped') {
            done = true;
            finish();
            return;
          }
        });

        setTimeout(check, 5000);
      }
1054850
def is_check(self) -> bool:
        """"""
        king = self.king(self.turn)
        return king is not None and self.is_attacked_by(not self.turn, king)
987485
def has_rotational(self):
        """"""
        for member in self.get_members():
            if member.physical_drives.has_rotational:
                return True
        return False
1186725
def verify(operations, loud=False):
    
    everything_ok, roll_call = check(operations, loud=loud)
    if not everything_ok:
        raise CheckFailedException(roll_call)
    return roll_call
123786
def this_machine(self, machineid=None):
        
        if machineid is None:
            machineid = _id128.get_machine().hex
        else:
            machineid = getattr(machineid, 'hex', machineid)
        self.add_match(_MACHINE_ID=machineid)
480142
async def connected_check(ctx: commands.Context):
    

    voice = ctx.guild.voice_client

    if not voice or not voice.is_connected():
        raise commands.CheckFailure("Not connected to VC in this guild")

    return True
1202613
def is_installed(self, bot_name):
        
        self.check_bots_ready()
        return any(b.name == bot_name for b in self.bots.values())