--- dataset_info: features: - name: commit dtype: string - name: old_file dtype: string - name: new_file dtype: string - name: old_contents dtype: string - name: new_contents dtype: string - name: subject dtype: string - name: message dtype: string - name: lang dtype: string - name: license dtype: string - name: repos dtype: string - name: ndiff dtype: string - name: instruction dtype: string - name: content dtype: string - name: fuzzy_diff dtype: string splits: - name: train num_bytes: 184538735.21562597 num_examples: 33443 - name: test num_bytes: 9717211.754768332 num_examples: 1761 download_size: 84611659 dataset_size: 194255946.9703943 configs: - config_name: default data_files: - split: train path: data/train-* - split: test path: data/test-* --- # Code Apply Processed [EditPackFT](https://huggingface.co/datasets/nuprl/EditPackFT/blob/main/README.md) with `fuzzy diff` generated using heuristics.
## Columns 1. `old_contents` the old code 2. `new_contents` the new code 3. `fuzzy_diff` the code segment extracted from diff between `old_contents` and `new_contents` ## Augmentation Examples with number of diff chunks > 1 were duplicated. Old contents have one of the diff chunks applied. ## Example ### Diff ```python from kombu import BrokerConnection from kombu.common import maybe_declare from kombu.pools import producers from sentry.conf import settings from sentry.queue.queues import task_queues, task_exchange class Broker(object): def __init__(self, config): self.connection = BrokerConnection(**config) + with producers[self.connection].acquire(block=False) as producer: + for queue in task_queues: + maybe_declare(queue, producer.channel) def delay(self, func, *args, **kwargs): payload = { "func": func, "args": args, "kwargs": kwargs, } with producers[self.connection].acquire(block=False) as producer: - for queue in task_queues: - maybe_declare(queue, producer.channel) producer.publish(payload, exchange=task_exchange, serializer="pickle", compression="bzip2", queue='default', routing_key='default', ) broker = Broker(settings.QUEUE) ``` ### Snippet ```python # ... existing code ... self.connection = BrokerConnection(**config) with producers[self.connection].acquire(block=False) as producer: for queue in task_queues: maybe_declare(queue, producer.channel) def delay(self, func, *args, **kwargs): # ... modified code ... with producers[self.connection].acquire(block=False) as producer: producer.publish(payload, exchange=task_exchange, # ... rest of the code ... ``` ### Partial apply ```python from kombu import BrokerConnection from kombu.common import maybe_declare from kombu.pools import producers from sentry.conf import settings from sentry.queue.queues import task_queues, task_exchange class Broker(object): def __init__(self, config): self.connection = BrokerConnection(**config) with producers[self.connection].acquire(block=False) as producer: for queue in task_queues: maybe_declare(queue, producer.channel) def delay(self, func, *args, **kwargs): payload = { "func": func, "args": args, "kwargs": kwargs, } with producers[self.connection].acquire(block=False) as producer: for queue in task_queues: maybe_declare(queue, producer.channel) producer.publish(payload, exchange=task_exchange, serializer="pickle", compression="bzip2", queue='default', routing_key='default', ) broker = Broker(settings.QUEUE) ```