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 |
|---|---|---|---|---|---|
364f7fece85aa2ce8d99702ff7004c761cd661d7 | diff --git a/cilium/cmd/cleanup.go b/cilium/cmd/cleanup.go
index <HASH>..<HASH> 100644
--- a/cilium/cmd/cleanup.go
+++ b/cilium/cmd/cleanup.go
@@ -76,7 +76,7 @@ func runCleanup() {
// errors seen, but continue. So that one remove function does not
// prevent the remaining from running.
type cleanupFunc func() error
- checks := []cleanupFunc{removeAllMaps, unmountFS, removeDirs, removeCNI}
+ checks := []cleanupFunc{removeAllMaps, removeDirs, removeCNI}
for _, clean := range checks {
if err := clean(); err != nil {
fmt.Fprintf(os.Stderr, "Error: %s\n", err)
@@ -145,13 +145,6 @@ func removeDirs() error {
return nil
}
-func unmountFS() error {
- if !bpf.IsBpffs(bpf.GetMapRoot()) {
- return nil
- }
- return bpf.UnMountFS()
-}
-
func removeAllMaps() error {
mapDir := bpf.MapPrefixPath()
maps, err := ioutil.ReadDir(mapDir) | cilium: Do not unmount BPF filesystem on cleanup
It does not seem wise to unmount the BPF filesystem on manual cleanup, it may
be in use by other components. | cilium_cilium | train | go |
fa75686da9252825292d6b8d5607000be47aa339 | diff --git a/sqlalchemy_postgres_autocommit/databases.py b/sqlalchemy_postgres_autocommit/databases.py
index <HASH>..<HASH> 100644
--- a/sqlalchemy_postgres_autocommit/databases.py
+++ b/sqlalchemy_postgres_autocommit/databases.py
@@ -14,12 +14,12 @@ class Database:
event.listen(self.Session, 'after_begin', self.handle_after_transaction_begin)
event.listen(self.Session, 'after_transaction_end', self.handle_after_transaction_end)
- def connect(self, database_url):
- self.engine = engine.create_engine(database_url, isolation_level="AUTOCOMMIT")
+ def connect(self, database_url, **kwargs):
+ self.engine = engine.create_engine(database_url, isolation_level="AUTOCOMMIT", **kwargs)
self.Session.configure(bind=self.engine)
- def connect_with_connection(self, database_url):
- self.engine = engine.create_engine(database_url, isolation_level="AUTOCOMMIT")
+ def connect_with_connection(self, database_url, **kwargs):
+ self.engine = engine.create_engine(database_url, isolation_level="AUTOCOMMIT", **kwargs)
connection = self.engine.connect()
self.Session.configure(bind=connection)
return connection | Add kwargs to create engine.
We decided to add pre_ping=True . Without it we were running into bug: <URL> | socialwifi_sqlalchemy-postgres-autocommit | train | py |
c9ee7d36b8f1e0b6a090948e2840a90f975d060c | diff --git a/lib/composer.js b/lib/composer.js
index <HASH>..<HASH> 100644
--- a/lib/composer.js
+++ b/lib/composer.js
@@ -19,8 +19,8 @@
var opts = targetOptions || {};
var renderTarget = new THREE.WebGLRenderTarget(
- (opts.width || renderer.domElement.width),
- (opts.height || renderer.domElement.height),
+ (opts.width * (opts.density || 1) || renderer.domElement.width),
+ (opts.height * (opts.density || 1) || renderer.domElement.height),
_.extend({
minFilter: THREE.LinearFilter,
magFilter: THREE.LinearFilter, | Fixing a spawned canvas density issue. | lumine-gl_lumine | train | js |
5d6dd3d69a6703ba20ddb77848d96c2138f89801 | diff --git a/classes/Enum.php b/classes/Enum.php
index <HASH>..<HASH> 100755
--- a/classes/Enum.php
+++ b/classes/Enum.php
@@ -12,7 +12,7 @@
abstract class Enum {
- private function __construct(){}
+ final private function __construct(){}
protected static function __constants(){
static $_consts = null; | Enum::__constructor now is final | caffeina-core_core | train | php |
ac156fc2d2459a33bfc5e0f0b8f586090c676ec6 | diff --git a/devices.js b/devices.js
index <HASH>..<HASH> 100644
--- a/devices.js
+++ b/devices.js
@@ -9628,6 +9628,28 @@ const devices = [
description: 'RGBW LED bulb with dimmer',
extend: generic.light_onoff_brightness_colortemp_colorxy,
},
+
+ // Viessmann
+ {
+ zigbeeModel: ['7637434'],
+ model: 'ZK03840',
+ vendor: 'Viessmann',
+ description: 'ViCare radiator thermostat valve',
+ supports: 'thermostat',
+ fromZigbee: [fz.thermostat_att_report, fz.battery],
+ toZigbee: [tz.thermostat_occupied_heating_setpoint, tz.thermostat_local_temperature_calibration],
+ meta: {configureKey: 1},
+ configure: async (device, coordinatorEndpoint) => {
+ const endpoint = device.getEndpoint(1);
+ await bind(endpoint, coordinatorEndpoint, [
+ 'genBasic', 'genPowerCfg', 'genIdentify', 'genTime', 'genPollCtrl', 'hvacThermostat',
+ 'hvacUserInterfaceCfg',
+ ]);
+ await configureReporting.thermostatTemperature(endpoint);
+ await configureReporting.thermostatOccupiedHeatingSetpoint(endpoint);
+ await configureReporting.thermostatPIHeatingDemand(endpoint);
+ },
+ },
];
module.exports = devices.map((device) => | add Viessmann thermostat (#<I>)
* add Viessmann thermostat
* Update devices.js
typo failure
* Update devices.js
okay sorry for the trouble :-)
* Update devices.js
* Update devices.js | Koenkk_zigbee-shepherd-converters | train | js |
cc7870168698da2250006baa76d801ff33ec3b05 | diff --git a/estnltk/tests/test_layer/test_ambiguous_span.py b/estnltk/tests/test_layer/test_ambiguous_span.py
index <HASH>..<HASH> 100644
--- a/estnltk/tests/test_layer/test_ambiguous_span.py
+++ b/estnltk/tests/test_layer/test_ambiguous_span.py
@@ -62,8 +62,8 @@ def test_getitem():
with pytest.raises(KeyError):
span_1['bla']
- with pytest.raises(IndexError):
- span_1[2]
+ with pytest.raises(KeyError):
+ span_1[0]
def test_base_spans(): | removed subscripting with integers from Span and AmbiguousSpan | estnltk_estnltk | train | py |
6ba25b97959b083ba6fcf7a474f5c60b7afa5c21 | diff --git a/lib/apruve/resources/order.rb b/lib/apruve/resources/order.rb
index <HASH>..<HASH> 100644
--- a/lib/apruve/resources/order.rb
+++ b/lib/apruve/resources/order.rb
@@ -25,7 +25,7 @@ module Apruve
response = Apruve.get("orders?secure_hash=#{hash}")
logger.debug response.body
orders = response.body.map { |order| Order.new(order) }
- orders.max_by { |order| order[:created_at] }
+ orders.max_by { |order| order.created_at }
end
def self.finalize!(id) | AP-<I>: attr method instead of hash lookup | apruve_apruve-ruby | train | rb |
75841e21b11faf6d7661d3f5ac94bcd47fb3a3c0 | diff --git a/lib/word-to-markdown.rb b/lib/word-to-markdown.rb
index <HASH>..<HASH> 100644
--- a/lib/word-to-markdown.rb
+++ b/lib/word-to-markdown.rb
@@ -72,9 +72,7 @@ class WordToMarkdown
when :windows
'C:\Program Files (x86)\LibreOffice 4\program\soffice.exe'
else
- soffice_path ||= which("soffice")
- soffice_path ||= which("soffice.bin")
- soffice_path ||= "soffice"
+ "soffice"
end
end | just call soffice, not abs path | benbalter_word-to-markdown | train | rb |
21f09fc04a91d2bf5a7dbaea4d5775ab499d19ba | diff --git a/code/media/koowa/com_koowa/js/koowa.js b/code/media/koowa/com_koowa/js/koowa.js
index <HASH>..<HASH> 100644
--- a/code/media/koowa/com_koowa/js/koowa.js
+++ b/code/media/koowa/com_koowa/js/koowa.js
@@ -506,7 +506,8 @@ Koowa.Controller.Grid = Koowa.Controller.extend({
// Trigger checkbox when the user clicks anywhere in the row
tr.on('click', function(event){
- if($(event.target).is('[type=checkbox]')) {
+ var target = $(event.target);
+ if(target.is('[type=checkbox]') || target.is('[type=radio]')) {
return;
}
@@ -518,6 +519,10 @@ Koowa.Controller.Grid = Koowa.Controller.extend({
var selected,
parent = tr.parent();
+ if ($(this).is('[type=radio]')) {
+ parent.find('.selected').removeClass('selected');
+ }
+
$(this).prop('checked') ? tr.addClass('selected') : tr.removeClass('selected');
selected = tr.hasClass('selected') + tr.siblings('.selected').length; | re #<I>: Add support for radio buttons to koowa.js | joomlatools_joomlatools-framework | train | js |
ea65f3048d0c2cc96e7514040ed6bd8246007e95 | diff --git a/lib/dm-core/collection.rb b/lib/dm-core/collection.rb
index <HASH>..<HASH> 100644
--- a/lib/dm-core/collection.rb
+++ b/lib/dm-core/collection.rb
@@ -17,10 +17,6 @@ module DataMapper
# A Collection is typically returned by the Model#all
# method.
class Collection < LazyArray
- extend Deprecate
-
- deprecate :add, :<<
- deprecate :build, :new
# Returns the Query the Collection is scoped with
# | Remove deprecated methods from Collection | datamapper_dm-core | train | rb |
9889b704557c5edc6b842ae680df363c84026bfb | diff --git a/master/buildbot/test/fake/fakedb.py b/master/buildbot/test/fake/fakedb.py
index <HASH>..<HASH> 100644
--- a/master/buildbot/test/fake/fakedb.py
+++ b/master/buildbot/test/fake/fakedb.py
@@ -106,7 +106,8 @@ class Row(object):
return '%s(**%r)' % (self.__class__.__name__, self.values)
def nextId(self):
- id, Row._next_id = Row._next_id, (Row._next_id or 1) + 1
+ id = Row._next_id if Row._next_id is not None else 1
+ Row._next_id = id + 1
return id
def hashColumns(self, *args): | treat Row._next_id=None case as if next id should be 1
Otherwise first call to Row.nextId() returns None, which leads to failures of
some tests if they are being run first (before other tests initialized next id
to non-None value). | buildbot_buildbot | train | py |
d99727d89f41f32d594f6399022a0dc2784a2001 | diff --git a/src/Illuminate/Support/Facades/Schema.php b/src/Illuminate/Support/Facades/Schema.php
index <HASH>..<HASH> 100755
--- a/src/Illuminate/Support/Facades/Schema.php
+++ b/src/Illuminate/Support/Facades/Schema.php
@@ -23,7 +23,7 @@ class Schema extends Facade
/**
* Get a schema builder instance for a connection.
*
- * @param string $name
+ * @param string|null $name
* @return \Illuminate\Database\Schema\Builder
*/
public static function connection($name) | Add missing null typehint to Schema facade connection method | laravel_framework | train | php |
f7082b8f1121098389131c1cacc1c90a7c01f48f | diff --git a/lib/mongo_mapper/plugins/associations/in_array_proxy.rb b/lib/mongo_mapper/plugins/associations/in_array_proxy.rb
index <HASH>..<HASH> 100644
--- a/lib/mongo_mapper/plugins/associations/in_array_proxy.rb
+++ b/lib/mongo_mapper/plugins/associations/in_array_proxy.rb
@@ -27,7 +27,7 @@ module MongoMapper
return nil if ids.blank?
if ordered?
- ids = find_ids(options)
+ ids = find_ordered_ids(options)
find!(ids.first) if ids.any?
else
query(options).first
@@ -38,7 +38,7 @@ module MongoMapper
return nil if ids.blank?
if ordered?
- ids = find_ids(options)
+ ids = find_ordered_ids(options)
find!(ids.last) if ids.any?
else
query(options).last
@@ -132,7 +132,9 @@ module MongoMapper
valid.empty? ? nil : valid
end
- def find_ids(options={})
+ def find_ordered_ids(options={})
+ return ids if options.empty?
+
matched_ids = klass.collection.distinct(:_id, query(options).criteria.to_hash)
matched_ids.sort_by! { |matched_id| ids.index(matched_id) }
end | * rename find_ids => find_ordered_ids
* optimization: don't do extra query with in_array_proxy ordered: true
when no query options are given | mongomapper_mongomapper | train | rb |
83c68f07ccecba8b7966e6c8acdb9000dee198cb | diff --git a/dwave/cloud/cli.py b/dwave/cloud/cli.py
index <HASH>..<HASH> 100644
--- a/dwave/cloud/cli.py
+++ b/dwave/cloud/cli.py
@@ -252,7 +252,9 @@ def ping(config_file, profile, json_output):
type=click.Path(exists=True, dir_okay=False), help='Configuration file path')
@click.option('--profile', '-p', default=None, help='Connection profile name')
@click.option('--id', default=None, help='Solver ID/name')
-def solvers(config_file, profile, id):
+@click.option('--list', 'list_solvers', default=False, is_flag=True,
+ help='List available solvers, one per line')
+def solvers(config_file, profile, id, list_solvers):
"""Get solver details.
Unless solver name/id specified, fetch and display details for
@@ -268,6 +270,11 @@ def solvers(config_file, profile, id):
click.echo("Solver {} not found.".format(id))
return 1
+ if list_solvers:
+ for solver in solvers:
+ click.echo(solver.id)
+ return
+
# ~YAML output
for solver in solvers:
click.echo("Solver: {}".format(solver.id)) | CLI: add --list option to 'dwave solvers' | dwavesystems_dwave-cloud-client | train | py |
8ec87afee4fc27323c7ff2cbf765e7070e0242e3 | diff --git a/web/concrete/models/permission/categories/block.php b/web/concrete/models/permission/categories/block.php
index <HASH>..<HASH> 100644
--- a/web/concrete/models/permission/categories/block.php
+++ b/web/concrete/models/permission/categories/block.php
@@ -134,7 +134,7 @@ class BlockPermissionKey extends PermissionKey {
'peID' => $pae->getAccessEntityID(),
'pdID' => $pdID,
'accessType' => $accessType
- ), array('cID', 'cvID', 'peID', 'pkID'), true);
+ ), array('cID', 'cvID', 'bID', 'peID', 'pkID'), true);
}
public function removeAssignment(PermissionAccessEntity $pe) { | fixing bug in block assignment
Former-commit-id: <I>cf9f<I>b9f2a<I>d<I>ffcfccbc4c<I>f<I> | concrete5_concrete5 | train | php |
4f7da941940597c32885099dca40ce216814589e | diff --git a/test/AbstractContextTest.php b/test/AbstractContextTest.php
index <HASH>..<HASH> 100644
--- a/test/AbstractContextTest.php
+++ b/test/AbstractContextTest.php
@@ -2,6 +2,7 @@
namespace Amp\Parallel\Test;
+use Amp\Delayed;
use Amp\Loop;
use Amp\Parallel\Sync\Internal\ExitSuccess;
use Amp\PHPUnit\TestCase;
@@ -280,7 +281,8 @@ abstract class AbstractContextTest extends TestCase {
$context->start();
- while (!yield $context->send(0));
+ yield new Delayed(1000);
+ yield $context->send(0);
});
}
} | Use delay instead of checking the resolution value for sending to exited context | amphp_parallel | train | php |
b190949e005a84e04c5c8eef9dc6b46f39d5b44d | diff --git a/tests/test_generate_hooks.py b/tests/test_generate_hooks.py
index <HASH>..<HASH> 100644
--- a/tests/test_generate_hooks.py
+++ b/tests/test_generate_hooks.py
@@ -144,7 +144,8 @@ def test_run_failing_hook_removes_output_directory():
repo_dir='tests/test-hooks/',
overwrite_if_exists=True
)
- assert 'Hook script failed' in str(excinfo.value)
+
+ assert 'Hook script failed' in str(excinfo.value)
assert not os.path.exists('inputhooks')
@@ -174,7 +175,8 @@ def test_run_failing_hook_preserves_existing_output_directory():
repo_dir='tests/test-hooks/',
overwrite_if_exists=True
)
- assert 'Hook script failed' in str(excinfo.value)
+
+ assert 'Hook script failed' in str(excinfo.value)
assert os.path.exists('inputhooks') | Move assert statements out of context managers in tests | audreyr_cookiecutter | train | py |
c5a55cbc6f406c45ca113c198d50c891687cb820 | diff --git a/packages/okam-core/src/swan/helper/triggerEvent.js b/packages/okam-core/src/swan/helper/triggerEvent.js
index <HASH>..<HASH> 100644
--- a/packages/okam-core/src/swan/helper/triggerEvent.js
+++ b/packages/okam-core/src/swan/helper/triggerEvent.js
@@ -40,7 +40,7 @@ export function normalizeEventArgs(component, args) {
dataset,
id: component.id
},
- detail: eventData
+ detail: args[1]
};
args[1] = eventObj; | fix(okam-core): fix $emit event with empty string event detail without keeping the original event detail | ecomfe_okam | train | js |
04a5a2d5b7d16d919865b0a3413e28c8af6174d1 | diff --git a/tests/integration/MediaUploaderTest.php b/tests/integration/MediaUploaderTest.php
index <HASH>..<HASH> 100644
--- a/tests/integration/MediaUploaderTest.php
+++ b/tests/integration/MediaUploaderTest.php
@@ -469,6 +469,21 @@ class MediaUploaderTest extends TestCase
$this->assertEquals('3ef5e70366086147c2695325d79a25cc', $media->filename);
}
+ public function test_it_can_revert_to_original_filename()
+ {
+ $this->useFilesystem('tmp');
+ $this->useDatabase();
+
+ $media = Facade::fromSource(__DIR__ . '/../_data/plank.png')
+ ->toDestination('tmp', 'foo')
+ ->useHashForFilename()
+ ->useOriginalFilename()
+ ->upload();
+
+ $this->assertEquals('plank', $media->filename);
+
+ }
+
protected function mockUploader($filesystem = null, $factory = null)
{
return new MediaUploader( | added test for useOriginalFilename() | plank_laravel-mediable | train | php |
24927eea8fe097b94d60943bf7110aef8bf87636 | diff --git a/trunk/JLanguageTool/src/java/org/languagetool/tools/StringTools.java b/trunk/JLanguageTool/src/java/org/languagetool/tools/StringTools.java
index <HASH>..<HASH> 100644
--- a/trunk/JLanguageTool/src/java/org/languagetool/tools/StringTools.java
+++ b/trunk/JLanguageTool/src/java/org/languagetool/tools/StringTools.java
@@ -105,8 +105,7 @@ public final class StringTools {
* <code>\n</code>
* @throws IOException
*/
- public static String readFile(final InputStream file, final String encoding)
- throws IOException {
+ public static String readFile(final InputStream file, final String encoding) throws IOException {
InputStreamReader isr = null;
BufferedReader br = null;
final StringBuilder sb = new StringBuilder();
@@ -238,6 +237,9 @@ public final class StringTools {
return sb.toString();
}
+ /**
+ * @deprecated use {@link #streamToString(java.io.InputStream, String)} instead (deprecated since 1.8)
+ */
public static String streamToString(final InputStream is) throws IOException {
final InputStreamReader isr = new InputStreamReader(is);
try {
@@ -264,7 +266,7 @@ public final class StringTools {
}
/**
- * Escapes these characters: less than, bigger than, quote, ampersand.
+ * Escapes these characters: less than, greater than, quote, ampersand.
*/
public static String escapeHTML(final String s) {
// this version is much faster than using s.replaceAll | deprecate streamToString(InputStream), which is not used anyway (but it's public so we deprecate it instead of just deleting it) | languagetool-org_languagetool | train | java |
3b02d4c5ffe739fa48b2e109d39e18f6d5a7609d | diff --git a/raft/raft.go b/raft/raft.go
index <HASH>..<HASH> 100644
--- a/raft/raft.go
+++ b/raft/raft.go
@@ -1093,6 +1093,9 @@ func stepLeader(r *raft, m pb.Message) error {
case pr.State == tracker.StateProbe:
pr.BecomeReplicate()
case pr.State == tracker.StateSnapshot && pr.Match >= pr.PendingSnapshot:
+ // TODO(tbg): we should also enter this branch if a snapshot is
+ // received that is below pr.PendingSnapshot but which makes it
+ // possible to use the log again.
r.logger.Debugf("%x recovered from needing snapshot, resumed sending replication messages to %x [%s]", r.id, m.From, pr)
// Transition back to replicating state via probing state
// (which takes the snapshot into account). If we didn't | raft: leave TODO about leaving StateSnapshot
The condition is overly strict, which has popped up in CockroachDB
recently. | etcd-io_etcd | train | go |
275c493a8d079b71989c9be849a3652e1bc84de6 | diff --git a/src/Command/User/UserListCommand.php b/src/Command/User/UserListCommand.php
index <HASH>..<HASH> 100644
--- a/src/Command/User/UserListCommand.php
+++ b/src/Command/User/UserListCommand.php
@@ -44,6 +44,13 @@ class UserListCommand extends CommandBase
ksort($rows);
+ if (!$table->formatIsMachineReadable()) {
+ $this->stdErr->writeln(sprintf(
+ 'Users on the project %s:',
+ $this->api()->getProjectLabel($project)
+ ));
+ }
+
$table->render(array_values($rows), ['email' => 'Email address', 'Name', 'role' => 'Project role', 'ID']);
if (!$table->formatIsMachineReadable()) { | [user:list] Display project name/ID | platformsh_platformsh-cli | train | php |
f3c46fc04c43b2337a23b53896358a2867c30db9 | diff --git a/lib/formtastic/builder/base.rb b/lib/formtastic/builder/base.rb
index <HASH>..<HASH> 100644
--- a/lib/formtastic/builder/base.rb
+++ b/lib/formtastic/builder/base.rb
@@ -57,12 +57,6 @@ module Formtastic
model_name.constantize.content_columns.collect { |c| c.name.to_sym }.compact rescue []
end
- # Returns nil, or a symbol like :belongs_to or :has_many
- def association_macro_for_method(method) #:nodoc:
- reflection = reflection_for(method)
- reflection.macro if reflection
- end
-
def association_primary_key(method)
reflection = reflection_for(method)
reflection.options[:foreign_key] if reflection && !reflection.options[:foreign_key].blank?
diff --git a/lib/formtastic/builder/errors_helper.rb b/lib/formtastic/builder/errors_helper.rb
index <HASH>..<HASH> 100644
--- a/lib/formtastic/builder/errors_helper.rb
+++ b/lib/formtastic/builder/errors_helper.rb
@@ -96,6 +96,11 @@ module Formtastic
@object && @object.respond_to?(:errors) && Formtastic::Builder::Base::INLINE_ERROR_TYPES.include?(inline_errors)
end
+ def association_macro_for_method(method) #:nodoc:
+ reflection = reflection_for(method)
+ reflection.macro if reflection
+ end
+
end
end
end
\ No newline at end of file | moved association_macro_for_method to ErrorsHelper | justinfrench_formtastic | train | rb,rb |
5ea053074fc28dde2444d9d093ed40ff926d5686 | diff --git a/src/org/jgroups/Version.java b/src/org/jgroups/Version.java
index <HASH>..<HASH> 100644
--- a/src/org/jgroups/Version.java
+++ b/src/org/jgroups/Version.java
@@ -20,7 +20,7 @@ import org.jgroups.annotations.Immutable;
@Immutable
public class Version {
public static final short major = 3;
- public static final short minor = 2;
+ public static final short minor = 3;
public static final short micro = 0;
public static final String description="3.3.0.Alpha1"; | Changed version to <I>.Alpha1 | belaban_JGroups | train | java |
eff92aeafb9e6d95d3a9084d0d6a1738171ea79d | diff --git a/bundle/Installer/_templates/legacy_siteaccess/site.ini.append.php b/bundle/Installer/_templates/legacy_siteaccess/site.ini.append.php
index <HASH>..<HASH> 100644
--- a/bundle/Installer/_templates/legacy_siteaccess/site.ini.append.php
+++ b/bundle/Installer/_templates/legacy_siteaccess/site.ini.append.php
@@ -33,6 +33,7 @@ TextTranslation=disabled
[ContentSettings]
CachedViewPreferences[full]=admin_navigation_content=1;admin_children_viewmode=list;admin_list_limit=1
TranslationList={{ translationList }}
+RedirectAfterPublish=node
[TemplateSettings]
Debug=disabled | Redirect to the current node after publish instead of parent (#<I>) | netgen_NetgenAdminUIBundle | train | php |
a50076375ebb964ea8991278d100a63c4ca00e36 | diff --git a/lib/redhillonrails_core/version.rb b/lib/redhillonrails_core/version.rb
index <HASH>..<HASH> 100644
--- a/lib/redhillonrails_core/version.rb
+++ b/lib/redhillonrails_core/version.rb
@@ -1,3 +1,3 @@
module RedhillonrailsCore
- VERSION = "1.1.3"
+ VERSION = "1.2.0"
end | bumped version to <I> | mlomnicki_redhillonrails_core | train | rb |
23ab1c47f1345f566ee1289e39c5f6fdfda8d3d5 | diff --git a/src/pyop/provider.py b/src/pyop/provider.py
index <HASH>..<HASH> 100644
--- a/src/pyop/provider.py
+++ b/src/pyop/provider.py
@@ -361,6 +361,13 @@ class Provider(object):
:param authentication_request: the code_verfier to check against the code challenge.
:returns: whether the code_verifier is what was expected given the cc_cm
"""
+ if not 'code_verifier' in token_request:
+ return False
+
+ if not 'code_challenge_method' in authentication_request:
+ raise InvalidTokenRequest("A code_challenge and code_verifier have been supplied"
+ "but missing code_challenge_method in authentication_request", token_request)
+
code_challenge_method = authentication_request['code_challenge_method']
if code_challenge_method == 'plain':
return authentication_request['code_challenge'] == token_request['code_verifier'] | verify that required request parameters have been supplied | IdentityPython_pyop | train | py |
d54c1b517d98e62c0beb14352f3d7c2e89df1ce6 | diff --git a/activeresource/lib/active_resource/base.rb b/activeresource/lib/active_resource/base.rb
index <HASH>..<HASH> 100644
--- a/activeresource/lib/active_resource/base.rb
+++ b/activeresource/lib/active_resource/base.rb
@@ -130,8 +130,8 @@ module ActiveResource
connection.delete(self.class.element_path(id, prefix_options))
end
- def to_xml
- attributes.to_xml(:root => self.class.element_name)
+ def to_xml(options={})
+ attributes.to_xml({:root => self.class.element_name}.merge(options))
end
# Reloads the attributes of this object from the remote web service. | to_xml needs to accept an options hash to conform with the expectations of Hash#to_xml
git-svn-id: <URL> | rails_rails | train | rb |
bff89a63d567d6df8c941ad588b3b2cb92fff328 | diff --git a/u2flib_host/hid_transport.py b/u2flib_host/hid_transport.py
index <HASH>..<HASH> 100644
--- a/u2flib_host/hid_transport.py
+++ b/u2flib_host/hid_transport.py
@@ -50,6 +50,8 @@ DEVICES = [
(0x1050, 0x0406), # YubiKey 4 U2F+CCID
(0x1050, 0x0407), # YubiKey 4 OTP+U2F+CCID
(0x2581, 0xf1d0), # Plug-Up U2F Security Key
+ (0x096e, 0x0858), # FT U2F
+ (0x096e, 0x085b), # FS ePass FIDO
]
HID_RPT_SIZE = 64 | add Google Titan (Feitian) devices | Yubico_python-u2flib-host | train | py |
75df7de2f1a6a970970f0b6e49f0408f0d225d80 | diff --git a/raft/src/main/java/net/kuujo/copycat/raft/state/LeaderState.java b/raft/src/main/java/net/kuujo/copycat/raft/state/LeaderState.java
index <HASH>..<HASH> 100644
--- a/raft/src/main/java/net/kuujo/copycat/raft/state/LeaderState.java
+++ b/raft/src/main/java/net/kuujo/copycat/raft/state/LeaderState.java
@@ -956,11 +956,7 @@ class LeaderState extends ActiveState {
* Resets the match index when a response fails.
*/
private void resetMatchIndex(AppendResponse response) {
- if (state.getMatchIndex() == 0) {
- state.setMatchIndex(response.logIndex());
- } else if (response.logIndex() != 0) {
- state.setMatchIndex(Math.max(state.getMatchIndex(), response.logIndex()));
- }
+ state.setMatchIndex(response.logIndex());
LOGGER.debug("{} - Reset match index for {} to {}", context.getCluster().member().id(), member, state.getMatchIndex());
} | Always set follower's matchIndex according to AppendEntries response logIndex. | atomix_atomix | train | java |
17384f3cf437fedbe19459a8d154af85de276570 | diff --git a/lib/Cake/Model/BehaviorCollection.php b/lib/Cake/Model/BehaviorCollection.php
index <HASH>..<HASH> 100644
--- a/lib/Cake/Model/BehaviorCollection.php
+++ b/lib/Cake/Model/BehaviorCollection.php
@@ -148,7 +148,7 @@ class BehaviorCollection extends ObjectCollection {
$parentMethods = array_flip(get_class_methods('ModelBehavior'));
$callbacks = array(
'setup', 'cleanup', 'beforeFind', 'afterFind', 'beforeSave', 'afterSave',
- 'beforeDelete', 'afterDelete', 'afterError'
+ 'beforeDelete', 'afterDelete', 'onError'
);
foreach ($methods as $m) { | Fix for wrong callback in $callbacks array: renamed afterError to onError | cakephp_cakephp | train | php |
ab8c61403d7ad618e7fa3ab532b71476036d4e72 | diff --git a/app/controllers/koudoku/subscriptions_controller.rb b/app/controllers/koudoku/subscriptions_controller.rb
index <HASH>..<HASH> 100644
--- a/app/controllers/koudoku/subscriptions_controller.rb
+++ b/app/controllers/koudoku/subscriptions_controller.rb
@@ -117,12 +117,13 @@ module Koudoku
@subscription.subscription_owner = @owner
if @subscription.save
- flash[:notice] = ::ApplicationController.respond_to?(:new_subscription_notice_message) ?
- ::ApplicationController.try(:new_subscription_notice_message) :
+ controller = ::ApplicationController.new
+ flash[:notice] = controller.respond_to?(:new_subscription_notice_message) ?
+ controller.try(:new_subscription_notice_message) :
"You've been successfully upgraded."
redirect_to(
- (::ApplicationController.respond_to?(:after_new_subscription_path) ?
- ::ApplicationController.try(:after_new_subscription_path, @owner, @subscription) :
+ (controller.respond_to?(:after_new_subscription_path) ?
+ controller.try(:after_new_subscription_path, @owner, @subscription) :
owner_subscription_path(@owner, @subscription)
)
) # EO redirect_to | -bugfix: fixed bug in subscription_controller#create where I was using reflection on the class instead of an object of that class | andrewculver_koudoku | train | rb |
85755c934a0c589d168170373e437270c9290846 | diff --git a/pysrt/srtfile.py b/pysrt/srtfile.py
index <HASH>..<HASH> 100644
--- a/pysrt/srtfile.py
+++ b/pysrt/srtfile.py
@@ -188,17 +188,17 @@ class SubRipFile(UserList, object):
Use init eol if no other provided.
"""
path = path or self.path
-
- save_file = open(path, 'w+')
- self.write_into(save_file, encoding=encoding, eol=eol)
+ encoding = encoding or self.encoding
+
+ save_file = codecs.open(path, 'w+', encoding=encoding)
+ self.write_into(save_file, eol=eol)
save_file.close()
- def write_into(self, io, encoding=None, eol=None):
- encoding = encoding or self.encoding
+ def write_into(self, io, eol=None):
output_eol = eol or self.eol
for item in self:
string_repr = unicode(item)
if output_eol != '\n':
string_repr = string_repr.replace('\n', output_eol)
- io.write(string_repr.encode(encoding))
+ io.write(string_repr) | refactor: get rid of encoding mess in SubRipFile.write_into | byroot_pysrt | train | py |
d3931def533f2c1745a1d027d546c98def3576b4 | diff --git a/tests/remotes/s3.py b/tests/remotes/s3.py
index <HASH>..<HASH> 100644
--- a/tests/remotes/s3.py
+++ b/tests/remotes/s3.py
@@ -30,7 +30,13 @@ class S3(Base, CloudURLInfo):
@staticmethod
def _get_storagepath():
- return TEST_AWS_REPO_BUCKET + "/" + str(uuid.uuid4())
+ return (
+ TEST_AWS_REPO_BUCKET
+ + "/"
+ + "dvc_test_caches"
+ + "/"
+ + str(uuid.uuid4())
+ )
@staticmethod
def get_url(): | tests: real_s3 fixture: use specific path (#<I>) | iterative_dvc | train | py |
0f5077acae7d0a98033d5cc88e238ce1a485ed02 | diff --git a/core/src/main/java/org/infinispan/CacheImpl.java b/core/src/main/java/org/infinispan/CacheImpl.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/infinispan/CacheImpl.java
+++ b/core/src/main/java/org/infinispan/CacheImpl.java
@@ -1009,7 +1009,6 @@ public class CacheImpl<K, V> extends CacheSupport<K, V> implements AdvancedCache
transactionManager.commit();
} catch (Throwable e) {
log.couldNotCompleteInjectedTransaction(e);
- tryRollback();
throw new CacheException("Could not commit implicit transaction", e);
}
} | ISPN-<I> For failing injected transactions, the rollback is incorrectly invoked | infinispan_infinispan | train | java |
98caf1c3ec2a7690a2adcb46253176aabed3a5e6 | diff --git a/holoviews/core/element.py b/holoviews/core/element.py
index <HASH>..<HASH> 100644
--- a/holoviews/core/element.py
+++ b/holoviews/core/element.py
@@ -113,11 +113,6 @@ class Element(ViewableElement, Composable, Overlayable):
return pandas.DataFrame(dim_vals, columns=column_names)
- def __repr__(self):
- params = ', '.join('%s=%r' % (k,v) for (k,v) in self.get_param_values())
- return "%s(%r, %s)" % (self.__class__.__name__, self.data, params)
-
-
class Element2D(Element): | Removed the old __repr__ implementation from Element | pyviz_holoviews | train | py |
27db9700ad7700334585f8140ae95016d499be73 | diff --git a/utp.go b/utp.go
index <HASH>..<HASH> 100644
--- a/utp.go
+++ b/utp.go
@@ -72,7 +72,7 @@ const (
// Experimentation on localhost on OSX gives me this value. It appears to
// be the largest approximate datagram size before remote libutp starts
// selectively acking.
- minMTU = 1500
+ minMTU = 576
recvWindow = 0x8000
// Does not take into account possible extensions, since currently we
// don't ever send any. | Possible packet truncation occuring with excessively long packets leading to corrupted stream
Need to investigate if DF Don't Fragment will prevent or report this to us | anacrolix_utp | train | go |
5af6936f801ce31e3803bd5f7725cd27fc9e10d4 | diff --git a/src/Pdf.php b/src/Pdf.php
index <HASH>..<HASH> 100644
--- a/src/Pdf.php
+++ b/src/Pdf.php
@@ -17,6 +17,9 @@ class Pdf
// Regular expression to detect HTML strings
const REGEX_HTML = '/<html/i';
+ // Regular expression to detect XML strings
+ const REGEX_XML = '/<\??xml/i';
+
// prefix for tmp files
const TMP_PREFIX = 'tmp_wkhtmlto_pdf_';
@@ -262,6 +265,8 @@ class Pdf
{
if (preg_match(self::REGEX_HTML, $input)) {
return $this->_tmpFiles[] = new File($input, '.html', self::TMP_PREFIX, $this->tmpDir);
+ } elseif (preg_match(self::REGEX_XML, $input)) {
+ return $this->_tmpFiles[] = new File($input, '.xml', self::TMP_PREFIX, $this->tmpDir);
} else {
return $input;
} | Added expression for XML (svg) detection | mikehaertl_phpwkhtmltopdf | train | php |
c5683f92340b2773c1805495517aad63de2fec70 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -4,7 +4,7 @@ from setuptools import find_packages
import time
-_version = "0.1.dev%s" % int(time.time())
+_version = "0.1"
_packages = find_packages(exclude=["*.tests", "*.tests.*", "tests.*", "tests"])
_short_description = "pylint-common is a Pylint plugin to improve Pylint error analysis of the" \
@@ -18,7 +18,7 @@ setup( name='pylint-common',
description=_short_description,
version=_version,
packages=_packages,
- install_requires=['pylint', 'astroid', 'pylint-plugin-utils'],
+ install_requires=['pylint>=1.0', 'astroid>=1.0', 'pylint-plugin-utils>=0.1'],
license='GPLv2',
keywords='pylint stdlib plugin'
) | Setting versions for requirements and setting version to <I> for release | landscapeio_pylint-common | train | py |
ba7e661852670b4ceb2164d968f2ca0b77599b59 | diff --git a/lib/vestal_versions/creation.rb b/lib/vestal_versions/creation.rb
index <HASH>..<HASH> 100644
--- a/lib/vestal_versions/creation.rb
+++ b/lib/vestal_versions/creation.rb
@@ -39,8 +39,8 @@ module VestalVersions
end
# Creates a new version upon updating the parent record.
- def create_version
- versions.create(version_attributes)
+ def create_version(attributes = nil)
+ versions.create(attributes || version_attributes)
reset_version_changes
reset_version
end
diff --git a/lib/vestal_versions/deletion.rb b/lib/vestal_versions/deletion.rb
index <HASH>..<HASH> 100644
--- a/lib/vestal_versions/deletion.rb
+++ b/lib/vestal_versions/deletion.rb
@@ -38,7 +38,7 @@ module VestalVersions
end
def create_destroyed_version
- versions.create({:modifications => attributes, :number => last_version + 1, :tag => 'deleted'})
+ create_version({:modifications => attributes, :number => last_version + 1, :tag => 'deleted'})
end
end | making the delete creation path follow the same flow as normal version creation | laserlemon_vestal_versions | train | rb,rb |
cb0a7e5b769be835d1cba3a671ce7595f3b6997e | diff --git a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java
index <HASH>..<HASH> 100644
--- a/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java
+++ b/biojava-structure/src/main/java/org/biojava/nbio/structure/io/mmcif/SimpleMMcifConsumer.java
@@ -610,6 +610,7 @@ public class SimpleMMcifConsumer implements MMcifConsumer {
// drop atoms from cloned group...
// https://redmine.open-bio.org/issues/3307
altLocG.setAtoms(new ArrayList<Atom>());
+ altLocG.getAltLocs().clear();
current_group.addAltLoc(altLocG);
return altLocG;
} | Fix altLocs bug in MMCiff
It was fixed for PDB files parsing but not for MMCiff | biojava_biojava | train | java |
ad79af24ea7cc615bf79ea71bc4dfe34d6667ec7 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -11,7 +11,7 @@ with open(path.join(here, 'README.rst'), encoding='utf-8') as f:
setup(
name='centerline',
- version='0.4',
+ version='0.4.1',
description='Calculate the centerline of a polygon',
long_description=long_description,
classifiers=[ | Bump package to <I> | fitodic_centerline | train | py |
f6fba3092c0b75e07902cc466e8022856092ab45 | diff --git a/src/index.js b/src/index.js
index <HASH>..<HASH> 100644
--- a/src/index.js
+++ b/src/index.js
@@ -25,8 +25,18 @@ class Watcher extends EventEmitter {
startchild() {
if (this.child) return;
+
+ let filteredArgs = process.execArgv.filter(
+ v => !/^--(debug|inspect)/.test(v)
+ );
- this.child = fork(path.join(__dirname, 'child'));
+ let options = {
+ execArgv: filteredArgs,
+ env: process.env,
+ cwd: process.cwd()
+ };
+
+ this.child = fork(path.join(__dirname, 'child'), process.argv, options);
if (this.watchedPaths.size > 0) {
this.sendCommand('add', [Array.from(this.watchedPaths)]);
@@ -130,4 +140,4 @@ class Watcher extends EventEmitter {
}
}
-module.exports = Watcher;
\ No newline at end of file
+module.exports = Watcher; | Fixed inspect bug
This package breaks inspect usage in parcel, please add this code, it is the same as in parcel itself:
<URL>. | DeMoorJasper_fswatcher-child | train | js |
868798ad8561aedf93a88bb5490457ab239c7a75 | diff --git a/src/PHPushbullet.php b/src/PHPushbullet.php
index <HASH>..<HASH> 100644
--- a/src/PHPushbullet.php
+++ b/src/PHPushbullet.php
@@ -126,7 +126,9 @@ class PHPushbullet
public function all()
{
foreach ($this->devices() as $device) {
- $this->devices[] = $device->iden;
+ if($device->pushable == true) {
+ $this->devices[] = $device->iden;
+ }
}
return $this; | Fix "Bad Request" error for unpushable devices | joetannenbaum_phpushbullet | train | php |
5b49ed80761ac02974646b5f3a5f4a37649d72a7 | diff --git a/src/Icon.js b/src/Icon.js
index <HASH>..<HASH> 100644
--- a/src/Icon.js
+++ b/src/Icon.js
@@ -8,7 +8,21 @@ import icons from '../icons.json'
const aliases = {
scrollLeft: icons.chevronLeft,
chevronLight: icons.chevronDown,
- chevronThick: icons.chevronDownThick
+ chevronThick: icons.chevronDownThick,
+ // aliases for breaking changes from #153
+ // should add propType warnings similar to the color name deprecation getters
+ box: icons.boxEmpty,
+ car: icons.cars,
+ cruise: icons.cruises,
+ description: icons.document,
+ hotel: icons.hotels,
+ allInclusive: icons.inclusive,
+ radioFilled: icons.radioChecked,
+ radio: icons.radioEmpty,
+ add: icons.radioPlus,
+ minus: icons.radioMinus,
+ businessSeat: icons.seatBusiness,
+ economySeat: icons.seatEconomy
}
const getPath = ({ name, legacy }) => { | Add aliases for renamed icons in #<I> | jrs-innovation-center_design-system | train | js |
ea52d67a3807b7895a1be879c11d1a9af0a630b5 | diff --git a/enforcer/datapath.go b/enforcer/datapath.go
index <HASH>..<HASH> 100644
--- a/enforcer/datapath.go
+++ b/enforcer/datapath.go
@@ -293,11 +293,10 @@ func (d *Datapath) doCreatePU(contextID string, puInfo *policy.PUInfo) error {
}
pu := &PUContext{
- ID: contextID,
- ManagementID: puInfo.Policy.ManagementID(),
- PUType: puInfo.Runtime.PUType(),
- IP: ip,
- externalIPCache: cache.NewCacheWithExpiration(time.Second * 900),
+ ID: contextID,
+ ManagementID: puInfo.Policy.ManagementID(),
+ PUType: puInfo.Runtime.PUType(),
+ IP: ip,
}
// Cache PUs for retrieval based on packet information
@@ -334,6 +333,8 @@ func (d *Datapath) doUpdatePU(puContext *PUContext, containerInfo *policy.PUInfo
puContext.Annotations = containerInfo.Policy.Annotations()
+ puContext.externalIPCache = cache.NewCache()
+
puContext.ApplicationACLs = acls.NewACLCache()
if err := puContext.ApplicationACLs.AddRuleList(containerInfo.Policy.ApplicationACLs()); err != nil {
return err | Fix ACL cache retention after policy updates (#<I>) | aporeto-inc_trireme-lib | train | go |
e43b6cb73d8025140eeb96783c67d63853756d67 | diff --git a/eqcorrscan/core/match_filter.py b/eqcorrscan/core/match_filter.py
index <HASH>..<HASH> 100644
--- a/eqcorrscan/core/match_filter.py
+++ b/eqcorrscan/core/match_filter.py
@@ -172,12 +172,12 @@ def _template_loop(template, chan, station, channel, debug=0, i=0):
:returns: tuple of (i, ccc) with ccc as an ndarray
.. rubric:: Note
- ..This function currently assumes only one template-channel per\
- data-channel, while this is normal for a standard matched-filter routine,\
- if we wanted to impliment a subspace detector, this would be the function\
- to change, I think. E.g. where I currently take only the first matching\
- channel, we could loop through all the matching channels and then sum the\
- correlation sums - however I don't really understand how you detect based\
+ ..This function currently assumes only one template-channel per
+ data-channel, while this is normal for a standard matched-filter routine,
+ if we wanted to impliment a subspace detector, this would be the function
+ to change, I think. E.g. where I currently take only the first matching
+ channel, we could loop through all the matching channels and then sum the
+ correlation sums - however I don't really understand how you detect based
on that. More reading of the Harris document required.
"""
from eqcorrscan.utils.timer import Timer | Minor docstring change to create paragraph
Former-commit-id: 3cf<I>aeafa<I>ec<I>e4eb<I>b<I>b4bdab<I> | eqcorrscan_EQcorrscan | train | py |
61ab286aa4a27142dfd0e76c2ff44598d07f8770 | diff --git a/src/Kunstmaan/MediaBundle/Helper/File/FileHelper.php b/src/Kunstmaan/MediaBundle/Helper/File/FileHelper.php
index <HASH>..<HASH> 100644
--- a/src/Kunstmaan/MediaBundle/Helper/File/FileHelper.php
+++ b/src/Kunstmaan/MediaBundle/Helper/File/FileHelper.php
@@ -127,11 +127,13 @@ class FileHelper
public function setFile(File $file)
{
$this->file = $file;
- $this->media->setContent($file);
- $this->media->setContentType($file->getMimeType());
- $this->media->setUrl(
- '/uploads/media/' . $this->media->getUuid() . '.' . $this->media->getContent()->getExtension()
- );
+ if (strlen($file->getPathname()) > 0) {
+ $this->media->setContent($file);
+ $this->media->setContentType($file->getMimeType());
+ $this->media->setUrl(
+ '/uploads/media/' . $this->media->getUuid() . '.' . $this->media->getContent()->getExtension()
+ );
+ }
}
/** | additional check for a case when file does not exist (did not upload correctly) | Kunstmaan_KunstmaanBundlesCMS | train | php |
3efc0e279e7e557f4888969356e6fb01ca5ec746 | diff --git a/Task/Collect.php b/Task/Collect.php
index <HASH>..<HASH> 100644
--- a/Task/Collect.php
+++ b/Task/Collect.php
@@ -118,7 +118,7 @@ class Collect extends Base {
foreach ($grouped_jobs as $collector_class_name => $jobs) {
$collector_helper = $this->getHelper($collector_class_name);
- $jobs_data = $collector_helper->collect($jobs);
+ $incremental_data[$collector_class_name] = $collector_helper->collect($jobs);
$last_job = end($jobs);
if (!empty($last_job['last'])) { | Fixed analysis data not being saved - bug introduced in <I>cd<I>ab5b<I>f<I>b<I>fcda7a<I>. | drupal-code-builder_drupal-code-builder | train | php |
9a7b073f4df6de12401dee154b53f88915a11842 | diff --git a/pkg/apis/storage/fuzzer/fuzzer.go b/pkg/apis/storage/fuzzer/fuzzer.go
index <HASH>..<HASH> 100644
--- a/pkg/apis/storage/fuzzer/fuzzer.go
+++ b/pkg/apis/storage/fuzzer/fuzzer.go
@@ -18,6 +18,7 @@ package fuzzer
import (
"fmt"
+
fuzz "github.com/google/gofuzz"
runtimeserializer "k8s.io/apimachinery/pkg/runtime/serializer"
@@ -82,6 +83,10 @@ var Funcs = func(codecs runtimeserializer.CodecFactory) []interface{} {
obj.Spec.StorageCapacity = new(bool)
*(obj.Spec.StorageCapacity) = false
}
+ if obj.Spec.FSGroupPolicy == nil {
+ obj.Spec.FSGroupPolicy = new(storage.FSGroupPolicy)
+ *obj.Spec.FSGroupPolicy = storage.ReadWriteOnceWithFSTypeFSGroupPolicy
+ }
if len(obj.Spec.VolumeLifecycleModes) == 0 {
obj.Spec.VolumeLifecycleModes = []storage.VolumeLifecycleMode{
storage.VolumeLifecyclePersistent, | Updated fuzzer to get RoundTripTest passing | kubernetes_kubernetes | train | go |
69f347414370ccffa686092e2a83a064c509d983 | diff --git a/backbone.localStorage.js b/backbone.localStorage.js
index <HASH>..<HASH> 100644
--- a/backbone.localStorage.js
+++ b/backbone.localStorage.js
@@ -70,13 +70,13 @@ _.extend(Backbone.LocalStorage.prototype, {
// Retrieve a model from `this.data` by id.
find: function(model) {
- return JSON.parse(this.localStorage().getItem(this.name+"-"+model.id));
+ return this.jsonData(this.localStorage().getItem(this.name+"-"+model.id));
},
// Return the array of all models currently in storage.
findAll: function() {
return _(this.records).chain()
- .map(function(id){return JSON.parse(this.localStorage().getItem(this.name+"-"+id));}, this)
+ .map(function(id){return this.jsonData(this.localStorage().getItem(this.name+"-"+id));}, this)
.compact()
.value();
},
@@ -91,6 +91,11 @@ _.extend(Backbone.LocalStorage.prototype, {
localStorage: function() {
return localStorage;
+ },
+
+ // fix for "illegal access" error on Android when JSON.parse is passed null
+ jsonData: function (data) {
+ return data && JSON.parse(data);
}
}); | fix for "illegal access" error on Android when JSON.parse is passed null | jeromegn_Backbone.localStorage | train | js |
59b6bc62a548dc9d85ff731e1434c9a1ac7df22f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -22,7 +22,7 @@ GRPC_EXTRAS = ['grpcio >= 0.13.0']
setup(
name='gcloud',
- version='0.10.1',
+ version='0.11.0',
description='API Client library for Google Cloud',
author='Google Cloud Platform',
author_email='jjg+gcloud-python@google.com', | Upgrading version to <I> | googleapis_google-cloud-python | train | py |
ea9c54b90f4f24fe1d46cd7fe8c3023cbf0b3038 | diff --git a/src/Lemonblast/Cbor4Php/Tests/CborTest.php b/src/Lemonblast/Cbor4Php/Tests/CborTest.php
index <HASH>..<HASH> 100644
--- a/src/Lemonblast/Cbor4Php/Tests/CborTest.php
+++ b/src/Lemonblast/Cbor4Php/Tests/CborTest.php
@@ -42,6 +42,13 @@ class CborTest extends \PHPUnit_Framework_TestCase
$this->assertEquals(pack('C', 25) . pack('n', 65535), $encoded);
}
+ function testDecodeUINT16()
+ {
+ $decoded = Cbor::decode(pack('C', 25) . pack('n', 65535));
+
+ $this->assertEquals(65535, $decoded);
+ }
+
function testEncodeUINT32()
{
$encoded = Cbor::encode(4294967295); | Added decode UINT <I> test | Lemonblast_Cbor4Php | train | php |
853a593ec39e5c3ebabd8af11fbef91b8de858ad | diff --git a/spec/support/crud/read.rb b/spec/support/crud/read.rb
index <HASH>..<HASH> 100644
--- a/spec/support/crud/read.rb
+++ b/spec/support/crud/read.rb
@@ -73,7 +73,7 @@ module Mongo
send(Utils.camel_to_snake(name), collection)
end
- # Whether the operation is expected to have restuls.
+ # Whether the operation is expected to have results.
#
# @example Whether the operation is expected to have results.
# operation.has_results?
diff --git a/spec/support/crud/write.rb b/spec/support/crud/write.rb
index <HASH>..<HASH> 100644
--- a/spec/support/crud/write.rb
+++ b/spec/support/crud/write.rb
@@ -69,7 +69,7 @@ module Mongo
@name = spec['name']
end
- # Whether the operation is expected to have restuls.
+ # Whether the operation is expected to have results.
#
# @example Whether the operation is expected to have results.
# operation.has_results? | Fix typos in crud spec runner | mongodb_mongo-ruby-driver | train | rb,rb |
70998abf15775112b9a71d688ffc21e26ff5dac9 | diff --git a/models/executor_action.go b/models/executor_action.go
index <HASH>..<HASH> 100644
--- a/models/executor_action.go
+++ b/models/executor_action.go
@@ -92,6 +92,7 @@ func (a UploadAction) Validate() error {
type RunAction struct {
Path string `json:"path"`
Args []string `json:"args"`
+ Dir string `json:"dir,omitempty"`
Env []EnvironmentVariable `json:"env"`
ResourceLimits ResourceLimits `json:"resource_limits"`
Privileged bool `json:"privileged,omitempty"`
diff --git a/models/executor_action_test.go b/models/executor_action_test.go
index <HASH>..<HASH> 100644
--- a/models/executor_action_test.go
+++ b/models/executor_action_test.go
@@ -154,6 +154,7 @@ var _ = Describe("Actions", func() {
`{
"path": "rm",
"args": ["-rf", "/"],
+ "dir": "./some-dir",
"env": [
{"name":"FOO", "value":"1"},
{"name":"BAR", "value":"2"}
@@ -163,6 +164,7 @@ var _ = Describe("Actions", func() {
}`,
&RunAction{
Path: "rm",
+ Dir: "./some-dir",
Args: []string{"-rf", "/"},
Env: []EnvironmentVariable{
{"FOO", "1"}, | add Dir to RunAction for working directory
[#<I>] | cloudfoundry_runtimeschema | train | go,go |
8048a02f45b08f4bcf788de45fafa2d3f6affdeb | diff --git a/src/neevo/Neevo.php b/src/neevo/Neevo.php
index <HASH>..<HASH> 100644
--- a/src/neevo/Neevo.php
+++ b/src/neevo/Neevo.php
@@ -32,7 +32,7 @@ class Neevo implements INeevoObservable, INeevoObserver {
// Neevo revision
- const REVISION = 447;
+ const REVISION = 448;
// Data types
const BOOL = 'b',
diff --git a/tests/NeevoResultTest.php b/tests/NeevoResultTest.php
index <HASH>..<HASH> 100644
--- a/tests/NeevoResultTest.php
+++ b/tests/NeevoResultTest.php
@@ -377,7 +377,6 @@ class NeevoResultTest extends PHPUnit_Framework_TestCase {
* @expectedException RuntimeException
*/
public function testHasCircularReferences(){
- $this->markTestIncomplete();
$this->result->leftJoin($this->result, 'foo')->dump(true);
}
@@ -386,7 +385,6 @@ class NeevoResultTest extends PHPUnit_Framework_TestCase {
* @expectedException RuntimeException
*/
public function testHasCircularReferencesDeeper(){
- $this->markTestIncomplete();
$subquery = new NeevoResult($this->connection, $this->result);
$this->result->leftJoin($subquery, 'foo')->dump(true);
} | Remove mark as incomplete on circular references detection tests | smasty_Neevo | train | php,php |
643241d3504aa7bf4e45052d99c2ec586722bd86 | diff --git a/pem.py b/pem.py
index <HASH>..<HASH> 100644
--- a/pem.py
+++ b/pem.py
@@ -61,16 +61,8 @@ def parse_file(file_name):
return parse(f.read())
-def certificateOptionsFromFiles(*pemFiles, **kw):
- """
- Read all *pemFiles*, find one key, use the first certificate as server
- certificate and the rest as chain.
- """
+def certificateOptionsFromPEMs(pems, **kw):
from twisted.internet import ssl
-
- pems = []
- for pemFile in pemFiles:
- pems += parse_file(pemFile)
keys = [key for key in pems if isinstance(key, Key)]
if not len(keys):
raise ValueError('Supplied PEM file(s) do *not* contain a key.')
@@ -99,6 +91,17 @@ def certificateOptionsFromFiles(*pemFiles, **kw):
return ctxFactory
+def certificateOptionsFromFiles(*pemFiles, **kw):
+ """
+ Read all *pemFiles*, find one key, use the first certificate as server
+ certificate and the rest as chain.
+ """
+ pems = []
+ for pemFile in pemFiles:
+ pems += parse_file(pemFile)
+ return certificateOptionsFromPEMs(pems, **kw)
+
+
class _DHParamContextFactory(object):
"""
A wrapping context factory that gets a context from a different | Refactor to allow working with pem objects directly, file I/O is a separate concern. | hynek_pem | train | py |
15d9afcd959de5df20ebfdfeb88a83b7dc09ba2a | diff --git a/lyricfetch/__init__.py b/lyricfetch/__init__.py
index <HASH>..<HASH> 100644
--- a/lyricfetch/__init__.py
+++ b/lyricfetch/__init__.py
@@ -5,8 +5,9 @@ from pathlib import Path
def _load_config():
here = Path(os.path.realpath(__file__))
config_name = here.parent / 'config.json'
- with open(config_name) as config_file:
- CONFIG.update(json.load(config_file))
+ if config_name.is_file():
+ with open(config_name) as config_file:
+ CONFIG.update(json.load(config_file))
for key in CONFIG:
environ_key = 'LFETCH_' + key.upper() | Don't load the config file if it doesn't exist | ocaballeror_LyricFetch | train | py |
75ab272d1f5892d0dea0d2735188364df3b20fac | diff --git a/datacats/cli/shell.py b/datacats/cli/shell.py
index <HASH>..<HASH> 100644
--- a/datacats/cli/shell.py
+++ b/datacats/cli/shell.py
@@ -32,7 +32,7 @@ def paster(opts):
"""Run a paster command from the current directory
Usage:
- datacats paster [-d] [-s NAME] [COMMAND...]
+ datacats paster [-d] [-s NAME] COMMAND...
Options:
-s --site=NAME Specify a site to run this paster command on [default: primary] | Need a command at the end for datacats paster command to make sense, make it non-optional. | datacats_datacats | train | py |
c66e670fe3256400bdbbe11ac23d678aef3dab67 | diff --git a/jquery.simple.timer.js b/jquery.simple.timer.js
index <HASH>..<HASH> 100644
--- a/jquery.simple.timer.js
+++ b/jquery.simple.timer.js
@@ -29,6 +29,11 @@
}
}(function($, window, document, undefined) {
+ // Polyfill new JS features for older browser
+ Number.isFinite = Number.isFinite || function(value) {
+ return typeof value === 'number' && isFinite(value);
+ }
+
var timer;
var Timer = function(targetElement){ | Polyfill Number.isFinite
Resolves issue #<I> | caike_jQuery-Simple-Timer | train | js |
bba210738416323144be4b564ac0c626fbaed43d | diff --git a/Schema/Blueprint.php b/Schema/Blueprint.php
index <HASH>..<HASH> 100644
--- a/Schema/Blueprint.php
+++ b/Schema/Blueprint.php
@@ -505,6 +505,16 @@ class Blueprint {
}
/**
+ * Add a "deleted at" timestamp for the table.
+ *
+ * @return void
+ */
+ public function softDeletes()
+ {
+ $this->timestamp('deleted_at')->nullable();
+ }
+
+ /**
* Create a new binary column on the table.
*
* @param string $column
diff --git a/Schema/Grammars/MySqlGrammar.php b/Schema/Grammars/MySqlGrammar.php
index <HASH>..<HASH> 100644
--- a/Schema/Grammars/MySqlGrammar.php
+++ b/Schema/Grammars/MySqlGrammar.php
@@ -387,7 +387,7 @@ class MySqlGrammar extends Grammar {
*/
protected function typeTimestamp(Fluent $column)
{
- return 'timestamp default 0';
+ return 'timestamp';
}
/** | Added softDeletes helper to Blueprint. | illuminate_database | train | php,php |
72da79c7f586329e563d7c469c0596f284379aef | 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, find_packages
setup(name='instana',
- version='0.3.0',
+ version='0.4.0',
download_url='https://github.com/instana/python-sensor',
url='https://www.instana.com/',
license='MIT',
@@ -11,11 +11,13 @@ setup(name='instana',
packages=find_packages(exclude=['tests', 'examples']),
long_description="The instana package provides Python metrics and traces for Instana.",
zip_safe=False,
- setup_requires=['nose>=1.0',
- 'fysom>=2.1.2',
- 'opentracing>=1.2.1,<1.3',
- 'basictracer>=2.2.0',
- 'psutil>=5.1.3'],
+ setup_requires=['nose>=1.0'],
+ install_requires=['autowrapt>=1.0',
+ 'fysom>=2.1.2',
+ 'opentracing>=1.2.1,<1.3',
+ 'basictracer>=2.2.0',
+ 'psutil>=5.1.3'],
+ entry_points={'instana.django': ['django.core.handlers.base = instana.django:hook']},
test_suite='nose.collector',
keywords=['performance', 'opentracing', 'metrics', 'monitoring'],
classifiers=[ | Post import hooks support
- Add autowrapt dependency
- Add django entry point hook
- Bump package version to <I> | instana_python-sensor | train | py |
a0ff6a72b76bbca94dbdaaa8a46f931c9ff3262b | diff --git a/frank_static_resources.bundle/symbiote.js b/frank_static_resources.bundle/symbiote.js
index <HASH>..<HASH> 100644
--- a/frank_static_resources.bundle/symbiote.js
+++ b/frank_static_resources.bundle/symbiote.js
@@ -61,7 +61,7 @@ $(document).ready(function() {
data: '["DUMMY"]', // a bug in cocoahttpserver means it can't handle POSTs without a body
url: G.base_url + "/dump",
success: function(data) {
- $('div#dom_dump').append( JsonTools.convert_json_to_dom( data ) );
+ $('div#dom_dump').html( JsonTools.convert_json_to_dom( data ) );
$("#dom_dump").treeview({
collapsed: false
}); | Don't append each DOM dump to the last one. This makes the browser get really slow really fast. | moredip_Frank | train | js |
1ad558f6e2cdca7384d88c90f0d9c6c53494f2d9 | diff --git a/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php b/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php
index <HASH>..<HASH> 100644
--- a/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php
+++ b/tests/Doctrine/ODM/MongoDB/Tests/Types/TypeTest.php
@@ -79,7 +79,7 @@ class TypeTest extends \Doctrine\ODM\MongoDB\Tests\BaseTest
$expectedDate = clone $date;
$cleanMicroseconds = (int) floor(((int) $date->format('u')) / 1000) * 1000;
- $expectedDate->modify($date->format('H:i:s') . '.' . $cleanMicroseconds);
+ $expectedDate->modify($date->format('H:i:s') . '.' . str_pad($cleanMicroseconds, 6, '0', STR_PAD_LEFT));
$type = Type::getType(Type::DATE);
$this->assertEquals($expectedDate, $type->convertToPHPValue($type->convertToDatabaseValue($date))); | Correctly format microseconds in test | doctrine_mongodb-odm | train | php |
8d9719586ac766a3debb261ed668dca068230e4f | diff --git a/chirptext/__version__.py b/chirptext/__version__.py
index <HASH>..<HASH> 100644
--- a/chirptext/__version__.py
+++ b/chirptext/__version__.py
@@ -10,6 +10,6 @@ __description__ = "ChirpText is a collection of text processing tools for Python
__url__ = "https://letuananh.github.io/chirptext/"
__maintainer__ = "Le Tuan Anh"
__version_major__ = "0.1"
-__version__ = "{}a20".format(__version_major__)
+__version__ = "{}a21".format(__version_major__)
__version_long__ = "{} - Alpha".format(__version_major__)
__status__ = "Prototype" | pump version to <I>a<I> | letuananh_chirptext | train | py |
a799ad95ce76d5b4e3668ba9ba5aecf6f1ea64bc | diff --git a/pulse.go b/pulse.go
index <HASH>..<HASH> 100644
--- a/pulse.go
+++ b/pulse.go
@@ -372,8 +372,8 @@ func action(ctx *cli.Context) {
"keyringFile": keyringFile,
}).Fatal("can't open keyring path")
os.Exit(1)
- defer file.Close()
}
+ file.Close()
log.Info("setting keyring file to: ", keyringFile)
c.SetKeyringFile(keyringFile)
} | Fix: Close keyring file passed in as we just set the path to file and not pass in the open file | intelsdi-x_snap | train | go |
febdaf0f76617b3d0f0f0c3b54451bd5f38aa57c | diff --git a/pkg/cmd/util/docker/docker.go b/pkg/cmd/util/docker/docker.go
index <HASH>..<HASH> 100644
--- a/pkg/cmd/util/docker/docker.go
+++ b/pkg/cmd/util/docker/docker.go
@@ -2,6 +2,7 @@ package docker
import (
"os"
+ "time"
"k8s.io/kubernetes/pkg/kubelet/dockertools"
@@ -39,15 +40,14 @@ func (_ *Helper) GetClient() (client *docker.Client, endpoint string, err error)
}
// GetKubeClient returns the Kubernetes Docker client.
-func (_ *Helper) GetKubeClient() (*KubeDocker, string, error) {
+func (_ *Helper) GetKubeClient(requestTimeout, imagePullProgressDeadline time.Duration) (*KubeDocker, string, error) {
var endpoint string
if len(os.Getenv("DOCKER_HOST")) > 0 {
endpoint = os.Getenv("DOCKER_HOST")
} else {
endpoint = "unix:///var/run/docker.sock"
}
- // TODO: set a timeout here
- client := dockertools.ConnectToDockerOrDie(endpoint, 0)
+ client := dockertools.ConnectToDockerOrDie(endpoint, requestTimeout, imagePullProgressDeadline)
originClient := &KubeDocker{client}
return originClient, endpoint, nil
} | adapt: request timeout and image pull progress deadline for docker.GetKubeClient | openshift_origin | train | go |
bddbbd25429e3ab3714a7c08af4c1260de97eee8 | diff --git a/sqlg-core/src/main/java/org/umlg/sqlg/structure/SqlgElement.java b/sqlg-core/src/main/java/org/umlg/sqlg/structure/SqlgElement.java
index <HASH>..<HASH> 100644
--- a/sqlg-core/src/main/java/org/umlg/sqlg/structure/SqlgElement.java
+++ b/sqlg-core/src/main/java/org/umlg/sqlg/structure/SqlgElement.java
@@ -14,6 +14,7 @@ import org.umlg.sqlg.util.SqlgUtil;
import java.lang.reflect.Array;
import java.sql.*;
import java.util.*;
+import java.util.concurrent.ConcurrentHashMap;
import java.util.stream.Stream;
/**
@@ -28,7 +29,8 @@ public abstract class SqlgElement implements Element {
protected String table;
protected RecordId recordId;
protected final SqlgGraph sqlgGraph;
- protected Map<String, Object> properties = new HashMap<>();
+ //Multiple threads can access the same element
+ protected Map<String, Object> properties = new ConcurrentHashMap<>();
private SqlgElementElementPropertyRollback elementPropertyRollback;
protected boolean removed = false; | make SqlgElement.properties a ConcurrentHashMap as occasionally multiple threads access the same element | pietermartin_sqlg | train | java |
e844b21e8b48bd13d3e2590e1d272fc21e642c6f | diff --git a/did/plugins/jira.py b/did/plugins/jira.py
index <HASH>..<HASH> 100644
--- a/did/plugins/jira.py
+++ b/did/plugins/jira.py
@@ -110,7 +110,7 @@ class Issue(object):
for comment in self.comments:
created = dateutil.parser.parse(comment["created"]).date()
try:
- if (comment["author"]["name"] == user.login and
+ if (comment["author"]["emailAddress"] == user.email and
created >= options.since.date and
created < options.until.date):
return True
@@ -131,7 +131,7 @@ class JiraCreated(Stats):
query = (
"project = '{0}' AND creator = '{1}' AND "
"created >= {2} AND created <= {3}".format(
- self.parent.project, self.user.login,
+ self.parent.project, self.user.email,
self.options.since, self.options.until))
self.stats = Issue.search(query, stats=self)
@@ -160,7 +160,7 @@ class JiraResolved(Stats):
query = (
"project = '{0}' AND assignee = '{1}' AND "
"resolved >= {2} AND resolved <= {3}".format(
- self.parent.project, self.user.login,
+ self.parent.project, self.user.email,
self.options.since, self.options.until))
self.stats = Issue.search(query, stats=self) | Use email for searching Jira issues [fix #<I>] | psss_did | train | py |
bfb13ba6ba383ffd3452d20026ee29f0231dae0c | diff --git a/public/js/data-table.js b/public/js/data-table.js
index <HASH>..<HASH> 100644
--- a/public/js/data-table.js
+++ b/public/js/data-table.js
@@ -1,6 +1,6 @@
define([
'plugins/admin/libs/jquery.dataTables/jquery.dataTables',
- 'template'
+ 'plugins/app/libs/artTemplate/template.min'
], function () {
//http://datatables.net/plug-ins/pagination#bootstrap
// Start Bootstrap
diff --git a/public/js/form.js b/public/js/form.js
index <HASH>..<HASH> 100644
--- a/public/js/form.js
+++ b/public/js/form.js
@@ -1,4 +1,9 @@
-define(['jquery-form', 'comps/jquery.loadJSON/index', 'plugins/admin/js/form-update'], function () {
+define([
+ 'plugins/app/libs/jquery-form/jquery.form',
+ 'comps/jquery.loadJSON/index',
+ 'plugins/admin/js/form-update',
+ 'plugins/app/libs/jquery-unparam/jquery-unparam.min'
+], function () {
// require jquery-unparam
$.fn.loadParams = function () {
return this.loadJSON($.unparam(location.search.substring(1))); | refactoring: form直接加载unparam | miaoxing_admin | train | js,js |
18973e2f2d7cf58933ef1bee2d6f1e7eb3b3a71f | diff --git a/plexapi/video.py b/plexapi/video.py
index <HASH>..<HASH> 100644
--- a/plexapi/video.py
+++ b/plexapi/video.py
@@ -454,10 +454,7 @@ class Show(Video):
key = '%s/prefs?' % self.key
preferences = {pref.id: list(pref.enumValues.keys()) for pref in self.preferences()}
for settingID, value in kwargs.items():
- try:
- enumValues = [int(x) for x in preferences.get(settingID)]
- except ValueError:
- enumValues = [x.decode() for x in preferences.get(settingID)]
+ enumValues = preferences.get(settingID)
if value in enumValues:
data[settingID] = value
else: | update editAdvanced method to work with py2 drop | pkkid_python-plexapi | train | py |
2df50c81367df684fadd93ed81335f2b8239d2af | diff --git a/abstract.js b/abstract.js
index <HASH>..<HASH> 100644
--- a/abstract.js
+++ b/abstract.js
@@ -574,7 +574,7 @@ ee(Object.defineProperties(PersistenceDriver.prototype, assign({
name = ensureString(name);
keyPath = ensureString(keyPath);
promise = this._trackSize(name, {
- eventName: 'index:' + keyPath,
+ eventName: 'computed:' + keyPath,
recalculate: this.recalculateComputedSize.bind(this, name, keyPath, searchValue),
resolveEvent: function (event) {
return {
@@ -699,7 +699,7 @@ ee(Object.defineProperties(PersistenceDriver.prototype, assign({
data: nu,
old: old
};
- this.emit('index:' + ns, driverEvent);
+ this.emit('computed:' + ns, driverEvent);
this.emit('object:' + path, driverEvent);
return promise;
}.bind(this)); | Rename event name prefix from 'index:' to 'computed:' | medikoo_dbjs-persistence | train | js |
b9160490458a17dc2eee585010968fcaf47c9dad | diff --git a/tests/tests.js b/tests/tests.js
index <HASH>..<HASH> 100644
--- a/tests/tests.js
+++ b/tests/tests.js
@@ -9,7 +9,7 @@
// NOTE: I need to rewrite this junk so it uses Quanah ...
//
// ~~ (c) SRW, 28 Nov 2012
-// ~~ last updated 20 May 2013
+// ~~ last updated 21 May 2013
(function () {
'use strict';
@@ -46,7 +46,11 @@
/*global phantom: false */
n -= 1;
if (n === 0) {
- console.log('Success! All tests passed :-)');
+ if (code === 0) {
+ console.log('Success! All tests passed :-)');
+ } else {
+ console.error('Exiting due to error ...');
+ }
setTimeout(phantom.exit, 0, code);
}
return; | Corrected the "Success!" message in tests | qmachine_qm-nodejs | train | js |
66651eccd5305cadf64591148e71eca3dc395f03 | diff --git a/Form/DataTransformer/EmptyEntityToNullTransformer.php b/Form/DataTransformer/EmptyEntityToNullTransformer.php
index <HASH>..<HASH> 100644
--- a/Form/DataTransformer/EmptyEntityToNullTransformer.php
+++ b/Form/DataTransformer/EmptyEntityToNullTransformer.php
@@ -43,6 +43,7 @@ class EmptyEntityToNullTransformer implements DataTransformerInterface
if (
null !== $reflPropertyValue
&& ($this->strict || '' !== $reflPropertyValue)
+ && (!$reflPropertyValue instanceof \Countable || sizeof($reflPropertyValue) > 0)
) {
$hasNonEmptyValue = true;
break; | Recognize empty collection in EmptyEntityToNullTransformer | imatic_form-bundle | train | php |
a70943475db3c148342f316d741ddede48a34796 | diff --git a/packages/tab/src/css/index.js b/packages/tab/src/css/index.js
index <HASH>..<HASH> 100644
--- a/packages/tab/src/css/index.js
+++ b/packages/tab/src/css/index.js
@@ -2,7 +2,7 @@ import core from '@pluralsight/ps-design-system-core'
import {
defaultName as themeDefaultName,
names as themeNames
-} from '@pluralsight/ps-design-system-theme/react'
+} from '@pluralsight/ps-design-system-theme/vars'
const listItemTextLightHover = {
color: core.colors.gray06 | fix(tab): reference vars from vars instead of react module | pluralsight_design-system | train | js |
f8df4a642cf935142da388d324a4ea8d7ddbe42a | diff --git a/proctor-common/src/main/java/com/indeed/proctor/common/dynamic/MetaTagsFilter.java b/proctor-common/src/main/java/com/indeed/proctor/common/dynamic/MetaTagsFilter.java
index <HASH>..<HASH> 100644
--- a/proctor-common/src/main/java/com/indeed/proctor/common/dynamic/MetaTagsFilter.java
+++ b/proctor-common/src/main/java/com/indeed/proctor/common/dynamic/MetaTagsFilter.java
@@ -3,6 +3,7 @@ package com.indeed.proctor.common.dynamic;
import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
import com.google.common.base.Preconditions;
+import com.google.common.collect.ImmutableSet;
import com.indeed.proctor.common.model.ConsumableTestDefinition;
import org.springframework.util.CollectionUtils;
@@ -15,7 +16,7 @@ public class MetaTagsFilter implements DynamicFilter {
public MetaTagsFilter(@JsonProperty("meta_tags") final Set<String> metaTags) {
Preconditions.checkArgument(!CollectionUtils.isEmpty(metaTags), "meta_tags should be non-empty string list.");
- this.metaTags = metaTags;
+ this.metaTags = ImmutableSet.copyOf(metaTags);
}
@JsonProperty("meta_tags") | PROC-<I>: Fix to use ImmutableSet to avoid being modified via getter | indeedeng_proctor | train | java |
acc538e30d11c2da9761a6f94bddd9d942c7b84b | diff --git a/beekeeper/data_handlers.py b/beekeeper/data_handlers.py
index <HASH>..<HASH> 100644
--- a/beekeeper/data_handlers.py
+++ b/beekeeper/data_handlers.py
@@ -29,7 +29,7 @@ class DataHandlerMeta(type):
cls.registry.update(**{mimetype: cls for mimetype in dct.get('mimetypes', [dct.get('mimetype')])})
super(DataHandlerMeta, cls).__init__(name, bases, dct)
-DataHandler = DataHandlerMeta('DataHandler', (object,), {})
+DataHandler = DataHandlerMeta(str('DataHandler'), (object,), {})
class XMLParser(DataHandler):
mimetypes = ['application/xml', 'text/xml'] | Adding explicit str() cast to accommodate python2 being unable to handle unicode variable names | haikuginger_beekeeper | train | py |
e43dc6f7d7d6a601b49695734d6ef87a3003a9e6 | diff --git a/concrete/src/Permission/Duration.php b/concrete/src/Permission/Duration.php
index <HASH>..<HASH> 100644
--- a/concrete/src/Permission/Duration.php
+++ b/concrete/src/Permission/Duration.php
@@ -66,7 +66,7 @@ class Duration extends AbstractRepetition
$dateEnd = '';
} else {
$dateEnd = $dateEndDT->format('Y-m-d H:i:s');
- if ($request->get('pdStartDateAllDayActivate')) {
+ if ($request->get('pdEndDateAllDayActivate')) {
// We need to work in the user timezone, otherwise we risk to change the day
$dateEnd = $service->toDateTime($dateEnd, 'user', 'system')->format('Y-m-d').' 23:59:59';
$pd->setEndDateAllDay(1); | Fix saving "all day" for the final date of permission duration | concrete5_concrete5 | train | php |
18ac6dd37ab91825d99c4d8090b4d123bc4ee569 | diff --git a/src/Twig/Extension/PhpFunctions.php b/src/Twig/Extension/PhpFunctions.php
index <HASH>..<HASH> 100644
--- a/src/Twig/Extension/PhpFunctions.php
+++ b/src/Twig/Extension/PhpFunctions.php
@@ -35,6 +35,7 @@ class PhpFunctions extends Twig_Extension
new Twig_SimpleFilter('getclass', 'get_class'),
new Twig_SimpleFilter('strlen', 'strlen'),
new Twig_SimpleFilter('count', 'count'),
+ new Twig_SimpleFilter('ksort', [$this, '_ksort']),
new Twig_SimpleFilter('php_*', [$this, '_callPhpFunction']),
];
}
@@ -58,4 +59,11 @@ class PhpFunctions extends Twig_Extension
return @call_user_func_array($func, $args);
}
+
+ function _ksort($array)
+ {
+ ksort($array);
+
+ return $array;
+ }
} | Alled filter ksort to Twig extension PhpFunctions | ansas_php-component | train | php |
a73f8592cf1ec395d4545ea69a21e66a60e770a7 | diff --git a/src/edeposit/amqp/harvester/structures.py b/src/edeposit/amqp/harvester/structures.py
index <HASH>..<HASH> 100755
--- a/src/edeposit/amqp/harvester/structures.py
+++ b/src/edeposit/amqp/harvester/structures.py
@@ -221,3 +221,12 @@ class Publication(object):
return False
return True
+
+class Publications(namedtuple("Publication", ["publications"])):
+ """
+ AMQP communication structured used to hold the transfered informations.
+
+ Attributes:
+ publications (list): List of :class:`Publication` namedtuples.
+ """
+ pass | structures.py: Added new class Publications. Fixed #9. | edeposit_edeposit.amqp.harvester | train | py |
b78631b13fd76f158f974364f51aa299b0013b8c | diff --git a/packages/heroku-run/commands/run.js b/packages/heroku-run/commands/run.js
index <HASH>..<HASH> 100644
--- a/packages/heroku-run/commands/run.js
+++ b/packages/heroku-run/commands/run.js
@@ -54,6 +54,14 @@ function readStdin(c) {
if (tty.isatty(0)) {
stdin.setRawMode(true);
stdin.pipe(c);
+ let sigints = 0;
+ stdin.on('data', function (c) {
+ if (c === '\u0003') sigints++;
+ if (sigints >= 5) {
+ cli.error('forcing dyno disconnect');
+ process.exit(1);
+ }
+ });
} else {
stdin.pipe(new stream.Transform({
objectMode: true, | disconnect from dyno after 5 sigints | heroku_cli | train | js |
da9611495c97b2646022ddb5a2edfab54bc18045 | diff --git a/BasePlugin.php b/BasePlugin.php
index <HASH>..<HASH> 100644
--- a/BasePlugin.php
+++ b/BasePlugin.php
@@ -44,8 +44,6 @@ class BasePlugin extends \miaoxing\plugin\BaseService
protected $require = [];
/**
- * 插件的唯一数字ID
- *
* @var int
*/
protected $id; | 解决property $id has a superfluous comment description问题 #<I> | miaoxing_plugin | train | php |
96346dedd33ffcce27c0046e056a6ff2fc42f909 | diff --git a/glue/ligolw/metaio.py b/glue/ligolw/metaio.py
index <HASH>..<HASH> 100644
--- a/glue/ligolw/metaio.py
+++ b/glue/ligolw/metaio.py
@@ -2,10 +2,6 @@ __author__ = "Kipp Cannon <kipp@gravity.phys.uwm.edu>"
__date__ = "$Date$"
__version__ = "$Revision$"
-try:
- import numarray
-except:
- pass
import re
import sys
from xml import sax
@@ -214,6 +210,7 @@ class Column(ligolw.Column):
# if the list like object has 0 length, causing numarray to
# barf. If the object is, in fact, a real Python list then
# numarray is made happy.
+ import numarray
if not len(self):
return numarray.array([], type = ToNumArrayType[self.getAttribute("Type")], shape = (len(self),))
return numarray.array(self, type = ToNumArrayType[self.getAttribute("Type")], shape = (len(self),)) | Move import of numarray into one piece of code that needs it --- speeds up
module load significantly for the normal case in which numarray isn't needed. | gwastro_pycbc-glue | train | py |
b7d52131ae3b9d0f559cea5ec3b57676b92cba70 | diff --git a/tests/test_wappalyzer.py b/tests/test_wappalyzer.py
index <HASH>..<HASH> 100644
--- a/tests/test_wappalyzer.py
+++ b/tests/test_wappalyzer.py
@@ -204,4 +204,15 @@ def test_analyze_with_versions_and_categories():
analyzer = Wappalyzer(categories=categories, technologies=technologies)
result = analyzer.analyze_with_versions_and_categories(webpage)
- assert ("WordPress", {"categories": ["CMS", "Blog"], "versions": ["5.4.2"]}) in result.items()
\ No newline at end of file
+ assert ("WordPress", {"categories": ["CMS", "Blog"], "versions": ["5.4.2"]}) in result.items()
+
+def test_pass_request_params():
+
+ try:
+ webpage = WebPage.new_from_url('http://example.com/', timeout=0.00001)
+ assert False #"Shoud have triggered TimeoutError"
+ except requests.exceptions.ConnectTimeout:
+ assert True
+ except:
+ assert False #"Shoud have triggered TimeoutError"
+ | Basic test for passing the params | chorsley_python-Wappalyzer | train | py |
d8cbdf6c94dd26a9e118641cc02b787fb01b18f3 | diff --git a/tests/docker_mock.py b/tests/docker_mock.py
index <HASH>..<HASH> 100644
--- a/tests/docker_mock.py
+++ b/tests/docker_mock.py
@@ -100,8 +100,13 @@ def mock_docker(build_should_fail=False,
flexmock(docker.Client, start=lambda cid, **kwargs: None)
flexmock(docker.Client, tag=lambda img, rep, **kwargs: True)
flexmock(docker.Client, wait=lambda cid: 1 if wait_should_fail else 0)
- flexmock(docker.Client, get_image=lambda img, **kwargs: open("/dev/null",
- "rb"))
+ class GetImageResult(object):
+ data = b''
+ def __init__(self):
+ self.fp = open('/dev/null', 'rb')
+ def __getattr__(self, attr):
+ return getattr(self, self.fp, attr)
+ flexmock(docker.Client, get_image=lambda img, **kwargs: GetImageResult())
flexmock(os.path, exists=lambda p: True if p == DOCKER_SOCKET_PATH else old_ope(p))
for method, args in should_raise_error.items(): | Make result of mocked docker.Client.get_image have 'data' attribute | projectatomic_atomic-reactor | train | py |
f7295533d6095f9fb8b0ea9df35ee1ddc629d4e9 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -31,6 +31,7 @@ setup(
dependency_links=["git+https://github.com/crytic/crytic-compile.git@master#egg=crytic-compile"],
license="AGPL-3.0",
long_description=long_description,
+ long_description_content_type='text/markdown',
entry_points={
"console_scripts": [
"slither = slither.__main__:main", | Fixed Pypi Markdown render
Added long_description_content_type value to have Pypi website correctly
render Readme.md with markdown | crytic_slither | train | py |
de47fc2c228d9d2dc494954a6897329ddb447349 | diff --git a/actionpack/lib/action_view/helpers/debug_helper.rb b/actionpack/lib/action_view/helpers/debug_helper.rb
index <HASH>..<HASH> 100644
--- a/actionpack/lib/action_view/helpers/debug_helper.rb
+++ b/actionpack/lib/action_view/helpers/debug_helper.rb
@@ -32,7 +32,7 @@ module ActionView
content_tag(:pre, object, :class => "debug_dump")
rescue Exception # errors from Marshal or YAML
# Object couldn't be dumped, perhaps because of singleton methods -- this is the fallback
- content_tag(:code, object.to_yaml, :class => "debug_dump")
+ content_tag(:code, object.inspect, :class => "debug_dump")
end
end
end | Fix debug helper not inspecting on Exception
The debug helper should inspect the object when it can't be converted to YAML, this behavior was changed in 8f8d8eb<I>e2ed9b6f<I>aa9d<I>e<I>f<I>. | rails_rails | train | rb |
1cbfc69e10d51ead6689d64c460af2144c2f5319 | diff --git a/bin/copy-assets.js b/bin/copy-assets.js
index <HASH>..<HASH> 100644
--- a/bin/copy-assets.js
+++ b/bin/copy-assets.js
@@ -255,7 +255,11 @@ function start() {
function onBundleFinish({mcPath, bundlePath, projectPath}) {
console.log("[copy-assets] delete debugger.js bundle");
- fs.unlinkSync(path.join(mcPath, bundlePath, "debugger.js"))
+
+ const debuggerPath = path.join(mcPath, bundlePath, "debugger.js")
+ if (fs.existsSync(debuggerPath)) {
+ fs.unlinkSync(debuggerPath)
+ }
console.log("[copy-assets] copy shared bundles to client/shared");
moveFile( | [releases] check if the file exits (#<I>) | firefox-devtools_debugger | train | js |
b6440b533c1d87f6e2dc316f11416cdbd2e5d0e0 | diff --git a/player_js.go b/player_js.go
index <HASH>..<HASH> 100644
--- a/player_js.go
+++ b/player_js.go
@@ -96,7 +96,12 @@ func toLR(data []byte) ([]int16, []int16) {
}
func (p *Player) Write(data []byte) (int, error) {
- p.bufferedData = append(p.bufferedData, data...)
+ m := getDefaultBufferSize(p.sampleRate, p.channelNum, p.bytesPerSample)
+ n := min(len(data), m - len(p.bufferedData))
+ if n < 0 {
+ n = 0
+ }
+ p.bufferedData = append(p.bufferedData, data[:n]...)
c := int64(p.context.Get("currentTime").Float() * float64(p.sampleRate))
if p.positionInSamples+positionDelay < c {
p.positionInSamples = c
@@ -123,7 +128,7 @@ func (p *Player) Write(data []byte) (int, error) {
p.positionInSamples += int64(len(il))
p.bufferedData = p.bufferedData[dataSize:]
}
- return len(data), nil
+ return n, nil
}
func (p *Player) Close() error { | Add limitation to buffers (JavaScript) (#6) | hajimehoshi_oto | train | go |
c3bfdd8e3c9887db8d1dd78b68aacbfd000ba265 | diff --git a/coolname/impl.py b/coolname/impl.py
index <HASH>..<HASH> 100755
--- a/coolname/impl.py
+++ b/coolname/impl.py
@@ -275,7 +275,6 @@ class RandomNameGenerator(object):
if not config['all'].get('__nocheck'):
_check_max_slug_length(self._max_slug_length, self._lists[None])
# Fire it up
- self.randomize()
assert self.generate_slug()
def randomize(self, seed=None): | Don't call randomize() on creation | alexanderlukanin13_coolname | train | py |
311842685098d6ba76c8512a6d61803a308e7546 | diff --git a/epdb/telnetclient.py b/epdb/telnetclient.py
index <HASH>..<HASH> 100755
--- a/epdb/telnetclient.py
+++ b/epdb/telnetclient.py
@@ -45,6 +45,8 @@ class TelnetClient(telnetlib.Telnet):
def ctrl_c(self, int, tb):
self.sock.sendall(IAC + IP)
+ self.sock.sendall('close\n')
+ raise KeyboardInterrupt
def sigwinch(self, int, tb):
self.updateTerminalSize() | close connection on ctrl-c | sassoftware_epdb | train | py |
cbdbfff330b079f8c8bc70158432105314147355 | diff --git a/test/unit/iterator.js b/test/unit/iterator.js
index <HASH>..<HASH> 100644
--- a/test/unit/iterator.js
+++ b/test/unit/iterator.js
@@ -302,13 +302,15 @@ var objectFixturesUUID = [
},
];
+// in the form of parsed docs
var alreadyInPGFixture = [
objectFixtures[0],
objectFixtures[1]
];
+// in the form of id/rev
var objectsNotInPGFixture = [
- objectFixtures[2]
+ objectFixturesUUID[2]
];
describe('iterator of couchdb data', function() { | mixed up docs and uuid inputs/returns. sorted now. | medic_couch2pg | train | js |
55025c585d08a595d036c6f42d646a48cb9a2a7f | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -2,7 +2,7 @@ from setuptools import setup
setup(
name='vent',
- version='v0.4.1',
+ version='v0.4.2.dev',
packages=['vent', 'vent.core', 'vent.core.file-drop',
'vent.core.rq-worker', 'vent.core.rq-dashboard', 'vent.menus',
'vent.core.rmq-es-connector', 'vent.helpers', 'vent.api'], | bump to <I>.dev | CyberReboot_vent | train | py |
35ba96510be5ac48858804c884e3bdf467c82979 | diff --git a/packages/storybook/src/knobs.js b/packages/storybook/src/knobs.js
index <HASH>..<HASH> 100644
--- a/packages/storybook/src/knobs.js
+++ b/packages/storybook/src/knobs.js
@@ -1,8 +1,8 @@
-import * as nativeKnobs from "@storybook/addon-knobs/react";
+import * as builtInKnobs from "@storybook/addon-knobs/react";
import select from "./select-shim";
const knobs = {
- nativeKnobs,
+ builtInKnobs,
select
}; | refactor: renamed confusingly named variable (#<I>) | newsuk_times-components | train | js |
179e1a88499450fbfa5a4a77c0fcfa76cf0417da | diff --git a/django_tenants/templatetags/tenant.py b/django_tenants/templatetags/tenant.py
index <HASH>..<HASH> 100644
--- a/django_tenants/templatetags/tenant.py
+++ b/django_tenants/templatetags/tenant.py
@@ -1,3 +1,4 @@
+from django.apps import apps
from django.conf import settings
from django.template import Library
from django.template.defaulttags import URLNode
@@ -35,7 +36,9 @@ def is_tenant_app(context, app):
return True
else:
_apps = settings.TENANT_APPS
- return app['app_label'] in [tenant_app.split('.')[-1] for tenant_app in _apps]
+
+ cfg = apps.get_app_config(app['app_label'])
+ return cfg.module.__name__ in _apps
@register.simple_tag()
@@ -44,7 +47,9 @@ def is_shared_app(app):
_apps = get_tenant_types()[get_public_schema_name()]['APPS']
else:
_apps = settings.SHARED_APPS
- return app['app_label'] in [tenant_app.split('.')[-1] for tenant_app in _apps]
+
+ cfg = apps.get_app_config(app['app_label'])
+ return cfg.module.__name__ in _apps
@register.simple_tag() | Update admin support to handle apps with a customized label
- This changes the templatetags for the admin template to correctly
identify apps in settings.SHARED_APPS if they have customized their
label and don't follow the default pattern. | tomturner_django-tenants | train | py |
625c3a9422a3e7afb394fbacb0cd71ba9f4d811e | diff --git a/workman/src/main/java/org/duracloud/mill/bit/BitIntegrityHelper.java b/workman/src/main/java/org/duracloud/mill/bit/BitIntegrityHelper.java
index <HASH>..<HASH> 100644
--- a/workman/src/main/java/org/duracloud/mill/bit/BitIntegrityHelper.java
+++ b/workman/src/main/java/org/duracloud/mill/bit/BitIntegrityHelper.java
@@ -76,17 +76,17 @@ public class BitIntegrityHelper {
*/
public static String getHeader() {
String[] values = {
- "DATE_CHECKED",
- "ACCOUNT",
- "STORE_ID",
- "STORE_TYPE",
- "SPACE_ID",
- "CONTENT_ID",
- "RESULT",
- "CONTENT_CHECKSUM",
- "PROVIDER_CHECKSUM",
- "MANIFEST_CHECKSUM",
- "DETAILS"};
+ "date-checked",
+ "account",
+ "store-id",
+ "store-type",
+ "space-id",
+ "content-id",
+ "result",
+ "content-checksum",
+ "provider-checksum",
+ "manifest-checksum",
+ "details"};
return StringUtils.join(values, "\t")+"\n"; | resolves issue #<I> in <URL> | duracloud_mill | train | java |
6ec7aabe42a90bbf07ca969483893bb56155ca53 | diff --git a/Tank/stepper/instance_plan.py b/Tank/stepper/instance_plan.py
index <HASH>..<HASH> 100644
--- a/Tank/stepper/instance_plan.py
+++ b/Tank/stepper/instance_plan.py
@@ -88,6 +88,18 @@ class LoadPlanBuilder(object):
raise StepperConfigurationError(
"Error in step configuration: 'const(%s'" % params)
+ def parse_start(params):
+ template = re.compile('(\d+)\)')
+ s_res = template.search(params)
+ if s_res:
+ instances = s_res.groups()
+ self.start(int(instances))
+ else:
+ self.log.info(
+ "Start step format: 'start(<instances_count>)'")
+ raise StepperConfigurationError(
+ "Error in step configuration: 'start(%s'" % params)
+
def parse_line(params):
template = re.compile('(\d+),\s*(\d+),\s*([0-9.]+[dhms]?)+\)')
s_res = template.search(params)
@@ -136,6 +148,7 @@ class LoadPlanBuilder(object):
'step': parse_stairway,
'ramp': parse_ramp,
'wait': parse_wait,
+ 'start': parse_start,
}
step_type, params = step_config.split('(')
step_type = step_type.strip() | instant start step for instaces_schedule | yandex_yandex-tank | train | py |
42cde48ed62fdd41801b82779b8426b94cda970b | diff --git a/evcache-core/src/main/java/com/netflix/evcache/event/EVCacheEvent.java b/evcache-core/src/main/java/com/netflix/evcache/event/EVCacheEvent.java
index <HASH>..<HASH> 100644
--- a/evcache-core/src/main/java/com/netflix/evcache/event/EVCacheEvent.java
+++ b/evcache-core/src/main/java/com/netflix/evcache/event/EVCacheEvent.java
@@ -18,6 +18,7 @@ public class EVCacheEvent {
private final String appName;
private final String cacheName;
private final EVCacheClientPool pool;
+ private final long startTime;
private Collection<EVCacheClient> clients = null;
private Collection<String> keys = null;
@@ -33,6 +34,7 @@ public class EVCacheEvent {
this.appName = appName;
this.cacheName = cacheName;
this.pool = pool;
+ this.startTime = System.currentTimeMillis();
}
public Call getCall() {
@@ -47,6 +49,10 @@ public class EVCacheEvent {
return cacheName;
}
+ public long getStartTimeUTC() {
+ return startTime;
+ }
+
public EVCacheClientPool getEVCacheClientPool() {
return pool;
} | Added start time to EVCache event | Netflix_EVCache | train | java |
a5250377e05a1cb3494e37f86c1d68571a4a18cb | diff --git a/lib/fog/vcloud_director/requests/compute/get_vdc.rb b/lib/fog/vcloud_director/requests/compute/get_vdc.rb
index <HASH>..<HASH> 100644
--- a/lib/fog/vcloud_director/requests/compute/get_vdc.rb
+++ b/lib/fog/vcloud_director/requests/compute/get_vdc.rb
@@ -110,7 +110,9 @@ module Fog
:Reserved=>"0",
:Used=>"0",
:Overhead=>"0"}},
- :ResourceEntities => {},
+ :ResourceEntities => {
+ :ResourceEntity => []
+ },
:AvailableNetworks => {},
:Capabilities=>
{:SupportedHardwareVersions=>
@@ -128,6 +130,13 @@ module Fog
:href=>make_href("#{item[:type]}/#{item[:type]}-#{id}")}
end
+ body[:ResourceEntities][:ResourceEntity] +=
+ data[:vapps].map do |id, vapp|
+ {:type => "application/vnd.vmware.vcloud.vApp+xml",
+ :name => vapp[:name],
+ :href => make_href("vApp/#{id}")}
+ end
+
body[:AvailableNetworks][:Network] =
data[:networks].map do |id, network|
{:type=>"application/vnd.vmware.vcloud.network+xml", | extend get_vdc mock to return contained vApps | fog_fog | train | rb |
1d7e131ff1bb950858fe900e6ebb909460dcc0cf | diff --git a/src/Bindings/Browser/ObjectService.php b/src/Bindings/Browser/ObjectService.php
index <HASH>..<HASH> 100644
--- a/src/Bindings/Browser/ObjectService.php
+++ b/src/Bindings/Browser/ObjectService.php
@@ -1039,12 +1039,7 @@ class ObjectService extends AbstractBrowserBindingService implements ObjectServi
*/
protected function isCached(array $identifier)
{
- if (is_array($identifier)) {
- return isset($this->objectCache[$identifier[0]][$identifier[1]]);
- } elseif (isset($this->objectCache[$identifier])) {
- return $this->objectCache[$identifier];
- }
- return false;
+ return isset($this->objectCache[$identifier[0]][$identifier[1]]);
}
/**
@@ -1056,7 +1051,7 @@ class ObjectService extends AbstractBrowserBindingService implements ObjectServi
protected function getCached(array $identifier)
{
if ($this->isCached($identifier)) {
- return $this->objectCache[$identifier];
+ return $this->objectCache[$identifier[0]][$identifier[1]];
}
return null;
} | Follow-up for internal object cache
Addresses an issue with unreachable code and warnings about illegal offsets. Previous pull request had been based on an outdated local copy. | dkd_php-cmis-client | train | php |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.