Implementation of NAPALM method open.
179299
def open(self):
        """"""
        try:
            connection = self.transport_class(
                host=self.hostname,
                username=self.username,
                password=self.password,
                timeout=self.timeout,
                **self.eapi_kwargs
            )

            if self.device is None:
                self.device = pyeapi.client.Node(connection, enablepwd=self.enablepwd)
            # does not raise an Exception if unusable

            # let's try to run a very simple command
            self.device.run_commands(["show clock"], encoding="text")
        except ConnectionError as ce:
            # and this is raised either if device not avaiable
            # either if HTTP(S) agent is not enabled
            # show management api http-commands
            raise ConnectionException(py23_compat.text_type(ce))
433049
public void open(final OperationResult<Void, Exception> onOpen, final OperationResult<Void, Exception> onClose) {

        this.onOpen = onOpen;
        this.onClose = onClose;
        this.sendLink.open();
        this.receiveLink.open();
    }
1302528
def _on_open(self, sender, *args, **kwargs):
        
        self.get_config()
        self.get_version()

        self.on_open()
141584
def open(self):
        '''  '''
        self.fd = open('/dev/net/tun', 'rb+', buffering=0)
        tun_flags = IFF_TAP | IFF_NO_PI | IFF_PERSIST
        ifr = struct.pack('16sH', self.name, tun_flags)
        fcntl.ioctl(self.fd, TUNSETIFF, ifr)
        fcntl.ioctl(self.fd, TUNSETOWNER, os.getuid())
        self.ifflags = self.ifflags | IFF_RUNNING
479010
void open(TopologyContext context, SpoutOutputCollector collector,
              int checkpointInterval, KeyValueState<String, CheckPointState> checkpointState) {
        this.context = context;
        this.collector = collector;
        this.checkpointInterval = checkpointInterval;
        this.sleepInterval = checkpointInterval / 10;
        this.checkpointState = checkpointState;
        this.curTxState = checkpointState.get(TX_STATE_KEY);
        lastCheckpointTs = 0;
        recoveryStepInProgress = false;
        checkpointStepInProgress = false;
        recovering = true;
    }
1360362
public void openWrite()
  {
    TempCharBuffer ptr = _head;

    _head = null;
    _tail = null;

    TempCharBuffer.freeAll(ptr);
  }
191940
@Override
	public void open(int taskNumber, int numTasks) throws IOException {
		this.session = cluster.connect();
		this.prepared = session.prepare(insertQuery);
		this.callback = new FutureCallback<ResultSet>() {
			@Override
			public void onSuccess(ResultSet ignored) {
				onWriteSuccess(ignored);
			}

			@Override
			public void onFailure(Throwable t) {
				onWriteFailure(t);
			}
		};
	}
1226313
@Override
	public void open() throws IOException, MemoryAllocationException, InterruptedException {
		this.hashJoin.open(this.firstInput, this.secondInput, this.buildSideOuterJoin);
	}
216586
def open_interpreter(self, fnames):
        """"""
        for path in sorted(fnames):
            self.sig_open_interpreter.emit(path)
1051472
protected function open()
    {
        $environment = $this->asyncAgiEvent->getEnvironment();
        $this->channel = $this->asyncAgiEvent->getChannel();
        foreach (explode("\n", $environment) as $line) {
            if ($this->isEndOfEnvironmentVariables($line)) {
                break;
            }
            $this->readEnvironmentVariable($line);
        }
        $this->listenerId = $this->pamiClient->registerEventListener($this);
        $this->logger->debug(print_r($this->variables, true));
    }
568269
protected void openFile() {

        try {
            FileAccess   fa  = isDump ? FileUtil.getDefaultInstance()
                                      : database.getFileAccess();
            OutputStream fos = fa.openOutputStreamElement(outFile);

            outDescriptor = fa.getFileSync(fos);
            fileStreamOut = new BufferedOutputStream(fos, 2 << 12);
        } catch (IOException e) {
            throw Error.error(ErrorCode.FILE_IO_ERROR,
                              ErrorCode.M_Message_Pair, new Object[] {
                e.toString(), outFile
            });
        }
    }
590193
public static void main(String[] args) {  
    try {
      SamReaderFactory factory =  SamReaderFactory.makeDefault();
      
      // If it was a file, we would open like so:
      // factory.open(new File("~/testdata/htsjdk/samtools/uncompressed.sam"));
      // For API access we use SamInputResource constructed from a URL:
      SamReader reader = factory.open(SamInputResource.of(new URL(GA4GH_URL)));
      
      Stopwatch timer = Stopwatch.createStarted();
      int processedReads = 0;
      for (@SuppressWarnings("unused") final SAMRecord samRecord : reader) {
        processedReads++;
      }
      final long elapsed = timer.elapsed(TimeUnit.MILLISECONDS);
      if (processedReads > 0 && elapsed > 0) {
        System.out.println("Processed " + processedReads + " reads in " + timer + 
            ". Speed: " + (processedReads*1000)/elapsed + " reads/sec");
      } else {
        System.out.println("Nothing processed or not enough reads for timing stats.");
      }
      reader.close();
    } catch (MalformedURLException e) {
      e.printStackTrace();
    } catch (IOException e) {
      e.printStackTrace();
    }
  }
491445
def open_multi(cls, sock, chunk_types, isattys, chunk_eof_type=None, buf_size=None,
                 select_timeout=None):
    """"""
    cls._assert_aligned(chunk_types, isattys)

    # N.B. This is purely to permit safe handling of a dynamic number of contextmanagers.
    with ExitStack() as stack:
      read_fds, write_fds = list(zip(
        # Allocate one pipe pair per chunk type provided.
        *(stack.enter_context(_pipe(isatty)) for isatty in isattys)
      ))
      writer = NailgunStreamWriter(
        read_fds,
        sock,
        chunk_types,
        chunk_eof_type,
        buf_size=buf_size,
        select_timeout=select_timeout
      )
      with writer.running():
        yield write_fds, writer
1154935
@Override
	public void open(int taskNumber, int numTasks) throws IOException {
		try {
			establishConnection();
			upload = dbConn.prepareStatement(query);
		} catch (SQLException sqe) {
			throw new IllegalArgumentException("open() failed:\t!", sqe);
		} catch (ClassNotFoundException cnfe) {
			throw new IllegalArgumentException("JDBC-Class not found:\t", cnfe);
		}
	}
442152
@Override
    public C execute(io.sniffy.Executable executable) throws SniffyAssertionError {
        checkOpened();
        try {
            executable.execute();
        } catch (Throwable e) {
            throw verifyAndAddToException(e);
        }

        verify();
        return self();
    }
319636
@Override
	public void open(int taskNumber, int numTasks) throws IOException {

		// enforce sequential open() calls
		synchronized (OPEN_MUTEX) {
			if (Integer.toString(taskNumber + 1).length() > 6) {
				throw new IOException("Task id too large.");
			}

			TaskAttemptID taskAttemptID = TaskAttemptID.forName("attempt__0000_r_"
					+ String.format("%" + (6 - Integer.toString(taskNumber + 1).length()) + "s", " ").replace(" ", "0")
					+ Integer.toString(taskNumber + 1)
					+ "_0");

			this.jobConf.set("mapred.task.id", taskAttemptID.toString());
			this.jobConf.setInt("mapred.task.partition", taskNumber + 1);
			// for hadoop 2.2
			this.jobConf.set("mapreduce.task.attempt.id", taskAttemptID.toString());
			this.jobConf.setInt("mapreduce.task.partition", taskNumber + 1);

			this.context = new TaskAttemptContextImpl(this.jobConf, taskAttemptID);

			this.outputCommitter = this.jobConf.getOutputCommitter();

			JobContext jobContext = new JobContextImpl(this.jobConf, new JobID());

			this.outputCommitter.setupJob(jobContext);

			this.recordWriter = this.mapredOutputFormat.getRecordWriter(null, this.jobConf, Integer.toString(taskNumber + 1), new HadoopDummyProgressable());
		}
	}
969031
public static function openLogs()
    {
        if (Daemon::$config->logging->value) {
            Daemon::$logpointer = fopen(Daemon::$config->logstorage->value, 'a');
            if (isset(Daemon::$config->group->value)) {
                chgrp(Daemon::$config->logstorage->value, Daemon::$config->group->value); // @TODO: rewrite to async I/O
            }
            if (isset(Daemon::$config->user->value)) {
                chown(Daemon::$config->logstorage->value, Daemon::$config->user->value); // @TODO: rewrite to async I/O
            }
            if ((Daemon::$process instanceof Thread\Worker) && FileSystem::$supported) {
                FileSystem::open(Daemon::$config->logstorage->value, 'a!', function ($file) {
                    Daemon::$logpointerAsync = $file;
                    if (!$file) {
                        return;
                    }
                });
            }
        } else {
            Daemon::$logpointer = null;
            Daemon::$logpointerAsync = null;
        }
    }