<commit_before>using System;
using System.Runtime.InteropServices;

namespace LibGPhoto2
{
	public enum CameraDriverStatus
	{
		Production,
		Testing,
		Experimental,
		Depreciated
	}
	
	public enum CameraOperation
	{
		None		= 0,
		CaptureImage	= 1 << 0,
		CaptureVideo	= 1 << 1,
		CaptureAudio	= 1 << 2,
		CapturePreview	= 1 << 3,
		Config		= 1 << 4
	}
	
	public enum CameraFileOperation
	{
		None		= 0,
		Delete		= 1 << 1,
		Preview		= 1 << 3,
		Raw			= 1 << 4,
		Audio		= 1 << 5,
		Exif		= 1 << 6
	}
	
	public enum CameraFolderOperation
	{
		None			= 0,
		DeleteAll		= 1 << 0,
		PutFile			= 1 << 1,
		MakeDirectory		= 1 << 2,
		RemoveDirectory		= 1 << 3
	}
	
	[StructLayout(LayoutKind.Sequential)]
	public unsafe struct CameraAbilities
	{
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string model;
		public CameraDriverStatus status;
		
		public PortType port;
		[MarshalAs(UnmanagedType.ByValArray, SizeConst=64)] public int[] speed;
		
		public CameraOperation operations;
		public CameraFileOperation file_operations;
		public CameraFolderOperation folder_operations;
		
		public int usb_vendor;
		public int usb_product;
		public int usb_class;
		public int usb_subclass;
		public int usb_protocol;
		
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)] public string library;
		[MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)] public string id;
		
		public int reserved1;
		public int reserved2;
		public int reserved3;
		public int reserved4;
		public int reserved5;
		public int reserved6;
		public int reserved7;
		public int reserved8;
	}
	
	public class CameraAbilitiesList : Object
	{
		public CameraAbilitiesList()
		{
			IntPtr native;

			Error.CheckError (gp_abilities_list_new (out native));

			this.handle = new HandleRef (this, native);
		}
		
		protected override void Cleanup ()
		{
			gp_abilities_list_free(this.handle);
		}
		
		public void Load (Context context)
		{
			unsafe {
				ErrorCode result = gp_abilities_list_load (this.Handle, context.Handle);
				
				if (Error.IsError (result))
					throw Error.ErrorException(result);
			}
		}
		
		public void Detect (PortInfoList info_list, CameraList l, Context context)
		{
			Error.CheckError (gp_abilities_list_detect (this.handle, info_list.Handle, 
								    l.Handle, context.Handle));
		}
		
		public int Count ()
		{
			ErrorCode result = gp_abilities_list_count (this.handle);

			if (Error.IsError (result)) 
				throw Error.ErrorException (result);

			return (int)result;
		}
		
		public int LookupModel (string model)
		{
			ErrorCode result = gp_abilities_list_lookup_model(this.handle, model);

			if (Error.IsError (result))
				throw Error.ErrorException (result);
	
			return (int)result;
		}
		
		public CameraAbilities GetAbilities (int index)
		{
			CameraAbilities abilities = new CameraAbilities ();

			Error.CheckError (gp_abilities_list_get_abilities(this.Handle, index, out abilities));

			return abilities;
		}
		
		public void Append (CameraAbilities abilities)
		{
			Error.CheckError (gp_abilities_list_append (this.Handle, ref abilities));
		}

		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_abilities_list_new (out IntPtr native);

		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_abilities_list_free (HandleRef list);
		
		[DllImport ("libgphoto2.so")]
		internal unsafe static extern ErrorCode gp_abilities_list_load (HandleRef list, HandleRef context);

		[DllImport ("libgphoto2.so")]
		internal unsafe static extern ErrorCode gp_abilities_list_detect (HandleRef list, HandleRef info_list, HandleRef l, HandleRef context);

		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_abilities_list_count (HandleRef list);

		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_abilities_list_lookup_model (HandleRef list, string model);

		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_abilities_list_get_abilities (HandleRef list, int index, out CameraAbilities abilities);

		[DllImport ("libgphoto2.so")]
		internal static extern ErrorCode gp_abilities_list_append (HandleRef list, ref CameraAbilities abilities);

	}
}<commit_msg>formatting<commit_after>using System;
using System.Runtime.InteropServices;

namespace LibGPhoto2
{
    public enum CameraDriverStatus
    {
        Production,
        Testing,
        Experimental,
        Depreciated
    }
    
    public enum CameraOperation
    {
        None            = 0,
        CaptureImage    = 1 << 0,
        CaptureVideo    = 1 << 1,
        CaptureAudio    = 1 << 2,
        CapturePreview  = 1 << 3,
        Config          = 1 << 4
    }
    
    public enum CameraFileOperation
    {
        None        = 0,
        Delete      = 1 << 1,
        Preview     = 1 << 3,
        Raw         = 1 << 4,
        Audio       = 1 << 5,
        Exif        = 1 << 6
    }
    
    public enum CameraFolderOperation
    {
        None                = 0,
        DeleteAll           = 1 << 0,
        PutFile             = 1 << 1,
        MakeDirectory       = 1 << 2,
        RemoveDirectory     = 1 << 3
    }
    
    [StructLayout(LayoutKind.Sequential)]
    public unsafe struct CameraAbilities
    {
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst=128)] public string model;
        public CameraDriverStatus status;
        
        public PortType port;
        [MarshalAs(UnmanagedType.ByValArray, SizeConst=64)] public int[] speed;
        
        public CameraOperation operations;
        public CameraFileOperation file_operations;
        public CameraFolderOperation folder_operations;
        
        public int usb_vendor;
        public int usb_product;
        public int usb_class;
        public int usb_subclass;
        public int usb_protocol;
        
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)] public string library;
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst=1024)] public string id;
        
        public int reserved1;
        public int reserved2;
        public int reserved3;
        public int reserved4;
        public int reserved5;
        public int reserved6;
        public int reserved7;
        public int reserved8;
    }
    
    public class CameraAbilitiesList : Object
    {
        public CameraAbilitiesList()
        {
            IntPtr native;

            Error.CheckError (gp_abilities_list_new (out native));

            this.handle = new HandleRef (this, native);
        }
        
        protected override void Cleanup ()
        {
            gp_abilities_list_free(this.handle);
        }
        
        public void Load (Context context)
        {
            unsafe {
                ErrorCode result = gp_abilities_list_load (this.Handle, context.Handle);
                
                if (Error.IsError (result))
                    throw Error.ErrorException(result);
            }
        }
        
        public void Detect (PortInfoList info_list, CameraList l, Context context)
        {
            Error.CheckError (gp_abilities_list_detect (this.handle, info_list.Handle, 
                                                        l.Handle, context.Handle));
        }
        
        public int Count ()
        {
            ErrorCode result = gp_abilities_list_count (this.handle);

            if (Error.IsError (result)) 
                throw Error.ErrorException (result);

            return (int)result;
        }
        
        public int LookupModel (string model)
        {
            ErrorCode result = gp_abilities_list_lookup_model(this.handle, model);

            if (Error.IsError (result))
                throw Error.ErrorException (result);
    
            return (int)result;
        }
        
        public CameraAbilities GetAbilities (int index)
        {
            CameraAbilities abilities = new CameraAbilities ();

            Error.CheckError (gp_abilities_list_get_abilities(this.Handle, index, out abilities));

            return abilities;
        }
        
        public void Append (CameraAbilities abilities)
        {
            Error.CheckError (gp_abilities_list_append (this.Handle, ref abilities));
        }

        [DllImport ("libgphoto2.so")]
        internal static extern ErrorCode gp_abilities_list_new (out IntPtr native);

        [DllImport ("libgphoto2.so")]
        internal static extern ErrorCode gp_abilities_list_free (HandleRef list);
        
        [DllImport ("libgphoto2.so")]
        internal unsafe static extern ErrorCode gp_abilities_list_load (HandleRef list, HandleRef context);

        [DllImport ("libgphoto2.so")]
        internal unsafe static extern ErrorCode gp_abilities_list_detect (HandleRef list, HandleRef info_list, HandleRef l, HandleRef context);

        [DllImport ("libgphoto2.so")]
        internal static extern ErrorCode gp_abilities_list_count (HandleRef list);

        [DllImport ("libgphoto2.so")]
        internal static extern ErrorCode gp_abilities_list_lookup_model (HandleRef list, string model);

        [DllImport ("libgphoto2.so")]
        internal static extern ErrorCode gp_abilities_list_get_abilities (HandleRef list, int index, out CameraAbilities abilities);

        [DllImport ("libgphoto2.so")]
        internal static extern ErrorCode gp_abilities_list_append (HandleRef list, ref CameraAbilities abilities);
    }
}
{'fraction_non_alphanumeric': 0.07864088043594401, 'fraction_numerical': 0.013035580724436372, 'mean_word_length': 2.5174746335963922, 'pattern_counts': {'":': 0, '<': 59, '<?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': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '2821052', 'n_tokens_mistral': 2945, 'n_tokens_neox': 2600, 'n_words': 706}