A semantic search engine for source code https://bitshift.benkurtovic.com/
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.
 
 
 
 
 
 

60 rindas
2.4 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. :ivar symbols: (dict) Dictionary containing dictionaries of functions, classes,
  20. variable definitions, etc.
  21. """
  22. def __init__(self, name, code, filename, language, authors, code_url,
  23. date_created, date_modified, rank):
  24. """
  25. Create a Codelet instance.
  26. :param name: see :attr:`self.name`
  27. :param code: see :attr:`self.code`
  28. :param filename: see :attr:`self.filename`
  29. :param language: see :attr:`self.language`
  30. :param authors: see :attr:`self.authors`
  31. :param code_url: see :attr:`self.code_url`
  32. :param date_created: see :attr:`self.date_created`
  33. :param date_modified: see :attr:`self.date_modified`
  34. :param rank: see :attr:`self.rank`
  35. :type name: see :attr:`self.name`
  36. :type code: see :attr:`self.code`
  37. :type filename: see :attr:`self.filename`
  38. :type language: see :attr:`self.language`
  39. :type authors: see :attr:`self.authors`
  40. :type code_url: see :attr:`self.code_url`
  41. :type date_created: see :attr:`self.date_created`
  42. :type date_modified: see :attr:`self.date_modified`
  43. :type rank: see :attr:`self.rank`
  44. """
  45. self.name = name
  46. self.code = code
  47. self.filename = filename
  48. self.language = language
  49. self.authors = authors
  50. self.code_url = code_url
  51. self.date_created = date_created
  52. self.date_modified = date_modified
  53. self.rank = rank