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 |
|---|---|---|---|---|---|
3a9a4dee5cd93f04b1582cc60c9777c64481a5f6 | diff --git a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java
index <HASH>..<HASH> 100755
--- a/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java
+++ b/robotium-solo/src/main/java/com/jayway/android/robotium/solo/ActivityUtils.java
@@ -227,13 +227,22 @@ class ActivityUtils {
public void finalize() throws Throwable {
try {
+ // Finish all opened activities
for (int i = activityList.size()-1; i >= 0; i--) {
activityList.get(i).finish();
sleeper.sleep(100);
}
+
+ // Finish the initial activity, pressing Back for good measure
getCurrentActivity().finish();
- inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
+ try {
+ inst.sendKeyDownUpSync(KeyEvent.KEYCODE_BACK);
+ } catch (SecurityException ignored) {
+ // Guard against lack of INJECT_EVENT permission
+ }
activityList.clear();
+
+ // Remove the monitor added during startup
if (activityMonitor != null) {
inst.removeMonitor(activityMonitor);
} | Catch SecurityException during ActivityUtils finalisation, and add comments. | RobotiumTech_robotium | train | java |
12c2f39c0f37ff55775e97d70dd3efd67dfda4df | diff --git a/lib/share_progress/button.rb b/lib/share_progress/button.rb
index <HASH>..<HASH> 100644
--- a/lib/share_progress/button.rb
+++ b/lib/share_progress/button.rb
@@ -72,7 +72,15 @@ module ShareProgress
def update_attributes(params)
params.each_pair do |key, value|
- instance_variable_set("@#{key}", value)
+ if key == 'variants'
+ # variants have to be parsed by add_variations
+ value.each_pair do |variant_type, variants|
+ self.add_variations(variations: variants)
+ end
+ else
+ instance_variable_set("@#{key}", value)
+ end
+
end
end | Parsing variations from the API retrieval. | SumOfUs_share_progress | train | rb |
f0cc4e4c9003757c774a1fc24ce4d4e6fc305721 | diff --git a/src/FilterFactory.php b/src/FilterFactory.php
index <HASH>..<HASH> 100644
--- a/src/FilterFactory.php
+++ b/src/FilterFactory.php
@@ -51,6 +51,7 @@ class FilterFactory
'between' => function () { return new Rule\Between; },
'blank' => function () { return new Rule\Blank; },
'bool' => function () { return new Rule\Bool; },
+ 'closure' => function () { return new Rule\Closure; },
'creditCard' => function () { return new Rule\CreditCard; },
'dateTime' => function () { return new Rule\DateTime; },
'email' => function () { return new Rule\Email; }, | add 'closure' rule to the collection | auraphp_Aura.Filter | train | php |
ebfe13bb93c0e93e948918bf178de54a7b7220e8 | diff --git a/bin/browsertime.js b/bin/browsertime.js
index <HASH>..<HASH> 100755
--- a/bin/browsertime.js
+++ b/bin/browsertime.js
@@ -48,13 +48,13 @@ require('whereis')('java', function searched(err) {
bt.fetch(argv, cb);
}
],
- function (err) {
- if (err) {
- logger.getLog().error(err.message);
+ function (e) {
+ if (e) {
+ logger.getLog().error(e.message);
}
p.stopProcess(function() {});
- process.exit(err ? 1 : 0);
+ process.exit(e ? 1 : 0);
});
}
}); | Nested callback shouldn't reuse same error param. | sitespeedio_browsertime | train | js |
d3e7d91050da858bd5ec6a061b96466bd9ac85ef | diff --git a/railties/lib/rails/test_help.rb b/railties/lib/rails/test_help.rb
index <HASH>..<HASH> 100644
--- a/railties/lib/rails/test_help.rb
+++ b/railties/lib/rails/test_help.rb
@@ -11,10 +11,6 @@ require "rails/generators/test_case"
require "active_support/testing/autorun"
-if defined?(Capybara) && defined?(Puma)
- require "action_dispatch/system_test_case"
-end
-
if defined?(ActiveRecord::Base)
ActiveRecord::Migration.maintain_test_schema!
@@ -48,12 +44,3 @@ class ActionDispatch::IntegrationTest
super
end
end
-
-if defined?(Capybara) && defined?(Puma)
- class ActionDispatch::SystemTestCase
- def before_setup # :nodoc:
- @routes = Rails.application.routes
- super
- end
- end
-end | Remove unnecessary system test code
It turns out that we don't need to require system tests in the railties
test helper so we can remove it. If you're using system tests they will
be loaded by inheriting from ActionDispatch::SystemTestCase and the
routes will be loaded by ActionDispatch::IntegrationTest. | rails_rails | train | rb |
a07cc96c38461f6e7f622fb82a8f7e14d3baf16e | diff --git a/core/src/main/java/hudson/scm/PollingResult.java b/core/src/main/java/hudson/scm/PollingResult.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/hudson/scm/PollingResult.java
+++ b/core/src/main/java/hudson/scm/PollingResult.java
@@ -6,7 +6,7 @@ import hudson.FilePath;
import hudson.Launcher;
import hudson.model.AbstractProject;
import hudson.model.TaskListener;
-import java.io.Serializable;
+import org.jenkinsci.remoting.SerializableOnlyOverRemoting;
/**
* Immutable object that represents the result of {@linkplain SCM#poll(AbstractProject, Launcher, FilePath, TaskListener, SCMRevisionState) SCM polling}.
@@ -18,7 +18,7 @@ import java.io.Serializable;
* @author Kohsuke Kawaguchi
* @since 1.345
*/
-public final class PollingResult implements Serializable {
+public final class PollingResult implements SerializableOnlyOverRemoting {
/**
* Baseline of the comparison.
* (This comes from either the workspace, or from the remote repository as of the last polling. | Mark `PollingResult` as `SerializableOnlyOverRemoting` (#<I>) | jenkinsci_jenkins | train | java |
8f9fc6e5a0feccb91dec5ddc225078d4036d2359 | diff --git a/Console/Command/EnableCommand.php b/Console/Command/EnableCommand.php
index <HASH>..<HASH> 100644
--- a/Console/Command/EnableCommand.php
+++ b/Console/Command/EnableCommand.php
@@ -24,6 +24,7 @@ use Fastly\Cdn\Model\Config;
use Fastly\Cdn\Model\Api;
use Fastly\Cdn\Helper\Vcl;
use Symfony\Component\Console\Command\Command;
+use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Input\InputOption;
@@ -385,6 +386,9 @@ class EnableCommand extends Command
if ($input->getOption('cache')) {
$this->cleanCache();
}
+
+ $arguments = new ArrayInput(['command' => 'cache:flush', 'types' => ['config']]);
+ $this->getApplication()->find('cache:flush')->run($arguments, $output);
}
/** | feature/M<I>M<I>A-<I> [MAGENTO 2] Command line interface broken
- Added call to `cache:flush config` to the end of `fastly:config:set`, so that following commands use the update values always. | fastly_fastly-magento2 | train | php |
134ff36090f0f5ec2a1e513a0f7598ce869ede1a | diff --git a/wsgi.py b/wsgi.py
index <HASH>..<HASH> 100644
--- a/wsgi.py
+++ b/wsgi.py
@@ -17,7 +17,7 @@
# This file is OpenShift entry point
-import server.app
+import dci.server.app
-conf = server.app.generate_conf()
-application = server.app.create_app(conf)
+conf = dci.server.app.generate_conf()
+application = dci.server.app.create_app(conf) | wsgi: load server class from dci.server
This is a regression introduced by:
If<I>baf<I>dde5afcd5bfaf<I>eeb<I>c<I>
Change-Id: I<I>fb<I>d<I>d<I>b0c<I>cfd0ac<I>faa7add9ec1 | redhat-cip_dci-control-server | train | py |
678e7f1127c491ffe4f67f2e55c8b8b5f13a917f | diff --git a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosSchedulerImpl.java b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosSchedulerImpl.java
index <HASH>..<HASH> 100644
--- a/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosSchedulerImpl.java
+++ b/SingularityService/src/main/java/com/hubspot/singularity/mesos/SingularityMesosSchedulerImpl.java
@@ -205,7 +205,7 @@ public class SingularityMesosSchedulerImpl extends SingularityMesosScheduler {
final Set<OfferID> acceptedOffers = Sets.newHashSetWithExpectedSize(offersToCheck.size());
try {
- List<SingularityOfferHolder> offerHolders = offerScheduler.checkOffers(offers);
+ List<SingularityOfferHolder> offerHolders = offerScheduler.checkOffers(offersToCheck);
for (SingularityOfferHolder offerHolder : offerHolders) {
if (!offerHolder.getAcceptedTasks().isEmpty()) { | Use list of offers excluding declined here | HubSpot_Singularity | train | java |
0683a1807ef9a8d1c62c2fae9526bc06101550e3 | diff --git a/lib/combinators/filter.js b/lib/combinators/filter.js
index <HASH>..<HASH> 100644
--- a/lib/combinators/filter.js
+++ b/lib/combinators/filter.js
@@ -31,17 +31,25 @@ exports.distinctBy = distinctBy;
* @returns {Stream} stream containing only items for which predicate returns truthy
*/
function filter(p, stream) {
- var stepper = stream.step;
- return stream.beget(function(state) {
- return stepFilter(p, stepper, state);
- }, stream.state);
+ return stream.begetWithDispose(function(state) {
+ return stepFilter(p, stream.step, state);
+ }, new Pair(void 0, stream.state), function(t, x, s) {
+ return stream.dispose(t, x, s.state);
+ });
}
function stepFilter(p, stepper, state) {
return when(function(i) {
- return i.done || p(i.value) ? i
- : stepFilter(p, stepper, i.state);
- }, when(stepper, state));
+ return handleFilter(p, stepper, state, i);
+ }, when(stepper, state.state));
+}
+
+function handleFilter(p, stepper, state, i) {
+ if(p(i.value)) {
+ return i.withState(new Pair(i.value, i.state));
+ }
+ return i.done ? new End(i.time, state.value, new Pair(i.value, i.state))
+ : stepFilter(p, stepper, new Pair(state.value, i.state));
}
/** | Make filter emit last allowed value on end | mostjs_core | train | js |
96fbe22b403ce5402b43e6aa846b9faff2228281 | diff --git a/example/EchoTimeService.php b/example/EchoTimeService.php
index <HASH>..<HASH> 100644
--- a/example/EchoTimeService.php
+++ b/example/EchoTimeService.php
@@ -12,6 +12,6 @@ class EchoTimeService
echo "Time is: " . $message->time . "\n";
- usleep(100, 500);
+ usleep(100);
}
} | sleep <I>ms instead of 1 sec | bernardphp_bernard | train | php |
148bc98eeadf324810c734f8605380328a3586a2 | diff --git a/src/Service/Provider.php b/src/Service/Provider.php
index <HASH>..<HASH> 100644
--- a/src/Service/Provider.php
+++ b/src/Service/Provider.php
@@ -54,6 +54,7 @@ class Provider implements \Pimple\ServiceProviderInterface
$container["logger.service"](),
$container["config.service"],
\ICanBoogie\Inflector::get(),
+ $container["queryBuilder.service"],
$container["databaseLibrary.service"]
);
@@ -66,5 +67,9 @@ class Provider implements \Pimple\ServiceProviderInterface
return $container[$cacheName] = $model;
}
);
+
+ $container["queryBuilder.service"] = function() {
+ return new \SlaxWeb\Database\Query\Builder;
+ };
}
} | add the query builder service to the provider | SlaxWeb_Database | train | php |
3ecf4b8ef3b5da587c5a34e52917d0d346d88cdd | diff --git a/test/folder.js b/test/folder.js
index <HASH>..<HASH> 100644
--- a/test/folder.js
+++ b/test/folder.js
@@ -21,7 +21,7 @@ describe('Traverse folder', function () {
it('read only one layer and return json', function () {
var r = folder.readDir('./test/traverse-me');
- expect(r).to.eql(
+ expect(r.files).to.eql(
[
{
dir: true,
@@ -34,4 +34,6 @@ describe('Traverse folder', function () {
]
);
});
+
+ // TODO: add test for readMe
});
\ No newline at end of file | Fix the tests for folderUtil | at15_doc-viewer | train | js |
368e92e290bce76043cf67315b4052afda2eb923 | diff --git a/src/Entities/Organisations/OrganisationProfile.php b/src/Entities/Organisations/OrganisationProfile.php
index <HASH>..<HASH> 100644
--- a/src/Entities/Organisations/OrganisationProfile.php
+++ b/src/Entities/Organisations/OrganisationProfile.php
@@ -58,14 +58,6 @@ class OrganisationProfile
}
/**
- * @param boolean $enabled
- */
- public function setEnabled($enabled)
- {
- $this->enabled = $enabled;
- }
-
- /**
* @return OrganisationAddress
*/
public function getAddress() | Removed setter from OrganisationProfile | ordercloud_ordercloud-php | train | php |
7234cf5e213ec365c8b2a7866d7da9ea0c5b717c | diff --git a/app/routes/app.php b/app/routes/app.php
index <HASH>..<HASH> 100644
--- a/app/routes/app.php
+++ b/app/routes/app.php
@@ -1,3 +1,4 @@
<?php
Route::get('/', 'HomeController@showIndex');
+ Route::get('/incident/{incident}', 'HomeController@showIncident'); | Route model for Incident and Component, readying a route too. | CachetHQ_Cachet | train | php |
b600d9ecd2902617cda7f87de21de2077dc9a1e2 | diff --git a/pytablereader/_tabledata_sanitizer.py b/pytablereader/_tabledata_sanitizer.py
index <HASH>..<HASH> 100644
--- a/pytablereader/_tabledata_sanitizer.py
+++ b/pytablereader/_tabledata_sanitizer.py
@@ -169,6 +169,33 @@ class AbstractTableDataSanitizer(TableDataSanitizerInterface):
return new_header_list
+class TableDataSanitizer(AbstractTableDataSanitizer):
+
+ def _preprocess_table_name(self):
+ return self._tabledata.table_name
+
+ def _validate_table_name(self, table_name):
+ try:
+ typepy.type.String(table_name).validate()
+ except TypeError as e:
+ raise InvalidTableNameError(e)
+
+ def _sanitize_table_name(self, table_name):
+ return typepy.type.String(table_name).force_convert()
+
+ def _preprocess_header(self, col, header):
+ return header
+
+ def _validate_header(self, header):
+ try:
+ typepy.type.String(header).validate()
+ except TypeError as e:
+ raise InvalidHeaderNameError(e)
+
+ def _sanitize_header(self, header):
+ return typepy.type.String(header).force_convert()
+
+
class SQLiteTableDataSanitizer(AbstractTableDataSanitizer):
__RE_PREPROCESS = re.compile("[^a-zA-Z0-9_]+") | Add TableDataSanitizer class | thombashi_pytablereader | train | py |
65d1a0c9c796b32a8ec8ff305eca6a7661845ee2 | diff --git a/doc.go b/doc.go
index <HASH>..<HASH> 100644
--- a/doc.go
+++ b/doc.go
@@ -1,5 +1,9 @@
// xslx is a package designed to help with reading data from
// spreadsheets stored in the XLSX format used in recent versions of
// Microsoft's Excel spreadsheet.
+//
+// For a concise example of how to use this library why not check out
+// the source for xlsx2csv here: https://github.com/tealeg/xlsx2csv
+
package xlsx | Made reference to xslx2csv (<URL>) as an example of how to use XLSX. | tealeg_xlsx | train | go |
72f127b763a3f4f0916cabbecce9b3d215a382b1 | diff --git a/interfaces/semantic/support/fixtures/crud.fixture.js b/interfaces/semantic/support/fixtures/crud.fixture.js
index <HASH>..<HASH> 100644
--- a/interfaces/semantic/support/fixtures/crud.fixture.js
+++ b/interfaces/semantic/support/fixtures/crud.fixture.js
@@ -68,7 +68,7 @@ module.exports = Waterline.Collection.extend({
avatar: {
type: 'ref',
autoMigrations: {
- columnType: 'bytea'
+ columnType: 'text'
}
}, | fix to make work in other datastores | balderdashy_waterline-adapter-tests | train | js |
f71287b538ff3687ab98455a597a4d514a7ee158 | diff --git a/app/models/pay/subscription.rb b/app/models/pay/subscription.rb
index <HASH>..<HASH> 100644
--- a/app/models/pay/subscription.rb
+++ b/app/models/pay/subscription.rb
@@ -36,12 +36,7 @@ module Pay
validates :quantity, presence: true, numericality: {only_integer: true, greater_than_or_equal_to: 0}
validates :status, presence: true
- delegate :on_grace_period?,
- :paused?,
- :pause,
- :cancel,
- :cancel_now!,
- to: :payment_processor
+ delegate_missing_to :payment_processor
# Helper methods for payment processors
%w[braintree stripe paddle fake_processor].each do |processor_name| | Delegate missing methods on Pay::Subscription to the processor | jasoncharnes_pay | train | rb |
714ed899ae46e55bd713d0da0c13c4c5398c4dd9 | diff --git a/hszinc/parser.py b/hszinc/parser.py
index <HASH>..<HASH> 100644
--- a/hszinc/parser.py
+++ b/hszinc/parser.py
@@ -273,6 +273,12 @@ def parse_scalar(scalar, mode=MODE_ZINC):
return MARKER
elif isinstance(scalar, bool):
return scalar
+ elif scalar == 'n:INF':
+ return float('INF')
+ elif scalar == 'n:-INF':
+ return -float('INF')
+ elif scalar == 'n:NaN':
+ return float('nan')
# Is it a number?
match = NUMBER_RE.match(scalar) | parser: Implement INF, -INF and NaN for JSON | vrtsystems_hszinc | train | py |
56e735b86dc180ddc7da03131267060b5531b26a | diff --git a/core/crypto/bench_test.go b/core/crypto/bench_test.go
index <HASH>..<HASH> 100644
--- a/core/crypto/bench_test.go
+++ b/core/crypto/bench_test.go
@@ -54,11 +54,11 @@ func runBenchmarkSign(b *testing.B, numBytes int, t int) {
}
func RunBenchmarkVerifyRSA(b *testing.B, numBytes int) {
- runBenchmarkSign(b, numBytes, RSA)
+ runBenchmarkVerify(b, numBytes, RSA)
}
func RunBenchmarkVerifyEd25519(b *testing.B, numBytes int) {
- runBenchmarkSign(b, numBytes, Ed25519)
+ runBenchmarkVerify(b, numBytes, Ed25519)
}
func runBenchmarkVerify(b *testing.B, numBytes int, t int) { | fix benchmark of key verifications (#<I>) | libp2p_go-libp2p | train | go |
72e2b5ab29b7d5d9b4c10d962af3a03a9104407f | diff --git a/cli.js b/cli.js
index <HASH>..<HASH> 100755
--- a/cli.js
+++ b/cli.js
@@ -3,6 +3,8 @@
var fs = require('fs');
var path = require('path');
var url = require('url');
+var http = require('http');
+var https = require('https');
var existsSync = fs.existsSync || path.existsSync;
@@ -98,7 +100,16 @@ for (var i = 0; i < args.length; i++) {
if (inputUrl && inputUrl.protocol) {
// URL input, use stdout
program.inputType = "url";
- convert(arg, undefined, program);
+ var handler = (inputUrl.protocol == 'https:')?https:http;
+ var req = handler.get(arg, function (res) {
+ var data = '';
+ res.on('data', function (chunk) {
+ data += chunk;
+ });
+ res.on('end', function () {
+ convert(data, undefined, program);
+ });
+ });
} else {
// path or glob
inputPath = parsePath(arg); | fixed missing http requests to urls (#<I>)
* fixed missing http requests to urls
* add support to https requests | donpark_html2jade | train | js |
8ac5cad6087caa0d2c1ffcf7f090134a31a1e950 | diff --git a/pages/__init__.py b/pages/__init__.py
index <HASH>..<HASH> 100644
--- a/pages/__init__.py
+++ b/pages/__init__.py
@@ -1,6 +1,6 @@
# -*- coding: utf-8 -*-
"""Django page CMS module."""
-VERSION = (1, 4, 1)
+VERSION = (1, 4, 2)
__version__ = '.'.join(map(str, VERSION))
__author__ = "Batiste Bieler"
__contact__ = "batiste.bieler@gmail.com" | New version, latest version had a packaging error. | batiste_django-page-cms | train | py |
3286404927c38f60bd457d06cef7dd2b89f2f387 | diff --git a/pymomo/commander/proxy/proxy12.py b/pymomo/commander/proxy/proxy12.py
index <HASH>..<HASH> 100644
--- a/pymomo/commander/proxy/proxy12.py
+++ b/pymomo/commander/proxy/proxy12.py
@@ -23,13 +23,6 @@ class MIB12ProxyObject (proxy.MIBProxyObject):
#Know Configuration Variable Types
config_types = {6: 'array', 7: 'string'}
- @returns(desc='application firmware checksum', data=True)
- def checksum(self):
- """
- Get the 8-bit application checksum.
- """
- return self.rpc(0,2, result_type=(1,False))['ints'][0]
-
@return_type("fw_mib12_status")
def status(self):
""" | Remove outdated checksum function from proxy<I> | iotile_coretools | train | py |
54a1a833c98ddc7d9ab5571ea4f89e2bd9b0fb0a | diff --git a/xrpc_tests/mp/abstract.py b/xrpc_tests/mp/abstract.py
index <HASH>..<HASH> 100644
--- a/xrpc_tests/mp/abstract.py
+++ b/xrpc_tests/mp/abstract.py
@@ -4,6 +4,7 @@ import sys
import unittest
from contextlib import ExitStack
from itertools import count
+from os import environ
import subprocess
from dataclasses import field, dataclass
@@ -86,9 +87,15 @@ class Timer:
return self.get()
+DEFAULT_LEVEL = logging.INFO
+
+if environ.get('DEBUG', None):
+ DEFAULT_LEVEL = logging.DEBUG
+
+
@dataclass(frozen=False)
class ProcessHelper:
- ls: LoggerSetup = field(default_factory=lambda: LoggerSetup(LL(None, logging.DEBUG), [], ['stream:///stderr']))
+ ls: LoggerSetup = field(default_factory=lambda: LoggerSetup(LL(None, DEFAULT_LEVEL), [], ['stream:///stderr']))
es: ExitStack = field(default_factory=ExitStack)
ps: PopenStack = field(default_factory=lambda: PopenStack(10)) | API_VERSION: up
VERSION: up | andreycizov_python-xrpc | train | py |
24ad89c6494c9faa609152b6c73a53df48ee020e | diff --git a/utool/util_grabdata.py b/utool/util_grabdata.py
index <HASH>..<HASH> 100755
--- a/utool/util_grabdata.py
+++ b/utool/util_grabdata.py
@@ -551,7 +551,7 @@ TESTIMG_URL_DICT = {
def get_valid_test_imgkeys():
r""" returns valid keys for grab_test_imgpath """
- return list(TESTIMG_URL_DICT.keys())
+ return sorted(TESTIMG_URL_DICT.keys())
def clear_test_img_cache(): | sorted grabdata test keys for consistency | Erotemic_utool | train | py |
100284cdd5f36221a8ba91ba118031535b2ed138 | diff --git a/numexpr/tests/test_numexpr.py b/numexpr/tests/test_numexpr.py
index <HASH>..<HASH> 100644
--- a/numexpr/tests/test_numexpr.py
+++ b/numexpr/tests/test_numexpr.py
@@ -380,6 +380,16 @@ class test_evaluate(TestCase):
assert_array_equal(evaluate("c1"), c1)
assert_array_equal(evaluate("a0+c1"), a0 + c1)
+ def test_recarray_strides(self):
+ a = arange(100)
+ b = arange(100,200)
+ recarr = np.rec.array(None, formats='f4,f4', shape=(100,))
+ recarr['f0'] = a
+ recarr['f1'] = b
+ c = recarr['f1']
+ assert_array_almost_equal(evaluate("sqrt(c) > 1."), sqrt(c) > 1.)
+ assert_array_almost_equal(evaluate("log10(c)"), log10(c))
+
def test_broadcasting(self):
a = arange(100).reshape(10, 10)[::2]
c = arange(10) | Add unittest for strides over columns of numpy.rec.arrays
(This currently fails when using MKL) | pydata_numexpr | train | py |
fe2e18c3c073955daf769c9f3f760b8965c8f72d | diff --git a/lib/twitter-ads/creative/promoted_tweet.rb b/lib/twitter-ads/creative/promoted_tweet.rb
index <HASH>..<HASH> 100644
--- a/lib/twitter-ads/creative/promoted_tweet.rb
+++ b/lib/twitter-ads/creative/promoted_tweet.rb
@@ -38,7 +38,7 @@ module TwitterAds
#
# @return [self] Returns the instance refreshed from the API.
#
- # Note: override to handle the inconsistency of the promoted tweet endpoint.
+ # Note: override to handle the inconsistency of the promoted tweet endpoint. (see REVAPI-5348)
#
# @since 0.2.4
def save | [minor] adding ticket reference to promoted tweet behavior override | twitterdev_twitter-ruby-ads-sdk | train | rb |
61f19859f058675494d9bbc77168d7e5d93e8ceb | diff --git a/examples/routeguide_client.rb b/examples/routeguide_client.rb
index <HASH>..<HASH> 100644
--- a/examples/routeguide_client.rb
+++ b/examples/routeguide_client.rb
@@ -111,9 +111,9 @@ end
sock = TCPSocket.new(HOST, PORT)
stub = Routeguide::RouteGuide::Stub.new(sock, **opts)
-# get_feature(stub)
-# list_features(stub)
-# record_route(stub, 10)
+get_feature(stub)
+list_features(stub)
+record_route(stub, 10)
route_chat(stub)
# rubocop:enable Style/GlobalVars | example call all type of rpcs | cookpad_grpc_kit | train | rb |
d5bd805fa590c8248301f03cd5ffce36e80c4476 | diff --git a/src/libs/Auth.php b/src/libs/Auth.php
index <HASH>..<HASH> 100644
--- a/src/libs/Auth.php
+++ b/src/libs/Auth.php
@@ -435,10 +435,9 @@ class Auth
return false;
}
- $user->load();
-
// make sure there are no other forgot links
$oldLinks = UserLink::totalRecords([
+ 'uid' => $user->id(),
'link_type' => USER_LINK_FORGOT_PASSWORD,
'created_at > "'.U::unixToDb(time() - UserLink::$forgotLinkTimeframe).'"', ]); | bugfix: filter by user when checking for past forgot links | infusephp_auth | train | php |
8d4de6c3b5f17019f28b0835b891821b557e0074 | diff --git a/packages/sproutcore-views/lib/system/render_buffer.js b/packages/sproutcore-views/lib/system/render_buffer.js
index <HASH>..<HASH> 100644
--- a/packages/sproutcore-views/lib/system/render_buffer.js
+++ b/packages/sproutcore-views/lib/system/render_buffer.js
@@ -123,7 +123,7 @@ SC._RenderBuffer = SC.Object.extend(
@returns {SC.RenderBuffer} this
*/
addClass: function(className) {
- get(this, 'elementClasses').pushObject(className);
+ get(this, 'elementClasses').addObject(className);
return this;
},
diff --git a/packages/sproutcore-views/lib/views/view.js b/packages/sproutcore-views/lib/views/view.js
index <HASH>..<HASH> 100644
--- a/packages/sproutcore-views/lib/views/view.js
+++ b/packages/sproutcore-views/lib/views/view.js
@@ -906,7 +906,7 @@ SC.View = SC.Object.extend(
this._applyAttributeBindings(buffer);
- buffer.addClass(get(this, 'classNames').join(' '));
+ get(this, 'classNames').forEach(function(name){ buffer.addClass(name); });
buffer.id(get(this, 'elementId'));
var role = get(this, 'ariaRole'); | Make sure classNames are unique on views | emberjs_ember.js | train | js,js |
60cd5c31d6faf809a3f4decf4c89f70eaeffce8f | diff --git a/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java b/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java
index <HASH>..<HASH> 100644
--- a/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java
+++ b/java/client/src/org/openqa/selenium/firefox/xpi/XpiDriverService.java
@@ -51,7 +51,6 @@ import java.net.MalformedURLException;
import java.net.URL;
import java.time.Duration;
import java.util.ArrayList;
-import java.util.Collections;
import java.util.HashSet;
import java.util.List;
import java.util.Map; | [java] Deleting unused imports | SeleniumHQ_selenium | train | java |
4cacae6e6e6fde6c4585b7883d0619ede106fc90 | diff --git a/lib/fivemat/cucumber.rb b/lib/fivemat/cucumber.rb
index <HASH>..<HASH> 100644
--- a/lib/fivemat/cucumber.rb
+++ b/lib/fivemat/cucumber.rb
@@ -23,6 +23,7 @@ module Fivemat
def after_features(features)
@io.puts
print_stats(features, @options)
+ print_snippets(@options)
print_passing_wip(@options)
end
end | Print snippets for undefined Cucumber steps | tpope_fivemat | train | rb |
3cf792ec7d3131774e87bd38c8bdda3f3646e844 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -36,10 +36,15 @@ setup(
description=description,
long_description=long_description,
download_url=download_url,
- packages=['simple_settings', 'simple_settings.strategies'],
+ packages=[
+ 'simple_settings',
+ 'simple_settings.strategies',
+ 'simple_settings.dynamic_settings',
+ ],
package_dir={
'simple_settings': 'simple_settings',
- 'strategies': 'simple_settings/strategies'
+ 'strategies': 'simple_settings/strategies',
+ 'dynamic_settings': 'simple_settings/dynamic_settings',
},
classifiers=[
'Intended Audience :: Developers', | add dynamic_settings package in setup.py | drgarcia1986_simple-settings | train | py |
3386a089eff05a8a990ca56909c9a427f4f2fe25 | diff --git a/activerecord/lib/active_record/attribute_methods.rb b/activerecord/lib/active_record/attribute_methods.rb
index <HASH>..<HASH> 100644
--- a/activerecord/lib/active_record/attribute_methods.rb
+++ b/activerecord/lib/active_record/attribute_methods.rb
@@ -36,7 +36,7 @@ module ActiveRecord
@@_defined_activerecord_methods ||= defined_activerecord_methods
raise DangerousAttributeError, "#{method_name} is defined by ActiveRecord" if @@_defined_activerecord_methods.include?(method_name)
- @_defined_class_methods.include?(method_name)
+ @_defined_class_methods.include?(method_name) || generated_attribute_methods.method_defined?(method_name)
end
def defined_activerecord_methods | Fix warnings.
Make sure we don't redefine an already-defined attribute method. | rails_rails | train | rb |
425f5d278ce0f97f130b8cc31372ab42a20ca59b | diff --git a/core/model/SiteTree.php b/core/model/SiteTree.php
index <HASH>..<HASH> 100755
--- a/core/model/SiteTree.php
+++ b/core/model/SiteTree.php
@@ -1665,9 +1665,18 @@ class SiteTree extends DataObject implements PermissionProvider,i18nEntityProvid
if(!Permission::check('SITETREE_GRANT_ACCESS')) {
$fields->makeFieldReadonly($viewersOptionsField);
- $fields->makeFieldReadonly($viewerGroupsField);
+ if($this->CanViewType == 'OnlyTheseUsers') {
+ $fields->makeFieldReadonly($viewerGroupsField);
+ } else {
+ $fields->removeByName('ViewerGroups');
+ }
+
$fields->makeFieldReadonly($editorsOptionsField);
- $fields->makeFieldReadonly($editorGroupsField);
+ if($this->CanEditType == 'OnlyTheseUsers') {
+ $fields->makeFieldReadonly($editorGroupsField);
+ } else {
+ $fields->removeByName('EditorGroups');
+ }
}
$tabContent->setTitle(_t('SiteTree.TABCONTENT', "Content")); | MINOR: Hide readonly permission group fields on pages when not relevant,
as they are confusing. (from r<I>)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/trunk@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9 | silverstripe_silverstripe-framework | train | php |
bb9f2e37da81f7ad7fd17e1f9c247fd69d2e9ad2 | diff --git a/openquake/calculators/tests/gmf_ebrisk_test.py b/openquake/calculators/tests/gmf_ebrisk_test.py
index <HASH>..<HASH> 100644
--- a/openquake/calculators/tests/gmf_ebrisk_test.py
+++ b/openquake/calculators/tests/gmf_ebrisk_test.py
@@ -98,8 +98,6 @@ class GmfEbRiskTestCase(CalculatorTestCase):
@attr('qa', 'risk', 'event_based_risk')
def test_case_master(self):
- if sys.platform == 'darwin':
- raise unittest.SkipTest('macOS')
self.run_calc(case_master.__file__, 'job.ini', insured_losses='false')
calc0 = self.calc.datastore # single file event_based_risk
self.run_calc(case_master.__file__, 'job.ini', insured_losses='false', | Unskipped another test on macOS [skip CI]
Former-commit-id: 5a<I>a<I>f<I>b<I>b<I>e6d6e2bc<I>d<I>e | gem_oq-engine | train | py |
cfc47707877a352668024c91eb1a45a50f787cf0 | diff --git a/lib/streamio/audio.rb b/lib/streamio/audio.rb
index <HASH>..<HASH> 100644
--- a/lib/streamio/audio.rb
+++ b/lib/streamio/audio.rb
@@ -3,6 +3,6 @@ module Streamio
resource_name "audios"
creatable_attributes %w(file)
accessable_attributes %w(title description tags)
- readable_attributes %w(id state progress plays duration created_at updated_at account_id transcodings)
+ readable_attributes %w(id state progress plays duration created_at updated_at account_id transcodings original_file)
end
end
diff --git a/spec/streamio/audio_spec.rb b/spec/streamio/audio_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/streamio/audio_spec.rb
+++ b/spec/streamio/audio_spec.rb
@@ -24,7 +24,7 @@ module Streamio
end
it "should have certain readable attributes" do
- Audio.readable_attributes.should == %w(id state progress plays duration created_at updated_at account_id transcodings)
+ Audio.readable_attributes.should == %w(id state progress plays duration created_at updated_at account_id transcodings original_file)
end
end
end
\ No newline at end of file | Add original_file to Audio readable attributes. | streamio_streamio-rb | train | rb,rb |
fc8815d6258142d664a27a9184e3119368ac9496 | diff --git a/src/edgehandles/gesture-lifecycle.js b/src/edgehandles/gesture-lifecycle.js
index <HASH>..<HASH> 100644
--- a/src/edgehandles/gesture-lifecycle.js
+++ b/src/edgehandles/gesture-lifecycle.js
@@ -80,11 +80,12 @@ function snap(){
let cy = this.cy;
let tgt = this.targetNode;
let threshold = this.options.snapThreshold;
- let sqThreshold = threshold * threshold;
+ let sqThreshold = n => { let r = getRadius(n); let t = r + threshold; return t * t; };
let mousePos = this.mp();
let sqDist = (p1, p2) => (p2.x - p1.x) * (p2.x - p1.x) + (p2.y - p1.y) * (p2.y - p1.y);
+ let getRadius = n => ( n.outerWidth() + n.outerHeight() ) / 4;
let nodeSqDist = memoize(n => sqDist(n.position(), mousePos), n => n.id());
- let isWithinTheshold = n => nodeSqDist(n) <= sqThreshold;
+ let isWithinTheshold = n => nodeSqDist(n) <= sqThreshold(n);
let cmpSqDist = (n1, n2) => nodeSqDist(n1) - nodeSqDist(n2);
let allowHoverDelay = false; | Improve support for large nodes, such as compounds, by increasing the snap threshold by an estimate of the target node's radius. | cytoscape_cytoscape.js-edgehandles | train | js |
cb000b474677ca9c15b00c9d65107bf690a1b231 | diff --git a/src/scripts/upload/upload.store.js b/src/scripts/upload/upload.store.js
index <HASH>..<HASH> 100644
--- a/src/scripts/upload/upload.store.js
+++ b/src/scripts/upload/upload.store.js
@@ -362,7 +362,9 @@ let UploadStore = Reflux.createStore({
* in the upload menu.
*/
selectTab(activeKey) {
- this.update({activeKey});
+ if (activeKey) {
+ this.update({activeKey});
+ }
},
/** | Added selectTab condition to prevent new bootstrap tabs from selecting 'undefined' | OpenNeuroOrg_openneuro | train | js |
8d716e27a75c37924324c7c8e34d8132831a9490 | diff --git a/psamm/lpsolver/lp.py b/psamm/lpsolver/lp.py
index <HASH>..<HASH> 100644
--- a/psamm/lpsolver/lp.py
+++ b/psamm/lpsolver/lp.py
@@ -29,6 +29,7 @@ single variable. This allows many similar expressions to be represented by one
constructed faster.
"""
+import math
import numbers
from collections import Counter
import abc
@@ -109,8 +110,12 @@ class Expression(object):
"""Add expression with a number or another expression"""
if isinstance(other, numbers.Number):
+ if math.isinf(self.offset) or math.isinf(other):
+ return self.__class__(offset=self._offset + other)
return self.__class__(self._variables, self._offset + other)
elif isinstance(other, self.__class__):
+ if math.isinf(self.offset) or math.isinf(other.offset):
+ return self.__class__(offset=self._offset + other._offset)
variables = Counter(self._variables)
variables.update(other._variables)
return self.__class__(variables, self._offset + other._offset)
@@ -126,6 +131,9 @@ class Expression(object):
return -self + other
def __mul__(self, other):
+ if math.isinf(other):
+ return self.__class__(offset=other)
+
return self.__class__(
{var: value*other for var, value in iteritems(self._variables)},
self._offset*other) | lp: Propagate infinity values into Expression
Extends Expression such that adding or multiplying a normal expression with
infinity produces an Expression with no variables and the offset set to
the same infinity value. This means that the offset can be quickly checked
to see if an Expression is at infinity. | zhanglab_psamm | train | py |
b65da0d300a99cac157d4d940150de0e717eebfc | diff --git a/go/ephemeral/device_ek.go b/go/ephemeral/device_ek.go
index <HASH>..<HASH> 100644
--- a/go/ephemeral/device_ek.go
+++ b/go/ephemeral/device_ek.go
@@ -66,9 +66,8 @@ func publishNewDeviceEK(mctx libkb.MetaContext, merkleRoot libkb.MerkleRoot) (me
storage := mctx.G().GetDeviceEKStorage()
generation, err := storage.MaxGeneration(mctx, true)
- if err != nil {
+ if err != nil || generation < 0 {
// Let's try to get the max from the server
- mctx.Debug("Error getting maxGeneration from storage")
generation, err = serverMaxDeviceEK(mctx, merkleRoot)
if err != nil {
return metadata, err | Improve generation calculation for device eks (#<I>)
* Improve generation calculation for device eks
* no log | keybase_client | train | go |
b62ed5dc90ae7ae0d414f9b249bd22765c38d6a4 | diff --git a/cmd/object-handlers.go b/cmd/object-handlers.go
index <HASH>..<HASH> 100644
--- a/cmd/object-handlers.go
+++ b/cmd/object-handlers.go
@@ -166,6 +166,10 @@ func (api objectAPIHandlers) SelectObjectContentHandler(w http.ResponseWriter, r
writeErrorResponse(w, ErrExpressionTooLong, r.URL)
return
}
+ if selectReq.InputSerialization.CSV == nil || selectReq.OutputSerialization.CSV == nil {
+ writeErrorResponse(w, ErrInvalidRequestParameter, r.URL)
+ return
+ }
if selectReq.InputSerialization.CSV.FileHeaderInfo != CSVFileHeaderInfoUse &&
selectReq.InputSerialization.CSV.FileHeaderInfo != CSVFileHeaderInfoNone &&
selectReq.InputSerialization.CSV.FileHeaderInfo != CSVFileHeaderInfoIgnore && | select API CSV may not be specified (#<I>)
This should be present until we support JSON | minio_minio | train | go |
0bb4c1bd060627ddeb098f107fc7ec5d8cddbb0d | diff --git a/core/client/assets/lib/touch-editor.js b/core/client/assets/lib/touch-editor.js
index <HASH>..<HASH> 100644
--- a/core/client/assets/lib/touch-editor.js
+++ b/core/client/assets/lib/touch-editor.js
@@ -46,7 +46,8 @@ var createTouchEditor = function createTouchEditor() {
nthLine: noop,
refresh: noop,
selectLines: noop,
- on: noop
+ on: noop,
+ off: noop
};
return TouchEditor; | Add off as a noop function to touch editor.
Closes #<I> | TryGhost_Ghost | train | js |
97bfecf06230f66a13b83448111c2cce9266b495 | diff --git a/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb b/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
+++ b/fastlane/lib/fastlane/actions/upload_symbols_to_crashlytics.rb
@@ -83,7 +83,9 @@ module Fastlane
command << "-p #{params[:platform] == 'appletvos' ? 'tvos' : params[:platform]}"
command << File.expand_path(path).shellescape
begin
- Actions.sh(command.join(" "), log: false)
+ command_to_execute = command.join(" ")
+ UI.verbose("upload_dsym using command: #{command_to_execute}")
+ Actions.sh(command_to_execute, log: false)
rescue => ex
UI.error ex.to_s # it fails, however we don't want to fail everything just for this
end
@@ -96,6 +98,7 @@ module Fastlane
next unless result
next unless result.kind_of?(Hash)
params[:api_token] ||= result["APIKey"]
+ UI.verbose("found an APIKey in #{current}")
end
end
UI.user_error!("Please provide an api_token using api_token:") unless params[:api_token] | Add verbose output for upload_dsym (#<I>)
* Add verbose output for upload_dsym
be able to see what command is failing when verbose output is on
* Show where APIkeys are found | fastlane_fastlane | train | rb |
154e2835de835f3b06e69f0fd79df5f8d75491c7 | diff --git a/lib/ztk/dsl/core/actions/find.rb b/lib/ztk/dsl/core/actions/find.rb
index <HASH>..<HASH> 100644
--- a/lib/ztk/dsl/core/actions/find.rb
+++ b/lib/ztk/dsl/core/actions/find.rb
@@ -23,7 +23,11 @@ module ZTK::DSL::Core::Actions
end
def first(*args)
- find(*args).first
+ if args.count == 0
+ all.first
+ else
+ find(*args).first
+ end
end
def count | if no arguments are supplied just return the first item; otherwise defer to find and return the first result | zpatten_ztk | train | rb |
0ca75927745b290b59a0090db724b32ea8b5e56b | diff --git a/openquake/commonlib/calculators/classical.py b/openquake/commonlib/calculators/classical.py
index <HASH>..<HASH> 100644
--- a/openquake/commonlib/calculators/classical.py
+++ b/openquake/commonlib/calculators/classical.py
@@ -68,7 +68,6 @@ def classical(sources, sitecol, gsims_assoc, monitor):
# notice that the rupture filter may remove everything
if any(curves[imt].sum() for imt in imtls):
result[trt_model_id, str(gsim)] = array_to_dict(curves)
- import pdb; pdb.set_trace()
return result | Removed a forgotten pdb | gem_oq-engine | train | py |
d9bc75f5912f453cdfb15b93dac639da09f5450a | diff --git a/tests/XssTest.php b/tests/XssTest.php
index <HASH>..<HASH> 100644
--- a/tests/XssTest.php
+++ b/tests/XssTest.php
@@ -129,7 +129,7 @@ EOT;
}
// Test bad elements.
- if (count($config) == 1 && !empty($config['safe'])) {
+ if (is_array($config) && count($config) == 1 && !empty($config['safe'])) {
$elems = ['applet', 'iframe', 'script', 'embed', 'object'];
} else {
$elems = ['applet', 'form', 'input', 'textarea', 'iframe', 'script', 'style', 'embed', 'object'];
@@ -297,4 +297,4 @@ HTML;
return $result;
}
}
-
\ No newline at end of file
+ | Ensure that $config is an array | vanilla_htmlawed | train | php |
359b55eb4d85036eb915decf311a1547a952d860 | diff --git a/etc/eslint/rules/stdlib.js b/etc/eslint/rules/stdlib.js
index <HASH>..<HASH> 100644
--- a/etc/eslint/rules/stdlib.js
+++ b/etc/eslint/rules/stdlib.js
@@ -104,6 +104,7 @@ rules[ 'stdlib/no-redeclare' ] = [ 'error', {
'Int8Array',
'Int16Array',
'Int32Array',
+ 'SharedArrayBuffer',
'Uint8Array',
'Uint8ClampedArray',
'Uint16Array', | Add `SharedArrayBuffer` to list of exceptions | stdlib-js_stdlib | train | js |
71a96b819278e5b6fcf7686c64ae59b8d371feae | diff --git a/lib/lolapi.js b/lib/lolapi.js
index <HASH>..<HASH> 100644
--- a/lib/lolapi.js
+++ b/lib/lolapi.js
@@ -73,7 +73,7 @@
freetoPlayQuery = '',
regionAndFunc = util.getCallbackAndRegion(regionOrFunction, region, callback);
- if (!(freeToPlay === null || typeof (freetoPlayQuery) === 'boolean')) {
+ if (freeToPlay === null || !(typeof (freeToPlay) === 'boolean')) {
console.log('Invalid query parameter for freeToPlay: ' + freeToPlay);
} | Fixed freeToPlay value check
the FreeToPlay check previously would always return invalid because it
was checking FreeToPlayQuery | Colorfulstan_LeagueJS | train | js |
0addc766ac52a04651f0f7a27256990eb0c26300 | diff --git a/genepattern/static/resources/genepattern.task.js b/genepattern/static/resources/genepattern.task.js
index <HASH>..<HASH> 100644
--- a/genepattern/static/resources/genepattern.task.js
+++ b/genepattern/static/resources/genepattern.task.js
@@ -691,6 +691,9 @@ define("genepattern/task", ["base/js/namespace",
$("<span></span>")
.addClass("file-widget-value-text")
.text(file_display)
+ .dblclick(function(event) {
+ $(event.target).parent().trigger("dblclick");
+ })
)
.dblclick(function(event) {
// Ignore this event for file uploads | Bug fix for double-clicking file text | genepattern_genepattern-notebook | train | js |
b02efdeb2ecae2e7df5d53cda746367565071ebf | diff --git a/ArgusWeb/app/js/directives/charts/lineChart.js b/ArgusWeb/app/js/directives/charts/lineChart.js
index <HASH>..<HASH> 100644
--- a/ArgusWeb/app/js/directives/charts/lineChart.js
+++ b/ArgusWeb/app/js/directives/charts/lineChart.js
@@ -643,6 +643,7 @@ angular.module('argus.directives.charts.lineChart', [])
var domainEnd = x.domain()[1].getTime();
//redraw
if(domainStart <= dateExtent[1] && domainEnd >= dateExtent[0]) {
+ mainChart.selectAll('path.line').attr('display', null);
//update the dataum and redraw the line
currSeries.forEach(function (metric) {
if (metric === null || metric.data.length === 0) return;
@@ -664,6 +665,8 @@ angular.module('argus.directives.charts.lineChart', [])
.attr('d', line); //change the datum will call d3 to redraw
});
//svg_g.selectAll(".line").attr("d", line);//redraw the line
+ }else{
+ mainChart.selectAll('path.line').attr('display', 'none');
}
xAxisG.call(xAxis); //redraw xAxis
yAxisG.call(yAxis); //redraw yAxis | Fix an issue that some line path remains when brush into empty date range | salesforce_Argus | train | js |
ce72ff96d4f3a80ba3e27912e7b6000cefcc8e0d | diff --git a/auto-release.js b/auto-release.js
index <HASH>..<HASH> 100644
--- a/auto-release.js
+++ b/auto-release.js
@@ -48,8 +48,12 @@ async function init() {
if (isCanaryRelease) {
try {
const version = await shell
- .exec(`auto version --from v${currentVersion}`, { silent: true })
- .stdout.trim() || 'patch';
+ .exec('auto version', { silent: true })
+ .stdout.trim();
+
+ console.log('current version', currentVersion);
+ console.log('upcoming version type', version);
+ console.log('canary version', canaryVersion);
await shell.exec(
`npx lerna publish pre${version} --dist-tag canary --preid canary${canaryVersion} --no-git-reset --no-git-tag-version --exact --ignore-scripts --no-push --force-publish --yes -m "[skip travis] chore(release): pre-release %s"`, | test: re-test canary release test w/ added logs | bolt-design-system_bolt | train | js |
72c4fb430adf722aedb74db699c6ed6cdf0b8d9d | diff --git a/atrcopy/parsers.py b/atrcopy/parsers.py
index <HASH>..<HASH> 100644
--- a/atrcopy/parsers.py
+++ b/atrcopy/parsers.py
@@ -26,7 +26,7 @@ class SegmentParser(object):
def parse(self):
r = self.segment_data
- self.segments.append(DefaultSegment(r, 0))
+ self.segments.append(DefaultSegment(r, 0, name=self.menu_name))
try:
self.image = self.get_image(r)
self.check_image() | Use parser name as the name of the default segment | robmcmullen_atrcopy | train | py |
c4aff2bb58f75e247e728a43f37a87373a81ce70 | 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
@@ -2,7 +2,20 @@
function forEach(arr, f) {
for (var i = 0, e = arr.length; i < e; ++i) f(arr[i]);
}
-
+
+ function arrayContains(arr, item) {
+ if (!Array.prototype.indexOf) {
+ var i = arr.length;
+ while (i--) {
+ if (arr[i] === item) {
+ return true;
+ }
+ }
+ return false;
+ }
+ return arr.indexOf(item) != -1;
+ }
+
CodeMirror.javascriptHint = function(editor) {
// Find the token at the cursor
var cur = editor.getCursor(), token = editor.getTokenAt(cur), tprop = token;
@@ -35,7 +48,7 @@
function getCompletions(token, context) {
var found = [], start = token.string;
function maybeAdd(str) {
- if (str.indexOf(start) == 0 && found.indexOf(str) == -1) found.push(str);
+ if (str.indexOf(start) == 0 && !arrayContains(found, str)) found.push(str);
}
function gatherCompletions(obj) {
if (typeof obj == "string") forEach(stringProps, maybeAdd); | Define and use an arrayContains function rather than directly using array.indexOf, this fixes the auto completion demo in IE6/7/8. | codemirror_CodeMirror | train | js |
a0d4edcbd863dc666c5fe79e43e10000d633d8a5 | diff --git a/server/php/UploadHandler.php b/server/php/UploadHandler.php
index <HASH>..<HASH> 100644
--- a/server/php/UploadHandler.php
+++ b/server/php/UploadHandler.php
@@ -279,6 +279,10 @@ class UploadHandler
} else {
$new_file_path = $file_path;
}
+ if (!function_exists('getimagesize')) {
+ error_log('Function not found: getimagesize');
+ return false;
+ }
list($img_width, $img_height) = @getimagesize($file_path);
if (!$img_width || !$img_height) {
return false;
@@ -295,6 +299,11 @@ class UploadHandler
}
return true;
}
+
+ if (!function_exists('imagecreatetruecolor')) {
+ error_log('Function not found: imagecreatetruecolor');
+ return false;
+ }
if (empty($options['crop'])) {
$new_width = $img_width * $scale;
$new_height = $img_height * $scale; | Test existance of image functions and log an error if they do not exist. | blueimp_jQuery-File-Upload | train | php |
fac118b8ee635bf2e518fd5ca7f531fd50996b5f | diff --git a/tasks/build-contrib.js b/tasks/build-contrib.js
index <HASH>..<HASH> 100644
--- a/tasks/build-contrib.js
+++ b/tasks/build-contrib.js
@@ -45,7 +45,7 @@ module.exports = function(grunt) {
if (meta.appveyor && meta.appveyor.project_id) {
var pid = meta.appveyor.project_id;
- meta.appveyor = 'https://ci.appveyor.com/api/projects/status/' + pid + '/branch/master';
+ meta.appveyor = 'https://ci.appveyor.com/api/projects/status/' + pid + '/branch/master?svg=true';
}
var authors = grunt.file.read('AUTHORS'); | Use SVG for the AppVeyor badge too. | gruntjs_grunt-contrib-internal | train | js |
d92f88bcdb8f97c35e481a4d8f6b7813c000af4a | diff --git a/client/__init__.py b/client/__init__.py
index <HASH>..<HASH> 100644
--- a/client/__init__.py
+++ b/client/__init__.py
@@ -1,4 +1,4 @@
-__version__ = 'v1.3.33'
+__version__ = 'v1.3.34'
FILE_NAME = 'ok'
import os
diff --git a/client/cli/lock.py b/client/cli/lock.py
index <HASH>..<HASH> 100644
--- a/client/cli/lock.py
+++ b/client/cli/lock.py
@@ -22,6 +22,7 @@ def main():
args = parse_input()
args.lock = True
args.question = []
+ args.all = False
args.timeout = 0
args.verbose = False
args.interactive = False | Fix ok-lock bug and update to <I> | okpy_ok-client | train | py,py |
c0985b772a226ff5199db8f100e522d6f7b3ff5b | diff --git a/SingularityService/src/main/java/com/hubspot/singularity/data/history/DeployTaskHistoryHelper.java b/SingularityService/src/main/java/com/hubspot/singularity/data/history/DeployTaskHistoryHelper.java
index <HASH>..<HASH> 100644
--- a/SingularityService/src/main/java/com/hubspot/singularity/data/history/DeployTaskHistoryHelper.java
+++ b/SingularityService/src/main/java/com/hubspot/singularity/data/history/DeployTaskHistoryHelper.java
@@ -91,7 +91,7 @@ public class DeployTaskHistoryHelper extends BlendedHistoryHelper<SingularityTas
public List<SingularityTaskIdHistory> getInactiveDeployTasks(SingularityDeployKey key, Integer limitCount, Integer limitStart) {
// We don't know our limits yet before filtering task state
- Integer limit = singularityConfiguration.getHistoryPurgingConfiguration().getDeleteTaskHistoryAfterTasksPerRequest().or(10000);
+ Integer limit = (int) (singularityConfiguration.getHistoryPurgingConfiguration().getDeleteTaskHistoryAfterTasksPerRequest().or(10000) * 1.2);
List<SingularityTaskIdHistory> histories = this.getBlendedHistory(key, 0, limit);
final Iterable<SingularityTaskIdHistory> inactiveHistories = Iterables.filter(histories, new Predicate<SingularityTaskIdHistory>() { | Add in a buffer to the limit for tasks that have not been purged yet | HubSpot_Singularity | train | java |
ab9a0a378d4df9d26a4d0bee2365e9d815734522 | diff --git a/core/lib/rom/setup/finalize/finalize_relations.rb b/core/lib/rom/setup/finalize/finalize_relations.rb
index <HASH>..<HASH> 100644
--- a/core/lib/rom/setup/finalize/finalize_relations.rb
+++ b/core/lib/rom/setup/finalize/finalize_relations.rb
@@ -43,7 +43,7 @@ module ROM
klass.use(:registry_reader, relation_names)
- notifications.trigger('configuration.relations.class.ready', relation: klass)
+ notifications.trigger('configuration.relations.class.ready', relation: klass, adapter: klass.adapter)
relations[key] = build_relation(klass, registry)
end | Include :adapter when emitting "configuration.relations.class.ready" event | rom-rb_rom | train | rb |
8fa993511984e1951fa7fe90baa596dfd92016fb | diff --git a/base.php b/base.php
index <HASH>..<HASH> 100644
--- a/base.php
+++ b/base.php
@@ -1021,7 +1021,7 @@ final class Base {
krsort($this->hive['ROUTES']);
// Convert to BASE-relative URL
$req=preg_replace(
- '/^'.preg_quote($this->hive['BASE'],'/').'\b(.*)/','\1',
+ '/^'.preg_quote($this->hive['BASE'],'/').'(\/.*|$)/','\1',
$this->hive['URI']
);
$allowed=array();
@@ -1424,9 +1424,7 @@ final class Base {
$scheme=isset($_SERVER['HTTPS']) && $_SERVER['HTTPS']=='on' ||
isset($headers['X-Forwarded-Proto']) &&
$headers['X-Forwarded-Proto']=='https'?'https':'http';
- $base=implode('/',array_map('urlencode',
- explode('/',$this->fixslashes(
- preg_replace('/\/[^\/]+$/','',$_SERVER['SCRIPT_NAME'])))));
+ $base=preg_replace('/\/[^\/]+$/','',$_SERVER['PHP_SELF']);
call_user_func_array('session_set_cookie_params',
$jar=array(
'expire'=>0, | Bug fix: Routing failure when dir path contains a tilde (Issue #<I>) | bcosca_fatfree-core | train | php |
cfd3b84bd9efcf23180dbde650ce5f752892dc6c | diff --git a/src/Controller/Component/AuthorizationComponent.php b/src/Controller/Component/AuthorizationComponent.php
index <HASH>..<HASH> 100644
--- a/src/Controller/Component/AuthorizationComponent.php
+++ b/src/Controller/Component/AuthorizationComponent.php
@@ -73,7 +73,7 @@ class AuthorizationComponent extends Component
}
/**
- * Check the policy for $resource, raising an exception on error.
+ * Check the policy for $resource, returns true if the action is allowed
*
* If $action is left undefined, the current controller action will
* be used. | Fixing a doc block in AuthorizationComponent | cakephp_authorization | train | php |
9f596f0895797afe43492da17a1eb94ff5f5a19b | diff --git a/karma.debug.conf.js b/karma.debug.conf.js
index <HASH>..<HASH> 100644
--- a/karma.debug.conf.js
+++ b/karma.debug.conf.js
@@ -2,7 +2,7 @@ module.exports = function(config) {
config.set({
frameworks: ['jasmine'],
files: [
- 'node_modules/angular/angular.min.js',
+ 'node_modules/angular/angular.js',
'node_modules/angular-mocks/angular-mocks.js',
'src/*.js',
'tests/*-helper.js', | Use non-minified files in tests debug | RedGlow_angular-gw2-api | train | js |
491e64eefec7a5370c40e47674b8cffe92932dd4 | diff --git a/src/Table/Table.js b/src/Table/Table.js
index <HASH>..<HASH> 100644
--- a/src/Table/Table.js
+++ b/src/Table/Table.js
@@ -150,14 +150,14 @@ export default class Table extends React.Component {
} else {
order = 'desc';
}
- }
- this.setState({
- sortBy: {
- order: order,
- prop: prop
- }
- });
+ this.setState({
+ sortBy: {
+ order: order,
+ prop: prop
+ }
+ });
+ }
if (Util.isFunction(onSortCallback)) {
onSortCallback(sortBy); | Avoid setting sortBy state when component receives props | mesosphere_reactjs-components | train | js |
d8bffb58a421d63dff971f9fce300542e2cecb27 | diff --git a/src/Http/Before/CsrfFilter.php b/src/Http/Before/CsrfFilter.php
index <HASH>..<HASH> 100644
--- a/src/Http/Before/CsrfFilter.php
+++ b/src/Http/Before/CsrfFilter.php
@@ -2,8 +2,9 @@
namespace CachetHQ\Cachet\Http\Before;
+use Illuminate\Http\Request;
+use Illuminate\Routing\Route;
use Illuminate\Session\TokenMismatchException;
-use Illuminate\Support\Facades\Input;
use Illuminate\Support\Facades\Session;
class CsrfFilter
@@ -15,13 +16,16 @@ class CsrfFilter
* our csrf token in the session does not match the one given sent to us in
* this request, then we'll bail.
*
+ * @param \Illuminate\Routing\Route $route
+ * @param \Illuminate\Http\Request $request
+ *
* @throws \Illuminate\Session\TokenMismatchException
*
* @return void
*/
- public function filter()
+ public function filter(Route $route, Request $request)
{
- if (Session::token() !== Input::get('_token')) {
+ if (Session::token() !== $request->input('_token')) {
throw new TokenMismatchException();
}
} | Cleanup the csrf filter | CachetHQ_Cachet | train | php |
00fe6161c7c26d25f52fa6cf374c3fd767cf7cf7 | diff --git a/conllu/compat.py b/conllu/compat.py
index <HASH>..<HASH> 100644
--- a/conllu/compat.py
+++ b/conllu/compat.py
@@ -1,17 +1,6 @@
from io import StringIO
+from contextlib import redirect_stdout
-try:
- from contextlib import redirect_stdout
-except ImportError:
- import contextlib
- import sys
-
- @contextlib.contextmanager
- def redirect_stdout(target):
- original = sys.stdout
- sys.stdout = target
- yield
- sys.stdout = original
def string_to_file(string):
return StringIO(text(string) if string else None) | Remove special case for redirect_stdout. | EmilStenstrom_conllu | train | py |
4ee95c3177156482f7c523e3478478f3605a3d05 | diff --git a/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java b/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java
index <HASH>..<HASH> 100644
--- a/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java
+++ b/src/test/java/com/microsoft/azure/spring/data/cosmosdb/common/TestConstants.java
@@ -16,7 +16,7 @@ import java.util.UUID;
@NoArgsConstructor(access = AccessLevel.PRIVATE)
public class TestConstants {
- private static final int SUFFIX_LENGTH = 3;
+ private static final int SUFFIX_LENGTH = 1;
private static final String DB_NAME_SUFFIX = UUID.randomUUID().toString().substring(0, SUFFIX_LENGTH);
private static final Address ADDRESS_1 = new Address("201107", "Zixing Road", "Shanghai"); | Use one char as testdb suffix, fix #<I>. (#<I>) | Microsoft_spring-data-cosmosdb | train | java |
f9c424807cf645522bda8021bcef581e8f45f6b7 | diff --git a/carpenter/__init__.py b/carpenter/__init__.py
index <HASH>..<HASH> 100644
--- a/carpenter/__init__.py
+++ b/carpenter/__init__.py
@@ -1,3 +1,6 @@
+# Make this available to other repositories to avoid version conflicts
+import datawrap
+
import os
import glob
# Hack to get setup tools to correctly include all python files
diff --git a/requirements.txt b/requirements.txt
index <HASH>..<HASH> 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -1 +1 @@
-pydatawrap==1.2.0
\ No newline at end of file
+pydatawrap==1.2.1
\ No newline at end of file
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -53,7 +53,7 @@ setup(
description = "A utility library which repairs and analyzes tablular data",
install_requires = required,
package_data = { "" : data_types },
- dependency_links = ["https://github.com/OpenGov/python_data_wrap/tarball/v1.2.0#egg=pydatawrap-1.2.0"],
+ dependency_links = ["https://github.com/OpenGov/python_data_wrap/tarball/v1.2.1#egg=pydatawrap-1.2.1"],
packages = packages,
test_suite = "tests",
zip_safe = False, | Added datawrap to init and bumped pydatawrap version requirement number | OpenGov_carpenter | train | py,txt,py |
d7a5819677bc8bad72a6d2c7669e7b191af19022 | diff --git a/fleetctl/debug_info.go b/fleetctl/debug_info.go
index <HASH>..<HASH> 100644
--- a/fleetctl/debug_info.go
+++ b/fleetctl/debug_info.go
@@ -22,13 +22,13 @@ func debugInfoAction(c *cli.Context) {
info, err := registryCtl.GetDebugInfo()
if err != nil {
fmt.Fprintln(os.Stderr, "Get response from etcd error:", err)
- return
+ os.Exit(1)
}
fmt.Println("All fleet entries in etcd service:")
buf := new(bytes.Buffer)
if err = json.Indent(buf, []byte(info), "", "\t"); err != nil {
- return
+ os.Exit(1)
}
fmt.Println(buf.String())
} | fix(fleetctl): exit 1 on failures in debug-info | coreos_fleet | train | go |
f05832e10aa25f5bfffe094c562721fe00e7dfd2 | diff --git a/doc/conf.py b/doc/conf.py
index <HASH>..<HASH> 100644
--- a/doc/conf.py
+++ b/doc/conf.py
@@ -121,7 +121,7 @@ html_theme = 'nature'
# Add any paths that contain custom static files (such as style sheets) here,
# relative to this directory. They are copied after the builtin static files,
# so a file named "default.css" will overwrite the builtin "default.css".
-html_static_path = ['_static']
+#html_static_path = ['_static']
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format. | Sphinx: Remove unsued directory. | ryan-roemer_django-cloud-browser | train | py |
b54b9a15cc8431c8b2ab387c63fcdbf152ec996e | diff --git a/morris/__init__.py b/morris/__init__.py
index <HASH>..<HASH> 100644
--- a/morris/__init__.py
+++ b/morris/__init__.py
@@ -562,6 +562,9 @@ class boundmethod(object):
def __init__(self, instance, func):
self.instance = instance
self.func = func
+ if hasattr(func, '__qualname__'):
+ self.__qualname__ = self.func.__qualname__
+ self.__name__ = self.func.__name__
def __call__(self, *args, **kwargs):
return self.func(self.instance, *args, **kwargs) | Set __{qual,}name__ in boundmethod()
This patch makes the boundmethod() object look a little more like a
function by having __qualname__ and __name__. This makes it compatible
with _get_fn_name() | zyga_morris | train | py |
180073d8ed060bedf22f0fb89b403fa02a100b33 | diff --git a/lib/ronin/scanners/scanner.rb b/lib/ronin/scanners/scanner.rb
index <HASH>..<HASH> 100644
--- a/lib/ronin/scanners/scanner.rb
+++ b/lib/ronin/scanners/scanner.rb
@@ -196,7 +196,7 @@ module Ronin
# If no categories are specified, all categories will be ran
# against +each_target+.
#
- # @param [Hash{Symbol => true,Hash}] categories
+ # @param [Hash{Symbol,String => Boolean,Hash}] categories
# The categories to scan for, with additional per-category
# scanner-options.
# | Adjusted the docs on Scanners#scan. | ronin-ruby_ronin | train | rb |
213488f19291dd63d928953cc3d4503ab3f1f90a | diff --git a/src/Composer/PackageManager.php b/src/Composer/PackageManager.php
index <HASH>..<HASH> 100644
--- a/src/Composer/PackageManager.php
+++ b/src/Composer/PackageManager.php
@@ -102,6 +102,12 @@ class PackageManager
// Set composer environment variables
putenv('COMPOSER_HOME=' . $this->app['resources']->getPath('cache') . '/composer');
+ /*
+ * If the extension project area is writable, ensure the JSON is up-to-date
+ * and test connection to the extension server.
+ *
+ * If all is OK, set $app['extend.online'] to TRUE
+ */
if ($app['extend.writeable']) {
// Copy/update installer helper
$this->copyInstaller(); | Add flow explaination comment to constructor | bolt_bolt | train | php |
f6e71349e630e909b57e0835bd70cb46628efb2a | diff --git a/admobadapter/src/main/java/com/clockbyte/admobadapter/AdmobAdapterCalculator.java b/admobadapter/src/main/java/com/clockbyte/admobadapter/AdmobAdapterCalculator.java
index <HASH>..<HASH> 100644
--- a/admobadapter/src/main/java/com/clockbyte/admobadapter/AdmobAdapterCalculator.java
+++ b/admobadapter/src/main/java/com/clockbyte/admobadapter/AdmobAdapterCalculator.java
@@ -79,7 +79,7 @@ public class AdmobAdapterCalculator {
* @return the original position that the adapter position would have been without ads
*/
public int getAdsCountToPublish(int fetchedAdsCount, int sourceItemsCount){
- if(fetchedAdsCount == 0 || getNoOfDataBetweenAds() == 0) return 0;
+ if(fetchedAdsCount <= 0 || getNoOfDataBetweenAds() <= 0) return 0;
int expected = 0;
if(sourceItemsCount > 0 && sourceItemsCount >= getOffsetValue()+1)
expected = (sourceItemsCount - getOffsetValue()) / getNoOfDataBetweenAds() + 1; | Fix issue when failed admob requests are < 0 | clockbyte_admobadapter | train | java |
f109698196a44a6e6791d1a2b89e179102b940c3 | diff --git a/salt/client/mixins.py b/salt/client/mixins.py
index <HASH>..<HASH> 100644
--- a/salt/client/mixins.py
+++ b/salt/client/mixins.py
@@ -285,9 +285,8 @@ class SyncClientMixin(object):
# Inject some useful globals to *all* the function's global
# namespace only once per module-- not per func
completed_funcs = []
- _functions = copy.deepcopy(self.functions)
- for mod_name in six.iterkeys(_functions):
+ for mod_name in six.iterkeys(self.functions):
if '.' not in mod_name:
continue
mod, _ = mod_name.split('.', 1) | No need to deepcopy since six.iterkeys() creates a copy | saltstack_salt | train | py |
917fa9173b3bce0edc9c857860183ffa5965a0a8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -19,13 +19,15 @@ setup(
name='awss',
packages=['awss'],
entry_points={'console_scripts': ['awss=awss:main']},
- version='0.9.5',
+ version='0.9.5.3',
author="Robert Peteuil",
author_email="robert.s.peteuil@gmail.com",
url='https://github.com/robertpeteuil/aws-shortcuts',
+ download_url='https://pypi.python.org/pypi/awss/',
+ license='MIT',
description='AWS Shortcuts for Command-Line Instance Control',
+ platforms='any',
keywords='AWS EC2 instance control ssh',
- license='MIT License: http://www.opensource.org/licenses/mit-license.php',
install_requires=['boto3>=1.4',
'future>=0.14',
'colorama'], | Added Download URL and Platforms to setup.py | robertpeteuil_aws-shortcuts | train | py |
d21e6baddced27478a4fa9a2a687755094da82d0 | diff --git a/darwin/option.go b/darwin/option.go
index <HASH>..<HASH> 100644
--- a/darwin/option.go
+++ b/darwin/option.go
@@ -6,7 +6,7 @@ type Option func(*Device) error
// OptPeripheralRole configures the device to perform Peripheral tasks.
func OptPeripheralRole() Option {
return func(d *Device) error {
- d.role = 0
+ d.role = 1
return nil
}
}
@@ -14,7 +14,7 @@ func OptPeripheralRole() Option {
// OptCentralRole configures the device to perform Central tasks.
func OptCentralRole() Option {
return func(d *Device) error {
- d.role = 1
+ d.role = 0
return nil
}
} | osx: fix device role option | currantlabs_ble | train | go |
118ca2cc037b1489edc0fa88cb5dd1dc81148fc1 | diff --git a/lib/guard/rspec/inspector.rb b/lib/guard/rspec/inspector.rb
index <HASH>..<HASH> 100644
--- a/lib/guard/rspec/inspector.rb
+++ b/lib/guard/rspec/inspector.rb
@@ -62,7 +62,7 @@ module Guard
spec_files = spec_paths.collect { |path| Dir[File.join(path, "**{,/*/**}", "*[_.]spec.rb")] }
feature_files = spec_paths.collect { |path| Dir[File.join(path, "**{,/*/**}", "*.feature")] }
files = (spec_files + feature_files).flatten
- paths.select { |p| files.include?(p) }
+ paths.select { |p| files.include?(p) || spec_paths.include?(p) }
end
end | fix run all on spec_helper change
watch('spec/spec_helper.rb') { 'spec' } will trigger again and run all specs | guard_guard-rspec | train | rb |
ef2d781872b6aa5ae1ef162c3d3cf2adab12f9f6 | diff --git a/src/sag.js b/src/sag.js
index <HASH>..<HASH> 100644
--- a/src/sag.js
+++ b/src/sag.js
@@ -123,7 +123,7 @@
var publicThat = {
get: function(opts) {
if(!currDatabase) {
- throw 'You must call setDatabase() first.';
+ throw 'Must setDatabase() first.';
}
if(typeof opts !== 'object') {
@@ -201,6 +201,10 @@
},
getStats: function(callback) {
+ if(!currDatabase) {
+ throw 'Must setDatabase() first.';
+ }
+
procPacket('GET', '/_stats', null, null, callback);
},
@@ -218,6 +222,10 @@
},
put: function(opts) {
+ if(!currDatabase) {
+ throw 'Must setDatabase() first.';
+ }
+
if(opts.callback && typeof opts.callback !== 'function') {
throw 'Invalid callback';
} | Adding forgotten checks for currDatabase. | sbisbee_sag-js | train | js |
59d9d80d1d5aa5f9fb6c8a4a71f43e1a405cd28d | diff --git a/packages/swagger2openapi/index.js b/packages/swagger2openapi/index.js
index <HASH>..<HASH> 100644
--- a/packages/swagger2openapi/index.js
+++ b/packages/swagger2openapi/index.js
@@ -64,7 +64,7 @@ function fixupSchema(obj,key,state){
delete obj[key]; // TODO check we're at the right level(s) if poss.
}
if (state.payload.targetted && (key == 'properties') && (typeof obj[key] === 'object')) {
- if (typeof obj.type === 'undefined') {
+ if ((state.pkey !== 'properties') && (typeof obj.type === 'undefined')) {
obj.type = 'object';
}
} | Only add missing type:object at top level of properties | Mermade_oas-kit | train | js |
4c3f3824b862e854984afe6f3738be7b74674a07 | diff --git a/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/impl/DbnsfpGeneServiceAnnotator.java b/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/impl/DbnsfpGeneServiceAnnotator.java
index <HASH>..<HASH> 100644
--- a/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/impl/DbnsfpGeneServiceAnnotator.java
+++ b/molgenis-data-annotators/src/main/java/org/molgenis/data/annotation/impl/DbnsfpGeneServiceAnnotator.java
@@ -54,8 +54,6 @@ import org.springframework.stereotype.Component;
public class DbnsfpGeneServiceAnnotator extends LocusAnnotator
{
private static final String NAME = "dbNSFP-Gene";
- private static final String CHROMOSOME = "chrom";
- private static final String POSITION = "pos";
// FIXME set runtime property for file location
private static final String GENE_FILE = "/Users/mdehaan/bin/tools/dbnsfp/dbNSFP2.3_gene"; | Removed constants because they are already defined in superclass | molgenis_molgenis | train | java |
58faca0b65d2d64f1112f323bd843fc2b23fd086 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -28,7 +28,7 @@ setup(
long_description=long_description,
long_description_content_type='text/markdown',
keywords='arcgis,fgdc,iso,ISO-19115,ISO-19139,gis,metadata,parser,xml,gis_metadata,gis_metadata_parser',
- version='1.2.5',
+ version='1.2.6',
packages=[
'gis_metadata', 'gis_metadata.tests'
], | Increment version after fix to frozendict version | consbio_gis-metadata-parser | train | py |
54d1680e84866d46d10ff278fce36902ce2de7ac | diff --git a/test/lib/migrator_test.rb b/test/lib/migrator_test.rb
index <HASH>..<HASH> 100644
--- a/test/lib/migrator_test.rb
+++ b/test/lib/migrator_test.rb
@@ -45,6 +45,6 @@ class GenaratorRunnerTest < ActiveSupport::TestCase
end
test '.execute_generate_migration' do
- assert_includes 'db/migrate/20120512132600_create_foobars.rb', Erd::GenaratorRunner.execute_generate_migration('create_foobars')
+ assert_includes Erd::GenaratorRunner.execute_generate_migration('create_foobars'), 'db/migrate/20120512132600_create_foobars.rb'
end
end | assert_includes takes the collection first | amatsuda_erd | train | rb |
aefd7c617c423a6827034a20ee33a2b87d559ae2 | diff --git a/src/Yosymfony/Spress/Command/NewPostCommand.php b/src/Yosymfony/Spress/Command/NewPostCommand.php
index <HASH>..<HASH> 100644
--- a/src/Yosymfony/Spress/Command/NewPostCommand.php
+++ b/src/Yosymfony/Spress/Command/NewPostCommand.php
@@ -113,11 +113,13 @@ EOT
// Tags:
$tags = $input->getOption('tags') ?: '';
$question = new Question('List of post tags separed by white space: ', $tags);
+ $tags = $helper->ask($input, $output, $question);
$input->setOption('tags', $tags);
// Categories:
$categories = $input->getOption('categories') ?: '';
$question = new Question('List of post categories separed by white space: ', $categories);
+ $categories = $helper->ask($input, $output, $question);
$input->setOption('categories', $categories);
} | Fixed questions for tags and categories in new:post command | spress_spress | train | php |
3292cf3fd0ef477c26a2682fa2be9e75ae6a6415 | diff --git a/indra/sources/sparser/processor.py b/indra/sources/sparser/processor.py
index <HASH>..<HASH> 100644
--- a/indra/sources/sparser/processor.py
+++ b/indra/sources/sparser/processor.py
@@ -215,6 +215,12 @@ def _fix_agent(agent):
target = ncit_map.get(agent.db_refs['NCIT'])
if target:
agent.db_refs[target[0]] = target[1]
+ # If the name is an UP ID, change it
+ if agent.name and 'UP' not in agent.db_refs \
+ and 'FPLX' not in agent.db_refs:
+ if uniprot_client.get_gene_name(agent.name):
+ agent.db_refs['UP'] = agent.name
+
# Check what entries we have
up_id = agent.db_refs.get('UP')
hgnc_id = agent.db_refs.get('HGNC') | Handle UP ID in agent name | sorgerlab_indra | train | py |
3c751940a92a3de8e2bb855cfc3a58e9a3582a1b | diff --git a/src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java b/src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java
index <HASH>..<HASH> 100644
--- a/src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java
+++ b/src/hsqldb19b3/org/hsqldb_voltpatches/Constraint.java
@@ -180,12 +180,11 @@ public final class Constraint implements SchemaObject {
// A VoltDB extension to support the assume unique attribute
copy.assumeUnique = assumeUnique;
// End of VoltDB extension
- // A VoltDB extension to support indexed expressions
+ // A VoltDB extension to support LIMIT PARTITION ROWS syntax
copy.rowsLimit = rowsLimit;
copy.rowsLimitDeleteStmt = rowsLimitDeleteStmt;
// End of VoltDB extension
- // A VoltDB extension to support LIMIT PARTITION ROWS syntax
- // Does this need a deeper copy? --izzy
+ // A VoltDB extension to support indexed expressions
copy.indexExprs = indexExprs;
// End of VoltDB extension | ENG-<I>: cleanup. I switched up which extension comment went with
which code. | VoltDB_voltdb | train | java |
841359be6952bf49e389c9321c5f133c150f1688 | diff --git a/src/Util/ActivityUtil.php b/src/Util/ActivityUtil.php
index <HASH>..<HASH> 100644
--- a/src/Util/ActivityUtil.php
+++ b/src/Util/ActivityUtil.php
@@ -119,6 +119,14 @@ abstract class ActivityUtil
$bar->setFormat(" [%bar%] %elapsed:6s% (%states%)");
$bar->start();
+ // Get the most recent created date of each of the activities, as a Unix
+ // timestamp, so that they can be more efficiently refreshed.
+ $mostRecentTimestamp = 0;
+ foreach ($activities as $activity) {
+ $created = strtotime($activity->created_at);
+ $mostRecentTimestamp = $created > $mostRecentTimestamp ? $created : $mostRecentTimestamp;
+ }
+
// Wait for the activities to complete, polling (refreshing) all of them
// with a 1 second delay.
$complete = 0;
@@ -126,7 +134,10 @@ abstract class ActivityUtil
sleep(1);
$states = [];
$complete = 0;
- $projectActivities = $project->getActivities();
+ // Get a list of activities on the project. Any of our activities
+ // which are not contained in this list must be refreshed
+ // individually.
+ $projectActivities = $project->getActivities(0, null, $mostRecentTimestamp ?: null);
foreach ($activities as $activity) {
$refreshed = false;
foreach ($projectActivities as $projectActivity) { | Use starts_at in activity batching | platformsh_platformsh-cli | train | php |
8f9c46e14598bbbd9edb732aa332daac04a81eb5 | diff --git a/types/types.js b/types/types.js
index <HASH>..<HASH> 100644
--- a/types/types.js
+++ b/types/types.js
@@ -30,7 +30,7 @@ steal.then(function() {
* @codeend
*
* Documentjs is flexible enough to let you do this with minimal effort.
- * All you have to do is to add a new type to the existing types list (documentjs/types/types.js). Let's name it __make_class.js__:
+ * All you have to do is to add a new type to the existing types folder (__documentjs/types__). Let's name it __make_class.js__:
*
* @codestart
* DocumentJS.Type("MakeClass", | Cleaned up 'types' docs. | bitovi_documentjs | train | js |
76bd2dbb9b215b64ffca626acc72e75f91043095 | diff --git a/io/eolearn/io/local_io.py b/io/eolearn/io/local_io.py
index <HASH>..<HASH> 100644
--- a/io/eolearn/io/local_io.py
+++ b/io/eolearn/io/local_io.py
@@ -83,7 +83,7 @@ class BaseLocalIo(EOTask):
def _generate_paths(path_template, timestamps):
""" Uses a filename path template to create a list of actual filename paths
"""
- if not (path_template.endswith('.tif') or path_template.endswith('.tiff')):
+ if not (path_template.lower().endswith('.tif') or path_template.lower().endswith('.tiff')):
path_template = f'{path_template}.tif'
if not timestamps: | fix(local_io): ImportFromTiff task is now able to load tiff files with uppercase extension | sentinel-hub_eo-learn | train | py |
61e4ac65d40adfc7750b6c9981f7e4a2127ad195 | diff --git a/lib/event_sourcery/event_store/postgres/optimised_event_poll_waiter.rb b/lib/event_sourcery/event_store/postgres/optimised_event_poll_waiter.rb
index <HASH>..<HASH> 100644
--- a/lib/event_sourcery/event_store/postgres/optimised_event_poll_waiter.rb
+++ b/lib/event_sourcery/event_store/postgres/optimised_event_poll_waiter.rb
@@ -51,8 +51,8 @@ module EventSourcery
@pg_connection.listen('new_event',
loop: loop,
after_listen: after_listen,
- timeout: timeout) do |channel, pid, payload|
- @events_queue.push(:new_event)
+ timeout: timeout) do |_channel, _pid, _payload|
+ @events_queue.push(:new_event_arrived)
end
end
end | Improve naming and use _ to indicate we're not using those params | envato_event_sourcery | train | rb |
05610e696a3b43c8984222c9bccc36909eca0753 | diff --git a/lib/server.js b/lib/server.js
index <HASH>..<HASH> 100644
--- a/lib/server.js
+++ b/lib/server.js
@@ -2,7 +2,8 @@ var Router = require('./router.js');
var log = require('logule').init(module, 'Server');
var url = require('url');
-var Server = function () {
+var Server = module.exports = function (cfg) {
+ this.cfg = cfg;
this.router = new Router();
return this;
};
@@ -34,24 +35,16 @@ Server.prototype.bind = function (requrl, method, flags, handler) {
this.router.on(path_array, method, flags, handler);
return this;
};
-
Server.prototype.on = function (requrl, flags, handler) {
return this.bind(requrl, 'ALL', flags, handler);
};
-
Server.prototype.get = function (requrl, flags, handler) {
return this.bind(requrl, 'GET', flags, handler);
};
-
Server.prototype.post = function (requrl, flags, handler) {
return this.bind(requrl, 'POST', flags, handler);
};
-Server.prototype.config = function (cfg) {
- this.cfg = cfg;
- return this;
-};
-
Server.prototype.start = function () {
var self = this;
@@ -80,5 +73,3 @@ Server.prototype.start = function () {
}).listen(self.cfg.https);
}
};
-
-module.exports = new Server(); | changed module.exports to class from intance | Thhethssmuz_nnn | train | js |
f5f67cef4cc5b8fc62c251b05c943a4a0ffdb07d | diff --git a/src/util.py b/src/util.py
index <HASH>..<HASH> 100644
--- a/src/util.py
+++ b/src/util.py
@@ -1,5 +1,3 @@
-#!/usr/bin/env python
-#-*- encoding: utf-8 -*-
#
# This file is part of python-gnupg, a Python wrapper around GnuPG.
# Copyright © 2013 Isis Lovecruft, Andrej B. | Remove script headers from src/util.py. | isislovecruft_python-gnupg | train | py |
8d0fdaf4aaea29310a1a7be706f0a6d4bb58b175 | diff --git a/vaex/file/other.py b/vaex/file/other.py
index <HASH>..<HASH> 100644
--- a/vaex/file/other.py
+++ b/vaex/file/other.py
@@ -912,6 +912,7 @@ class DatasetAstropyTable(DatasetArrays):
#print vars(table)
#print dir(table)
DatasetArrays.__init__(self, table.meta.get("name", "unknown-astropy"))
+ self.description = table.meta.get("description")
self.table = table
#self.name
@@ -928,6 +929,8 @@ class DatasetAstropyTable(DatasetArrays):
masked_array = self.table[name].data
if "ucd" in column._meta:
self.ucds[clean_name] = column._meta["ucd"]
+ if column.unit:
+ self.units[clean_name] = column.unit
if column.description:
self.descriptions[clean_name] = column.description
if hasattr(masked_array, "mask"): | fix: better support for ucds, units and description for astropy tables | vaexio_vaex | train | py |
3b94ac4feaf60552fee863e6987482d707586d26 | diff --git a/lib/acts_as_audited.rb b/lib/acts_as_audited.rb
index <HASH>..<HASH> 100644
--- a/lib/acts_as_audited.rb
+++ b/lib/acts_as_audited.rb
@@ -73,7 +73,7 @@ module CollectiveIdea #:nodoc:
except |= [options[:except]].flatten.collect(&:to_s) if options[:except]
write_inheritable_attribute :non_audited_columns, except
- has_many :audits, :as => :auditable, :order => 'audits.version desc'
+ has_many :audits, :as => :auditable, :order => "#{Audit.table_name}.version desc"
attr_protected :audit_ids if options[:protect]
Audit.audited_classes << self | Don't hardcode the table name. This allows unconventional table names to be used for the audits table. | collectiveidea_audited | train | rb |
e6e8dbe437a4e13018993492680493fc5a9ebd94 | diff --git a/qhue/qhue.py b/qhue/qhue.py
index <HASH>..<HASH> 100755
--- a/qhue/qhue.py
+++ b/qhue/qhue.py
@@ -105,7 +105,8 @@ def create_new_username(ip, devicetype=None, timeout=_DEFAULT_TIMEOUT):
QhueException if something went wrong with username generation (for
example, if the bridge button wasn't pressed).
"""
- res = Resource(_local_api_url(ip), timeout)
+ session = requests.Session()
+ res = Resource(_local_api_url(ip), session, timeout)
prompt = "Press the Bridge button, then press Return: "
input(prompt) | Update create_new_username to pass a session object (#<I>)
Im guessing the signature to Resource changed at some point to accept a
session as the second argument. This PR updates create_new_username to
create and pass a session object | quentinsf_qhue | train | py |
d5450d0edde6a1a51fc3807d1f51720fbebee0b2 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -67,7 +67,6 @@ setuptools.setup(
'httpx',
'phx-filters',
'pysha3',
- 'six',
],
extras_require={ | Remove 'six' from package deps | iotaledger_iota.lib.py | train | py |
a49220e67be1a3e8d3dcf3a4eb4afefdd27664a7 | diff --git a/generators/server/templates/src/main/java/package/web/rest/_ProfileInfoResource.java b/generators/server/templates/src/main/java/package/web/rest/_ProfileInfoResource.java
index <HASH>..<HASH> 100644
--- a/generators/server/templates/src/main/java/package/web/rest/_ProfileInfoResource.java
+++ b/generators/server/templates/src/main/java/package/web/rest/_ProfileInfoResource.java
@@ -53,6 +53,11 @@ public class ProfileInfoResource {
private String ribbonEnv;
+ ProfileInfoVM(String[] activeProfiles, String ribbonEnv) {
+ this.activeProfiles = activeProfiles;
+ this.ribbonEnv = ribbonEnv;
+ }
+
public String[] getActiveProfiles() {
return activeProfiles;
}
@@ -60,10 +65,5 @@ public class ProfileInfoResource {
public String getRibbonEnv() {
return ribbonEnv;
}
-
- ProfileInfoVM(String[] activeProfiles, String ribbonEnv) {
- this.activeProfiles = activeProfiles;
- this.ribbonEnv = ribbonEnv;
- }
}
} | Sonar warning: the constructor should be before the methods | jhipster_generator-jhipster | train | java |
684082eb4927756db22fb52ed8957e55c55574d1 | diff --git a/lib/deploy/repository.rb b/lib/deploy/repository.rb
index <HASH>..<HASH> 100644
--- a/lib/deploy/repository.rb
+++ b/lib/deploy/repository.rb
@@ -21,19 +21,13 @@ class Repository
end
def sync!
+ version!
commit!
tag!
push!
end
def commit!
- puts "Writing version.txt..."
- require 'fileutils'
- FileUtils.mkdir_p 'public'
- File.open('public/version.txt', 'w') do |file|
- file.write(@tag)
- end
- puts "Tagging #{@tag} as new version and committing."
message = "#{last_commit_message} - deploy"
index.add path: 'public/version.txt',
oid: (Rugged::Blob.from_workdir repo, 'public/version.txt'),
@@ -49,6 +43,11 @@ class Repository
update_ref: 'HEAD'
end
+ def version!
+ require 'fileutils'
+ FileUtils.mkdir_p 'public'
+ File.open('public/version.txt', 'w') { |file| file.puts(@tag) }
+ end
def tag!
puts "Tagging #{@tag} as new version..." | Extract file IO into separate method and remove puts | sealink_deploy_aws | train | rb |
8a3621b0fb5b640c7815363b681f83c0bd08abf9 | diff --git a/blockstack/lib/operations/namespacepreorder.py b/blockstack/lib/operations/namespacepreorder.py
index <HASH>..<HASH> 100644
--- a/blockstack/lib/operations/namespacepreorder.py
+++ b/blockstack/lib/operations/namespacepreorder.py
@@ -251,7 +251,7 @@ def parse( bin_payload, block_height ):
0 2 3 23 39 47
|-----|---|--------------------------------------|----------------|--------------------------|
- magic op hash(ns_id,script_pubkey,reveal_addr) consensus hash token fee (little-endian)
+ magic op hash(ns_id,script_pubkey,reveal_addr) consensus hash token fee (big-endian)
Returns {
'opcode': ... | docs: big-endian token representation | blockstack_blockstack-core | train | py |
98e6d3ed65b1660504a68efe96e0f42fe3150020 | diff --git a/lib/Stampie/Mailer/SendGrid.php b/lib/Stampie/Mailer/SendGrid.php
index <HASH>..<HASH> 100644
--- a/lib/Stampie/Mailer/SendGrid.php
+++ b/lib/Stampie/Mailer/SendGrid.php
@@ -117,6 +117,7 @@ class SendGrid extends Mailer
list(,$inline) = $this->processAttachments($message->getAttachments());
}
+ var_dump($message->getHeaders());
$parameters = array(
'api_user' => $username,
'api_key' => $password,
@@ -129,10 +130,14 @@ class SendGrid extends Mailer
'html' => $message->getHtml(),
'bcc' => $bccEmails,
'replyto' => $message->getReplyTo(),
- 'headers' => json_encode($message->getHeaders()),
'content' => $inline,
);
+ if ($headers = $message->getHeaders()) {
+ $parameters['headers'] = json_encode($headers);
+ }
+
+
if ($smtpApi) {
$parameters['x-smtpapi'] = json_encode(array_filter($smtpApi));
} | Only set headers when they are present. Otherwise sendgrid will throw up | Stampie_Stampie | train | php |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.