Randomly connect one input to all output nodes
        (FS-NEAT without connections to hidden, if any).
        Originally connect_fs_neat.
335306
def connect_fs_neat_nohidden(self, config):
        
        input_id = choice(config.input_keys)
        for output_id in config.output_keys:
            connection = self.create_connection(config, input_id, output_id)
            self.connections[connection.key] = connection
276152
def combine_inputs(self, args, kw, ignore_args):
        ""
        inputs= args + tuple(c[1] for c in sorted(kw.items(), key=lambda x: x[0]))
        # REMOVE the ignored arguments from input and PREVENT it from being checked!!!
        return [a for i,a in enumerate(inputs) if i not in ignore_args]
624966
def from_node(cls, flow):
        """"""
        new = super().from_node(flow)

        # Will put all files found in outdir in GridFs
        d = {os.path.basename(f): f for f in flow.outdir.list_filepaths()}

        # Add the pickle file.
        d["pickle"] = flow.pickle_file if flow.pickle_protocol != 0 else (flow.pickle_file, "t")
        new.add_gridfs_files(**d)

        return new
1163773
def generate_random_graph(node_num, edge_num, self_loops=False, multi_edges=False):
    '''
    
    '''
    g = Graph.Graph()

    if not multi_edges:
        if self_loops:
            max_edges = node_num * node_num
        else:
            max_edges = node_num * (node_num-1)

        if edge_num > max_edges:
            raise GraphError("inconsistent arguments to 'generate_random_graph'")

    nodes = range(node_num)

    for node in nodes:
        g.add_node(node)

    while 1:
        head = random.choice(nodes)
        tail = random.choice(nodes)

        # loop defense
        if head == tail and not self_loops:
            continue

        # multiple edge defense
        if g.edge_by_node(head,tail) is not None and not multi_edges:
            continue

        # add the edge
        g.add_edge(head, tail)
        if g.number_of_edges() >= edge_num:
            break

    return g
388554
async def random_connection(self):
        
        addr = choice(list(self._connections.keys()))
        return await self.env.connect(addr)
1316049
function random (utxos, outputs, feeRate) {
  utxos = shuffle(utxos)

  return accumulative(utxos, outputs, feeRate)
}
1031515
def shuffle(self, *args):
        
        call_args = list(args)
        self.random.shuffle(call_args)
        return ''.join(call_args)
1013191
def randomToggle(self, randomize):
        """"""
        if randomize:
            self._stim.setReorderFunc(order_function('random'), 'random')
        else:
            self._stim.reorder = None
419407
def ipshuffle(l, random=None):
    """
    import random as _random
    _random.shuffle(l, random)
    return l
690017
def _argsort_and_resolve_ties(time, random_state):
        """"""
        n_samples = len(time)
        order = numpy.argsort(time, kind="mergesort")

        i = 0
        while i < n_samples - 1:
            inext = i + 1
            while inext < n_samples and time[order[i]] == time[order[inext]]:
                inext += 1

            if i + 1 != inext:
                # resolve ties randomly
                random_state.shuffle(order[i:inext])
            i = inext
        return order
1275087
def create_random_ind_full(self, depth=0):
        ""
        lst = []
        self._create_random_ind_full(depth=depth, output=lst)
        return lst
993795
def random(args):
    
    from random import sample

    p = OptionParser(random.__doc__)
    opts, args = p.parse_args(args)

    if len(args) != 2:
        sys.exit(not p.print_help())

    fastafile, N = args
    N = int(N)
    assert N > 0

    f = Fasta(fastafile)
    fw = must_open("stdout", "w")

    for key in sample(f.keys(), N):
        rec = f[key]
        SeqIO.write([rec], fw, "fasta")

    fw.close()
1178598
def _add_non_batch(self, TX_nodes, PmtInf_nodes):
        
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['PmtInfIdNode'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['PmtMtdNode'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['BtchBookgNode'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['NbOfTxsNode'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['CtrlSumNode'])

        PmtInf_nodes['SvcLvlNode'].append(PmtInf_nodes['Cd_SvcLvl_Node'])
        PmtInf_nodes['LclInstrmNode'].append(PmtInf_nodes['Cd_LclInstrm_Node'])
        PmtInf_nodes['PmtTpInfNode'].append(PmtInf_nodes['SvcLvlNode'])
        PmtInf_nodes['PmtTpInfNode'].append(PmtInf_nodes['LclInstrmNode'])
        PmtInf_nodes['PmtTpInfNode'].append(PmtInf_nodes['SeqTpNode'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['PmtTpInfNode'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['ReqdColltnDtNode'])

        PmtInf_nodes['CdtrNode'].append(PmtInf_nodes['Nm_Cdtr_Node'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['CdtrNode'])

        PmtInf_nodes['Id_CdtrAcct_Node'].append(
            PmtInf_nodes['IBAN_CdtrAcct_Node'])
        PmtInf_nodes['CdtrAcctNode'].append(PmtInf_nodes['Id_CdtrAcct_Node'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['CdtrAcctNode'])

        if 'BIC' in self._config:
            PmtInf_nodes['FinInstnId_CdtrAgt_Node'].append(
                PmtInf_nodes['BIC_CdtrAgt_Node'])
        PmtInf_nodes['CdtrAgtNode'].append(
            PmtInf_nodes['FinInstnId_CdtrAgt_Node'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['CdtrAgtNode'])

        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['ChrgBrNode'])

        if self.schema == 'pain.008.001.02':
            PmtInf_nodes['CdtrSchmeIdNode'].append(PmtInf_nodes['Nm_CdtrSchmeId_Node'])
        PmtInf_nodes['OthrNode'].append(PmtInf_nodes['Id_Othr_Node'])
        PmtInf_nodes['SchmeNmNode'].append(PmtInf_nodes['PrtryNode'])
        PmtInf_nodes['OthrNode'].append(PmtInf_nodes['SchmeNmNode'])
        PmtInf_nodes['PrvtIdNode'].append(PmtInf_nodes['OthrNode'])
        PmtInf_nodes['Id_CdtrSchmeId_Node'].append(PmtInf_nodes['PrvtIdNode'])
        PmtInf_nodes['CdtrSchmeIdNode'].append(
            PmtInf_nodes['Id_CdtrSchmeId_Node'])
        PmtInf_nodes['PmtInfNode'].append(PmtInf_nodes['CdtrSchmeIdNode'])

        TX_nodes['PmtIdNode'].append(TX_nodes['EndToEndIdNode'])
        TX_nodes['DrctDbtTxInfNode'].append(TX_nodes['PmtIdNode'])
        TX_nodes['DrctDbtTxInfNode'].append(TX_nodes['InstdAmtNode'])

        TX_nodes['MndtRltdInfNode'].append(TX_nodes['MndtIdNode'])
        TX_nodes['MndtRltdInfNode'].append(TX_nodes['DtOfSgntrNode'])
        TX_nodes['DrctDbtTxNode'].append(TX_nodes['MndtRltdInfNode'])
        TX_nodes['DrctDbtTxInfNode'].append(TX_nodes['DrctDbtTxNode'])

        if 'BIC_DbtrAgt_Node' in TX_nodes and TX_nodes['BIC_DbtrAgt_Node'].text is not None:
            TX_nodes['FinInstnId_DbtrAgt_Node'].append(
                TX_nodes['BIC_DbtrAgt_Node'])
        TX_nodes['DbtrAgtNode'].append(TX_nodes['FinInstnId_DbtrAgt_Node'])
        TX_nodes['DrctDbtTxInfNode'].append(TX_nodes['DbtrAgtNode'])

        TX_nodes['DbtrNode'].append(TX_nodes['Nm_Dbtr_Node'])
        TX_nodes['DrctDbtTxInfNode'].append(TX_nodes['DbtrNode'])

        TX_nodes['Id_DbtrAcct_Node'].append(TX_nodes['IBAN_DbtrAcct_Node'])
        TX_nodes['DbtrAcctNode'].append(TX_nodes['Id_DbtrAcct_Node'])
        TX_nodes['DrctDbtTxInfNode'].append(TX_nodes['DbtrAcctNode'])

        TX_nodes['RmtInfNode'].append(TX_nodes['UstrdNode'])
        TX_nodes['DrctDbtTxInfNode'].append(TX_nodes['RmtInfNode'])
        PmtInf_nodes['PmtInfNode'].append(TX_nodes['DrctDbtTxInfNode'])
        CstmrDrctDbtInitn_node = self._xml.find('CstmrDrctDbtInitn')
        CstmrDrctDbtInitn_node.append(PmtInf_nodes['PmtInfNode'])
1105931
def input_connections(self, name):
        
        for input_name in self._compound_children[name].inputs:
            dest = name, input_name
            for src, dests in self._compound_linkages.items():
                if isinstance(dests[0], six.string_types):
                    dests = zip(dests[0::2], dests[1::2])
                if dest in dests:
                    yield src, dest
846571
def do_connected(self, args):
        ''''''
        connected = self.label_store.connected_component(args.content_id)
        for label in connected:
            self.stdout.write('{0}\n'.format(label))
333467
def connected(self, node_id):
        """"""
        conn = self._conns.get(node_id)
        if conn is None:
            return False
        return conn.connected()
1339552
def _shuffle_single(fname, extra_fn=None):
  
  records = read_records(fname)
  random.shuffle(records)
  if extra_fn is not None:
    records = extra_fn(records)
  out_fname = fname.replace(UNSHUFFLED_SUFFIX, "")
  write_records(records, out_fname)
  tf.gfile.Remove(fname)