Get upyun instance
182497
function getInstance(options) {
  var bucket = options.bucket;
  var upyunInstance = instances[bucket];

  // If can not found instance, then new one.
  if (!upyunInstance) {
    instances[bucket] = upyunInstance = new UPYUN(options.bucket, options.operator, options.password, options.endpoing, options.apiVersion);
  }

  return upyunInstance;
}
809316
def GetUnreachableInstances(instances, ssh_key):
  
  hostnames = [i.private_ip for i in instances]
  ssh_status = AreHostsReachable(hostnames, ssh_key)
  assert(len(hostnames) == len(ssh_status))
  nonresponsive_instances = [instance for (instance, ssh_ok) in
                             zip(instances, ssh_status) if not ssh_ok]
  return nonresponsive_instances
277040
def up(self) -> "InstanceNode":
        
        ts = max(self.timestamp, self.parinst.timestamp)
        return self.parinst._copy(self._zip(), ts)
115305
def find(self, x):
        
        if self.up[x] == x:
            return x
        else:
            self.up[x] = self.find(self.up[x])
            return self.up[x]
979988
def show_instance(name, call=None):
    '''
    
    '''
    if call != 'action':
        raise SaltCloudSystemExit(
            'The show_instance action must be called with -a or --action.'
        )

    items = query(action='ve', command=name)

    ret = {}
    for item in items:
        if 'text' in item.__dict__:
            ret[item.tag] = item.text
        else:
            ret[item.tag] = item.attrib

        if item._children:
            ret[item.tag] = {}
            children = item._children
            for child in children:
                ret[item.tag][child.tag] = child.attrib

    __utils__['cloud.cache_node'](ret, __active_provider_name__, __opts__)
    return ret
643027
function fromGithubIssue (issue) {
  if (!issue) {
    return null;
  }

  return {
    "type":   "issue",
    "number": issue.number,
    "url":    issue.html_url,
    "title":  issue.title,
    "labels": _.pluck(issue.labels, "name")
  };
}
651250
def _get_instance(self, **kwargs):
        """"""
        current_app.logger.info("Getting instance")
        current_app.logger.debug("kwargs: {}".format(kwargs))

        current_app.logger.info(
            "Loading instance: {}".format(kwargs['obj_id']))
        rec = self.db_query.get_instance(self.db_collection, kwargs['obj_id'])
        g._resource_instance = rec
        current_app.logger.debug(
            "g._resource_instance: {}".format(g._resource_instance))
        return rec
529274
async function getStudySetup() {
  // shallow copy
  const studySetup = Object.assign({}, baseStudySetup);

  studySetup.allowEnroll = await cachingFirstRunShouldAllowEnroll(studySetup);

  const testingOverrides = await browser.study.getTestingOverrides();
  studySetup.testing = {
    variationName: testingOverrides.variationName,
    firstRunTimestamp: testingOverrides.firstRunTimestamp,
    expired: testingOverrides.expired,
  };

  return studySetup;
}
714823
def get_instance(uri):
    """"""
    global _instances
    try:
        instance = _instances[uri]
    except KeyError:
        instance = MediaFile(
            uri,
            client.get_instance()
        )
        _instances[uri] = instance

    return instance
393941
protected function getUpyun()
    {
        if (!$this->upload) {
            $this->upload = new UpYun(
                $this->config['bucket'],//空间名称
                $this->config['username'],//用户名
                $this->config['password'],//密码
                $this->config['endpoint'],//线路
                $this->config['timeout']//超时时间
            );
        }
        return $this->upload;
    }
984439
def get(self, uuid):
        
        args = {'uuid':uuid}
        self._get_chk.check(args)
        return self._client.json('kvm.get', args)
56475
def get_session(username, password, locale=DEFAULT_LOCALE,
                cookie_path=COOKIE_PATH):
    """"""
    class UPSAuth(AuthBase):  # pylint: disable=too-few-public-methods
        """UPS authorization storage."""

        def __init__(self, username, password, locale, cookie_path):
            """Init."""
            self.username = username
            self.password = password
            self.locale = locale
            self.cookie_path = cookie_path

        def __call__(self, r):
            """Call is no-op."""
            return r

    session = requests.session()
    session.auth = UPSAuth(username, password, locale, cookie_path)
    if os.path.exists(cookie_path):
        session.cookies = _load_cookies(cookie_path)
    else:
        _login(session)
    return session
460611
def get_default(name, value):
    """"""
    return os.environ.get('EXAMPLE_{}'.format(name.upper()), value)
581739
def get_instance(key, expire=None):
    """"""
    global _instances
    try:
        instance = _instances[key]
    except KeyError:
        instance = RedisSet(
            key,
            _redis,
            expire=expire
        )
        _instances[key] = instance

    return instance
215845
public function getUpYunChunk()
    {
        if (empty($this->upyun_chunk)) {
            $this->upyun_chunk = new Multi($this->getUpyunConfig());
        }
        return $this->upyun_chunk;
    }
62993
def uptime
      @uptime ||= if (uptime = @node.at_xpath('uptime'))
                    Uptime.new(
                      uptime['seconds'].to_i,
                      Time.parse(uptime['lastboot'])
                    )
                  end

      yield @uptime if (@uptime && block_given?)
      return @uptime
    end
464532
def get_instance(uri):
    """"""
    global _instances
    try:
        instance = _instances[uri]
    except KeyError:
        instance = Page(
            uri,
            client.get_instance()
        )
        _instances[uri] = instance

    return instance