r_bin_java_line_number_table_attr_new

In C, write a function to create a new Java line number table attribute from a binary buffer.


decode_studio_vop_header

Write a C function to decode the header of a studio video object plane (VOP) for an MPEG4 decoder context.


str_lower_case_match

Write a C function named `str_lower_case_match` that compares two strings for equality, considering case insensitivity, using Oniguruma encoding functions.


HPHP::SimpleParser::handleBackslash

Write a C++ function to process escape sequences in a JSON string and convert them to their corresponding characters.


avr_op_analyze

Write a C function named `avr_op_analyze` for analyzing AVR opcodes and updating the analysis structure.


uas_switch_interface

Write a C function named `uas_switch_interface` that switches the USB interface to an alternate setting for a given USB device and interface.


sh_op

Write a C function named `sh_op` that initializes an `RAnalOp` structure for a given operation.


ReadPSDChannelPixels

In C, write a function to process and assign pixel values to an image channel based on the PSD format.


ape_decode_frame

Write a C function named `ape_decode_frame` for decoding an audio frame in the APE codec.


WriteImageChannels

In C, write a function to handle writing image channel data with optional RLE compression and color space considerations.


HPHP::string_rfind

Write a C++ function named `string_rfind` that finds the last occurrence of a substring within a string, with options for case sensitivity and starting position.


store_versioninfo_gnu_verdef

Write a C function named `store_versioninfo_gnu_verdef` that processes version definition sections in an ELF binary and stores the information in a database.


enc_untrusted_recvfrom

Write a C++ function `enc_untrusted_recvfrom` that wraps a system call to receive data from a socket, handling errors and converting address formats.


license_read_new_or_upgrade_license_packet

In C, write a function to process a new or upgraded license packet for Remote Desktop Protocol (RDP) licensing.


start

Write a Python function to inject a backdoor into a Java application by modifying its manifest and main class, then recompiling and repackaging it.


_map_vol_to_host

Write a Python function to map a storage volume to a host, handling existing mappings and LUN allocation.


_delete_vdisk

Write a Python function to delete a virtual disk with an option to force deletion, handling necessary pre-deletion checks and mappings.


_cliq_run

Write a Python function that executes a command with arguments over SSH without parsing the results.


_set_qos_rule

Write a Python function to construct and execute a command for setting Quality of Service (QoS) rules based on provided parameters.


get_lines

Write a Python function named `get_lines` that executes a given command and returns the output as a list of stripped strings.


_modify_3par_iscsi_host

Write a Python function to add an iSCSI host to a 3PAR system without persona or domain options.


run_interactive_shell_command

Write a Python function that acts as a context manager to run shell commands interactively, handling stdin, stdout, and stderr streams.


delete_video

Write a Python Flask function to delete a video file and its database record if the logged-in user owns it.


whitelist

Write a Python function that processes a string of usernames and executes a command for each valid username.


test_create_host

Write a Python unit test function that mocks SSH commands for creating and verifying a host in an HP 3PAR storage system.


do_setup

Write a Python function named `do_setup` that initializes storage configuration and checks for pool existence, compression support, and node details.


_execute_command_and_parse_attributes

In Python, write a function to execute an SSH command, parse the output into attributes, and handle any execution errors.


test_get_iscsi_ip_active

Write a Python unit test function that mocks SSH commands to retrieve an active iSCSI IP address.


_find_host_from_wwpn

In Python, write a function to find a host's name using a WWPN (World Wide Port Name) by executing an SSH command and parsing the output.


extend_volume

Write a Python function to increase the size of a storage volume using SSH commands, ensuring no snapshots exist.


_get_host_from_connector

Write a Python function to retrieve a host name from storage based on connection information, using SSH for commands.


_get_hostvdisk_mappings

Write a Python function to fetch and parse storage mappings for a given host using SSH.


main

Write a Python script that continuously monitors the clipboard for new text and fetches definitions from Dictionary.com and UrbanDictionary.com if the text is a single word or a phrase with less than five words.


_get_vvset_from_3par

Write a Python function to extract the name of a Virtual Volume Set by simulating the deletion of a volume in 3PAR and parsing the error message.


_get_flashcopy_mapping_attributes

Write a Python function to fetch and parse FlashCopy mapping attributes using SSH commands.


_add_volume_to_volume_set

Write a Python function to add a volume to a volume set, optionally creating the set and applying QoS rules if the set doesn't exist.


test_initialize_connection

Write a Python unit test that mocks the execution of an iSCSI volume access creation command and verifies the initialization of a connection by comparing the returned iSCSI properties with expected fake properties.


test_create_invalid_host

Write a Python unit test function that mocks SSH commands for creating a host in an HP 3PAR storage system and checks the host's name.


get_logs

Write a Python Flask endpoint to serve a log file from an upload directory, validating the session ID and handling invalid requests.


_make_fc_map

Write a Python function to create a FlashCopy mapping between a source and target, with an option for a full copy.


test_get_iscsi_ip

Write a Python unit test function that mocks SSH commands to retrieve iSCSI IP information and asserts the expected IP address.


usage

Write a Python function named `usage` that returns disk usage information for mounted volumes, with optional arguments for additional flags.


_get_fc_wwpns

In Python, write a function to update the WWPN list of storage nodes by executing an SSH command and parsing the response.


ls

Write a Python function that lists files in JSON format at a given path using rclone, handling exceptions.


_run_ssh

Write a Python function to execute an SSH command using a connection pool, with retry logic on failure.


verify

Write a Python function named `verify` that formats credentials, executes an `rclone lsjson` command, and returns a success or error message.


add_extra_args

Write a Python function that extends argument parsing with additional arguments based on existing parsed arguments.


_get_vdisk_fc_mappings

Write a Python function to fetch and return the IDs of FlashCopy mappings for a given virtual disk using SSH commands.


test_create_host

Write a Python unit test function that mocks SSH commands for creating and verifying an iSCSI host.


_copy_volume

Write a Python function to construct a command for cloning a volume with optional parameters for CPG and snapshot CPG, and a flag for thin provisioning.


_get_active_nsp

Write a Python function to retrieve the active network service provider (NSP) for a specified host by parsing CLI command output.


initialize_connection

Write a Python function to set up restricted access to a storage volume using iSCSI, handling CHAP authentication if configured.


mkdir

Write a Python function to create a directory using rclone with error handling.


populate_custom_grains_and_pillar

Write a Python function to retrieve and set custom grains and pillar data from a configuration file using SaltStack commands.


copy

Write a Python function named `copy` that handles file copying with rclone, including local and remote sources and destinations, and manages job IDs.


IsBlacklistedArg

Write a C++ function to check if a command-line argument is blacklisted, considering platform-specific character encoding and argument prefixes.


_remove_volume_from_volume_set

Write a Python function to execute a command-line instruction that removes a volume from a volume set.


handle_message

Write a Python function `handle_message` that processes AMQP messages to run workflows or views based on the message content.


_add_chapsecret_to_host

Write a Python function to generate a CHAP secret and execute an SSH command to apply it to a host.


_call_prepare_fc_map

Write a Python function that attempts to run an SSH command for preparing a FlashCopy map and logs an error if it fails.


bin_symbols

Write a C function to process and print binary symbols in various formats based on the given mode.


on_message

Write a Python function that displays a notification with a title and message when a certain condition is met, with an optional timeout parameter.


podbeuter::pb_controller::play_file

Write a C++ function named `play_file` in a class `pb_controller` that executes a media player command using a file path, handling quotes in the file path.


_find_host_exhaustive

Write a Python function that searches for a host with matching iSCSI or WWPN attributes in a list of hosts using SSH commands.


_create_vdisk

Write a Python function to create a virtual disk with options for size, auto-expansion, easy tier, and compression.


test_invalid_iscsi_ip

Write a Python unit test that mocks SSH commands to validate iSCSI IP configuration.


get_output

Write a Python function that executes a system command and returns the output.


openscript

In C, write a function `openscript` that takes a script name and a flag to execute directly, handling script nesting and environment expansion.


add_user

Write a Python function named `add_user` that creates a new system user with a password and adds them to the 'docker' and 'wheel' groups.


write_section

In Python, write a function to format and append a configuration section with sorted keys to a list, ensuring no newlines or closing braces are present in the values.


_update_volume_stats

Write a Python function to update storage volume statistics with IBM vendor details and capacity information.


test_create_modify_host

Write a Python unit test function that mocks SSH commands for creating and verifying a host in an HP 3PAR storage system.


install

Write a Python function named `install` that unpacks a tar file and runs an installation script within it to a specified target directory, then cleans up the installation files.


_get_least_used_nsp

Write a Python function to find the network storage processor (nsp) with the fewest active volume logical units (vluns) from a list.


_start_fc_map

Write a Python function to initiate a FlashCopy operation over SSH and handle any execution errors with logging.


resolve_hostname

Write a Python function using a decorator to assert that a given hostname can be resolved using nslookup in a Kubernetes pod.


_modify_3par_fibrechan_host

Write a Python function to add WWNs to a Fibre Channel host on a 3PAR storage system without including persona or domain options.


test_settings_path_skip_issue_909

Write a Python test function that creates a temporary directory structure to simulate skipping files with isort configuration and verifies the behavior.


_create_3par_fibrechan_host

Write a Python function to create a 3PAR Fibre Channel host, handling potential WWN conflicts.


take_bug_report

Write a Python function to capture a bug report from a device, save it to a file, and handle different versions of the bug reporting tool.


test_create_invalid_host

Write a Python unit test function that mocks SSH commands for creating a host on an HP 3PAR storage system.


__getattr__.adb_call

Create a Python function named `adb_call` that serves as a wrapper for executing ADB (Android Debug Bridge) commands with optional arguments and shell execution flag.


test_skip_paths_issue_938

Write a Python test function that checks if the 'isort' tool respects skip patterns specified in its configuration file.


_ensure_vdisk_no_fc_mappings

Write a Python function to check and handle FlashCopy mappings for a virtual disk, with an option to allow snapshots.


tcp_forward

Write a Python function named `tcp_forward` that sets up TCP forwarding between a specified host port and an Android device port.


repack

In Python, write a function named `repack` that downloads and installs specific Rust packages for a given host and target platforms, then repackages them into a tarball.


extend_volume

Write a Python function to resize a storage volume by increasing its size and log the operation.


_remove_volume_set

Write a Python function to clear QoS rules and remove a volume set using CLI commands.


_get_3par_hostname_from_wwn_iqn

Write a Python function that takes a string or list of strings and returns the hostname associated with a WWN or IQN from a storage system's CLI output.


get_ports

Write a Python function to parse and return active FC and iSCSI port details from CLI output.


test_get_least_used_nsp

Write a Python unit test function that mocks an SSH command to determine the least used network service provider.


_cmd_to_dict

Write a Python function that converts a command string or list into a dictionary of arguments, handling special cases for two-word commands.


_cli_run

Write a Python function that executes a given command over SSH and returns the output, excluding the first five lines and the last two lines.


_call_external_zip

Write a Python function to execute an external `zip` command with options for verbosity and dry run, and optionally log the command.


_create_host

Write a Python function to create a storage system host with a unique name and associated connection ports.


_get_iscsi_ip_addrs

Write a Python function to parse iSCSI port IP addresses from a configuration generator and store them in a storage node dictionary.


talk

Create a Python function named `talk` that processes a string to fetch a tweet if it contains the word "twitter" and then uses the `espeak` tool to convert the text to speech, saving it to a WAV file before playing it.


_exec_cmd

In Python, write a function to execute adb commands and handle the output based on the command's success or failure.


_get_conn_fc_wwpns

Write a Python function to retrieve a list of WWPNs for a given host by parsing the output from a command-line storage query.


_create_3par_iscsi_host

Write a Python function to create an iSCSI host on a 3PAR system, handling potential conflicts with existing IQNs.


_delete_3par_host

Write a Python function named `_delete_3par_host` that takes a hostname as an argument and calls a method `_cli_run` to execute a command to remove that host.


process_statistics

Write a Python function that filters out certain files and asynchronously runs a command with arguments based on metadata.


_delete_host

Write a Python function to delete a host from a storage system using SSH commands, with debug logging before and after the operation.


fetch

Write a Python function to download and verify a package from a given URL using checksums and cryptographic signatures.


_formatCredentials

Write a Python function to format cloud storage credentials into a string or dictionary based on the storage type.


initHeader

In Python, write a method to initialize an Ethernet and IP header with ARP resolution and field definitions.


poll

Write a Python function that attempts an RDP connection using given credentials and server details, returning the connection status.


terminate_connection

Write a Python function to clean up resources after an iSCSI connection is terminated.


_port_conf_generator

Write a Python function named `_port_conf_generator` that takes a command, executes it via SSH, and yields parsed port configuration data.


multiSelect

Write a function in C for SQLite that handles the execution of compound SELECT queries with specific handling for UNION, INTERSECT, and EXCEPT operations.


r_pkcs7_parse_cms

Write a function in C that parses a CMS (Cryptographic Message Syntax) structure from a given buffer and length, returning a pointer to the parsed CMS object or NULL on failure.


ReadDCMImage

Write a function in C to read and process DICOM medical images.


hash_accept

Write a C function named `hash_accept` that handles the acceptance of a new hash algorithm socket connection and the transfer of its state.


php_wddx_pop_element

Write a PHP function that handles the end of an XML element during WDDX deserialization.


prplcb_xfer_new_send_cb

Write a C function to initialize a file transfer callback in the BitlBee instant messaging client.


changedline

Write a C function named `changedline` that checks if the execution line has changed between two program counters within a Lua function prototype.


exprListAppendList

Write a C function to append one expression list to another in SQLite, with an option to convert integers to NULL.


inet_rtm_getroute

Write a C function named `inet_rtm_getroute` that processes a routing message to get a route in the Linux kernel networking stack.


LookupModMask

Write a C function named `LookupModMask` that determines the modifier mask for a given string representation of a keyboard modifier.


validate_as_request

Write a C function named `validate_as_request` that checks various conditions for a Kerberos Authentication Service request, returning error codes and setting status messages accordingly.


rfcomm_sock_bind

Write a C function for binding an RFCOMM Bluetooth socket to an address.


AP4_HdlrAtom::AP4_HdlrAtom

Write a C++ constructor for the `AP4_HdlrAtom` class that initializes an atom and reads its handler type and name from a byte stream.


generatePreview

In C++, write a function to generate a resized preview image from an input file with adjustable exposure.


kvm_vm_ioctl_check_extension

Write a C function named `kvm_vm_ioctl_check_extension` that checks if a specified KVM extension is supported, considering whether the system is running in HV mode.


handle_client_startup

Write a C function `handle_client_startup` to process different types of startup packets for a PostgreSQL client connection.


mrb_class_real

Write a function in C that returns the first non-singleton and non-included class in a class hierarchy, or NULL if not found.


nsv_read_chunk

Write a C function named `nsv_read_chunk` that reads a chunk of NSV format data from a given AVFormatContext.


_kdc_as_rep

Write a function in C that processes an AS-REQ (Authentication Service Request) for Kerberos 5.


formUpdateBuffer

In C, write a function `formUpdateBuffer` to update the contents of a buffer with form input data based on the position of an anchor.


lexer_process_char_literal

In C, write a function to process character literals in a lexer, handling escape sequences and ensuring they don't exceed predefined limits.


unimac_mdio_probe

Write a C function for probing a Broadcom UniMAC MDIO bus in a Linux kernel driver.


hi3660_stub_clk_probe

Write a C function for initializing a clock in the hi3660 platform driver.


assoc_array_insert_into_terminal_node

Write a C function to insert or replace a key in an associative array node, handling node splits if necessary.


ipv4_pktinfo_prepare

Write a C function named `ipv4_pktinfo_prepare` that prepares packet information for an IPv4 socket in a Linux kernel environment.


dex_parse_debug_item

Write a C function to parse debug information from a DEX file in C.


rds_cmsg_atomic

Write a C function named `rds_cmsg_atomic` that processes atomic operations in RDS messages.


AP4_AtomFactory::CreateAtomFromStream

Write a C++ function in AP4_AtomFactory that creates an atom from a stream based on type and size.


imcb_file_send_start

Write a C function named `imcb_file_send_start` that initiates a file transfer if possible, returning a pointer to the transfer structure or NULL.


mpeg4video_probe

Write a C function named `mpeg4video_probe` that checks for MPEG-4 video signatures in a buffer and returns a score based on specific criteria.


megasas_alloc_cmds

Write a C function named `megasas_alloc_cmds` that allocates command structures for a `megasas_instance` and initializes a frame pool.


IRC_PROTOCOL_CALLBACK

In C, write a function to handle IRC protocol 352 messages, parsing user details and updating channel and nick information.


xfs_attr_shortform_to_leaf

Write a C function named `xfs_attr_shortform_to_leaf` that converts short-form attributes to leaf-form in the XFS filesystem.


lys_restr_dup

Write a C function `lys_restr_dup` to duplicate an array of `lys_restr` structures, handling memory allocation and deep copying of contained strings and extensions.


nfc_genl_deactivate_target

Write a C function to deactivate an NFC target by putting it into sleep mode, handling errors for invalid device or target indices.


dnxhd_find_frame_end

Write a C function to detect the end of a frame in a DNXHD video stream buffer.


__rds_rdma_map

Write a C function named `__rds_rdma_map` that maps a user buffer for RDMA operations and returns a cookie for the mapped memory region.


daemon_AuthUserPwd

Write a C function named `daemon_AuthUserPwd` that authenticates a user by username and password, handling both Windows and UNIX systems.


run

Write a C++ function named `run` that processes command-line options to load, compile, link, and execute a WebAssembly module.


open_ssl_connection

Write a C function to establish an SSL connection with optional certificate verification and error handling.


copyIPv6IfDifferent

Write a C function named `copyIPv6IfDifferent` that copies an IPv6 address from source to destination if they are different, with the second version also checking if the source is not NULL.


archive_acl_from_text_l

Write a C function to parse ACL entries from a text string and add them to an ACL object.


avcodec_open2

Write a C function in FFmpeg to open a codec context with given options.


tflite::Subgraph::Invoke

Write a C++ function named `Invoke` in the `Subgraph` class of TensorFlow Lite that checks model consistency, prepares tensors, and invokes operations in order.


store_versioninfo_gnu_verdef

Write a C function named `store_versioninfo_gnu_verdef` that processes GNU version definition sections from an ELF binary object.


upnp_redirect

In C, write a function `upnp_redirect` to manage port forwarding rules for UPnP, including permission checks and updating existing mappings.


WriteOnePNGImage

Write a function in C to output a single PNG image using libpng, handling various color types and compression settings.


ReadPSDChannel

In C, write a function to read a channel from a PSD file, handling different compression types and optional masks.


keyctl_read_key

Write a C function named `keyctl_read_key` that reads data from a specified key into a buffer, handling permissions and errors.


ExprResolveLhs

Write a C function named `ExprResolveLhs` that resolves left-hand side expressions in an XKB context.


tar_directory_for_file

Write a C function to navigate or create directories within a TAR file based on a given path.


crypto_skcipher_init_tfm

Write a C function named `crypto_skcipher_init_tfm` that initializes a symmetric key cipher transformation context.


fm10k_init_module

Write a Linux kernel module initialization function in C that logs the driver version, allocates a workqueue, initializes debugging, and registers a PCI driver, handling potential memory allocation failure.


parse_class

Write a C function to parse and process class information from a DEX file.


lexer_process_char_literal

In C, write a function to process character literals in a parser context, handling escape sequences and ensuring they don't exceed predefined limits.


mrb_obj_clone

Write a function in C for the MRuby engine that clones an object, handling immediate values and singleton classes, and preserving the original object's frozen state.


big_key_init

Write a C function for Linux kernel module initialization that registers a new key type and optionally sets up cryptographic components.


flattenSubquery

Write a function in C that flattens a subquery within an outer SELECT statement in SQLite.


CompileKeymap

In C, write a function `CompileKeymap` that compiles a keymap from XkbFile sections, handling duplicates and missing sections.


avpriv_ac3_parse_header

Write a C function named `avpriv_ac3_parse_header` that initializes a bit context and parses the AC3 header from a buffer, returning the number of bits read.


mailimf_group_parse

Write a C function to parse an email group from a string, handling memory allocation and errors.


srpt_handle_tsk_mgmt

Write a C function named `srpt_handle_tsk_mgmt` that processes task management requests for an RDMA channel in a storage protocol.


ResolveStateAndPredicate

In C, write a function `ResolveStateAndPredicate` that processes an expression to determine a matching operation and modifier mask for keyboard input compatibility.


GetOutboundPinholeTimeout

Write a C function named `GetOutboundPinholeTimeout` that handles a SOAP request to retrieve the timeout for an outbound pinhole in a UPnP service.


AP4_AtomSampleTable::GetSample

In C++, write a function to retrieve a media sample from an MP4 file's atom sample table by its index.


acc_ctx_cont

Write a C function named `acc_ctx_cont` that processes a security token in a SPNEGO context and updates the negotiation state.


chmd_read_headers

Write a C function to read and process CHM file headers and directory chunks.


filter_session_io

Write a C function named `filter_session_io` that processes IO events for a session, handling data input and disconnection.


x86_decode_insn

Write a C function named `x86_decode_insn` that decodes an x86 instruction from a given context, instruction pointer, and length.


expand_downwards

Write a C function named `expand_downwards` that adjusts the starting address of a virtual memory area to accommodate stack growth.


disk_seqf_stop

Write a C function named `disk_seqf_stop` that cleans up an iterator for a sequence file, ensuring memory is freed and the iterator is reset if necessary.


dbd_st_fetch

Write a Perl function to fetch a row of data from a MySQL database using the DBI module.


Magick::Image::read

In C++, write a function within the Magick::Image class to read an image, ensuring only a single frame is retained and handling exceptions if no image is loaded.


sctp_do_peeloff

Write a C function named `sctp_do_peeloff` that peels off an SCTP association from a socket and creates a new socket for it.


ap_limit_section

Write a C function to parse and apply method restrictions within Apache's configuration directives.


do_mq_notify

Write a C function named `do_mq_notify` that sets up message queue notifications.


xc2028_set_config

Write a C function named `xc2028_set_config` that updates the configuration of a DVB frontend device and handles firmware requests.


snd_pcm_period_elapsed

Write a C function named `snd_pcm_period_elapsed` that handles the end-of-period interrupt for a PCM audio substream.


wwunpack

Write a C function named `wwunpack` that decompresses and updates a given executable section.


__ext4_journal_stop

Write a C function named `__ext4_journal_stop` that stops a journaling handle and handles errors appropriately.


blk_rq_map_user_iov

Write a C function named `blk_rq_map_user_iov` that maps a user I/O vector to a request queue and handles errors.


mif_process_cmpt

Write a C function to parse component information from a buffer and add it to a MIF header, handling errors appropriately.


onig_new_deluxe

Write a C function named `onig_new_deluxe` that initializes a new regular expression object with error handling.


usb_sg_cancel

Write a C function named `usb_sg_cancel` that cancels scatter-gather USB requests and handles locking and error reporting.


ip4_datagram_release_cb

In C, write a function named `ip4_datagram_release_cb` that manages the release of an IPv4 datagram's resources associated with a socket.


mark_context_stack

Write a function in C for the MRuby engine that marks the stack context for garbage collection.


shadow_server_start

Write a C function named `shadow_server_start` that initializes a remote desktop protocol shadow server, handling network setup and thread creation.


Curl_close

Write a function in C to clean up and close a libcurl easy handle.


ExprAppendMultiKeysymList

Write a C function to append one keysym list to another and update indices, then free the appended structure.


mm_init

Write a function in C to initialize a memory management structure with default values and set up its context for a given task and user namespace.


PHP_MINIT_FUNCTION

Write a PHP initialization function to set up SPL array classes with their respective handlers and interfaces.


do_get_mempolicy

Write a C function to retrieve memory policy and node mask information for a given address and flags.


wddx_stack_destroy

Write a function in C to destroy a stack, deallocating any dynamic memory used by its elements.


regulator_ena_gpio_free

Write a C function to release a GPIO pin associated with a regulator device when it's no longer in use.


usb_console_setup

Write a C function named `usb_console_setup` for setting up a USB console with configurable baud rate, parity, and data bits.


ipxitf_ioctl

Write a C function named `ipxitf_ioctl` that handles IPX network interface control commands.


PHP_MINIT_FUNCTION

Write a PHP function to initialize the Zip extension with object-oriented features and resource destructors.


get_task_ioprio

Write a C function named `get_task_ioprio` that retrieves the I/O priority of a given task, using a `task_struct` pointer, and includes proper synchronization if necessary.


SetImageType

In C, write a function to change the type of an image using ImageMagick's API.


updateDevice

In C, write a function `updateDevice` to manage a device list by updating an existing device or adding a new one based on provided headers and a timestamp.


kvm_ioctl_create_device

In C, write a function to handle the creation of a new KVM device, including memory allocation and error checking.


SMB2_read

Write a C function named `SMB2_read` that performs a read operation using Server Message Block (SMB) protocol version 2.


archive_read_format_rar_read_data

Write a C function to read data from a RAR archive entry, handling both stored and compressed data methods.


r_anal_bb_free

Write a function in C to safely free a basic block structure and its associated resources.


hci_uart_set_proto

Write a C function named `hci_uart_set_proto` that assigns a UART protocol to a device and handles registration, returning an error code if the protocol is unsupported or registration fails.


rm_read_multi

In C, write a function to process multiple streams and metadata packets from a RealMedia file.


HeifContext::interpret_heif_file

Write a C++ function to process HEIF image files, handling image references, thumbnails, auxiliary images, and metadata.


PlayerGeneric::~PlayerGeneric

Write a C++ destructor for a class named `PlayerGeneric` that cleans up memory by deleting member pointers, ensuring that a `mixer` object is properly deactivated and devices are removed before deletion.


vips_foreign_load_gif_scan_image

Write a C function to scan and validate a GIF image frame for the Vips image processing library.


ReadMATImage

Write a function in C to read and process MATLAB image files.


opj_j2k_write_mco

Write a C function named `opj_j2k_write_mco` that writes the MCO marker for JPEG 2000 image encoding.


tcpmss_mangle_packet

Write a C function to adjust the TCP MSS option in a packet according to given parameters.


luaD_shrinkstack

Write a C function named `luaD_shrinkstack` for Lua that adjusts the stack size based on current usage and predefined limits.


mrb_vm_exec

Execute a Ruby method from a given bytecode in the MRuby language.


__ns_get_path

Write a C function named `__ns_get_path` that retrieves a file path from a namespace object.


PHP_FUNCTION

Write a PHP function to unserialize data with an optional parameter for allowed classes.


TraceBezier

Write a C function named `TraceBezier` that calculates Bezier curve points given a number of coordinates.


parse_playlist

Write a C function to parse an HLS playlist from a given URL and populate a playlist structure with the parsed data.


get_net_ns_by_id

Write a C function named `get_net_ns_by_id` that retrieves a network namespace by its ID from a given network structure, handling synchronization and reference acquisition.


usb_audio_probe

Write a C function named `usb_audio_probe` for probing USB audio devices and registering them with the ALSA sound system.


audio_sample_entry_Read

Write a C function named `audio_sample_entry_Read` that reads and processes an audio sample entry from a bitstream.


ffs_user_copy_worker

Write a C function named `ffs_user_copy_worker` that processes I/O data for a USB function filesystem.


ndpi_reset_packet_line_info

In C, write a function to reset all fields of a given `ndpi_packet_struct` to their initial state.


snd_seq_device_dev_free

Write a C function named `snd_seq_device_dev_free` that takes a pointer to `struct snd_device`, performs cleanup, and returns an integer.


__mdiobus_register

In C, write a function to register an MDIO bus with error handling and PHY device scanning.


mrb_io_initialize_copy

Write a C function for the MRuby language that duplicates an IO object, including its file descriptors and instance variables.


SMB2_write

In C, write a function to perform an SMB2 write operation with error handling and encryption check.


dd_get_item_size

In C, write a function to get the size of a file within a directory structure, handling errors appropriately.


zmi_page_request

Write a Python function named `zmi_page_request` that modifies HTTP response headers, manages session variables, and redirects to a normalized URL if necessary.


nntp_hcache_namer

Write a C function named `nntp_hcache_namer` that formats a file path with the extension ".hcache", optionally removing directory components.


TarFileReader::extract

In C++, write a function to extract a file from a tar archive, handling path validation and logging the extraction process.


handle_method_call

Write a C function to handle various method calls for problem management over D-Bus.


_inject_file_into_fs

Write a Python function to create or append contents to a file at a specified path within a virtual filesystem, ensuring the parent directories exist.


set_interface_var

Write a C function to update a network interface variable in a file, handling file paths and potential errors.


cut

Write a Python function named `cut` that deletes a key from an etcd store and handles exceptions.


wiki_handle_http_request

In C, write a function to handle HTTP requests for a simple wiki, including serving static files, API calls, and wiki page creation or editing.


candidate_paths_for_url

Write a Python function that yields file system paths corresponding to a given URL based on predefined directory mappings.


updateKey

Write a Python function to update a user's key file with new data, raising an error if the key file does not exist.


create_basename_core

Write a Python function to sanitize and encode a string for use as a URL basename.


get

Write a Python method named `get` that retrieves a value from an etcd store by a given key, logs an error, and raises a custom exception if the retrieval fails.


PHYSICALPATH_FUNC

Write a C function named `mod_alias_physical_handler` that rewrites URL paths based on predefined aliases and handles path traversal security.


download_check_files

Write a Python function named `download_check_files` that validates a list of file paths for download permissions, path security, and size constraints.


get_files

Write a Python function to retrieve and format files from a database submission, with optional password and tree formatting.


handle

Write a Python function to handle HTTP requests with optional keepalive and initial timeout parameters.


dd_delete_item

Write a C function named `dd_delete_item` that deletes a file with error handling for an unlocked directory and invalid filenames.


render

Write a Python function to handle file actions like streaming, downloading, deleting, or listing directory contents based on request parameters.


_inject_net_into_fs

Write a Python function to create necessary directories and set permissions to inject network configuration into a specified filesystem.


canonicalize

Write a Python function named `canonicalize` that simplifies file paths by resolving ".", "..", and optionally "..." in a path object.


CWebSock::GetSkinPath

In C++, write a function to return the path to a web skin directory, checking multiple locations and sanitizing the skin name if necessary.


addKey

Write a Python function named `addKey` that creates a new key file for a client if it doesn't already exist, or raises an error if the key file already exists.


dd_save_text

Write a C function `dd_save_text` to save text data to a file within a directory structure, handling errors for directory access and file naming.


misc_file_checks

Write a Python function to check for mandatory files, deprecated configurations, and potential vulnerabilities in a project's file structure and configurations.


dd_save_binary

Write a C function named `dd_save_binary` that saves binary data to a file within a directory structure, ensuring the directory is open and the filename is valid.


pascal_case

Write a Python function named `pascal_case` that converts a string to PascalCase format, optionally sanitizing the input first.


cleanup_pathname

Write a C function named `cleanup_pathname` that sanitizes and validates a pathname stored in a `struct archive_write_disk` object.


create_dump_dir_from_problem_data

Write a C function to initialize a dump directory with problem data, handling errors and creating necessary files.


list

Write a Python function that lists keys from an etcd directory, handling exceptions and returning sorted results.


process

In C, write a function to process a file path for compression or decompression, handling directories, symbolic links, and file suffixes.


imap_hcache_open

Write a C function named `imap_hcache_open` that opens an IMAP header cache, optionally using a provided path.


_normalize

Write a Python function to filter and reformat error metadata for a linting tool's output.


dd_load_text_ext

Write a C function named `dd_load_text_ext` that loads text from a file within a directory structure, handling special cases and errors.


_download_file

Write a Python method to download a file from an S3 bucket to a local directory.


Utility::UnZip

Write a C++ function to unzip a file to a specified directory using the QuaZIP library.


save

Write a Python function to update an item's name and metadata from a POST request.


wiki_handle_rest_call

In C, write a function to handle RESTful API calls for a wiki page system, supporting operations like get, set, delete, check existence, and list/search pages.


handle_method_call

Write a C function to handle various method calls for problem management over D-Bus.


HPHP::extractFileTo

Write a C++ function to extract a file from a zip archive to a specified directory, handling directory creation and path sanitization.


new_goal

Write a Python function to create a new goal with validation for name uniqueness and proper date format.


_inject_admin_password_into_fs

Provide a Python function to set the root password on a filesystem without using a guest agent.


get_paths

Write a Python function that generates file paths for data and metadata files based on a given base path.


compose_path

In C, write a function to construct an absolute file path from a given relative path and the current working directory stored in a control structure.


valid_id

Write a Python function named `valid_id` that checks the validity of an identifier based on certain conditions and directory path options.


get

Write a Python function named `get` that retrieves a static file from a base path, which may involve sanitizing the path and handling multiple base paths.


dd_exist

Write a C function named `dd_exist` that checks if a file exists within a directory structure represented by a `dump_dir` structure, and handles invalid filenames with an error message.


is_cgi

Create a Python function that checks if a given path is a CGI script and updates an attribute with the script's directory information.


deleteKey

Write a Python function named `deleteKey` that removes a client's key file and handles the case where the key does not exist.


set

Write a Python function named `set` that stores a key-value pair in etcd, with an option to replace the existing key, and handles specific etcd exceptions.


_inject_key_into_fs

Write a Python function to add an SSH key to the root user's authorized_keys file in a given filesystem.


rfbHandleAuthResult

Write a C function named `rfbHandleAuthResult` that processes VNC authentication results from a server.


jbig2_image_compose

Write a C function to overlay one image onto another at a specified position using a given composition operation.


next_state_class

Write a C function named `next_state_class` that updates character class states and values for a regex engine.


mpol_parse_str

In C, write a function to parse a string defining memory policy options and create a corresponding memory policy structure.


keycompare_mb

Write a C function named `keycompare_mb` that compares two lines based on predefined key positions, handling multibyte characters and various comparison options.


next_state_val

Write a C function named `next_state_val` that updates the state and value type of a character class node based on input values and a state machine.


cbs_jpeg_split_fragment

Write a C function to parse and validate a JPEG image fragment for errors and markers.


avcodec_align_dimensions2

Write a C function named `avcodec_align_dimensions2` that adjusts the width and height of a video frame based on the codec context and pixel format.


ContentLine_Analyzer::DoDeliverOnce

Write a C++ function that processes a stream of data to handle newline characters and buffer management.


idn2_to_ascii_4i

In C, write a function to convert Unicode text to ASCII using IDNA2008 (Internationalized Domain Names in Applications) standards.


blosc_c

Write a C function named `blosc_c` for compressing data blocks with support for various compression algorithms and dictionary training.


re2c::Scanner::fill

Write a C++ function named `fill` in the `Scanner` class that ensures a buffer has enough free space and reads more data if necessary.


input_csi_dispatch_sgr_colon

Write a C function to parse colon-separated SGR (Select Graphic Rendition) parameters and update text attributes accordingly.


enl_ipc_get

Write a C function named `enl_ipc_get` that appends chunks of data to a static buffer until a complete message is received or a timeout occurs.


xdp_umem_reg

Write a C function named `xdp_umem_reg` that registers a user memory (`umem`) area for use with XDP sockets, validating the provided memory region parameters.


gps_tracker

Write a C function named `gps_tracker` that connects to a GPS daemon on localhost and reads GPS coordinates in a loop.


tcp_test

Write a C function named `tcp_test` that attempts to establish a TCP connection to a specified IP and port, sends a specific command, and measures connection times.


mapi_attr_read

Write a C function named `mapi_attr_read` that parses MAPI attributes from a buffer.


WritePSDChannel

Write a C function named `WritePSDChannel` that handles writing image channel data for PSD files, including compression if necessary.


flb_gzip_compress

Write a C function to compress data using GZIP and handle memory allocation for the output buffer.


sc_oberthur_read_file

Write a C function named `sc_oberthur_read_file` that reads data from a file on an Oberthur smart card, optionally verifying the PIN.


tflite::ops::builtin::segment_sum::ResizeOutputTensor

Write a C++ function to resize an output tensor based on segment IDs in TensorFlow Lite.


mwifiex_ret_wmm_get_status

Write a C function named `mwifiex_ret_wmm_get_status` that processes a WMM (Wireless Multimedia) status response for a WiFi device.


patch

Write a Python C extension function named `patch` that applies a binary patch to given data using control tuples and diff/extra blocks.


HandleRFBServerMessage

Write a function in C to handle server messages for a VNC client.


enc_untrusted_create_wait_queue

Write a C++ function named `enc_untrusted_create_wait_queue` that allocates a wait queue using a non-system call dispatcher and handles errors.


FromkLinuxSockAddr

Write a C++ function to convert a Linux-specific socket address structure to a generic socket address structure, handling different address families and providing an abort callback for errors.


opj_pi_create_decode

In C, write a function `opj_pi_create_decode` that initializes decoding parameters for an image tile.


opj_j2k_set_cinema_parameters

Write a C function to configure JPEG 2000 cinema parameters for an image.


adminchild

Write a C function named `adminchild` that processes HTTP requests for a proxy server's admin interface.


ecall_restore

Write a C++ function named `ecall_restore` that checks if input and output buffers are outside enclave memory and performs a restore operation using Asylo primitives.


handle_PORT

In C, write a function to handle the FTP PORT command by parsing an IP address and port from a string and updating the control structure accordingly.


rom_copy

Write a C function named `rom_copy` that copies ROM data to a destination buffer, handling memory regions and zero-filling as needed.


NeXTDecode

Write a C function named `NeXTDecode` that decodes a scanline from a TIFF image.


TiledInputFile::rawTileData

Provide a C++ function to read raw tile data from an image file, handling multipart files and validating tile coordinates.


tcos_decipher

Write a C function named `tcos_decipher` that performs a decipher operation with a smart card using the TCOS protocol.


decode_zbuf

Write a C function named `decode_zbuf` that inflates zlib-compressed data into a buffer using the FFmpeg library's AVBPrint structure.


MultiPartInputFile::Data::chunkOffsetReconstruction

Write a C++ function to reconstruct chunk offset tables from an OpenEXR file stream, handling exceptions silently.


make_canonical

Write a C function named `make_canonical` that converts various data types to their canonical string form.


decode_frame

Write a C function named `decode_frame` for decoding video frames in an FFmpeg codec context.


add_password

In C, write a function to add an encrypted password to an authentication request using MD5 hashing.


unicode_unfold_key

Write a function in C that searches for a Unicode code point in a static array using a hash lookup.


PHP_FUNCTION

Write a PHP function to apply gamma correction to an image resource with given input and output gamma values.


rfbProcessFileTransferReadBuffer

In C, write a function to read a specified length of data from a client connection into a buffer, handling memory allocation and error checking.


track_header

Write a C function to parse video and audio track headers from a buffer in an AVFormatContext using FFmpeg libraries.


yaffsfs_istat

Write a C function named `yaffsfs_istat` that prints file system metadata and data chunk information for a given inode in a YAFFS file system.


InsertRow

Write a C function named `InsertRow` that processes a scanline of an image based on the bits per pixel (bpp) parameter.


rds_rdma_extra_size

Write a C function named `rds_rdma_extra_size` that calculates the total size of memory pages described by an array of `rds_iovec` structures, handling user-space memory copying and validation.


decode_frame

Write a C function for decoding a video frame using the FFmpeg library.


concat_opt_exact_str

Write a C function to concatenate a string to an OptStr structure, ensuring it doesn't exceed a maximum length.


init_settings

Write a Python function named `init_settings` that initializes and returns a settings dictionary for a web application, incorporating various managers, configurations, and template options.


get

Write a Python function that handles HTTP GET requests to retrieve and redirect to a specific build's URL, with error handling for authentication and invalid build IDs.


index

Write a Python function named `index` that handles a web request, performs user authorization, and renders a search dashboard template with dynamic content based on query parameters.


respond_error

Write a Python function that handles a server error by displaying an error page with a stack trace.


edit_bundle

Write a Python function with a decorator to check user permissions and handle editing a document bundle, including fetching coordinators and rendering a template.


history_data

Write a Python function to fetch and return web history data, with optional offset, ensuring special HTML characters in URLs and titles are escaped.


json_dumps

Create a Django template filter in Python that safely serializes a QuerySet or other values to JSON, with optional indentation.


htmlvalue

Provide a Python function named `htmlvalue` that returns a safe HTML representation of a given value using a block's render method.


gravatar

Create a Django template tag in Python that generates an HTML image tag for a user's Gravatar with an optional size parameter.


PeerListWidget::addPeer

In C++, write a function to add a peer's details to a list model in a peer list widget.


is_safe_url

Write a Python function to check if a given URL is considered safe based on its host and scheme.


get_context_data

Write a Python function to enhance the context data with comments, a form, and processed markdown content for a web page.


edit_workflow

Write a Python function with a decorator to check user permissions, which retrieves and edits workflow data based on a request, handling credentials and rendering a response.


simple_search

Write a Python class method that performs a simple search with optional highlighting, without using facets.


HPHP::WddxPacket::recursiveAddVar

Write a C++ function named `recursiveAddVar` that serializes a variable into a WDDX (Web Distributed Data Exchange) packet string, handling arrays, objects, and primitive data types, and optionally wrapping the serialized data in a `<var>` tag.


mode_receive

Write a Python function named `mode_receive` that implements a long-polling mechanism to handle incoming POST requests and manage data reception based on client session IDs.


edit_coordinator

In Python, write a view function `edit_coordinator` that checks access permissions, fetches coordinator and workflow details, and renders them to a template.


_keyify

Write a Python function named `_keyify` that sanitizes a string key by converting it to lowercase and replacing certain patterns with a space.


batch_edit_translations

Write a Django view function in Python that handles a POST request to batch edit translations with AJAX, ensuring the user is logged in and has the necessary permissions.


make_eb_config

Write a Python function to generate an Elastic Beanstalk configuration file from a template with application name and default region variables.


mode_keepalive

Write a Python function named `mode_keepalive` that updates a timestamp for a client session ID from a POST request and returns an empty string.


Logger::addPeer

Write a C++ function in a Logger class that adds a peer with an IP, block status, and reason to a log, and emits a signal when a new peer is logged.


subscribe_for_tags

In Python, write a Django view function named `subscribe_for_tags` that handles user tag subscription requests, including CSRF protection.


nav_path

Write a Python function that generates a breadcrumb navigation path from a request object.


__init__

Write a Python class initializer that processes event-related form fields with dynamic question types and initial values.


link_dialog

Generate a Python function named `link_dialog` that creates a link dialog interface for a wiki page using the MoinMoin framework.


action_save_user

Write a Python function to save or update a user's profile with permissions and redirection handling.


save

Write a Python method named `save` that sanitizes user input, handles cross-referencing or tagging, generates a slug from the title, and then calls the superclass's save method.


PropertiesWidget::loadTorrentInfos

Write a C++ function in the PropertiesWidget class that loads and displays torrent information using the BitTorrent::TorrentHandle object.


mode_close

Write a Python function named `mode_close` that handles a POST request to disconnect a client session using a session ID.


get_queryset

Write a Python function named `get_queryset` that orders articles by time and converts their content to markdown format.


screenshotcommentcounts

In Python, write a function that returns a JSON representation of comments associated with a screenshot, including details like text, draft status, and position.


mode_input

Write a Python function named `mode_input` that processes a POST request by extracting session ID and data, updates session activity, and handles incoming data for a session.


get_list_context

Write a Python function in Frappe to customize the context of a blog list page based on filters like category, blogger, or search text.


mode_init

In Python, write a function `mode_init` that initializes a web client session and handles keep-alive upon receiving a POST request.


handle_file

Write a Python function to handle media file uploads, including image resizing and metadata processing.


commentcounts

In Python, write a function that returns a JSON array of comments for a file difference, including metadata like comment ID, text, line number, and user details, sorted by line number.


oidc_handle_session_management_iframe_rp

In C, write a function to handle session management using an iframe for OpenID Connect, including JavaScript for client-side checks and redirection based on session state changes.


Logger::addMessage

Write a C++ function named `addMessage` for a `Logger` class that appends a log message with a timestamp and type to a list, removing the oldest if a max size is reached, and emits a signal.


get

Write a Python function decorated to handle HTML GET requests, which renders a login page with configuration details and optionally checks the redirect URL.


manipulate_reservation_action

Write a Python function to handle reservation modifications and redirection based on user input from a web request.


html_content

Generate a Python async property method that converts stored content to HTML, handling empty content and ensuring safe markup.


get_context_data

Write a Python function that extends `get_context_data` to include a 'back_link' from a GET parameter, with validation against XSS for the second snippet.


add_article_action

Write a Python function to handle adding single or multiple articles to a reservation, with redirection and error handling.


ImagingLibTiffDecode

Write a C function named `ImagingLibTiffDecode` that decodes a TIFF image into an internal imaging structure.


futex_requeue

Write a C function named `futex_requeue` that manages the requeueing of futexes, potentially involving priority inheritance logic.


_gd2GetHeader

Write a C function to read and validate the header of a GD2 image file.


jpc_pi_nextcprl

Write a C function named `jpc_pi_nextcprl` that iterates over components, resolutions, positions, and layers for JPEG 2000 progression order changes.


process_get_command

Write a C function named `process_get_command` that processes a 'get' command for a connection, handling tokens and optional CAS return.


Exiv2::WebPImage::getHeaderOffset

Write a C++ function that finds the position of a header within a block of data and returns the index, or -1 if not found.


ring_buffer_resize

Write a C function to resize a ring buffer for a specific CPU or all CPUs, handling memory allocation and synchronization issues.


rwpng_read_image24_libpng

Write a C function to read and process a PNG image using libpng.


UnicodeString::doAppend

In C++, write a method `doAppend` for the `UnicodeString` class that appends a substring to the current string, handling memory allocation and avoiding self-appending issues.


WriteBMPImage

Write a function in C to save an image in BMP format.


AllocateDataSet

Write a C function named `AllocateDataSet` that allocates memory for a data set in a structure, handling potential errors.


vc4_get_bcl

Write a C function named `vc4_get_bcl` that handles memory allocation and validation for command lists and shader records in a DRM device context.


TIFFSeekCustomStream

Write a C function named `TIFFSeekCustomStream` that adjusts the offset within a Photoshop profile structure based on the seek operation specified.


perf_cpu_time_max_percent_handler

Write a C function to handle changes to a sysctl setting that controls CPU time percentage for performance monitoring, warning if set to 0 or 100%.


git_delta_apply

Write a C function named `git_delta_apply` that applies a delta to a given base data to produce an output.


uvesafb_setcmap

Write a C function to update the color map of a framebuffer device in the Linux kernel.


b_unpack

Write a Lua C API function named `b_unpack` that unpacks binary data according to a format string.


copyaudiodata

Write a C function named `copyaudiodata` that copies audio data from one file to another for a specified track ID, handling memory allocation and error checking.


_zend_hash_init

Write a function in C to initialize a hash table structure with a given size, destructor function, and persistence flag.


Perl_re_op_compile

Compile a regular expression pattern in Perl.


mem_check_range

Write a C function named `mem_check_range` that checks if a memory range specified by `iova` and `length` is valid within a memory region `mem`, returning 0 for valid or `-EFAULT` for invalid.


set_geometry

Write a C function named `set_geometry` that configures the disk geometry for a floppy drive.


__get_data_block

Write a C function named `__get_data_block` that maps blocks for a given inode in a filesystem, handling buffer head and block mapping with error checking.


HPHP::StringUtil::Implode

Write a C++ function that concatenates elements of a container into a string with a specified delimiter, throwing an exception if the input is not a container.


PHP_FUNCTION

Write a PHP function to read a specified number of bytes from a stream resource.


amqp_handle_input

Write a C function named `amqp_handle_input` that processes incoming AMQP data and decodes it into a frame structure.


choose_volume

In C, write a function `choose_volume` that selects the appropriate volume descriptor for an ISO9660 archive and reads the root directory block.


cs_winkernel_malloc

Write a C function named `cs_winkernel_malloc` that allocates memory in the Windows kernel, ensuring it's non-zero and handles potential size overflows.


hfs_cat_traverse

Write a C function named `hfs_cat_traverse` that traverses the HFS catalog B-tree and calls a callback function for each node.


PyImaging_MapBuffer

Write a C function in Python that maps a buffer to an image object with specified dimensions, mode, and stride.


read_entry

Write a C function named `read_entry` that parses a git index entry from a buffer and stores the result.


read_SubStreamsInfo

In C, write a function to read substream information for folders within a 7z archive.


gdi_Bitmap_Decompress

Write a C function named `gdi_Bitmap_Decompress` that decompresses a bitmap image in a remote desktop protocol context.


SWFInput_readSBits

Write a C function named `SWFInput_readSBits` that reads a specified number of bits and interprets them as a signed integer.


layer_resize

In C, write a function to resize a map layer, reallocating the tilemap and adjusting map zones and triggers accordingly.


ApplyEvaluateOperator

Write a C function named `ApplyEvaluateOperator` that performs various arithmetic and noise operations on a pixel value based on an operator type.


authDigestNonceLink

Write a C++ function named `authDigestNonceLink` that increments a reference counter for a given nonce object and logs the new reference count, ensuring the nonce is not null and, for the second snippet, that the reference count does not overflow.


jpc_dec_process_siz

Write a C function named `jpc_dec_process_siz` that initializes decoder settings based on image size parameters.


generate_node_config

Write a Python function to fetch and return a node's configuration as a YAML string from a database using the node's certificate name.


parse_profile

Write a Python function to parse a YAML profile, handling empty files and merging with default data.


set_body

Write a Python function named `set_body` that loads a string into an object's data attribute using the `yaml` library.


build_textcaptcha_config

Write a Ruby method that loads textcaptcha configuration options from a YAML file or uses a provided hash, handling any standard errors by raising an argument error.


read_configuration

Write a Ruby method named `read_configuration` that loads a YAML configuration file if it exists, with the second version safely loading symbols.


data

Create a Ruby method named `data` that lazily loads and memoizes the contents of a YAML file.


TestAcceptBasketRequests_BadRequest

Write a Go test function to verify that an HTTP request with an invalid basket name returns a 400 Bad Request response.


writeErrorResponse

Create a Go function to send an error response with a status code and message to an HTTP client.


(anonymous)

Write a jQuery script to load CSS and JavaScript for a lightbox, and update a specific element with content from an external service when a new popover is added to the DOM.


(anonymous)

Write a jQuery plugin in JavaScript that enables inline editing with tooltips for elements, including AJAX save functionality.


showLog

Write a JavaScript function named `showLog` that logs a message and optional data to the console and also appends the message to a page element with the ID 'print-wall'.


(anonymous)

Write a JavaScript function that modifies a newsletter form's action and target, submits it, then resets those attributes and updates the heading with the newsletter subject after a delay.


transvision

Write a Python function to fetch translations from an API using query parameters from a web request.


tileRec

Write a JavaScript function for recursive image tiling with adjustable zoom and quality settings.


tileLevel

Write a JavaScript function that takes an image path, output directory, zoom level, tile size, filename pattern, and image quality, then generates image tiles using ImageMagick.


editor

Write a Python function that opens a file in the system's default text editor, handling the absence of a configured editor.


crypt

Write a Ruby method to encrypt or decrypt a file using OpenSSL, with an option to specify a password.


open

Write a Ruby method named `open` that reads from a file, processes its contents, and optionally writes back to it.


render

Create a React component in JavaScript that displays highlighted search results from a repository with a load more functionality.


Create a Go HTTP handler that retrieves and returns the last 'n' daily totals as JSON from a database, using a URL parameter to specify 'n'.


(anonymous)

Write a JavaScript function that retrieves a single occupation record from a database using the 'soc' code.


Database.prototype.register

Write a JavaScript function to insert an attendee's details into a database table using a `Database` object's `register` method.


forgot_passwd

Write a Python Flask function to handle a forgot-password route, allowing users to reset their password via email.


verify_token

Write a Python function using `aiopg` to asynchronously verify a session token in a PostgreSQL database.


sanitize

Write a Ruby function named `sanitize` that escapes special characters in a string, allowing only alphanumeric characters and a specific set of punctuation.


check_in_interaction_ids

Write a Ruby method to retrieve the IDs of ongoing check-in interactions for a specific Slack channel using a bot's access token.


set

Write a JavaScript function named `set` that assigns a value to a nested object property, optionally creating nested objects if the path does not exist, and handles the case where the property path is not provided.


encryptPassword

Create a password encryption function in JavaScript that uses either SHA-1 with a salt or bcrypt.


FileStorage::getResourceFile

Write a Java function that retrieves a resource file based on an identifier and location, handling null IDs and checking for file existence.


DefaultSampleFilesService::downloadAndUnpackResource

Write a Java function to download a ZIP file from a given location and extract its contents to a specified directory.


(anonymous)

Write a JavaScript function to process release assets, parse their names for architecture information, and provide methods to download and extract them.


_get_obj_absolute_path

Write a Python function named `_get_obj_absolute_path` that concatenates a predefined base path with a given object path to form an absolute path.


modname_normalize

Write a C function to normalize a module name by replacing hyphens with underscores and truncating the name at the first period or at a maximum length, returning the normalized name.


make_btrfs

Write a C function to initialize a Btrfs filesystem on a given file descriptor with specified parameters.


SecurityConfiguration::configure

Write a Java Spring Security configuration method to set up authorization rules for specific URL patterns and configure custom login and logout behavior.


preparehttpserver

Write a Python function that configures an HTTP server with SSL using a certificate from the configuration.


get_socket

In Python, write a function to establish a secure socket connection with SSL, handling certificate verification and errors.


testConstructWrapperWithExistingNonEmptyDumpRoot

Write a Python test function that checks if an exception is raised when initializing a debug wrapper session with a non-empty directory.


try_compile_and_link

Write a Python function that attempts to compile and link a C++ source code snippet using a specified compiler and optional flags, with an option to print verbose output.


_make_asset

Write a Python function to create a temporary file with specified contents and return its filename.


testConstructWrapperWithExistingFileDumpRoot

Write a Python function that tests the creation of a debug wrapper session with a file path that already exists, expecting a ValueError.


check_inode

Write a C function to validate and potentially repair an inode in an exFAT file system.


VerifyMAC

Write a Go function to verify a MAC (Message Authentication Code) against given data.


_thp_job_create

Write a C function named `_thp_job_create` that initializes a `thp_job_t` structure with a function pointer and an argument, handling memory allocation.


likeComments

Write a Python function to insert a user's like for a comment into a database.


add_inverters

Write a Python function to insert or update inverter data into a database using either string formatting or parameter substitution.


delete

Create a Python Flask route to delete a message by ID from a database and redirect with a success message.


karma_rank

Write a Python function to calculate and return a user's rank based on their karma score from a database.


get_last_month

In Python, write a function to retrieve the date of the last match from a database for a given scene and round it up to the next month if it's more than a month old.


achievements_list_player

Write a Python Flask endpoint to list a player's achievements using their ID.


check_if_this_project_is_in_database

Write a Python function to determine if a project with a given ID exists in a database.


edit_page

Create a Python Flask route to edit a page by its name, fetching data from a database and rendering an HTML template with the query result.


reportMatch

Write a Python function to insert the winner and loser player IDs into a database after a match.


get_game_info

Write a Python function to fetch and return basic game information from a database given a game ID.


process_as_reply

Write a Python function to process email feedback, update job status, and log matches in a database.


update_playlist

Write a Python function to update the name of a playlist in a database by its ID.


get_requested_month

Write a Python function to fetch and summarize monthly power yield data, including checks for previous and next data availability.


retrieve_videos_from_playlist

Write a Python function to fetch video details from a database by playlist ID, sorted by their position.


create_playlist

Write a Python function to add a new playlist with a default video position to a database.


update_video_positions

Write a Python function to decrement the position of videos in a database after a certain position has been removed.


_check_camera_tags

Write a Python function that replaces camera tag names with corrected versions from a MySQL database, returning the updated list of tags.


add_input

Write a Python function named `add_input` that inserts user-provided data into a database table named 'crimes', intentionally using insecure query formatting to demonstrate SQL injection vulnerability.


getResults

Write a Python function named `getResults` that retrieves and counts poll options from a database given a `poll_name`.


update_sources

Write a Python function to update a database table with new source entries and notify about discrepancies between old and current sources.


search_make_new

Write a C function named `search_make_new` that appends a domain postfix to a base name from a list of search domains, given an index `n`.


TS_OBJ_print_bio

Write a C function named `TS_OBJ_print_bio` that converts an ASN1_OBJECT to text and prints it to a BIO stream.


main

Write a C program that converts a plist file from binary to XML format or vice versa, based on the input file's format, and handles command-line arguments for input and output file paths.


AirPDcapDecryptWPABroadcastKey

Write a C function to decrypt WPA broadcast keys from EAPOL packets.


AdaptiveThresholdImage

Write a C function in ImageMagick to perform adaptive thresholding on an image.


INST_HANDLER

Write a C function named `INST_HANDLER` for the `lds` instruction that loads a value from a specified memory address into a register, handling potential buffer length issues.


jpeg_size

Write a C function to extract the width and height from a JPEG image's binary data.


RLEDECOMPRESS

Write a C function for run-length decoding of compressed image data.


jp2_decode

Write a C function named `jp2_decode` that decodes a JPEG 2000 image from a given input stream and returns a pointer to the decoded image structure.


get_conn_text

Write a C function named `get_conn_text` that formats a socket address into a human-readable string.


parse_sec_attr_44

Write a C function named `parse_sec_attr_44` that processes security attributes from a buffer and updates an OpenSC file structure with access control entries.


do_core_note

Write a C function named `do_core_note` that processes core dump note segments to determine the originating OS and program details.


gst_asf_demux_process_ext_content_desc

Write a C function in GStreamer for processing extended content descriptors in ASF demuxing.


enc_untrusted_recvmsg

Write a C++ function `enc_untrusted_recvmsg` that wraps a system call to receive a message on a socket within an enclave, handling message structure and error conversion.


HPHP::HHVM_METHOD

Write a function in HHVM to retrieve extended statistics from all Memcache servers.


_get_3par_host

In Python, write a function to parse detailed host information from CLI output.


_get_vdisk_attributes

Write a Python function to fetch virtual disk attributes using an SSH command, handling non-existence and parsing exceptions.


git_hook

Write a Python function named `git_hook` that acts as a pre-commit hook to check if Python files are correctly sorted by `isort`, with options to either strictly enforce sorting or just warn, and to modify files if needed.


test_create_modify_host

Write a Python unit test function that mocks SSH commands for creating and verifying an iSCSI host.


_run_ssh

Write a Python function to execute SSH commands with retry logic and connection pooling.


view

Create a Python Flask route handler that checks if a provided 'sid' is valid and serves a directory if it exists, or aborts with an error if not.


get_title_from_youtube_url

Write a Python function that extracts the title of a YouTube video from its URL using the `youtube-dl` command-line program, handling any potential errors.


test_get_ports

Write a Python unit test function that mocks SSH commands to retrieve port information and asserts the results.


_create_3par_vlun

Write a Python function to create a 3PAR VLUN, handling domain mismatch errors.


_set_connections

Write a Python function to configure the maximum number of concurrent connections for a 3PAR WS API server.


_get_chap_secret_for_host

Write a Python function to retrieve the CHAP secret for a specified host by executing an SSH command and parsing the output.


tensorflow::KernelAndDeviceOp::Run

Write a C++ function to execute a kernel operation with input arguments, output handling, and cancellation support.


check_client_passwd

In C, write a function to validate a client's password using different authentication methods (plain, crypt, MD5).


rds_tcp_kill_sock

Write a C function named `rds_tcp_kill_sock` that disconnects and cleans up TCP connections in a given network namespace.


ReadXCFImage

Write a function in C to read and process XCF image files.


CopyKeyAliasesToKeymap

Write a C function to validate and copy key aliases into a keymap structure.


tensorflow::GetSessionHandleOp::Compute

Write a C++ function to store a tensor and return a handle to it, handling both V2 and legacy V1 behaviors.


tun_set_iff

Write a C function named `tun_set_iff` that configures a network TUN/TAP device based on provided settings.


WriteImages

In C, write a function to export and write a sequence of images to a file using ImageMagick's API.


__oom_reap_task_mm

Write a C function named `__oom_reap_task_mm` that attempts to free memory by reaping a task's memory mappings in a Linux kernel context.


gf_m2ts_process_pat

Write a C function to process Program Association Table (PAT) sections in an MPEG-2 transport stream demuxer.


ReadPWPImage

Write a C function named `ReadPWPImage` that reads a PWP image file and returns an Image pointer.


skb_segment

Write a C function named `skb_segment` that segments an `sk_buff` packet according to given network device features.


usb_serial_console_disconnect

Write a C function named `usb_serial_console_disconnect` that disconnects a USB serial console if the first port matches a specified port.


blk_init_allocated_queue

Write a C function named `blk_init_allocated_queue` that initializes a block device queue structure.


snd_timer_open

Write a C function named `snd_timer_open` that opens a new sound timer instance, either as a master or a slave, based on the provided timer ID.


getKey

Write a Python function to retrieve and return a client's key from a server, handling potential errors and ensuring the key name is alphanumeric.


ImportEPUB::ExtractContainer

Write a C++ function to extract the contents of an EPUB file, handling different character encodings and ensuring file paths are secure.


GetMagickModulePath

Write a C function named `GetMagickModulePath` that locates a module file path based on its filename and type, handling various search strategies and exceptions.


estimate_size

Write a Python function to estimate the compressed size of specified directories and files within a task's analysis path.


span

Write a Python function named `span` that attempts to create a new directory in an etcd store with a given key, and handles exceptions for already existing keys or other etcd errors.


_get_settings

Write a Python function to fetch and return a dictionary of settings for the Anaconda plugin in a code editor, using default values if specific settings are not found.


WritePSDChannels

Write a C function to handle the writing of image channels for PSD files, including support for RLE compression and separate layers.


InitialiseRFBConnection

Write a C function to initialize a connection to a VNC server using the RFB protocol.


cdf_read_property_info

Write a C function to read property information from a compound file binary format stream.


pgxtoimage

Write a C function named `pgxtoimage` that converts a PGX file to an OpenJPEG image structure, taking a filename and decoding parameters as arguments.


S_study_chunk

Analyze a regular expression pattern to determine minimum and maximum possible match lengths in Perl.


RemoveICCProfileFromResourceBlock

In C, write a function to remove an ICC profile from an image's resource block.


PeerListWidget::updatePeer

In C++, write a function to update the display information of a peer in a torrent client's peer list widget.


redirect

Create a Python method named `redirect` that ensures the URL is a string before calling the superclass's redirect method, with an optional step to validate the URL.


get_value

Write a Python function named `get_value` that retrieves a value based on an object's attribute or a specified render function, handling different data types and potential HTML escaping.


http_error_t::make_body

Write a C++ function that generates an HTML error page body with optional XSS protection.


list_editor_workflows

Write a Python function that retrieves a list of workflows for a user, converts them to JSON, and renders a response using a Mako template.


opj_get_encoding_parameters

Write a C function named `opj_get_encoding_parameters` that calculates encoding parameters for an image tile.


rfbScaledScreenUpdateRect

In C, write a function to update a scaled screen rectangle with pixel blending if true color is enabled.


jsuGetFreeStack

Write a C function named `jsuGetFreeStack` that calculates the amount of free stack space available, with platform-specific implementations for ARM and Linux, and a default value for other platforms.


ssl_parse_client_psk_identity

Write a C function to parse a client's pre-shared key identity during an SSL handshake using the MbedTLS library.


read_ujpg

In C++, write a function named `read_ujpg` that processes and decodes a custom JPEG file format.