<commit_before>import re
import itertools
import maya.OpenMaya as om
import maya.cmds as cmds
from blur3d.api.abstract.abstractscenewrapper import AbstractSceneWrapper
from blur3d.api import ExceptionRouter

class MayaSceneWrapper( AbstractSceneWrapper ):
	#--------------------------------------------------------------------------------
	#							Making OpenMaya pythonic
	#--------------------------------------------------------------------------------
	@classmethod
	def _asMOBject(cls, obj):
		''' When passed a object name it will convert it to a MObject. If passed a MObject, it will return the MObject
		:param obj: A MObject or object name to return as a MObject
		'''
		if isinstance(obj, basestring):
			sel = om.MSelectionList()
			sel.add(obj)
			obj = om.MObject()
			sel.getDependNode(0, obj)
		return obj
	
	@classmethod
	def _getAttributeDataType(cls, data):
		""" Returns the OpenMaya.MFnData id for the given object. Returns OpenMaya.MFnData.kInvalid
		if the object type could not be identified.
		:param data: the object to get the data type of
		:return: int value for the dataType
		"""
		dataType = om.MFnData.kInvalid
		if isinstance(data, basestring):
			dataType = om.MFnData.kString
		elif isinstance(value, float):
			dataType = om.MFnData.kFloatArray
		elif isinstance(value, int):<commit_msg>You can now pass a pymel node to create the SceneObject<commit_after>import re
import itertools
import maya.OpenMaya as om
import maya.cmds as cmds
from blur3d.api.abstract.abstractscenewrapper import AbstractSceneWrapper
from blur3d.api import ExceptionRouter

class MayaSceneWrapper( AbstractSceneWrapper ):
	#--------------------------------------------------------------------------------
	#							Making OpenMaya pythonic
	#--------------------------------------------------------------------------------
	@classmethod
	def _asMOBject(cls, obj):
		''' When passed a object name it will convert it to a MObject. If passed a MObject, it will return the MObject
		:param obj: A MObject or object name to return as a MObject
		'''

		if isinstance(obj, basestring):
			sel = om.MSelectionList()
			sel.add(obj)
			obj = om.MObject()
			sel.getDependNode(0, obj)
		elif obj.__module__.startswith("pymel"):
			obj = obj.__apimfn__().object()

		return obj
	
	@classmethod
	def _getAttributeDataType(cls, data):
		""" Returns the OpenMaya.MFnData id for the given object. Returns OpenMaya.MFnData.kInvalid
		if the object type could not be identified.
		:param data: the object to get the data type of
		:return: int value for the dataType
		"""
		dataType = om.MFnData.kInvalid
		if isinstance(data, basestring):
			dataType = om.MFnData.kString
		elif isinstance(value, float):
			dataType = om.MFnData.kFloatArray
		elif isinstance(value, int):
{'fraction_non_alphanumeric': 0.1856936416184971, 'fraction_numerical': 0.002167630057803468, 'mean_word_length': 2.483018867924528, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '223871', 'n_tokens_mistral': 854, 'n_tokens_neox': 786, 'n_words': 269}