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
|
---|---|---|---|---|---|
d4ff87a92660d2a75b07de768c36523e13b1e4c2 | diff --git a/spyderlib/widgets/ipython.py b/spyderlib/widgets/ipython.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/ipython.py
+++ b/spyderlib/widgets/ipython.py
@@ -638,17 +638,15 @@ class IPythonClient(QWidget, SaveHistoryMixin):
"""Resets the namespace by removing all names defined by the user"""
reply = QMessageBox.question(
- None,
+ self,
_("Reset IPython namespace"),
_("All user-defined variables will be removed."
- "<br>Are you sure you want to clean the namespace?"),
+ "<br>Are you sure you want to reset the namespace?"),
QMessageBox.Yes | QMessageBox.No,
)
- if reply == QMessageBox.No:
- return
-
- self.shellwidget.execute("%reset -f")
+ if reply == QMessageBox.Yes:
+ self.shellwidget.execute("%reset -f")
def if_kernel_dies(self, t):
""" | Fixed parent object, question message and reply check. | spyder-ide_spyder | train | py |
eded3569a1696b5ea8fc31a70ff01af35a3accfa | diff --git a/src/main/java/com/thomasjensen/checkstyle/addons/checks/misc/CatalogEntry.java b/src/main/java/com/thomasjensen/checkstyle/addons/checks/misc/CatalogEntry.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/thomasjensen/checkstyle/addons/checks/misc/CatalogEntry.java
+++ b/src/main/java/com/thomasjensen/checkstyle/addons/checks/misc/CatalogEntry.java
@@ -88,7 +88,7 @@ final class CatalogEntry
@Override
public int compareTo(@Nonnull final CatalogEntry pOther)
{
- int result = Integer.compare(ast.getLineNo(), pOther.getAst().getLineNo());
+ int result = Integer.valueOf(ast.getLineNo()).compareTo(Integer.valueOf(pOther.getAst().getLineNo()));
if (result == 0) {
result = constantName.compareTo(pOther.getConstantName());
} | Fix Java 6 compatibility in CatalogEntry.compareTo() | checkstyle-addons_checkstyle-addons | train | java |
0b682bf7d3cbc64382a238cc5be9a67eba027ba0 | diff --git a/bokeh/server/views/autoload_js_handler.py b/bokeh/server/views/autoload_js_handler.py
index <HASH>..<HASH> 100644
--- a/bokeh/server/views/autoload_js_handler.py
+++ b/bokeh/server/views/autoload_js_handler.py
@@ -77,7 +77,7 @@ class AutoloadJsHandler(SessionHandler):
bundle = bundle_for_objs_and_resources(None, resources)
render_items = [RenderItem(token=session.token, elementid=element_id, use_for_title=False)]
- bundle.add(Script(script_for_render_items(None, render_items, app_path=app_path, absolute_url=absolute_url)))
+ bundle.add(Script(script_for_render_items({}, render_items, app_path=app_path, absolute_url=absolute_url)))
js = AUTOLOAD_JS.render(bundle=bundle, elementid=element_id) | Provide empty (not None) docs_json in AutoloadJsHandler (#<I>) | bokeh_bokeh | train | py |
bd52c37ffc10c7264091b50f9fee62eaf6ef7eec | diff --git a/tests/plots/test_mapping.py b/tests/plots/test_mapping.py
index <HASH>..<HASH> 100644
--- a/tests/plots/test_mapping.py
+++ b/tests/plots/test_mapping.py
@@ -10,7 +10,7 @@ ccrs = pytest.importorskip('cartopy.crs')
from metpy.plots.mapping import CFProjection # noqa: E402
def test_inverse_flattening_0():
- """Test new code for dealing the case where inverse_flattening = 0"""
+ """Test new code for dealing the case where inverse_flattening = 0."""
attrs = {'grid_mapping_name': 'lambert_conformal_conic', 'earth_radius': 6367000,
'standard_parallel': 25, 'inverse_flattening': 0}
proj = CFProjection(attrs)
@@ -22,6 +22,7 @@ def test_inverse_flattening_0():
assert globe_params['a'] == 6367000
assert globe_params['b'] == 6367000
+
def test_cfprojection_arg_mapping():
"""Test the projection mapping arguments."""
source = {'source': 'a', 'longitude_of_projection_origin': -100} | Corrected spacing/formatting issues | Unidata_MetPy | train | py |
560eb07009d65fbcfb49b2fa8b04a2e3f4d647e8 | diff --git a/integration-cli/docker_cli_events_test.go b/integration-cli/docker_cli_events_test.go
index <HASH>..<HASH> 100644
--- a/integration-cli/docker_cli_events_test.go
+++ b/integration-cli/docker_cli_events_test.go
@@ -65,7 +65,7 @@ func TestCLILimitEvents(t *testing.T) {
out, _, _ := runCommandWithOutput(eventsCmd)
events := strings.Split(out, "\n")
n_events := len(events) - 1
- if n_events > 64 {
+ if n_events != 64 {
t.Fatalf("events should be limited to 64, but received %d", n_events)
}
logDone("events - limited to 64 entries") | avoid regression in events test
Docker-DCO-<I>- | moby_moby | train | go |
3b3abfd42a23e922d04edf09fd56b3519252622f | diff --git a/src/main/java/com/optimaize/langdetect/LanguageDetectorImpl.java b/src/main/java/com/optimaize/langdetect/LanguageDetectorImpl.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/optimaize/langdetect/LanguageDetectorImpl.java
+++ b/src/main/java/com/optimaize/langdetect/LanguageDetectorImpl.java
@@ -248,14 +248,17 @@ public final class LanguageDetectorImpl implements LanguageDetector {
for (int j=0;j<prob.length;++j) {
double p = prob[j];
if (p >= probabilityThreshold) {
- for (int i=0; i<=list.size(); ++i) {
- if (i == list.size() || list.get(i).getProbability() < p) {
- list.add(i, new DetectedLanguage(ngramFrequencyData.getLanguage(j), p));
- break;
+ list.add(new DetectedLanguage(ngramFrequencyData.getLanguage(j), p));
+ }
+ list.sort(
+ new Comparator<DetectedLanguage>() {
+ public int compare(DetectedLanguage a, DetectedLanguage b) {
+ return b.getProbability() > a.getProbability() ? 1 : -1;
}
}
- }
+ );
}
+
return list;
} | change sorting algorithm to let ArrayList handle sorting | optimaize_language-detector | train | java |
dde35501cd9a22c73baf1d759e5f6fd70861df27 | diff --git a/tests/support/helpers.py b/tests/support/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/support/helpers.py
+++ b/tests/support/helpers.py
@@ -1663,7 +1663,7 @@ class VirtualEnv:
venv_dir = attr.ib(converter=_cast_to_pathlib_path)
env = attr.ib(default=None)
system_site_packages = attr.ib(default=False)
- pip_requirement = attr.ib(default="pip", repr=False)
+ pip_requirement = attr.ib(default="pip>=20.2.4,<21.2", repr=False)
setuptools_requirement = attr.ib(
default="setuptools!=50.*,!=51.*,!=52.*", repr=False
)
@@ -1802,9 +1802,6 @@ class SaltVirtualEnv(VirtualEnv):
using static requirements
"""
- pip_requirement = attr.ib(default="pip>=20.2.4,<21.2", repr=False)
- upgrade_pip_and_setuptools = attr.ib(init=False, default=False, repr=False)
-
def _create_virtualenv(self):
super()._create_virtualenv()
self.install(RUNTIME_VARS.CODE_DIR) | Same pip constrains as ``noxfile.py`` | saltstack_salt | train | py |
a24e4ddba7e33ea7113c4b557a6564a52c726f96 | diff --git a/consul/base.py b/consul/base.py
index <HASH>..<HASH> 100644
--- a/consul/base.py
+++ b/consul/base.py
@@ -70,6 +70,9 @@ class Consul(object):
that support the consistency option. It's still possible to override
this by passing explicitly for a given request. *consistency* can be
either 'default', 'consistent' or 'stale'.
+
+ *dc* is the datacenter that this agent will communicate with.
+ By default the datacenter of the host is used.
"""
# TODO: Event, Status | added comment for Consul class dc param | cablehead_python-consul | train | py |
8c513f1b884e3175ff396a819a0e1389df080b0b | diff --git a/options.go b/options.go
index <HASH>..<HASH> 100644
--- a/options.go
+++ b/options.go
@@ -85,12 +85,12 @@ func (opt *Options) init() {
}
if opt.Dialer == nil {
opt.Dialer = func() (net.Conn, error) {
- conn, err := net.DialTimeout(opt.Network, opt.Addr, opt.DialTimeout)
- if opt.TLSConfig == nil || err != nil {
- return conn, err
+ netDialer := &net.Dialer{Timeout: opt.DialTimeout}
+ if opt.TLSConfig == nil {
+ return netDialer.Dial(opt.Network, opt.Addr)
+ } else {
+ return tls.DialWithDialer(netDialer, opt.Network, opt.Addr, opt.TLSConfig)
}
- t := tls.Client(conn, opt.TLSConfig)
- return t, t.Handshake()
}
}
if opt.PoolSize == 0 { | Estab TLS connections + Handshake should respect DialTimeout | go-redis_redis | train | go |
a0e086b71b84c4a9e67d2d10df5fe89c980d365a | diff --git a/test/timeout.js b/test/timeout.js
index <HASH>..<HASH> 100644
--- a/test/timeout.js
+++ b/test/timeout.js
@@ -54,7 +54,7 @@ describe("timeout", function () {
triggered = false;
var id = handlers.setTimeout(function () {
callback(id);
- }, 10);
+ }, 20);
timeoutId = id;
synchronousFlag = true;
});
@@ -130,7 +130,7 @@ describe("timeout", function () {
beforeEach(function () {
var id = handlers.setTimeout(function () {
fasterCallback(id);
- }, 0);
+ }, 10);
fasterTimeoutId = id;
}); | Sometimes tests were failing
This lowers the coverage, I need to find why | ArnaudBuchholz_gpf-js | train | js |
c00572127643eb034bb28c28033ed64ad8c267b4 | diff --git a/warc/__init__.py b/warc/__init__.py
index <HASH>..<HASH> 100644
--- a/warc/__init__.py
+++ b/warc/__init__.py
@@ -16,6 +16,7 @@ import gzip
from cStringIO import StringIO
from .utils import CaseInsensitiveDict
+from .arc import ARCFile
class WARCHeader(CaseInsensitiveDict):
"""The WARC Header object represents the headers of a WARC record.
@@ -235,11 +236,34 @@ class WARCFile:
def close(self):
self.fileobj.close()
+
+def detect_format(filename):
+ """Tries to figure out the type of the file. Return 'warc' for
+ WARC files and 'arc' for ARC files"""
+
+ if ".arc" in filename:
+ return "arc"
+ if ".warc" in filename:
+ return "warc"
+
+ return "unknown"
-def open(filename, mode="rb"):
+def open(filename, mode="rb", format = None):
"""Shorthand for WARCFile(filename, mode).
+
+ Auto detects file and opens it.
+
"""
- return WARCFile(filename, mode)
+ if format == "auto":
+ format = detect_format(filename)
+
+ if format == "warc":
+ return WARCFile(filename, mode)
+ elif format == "arc":
+ return ARCFile(filename, mode)
+ else:
+ raise IOError("Don't know how to open '%s' files"%format)
+
class WARCReader:
RE_VERSION = re.compile("WARC/(\d+.\d+)\r\n") | Added rudimentary auto detection | internetarchive_warc | train | py |
823cb85df01249cbda66f9b753e8996d548a1787 | diff --git a/src/ContaoCommunityAlliance/DcGeneral/Controller/DefaultController.php b/src/ContaoCommunityAlliance/DcGeneral/Controller/DefaultController.php
index <HASH>..<HASH> 100644
--- a/src/ContaoCommunityAlliance/DcGeneral/Controller/DefaultController.php
+++ b/src/ContaoCommunityAlliance/DcGeneral/Controller/DefaultController.php
@@ -292,7 +292,7 @@ class DefaultController implements ControllerInterface
if ($backendViewDefinition && $backendViewDefinition instanceof Contao2BackendViewDefinitionInterface)
{
$listingConfig = $backendViewDefinition->getListingConfig();
- $sortingProperties = array_keys($listingConfig->getDefaultSortingFields());
+ $sortingProperties = array_keys((array)$listingConfig->getDefaultSortingFields());
$sortingPropertyIndex = array_search($sortingProperty, $sortingProperties);
if ($sortingPropertyIndex !== false && $sortingPropertyIndex > 0) | Force sorting fields to be an array. | contao-community-alliance_dc-general | train | php |
860b178408ac6083a91c6ff5e6eecd08a2a086c3 | diff --git a/meter/src/main/java/com/ning/billing/meter/timeline/persistent/DefaultTimelineDao.java b/meter/src/main/java/com/ning/billing/meter/timeline/persistent/DefaultTimelineDao.java
index <HASH>..<HASH> 100644
--- a/meter/src/main/java/com/ning/billing/meter/timeline/persistent/DefaultTimelineDao.java
+++ b/meter/src/main/java/com/ning/billing/meter/timeline/persistent/DefaultTimelineDao.java
@@ -167,6 +167,10 @@ public class DefaultTimelineDao implements TimelineDao {
final DateTime endTime,
final TimelineChunkConsumer chunkConsumer,
final InternalTenantContext context) {
+ if (sourceIdList.size() == 0) {
+ return;
+ }
+
dbi.withHandle(new HandleCallback<Void>() {
@Override
public Void withHandle(final Handle handle) throws Exception { | meter: bail early if no source is supplied in DefaultTimelineDao | killbill_killbill | train | java |
2f6d53d840cf373606891fc8008489fb04091194 | diff --git a/src/Structure.php b/src/Structure.php
index <HASH>..<HASH> 100644
--- a/src/Structure.php
+++ b/src/Structure.php
@@ -203,7 +203,7 @@ class Structure
*/
public function getData()
{
- foreach ($this->data as $key => $value) {
+ foreach ($this->data as $value) {
$this->validateDefinitions($value);
}
return $this->data;
@@ -314,6 +314,15 @@ class Structure
}
/**
+ * Get structure version for compatibility.
+ * @return int
+ */
+ public function getVersion()
+ {
+ return 3;
+ }
+
+ /**
* Return a legacy type for the given node.
* @param NodePath $nodePath
* @return string
@@ -420,7 +429,7 @@ class Structure
public function load(array $definitions)
{
$this->data = $definitions;
- foreach ($definitions as $key => $value) {
+ foreach ($definitions as $value) {
$this->validateDefinitions($value);
}
} | fix: cs issues
feat: add version method | keboola_php-jsonparser | train | php |
136ab3e5842e613814990e3babb60eaaa4552eff | diff --git a/lib/plugins/multipart_parser.js b/lib/plugins/multipart_parser.js
index <HASH>..<HASH> 100644
--- a/lib/plugins/multipart_parser.js
+++ b/lib/plugins/multipart_parser.js
@@ -40,6 +40,17 @@ function multipartBodyParser(options) {
if (options.uploadDir)
form.uploadDir = options.uploadDir;
+ form.onPart = function(part) {
+ if (part.filename && !options.multipartFileHandler)
+ form.handlePart(part);
+ else if (part.filename && options.multipartFileHandler)
+ options.multipartFileHandler(part);
+ else if (!part.filename && !options.multipartHandler)
+ form.handlePart(part);
+ else if (!part.filename && options.multipartHandler)
+ options.multipartHandler(part);
+ };
+
form.parse(req, function (err, fields, files) {
if (err)
return (next(new BadRequestError(err.message))); | Allow custom handling of multipart data.
Multipart is often used to upload files or large chunks of data.
It is not always desired to have this stored in memory, or even
on disk (for instance if processing can be done during the data
is transferred). Add two custom handlers for the multipart parts. | restify_plugins | train | js |
357cff45fe7fced64ff6fc0ee66ce1f11e7696c2 | diff --git a/scipy_data_fitting/fit.py b/scipy_data_fitting/fit.py
index <HASH>..<HASH> 100644
--- a/scipy_data_fitting/fit.py
+++ b/scipy_data_fitting/fit.py
@@ -192,11 +192,14 @@ class Fit:
Other keys can be added freely and will be available
as metadata for the various output formats.
+ Defaults to `{}`.
+
Example:
#!python
{'symbol': 'V', 'name': 'Voltage', 'prefix': 'kilo', 'units': 'kV'}
"""
+ if not hasattr(self, '_dependent'): self._dependent = {}
return self._dependent
@dependent.setter | Added default to Fit.dependent. | razor-x_scipy-data_fitting | train | py |
1954861668f0dd71ea141afa05aeabce1d4d0578 | diff --git a/discord/role.py b/discord/role.py
index <HASH>..<HASH> 100644
--- a/discord/role.py
+++ b/discord/role.py
@@ -139,6 +139,15 @@ class Role(Hashable):
position: :class:`int`
The position of the role. This number is usually positive. The bottom
role has a position of 0.
+
+ .. warning::
+
+ Multiple roles can have the same position number. As a consequence
+ of this, comparing via role position is prone to subtle bugs if
+ checking for role hierarchy. The recommended and correct way to
+ compare for roles in the hierarchy is using the comparison
+ operators on the role objects themselves.
+
managed: :class:`bool`
Indicates if the role is managed by the guild through some form of
integrations such as Twitch. | Add warning for comparing with role positioning | Rapptz_discord.py | train | py |
a7af0ed4b8d2710b92395b241cb891cf24ca03e2 | diff --git a/packages/components/bolt-video/src/video.standalone.js b/packages/components/bolt-video/src/video.standalone.js
index <HASH>..<HASH> 100644
--- a/packages/components/bolt-video/src/video.standalone.js
+++ b/packages/components/bolt-video/src/video.standalone.js
@@ -599,28 +599,11 @@ class BoltVideo extends withPreact {
}
this.hasInitialized = true;
-
- if (this.offsetHeight) {
- // Set flag so that video will not be re-initialized unnecessarily on update()
- this.removeAttribute('will-update', '');
- } else {
- // If not visible, add attribute so that it can be found by other components and updated manually.
- this.setAttribute('will-update', '');
- }
} catch (error) {
console.log(error);
}
}
- update() {
- // Brightcove doesn't have a simple "reset/update" method that I could find, so we must dispose and reinit
- if (this.player) {
- this.player.dispose();
- this.hasInitialized = false;
- this.triggerUpdate();
- }
- }
-
rendered() {
super.rendered && super.rendered(); | fix: remove original fix for loading hidden videos, not necessary anymore, actually causing new bug | bolt-design-system_bolt | train | js |
4bc3f0e9f9e2930db917bb38ddab524331a8008e | diff --git a/packages/material-ui/src/LinearProgress/LinearProgress.js b/packages/material-ui/src/LinearProgress/LinearProgress.js
index <HASH>..<HASH> 100644
--- a/packages/material-ui/src/LinearProgress/LinearProgress.js
+++ b/packages/material-ui/src/LinearProgress/LinearProgress.js
@@ -192,7 +192,7 @@ function LinearProgress(props) {
[classes.barColorSecondary]: color === 'secondary' && variant !== 'buffer',
[classes.colorSecondary]: color === 'secondary' && variant === 'buffer',
[classes.bar2Indeterminate]: variant === 'indeterminate' || variant === 'query',
- [classes.bar1Determinate]: variant === 'determinate',
+ [classes.bar2Determinate]: variant === 'determinate',
[classes.bar2Buffer]: variant === 'buffer',
});
const rootProps = {}; | [LinearProgress] Fix wrong style rule usage (#<I>) | mui-org_material-ui | train | js |
7942f14b295b035486cfa491b27fb08b2f56fd7c | diff --git a/src/services/Router.php b/src/services/Router.php
index <HASH>..<HASH> 100644
--- a/src/services/Router.php
+++ b/src/services/Router.php
@@ -80,7 +80,8 @@ class Router
// scan
foreach ($this->paths as $name => $path)
{
- $scanner = new Scanner(base_path($path), $this->route . $name . '/');
+ $root = strpos($path, '/') === 0 ? $path : base_path($path);
+ $scanner = new Scanner($root, $this->route . $name . '/');
$scanner->start();
$this->routes = array_merge($this->routes, $scanner->routes);
$this->controllers = array_merge($this->controllers, $scanner->controllers);
diff --git a/src/services/Sketchpad.php b/src/services/Sketchpad.php
index <HASH>..<HASH> 100644
--- a/src/services/Sketchpad.php
+++ b/src/services/Sketchpad.php
@@ -106,7 +106,7 @@ class Sketchpad
// build the index page
$data = $this->getVariables();
- $data['app'] = file_get_contents(base_path('vendor/davestewart/sketchpad/resources/views/vue/app.vue'));
+ $data['app'] = vue('sketchpad::vue.app');
$data['data'] =
[
'controllers' => $this->router->getControllers(), | Minor updates to handle absolute controller folder paths | davestewart_laravel-sketchpad | train | php,php |
d63b29cfdd6d666fb6475cd2362c21c96a931ac8 | diff --git a/src/python/pants/option/global_options.py b/src/python/pants/option/global_options.py
index <HASH>..<HASH> 100644
--- a/src/python/pants/option/global_options.py
+++ b/src/python/pants/option/global_options.py
@@ -572,7 +572,11 @@ class GlobalOptions(Subsystem):
"--print-exception-stacktrace",
advanced=True,
type=bool,
- fingerprint=False,
+ default=False,
+ # TODO: We must restart the daemon because of global mutable state in `init/logging.py`
+ # from `ExceptionSink.should_print_exception_stacktrace`. Fix this and only use
+ # `fingerprint=True` instead.
+ daemon=True,
help="Print to console the full exception stack trace if encountered.",
) | Fix `--print-exception-stacktrace` not invalidating pantsd (#<I>)
Before, if a command failed and you run it again with `--print-exception-stacktrace`, it would make no difference because the daemon's cache was being used.
Now, we force pantsd to restart so that the option works properly.
[ci skip-rust-tests] | pantsbuild_pants | train | py |
d27c08ea307ee92e59e41fa1f4f3eb5d54997331 | diff --git a/bids/grabbids/bids_layout.py b/bids/grabbids/bids_layout.py
index <HASH>..<HASH> 100644
--- a/bids/grabbids/bids_layout.py
+++ b/bids/grabbids/bids_layout.py
@@ -62,7 +62,11 @@ class BIDSLayout(Layout):
"BIDS project." % path)
if not type:
- # Constrain the search to .json files with the same type as target
+ if 'type' not in self.files[path].entities:
+ raise ValueError(
+ "File '%s' does not have a valid type definition, most "
+ "likely because it is not a valid BIDS file." % path
+ )
type = self.files[path].entities['type']
tmp = self.get_nearest(path, extensions=extension, all_=True, | more informative failure in get_nearest_helper; fixes #<I> | bids-standard_pybids | train | py |
bdad86b6dd313e509c31d17103fb98b3b1bef981 | diff --git a/packages/react-pdf/src/renderer.js b/packages/react-pdf/src/renderer.js
index <HASH>..<HASH> 100644
--- a/packages/react-pdf/src/renderer.js
+++ b/packages/react-pdf/src/renderer.js
@@ -91,7 +91,9 @@ const PDFRenderer = ReactFiberReconciler({
},
removeChildFromContainer(parentInstance, child) {
- parentInstance.removeChild(child);
+ if (parentInstance.removeChild) {
+ parentInstance.removeChild(child);
+ }
},
commitTextUpdate(textInstance, oldText, newText) { | Protect against parentInstance not being a node when unmounting [fixes #<I>] (#<I>) | diegomura_react-pdf | train | js |
cbeeeb68c04638ca0768c94ef6cb1ddd9343b3a3 | diff --git a/IndexedRedis/fields/b64.py b/IndexedRedis/fields/b64.py
index <HASH>..<HASH> 100644
--- a/IndexedRedis/fields/b64.py
+++ b/IndexedRedis/fields/b64.py
@@ -19,6 +19,11 @@ except NameError:
class IRBase64Field(IRField):
'''
IRBase64Field - Encode/Decode data automatically into base64 for storage and from for retrieval.
+
+ Data will be found on the object in bytes format (right after assignment, after fetching, etc). To convert to another format,
+ use an IRFieldChain.
+
+ Like, use it with an IRUnicodeField as the far left to have it be a utf-16 value, or use IRField(valueType=str) for a string, or IRField(valueType=int) for int, etc.
'''
CAN_INDEX = False
@@ -45,7 +50,7 @@ class IRBase64Field(IRField):
return b64decode(tobytes(value, self.encoding))
def _fromInput(self, value):
- return value
+ return tobytes(value, self.encoding)
def _toStorage(self, value):
if isEmptyString(value): | Ensure the value on Base<I> field is ALWAYS bytes (not just after fetch from storage). Add a note, and suggest using IRFieldChain to PROPERLY have value be other types. | kata198_indexedredis | train | py |
c6f0d96cb006fc9692cd5ed90d1856e10bafe15f | diff --git a/jira/client.py b/jira/client.py
index <HASH>..<HASH> 100755
--- a/jira/client.py
+++ b/jira/client.py
@@ -402,7 +402,7 @@ class JIRA(object):
)
m = file_stream()
r = self._session.post(
- url, data=m, headers=CaseInsensitiveDict({'content-type': m.content_type}), retry_data=file_stream)
+ url, data=m, headers=CaseInsensitiveDict({'content-type': m.content_type, 'X-Atlassian-Token': 'nocheck'}), retry_data=file_stream)
attachment = Attachment(self._options, self._session, json_loads(r)[0])
if attachment.size == 0: | fix atlassian header
It was not possible to attach files when the request-toolbelt was installed, because the headers was missing in the else part. | pycontribs_jira | train | py |
60cb32c2f4504b19c1b78e68f0e13c32b6b45a4c | diff --git a/tasks/lib/wrapper/dependency.js b/tasks/lib/wrapper/dependency.js
index <HASH>..<HASH> 100644
--- a/tasks/lib/wrapper/dependency.js
+++ b/tasks/lib/wrapper/dependency.js
@@ -604,11 +604,13 @@ Object.defineProperty($rootClassProto.prototype, 'abstract', $descriptor);
* @function throwError
* @param {String} message
* @param {String} type
+ * @param {Number} index
* @api public
*/
-$descriptor.value = function (message, type) {
- throwError(message, type);
+$descriptor.value = function (message, type, index) {
+ // Increment index by one to ignore this method in error stack.
+ throwError(message, type, index + 1);
};
Object.defineProperty($rootClassProto.prototype, 'throwError', $descriptor); | {Update: dependency.js} Include index param in CLASS throwError method. | jeanamarante_catena | train | js |
249b9bf8bef821e3c7c0c433b4579d0447577000 | diff --git a/system/src/Grav/Console/ClearCacheCommand.php b/system/src/Grav/Console/ClearCacheCommand.php
index <HASH>..<HASH> 100644
--- a/system/src/Grav/Console/ClearCacheCommand.php
+++ b/system/src/Grav/Console/ClearCacheCommand.php
@@ -12,7 +12,8 @@ use \Symfony\Component\Yaml\Yaml;
class ClearCacheCommand extends Command {
protected $paths_to_remove = [
- 'cache'
+ 'cache',
+ 'images'
];
protected function configure() {
@@ -44,6 +45,8 @@ class ClearCacheCommand extends Command {
$output->writeln('<magenta>Clearing cache</magenta>');
$output->writeln('');
+ $user_config = USER_DIR . 'config/system.yaml';
+
$anything = false;
foreach($this->paths_to_remove as $path) {
@@ -57,6 +60,13 @@ class ClearCacheCommand extends Command {
if ($anything) $output->writeln('<red>Cleared: </red>' . $path . '*');
}
+ if (file_exists($user_config)) {
+ touch ($user_config);
+ $output->writeln('');
+ $output->writeln('<red>Touched: </red>' . $user_config);
+ $output->writeln('');
+ }
+
if (!$anything) {
$output->writeln('<green>Nothing to clear...</green>');
$output->writeln(''); | Added images dir to list of folders to clear. Plus added 'touching' of system.yaml to trigger clearing of APC/XCache/WinCache etc. | getgrav_grav | train | php |
1776aa8b8bc6987d4da0f32b1fa2362feb5db086 | diff --git a/EinsteinVision/EinsteinVision.py b/EinsteinVision/EinsteinVision.py
index <HASH>..<HASH> 100644
--- a/EinsteinVision/EinsteinVision.py
+++ b/EinsteinVision/EinsteinVision.py
@@ -351,4 +351,4 @@ class EinsteinVisionService:
for line in result:
ff.write(line + '\n')
- ff.close()
+ ff.close()
\ No newline at end of file | Somehow the change markers got commited? | feliperyan_EinsteinVisionPython | train | py |
011c7cb0a28b8b517626749c4a73af13b538228d | diff --git a/ghost/members-api/lib/repositories/member.js b/ghost/members-api/lib/repositories/member.js
index <HASH>..<HASH> 100644
--- a/ghost/members-api/lib/repositories/member.js
+++ b/ghost/members-api/lib/repositories/member.js
@@ -317,6 +317,7 @@ module.exports = class MemberRepository {
'geolocation',
'products',
'newsletters',
+ 'enable_comment_notifications',
'last_seen_at'
]); | Added support for updating member enable_comment_notifications
refs <URL> | TryGhost_Ghost | train | js |
faff13634c588cefcf2eb96c97d4555af8886070 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -58,9 +58,9 @@ function openMainWindow () {
width: 1024,
height: 768,
titleBarStyle: 'hidden-inset',
- title: 'Ferment',
+ title: 'Patchwork',
show: true,
- backgroundColor: '#444',
+ backgroundColor: '#EEE',
webPreferences: {
experimentalFeatures: true
},
diff --git a/views/public-feed.js b/views/public-feed.js
index <HASH>..<HASH> 100644
--- a/views/public-feed.js
+++ b/views/public-feed.js
@@ -114,20 +114,19 @@ exports.screen_view = function (path, sbot) {
// )
return div
+ }
- // scoped
-
- function refresh () {
- pull(
- sbot_log({reverse: true, limit: 500, live: false}),
- pull.collect((err, values) => {
- if (err) throw err
- events.set(groupMessages(values))
- sync.set(true)
- updates.set(0)
- })
- )
- }
+ // scoped
+ function refresh () {
+ pull(
+ sbot_log({reverse: true, limit: 500, live: false}),
+ pull.collect((err, values) => {
+ if (err) throw err
+ events.set(groupMessages(values))
+ sync.set(true)
+ updates.set(0)
+ })
+ )
}
} | fix window title, background color, etc | ssbc_patchwork | train | js,js |
e452fdf041f8713182396b2d7fcb349e98b930dd | diff --git a/src/sos/step_executor.py b/src/sos/step_executor.py
index <HASH>..<HASH> 100755
--- a/src/sos/step_executor.py
+++ b/src/sos/step_executor.py
@@ -1693,12 +1693,14 @@ class Base_Step_Executor:
matched = validate_step_sig(sig)
skip_index = bool(matched)
if skip_index:
- self.skip_substep()
# matched["output"] might hav vars not defined in "output" #1355
+ env.sos_dict.set('_output', matched["output"])
self.output_groups[idx] = matched["output"]
if 'vars' in matched:
self.shared_vars[idx].update(
matched["vars"])
+ self.skip_substep()
+
break
try:
if self.concurrent_substep: | Fix retrieval of _output vars from signature #<I> | vatlab_SoS | train | py |
c517125ea169f081202ca1639521d7f7732e66b0 | diff --git a/agent.go b/agent.go
index <HASH>..<HASH> 100644
--- a/agent.go
+++ b/agent.go
@@ -79,9 +79,6 @@ type sandbox struct {
sync.RWMutex
id string
- running bool
- noPivotRoot bool
- enableGrpcTrace bool
containers map[string]*container
channel channel
network network
@@ -94,6 +91,9 @@ type sandbox struct {
deviceWatchers map[string](chan string)
sharedUTSNs namespace
sharedIPCNs namespace
+ running bool
+ noPivotRoot bool
+ enableGrpcTrace bool
sandboxPidNs bool
} | ci: Refactor to pass metalinter checks
Refactor for struct checks. | kata-containers_agent | train | go |
e47df82cf828828c07e5c56675d3591dc08496a6 | diff --git a/src/main/java/com/turn/ttorrent/client/network/HandshakeReceiver.java b/src/main/java/com/turn/ttorrent/client/network/HandshakeReceiver.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/turn/ttorrent/client/network/HandshakeReceiver.java
+++ b/src/main/java/com/turn/ttorrent/client/network/HandshakeReceiver.java
@@ -74,8 +74,8 @@ public class HandshakeReceiver implements DataProcessor {
ConnectionUtils.sendHandshake(socketChannel, hs.getInfoHash(), peersStorageFactory.getPeersStorage().getSelf().getPeerIdArray());
SharedTorrent torrent = torrentsStorageFactory.getTorrentsStorage().getTorrent(hs.getHexInfoHash());
SharingPeer sharingPeer = new SharingPeer(peer.getIp(), peer.getPort(), peer.getPeerId(), torrent);
- sharingPeer.bind(socketChannel, true);
sharingPeer.register(torrent);
+ sharingPeer.bind(socketChannel, true);
peersStorageFactory.getPeersStorage().addSharingPeer(peer, sharingPeer);
return new WorkingReceiver(this.uid, peersStorageFactory, torrentsStorageFactory);
} | fixed error that channel for file was not opened because torrent register as listener after bind socket to peer | mpetazzoni_ttorrent | train | java |
b26cfa54977cb81e68dba47f6ebf3add2883236a | diff --git a/ci/run_apex_tests.py b/ci/run_apex_tests.py
index <HASH>..<HASH> 100644
--- a/ci/run_apex_tests.py
+++ b/ci/run_apex_tests.py
@@ -287,7 +287,7 @@ def run_tests():
'Callout': 'Info',
'Database': 'Info',
'ExpirationDate': expiration.isoformat(),
- 'ScopeId': user_id,
+ #'ScopeId': user_id,
'System': 'Info',
'TracedEntityId': user_id,
'Validation': 'Info', | Change to ScopeId = null on the user specific TraceFlag to hopefully get
beyond the limit of <I> logs | SFDO-Tooling_CumulusCI | train | py |
81445d82b556f1f0f3a03aa002010f566f566bfb | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -1,6 +1,8 @@
$LOAD_PATH.unshift File.expand_path('../../lib', __FILE__)
require 'sheetsu'
require 'webmock/rspec'
+require 'codeclimate-test-reporter'
+CodeClimate::TestReporter.start
WebMock.disable_net_connect!(allow_localhost: true)
RSpec.configure do |config| | start Code Climate test reporter when spec run
to send current test coverage to Code Climate | williamn_sheetsu | train | rb |
38e4aed0b69d5e9aad4061fd037a0d5ab4b32f1b | diff --git a/Infra/Security/SecurityUser.php b/Infra/Security/SecurityUser.php
index <HASH>..<HASH> 100644
--- a/Infra/Security/SecurityUser.php
+++ b/Infra/Security/SecurityUser.php
@@ -23,7 +23,7 @@ use Symfony\Component\Security\Core\User\UserInterface;
/**
* @author Roland Franssen <[email protected]>
*/
-final class SecurityUser implements UserInterface, EquatableInterface, \Serializable
+final class SecurityUser implements UserInterface, EquatableInterface
{
/**
* @var UserIdInterface
@@ -118,14 +118,4 @@ final class SecurityUser implements UserInterface, EquatableInterface, \Serializ
{
return $user instanceof self && $user->getUserId()->equals($this->id);
}
-
- public function serialize(): string
- {
- return serialize([$this->id, $this->originUsername, $this->roles, $this->password, $this->passwordSalt]);
- }
-
- public function unserialize($serialized): void
- {
- [$this->id, $this->originUsername, $this->roles, $this->password, $this->passwordSalt] = unserialize($serialized);
- }
} | cleanup serialization (#<I>) | msgphp_user | train | php |
a42943d50587cb6c4e2ee5a720e8e8949190a1aa | diff --git a/src/Http/Middleware/RefreshToken.php b/src/Http/Middleware/RefreshToken.php
index <HASH>..<HASH> 100644
--- a/src/Http/Middleware/RefreshToken.php
+++ b/src/Http/Middleware/RefreshToken.php
@@ -34,7 +34,7 @@ class RefreshToken extends BaseMiddleware
try {
$token = $this->auth->parseToken()->refresh();
} catch (JWTException $e) {
- throw new UnauthorizedHttpException('jwt-auth', $e->getMessage());
+ throw new UnauthorizedHttpException('jwt-auth', $e->getMessage(), $e, $e->getCode());
}
$response = $next($request); | Pass the previous exception along when refreshing token | tymondesigns_jwt-auth | train | php |
426a38985a7bef76b190ad3717c9855911b86662 | diff --git a/lib/util/javascript-hint.js b/lib/util/javascript-hint.js
index <HASH>..<HASH> 100644
--- a/lib/util/javascript-hint.js
+++ b/lib/util/javascript-hint.js
@@ -127,8 +127,9 @@
}
else {
// If not, just look in the window object and any local scope
- // (reading into JS mode internals to get at the local variables)
+ // (reading into JS mode internals to get at the local and global variables)
for (var v = token.state.localVars; v; v = v.next) maybeAdd(v.name);
+ for (var v = token.state.globalVars; v; v = v.next) maybeAdd(v.name);
gatherCompletions(window);
forEach(keywords, maybeAdd);
} | use globals as well as locals in hinting | codemirror_CodeMirror | train | js |
e9f3e715ddddb119ac6788f5c397fbe5424a5825 | diff --git a/lib/moodlelib.php b/lib/moodlelib.php
index <HASH>..<HASH> 100644
--- a/lib/moodlelib.php
+++ b/lib/moodlelib.php
@@ -1331,6 +1331,7 @@ function clean_filename($string) {
$string = stripslashes($string);
$string = eregi_replace("\.\.", "", $string);
$string = eregi_replace("[^(-|[:alnum:]|\.)]", "_", $string);
+ $string = eregi_replace(",", "_", $string);
return eregi_replace("_+", "_", $string);
} | Add one more eregi_replace, because the 'alnum' allows the
comma char and it can cause some problems in filenames.
Off-topic: This is my 1st commit with my new eMac !! My old iMac screen
died two days ago... :-( but I've recovered everything :-) | moodle_moodle | train | php |
0cebccbd55ccec55b52f7d82dcb0694fabc5e397 | diff --git a/grimoire_elk/enriched/github.py b/grimoire_elk/enriched/github.py
index <HASH>..<HASH> 100644
--- a/grimoire_elk/enriched/github.py
+++ b/grimoire_elk/enriched/github.py
@@ -84,6 +84,7 @@ class GitHubEnrich(Enrich):
issue_roles = ['assignee_data', 'user_data']
pr_roles = ['merged_by_data', 'user_data']
+ roles = ['assignee_data', 'merged_by_data', 'user_data']
def __init__(self, db_sortinghat=None, db_projects_map=None, json_projects_map=None,
db_user='', db_password='', db_host=''): | [enriched-github] Set roles to allow refresh identities
This code sets the variables roles to merged_by_data,
user_data, assignee_data, thus allowing the refresh
of sortinghat information for the corresponding
identities. | chaoss_grimoirelab-elk | train | py |
67d9ca92fadd19195775b6f6410ebeffc796a0df | diff --git a/lib/middleware/pre_fetch.js b/lib/middleware/pre_fetch.js
index <HASH>..<HASH> 100644
--- a/lib/middleware/pre_fetch.js
+++ b/lib/middleware/pre_fetch.js
@@ -66,7 +66,9 @@ function readFromStream(options, request, fileName, urlPath) {
.map(pathFinder)
)
.then(
- () => createRemoteReadStream(request, urlPath),
+ () =>
+ createRemoteReadStream(request, urlPath)
+ .catch((err) => options.verbose.proxy ? console.error(urlPath, err) : ''),
(localFile) => fs.createReadStream(localFile)
)
]); | show remote stream fetch errors if proxy logging is active | Open-Xchange-Frontend_appserver | train | js |
04dc51d7b6669d8ce0182a0f68eea41566d2e45b | diff --git a/src/MessageBird/Resources/Conversation/Messages.php b/src/MessageBird/Resources/Conversation/Messages.php
index <HASH>..<HASH> 100644
--- a/src/MessageBird/Resources/Conversation/Messages.php
+++ b/src/MessageBird/Resources/Conversation/Messages.php
@@ -158,8 +158,10 @@ class Messages
return $this->object->loadFromArray($body);
}
+ $responseError = new ResponseError($body);
+
throw new RequestException(
- (new ResponseError($body))->getErrorString()
+ $responseError->getErrorString()
);
}
} | Remove object operator for PHP<I> support | messagebird_php-rest-api | train | php |
49e056b6aa1ac5fd092a74692821c29093100836 | diff --git a/openquake/server/tests/tests.py b/openquake/server/tests/tests.py
index <HASH>..<HASH> 100644
--- a/openquake/server/tests/tests.py
+++ b/openquake/server/tests/tests.py
@@ -54,9 +54,7 @@ class EngineServerTestCase(unittest.TestCase):
def get(cls, path, **data):
resp = cls.c.get('/v1/calc/%s' % path, data,
HTTP_HOST='127.0.0.1')
- if not resp.content:
- sys.stderr.write(open(cls.errfname).read())
- return {}
+ assert resp.content
try:
return json.loads(resp.content.decode('utf8'))
except:
@@ -104,14 +102,11 @@ class EngineServerTestCase(unittest.TestCase):
# let's impersonate the user openquake, the one running the WebUI:
# we need to set LOGNAME on Linux and USERNAME on Windows
env['LOGNAME'] = env['USERNAME'] = 'openquake'
- cls.fd, cls.errfname = tempfile.mkstemp(prefix='webui')
- print('Errors saved in %s' % cls.errfname, file=sys.stderr)
cls.c = Client()
@classmethod
def tearDownClass(cls):
cls.wait()
- os.close(cls.fd)
def setUp(self):
if sys.version_info[0] == 2: | Cleanup [skip CI] | gem_oq-engine | train | py |
c5b3337909c85d1c7fb62d3e3a0b51009156ac69 | diff --git a/package.php b/package.php
index <HASH>..<HASH> 100644
--- a/package.php
+++ b/package.php
@@ -4,7 +4,7 @@
require_once 'PEAR/PackageFileManager2.php';
-$version = '1.4.54';
+$version = '1.4.55';
$notes = <<<EOT
No release notes for you!
EOT; | prepare for release of <I>
svn commit r<I> | silverorange_swat | train | php |
3af2377d676ad5a69834a59466ab6ffa87a22a06 | diff --git a/src/TestSuite/MiddlewareDispatcher.php b/src/TestSuite/MiddlewareDispatcher.php
index <HASH>..<HASH> 100644
--- a/src/TestSuite/MiddlewareDispatcher.php
+++ b/src/TestSuite/MiddlewareDispatcher.php
@@ -67,9 +67,6 @@ class MiddlewareDispatcher
);
$server = new Server($app);
-
- // TODO How to pass session data? PSR7 requests don't handle sessions..
- // TODO pass php://input stream, base, webroot
$psrRequest = ServerRequestFactory::fromGlobals(
array_merge($_SERVER, $request['environment'], ['REQUEST_URI' => $request['url']]),
$request['query'], | Remove TODOs
The base and webroot attributes are handled by the RequestTransformer.
I'm not convinced that php://input needs to be handled as the legacy
dispatcher doesn't do a great job of it either. | cakephp_cakephp | train | php |
ef245ac12e0988b5d5271195cc14ed254778f5c3 | diff --git a/lib/millstone.js b/lib/millstone.js
index <HASH>..<HASH> 100644
--- a/lib/millstone.js
+++ b/lib/millstone.js
@@ -419,12 +419,12 @@ function resolve(options, callback) {
break;
case '.geojson':
case '.json':
- case '.rss':
d.type = d.type || 'ogr';
d.layer_by_index = 0;
l.srs = SRS.WGS84;
break;
case '.kml':
+ case '.rss':
d.type = d.type || 'ogr';
d.layer_by_index = 0;
l.srs = SRS.WGS84; | Move RSS alongside KML.
No logical change, but preparing for when GeoJSON autodetection is
sorted out. Refs #<I>. | tilemill-project_millstone | train | js |
d63358ba136d6f2660200b80908056d848d61fa3 | diff --git a/lionengine-examples/src/main/java/com/b3dgs/lionengine/example/game/collision/PlayerController.java b/lionengine-examples/src/main/java/com/b3dgs/lionengine/example/game/collision/PlayerController.java
index <HASH>..<HASH> 100644
--- a/lionengine-examples/src/main/java/com/b3dgs/lionengine/example/game/collision/PlayerController.java
+++ b/lionengine-examples/src/main/java/com/b3dgs/lionengine/example/game/collision/PlayerController.java
@@ -29,6 +29,9 @@ import com.b3dgs.lionengine.io.awt.Keyboard;
*/
class PlayerController extends FeatureModel implements Refreshable
{
+ private static final double SPEED = 3;
+ private static final double JUMP = 8.0;
+
private final Force movement;
private final Force jump;
private final Keyboard keyboard;
@@ -52,15 +55,15 @@ class PlayerController extends FeatureModel implements Refreshable
movement.setDirection(Direction.ZERO);
if (keyboard.isPressed(Keyboard.LEFT))
{
- movement.setDirection(-2, 0);
+ movement.setDirection(-SPEED, 0);
}
if (keyboard.isPressed(Keyboard.RIGHT))
{
- movement.setDirection(2, 0);
+ movement.setDirection(SPEED, 0);
}
if (keyboard.isPressedOnce(Keyboard.UP))
{
- jump.setDirection(0.0, 8.0);
+ jump.setDirection(0.0, JUMP);
}
}
} | #<I>: Example player speed updated. | b3dgs_lionengine | train | java |
7abe57c4c4605d189492a68d9131834d9c629527 | diff --git a/python/setup.py b/python/setup.py
index <HASH>..<HASH> 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup, find_packages
print find_packages()
setup(name='xbos',
- version='0.0.30',
+ version='0.0.31',
description='Aggregate wrapper for XBOS services and devices',
url='https://github.com/SoftwareDefinedBuildings/XBOS',
author='Gabe Fierro',
@@ -11,9 +11,9 @@ setup(name='xbos',
data_files=[('xbos/services', ['xbos/services/data.capnp'])],
include_package_data=True,
install_requires=[
- 'docker==2.5.1',
- 'delorean==0.6.0',
- 'msgpack-python==0.4.2',
+ 'docker>=2.5.1',
+ 'delorean>=0.6.0',
+ 'msgpack-python>=0.4.2',
'bw2python>=0.6.1',
'requests>=2.12.2',
'python-dateutil>=2.4.2', | allow more recent versions in setup.py | SoftwareDefinedBuildings_XBOS | train | py |
9d9dc682cfb8b8df74c3ca19be9372de3111a655 | diff --git a/pymunin/plugins/memcachedstats.py b/pymunin/plugins/memcachedstats.py
index <HASH>..<HASH> 100755
--- a/pymunin/plugins/memcachedstats.py
+++ b/pymunin/plugins/memcachedstats.py
@@ -424,7 +424,7 @@ class MuninMemcachedPlugin(MuninPlugin):
('incr', 'incr_hits', 'incr_misses'),
('decr', 'decr_hits', 'decr_misses')
):
- val = float(100)
+ val = float(0)
if prev_stats:
if (stats.has_key(field_hits)
and prev_stats.has_key(field_hits) | Set hit percent to zero, when total is zero. | aouyar_PyMunin | train | py |
d79cb0df645e101b2cebe89cbdceb2047b21d19a | diff --git a/databasetools/sql.py b/databasetools/sql.py
index <HASH>..<HASH> 100644
--- a/databasetools/sql.py
+++ b/databasetools/sql.py
@@ -53,6 +53,10 @@ class MySQLTools:
if self.enable_printing:
print(err)
+ def select(self, table, cols):
+ # TODO: Write function to select from a table with constraints
+ pass
+
def select_all(self, table):
# Concatenate statement
statement = ("SELECT * FROM " + str(table))
@@ -64,8 +68,8 @@ class MySQLTools:
print('\tMySQL rows successfully queried')
return rows
- def select(self, table, cols):
- # TODO: Write function to select from a table with constraints
+ def select_all_join(self, table1, table2, key):
+ # TODO: Write function to run a select * left join query
pass
def insert(self, table, columns, values): | Added select_all_join method to create | mrstephenneal_databasetools | train | py |
36db34eecd2abc7cd3042f2188bc1749c45daa08 | diff --git a/src/Client.php b/src/Client.php
index <HASH>..<HASH> 100644
--- a/src/Client.php
+++ b/src/Client.php
@@ -37,7 +37,7 @@ class VGS_Client {
/**
* SDK Version.
*/
- const VERSION = '2.4';
+ const VERSION = '2.4.1';
/**
* Oauth Token URL
@@ -66,8 +66,7 @@ class VGS_Client {
CURLOPT_SSL_VERIFYPEER => true,
CURLOPT_SSL_VERIFYHOST => 2,
CURLOPT_DNS_CACHE_TIMEOUT => 0,
- CURLOPT_TIMEOUT => 30,
- CURLOPT_USERAGENT => 'spid-php-2.4'
+ CURLOPT_TIMEOUT => 30
);
/**
@@ -1092,6 +1091,7 @@ class VGS_Client {
$ch = curl_init();
}
$opts = self::$CURL_OPTS;
+ $opts[CURLOPT_USERAGENT] = "spid-php-" . self::VERSION;
if ($this->useFileUploadSupport()) {
$opts[CURLOPT_POSTFIELDS] = $params;
} else { | Moved user agent option to make request, to use constant VERSION | schibsted_sdk-php | train | php |
141127962dcc895509e74e98f5d82f47bb4539ca | diff --git a/lib/ydim/invoice.rb b/lib/ydim/invoice.rb
index <HASH>..<HASH> 100644
--- a/lib/ydim/invoice.rb
+++ b/lib/ydim/invoice.rb
@@ -1,5 +1,7 @@
#!/usr/bin/env ruby
-# Invoice -- ydim -- 11.01.2006 -- [email protected]
+# encoding: utf-8
+# YDIM::Invoice -- ydim -- 12.12.2012 -- [email protected]
+# YDIM::Invoice -- ydim -- 11.01.2006 -- [email protected]
require 'pdfinvoice/config'
require 'pdfinvoice/invoice'
@@ -27,6 +29,9 @@ module YDIM
@items.inject(0.0) { |value, item| value + item.send(key) }
}
end
+ def date=(d)
+ @date = Date.new(d.year, d.month, d.day)
+ end
def initialize(unique_id)
@unique_id = unique_id
@items = [] | Debugged Date incompatibility between Ruby <I> and <I> in invoice.rb | zdavatz_ydim | train | rb |
d874b2693c75f6c0d680221314edc04f61b2e457 | diff --git a/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/runner/SessionDispatcherLeaderProcessTest.java b/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/runner/SessionDispatcherLeaderProcessTest.java
index <HASH>..<HASH> 100644
--- a/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/runner/SessionDispatcherLeaderProcessTest.java
+++ b/flink-runtime/src/test/java/org/apache/flink/runtime/dispatcher/runner/SessionDispatcherLeaderProcessTest.java
@@ -433,7 +433,7 @@ public class SessionDispatcherLeaderProcessTest {
jobGraphStore.removeJobGraph(JOB_GRAPH.getJobID());
dispatcherLeaderProcess.onRemovedJobGraph(JOB_GRAPH.getJobID());
- assertThat(terminateJobFuture).isCompletedWithValue(JOB_GRAPH.getJobID());
+ assertThat(terminateJobFuture.get()).isEqualTo(JOB_GRAPH.getJobID());
}
} | [hotfix][tests] Fix SessionDispatcherLeaderProcessTest.onRemovedJobGraph_terminatesRunningJob
Properly wait on the future completion for the assertion. | apache_flink | train | java |
5de3a09960a53d8c7263b73d429b03b471393aa2 | diff --git a/blocklist.js b/blocklist.js
index <HASH>..<HASH> 100644
--- a/blocklist.js
+++ b/blocklist.js
@@ -37,9 +37,8 @@ Watchlist.prototype.readData = function(){
});
}
-
-var domains = new Watchlist("domain-blocklist.txt"),
- keywords = new Watchlist("keyword-blocklist.txt");
+var domains = new Watchlist( __dirname + "/domain-blocklist.txt"),
+ keywords = new Watchlist( __dirname + "/keyword-blocklist.txt");
exports.urlAllowed = function(url){
if(typeof url == "string"){
@@ -79,4 +78,4 @@ exports.urlAllowed = function(url){
// if it's passed the above tests, than the url looks safe
console.log("url is safe");
return true;
-}
\ No newline at end of file
+} | tweaked blocklist file to use __dirname | nfriedly_node-unblocker | train | js |
ad7546769f0b1873146b1b72b5a546dfb904fad2 | diff --git a/generators/add-extension/index.js b/generators/add-extension/index.js
index <HASH>..<HASH> 100644
--- a/generators/add-extension/index.js
+++ b/generators/add-extension/index.js
@@ -45,8 +45,35 @@ class Generator extends Base {
this.composeWith(['phovea:_check-own-version', 'phovea:check-node-version']);
}
- prompting() {
- const type = this.config.get('type');
+ /**
+ * Find all plugins in the workspace by checking if they have a `.yo-rc.json file`.
+ * @returns {string} The name of the plugin directory
+ */
+ _findPluginsInWorkspace() {
+ const files = glob('*/.yo-rc.json', {
+ cwd: this.destinationPath()
+ });
+ return files.map(path.dirname);
+ }
+
+ /**
+ * Prompt the user to choose the application he would like to add the extension to when the generator is executed from the workspace.
+ */
+ _chooseApplication() {
+ return this.prompt([{
+ type: 'list',
+ name: 'plugin',
+ choices: this._findPluginsInWorkspace(),
+ message: 'Plugin/Application',
+ // default: 'web',
+ when: this._isWorkspace()
+ }]);
+ }
+
+
+ async prompting() {
+ const {plugin} = await this._chooseApplication();
+ this.cwd = plugin ? plugin + '/' : '';
const isHybridType = plugins.isTypeHybrid({type});
return this.prompt([{ | Prompt user to choose a plugin from the workspace
phovea/generator-phovea#<I> | phovea_generator-phovea | train | js |
d466d84be94d3a069168feacdd74ab16dacbe6bb | diff --git a/commands/example_circularqueue_test.go b/commands/example_circularqueue_test.go
index <HASH>..<HASH> 100644
--- a/commands/example_circularqueue_test.go
+++ b/commands/example_circularqueue_test.go
@@ -223,8 +223,8 @@ var cbCommands = &commands.ProtoCommands{
// Put(-1509199920) Get Put(967212411) Size Get Put(578995532) Size Get Size
// Get]
//
-// Though this is not the minimal possible combination of arguments, its already
-// quiet close.
+// Though this is not the minimal possible combination of command, its already
+// pretty close.
func Example_circularqueue() {
parameters := gopter.DefaultTestParameters()
parameters.Rng.Seed(1234) // Just for this example to generate reproducable results | Made the intentional bug a bit harder to find (addresses #5) | leanovate_gopter | train | go |
1fa99a553bb4f10c658cb080451a9e0d63213e7a | diff --git a/js/angular/services/foundation.core.js b/js/angular/services/foundation.core.js
index <HASH>..<HASH> 100644
--- a/js/angular/services/foundation.core.js
+++ b/js/angular/services/foundation.core.js
@@ -3,7 +3,6 @@
angular.module('foundation.core', ['foundation.core.animation'])
.service('FoundationApi', FoundationApi)
- .filter('prepareRoute', prepareRoute)
.factory('Utils', Utils)
;
@@ -97,7 +96,6 @@
function Utils() {
var utils = {};
- utils.prepareRoute = prepareRouteUtil;
utils.throttle = throttleUtil;
return utils; | Removed references to deprecated functions | zurb_foundation-apps | train | js |
3ab0b9ef27f5cf8adb1eb6f422d132625e2fd2ba | diff --git a/Framework/FileOrganiser.php b/Framework/FileOrganiser.php
index <HASH>..<HASH> 100644
--- a/Framework/FileOrganiser.php
+++ b/Framework/FileOrganiser.php
@@ -159,7 +159,9 @@ private function copyFiles($source, $dest, $recursive = true) {
}
$dh = opendir($source);
- @mkdir($dest, 0775, true);
+ if(!is_dir($dest)) {
+ mkdir($dest, 0775, true);
+ }
while(false !== ($name = readdir($dh)) ) {
if($name[0] == ".") {
diff --git a/Framework/Gt.php b/Framework/Gt.php
index <HASH>..<HASH> 100644
--- a/Framework/Gt.php
+++ b/Framework/Gt.php
@@ -10,7 +10,8 @@
* is done by the Dispatcher.
*/
public function __construct() {
- set_error_handler(array("ErrorHandler", "error"), E_ALL);
+ set_error_handler(array("ErrorHandler", "error"),
+ E_ALL & E_NOTICE & E_RECOVERABLE_ERROR);
$baseSuffix = "_Framework";
$appConfigClass = "App_Config"; | Closes #<I> - error handler function in place, ready to be extended for logging, extra handling, etc. | PhpGt_WebEngine | train | php,php |
457b6433fb726415cc015ef0a4b421f5ac00ff60 | diff --git a/src/sprite.js b/src/sprite.js
index <HASH>..<HASH> 100644
--- a/src/sprite.js
+++ b/src/sprite.js
@@ -53,6 +53,12 @@ Crafty.c("Sprite", {
* Uses a new location on the sprite map as its sprite.
*
* Values should be in tiles or cells (not pixels).
+ *
+ * @example
+ * ~~~
+ * Crafty.e("2D, DOM, Sprite")
+ * .sprite(0, 0, 2, 2);
+ * ~~~
*/
sprite: function(x,y,w,h) {
this.__coord = [x * this.__tile + this.__padding[0] + this.__trim[0],
@@ -75,6 +81,12 @@ Crafty.c("Sprite", {
* If the entity needs to be smaller than the tile size, use this method to crop it.
*
* The values should be in pixels rather than tiles.
+ *
+ * @example
+ * ~~~
+ * Crafty.e("2D, DOM, Sprite")
+ * .crop(40, 40, 22, 23);
+ * ~~~
*/
crop: function(x,y,w,h) {
var old = this._mbr || this.pos(); | added examples for sprite and crop in Sprite component | craftyjs_Crafty | train | js |
4b74de82c064ecb20327188bf3cbfd3dcfbe0c64 | diff --git a/tests/test_backends.py b/tests/test_backends.py
index <HASH>..<HASH> 100644
--- a/tests/test_backends.py
+++ b/tests/test_backends.py
@@ -38,7 +38,7 @@ from grimoire_elk.utils import get_connectors, get_elastic
CONFIG_FILE = 'tests.conf'
-NUMBER_BACKENDS = 28
+NUMBER_BACKENDS = 30
DB_SORTINGHAT = "test_sh"
DB_PROJECTS = "test_projects"
@@ -134,7 +134,8 @@ class TestBackends(unittest.TestCase):
load_identities(ocean_backend, enrich_backend)
enrich_count = enrich_backend.enrich_items(ocean_backend)
- logging.info("Total items enriched %i ", enrich_count)
+ if enrich_count is not None:
+ logging.info("Total items enriched %i ", enrich_count)
def test_enrich_sh(self):
"""Test enrich all sources with SortingHat""" | [tests] Support that the total number of enriched items is not returned | chaoss_grimoirelab-elk | train | py |
f53b61974a717177f705a1e39c4f9439e283ff58 | diff --git a/lib/omnibus/software.rb b/lib/omnibus/software.rb
index <HASH>..<HASH> 100644
--- a/lib/omnibus/software.rb
+++ b/lib/omnibus/software.rb
@@ -862,5 +862,9 @@ module Omnibus
def log_key
@log_key ||= "#{super}: #{name}"
end
+
+ def to_s
+ "#{name}[#{filepath}]"
+ end
end
end | Add to_s for software
Things rely on being able to print a software, so make its to_s useful | chef_omnibus | train | rb |
21cf8b1de8e11b0ff09f814bdb39786ba4ecfa7e | diff --git a/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java b/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java
+++ b/src/main/java/org/codehaus/groovy/control/ProcessingUnit.java
@@ -101,7 +101,10 @@ public abstract class ProcessingUnit {
// ClassLoaders should only be created inside a doPrivileged block in case
// this method is invoked by code that does not have security permissions.
this.classLoader = loader != null ? loader : AccessController.doPrivileged((PrivilegedAction<GroovyClassLoader>) () -> {
- ClassLoader parent = this.getClass().getClassLoader();
+ ClassLoader parent = Thread.currentThread().getContextClassLoader();
+ if (parent == null) {
+ parent = this.getClass().getClassLoader();
+ }
return new GroovyClassLoader(parent, getConfiguration());
});
} | GROOVY-<I>: trivial tweak for better backward compatibility | apache_groovy | train | java |
99e7c6382faaa883bc53db00f3a59525eec2f84a | diff --git a/bitrise/setup.go b/bitrise/setup.go
index <HASH>..<HASH> 100644
--- a/bitrise/setup.go
+++ b/bitrise/setup.go
@@ -9,8 +9,8 @@ import (
)
const (
- minEnvmanVersion = "0.9.9"
- minStepmanVersion = "0.9.16"
+ minEnvmanVersion = "0.9.10"
+ minStepmanVersion = "0.9.17"
)
// RunSetup ... | required envman and stepman version bumps | bitrise-io_bitrise | train | go |
e7ee8b8b8728b9039253d0d8b418068cb8b5ff5a | diff --git a/src/mediaelementplayer.js b/src/mediaelementplayer.js
index <HASH>..<HASH> 100644
--- a/src/mediaelementplayer.js
+++ b/src/mediaelementplayer.js
@@ -478,9 +478,19 @@
// removed byte/loaded
// changed over to W3C method, even through Chrome currently does this wrong.
- // TODO: account for a real array with multiple values
+ // need to account for a real array with multiple values
function setTimeLoaded(target) {
- if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
+ // Some broswers (e.g., FF3.6 and Safari 5) cannot calculate target.bufferered.end()
+ // to be anything other than 0. If the byte count is available we use this instead.
+ // Browsers that support the else if do not seem to have the bufferedBytes value and
+ // should skip to there. Tested in Safari 5, Webkit head, FF3.6, Chrome 6.
+ if (target && target.bytesTotal != undefined && target.bytesTotal > 0 && target.bufferedBytes != undefined) {
+ var percent = target.bufferedBytes / target.bytesTotal;
+
+ // update loaded bar
+ timeLoaded.width(timeTotal.width() * percent);
+ }
+ else if (target && target.buffered && target.buffered.length > 0 && target.buffered.end && target.duration) {
// calculate percentage
var percent = target.buffered.end(0) / target.duration; | The loaded bar was not working in several browsers because target.buffered.end() would not calculate anything other than a 0 value. Some browsers (e.g., Safari 5 and FF <I>) provide data for the byte count rather than the time count. So, provide both methods as an option for calculating the percent downloaded. | mediaelement_mediaelement | train | js |
aa233c31ea6184d1c88a80f5f9078114a324682a | diff --git a/aws/data_source_aws_eip.go b/aws/data_source_aws_eip.go
index <HASH>..<HASH> 100644
--- a/aws/data_source_aws_eip.go
+++ b/aws/data_source_aws_eip.go
@@ -8,6 +8,7 @@ import (
"github.com/aws/aws-sdk-go/aws"
"github.com/aws/aws-sdk-go/service/ec2"
"github.com/hashicorp/terraform-plugin-sdk/helper/schema"
+ "github.com/terraform-providers/terraform-provider-aws/aws/internal/keyvaluetags"
)
func dataSourceAwsEip() *schema.Resource {
@@ -145,7 +146,10 @@ func dataSourceAwsEipRead(d *schema.ResourceData, meta interface{}) error {
}
}
d.Set("public_ipv4_pool", eip.PublicIpv4Pool)
- d.Set("tags", tagsToMap(eip.Tags))
+
+ if err := d.Set("tags", keyvaluetags.Ec2KeyValueTags(eip.Tags).IgnoreAws().Map()); err != nil {
+ return fmt.Errorf("error setting tags: %s", err)
+ }
return nil
} | data-source/aws_eip: Refactor to use keyvaluetags package (#<I>) | terraform-providers_terraform-provider-aws | train | go |
1665bec46b840d3a0ff31cdb6b5ab776ece22c39 | diff --git a/libs/queries.js b/libs/queries.js
index <HASH>..<HASH> 100644
--- a/libs/queries.js
+++ b/libs/queries.js
@@ -40,11 +40,11 @@ var contains = function (params, query) {
coordinates = coordinates.map(parseFloat);
if (coordinates[0] < -180 || coordinates[0] > 180) {
- throw 'Invalid coordinates';
+ throw new Error('Invalid coordinates');
}
if (coordinates[1] < -90 || coordinates[1] > 90) {
- throw 'Invalid coordinates';
+ throw new Error('Invalid coordinates');
}
var shape = ejs.Shape('circle', coordinates).radius('1km');
@@ -54,7 +54,7 @@ var contains = function (params, query) {
.shape(shape));
return query;
} else {
- throw 'Invalid coordinates';
+ throw new Error('Invalid coordinates');
}
}; | user Error object for throwing errors | sat-utils_sat-api-lib | train | js |
89be437170bf5008e2be683da0ee0b4bebfc47f9 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -144,6 +144,11 @@ Web3ProviderEngine.prototype._startPolling = function(){
self._pollIntervalId = setInterval(function() {
self._fetchLatestBlock()
}, self._pollingInterval)
+
+ // Tell node that block polling shouldn't keep the process open.
+ if (self._pollIntervalId.unref) {
+ self._pollIntervalId.unref();
+ }
}
Web3ProviderEngine.prototype._stopPolling = function(){ | Don't keep node processes open for block polling. | MetaMask_web3-provider-engine | train | js |
63519b55f67e482b8f6f9892d8fb138e957cce9d | diff --git a/min/index.php b/min/index.php
index <HASH>..<HASH> 100644
--- a/min/index.php
+++ b/min/index.php
@@ -36,10 +36,10 @@ if (!empty($min_customConfigPaths)) {
}
// load config
-require $min_configPaths['config.php'] . '/config.php';
+require $min_configPaths['config.php'];
if (isset($_GET['test'])) {
- include $min_configPaths['config-test.php'] . '/config-test.php';
+ include $min_configPaths['config-test.php'];
}
require "$min_libPath/Minify/Loader.php";
@@ -79,7 +79,7 @@ if (preg_match('/&\\d/', $_SERVER['QUERY_STRING'])) {
}
if (isset($_GET['g'])) {
// well need groups config
- $min_serveOptions['minApp']['groups'] = (require $min_configPaths['groupsConfig.php'] . '/groupsConfig.php');
+ $min_serveOptions['minApp']['groups'] = (require $min_configPaths['groupsConfig.php']);
}
if (isset($_GET['f']) || isset($_GET['g'])) {
// serve! | Remove filenames from include statements. | mrclay_jsmin-php | train | php |
a52d1554a5fdc68433573967d34d2084e9480934 | diff --git a/src/main/java/org/fxmisc/wellbehaved/event/template/InputHandlerTemplate.java b/src/main/java/org/fxmisc/wellbehaved/event/template/InputHandlerTemplate.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/fxmisc/wellbehaved/event/template/InputHandlerTemplate.java
+++ b/src/main/java/org/fxmisc/wellbehaved/event/template/InputHandlerTemplate.java
@@ -4,6 +4,12 @@ import javafx.event.Event;
import org.fxmisc.wellbehaved.event.InputHandler.Result;
+/**
+ * Template version of {@link org.fxmisc.wellbehaved.event.InputHandler}.
+ *
+ * @param <S> the type of the object that will be passed into the {@link InputHandlerTemplate}'s block of code.
+ * @param <E> the event type for which this InputMap's {@link org.fxmisc.wellbehaved.event.EventPattern} matches
+ */
@FunctionalInterface
public interface InputHandlerTemplate<S, E extends Event> { | Javadoc: refer readers to the non-template version for an explanation | FXMisc_WellBehavedFX | train | java |
d595554de08371053ae1bd650e3993bea92be816 | diff --git a/src/models/Client.php b/src/models/Client.php
index <HASH>..<HASH> 100644
--- a/src/models/Client.php
+++ b/src/models/Client.php
@@ -58,8 +58,9 @@ class Client extends \hipanel\base\Model
[['login', 'seller', 'state', 'type', 'tariff', 'profile', 'referer'], 'safe'],
[['state_label', 'type_label'], 'safe'],
- [['profile_ids', 'tariff_ids'], 'safe', 'on' => ['update', 'set-tariffs']],
- [['ids'], 'required', 'on' => ['update', 'set-tariffs']],
+ [['profile_ids', 'tariff_ids', 'ids'], 'safe', 'on' => ['update', 'set-tariffs']],
+ [['ids'], 'required', 'on' => ['set-tariffs']],
+ [['id'], 'required', 'on' => ['update']],
[['balance', 'credit', 'full_balance'], 'number'],
[['count', 'confirm_url', 'language', 'comment', 'name', 'currency'], 'safe'], | fixed 'ids cannot be blank' error while client update action (#<I>) | hiqdev_hipanel-module-client | train | php |
278222cc8eb1e3474c38eb82f9857dfaa06f5a1e | diff --git a/spec/country_spec.rb b/spec/country_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/country_spec.rb
+++ b/spec/country_spec.rb
@@ -48,7 +48,7 @@ describe ISO3166::Country do
end
it 'should return alternate names' do
- expect(country.names).to eq(['United States', 'Vereinigte Staaten von Amerika', 'États-Unis', 'Estados Unidos', 'アメリカ合衆国', 'Verenigde Staten'])
+ expect(country.names).to eq(['United States', 'Murica', 'Vereinigte Staaten von Amerika', 'États-Unis', 'Estados Unidos', 'アメリカ合衆国', 'Verenigde Staten'])
end
it 'should return translations' do | Fixes failing rspec assertions after cache update | hexorx_countries | train | rb |
620424d8f126270ad21444f308385a39b7cf7ef8 | diff --git a/liquibase-core/src/main/java/liquibase/command/core/DropAllCommand.java b/liquibase-core/src/main/java/liquibase/command/core/DropAllCommand.java
index <HASH>..<HASH> 100644
--- a/liquibase-core/src/main/java/liquibase/command/core/DropAllCommand.java
+++ b/liquibase-core/src/main/java/liquibase/command/core/DropAllCommand.java
@@ -92,7 +92,7 @@ public class DropAllCommand extends AbstractCommand {
DATABASE_ARG.getValue(commandScope).dropDatabaseObjects(schema);
}
if (hubUpdater != null && (doSyncHub || HUB_CONNECTION_ID.getValue(commandScope) != null)) {
- hubUpdater.syncHub(CHANGELOG_FILE_ARG.getValue(commandScope), DATABASE_ARG.getValue(commandScope), changeLog, HUB_CONNECTION_ID.getValue(commandScope));
+ hubUpdater.syncHub(CHANGELOG_FILE_ARG.getValue(commandScope), changeLog, HUB_CONNECTION_ID.getValue(commandScope));
}
} catch (DatabaseException e) {
throw e; | Merged from master via LB-<I> | liquibase_liquibase | train | java |
27fb1f05204c4c306db8dab3984b0720f060a142 | diff --git a/tests/lib/xhprof-0.9.2/xhprof_lib/utils/xhprof_lib.php b/tests/lib/xhprof-0.9.2/xhprof_lib/utils/xhprof_lib.php
index <HASH>..<HASH> 100755
--- a/tests/lib/xhprof-0.9.2/xhprof_lib/utils/xhprof_lib.php
+++ b/tests/lib/xhprof-0.9.2/xhprof_lib/utils/xhprof_lib.php
@@ -905,6 +905,12 @@ function xhprof_param_init($params) {
exit();
}
+ if ($k === 'run') {
+ $p = implode(',', array_filter(explode(',', $p), function ($a) {
+ return is_numeric($a) || is_numeric(base_convert($a, 16, 10));
+ }));
+ }
+
// create a global variable using the parameter name.
$GLOBALS[$k] = $p;
} | updated fix to also accept randomly generated run IDs | matomo-org_matomo | train | php |
bd0cfd6fbf63e12fda1661ebfc0e10290bbcd7fc | diff --git a/ember-cli-build.js b/ember-cli-build.js
index <HASH>..<HASH> 100644
--- a/ember-cli-build.js
+++ b/ember-cli-build.js
@@ -43,7 +43,6 @@ module.exports = function() {
// generate "loose" ES<latest> modules...
let dependenciesES = new MergeTrees([
backburnerES(),
- handlebarsES(),
rsvpES(),
dagES(),
routerES(),
@@ -112,7 +111,7 @@ module.exports = function() {
let emberDebugBundle = new MergeTrees([
new Funnel(packagesES5, {
- exclude: ['*/tests/**', 'ember-template-compiler/**'],
+ exclude: ['*/tests/**', 'ember-template-compiler/**', 'internal-test-helpers/**'],
}),
dependenciesES5,
emberDebugFeaturesES5,
@@ -177,7 +176,12 @@ module.exports = function() {
let emberProdBundle = new MergeTrees([
new Funnel(prodPackagesES5, {
- exclude: ['*/tests/**', 'ember-template-compiler/**'],
+ exclude: [
+ '*/tests/**',
+ 'ember-template-compiler/**',
+ 'ember-testing/**',
+ 'internal-test-helpers/**',
+ ],
}),
stripForProd(dependenciesES5),
loader, | Ensure internal-test-helpers is excluded from debug & prod builds. | emberjs_ember.js | train | js |
7bfde7c1c0b7977e0eaa556c457eb2ec4ae33bda | diff --git a/abaaso.js b/abaaso.js
index <HASH>..<HASH> 100644
--- a/abaaso.js
+++ b/abaaso.js
@@ -42,7 +42,7 @@
* @author Jason Mulligan <[email protected]>
* @link http://abaaso.com/
* @module abaaso
- * @version 1.7.59
+ * @version 1.7.6
*/
var $ = $ || null, abaaso = (function() {
"use strict";
@@ -634,6 +634,7 @@
if (headers !== null) for (i in headers) { xhr.setRequestHeader(i, headers[i]); }
if (typeof cached === "object" && typeof cached.headers.ETag !== "undefined") xhr.setRequestHeader("ETag", cached.headers.ETag);
+ if (typeof xhr.withCredentials === "boolean") xhr.withCredentials = true;
xhr.send(payload);
}
@@ -3711,7 +3712,7 @@
return observer.remove.call(observer, obj, event, id);
},
update : el.update,
- version : "1.7.59"
+ version : "1.7.6"
};
})();
if (typeof abaaso.bootstrap === "function") abaaso.bootstrap(); | Added credentials to CORS requests, if supported | avoidwork_abaaso | train | js |
2227ef6514cca7b96bbd8bf007a7641258ec4f75 | diff --git a/system/Format/JSONFormatter.php b/system/Format/JSONFormatter.php
index <HASH>..<HASH> 100644
--- a/system/Format/JSONFormatter.php
+++ b/system/Format/JSONFormatter.php
@@ -56,7 +56,7 @@ class JSONFormatter implements FormatterInterface
*/
public function format($data)
{
- $options = $config->formatterOptions['application/json'] ?? 0;
+ $options = $config->formatterOptions['application/json'] ?? JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES;
$options = $options | JSON_PARTIAL_OUTPUT_ON_ERROR ;
$options = ENVIRONMENT === 'production' ? $options : $options | JSON_PRETTY_PRINT; | updat as per pull request
updat as per pull request | codeigniter4_CodeIgniter4 | train | php |
dfe0efaf175653b7ea34a6776a9b882e055f060b | diff --git a/builtin/providers/aws/resource_aws_db_instance.go b/builtin/providers/aws/resource_aws_db_instance.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/aws/resource_aws_db_instance.go
+++ b/builtin/providers/aws/resource_aws_db_instance.go
@@ -46,6 +46,10 @@ func resourceAwsDbInstance() *schema.Resource {
Type: schema.TypeString,
Required: true,
ForceNew: true,
+ StateFunc: func(v interface{}) string {
+ value := v.(string)
+ return strings.ToLower(value)
+ },
},
"engine_version": &schema.Schema{ | aws_db_instance: Only write lowercase engines to the state file.
Amazon accepts mixed-case engines, but only returns lowercase. Without
the proper StateFunc, every apply of a mixed-case engine will result in
a new db instance. Standardize on lowercase. | hashicorp_terraform | train | go |
639a9e095f598534015c0bef688b62fb15a12a34 | diff --git a/src/trait_manager/view/TraitView.js b/src/trait_manager/view/TraitView.js
index <HASH>..<HASH> 100644
--- a/src/trait_manager/view/TraitView.js
+++ b/src/trait_manager/view/TraitView.js
@@ -45,6 +45,8 @@ export default Backbone.View.extend({
}
);
model.view = this;
+ this.listenTo(model, 'change:label', this.render);
+ this.listenTo(model, 'change:placeholder', this.rerender);
this.init();
}, | Listen to lable changes in trauts | artf_grapesjs | train | js |
f848e778ba0c1bf8451301b9019c1b056017d1d1 | diff --git a/slug.go b/slug.go
index <HASH>..<HASH> 100644
--- a/slug.go
+++ b/slug.go
@@ -6,7 +6,7 @@
package slug
import (
- "code.google.com/p/go.text/unicode/norm"
+ "golang.org/x/text/unicode/norm"
"encoding/hex"
"unicode"
"unicode/utf8" | Update code.google.com repo to the new location | extemporalgenome_slug | train | go |
cd25ff8c5083faeeb5df95004f777826839cabed | diff --git a/base.php b/base.php
index <HASH>..<HASH> 100644
--- a/base.php
+++ b/base.php
@@ -2061,7 +2061,10 @@ final class Base extends Prefab implements ArrayAccess {
set_exception_handler(
function($obj) use($fw) {
$fw->hive['EXCEPTION']=$obj;
- $fw->error(500,$obj->getmessage(),$obj->gettrace());
+ $fw->error(500,
+ $obj->getmessage().' '.
+ '['.$obj->getFile().':'.$obj->getLine().']',
+ $obj->gettrace());
}
);
set_error_handler( | Display file and line number in exception handler (bcosca/fatfree#<I>) | bcosca_fatfree-core | train | php |
d4e41869b2c9c1b12588981ab3eb392fe90d780b | diff --git a/lib/servicers/wallaby/abstract_model_servicer.rb b/lib/servicers/wallaby/abstract_model_servicer.rb
index <HASH>..<HASH> 100644
--- a/lib/servicers/wallaby/abstract_model_servicer.rb
+++ b/lib/servicers/wallaby/abstract_model_servicer.rb
@@ -3,7 +3,7 @@ module Wallaby
class AbstractModelServicer
# @return [Class] model class that comes from its class name
def self.model_class
- return unless self < ::Wallaby::ModelServicer
+ return unless self < ::Wallaby.configuration.mapping.model_servicer
Map.model_class_map name.gsub('Servicer', EMPTY_STRING)
end | [Chore] Use mapping configuration for servicer class method `model_class` (#<I>) | reinteractive_wallaby | train | rb |
0dc271292fd9f0e83246685a6750ba2f590e870c | diff --git a/src/main/java/org/jdbdt/Row.java b/src/main/java/org/jdbdt/Row.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/jdbdt/Row.java
+++ b/src/main/java/org/jdbdt/Row.java
@@ -20,7 +20,7 @@ final class Row {
/**
* Hash code (computed only once).
*/
- private volatile int hash;
+ private int hash;
/**
* Constructs a new row. | Row: hash need not be volatile | JDBDT_jdbdt | train | java |
925b51ef25a29fc02794baf214b7eb1b34e1869c | diff --git a/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php b/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php
index <HASH>..<HASH> 100644
--- a/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php
+++ b/modules/custom/wxt_core/src/UpdateWxT/UpdateWxT420.php
@@ -6,7 +6,6 @@ use Drupal\Core\Config\ConfigFactoryInterface;
use Drupal\Core\DependencyInjection\ContainerInjectionInterface;
use Drupal\Core\Extension\ModuleInstallerInterface;
use Drupal\filter\Entity\FilterFormat;
-use Drupal\wxt_core\ConfigHelper as Config;
use Symfony\Component\DependencyInjection\ContainerInterface;
/** | Issue #<I> by smulvih2: CKEditor improvements - automatic TOC | drupalwxt_wxt | train | php |
2841c012cd864dd2fb1bad9b5e9abc53fb822a43 | diff --git a/lib/algebrick/matching.rb b/lib/algebrick/matching.rb
index <HASH>..<HASH> 100644
--- a/lib/algebrick/matching.rb
+++ b/lib/algebrick/matching.rb
@@ -20,6 +20,12 @@ module Algebrick
end
def match(value, *cases)
+ success, result = match? value, *cases
+ raise "no match for (#{value.class}) '#{value}' by any of #{cases.map(&:first).join ', '}" unless success
+ result
+ end
+
+ def match?(value, *cases)
cases = if cases.size == 1 && cases.first.is_a?(Hash)
cases.first
else
@@ -27,9 +33,9 @@ module Algebrick
end
cases.each do |matcher, block|
- return Matching.match_value matcher, block if matcher === value
+ return true, Matching.match_value(matcher, block) if matcher === value
end
- raise "no match for (#{value.class}) '#{value}' by any of #{cases.map(&:first).join ', '}"
+ [false, nil]
end
def on(matcher, value = nil, &block) | Add #match? method as addition to #match | pitr-ch_algebrick | train | rb |
0dbcc83b70b276999705329d2915de7ccef703c0 | diff --git a/luigi/contrib/redshift.py b/luigi/contrib/redshift.py
index <HASH>..<HASH> 100644
--- a/luigi/contrib/redshift.py
+++ b/luigi/contrib/redshift.py
@@ -1,6 +1,5 @@
import abc
import logging
-import luigi.postgres
import luigi
import json
from luigi.contrib import rdbms | Do not import postgres twice
Looks like we import postgres twice while only the second import is used. | spotify_luigi | train | py |
f51af1df42ea8baacbec06ad012e56e24051f714 | diff --git a/delphi/api.py b/delphi/api.py
index <HASH>..<HASH> 100644
--- a/delphi/api.py
+++ b/delphi/api.py
@@ -34,7 +34,8 @@ def create_qualitative_analysis_graph(sts: List[Influence]) -> AnalysisGraph:
return make_cag_skeleton(sts)
-def get_subgraph_for_concept(concept: str, cag: AnalysisGraph, depth_limit = 2) -> AnalysisGraph:
+def get_subgraph_for_concept(concept: str, cag: AnalysisGraph,
+ depth_limit = None) -> AnalysisGraph:
""" Get a subgraph of the analysis graph for a single concept.
Args:
@@ -42,8 +43,9 @@ def get_subgraph_for_concept(concept: str, cag: AnalysisGraph, depth_limit = 2)
cag
depth_limit
"""
- pred = nx.dfs_predecessors(cag, concept, depth_limit = depth_limit)
- return cag.subgraph(list(pred.keys())+[concept])
+ rev = cag.reverse()
+ dfs_edges = nx.dfs_edges(rev, concept, depth_limit = depth_limit)
+ return cag.subgraph(chain.from_iterable(dfs_edges))
def get_subgraph_for_concept_pair(source: str, target: str, | Fixed get_subgraph_for_concept bug | ml4ai_delphi | train | py |
6a8c8abde8b49053b6c7da232008f7928f445ebd | diff --git a/lib/open_namespace/class_methods.rb b/lib/open_namespace/class_methods.rb
index <HASH>..<HASH> 100644
--- a/lib/open_namespace/class_methods.rb
+++ b/lib/open_namespace/class_methods.rb
@@ -80,6 +80,32 @@ module OpenNamespace
end
#
+ # Finds the exact constant.
+ #
+ # @param [String] name
+ # The name of the constant.
+ #
+ # @return [Object, nil]
+ # The exact constant or `nil` if the constant could not be found.
+ #
+ # @since 0.4.0
+ #
+ def const_lookup(name)
+ names = name.split('::')
+ scope = self
+
+ until names.empty?
+ begin
+ scope = scope.const_get(names.shift)
+ rescue NameError
+ return nil
+ end
+ end
+
+ return scope
+ end
+
+ #
# Finds the constant with a name similar to the given file name.
#
# @param [Symbol, String] file_name | Added const_lookup, to perform exact constant searches. | postmodern_open_namespace | train | rb |
4db305ee9594ca57a929867c315c6c673c8b38e4 | diff --git a/js/iosrtc.js b/js/iosrtc.js
index <HASH>..<HASH> 100644
--- a/js/iosrtc.js
+++ b/js/iosrtc.js
@@ -217,6 +217,7 @@ function registerGlobals(doNotRestoreCallbacksSupport) {
img.addEventListener('load', function () {
args.splice(0, 1, img);
drawImage.apply(context, args);
+ img.src = null;
});
img.setAttribute('src', 'data:image/jpg;base64,' + data);
}); | force early GC on Image loaded for Video to Canvas shim by retting src to null | BasqueVoIPMafia_cordova-plugin-iosrtc | train | js |
332a1ebe6ced4b007fa8b6d52df86fcf36cdfe6b | diff --git a/lib/client.js b/lib/client.js
index <HASH>..<HASH> 100644
--- a/lib/client.js
+++ b/lib/client.js
@@ -36,7 +36,7 @@ NodeSocketClient.prototype.remoteExecute = function(identifier, typemap, args, c
if(this._master) {
if(this._state === NodeSocketCommon.EnumConnectionState.Verified) {
var buffer = NodeSocketCommon.createExecutePayload(identifier, typemap, args, function(error) {
- self.emit('error', error, this._socket);
+ self.emit('error', error, self._socket);
});
if(!buffer) {
diff --git a/lib/common.js b/lib/common.js
index <HASH>..<HASH> 100644
--- a/lib/common.js
+++ b/lib/common.js
@@ -427,7 +427,7 @@ module.exports = {
makeWebSocketFrameObject: function(buffer) {
return {
final: true,
- opcode: 0x2,
+ opcode: 0x1,
payloadLength: buffer.length,
payload: buffer
}; | Fixed "this" reference inside of closure and changed WebSocket responses to be handled as text by default | bryanwayb_nodesocket-nodejs | train | js,js |
c6f268e295ed06d389eb17a52d10dacbb7fd543e | diff --git a/test/client.js b/test/client.js
index <HASH>..<HASH> 100644
--- a/test/client.js
+++ b/test/client.js
@@ -4,6 +4,7 @@ var url = require("url");
var http = require("http");
var querystring = require("querystring");
var vibe = require("../lib/index");
+var sid = process.env.VIBE_TEST_SESSION_ID;
http.globalAgent.maxSockets = Infinity;
@@ -48,6 +49,9 @@ describe("client", function() {
var port = this.address().port;
// This method is to tell client to connect this server
self.order = function(params) {
+ if (sid) {
+ params.sid = sid;
+ }
params.uri = "http://localhost:" + port + "/vibe";
params.heartbeat = params.heartbeat || false;
params._heartbeat = params._heartbeat || false; | Add sid param for when multiple test runners run concurrently
The sid, test session id comes from enviornment variable. It's only to
support JavaScript client and not a public option. | vibe-project_vibe-protocol | train | js |
7aae314e74088322a60f1ef9632a257a79ff8982 | diff --git a/celerytask/tasks.py b/celerytask/tasks.py
index <HASH>..<HASH> 100644
--- a/celerytask/tasks.py
+++ b/celerytask/tasks.py
@@ -408,7 +408,10 @@ def set_state(user):
if user.is_superuser:
return
change = False
- state = determine_membership_by_user(user)
+ if user.is_active:
+ state = determine_membership_by_user(user)
+ else:
+ state = False
logger.debug("Assigning user %s to state %s" % (user, state))
if state == "MEMBER":
change = make_member(user) | do not assess states of inactive users
addresses #<I> | allianceauth_allianceauth | train | py |
387b401b5d37df9b2744c5af8226b504f9ecb66d | diff --git a/test/migration_tests.js b/test/migration_tests.js
index <HASH>..<HASH> 100644
--- a/test/migration_tests.js
+++ b/test/migration_tests.js
@@ -629,12 +629,4 @@ describe('Migration', function() {
// complicated, but still could be decently easy.
it('knows the reverse of creating a table');
});
-
- // ADD FEATURE: hash migrations when they are run so we're able to warn the
- // user about migrations that have been altered after they've been applied.
- // store the hash in the migration table & any time migrations are run, check
- // that all previously run migrations still match their current values when
- // read from the disk. this could be extended to ensure that when rolling
- // back we prompt the user that this could potentially break and/or not
- // reverse the migration as intended.
}); | Removed note in code & added #<I> instead. | wbyoung_azul | train | js |
539d77d8be029c78e20baf2fdd5cc2a8006507de | diff --git a/source/rafcon/gui/controllers/execution_log_viewer.py b/source/rafcon/gui/controllers/execution_log_viewer.py
index <HASH>..<HASH> 100644
--- a/source/rafcon/gui/controllers/execution_log_viewer.py
+++ b/source/rafcon/gui/controllers/execution_log_viewer.py
@@ -11,6 +11,7 @@
# example basictreeview.py
from gi.repository import Gtk
+from gi.repository import Gdk
import shelve
import rafcon.utils.execution_log as log_helper | fix(execution log viewer): fix import of Gdk | DLR-RM_RAFCON | train | py |
1985d4f9de8ae76a01516743668900fcd6ab7599 | diff --git a/includes/object-cache.php b/includes/object-cache.php
index <HASH>..<HASH> 100644
--- a/includes/object-cache.php
+++ b/includes/object-cache.php
@@ -556,6 +556,8 @@ class WP_Object_Cache {
$result = $this->parse_redis_response( $this->redis->del( $derived_key ) );
}
+ do_action('redis_object_cache_delete', $key, $group);
+
return $result;
} | update ::delete() with redis_object_cache_delete action
This is similar to the get/set actions (and get filter) already added in a previous update.
Just adds a matching action for delete.
Personally I need this for my logging system that tracks actions and specifically because my 'set' action triggers delete commands and I need them logged to.
Don't think there's any real risk to adding this and it would be very useful for me.
Thanks! | tillkruss_redis-cache | train | php |
2c6cc4634ccebe9cc608c6997421215c32d4176c | diff --git a/client/lib/purchases/assembler.js b/client/lib/purchases/assembler.js
index <HASH>..<HASH> 100644
--- a/client/lib/purchases/assembler.js
+++ b/client/lib/purchases/assembler.js
@@ -32,6 +32,7 @@ function createPurchasesArray( dataTransferObject ) {
expiryStatus: camelCase( purchase.expiry_status ),
hasPrivateRegistration: Boolean( purchase.has_private_registration ),
includedDomain: purchase.included_domain,
+ isCancelable: Boolean( purchase.is_cancelable ),
isDomainRegistration: Boolean( purchase.is_domain_registration ),
isRedeemable: Boolean( purchase.is_redeemable ),
isRefundable: Boolean( purchase.is_refundable ), | Purchases: Revert isCancelable flag for single purchase | Automattic_wp-calypso | train | js |
f600918ee9ff412803d57b7055978d6ecfabf659 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -22,7 +22,7 @@ function hasFlex(decl) {
}
-function addgap(decl, opts) {
+function addGap(decl, opts) {
const container = decl.parent;
@@ -237,7 +237,7 @@ export default postcss.plugin("postcss-gap", (opts) => {
if (declTwo.prop === "display") {
if (declTwo.value !== "grid") {
- addgap(decl, webComponents);
+ addGap(decl, webComponents);
}
}
}); | Fixed naming of function addGap | limitlessloop_postcss-gutters | train | js |
12907271ffd230d787c597fb0413262a7f2d49c2 | diff --git a/code/Forms/InternalLinkFormFactory.php b/code/Forms/InternalLinkFormFactory.php
index <HASH>..<HASH> 100644
--- a/code/Forms/InternalLinkFormFactory.php
+++ b/code/Forms/InternalLinkFormFactory.php
@@ -48,6 +48,8 @@ class InternalLinkFormFactory extends LinkFormFactory
$fields->insertAfter('PageID', TextField::create('Text', _t(__CLASS__.'.LINKTEXT', 'Link text')));
}
+ $this->extend('updateFormFields', $fields, $controller, $name, $context);
+
return $fields;
} | NEW Add update extension hooks for LinkFormFactory subclasses | silverstripe_silverstripe-cms | train | php |
6f0dba6dddeef17b50e9ba6c11c74772825c68fa | diff --git a/quickunit/plugin.py b/quickunit/plugin.py
index <HASH>..<HASH> 100644
--- a/quickunit/plugin.py
+++ b/quickunit/plugin.py
@@ -98,6 +98,10 @@ class QuickUnitPlugin(Plugin):
assert pipe in ('stdout', 'stderr')
self.report_file = getattr(sys, pipe)
else:
+ path = os.path.dirname(report_output)
+ if not os.path.exists(path):
+ os.makedirs(path)
+
self.report_file = open(report_output, 'w')
def begin(self): | Automatically create the directory for the json file if it does not exist | dcramer_quickunit | train | py |
936e839940b77dbd0abb2c6340681764db73d692 | diff --git a/lib/yard/logging.rb b/lib/yard/logging.rb
index <HASH>..<HASH> 100644
--- a/lib/yard/logging.rb
+++ b/lib/yard/logging.rb
@@ -26,7 +26,7 @@ module YARD
return false if YARD.ruby18? # threading is too ineffective for progress support
return false if YARD.windows? # windows has poor ANSI support
return false unless io.tty? # no TTY support on IO
- return false if level > WARN # no progress in verbose/debug modes
+ return false unless level > INFO # no progress in verbose/debug modes
@show_progress
end
attr_writer :show_progress | Fix inverted conditional in Logger#show_progress
Prior to this patch, YARD would show animated progress even when `--debug` was
specified. The progress animation renders any debugger REPL unusable, so having
a way to disable it from the command line is critical. | lsegal_yard | train | rb |
0a8946f53cc6169728828ed157c110f0606e8e9a | diff --git a/src/test/moment/is_valid.js b/src/test/moment/is_valid.js
index <HASH>..<HASH> 100644
--- a/src/test/moment/is_valid.js
+++ b/src/test/moment/is_valid.js
@@ -126,8 +126,10 @@ test('valid string iso 8601 + timezone', function (assert) {
], i;
for (i = 0; i < tests.length; i++) {
- assert.equal(moment(tests[i]).isValid(), true, tests[i] + ' should be valid');
- assert.equal(moment.utc(tests[i]).isValid(), true, tests[i] + ' should be valid');
+ assert.equal(moment(tests[i]).isValid(), true, tests[i] + ' should be valid in normal');
+ assert.equal(moment.utc(tests[i]).isValid(), true, tests[i] + ' should be valid in normal');
+ assert.equal(moment(tests[i], moment.ISO_8601, true).isValid(), true, tests[i] + ' should be valid in strict');
+ assert.equal(moment.utc(tests[i], moment.ISO_8601, true).isValid(), true, tests[i] + ' should be valid in strict');
}
}); | Adding unit tests to verify strict date parsing of ISO-<I> dates. | moment_moment | train | js |
Subsets and Splits