def sample(self, sample_size=<NUM_LIT:20>):
context = str(self.context)<EOL>request_url = build_url_endpoint(self.ENDPOINT, context)<EOL>request_params = dict(self.request_params)<EOL>try:<EOL><INDENT>if sample_size > <NUM_LIT:100>:<EOL><INDENT>raise UrlSyntaxError(<EOL>'<STR_LIT>' % str(sample_size)<EOL>)<EOL><DEDENT><DEDENT>except TypeError:<EOL><INDENT>raise UrlSyntaxError(<EOL>'<STR_LIT>' % str(sample_size)<EOL>)<EOL><DEDENT>request_params['<STR_LIT>'] = sample_size<EOL>return self.__class__(request_url, request_params, context, self.etiquette)<EOL>
This method retrieve an iterable object that implements the method
__iter__. The arguments given will compose the parameters in the
request url.

kwargs: sample_size (Integer) between 0 and 100.

return: iterable object of Works metadata

Example:
    >>> from crossref.restful import Works
    >>> works = Works()
    >>> works.sample(2).url
    'https://api.crossref.org/works?sample=2'
    >>> [i['title'] for i in works.sample(2)]
    [['A study on the hemolytic properties ofPrevotella nigrescens'],
    ['The geometry and the radial breathing mode of carbon nanotubes: beyond the ideal behaviour']]