Create AndroidDevice instances from a list of serials.

    Args:
        serials: A list of android device serials.

    Returns:
        A list of AndroidDevice objects.
186938
def get_instances(serials):
    
    results = []
    for s in serials:
        results.append(AndroidDevice(s))
    return results
723233
def _to_instances(self, pks):
        
        # we want instances, so create an object for each pk, without
        # checking for pk existence if asked
        meth = self.cls.lazy_connect if self._instances_skip_exist_test else self.cls
        return [meth(pk) for pk in pks]
16810
def _join_factory(cls, gap, pad):
    
    if issubclass(cls, dict):
        def _join(data):
            out = cls()
            data = list(data)
            while data:
                tsd = data.pop(0)
                out.append(tsd, gap=gap, pad=pad)
                del tsd
            return out
    else:
        from .. import TimeSeriesBaseList

        def _join(arrays):
            list_ = TimeSeriesBaseList(*arrays)
            return list_.join(pad=pad, gap=gap)
    return _join
562269
def devices(self):
        
        if self._devices is None:
            self._devices = DeviceList(self._version, fleet_sid=self._solution['sid'], )
        return self._devices
428811
def _createTimeSeriesObjects(self, timeSeries, filename):
        
        try:
            # Determine number of value columns
            valColumns = len(timeSeries[0]['values'])

            # Create List of GSSHAPY TimeSeries objects
            series = []
            for i in range(0, valColumns):
                ts = TimeSeries()
                ts.timeSeriesFile = self
                series.append(ts)

            for record in timeSeries:
                for index, value in enumerate(record['values']):
                    # Create GSSHAPY TimeSeriesValue objects
                    tsVal = TimeSeriesValue(simTime=record['time'],
                                            value=value)

                    # Associate with appropriate TimeSeries object via the index
                    tsVal.timeSeries = series[index]
        except IndexError:
            log.warning(('%s was opened, but the contents of the file were empty.'
                     'This file will not be read into the database.') % filename)
        except:
            raise
505778
def to_dict(self, serial=False):
        '''

        '''
        if serial:
            return dict((key, self._fields[key].to_serial(getattr(self, key)))
                        for key in list(self._fields.keys()) if hasattr(self, key))
        else:
            return dict((key, getattr(self, key)) for key in list(self._fields.keys())
                       if hasattr(self, key))
93353
def _create_serial_ports(serial_ports):
    '''
    
    '''
    ports = []
    keys = range(-9000, -9050, -1)
    if serial_ports:
        devs = [serial['adapter'] for serial in serial_ports]
        log.trace('Creating serial ports %s', devs)
        for port, key in zip(serial_ports, keys):
            serial_port_device = _apply_serial_port(port, key, 'add')
            ports.append(serial_port_device)
    return ports
60111
def library_sequencing_results(self):
        
        sres_ids = self.sequencing_result_ids
        res = {}
        for i in sres_ids:
            sres = SequencingResult(i)
            res[sres.library_id] = sres
        return res
603999
def create_generic_instances(self, instances):
        
        generic_instances = []
        for instance in instances:
            transformed_instance = self._create_core_dns_instance(instance)
            generic_instances.append(transformed_instance)

        return generic_instances
490535
def init_serials(self, ses_seed):
        
        sources = self.get_sources()
        serial = ses_seed
        for src in sources:
            nr = src.num_ruptures
            src.serial = serial
            serial += nr
974864
def create(self, **kwargs):
        ''''''

        self._set_attributes(**kwargs)
        self._check_type()
        pollster(self._check_all_devices_in_sync)()
        dg = self.devices[0].tm.cm.device_groups.device_group
        dg.create(name=self.name, partition=self.partition, type=self.type)
        for device in self.devices:
            self._add_device_to_device_group(device)
            device.tm.sys.config.exec_cmd('save')
        self.ensure_all_devices_in_sync()
59380
def list_adb_devices_by_usb_id():
    
    out = adb.AdbProxy().devices(['-l'])
    clean_lines = new_str(out, 'utf-8').strip().split('\n')
    results = []
    for line in clean_lines:
        tokens = line.strip().split()
        if len(tokens) > 2 and tokens[1] == 'device':
            results.append(tokens[2])
    return results
170458
def device_sdr_entries(self):
        
        reservation_id = self.reserve_device_sdr_repository()
        record_id = 0

        while True:
            record = self.get_device_sdr(record_id, reservation_id)
            yield record
            if record.next_id == 0xffff:
                break
            record_id = record.next_id
679467
def from_range(cls, range_list, register_flag=True):
        
        s = dict_from_range(range_list)
        obj = cls.from_serializable(s, register_flag)
        return obj
153623
public void setDeviceInstances(java.util.Collection<DeviceInstance> deviceInstances) {
        if (deviceInstances == null) {
            this.deviceInstances = null;
            return;
        }

        this.deviceInstances = new java.util.ArrayList<DeviceInstance>(deviceInstances);
    }
1109927
def create_tx(self, txins=None, txouts=None, lock_time=0):
        
        txins = [] if txins is None else txins
        txouts = [] if txouts is None else txouts
        lock_time = deserialize.positive_integer(lock_time)
        txins = deserialize.txins(txins)
        txouts = deserialize.txouts(self.testnet, txouts)
        tx = control.create_tx(self.service, self.testnet, txins, txouts,
                               lock_time=lock_time)
        return serialize.tx(tx)
998364
def make_serial(self,data,days,rev=0):
    
    raw = data[:]
    result = []
    try:
      while len(raw) >= days:
        result.append(float(sum(raw[-days:]) / days))
        raw.pop()
        self.debug_print(len(result))

      result.reverse()
      re = [self.cum_serial(result,rev), result]
      return re
    except:
      return '?'