A semantic search engine for source code https://bitshift.benkurtovic.com/
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 
 
 
 

46 líneas
1.7 KiB

  1. __all__ = ["Codelet"]
  2. class Codelet(object):
  3. """
  4. A source-code object with code metadata and composition analysis.
  5. :ivar code: (str) A containing the raw source code.
  6. :ivar filename: (str, or None) The filename of the snippet.
  7. :ivar language: (str, or None) The inferred language of `code`.
  8. :ivar author: (str, or None) The name of the code's author.
  9. :ivar url: (str) The url of the (page containing the) source code.
  10. :ivar date_created: (str, or None) The date the code was published.
  11. :ivar date_modified: (str, or None) The date the code was last modified.
  12. """
  13. def __init__(self, code, filename, author, language, code_url, author_url,
  14. date_created, date_modified):
  15. """
  16. Create a Codelet instance.
  17. :param code: The raw source code.
  18. :param filename: The filename of the code, if any.
  19. :param author: The author of the code.
  20. :param language: The inferred language.
  21. :param code_url: The url of the (page containing the) source code.
  22. :param date_created: The date the code was published.
  23. :param date_modified: The date the code was last modified.
  24. :type code: str
  25. :type filename: str, or None
  26. :type language: str, or None
  27. :type author: str, or None
  28. :type url: str
  29. :type date_created: str, or None
  30. :type date_modified: str, or None
  31. """
  32. self.code = code
  33. self.filename = filename
  34. self.author = author
  35. self.language = language
  36. self.code_url = code_url
  37. self.author_url = author_url
  38. self.date_created = date_created
  39. self.date_modified = date_modified