WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
https://facebook.github.io/react-native/docs/cameraroll.html#getphotos

Issue 2:
Right now the picker defaults to single mode, it would be nice to be able to have a multi-mode, by passing a parameter when you launch it, then an array is returned of files instead of just one.

for android this might help speed things up

unique code

intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);

full example

Intent intent = new Intent();
intent.setType("image/*");
intent.putExtra(Intent.EXTRA_ALLOW_MULTIPLE, true);
intent.setAction(Intent.ACTION_GET_CONTENT);
startActivityForResult(Intent.createChooser(intent,"Select Picture"), 1);

for iOS I think maybe using this library might help, and seems up to date.

https://github.com/hackiftekhar/IQMediaPickerController
Issue 1:
Installing a package from a remote repository from Github gives me:

$ rustpkg install git://github.com/brson/rust-sdl.git
rust: task failed at 'Package git:/github.com/brson/rust-sdl.git not found in any of the following workspaces: [.]', /Users/pascal/git/rust/src/librustpkg/workspace.rs:24

Note the missing / in the URL. The same is happening if I omit the git:// part. Tested with 3290110. The people on #rust noted that rustpkg is not usable today but encouraged me to file a bug so that it doesn't get lost.

Issue 2:
if you have a cross-crate crust fn, it has type native fn not *u8
Issue 1:
My issue is about high memory usage when using orthogonal indexing on sparse arrays, dependent on the shape of the indexers.

Reproducing code example:

%load_ext memory_profiler
from scipy import sparse
import numpy as np

s = sparse.random(10000, 10000, format="csr")
idx = np.arange(10000)

# This uses a reasonable amount of memory
%memit s[idx.reshape(-1, 1), idx]
# peak memory: 135.93 MiB, increment: 46.52 MiB

# This does not
%memit s[np.ix_(idx, idx)]
# peak memory: 2066.09 MiB, increment: 1930.15 MiB

As far as I can tell, the results are exactly the same. Only performance is different.

It looks like this is (at least partially) a known issue (#12015 (comment)).

Initially discovered in scverse/anndata#380

Scipy/Numpy/Python version information:

# 1.4.1 1.18.4 sys.version_info(major=3, minor=7, micro=7, releaselevel='final', serial=0)

Issue 2:
A typical way to perform outer indexing can be unnecessarily and surprisingly super slow. It is illustrated in the in/out below.

I think the issue could be fixed by adding another fast path for input as in my In [8] to scipy._index.IndexMixin, in a similar manner to how it's done when using the method of In [10].

Reproducing code example:

In [1]: import scipy.sparse as ss, numpy as np

In [2]: matrix = ss.random(2000, 50000, format="csr")

In [3]: idx0 = np.arange(1000)[:, None]

In [4]: idx1 = np.arange(1000, 2000)

In [5]: imod = np.arange(25)[None, :]

In [6]: idx1 = (idx1[:, None] + 1000 * imod).T.reshape(-1, 1)

In [8]: # The 'easy' way to index: also really slow
...: %timeit out0 = matrix[idx0, idx1.T]
743 ms � 48 ms per loop (mean � std. dev. of 7 runs, 1 loop each)

In [9]: # Equivalent submatrix, but not so easy to write: Much faster
...: %timeit out1 = matrix[idx0.ravel(), :][:, idx1.ravel()]
3.57 ms � 89.6 �s per loop (mean � std. dev. of 7 runs, 100 loops each)

In [10]: # There is an existing fast path when the second index is 1D
...: %timeit out2 = matrix[idx0, idx1.ravel()]
3.47 ms � 113 �s per loop (mean � std. dev. of 7 runs, 100 loops each)

Scipy/Numpy/Python version information:

In [40]: import sys, scipy, numpy; print(scipy.__version__, numpy.__version__, sys.version_info)
1.3.0 1.16.4 sys.version_info(major=3, minor=7, micro=3, releaselevel='final', serial=0)
Issue 1:
I am running jax revision 0981e75 (currently master) which I compiled for Python 3.7.3 installed with homebrew. This crash also happens with a pip installable jax.

The issue can be reproduced with the following piece of code:

from jax import np

for i in range(15, 20):
print(i)
np.linalg.cholesky(np.eye(i))

The program crashes after the i==17.

15
/Users/bayerj/.virtualenvs/try-jax/lib/python3.7/site-packages/jax/lib/xla_bridge.py:114: UserWarning: No GPU/TPU found, falling back to CPU.
warnings.warn('No GPU/TPU found, falling back to CPU.')
16
17
[1] 81997 bus error python3 bug.py

Issue 2:
I'm not exactly sure why this happens, being unfamiliar with the internal architecture, but on MacOS with Python 3.6.8, the following code segfaults if scipy 1.2.1 is installed (the version that comes by default when you pip install jax jaxlib):

import jax.random as random
import jax.scipy.linalg as linalg

key = random.PRNGKey(42)
# For some reason, matrices smaller than (50, 50) or so do not trigger segfaults
X = random.normal(key, (500, 500))
A = X @ X.T # Drawn from standard Wishart distribution
linalg.cholesky(A)
print("Success!")

Output:

$ python -W ignore test.py
zsh: bus error python -W ignore test.py

If I roll back to Scipy 1.1.0, everything works:

$ python -W ignore test.py
Success!

This is a great project by the way--thanks for working on it!

Edit: after further digging, I found the following in the the Scipy 1.2 release notes:

scipy.linalg.lapack now exposes the LAPACK routines using the Rectangular Full Packed storage (RFP) for upper triangular, lower triangular, symmetric, or Hermitian matrices; the upper trapezoidal fat matrix RZ decomposition routines are now available as well.

Perhaps this has something to do with it?

Even more edits: yet more digging has revealed scipy/scipy#9751, which hints that this might be caused by a specific (old) version of XCode. I will report back once XCode is upgraded.
Issue 1:
In this challenge, the moment I write "function" the whole thing just freezes. I tried it over and over, refreshing, restarting, waiting days in between. It always freezes at the exact same point. I start typing the reverse code and as soon as I write function, it simply freezes

Challenge Waypoint: Reverse Arrays with reverse has an issue.

User Agent is: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.86 Safari/537.36.

Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

var array = [1,2,3,4,5,6,7];

// Only change code below this line.

var newArray = array;

// Only change code above this line.

Issue 2:
This issue probably exists somewhere, but adding a function below a bonfire's default code will crash the browser.

Adding a function above a Bonfire's default code doesn't cause any problems.
Issue 1:
This code:

trait Foo<T> {}
struct Bar<T>;
impl<T> Foo<T> for Bar<T> {}

fn get<H: Foo<int>>(val: H) {}

fn main() {
get(Bar);
}

Is producing an error:

<anon>:8:5: 8:8 error: cannot determine a type for this bounded type parameter: unconstrained type
<anon>:8 get(Bar);
^~~

I'm not sure whether this is a bug or just a known limitation of type inference, but in both case it would be nice if it worked.

Surprisingly I didn't manage to find a duplicate issue.

Issue 2:
Sometimes you just want to do something some number of times. There's no real concise way to express that right now.
Issue 1:
bootstrap not validated what the hell with this......

http://jigsaw.w3.org/css-validator/validator?uri=http://twitter.github.com/bootstrap

Issue 2:
I didn't find how to update data-source with typeahead. I tried to make it work simply with a new typehead() call and new values, but it does not update at all.

The first call works perfectly :) but the second one does.. nothing :(

$('select').change(function() {
var id = $(this).val();
$.getJSON(url + id, function(data) {
$('input').typeahead({
source: data
});
$('input.hide').slideDown(120);
});
});
Issue 1:
From @SamVerschueren on October 23, 2015 19:18

Is it possible to have something like an OutputInputChannel? I am creating a command that requires terminal input from the user.

If necessary, want to share more on the project I'm working on.

Copied from original issue: Microsoft/vscode-extensionbuilders#55

Issue 2:
Visual Studio Code (version 0.10.11 on Windows 10586.164):

Source code, documentation, signature, all look almost the same. The following issues make it difficult to read:

Same background as the underlying text view

Same font and color as source code for documentation and signature, even line heights matches

Difficult to see where does documentations ends and where does the actual signature begins

Signature is incorrectly syntax highlighted: only the const keyword is highlighted, while any or any other type is not

Wraps the signature into multiple lines which makes it more difficult to read, even if I still have a bunch of space horizontally on my screen

+1 Links in the documentation text look like highlighted keywords. First thought was it is a bug: even the text is colorized, then seen that they are links.

For reference, Visual Studio:

Different background and typography, it does not feel like it is embedded into the editor (the other one looks like an area in the editor with a border, there is no depth)

Documentation and signature is separated visually

Signature colorized correctly (keywords, types, identifiers)

Signature is not wrapped into multiple lines

Steps to Reproduce:

Hover on anything
Issue 1:
System information (version)

OpenCV => 3.4.2

Operating System / Platform => Windows 64 Bit

Compiler => Visual Studio 2015

Python => Python 3.6 (64-bit)

BuildInformation.txt

Detailed description

I have only one camera connected to my pc. When I try to connect to it and grab a frame (code example 1), I end up with an error after a 10 second time out. Coincidentally, I found, that I am able to connect to my camera by using index -1 for cv2.VideoCapture(index), see code example 2.

As cv2.VideoCapture(index) is initilized by an index, I'd suppose this index would start with 0.

Steps to reproduce

Python Code example 1 (returns error)

import cv2

cap = cv2.VideoCapture(0)
_, frame = cap.read()

returning output:

[ WARN:0] videoio(MSMF): can't grab frame. Error: -2147483638
Traceback (most recent call last): File "D:\...\Test1.py", line 10, in <module> hsvFrame = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV) cv2.error: OpenCV(3.4.2) c:\projects\opencv-python\opencv\modules\imgproc\src\color.hpp:253: error: (-215:Assertion failed) VScn::contains(scn) && VDcn::contains(dcn) && VDepth::contains(depth) in function 'cv::CvtHelper<struct cv::Set<3,4,-1>,struct cv::Set<3,-1,-1>,struct cv::Set<0,5,-1>,2>::CvtHelper'

Python Code example 2 (works)

import cv2

cap = cv2.VideoCapture(-1)
_, frame = cap.read()

Issue 2:
System information (version)

OpenCV => 3.2,0

Operating System / Platform =>Windows 64 Bit

Compiler => mingw32

Detailed description

Hello I am installing opencv in QT as mention below link :

https://wiki.qt.io/How_to_setup_Qt_and_openCV_on_Windows

During below step :

d:

cd d:

cd opencv-build

mingw32-make -j 8

mingw32-make install

Brief part

collect2.exe: error: ld returned 1 exit status

modules\highgui\CMakeFiles\opencv_highgui.dir\build.make:202: recipe for target 'bin/libopencv_highgui320.dll' failed

mingw32-make[2]: *** [bin/libopencv_highgui320.dll] Error 1

CMakeFiles\Makefile2:4399: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed

mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2

Makefile:159: recipe for target 'all' failed

mingw32-make: *** [all] Error 2

collect2.exe: error: ld returned 1 exit status

modules\highgui\CMakeFiles\opencv_highgui.dir\build.make:202: recipe for target 'bin/libopencv_highgui320.dll' failed

mingw32-make[2]: *** [bin/libopencv_highgui320.dll] Error 1

CMakeFiles\Makefile2:4399: recipe for target 'modules/highgui/CMakeFiles/opencv_highgui.dir/all' failed

mingw32-make[1]: *** [modules/highgui/CMakeFiles/opencv_highgui.dir/all] Error 2

Makefile:159: recipe for target 'all' failed

mingw32-make: *** [all] Error 2

i am getting compilation as mentioned in attached file

Opencv_QT.txt

Steps to reproduce
Issue 1:
Issue Description

I have noticed that when I return to view my completed Camper News project, I am failing to get access to the API via AJAX, as I'm now getting the "No-Access-Control-Origin" error in the console. This has been working from the moment I completed it (2015), but for reason, it does not work anymore, so no news info is populating the page as I designed. Not sure if FCC server still accepts CORS or if I'm doing something wrong?

I tried pulling up the project on codepen via Firefox Browser, as well as my iPhone's Safari browser. Same results.

My Browser Information

Chrome Version 49.0.2623.87 (64-bit)

Linux, Ubuntu Mate 15.10

My Code

My codepen

var req = new XMLHttpRequest();
req.open("GET", "http://www.freecodecamp.com/news/hot", true);
req.onload = function() {
var fcc;
fcc = JSON.parse(req.responseText);
var amountToDisplay = 40;
for (var i = 0; i < amountToDisplay; i++) {
var storySection = document.querySelector(".story-section");
var story = document.createElement("div");
var headline = document.createElement("a");
var img = document.createElement("img");[GitHub](http://github.com)
var author = document.createElement("a");
var likes = document.createElement("p");
story.classList.add("story");
headline.classList.add("headline");
headline.setAttribute("href", fcc[i].link);
headline.innerHTML = fcc[i].headline;
headline.setAttribute("target", "_blank");
img.setAttribute("src", fcc[i].author.picture);
author.classList.add("author");
author.setAttribute("href", "http://www.freecodecamp.com/" + fcc[i].author.username);
author.innerHTML = "By " + fcc[i].author.username;
likes.innerHTML = "♥ " + fcc[i].upVotes.length;
likes.classList.add("likes");
story.appendChild(headline);
story.appendChild(img);
story.appendChild(author);
story.appendChild(likes);
storySection.appendChild(story);
};

};
req.send();

Issue 2:
Challenge Show Relationships with a Force Directed Graph has an issue.

User Agent is: Mozilla/5.0 (X11; Ubuntu; Linux i686; rv:41.0) Gecko/20100101 Firefox/41.0.

Please describe how to reproduce this issue, and include links to screenshots if possible.

Just opened the pen and it spits out a CORS error.
Issue 1:
Original ticket http://projects.scipy.org/numpy/ticket/930 on 2008-10-14 by trac user jbosch, assigned to unknown.

The empty_like and zeros_like creation functions, which are defined in python in numeric.py, differ in their handling of array-subtype input from ones_like, which is defined in C as a ufunc.

In particular, if a subtype of ndarray is passed to empty_like or zeros_like, neither __array_wrap__ or __array_finalize__ is called, which makes it impossible for subtypes to define any extra attributes they might need.

I believe this behavior could be fixed entirely by switching from:

if isinstance(a,ndarray):

to

if type(a)==ndarray:

at the top of those two functions, though there are probably more efficient ways to accomplish the same thing.

Issue 2:
Copied code for NumPy.ipmt at https://docs.scipy.org/doc/numpy/reference/generated/numpy.ipmt.html#numpy.ipmt.

import numpy as np
principal = 2500.00
per = np.arange(1*12) + 1
ipmt = np.ipmt(0.0824/12, per, 1*12, principal)
ppmt = np.ppmt(0.0824/12, per, 1*12, principal)
fmt = '{0:2d} {1:8.2f} {2:8.2f} {3:8.2f}'
for payment in per:
index = payment - 1
principal = principal + ppmt[index]
print(fmt.format(payment, ppmt[index], ipmt[index], principal))

Expected output:

1 -200.58 -17.17 2299.42

2 -201.96 -15.79 2097.46

3 -203.35 -14.40 1894.11

4 -204.74 -13.01 1689.37

5 -206.15 -11.60 1483.22

6 -207.56 -10.18 1275.66

7 -208.99 -8.76 1066.67

8 -210.42 -7.32 856.25

9 -211.87 -5.88 644.38

10 -213.32 -4.42 431.05

11 -214.79 -2.96 216.26

12 -216.26 -1.49 -0.00

I get:

0 -216.26 -1.49 2283.74

1 -199.21 -18.53 2084.52

2 -200.58 -17.17 1883.94

3 -201.96 -15.79 1681.98

4 -203.35 -14.40 1478.64

5 -204.74 -13.01 1273.89

6 -206.15 -11.60 1067.74

7 -207.56 -10.18 860.18

8 -208.99 -8.76 651.19

9 -210.42 -7.32 440.77

10 -211.87 -5.88 228.90

11 -213.32 -4.42 15.57

12 -214.79 -2.96 -199.21

per variable is supposed to start the payment number count at 1, but as you can see, when I do it, it starts at 0 and throws off the entire array.

Numpy version information: 1.17.0

Python version information: 3.7.3 (v3.7.3:ef4ec6ed12, Mar 25 2019, 22:22:05) [MSC v.1916 64 bit (AMD64)]

How do I get an accurate array?

Thank you.
Issue 1:
this applies to v0.14.0-rc2

OnChange event does not pass menuItem anymore. Based on documentation it should be

onChange function(event, selectedIndex, menuItem)

Instead, what is happening now is

onChange function(event, selectedIndex, selectedIndex)

Both 2nd and 3rd parameters are selectedIndex, menuItem never get passed along. Please fix.

Also I use extra properties in menuItem of pass data, so please retain everything in menuItem.

e.g. I use menuItem as

let menuItems = [
{ id: 'myid', payload: '1', text: 'Never' },
{ id: 'myid', payload: '2', text: 'Every Night' },
];

Issue 2:
I upgraded react and material-ui to the 0.14-rc2

and Dropdown menu params seem to have changed

I wouldn't think a change like this would slip through react itself

Package: react@0.14.3

Maintainers: mdg

Git: https://github.com/meteor/react-packages

Implies: jsx, react-meteor-data, react-runtime

<DropDownMenu
hintText='topic'
selectedIndex={topicMenuIndex}
onChange={this.setTopicFilter}
menuItems={this.data.topics}
desktop={true}
/>

setTopicFilter(event, selectedIndex, menuItem)

previously the 3rd param was the text of the menuItem but now I'm getting the selectedIndex twice.

could this be related to the Menu composability refactoring?
Issue 1:
I've confirmed the error does not occur in Pandas 0.16 on a similar machine.

Code Sample, a copy-pastable example if possible

import pandas as pd
df = pd.DataFrame({'x': ['a', 'a', 'b'],
'y': [pd.Timestamp('2016-05-07 20:09:25+00:00'), pd.Timestamp('2016-05-07 20:09:29+00:00'), pd.Timestamp('2016-05-07 20:09:29+00:00')]})
df.groupby('x').count()

Observed output

ValueError Traceback (most recent call last)
<ipython-input-5-3119045de5b1> in <module>()
2 df = pd.DataFrame({'x': ['a', 'a', 'b'],
3 'y': [pd.Timestamp('2016-05-07 20:09:25+00:00'), pd.Timestamp('2016-05-07 20:09:29+00:00'), pd.Timestamp('2016-05-07 20:09:29+00:00')]})
----> 4 print df.groupby('x').count()

/usr/local/lib/python2.7/dist-packages/pandas/core/groupby.pyc in count(self)
3754 blk = map(make_block, map(counter, val), loc)
3755
-> 3756 return self._wrap_agged_blocks(data.items, list(blk))
3757
3758

pandas/lib.pyx in pandas.lib.count_level_2d (pandas/lib.c:23068)()

ValueError: Buffer has wrong number of dimensions (expected 2, got 1)

Expected Output

x y
a 2
b 1

output of pd.show_versions()

INSTALLED VERSIONS
------------------
commit: None
python: 2.7.6.final.0
python-bits: 64
OS: Linux
OS-release: 3.13.0-32-generic
machine: x86_64
processor: x86_64
byteorder: little
LC_ALL: None
LANG: en_US.UTF-8

pandas: 0.18.1
nose: 1.3.1
pip: 8.1.2
setuptools: 21.2.1
Cython: None
numpy: 1.11.0
scipy: 0.16.0
statsmodels: 0.5.0
xarray: None
IPython: 4.2.0
sphinx: None
patsy: 0.2.1
dateutil: 2.5.3
pytz: 2016.4
blosc: None
bottleneck: 0.8.0
tables: 3.1.1
numexpr: 2.2.2
matplotlib: 1.5.1
openpyxl: 1.7.0
xlrd: 0.9.2
xlwt: 0.7.5
xlsxwriter: 0.5.8
lxml: None
bs4: 4.2.1
html5lib: 0.999
httplib2: None
apiclient: None
sqlalchemy: 0.9.7
pymysql: None
psycopg2: 2.5.3 (dt dec pq3 ext)
jinja2: 2.8
boto: 2.36.0
pandas_datareader: None

Issue 2:
Currently masking by boolean vectors it doesn't matter which syntax you use:

df[mask]
df.iloc[mask]
df.loc[mask]

are all equivalent. Should mask df.iloc[mask] mask by position? (this makes sense if mask is integer index).

This SO question.
Issue 1:
When I write this code,syntax highlighting is error with too much '

var http = require('http'),
util = require('util'),
databaseUrl = "***",
collections = ["files"],
db = require("mongojs").connect(databaseUrl, collections);

var spawn = require('child_process').spawn,
ffmpeg = spawn('./ffmpeg-2.1.3/bin/ffmpeg', ['-i','upload_3481af342dad78be657922eb9f70a87d.MOV','-c:v','libx264','-subq','7','-qcomp','0.6','-qmin','10','-qmax','50','-qdiff','4','-bf','16','-coder','1','-refs','6','-x264opts','b-pyramid:weightb:mixed-refs:8x8dct:no-fast-pskip=0','-vprofile','high','-pix_fmt','yuv420p','-b:v','2500k','-s','720x1280','-r','29.829','-g','60','-vf','transpose=1','-metadata:s:v','rotate="0"','-c:a','libfdk_aac','-filter_complex','aresample=async=1:min_hard_comp=0.100000:first_pts=0','-b:a','128k','-ar','44100','-ac','2','-f','mp4','-flags','+loop+mv4','-cmp','256','-partitions','+parti4x4+partp8x8+partb8x8','-trellis','1','-refs','6','-me_range','16','-keyint_min','20','-sc_threshold','40','-i_qfactor','0.71','-bt','700k','-maxrate','2500k','-bufsize','5000k','-rc_eq','blurCplx^(1-qComp)','-vsync','1','-threads','4','-y','upload_3481af342dad78be657922eb9f70a87d_720p.mp4']);

ffmpeg.stdout.on('data', function (data) {
console.log('' + data);
});

ffmpeg.stderr.on('data', function (data) {
console.log('ffmpeg stderr: ' + data);
});

ffmpeg.on('close', function (code) {
if (code !== 0) {
console.log('ffmpeg process exited with code ' + code);
}
});

atom

nodepad++

Issue 2:
I opened a Python file with the following line (#963):

PrintAndLog(u"SSID: " + RememberedNetwork["SSIDString"].decode("utf-8") + u" - BSSID: " + RememberedNetwork["CachedScanRecord"]["BSSID"] + u" - RSSI: " + str(RememberedNetwork["CachedScanRecord"]["RSSI"]) + u" - Last connected: " + str(RememberedNetwork["LastConnected"]) + u" - Security type: " + RememberedNetwork["SecurityType"] + u" - Geolocation: " + Geolocation, "INFO")

Which led to the following bug:

You can find this as the main file in osxauditor.py.
Issue 1:
When using the baseUrl property intsconfig.json, Next 9 fails to build with the following error:

Module not found: Can't resolve ...

This is resolved by updating the import path to be absolute.

When running tsc on the same directory, the relative import works.

Expected behavior

The baseUrl in tsconfig.json is used when running next build

To Reproduce

Update tsconfig to use baseUrl compiler option:

{
"compilerOptions": {
"target": "es5",
"lib": ["dom", "dom.iterable", "esnext"],
"allowJs": true,
"skipLibCheck": true,
"strict": true,
"forceConsistentCasingInFileNames": true,
"noEmit": true,
"esModuleInterop": true,
"module": "esnext",
"moduleResolution": "node",
"resolveJsonModule": true,
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": "."
},
"exclude": ["node_modules"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"]
}

Assuming a directory structure of:

components
|--> Layout.tsx
pages
|--> index.tsx

Import file using relative path:

// pages/index.js
import Layout from 'components/layout'

export default (props) => <Layout>Welcome!</Layout>

package.json

"dependencies": {
"next": "^9.0.0",
"react": "^16.8.6",
"react-dom": "^16.8.6",
},
"devDependencies": {
"typescript": "^3.5.3"
}

Issue 2:
Question

I create a simple React Context to test the React Context API but it seems that is doesn't work as expected or I'm doing something wrong.

TestContext

import React from 'react';
export default React.createContext(true);

in _app.js

import TestContext from './TestContext';
...
render(){
....
<TestContext.Provider value={false}>
<Component pageContext={this.pageContext} {...pageProps} />
</TestContext.Provider>
}

inside a page:

render() {
return (
<TestContext.Consumer>
{isTrue => isTrue ? 'true' : 'false'}
</TestContext.Consumer>
);
}

output: true