sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: html/template: document ability to modify FuncMap after template parse by calling Funcs again
Labels: Documentation,help wanted,NeedsFix

# Background

I have a bunch of templates that have a complex dependency structure like:

     A -> B, D, E
     B ->  E, F
     C -> E, G
     D -> F, H
     E -> H
     F -> nil
     G -> nil
     H -> nil

The contents of the corresponding files ('A.tmpl', 'B.tmpl', etc.) are static; however, the `template.FuncMap` that they reference contain implicit reference to captured state that varies by caller. That is, the `FuncMap` is created like so:

```
func createFuncMap(request *rpc.Request) {
   result := template.FuncMap {
     "Foo": createFooFunc(request),
     "Bar": createBarFunc(request),
      ...
   }
  return request
}
```

# What I Want to Do

I'd like to be able to preparse all of the various files irrespective of the func map (or perhaps with a whitelist of functions that will be defined), and I'd like to parse the individual pieces separately (e.g. parse 'F' only once, even though it is a dependency of 'B' and 'D'), and then somehow combine the parsed templates together like:

```
   func getTemplate(name string) *template.Template {
     result := template.New(name).Funcs(getStubFunctionMap())
     for _, dep := range getDeps(name) {
        result.AddDep(getTemplate(dep))
      }
      result.Parse(getFileContent(name))
      return result
    }
```

I'd also like to trivially rebind the function map as in:


```
   func getBoundTemplate(name string, request *rpc.Request) *template.Template {
     cachedTemplate := getOrCreateCachedTemplate(name)
     boundTemplate := cachedTemplate.Clone().Funcs(funcMapFor(request))
     return boundTemplate
   }
```

# Why I Can't Do It

The documentation of `html/template` makes it appear that parsing is context dependent and that parsing is linear (dependencies can be added linearly, but cannot be combined from multiple, already-parsed templates). This is a pretty major limitation of the interface.

# Impact of This Limitation

This is a major efficiency problem; I want to parse a complex network of templates upfront before receiving requests and do very minimal work on each request. This structure is causing much more work to happen in the context of every request.

For more specifics of this use case, reach out to me directly from your `@google.com` account, and I can share more details of the specific code in question.
Repository: go
Issue: proposal: unsafe: clarify unsafe.Pointer rules for package syscall
Labels: Proposal,Proposal-Hold

unsafe.Pointer's rule 4 says:

> Conversion of a Pointer to a uintptr when calling syscall.Syscall.
>
> The Syscall functions in package syscall pass their uintptr arguments directly to the operating system, which then may, depending on the details of the call, reinterpret some of them as pointers. That is, the system call implementation is implicitly converting certain arguments back from uintptr to pointer.

It talks about "the Syscall functions", but on Windows, there's also [Proc.Call](https://golang.org/pkg/syscall/?GOOS=windows#Proc.Call) and [LazyProc.Call](https://golang.org/pkg/syscall/?GOOS=windows#LazyProc.Call).

**Q1:** Are these two functions "Syscall functions"? Strictly speaking, I would interpret "Syscall functions" to mean Syscall{,6,9,12,15,18}. Perhaps the docs should be clarified.

**Q2:** Do functions have to be called directly, or are indirect calls allowed? The rule explicitly warns that conversions have to be performed directly in the argument list, but it doesn't say anything about indirect calls.

**Q3:** For Proc.Call and LazyProc.Call, are direct calls via method expressions allowed? E.g., if `x.Call(uintptr(p), 0, 0)` is valid, then is `(*Proc).Call(x, uintptr(p), 0, 0)` also valid?

Clarifying this is relevant to determining how far we need to go in fixing #34474.

Incidentally, Q2 and Q3 also apply to rule 5. The status quo there is that cmd/compile safely handles `unsafe.Pointer(f(...))` for all `f(...)`, so we do allow indirect and method expression calls to reflect.Value.Pointer and reflect.Value.UnsafeAddr.

/cc @rsc @ianlancetaylor
Repository: flutter
Issue: Flutter driver test won't tap on empty GuestureDetector
Labels: a: tests,tool,t: flutter driver,P3,team-tool,triaged-tool

I replaced the `FloatingActionButton` in the standard flutter example app (created with a driver test) with 

```
      floatingActionButton: SizedBox(
        height: 200,
        width: 200,
        child: GestureDetector(
          key: Key('target'),
          onTap: _incrementCounter,
          behavior: HitTestBehavior.translucent,
//          child: Container(
//            decoration: BoxDecoration(color: Color.fromARGB(0, 0, 0, 0)),
//          ),
        ), // This trailing comma makes auto-formatting nicer for build methods.
      ),
```

and the finder in the driver test with

`SerializableFinder fab = find.byValueKey('target');`

If I run the app, I can still click on the button and increment the counter, but if I run the driver test, it fails.  However, if I uncomment the child container code above, the driver test passes.  

I think the driver should be able to tap on the GestureDetector when it's possible for a human to tap on it.

My test app is here https://github.com/tarobins/driver_tap_bug
Repository: pytorch
Issue: Allow one inferred axis in torch.split 
Labels: triaged,enhancement

## 🚀 Feature
Currently `split_with_sizes` expects to fully span the given dimension. Similar to `view()` it will be nice to allow `-1` to mean a split should be inferred.

## Motivation

```python
import torch
a = torch.arange(15).reshape(3,5)
splits = torch.split(a, [1, 2, 2], 1)
```
In order to do a split `a` we must know its dimension before hand and pass `split_size_or_sections` to fully span `a`. 

## Pitch

It would be nice to be able to do:

```python
import torch
a = torch.arange(15).reshape(3,5)
splits = torch.split(a, [1, 2, -1], 1)
```

Instead of:

> RuntimeError: split_with_sizes expects split_sizes have only non-negative entries, but got split_sizes=[1, 2, -1]

The last element could be inferred.

## Alternatives

We can use `tensor.shape` and avoid `-1` but with the same reason that `-1` is more elegant in some scenarios of `view`, `-1` will be more elegant for `split`
Repository: pytorch
Issue: [jit] `ScriptFunction`s are loaded as `ScriptModule`s
Labels: oncall: jit,triaged

If you have a `ScriptFunction` and you save it, then load it in the resulting object is a `ScriptModule`, not a `ScriptFunction`.

cc @suo
Repository: flutter
Issue: Provide embedder sample project inside engine repo
Labels: engine,d: examples,e: embedder,P2,team-engine,triaged-engine

Chinmay has a gist for embedding flutter using glfw: https://gist.github.com/chinmaygarde/8abf44921f7d87f6da7bf026267c4792

We should move that into flutter/engine and get a LUCI script that builds it to make sure that it is always up to date and compiling.  We could create a CMake build file to make it easy for people to build and run locally without building the engine.
Repository: rust
Issue: Bounds on associated types prevent a trait from being dyn-compatible
Labels: A-trait-system,A-associated-items,T-lang,T-compiler,C-bug,A-trait-objects

[playground](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b33e91b1b5bbcc0de0a646cf9622f74c)

```rust
trait Foo {
    type Bar: Other<Self::Bar>;
}

impl dyn Foo<Bar = ()> {}

trait Other<T> {}

impl<T> Other<T> for T {}
```

Doesn't compile with the error,

```
error[E0038]: the trait `Foo` cannot be made into an object
 --> src/lib.rs:5:6
  |
5 | impl dyn Foo<Bar = ()> {}
  |      ^^^^^^^^^^^^^^^^^ the trait `Foo` cannot be made into an object
  |
  = note: the trait cannot use `Self` as a type parameter in the supertraits or where-clauses
```

But this doesn't make sense, because `Self` (being the type erased thing in `dyn Foo`) is never referenced in *any* bound. `Self::Bar` is referenced, but this should be fine in a dyn-compatible[^1] trait because all associated types have to be specified to use the dyn-compatible trait (i.e. I can't do `dyn Foo` in this case). This can be seen in `Iterator` which is dyn-compatible.

I think this should work and allow these sorts of bounds.

Note that moving the bound to a function is perfectly fine as [seen here](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b58a544d26d330a36ec1f6d101c64a31), but not on associated types or the trait itself.

I think this may be related to #27675

[^1]: Formerly known as "object safe".
Repository: youtube-dl
Issue: Site support request: Yelo Play
Labels: site-support-request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2019.09.28. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a new site support request
- [x] I've verified that I'm running youtube-dl version **2019.09.28**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [ ] I've checked that none of provided URLs violate any copyrights
- [ ] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

https://www.yeloplay.be/series/romance/wtfock/season-1/episode-1

## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

Note: You need a login to access the videos.
Repository: youtube-dl
Issue: kuaishou
Labels: site-support-request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2019.09.28. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Make sure that all provided video/audio/playlist URLs (if any) are alive and playable in a browser.
- Make sure that site you are requesting is not dedicated to copyright infringement, see https://yt-dl.org/copyright-infringement. youtube-dl does not support such sites. In order for site support request to be accepted all provided example URLs should not violate any copyrights.
- Search the bugtracker for similar site support requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a new site support request
- [x] I've verified that I'm running youtube-dl version **2019.09.28**
- [x] I've checked that all provided URLs are alive and playable in a browser
- [x] I've checked that none of provided URLs violate any copyrights
- [x] I've searched the bugtracker for similar site support requests including closed ones


## Example URLs

<!--
Provide all kinds of example URLs support for which should be included. Replace following example URLs by yours.
-->

- Single video: http://m.gifshow.com/s/PiA9mAwT
- Single video: https://live.kuaishou.com/u/Mary981182762?csr=true
- Playlist: https://live.kuaishou.com/profile/Mary981182762


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

I posted 2 links for an example. The first link is the result of copying from a mobile application (client for iOs), the second is a redirect of this link in the browser for the computer.

A playlist is all the videos from this account, where the first video is a live stream (it is active at the time I send it)
 
Here is the link to the video stream that I received using debugging in the browser. This link is not directly on the page and it is calculated either by a flash player or a script. Perhaps the mobile version contains a direct link.
 
`https://ali-origin.pull.yximgs.com/gifshow/dWvg_fxrD9w.flv?auth_key=1570278505-0-0-04ee9c11e97bba67e2d4ca1c5ad925e2&oidc=alihb`
 
This link is downloaded by the youtube-dl without any problems (no additional authorization and cookies are required). Of course, it will not work after the end of the stream, and perhaps the key is individual for different IPs.
Repository: flutter
Issue: [Desktop] - Splash screen or background color customization
Labels: c: new feature,engine,platform-mac,platform-windows,customer: crowd,platform-linux,customer: google,a: desktop,P2,team-macos,triaged-macos

Internal: b/233627067

## Use case

For desktop support, it would be nice to have an easy way to configure a splash screen or a window background color (visible before Flutter first frame is rendered).

## Proposal

Add properties in c++ code (win32_flutter_window.cc, flutter_glfw.cc, etc) or in a configuration file   to make this customizable on desktop launchers.

Launching Flutter on desktop is in early stage and is moving fast so feel free to close this feature request if it is too soon to ask for this.

Edit by cbracken (2022-04-25): deduped against https://github.com/flutter/flutter/issues/82538. Add 78 thumbs-ups (and 23 hearts) to the total on this issue.
Repository: rust
Issue: A single method to rotate slices or vecs
Labels: T-libs-api,C-feature-request

Hello,

I know there's already 2 methods to rotate slices or vec (rotate_right and rotate_left).
But they both accept unsigned numbers exclusively.

Why not a single method which could accept a signed number ?
A positive number would turn to the right and a negative one to the left
Repository: godot
Issue: LightOccluder2D lets light through on Android when using GLES2
Labels: bug,platform:android,topic:rendering,confirmed,topic:2d

**Godot version:**
3.1.1

**OS/device including version:**
Win 10 / Android. Xiaomi Pocophone F1

**Issue description:**
When exporting to Android using GLES2, LightOccluder2D lets through light as seen in the picture below. The light is displayed correctly when switching to GLES3.

![light bug](https://user-images.githubusercontent.com/3285214/66222431-0f3d4780-e6c9-11e9-971f-51eaa06c0caf.png)

Expected result (On Windows using GLES2/3, using GLES3 on Android)

![expected](https://user-images.githubusercontent.com/3285214/66222523-401d7c80-e6c9-11e9-9c49-341c6342dc58.PNG)

**Steps to reproduce:**
Using a Light2D with shadows with a LightOccluder2D. Export to Android with GLES2.
Repository: terminal
Issue: Add a setting to manually set the Pane highlight color
Labels: Area-Settings,Product-Terminal,Issue-Task,Area-Theming

Follow up from #994 and PR:#3060

In the aforementioned PR, we're just using the accent color for highlighting the pane. We should let that be a customizable global setting.

Questions:
* There's been discussion before about allowing custom theming, hypothetically powered by XAML. Would we want to wait for that discussion to be had before we do this?
  - We'd probably want to change it from using `SystemAccentColor` to some `FocusedPaneBorder` color resource, that we define by default to be `SystemAccentColor`, should we decide to pursue this option
  - If we do want to do this in XAML later, would enabling it in the json _now_ negatively impact that future scenario?
Repository: storybook
Issue: [addon-docs] Deep linking to "kind" in JSDoc comments
Labels: feature request,addon: docs

**Is your feature request related to a problem? Please describe.**

In JSDocs for components, we may want to link to another component but it seems the "selectedKind" syntax may not work nicely when specifying `|` characters, like so:

```js
/**
 * See other component {@link /?selectedKind=Header|Menu | Header Menu}
 */

/**
 * See other component [Component](/?selectedKind=Header|Menu)
 */
```

The `@link` JSDoc will not translate to a link anyway, so perhaps that's out-of-scope for this request.

The syntax is also a bit awkward, it would be great to take a page out of something like [TypeDoc](https://typedoc.org/guides/doccomments/#symbol-references) and support a shorthand:

```js
/**
 * See other component [[Header|Menu]]
 */
```

The main issue is the pipe (`|`) character again, as it denotes what the link text will be vs. the path.

The approach probably also needs to take into account props table documentation, not just component documentation.

**Describe the solution you'd like**

Somehow being able to translate the kind syntax to something compatible with `@link` or a shorthand notation. It should *ideally* link to the `/docs/` path, not the raw story, since this is within the `addon-docs` context.

```js
/**
 * See other component [[Header|Menu]]
 */
```

This would render:

```
See other component <a href="?path=/docs/header-menu--*">Header | Menu</a>
```

If it were able to perhaps detect the exported `component` tied to the stories, you could use the component type itself:

```js
export default {
  title: "Header | Menu",
  component: HeaderMenu
}

/**
 * See other component [[HeaderMenu]]
 */
```

Storybook build would fail when component/kind doesn't match any known values, to ensure links are kept up-to-date.

**Describe alternatives you've considered**

You can kind of work around this in an awkward fashion by encoding the pipe using `%7C` and spaces with `%20`:

```js
/**
 * See [Menu](/?selectedKind=Header%7CMenu)
 */
```

This links to the stories, not the docs and it loses any benefits of potential warnings/checks of broken component links.

**Are you able to assist bring the feature to reality?**

Maybe

**Additional context**

Using the workaround looks like this when rendered:

![image](https://user-images.githubusercontent.com/563819/66223492-3c720180-e699-11e9-80a3-162070b624cb.png)
Repository: terminal
Issue: Add a setting to manually set the Pane border width
Labels: Help Wanted,Area-UserInterface,Area-Settings,Product-Terminal,Issue-Task

Follow up from #994 and PR:#3060

In the aforementioned PR, we're hardcoding the border width to `2`. This should really be configurable to any positive `double`.

Questions:

* _(Similar to the discussion in #3061)_ There's been discussion before about allowing custom theming, hypothetically powered by XAML. Would we want to wait for that discussion to be had before we do this?
  - If we do want to do this in XAML later, would enabling it in the json now negatively impact that future scenario?
Repository: flutter
Issue: Fix and re-enable EmbedderTest.CanLaunchAndShutdownMultipleTimes.
Labels: engine,P2,team-engine,triaged-engine
Repository: flutter
Issue: Use libdispatch for concurrent workqueues on Darwin.
Labels: engine,P2,team-engine,triaged-engine
Repository: flutter
Issue: Investigate ios-webkit-debug-proxy for debugging Flutter for Web apps on a connected iOS device
Labels: tool,platform-web,P2,team-web,triaged-web

The chrome remote device debugging does not currently work for non-Android device. The article below describes how to set up ios-webkit-debug-proxy to remotely debug web pages

https://medium.com/@nikoloza/how-to-debug-remote-ios-device-using-chrome-devtools-f44d697003a7

@mdebbar @nturgut and I weren't able to get this working locally, and instead we're debugging on the simulator.  We should investigate a way to get this working, such as manually doing port forwarding via the existing tooling.
Repository: rust
Issue: Audit ABI implementations in rustc_target (vs Clang).
Labels: A-codegen,A-FFI,T-compiler,WG-llvm,A-ABI

In https://github.com/rust-lang/rust/pull/63649#issuecomment-537896684 I wrote:
> The `wasm-bindgen` mismatch could've been avoided, had we validated the call ABI by comparing it with what Clang does, when it was initially implemented (to be clear, I think I dropped the ball here).
>
> Irrespective of what happens to this PR, I think we should do an audit of all our call ABIs, and institute a policy to prevent this from happening again in the future.
> cc @rust-lang/compiler @rust-lang/wg-codegen

The context there was that our `wasm32` ABI has been wrong since it was added, and `wasm-bindgen` now relies on the wrong ABI.

I opened this issue so we don't lose track of this, because I'm sure I will.
Repository: godot
Issue: Mono export templates lack mono shared libs on Linux system using /usr/lib64
Labels: bug,topic:buildsystem,confirmed,topic:dotnet

**Godot version:**
3.2 master (5a23ab61)

**OS/device including version:**
Linux, RPM-based distro or similar using `/usr/lib64` for 64-bit libraries (versus `/usr/lib` on Debian-based distros).

**Issue description:**
Our current logic to copy shared mono libraries to the export templates' `data.mono.*` folders rely on `mono_root + 'lib'`:
https://github.com/godotengine/godot/blob/5a23ab61fae79cce576fe7ec60fd928d2bd27fca/modules/mono/build_scripts/mono_configure.py#L389-L396

This fails on 64-bit RPM-based distros where mono is installed in `/usr/lib64` instead of `/usr/lib`.

We should rely on `pkg-config` when available to figure out what is the proper lib folder, and otherwise the logic should be (pseudo code):
```
if 64bit build:
  if lib64 exists: use lib64 (rpm)
  else: use lib (deb)
elif 32bit build:
  if lib32 exists: use lib32 (deb)
  else: use lib (rpm)
```

That's not all though, as mono hardcodes those installation paths, so trying to load a fix `data.mono` with the libraries in `Mono/lib` will still fail:
```
System.TypeInitializationException: The type initializer for 'System.Random' threw an exception. ---> System.DllNotFoundException: /home/akien/tmp/godot/test-export/lin/data_DodgeTheCreepsCS/Mono/lib/../lib64/libmono-native.so
```

So the data folder would need to have:
```
Mono/bin/*
Mono/lib/  (empty)
Mono/lib64/*
```

I'm not sure how we can influence the base path before `../lib64/libmono-native.so`, but if we can change it, it should likely point to `Mono/bin/` instead of `Mono/lib/`, so that we can have either:
```
Mono/bin/*
Mono/lib/*
```
or
```
Mono/bin/*
Mono/lib64/*
```
depending on whether the template was packaged on Ubuntu or CentOS, basically.