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
|
---|---|---|---|---|---|
aed13951121f4b503d48ed5226d90c9c176a9681 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,6 +12,7 @@ setup(
description='Run commands and manipulate files locally or over SSH using the same interface',
long_description=read("README.rst"),
author='Michael Williamson',
+ author_email='[email protected]',
url='http://github.com/mwilliamson/spur.py',
keywords="ssh shell subprocess process",
packages=['spur'], | Add author_email to setup.py | mwilliamson_spur.py | train | py |
f25289b9ac3889d8f8a23875c8bf6db17dd2564f | diff --git a/resources/lang/nl-NL/dashboard.php b/resources/lang/nl-NL/dashboard.php
index <HASH>..<HASH> 100644
--- a/resources/lang/nl-NL/dashboard.php
+++ b/resources/lang/nl-NL/dashboard.php
@@ -35,6 +35,7 @@ return [
'failure' => 'Er is een fout opgetreden bij het wijzigen van de incident update',
],
],
+ 'reported_by' => 'Reported by :user',
'add' => [
'title' => 'Meld een incident',
'success' => 'Incident toegevoegd.', | New translations dashboard.php (Dutch) | CachetHQ_Cachet | train | php |
385849e4c86e4a6412354ab1dab5d97581de61d9 | diff --git a/pyam_analysis/core.py b/pyam_analysis/core.py
index <HASH>..<HASH> 100644
--- a/pyam_analysis/core.py
+++ b/pyam_analysis/core.py
@@ -16,6 +16,12 @@ import seaborn as sns
# ignore warnings
warnings.filterwarnings('ignore')
+try:
+ import ixmp
+ has_ix = True
+except Exception:
+ has_ix = False
+
# disable autoscroll in Jupyter notebooks
try:
get_ipython().run_cell_magic(u'javascript', u'', | try to import 'ixmp' package (for reading timeseries from ix object) | IAMconsortium_pyam | train | py |
5a0fb79a5cdd75bc30266c632ed4068a412f6ebe | diff --git a/database/migrations/2018_01_01_000000_create_permission_tables.php b/database/migrations/2018_01_01_000000_create_permission_tables.php
index <HASH>..<HASH> 100644
--- a/database/migrations/2018_01_01_000000_create_permission_tables.php
+++ b/database/migrations/2018_01_01_000000_create_permission_tables.php
@@ -30,7 +30,7 @@ class CreatePermissionTables extends Migration
});
Schema::create($tableNames['model_has_permissions'], function (Blueprint $table) use ($tableNames) {
- $table->increments('id');
+ $table->bigInteger('id');
$table->unsignedInteger('permission_id');
$table->morphs('model');
@@ -43,7 +43,7 @@ class CreatePermissionTables extends Migration
});
Schema::create($tableNames['model_has_roles'], function (Blueprint $table) use ($tableNames) {
- $table->increments('id');
+ $table->bigInteger('id');
$table->unsignedInteger('role_id');
$table->morphs('model');
@@ -56,7 +56,7 @@ class CreatePermissionTables extends Migration
});
Schema::create($tableNames['role_has_permissions'], function (Blueprint $table) use ($tableNames) {
- $table->increments('id');
+ $table->bigInteger('id');
$table->unsignedInteger('permission_id');
$table->unsignedInteger('role_id'); | found issue in migration create_permission_table | chuckbe_chuckcms | train | php |
4ec84f5a2d93ce99c4da2557d8b05112fbc3cd80 | diff --git a/yarl/__init__.py b/yarl/__init__.py
index <HASH>..<HASH> 100644
--- a/yarl/__init__.py
+++ b/yarl/__init__.py
@@ -164,10 +164,17 @@ class URL:
if host is None:
raise ValueError(
"Invalid URL: host is required for abolute urls.")
+
+ try:
+ port = val.port
+ except ValueError:
+ raise ValueError(
+ "Invalid URL: port can't be converted to integer")
+
netloc = cls._make_netloc(val.username,
val.password,
host,
- val.port,
+ port,
encode=True)
path = cls._PATH_QUOTER(val[2])
if netloc: | Issue#<I>: give friendlier error when port cant be converted to int (#<I>) | aio-libs_yarl | train | py |
0d3a86512780512db5523c145fd1f5b6020d4528 | diff --git a/fastlane/lib/fastlane/actions/gradle.rb b/fastlane/lib/fastlane/actions/gradle.rb
index <HASH>..<HASH> 100644
--- a/fastlane/lib/fastlane/actions/gradle.rb
+++ b/fastlane/lib/fastlane/actions/gradle.rb
@@ -185,8 +185,23 @@ module Fastlane
"versionName" => "1.0.0",
# ...
}
+ )
+ ```
+
+ You can use this to automatically [sign and zipalign](https://developer.android.com/studio/publish/app-signing.html) your app:
+ ```ruby
+ gradle(
+ task: "assemble",
+ build_type: "Release",
+ print_command: false,
+ properties: {
+ "android.injected.signing.store.file" => "keystore.jks",
+ "android.injected.signing.store.password" => "store_password",
+ "android.injected.signing.key.alias" => "key_alias",
+ "android.injected.signing.key.password" => "key_password",
+ }
)',
- '# If you need to pass sensitive information through the `gradle` action, and don"t want the generated command to be printed before it is run, you can suppress that:
+ '# If you need to pass sensitive information through the `gradle` action, and don\'t want the generated command to be printed before it is run, you can suppress that:
gradle(
# ...
print_command: false | [gradle] example how to sign and zipalign app (#<I>)
* [gradle] example how to sign and zipalign app
- code example how to sign and zipalign the app with `gradle`
- replace wrong " with correct (and escaped) \'
* fix code example | fastlane_fastlane | train | rb |
8e87e67c5a7dfe85aed119eb3570414714765e28 | diff --git a/tests/unittests/helpers.py b/tests/unittests/helpers.py
index <HASH>..<HASH> 100644
--- a/tests/unittests/helpers.py
+++ b/tests/unittests/helpers.py
@@ -131,7 +131,7 @@ class ShoebotTestCase(TestCase):
seed(0)
- bot.run(code, verbose=True)
+ bot.run(code, verbose=verbose)
def run_filename(self, filename, outputfile, windowed=False, namespace=None, verbose=True):
""" | Tests: Pass verbose option through to run_code | shoebot_shoebot | train | py |
a29b6a55b272374bf671a5e529ca52450a0bc0fa | diff --git a/openquake/risklib/asset.py b/openquake/risklib/asset.py
index <HASH>..<HASH> 100644
--- a/openquake/risklib/asset.py
+++ b/openquake/risklib/asset.py
@@ -775,7 +775,7 @@ class Exposure(object):
expected_header = self._csv_header()
fnames = [os.path.join(dirname, f) for f in csvnames.split()]
for fname in fnames:
- with open(fname) as f:
+ with open(fname, encoding='utf-8') as f:
fields = next(csv.reader(f))
header = set(fields)
if len(header) < len(fields):
@@ -788,7 +788,7 @@ class Exposure(object):
(fname, sorted(expected_header), sorted(header)))
occupancy_periods = self.occupancy_periods.split()
for fname in fnames:
- with open(fname) as f:
+ with open(fname, encoding='utf-8') as f:
for i, dic in enumerate(csv.DictReader(f), 1):
asset = Node('asset', lineno=i)
with context(fname, asset): | Force the exposure to be read as UTF-8 | gem_oq-engine | train | py |
1f419175fbb913b2e8bb822553892e40b56481f2 | diff --git a/skyfield/tests/test_timelib.py b/skyfield/tests/test_timelib.py
index <HASH>..<HASH> 100644
--- a/skyfield/tests/test_timelib.py
+++ b/skyfield/tests/test_timelib.py
@@ -46,6 +46,17 @@ def test_indexing_julian_date():
assert jd.ut1[0] == jd0.ut1
assert jd.delta_t == jd0.delta_t
+def test_slicing_julian_date():
+ jd = JulianDate(utc=(1974, 10, range(1, 6)))
+ assert jd.shape == (5,)
+ jd24 = jd[2:4]
+ assert jd24.shape == (2,)
+ assert (jd.tai[2:4] == jd24.tai).all()
+ assert (jd.tt[2:4] == jd24.tt).all()
+ assert (jd.tdb[2:4] == jd24.tdb).all()
+ assert (jd.ut1[2:4] == jd24.ut1).all()
+ assert jd.delta_t == jd24.delta_t
+
def test_early_utc():
jd = JulianDate(utc=(1915, 12, 2, 3, 4, 5.6786786))
assert abs(jd.tt - 2420833.6283317441) < epsilon | Confirm that we can also slice JulianDates | skyfielders_python-skyfield | train | py |
65ce7d5d71b4dcfcfdc212eb1dfdea8292f3f33f | diff --git a/salt/states/cron.py b/salt/states/cron.py
index <HASH>..<HASH> 100644
--- a/salt/states/cron.py
+++ b/salt/states/cron.py
@@ -24,7 +24,7 @@ parameters used by Salt to define the various timing values for a cron job:
the cron job is for another user, it is necessary to specify that user with
the ``user`` parameter.
-In a time, a long ago when making changes to an existing cron job,
+In a time, a long ago (before 2014.2) when making changes to an existing cron job,
the name declaration is the parameter used to uniquely identify the job,
so if an existing cron that looks like this:
@@ -50,6 +50,7 @@ then a new cron job will be added to the user's crontab.
The current behavior is still relying on that mecanism, but you can also
specify an identifier to identify your crontabs:
+.. versionadded:: 2014.2
.. code-block:: yaml
date > /tmp/crontest:
@@ -60,6 +61,7 @@ specify an identifier to identify your crontabs:
- hour: 2
And, some monthes later, you modify it:
+.. versionadded:: 2014.2
.. code-block:: yaml
superscript > /tmp/crontest: | add some version infos for cron | saltstack_salt | train | py |
1e6c4d4c96eafa552fed2abb87f3c7877da9f663 | diff --git a/tests/test_function_manager.py b/tests/test_function_manager.py
index <HASH>..<HASH> 100644
--- a/tests/test_function_manager.py
+++ b/tests/test_function_manager.py
@@ -82,6 +82,9 @@ def test_call_to():
def find_symbol_name(self, *args, **kwargs):
return 'unknown'
+ def is_hooked(self, addr):
+ return False
+
project = dummy()
project.arch = ArchAMD64() | Fix the test_function_manager project test stub to have a is_hooked method | angr_angr | train | py |
d71fb575a0ba9993eea1d4a23c593e0df70a5c0d | diff --git a/test/client/sync-mediator.spec.js b/test/client/sync-mediator.spec.js
index <HASH>..<HASH> 100644
--- a/test/client/sync-mediator.spec.js
+++ b/test/client/sync-mediator.spec.js
@@ -55,8 +55,7 @@ describe('Test the sync via mediator', function() {
it('create works.', function() {
var ts = new Date().getTime();
- mediator.publish('sync:'+config.datasetId+':create', {id:1, value:'test1'}, ts);
- return mediator.promise('done:sync:'+config.datasetId+':create:'+ts)
+ return mediator.request('sync:'+config.datasetId+':create', [{id:1, value:'test1'}, ts], {uid: ts})
.then(function() {
return mediator.request('sync:'+config.datasetId+':list:load')
}) | Used the mediator.request promise, passing in the create arguments as an array | raincatcher-beta_raincatcher-sync | train | js |
974cde5727a0edb4203c7ddc4bebdfbca4b96f30 | diff --git a/lib/poolparty/chef.rb b/lib/poolparty/chef.rb
index <HASH>..<HASH> 100644
--- a/lib/poolparty/chef.rb
+++ b/lib/poolparty/chef.rb
@@ -56,9 +56,7 @@ module PoolParty
def node_bootsrapped?(remote_instance)
# "(gem list; dpkg -l chef) | grep -q chef && echo 'chef installed'"
- remote_instance.ssh([
- 'if [ -z "$(gem list | grep chef)" ]; then echo ""; else echo "chef installed"; fi'
- ], :do_sudo => false).empty?
+ remote_instance.ssh(['if [ ! -n "$(gem list 2>/dev/null | grep chef)" ]; then echo "chef installed"; fi'], :do_sudo => false).empty? rescue false
end
def node_bootstrap!(remote_instance)
remote_instance.ssh([
@@ -76,7 +74,11 @@ module PoolParty
end
def method_missing(m,*args,&block)
- cloud.send(m,*args,&block) if cloud.respond_to?(m)
+ if cloud.respond_to?(m)
+ cloud.send(m,*args,&block)
+ else
+ super
+ end
end
end | Adding checking to see if chef is installed on the remote instance | auser_poolparty | train | rb |
82b772f7837790271b1342f51f43476389174581 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,7 +1,7 @@
from setuptools import setup
setup(name='lifxlan',
- version='0.2',
+ version='0.2.1',
description='API for local communication with LIFX devices over a LAN.',
url='http://github.com/mclarkk/lifxlan',
author='Meghan Clark', | <I> for IP addr support | mclarkk_lifxlan | train | py |
b185a7c4682dc4e76bd536ea5de1e7cc547b8303 | diff --git a/cnxpublishing/db.py b/cnxpublishing/db.py
index <HASH>..<HASH> 100644
--- a/cnxpublishing/db.py
+++ b/cnxpublishing/db.py
@@ -1241,10 +1241,9 @@ def _upsert_persons(cursor, person_ids, lookup_func):
# Check for existing records to update.
cursor.execute("SELECT personid from persons where personid = ANY (%s)",
(person_ids,))
- try:
- existing_person_ids = [x[0] for x in cursor.fetchall()]
- except TypeError:
- existing_person_ids = []
+
+ existing_person_ids = [x[0] for x in cursor.fetchall()]
+
new_person_ids = [p for p in person_ids if p not in existing_person_ids]
# Update existing records.
@@ -1277,10 +1276,9 @@ def _upsert_users(cursor, user_ids, lookup_func):
# Check for existing records to update.
cursor.execute("SELECT username from users where username = ANY (%s)",
(user_ids,))
- try:
- existing_user_ids = [x[0] for x in cursor.fetchall()]
- except TypeError:
- existing_user_ids = []
+
+ existing_user_ids = [x[0] for x in cursor.fetchall()]
+
new_user_ids = [u for u in user_ids if u not in existing_user_ids]
# Update existing records. | removing unused exception b/c cursor.fetchall() will always return a list | openstax_cnx-publishing | train | py |
b6aa0c0d372c576590ac22f973fe1f3314971bd2 | diff --git a/pulley.js b/pulley.js
index <HASH>..<HASH> 100755
--- a/pulley.js
+++ b/pulley.js
@@ -59,7 +59,7 @@
empty: false,
hidden: true
}], function( err, result ) {
- var auth = result.username + ":" + result.password;
+ var auth = encodeURIComponent( result.username ) + ":" + encodeURIComponent( result.password );
request.post("https://" + auth + "@api.github.com/authorizations", {
json: true,
body: { | Update pulley.js: Add encodeURIComponent for auth.
Passwords can contain symbols such as '@' (which are
not allowed in that position and breaks the request). | jeresig_pulley | train | js |
1c6fb5e3975a96e70684965ca47291206caab6c3 | diff --git a/lib/action_cable/connection/base.rb b/lib/action_cable/connection/base.rb
index <HASH>..<HASH> 100644
--- a/lib/action_cable/connection/base.rb
+++ b/lib/action_cable/connection/base.rb
@@ -180,11 +180,6 @@ module ActionCable
end
end
- def allowed_origins_match? origin
- allowed_origins = Array(server.config.allowed_request_origins)
- allowed_origins.any? { |allowed_origin| allowed_origin.is_a?(Regexp) ? allowed_origin =~ origin : allowed_origin == origin }
- end
-
def respond_to_successful_request
websocket.rack_response
end | Remove unused method allowed_origins in Connection::Base | rails_rails | train | rb |
f838c213beffd20a3f100fcbe18b8ec4f0fa7120 | diff --git a/actioncable/lib/action_cable/server/base.rb b/actioncable/lib/action_cable/server/base.rb
index <HASH>..<HASH> 100644
--- a/actioncable/lib/action_cable/server/base.rb
+++ b/actioncable/lib/action_cable/server/base.rb
@@ -54,7 +54,7 @@ module ActionCable
# The worker pool is where we run connection callbacks and channel actions. We do as little as possible on the server's main thread.
# The worker pool is an executor service that's backed by a pool of threads working from a task queue. The thread pool size maxes out
- # at 4 worker threads by default. Tune the size yourself with `config.action_cable.worker_pool_size`.
+ # at 4 worker threads by default. Tune the size yourself with <tt>config.action_cable.worker_pool_size</tt>.
#
# Using Active Record, Redis, etc within your channel actions means you'll get a separate connection from each thread in the worker pool.
# Plan your deployment accordingly: 5 servers each running 5 Puma workers each running an 8-thread worker pool means at least 200 database | [ci skip] Fix formatting of documentation of worker_pool method from AC::Server::Base | rails_rails | train | rb |
aed1f1181577b550c19589ab3e4840427cf31869 | diff --git a/lib/puppet/type/pfile.rb b/lib/puppet/type/pfile.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/type/pfile.rb
+++ b/lib/puppet/type/pfile.rb
@@ -34,7 +34,34 @@ module Puppet
desc "Whether files should be backed up before
being replaced. If a filebucket_ is specified, files will be
backed up there; else, they will be backed up in the same directory
- with a ``.puppet-bak`` extension."
+ with a ``.puppet-bak`` extension.
+
+ To use filebuckets, you must first create a filebucket in your
+ configuration::
+
+ filebucket { main:
+ server => puppet
+ }
+
+ ``puppetmasterd`` creates a filebucket by default, so you can
+ usually back up to your main server with this configuration. Once
+ you've described the bucket in your configuration, you can use
+ it in any file::
+
+ file { \"/my/file\":
+ source => \"/path/in/nfs/or/something\",
+ backup => main
+ }
+
+ This will back the file up to the central server.
+
+ At this point, the only benefits to doing so are that you do not
+ have backup files lying around on each of your machines, a given
+ version of a file is only backed up once, and you can restore
+ any given file manually, no matter how old. Eventually,
+ transactional support will be able to automatically restore
+ filebucketed files.
+ "
attr_reader :bucket
defaultto true | Ooops, did not save the docs before committing.
git-svn-id: <URL> | puppetlabs_puppet | train | rb |
4b513f317bda7f84a60be8600258c6f5f356f0f7 | diff --git a/lib/how_is/sources/github/issues.rb b/lib/how_is/sources/github/issues.rb
index <HASH>..<HASH> 100644
--- a/lib/how_is/sources/github/issues.rb
+++ b/lib/how_is/sources/github/issues.rb
@@ -156,11 +156,9 @@ module HowIs::Sources
last_cursor = fetch_last_cursor
return @data if last_cursor.nil?
- after = fetch_issues(after, last_cursor)
+ after, data = fetch_issues(after, data, last_cursor)
- @data = @data.select!(&method(:issue_is_relevant?))
-
- @data
+ @data = data.select(&method(:issue_is_relevant?))
end
def issue_is_relevant?(issue)
@@ -196,7 +194,8 @@ module HowIs::Sources
end
end
- def fetch_issues(after, last_cursor)
+ def fetch_issues(after, data, last_cursor)
+ data ||= []
chunk_size = 100
after_str = ", after: #{after.inspect}" unless after.nil?
@@ -236,10 +235,10 @@ module HowIs::Sources
node
}
- @data += new_data
+ data += new_data
end
- current_last_cursor
+ [current_last_cursor, data]
end
def date_le(left, right) | More refactoring. (#2) | duckinator_inq | train | rb |
ddf6b07db73f9b5eec6fa10a97dbdf34ff6f0505 | diff --git a/scoop/launch/workerLaunch.py b/scoop/launch/workerLaunch.py
index <HASH>..<HASH> 100644
--- a/scoop/launch/workerLaunch.py
+++ b/scoop/launch/workerLaunch.py
@@ -40,6 +40,7 @@ def localWorker(workerNum, size, pythonExecutable, executable, args,
c.append("--profile")
c.append(executable)
c.extend(args)
+ logging.debug("localWorker: going to start %s" % c)
return subprocess.Popen(c)
class remoteWorker(subprocessHandling.baseRemote):
@@ -52,7 +53,8 @@ class remoteWorker(subprocessHandling.baseRemote):
pythonpath = ("export PYTHONPATH={0} "
"&&".format(pythonPath) if pythonPath else '')
broker = "127.0.0.1" if brokerIsLocalhost else brokerHostname
- self.command += [(
+
+ c = (
"{pythonpath} cd {remotePath} && {nice} {pythonExecutable} "
"-m scoop.bootstrap.__main__ "
"{echoGroup}"
@@ -78,7 +80,9 @@ class remoteWorker(subprocessHandling.baseRemote):
n=size,
executable=executable,
arguments=" ".join(args)
- )]
+ )
+ logging.debug("addWorker: adding %s" % c)
+ self.command.append(c)
def getCommand(self):
return self.command
\ No newline at end of file | add more debug info for local and remote worker | soravux_scoop | train | py |
bf543cd16018f61ed21ad4e45baf2ec5dc699dd2 | diff --git a/update/result.go b/update/result.go
index <HASH>..<HASH> 100644
--- a/update/result.go
+++ b/update/result.go
@@ -3,6 +3,7 @@ package update
import (
"fmt"
"sort"
+ "strings"
"github.com/weaveworks/flux"
)
@@ -44,14 +45,23 @@ func (r Result) ImageIDs() []string {
}
// Error returns the error for this release (if any)
-// TODO: should we concat them here? or what if there are multiple?
func (r Result) Error() string {
- for _, serviceResult := range r {
- if serviceResult.Error != "" {
- return serviceResult.Error
+ var errIds []string
+ var errStr string
+ for id, serviceResult := range r {
+ if serviceResult.Status == ReleaseStatusFailed {
+ errIds = append(errIds, id.String())
+ errStr = serviceResult.Error
}
}
- return ""
+ switch {
+ case len(errIds) == 0:
+ return ""
+ case len(errIds) == 1:
+ return fmt.Sprintf("%s failed: %s", errIds[0], errStr)
+ default:
+ return fmt.Sprintf("Multiple services failed: %s", strings.Join(errIds, ", "))
+ }
}
type ServiceResult struct { | Only report a release as failed if >0 service failed | weaveworks_flux | train | go |
00913d46754aa1039e59c8ec60a12485fc123add | diff --git a/osbs/core.py b/osbs/core.py
index <HASH>..<HASH> 100755
--- a/osbs/core.py
+++ b/osbs/core.py
@@ -29,7 +29,7 @@ class OpenshiftException(Exception):
def check_response(response):
- if response.status_code != httplib.OK:
+ if response.status_code not in (httplib.OK, httplib.CREATED):
raise OpenshiftException(response.status_code)
diff --git a/osbs/http.py b/osbs/http.py
index <HASH>..<HASH> 100644
--- a/osbs/http.py
+++ b/osbs/http.py
@@ -87,7 +87,7 @@ class Response(object):
def _check_status_code(self):
if self.status_code == 0:
self.status_code = self.curl.getinfo(pycurl.HTTP_CODE)
- if self.status_code != 0 and self.status_code != httplib.OK:
+ if self.status_code not in (0, httplib.OK, httplib.CREATED):
if self.curl:
url = self.curl.url
else: | Don't treat HTTP <I> ("Created") as an error. | projectatomic_osbs-client | train | py,py |
d5055347cec1bf3bece2bae36f3f91ab13c7b9d5 | diff --git a/frontends/default/javascripts/jquery/active_scaffold.js b/frontends/default/javascripts/jquery/active_scaffold.js
index <HASH>..<HASH> 100644
--- a/frontends/default/javascripts/jquery/active_scaffold.js
+++ b/frontends/default/javascripts/jquery/active_scaffold.js
@@ -622,7 +622,7 @@ var ActiveScaffold = {
if (typeof(element) == 'string') element = '#' + element;
var element = $(element);
if (options.singular == false) {
- if (!(options.id && $(options.id))) {
+ if (!(options.id && $('#' + options.id).size() > 0)) {
element.append(content);
}
} else { | Bugfix: jquery create-associated_record_form used prototype code; issue
<I> reported by clyfe | activescaffold_active_scaffold | train | js |
98aa5ac48663fdcc072ed57a077e9594bc4dcbe4 | diff --git a/mdata/store_mock.go b/mdata/store_mock.go
index <HASH>..<HASH> 100644
--- a/mdata/store_mock.go
+++ b/mdata/store_mock.go
@@ -26,9 +26,8 @@ func NewMockStore() *MockStore {
// add a chunk to be returned on Search()
func (c *MockStore) AddMockResult(metric string, itgen chunk.IterGen) {
- if itgens, ok := c.results[metric]; !ok {
- itgens = make([]chunk.IterGen, 0)
- c.results[metric] = itgens
+ if _, ok := c.results[metric]; !ok {
+ c.results[metric] = make([]chunk.IterGen, 0)
}
c.results[metric] = append(c.results[metric], itgen) | fix itgens not being used
thx ineffassign | grafana_metrictank | train | go |
68bc8270401dff5dfe9c3aed071bfd6759f95948 | diff --git a/cslbot/commands/metar.py b/cslbot/commands/metar.py
index <HASH>..<HASH> 100644
--- a/cslbot/commands/metar.py
+++ b/cslbot/commands/metar.py
@@ -37,7 +37,7 @@ def cmd(send, msg, args):
return
if isinstance(cmdargs.stations, list):
cmdargs.stations = ','.join(cmdargs.stations)
- req = get('https://aviationweather.gov/adds/dataserver_current/httpparam',
+ req = get('http://aviationweather.gov/adds/dataserver_current/httpparam',
params={'datasource': 'metars', 'requestType': 'retrieve',
'format': 'xml', 'mostRecentForEachStation': 'constraint',
'hoursBeforeNow': '1.25', 'stationString': cmdargs.stations}) | seems metar broke their ssl | tjcsl_cslbot | train | py |
d8f3a8c1bcd71d1b09f7e0187594236f009c3e7e | diff --git a/src/frontend/org/voltdb/iv2/Initiator.java b/src/frontend/org/voltdb/iv2/Initiator.java
index <HASH>..<HASH> 100644
--- a/src/frontend/org/voltdb/iv2/Initiator.java
+++ b/src/frontend/org/voltdb/iv2/Initiator.java
@@ -61,6 +61,4 @@ public interface Initiator
/** Write a viable replay set to the command log */
public void enableWritingIv2FaultLog();
-
- public long getCurrentTxnId();
} | Clean up multi-merge leftover interface cruft. | VoltDB_voltdb | train | java |
0fe8f693e602cc35086217d25cf653e4fe4c4ef8 | diff --git a/topologies/replset.js b/topologies/replset.js
index <HASH>..<HASH> 100644
--- a/topologies/replset.js
+++ b/topologies/replset.js
@@ -1196,7 +1196,11 @@ function executeWriteOperation(args, options, callback) {
}
const willRetryWrite =
- !args.retrying && options.retryWrites && options.session && isRetryableWritesSupported(self);
+ !args.retrying &&
+ options.retryWrites &&
+ options.session &&
+ isRetryableWritesSupported(self) &&
+ !options.session.inTransaction();
if (!self.s.replicaSetState.hasPrimary()) {
if (self.s.disconnectHandler) { | refactor(replset): don't retry writes if in a transaction | mongodb_node-mongodb-native | train | js |
d99e3504352303d932ce3e4eeba8618c1b0a28ca | diff --git a/lib/model/activity.js b/lib/model/activity.js
index <HASH>..<HASH> 100644
--- a/lib/model/activity.js
+++ b/lib/model/activity.js
@@ -570,6 +570,9 @@ Activity.prototype.applyJoin = function(callback) {
},
function(err, post) {
if (err) throw err;
+ if (!post) {
+ throw new AppError("Can't join group: no access");
+ }
post.checkRecipient(act.actor, this);
},
function(err, isRecipient) { | Handle the case where there is no post activity for a group | pump-io_pump.io | train | js |
ee6324a4979a77b71df05cec993d05e51a1a9165 | diff --git a/bibliopixel/layout/matrix.py b/bibliopixel/layout/matrix.py
index <HASH>..<HASH> 100644
--- a/bibliopixel/layout/matrix.py
+++ b/bibliopixel/layout/matrix.py
@@ -66,7 +66,7 @@ class Matrix(MultiLayout):
serpentine=serpentine,
rotation=rotation,
y_flip=vert_flip)
- else:
+ elif self.drivers:
raise TypeError(
"Must provide coord_map if using multiple drivers!") | Now layout.Matrix supports having 0 drivers | ManiacalLabs_BiblioPixel | train | py |
cb4bc69d762397f3a26f6b009e2b7fa5d706ed5f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,7 @@ f = open('README.rst')
__doc__ = f.read()
f.close()
-VERSION = "1.0.6"
+VERSION = "1.0.7"
classifiers = [
"Development Status :: 5 - Production/Stable", | Leakage of update from setup.py | teitei-tk_Simple-AES-Cipher | train | py |
90d687e8046468013f3859864f16116c08865aa3 | diff --git a/src/main/resources/META-INF/resources/primefaces-extensions/timepicker/1-timepicker.js b/src/main/resources/META-INF/resources/primefaces-extensions/timepicker/1-timepicker.js
index <HASH>..<HASH> 100644
--- a/src/main/resources/META-INF/resources/primefaces-extensions/timepicker/1-timepicker.js
+++ b/src/main/resources/META-INF/resources/primefaces-extensions/timepicker/1-timepicker.js
@@ -151,12 +151,14 @@ PrimeFacesExt.widget.TimePicker = PrimeFaces.widget.BaseWidget.extend({
mouseup: function(){
$(this).removeClass('ui-state-active');
},
- mousedown: function(){
+ mousedown: function(e){
var el = $(this);
el.addClass('ui-state-active');
var dir = el.hasClass('pe-timepicker-up') ? 1 : -1;
_self.spin(dir);
+
+ e.preventDefault();
}
});
}, | Fixed issue #<I> (timePicker issue in Chrome) | primefaces-extensions_core | train | js |
238c335d31ea24675859a59f601d82f78e61d938 | diff --git a/lib/restful_acl.rb b/lib/restful_acl.rb
index <HASH>..<HASH> 100644
--- a/lib/restful_acl.rb
+++ b/lib/restful_acl.rb
@@ -9,9 +9,9 @@ module RestfulAcl
def has_permission?
begin
- # Load the Model based on the controller name passed in
- klass = params[:controller].classify.constantize
-
+ # Load the Model based on the controller name
+ klass = self.controller_name.classify.constantize
+
# Load the object requested if the param[:id] exists
object = klass.find(params[:id]) unless params[:id].blank?
@@ -49,4 +49,4 @@ module RestfulAcl
end
end
-end
\ No newline at end of file
+end | Refactored the way the controller name is found
Thanks to Devon at kuxuesoft.com! | mdarby_restful_acl | train | rb |
d4c99ef8370815bc118273b58e614926585727e4 | diff --git a/pkg/oc/cli/admin/diagnostics/diagnostics/cluster/network/results.go b/pkg/oc/cli/admin/diagnostics/diagnostics/cluster/network/results.go
index <HASH>..<HASH> 100644
--- a/pkg/oc/cli/admin/diagnostics/diagnostics/cluster/network/results.go
+++ b/pkg/oc/cli/admin/diagnostics/diagnostics/cluster/network/results.go
@@ -14,6 +14,7 @@ import (
"github.com/openshift/source-to-image/pkg/tar"
s2ifs "github.com/openshift/source-to-image/pkg/util/fs"
+ corev1 "k8s.io/api/core/v1"
kerrs "k8s.io/apimachinery/pkg/util/errors"
kapi "k8s.io/kubernetes/pkg/apis/core"
"k8s.io/kubernetes/pkg/kubectl/polymorphichelpers"
@@ -99,7 +100,7 @@ func (d *NetworkDiagnostic) copyNetworkPodInfo(pod *kapi.Pod) error {
func (d *NetworkDiagnostic) getNetworkPodLogs(pod *kapi.Pod) error {
bytelim := int64(1024000)
- opts := &kapi.PodLogOptions{
+ opts := &corev1.PodLogOptions{
TypeMeta: pod.TypeMeta,
Container: pod.Name,
Follow: true, | Fix provided options object is not a PodLogOptions error in network diags
This seems fallout from <I> rebase (<URL>) | openshift_origin | train | go |
afaeb9ff0ca402b8d36a0f7c4128ba7af971c656 | diff --git a/src/test-environment-maker.js b/src/test-environment-maker.js
index <HASH>..<HASH> 100644
--- a/src/test-environment-maker.js
+++ b/src/test-environment-maker.js
@@ -22,12 +22,12 @@ function init(rawSyncFunction, syncFunctionFile) {
try {
environmentTemplate = fs.readFileSync(__dirname + '/templates/test-environment-template.js', 'utf8').trim();
} catch (ex) {
- console.log('ERROR: Unable to read the test helper environment template: ' + ex);
+ console.log('ERROR: Unable to read the test environment template: ' + ex);
throw ex;
}
- // The test helper environment includes a placeholder string called "%SYNC_FUNC_PLACEHOLDER%" that is to be replaced with the contents of
+ // The test environment includes a placeholder string called "%SYNC_FUNC_PLACEHOLDER%" that is to be replaced with the contents of
// the sync function
var environmentString = environmentTemplate.replace(
'%SYNC_FUNC_PLACEHOLDER%',
@@ -37,7 +37,7 @@ function init(rawSyncFunction, syncFunctionFile) {
// valid statement.
var environmentStatement = '(' + environmentString + ');';
- // Compile the test helper environment function within the current virtual machine context so it can share access to the "requireAccess",
+ // Compile the test environment function within the current virtual machine context so it can share access to the "requireAccess",
// "channel", "customActionStub", etc. stubs with the test-helper module
var environmentFunction = vm.runInThisContext(environmentStatement, options); | Issue #<I>: Minor text changes for test environment maker | Kashoo_synctos | train | js |
1d02ad2a519765179480e0ae113bcf510a2713af | diff --git a/volume/volume.go b/volume/volume.go
index <HASH>..<HASH> 100644
--- a/volume/volume.go
+++ b/volume/volume.go
@@ -5,9 +5,6 @@ import (
"os"
"runtime"
"strings"
-
- "github.com/Sirupsen/logrus"
- "github.com/docker/docker/pkg/system"
)
// DefaultDriverName is the driver name used for the driver
@@ -79,8 +76,7 @@ func (m *MountPoint) Setup() (string, error) {
return "", err
}
if runtime.GOOS != "windows" { // Windows does not have deprecation issues here
- logrus.Warnf("Auto-creating non-existent volume host path %s, this is deprecated and will be removed soon", m.Source)
- if err := system.MkdirAll(m.Source, 0755); err != nil {
+ if err := os.MkdirAll(m.Source, 0755); err != nil {
return "", err
}
} | Remove deprecation warning
Auto-creation of non-existing host directories
is no longer deprecated (9d5c<I>bed2ac<I>e<I>d<I>e3f5),
so this warning is no longer relevant.
This removes the deprecation warning.
Also removes the "system" package here, because it's only used
on non-Windows, so basically just called os.MkdirAll() | moby_moby | train | go |
a64d603dbe0f5b7dc28354299876b107780cba54 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -103,7 +103,7 @@ setup(
keywords="read reader edit editor parse parser asam mdf measurement",
# You can just specify the packages manually here if your project is
# simple. Or you can use find_packages().
- packages=find_packages(exclude=["contrib", "docs", "test"]),
+ packages=find_packages(include=("asammdf*",)),
# Alternatively, if you want to distribute just a my_module.py, uncomment
# this:
# py_modules=["my_module"],
@@ -112,14 +112,14 @@ setup(
# requirements files see:
# https://packaging.python.org/en/latest/requirements.html
install_requires=[
- "numpy>=1.16.1",
- "pandas",
- "numexpr",
- "wheel",
"canmatrix[arxml, dbc]>=0.8",
- "natsort",
"lxml",
"lz4",
+ "natsort",
+ "numexpr",
+ "numpy>=1.16.1",
+ "pandas",
+ "wheel",
],
# List additional groups of dependencies here (e.g. development
# dependencies). You can install these using the following syntax, | only include asammdf package | danielhrisca_asammdf | train | py |
5fe278efec4a13543e9bfcc8a47e93ca7419ef44 | diff --git a/pysat/instruments/methods/general.py b/pysat/instruments/methods/general.py
index <HASH>..<HASH> 100644
--- a/pysat/instruments/methods/general.py
+++ b/pysat/instruments/methods/general.py
@@ -285,4 +285,3 @@ def load_csv_data(fnames, read_csv_kwargs=None):
data = pds.DataFrame() if len(fdata) == 0 else pds.concat(fdata, axis=0)
return data
- | STY: fixed flake8
Removed extra line from the end of the file. | rstoneback_pysat | train | py |
288f79bae3f32f21a314ac734c366c16254f8b71 | diff --git a/jmetal-core/src/main/java/org/uma/jmetal/util/solutionattribute/impl/GenericSolutionAttribute.java b/jmetal-core/src/main/java/org/uma/jmetal/util/solutionattribute/impl/GenericSolutionAttribute.java
index <HASH>..<HASH> 100755
--- a/jmetal-core/src/main/java/org/uma/jmetal/util/solutionattribute/impl/GenericSolutionAttribute.java
+++ b/jmetal-core/src/main/java/org/uma/jmetal/util/solutionattribute/impl/GenericSolutionAttribute.java
@@ -35,7 +35,7 @@ public class GenericSolutionAttribute <S extends Solution<?>, V> implements Solu
}
@Override
- public static Object getAttributeID() {
+ public Object getAttributeID() {
return this.getClass() ;
}
} | undo changes in GenericSolutionAttribute | jMetal_jMetal | train | java |
8864d0dfb245e793cb73967f90a15dc5a9d00ad5 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -54,7 +54,7 @@ function coearseAddress (address) {
//opts must have appKey
module.exports = function (opts) {
- var appKey = opts.appKey
+ var appKey = (opts && opts.caps && opts.caps.shs || opts.appKey)
var defaultTimeout = (
opts.defaultTimeout || 5e3 // 5 seconds.
)
@@ -109,10 +109,11 @@ module.exports = function (opts) {
manifest: 'sync',
},
init: function (api, opts, permissions, manifest) {
+ var shsCap = (opts.caps && opts.caps.shs) || opts.appKey || appKey
var shs = Shs({
keys: opts.keys && toSodiumKeys(opts.keys),
seed: opts.seed,
- appKey: toBuffer(opts.appKey || appKey),
+ appKey: toBuffer(shsCap),
//****************************************
timeout: timeout_handshake,
@@ -187,7 +188,6 @@ module.exports = function (opts) {
close: function (err, cb) {
if(isFunction(err)) cb = err, err = null
api.closed = true
-
;(server.close || server)(function (err) {
api.emit('close', err)
cb && cb(err)
@@ -207,3 +207,7 @@ module.exports = function (opts) {
}
+
+
+
+ | take cap in consistent way with other uses of caps in ssb-* | ssbc_secret-stack | train | js |
67e0bd980ad8517dd0b47d4307e1ce3e39e90413 | diff --git a/core/Http.php b/core/Http.php
index <HASH>..<HASH> 100644
--- a/core/Http.php
+++ b/core/Http.php
@@ -444,6 +444,7 @@ class Http
// only get header info if not saving directly to file
CURLOPT_HEADER => is_resource($file) ? false : true,
CURLOPT_CONNECTTIMEOUT => $timeout,
+ CURLOPT_TIMEOUT => $timeout,
);
// Case core:archive command is triggering archiving on https:// and the certificate is not valid
if ($acceptInvalidSslCertificate) { | Fix curl timeout not set completely: this could result in Piwik hang indefinitely on an HTTP request
More particularly, this resulted in the installation hanging at the second step (system check) when using PHP's built-in webserver. | matomo-org_matomo | train | php |
7af9c2d4ea3670744e38d5d58f75b320254a6766 | diff --git a/handlers/datasets.js b/handlers/datasets.js
index <HASH>..<HASH> 100644
--- a/handlers/datasets.js
+++ b/handlers/datasets.js
@@ -21,7 +21,7 @@ export default {
create(req, res) {
counter.getNext('datasets', (datasetNumber) => {
- let offset = 100;
+ let offset = 1000;
datasetNumber += offset;
datasetNumber = 'ds' + ('000000' + datasetNumber).substr(-6,6);
req.body._id = datasetNumber;
@@ -96,4 +96,4 @@ export default {
});
}
-};
\ No newline at end of file
+}; | Bump reserved range for dataset accession numbers to 0-<I>. | OpenNeuroOrg_openneuro | train | js |
89abb29047371068d7170a1880750231af5ebda8 | diff --git a/javascript/CMSMain.AddForm.js b/javascript/CMSMain.AddForm.js
index <HASH>..<HASH> 100644
--- a/javascript/CMSMain.AddForm.js
+++ b/javascript/CMSMain.AddForm.js
@@ -42,7 +42,7 @@
var hints = this.find('.hints').data('hints'),
metadata = this.find('#ParentID .TreeDropdownField').data('metadata'),
id = this.find('#ParentID .TreeDropdownField').getValue(),
- newClassName = metadata[0].ClassName,
+ newClassName = metadata.ClassName,
disallowedChildren = hints[newClassName ? newClassName : 'Root'].disallowedChildren || [],
defaultChildClass = hints[newClassName ? newClassName : 'Root'].defaultChild || null; | MINOR Fixed reading of javascript metadata in CMSMain.AddForm.js | silverstripe_silverstripe-siteconfig | train | js |
805e223112ecdd2d02b6672f85d0dd4196c66e4a | diff --git a/lib/conceptql/annotate_grapher.rb b/lib/conceptql/annotate_grapher.rb
index <HASH>..<HASH> 100644
--- a/lib/conceptql/annotate_grapher.rb
+++ b/lib/conceptql/annotate_grapher.rb
@@ -54,7 +54,7 @@ module ConceptQL
edge_options = {}
opts = from.last[:annotation]
- types(from).tap { |t| puts [from.first, from[1], t].inspect}.each do |type|
+ types(from).each do |type|
type_opts = opts[:counts][type] || {}
#next unless (type_opts = (opts[:counts][type])).is_a?(Hash)
n = type_opts[:n] | Remove some debug output from AnnotateGrapher | outcomesinsights_conceptql | train | rb |
76297426b9c0f462f6ef973e1ede37bdbdf1ee2a | diff --git a/lib/oxidized/model/procurve.rb b/lib/oxidized/model/procurve.rb
index <HASH>..<HASH> 100644
--- a/lib/oxidized/model/procurve.rb
+++ b/lib/oxidized/model/procurve.rb
@@ -22,8 +22,6 @@ class Procurve < Oxidized::Model
new_cfg
end
- cmd 'show running-config'
-
cmd 'show version' do |cfg|
comment cfg
end
@@ -32,9 +30,11 @@ class Procurve < Oxidized::Model
comment cfg
end
+ cmd 'show running-config'
+
cfg :telnet do
- username /^\r?Username:/
- password /Password: /
+ username /Username:/
+ password /Password:/
end
cfg :telnet, :ssh do | Be more liberal about username prompt
^\r? was too strict
Also move non-config above of config, rancid-style.
Also Procurve is unbelievably shitty crapbox, screen drawing is shit,
telnet password is maximum <I> chars, ssh password maximum <I> chars, que? | ytti_oxidized | train | rb |
7ffc90312d6b2c9697a76b0bd186629d521265de | diff --git a/tests/modularinputs/test_modularinput.js b/tests/modularinputs/test_modularinput.js
index <HASH>..<HASH> 100644
--- a/tests/modularinputs/test_modularinput.js
+++ b/tests/modularinputs/test_modularinput.js
@@ -309,6 +309,10 @@ exports.setup = function() {
},
"ModularInput Input Validation fails": function(test) {
+ // Make logger noop so testoutput is cleaner
+ var loggerErrorBackup = Logger.error;
+ Logger.error = function(){};
+
exports.getScheme = function() {
return null;
};
@@ -484,6 +488,7 @@ exports.setup = function() {
test.equal(5, expectedChildren.length);
test.equal(expectedChildren.length, foundChildren.length);
+ test.ok(asObject);
test.ok(testUtils.XMLCompare(ET.parse(expected).getroot(), ET.parse(found).getroot()));
test.strictEqual(0, scriptStatus);
test.done(); | Suppress modinput logging to console for tests | splunk_splunk-sdk-javascript | train | js |
108a5e8c0901487fde73918f4782801abb6349d1 | diff --git a/python_modules/dagster/dagster/core/definitions/solid.py b/python_modules/dagster/dagster/core/definitions/solid.py
index <HASH>..<HASH> 100644
--- a/python_modules/dagster/dagster/core/definitions/solid.py
+++ b/python_modules/dagster/dagster/core/definitions/solid.py
@@ -531,15 +531,6 @@ class CompositeSolidDefinition(ISolidDefinition, IContainSolids):
return self._config_mapping is not None
@property
- def has_descendant_config_mapping(self):
- return any(
- (
- isinstance(solid, CompositeSolidDefinition) and solid.has_config_mapping
- for solid in self.iterate_solid_defs()
- )
- )
-
- @property
def has_config_entry(self):
has_child_solid_config = any([solid.definition.has_config_entry for solid in self.solids])
return ( | (make-pipeline-a-solid-1) Delete has_descendant_config_mapping
Summary: Dead code.
Test Plan: BK
Reviewers: alangenfeld
Reviewed By: alangenfeld
Differential Revision: <URL> | dagster-io_dagster | train | py |
a9495e0eee70752c14fd68dadec3b55a1a668513 | diff --git a/internal/export/distro/zeromq.go b/internal/export/distro/zeromq.go
index <HASH>..<HASH> 100644
--- a/internal/export/distro/zeromq.go
+++ b/internal/export/distro/zeromq.go
@@ -22,17 +22,18 @@ type zeroMQEventPublisher struct {
mux sync.Mutex
}
-func newZeroMQEventPublisher() zeroMQEventPublisher {
+func newZeroMQEventPublisher() sender {
newPublisher, _ := zmq.NewSocket(zmq.PUB)
LoggingClient.Info("Connecting to analytics 0MQ at: " + Configuration.AnalyticsQueue.Uri())
newPublisher.Bind(Configuration.AnalyticsQueue.Uri())
LoggingClient.Info("Connected to analytics outbound 0MQ")
- return zeroMQEventPublisher{
+ sender := &zeroMQEventPublisher{
publisher: newPublisher,
}
+ return sender
}
-func (sender zeroMQEventPublisher) Send(data []byte, event *models.Event) bool {
+func (sender *zeroMQEventPublisher) Send(data []byte, event *models.Event) bool {
sender.mux.Lock()
defer sender.mux.Unlock()
LoggingClient.Debug("Sending data to 0MQ: " + string(data[:])) | fix Send method on 0MQ publisher to be pointer | edgexfoundry_edgex-go | train | go |
a395fab96315e969b0230068b9ed3e8e01eea393 | diff --git a/lib/translate_routes.rb b/lib/translate_routes.rb
index <HASH>..<HASH> 100755
--- a/lib/translate_routes.rb
+++ b/lib/translate_routes.rb
@@ -89,7 +89,8 @@ module ActionController
@@original_named_routes = Routes.named_routes.routes.dup # Hash {:name => :route}
@@original_names = @@original_named_routes.keys
- Routes.clear!
+ #don't delete original routes
+ #Routes.clear!
new_routes = []
new_named_routes = {}
@@ -106,8 +107,8 @@ module ActionController
new_routes.concat(trans_routes)
end
-
- Routes.routes = new_routes
+ #merge old routes with new ones
+ Routes.routes |= new_routes
new_named_routes.each { |name, r| Routes.named_routes.add name, r }
@@original_names.each{ |old_name| add_untranslated_helpers_to_controllers_and_views(old_name) } | Keep original routes as we still need them | enriclluelles_route_translator | train | rb |
fc09b52a0aef8e74e817ea0e4077b0b74f9f8a70 | diff --git a/bin/formats/cmd.js b/bin/formats/cmd.js
index <HASH>..<HASH> 100644
--- a/bin/formats/cmd.js
+++ b/bin/formats/cmd.js
@@ -7,18 +7,17 @@ var child_process = require('child_process');
var fs = require('fs');
module.exports = {
- exec: function(command) {
+ exec: function(command) {
+ if (fs.existsSync('done')) {
+ fs.unlinkSync('done');
+ }
// Run the command in a subshell
child_process.exec(command + ' 2>&1 1>output && echo done! > done');
// Block the event loop until the command has executed.
while (!fs.existsSync('done')) {
// Do nothing
}
- // Read the output
- var output = fs.readFileSync('output');
- // Delete temporary files.
- fs.unlinkSync('output');
- fs.unlinkSync('done');
- return { stdout: output };
+ // Output
+ return { stdout: fs.readFileSync('output') };
}
};
\ No newline at end of file | fix : avoid errors when test crash (with temp files) | glayzzle_php-parser | train | js |
4292df70df546334d4174bcd77271253c9b7835c | diff --git a/server.go b/server.go
index <HASH>..<HASH> 100644
--- a/server.go
+++ b/server.go
@@ -137,6 +137,9 @@ func (u *Upgrader) Upgrade(w http.ResponseWriter, r *http.Request, responseHeade
}
var rw *bufio.ReadWriter
netConn, rw, err = h.Hijack()
+ if err != nil {
+ return u.returnError(w, r, http.StatusInternalServerError, err.Error())
+ }
br = rw.Reader
if br.Buffered() > 0 { | Check and handle error return from hijack. | gorilla_websocket | train | go |
9133fa60c1431f74cd420f2f95937e9428649ddc | diff --git a/storage/smiles/src/test/java/org/openscience/cdk/smiles/SmilesParserTest.java b/storage/smiles/src/test/java/org/openscience/cdk/smiles/SmilesParserTest.java
index <HASH>..<HASH> 100644
--- a/storage/smiles/src/test/java/org/openscience/cdk/smiles/SmilesParserTest.java
+++ b/storage/smiles/src/test/java/org/openscience/cdk/smiles/SmilesParserTest.java
@@ -2575,4 +2575,10 @@ public class SmilesParserTest extends CDKTestCase {
return parser.parseSmiles(smi);
}
+ public void testNoTitle() throws InvalidSmilesException {
+ SmilesParser parser = new SmilesParser(SilentChemObjectBuilder.getInstance());
+ IAtomContainer mol = parser.parseSmiles("CCC");
+ Assert.assertNull(mol.getProperty("cdk:Title"));
+ }
+
} | Unit test to make sure parsing a SMILES does not set a null cdk:Title (as <I> does, as found in Bioclipse) | cdk_cdk | train | java |
aead6b248680e9eb72dcf4c024c4a511a76091f1 | diff --git a/lib/gelf/logger.rb b/lib/gelf/logger.rb
index <HASH>..<HASH> 100644
--- a/lib/gelf/logger.rb
+++ b/lib/gelf/logger.rb
@@ -1,6 +1,9 @@
module GELF
# Methods for compatibility with Ruby Logger.
module LoggerCompatibility
+
+ attr_accessor :formatter
+
# Does nothing.
def close
end | Added formatter field to Logger | graylog-labs_gelf-rb | train | rb |
be37742e0226e3552185aafba87c15708681c1fe | diff --git a/lib/mail_chimp.rb b/lib/mail_chimp.rb
index <HASH>..<HASH> 100644
--- a/lib/mail_chimp.rb
+++ b/lib/mail_chimp.rb
@@ -6,15 +6,15 @@ module MailChimp
after_filter :create_in_mailchimp, :only => [:create]
after_filter :update_in_mailchimp, :only => [:update]
destroy.after :remove_from_mailchimp # can use r_c?
- end
- end
- def self.hominid
- @hominid ||= Hominid::Base.new({:api_key => Spree::Config.get(:mailchimp_api_key)})
- end
+ def hominid
+ @hominid ||= Hominid::Base.new({:api_key => Spree::Config.get(:mailchimp_api_key)})
+ end
- def self.mc_list_id
- Spree::Config.get(:mailchimp_list_id)
+ def mc_list_id
+ Spree::Config.get(:mailchimp_list_id)
+ end
+ end
end
def create_in_mailchimp | dont use Class methods in a controller action, it doesnt work | sbeam_spree-mail-chimp | train | rb |
f37f570fcdb5a77feb6b27eeda5e64c9ac1c7c74 | diff --git a/nbp/src/main/java/jlibs/nbp/Feeder.java b/nbp/src/main/java/jlibs/nbp/Feeder.java
index <HASH>..<HASH> 100644
--- a/nbp/src/main/java/jlibs/nbp/Feeder.java
+++ b/nbp/src/main/java/jlibs/nbp/Feeder.java
@@ -17,6 +17,7 @@ package jlibs.nbp;
import java.io.IOException;
import java.nio.CharBuffer;
+import java.nio.channels.ReadableByteChannel;
import java.nio.charset.CharacterCodingException;
/**
@@ -49,6 +50,10 @@ public class Feeder{
charBuffer.clear();
}
+ public final ReadableByteChannel byteChannel(){
+ return channel instanceof NBChannel ? ((NBChannel)channel).getChannel() : null;
+ }
+
protected Feeder child;
private Feeder parent;
public final void setChild(Feeder child){ | byteChannel() method added | santhosh-tekuri_jlibs | train | java |
8dfa58696aff81a6fa7ab2d10d859610711fdb49 | diff --git a/setuptools/extension.py b/setuptools/extension.py
index <HASH>..<HASH> 100644
--- a/setuptools/extension.py
+++ b/setuptools/extension.py
@@ -1,4 +1,6 @@
import sys
+import re
+import functools
import distutils.core
import distutils.extension
@@ -37,13 +39,10 @@ class Extension(_Extension):
if have_pyrex():
# the build has Cython, so allow it to compile the .pyx files
return
- def pyx_to_target(source):
- lang = self.language or ''
- target_ext = '.cpp' if lang.lower() == 'c++' else '.c'
- if source.endswith('.pyx'):
- source = source[:-4] + target_ext
- return source
- self.sources = list(map(pyx_to_target, self.sources))
+ lang = self.language or ''
+ target_ext = '.cpp' if lang.lower() == 'c++' else '.c'
+ sub = functools.partial(re.sub, '.pyx$', target_ext)
+ self.sources = list(map(sub, self.sources))
class Library(Extension):
"""Just like a regular Extension, but built as a library instead""" | Use functools.partial and re.sub to construct the substitution function. | pypa_setuptools | train | py |
6f99e2a9f629a10bb1f5de7cb3cd978f81c85190 | diff --git a/padatious/__init__.py b/padatious/__init__.py
index <HASH>..<HASH> 100644
--- a/padatious/__init__.py
+++ b/padatious/__init__.py
@@ -15,4 +15,4 @@
from .intent_container import IntentContainer
from .match_data import MatchData
-__version__ = '0.3.7' # Also change in setup.py
+__version__ = '0.3.8' # Also change in setup.py
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100755
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ with open(join(dirname(abspath(__file__)), 'requirements.txt')) as f:
setup(
name='padatious',
- version='0.3.7', # Also change in padatious/__init__.py
+ version='0.3.8', # Also change in padatious/__init__.py
description='A neural network intent parser',
url='http://github.com/MycroftAI/padatious',
author='Matthew Scholefield', | Increment version to <I> | MycroftAI_padatious | train | py,py |
aa56c451020e8986ad0220398af16a0bbbbd1d51 | diff --git a/frontend/controllers/ProductController.php b/frontend/controllers/ProductController.php
index <HASH>..<HASH> 100755
--- a/frontend/controllers/ProductController.php
+++ b/frontend/controllers/ProductController.php
@@ -102,7 +102,8 @@ class ProductController extends Controller
*/
private function setSeoData($model)
{
- $this->view->title = $model->translation->seoTitle ?? $model->translation->title ?? '';
+ $this->view->title = !empty(($model->translation->seoTitle)) ?
+ strip_tags($model->translation->seoTitle) : strip_tags($model->translation->title);
$this->view->registerMetaTag([
'name' => 'description',
'content' => strip_tags($model->translation->seoDescription) ?? '' | Changes getting seo title in ProductController. | black-lamp_blcms-shop | train | php |
b4935f594eaccd85fe698604ab6c8ac92dd88d4f | diff --git a/docs/conf.py b/docs/conf.py
index <HASH>..<HASH> 100644
--- a/docs/conf.py
+++ b/docs/conf.py
@@ -161,7 +161,7 @@ html_theme = 'alabaster'
# 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 = []
# Add any extra paths that contain custom files (such as robots.txt or
# .htaccess) here, relative to this directory. These files are copied | docs: Get rid of warning about missing _static/ dir | phodge_homely | train | py |
c411aca860083e283006863cc466337589847be1 | diff --git a/pyqt_distutils/build_ui.py b/pyqt_distutils/build_ui.py
index <HASH>..<HASH> 100644
--- a/pyqt_distutils/build_ui.py
+++ b/pyqt_distutils/build_ui.py
@@ -92,10 +92,10 @@ class build_ui(Command):
try:
subprocess.check_output(cmd.split(' '))
except subprocess.CalledProcessError as e:
- write_message(cmd, 'red')
+ write_message(cmd, 'yellow')
write_message(e.output, 'red')
except OSError as e:
- write_message(cmd, 'red')
+ write_message(cmd, 'yellow')
write_message(str(e), 'red')
else:
write_message(cmd, 'green') | Tweak colors
Print failing command in yellow and error message in red | ColinDuquesnoy_pyqt_distutils | train | py |
32072d78e1cdab9bec5796b59e3a8e8f499c7cfc | diff --git a/pyspectral/rayleigh.py b/pyspectral/rayleigh.py
index <HASH>..<HASH> 100644
--- a/pyspectral/rayleigh.py
+++ b/pyspectral/rayleigh.py
@@ -174,6 +174,8 @@ class Rayleigh(object):
clip_angle = np.rad2deg(np.arccos(1. / 25))
sun_zenith = np.clip(np.asarray(sun_zenith), 0, clip_angle)
sunzsec = 1. / np.cos(np.deg2rad(sun_zenith))
+ clip_angle = np.rad2deg(np.arccos(1. / 3.))
+ sat_zenith = np.clip(np.asarray(sat_zenith), 0, clip_angle)
satzsec = 1. / np.cos(np.deg2rad(np.asarray(sat_zenith)))
shape = sun_zenith.shape | Clip satellite-zenith angles outside range | pytroll_pyspectral | train | py |
a735af837196333a0717350c0c333ae024c57ffc | diff --git a/lib/coverband/collectors/coverage.rb b/lib/coverband/collectors/coverage.rb
index <HASH>..<HASH> 100644
--- a/lib/coverband/collectors/coverage.rb
+++ b/lib/coverband/collectors/coverage.rb
@@ -47,7 +47,11 @@ module Coverband
@logger.info 'coverage report: '
@logger.info @file_line_usage.inspect
end
- rescue RuntimeError => err
+ # StandardError might be better option
+ # coverband previously had RuntimeError here
+ # but runtime error can let a large number of error crash this method
+ # and this method is currently in a ensure block in middleware
+ rescue StandardError => err
failed!
if @verbose
@logger.info 'coverage missing'
@@ -83,7 +87,11 @@ module Coverband
if previous_results
new_results = {}
current_coverage.each_pair do |file, line_counts|
- new_results[file] = array_diff(line_counts, previous_results[file])
+ if previous_results[file]
+ new_results[file] = array_diff(line_counts, previous_results[file])
+ else
+ new_results[file] = line_counts
+ end
end
else
new_results = current_coverage
@@ -138,7 +146,7 @@ module Coverband
::Coverage.start unless ::Coverage.running?
else
::Coverage.start
- end
+ end
@semaphore = Mutex.new
@@previous_results = nil
reset_instance | skip calculations when previous results are missing, capture better error | danmayer_coverband | train | rb |
32ea5eecaa2ad08d353de075f505c0097b2bf3bb | diff --git a/ksamsok/ksamsok.py b/ksamsok/ksamsok.py
index <HASH>..<HASH> 100644
--- a/ksamsok/ksamsok.py
+++ b/ksamsok/ksamsok.py
@@ -135,7 +135,7 @@ class KSamsok:
uri = re.sub('rdf/', '', uri)
uri = re.sub('html/', '', uri)
uri = re.sub('jsonld/', '', uri)
-
+ uri = re.sub('museumdat/', '', uri)
# get position of the last /
try: | support museumdat as input URI | Abbe98_ksamsok-py | train | py |
a48ffaa7cc654001c9239b1e8c9f8c9c8dd166aa | diff --git a/types/plugin.go b/types/plugin.go
index <HASH>..<HASH> 100644
--- a/types/plugin.go
+++ b/types/plugin.go
@@ -26,10 +26,11 @@ type PluginConfig struct {
// Plugin represents a Docker plugin for the remote API
type Plugin struct {
- ID string `json:"Id,omitempty"`
- Name string
- Tag string
- Active bool
+ ID string `json:"Id,omitempty"`
+ Name string
+ Tag string
+ // Enabled is true when the plugin is running, is false when the plugin is not running, only installed.
+ Enabled bool
Config PluginConfig
Manifest PluginManifest
} | replace .Active by .Enabled | docker_engine-api | train | go |
b1727387881d08185cddffe2b81c3419ccb9788e | diff --git a/ehforwarderbot/__version__.py b/ehforwarderbot/__version__.py
index <HASH>..<HASH> 100644
--- a/ehforwarderbot/__version__.py
+++ b/ehforwarderbot/__version__.py
@@ -1,3 +1,3 @@
# coding=utf-8
-__version__ = "2.1.0.dev3"
+__version__ = "2.1.0" | bump: bumping version: <I>.dev3 -> <I> | blueset_ehForwarderBot | train | py |
fe8b22dd2836ee7eb64c727b3006ac38e02d8fa5 | diff --git a/test/phpunitBootstrap.php b/test/phpunitBootstrap.php
index <HASH>..<HASH> 100644
--- a/test/phpunitBootstrap.php
+++ b/test/phpunitBootstrap.php
@@ -1,11 +1,9 @@
<?php
-
-define('ARTAX_SYSDIR', dirname(__DIR__));
spl_autoload_register(function($cls) {
if (0 === strpos($cls, 'Artax\\')) {
$cls = str_replace('\\', '/', $cls);
- require ARTAX_SYSDIR . "/src/$cls.php";
+ require dirname(__DIR__) . "/src/$cls.php";
}
-});
+}); | removed constant from testing bootstrap for better multi-process testing | amphp_artax | train | php |
f5d16f2eac5a227dfef51ced178542c71e4a0bce | diff --git a/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/NavigationView.java b/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/NavigationView.java
index <HASH>..<HASH> 100644
--- a/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/NavigationView.java
+++ b/libandroid-navigation-ui/src/main/java/com/mapbox/services/android/navigation/ui/v5/NavigationView.java
@@ -240,7 +240,9 @@ public class NavigationView extends CoordinatorLayout implements LifecycleObserv
@Override
public void setCameraTrackingEnabled(boolean isEnabled) {
- camera.setCameraTrackingLocation(isEnabled);
+ if (camera != null) {
+ camera.setCameraTrackingLocation(isEnabled);
+ }
}
@Override | Null check camera tracking (#<I>) | mapbox_mapbox-navigation-android | train | java |
249ed044052fb2cae96547dd44c47e38082e71a1 | diff --git a/sark/code/instruction.py b/sark/code/instruction.py
index <HASH>..<HASH> 100644
--- a/sark/code/instruction.py
+++ b/sark/code/instruction.py
@@ -100,4 +100,4 @@ class Instruction(object):
@property
def regs(self):
- return [operand.reg for operand in self.operands]
\ No newline at end of file
+ return set(operand.reg for operand in self.operands)
\ No newline at end of file | Removed repetitions in `Instruction.regs`. | tmr232_Sark | train | py |
ce65a8bd2f967b65d67dd871df05b3c31c1d7d0d | diff --git a/windpowerlib/wind_farm.py b/windpowerlib/wind_farm.py
index <HASH>..<HASH> 100644
--- a/windpowerlib/wind_farm.py
+++ b/windpowerlib/wind_farm.py
@@ -21,7 +21,7 @@ class WindFarm(object):
Parameters
----------
- wind_turbine_fleet : :pandas:`pandas.DataFrame<frame>` or list(dict)
+ wind_turbine_fleet : :pandas:`pandas.DataFrame<frame>` or list()
Wind turbines of wind farm. DataFrame/Dictionaries must have
'wind_turbine' containing a :class:`~.wind_turbine.WindTurbine` object
and either 'number_of_turbines' (number of wind turbines of the same
@@ -38,11 +38,11 @@ class WindFarm(object):
Attributes
----------
- wind_turbine_fleet : list(dict)
- Wind turbines of wind farm. Dictionaries must have 'wind_turbine'
+ wind_turbine_fleet : :pandas:`pandas.DataFrame<frame>`
+ Wind turbines of wind farm. DataFrame must have 'wind_turbine'
(contains a :class:`~.wind_turbine.WindTurbine` object) and
'number_of_turbines' (number of wind turbines of the same turbine type
- in the wind farm) as keys.
+ in the wind farm) as columns.
efficiency : float or :pandas:`pandas.DataFrame<frame>` or None
Efficiency of the wind farm. Either constant (float) power efficiency
curve (pd.DataFrame) containing 'wind_speed' and 'efficiency' | Adapt docstring of WindFarm | wind-python_windpowerlib | train | py |
ad254671b36e02474650d7b1aea13807ebe5d6d5 | diff --git a/tests/test_project.py b/tests/test_project.py
index <HASH>..<HASH> 100644
--- a/tests/test_project.py
+++ b/tests/test_project.py
@@ -136,6 +136,7 @@ class TestProject(unittest.TestCase):
"""
uses dummy_function as func to execute tasks
"""
+
proj13 = project.Project(name='Maths Calc', fldr=root_folder, desc='run simple maths functions')
t1 = project.Task(1, 'task_1', dummy_function)
t1.add_param(param_key='a_number', param_val=3)
@@ -148,8 +149,11 @@ class TestProject(unittest.TestCase):
proj13.add_task(t1)
proj13.add_task(t2)
proj13.add_detail('info', 'This project runs a seris of calculations')
- proj13.execute_tasks()
+ dummy_projects = project.Projects()
+ dummy_projects.add_project(proj13)
+ #proj13.execute_tasks()
+ dummy_projects.run()
if __name__ == '__main__':
unittest.main()
\ No newline at end of file | using projects.run instead of project.execute to test coverage | acutesoftware_AIKIF | train | py |
85f42c9bd100cf5fd3765a6b7e45e2a499033204 | diff --git a/compat/__init__.py b/compat/__init__.py
index <HASH>..<HASH> 100644
--- a/compat/__init__.py
+++ b/compat/__init__.py
@@ -15,7 +15,11 @@ try:
except ImportError:
import six
-
+# get_indent
+if six.PY3:
+ from threading import get_ident
+else:
+ from thread import get_ident # noqa
try:
from django.conf.urls import url, patterns, include, handler404, handler500
@@ -255,6 +259,7 @@ __all__ = [
'get_model_name',
'get_user_model',
'get_username_field',
+ 'get_indent',
'import_string',
'user_model_label',
'url', | Added get_indent compatibility. | arteria_django-compat | train | py |
26b1d82a3708558cbb430feaf21aefd7725d9dd1 | diff --git a/test/unit/sandbox-libraries/pm.test.js b/test/unit/sandbox-libraries/pm.test.js
index <HASH>..<HASH> 100644
--- a/test/unit/sandbox-libraries/pm.test.js
+++ b/test/unit/sandbox-libraries/pm.test.js
@@ -497,7 +497,6 @@ describe('sandbox library - pm api', function () {
context.execute(`
var assert = require('assert');
assert.strictEqual(typeof pm.cookies.jar, 'function');
- assert.strictEqual(pm.cookies.jar().constructor.name, 'PostmanCookieJar');
`, {
context: { cookies: [] }
}, done); | Test: do not assert for private class name | postmanlabs_postman-sandbox | train | js |
43b046cf343feee050ae44a189c62711b842360b | diff --git a/lib/taps/data_stream.rb b/lib/taps/data_stream.rb
index <HASH>..<HASH> 100644
--- a/lib/taps/data_stream.rb
+++ b/lib/taps/data_stream.rb
@@ -167,7 +167,7 @@ class DataStream
log.debug "DataStream#fetch_from_resource state -> #{state.inspect}"
state[:chunksize] = Taps::Utils.calculate_chunksize(state[:chunksize]) do |c|
state[:chunksize] = c.to_i
- res = resource.post({:state => OkJson.encode(self)}, headers)
+ res = resource.post({:state => OkJson.encode(self.to_hash)}, headers)
end
begin | need to encode self.to_hash specifically | ricardochimal_taps | train | rb |
168dcf0f3881cd1d885d57855c27badb91792ce4 | diff --git a/upload/admin/model/marketing/marketing.php b/upload/admin/model/marketing/marketing.php
index <HASH>..<HASH> 100644
--- a/upload/admin/model/marketing/marketing.php
+++ b/upload/admin/model/marketing/marketing.php
@@ -43,7 +43,7 @@ class ModelMarketingMarketing extends Model {
$implode[] = "o.order_status_id = '" . (int)$order_status_id . "'";
}
- $sql = "SELECT *, (SELECT COUNT(*) FROM `" . DB_PREFIX . "order` o WHERE o.order_status_id = '" . (int)$this->config->get('config_complete_status_id') . "' AND o.marketing_id = m.marketing_id) AS orders FROM " . DB_PREFIX . "marketing m";
+ $sql = "SELECT *, (SELECT COUNT(*) FROM `" . DB_PREFIX . "order` o WHERE (" . implode(" OR ", $implode) . ") AND o.marketing_id = m.marketing_id) AS orders FROM " . DB_PREFIX . "marketing m";
$implode = array();
@@ -123,4 +123,4 @@ class ModelMarketingMarketing extends Model {
return $query->row['total'];
}
-}
\ No newline at end of file
+} | Marketing Tracking doesn't count orders | opencart_opencart | train | php |
c0bf30d0eda5f238a76b0d6bd894e5ecb4d0da52 | diff --git a/lib/buckaruby/version.rb b/lib/buckaruby/version.rb
index <HASH>..<HASH> 100644
--- a/lib/buckaruby/version.rb
+++ b/lib/buckaruby/version.rb
@@ -1,5 +1,5 @@
# frozen_string_literal: true
module Buckaruby
- VERSION = "1.2.0beta"
+ VERSION = "1.2.0"
end | Update version to <I>. | KentaaNL_buckaruby | train | rb |
ece7c259ac0ca5b651a249b75979ade194ff5e8e | diff --git a/main/app/Routing/ApiLoader.php b/main/app/Routing/ApiLoader.php
index <HASH>..<HASH> 100644
--- a/main/app/Routing/ApiLoader.php
+++ b/main/app/Routing/ApiLoader.php
@@ -228,11 +228,13 @@ class ApiLoader extends Loader
}
}
+ $mapping = array_merge($defaults, self::DEFAULT_MAP);
+
foreach ($ignore as $ignored) {
- unset($defaults[$ignored]);
+ unset($mapping[$ignored]);
}
- return array_merge($defaults, self::DEFAULT_MAP);
+ return $mapping;
}
//@see http://stackoverflow.com/questions/1589468/convert-camelcase-to-under-score-case-in-php-autoload | Update ApiLoader.php (#<I>)
better in that order | claroline_Distribution | train | php |
01a5562443e3a23c512c2339dcd95a1472e1897d | diff --git a/comparer/comparer_test.go b/comparer/comparer_test.go
index <HASH>..<HASH> 100644
--- a/comparer/comparer_test.go
+++ b/comparer/comparer_test.go
@@ -181,3 +181,37 @@ func TestDetectsModifiedContent(t *testing.T) {
3,
)
}
+
+func TestDetectsPartialBlockAtEnd(t *testing.T) {
+ const BLOCK_SIZE = 4
+ var err error
+ const A = "abcdefghijklmnopqrstuvwxyz"
+ const ORIGINAL_STRING = A
+ const MODIFIED_STRING = A
+
+ originalFileContent := bytes.NewBufferString(ORIGINAL_STRING)
+ generator := filechecksum.NewFileChecksumGenerator(BLOCK_SIZE)
+ _, reference, err := indexbuilder.BuildChecksumIndex(generator, originalFileContent)
+
+ if err != nil {
+ t.Fatal(err)
+ }
+
+ modifiedContent := bytes.NewBufferString(MODIFIED_STRING)
+
+ results := FindMatchingBlocks(
+ modifiedContent,
+ 0,
+ generator,
+ reference,
+ )
+
+ CheckResults(
+ t,
+ ORIGINAL_STRING,
+ MODIFIED_STRING,
+ results,
+ BLOCK_SIZE,
+ 7, // [abcd efgh ijkl mnop qrst uvwx yz]
+ )
+} | Adding test for partial trailing blocks in the comparer
Expected failure for now | Redundancy_go-sync | train | go |
7a2437f190a46887c0bf8479fe609b45930e0cc4 | diff --git a/vertica_python/vertica/connection.py b/vertica_python/vertica/connection.py
index <HASH>..<HASH> 100644
--- a/vertica_python/vertica/connection.py
+++ b/vertica_python/vertica/connection.py
@@ -31,7 +31,7 @@ class Connection(object):
self._cursor = Cursor(self, None)
self.options.setdefault('port', 5433)
self.options.setdefault('read_timeout', 600)
- self.boot_connection()
+ self.startup_connection()
def __enter__(self):
return self
@@ -166,11 +166,7 @@ class Connection(object):
def reset_connection(self):
self.close()
- self.boot_connection()
-
- def boot_connection(self):
self.startup_connection()
- self.initialize_connection()
def read_message(self):
try:
@@ -266,12 +262,3 @@ class Connection(object):
if isinstance(message, messages.ReadyForQuery):
break
-
- def initialize_connection(self):
- if self.options.get('search_path') is not None:
- self.query("SET SEARCH_PATH TO {0}".format(self.options['search_path']))
- if self.options.get('role') is not None:
- self.query("SET ROLE {0}".format(self.options['role']))
-
-# if self.options.get('interruptable'):
-# self.session_id = self.query("SELECT session_id FROM v_monitor.current_session").the_value() | Remove calls to unused `query` function in `Connection` class
There were some calls to a nonexistent function `query` in the
`initialize_connection` function of the `Connection` class. These
appear to be artifacts from when porting the Ruby codebase.
The queries being made were related to setting a role for the current
session, as well as setting schema search path. | vertica_vertica-python | train | py |
74ae73df425205122fd3cc4196919a2fc6c3c367 | diff --git a/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java b/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java
index <HASH>..<HASH> 100644
--- a/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java
+++ b/indexing-service/src/main/java/io/druid/indexing/overlord/http/OverlordResource.java
@@ -648,7 +648,7 @@ public class OverlordResource
task.getDataSource(),
null,
null,
- DateTimes.EPOCH,
+ task.getCreatedTime(),
DateTimes.EPOCH,
TaskLocation.unknown()
)); | Add the correct createdTime to waiting tasks (#<I>) | apache_incubator-druid | train | java |
efc2e477891015a295ddfea2990e02746bbd9a68 | diff --git a/system/Filters/CSRF.php b/system/Filters/CSRF.php
index <HASH>..<HASH> 100644
--- a/system/Filters/CSRF.php
+++ b/system/Filters/CSRF.php
@@ -72,7 +72,7 @@ class CSRF implements FilterInterface
* @param array|null $arguments
*
* @return mixed
- * @throws \Exception
+ * @throws \CodeIgniter\Security\Exceptions\SecurityException
*/
public function before(RequestInterface $request, $arguments = null)
{ | Phpstorm keeps change the @throws doc | codeigniter4_CodeIgniter4 | train | php |
b41f9a95e3d89ed32cd0f50dcef89c6593f9b642 | diff --git a/lib/tjbot.js b/lib/tjbot.js
index <HASH>..<HASH> 100644
--- a/lib/tjbot.js
+++ b/lib/tjbot.js
@@ -142,7 +142,7 @@ TJBot.prototype.services = ['conversation', 'language_translator', 'speech_to_te
TJBot.prototype.defaultConfiguration = {
verboseLogging: false,
robot: {
- gender: 'male' // see TJBot.prototype.genders
+ gender: 'male', // see TJBot.prototype.genders
name: 'TJ'
},
listen: { | again with the comma! | ibmtjbot_tjbotlib | train | js |
9059b4773936b8b11963c501481a5257d8364339 | diff --git a/build/rollup.config.min.js b/build/rollup.config.min.js
index <HASH>..<HASH> 100644
--- a/build/rollup.config.min.js
+++ b/build/rollup.config.min.js
@@ -1,8 +1,12 @@
import base from './rollup.config.base';
import uglify from 'rollup-plugin-uglify';
+import replace from 'rollup-plugin-replace';
const {name} = require('../package.json');
import {camelize} from 'toxic-utils';
const config = base('min');
+config.plugins.unshift(replace({
+ 'process.env.NODE_ENV': '"production"'
+}));
config.plugins.push(uglify());
export default Object.assign(config, {
format: 'umd', | [updare] update build for min
what:
why:
how: | Chimeejs_chimee | train | js |
b5fb5aa947a765542c86a47f6d163baec3603f43 | diff --git a/better_apidoc.py b/better_apidoc.py
index <HASH>..<HASH> 100644
--- a/better_apidoc.py
+++ b/better_apidoc.py
@@ -263,7 +263,7 @@ def _get_mod_ns(name, fullname, includeprivate):
'name': name, 'fullname': fullname, 'members': [], 'functions': [],
'classes': [], 'exceptions': [], 'subpackages': [], 'submodules': [],
'all_refs': [], 'members_imports': [], 'members_imports_refs': [],
- 'data': []}
+ 'data': [], 'doc':None}
p = 0
if includeprivate:
p = 1
@@ -276,6 +276,7 @@ def _get_mod_ns(name, fullname, includeprivate):
ns['members_imports'] = _get_members(mod, include_imported=True)[p]
ns['members_imports_refs'] = _get_members(mod, include_imported=True, as_refs=True)[p]
ns['data'] = _get_members(mod, typ='data')[p]
+ ns['doc'] = mod.__doc__
return ns | Added documentation to package and module as 'doc' | goerz_better-apidoc | train | py |
ae5fd51d71d213d0967479b2dc3cd224eca40332 | diff --git a/test/tests.es6.js b/test/tests.es6.js
index <HASH>..<HASH> 100644
--- a/test/tests.es6.js
+++ b/test/tests.es6.js
@@ -105,3 +105,23 @@ describe("collatz generator", function() {
check(gen(82), eightyTwo, 110);
});
});
+
+describe("try-catch generator", function() {
+ function *gen(x) {
+ yield 0;
+ try {
+ yield 1;
+ if (x % 2 === 0)
+ throw 2;
+ yield x;
+ } catch (x) {
+ yield x;
+ }
+ yield 3;
+ }
+
+ it("should catch exceptions properly", function() {
+ check(gen(4), [0, 1, 2, 3]);
+ check(gen(5), [0, 1, 5, 3]);
+ });
+}); | Add a test of try-catch statements. | facebook_regenerator | train | js |
2dcf168c1d03a5537bf66220bec6c702356d5c2c | diff --git a/zarr/core.py b/zarr/core.py
index <HASH>..<HASH> 100644
--- a/zarr/core.py
+++ b/zarr/core.py
@@ -1840,6 +1840,19 @@ class Array(object):
def hexdigest(self, hashname="sha1"):
"""
Compute a checksum for the data. Default uses sha1 for speed.
+
+ Examples
+ --------
+ >>> import zarr
+ >>> z = zarr.empty(shape=(10000, 10000), chunks=(1000, 1000))
+ >>> z.hexdigest()
+ '041f90bc7a571452af4f850a8ca2c6cddfa8a1ac'
+ >>> z = zarr.zeros(shape=(10000, 10000), chunks=(1000, 1000))
+ >>> z.hexdigest()
+ '7162d416d26a68063b66ed1f30e0a866e4abed60'
+ >>> z = zarr.zeros(shape=(10000, 10000), dtype="u1", chunks=(1000, 1000))
+ >>> z.hexdigest()
+ 'cb387af37410ae5a3222e893cf3373e4e4f22816'
"""
h = hashlib.new(hashname) | Provide a couple examples of hexdigest | zarr-developers_zarr | train | py |
bfb914585b87155858e59c604bd8ead4cfe880a5 | diff --git a/lib/__init__.php b/lib/__init__.php
index <HASH>..<HASH> 100755
--- a/lib/__init__.php
+++ b/lib/__init__.php
@@ -73,7 +73,7 @@ require_once('support/events/EventFiringWebElement.php');
// touch
require_once('interactions/WebDriverTouchScreen.php');
-require_once('remote/RemoteTouch.php');
+require_once('remote/RemoteTouchScreen.php');
require_once('interactions/WebDriverTouchActions.php');
require_once('interactions/touch/WebDriverTouchAction.php');
require_once('interactions/touch/WebDriverDoubleTapAction.php');
@@ -85,4 +85,4 @@ require_once('interactions/touch/WebDriverMoveAction.php');
require_once('interactions/touch/WebDriverScrollAction.php');
require_once('interactions/touch/WebDriverScrollFromElementAction.php');
require_once('interactions/touch/WebDriverTapAction.php');
-require_once('interactions/touch/WebDriverUpAction.php');
\ No newline at end of file
+require_once('interactions/touch/WebDriverUpAction.php'); | Fixed incorrect RemoteTouchScreen.php filename in __init__.php on line <I> | facebook_php-webdriver | train | php |
f2cf90680186d9941e965a8cd19a328b759520e0 | diff --git a/src/Authenticator.php b/src/Authenticator.php
index <HASH>..<HASH> 100644
--- a/src/Authenticator.php
+++ b/src/Authenticator.php
@@ -12,7 +12,7 @@ use Symfony\Component\Security\Core\User\UserProviderInterface;
use Symfony\Component\Security\Core\Exception\BadCredentialsException;
use Symfony\Component\Security\Http\Authentication\AuthenticationFailureHandlerInterface;
use Symfony\Component\HttpFoundation\Response;
-use Symfony\Component\Security\Core\User\UserChecker;
+use Symfony\Component\Security\Core\User\UserCheckerInterface;
class Authenticator implements SimplePreAuthenticatorInterface, AuthenticationFailureHandlerInterface
{
@@ -20,10 +20,10 @@ class Authenticator implements SimplePreAuthenticatorInterface, AuthenticationFa
private $coder;
/**
- * @param UserChecker $userChecker
- * @param Coder $coder
+ * @param UserCheckerInterface $userChecker
+ * @param Coder $coder
*/
- public function __construct(UserChecker $userChecker, Coder $coder)
+ public function __construct(UserCheckerInterface $userChecker, Coder $coder)
{
$this->userChecker = $userChecker;
$this->coder = $coder; | Typehint the interface rather than the implemenation | flint_Antenna | train | php |
6c01998cd2da68a328cad4adbf38835b79698798 | diff --git a/lib/heroics/client_generator.rb b/lib/heroics/client_generator.rb
index <HASH>..<HASH> 100644
--- a/lib/heroics/client_generator.rb
+++ b/lib/heroics/client_generator.rb
@@ -43,7 +43,7 @@ module Heroics
default_headers: options.fetch(:default_headers, {}),
cache: options.fetch(:cache, {}),
description: schema.description,
- schema: MultiJson.dump(schema.schema),
+ schema: MultiJson.dump(schema.schema, pretty:true),
resources: resources
}
end | generate client with pretty-printed schema, mostly for saner diffs | interagent_heroics | train | rb |
045aaff36191166259557d4f10f60a23e0e6075a | diff --git a/components/icon/icon.test.js b/components/icon/icon.test.js
index <HASH>..<HASH> 100644
--- a/components/icon/icon.test.js
+++ b/components/icon/icon.test.js
@@ -1,12 +1,11 @@
describe('Icon', function () {
var $ = require('jquery');
- var React = require('react');
var TestUtils = require('react-addons-test-utils');
var Icon = require('./icon');
var expandIcon = require('icon/source/expand.svg');
beforeEach(function () {
- this.icon = TestUtils.renderIntoDocument(new Icon({
+ this.icon = TestUtils.renderIntoDocument(Icon.factory({
glyph: expandIcon
}));
}); | Fix icons test examples after merge
Former-commit-id: <I>b<I>e<I>ad<I>c<I>fbcce<I>dc<I>b | JetBrains_ring-ui | train | js |
fe802ab573033246a0bc03be383fd40e26ca5930 | diff --git a/src/Wrep/Notificare/Apns/Certificate.php b/src/Wrep/Notificare/Apns/Certificate.php
index <HASH>..<HASH> 100644
--- a/src/Wrep/Notificare/Apns/Certificate.php
+++ b/src/Wrep/Notificare/Apns/Certificate.php
@@ -38,7 +38,7 @@ class Certificate
{
// Check if the given PEM file does exists and expand the path
$absolutePemFilePath = realpath($pemFile);
- if (false === $absolutePemFilePath) {
+ if (!is_file($absolutePemFilePath)) {
throw new \InvalidArgumentException('Could not find the given PEM file "' . $pemFile . '".');
} | Whoops, broke the build with a wonky certificate check. | mac-cain13_notificato | train | php |
f7f1015e4daa0e1cf8c79ec14d77d2e5fa3acba2 | diff --git a/api/server/version.go b/api/server/version.go
index <HASH>..<HASH> 100644
--- a/api/server/version.go
+++ b/api/server/version.go
@@ -7,7 +7,7 @@ import (
)
// Version of IronFunctions
-var Version = "0.1.49"
+var Version = "0.1.50"
func handleVersion(c *gin.Context) {
c.JSON(http.StatusOK, gin.H{"version": Version}) | functions: <I> release [skip ci] | iron-io_functions | train | go |
98945d39d7c45951bb21bb872ef0154ba823ca07 | diff --git a/fermipy/diffuse/defaults.py b/fermipy/diffuse/defaults.py
index <HASH>..<HASH> 100644
--- a/fermipy/diffuse/defaults.py
+++ b/fermipy/diffuse/defaults.py
@@ -16,7 +16,7 @@ diffuse = {
'hpx_order_ccube': (9, 'Maximum HEALPIX order for binning counts data.', int),
'hpx_order_expcube': (6, 'Maximum HEALPIX order for exposure cubes.', int),
'hpx_order_fitting': (7, 'Maximum HEALPIX order for model fitting.', int),
- 'mktimefilter': ('nosm', 'Key for gtmktime selection', str),
+ 'mktimefilter': (None, 'Key for gtmktime selection', str),
'do_ltsum': (False, 'Run gtltsum on inputs', bool),
'make_xml': (True, 'Make XML files.', bool),
'dry_run': (False, 'Print commands but do not run them', bool), | Changed default for mktimefilter to None | fermiPy_fermipy | train | py |
2514e178b0be3e4f3dbdeeed2e0b6d780de011df | diff --git a/src/test/java/org/springframework/retry/support/RetryTemplateBuilderTest.java b/src/test/java/org/springframework/retry/support/RetryTemplateBuilderTest.java
index <HASH>..<HASH> 100644
--- a/src/test/java/org/springframework/retry/support/RetryTemplateBuilderTest.java
+++ b/src/test/java/org/springframework/retry/support/RetryTemplateBuilderTest.java
@@ -163,9 +163,8 @@ public class RetryTemplateBuilderTest {
@Test(expected = IllegalArgumentException.class)
public void testFailOnNotationsMix() {
- RetryTemplate.builder()
- .retryOn(Collections.<Class<? extends Throwable>>singletonList(IOException.class))
- .notRetryOn(Collections.<Class<? extends Throwable>>singletonList(OutOfMemoryError.class));
+ RetryTemplate.builder().retryOn(Collections.<Class<? extends Throwable>>singletonList(IOException.class))
+ .notRetryOn(Collections.<Class<? extends Throwable>>singletonList(OutOfMemoryError.class));
}
/* ---------------- BackOff -------------- */ | Fix indents in the RetryTemplateBuilderTest | spring-projects_spring-retry | train | java |
a8a80427a75b66fd89a06bf42008aeba5cd80f9e | diff --git a/pyjoin/__init__.py b/pyjoin/__init__.py
index <HASH>..<HASH> 100644
--- a/pyjoin/__init__.py
+++ b/pyjoin/__init__.py
@@ -148,3 +148,10 @@ def send_sms(api_key, sms_number, sms_text, device_id=None, device_ids=None, dev
if device_names: req_url += "&deviceNames=" + device_names
requests.get(req_url)
+def set_mediavolume(api_key, mediavolume, device_id=None, device_ids=None, device_names=None):
+ if device_id is None and device_ids is None and device_names is None: return False
+ req_url = SEND_URL + api_key + "&mediaVolume=" + mediavolume
+ if device_id: req_url += "&deviceId=" + device_id
+ if device_ids: req_url += "&deviceIds=" + device_ids
+ if device_names: req_url += "&deviceNames=" + device_names
+ requests.get(req_url) | Update __init__.py
Added a set_mediavolume() call to be able to set the volume of a device before sending it a TTS notification. Volume on my GSM is normally 0, so I want to be able to set it to 5 or <I>, then send a TTS notification and eventually set it back to 0. | nkgilley_python-join-api | train | py |
3e7f4e900152ad60b421906d58e955b5a701f8f4 | diff --git a/datalad_service/handlers/draft.py b/datalad_service/handlers/draft.py
index <HASH>..<HASH> 100644
--- a/datalad_service/handlers/draft.py
+++ b/datalad_service/handlers/draft.py
@@ -31,6 +31,8 @@ class DraftResource(object):
'files': None, 'name': name, 'email': email})
commit.wait()
if not commit.failed():
+ # Attach the commit hash to response
+ media_dict['ref'] = commit.get()
resp.media = media_dict
resp.status = falcon.HTTP_OK
else: | Add missing ref to commit_files reponse. | OpenNeuroOrg_openneuro | train | py |
2c3b11b16585b38df871dfd28d53835541666f2b | diff --git a/packages/react/src/components/DatePicker/DatePicker.js b/packages/react/src/components/DatePicker/DatePicker.js
index <HASH>..<HASH> 100644
--- a/packages/react/src/components/DatePicker/DatePicker.js
+++ b/packages/react/src/components/DatePicker/DatePicker.js
@@ -329,6 +329,7 @@ export default class DatePicker extends Component {
onValueUpdate: onHook,
});
this.addKeyboardEvents(this.cal);
+ this.addRoleAttributeToDialog();
}
}
}
@@ -386,6 +387,22 @@ export default class DatePicker extends Component {
}
};
+ /**
+ * Flatpickr's calendar dialog is not rendered in a landmark causing an
+ * error with IBM Equal Access Accessibility Checker so we add an aria
+ * role to the container div.
+ */
+ addRoleAttributeToDialog = () => {
+ if (this.inputField) {
+ this.cal.calendarContainer.setAttribute('role', 'region');
+ // IBM EAAC requires an aria-label on a role='region'
+ this.cal.calendarContainer.setAttribute(
+ 'aria-label',
+ 'calendar-container'
+ );
+ }
+ };
+
addKeyboardEvents = (cal) => {
if (this.inputField) {
this.inputField.addEventListener('keydown', (e) => { | fix(Datepicker): add aria role to Flatpickr dialog (#<I>) | carbon-design-system_carbon-components | train | js |
39a3bf89917c6d38b1b892370d434b1540812b82 | diff --git a/gridData/tests/test_ccp4.py b/gridData/tests/test_ccp4.py
index <HASH>..<HASH> 100644
--- a/gridData/tests/test_ccp4.py
+++ b/gridData/tests/test_ccp4.py
@@ -60,7 +60,7 @@ def ccp4data():
('nlabl', 1),
('label', ' Map from fft '),
])
-def test_ccp4_integer_reading(ccp4data, name, value):
+def test_ccp4_read_header(ccp4data, name, value):
if type(value) is float:
assert_almost_equal(ccp4data.header[name], value, decimal=6)
else: | better name for testing reading of CCP4 header | MDAnalysis_GridDataFormats | train | py |
2b45310235d5aa730605a8d6d98f09d573447445 | diff --git a/spec/support/http_library_adapters.rb b/spec/support/http_library_adapters.rb
index <HASH>..<HASH> 100644
--- a/spec/support/http_library_adapters.rb
+++ b/spec/support/http_library_adapters.rb
@@ -86,11 +86,11 @@ HTTP_LIBRARY_ADAPTERS['curb'] = Module.new do
def make_http_request(method, url, body = nil, headers = {})
Curl::Easy.new(url) do |c|
c.headers = headers
- case method
- when :get then c.http_get
- when :post then c.http_post(body)
- when :put then c.http_put(body)
- when :delete then c.http_delete
+
+ if [:post, :put].include?(method)
+ c.send("http_#{method}", body)
+ else
+ c.send("http_#{method}")
end
end
end | Fixed curb http adapter module so it supports all HTTP methods. | vcr_vcr | train | rb |
dc18fa3b4592e1b0ddf81f0d588aef5c0484f5a9 | diff --git a/zipline/testing/predicates.py b/zipline/testing/predicates.py
index <HASH>..<HASH> 100644
--- a/zipline/testing/predicates.py
+++ b/zipline/testing/predicates.py
@@ -100,6 +100,8 @@ def keywords(func):
"""
if isinstance(func, type):
return keywords(func.__init__)
+ elif isinstance(func, partial):
+ return keywords(func.func)
return inspect.getargspec(func).args | BUG: Allow partials in assert_equal. | quantopian_zipline | train | py |
624b59987c09c9876b42121af8d17d6769709932 | diff --git a/lib/synapse/service_watcher/docker.rb b/lib/synapse/service_watcher/docker.rb
index <HASH>..<HASH> 100644
--- a/lib/synapse/service_watcher/docker.rb
+++ b/lib/synapse/service_watcher/docker.rb
@@ -35,7 +35,7 @@ module Synapse
sleep_until_next_check(start)
rescue => e
- log.warn "Error in watcher thread: #{e.inspect}"
+ log.warn "synapse: error in watcher thread: #{e.inspect}"
log.warn e.backtrace
end
end
@@ -54,7 +54,7 @@ module Synapse
begin
cnts = Docker::Util.parse_json(Docker.connection.get('/containers/json', {}))
rescue => e
- log.warn "Error polling docker host #{Docker.url}: #{e.inspect}"
+ log.warn "synapse: error polling docker host #{Docker.url}: #{e.inspect}"
next []
end
# "Ports" comes through (as of 0.6.5) as a string like "0.0.0.0:49153->6379/tcp, 0.0.0.0:49153->6379/tcp"
@@ -81,7 +81,7 @@ module Synapse
end
backends.flatten
rescue => e
- log.warn "Error while polling for containers: #{e.inspect}"
+ log.warn "synapse: error while polling for containers: #{e.inspect}"
[]
end | docker watcher: follow log convention | airbnb_synapse | train | rb |
Subsets and Splits