hash
stringlengths 40
40
| diff
stringlengths 131
26.7k
| message
stringlengths 7
694
| project
stringlengths 5
67
| split
stringclasses 1
value | diff_languages
stringlengths 2
24
|
---|---|---|---|---|---|
9d00a15e439beebc3b931a91114950eef7c51f26 | diff --git a/crunchyroll/models.py b/crunchyroll/models.py
index <HASH>..<HASH> 100644
--- a/crunchyroll/models.py
+++ b/crunchyroll/models.py
@@ -50,7 +50,11 @@ class DictModel(object):
class XmlModel(object):
def __init__(self, node):
- if isinstance(node, basestring):
+ try:
+ is_basestring = isinstance(node, basestring)
+ except NameError:
+ is_basestring = isinstance(node, (bytes, str))
+ if is_basestring:
try:
node = parse_xml_string(node)
except Exception as err: | PYTHON 3 COMPATABILITY:
- Account for removal of "basestring" class | aheadley_python-crunchyroll | train | py |
d8ccc7d77bdc11f9e29b31752af4a18dad10b016 | diff --git a/packages/bonde-admin-canary/src/components/Link/ButtonLink.js b/packages/bonde-admin-canary/src/components/Link/ButtonLink.js
index <HASH>..<HASH> 100644
--- a/packages/bonde-admin-canary/src/components/Link/ButtonLink.js
+++ b/packages/bonde-admin-canary/src/components/Link/ButtonLink.js
@@ -1,11 +1,21 @@
import React from 'react'
import { Link } from 'react-router-dom'
import { Button } from 'bonde-styleguide'
+import PropTypes from 'prop-types'
-export default ({ to, title, children, align }) => (
+const ButtonLink = ({ to, title, children, align }) => (
<Link to={to} title={title}>
<Button flat align={align || 'left'} padding='0'>
{children}
</Button>
</Link>
)
+
+ButtonLink.propTypes = {
+ to: PropTypes.string,
+ title: PropTypes.string,
+ children: PropTypes.node,
+ align: PropTypes.string
+}
+
+export default ButtonLink | chore(admin-canary): lints components/Link | nossas_bonde-client | train | js |
e326e4e042accf475341aec6a6cb6d4576d07f85 | diff --git a/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java b/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
index <HASH>..<HASH> 100644
--- a/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
+++ b/sonar-core/src/main/java/org/sonar/core/platform/PluginClassloaderFactory.java
@@ -157,6 +157,7 @@ public class PluginClassloaderFactory {
.addInclusion("org/codehaus/stax2/")
.addInclusion("org/codehaus/staxmate/")
.addInclusion("com/ctc/wstx/")
+ .addInclusion("org/jfree/")
.addInclusion("org/slf4j/")
// SLF4J bridges. Do not let plugins re-initialize and configure their logging system | Keep compatibility with deprecated JFreeChart | SonarSource_sonarqube | train | java |
00f245b9597e727379b2c881c3d0a0d4d789f57b | diff --git a/bloom/filter_test.go b/bloom/filter_test.go
index <HASH>..<HASH> 100644
--- a/bloom/filter_test.go
+++ b/bloom/filter_test.go
@@ -29,13 +29,13 @@ func TestFilterLoad(t *testing.T) {
f := bloom.LoadFilter(&merkle)
if !f.IsLoaded() {
- t.Errorf("TestFilterLoad IsLoaded test failed: want %d got %d",
+ t.Errorf("TestFilterLoad IsLoaded test failed: want %v got %v",
true, !f.IsLoaded())
return
}
f.Unload()
if f.IsLoaded() {
- t.Errorf("TestFilterLoad IsLoaded test failed: want %d got %d",
+ t.Errorf("TestFilterLoad IsLoaded test failed: want %v got %v",
f.IsLoaded(), false)
return
} | Fix formatting directives in tests.
Found by 'go vet' | btcsuite_btcutil | train | go |
0c575ace48dee00791377eedd19f1507ccc2314a | diff --git a/torchvision/transforms/transforms.py b/torchvision/transforms/transforms.py
index <HASH>..<HASH> 100644
--- a/torchvision/transforms/transforms.py
+++ b/torchvision/transforms/transforms.py
@@ -782,10 +782,11 @@ class LinearTransformation(object):
subtract mean_vector from it which is then followed by computing the dot
product with the transformation matrix and then reshaping the tensor to its
original shape.
+
Applications:
- - whitening transformation: Suppose X is a column vector zero-centered data.
- Then compute the data covariance matrix [D x D] with torch.mm(X.t(), X),
- perform SVD on this matrix and pass it as transformation_matrix.
+ whitening transformation: Suppose X is a column vector zero-centered data.
+ Then compute the data covariance matrix [D x D] with torch.mm(X.t(), X),
+ perform SVD on this matrix and pass it as transformation_matrix.
Args:
transformation_matrix (Tensor): tensor [D x D], D = C x H x W
mean_vector (Tensor): tensor [D], D = C x H x W | Improve doc of Linear Transformation (#<I>) | pytorch_vision | train | py |
968d36ffb704ca080256965b0ad11af563f39162 | diff --git a/ai/methods.py b/ai/methods.py
index <HASH>..<HASH> 100644
--- a/ai/methods.py
+++ b/ai/methods.py
@@ -1,5 +1,5 @@
# coding=utf-8
-from utils import FifoList
+from utils import FifoList, AddOnceList, AddOnceFifoList
from models import SearchNode
@@ -11,6 +11,14 @@ def depth_first_tree_search(problem):
return _tree_search(problem, [])
+def breadth_first_graph_search(problem):
+ return _tree_search(problem, AddOnceFifoList())
+
+
+def depth_first_graph_search(problem):
+ return _tree_search(problem, AddOnceList())
+
+
def _tree_search(problem, fringe):
fringe.append(SearchNode(state=problem.initial_state,
parent=None, | Added breath and depth first graph searches | simpleai-team_simpleai | train | py |
4d77f7de09caa51fe0e8f49af971f50804e4a90a | diff --git a/treeCl/collection.py b/treeCl/collection.py
index <HASH>..<HASH> 100755
--- a/treeCl/collection.py
+++ b/treeCl/collection.py
@@ -9,7 +9,6 @@ import os
import sys
import random
import time
-import timeit
# third party
@@ -24,6 +23,7 @@ from parameters import PartitionParameters
from utils import fileIO, setup_progressbar, model_translate
from errors import optioncheck, directorycheck
from constants import SORT_KEY, PLL_RANDOM_SEED
+from treeCl.utils.decorators import lazyprop
DISTRIBUTED_TASK_QUEUE_INSPECT = app.control.inspect()
@@ -111,7 +111,7 @@ class Collection(object):
""" Sets a dictionary of records keyed by SORT_KEY order """
self._records = dict(enumerate(records))
- @property
+ @lazyprop
def trees(self):
""" Returns a list of trees in SORT_KEY order """
try: | Changed Collection.trees into a lazy property | kgori_treeCl | train | py |
86d87f7ee3b82c3865bb04634ddde2a890da3e16 | diff --git a/test/points/PointOctree.js b/test/points/PointOctree.js
index <HASH>..<HASH> 100644
--- a/test/points/PointOctree.js
+++ b/test/points/PointOctree.js
@@ -1,5 +1,5 @@
import test from "ava";
-import { Box3, Vector3 } from "three";
+import { Box3, Raycaster, Vector3 } from "three";
import { PointOctree } from "sparse-octree";
const box = new Box3(
@@ -197,3 +197,23 @@ test("retrieves leaves when octree is large", (t) => {
t.is(found.length, 100, "should find 100 points");
});
+
+test("intersects root when octree is small", (t) => {
+
+ const octree = new PointOctree(box.min, box.max);
+
+ octree.set(new Vector3(0.0, 0, 0), data0);
+ octree.set(new Vector3(0.1, 0, 0), data1);
+ octree.set(new Vector3(0.2, 0, 0), data2);
+
+ const raycaster = new Raycaster(
+ new Vector3(0, 0, 0),
+ new Vector3(0, 0, -1)
+ );
+
+ raycaster.params.Points.threshold = 0.5;
+ const found = octree.raycast(raycaster);
+
+ t.is(found.length, 3, "should find 3 points");
+
+}); | Add test for PointOctree.raycast
Related to #<I>. | vanruesc_sparse-octree | train | js |
7705f66fc4d92a7902ff5fc2c5e976c22c0f0c8f | diff --git a/pyls/uris.py b/pyls/uris.py
index <HASH>..<HASH> 100644
--- a/pyls/uris.py
+++ b/pyls/uris.py
@@ -7,7 +7,7 @@ import re
from urllib import parse
from pyls import IS_WIN
-RE_DRIVE_LETTER_PATH = re.compile(r'^\/[a-zA-z]:')
+RE_DRIVE_LETTER_PATH = re.compile(r'^\/[a-zA-Z]:')
def urlparse(uri):
@@ -55,7 +55,7 @@ def to_fs_path(uri):
if netloc and path and scheme == 'file':
# unc path: file://shares/c$/far/boo
- value = "//{netloc}{path}".format(netloc=netloc, path=path)
+ value = "//{}{}".format(netloc, path)
elif RE_DRIVE_LETTER_PATH.match(path):
# windows drive letter: file:///C:/far/boo
diff --git a/pyls/workspace.py b/pyls/workspace.py
index <HASH>..<HASH> 100644
--- a/pyls/workspace.py
+++ b/pyls/workspace.py
@@ -79,9 +79,6 @@ class Workspace(object):
path.extend(sys.path)
return path
- def is_in_workspace(self, path):
- return not self._root_path or os.path.commonprefix((self._root_path, path))
-
class Document(object): | Address comments (#<I>) | palantir_python-language-server | train | py,py |
2f92b1e29d71e248ebdf3792ccdcdbb35ad219d0 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -13,6 +13,7 @@ setup(
"pycoin.convention",
"pycoin.ecdsa",
"pycoin.key",
+ "pycoin.network",
"pycoin.tx",
"pycoin.tx.pay_to",
"pycoin.tx.script", | Add pycoin.network to setup.py. | richardkiss_pycoin | train | py |
b702d45fa10ecc5509e625ce3cacc03f37f619b2 | diff --git a/src/server/pkg/obj/local_client.go b/src/server/pkg/obj/local_client.go
index <HASH>..<HASH> 100644
--- a/src/server/pkg/obj/local_client.go
+++ b/src/server/pkg/obj/local_client.go
@@ -19,7 +19,14 @@ type localClient struct {
}
func (c *localClient) Writer(path string) (io.WriteCloser, error) {
- file, err := os.Create(filepath.Join(c.root, path))
+ fullPath := filepath.Join(c.root, path)
+
+ // Create the directory since it may not exist
+ if err := os.MkdirAll(filepath.Dir(fullPath), 0755); err != nil {
+ return nil, err
+ }
+
+ file, err := os.Create(fullPath)
if err != nil {
return nil, err
} | Fix a bug where nested objects cannot be created locally | pachyderm_pachyderm | train | go |
f2f34e24a4f9751d147ffe73baa7713450aaf947 | diff --git a/src/Commands/Visualize.php b/src/Commands/Visualize.php
index <HASH>..<HASH> 100644
--- a/src/Commands/Visualize.php
+++ b/src/Commands/Visualize.php
@@ -136,11 +136,11 @@ class Visualize extends Command
// Use first value from 'states' as start.
$start = $config['states'][0]['name'];
$result[] = "node [shape = {$nodeShape}];"; // Default nodes
- $result[] = "_start_ -> {$start};"; // Input node -> starting node.
+ $result[] = "_start_ -> \"{$start}\";"; // Input node -> starting node.
foreach ($config['transitions'] as $name => $transition) {
foreach ($transition['from'] as $from) {
- $result[] = "{$from} -> {$transition['to']} [label = \"{$name}\"];";
+ $result[] = "\"{$from}\" -> \"{$transition['to']}\" [label = \"{$name}\"];";
}
} | Quote state and transition names
The state and transition names can contain dashes, and those result in a syntax error in the generated dot file. | sebdesign_laravel-state-machine | train | php |
8c4ea855d58138abdffe78549545bd045d251f5d | diff --git a/src/article/metadata/MetadataEditor.js b/src/article/metadata/MetadataEditor.js
index <HASH>..<HASH> 100644
--- a/src/article/metadata/MetadataEditor.js
+++ b/src/article/metadata/MetadataEditor.js
@@ -6,6 +6,7 @@ import ArticleEditorSession from '../ArticleEditorSession'
import ArticleAPI from '../ArticleAPI'
import CollectionEditor from './CollectionEditor'
import EntityEditor from './EntityEditor'
+import CardComponent from './CardComponent'
const SECTIONS = [
{ label: 'Authors', modelType: 'authors' },
@@ -153,9 +154,11 @@ export default class MetadataEditor extends Component {
} else if (section.modelType === 'article-record') {
model = api.getEntity('article-record')
collectionsEl.append(
- $$(EntityEditor, { model: model })
- .attr({id: model.id})
- .ref(model.id)
+ $$(CardComponent).append(
+ $$(EntityEditor, { model: model })
+ .attr({id: model.id})
+ .ref(model.id)
+ )
)
}
}) | Fix article-record card style. | substance_texture | train | js |
614e9a477bbd86653264ab8ea6f7bd458afbbbe5 | diff --git a/python/jsbeautifier/unpackers/packer.py b/python/jsbeautifier/unpackers/packer.py
index <HASH>..<HASH> 100644
--- a/python/jsbeautifier/unpackers/packer.py
+++ b/python/jsbeautifier/unpackers/packer.py
@@ -19,8 +19,7 @@ PRIORITY = 1
def detect(source):
"""Detects whether `source` is P.A.C.K.E.R. coded."""
- return re.match(r'eval *\( *function *\(p, *a, *c, *k, *e, *r',
- source) is not None
+ return source.replace(' ', '').startswith('eval(function(p,a,c,k,e,r')
def unpack(source):
"""Unpacks P.A.C.K.E.R. packed js code.""" | Removed regex based recognition. Bit faster. | beautify-web_js-beautify | train | py |
60447633da75e0bd53ec80dea56f47fc7d60212e | diff --git a/wagtailnews/views/frontend.py b/wagtailnews/views/frontend.py
index <HASH>..<HASH> 100644
--- a/wagtailnews/views/frontend.py
+++ b/wagtailnews/views/frontend.py
@@ -11,8 +11,9 @@ def _newsitem_list(request, newsindex, newsitem_list, extra_context):
paginator, page = paginate(request, newsitem_list)
context = {
'self': newsindex,
+ 'page': newsindex,
'paginator': paginator,
- 'page': page,
+ 'newsitem_page': page,
'newsitem_list': page.object_list,
}
context.update(extra_context) | Use `page` for news index, `newsitem_page` for paginated page
Jinja2 templates do not support using `self` for a context variable.
Wagtail now uses `page` instead of `self` because of this. `wagtailnews`
now does the same. This conflicted with the `page` variable which used
to be the current page of the paginated news item list. This variable is
now called `newsitem_page`.
This is a backwards incompatible change. | neon-jungle_wagtailnews | train | py |
e4bdb4ea67b5f7f12fe5b1f729876192321e9778 | diff --git a/yandextank/stepper/load_plan.py b/yandextank/stepper/load_plan.py
index <HASH>..<HASH> 100644
--- a/yandextank/stepper/load_plan.py
+++ b/yandextank/stepper/load_plan.py
@@ -135,8 +135,12 @@ class Stairway(Composite):
Const(minrps + i * increment, duration)
for i in xrange(0, n_steps + 1)
]
- if (n_steps + 1) * increment < maxrps:
- steps.append(Const(maxrps, duration))
+ if increment > 0:
+ if (min_rps + n_steps * increment) < maxrps:
+ steps.append(Const(maxrps, duration))
+ elif increment < 0:
+ if (min_rps + n_steps * increment) > maxrps:
+ steps.append(Const(maxrps, duration))
logging.info(steps)
super(Stairway, self).__init__(steps) | Fix: more consistent final step for step(...) schedule | yandex_yandex-tank | train | py |
7b75906546d21472afb7aad9d19c09a28aae6255 | diff --git a/src/ResizeSensor.js b/src/ResizeSensor.js
index <HASH>..<HASH> 100644
--- a/src/ResizeSensor.js
+++ b/src/ResizeSensor.js
@@ -114,8 +114,8 @@
element.style.position = 'relative';
}
- var x = 0,
- y = 0,
+ var x = -1,
+ y = -1,
firstStyle = element.resizeSensor.firstElementChild.firstChild.style,
lastStyle = element.resizeSensor.lastElementChild.firstChild.style; | Avoid non-initialized resize-sensor width/heights when element initially has zero width or height. The underflow will never trigger in these cases otherwise. | marcj_css-element-queries | train | js |
dbb91d445cc2786d4ecdd29d5a2fe449b4cdef7c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -356,7 +356,7 @@ Logger.prototype.serialize = function(k, v) {
&& (typeof this.conf.serializers[k] === 'function')
? this.conf.serializers[k] : null;
if(!serializer) return v;
- return serializer(v);
+ return serializer.apply(this, [v]);
}
/** | Invoke serializers in the scope of the logger. | cli-kit_cli-logger | train | js |
9a3cf77919b0541048be5bfe7806a001c31974d1 | diff --git a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php
+++ b/lib/Doctrine/ORM/Tools/Console/MetadataFilter.php
@@ -76,9 +76,12 @@ class MetadataFilter extends \FilterIterator implements \Countable
$metadata = $it->current();
foreach ($this->filter as $filter) {
- $pregResult = preg_match("/" . preg_quote($filter) . "/", $metadata->name);
+ $pregResult = preg_match("/$filter/", $metadata->name);
+
if ($pregResult === false) {
- return false;
+ throw new \RuntimeException(
+ sprintf("Error while evaluating regex '/%s/'.", $filter)
+ );
}
if ($pregResult === 0) { | [DDC-<I>] Fix PR according to comments. | doctrine_orm | train | php |
5a3c67b321b92d5c6b1ba4da45c6435885229a8d | diff --git a/gshell-core/src/test/java/org/sonatype/gshell/command/support/CommandTestSupport.java b/gshell-core/src/test/java/org/sonatype/gshell/command/support/CommandTestSupport.java
index <HASH>..<HASH> 100644
--- a/gshell-core/src/test/java/org/sonatype/gshell/command/support/CommandTestSupport.java
+++ b/gshell-core/src/test/java/org/sonatype/gshell/command/support/CommandTestSupport.java
@@ -139,7 +139,9 @@ public abstract class CommandTestSupport
aliasRegistry = null;
vars = null;
io = null;
- shell.close();
+ if (shell != null) {
+ shell.close();
+ }
shell = null;
requiredCommands.clear();
} | o Improved robust of test tear down in case of test failure | jdillon_gshell | train | java |
5ca2d3e55dd34bdd03098a024f057b7774967b5d | diff --git a/modules/wyone/src/wyone/core/Automaton.java b/modules/wyone/src/wyone/core/Automaton.java
index <HASH>..<HASH> 100644
--- a/modules/wyone/src/wyone/core/Automaton.java
+++ b/modules/wyone/src/wyone/core/Automaton.java
@@ -753,17 +753,6 @@ public final class Automaton {
length = nchildren.length;
}
- public boolean remap(int from, int to) {
- boolean changed = false;
- for(int i=0;i!=length;++i) {
- if(children[i] == from) {
- children[i] = to;
- changed = true;
- }
- }
- return changed;
- }
-
public boolean remap(int[] map) {
boolean changed = false;
for (int i = 0; i != length; ++i) {
@@ -852,7 +841,7 @@ public final class Automaton {
public boolean remap(int[] map) {
if(super.remap(map)) {
- Arrays.sort(children);
+ Arrays.sort(children,0,length);
return true;
} else {
return false;
@@ -946,7 +935,7 @@ public final class Automaton {
return;
}
- Arrays.sort(children);
+ Arrays.sort(children,0,length);
// first, decide if we have duplicates
int last = children[0]; | WYONE: found yet more bugs, but none of them are solving my problem :( | Whiley_WhileyCompiler | train | java |
f495b1c07d58620c3aa2b19705adaa2437e867cd | diff --git a/lxc/remote.go b/lxc/remote.go
index <HASH>..<HASH> 100644
--- a/lxc/remote.go
+++ b/lxc/remote.go
@@ -21,6 +21,7 @@ lxc remote list List all remotes.
lxc remote rename <old> <new> Rename remote <old> to <new>.
lxc remote set-url <name> <url> Update <name>'s url to <url>.
lxc remote set-default <name> Set the default remote.
+lxc remote get-default Print the default remote.
`
func (c *remoteCmd) usage() string { | Add get-default to remote's help message
Just a quick thing I noticed while on a call today. | lxc_lxd | train | go |
a12865059fb625a8c2fc123d81d636d825d3d9d8 | diff --git a/lib/rules/no-useless-token-range.js b/lib/rules/no-useless-token-range.js
index <HASH>..<HASH> 100644
--- a/lib/rules/no-useless-token-range.js
+++ b/lib/rules/no-useless-token-range.js
@@ -112,9 +112,8 @@ module.exports = {
!affectsGetTokenOutput(identifier.parent.parent.arguments[1]) &&
identifier.parent.parent.parent.type === 'MemberExpression' &&
identifier.parent.parent === identifier.parent.parent.parent.object && (
- (isStartAccess(identifier.parent.parent.parent) && identifier.parent.property.name === 'getFirstToken') ||
- (isEndAccess(identifier.parent.parent.parent) && identifier.parent.property.name === 'getLastToken')
- )
+ (isStartAccess(identifier.parent.parent.parent) && identifier.parent.property.name === 'getFirstToken') ||
+ (isEndAccess(identifier.parent.parent.parent) && identifier.parent.property.name === 'getLastToken'))
)
.forEach(identifier => {
const fullRangeAccess = isRangeAccess(identifier.parent.parent.parent) | Chore: fix linting errors (#<I>) | not-an-aardvark_eslint-plugin-eslint-plugin | train | js |
57776ce59b964527cbc22ea9d3c05cdf7d7d2cc0 | diff --git a/refresh/config.go b/refresh/config.go
index <HASH>..<HASH> 100644
--- a/refresh/config.go
+++ b/refresh/config.go
@@ -6,6 +6,8 @@ import (
"io/ioutil"
"os"
"path"
+ "runtime"
+ "strings"
"time"
yaml "gopkg.in/yaml.v2"
@@ -24,7 +26,13 @@ type Configuration struct {
}
func (c *Configuration) FullBuildPath() string {
- return path.Join(c.BuildPath, c.BinaryName)
+ path := path.Join(c.BuildPath, c.BinaryName)
+ if runtime.GOOS == "windows" {
+ if !strings.HasSuffix(path, ".exe") {
+ path += ".exe"
+ }
+ }
+ return path
}
func (c *Configuration) Load(path string) error { | Add ".exe" to windows executable path if it is not explicitly set | markbates_refresh | train | go |
a5c2782b137981fa9077df3e86231913649d5453 | diff --git a/okio/src/test/java/okio/BufferTest.java b/okio/src/test/java/okio/BufferTest.java
index <HASH>..<HASH> 100644
--- a/okio/src/test/java/okio/BufferTest.java
+++ b/okio/src/test/java/okio/BufferTest.java
@@ -22,6 +22,7 @@ import java.io.InputStream;
import java.util.Arrays;
import java.util.List;
import java.util.Random;
+import org.junit.Ignore;
import org.junit.Test;
import static java.util.Arrays.asList;
@@ -585,6 +586,12 @@ public final class BufferTest {
assertEquals("aaa", target.readUtf8());
}
+ @Ignore
+ @Test public void snapshotReportsAccurateSize() throws Exception {
+ Buffer buf = new Buffer().write(new byte[] { 0, 1, 2, 3 });
+ assertEquals(1, buf.snapshot(1).size());
+ }
+
/**
* Returns a new buffer containing the data in {@code data}, and a segment
* layout determined by {@code dice}. | Test for Buffer.snapshot(int) | square_okio | train | java |
b6219694e4c7f6d3e0bdde838f29a2deda6bd476 | diff --git a/protocol/go/extras.go b/protocol/go/extras.go
index <HASH>..<HASH> 100644
--- a/protocol/go/extras.go
+++ b/protocol/go/extras.go
@@ -206,7 +206,7 @@ func (u UID) GetShard(shardCount int) (int, error) {
return 0, err
}
n := binary.LittleEndian.Uint32(bytes)
- return int(n) % shardCount, nil
+ return int(n % uint32(shardCount)), nil
}
func (s SigID) IsNil() bool { | protocol: don't cast a uint<I> to an int and expect a positive num
That doesn't work on <I>-bit machines. | keybase_client | train | go |
be910bfa10a64de8573d6641d87904ac13509508 | diff --git a/sources/EngineWorks/DBAL/Sqlite/Result.php b/sources/EngineWorks/DBAL/Sqlite/Result.php
index <HASH>..<HASH> 100644
--- a/sources/EngineWorks/DBAL/Sqlite/Result.php
+++ b/sources/EngineWorks/DBAL/Sqlite/Result.php
@@ -143,7 +143,7 @@ class Result implements ResultInterface
* Private function to get the CommonType from the information of the field
*
* @param string $columnName
- * @param int $field
+ * @param int|false $field
* @return string
*/
private function getCommonType($columnName, $field)
@@ -158,7 +158,7 @@ class Result implements ResultInterface
if (isset($this->overrideTypes[$columnName])) {
return $this->overrideTypes[$columnName];
}
- if ($field !== false && array_key_exists($field, $types)) {
+ if (false !== $field && array_key_exists($field, $types)) {
return $types[$field];
}
return CommonTypes::TTEXT; | Improve docblock in getCommonType | eclipxe13_engineworks-dbal | train | php |
05c6e91c4bc71e237619e64b43124c9f7bbc2d35 | diff --git a/pyvizio/util/const.py b/pyvizio/util/const.py
index <HASH>..<HASH> 100644
--- a/pyvizio/util/const.py
+++ b/pyvizio/util/const.py
@@ -4,7 +4,13 @@ APK_SOURCE_PATH = "src"
RESOURCE_PATH = "resources/res/raw"
APP_NAMES_FILE = "apps.json"
APP_PAYLOADS_FILE = "apps_availability.json"
+
+# File with app URLs: smartcast.apk-decompiled\res\values\strings.xml
+# Use the keys below to find the values
+
+# <string name="default_appsservice_app_server">
APP_NAMES_URL = "http://hometest.buddytv.netdna-cdn.com/appservice/vizio_apps_prod.json"
+# <string name="default_appsservice_availability_server">
APP_PAYLOADS_URL = (
"http://hometest.buddytv.netdna-cdn.com/appservice/app_availability_prod.json"
) | Add comments so I know where to find apps files in the future (#<I>)
* Add comments so I know where to find apps files in the future
* comments | vkorn_pyvizio | train | py |
9b618d6dcf80cbeda6ad24544f6621c87dad1940 | diff --git a/examples/example0/__main__.py b/examples/example0/__main__.py
index <HASH>..<HASH> 100644
--- a/examples/example0/__main__.py
+++ b/examples/example0/__main__.py
@@ -23,6 +23,11 @@ def index(req, res):
def hello_world(req, res):
res.send_text("Hello World!!")
[email protected]
+def error_handler(req, res, err):
+ res.send_text("404 : Hello World!!")
+
+
http = create_http_server(app, host='127.0.0.1', port=(8000, 9000))
asyncio.get_event_loop().run_until_complete(http.listen()) | Added an error handler to example0 | pyGrowler_Growler | train | py |
51b0830fa9f549ba31ef71da8b8ef9a990669ed8 | diff --git a/test.rb b/test.rb
index <HASH>..<HASH> 100644
--- a/test.rb
+++ b/test.rb
@@ -61,11 +61,10 @@ CloudFormation {
LaunchConfigurationName Ref("LaunchConfig")
MinSize 1
MaxSize FnIf('OneIsTest', 1, 3)
- LoadBalancer Ref("ElasticLoadBalancer")
+ LoadBalancerNames Ref("ElasticLoadBalancer")
}
LaunchConfiguration("LaunchConfig")
- LoadBalancer("ElasticLoadBalancer")
UndefinedResource("asddfasdf")
} | Updates test script to use correct property name for list of load balancers | cfndsl_cfndsl | train | rb |
a0e592ec341352c7d889b0b645b244d12a00e1fd | diff --git a/django_mako_plus/middleware.py b/django_mako_plus/middleware.py
index <HASH>..<HASH> 100644
--- a/django_mako_plus/middleware.py
+++ b/django_mako_plus/middleware.py
@@ -1,4 +1,5 @@
from django.core.exceptions import ImproperlyConfigured
+from django.utils.deprecation import MiddlewareMixin
from urllib.parse import unquote
from .util import URLParamList, get_dmp_app_configs, get_dmp_instance, DMP_OPTIONS
@@ -8,13 +9,14 @@ from .util import URLParamList, get_dmp_app_configs, get_dmp_instance, DMP_OPTIO
### Middleware the prepares the request for
### use with the controller.
-class RequestInitMiddleware:
+class RequestInitMiddleware(MiddlewareMixin):
'''Adds several fields to the request that our controller needs.
This class MUST be included in settings.py -> MIDDLEWARE_CLASSES.
'''
- def __init__(self):
+ def __init__(self, *args, **kwargs):
'''Constructor'''
+ super().__init__(*args, **kwargs)
self.dmp_app_names = set(( config.name for config in get_dmp_app_configs() )) | updated the middleware to the new <I> middleware format | doconix_django-mako-plus | train | py |
6cd786a7f54edbc35708db908a30cc609dfaa530 | diff --git a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
+++ b/aeron-cluster/src/main/java/io/aeron/cluster/ConsensusModuleAgent.java
@@ -863,7 +863,10 @@ final class ConsensusModuleAgent implements Agent
{
roleChange(role, newRole, memberId);
role = newRole;
- clusterRoleCounter.setOrdered(newRole.code());
+ if (!clusterRoleCounter.isClosed())
+ {
+ clusterRoleCounter.set(newRole.code());
+ }
}
} | [Java] Check that role counter is not closed before updating it. | real-logic_aeron | train | java |
402676f3faf86dbf9f9c87d787e981eb5dfbee38 | diff --git a/git_code_debt/file_diff_stat.py b/git_code_debt/file_diff_stat.py
index <HASH>..<HASH> 100644
--- a/git_code_debt/file_diff_stat.py
+++ b/git_code_debt/file_diff_stat.py
@@ -122,7 +122,10 @@ def _to_file_diff_stat(file_diff):
)
+GIT_DIFF_RE = re.compile('^diff --git', flags=re.MULTILINE)
+
+
def get_file_diff_stats_from_output(output):
- files = re.split('^diff --git ', output, flags=re.MULTILINE)
+ files = GIT_DIFF_RE.split(output)
assert not files[0].strip() or files[0].startswith('commit ')
return map(_to_file_diff_stat, files[1:]) | Fix py<I> compatibility with re.split | asottile_git-code-debt | train | py |
3ac15f4a9b242f0f4972bb0e517739f7c836e289 | diff --git a/src/main/java/org/andidev/webdriverextension/Bot.java b/src/main/java/org/andidev/webdriverextension/Bot.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/andidev/webdriverextension/Bot.java
+++ b/src/main/java/org/andidev/webdriverextension/Bot.java
@@ -1581,4 +1581,8 @@ public class Bot {
public static <T extends Object> void assertThat(T actual, Matcher<? super T> matcher) {
MatcherAssert.assertThat(actual, matcher);
}
+
+ public static <T extends Object> void assertThat(String reason, T actual, Matcher<? super T> matcher) {
+ MatcherAssert.assertThat(reason, actual, matcher);
+ }
} | Added Hamcrest assertThat method with reason as parameter | webdriverextensions_webdriverextensions | train | java |
de04c7978c6713995cbf1717f6ca7ffd292cdeb1 | diff --git a/packages/@uppy/companion/src/server/controllers/url.js b/packages/@uppy/companion/src/server/controllers/url.js
index <HASH>..<HASH> 100644
--- a/packages/@uppy/companion/src/server/controllers/url.js
+++ b/packages/@uppy/companion/src/server/controllers/url.js
@@ -56,6 +56,7 @@ const get = (req, res) => {
protocol: req.body.protocol,
metadata: req.body.metadata,
size: size,
+ fieldname: req.body.fieldname,
pathPrefix: `${filePath}`,
storage: redis.client(),
headers: req.body.headers
@@ -97,5 +98,6 @@ const downloadURL = (url, onDataChunk) => {
request(opts)
.on('data', onDataChunk)
+ .on('end', () => onDataChunk(null))
.on('error', (err) => logger.error(err, 'controller.url.download.error'))
} | companion: send null when download is complete | transloadit_uppy | train | js |
3b854cf864d6b22eaf3666a1c14a5a0a57d0132c | diff --git a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/Subscription.java b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/Subscription.java
index <HASH>..<HASH> 100644
--- a/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/Subscription.java
+++ b/microsoft-azure-api/src/main/java/com/microsoft/windowsazure/services/serviceBus/models/Subscription.java
@@ -94,11 +94,6 @@ public class Subscription extends EntryModel<SubscriptionDescription> {
return getModel().getMessageCount();
}
- public Subscription setMessageCount(Long value) {
- getModel().setMessageCount(value);
- return this;
- }
-
public Integer getMaxDeliveryCount() {
return getModel().getMaxDeliveryCount();
} | subscription Messagecount should be a readonly property. fixes #<I>
Currently we have subscription.setMessageCount() which I feel doesn't make sense.
Also from .net msdn doc this is a readonly property
<URL> | Azure_azure-sdk-for-java | train | java |
3a347cb3b3a634096fe10c6481a8d5d29eda7084 | diff --git a/pyzotero/zotero.py b/pyzotero/zotero.py
index <HASH>..<HASH> 100644
--- a/pyzotero/zotero.py
+++ b/pyzotero/zotero.py
@@ -478,6 +478,8 @@ class Zotero(object):
""" Generator for self.follow()
"""
# use same criterion as self.follow()
+ if self.links is None:
+ return
while self.links.get('next'):
yield self.follow() | Adds check to iterfollow to avoid unwanted exception | urschrei_pyzotero | train | py |
a354d7bc1b7737fc1b4a9d238a247364035ab3d8 | diff --git a/setuptools/lib2to3_ex.py b/setuptools/lib2to3_ex.py
index <HASH>..<HASH> 100644
--- a/setuptools/lib2to3_ex.py
+++ b/setuptools/lib2to3_ex.py
@@ -13,6 +13,7 @@ from distutils import log
from lib2to3.refactor import RefactoringTool, get_fixers_from_package
import setuptools
+from ._deprecation_warning import SetuptoolsDeprecationWarning
class DistutilsRefactoringTool(RefactoringTool):
@@ -40,7 +41,7 @@ class Mixin2to3(_Mixin2to3):
"requires Python 2 support, please migrate to "
"a single-codebase solution or employ an "
"independent conversion process.",
- DeprecationWarning)
+ SetuptoolsDeprecationWarning)
log.info("Fixing " + " ".join(files))
self.__build_fixer_names()
self.__exclude_fixers() | Use the SetuptoolsDeprecationWarning to make the warning more visible outside test runners. | pypa_setuptools | train | py |
3d11fa4151bd1344f84f063cd2d0f27c87ba3339 | diff --git a/lib/default/serverError.js b/lib/default/serverError.js
index <HASH>..<HASH> 100644
--- a/lib/default/serverError.js
+++ b/lib/default/serverError.js
@@ -2,6 +2,9 @@
module.exports = function (message, code, extraData) {
// Set status code
this.status(500);
+ if(extraData instanceof Error) {
+ extraData = extraData.toString();
+ }
this.send({
error : {
message : message || 'We\'re sorry, a server error occurred. Please wait a bit and try again.',
@@ -9,4 +12,4 @@ module.exports = function (message, code, extraData) {
extraData : extraData || undefined
}
});
-};
\ No newline at end of file
+}; | Display errors as extraData
Errors are filtered from the response by express or node.js. This behavior is | fireridlle_express-custom-response | train | js |
d5092c64d4dc1d775d617d822f7a84150bf32736 | diff --git a/test/test.js b/test/test.js
index <HASH>..<HASH> 100644
--- a/test/test.js
+++ b/test/test.js
@@ -261,10 +261,14 @@
})
it('Handle image loading error', function () {
- return loadImage('404').catch(function (err) {
- expect(err).to.be.an.instanceOf(window.Event)
- expect(err.type).to.equal('error')
- })
+ return loadImage('404')
+ .then(function () {
+ throw new Error('Promise not rejected')
+ })
+ .catch(function (err) {
+ expect(err).to.be.an.instanceOf(window.Event)
+ expect(err.type).to.equal('error')
+ })
})
it('Provide original image width+height in callback data', function () { | Test if Promise is rejected on loading error. | blueimp_JavaScript-Load-Image | train | js |
faa222e27b3c1a89e6e084f0c5893d1ec8569b94 | diff --git a/spec/support/dairy_data.rb b/spec/support/dairy_data.rb
index <HASH>..<HASH> 100644
--- a/spec/support/dairy_data.rb
+++ b/spec/support/dairy_data.rb
@@ -1,3 +1,5 @@
+require 'ostruct'
+
Cheese = Struct.new(:id, :flavor, :origin, :fat_content, :source)
CHEESES = {
1 => Cheese.new(1, "Brie", "France", 0.19, 1),
diff --git a/spec/support/star_wars_data.rb b/spec/support/star_wars_data.rb
index <HASH>..<HASH> 100644
--- a/spec/support/star_wars_data.rb
+++ b/spec/support/star_wars_data.rb
@@ -1,3 +1,4 @@
+require 'ostruct'
names = [
'X-Wing', | Add missing requires for OpenStruct objects
Std-lib doc shows the needed `require` statement, not sure why the builds pass without it:
<URL> | rmosolgo_graphql-ruby | train | rb,rb |
2d1da6c3ff6eb7f57f477dc9f880c68784597511 | diff --git a/src/Renderers/ErrorPopupRenderer.php b/src/Renderers/ErrorPopupRenderer.php
index <HASH>..<HASH> 100644
--- a/src/Renderers/ErrorPopupRenderer.php
+++ b/src/Renderers/ErrorPopupRenderer.php
@@ -318,6 +318,14 @@ class ErrorPopupRenderer
color: #5A5;
}
+#__error .tag {
+ color: #ffd064;
+}
+
+#__error .tag-hilight {
+ color: #5ed4e4;
+}
+
#__error .error-location {
padding: 20px;
border-top: 1px solid #BF3D27; | Colors for markup source view. | php-kit_php-web-console | train | php |
8d8175c9344c3868b36b2f03cfdb6f4e9bb08f3d | diff --git a/tests/unit/core/oxservernodecheckerTest.php b/tests/unit/core/oxservernodecheckerTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/core/oxservernodecheckerTest.php
+++ b/tests/unit/core/oxservernodecheckerTest.php
@@ -25,7 +25,7 @@
*
* @covers oxServerNodeChecker
*/
-class Unit_Core_oxServerNodeCheckerTest extends OxidTestCase
+class Unit_Core_oxServerCheckerTest extends OxidTestCase
{
public function tearDown()
{ | ESDEV-<I> Save information about frontend servers so it could be used for license check.
class names change | OXID-eSales_oxideshop_ce | train | php |
b2797c292f2549b955b60b3ddf6c942d607e4488 | diff --git a/lib/index.js b/lib/index.js
index <HASH>..<HASH> 100644
--- a/lib/index.js
+++ b/lib/index.js
@@ -2063,7 +2063,7 @@ function handlevWSClose(voiceSession) {
//Kill encoder and decoders
var audio = voiceSession.audio, members = voiceSession.members;
audio && audio._systemEncoder.kill();
- audio && audio._mixedDecoder.destroy();
+ audio._mixedDecoder && audio._mixedDecoder.destroy();
Object.keys(members).forEach(function(ID) {
var member = members[ID]; | Fix crashing on encoder destroying | izy521_discord.io | train | js |
6a33af661978f79c78db72afd1614515b78c4a60 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -37,10 +37,10 @@ setup(
"Programming Language :: Python :: 2",
"Programming Language :: Python :: 2.7",
"Programming Language :: Python :: 3",
- "Programming Language :: Python :: 3.3",
"Programming Language :: Python :: 3.4",
"Programming Language :: Python :: 3.5",
"Programming Language :: Python :: 3.6",
+ "Programming Language :: Python :: 3.7",
"Development Status :: 5 - Production/Stable",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent", | chore: update python versions in setup.py | altaurog_pgcopy | train | py |
21e573c9c392615d77b574c5cbda162a5d9493e0 | diff --git a/angr/knowledge/function.py b/angr/knowledge/function.py
index <HASH>..<HASH> 100644
--- a/angr/knowledge/function.py
+++ b/angr/knowledge/function.py
@@ -727,6 +727,10 @@ class Function(object):
graph.remove_edge(p, n)
graph.remove_node(n)
+ if n in self._local_blocks:
+ self._local_blocks.remove(n)
+ self._local_blocks.add(new_node)
+
for p, _, data in original_predecessors:
if p not in other_nodes:
graph.add_edge(p, new_node, data) | Update local blocks list when performing normalization on Functions | angr_angr | train | py |
6e4b09ec6a3def271a4b7a89faeee5a7deae30dc | diff --git a/structr-rest/src/main/java/org/structr/rest/resource/SchemaTypeResource.java b/structr-rest/src/main/java/org/structr/rest/resource/SchemaTypeResource.java
index <HASH>..<HASH> 100644
--- a/structr-rest/src/main/java/org/structr/rest/resource/SchemaTypeResource.java
+++ b/structr-rest/src/main/java/org/structr/rest/resource/SchemaTypeResource.java
@@ -101,7 +101,7 @@ public class SchemaTypeResource extends Resource {
resultList.add(schema);
- String url = "/".concat(CaseHelper.toUnderscore(rawType, true));
+ String url = "/".concat(CaseHelper.toUnderscore(rawType, false));
schema.setProperty(new StringProperty("url"), url);
schema.setProperty(new StringProperty("type"), type.getSimpleName()); | Use singular form of REST endpoint URL in Types view as default | structr_structr | train | java |
ecd716f8e9420d4c5e486c44fda7514d6c0ffbc6 | diff --git a/src/Condition/Compiler.php b/src/Condition/Compiler.php
index <HASH>..<HASH> 100644
--- a/src/Condition/Compiler.php
+++ b/src/Condition/Compiler.php
@@ -40,7 +40,7 @@ class Compiler
{
$parts = explode('.', $column);
$field = array_pop($parts);
-
+
if ($parts) {
$model = $this->model;
@@ -146,15 +146,17 @@ class Compiler
$relation = $where['relation'];
$model = $this->model;
-
+
if ($relation) {
$model = $model->$relation()->getModel();
}
$conditions = $model->getPermissionWheres($this->user, $where['permission']);
+ if (!$conditions->wheres) {
+ return $query;
+ }
if (! $relation) {
- // @todo When there are no where clauses in $conditions, then this shouldn't alter the query
return $query->whereIn('id', function ($sub) use ($conditions, $model) {
$sub->select('id')
->from($model->getTable())
@@ -178,7 +180,7 @@ class Compiler
$relation = $where['relation'];
$model = $this->model;
-
+
if ($relation) {
$model = $model->$relation;
} | Don't add where clause if there are no conditions | tobscure_permissible | train | php |
91bd400227e7ef4af267b4ac499902aa11d2a5e7 | diff --git a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/ternWorkerCore.js b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/ternWorkerCore.js
index <HASH>..<HASH> 100644
--- a/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/ternWorkerCore.js
+++ b/bundles/org.eclipse.orion.client.javascript/web/javascript/plugins/ternWorkerCore.js
@@ -168,7 +168,17 @@ require([
return Deferred.all(loadDefs(defNames, projectLoc));
})
.then(function (json) {
- options.defs = json;
+ var arr = json;
+ if(!Array.isArray(arr)) {
+ arr = [arr];
+ }
+ options.defs = [];
+ arr.forEach(function(def) {
+ if(Object.keys(def).length < 1) {
+ return;
+ }
+ options.defs.push(def);
+ });
startAndMessage(options);
}, fallback)
.then(undefined, fallback); | Bug <I> - Trying to load a Tern definition that does not exist writes exception to the console | eclipse_orion.client | train | js |
d660f4f0a2569860770dbd80d10f9e2325d00aed | diff --git a/lib/rabl/version.rb b/lib/rabl/version.rb
index <HASH>..<HASH> 100644
--- a/lib/rabl/version.rb
+++ b/lib/rabl/version.rb
@@ -1,3 +1,3 @@
module Rabl
- VERSION = "0.5.5.i"
+ VERSION = "0.5.5.j"
end | Bump to version <I>.j | nesquena_rabl | train | rb |
b34ac6df150777d28f52b40a76d12fbca698f8e8 | diff --git a/src/kit/model/SubstanceModifications.js b/src/kit/model/SubstanceModifications.js
index <HASH>..<HASH> 100644
--- a/src/kit/model/SubstanceModifications.js
+++ b/src/kit/model/SubstanceModifications.js
@@ -129,6 +129,9 @@ export class ContainerEditorNew extends ModifiedSurface(SubstanceContainerEditor
props.model = model
return props
}
+
+ // HACK: overriding the original implementation which we do not want to use anymore
+ _attachPlaceholder () {}
}
function _monkeyPatchSurfaceProps (parent, props) { | Avoid to trigger old placehold rendering.
This fixes #<I>. | substance_texture | train | js |
865bfbd9217a23738995c5853ebe87913b19e6bc | diff --git a/src/Codeception/Module/Db.php b/src/Codeception/Module/Db.php
index <HASH>..<HASH> 100644
--- a/src/Codeception/Module/Db.php
+++ b/src/Codeception/Module/Db.php
@@ -200,7 +200,8 @@ class Db extends CodeceptionModule implements DbInterface
$sql = preg_replace('%/\*(?!!\d+).*?\*/%s', '', $sql);
if (!empty($sql)) {
- $this->sql = explode("\n", $sql);
+ // split SQL dump into lines
+ $this->sql = preg_split('/\r\n|\n|\r/', $sql, -1, PREG_SPLIT_NO_EMPTY);
}
} | Db: add support for SQL dumps with Windows/DOS and MAC line endings | Codeception_base | train | php |
bd0499863ce2c86ca14b04d010671c52a720bf37 | diff --git a/src/components/xy-grid.js b/src/components/xy-grid.js
index <HASH>..<HASH> 100644
--- a/src/components/xy-grid.js
+++ b/src/components/xy-grid.js
@@ -90,6 +90,7 @@ export const Cell = (props) => {
isDefined(props.offsetOnSmall) ? `small-offset-${props.offsetOnSmall}` : null,
isDefined(props.offsetOnMedium) ? `medium-offset-${props.offsetOnMedium}` : null,
isDefined(props.offsetOnLarge) ? `large-offset-${props.offsetOnLarge}` : null,
+ generalClassNames(props)
);
const passProps = removeProps(props, objectKeys(Cell.propTypes)); | Add generalClassNames to XY-Grid Cell (#<I>)
I don't know if it this was left off intentionally, but it would be nice to be able to add props such as `isHidden` to `<Cell>` components. | digiaonline_react-foundation | train | js |
9411e3011b16325ffdc5c34fd49cc4de5335a80e | diff --git a/airflow/default_login.py b/airflow/default_login.py
index <HASH>..<HASH> 100644
--- a/airflow/default_login.py
+++ b/airflow/default_login.py
@@ -65,8 +65,8 @@ def login(self, request):
username=DEFAULT_USERNAME,
is_superuser=True)
session.merge(user)
- session.expunge_all()
session.commit()
- session.close()
flask_login.login_user(user)
+ session.commit()
+ session.close()
return redirect(request.args.get("next") or url_for("index")) | #<I> default_login.py does not work out of the box | apache_airflow | train | py |
585fb3f49bd8f42450c324c805a6c281f4caf812 | diff --git a/lib/api/api_statics.go b/lib/api/api_statics.go
index <HASH>..<HASH> 100644
--- a/lib/api/api_statics.go
+++ b/lib/api/api_statics.go
@@ -136,7 +136,7 @@ func (s *staticsServer) serveFromAssetDir(file, theme string, w http.ResponseWri
return false
}
mtype := assets.MimeTypeForFile(file)
- if mtype == "" {
+ if mtype != "" {
w.Header().Set("Content-Type", mtype)
}
http.ServeFile(w, r, p) | lib/api: Fix inverted logic in string comparison | syncthing_syncthing | train | go |
3f9daa8cc5a10817309108282efa6d49c63d5820 | diff --git a/webapps/ui/common/scripts/util/pagination-utils.js b/webapps/ui/common/scripts/util/pagination-utils.js
index <HASH>..<HASH> 100644
--- a/webapps/ui/common/scripts/util/pagination-utils.js
+++ b/webapps/ui/common/scripts/util/pagination-utils.js
@@ -31,6 +31,18 @@ function initializePaginationInController($scope, search, updateCallback) {
updateCallback(newValue, oldValue);
});
+ $scope.$on('$locationChangeSuccess', function() {
+ var currentPage = getCurrentPageFromSearch(search);
+
+ if (pages.current !== currentPage) {
+ var oldPages = angular.extend({}, pages);
+
+ pages.current = currentPage;
+
+ updateCallback(pages, oldPages);
+ }
+ });
+
return pages;
} | fix(utils): add support for url in pagination util
related to CAM-<I> | camunda_camunda-bpm-platform | train | js |
4d02e60db82ca9769297e682ff6adf3fefd1c0d7 | diff --git a/Resources/public/js/interactionMatching.js b/Resources/public/js/interactionMatching.js
index <HASH>..<HASH> 100644
--- a/Resources/public/js/interactionMatching.js
+++ b/Resources/public/js/interactionMatching.js
@@ -90,13 +90,12 @@ function creationMatchingEdit(addchoice, addproposal, deletechoice, LabelValue,
containerProposal.children().first().children('div').each(function() {
- $('#newTableProposal').find('tbody').append('<tr></tr>');
+ $('#newTableProposal').find('tbody').append('<tr><td></td></tr>');
- addRemoveRowTableProposal();
$(this).find('.row').each(function() {
-
+
fillProposalArray($(this));
-
+ addRemoveRowTableProposal();
// Add the form errors
$('#proposalError').append($(this).find('span'));
});
@@ -107,6 +106,9 @@ function creationMatchingEdit(addchoice, addproposal, deletechoice, LabelValue,
$('#newTableProposal').find('tr:last').append('<td class="classic"></td>');
adddelete($('#newTableProposal').find('td:last'), deleteProposal);
}
+// if(first('tr') == null){
+//
+// }
});
containerProposal.remove(); | [ExoBundle] Organisation of the table of edit matching question | claroline_Distribution | train | js |
ac07783b7ee7c761d4854e1edfc61fc44cb21153 | diff --git a/spyder/plugins/editor/lsp/transport/producer.py b/spyder/plugins/editor/lsp/transport/producer.py
index <HASH>..<HASH> 100644
--- a/spyder/plugins/editor/lsp/transport/producer.py
+++ b/spyder/plugins/editor/lsp/transport/producer.py
@@ -15,17 +15,21 @@ queue, encapsulates them into valid JSONRPC messages and sends them to an
LSP server via TCP.
"""
-
-import os
-import zmq
+# Standard library imports
import json
-import time
-import socket
-import sys
import logging
+import os
+import socket
import subprocess
+import sys
+import time
+
+# Third party imports
+import zmq
+
+# Local imports
+from spyder.plugins.editor.lsp.transport.consumer import IncomingMessageThread
from spyder.py3compat import getcwd
-from consumer import IncomingMessageThread
TIMEOUT = 5000 | LSP: Reorganize some imports | spyder-ide_spyder | train | py |
a36d57ac756ee854ab7dab35319795fbfaf5c359 | diff --git a/hawtio-git/src/main/java/io/hawt/git/GitFacade.java b/hawtio-git/src/main/java/io/hawt/git/GitFacade.java
index <HASH>..<HASH> 100644
--- a/hawtio-git/src/main/java/io/hawt/git/GitFacade.java
+++ b/hawtio-git/src/main/java/io/hawt/git/GitFacade.java
@@ -742,7 +742,6 @@ public class GitFacade extends GitFacadeSupport {
LOG.warn("Failed to write git " + gitAttributes + ". " + e, e);
}
}
- System.out.println("Importing initial URLs: " + initialImportURLs);
if (Strings.isNotBlank(initialImportURLs)) {
String[] split = initialImportURLs.split(",");
if (split != null) {
@@ -967,4 +966,4 @@ public class GitFacade extends GitFacadeSupport {
return localBranchExists;
}
-}
\ No newline at end of file
+} | Remove System.out line
Remove the System.out.println line. It easily adds up if you use many GitFacade objects. | hawtio_hawtio | train | java |
86f653b3969ce16a603456605f7939863f89ce8a | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -14,7 +14,7 @@ var on = require('fdom/on');
var extend = require('cog/extend');
var defaults = require('cog/defaults');
var logger = require('cog/logger')('glue');
-var signaller = require('rtc/signaller');
+var signaller = require('rtc-signaller');
var media = require('rtc/media');
var captureConfig = require('rtc-captureconfig');
var transform = require('sdp-transform'); | Use rtc-signaller directly rather than going through rtc | rtc-io_rtc-glue | train | js |
49bc902f80bb0a4df773d20432e80d39a46f8497 | diff --git a/examples/send/main.go b/examples/send/main.go
index <HASH>..<HASH> 100644
--- a/examples/send/main.go
+++ b/examples/send/main.go
@@ -8,13 +8,13 @@ import (
func main() {
- n, err := notify.NewNotification("Test Notification", "This is a test notification")
+ ntf, err := notify.NewNotification("Test Notification", "This is a test notification")
if err != nil {
log.Fatal(err)
}
- if _, err := n.Send(); err != nil {
+ if _, err := ntf.Send(); err != nil {
log.Fatal(err)
}
diff --git a/notify.go b/notify.go
index <HASH>..<HASH> 100644
--- a/notify.go
+++ b/notify.go
@@ -245,7 +245,7 @@ func NewNotification(summary, body string) (n *Notification, err error) {
}
// Send the notification
-func (n *Notification) Send() (id uint32, err error) {
+func (n *Notification) Show() (id uint32, err error) {
hints := map[string]dbus.Variant{}
if len(n.Hints) != 0 { | Changed Send func to Show and updated example | TheCreeper_go-notify | train | go,go |
998a4e6f3144f2f4dfd0749bfe80f5dbcbaba4c8 | diff --git a/dynamodb_sessions/backends/dynamodb.py b/dynamodb_sessions/backends/dynamodb.py
index <HASH>..<HASH> 100644
--- a/dynamodb_sessions/backends/dynamodb.py
+++ b/dynamodb_sessions/backends/dynamodb.py
@@ -4,7 +4,7 @@ import logging
import boto
from django.conf import settings
-from django.contrib.sessions.backends.base import SessionBase, CreateError, randrange, MAX_SESSION_KEY
+from django.contrib.sessions.backends.base import SessionBase, CreateError, MAX_SESSION_KEY
from django.utils.hashcompat import md5_constructor
from boto.dynamodb.exceptions import DynamoDBKeyNotFoundError
from boto.exception import DynamoDBResponseError | randrange no longer in Django as of <I>: <URL> | gtaylor_django-dynamodb-sessions | train | py |
3b5aec57ea7563d3475f4882ec57d05cb3e9421d | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -350,11 +350,14 @@ Logsene.prototype.send = function (callback) {
}
var storeFileFlag = true
// don't use disk buffer for invalid Logsene tokens
-
if (res && res.body && appNotFoundRegEx.test(res.body)) {
storeFileFlag = false
}
- if (logseneError && limitRegex.test(logseneError) && process.env.LOGSENE_BUFFER_ON_APP_LIMIT === 'false') {
+ if (res && res.statusCode && res.statusCode == 400) {
+ storeFileFlag = false
+ }
+ if (logseneError && limitRegex.test(logseneError)) {
+ // && process.env.LOGSENE_BUFFER_ON_APP_LIMIT === 'false'
storeFileFlag = false
}
if (storeFileFlag) { | don't use disk buffer/retransmit for invalid tokens or app limits | sematext_logsene-js | train | js |
8346ad48ef27d407008fd5e40789f5aa7a23639b | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -16,7 +16,7 @@ const { LEVEL } = require('triple-beam');
* @param {Function} options.close - Called on "unpipe" from parent.
*/
const TransportStream = module.exports = function TransportStream(options = {}) {
- Writable.call(this, { objectMode: true });
+ Writable.call(this, { objectMode: true, highWaterMark: options.highWaterMark });
this.format = options.format;
this.level = options.level; | Add new property to increase default highWaterMark value | winstonjs_winston-transport | train | js |
14213ad692c2281e4335fcb6f21b70460902bb10 | diff --git a/lib/oxidized/model/speedtouch.rb b/lib/oxidized/model/speedtouch.rb
index <HASH>..<HASH> 100644
--- a/lib/oxidized/model/speedtouch.rb
+++ b/lib/oxidized/model/speedtouch.rb
@@ -1,7 +1,6 @@
class SpeedTouch < Oxidized::Model
-
prompt /([\w{}=]+[>])$/
- comment '! '
+ comment '! '
expect /login$/ do
send "\n"
@@ -10,16 +9,16 @@ class SpeedTouch < Oxidized::Model
cmd ':env list' do |cfg|
cfg.each_line.select do |line|
- not line.match /:env list$/ and
- not line.match /{\w+}=>$/
+ (not line.match /:env list$/) &&
+ (not line.match /{\w+}=>$/)
end.join
comment cfg
end
cmd ':config dump' do |cfg|
cfg.each_line.select do |line|
- not line.match /:config dump$/ and
- not line.match /{\w+}=>$/
+ (not line.match /:config dump$/) &&
+ (not line.match /{\w+}=>$/)
end.join
cfg
end
@@ -29,8 +28,7 @@ class SpeedTouch < Oxidized::Model
password /^Password : /
end
- cfg :telnet do
- pre_logout 'exit'
- end
-
+ cfg :telnet do
+ pre_logout 'exit'
+ end
end | Rubocop cleanup of speedtouch model. | ytti_oxidized | train | rb |
ee3124aa43a81a6ad434df92a43769c932f1f548 | diff --git a/satpy/tests/reader_tests/test_cmsaf_claas.py b/satpy/tests/reader_tests/test_cmsaf_claas.py
index <HASH>..<HASH> 100644
--- a/satpy/tests/reader_tests/test_cmsaf_claas.py
+++ b/satpy/tests/reader_tests/test_cmsaf_claas.py
@@ -71,13 +71,11 @@ def encoding():
@pytest.fixture
-def fake_file(fake_dataset, encoding):
+def fake_file(fake_dataset, encoding, tmp_path):
"""Write a fake dataset to file."""
- filename = "CPPin20140101001500305SVMSG01MD.nc"
+ filename = tmp_path / "CPPin20140101001500305SVMSG01MD.nc"
fake_dataset.to_netcdf(filename, encoding=encoding)
yield filename
- # Cleanup executed after test
- os.unlink(filename)
@pytest.fixture | Use tmp_path fixture for handling temporary files | pytroll_satpy | train | py |
8a7718040b5a347aba7adfd4693875f55a11a2d6 | diff --git a/lib/twitter-ads/campaign/campaign.rb b/lib/twitter-ads/campaign/campaign.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter-ads/campaign/campaign.rb
+++ b/lib/twitter-ads/campaign/campaign.rb
@@ -23,6 +23,7 @@ module TwitterAds
property :end_time, type: :time
property :start_time, type: :time
property :entity_status
+ property :effective_status
property :currency
property :standard_delivery
property :daily_budget_amount_local_micro | Update campaign.rb (#<I>) | twitterdev_twitter-ruby-ads-sdk | train | rb |
0d564b83675bf716e56020398730a3cc3af33ce6 | diff --git a/lib/discordrb/bot.rb b/lib/discordrb/bot.rb
index <HASH>..<HASH> 100644
--- a/lib/discordrb/bot.rb
+++ b/lib/discordrb/bot.rb
@@ -1067,6 +1067,9 @@ module Discordrb
debug 'Typing started in channel the bot has no access to, ignoring'
end
when :PRESENCE_UPDATE
+ # Ignore friends list presences
+ return unless data['guild_id']
+
now_playing = data['game']
presence_user = @users[data['user']['id'].to_i]
played_before = presence_user.nil? ? nil : presence_user.game | Ignore friends list presences, try 3 | meew0_discordrb | train | rb |
cbc8f32b9113fa3418fa5514c1dc7f06dee26b1d | diff --git a/dexmaker/src/test/java/com/google/dexmaker/stock/ProxyBuilderTest.java b/dexmaker/src/test/java/com/google/dexmaker/stock/ProxyBuilderTest.java
index <HASH>..<HASH> 100644
--- a/dexmaker/src/test/java/com/google/dexmaker/stock/ProxyBuilderTest.java
+++ b/dexmaker/src/test/java/com/google/dexmaker/stock/ProxyBuilderTest.java
@@ -771,6 +771,17 @@ public class ProxyBuilderTest extends TestCase {
.build();
}
+ public static class FinalToString {
+ @Override public final String toString() {
+ return "no proxy";
+ }
+ }
+
+ // https://code.google.com/p/dexmaker/issues/detail?id=12
+ public void testFinalToString() throws Throwable {
+ assertEquals("no proxy", proxyFor(FinalToString.class).build().toString());
+ }
+
/** Simple helper to add the most common args for this test to the proxy builder. */
private <T> ProxyBuilder<T> proxyFor(Class<T> clazz) throws Exception {
return ProxyBuilder.forClass(clazz) | Test for issue <I>. This fails! | linkedin_dexmaker | train | java |
3fd3da3d46e4c863b63e69dffa442ee5edb62f30 | diff --git a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
index <HASH>..<HASH> 100644
--- a/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
+++ b/lib/Doctrine/ORM/Tools/Pagination/LimitSubqueryOutputWalker.php
@@ -289,7 +289,7 @@ class LimitSubqueryOutputWalker extends SqlWalker
// The order by items are not required to be in the select list on Oracle and PostgreSQL, but
// for the sake of simplicity, order by items will be included in the select list on all platforms.
// This doesn't impact functionality.
- $selectListAdditions[] = trim(str_ireplace(array("asc", "desc"), "", $orderByItem));
+ $selectListAdditions[] = trim(preg_replace('/([^ ]+) (?:asc|desc)/i', '$1', $orderByItem));
$orderByItems[] = $orderByItem;
} | Fixed removal of ASC and DESC keywords from orderby items that will be included in select list | doctrine_orm | train | php |
946c565775fea6b1edcc5289edad17f6f0c09b95 | diff --git a/spec/nio/selectables_spec.rb b/spec/nio/selectables_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/nio/selectables_spec.rb
+++ b/spec/nio/selectables_spec.rb
@@ -102,6 +102,11 @@ describe "NIO selectables" do
_, writers = select [], [sock], [], 0
end while writers and writers.include? sock
+ # I think the kernel might manage to drain its buffer a bit even after
+ # the socket first goes unwritable. Attempt to sleep past this and then
+ # attempt to write again
+ sleep 0.1
+
# Once more for good measure!
begin
sock.write_nonblock "X" * 1024 | Attempt to outsleep any possible buffer drain
This is total hax, but producing a socket that reliably stays in the
unwritable state is fucking hard, sue me. | socketry_nio4r | train | rb |
b3de0c5a1ed9f0783e6c921c2cfdd5678889b74f | diff --git a/src/mouse.support.js b/src/mouse.support.js
index <HASH>..<HASH> 100644
--- a/src/mouse.support.js
+++ b/src/mouse.support.js
@@ -2,11 +2,10 @@ var syn = require('./synthetic');
require('./mouse');
-if (!document.body) {
- syn.schedule(function () {
- checkSupport(syn);
- }, 1);
-} else {
+(function checkSupport() {
+ if (!document.body) {
+ return syn.schedule(checkSupport, 1);
+ }
window.__synthTest = function () {
syn.support.linkHrefJS = true;
};
@@ -71,7 +70,7 @@ if (!document.body) {
//check stuff
syn.support.ready++;
-}
+}()); | mouse.support.js: Fix scheduled execution in case of no document.body.
Commit 5cf<I> changed the structure of this file, it does still call
checkSupport, but the function no longer exists. | bitovi_syn | train | js |
a2e6ec3cbf840f9d81de6e1b1a2c1507a9bafe64 | diff --git a/spec/generator_helpers.rb b/spec/generator_helpers.rb
index <HASH>..<HASH> 100644
--- a/spec/generator_helpers.rb
+++ b/spec/generator_helpers.rb
@@ -1,5 +1,9 @@
module GeneratorHelpers
+ ['devise', 'rails_admin'].each do |name|
+ define_method("create_#{name}_initializer".to_sym) { FileUtils.touch File.join(destination_root, 'config', 'initializers', "#{name}.rb") }
+ end
+
def create_rails_folder_structure
config_path = File.join(destination_root, 'config')
FileUtils.mkdir config_path
@@ -7,14 +11,6 @@ module GeneratorHelpers
FileUtils.mkdir File.join(config_path, 'locales')
end
- def create_devise_initializer
- FileUtils.touch File.join(destination_root, 'config', 'initializers', 'devise.rb')
- end
-
- def create_rails_admin_initializer
- FileUtils.touch File.join(destination_root, 'config', 'initializers', 'rails_admin.rb')
- end
-
def create_routes_with_devise
File.open(File.join(destination_root, 'config', 'routes.rb'), 'w') do |f|
f.puts "DummyApp::Application.routes.draw do | a little DRY reflection refactoring | sferik_rails_admin | train | rb |
475cdd6f9ddd4f7d5f952a8aef09c4a56477cb61 | diff --git a/packages/react-static/src/commands/create.js b/packages/react-static/src/commands/create.js
index <HASH>..<HASH> 100644
--- a/packages/react-static/src/commands/create.js
+++ b/packages/react-static/src/commands/create.js
@@ -177,7 +177,7 @@ export default (async function create({ name, template, isCLI }) {
}...`
)
// We install react-static separately to ensure we always have the latest stable release
- execSync(`cd ${name} && ${isYarn ? 'yarn' : 'npm install'}`)
+ execSync(`cd "${name}" && ${isYarn ? 'yarn' : 'npm install'}`)
console.log('')
}
@@ -186,7 +186,7 @@ export default (async function create({ name, template, isCLI }) {
console.log(`
${chalk.green('=> To get started:')}
- cd ${name} ${
+ cd "${name}" ${
!isCLI
? `&& ${
isYarn | fix project name with spaces on 'react-static create' #<I> (#<I>)
Adding \" on path name solves the problem | nozzle_react-static | train | js |
0ae49510cf507feaac70e8f5dd5e72753ae66dfd | diff --git a/salt/modules/file.py b/salt/modules/file.py
index <HASH>..<HASH> 100644
--- a/salt/modules/file.py
+++ b/salt/modules/file.py
@@ -198,9 +198,15 @@ def chown(path, user, group):
gid = group_to_gid(group)
err = ''
if uid == '':
- err += 'User does not exist\n'
+ if user != '':
+ err += 'User does not exist\n'
+ else:
+ uid = -1
if gid == '':
- err += 'Group does not exist\n'
+ if group != '':
+ err += 'Group does not exist\n'
+ else:
+ gid = -1
if not os.path.exists(path):
err += 'File not found'
if err: | Allow setting group and user perms for file state independently | saltstack_salt | train | py |
9355a99ae0ae40bbe81046b916fb36af2fbf8ac7 | diff --git a/src/ConnectionInterface.php b/src/ConnectionInterface.php
index <HASH>..<HASH> 100755
--- a/src/ConnectionInterface.php
+++ b/src/ConnectionInterface.php
@@ -42,7 +42,7 @@ interface ConnectionInterface {
*
* @return void
*/
- public function get ( $remote, $local );
+ public function get( $remote, $local );
/**
* Get the contents of a remote file.
diff --git a/src/GatewayInterface.php b/src/GatewayInterface.php
index <HASH>..<HASH> 100755
--- a/src/GatewayInterface.php
+++ b/src/GatewayInterface.php
@@ -28,6 +28,25 @@ interface GatewayInterface {
public function run( $command );
/**
+ * Download the contents of a remote file.
+ *
+ * @param string $remote
+ * @param string $local
+ *
+ * @return void
+ */
+ public function get( $remote, $local );
+
+ /**
+ * Get the contents of a remote file.
+ *
+ * @param string $remote
+ *
+ * @return string
+ */
+ public function getString( $remote );
+
+ /**
* Upload a local file to the server.
*
* @param string $local | Add get and getString to GatewayInterface, fix extra space in ConnectionInterface | LaravelCollective_remote | train | php,php |
fadff0d33231cf9db263c3ebe4d4d623f7aeee5c | diff --git a/test/integration/authorization_test.go b/test/integration/authorization_test.go
index <HASH>..<HASH> 100644
--- a/test/integration/authorization_test.go
+++ b/test/integration/authorization_test.go
@@ -379,7 +379,10 @@ var globalClusterReaderUsers = sets.NewString("system:serviceaccount:openshift-i
var globalClusterReaderGroups = sets.NewString("system:cluster-readers", "system:cluster-admins", "system:masters")
// this list includes any other users who can get DeploymentConfigs
-var globalDeploymentConfigGetterUsers = sets.NewString("system:serviceaccount:openshift-infra:unidling-controller")
+var globalDeploymentConfigGetterUsers = sets.NewString(
+ "system:serviceaccount:openshift-infra:unidling-controller",
+ "system:serviceaccount:openshift-infra:garbage-collector-controller",
+)
type resourceAccessReviewTest struct {
description string | fix-test: add GC user to globalDeploymentConfigGetterUsers | openshift_origin | train | go |
ed79bff080253f33878cbf9aba848cc84b607722 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -26,11 +26,11 @@ module.exports = {
// Import Chosen CSS (done by default)
if(options.importChosenCSS) { app.import(app.bowerDirectory + '/chosen/chosen.css'); }
},
- treeFor: function(treeName) {
+ treeForPublic: function(treeName) {
var tree;
// Only include the Chosen sprites if we're including Chosen CSS in the build
- if(treeName === 'public' && this.app.options['ember-cli-chosen'].importChosenCSS) {
+ if(this.app.options['ember-cli-chosen'].importChosenCSS) {
tree = pickFiles(this.app.bowerDirectory + '/chosen', {
srcDir: '/',
files: ['*.png'], | Allow other trees to be returned.
If you override `treeFor` but do not return anything for
`treeFor('addon')` or `treeFor('app')` no code will be shipped to the
browser. | green-arrow_ember-cli-chosen | train | js |
47e891445efe351974002e8c447217dcfe447926 | diff --git a/src/main/java/com/bugsnag/delivery/SyncHttpDelivery.java b/src/main/java/com/bugsnag/delivery/SyncHttpDelivery.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/bugsnag/delivery/SyncHttpDelivery.java
+++ b/src/main/java/com/bugsnag/delivery/SyncHttpDelivery.java
@@ -9,6 +9,7 @@ import org.slf4j.LoggerFactory;
import java.io.IOException;
import java.io.OutputStream;
import java.net.HttpURLConnection;
+import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.net.UnknownHostException;
@@ -81,6 +82,9 @@ public class SyncHttpDelivery implements HttpDelivery {
logger.warn(
"Error not reported to Bugsnag - got non-200 response code: {}", status);
}
+ } catch (MalformedURLException ex) {
+ logger.warn("Error not reported to Bugsnag - malformed URL."
+ + " Have you set both endpoints correctly?", ex);
} catch (SerializationException ex) {
logger.warn("Error not reported to Bugsnag - exception when serializing payload", ex);
} catch (UnknownHostException ex) { | feat: disable sending of sessions if endpoint is not set | bugsnag_bugsnag-java | train | java |
10e89f6730c78126363cdc393369fb3be5c150b8 | diff --git a/atrcopy/__init__.py b/atrcopy/__init__.py
index <HASH>..<HASH> 100644
--- a/atrcopy/__init__.py
+++ b/atrcopy/__init__.py
@@ -1,4 +1,4 @@
-__version__ = "3.2.0"
+__version__ = "3.3.0"
import logging | Updated version number to <I> so omnivore can require it | robmcmullen_atrcopy | train | py |
7a53480b327b1767c3e70c563c402ffa42308b6a | diff --git a/app/lib/content_search/content_view_comparison.rb b/app/lib/content_search/content_view_comparison.rb
index <HASH>..<HASH> 100644
--- a/app/lib/content_search/content_view_comparison.rb
+++ b/app/lib/content_search/content_view_comparison.rb
@@ -64,16 +64,17 @@ module ContentSearch
:cols => {}
)
- cols.each do |key, col|
+ total = cols.inject(0) do |total, (key, col)|
view_id, env_id = key.split("_")
# find the product in the view and get the # of packages
env = KTEnvironment.find(env_id)
version = ContentView.find(view_id).version(env)
field = "#{package_type}_count".to_sym
- total = version.repos(env).select{|r| r.product == product}.map(&field).inject(:+)
- row.cols[key] = Column.new(:display => total, :id => key) if total && total > 0
+ count = version.repos(env).select{|r| r.product == product}.map(&field).inject(:+)
+ count ? total + count : total
end
- product_rows << row unless row.cols.empty?
+
+ product_rows << row unless total < 1
product_rows
end
end | Content Search: not displaying total packages per product on cv comparison | Katello_katello | train | rb |
71ee490420916567069d33be0156d45c434e7301 | diff --git a/spec/rubocop/target_finder_spec.rb b/spec/rubocop/target_finder_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/rubocop/target_finder_spec.rb
+++ b/spec/rubocop/target_finder_spec.rb
@@ -145,8 +145,6 @@ describe Rubocop::TargetFinder, :isolated_environment do
context 'when an exception is raised while reading file' do
around do |example|
- File.any_instance.stub(:readline).and_raise(EOFError)
-
original_stderr = $stderr
$stderr = StringIO.new
begin
@@ -156,6 +154,10 @@ describe Rubocop::TargetFinder, :isolated_environment do
end
end
+ before do
+ File.any_instance.stub(:readline).and_raise(EOFError)
+ end
+
context 'and debug mode is enabled' do
let(:debug) { true } | Move a method stub from #around hook to #before hook | rubocop-hq_rubocop | train | rb |
f71172e4aa8a591a013b4dae7b0c380e5ae3cca6 | diff --git a/src/JsFunctionsScanner.php b/src/JsFunctionsScanner.php
index <HASH>..<HASH> 100644
--- a/src/JsFunctionsScanner.php
+++ b/src/JsFunctionsScanner.php
@@ -299,6 +299,7 @@ final class JsFunctionsScanner extends GettextJsFunctionsScanner {
if (
'ParenthesizedExpression' === $callee->getType() &&
'SequenceExpression' === $callee->getExpression()->getType() &&
+ 2 === count( $callee->getExpression()->getExpressions() ) &&
'Literal' === $callee->getExpression()->getExpressions()[0]->getType() &&
[] !== $node->getArguments()
) { | Check for 2 expressions inside the parenthesis | wp-cli_i18n-command | train | php |
99c86bbf46dad13b211760f1fca192e5f8cced0f | diff --git a/compress/conf/settings.py b/compress/conf/settings.py
index <HASH>..<HASH> 100644
--- a/compress/conf/settings.py
+++ b/compress/conf/settings.py
@@ -18,6 +18,3 @@ if COMPRESS_CSS_FILTERS is None:
if COMPRESS_JS_FILTERS is None:
COMPRESS_JS_FILTERS = []
-
-if COMPRESS_VERSION and not COMPRESS_AUTO:
- raise ImproperlyConfigured('COMPRESS_AUTO needs to be True when using COMPRESS_VERSION.')
\ No newline at end of file | COMPRESS_VERSION=True and COMPRESS_AUTO=False is now possible
removed the check for this | jazzband_django-pipeline | train | py |
472afd16ed0d37afda0ca07f06b98a1efce28a4b | diff --git a/lib/cert/developer_center.rb b/lib/cert/developer_center.rb
index <HASH>..<HASH> 100644
--- a/lib/cert/developer_center.rb
+++ b/lib/cert/developer_center.rb
@@ -174,9 +174,9 @@ module Cert
raise "Something went wrong with request to #{url}" unless certs
certs.each do |current_cert|
- if current_cert['typeString'] == certTypeName
- # The other profiles are push profiles
- # We only care about the distribution profile
+ if current_cert['typeString'] == certTypeName and current_cert['canDownload']
+ # The other profiles are push profiles or ones we are not allowed to download
+ # We only care about the distribution profile that we can download
available << current_cert # mostly we only care about the 'certificateId'
end
end | Only try to download certificates that we can access
Currently cert tries to download all certificates which causes an error
when the user is not allowed to download some certificates because
he doesn't have admin rights. | fastlane_fastlane | train | rb |
a8b04ef9ef81c4ce66b0a7ab13c03f3878dcf68f | diff --git a/uglifycss-lib.js b/uglifycss-lib.js
index <HASH>..<HASH> 100644
--- a/uglifycss-lib.js
+++ b/uglifycss-lib.js
@@ -129,7 +129,9 @@ function convertRelativeUrls(css, options, preservedTokens) {
url.shift();
}
- target.fill("..");
+ for (var i = 0, l = target.length; i < l; ++i) {
+ target[i] = "..";
+ }
url = terminator + target.concat(url, file).join(SEP) + terminator;
} else { | Get rid off fill array method
fill is not available on older version of node/v8
fix #<I> | fmarcia_UglifyCSS | train | js |
096f3ec8c10d1246e8c364799b584b88d8d1eff2 | diff --git a/lib/copy/__tests__/copy-sync.test.js b/lib/copy/__tests__/copy-sync.test.js
index <HASH>..<HASH> 100644
--- a/lib/copy/__tests__/copy-sync.test.js
+++ b/lib/copy/__tests__/copy-sync.test.js
@@ -331,6 +331,7 @@ describe('+ copySync()', function () {
require('../../util/utimes').hasMillisRes(function (err, doesIt) {
assert.ifError(err)
console.log(doesIt)
+ console.log('WHY IS THIS OUTPUT NOT ON appveyor? ' + doesIt)
done()
})
}) | lib/copy/__test__/copy-sync: appveyor (temporary) | jprichardson_node-fs-extra | train | js |
6bf80e518c452de4a1ec3152257fffe593032cfc | diff --git a/lib/node_modules/@stdlib/math/generics/statistics/chi2gof/lib/chi2gof.js b/lib/node_modules/@stdlib/math/generics/statistics/chi2gof/lib/chi2gof.js
index <HASH>..<HASH> 100644
--- a/lib/node_modules/@stdlib/math/generics/statistics/chi2gof/lib/chi2gof.js
+++ b/lib/node_modules/@stdlib/math/generics/statistics/chi2gof/lib/chi2gof.js
@@ -112,11 +112,21 @@ function chi2gof() {
}
distArgs = [ null ].concat( distParams );
expected = new Array( len );
+ psum = 0.0;
for ( i = 0; i < len; i++ ) {
distArgs[ 0 ] = i;
val = pmf.apply( null, distArgs );
+ psum += val;
expected[ i ] = val * n;
}
+ if ( psum < 1.0 ) {
+ // Add remaining category for all values greater or equal to `len`:
+ val = 1.0 - psum;
+ expected.push( val * n );
+ x = Array.prototype.slice.call( x );
+ x.push( 0 );
+ len += 1;
+ }
}
else {
if ( !isNonNegativeNumberArray( args[ 1 ] ) ) { | Add category to make probabilities sum to one
Random variables of discrete distributions have often a countably infinite number of possible values. Since the user-supplied observed frequency table will only contain frequencies up to a certain number, we append another category for which the observed count is zero and the expected count is n * P(X >= len). | stdlib-js_stdlib | train | js |
c4efaae922fb901b4f5180b3e6d7fc212939665d | diff --git a/js/jquery.mapael.js b/js/jquery.mapael.js
index <HASH>..<HASH> 100644
--- a/js/jquery.mapael.js
+++ b/js/jquery.mapael.js
@@ -521,6 +521,11 @@
});
}
+ // When the user drag the map, prevent to move the clicked element instead of dragging the map (behaviour seen with Firefox)
+ self.$map.on("dragstart", function() {
+ return false;
+ });
+
// Panning
$("body").on("mouseup." + pluginName + (zoomOptions.touch ? " touchend." + pluginName : ""), function () {
mousedown = false; | prevent to move the clicked element instead of dragging the map (behaviour seen with Firefox) | neveldo_jQuery-Mapael | train | js |
ddedcb9abf98fd1cc85fb43ee35a12b2e898a5d7 | diff --git a/tests/test_past/test_misc.py b/tests/test_past/test_misc.py
index <HASH>..<HASH> 100644
--- a/tests/test_past/test_misc.py
+++ b/tests/test_past/test_misc.py
@@ -30,7 +30,7 @@ class TestCmp(unittest.TestCase):
def test_cmp(self):
for x, y, cmp_python2_value in test_values.cmp_python2_value:
if PY26:
- # set comparison works a bit differently in 2.6
+ # set cmp works a bit differently in 2.6, we try to emulate 2.7 behavior, so skip set cmp tests
if isinstance(x, set) or isinstance(y, set):
continue
# to get this to run on python <3.4 which lacks subTest | fix <I> test, better comment | PythonCharmers_python-future | train | py |
731df905fb0282c7255e4e0d4acf339a98e3db7e | diff --git a/setuptools/build_meta.py b/setuptools/build_meta.py
index <HASH>..<HASH> 100644
--- a/setuptools/build_meta.py
+++ b/setuptools/build_meta.py
@@ -170,7 +170,7 @@ def build_wheel(wheel_directory, config_settings=None,
def build_sdist(sdist_directory, config_settings=None):
config_settings = _fix_config(config_settings)
sdist_directory = os.path.abspath(sdist_directory)
- sys.argv = sys.argv[:1] + ['sdist'] + \
+ sys.argv = sys.argv[:1] + ['sdist', '--formats', 'gztar'] + \
config_settings["--global-option"] + \
["--dist-dir", sdist_directory]
_run_setup() | Always specify formats=gztar, overriding the project's legacy expectation that a zip sdist should be generated. Fixes #<I>. | pypa_setuptools | train | py |
ca6544646c945facfac02540c06ed8bf47029d60 | diff --git a/src/Message.php b/src/Message.php
index <HASH>..<HASH> 100644
--- a/src/Message.php
+++ b/src/Message.php
@@ -148,8 +148,12 @@ trait Message {
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withHeader($name, $value):self {
+ if(!is_array($value)) {
+ $value = [$value];
+ }
+
$clone = clone $this;
- $clone->headers->set($name, $value);
+ $clone->headers->set($name, ...$value);
return $clone;
}
@@ -170,8 +174,12 @@ trait Message {
* @throws \InvalidArgumentException for invalid header names or values.
*/
public function withAddedHeader($name, $value) {
+ if(!is_array($value)) {
+ $value = [$value];
+ }
+
$clone = clone $this;
- $clone->headers->add($name, $value);
+ $clone->headers->add($name, ...$value);
return $clone;
} | Implement withHeader, withAddedHeader | PhpGt_Http | train | php |
32ce5113fe02ef60d02220452a93123790e16445 | diff --git a/app/src/Bolt/Controllers/Backend.php b/app/src/Bolt/Controllers/Backend.php
index <HASH>..<HASH> 100644
--- a/app/src/Bolt/Controllers/Backend.php
+++ b/app/src/Bolt/Controllers/Backend.php
@@ -592,6 +592,7 @@ class Backend implements ControllerProviderInterface
return redirect('dashboard');
}
+ // set the editreferrer global if it was not set yet
$tmpreferrer = $app['request']->server->get('HTTP_REFERER');
$editreferrer = $app['request']->get('editreferrer');
if(!$editreferrer) {
@@ -666,7 +667,6 @@ class Backend implements ControllerProviderInterface
// No returnto, so we go back to the 'overview' for this contenttype.
// check if a pager was set in the referrer - if yes go back there
- $editreferrer = false;
$editreferrer = $app['request']->get('editreferrer');
if($editreferrer) {
return simpleredirect($editreferrer); | add a redirect handler for overview and edit pagers | bolt_bolt | train | php |
11f0142009cf2ae0961080729da4666eaaf41d5f | diff --git a/salt/modules/zypper.py b/salt/modules/zypper.py
index <HASH>..<HASH> 100644
--- a/salt/modules/zypper.py
+++ b/salt/modules/zypper.py
@@ -315,7 +315,7 @@ def del_repo(repo):
return {
repo: True,
'message': msg[0].childNodes[0].nodeValue,
- }
+ }
raise CommandExecutionError('Repository \'{0}\' not found.'.format(repo))
@@ -662,7 +662,7 @@ def upgrade(refresh=True):
ret = {'changes': {},
'result': True,
'comment': '',
- }
+ }
if salt.utils.is_true(refresh):
refresh_db() | PEP8: closing bracked matching | saltstack_salt | train | py |
bd7b55e3846619c2f3b07ed3a8c5e9fb5104d245 | diff --git a/lib/auth/saml.go b/lib/auth/saml.go
index <HASH>..<HASH> 100644
--- a/lib/auth/saml.go
+++ b/lib/auth/saml.go
@@ -334,7 +334,7 @@ func (a *AuthServer) ValidateSAMLResponse(samlResponse string) (*SAMLAuthRespons
}
if len(request.PublicKey) != 0 {
- certTTL := utils.MinTTL(utils.ToTTL(a.clock, expiresAt), request.CertTTL)
+ certTTL := utils.MinTTL(sessionTTL, request.CertTTL)
allowedLogins, err := roles.CheckLoginDuration(certTTL)
if err != nil {
return nil, trace.Wrap(err) | Fixed incorrect certificates TTL for SAML users. | gravitational_teleport | train | go |
d386854bbee0a5762c08dbbce6578178b4d7916a | diff --git a/mpd/asyncio.py b/mpd/asyncio.py
index <HASH>..<HASH> 100644
--- a/mpd/asyncio.py
+++ b/mpd/asyncio.py
@@ -362,16 +362,16 @@ class MPDClient(MPDClientBase):
chunk = metadata.pop('binary', None)
if final_metadata is None:
+ data = chunk
final_metadata = metadata
+ if not data:
+ break
try:
size = int(final_metadata['size'])
except KeyError:
size = len(chunk)
except ValueError:
raise CommandError("Size data unsuitable for binary transfer")
- data = chunk
- if not data:
- break
else:
if metadata != final_metadata:
raise CommandError("Metadata of binary data changed during transfer")
diff --git a/mpd/tests.py b/mpd/tests.py
index <HASH>..<HASH> 100755
--- a/mpd/tests.py
+++ b/mpd/tests.py
@@ -1450,6 +1450,10 @@ class TestAsyncioMPD(unittest.TestCase):
self.init_client()
self._await(self._test_readpicture())
+ def test_readpicture_empty(self):
+ self.init_client()
+ self._await(self._test_readpicture_empty())
+
def test_mocker(self):
"""Does the mock server refuse unexpected writes?"""
self.init_client() | Fix empty-picture reads for asyncio | Mic92_python-mpd2 | train | py,py |
a490d4694170de009888ef10aa5a7cfd624d2b82 | diff --git a/revapi-basic-features/src/main/java/org/revapi/basic/SemverIgnoreTransform.java b/revapi-basic-features/src/main/java/org/revapi/basic/SemverIgnoreTransform.java
index <HASH>..<HASH> 100644
--- a/revapi-basic-features/src/main/java/org/revapi/basic/SemverIgnoreTransform.java
+++ b/revapi-basic-features/src/main/java/org/revapi/basic/SemverIgnoreTransform.java
@@ -68,8 +68,8 @@ public class SemverIgnoreTransform implements DifferenceTransform<Element> {
}
private Difference asBreaking(Difference d) {
- return Difference.builder().withCode("semver.incompatibleWithCurrentVersion")
- .withDescription(d.description + " (original difference code: " + d.code + ")")
+ return Difference.builder().withCode(d.code)
+ .withDescription(d.description + " (breaks semantic versioning)")
.withName("Incompatible with the current version: " + d.name)
.addAttachments(d.attachments).addClassifications(d.classification)
.addClassification(CompatibilityType.OTHER, DifferenceSeverity.BREAKING).build(); | Don't change the difference code during semver-ignore. Just let it break on other
and add info to the description that this breaks the semver rules. | revapi_revapi | train | java |
ed015258646c877fa3b2f4c26b38b71e24a7d470 | diff --git a/src/Connection.php b/src/Connection.php
index <HASH>..<HASH> 100644
--- a/src/Connection.php
+++ b/src/Connection.php
@@ -279,7 +279,7 @@ class Connection
*
* @return void
*/
- public function publish($subject, $payload)
+ public function publish($subject, $payload = null)
{
$msg = 'PUB '.$subject.' '.strlen($payload);
$this->send($msg . "\r\n" . $payload); | TASK: Allow empty payload in Connection::publish | repejota_phpnats | train | php |
9e23841be5836a71b91d4a6af6ce70d713797b53 | diff --git a/src/boot.js b/src/boot.js
index <HASH>..<HASH> 100644
--- a/src/boot.js
+++ b/src/boot.js
@@ -189,8 +189,8 @@ if ("undefined" !== typeof WScript) {
/*#endif*/
-// PhantomJS
-} else if ("undefined" !== typeof phantom && phantom.version) {
+// PhantomJS - When used as a command line (otherwise considered as a browser)
+} else if ("undefined" !== typeof phantom && phantom.version && !document.currentScript) {
_gpfHost = _GPF_HOST.PHANTOMJS;
_gpfDosPath = require("fs").separator === "\\";
_gpfMainContext = window; | PhantomJS is now detected only when used as a command line (#<I>) | ArnaudBuchholz_gpf-js | train | js |
e04f22975de10024ad9d98fc40b12c130b1b79f7 | diff --git a/scripts/build/build-docs.js b/scripts/build/build-docs.js
index <HASH>..<HASH> 100644
--- a/scripts/build/build-docs.js
+++ b/scripts/build/build-docs.js
@@ -28,7 +28,7 @@ const prettierPath = isPullRequest ? "dist" : "node_modules/prettier/";
if (isPullRequest) {
const pkg = require("../../package.json");
- pkg.version = `preview-${process.env.REVIEW_ID}`;
+ pkg.version = `pr-${process.env.REVIEW_ID}`;
pipe(JSON.stringify(pkg, null, 2)).to("package.json");
shell.exec("node scripts/build/build.js");
} | Change "preview" to "pr" | josephfrazier_prettier_d | train | js |
Subsets and Splits