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 |
|---|---|---|---|---|---|
d1c35af623522fbb9e519f5194c864eb9b0808c8 | diff --git a/lxd/db/devices.go b/lxd/db/devices.go
index <HASH>..<HASH> 100644
--- a/lxd/db/devices.go
+++ b/lxd/db/devices.go
@@ -57,6 +57,7 @@ func dbDeviceTypeToInt(t string) (int, error) {
}
}
+// DevicesAdd adds a new device.
func DevicesAdd(tx *sql.Tx, w string, cID int64, devices types.Devices) error {
// Prepare the devices entry SQL
str1 := fmt.Sprintf("INSERT INTO %ss_devices (%s_id, name, type) VALUES (?, ?, ?)", w, w)
@@ -136,6 +137,7 @@ func dbDeviceConfig(db *sql.DB, id int, isprofile bool) (types.Device, error) {
return newdev, nil
}
+// Devices returns the devices matching the given filters.
func (c *Cluster) Devices(qName string, isprofile bool) (types.Devices, error) {
var q string
if isprofile { | Fix lints in lxd/db/devices.go | lxc_lxd | train | go |
4a148a8e0c5da013cb0d4d678259a1b040857976 | diff --git a/src/Vendor/Processor.php b/src/Vendor/Processor.php
index <HASH>..<HASH> 100755
--- a/src/Vendor/Processor.php
+++ b/src/Vendor/Processor.php
@@ -547,7 +547,7 @@ class Processor extends AbstractApiProcessor
$miraklBankInfo = new BankInfo();
- $this->logger->debug($bankInfoStatus,
+ $this->logger->debug(BankInfoStatus::getLabel($bankInfoStatus),
array('miraklId' => $vendor->getMiraklId(), "action" => "Wallet creation"));
switch (trim($bankInfoStatus)) {
case BankInfoStatus::BLANK: | change bank info status from label to int | hipay_hipay-wallet-cashout-mirakl-library | train | php |
9bbc18b769b53e888709d1da204edec56ba59748 | diff --git a/src/Mpociot/ApiDoc/Generators/LaravelGenerator.php b/src/Mpociot/ApiDoc/Generators/LaravelGenerator.php
index <HASH>..<HASH> 100644
--- a/src/Mpociot/ApiDoc/Generators/LaravelGenerator.php
+++ b/src/Mpociot/ApiDoc/Generators/LaravelGenerator.php
@@ -88,6 +88,11 @@ class LaravelGenerator extends AbstractGenerator
$kernel->terminate($request, $response);
+ if (file_exists($file = App::bootstrapPath().'/app.php')) {
+ $app = require $file;
+ $app->make('Illuminate\Contracts\Console\Kernel')->bootstrap();
+ }
+
return $response;
}
} | Fixes issues #<I>, #<I> (#<I>)
* Fixes issue #<I> and #<I>
* tests fix | mpociot_laravel-apidoc-generator | train | php |
88ccacce5c6cb5a0f04aab96c2c91a19dd6003a5 | diff --git a/salt/states/file.py b/salt/states/file.py
index <HASH>..<HASH> 100644
--- a/salt/states/file.py
+++ b/salt/states/file.py
@@ -1651,8 +1651,8 @@ def recurse(name,
if x.startswith(source_rel + '/'))):
ret['result'] = False
ret['comment'] = (
- 'The directory {0!r} does not exist on the salt fileserver'
- .format(source)
+ 'The directory {0!r} does not exist on the salt fileserver '
+ 'in environment {1!r}'.format(source, __env__)
)
return ret | Add environment to file state error
Just a little enhancement to error reporting. | saltstack_salt | train | py |
39b22a7a1a264f9292da47a1f5b6baf1be4547da | diff --git a/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/fs/FileSystemPluginDefinition.java b/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/fs/FileSystemPluginDefinition.java
index <HASH>..<HASH> 100644
--- a/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/fs/FileSystemPluginDefinition.java
+++ b/activiti-cycle/src/main/java/org/activiti/cycle/impl/connector/fs/FileSystemPluginDefinition.java
@@ -17,7 +17,7 @@ import org.activiti.cycle.impl.plugin.ActivitiCyclePluginDefinition;
public class FileSystemPluginDefinition implements ActivitiCyclePluginDefinition {
public static final String ARTIFACT_TYPE_BPMN_20_XML = "bpmn20.xml";
- public static final String ARTIFACT_TYPE_ORYX_XML = "oryx.xml";
+ public static final String ARTIFACT_TYPE_ORYX_XML = "signavio.xml";
public static final String ARTIFACT_TYPE_TEXT = "txt";
public static final String ARTIFACT_TYPE_XML = "xml";
public static final String ARTIFACT_TYPE_MS_WORD = "doc"; | Merging commit <I> into trunk | camunda_camunda-bpm-platform | train | java |
523d96a39d41249226fef37ab53ead8de43ad5a8 | diff --git a/atomic_reactor/plugins/post_koji_import.py b/atomic_reactor/plugins/post_koji_import.py
index <HASH>..<HASH> 100644
--- a/atomic_reactor/plugins/post_koji_import.py
+++ b/atomic_reactor/plugins/post_koji_import.py
@@ -468,15 +468,15 @@ class KojiImportBase(PostBuildPlugin):
# Collect log files
osbs_logs = OSBSLogs(self.log, get_platforms(self.workflow.data))
- output_log_files = [
+ log_files_output = [
add_log_type(add_buildroot_id(md, buildroot_id))
for md in osbs_logs.get_log_files(self.osbs, self.pipeline_run_name)
]
- for remote_source_file_output in output_log_files:
- output.append(remote_source_file_output.metadata)
+ for log_file_output in log_files_output:
+ output.append(log_file_output.metadata)
koji_upload_files.append({
- "local_filename": remote_source_file_output.filename,
- "dest_filename": remote_source_file_output.metadata["filename"],
+ "local_filename": log_file_output.filename,
+ "dest_filename": log_file_output.metadata["filename"],
})
remote_source_file_outputs, kojifile_components = get_maven_metadata(self.workflow.data) | Fix variable names to be more meaningful
* CLOUDBLD-<I> | projectatomic_atomic-reactor | train | py |
a1ca72d3182f9ad78684b50c2b0da71726dd82dd | diff --git a/spec/datagrid/helper_spec.rb b/spec/datagrid/helper_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/datagrid/helper_spec.rb
+++ b/spec/datagrid/helper_spec.rb
@@ -26,6 +26,22 @@ describe Datagrid::Helper do
) }
let(:grid) { SimpleReport.new }
+ context "when grid has no records" do
+ let(:grid) do
+ test_report do
+ scope { Entry.where("1 != 1") }
+ end
+ end
+
+ it "should show an empty table with dashes" do
+ datagrid_table = subject.datagrid_table(grid)
+
+ datagrid_table.should match_css_pattern(
+ "table.datagrid tr td.noresults" => 1
+ )
+ end
+ end
+
describe ".datagrid_table" do
it "should have grid class as html class on table" do
subject.datagrid_table(grid).should match_css_pattern( | Added a spec for a grid with no results. | bogdan_datagrid | train | rb |
7ba172b70a85b8e4f1b436bbe3cc1701e6d9c676 | diff --git a/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java b/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
index <HASH>..<HASH> 100644
--- a/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
+++ b/face/geomajas-face-common-gwt/common-gwt/src/main/java/org/geomajas/gwt/client/command/GwtCommandDispatcher.java
@@ -262,8 +262,8 @@ public final class GwtCommandDispatcher implements HasDispatchHandlers, CommandE
boolean authenticationFailed = false;
for (ExceptionDto exception : response.getExceptions()) {
authenticationFailed |= SECURITY_EXCEPTION_CLASS_NAME.equals(exception.getClassName())
- && (ExceptionCode.CREDENTIALS_MISSING_OR_INVALID == exception.getExceptionCode() || isUndefinedToken(command
- .getUserToken()));
+ && (ExceptionCode.CREDENTIALS_MISSING_OR_INVALID == exception.getExceptionCode()
+ || isUndefinedToken(command.getUserToken()));
}
if (authenticationFailed && null != tokenRequestHandler) {
handleLogin(command, deferred); | CGWT-<I> Command dispatcher should call all callbacks of a deferred after an exception | geomajas_geomajas-project-client-gwt2 | train | java |
2a9b6becc592152aad90e8432cc2df22125255c2 | diff --git a/tests/v4/test_cloning.py b/tests/v4/test_cloning.py
index <HASH>..<HASH> 100644
--- a/tests/v4/test_cloning.py
+++ b/tests/v4/test_cloning.py
@@ -1,7 +1,7 @@
import pytest
from unittest.mock import Mock
-from .conftest import EXEMPLAR_GENERATORS
+from .conftest import EXEMPLAR_GENERATORS, EXEMPLAR_PRIMITIVE_GENERATORS
@pytest.mark.parametrize("g", EXEMPLAR_GENERATORS)
@@ -23,7 +23,7 @@ def test_can_register_clones_which_are_automatically_reset(g):
dummy_clone_2.reset.assert_called_with(99999)
-@pytest.mark.parametrize("g", EXEMPLAR_GENERATORS)
+@pytest.mark.parametrize("g", EXEMPLAR_PRIMITIVE_GENERATORS)
def test_clone_generators(g):
"""
Test that g.clone() clones a generator and the resulting clone is reset when the parent is reset, producing the same elements | Test for cloning does not work for exemplar derived generators because we can't explicitly reset their input generators, so the result is not reproducible in the test | maxalbert_tohu | train | py |
dca1877de42bcb2cfd17da2ff909e11ad807c716 | diff --git a/build/worker-blob.js b/build/worker-blob.js
index <HASH>..<HASH> 100644
--- a/build/worker-blob.js
+++ b/build/worker-blob.js
@@ -1,7 +1,8 @@
var blob;
var workerSrc = mod.src;
- window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
+ var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
+ // Older, deprecated way of creating a blob
try {
blob = new BlobBuilder();
blob.append(workerSrc);
diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -14653,8 +14653,9 @@ var WorkerClient = function(topLevelNamespaces, mod, classname) {
var blob;
var workerSrc = mod.src;
- window.BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
+ var BlobBuilder = window.BlobBuilder || window.WebKitBlobBuilder || window.MozBlobBuilder || window.MSBlobBuilder;
+ // Older, deprecated way of creating a blob
try {
blob = new BlobBuilder();
blob.append(workerSrc); | fixing issue that broke editor in safari all together
- no longer setting window.BlobBuilder, instead using local var | thlorenz_brace | train | js,js |
a4ebcb026e5aadac8454e06092af0de811f5f926 | diff --git a/packages/core/renderers/bolt-base.js b/packages/core/renderers/bolt-base.js
index <HASH>..<HASH> 100644
--- a/packages/core/renderers/bolt-base.js
+++ b/packages/core/renderers/bolt-base.js
@@ -59,10 +59,10 @@ export function BoltBase(Base = HTMLElement) {
const slotName = child.getAttribute ? child.getAttribute('slot') : null;
if (!slotName) {
- elem.slots.default.push(child);
- } else {
- elem.slots[slotName] = child;
- }
+ elem.slots.default.push(child);
+ } else {
+ elem.slots[slotName] = child;
+ }
});
} | fix: fix additional indent issues | bolt-design-system_bolt | train | js |
fd7c64476046f924dc18d1c1b80f77bedbf39f85 | diff --git a/lib/services/companies.js b/lib/services/companies.js
index <HASH>..<HASH> 100755
--- a/lib/services/companies.js
+++ b/lib/services/companies.js
@@ -10,7 +10,7 @@
this.config = config;
Inherits(this);
- fields = [
+ var fields = [
'id', 'name', 'universal-name',
'email-domains', 'company-type',
'ticker', 'website-url', 'industries', | Add var keywords to fields variable declaration. | ArkeologeN_node-linkedin | train | js |
c53dda97eb29ab203cb6661098f40155d4ceb7a2 | diff --git a/pgdbpy/tools.py b/pgdbpy/tools.py
index <HASH>..<HASH> 100644
--- a/pgdbpy/tools.py
+++ b/pgdbpy/tools.py
@@ -42,7 +42,6 @@ class PgDbPy(object):
sys.exit(1)
self.data_window_size = DEFAULT_DATA_WINDOW_SIZE
- self.sleep_time = DEFAULT_SLEEP_TIME
if MYNAME in cfg.cfg_dict:
module_cfgdict = cfg.cfg_dict[MYNAME]
if 'data_window_size' in module_cfgdict:
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -7,7 +7,7 @@ with open("README", 'r') as f:
setup(
name='pgdbpy',
- version='1.0.11',
+ version='1.0.12',
description='A simple PostgreSQL database connection manager that exploits the power of cfgpy',
license="Mozilla Public License 2.0 (MPL 2.0)",
long_description='A simple PostgreSQL database connection manager that exploits the power of cfgpy.', | fixed 'DEFAULT_SLEEP_TIME' is not defined bug | phenicle_pgdbpy | train | py,py |
197625669ff64f18a2a2b9a9079e04caafab00ea | diff --git a/test/time/conversions_test.rb b/test/time/conversions_test.rb
index <HASH>..<HASH> 100644
--- a/test/time/conversions_test.rb
+++ b/test/time/conversions_test.rb
@@ -3,14 +3,13 @@ require 'test_helper'
class Time::ConversionsTest < ActiveSupport::TestCase
test 'to_time should return same object' do
yaml = '2015-08-06 00:00:00 Z'
+
time = yaml.to_time
time2 = time.to_time
assert Time === time, 'time was not a Time'
assert Time === time2, 'time2 was not a Time'
- assert_equal '06.08.2015', time.to_s
- assert_equal '06.08.2015', time2.to_s
assert_equal time.object_id, time2.object_id
end
end | # Don't test activesupport string parsing | PublicHealthEngland_ndr_support | train | rb |
0bf0420ce3f1148c1beb65b652c0a64b533fa634 | diff --git a/lib/inline_svg/static_asset_finder.rb b/lib/inline_svg/static_asset_finder.rb
index <HASH>..<HASH> 100644
--- a/lib/inline_svg/static_asset_finder.rb
+++ b/lib/inline_svg/static_asset_finder.rb
@@ -1,7 +1,9 @@
+require "pathname"
+
# Naive fallback asset finder for when sprockets >= 3.0 &&
# config.assets.precompile = false
# Thanks to @ryanswood for the original code:
-# https://github.com/AbleHealth/inline_svg/commit/661bbb3bef7d1b4bd6ccd63f5f018305797b9509
+# https://github.com/jamesmartin/inline_svg/commit/661bbb3bef7d1b4bd6ccd63f5f018305797b9509
module InlineSvg
class StaticAssetFinder
def self.find_asset(filename)
@@ -14,7 +16,7 @@ module InlineSvg
def pathname
if ::Rails.application.config.assets.compile
- ::Rails.application.assets[@filename].pathname
+ Pathname.new(::Rails.application.assets[@filename].filename)
else
manifest = ::Rails.application.assets_manifest
asset_path = manifest.assets[@filename] | Fix bad reference to Sprockets::Asset.pathname | jamesmartin_inline_svg | train | rb |
59411b04b28dcb3069dead302bb4f4fd7da9b945 | diff --git a/tests/tests.py b/tests/tests.py
index <HASH>..<HASH> 100644
--- a/tests/tests.py
+++ b/tests/tests.py
@@ -339,7 +339,7 @@ class ConnectionClosing(unittest.TestCase):
# test overall recovery
conn._conn._sock.close()
with conn.cursor() as cur:
- with self.assertRaises(socket.error):
+ with self.assertRaises(Exception):
cur.execute('select 1')
cur.execute('select 1')
cur.fetchall()
@@ -348,7 +348,7 @@ class ConnectionClosing(unittest.TestCase):
tds_submit_query(cur._session, 'select 1')
conn._conn._sock.close()
self.assertTrue(cur._session.is_connected())
- with self.assertRaises(socket.error):
+ with self.assertRaises(Exception):
tds_process_tokens(cur._session, TDS_TOKEN_RESULTS)
self.assertFalse(cur._session.is_connected()) | fixed tests for python3 | denisenkom_pytds | train | py |
2dd9d29882d5e8a0836b1fca8310606ebfbcb41b | diff --git a/wallace/models.py b/wallace/models.py
index <HASH>..<HASH> 100644
--- a/wallace/models.py
+++ b/wallace/models.py
@@ -551,7 +551,10 @@ class Node(Base):
.filter_by(destination_id=self.id, status="received", failed=False).all()
info_ids = [t.info_id for t in transmissions]
- return type.query.filter(type.id.in_(info_ids)).all()
+ if info_ids:
+ return type.query.filter(type.id.in_(info_ids)).all()
+ else:
+ return []
def transmissions(self, direction="outgoing", status="all"):
""" | received_infos only does a query if transmissions have been received | berkeley-cocosci_Wallace | train | py |
ef559a484828c03335402ad89721cd6ea812ca95 | diff --git a/src/react/LogMonitor.js b/src/react/LogMonitor.js
index <HASH>..<HASH> 100644
--- a/src/react/LogMonitor.js
+++ b/src/react/LogMonitor.js
@@ -54,7 +54,8 @@ export default class LogMonitor extends Component {
jumpToState: PropTypes.func.isRequired,
setMonitorState: PropTypes.func.isRequired,
select: PropTypes.func.isRequired,
- visibleOnLoad: PropTypes.bool
+ visibleOnLoad: PropTypes.bool,
+ theme: PropTypes.object
};
static defaultProps = { | fix(LogMonitor): add theme to propTypes | reduxjs_redux-devtools | train | js |
635de93a9329f3f3fbf53473542b266805f81cc6 | diff --git a/packages/ember-views/tests/system/render_buffer_test.js b/packages/ember-views/tests/system/render_buffer_test.js
index <HASH>..<HASH> 100644
--- a/packages/ember-views/tests/system/render_buffer_test.js
+++ b/packages/ember-views/tests/system/render_buffer_test.js
@@ -179,6 +179,6 @@ test("properly handles old IE's zero-scope bug", function() {
buffer.push('<script></script>foo');
var element = buffer.element();
- ok($(element).html().match(/script/i), "should have script tag");
- ok(!$(element).html().match(/­/), "should not have ­");
+ ok(Ember.$(element).html().match(/script/i), "should have script tag");
+ ok(!Ember.$(element).html().match(/­/), "should not have ­");
}); | Use Ember.$ in the tests | emberjs_ember.js | train | js |
256c9c1b3a0988158c938a73d16e182a54f0dfe0 | diff --git a/inc/shortcodes/glossary/class-glossary.php b/inc/shortcodes/glossary/class-glossary.php
index <HASH>..<HASH> 100644
--- a/inc/shortcodes/glossary/class-glossary.php
+++ b/inc/shortcodes/glossary/class-glossary.php
@@ -309,7 +309,7 @@ class Glossary {
* @return string
*/
public function exportShortcodeHandler( $atts, $content ) {
- return $content;
+ return "<span class='glossary-term'>" . $content . '</span>';
}
/** | Adding span wrapper for glossary term shortcode in export action | pressbooks_pressbooks | train | php |
d7ec631da6d3042f72b168d099b17e5d85670416 | diff --git a/azurerm/resource_arm_private_dns_srv_record.go b/azurerm/resource_arm_private_dns_srv_record.go
index <HASH>..<HASH> 100644
--- a/azurerm/resource_arm_private_dns_srv_record.go
+++ b/azurerm/resource_arm_private_dns_srv_record.go
@@ -208,6 +208,13 @@ func flattenAzureRmPrivateDnsSrvRecords(records *[]privatedns.SrvRecord) []map[s
if records != nil {
for _, record := range *records {
+ if record.Priority == nil ||
+ record.Weight == nil ||
+ record.Port == nil ||
+ record.Target == nil {
+ continue
+ }
+
results = append(results, map[string]interface{}{
"priority": *record.Priority,
"weight": *record.Weight, | Added dereference nil checks | terraform-providers_terraform-provider-azurerm | train | go |
d1da48ff0f396f04b02d1a9dc33c62f8494b38e2 | diff --git a/script/lib/config.py b/script/lib/config.py
index <HASH>..<HASH> 100644
--- a/script/lib/config.py
+++ b/script/lib/config.py
@@ -9,7 +9,7 @@ import sys
BASE_URL = os.getenv('LIBCHROMIUMCONTENT_MIRROR') or \
'https://s3.amazonaws.com/github-janky-artifacts/libchromiumcontent'
LIBCHROMIUMCONTENT_COMMIT = os.getenv('LIBCHROMIUMCONTENT_COMMIT') or \
- '76bb29da18cbeec0051e0690bc1b95e78034a422'
+ 'd59491fbd40f98ae72dfa575fd2b477c061ce613'
PLATFORM = {
'cygwin': 'win32', | Upgrade libcc for Chrome <I> Linux key event fix | electron_electron | train | py |
ba7946a057e88a86dee6eb29d54337b820652e6c | diff --git a/manta_test.go b/manta_test.go
index <HASH>..<HASH> 100644
--- a/manta_test.go
+++ b/manta_test.go
@@ -8,6 +8,7 @@ import (
"github.com/stretchr/testify/assert"
)
+func TestMatch2159568145(t *testing.T) { testScenarios[2159568145].test(t) }
func TestMatch2109130988(t *testing.T) { testScenarios[2109130988].test(t) }
func TestMatch1855408730(t *testing.T) { testScenarios[1855408730].test(t) }
@@ -55,6 +56,18 @@ type testScenario struct {
}
var testScenarios = map[int64]testScenario{
+ 2159568145: {
+ matchId: "2159568145",
+ replayUrl: "https://s3-us-west-2.amazonaws.com/manta.dotabuff/2159568145.dem",
+ expectGameBuild: 1295,
+ expectEntityEvents: 1072803,
+ expectCombatLogDamage: 0,
+ expectCombatLogHealing: 0,
+ expectCombatLogDeaths: 0,
+ expectCombatLogEvents: 0,
+ expectUnitOrderEvents: 40297,
+ },
+
2109130988: {
matchId: "2109130988",
replayUrl: "https://s3-us-west-2.amazonaws.com/manta.dotabuff/2109130988.dem", | failing testcase for build <I> | dotabuff_manta | train | go |
45972b44cfd901c914f74c8e774f3dbc9a2d583c | diff --git a/src/components/ToggleSmall/ToggleSmall.js b/src/components/ToggleSmall/ToggleSmall.js
index <HASH>..<HASH> 100644
--- a/src/components/ToggleSmall/ToggleSmall.js
+++ b/src/components/ToggleSmall/ToggleSmall.js
@@ -67,6 +67,7 @@ const ToggleSmall = ({
</svg>
)}
</span>
+ <span class={`${prefix}--assistive-text`}>{ariaLabel}</span>
</label>
</div>
); | fix(a<I>y): avoid empty label in ToggleSmall (#<I>)
Fixes #<I>. | carbon-design-system_carbon-components-react | train | js |
1dc026c8362a973d7eb5278a3ac85262f6911c9d | diff --git a/lib/findConfig.js b/lib/findConfig.js
index <HASH>..<HASH> 100644
--- a/lib/findConfig.js
+++ b/lib/findConfig.js
@@ -67,7 +67,7 @@ module.exports = function(opts) {
}
return pack(
- Object.assign(defaults, config, opts)
+ Object.assign(defaults, opts, config)
);
} | Override default options with config
Looks like this is the reason why custom config is not having effect <URL> | reapp_reapp | train | js |
9f4aeb4b624b7cf0dcbb3d7beb0a72e53d4d8b21 | diff --git a/lxd/db/projects.go b/lxd/db/projects.go
index <HASH>..<HASH> 100644
--- a/lxd/db/projects.go
+++ b/lxd/db/projects.go
@@ -47,15 +47,21 @@ type ProjectFilter struct {
}
// ToAPI converts the database Project struct to an api.Project entry.
-func (p *Project) ToAPI() api.Project {
- return api.Project{
+func (p *Project) ToAPI(tx *ClusterTx) (*api.Project, error) {
+ apiProject := &api.Project{
ProjectPut: api.ProjectPut{
- Config: p.Config,
Description: p.Description,
},
- Name: p.Name,
- UsedBy: p.UsedBy,
+ Name: p.Name,
}
+
+ var err error
+ apiProject.Config, err = tx.GetProjectConfig(p.ID)
+ if err != nil {
+ return nil, err
+ }
+
+ return apiProject, nil
}
// ProjectHasProfiles is a helper to check if a project has the profiles | lxd/db/projects: Populate config in ToAPI | lxc_lxd | train | go |
39cc609ff9532a471d374f0c0b75a048c747b162 | diff --git a/HARK/ConsumptionSaving/ConsIndShockModel.py b/HARK/ConsumptionSaving/ConsIndShockModel.py
index <HASH>..<HASH> 100644
--- a/HARK/ConsumptionSaving/ConsIndShockModel.py
+++ b/HARK/ConsumptionSaving/ConsIndShockModel.py
@@ -893,8 +893,7 @@ class ConsIndShockSolverBasic(ConsIndShockSetup):
cFuncNowUnc = interpolator(mNrm,cNrm)
# Combine the constrained and unconstrained functions into the true consumption function
- cFuncNow = LowerEnvelope(cFuncNowUnc, self.cFuncNowCnst,
- nan_bool = False)
+ cFuncNow = LowerEnvelope(cFuncNowUnc, self.cFuncNowCnst, nan_bool = False)
# Make the marginal value function and the marginal marginal value function
vPfuncNow = MargValueFunc(cFuncNow,self.CRRA) | Fix one line break
One line break in a PR I merged in was invalid in Python <I>, should now be fixed. | econ-ark_HARK | train | py |
ca869802c15ef7dfd9644eddabd52cf2fc50d27e | diff --git a/generator/pkg/schemagen/generate.go b/generator/pkg/schemagen/generate.go
index <HASH>..<HASH> 100644
--- a/generator/pkg/schemagen/generate.go
+++ b/generator/pkg/schemagen/generate.go
@@ -175,6 +175,9 @@ func (g *schemaGenerator) jsonDescriptor(t reflect.Type) *JSONDescriptor {
return &JSONDescriptor{Type: "boolean"}
case reflect.String:
return &JSONDescriptor{Type: "string"}
+ case reflect.Interface:
+ // When having something like: Tag interface{}, it should be mapped into "Tag Object".
+ return &JSONDescriptor{Type: "object"}
}
panic("Nothing for " + t.Name())
@@ -563,6 +566,11 @@ func (g *schemaGenerator) fieldCategory(field reflect.StructField) FieldType {
case reflect.Map:
return MAP
case reflect.Interface:
+ // Special case when "interface {}" is a Interface kind, but meant to be mapped to Objects
+ if fieldType.String() == "interface {}" {
+ return SIMPLE
+ }
+
return INTERFACE
default: | Fix mapping to "interface{}" to Object | fabric8io_kubernetes-client | train | go |
49f087ea3822af3cfd846442bf4f0f0641689d6c | diff --git a/tests/test_fetcher_processor.py b/tests/test_fetcher_processor.py
index <HASH>..<HASH> 100644
--- a/tests/test_fetcher_processor.py
+++ b/tests/test_fetcher_processor.py
@@ -89,9 +89,12 @@ class TestFetcherProcessor(unittest.TestCase):
return False
return status.get('track', {}).get(type, {}).get('ok', False)
+ '''
+ #not used
@classmethod
def __getattr__(self, name):
return name
+ '''
@classmethod
def some_class_method(self): | tracing "unexpected successes" | binux_pyspider | train | py |
759bbece610ad93965112eed700abe9c6b16fe37 | diff --git a/spec/unit/settings/ini_file_spec.rb b/spec/unit/settings/ini_file_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/settings/ini_file_spec.rb
+++ b/spec/unit/settings/ini_file_spec.rb
@@ -154,7 +154,7 @@ name = value
# this is the preceding comment
[section]
ascii = foo
- #{mixed_utf8} = bar
+ A\u06FF\u16A0\u{2070E} = bar
# this is the trailing comment
CONFIG | (PUP-<I>) Work around JRuby issue #<I>
By using a literal string with no interpolation in the construction of a
stringio instance we avoid a subtle string sharing bug that was causing
corruption.
<URL> | puppetlabs_puppet | train | rb |
3fc88407639475739a85c72d3f580683b262078e | diff --git a/src/main/java/eu/hansolo/tilesfx/skins/TileSkin.java b/src/main/java/eu/hansolo/tilesfx/skins/TileSkin.java
index <HASH>..<HASH> 100644
--- a/src/main/java/eu/hansolo/tilesfx/skins/TileSkin.java
+++ b/src/main/java/eu/hansolo/tilesfx/skins/TileSkin.java
@@ -264,7 +264,7 @@ public class TileSkin extends SkinBase<Tile> implements Skin<Tile> {
//pane.relocate((width - size) * 0.5, (height - size) * 0.5);
double offsetTop = tile.getTitle().isEmpty() ? inset : size * 0.15;
- double offsetBottom = tile.getText().isEmpty() ? height - inset : height - size * 0.15;
+ double offsetBottom = (tile.getText().isEmpty() || !tile.isTextVisible()) ? height - inset : height - size * 0.15;
contentBounds.setX(inset);
contentBounds.setY(offsetTop);
contentBounds.setWidth(width - doubleInset); | Added support for textVisible in TileSkin | HanSolo_tilesfx | train | java |
48f25d9ed7ac149a67b23c179f7c60f12484de68 | diff --git a/core/corehttp/metrics.go b/core/corehttp/metrics.go
index <HASH>..<HASH> 100644
--- a/core/corehttp/metrics.go
+++ b/core/corehttp/metrics.go
@@ -32,6 +32,7 @@ func MetricsCollectionOption(handlerName string) ServeOption {
reqCnt := prometheus.NewCounterVec(
prometheus.CounterOpts{
+ Namespace: opts.Namespace,
Subsystem: opts.Subsystem,
Name: "requests_total",
Help: "Total number of HTTP requests made.", | pass opts.Namespace along like before | ipfs_go-ipfs | train | go |
28352e09b1e76acca6d84ad8148d1f6edc3835a3 | diff --git a/bridge/doctrine-phpcr-odm/tests/Functional/GeneralTest.php b/bridge/doctrine-phpcr-odm/tests/Functional/GeneralTest.php
index <HASH>..<HASH> 100644
--- a/bridge/doctrine-phpcr-odm/tests/Functional/GeneralTest.php
+++ b/bridge/doctrine-phpcr-odm/tests/Functional/GeneralTest.php
@@ -203,7 +203,6 @@ class GeneralTest extends PhpcrOdmTestCase
$article->objectReferences = [$article1, $article2];
$article = $this->persistAndReloadArticle($article);
- $article = $this->documentManager->find(null, '/test/article');
$this->assertCount(2, $article->objectReferences);
$this->assertEquals('/test/article1', $article->objectReferences[0]->id);
$this->assertEquals('/test/article2', $article->objectReferences[1]->id); | ORM scalar array support | psiphp_content-type | train | php |
078aba2492730525260ef07491d2385cc9c233ff | diff --git a/src/golibmc.go b/src/golibmc.go
index <HASH>..<HASH> 100644
--- a/src/golibmc.go
+++ b/src/golibmc.go
@@ -386,7 +386,7 @@ func (client *Client) conn(ctx context.Context) (*conn, error) {
return cn, err
}
-func (client *Client) _conn(ctx context.Context, useFreeClient bool) (*conn, error) {
+func (client *Client) _conn(ctx context.Context, useFreeConn bool) (*conn, error) {
client.lk.Lock()
if client.closed {
client.lk.Unlock()
@@ -403,7 +403,7 @@ func (client *Client) _conn(ctx context.Context, useFreeClient bool) (*conn, err
var cn *conn
numFree := len(client.freeConns)
- if useFreeClient && numFree > 0 {
+ if useFreeConn && numFree > 0 {
cn = client.freeConns[0]
copy(client.freeConns, client.freeConns[1:])
client.freeConns = client.freeConns[:numFree-1] | Replace useFreeClient to useFreeConn | douban_libmc | train | go |
dc14f9e47f3f5182d06b8a9f84a8c08d2648fbba | diff --git a/DependencyInjection/Compiler/CheckClosureFilterPass.php b/DependencyInjection/Compiler/CheckClosureFilterPass.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/Compiler/CheckClosureFilterPass.php
+++ b/DependencyInjection/Compiler/CheckClosureFilterPass.php
@@ -23,8 +23,7 @@ class CheckClosureFilterPass implements CompilerPassInterface
{
public function process(ContainerBuilder $container)
{
- if ($container->hasDefinition('assetic.filter.closure.jar') &&
- $container->getParameterBag()->resolveValue($container->getParameter('assetic.filter.closure.jar'))) {
+ if ($container->hasDefinition('assetic.filter.closure.jar') && $container->hasParameter('assetic.filter.closure.jar')) {
$container->removeDefinition('assetic.filter.closure.api');
} elseif ($container->hasDefinition('assetic.filter.closure.api')) {
$container->removeDefinition('assetic.filter.closure.jar'); | [AsseticBundle] fixed compiler pass when closure filter is enabled but no jar registered | symfony_assetic-bundle | train | php |
e913bbc33adf31396102c000668037c3600d0a57 | diff --git a/src/main/java/org/craftercms/engine/graphql/impl/SiteDataFetcher.java b/src/main/java/org/craftercms/engine/graphql/impl/SiteDataFetcher.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/craftercms/engine/graphql/impl/SiteDataFetcher.java
+++ b/src/main/java/org/craftercms/engine/graphql/impl/SiteDataFetcher.java
@@ -134,9 +134,11 @@ public class SiteDataFetcher implements DataFetcher<Object> {
query.filter(QueryBuilders.termQuery("content-type", contentTypeName));
// Check the selected fields to build the ES query
- List<SelectedField> fields = env.getSelectionSet().getField(FIELD_NAME_ITEMS).getSelectionSet().getFields();
- fields.forEach(
- selectedField -> processSelectedField(selectedField, query, selectedFields));
+ SelectedField requestedFields = env.getSelectionSet().getField(FIELD_NAME_ITEMS);
+ if (Objects.nonNull(requestedFields)) {
+ List<SelectedField> fields = requestedFields.getSelectionSet().getFields();
+ fields.forEach(selectedField -> processSelectedField(selectedField, query, selectedFields));
+ }
// Only fetch the selected fields for better performance
source.fetchSource(selectedFields.toArray(new String[0]), new String[0]); | GraphQL improvement:
- Prevent NPE if only total is selected in a query | craftercms_engine | train | java |
83dbb71ee85e237532516aa8a3170e60a379ff4a | diff --git a/src/Geocode.php b/src/Geocode.php
index <HASH>..<HASH> 100755
--- a/src/Geocode.php
+++ b/src/Geocode.php
@@ -47,7 +47,7 @@ class Geocode
*/
public function __construct($address, $secure_protocol = false, $key=null)
{
- $this->service_url = $secure_protocol ? 'https' . $this->service_url : 'http' . $this->service_url;
+ $this->service_url = ($secure_protocol|| !is_null($key)) ? 'https' . $this->service_url : 'http' . $this->service_url;
$this->service_url .= (is_null($key))?"":"key={$key}";
$this->fetchAddressLatLng($address); | need https if use api key | hugobots_php-geocode | train | php |
f621436cfcc0e81c1a26723e748a548756283028 | diff --git a/scripts/prepare.js b/scripts/prepare.js
index <HASH>..<HASH> 100644
--- a/scripts/prepare.js
+++ b/scripts/prepare.js
@@ -32,6 +32,7 @@ function cleanup() {
// --copy-files option doesn't work with --ignore
// https://github.com/babel/babel/issues/6226
if (fs.existsSync(path.join(process.cwd(), 'dist'))) {
+ const inStoryShoots = process.cwd().includes('storyshots'); // This is a helper the exclude storyshots folder from the regex
const files = shell.find('dist').filter((filePath) => {
// Do not remove folder
// And do not clean anything for:
@@ -39,10 +40,11 @@ function cleanup() {
// - @storybook/cli/dist/frameworks/*
// because these are the template files
// that will be copied to init SB on users' projects
+
if (
fs.lstatSync(filePath).isDirectory() ||
/generators\/.+\/template.*/.test(filePath) ||
- /dist\/frameworks\/.*/.test(filePath)
+ (/dist\/frameworks\/.*/.test(filePath) && !inStoryShoots)
) {
return false;
} | check if we are in the storyshot folder, fixes #<I> | storybooks_storybook | train | js |
5b3795270aa9d7008b7ebc207f1e2eddd75ea85d | diff --git a/client/cli/ok.py b/client/cli/ok.py
index <HASH>..<HASH> 100644
--- a/client/cli/ok.py
+++ b/client/cli/ok.py
@@ -201,8 +201,12 @@ def main():
if isinstance(response, dict):
print("Backup successful for user: {0}".format(response['data']['email']))
- if args.submit:
+ if args.submit or args.backup:
print("URL: https://ok-server.appspot.com/#/{0}/submission/{1}".format(response['data']['course'], response['data']['key']))
+ if args.backup:
+ print('NOTE: this is only a backup. '
+ 'To submit your assignment, run ok with --submit.')
+
else:
print('Unable to complete backup.')
log.warning('network.dump_to_server returned {}'.format(response)) | Show submission url for --backup | okpy_ok-client | train | py |
be6ff3919921acf12661af0dd37407dfd2b15788 | diff --git a/railties/test/railties/mounted_engine_test.rb b/railties/test/railties/mounted_engine_test.rb
index <HASH>..<HASH> 100644
--- a/railties/test/railties/mounted_engine_test.rb
+++ b/railties/test/railties/mounted_engine_test.rb
@@ -88,18 +88,14 @@ module ApplicationTests
@plugin.write "app/models/blog/post.rb", <<-RUBY
module Blog
class Post
- extend ActiveModel::Naming
+ include ActiveModel::Model
def id
44
end
- def to_param
- id.to_s
- end
-
- def new_record?
- false
+ def persisted?
+ true
end
end
end | This model is a model so it should behaves like one | rails_rails | train | rb |
f11f83ab024dc0015902fc40c9ba9d4ae117acf5 | diff --git a/config/application.php b/config/application.php
index <HASH>..<HASH> 100644
--- a/config/application.php
+++ b/config/application.php
@@ -22,9 +22,9 @@ if (file_exists($root_dir . '/.env')) {
/**
* Set up our global environment constant and load its config first
- * Default: development
+ * Default: production
*/
-define('WP_ENV', env('WP_ENV') ?: 'development');
+define('WP_ENV', env('WP_ENV') ?: 'production');
$env_config = __DIR__ . '/environments/' . WP_ENV . '.php'; | Production environment by default
In my enormous amount of spare time, I've been working on a side project where I'm working on integrating best practices throughout a WP project.
It seems like a more sensible default for a site would be to default to production, rather than development. Development has all errors being displayed, amongst some other things. It's rather pedantic, but if a user forgets to set this for some reason, the safer option would be production rather than development | roots_bedrock | train | php |
ac04e1dcdc5bb81b99c1b0172e170f9469feed93 | diff --git a/packages/build-essentials/src/webpack.config.js b/packages/build-essentials/src/webpack.config.js
index <HASH>..<HASH> 100644
--- a/packages/build-essentials/src/webpack.config.js
+++ b/packages/build-essentials/src/webpack.config.js
@@ -43,6 +43,8 @@ const webpackConfig = {
test: /\.tsx?$/,
exclude: /node_modules/,
use: [{
+ loader: 'babel-loader'
+ }, {
loader: 'ts-loader'
}]
}, | BUGFIX: transpile TS code with babel | neos_neos-ui | train | js |
22cef7f103f82bcbf76f7318d40ad541be49dd04 | diff --git a/lib/millstone.js b/lib/millstone.js
index <HASH>..<HASH> 100644
--- a/lib/millstone.js
+++ b/lib/millstone.js
@@ -909,7 +909,6 @@ function resolve(options, callback) {
var vrt_file = fs.readFileSync(d.file, 'utf8').toString();
if (vrt_file.indexOf('OGRVRTLayer') != -1) {
d.type = 'ogr';
- d.layer_by_index = 0;
if (!l.srs) {
var match = vrt_file.match(/<LayerSRS>(.+)<\/LayerSRS>/);
if (match && match[1]) {
@@ -930,8 +929,8 @@ function resolve(options, callback) {
l.srs = l.srs || SRS.WGS84;
break;
case '.geojson':
+ case '.topojson':
case '.json':
- d.layer_by_index = 0;
try {
l.srs = l.srs || srs.parse(d.file).proj4;
} catch (e) {
@@ -940,7 +939,6 @@ function resolve(options, callback) {
break;
case '.kml':
case '.rss':
- d.layer_by_index = 0;
l.srs = SRS.WGS84;
break;
} | remove layer_by_index hack now that mapbox/tilemill#<I> is in place | tilemill-project_millstone | train | js |
ad506b6a0c3dd4a44e683b7c87787ace0adfcf52 | diff --git a/lambda_decorators.py b/lambda_decorators.py
index <HASH>..<HASH> 100644
--- a/lambda_decorators.py
+++ b/lambda_decorators.py
@@ -79,6 +79,9 @@ import json
from functools import wraps
+__version__ = '0.1a3'
+
+
def async_handler(handler):
"""
This decorator allows for use of async handlers by automatically running
diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,11 +1,13 @@
from setuptools import setup
-long_description = open('README.rst').read()
+import lambda_decorators
+
+long_description = lambda_decorators.__doc__
setup(
name='lambda-decorators',
- version='0.1a2',
+ version=lambda_decorators.__version__,
description='A collection of useful decorators for making AWS Lambda handlers',
long_description=long_description, | version bump and version&long-desc from src | dschep_lambda-decorators | train | py,py |
dca8dae579d80730a7126bd47711a84c03cee299 | diff --git a/src/Replication.php b/src/Replication.php
index <HASH>..<HASH> 100644
--- a/src/Replication.php
+++ b/src/Replication.php
@@ -84,17 +84,22 @@ class Replication
*/
public static function createFromConfig(array $config)
{
- $master = new Adapter([]);
+ $master = new Adapter([
+ 'host' => $config['host'],
+ 'username' => $config['username'],
+ 'password' => $config['password'],
+ 'dbname' => $config['dbname']
+ ]);
$slaves = [];
foreach ($config['slaves'] as $slave) {
$slaves[] = new Adapter($slave);
}
$storageClass = $config['storage']['class'];
if (!class_exists($storageClass)) {
- throw new InvalidArgumentException;
+ throw new InvalidArgumentException("Specified storage class '$storageClass' could not be found.");
}
- if (!method_exists([$storageClass, 'createFromConfig'])) {
- throw new InvalidArgumentException;
+ if (!method_exists($storageClass, 'createFromConfig')) {
+ throw new InvalidArgumentException("Storage class '$storageClass' is missing required method 'createFromConfig'.");
}
$storage = call_user_func_array([$storageClass, 'createFromConfig'], $config['storage']['args']);
return new static($master, $slaves, $storage); | Fix static method to create replication instance to work as expected | phlib_db | train | php |
a9594c0e8587bf118bd96a753a69982292886542 | diff --git a/tests/geo/surface/complex_fault_test.py b/tests/geo/surface/complex_fault_test.py
index <HASH>..<HASH> 100644
--- a/tests/geo/surface/complex_fault_test.py
+++ b/tests/geo/surface/complex_fault_test.py
@@ -160,6 +160,17 @@ class ComplexFaultSurfaceProjectionTestCase(unittest.TestCase):
numpy.testing.assert_allclose(polygon.lons, elons)
numpy.testing.assert_allclose(polygon.lats, elats)
+ def test_edges_with_nonuniform_length(self):
+ edges = [Line([Point(1, -20, 30), Point(1, -20.2, 30),
+ Point(2, -19.7, 30), Point(3, -19.5, 30)]),
+ Line([Point(1, -20, 50), Point(1, -20.2, 50),
+ Point(2, -19.7, 50)])]
+ polygon = ComplexFaultSurface.surface_projection_from_fault_data(edges)
+ elons = [1, 1, 2, 3]
+ elats = [-20.2, -20., -19.7, -19.5]
+ numpy.testing.assert_allclose(polygon.lons, elons)
+ numpy.testing.assert_allclose(polygon.lats, elats)
+
class ComplexFaultSurfaceGetWidthTestCase(unittest.TestCase):
def test_surface_with_variable_width(self): | tests/geo/surface/complex_fault:
Added a test case for the scenario where complex fault edges have
non-uniform lengths. | gem_oq-engine | train | py |
46f2026cfd7b89f0eb9f3c0271e958f9571beb31 | diff --git a/autoload_files.php b/autoload_files.php
index <HASH>..<HASH> 100644
--- a/autoload_files.php
+++ b/autoload_files.php
@@ -1,9 +1,23 @@
<?php
+/*
+ * Includes the appropriate function and constant files necessary to run the vanilla framework.
+ *
+ * This file must be included *after* the framework has been registered with an autoloader.
+ *
+ * @author Todd Burry <todd@vanillaforums.com>
+ * @copyright 2009 Vanilla Forums Inc.
+ * @license LGPL-2.1
+ * @package Vanilla
+ * @since 1.0
+ */
+
+use \Vanilla\Event;
+
// Include the core functions.
require_once __DIR__.'/functions/core-functions.php';
-// Load the framework's overrideable functions as late as possible so that addons can override them.
+// Load the framework's overrideable functions late so that addons can override them.
Event::bind('framework_loaded', function() {
require_once __DIR__.'/functions/formatting-functions.php';
}, Event::PRIORITY_LOW); | Added some documentation to autoload_files.php. | vanilla_garden | train | php |
9c1cd3487907d468f6279c80544005a9ce6e6d35 | diff --git a/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java b/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java
index <HASH>..<HASH> 100644
--- a/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java
+++ b/languagetool-language-modules/en/src/main/java/org/languagetool/rules/en/AdverbFilter.java
@@ -139,6 +139,7 @@ public class AdverbFilter extends RuleFilter {
put("personally", "personal");
put("basically", "basical");
put("definitely", "definite");
+ put("potentially", "potential");
// TODO: add more or maybe use https://github.com/simplenlg/simplenlg?
//put("", ""); | [en] add adverbs | languagetool-org_languagetool | train | java |
85290d1dbf65e323c96a0337e16153ac824fa0c0 | diff --git a/ast_test.go b/ast_test.go
index <HASH>..<HASH> 100644
--- a/ast_test.go
+++ b/ast_test.go
@@ -216,6 +216,20 @@ var astTests = []testCase{
litCmd(`foo`, `\"`, `bar`),
},
{
+ []string{`'"'`},
+ Command{Args: litWords(`'"'`)},
+ },
+ {
+ []string{"'`'"},
+ Command{Args: litWords("'`'")},
+ },
+ {
+ []string{`"'"`},
+ Command{Args: []Word{
+ word(dblQuoted(lit("'"))),
+ }},
+ },
+ {
[]string{"s{s s=s"},
litCmd("s{s", "s=s"),
}, | Add some more nested quoting tests | mvdan_sh | train | go |
1ca4dfb098488400f3cbf37abe73a14b55d12ec1 | diff --git a/test/models/travel_advice_edition_test.rb b/test/models/travel_advice_edition_test.rb
index <HASH>..<HASH> 100644
--- a/test/models/travel_advice_edition_test.rb
+++ b/test/models/travel_advice_edition_test.rb
@@ -16,6 +16,7 @@ class TravelAdviceEditionTest < ActiveSupport::TestCase
assert_equal "Travel advice for Aruba", ed.title
assert_equal "This gives travel advice for Aruba", ed.overview
assert_equal 'aruba', ed.country_slug
+ assert_equal [ 'avoid_all_but_essential_travel_to_parts', 'avoid_all_travel_to_parts' ], ed.alert_status
assert_equal 4, ed.version_number
assert_equal "Part One", ed.parts.first.title
end | Test the alert_status value in the has_correct_fields test | alphagov_govuk_content_models | train | rb |
e10554448f68f82f360e32077b055fed500c5467 | diff --git a/Request.php b/Request.php
index <HASH>..<HASH> 100644
--- a/Request.php
+++ b/Request.php
@@ -316,6 +316,19 @@ class Request // requires carbon::application;
})($array);
}
+
+ /**Check for character(s) / array members / representing a hexadecimal digit
+ * @link http://php.net/manual/en/function.ctype-xdigit.php
+ * @return mixed
+ */
+ public function hex()
+ {
+ $array = [];
+ return $this->closure(function ($key) use (&$array) {
+ return $array[] = (ctype_xdigit($key) ? $key : false);
+ })($array);
+ }
+
/** Removes HTML chars from a given set
* @param bool $complete if set to true than $this
* will be returned | Added Sorting options to rest, and Hex verification in request | RichardTMiles_CarbonPHP | train | php |
996acef5d1567e0e51c97515e494ad810e7b9523 | diff --git a/src/Esperance/Assertion.php b/src/Esperance/Assertion.php
index <HASH>..<HASH> 100644
--- a/src/Esperance/Assertion.php
+++ b/src/Esperance/Assertion.php
@@ -70,7 +70,7 @@ class Assertion
public function throwException($klass)
{
- $this->expect($this->subject)->to->be->callable();
+ $this->expect($this->subject)->to->be->invokable();
$thrown = false;
try {
@@ -87,12 +87,12 @@ class Assertion
);
}
- public function callable()
+ public function invokable()
{
$this->assert(
\is_callable($this->subject),
- "expected {$this->i($this->subject)} to be callable",
- "expected {$this->i($this->subject)} to not be callable"
+ "expected {$this->i($this->subject)} to be invokable",
+ "expected {$this->i($this->subject)} to not be invokable"
);
} | Replace reserved word in PHP<I> callable with invokable. | esperance_esperance | train | php |
da367a6cb3a0966b3d73037a56957a87748ee061 | diff --git a/vault/acl.go b/vault/acl.go
index <HASH>..<HASH> 100644
--- a/vault/acl.go
+++ b/vault/acl.go
@@ -334,7 +334,7 @@ CHECK:
// Only check parameter permissions for operations that can modify
// parameters.
- if op == logical.UpdateOperation || op == logical.CreateOperation {
+ if op == logical.ReadOperation || op == logical.UpdateOperation || op == logical.CreateOperation {
for _, parameter := range permissions.RequiredParameters {
if _, ok := req.Data[strings.ToLower(parameter)]; !ok {
return | Check allowed/denied/required params on read calls. (#<I>)
We added support a bit ago for some read operations to take in
parameters, so we should now apply these checks against them. | hashicorp_vault | train | go |
799ab84f9e55afe11c39f0712aaf9424e45778d0 | diff --git a/src/spec/gocli/integration/deploy/exported_from_spec.rb b/src/spec/gocli/integration/deploy/exported_from_spec.rb
index <HASH>..<HASH> 100644
--- a/src/spec/gocli/integration/deploy/exported_from_spec.rb
+++ b/src/spec/gocli/integration/deploy/exported_from_spec.rb
@@ -97,9 +97,9 @@ describe 'exported_from releases', type: :integration do
'version' => '3002',
}
manifest['instance_groups'] << Bosh::Spec::NewDeployments.simple_instance_group(
- 'jobs' => jobs,
- 'name' => 'foobar2',
- 'stemcell' => 'other-centos',
+ :jobs => jobs,
+ :name => 'foobar2',
+ :stemcell => 'other-centos',
)
manifest['releases'][0]['exported_from'] << { 'os' => 'centos-7', 'version' => '3002' } | Revert some keys in hashes back to symbols
- Test fixture factory disagrees with the previous change :(
- Purposely ignores rubocop offenses
[#<I>](<URL>) | cloudfoundry_bosh | train | rb |
ed4b460502c43a3dd709e76aa4bd3211e59ffee4 | diff --git a/packages/filesystem/src/FileObject.php b/packages/filesystem/src/FileObject.php
index <HASH>..<HASH> 100644
--- a/packages/filesystem/src/FileObject.php
+++ b/packages/filesystem/src/FileObject.php
@@ -508,6 +508,17 @@ class FileObject extends SplFileInfo
return $this;
}
+ public function addFile(string $filename, mixed $content = ''): static
+ {
+ if (!$this->isDir()) {
+ throw new FilesystemException('Unable able to add file, current path is not a dir.');
+ }
+
+ $dest = $this->appendPath(DIRECTORY_SEPARATOR . $filename);
+
+ return $dest->write($content);
+ }
+
/**
* delete
* | Try new FileObject operations #<I> | ventoviro_windwalker | train | php |
8df6980c9e10cbe4b4c7f39274792cb4fe07fc17 | diff --git a/app/controllers/devise_controller.rb b/app/controllers/devise_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/devise_controller.rb
+++ b/app/controllers/devise_controller.rb
@@ -44,7 +44,7 @@ class DeviseController < Devise.parent_controller.constantize
# loaded before even having a request object.
def _prefixes #:nodoc:
@_prefixes ||= if self.class.scoped_views? && request && devise_mapping
- super.unshift("#{devise_mapping.scoped_path}/#{controller_name}")
+ ["#{devise_mapping.scoped_path}/#{controller_name}"] + super
else
super
end | Update `_prefixes` override to work with Rails <I> | plataformatec_devise | train | rb |
e5b06803eec9b0c05ee00a5385a560975f9b44e9 | diff --git a/source/Application/Model/Attribute.php b/source/Application/Model/Attribute.php
index <HASH>..<HASH> 100644
--- a/source/Application/Model/Attribute.php
+++ b/source/Application/Model/Attribute.php
@@ -117,7 +117,6 @@ class Attribute extends \OxidEsales\Eshop\Core\Model\MultiLanguageModel
foreach ($aMDVariants as $sVarId => $oValue) {
if (strpos($sVarId, "mdvar_") === 0) {
foreach ($oValue as $sId) {
- //var_dump($sVarId, $oAttribute->oxattribute__oxid->value);
$sVarId = substr($sVarId, 6);
$oNewAssign = oxNew("oxBase");
$oNewAssign->init("oxobject2attribute"); | Removed a commented debugging line | OXID-eSales_oxideshop_ce | train | php |
fbec72b4c362c5309b7f92a9ae0fa84c62de3a21 | diff --git a/spacy/tests/regression/test_issue3468.py b/spacy/tests/regression/test_issue3468.py
index <HASH>..<HASH> 100644
--- a/spacy/tests/regression/test_issue3468.py
+++ b/spacy/tests/regression/test_issue3468.py
@@ -13,11 +13,11 @@ def test_issue3468():
nlp = English()
nlp.add_pipe(nlp.create_pipe("sentencizer"))
doc = nlp("Hello world")
- assert doc.is_sentenced
assert doc[0].is_sent_start
+ assert doc.is_sentenced
assert len(list(doc.sents)) == 1
doc_bytes = doc.to_bytes()
new_doc = Doc(nlp.vocab).from_bytes(doc_bytes)
- assert new_doc.is_sentenced
assert doc[0].is_sent_start
+ assert new_doc.is_sentenced
assert len(list(new_doc.sents)) == 1 | Slightly modify test for #<I>
Check for Token.is_sent_start first (which is serialized/deserialized correctly) | explosion_spaCy | train | py |
fda895f267ff4b8c877b5386af0d49e4d21d9f28 | diff --git a/DrdPlus/Tables/Armaments/Armourer.php b/DrdPlus/Tables/Armaments/Armourer.php
index <HASH>..<HASH> 100644
--- a/DrdPlus/Tables/Armaments/Armourer.php
+++ b/DrdPlus/Tables/Armaments/Armourer.php
@@ -301,7 +301,7 @@ class Armourer extends StrictObject
* Beware of spear, which can be both range and melee - if you want to use it as range, provide it as RangeWeaponCode,
* otherwise as MeleeWeaponCode
* @param WeaponCode $weaponCode
- * @param $currentStrength
+ * @param int $currentStrength
* @return bool
* @throws \DrdPlus\Tables\Armaments\Weapons\Exceptions\UnknownWeaponCode
* @throws \Granam\Integer\Tools\Exceptions\WrongParameterType | Added annotation about expected value type to armourer | drdplusinfo_tables | train | php |
a7291d47e95e61f9a2448f69dac05822aa3fb771 | diff --git a/samtranslator/plugins/__init__.py b/samtranslator/plugins/__init__.py
index <HASH>..<HASH> 100644
--- a/samtranslator/plugins/__init__.py
+++ b/samtranslator/plugins/__init__.py
@@ -1,6 +1,6 @@
import logging
-from samtranslator.model.exceptions import InvalidResourceException
+from samtranslator.model.exceptions import InvalidResourceException, InvalidDocumentException
from enum import Enum
@@ -128,7 +128,7 @@ class SamPlugins(object):
try:
getattr(plugin, method_name)(*args, **kwargs)
- except InvalidResourceException as ex:
+ except (InvalidResourceException, InvalidDocumentException) as ex:
# Don't need to log these because they don't result in crashes
raise ex
except Exception as ex: | fix: do not log InvalidDocumentException as an uncaught error (#<I>) | awslabs_serverless-application-model | train | py |
6696df697667afdcd3c296fae94ceff63732171e | diff --git a/lib/travis/cli/accounts.rb b/lib/travis/cli/accounts.rb
index <HASH>..<HASH> 100644
--- a/lib/travis/cli/accounts.rb
+++ b/lib/travis/cli/accounts.rb
@@ -16,7 +16,9 @@ module Travis
account.repos_count == 1 ? "1 repository" : "#{account.repos_count} repositories"
].join(" ")
end
- say session.config['host'], "To set up a subscription, please visit %s." unless accounts.all?(&:subscribed?)
+ unless accounts.all?(&:subscribed?) or session.config['host'].nil?
+ say session.config['host'], "To set up a subscription, please visit %s."
+ end
end
end
end | don't tell user about host if we don't know it | travis-ci_travis.rb | train | rb |
10616e1d80a2e1039b360ccaa44e08c5ba5421fa | diff --git a/code/libraries/koowa/components/com_activities/activity/object/object.php b/code/libraries/koowa/components/com_activities/activity/object/object.php
index <HASH>..<HASH> 100644
--- a/code/libraries/koowa/components/com_activities/activity/object/object.php
+++ b/code/libraries/koowa/components/com_activities/activity/object/object.php
@@ -28,8 +28,6 @@ class ComActivitiesActivityObject extends KObjectConfigJson implements ComActivi
* @var array
*/
protected $_allowed = array(
- 'parameter',
- 'translate',
'objectType',
'displayType',
'deleted',
@@ -37,19 +35,16 @@ class ComActivitiesActivityObject extends KObjectConfigJson implements ComActivi
'downstreamDuplicates',
'upstreamDuplicates',
'attributes',
- 'link',
'author',
'content',
'objectName',
'displayName',
'id',
'image',
- 'type',
'published',
'summary',
'updated',
'url',
- 'value',
);
public function __construct($label, $config = array())
@@ -63,8 +58,7 @@ class ComActivitiesActivityObject extends KObjectConfigJson implements ComActivi
'attachments' => array(),
'downstreamDuplicates' => array(),
'upstreamDuplicates' => array(),
- 'attributes' => array(),
- 'link' => array()
+ 'attributes' => array()
));
$this->setLabel($label); | re #<I> Cleaned up object.
Removed old properties from old interface. | joomlatools_joomlatools-framework | train | php |
0a3979509d07a5f402dfb68cea520e2d3dd7c829 | diff --git a/src/main/java/org/vesalainen/util/logging/MinimalFormatter.java b/src/main/java/org/vesalainen/util/logging/MinimalFormatter.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/vesalainen/util/logging/MinimalFormatter.java
+++ b/src/main/java/org/vesalainen/util/logging/MinimalFormatter.java
@@ -67,6 +67,12 @@ public class MinimalFormatter extends Formatter
case "FINEST":
levelId = "F3";
break;
+ case "VERBOSE":
+ levelId = "VE";
+ break;
+ case "DEBUG":
+ levelId = "DE";
+ break;
default:
levelId = "LEVEL("+record.getLevel().intValue()+")";
break; | Add new log levels VERBOSE = <I> and DEBUG = <I> | tvesalainen_util | train | java |
03fb8e79c68bc981bdcc2240257253c8f8596204 | diff --git a/src/transformers/modeling_tf_longformer.py b/src/transformers/modeling_tf_longformer.py
index <HASH>..<HASH> 100644
--- a/src/transformers/modeling_tf_longformer.py
+++ b/src/transformers/modeling_tf_longformer.py
@@ -348,7 +348,7 @@ class TFLongformerSelfAttention(tf.keras.layers.Layer):
# matrix multipication
# bcxd: batch_size * num_heads x chunks x 2window_overlap x head_dim
# bcyd: batch_size * num_heads x chunks x 2window_overlap x head_dim
- # bcxy: batch_size * num_heads x chunks x 2window_overlap x window_overlap
+ # bcxy: batch_size * num_heads x chunks x 2window_overlap x 2window_overlap
chunked_attention_scores = tf.einsum("bcxd,bcyd->bcxy", chunked_query, chunked_key) # multiply
# convert diagonals into columns | Update modeling_tf_longformer.py (#<I>)
correct a very small mistake | huggingface_pytorch-pretrained-BERT | train | py |
0acba7878afaf9514715b0e9f63e216744aad5f4 | diff --git a/test/unit/Coverage/CoverageMergerTest.php b/test/unit/Coverage/CoverageMergerTest.php
index <HASH>..<HASH> 100644
--- a/test/unit/Coverage/CoverageMergerTest.php
+++ b/test/unit/Coverage/CoverageMergerTest.php
@@ -24,6 +24,8 @@ class CoverageMergerTest extends \TestBase
$firstFile = PARATEST_ROOT . '/src/Logging/LogInterpreter.php';
$secondFile = PARATEST_ROOT . '/src/Logging/MetaProvider.php';
+ // Every time the two above files are changed, the line numbers
+ // may change, and so these two numbers may need adjustments
$firstFileFirstLine = 38;
$secondFileFirstLine = 38; | CoverageMergerTest: explanation added for needed changes | paratestphp_paratest | train | php |
954bd69e7d9f8567989c8213b6b2c4e3a357969e | diff --git a/app/src/js/modules/fields/repeater.js b/app/src/js/modules/fields/repeater.js
index <HASH>..<HASH> 100644
--- a/app/src/js/modules/fields/repeater.js
+++ b/app/src/js/modules/fields/repeater.js
@@ -66,8 +66,21 @@
var cloned = $(template).clone();
$('[data-bolt-field]', cloned).each(function () {
- var type = $(this).data('bolt-field'),
- conf = $(this).data('bolt-fconf');
+ var field = $(this),
+ type = $(field).data('bolt-field'),
+ conf = $(field).data('bolt-fconf');
+
+ // Replace all id's and correspondending for-attributes.
+ $(field).find('[id]').each(function () {
+ var id = $(this).attr('id'),
+ nid = bolt.app.uid();
+
+ $(this).attr('id', nid);
+
+ $(field).find('[for="' + id + '"]').each(function () {
+ $(this).attr('for', nid);
+ });
+ });
// Implemented fields:
// text, image | Add automatic id/for replacement | bolt_bolt | train | js |
7d659f17a3f024a18abdd06afc28d3556075fb84 | diff --git a/test/index.js b/test/index.js
index <HASH>..<HASH> 100644
--- a/test/index.js
+++ b/test/index.js
@@ -1,5 +1,6 @@
+// ./simpla should be imported first as it imports the polyfills
+import './simpla';
import './actions';
import './plugins';
import './reducers';
import './utils';
-import './simpla'; | import simpla.js into tests first - ensures polyfills are loaded | simplajs_simpla | train | js |
d4a2e39c3ed3bfd680903f03bcb6a109eca590f7 | diff --git a/lib/vagrant/action/vm/network.rb b/lib/vagrant/action/vm/network.rb
index <HASH>..<HASH> 100644
--- a/lib/vagrant/action/vm/network.rb
+++ b/lib/vagrant/action/vm/network.rb
@@ -308,6 +308,7 @@ module Vagrant
def bridged_config(args)
options = args[0] || {}
+ options = {} if !options.is_a?(Hash)
return {
:adapter => nil, | Gracefully handle if the type of arg is not correct for bridged.
[GH-<I>] | hashicorp_vagrant | train | rb |
75b12b6f91e71af83f04ed73ec585d5daf12127c | diff --git a/Script/Gt.js b/Script/Gt.js
index <HASH>..<HASH> 100644
--- a/Script/Gt.js
+++ b/Script/Gt.js
@@ -83,7 +83,7 @@
// If Gt.js is being used without PHP.Gt, the original template
// elements will still be present in the DOM - scrape them here.
- toScrape = GT("[data-template]");
+ /*toScrape = GT("[data-template]");
toScrapeLength = toScrape.length;
if(toScrape && toScrapeLength > 0) {
@@ -95,7 +95,7 @@
}
toScrape.remove();
- }
+ }*/
},
/** | Temporarily removed non-php templating, while data-template issue is fixed | PhpGt_WebEngine | train | js |
3e0219c4384465bc0f66369817426e3baa103583 | diff --git a/src/Composer/Factory.php b/src/Composer/Factory.php
index <HASH>..<HASH> 100644
--- a/src/Composer/Factory.php
+++ b/src/Composer/Factory.php
@@ -496,7 +496,26 @@ class Factory
private function getContentHash($composerFilePath)
{
$content = json_decode(file_get_contents($composerFilePath), true);
- ksort($content);
- return md5(json_encode($content));
+
+ $relevantKeys = array(
+ 'require',
+ 'require-dev',
+ 'conflict',
+ 'replace',
+ 'provide',
+ 'suggest',
+ 'minimum-stability',
+ 'prefer-stable',
+ 'repositories',
+ );
+
+ $relevantContent = array();
+
+ foreach (array_intersect($relevantKeys, array_keys($content)) as $key) {
+ $relevantContent[$key] = $content[$key];
+ }
+
+ ksort($relevantContent);
+ return md5(json_encode($relevantContent));
}
} | Change the content hash to be only based on values that affect dependency resolution | composer_composer | train | php |
1b893f2283ee69c6da64c1cfe6f11f932155b5e8 | diff --git a/photutils/psf/tests/test_sandbox.py b/photutils/psf/tests/test_sandbox.py
index <HASH>..<HASH> 100644
--- a/photutils/psf/tests/test_sandbox.py
+++ b/photutils/psf/tests/test_sandbox.py
@@ -8,7 +8,6 @@ from astropy.modeling.models import Gaussian2D
from astropy.table import Table
import numpy as np
from numpy.testing import assert_allclose
-import pytest
from ..sandbox import DiscretePRF
@@ -99,16 +98,3 @@ def test_create_prf_flux():
mode='median', fluxes=INTAB['flux_0'])
assert_allclose(prf._prf_array[0, 0].sum(), 1)
assert_allclose(prf._prf_array[0, 0], test_psf, atol=1E-8)
-
-
-def test_create_prf_excessive_subsampling():
- """
- Check if a helpful error is raised if the subsampling parameter is
- too high.
- """
-
- with pytest.raises(ValueError) as exc:
- DiscretePRF.create_from_image(image,
- list(INTAB['x_0', 'y_0'].as_array()),
- PSF_SIZE, subsampling=999)
- assert('subsampling' in exc.value.args[0]) | Remove legacy PRF test due to memory usage | astropy_photutils | train | py |
fa07200cbade5d26dda36b5925c0ee4562d12261 | diff --git a/src/visualizers/widgets/CodeEditor/CodeEditorWidget.js b/src/visualizers/widgets/CodeEditor/CodeEditorWidget.js
index <HASH>..<HASH> 100644
--- a/src/visualizers/widgets/CodeEditor/CodeEditorWidget.js
+++ b/src/visualizers/widgets/CodeEditor/CodeEditorWidget.js
@@ -706,14 +706,15 @@ define([
// TODO: Handle non-code updates that affect tree, like name of node
var self = this;
if (desc) {
+ // update the node info in our database
+ self.nodes[desc.id] = desc;
+ var nodeInfo = self.getNodeInfo(desc.id);
+ if (nodeInfo.node) {
+ // make sure the title is up to date
+ nodeInfo.node.setTitle(desc.name);
+ }
var attributeNames = Object.keys(desc.codeAttributes);
if (attributeNames.length > 0) {
- self.nodes[desc.id] = desc;
- var nodeInfo = self.getNodeInfo(desc.id);
- if (nodeInfo.node) {
- // make sure the title is up to date
- nodeInfo.node.setTitle(desc.name);
- }
if (nodeInfo.attributes) {
// make sure the code is up to date
attributeNames.map(function(attributeName) { | fixed to properly update all names, including root object names. closes #<I> | finger563_webgme-codeeditor | train | js |
2828cb4ecfe3f3efb1372d9008f702ea301af2c5 | diff --git a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
index <HASH>..<HASH> 100644
--- a/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
+++ b/src/java/org/apache/cassandra/config/DatabaseDescriptor.java
@@ -85,7 +85,7 @@ public class DatabaseDescriptor
private static RequestSchedulerOptions requestSchedulerOptions;
public static final UUID INITIAL_VERSION = new UUID(4096, 0); // has type nibble set to 1, everything else to zero.
- private static UUID defsVersion = INITIAL_VERSION;
+ private static volatile UUID defsVersion = INITIAL_VERSION;
/**
* Inspect the classpath to find storage configuration file | make DD.defsVersion volatile
patch by Jeffrey Wang; reviewed by jbellis for CASSANDRA-<I>
git-svn-id: <URL> | Stratio_stratio-cassandra | train | java |
fba184b7fb7a98bf1e6897639eb386387ab12228 | diff --git a/karma.saucelabs.conf.js b/karma.saucelabs.conf.js
index <HASH>..<HASH> 100644
--- a/karma.saucelabs.conf.js
+++ b/karma.saucelabs.conf.js
@@ -1,16 +1,6 @@
'use strict'
var customLaunchers = {
- win10chrome: {
- base: 'SauceLabs',
- browserName: 'chrome',
- platform: 'Windows 10'
- },
- win10firefox: {
- base: 'SauceLabs',
- browserName: 'firefox',
- platform: 'Windows 10'
- },
osxSafari: {
base: 'SauceLabs',
browserName: 'safari', | Moving to available browsers in saucelabs | holidayextras_barometer | train | js |
124f45ea12e6644cdb322116a2aff08874b0b044 | diff --git a/app/models/user.rb b/app/models/user.rb
index <HASH>..<HASH> 100644
--- a/app/models/user.rb
+++ b/app/models/user.rb
@@ -18,8 +18,10 @@ class User < ActiveRecord::Base
# Selecting all users with given role (A.K.A. scoping):
# User.with_role(:editor)
def as_json
- { 'success' => true, 'id' => self.id,
- 'auth_token' => self.authentication_token,
- 'email' => self.email }.to_json
+ { 'success' => true,
+ id: id,
+ auth_token: authentication_token,
+ email: email
+ }.to_json
end
end | Reduce code mass of as_json method | lab2023_kebab-remote-api | train | rb |
4d02823302255a2359ed69d37612a4fa775a743e | diff --git a/lib/puppet/rails.rb b/lib/puppet/rails.rb
index <HASH>..<HASH> 100644
--- a/lib/puppet/rails.rb
+++ b/lib/puppet/rails.rb
@@ -61,6 +61,7 @@ module Puppet::Rails
ActiveRecord::Base.logger = Logger.new(Puppet[:railslog])
ActiveRecord::Base.allow_concurrency = true
+ ActiveRecord::Base.verify_active_connections!
begin
ActiveRecord::Base.establish_connection(database_arguments()) | I believe this fixes the issues in ticket #<I>
My testing on mysql shows connections being reaped.
git-svn-id: <URL> | puppetlabs_puppet | train | rb |
e0fea5a36dab9b6649914926bc2990d109b66618 | diff --git a/twarc.py b/twarc.py
index <HASH>..<HASH> 100755
--- a/twarc.py
+++ b/twarc.py
@@ -40,6 +40,9 @@ def main():
help="maximum tweet id to search for")
parser.add_argument("--since_id", dest="since_id",
help="smallest id to search for")
+ parser.add_argument("--result_type", dest="result_type",
+ choices=["mixed", "recent", "popular"],
+ default="recent", help="search result type")
parser.add_argument("--lang", dest="lang",
help="limit to ISO 639-1 language code"),
parser.add_argument("--track", dest="track",
@@ -108,7 +111,8 @@ def main():
args.search,
since_id=args.since_id,
max_id=args.max_id,
- lang=args.lang
+ lang=args.lang,
+ result_type=args.result_type,
)
elif args.track or args.follow or args.locations:
tweets = t.filter(track=args.track, follow=args.follow, | adding result_type to command line options too | DocNow_twarc | train | py |
b4bb8eccbc44b2a6b00508ee7b47c7ce0ec51863 | diff --git a/src/js/modal.js b/src/js/modal.js
index <HASH>..<HASH> 100644
--- a/src/js/modal.js
+++ b/src/js/modal.js
@@ -72,10 +72,18 @@ ch.modal = function(conf){
if (!ch.features.fixed) {
ch.positioner({ element: $dimmer });
};
+
+ if ($("html").hasClass("ie6")) {
+ $("select, object").css("visibility", "hidden");
+ };
},
off: function() {
- $dimmer.fadeOut("normal", function(){
+ $dimmer.fadeOut("normal", function(){
$dimmer.detach();
+
+ if ($("html").hasClass("ie6")) {
+ $("select, object").css("visibility", "visible");
+ };
});
}
}; | GH-<I> Objects and selects are hidden by the dimmer on IE6. | mercadolibre_chico | train | js |
49d7a123022c8def6dd24313a557e9e88ff480a8 | diff --git a/lib/netsuite/utilities.rb b/lib/netsuite/utilities.rb
index <HASH>..<HASH> 100644
--- a/lib/netsuite/utilities.rb
+++ b/lib/netsuite/utilities.rb
@@ -273,15 +273,20 @@ module NetSuite
to_date.
to_datetime
- offset = 8
- time = time.new_offset("-08:00")
-
- if time.to_time.getlocal.dst?
- offset = 7
+ # tzinfo allows us to determine the dst status of the time being passed in
+ # NetSuite requires that the time be passed to the API with the PDT TZ offset
+ # of the time passed in (i.e. not the current TZ offset of PDT)
+
+ offset = Rational(-7, 24)
+
+ if defined?(TZInfo)
+ time = TZInfo::Timezone.get("America/Los_Angeles").utc_to_local(time)
+ offset = time.offset
+ else
time = time.new_offset("-07:00")
end
- (time + Rational(offset, 24)).iso8601
+ (time + (offset * -1)).iso8601
end
end | Hopefully a final solve to the timezone conversion issues | NetSweet_netsuite | train | rb |
6b6d44ff474e40d5558d8ccbc1de54b674859667 | diff --git a/airflow/contrib/operators/azure_container_instances_operator.py b/airflow/contrib/operators/azure_container_instances_operator.py
index <HASH>..<HASH> 100644
--- a/airflow/contrib/operators/azure_container_instances_operator.py
+++ b/airflow/contrib/operators/azure_container_instances_operator.py
@@ -103,7 +103,7 @@ class AzureContainerInstancesOperator(BaseOperator):
"myprivateregistry.azurecr.io/my_container:latest",
"westeurope",
{"MODEL_PATH": "my_value",
- "POSTGRES_LOGIN": "{{ macros.connection('postgres_default').login }}"
+ "POSTGRES_LOGIN": "{{ macros.connection('postgres_default').login }}",
"POSTGRES_PASSWORD": "{{ macros.connection('postgres_default').password }}",
"JOB_GUID": "{{ ti.xcom_pull(task_ids='task1', key='guid') }}" },
['POSTGRES_PASSWORD'], | [AIRFLOW-XXX] Fix AzureContainerInstancesOperator example (#<I>) | apache_airflow | train | py |
c4d2a015c14e71864b6e13043049807494d89c86 | diff --git a/php/qrcode.php b/php/qrcode.php
index <HASH>..<HASH> 100644
--- a/php/qrcode.php
+++ b/php/qrcode.php
@@ -90,7 +90,7 @@ class QRCode {
$this->qrDataList = array();
}
- function addDataImpl(&$qrData) {
+ function addDataImpl($qrData) {
$this->qrDataList[] = $qrData;
} | Avoid warning on PHP 7
There is no need for the reference parameter here (its arguments are objects like “new QRNumber”), and expressions can’t be passed as references. | kazuhikoarase_qrcode-generator | train | php |
05fab28f522f9166b6c86d17e6576887a7dbb7b4 | diff --git a/src/Generator/TypeBuilder.php b/src/Generator/TypeBuilder.php
index <HASH>..<HASH> 100644
--- a/src/Generator/TypeBuilder.php
+++ b/src/Generator/TypeBuilder.php
@@ -637,6 +637,9 @@ class TypeBuilder
if (isset($args[0]) && is_array($args[0])) {
// Nested instance
$instance->addArgument($this->buildConstraints($args, false));
+ } elseif (isset($args['constraints'][0]) && is_array($args['constraints'][0])) {
+ // Nested instance with explicit "constraints" key
+ $instance->addArgument($this->buildConstraints($args['constraints'], false));
} else {
// Numeric or Assoc array?
$instance->addArgument(isset($args[0]) ? $args : Collection::assoc($args)); | Fix type generation for Composite symfony validator with explicit 'constraints' key | overblog_GraphQLBundle | train | php |
288e7620b5007c12b3873f39a45a953820b40a2b | diff --git a/cmsplugin_cascade/utils.py b/cmsplugin_cascade/utils.py
index <HASH>..<HASH> 100644
--- a/cmsplugin_cascade/utils.py
+++ b/cmsplugin_cascade/utils.py
@@ -1,6 +1,8 @@
# -*- coding: utf-8 -*-
from __future__ import unicode_literals
+import warnings
+
from django.core.exceptions import ValidationError
from django.contrib.staticfiles.finders import get_finders
from django.utils.translation import ugettext_lazy as _
@@ -60,6 +62,12 @@ def resolve_dependencies(filenames):
"""
from cmsplugin_cascade import settings
+ warnings.warn(
+ 'resolve_dependencies() is deprecated and will be removed.',
+ DeprecationWarning,
+ stacklevel=2,
+ )
+
def find_file(path):
for finder in get_finders():
result = finder.find(path) | resolve_dependencies is deprecated now | jrief_djangocms-cascade | train | py |
a49dead4e0e9489f2de3699af149f09b875b68eb | diff --git a/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php b/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php
+++ b/src/Symfony/Component/Notifier/Bridge/OvhCloud/OvhCloudTransport.php
@@ -28,12 +28,6 @@ final class OvhCloudTransport extends AbstractTransport
{
private $endpoints = [
'ovh-eu' => 'https://eu.api.ovh.com/1.0',
- 'ovh-ca' => 'https://ca.api.ovh.com/1.0',
- 'ovh-us' => 'https://api.us.ovhcloud.com/1.0',
- 'kimsufi-eu' => 'https://eu.api.kimsufi.com/1.0',
- 'kimsufi-ca' => 'https://ca.api.kimsufi.com/1.0',
- 'soyoustart-eu' => 'https://eu.api.soyoustart.com/1.0',
- 'soyoustart-ca' => 'https://ca.api.soyoustart.com/1.0',
];
private $applicationKey; | sms endpoint is only available in ovh-eu | symfony_symfony | train | php |
13cb6352a00d4f8278cc1ec8745f858b7867815d | diff --git a/src/Illuminate/Console/Scheduling/Schedule.php b/src/Illuminate/Console/Scheduling/Schedule.php
index <HASH>..<HASH> 100644
--- a/src/Illuminate/Console/Scheduling/Schedule.php
+++ b/src/Illuminate/Console/Scheduling/Schedule.php
@@ -42,7 +42,7 @@ class Schedule
$artisan = 'artisan';
}
- return $this->exec(PHP_BINARY.' "'.$artisan.'" '.$command, $parameters);
+ return $this->exec('"'.PHP_BINARY.'" "'.$artisan.'" '.$command, $parameters);
}
/** | [<I>] Quote PHP_BINARY's that have spaces
When trying to use scheduler with a PHP_BINARY path that has a space in it, the command cannot run. Quoting the path resolves the problem. This fixes Issue #<I>. | laravel_framework | train | php |
ca06b47835f6b03f45b9fa3bffc9542e086f6cbb | diff --git a/src/java/com/threerings/io/Streamer.java b/src/java/com/threerings/io/Streamer.java
index <HASH>..<HASH> 100644
--- a/src/java/com/threerings/io/Streamer.java
+++ b/src/java/com/threerings/io/Streamer.java
@@ -35,8 +35,10 @@ import java.security.PrivilegedActionException;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
+import java.util.logging.Level;
import com.samskivert.util.ClassUtil;
+import com.samskivert.util.StringUtil;
import static com.threerings.NaryaLog.log;
@@ -375,7 +377,7 @@ public class Streamer
String errmsg = "Failure reading streamable field " +
"[class=" + _target.getName() +
", field=" + field.getName() +
- ", error=" + e.getMessage() + "]";
+ ", error=" + StringUtil.getMessage(e) + "]";
throw (IOException) new IOException(errmsg).initCause(e);
}
} | Report as useful a message as we can when we have an error.
I was getting an IllegalArgumentException and the message was "null",
so this will at least log the name of the exception.
git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@<I> <I>f4-<I>e9-<I>-aa3c-eee0fc<I>fb1 | threerings_narya | train | java |
5f03b1589f516b0bb01abb82b0468aa4db1393d1 | diff --git a/tasks/zip.js b/tasks/zip.js
index <HASH>..<HASH> 100644
--- a/tasks/zip.js
+++ b/tasks/zip.js
@@ -47,7 +47,8 @@ module.exports = function(grunt) {
// Grab the cwd and return the relative path as our router
var cwd = data.cwd || process.cwd();
router = function routerFn (filepath) {
- return path.relative(cwd, filepath);
+ // modify the path to always use / as seperator, not \.
+ return path.relative(cwd, filepath).split(path.sep).join('/');
};
} else if (data.cwd) {
// Otherwise, if a `cwd` was specified, throw a fit and leave | Use `/` as path seperator instead of `\` on windows. | twolfson_grunt-zip | train | js |
feef59e025347a9e193f36dac5c0965cc9d40f95 | diff --git a/addon/initializers/route-anchor-jump.js b/addon/initializers/route-anchor-jump.js
index <HASH>..<HASH> 100644
--- a/addon/initializers/route-anchor-jump.js
+++ b/addon/initializers/route-anchor-jump.js
@@ -1,12 +1,12 @@
import Route from '@ember/routing/route';
-import { scheduleOnce } from '@ember/runloop';
+import { schedule } from '@ember/runloop';
Route.reopen({
afterModel() {
if (typeof location !== 'undefined') {
const { hash } = location;
if (hash && hash.length) {
- scheduleOnce('afterRender', null, () => {
+ schedule('afterRender', null, () => {
const anchor = document.querySelector(`a[href="${hash}"`);
if (anchor) {
anchor.scrollIntoView(); | Change scheduleOnce to schedule (#<I>)
Using `scheduleOnce` with an anonymous function [doesn't actually schedule only once](<URL>), since a new function is created on every invocation. This PR just changes to use `schedule`, which I believe is fine in this case. | ember-learn_ember-cli-addon-docs | train | js |
48a99bc939bf6d17a67fc0c250614d2e60130e8f | diff --git a/tests/unit/state_test.py b/tests/unit/state_test.py
index <HASH>..<HASH> 100644
--- a/tests/unit/state_test.py
+++ b/tests/unit/state_test.py
@@ -21,7 +21,7 @@ ensure_in_syspath('../')
import salt.state
import salt.config
import salt.exceptions
-from salt.utils.odict import OrderedDict
+from salt.utils.odict import OrderedDict, DefaultOrderedDict
@skipIf(NO_MOCK, NO_MOCK_REASON) | Add missing import after moving highstate tests | saltstack_salt | train | py |
a26d3e0f1b171cd7b13c154eed371371e90ad860 | diff --git a/document/client/document/documentController.js b/document/client/document/documentController.js
index <HASH>..<HASH> 100644
--- a/document/client/document/documentController.js
+++ b/document/client/document/documentController.js
@@ -102,7 +102,7 @@ angular.module('bauhaus.document.controllers').controller('DocumentDetailCtrl',
if (obj.hasOwnProperty(f)) {
var field = obj[f];
// replace field with object by id
- if (typeof field === 'object' && field._id) {
+ if (typeof field !== 'undefined' && field._id) {
obj[f] = field._id;
}
// replace field with array of objects by array of ids | Fix type checking for reference deletion (unpopulate) | bauhausjs_bauhausjs | train | js |
467bcc24611448ce6646baeb58f3837cdbcc1017 | diff --git a/tagcube/client/api.py b/tagcube/client/api.py
index <HASH>..<HASH> 100644
--- a/tagcube/client/api.py
+++ b/tagcube/client/api.py
@@ -38,8 +38,7 @@ You can't scan the specified domain. This happens in the following cases:
class TagCubeClient(object):
- ROOT_DOMAIN = os.environ.get('ROOT_DOMAIN', None) or 'api.tagcube.io'
- ROOT_URL = 'https://%s/' % ROOT_DOMAIN
+ ROOT_URL = os.environ.get('ROOT_URL', None) or 'https://api.tagcube.io/'
API_VERSION = '1.0' | Setting a more helpful ROOT_URL environment variable | tagcubeio_tagcube-cli | train | py |
257a8d0b49afad3605ba378b52db52fb552ae72f | diff --git a/geomet/wkt.py b/geomet/wkt.py
index <HASH>..<HASH> 100644
--- a/geomet/wkt.py
+++ b/geomet/wkt.py
@@ -150,7 +150,18 @@ def __dump_multipoint(obj, fmt):
def __dump_multilinestring(obj, fmt):
- raise NotImplementedError
+ """
+ Dump a GeoJSON-like MultiLineString object to WKT.
+
+ Input parameters and return value are the MULTILINESTRING equivalent to
+ :func:`__dump_point`.
+ """
+ coords = obj['coordinates']
+ mlls = 'MULTILINESTRING (%s)'
+ linestrs = ('(%s)' % ', '.join(' '.join(fmt % c for c in pt)
+ for pt in linestr) for linestr in coords)
+ mlls %= ', '.join(ls for ls in linestrs)
+ return mlls
def __dump_multipolygon(obj, fmt): | wkt:
Implemented __dump_multilinestring. | geomet_geomet | train | py |
ff05bb31664fc60db14dafd62195ad4ca9291556 | diff --git a/lib/upgradelib.php b/lib/upgradelib.php
index <HASH>..<HASH> 100644
--- a/lib/upgradelib.php
+++ b/lib/upgradelib.php
@@ -465,6 +465,10 @@ function upgrade_plugins_modules($startcallback, $endcallback, $verbose) {
}
}
+ if (empty($module->cron)) {
+ $module->cron = 0;
+ }
+
// all modules must have en lang pack
if (!is_readable("$fullmod/lang/en/$mod.php")) {
throw new plugin_defective_exception($component, 'Missing mandatory en language pack.'); | MDL-<I> upgrade: cope with modules that do not set $module->cron. | moodle_moodle | train | php |
bb69caa7239b44fb839eb5c5e628d3fa04328281 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -38,7 +38,7 @@ VERSION = "1.4.7"
REQS = ['enum34>=1.0.4',
'future>=0.16.0',
- 'h5py==2.7.1',
+ 'h5py>=2.7.1',
'matplotlib>=1.3.1',
'numpy>=1.8.0',
'pylru>=1.0', | unpin dependencies (#<I>) | BlueBrain_NeuroM | train | py |
5a386dec81bd45083740f0db6c0458f1cd012bde | diff --git a/salt/utils/parsers.py b/salt/utils/parsers.py
index <HASH>..<HASH> 100644
--- a/salt/utils/parsers.py
+++ b/salt/utils/parsers.py
@@ -1496,7 +1496,7 @@ class SaltRunOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
class SaltSSHOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
- LogLevelMixIn):
+ LogLevelMixIn, TargetOptionsMixIn):
__metaclass__ = OptionParserMeta
usage = '%prog [options]'
@@ -1520,7 +1520,12 @@ class SaltSSHOptionParser(OptionParser, ConfigDirMixIn, MergeConfigMixIn,
)
def _mixin_after_parsed(self):
- self.config['arg_str'] = self.args[0:]
+ if self.options.list:
+ self.config['tgt'] = self.args[0].split(',')
+ else:
+ self.config['tgt'] = self.args[0]
+ if len(self.args) > 0:
+ self.config['arg_str'] = self.args[1:]
def setup_config(self):
return config.master_config(self.get_config_file_path()) | Read in the arg_str and tgt for salt-ssh | saltstack_salt | train | py |
a3ce99a5fb7a07065f0d6a6d46263659b9d34dd9 | diff --git a/lib/commands/gesture.js b/lib/commands/gesture.js
index <HASH>..<HASH> 100644
--- a/lib/commands/gesture.js
+++ b/lib/commands/gesture.js
@@ -53,7 +53,14 @@ commands.performActions = async function (actions) {
parameters: {
pointerType: 'touch'
}
- } : {}));
+ } : {}))
+ .map((action) => {
+ const modifiedAction = _.clone(action) || {};
+ // Selenium API unexpectedly inserts zero pauses, which are not supported by WDA
+ modifiedAction.actions = (action.actions || [])
+ .filter((innerAction) => !(innerAction.type === 'pause' && innerAction.duration === 0));
+ return modifiedAction;
+ });
log.debug(`Preprocessed actions: ${JSON.stringify(preprocessedActions, null, ' ')}`);
return await this.proxyCommand('/actions', 'POST', {actions: preprocessedActions});
}; | Filter out zero waits from W3C actions (#<I>)
* Filter out zero waits from W3C actions
* Make it more stable | appium_appium-xcuitest-driver | train | js |
2bb7c8875653cf3f629727eabf4e50012519ec88 | diff --git a/flask_io/permissions.py b/flask_io/permissions.py
index <HASH>..<HASH> 100644
--- a/flask_io/permissions.py
+++ b/flask_io/permissions.py
@@ -16,10 +16,3 @@ class Permission(metaclass=ABCMeta):
Return `True` if permission is granted, `False` otherwise.
"""
pass
-
- @abstractmethod
- def has_object_permission(self, obj):
- """
- Return `True` if permission is granted, `False` otherwise.
- """
- pass | Remove method has_object_permission | viniciuschiele_flask-io | train | py |
b667ee4adf489e4604903965267d8b80d22e6119 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -97,7 +97,7 @@ export default function TimeAgo({
maxPeriod * 1000,
)
- if (period) {
+ if (period && period !== Infinity) {
if (timeoutId) {
clearTimeout(timeoutId)
} | Fix refresh creating an infinite timeout loop | nmn_react-timeago | train | js |
bb65a5d5b9b89e34b78336592ca2588e7c938f98 | diff --git a/DependencyInjection/DoctrineExtension.php b/DependencyInjection/DoctrineExtension.php
index <HASH>..<HASH> 100644
--- a/DependencyInjection/DoctrineExtension.php
+++ b/DependencyInjection/DoctrineExtension.php
@@ -54,8 +54,8 @@ class DoctrineExtension extends Extension
*/
public function ormLoad($config, ContainerBuilder $container)
{
- $this->createOrmProxyDirectory($container->getParameter('kernel.cache_dir'));
$this->loadOrmDefaults($config, $container);
+ $this->createOrmProxyDirectory($container->getParameter('doctrine.orm.proxy_dir'));
$this->loadOrmEntityManagers($config, $container);
}
@@ -181,10 +181,9 @@ class DoctrineExtension extends Extension
/**
* Create the Doctrine ORM Entity proxy directory
*/
- protected function createOrmProxyDirectory($tmpDir)
+ protected function createOrmProxyDirectory($proxyCacheDir)
{
// Create entity proxy directory
- $proxyCacheDir = $tmpDir.'/doctrine/orm/Proxies';
if (!is_dir($proxyCacheDir)) {
if (false === @mkdir($proxyCacheDir, 0777, true)) {
die(sprintf('Unable to create the Doctrine Proxy directory (%s)', dirname($proxyCacheDir))); | [DoctrineBundle] Fix createOrmProxyDirectory method | doctrine_DoctrineBundle | train | php |
7cfcbf5b5c814ba0a08d6c61a045c3e6ee8ffe86 | diff --git a/koala/ast/graph.py b/koala/ast/graph.py
index <HASH>..<HASH> 100644
--- a/koala/ast/graph.py
+++ b/koala/ast/graph.py
@@ -45,6 +45,7 @@ class Spreadsheet(object):
self.history = dict()
self.count = 0
self.volatile_to_remove = ["INDEX", "OFFSET"]
+ self.reset_buffer = set()
def prune_graph(self, inputs):
@@ -319,6 +320,8 @@ class Spreadsheet(object):
def set_value(self, address, val):
+ self.reset_buffer = set()
+
if address not in self.cellmap:
raise Exception("Address not present in graph.")
@@ -349,12 +352,15 @@ class Spreadsheet(object):
addr = cell.address()
if cell.value is None and addr not in self.named_ranges: return
+ self.reset_buffer.add(cell)
# update depending ranges
if type(cell.value) == Range:
cell.value.reset()
else:
cell.value = None
- map(self.reset,self.G.successors_iter(cell))
+ for child in self.G.successors_iter(cell):
+ if child not in self.reset_buffer:
+ self.reset(child)
def print_value_tree(self,addr,indent):
cell = self.cellmap[addr] | set_value goes from 3s to <I> with a buffer | anthill_koala | train | py |
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.