A semantic search engine for source code https://bitshift.benkurtovic.com/
Não pode escolher mais do que 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 
 
 

58 linhas
2.3 KiB

  1. __all__ = ["Codelet"]
  2. class Codelet(object):
  3. """
  4. A source-code object with code metadata and composition analysis.
  5. :ivar name: (str) A suitable name for the codelet.
  6. :ivar code: (str) A containing the raw source code.
  7. :ivar filename: (str, or None) The filename of the snippet.
  8. :ivar language: (int, or None) The inferred language of `code`.
  9. :ivar authors: (array of tuples (str, str or None)) An array of tuples
  10. containing an author's name and profile URL (on the service the code
  11. was pulled from).
  12. :ivar code_url: (str) The url of the (page containing the) source code.
  13. :ivar date_created: (:class:`datetime.datetime`, or None) The date the code
  14. was published.
  15. :ivar date_modified: (:class:`datetime.datetime`, or None) The date the
  16. code was last modified.
  17. :ivar rank: (float) A quanitification of the source code's quality, as
  18. per available ratings (stars, forks, upvotes, etc.).
  19. """
  20. def __init__(self, name, code, filename, language, authors, code_url,
  21. date_created, date_modified, rank):
  22. """
  23. Create a Codelet instance.
  24. :param name: see :attr:`self.name`
  25. :param code: see :attr:`self.code`
  26. :param filename: see :attr:`self.filename`
  27. :param language: see :attr:`self.language`
  28. :param authors: see :attr:`self.authors`
  29. :param code_url: see :attr:`self.code_url`
  30. :param date_created: see :attr:`self.date_created`
  31. :param date_modified: see :attr:`self.date_modified`
  32. :param rank: see :attr:`self.rank`
  33. :type name: see :attr:`self.name`
  34. :type code: see :attr:`self.code`
  35. :type filename: see :attr:`self.filename`
  36. :type language: see :attr:`self.language`
  37. :type authors: see :attr:`self.authors`
  38. :type code_url: see :attr:`self.code_url`
  39. :type date_created: see :attr:`self.date_created`
  40. :type date_modified: see :attr:`self.date_modified`
  41. :type rank: see :attr:`self.rank`
  42. """
  43. self.name = name
  44. self.code = code
  45. self.filename = filename
  46. self.language = language
  47. self.authors = authors
  48. self.code_url = code_url
  49. self.date_created = date_created
  50. self.date_modified = date_modified
  51. self.rank = rank