internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: liqd/a4-product

Issue:
problems with the marked class in css on text that extends over multiple lines
![bildschirmfoto 2018-02-01 um 17 35 25](https://user-images.githubusercontent.com/2905743/35690599-8a256baa-0776-11e8-83a8-e6dc15190930.png)

![bildschirmfoto 2018-02-01 um 17 38 01](https://user-images.githubusercontent.com/2905743/35690658-b53cc428-0776-11e8-87c1-866ece150a65.png)



Discussion:

Resolving patch:
diff --git a/liqd_product/apps/contrib/templatetags/__init__.py b/liqd_product/apps/contrib/templatetags/__init__.py
new file mode 100644
diff --git a/liqd_product/apps/contrib/templatetags/marked_tags.py b/liqd_product/apps/contrib/templatetags/marked_tags.py
new file mode 100644
--- /dev/null
+++ b/liqd_product/apps/contrib/templatetags/marked_tags.py
@@ -0,0 +1,16 @@
+from django import template
+from django.template.defaultfilters import stringfilter
+from django.utils.safestring import mark_safe
+
+register = template.Library()
+
+
+@register.filter(needs_autoescape=True)
+@stringfilter
+def marked_per_word(value, autoescape=True):
+    result = ''
+    for word in value.split():
+        result += ('<div class="marked marked--multiple_lines">{}</div>'
+                   .format(word))
+
+    return mark_safe(result)


Test patch:
Repository: liqd/a4-product

Issue:
Update default polygon in settings
When a new project with a map is added, the initiator can set the polygon in which e.g. ideas are allowed. At the moment the map when choosing this polygon is set to an area around Berlin but should be extended to a larger area e.g. Germany. This can be done in the settings.


Discussion:

Resolving patch:
diff --git a/liqd_product/config/settings/base.py b/liqd_product/config/settings/base.py
--- a/liqd_product/config/settings/base.py
+++ b/liqd_product/config/settings/base.py
@@ -404,7 +404,7 @@
 
 A4_MAP_BASEURL = 'https://{s}.tile.openstreetmap.org/'
 A4_MAP_ATTRIBUTION = '&copy; <a href="http://openstreetmap.org/copyright">OpenStreetMap</a> contributors'
-A4_MAP_BOUNDING_BOX = ([[52.3517, 13.8229], [52.6839, 12.9543]])
+A4_MAP_BOUNDING_BOX = ([[54.983, 15.016], [47.302, 5.988]])
 
 A4_DASHBOARD = {
     'PROJECT_DASHBOARD_CLASS': 'meinberlin.apps.dashboard.ProjectDashboard',


Test patch:
Repository: liqd/a4-product

Issue:
[f2f module] wording
Here are the wordings:

1 
Edit face-to-face participation information
Informationen zur Vor-Ort-Beteiligung bearbeiten

2
Title
Titel

3
Highlighted Info
Hervorgehobene Information

3a (Hilfetext)
Highlight important information like the time or location of your face-to-face event
Zur Hervorhebung von wichtigen Informationen wie Ort oder Zeitraum der Vor-Ort-Beteiligung

4
Description
Beschreibung

5
Face-to-Face Information
Informationen Vor-Ort-Beteiligung

6
Face-to-Face Participation
Vor-Ort-Beteiligung

7
With this module you can provide information about events or phases for face-to-face participation. No online participation is possible in this module.
Mit diesem Modul können Informationen über Veranstaltungen und Phasen zur Vor-Ort-Beteiligung bereitgestellt werden. In diesem Modul ist keine Online-Beteiligung möglich.

8
Phase 1: Provide information about face-to-face participation events
Phase 1: Informationen zur Vor-Ort-Beteiligung bereitstellen

![f2f-screenshot_1](https://user-images.githubusercontent.com/15341015/39699926-9f0fe034-51fb-11e8-951f-9c8cdbae013f.png)
![f2f-screenshot_2](https://user-images.githubusercontent.com/15341015/39699932-a4223c98-51fb-11e8-9642-11eac8aee6ea.png)




Discussion:

Resolving patch:
diff --git a/liqd_product/apps/dashboard/blueprints.py b/liqd_product/apps/dashboard/blueprints.py
--- a/liqd_product/apps/dashboard/blueprints.py
+++ b/liqd_product/apps/dashboard/blueprints.py
@@ -101,9 +101,11 @@
      )),
     ('facetoface',
      ProjectBlueprint(
-         title=_('Face to Face Participation'),
+         title=_('Face-to-Face Participation'),
          description=_(
-             'Share info about a face to face participation event.'
+             'With this module you can provide information about events or '
+             'phases for face-to-face participation. No online participation '
+             'is possible in this module.'
          ),
          content=[
              activities_phases.FaceToFacePhase(),


Test patch:
Repository: liqd/a4-product

Issue:
[partner landing page] unpublished and archived projects are shown
On the partner landing page, we show unpublished and archived projects. Unpublished projects should never be shown and archived projects should be hidden per default.

See: https://product-dev.liqd.net/teststadt/

![bildschirmfoto 2018-05-28 um 11 33 51](https://user-images.githubusercontent.com/15341015/40608238-2254983e-626b-11e8-8429-588c014f7a82.png)





Discussion:

Resolving patch:
diff --git a/liqd_product/apps/partners/views.py b/liqd_product/apps/partners/views.py
--- a/liqd_product/apps/partners/views.py
+++ b/liqd_product/apps/partners/views.py
@@ -20,7 +20,9 @@ def get_context_data(self, **kwargs):
         context = super().get_context_data(**kwargs)
 
         context['project_list'] = Project.objects\
-            .filter(organisation__partner=self.object)
+            .filter(organisation__partner=self.object,
+                    is_archived=False,
+                    is_draft=False)
 
         context['action_list'] = Action.objects\
             .filter(project__organisation__partner=self.object)\


Test patch:
Repository: liqd/a4-product

Issue:
can't see full time when creating an event on small screen
![bildschirmfoto 2018-07-13 um 10 57 54](https://user-images.githubusercontent.com/41073836/42682788-d0101a54-868b-11e8-816e-e77dc5f8a60e.png)



Discussion:
@phillimorland And maybe this? It should be in offlineevents (and I wonder if not also in the phases if it's there).

Resolving patch:
diff --git a/liqd_product/apps/actions/apps.py b/liqd_product/apps/actions/apps.py
--- a/liqd_product/apps/actions/apps.py
+++ b/liqd_product/apps/actions/apps.py
@@ -35,6 +35,6 @@ def ready(self):
         configure_icon('far fa-comment', type='comment')
         configure_icon('far fa-lightbulb', type='item')
         configure_icon('fas fa-plus', verb=Verbs.ADD)
-        configure_icon('fas fa-pencil-alt', verb=Verbs.UPDATE)
+        configure_icon('fas fa-pencil', verb=Verbs.UPDATE)
         configure_icon('fas fa-flag', verb=Verbs.START)
-        configure_icon('far fa-clock', verb=Verbs.SCHEDULE)
+        configure_icon('far fa-clock-o', verb=Verbs.SCHEDULE)


Test patch:
Repository: liqd/a4-product

Issue:
Mandatory mB topic selection on bet.in ( US #1775)
All projects need a topic on bet.in now, even existing ones. Can we remove that requirement? We haven't yet thought about how to implement topics on bet.in and there are not shown anywhere, so it would probably be confusing for initiators.


Discussion:

Resolving patch:
diff --git a/liqd_product/apps/projects/dashboard.py b/liqd_product/apps/projects/dashboard.py
--- a/liqd_product/apps/projects/dashboard.py
+++ b/liqd_product/apps/projects/dashboard.py
@@ -2,10 +2,8 @@
 from django.utils.translation import ugettext_lazy as _
 
 from adhocracy4.dashboard import DashboardComponent
-from adhocracy4.dashboard import ProjectFormComponent
 from adhocracy4.dashboard import components
 
-from . import forms
 from . import views
 
 
@@ -51,16 +49,5 @@ def get_urls(self):
         )]
 
 
-class TopicComponent(ProjectFormComponent):
-    identifier = 'topics'
-    weight = 33
-    label = _('Topics')
-
-    form_title = _('Edit topics')
-    form_class = forms.TopicForm
-    form_template_name = 'liqd_product_projects/project_topics.html'
-
-
 components.register_project(ModeratorsComponent())
 components.register_project(ParticipantsComponent())
-components.register_project(TopicComponent())
diff --git a/liqd_product/apps/projects/forms.py b/liqd_product/apps/projects/forms.py
--- a/liqd_product/apps/projects/forms.py
+++ b/liqd_product/apps/projects/forms.py
@@ -3,8 +3,6 @@
 from django.core.exceptions import ValidationError
 from django.utils.translation import ugettext_lazy as _
 
-from adhocracy4.dashboard.forms import ProjectDashboardForm
-from adhocracy4.projects.models import Project
 from liqd_product.apps.users import fields as user_fields
 
 from .models import ModeratorInvite
@@ -70,11 +68,3 @@ def clean(self):
             raise ValidationError(
                 _('Please enter email addresses or upload a file'))
         return cleaned_data
-
-
-class TopicForm(ProjectDashboardForm):
-
-    class Meta:
-        model = Project
-        fields = ['topics']
-        required_for_project_publish = ['topics']


Test patch:
Repository: liqd/a4-product

Issue:
Error 500 when trying to edit landing page 
I need to add a partner to the landing page on beteiligung.in productive soon. Currently, I can’t edit the page (500 error).

https://www.beteiligung.in/admin/pages/3/edit/

Could you look into it?


Discussion:
Yeah looks familiar. Will look into it

Resolving patch:
diff --git a/liqd_product/config/settings/base.py b/liqd_product/config/settings/base.py
--- a/liqd_product/config/settings/base.py
+++ b/liqd_product/config/settings/base.py
@@ -444,3 +444,9 @@
 # The default language is used for emails and strings
 # that are stored translated to the database.
 DEFAULT_LANGUAGE = 'de'
+
+WAGTAILADMIN_RICH_TEXT_EDITORS = {
+    'default': {
+        'WIDGET': 'wagtail.admin.rich_text.HalloRichTextArea'
+    }
+}


Test patch:
Repository: liqd/a4-product

Issue:
#2151 contact form field labels
In EN: 

It should say „Your name“ instead of „your first and last name“
It should say „I want to receive a copy of my message“ instead of „
I want to receicve a copy of my message as email“

in DE:

It should say „Ihr Name” instead of „Ihr Vor- und Nachname“

It should say „Eine Kopie der Nachricht an mich senden“ instead of „Eine Kopie der Anfrage an mich senden“



Discussion:

Resolving patch:
diff --git a/apps/cms/contacts/models.py b/apps/cms/contacts/models.py
--- a/apps/cms/contacts/models.py
+++ b/apps/cms/contacts/models.py
@@ -115,7 +115,7 @@ def get_form_fields(self):
         fields.insert(0, FormField(
             label='receive_copy',
             field_type='checkbox',
-            help_text=_('I want to receicve a copy of my message as email'),
+            help_text=_('I want to receive a copy of my message'),
             required=False))
 
         fields.insert(0, FormField(
@@ -138,7 +138,7 @@ def get_form_fields(self):
 
         fields.insert(0, FormField(
             label='name',
-            help_text=_('Your first and last name'),
+            help_text=_('Your name'),
             field_type='singleline',
             required=False))
         return fields


Test patch:
Repository: liqd/a4-product

Issue:
very long username breaks profile and settings
![Screenshot from 2019-10-17 17-57-14](https://user-images.githubusercontent.com/8178179/67026284-bda0ae00-f107-11e9-85d4-1411949a40fa.png)
![Screenshot from 2019-10-17 17-55-57](https://user-images.githubusercontent.com/8178179/67026286-be394480-f107-11e9-9950-73b7c7c03e3f.png)



Discussion:

Resolving patch:
diff --git a/apps/users/migrations/0011_add_helptexts.py b/apps/users/migrations/0011_add_helptexts.py
new file mode 100644
--- /dev/null
+++ b/apps/users/migrations/0011_add_helptexts.py
@@ -0,0 +1,28 @@
+# Generated by Django 2.2.6 on 2019-10-18 08:16
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('a4_candy_users', '0010_rename_avatar_field'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='user',
+            name='bio',
+            field=models.TextField(blank=True, help_text='Tell us about yourself in 255 characters!', max_length=255, verbose_name='Biography'),
+        ),
+        migrations.AlterField(
+            model_name='user',
+            name='facebook_handle',
+            field=models.CharField(blank=True, help_text='Your facebook name is the last part of the URL, when you access your profile.', max_length=50, verbose_name='Facebook name'),
+        ),
+        migrations.AlterField(
+            model_name='user',
+            name='twitter_handle',
+            field=models.CharField(blank=True, max_length=15, verbose_name='Twitter handle'),
+        ),
+    ]
diff --git a/apps/users/models.py b/apps/users/models.py
--- a/apps/users/models.py
+++ b/apps/users/models.py
@@ -76,18 +76,23 @@ class User(auth_models.AbstractBaseUser, auth_models.PermissionsMixin):
         blank=True,
         max_length=255,
         verbose_name=_('Biography'),
+        help_text=_(
+            'Tell us about yourself in 255 characters!')
     )
 
     twitter_handle = models.CharField(
         blank=True,
         max_length=15,
-        verbose_name=_('Twitter name'),
+        verbose_name=_('Twitter handle'),
     )
 
     facebook_handle = models.CharField(
         blank=True,
         max_length=50,
         verbose_name=_('Facebook name'),
+        help_text=_(
+            'Your facebook name is the last part of the URL, '
+            'when you access your profile.')
     )
 
     homepage = models.URLField(


Test patch:
Repository: liqd/a4-product

Issue:
get_newsletters during normal register is broken
If checked, the user still has get_newsletters = False. But when changed in the account settings, it's changed.


Discussion:

Resolving patch:
diff --git a/apps/users/forms.py b/apps/users/forms.py
--- a/apps/users/forms.py
+++ b/apps/users/forms.py
@@ -14,6 +14,7 @@ class TermsSignupForm(auth_forms.UserCreationForm):
     })
 
     def signup(self, request, user):
+        user.get_newsletters = self.cleaned_data["get_newsletters"]
         user.signup(
             self.cleaned_data['username'],
             self.cleaned_data['email'],


Test patch:
Repository: liqd/a4-product

Issue:
#2321: small support banner is not shown in German
The mobile version of the support banner is not shown in German. 

![Bildschirmfoto 2019-10-21 um 13 07 23](https://user-images.githubusercontent.com/15341015/67200371-dbba2700-f403-11e9-9f98-27de83159e4f.png)



Discussion:

Resolving patch:
diff --git a/apps/organisations/migrations/0008_add_label_and_help_for_is_supporting.py b/apps/organisations/migrations/0008_add_label_and_help_for_is_supporting.py
new file mode 100644
--- /dev/null
+++ b/apps/organisations/migrations/0008_add_label_and_help_for_is_supporting.py
@@ -0,0 +1,18 @@
+# Generated by Django 2.2.6 on 2019-10-21 13:04
+
+from django.db import migrations, models
+
+
+class Migration(migrations.Migration):
+
+    dependencies = [
+        ('a4_candy_organisations', '0007_organisation_is_supporting'),
+    ]
+
+    operations = [
+        migrations.AlterField(
+            model_name='organisation',
+            name='is_supporting',
+            field=models.BooleanField(default=False, help_text='For supporting organisations, the banner asking for donations is not displayed on their pages.', verbose_name='is a supporting organisation'),
+        ),
+    ]
diff --git a/apps/organisations/models.py b/apps/organisations/models.py
--- a/apps/organisations/models.py
+++ b/apps/organisations/models.py
@@ -79,7 +79,10 @@ class Organisation(models.Model):
                     'The imprint will be shown on a separate page.')
     )
     is_supporting = models.BooleanField(
-        default=False
+        default=False,
+        verbose_name=_('is a supporting organisation'),
+        help_text=_('For supporting organisations, the banner asking '
+                    'for donations is not displayed on their pages.')
     )
 
     def __str__(self):


Test patch:
Repository: liqd/a4-product

Issue:
archived projects accessible via activity feed
 At https://www.beteiligung.in/liqd/ all projects are private but I can see the content of the projects if I click on the activity feed. Even if not signed in.


Discussion:
Thank you for noticing, this @CarolingerSeilchenspringer ! @MagdaN Could we add this to the sprint as a task without US? I think it is a relatively critical issue.
sure
Thank you! :)
Alright! We fixed the other new issues where we could see the content of private projects, when there was only one module and no event in that project. That was a new bug introduced with the timeline.
As for this issue here with the activitiy feed: all projects that are shown in the activitiy feed on bet.in/liqd are public, but archived. So, they are not shown as project tiles, but in the activity feed. Should we remove actions from archived projects from the activity feed?
currently archived projects can't be accessed anywhere (else) in a+?! #376 

@rittermo Should activities of archived projects be removed from the activity list?? Otherwise we should close this issue!

Resolving patch:
diff --git a/apps/organisations/views.py b/apps/organisations/views.py
--- a/apps/organisations/views.py
+++ b/apps/organisations/views.py
@@ -31,6 +31,7 @@ def get_context_data(self, **kwargs):
 
         context['action_list'] = Action.objects\
             .filter(project__organisation=self.object)\
+            .filter(project__is_archived=False) \
             .filter_public()\
             .exclude_updates()[:4]
 


Test patch:
Repository: OpenNMT/OpenNMT-tf

Issue:
Poor translation results with the Transformer
The Transformer model produces very bad translation results. Its implementation should be revised and fixed.

See also the reference implementation at https://github.com/tensorflow/tensor2tensor.


Discussion:

Resolving patch:
diff --git a/opennmt/utils/transformer.py b/opennmt/utils/transformer.py
--- a/opennmt/utils/transformer.py
+++ b/opennmt/utils/transformer.py
@@ -163,5 +163,5 @@ def add_and_norm(inputs,
       rate=dropout,
       training=mode == tf.estimator.ModeKeys.TRAIN)
   outputs += inputs
-  outputs = tf.contrib.layers.layer_norm(outputs)
+  outputs = tf.contrib.layers.layer_norm(outputs, begin_norm_axis=-1)
   return outputs


Test patch:
Repository: OpenNMT/OpenNMT-tf

Issue:
Crash loading parallel inputs with --data_dir
I found the next issue if I follow the tutorial and try to do

data:
  train_features_file:
    - train_source_1.records
    - train_source_2.txt
    - train_source_3.txt

in main.py at the method _prefix_paths
new_path = os.path.join(prefix, path) 
will crash because paths is a list and join can't be done on a list.

The fix should be just check the instance type at paths and iterate


Discussion:
Thanks for reporting. As you identified the fix, do you want to send a PR?
Sure, tomorrow i will be back to the office and i can send it to you if you tell me how to do it
not sure how to send you the code.

its just substitute inside main.py

_prefix_paths with this method
```
def _prefix_paths(prefix, paths):
  """Recursively prefix paths.

  Args:
    prefix: The prefix to apply.
    data: A dict of relative paths.

  Returns:
    The updated dict.
  """
  if isinstance(paths, dict):
    for key, path in six.iteritems(paths):
      paths[key] = _prefix_paths(prefix, path)
    return paths
  elif isinstance(paths, list):
      fixedPaths = list()

      for path in paths:
        fixedPaths.append(_prefix_paths(prefix,path))

      return fixedPaths
  else:
    path = paths
    new_path = os.path.join(prefix, path)
    if os.path.isfile(new_path):
      return new_path
    else:
      return path
```

Resolving patch:
diff --git a/opennmt/bin/main.py b/opennmt/bin/main.py
--- a/opennmt/bin/main.py
+++ b/opennmt/bin/main.py
@@ -27,6 +27,10 @@ def _prefix_paths(prefix, paths):
     for key, path in six.iteritems(paths):
       paths[key] = _prefix_paths(prefix, path)
     return paths
+  elif isinstance(paths, list):
+    for i, path in enumerate(paths):
+      paths[i] = _prefix_paths(prefix, path)
+    return paths
   else:
     path = paths
     new_path = os.path.join(prefix, path)


Test patch:
Repository: OpenNMT/OpenNMT-tf

Issue:
assert_state_is_compatible() cannot detect dimension difference between encoder_state and decoder_zero_state when encoder and decoder dimensions are not the same in NMTSmall model
I just followed the instructions on the page [http://opennmt.net/OpenNMT-tf/quickstart.html](http://opennmt.net/OpenNMT-tf/quickstart.html) and played around a little bit with the NMTSmall model by setting a different `num_units` value to the `UnidirectionalRNNEncoder`, say `256`, which is different from the `512` for the `AttentionalRNNDecoder`. 

This line

https://github.com/OpenNMT/OpenNMT-tf/blob/ae0ada93a652c02793de3b481e20315716ea4f23/opennmt/layers/bridge.py#L56

in the `CopyBridge` did not throw any error, even though the `encoder_state` and `decoder_zero_state` do not have the same dimensions, `256` vs `512`.

It probably natual for someone to think of using the `DenseBridge` when dimensions are set differently. However, the `CopyBridge` should be throwing some errors in such misusage cases here, instead of letting one to figure out that with some error message as follows

`ValueError: Dimensions must be equal, but are 1280 and 1536 for 'seq2seq/parallel_0/seq2seq/decoder_1/decoder/while/BasicDecoderStep/decoder/attention_wrapper/attention_wrapper/multi_rnn_cell/cell_0/lstm_cell/MatMul' (op: 'MatMul') with input shapes: [?,1280], [1536,2048].`

Can anyone please explain why the 
https://github.com/OpenNMT/OpenNMT-tf/blob/ae0ada93a652c02793de3b481e20315716ea4f23/opennmt/layers/bridge.py#L28
passed without an issue?

Thanks!


Discussion:
Thanks for reporting.

Looks like `tf.contrib.framework.with_same_shape(x, y)` is incorrectly used here as it does not throw directly but returns `y` with an [assert op](https://www.tensorflow.org/api_docs/python/tf/Assert) dependency. I think we could remove the use of this function and just check manually that the depth dimension is the same.

Resolving patch:
diff --git a/opennmt/layers/bridge.py b/opennmt/layers/bridge.py
--- a/opennmt/layers/bridge.py
+++ b/opennmt/layers/bridge.py
@@ -25,7 +25,11 @@ def assert_state_is_compatible(expected_state, state):
 
   for x, y in zip(expected_state_flat, state_flat):
     if tf.contrib.framework.is_tensor(x):
-      tf.contrib.framework.with_same_shape(x, y)
+      expected_depth = x.get_shape().as_list()[-1]
+      depth = y.get_shape().as_list()[-1]
+      if depth != expected_depth:
+        raise ValueError("Tensor %s in state has shape %s which is incompatible "
+                         "with the target shape %s" % (y.name, y.shape, x.shape))
 
 
 @six.add_metaclass(abc.ABCMeta)


Test patch:
Repository: OpenNMT/OpenNMT-tf

Issue:
Sharing Embedding meets ERROR!
when I set "share_embeddings=EmbeddingsSharingLevel.ALL" in Transformer model, The trained model can not be correctly infered, e.g. the model will output serveral same tokens for each input query. There may be a bug under this parameter. I also tried share_embeddings=EmbeddingsSharingLevel.NONE, it's ok. 
my env:
gpu: k40
os:redhat
cuda:9.0
opennmt-tf version: v1.20.1 and the current master.


Discussion:
Did you make sure to train with a joint vocabulary? If yes, how does the training loss look like with `share_embeddings=EmbeddingsSharingLevel.ALL`?
Yes.My task is Dialogue so I use same vocabulary for input and target. The loss curve seems well but the problem only happens during inference. 

I guess the embedding sharing has something bug. Please help me the fix that. 

The embedding sharing Transformer I used is just from config/models/transformer_share_embeddings.py
@guillaumekln
Yeah looks like there is a bug. Thanks for testing and reporting, that's helpful.

Resolving patch:
diff --git a/opennmt/inputters/inputter.py b/opennmt/inputters/inputter.py
--- a/opennmt/inputters/inputter.py
+++ b/opennmt/inputters/inputter.py
@@ -454,6 +454,7 @@ def build(self, input_shape=None):
             or (isinstance(attr, tf.keras.layers.Layer) and attr.variables)):
           for inputter in others:
             setattr(inputter, name, attr)
+            inputter.built = True
     else:
       for inputter, scope in zip(self.inputters, self._get_names()):
         with compat.tf_compat(v1="variable_scope")(scope):


Test patch: