Public: Returns the passed examples
341474
def passed
      v = RRRSpec.redis.hget(key, 'passed')
      v.present? ? v.to_i : nil
    end
1349141
def fetch(self):
        
        params = values.of({})

        payload = self._version.fetch(
            'GET',
            self._uri,
            params=params,
        )

        return SampleInstance(
            self._version,
            payload,
            assistant_sid=self._solution['assistant_sid'],
            task_sid=self._solution['task_sid'],
            sid=self._solution['sid'],
        )
1181338
def example():
    
    client = Client(ACCOUNT_SID, AUTH_TOKEN)

    # Get all messages
    all_messages = client.messages.list()
    print('There are {} messages in your account.'.format(len(all_messages)))

    # Get only last 10 messages...
    some_messages = client.messages.list(limit=10)
    print('Here are the last 10 messages in your account:')
    for m in some_messages:
        print(m)

    # Get messages in smaller pages...
    all_messages = client.messages.list(page_size=10)
    print('There are {} messages in your account.'.format(len(all_messages)))

    print('Sending a message...')
    new_message = client.messages.create(to='XXXX', from_='YYYY', body='Twilio rocks!')

    print('Making a call...')
    new_call = client.calls.create(to='XXXX', from_='YYYY', method='GET')

    print('Serving TwiML')
    twiml_response = VoiceResponse()
    twiml_response.say('Hello!')
    twiml_response.hangup()
    twiml_xml = twiml_response.to_xml()
    print('Generated twiml: {}'.format(twiml_xml))
915502
def send_example(self,
                     *args,
                     **kwargs
                     ):
        
        # Pop out the keyword argument 'parse_result' if given
        parse_result = kwargs.pop('parse_result', True)
        line = self.make_line(*args, **kwargs)
        result = self.send_line(line, parse_result=parse_result)
        return result
220046
def show_instance(name, call=None):
    '''
    
    '''
    response = _query('grid', 'server/get', args={'name': name})
    ret = {}
    for item in response['list']:
        name = item['name']
        ret[name] = item

        ret[name]['image_info'] = item['image']
        ret[name]['image'] = item['image']['friendlyName']
        ret[name]['size'] = item['ram']['name']
        ret[name]['public_ips'] = [item['ip']['ip']]
        ret[name]['private_ips'] = []
        ret[name]['state_info'] = item['state']
        if 'active' in item['state']['description']:
            ret[name]['state'] = 'RUNNING'
    return ret
313793
def to_s
      public_vars = instance_variables.reject do |var|
        INSTANCE_VARIABLE_LOG_BLACKLIST.include? var
      end

      public_vars.map! do |var|
        "#{var}=\"#{instance_variable_get(var)}\""
      end

      public_vars = public_vars.join(' ')

      "<##{self.class}:#{object_id.to_s(8)} #{public_vars}>"
    end
588820
function getExample (obj) {
  if (isArray(obj)) {
    return removeOptionalWithoutExamples(obj).map(getExample);
  }

  const { example, details } = obj;

  if (example === undefined && details !== undefined) {
    const nested = {};

    Object.keys(details).forEach((key) => {
      nested[key] = getExample(details[key]);
    });

    return nested;
  }

  return example;
}
1209139
def passed(self):
        
        return [test for test in self.all() if not test.failed() and not test.skipped()]
1323077
function hasExample ({ optional, example, details } = {}) {
  if (optional || example !== undefined) {
    return true;
  }

  if (details !== undefined) {
    const values = Object.keys(details).map((key) => details[key]);

    return values.every(hasExample);
  }

  return false;
}
670132
def all_examples(self, pred_name=None):
        '''
        
        '''
        target = self.db.target_table
        pred_name = pred_name if pred_name else target
        examples = self.db.rows(target, [self.db.target_att, self.db.pkeys[target]])
        return '\n'.join(["%s(%s, %s)." % (pred_name, ILPConverter.fmt_col(cls), pk) for cls, pk in examples])
1329757
def examples(self):
         
        examples = []
        for example in [variant.examples for variant in self._raw_synset.variants if len(variant.examples)]:
            examples.extend(example)
        return examples
592187
public static List<StringContext> getContextsFromExamples(List<CcgExample> examples) {
    List<StringContext> contexts = Lists.newArrayList();
    for (CcgExample example : examples) {
      AnnotatedSentence sentence = example.getSentence();
      int numTerminals = sentence.size();
      for (int i = 0; i < numTerminals; i++) {
        for (int j = i; j < numTerminals; j++) {
          contexts.add(new StringContext(i, j, sentence));
        }
      }
    }
    return contexts;
  }
540122
def get_examples(examples_dir="examples/"):  # pragma: no cover
    """"""
    all_files = os.listdir(examples_dir)
    python_files = [f for f in all_files if is_python_file(f)]
    basenames = [remove_suffix(f) for f in python_files]
    modules = [import_module(module) for module in pathify(basenames)]
    return [
        module for module in modules
        if getattr(module, 'app', None) is not None
    ]
847121
def samples(self, anystring, limit=None, offset=None, sortby=None):
        ''''''

        uri = self._uris['samples'].format(anystring)
        params = {'limit': limit, 'offset': offset, 'sortby': sortby}

        return self.get_parse(uri, params)
739416
def _generate_examples(self, archive):
    """"""
    num_skipped = 0
    for fname, fobj in archive:
      res = _NAME_RE.match(fname)
      if not res:  # README file, ...
        continue
      label = res.group(1).lower()
      if tf.compat.as_bytes("JFIF") not in fobj.peek(10):
        num_skipped += 1
        continue
      yield {
          "image": fobj,
          "image/filename": fname,
          "label": label,
      }

    if num_skipped != _NUM_CORRUPT_IMAGES:
      raise ValueError("Expected %d corrupt images, but found %d" % (
          _NUM_CORRUPT_IMAGES, num_skipped))
    logging.warning("%d images were corrupted and were skipped", num_skipped)
913262
def examples(path='holoviews-examples', verbose=False, force=False, root=__file__):
    
    filepath = os.path.abspath(os.path.dirname(root))
    example_dir = os.path.join(filepath, './examples')
    if not os.path.exists(example_dir):
        example_dir = os.path.join(filepath, '../examples')
    if os.path.exists(path):
        if not force:
            print('%s directory already exists, either delete it or set the force flag' % path)
            return
        shutil.rmtree(path)
    ignore = shutil.ignore_patterns('.ipynb_checkpoints', '*.pyc', '*~')
    tree_root = os.path.abspath(example_dir)
    if os.path.isdir(tree_root):
        shutil.copytree(tree_root, path, ignore=ignore, symlinks=True)
    else:
        print('Cannot find %s' % tree_root)
204007
public function examplesAction()
    {
        $kernelRootDir = $this->container->getParameter('kernel.root_dir');
        
        $propablyPhpPdfExamplesFilePaths = array($kernelRootDir.'/../vendor/PHPPdf/examples/index.php', $kernelRootDir.'/../vendor/psliwa/php-pdf/examples/index.php');

        foreach($propablyPhpPdfExamplesFilePaths as $propablyPhpPdfExamplesFilePath)
        {
            if(file_exists($propablyPhpPdfExamplesFilePath))
            {
                require $propablyPhpPdfExamplesFilePath;
                exit();
            }
        }

        throw new NotFoundHttpException('File with PHPPdf examples not found.');
    }