sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: os: chmod could report if mode bits that are not in use are provided
Labels: NeedsInvestigation

### What version of Go are you using (`go version`)?

<pre>
go version go1.16rc1 linux/amd64
</pre>

### Does this issue reproduce with the latest release?
Yes


### What operating system and processor architecture are you using linux/amd64

<!--
os.chmod("/tmp2", 01777)
-->



### What did you expect to see?
A directory with drwxrwxrwt


### What did you see instead?
drwxrwxrwx
Incorrect permission bit (missing t)

### Proposal

Chmod could return an error, if bits are supplied that are not in use.

This could point users to the documentation that alternatively could be improved (currently an iota source copy) and also protect users to a degree, that fail to use an octal literal notation e.g. 1777 like the chmod command line binary instead of 01777

I assume to some degree that os.chmod could return an error upon use of certain or ideally, all unused bits. Those bits could be reclaimed if needed in the future and consideration of user behaviour, considered before new bit assignments?

<Pre>
if (mode & 0o1000) != 0 {
   return errors.New("the supplied os.FileMode contains a unix sticky bit that is not currently in use, use os.ModeSticky ")
}

//Or along the lines of the following (sticky, sgid and suid) but perhaps for all unused bits.

if (mode & 0o7000) != 0 {
   return errors.New("the supplied os.FileMode contains a bit that is not currently in use, go chmod differs from unix chmod")
}
</pre>
Repository: pytorch
Issue: torch.searchsorted issues
Labels: module: docs,triaged,module: numpy,module: sorting and selection

https://pytorch.org/docs/stable/generated/torch.searchsorted.html?highlight=searchsorted#torch.searchsorted:

- does not have a "Returns" section explaining the dimensions and dtype of the returned tensor (currently it is amalgamated with the rest of documentation)
- hard to understand phrasing. NumPy docs include `Find indices where elements should be inserted to maintain order.`, while PyTorch only includes `Find the indices from the innermost dimension of sorted_sequence such that, if the corresponding values in values were inserted before the indices, the order of the corresponding innermost dimension within sorted_sequence would be preserved`
- very nonstandard argument name `out_int32`. Should it not be just be `dtype`? `int16`, `int8`, `uint16`, `uint8` outputs can be useful as well for saving memory (if it is known that arrays are small)
- has no example with the most simple case: 1d sequence and scalar query value; has no clear separate discussion of most obvious corner case: the query is less than all elements in the sequence, the query is larger than all elements in the sequence. as an illustration, it may be beneficial to have such example even if it fits in the general case
- has no tensor instance variant

cc @brianjo @mruberry @rgommers @heitorschueroff
Repository: pytorch
Issue: Gradient checkpointing support in C++ API
Labels: module: cpp,feature,triaged,enhancement

## 🚀 Feature
Gradient checkpointing feature is available as torch.utils.checkpoint.* in Python API. However, after an exhaustive search, I can't find a C++ equivalent of this feature. Self-implementing also seems difficult because C++ Node class is quite different from Python torch.autograd.Function class.

## Motivation

Due to a subtle reason I have to use C++ for model training. Everything works fine in using PyTorch C++ APIs since they mostly resembles their Python counterparts. However, one thing which is essential but missing is the gradient checkpointing feature.

## Pitch

The gradient checkpointing feature has an equivalent in C++: its functions most desirably reside in torch::utils::checkpoint namespace and resemble their Python counterparts `checkpoint` and `checkpoint_sequential`.

## Alternatives

Manually checkpointing the gradients is possible at least in my case, by replicating the logic in CheckpointFunction. However, since I can't hack the backward pass, I have to manually do backward() many times from each checkpointed output.

## Additional context

None


cc @yf225 @glaringlee
Repository: pytorch
Issue: Sort torch.topk() output following input index order
Labels: triaged,enhancement

## 🚀 Feature

Sort torch.topk() result following input index order

https://pytorch.org/docs/stable/generated/torch.topk.html
Repository: go
Issue: cmd/compile: optimize maps with bool keys
Labels: Performance,NeedsInvestigation

In programming, sometimes it is less verbose by using a map with bool key than using an if-else block. For example:
```go
    if condition {
        counter++
    } else {
        counter--
    }
```

vs.

```go
var boolToInt = map[bool]int{true: 1, false: 0}
...

    counter += boolToInt[condition]
```

Or
```go
    if condition {
        f(...)
    } else {
        g(...)
    }
```

vs.

```go
var boolToFunc = map[bool]func(...){true: f, false: g}
...

    boolToFunc[condition](...)
```

However, currently, the map form is much less efficient than the if-else block form:
```go
package main

import (
	"testing"
)

func f(x bool) int {
	if x {
		return 1
	} else {
		return 0
	}
}

var m = map[bool]int{true: 1, false: 0}
func g(x bool) int {
	return m[x]
}

var fr, gr int

func Benchmark_f(b *testing.B) {
	for i := 0; i < b.N; i++ {
		fr = f(true)
		fr = f(false)
	}
}

func Benchmark_g(b *testing.B) {
	for i := 0; i < b.N; i++ {
		gr = g(true)
		gr = g(false)
	}
}

Benchmark_f-4   	1000000000	         0.7478 ns/op
Benchmark_g-4   	19250287	        60.28 ns/op
```

Maps with bool keys could contain at most two entries, so I think it will be not hard to make optimizations for them.
If this could be implemented, it will be much helpful to improve performance for some Go programs.
Repository: rust
Issue: Returning a value that causes a borrow checker error is less precise than not returning it 
Labels: A-diagnostics,A-borrow-checker,T-compiler,D-terse

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur. 
-->

Given the following code: <!-- Please provide a link to play.rust-lang.org -->

```rust
struct Thing {
    a: i32,
    b: i32,
}

impl Thing {
    fn get_mut_a(&mut self) -> &mut i32 {
        &mut self.a
    }
    
    fn get_mut_b(&mut self) -> &mut i32 {
        &mut self.b
    }
    
    fn get_both<'a>(&'a mut self) -> (&'a mut i32, &'a mut i32) {
        let a = self.get_mut_a();
        let b = self.get_mut_b();
        (a, b)
    }
}
```

The current output is:

```
error[E0499]: cannot borrow `*self` as mutable more than once at a time
  --> src/lib.rs:17:17
   |
15 |     fn get_both<'a>(&'a mut self) -> (&'a mut i32, &'a mut i32) {
   |                 -- lifetime `'a` defined here
16 |         let a = self.get_mut_a();
   |                 ---- first mutable borrow occurs here
17 |         let b = self.get_mut_b();
   |                 ^^^^ second mutable borrow occurs here
18 |         (a, b)
   |         ------ returning this value requires that `*self` is borrowed for `'a`
```

<!-- The following is not always necessary. -->
Ideally, the output would not include the text:

```
returning this value requires that `*self` is borrowed for `'a`
```

While this text is *true*, it's not relevant to solving the problem. Changing the tail of the function improves the error message:

```rust
(a, b);
todo!()
```

```
18 |         (a, b);
   |          - first borrow later used here
```

This is the behavior in Rust 1.50.0 and 1.52.0-nightly (2021-02-23 fe1bf8e05c39bdcc73fc).
Repository: flutter
Issue: Need a ReorderableListView.seperated constructor
Labels: c: new feature,framework,f: material design,f: scrolling,c: proposal,good first issue,P3,team-design,triaged-design

## Steps to Reproduce

1. Run `flutter create bug`.
2. Update the files as follows:
Add a ReorderableListView child to the Scaffold body's child column. The issue is with every ReorderableListView, but the following makes it easy to see, as follows:
````dart
Expanded(
  ReorderableListView(
    children: List.generate(10, (index) => Container(
      key: ValueKey('abcd-$index'),
      width: 250,
      height: 150,
      color: Colors.lightBlue,
      margin: EdgeInsets.symmetric(vertical: 20, horizontal: 25),
    )),
    onReorder: (oldIndex, newIndex) {},
  )
)
`````
3. Long press on any of the children of the ReorderableListView and you will see that a box shadow is applied to the border around the margin of the child that was long pressed. 

**Expected results:** The shadow or animation shown by the ReorderableListView surrounds the actual child without including the margin of the child.

**Actual results:** The shadow or animation shown includes the margin of the child. 

Since it is not possible to define padding or separators for the ReorderableListView's children (unlike with the ListView.separated variant), I would have expected the margin to be respected by the ReorderableListView. Currently i do not know how to avoid this problem.

Screenshot showing the shadow around the margin:
<img src="https://user-images.githubusercontent.com/25553592/109020765-8c040380-76ba-11eb-8b6c-631e5172a846.png" width="300" />
Repository: godot
Issue: Accessing autoload from this autoload causes memory leak
Labels: bug,topic:gdscript

**Godot version:**
4.0.dev.custom_build. 2ffecb76e

**OS/device including version:**
Ubuntu 20.04

**Issue description:**
Accessing property in `CreateProjectBase` singleton from the same singleton e.g.
```
extends Node

var base_path: String = ""

func _ready():
	CreateProjectBase.base_path = ""
```
causes memory leak:
```
WARNING: ObjectDB instances leaked at exit (run with --verbose for details).
     at: cleanup (core/object/object.cpp:1932)
Leaked instance: Reference:-9222491877796740647
Hint: Leaked instances typically happen when nodes are removed from the scene tree (with `remove_child()`) but not freed (with `free()` or `queue_free()`).
Orphan StringName: @export_placeholder
Orphan StringName: @export_multiline
Orphan StringName: @export_flags_2d_physics
Orphan StringName: Reference
Orphan StringName: @export_global_dir
```

**Steps to reproduce:**
1. Open minimal project

**Minimal reproduction project:**
[Qarminer.zip](https://github.com/godotengine/godot/files/6037020/Qarminer.zip)
Repository: pytorch
Issue: [proposal] Make torchvision and other libraries' docs searchable via main docs search
Labels: module: docs,triaged,module: doc infra

Currently they're missing and require going to a specific library page. It would be more convenient to have single-stop search bar:

Can't find `draw_bounding_boxes`:
https://pytorch.org/docs/master/search.html?q=draw_bounding_boxes&check_keywords=yes&area=default

Can find `draw_bounding_boxes`:
https://pytorch.org/vision/master/utils.html?highlight=draw_bounding_boxes#torchvision.utils.draw_bounding_boxes

cc @ezyang @zou3519 @jlin27 @brianjo @mruberry
Repository: flutter
Issue: ios return-to-top + tab state caching + pagination inside tabs
Labels: platform-ios,framework,f: scrolling,has reproducible steps,P2,found in release: 2.10,found in release: 2.13,team-ios,triaged-ios

In my app i have TabBarView with tabs inside and i'm trying to befriend tabs with cached state and return-to-tap ios behavior.
Somehow after some struggling i achieved behavior using NotificationListener, but it is still imperfect, I can not to find solution when after clock tap scrollOffset of inactive tabs doesn't change to zero. Is there a way to achieve this?
[here is my repo with prototype code](https://github.com/misterfourtytwo/tabviewer_return_to_top) 
<!-- You must include full steps to reproduce so that we can reproduce the problem. -->

**Expected results:** <!-- what did you want to see? -->
After clock tap only currently opened scrollView resets its offset.
**Actual results:** <!-- what did you see? -->
Tap in notification area resets each tab's scroll position.
Repository: youtube-dl
Issue: pornoaer.com
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 2021.02.22. 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 **2021.02.22**
- [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://pornoaer.com/videos/2323/


## Description

<!--
Provide any additional information.
If work on your issue requires account credentials please provide them or explain how one can obtain them.
-->

WRITE DESCRIPTION HERE
Repository: react-native
Issue: "NETWORK ERROR" when making API call in react-native Android, while works in iOS
Labels: Needs: Triage :mag:

Please provide all the information requested. Issues that do not follow this format are likely to stall.

## Description
API calls not working in Android devices, while its working in iOS simulator and device

My BaseUrl -> 'http://167.XXX.XX.89'

My network_security_config.xml
![image](https://user-images.githubusercontent.com/25193916/109031590-e0bf7280-76ea-11eb-8732-d1a0d6948322.png)


I've included this file (network_security_config.xml) in AndroidManifest.xml (android/app/src/main) too.

My FLIPPER_VERSION
![image](https://user-images.githubusercontent.com/25193916/109030838-2b8cba80-76ea-11eb-8f34-1d9d5359f2a4.png)

Also I've commented out
![image](https://user-images.githubusercontent.com/25193916/109031014-5414b480-76ea-11eb-9302-6127a9ce62f7.png)


API calls are successfully working in iOS devices but not working in android.

ERROR
![image](https://user-images.githubusercontent.com/25193916/109031115-6a227500-76ea-11eb-8965-d9b35336e475.png)



## React Native version:
![image](https://user-images.githubusercontent.com/25193916/109030546-e9637900-76e9-11eb-9d1a-e77a56e94a50.png)

System:
    OS: macOS 11.2.1
    CPU: (8) x64 Apple M1
    Memory: 33.83 MB / 8.00 GB
    Shell: 5.8 - /bin/zsh
  Binaries:
    Node: 14.15.3 - /usr/local/bin/node
    Yarn: Not Found
    npm: 6.14.9 - /usr/local/bin/npm
    Watchman: Not Found
  Managers:
    CocoaPods: 1.10.1 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
    Android SDK:
      API Levels: 29
      Build Tools: 28.0.3, 29.0.2
      System Images: android-29 | Intel x86 Atom_64
      Android NDK: Not Found
  IDEs:
    Android Studio: 4.1 AI-201.8743.12.41.7042882
    Xcode: 12.4/12D4e - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_282 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: ^16.13.1 => 16.14.0 
    react-native: ^0.63.2 => 0.63.4 
    react-native-macos: Not Found
  npmGlobalPackages:
    *react-native*: Not Found


## Steps To Reproduce
Provide a detailed list of steps that reproduce the issue.

1. Tried making API calls in Android.
2. Its not working, its working in iOS devices.

## Expected Results
Successful API Calls.

## Snack, code example, screenshot, or link to a repository:
Please provide a Snack (https://snack.expo.io/), a link to a repository on GitHub, or provide a minimal code example that reproduces the problem.
You may provide a screenshot of the application if you think it is relevant to your bug report.
Here are some tips for providing a minimal example: https://stackoverflow.com/help/mcve
Repository: rust
Issue: Improve error message for wrong attempt to box error
Labels: A-diagnostics,A-trait-system,T-compiler,D-verbose

So this came up when someone at my work started writing their first bits of Rust code for a binary and decided to use `Result<i32, Box<dyn std::error::Error>>` for a function. Given they wanted to go from a `Result<T, E> where E: std::error::Error` it seemed logical to try a `.into()` after the result type but the error message wasn't helpful so they came and asked me.

An example from rust playground

```rust
fn f() -> Result<i32, Box<dyn std::error::Error>> {
    Result::<i32, std::io::Error>::Ok(42).into()
}
```

printout

```
   Compiling playground v0.0.1 (/playground)
error[E0277]: the trait bound `std::result::Result<i32, Box<dyn std::error::Error>>: From<std::result::Result<i32, std::io::Error>>` is not satisfied
 --> src/lib.rs:2:43
  |
2 |     Result::<i32, std::io::Error>::Ok(42).into()
  |                                           ^^^^ the trait `From<std::result::Result<i32, std::io::Error>>` is not implemented for `std::result::Result<i32, Box<dyn std::error::Error>>`
  |
  = help: the following implementations were found:
            <std::result::Result<miniz_oxide::MZStatus, miniz_oxide::MZError> as From<&miniz_oxide::StreamResult>>
            <std::result::Result<miniz_oxide::MZStatus, miniz_oxide::MZError> as From<miniz_oxide::StreamResult>>
  = note: required because of the requirements on the impl of `Into<std::result::Result<i32, Box<dyn std::error::Error>>>` for `std::result::Result<i32, std::io::Error>`

error: aborting due to previous error

For more information about this error, try `rustc --explain E0277`.
error: could not compile `playground`

To learn more, run the command again with --verbose.
```

The playground error looks a bit extra from what they got, what they had was going from attempting to parse a string into an into so `std::num::ParseIntError` into the boxed error. And what the message they pasted to me looked like this:

```
the trait `std::convert::From<std::result::Result<i16, std::num::ParseIntError>>` is not implemented for `std::result::Result<i16, std::boxed::Box<dyn std::error::Error>>`
```

So (in my opinion) ideally it should suggest using `map_err(|e| e.into())` if it can see that E can go into `Box<dyn std::error::Error>`. For a more general case if going from `Result<T, E> -> Result<T, F> where E: Into<F>` and the user uses into (or from?), suggest `map_err`. And suggest map for the similar case of `Result<T, E> -> Result<U, E> where T: Into<U>.
Repository: ant-design
Issue: Ability to set attribute "dangerouslySetInnerHTML" with ellipsis using antd
Labels: Inactive

- [ ] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### What problem does this feature solve?
We can set ellipsis to <Paragraph></Paragraph> but if ellipsis is required along with "dangerouslySetInnerHTML" attribute, it's not available.

More details available here -
https://stackoverflow.com/questions/66350386/how-to-set-attribute-dangerouslysetinnerhtml-with-ellipsis-using-antd
https://github.com/ant-design/ant-design/discussions/29459

### What does the proposed API look like?
```
<Paragraph ellipsis={{ rows: 2, expandable: true, symbol: "more" }}>
      <span dangerouslySetInnerHTML={{ __html: comment.comment }} />
</Paragraph>

```
or

```
<Paragraph ellipsis={{ rows: 2, expandable: true, symbol: "more" }} dangerouslySetInnerHTML={{ __html: comment.comment }}>
</Paragraph>
```


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: pytorch
Issue: Basic feature missing
Labels: module: autograd,triaged

Pytorch is based on autograd. When I calculate a backward pass, for example, y = x**2, y.backward(), pytorch is missing the extremely basic feature to be able to get x from y, that is, to display where the gradient will be propagated to. Of course, internally pytorch needs to have this, inside the so called "computational graph", but it seems that developers forgot that not only pytorch internals, but users of pytorch need to be able to get the computational graph too. If y.backward() propagates gradients to the tensor x, I should be able to see to which tensor the gradients will be or are being propagated. If this method exists, it is not documented as far as I could find.

cc @ezyang @albanD @zou3519 @gqchen @pearu @nikitaved @soulitzer
Repository: go
Issue: cmd/go: go test -json has inconsistent Time precision
Labels: NeedsInvestigation,GoCommand

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.14.13 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes (go1.16)

### What did you do?

Ran `go test -json` on a package, and attempted to sort the resulting JSON via jq using the `Package` and `Time` fields.

### What did you expect to see?

I expected jq to sort the results correctly.

### What did you see instead?

I noticed that the decimal precision of the `Time` field is inconsistent. My guess is that it is chopping off trailing zeros. However, this means that the resulting timestamps cannot be sorted properly. For example, we might get the following two entries:

> {"Time":"2021-02-24T14:14:25.8589Z","Action":"output","Package":"my-package","Test":"TestFoo","Output":"=== RUN TestFoo\n"}
> {"Time":"2021-02-24T14:14:25.8589131Z","Action":"output","Package":"my-package","Test":"TestFoo","Output":" --- PASS: TestFoo (0.00s)\n"}

Since 'Z' > '1', this causes the "PASS" line to get sorted before the "RUN" line. This is especially a problem when dealing with older (< 1.6) versions of jq that do not perform a stable sort.