A semantic search engine for source code https://bitshift.benkurtovic.com/
Nie możesz wybrać więcej, niż 25 tematów Tematy muszą się zaczynać od litery lub cyfry, mogą zawierać myślniki ('-') i mogą mieć do 35 znaków.
 
 
 
 
 
 

51 wiersze
2.0 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: (str, or None) The inferred language of `code`.
  9. :ivar authors: (array of str tuples) An array of tuples containing an
  10. author's name and profile URL (on the service the code was pulled from).
  11. :ivar code_url: (str) The url of the (page containing the) source code.
  12. :ivar date_created: (str, or None) The date the code was published.
  13. :ivar date_modified: (str, or None) The date the code was last modified.
  14. """
  15. def __init__(self, name, code, filename, language, authors, code_url,
  16. date_created, date_modified):
  17. """
  18. Create a Codelet instance.
  19. :param name: The name of the codelet.
  20. :param code: The raw source code.
  21. :param filename: The filename of the code, if any.
  22. :param language: The inferred language.
  23. :param authors: An array of tuples containing an author's name and
  24. profile URL (on the service the code was pulled from).
  25. :param code_url: The url of the (page containing the) source code.
  26. :param date_created: The date the code was published.
  27. :param date_modified: The date the code was last modified.
  28. :type name: str
  29. :type code: str
  30. :type filename: str, or None
  31. :type language: str, or None
  32. :type authors: array of str tuples, or None
  33. :type code_url: str
  34. :type date_created: str, or None
  35. :type date_modified: str, or None
  36. """
  37. self.name = name
  38. self.code = code
  39. self.filename = filename
  40. self.language = language
  41. self.authors = authors
  42. self.code_url = code_url
  43. self.date_created = date_created
  44. self.date_modified = date_modified