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 |
|---|---|---|---|---|---|
d85c314726e62ae86a236c9c6730d600187cbc4a | diff --git a/src/main/java/com/nulabinc/backlog4j/api/option/UpdateWikiParams.java b/src/main/java/com/nulabinc/backlog4j/api/option/UpdateWikiParams.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/nulabinc/backlog4j/api/option/UpdateWikiParams.java
+++ b/src/main/java/com/nulabinc/backlog4j/api/option/UpdateWikiParams.java
@@ -29,8 +29,8 @@ public class UpdateWikiParams extends PatchParams {
return this;
}
- public UpdateWikiParams mailNotify(String mailNotify) {
- parameters.add(new NameValuePair("mailNotify", mailNotify));
+ public UpdateWikiParams mailNotify(boolean mailNotify) {
+ parameters.add(new NameValuePair("mailNotify", String.valueOf(mailNotify)));
return this;
}
} | change the type of mailNotify from string to boolean | nulab_backlog4j | train | java |
7ade096ed75f415717e6d4138ca9dd5b1bb16f7b | diff --git a/intranet/middleware/access_log.py b/intranet/middleware/access_log.py
index <HASH>..<HASH> 100644
--- a/intranet/middleware/access_log.py
+++ b/intranet/middleware/access_log.py
@@ -31,13 +31,7 @@ class AccessLogMiddleWare:
user_agent = request.META.get("HTTP_USER_AGENT", "")
log_line = '{} - {} - [{}] "{}" "{}"'.format(ip, username, datetime.now(), request.get_full_path(), user_agent)
- loggable = True
- for user_agent_substring in settings.NONLOGGABLE_USER_AGENT_SUBSTRINGS:
- if user_agent_substring in user_agent:
- loggable = False
- break
-
- if loggable:
+ if user_agent and not any(user_agent_substring in user_agent for user_agent_substring in settings.NONLOGGABLE_USER_AGENT_SUBSTRINGS)
logger.info(log_line)
return response | refactor(logging): use any to determine
if a line is loggable | tjcsl_ion | train | py |
92d869695978dc73350be6590456c83ac9e80593 | diff --git a/lib/WebSocketServer.js b/lib/WebSocketServer.js
index <HASH>..<HASH> 100644
--- a/lib/WebSocketServer.js
+++ b/lib/WebSocketServer.js
@@ -153,11 +153,9 @@ class WebSocketServer extends EventEmitter {
const version = +req.headers['sec-websocket-version'];
if (
- !this.shouldHandle(req) ||
- !req.headers.upgrade ||
- req.headers.upgrade.toLowerCase() !== 'websocket' ||
- !req.headers['sec-websocket-key'] ||
- version !== 8 && version !== 13
+ req.method !== 'GET' || req.headers.upgrade.toLowerCase() !== 'websocket' ||
+ !req.headers['sec-websocket-key'] || version !== 8 && version !== 13 ||
+ !this.shouldHandle(req)
) {
return abortConnection(socket, 400);
} | [fix] Accept only GET requests | websockets_ws | train | js |
4abad7c5d84762d0dd2911704ccd82f2713bdf5a | diff --git a/app/src/components/ReviewDeckModal/Prompt.js b/app/src/components/ReviewDeckModal/Prompt.js
index <HASH>..<HASH> 100644
--- a/app/src/components/ReviewDeckModal/Prompt.js
+++ b/app/src/components/ReviewDeckModal/Prompt.js
@@ -21,7 +21,7 @@ export default function Prompt (props: Props) {
To calibrate deck, position full tipracks and empty labware in their
designated slots as illustrated below
</p>
- <OutlineButton className={styles.prompt_button} onClick={onClick}>
+ <OutlineButton className={styles.prompt_button} onClick={onClick} light>
{`Continue moving to ${labwareType}`}
</OutlineButton>
<p className={styles.prompt_details}> | invert outline button in deckmap review | Opentrons_opentrons | train | js |
0c5b4aa04f4e3567c08f3ee8911d922612d3c020 | diff --git a/src/FluentDOM/Loader/Json/JsonML.php b/src/FluentDOM/Loader/Json/JsonML.php
index <HASH>..<HASH> 100644
--- a/src/FluentDOM/Loader/Json/JsonML.php
+++ b/src/FluentDOM/Loader/Json/JsonML.php
@@ -65,7 +65,7 @@ namespace FluentDOM\Loader\Json {
* @param \stdClass $properties
*/
private function addAttributes(Element $node, \stdClass $properties) {
- $document = $node instanceof \DOMDocument ? $node : $node->ownerDocument;
+ $document = $node->ownerDocument;
foreach ($properties as $name => $value) {
if (!($name === 'xmlns' || 0 === \strpos($name, 'xmlns:'))) {
$namespaceURI = $this->getNamespaceForNode($name, $properties, $node); | Remove unused code, $node is always an Element, so it can never be an DOMDocument | ThomasWeinert_FluentDOM | train | php |
8e6052a06fef1de81aadcb5ba3feed6faf6d07df | diff --git a/examples/route_guide/client/client.go b/examples/route_guide/client/client.go
index <HASH>..<HASH> 100644
--- a/examples/route_guide/client/client.go
+++ b/examples/route_guide/client/client.go
@@ -40,7 +40,7 @@ var (
tls = flag.Bool("tls", false, "Connection uses TLS if true, else plain TCP")
caFile = flag.String("ca_file", "", "The file containing the CA root cert file")
serverAddr = flag.String("server_addr", "localhost:10000", "The server address in the format of host:port")
- serverHostOverride = flag.String("server_host_override", "x.test.youtube.com", "The server name use to verify the hostname returned by TLS handshake")
+ serverHostOverride = flag.String("server_host_override", "x.test.youtube.com", "The server name used to verify the hostname returned by the TLS handshake")
)
// printFeature gets the feature for the given point. | fix typo in flag description (#<I>) | grpc_grpc-go | train | go |
b961c73bcab9162182d79329e04c236547f9e281 | diff --git a/driver-testsuite/tests/Basic/BestPracticesTest.php b/driver-testsuite/tests/Basic/BestPracticesTest.php
index <HASH>..<HASH> 100644
--- a/driver-testsuite/tests/Basic/BestPracticesTest.php
+++ b/driver-testsuite/tests/Basic/BestPracticesTest.php
@@ -65,7 +65,7 @@ class BestPracticesTest extends TestCase
$message .= ' '.$reason;
}
- $this->assertSame($ref->name, $refMethod->getDeclaringClass()->name, $message);
+ $this->assertNotSame('Behat\Mink\Driver\CoreDriver', $refMethod->getDeclaringClass()->name, $message);
}
private function assertNotImplementMethod($method, $object, $reason = '')
@@ -79,6 +79,6 @@ class BestPracticesTest extends TestCase
$message .= ' '.$reason;
}
- $this->assertNotSame($ref->name, $refMethod->getDeclaringClass()->name, $message);
+ $this->assertSame('Behat\Mink\Driver\CoreDriver', $refMethod->getDeclaringClass()->name, $message);
}
} | Fix the driver testsuite to account for driver inheritance
GoutteDriver extends BrowserKitDriver and so does not implement the
methods directly. What we really need to check is whether the
implementation comes from CoreDriver or no. | minkphp_Mink | train | php |
feebdc72c766ac01c210547b08f3d619227bb638 | diff --git a/src/main/java/org/deepsymmetry/beatlink/data/TrackMetadata.java b/src/main/java/org/deepsymmetry/beatlink/data/TrackMetadata.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/deepsymmetry/beatlink/data/TrackMetadata.java
+++ b/src/main/java/org/deepsymmetry/beatlink/data/TrackMetadata.java
@@ -302,6 +302,7 @@ public class TrackMetadata {
}
dateAdded = Database.getText(rawRow.dateAdded());
+ year = rawRow.year();
}
/** | Load track years from PDB export as well.
We now can get them either from the dbserver, if it is configured to
track them, or from the rekordbox database export if we are using
that. | Deep-Symmetry_beat-link | train | java |
5c9cee74febea828db214333a4c39a6aaf0d3df1 | diff --git a/fmn/rules/utils.py b/fmn/rules/utils.py
index <HASH>..<HASH> 100644
--- a/fmn/rules/utils.py
+++ b/fmn/rules/utils.py
@@ -148,7 +148,10 @@ def _get_pkgdb2_packages_for(config, username):
data = req.json()
- packages_of_interest = data['point of contact'] + data['co-maintained']
+ packages_of_interest = \
+ data['point of contact'] + \
+ data['co-maintained'] + \
+ data['watch']
packages_of_interest = set([p['name'] for p in packages_of_interest])
log.debug("done talking with pkgdb2 for now. %0.2fs", time.time() - start)
return packages_of_interest | Add watchcommits/watchbugs to the package-ownership fmn rule. | fedora-infra_fmn.rules | train | py |
2b43638c319f51bb981a4b9332616ded3fde12a9 | diff --git a/PZFileReader/src/main/java/net/sf/pzfilereader/util/ParserUtils.java b/PZFileReader/src/main/java/net/sf/pzfilereader/util/ParserUtils.java
index <HASH>..<HASH> 100644
--- a/PZFileReader/src/main/java/net/sf/pzfilereader/util/ParserUtils.java
+++ b/PZFileReader/src/main/java/net/sf/pzfilereader/util/ParserUtils.java
@@ -822,7 +822,12 @@ public final class ParserUtils {
/**
* Removes chars from the String that could not
* be parsed into a Long value
- *
+ *
+ * StringUtils.stripNonLongChars("1000.25") = "1000"
+ *
+ * Method will truncate everything to the right of the decimal
+ * place when encountered.
+ *
* @param value
* @return String
*/
@@ -831,9 +836,6 @@ public final class ParserUtils {
for (int i = 0; i < value.length(); i++) {
final char c = value.charAt(i);
- //TODO may want to revist this logic and what exactly should
- //happen in this method for the following value 1000.10
- //in the current version (2.2) it would become 100010
if (c == '.') {
//stop if we hit a decimal point
break; | added better javadoc comment for stripNonLongChars
Former-commit-id: <I>e<I>f<I>ecc9cc7cecfa<I>db<I>a<I>f<I> | Appendium_flatpack | train | java |
fe96a5528cbe4922d9ec93a6a77ed96cc790a9a3 | diff --git a/lib/db/access.php b/lib/db/access.php
index <HASH>..<HASH> 100644
--- a/lib/db/access.php
+++ b/lib/db/access.php
@@ -969,7 +969,7 @@ $capabilities = array(
'moodle/course:viewhiddenactivities' => array(
- 'captype' => 'write',
+ 'captype' => 'read',
'contextlevel' => CONTEXT_MODULE,
'archetypes' => array(
'teacher' => CAP_ALLOW,
@@ -1558,7 +1558,7 @@ $capabilities = array(
'moodle/course:viewhiddensections' => array(
- 'captype' => 'write',
+ 'captype' => 'read',
'contextlevel' => CONTEXT_COURSE,
'archetypes' => array(
'editingteacher' => CAP_ALLOW, | MDL-<I> lib: viewhiddenactivities should be set as captype:read | moodle_moodle | train | php |
5ed331fe468e1c33ed1ac988b92afe2d6edf052a | diff --git a/lib/skittles/client/venue.rb b/lib/skittles/client/venue.rb
index <HASH>..<HASH> 100644
--- a/lib/skittles/client/venue.rb
+++ b/lib/skittles/client/venue.rb
@@ -215,7 +215,7 @@ module Skittles
# @requires_acting_user No
# @see http://developer.foursquare.com/docs/venues/search.html
def venue_search(ll, options = {})
- get('venues/search', { :ll => ll }.merge(options)).groups
+ get('venues/search', { :ll => ll }.merge(options)).venues
end
# Returns tips for a venue.
@@ -233,4 +233,4 @@ module Skittles
end
end
end
-end
\ No newline at end of file
+end
diff --git a/spec/skittles_spec.rb b/spec/skittles_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/skittles_spec.rb
+++ b/spec/skittles_spec.rb
@@ -1,7 +1,9 @@
require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
describe "Skittles" do
- it "fails" do
- fail "hey buddy, you should probably rename this file and start specing for real"
+ it 'should search for venues' do
+ response = Skittles.venue_search('40.7,-75', :query => 'Brooklyn Bridge Park - Pier 1')
+ response.should_not be_nil
+ response.should be_a_kind_of Array
end
end | Fixed venue_search to rely on venues array rather than the old groups array. Special thanks to felipecsl! | anthonator_skittles | train | rb,rb |
503e15140fb1b238cf52edff25032bb145a4f940 | diff --git a/rah_backup.php b/rah_backup.php
index <HASH>..<HASH> 100644
--- a/rah_backup.php
+++ b/rah_backup.php
@@ -383,7 +383,7 @@ class rah_backup {
//-->
</script>
<style type="text/css">
- #rah_backup_container #rah_backup_step {
+ #rah_backup_container .rah_ui_step {
text-align: right;
}
#rah_backup_container td.rah_backup_restore {
@@ -494,7 +494,7 @@ EOF;
' </table>'.n.
(has_privs('rah_backup_delete') ?
- ' <p id="rah_backup_step" class="rah_ui_step">'.n.
+ ' <p class="rah_ui_step">'.n.
' <select name="step">'.n.
' <option value="">'.gTxt('rah_backup_with_selected').'</option>'.n.
' <option value="delete">'.gTxt('rah_backup_delete').'</option>'.n. | Removed #rah_backup_step selector. | gocom_rah_backup | train | php |
c8da092a44a2575cd149eb91b96ac12be85c1163 | diff --git a/karma.conf.js b/karma.conf.js
index <HASH>..<HASH> 100644
--- a/karma.conf.js
+++ b/karma.conf.js
@@ -48,7 +48,7 @@ module.exports = function (config) {
// external libs/files
'jspm_packages/github/components/handlebars.js@4.0.5/handlebars.js',
'jspm_packages/npm/immutable@3.7.6/dist/immutable.js',
- 'jspm_packages/npm/should@8.0.2/lib/should.js',
+ 'jspm_packages/npm/should@8.2.1/lib/should.js',
]
},
autoWatch: true, | karma.conf.js: Bugfix: changed version of shouldjs | SerkanSipahi_app-decorators | train | js |
978561567c1a36f780e0bc5fbbf5eaf47d504572 | diff --git a/src/mako/application/Application.php b/src/mako/application/Application.php
index <HASH>..<HASH> 100644
--- a/src/mako/application/Application.php
+++ b/src/mako/application/Application.php
@@ -100,8 +100,6 @@ abstract class Application
$this->startTime = microtime(true);
$this->applicationPath = $applicationPath;
-
- $this->boot();
}
/**
@@ -112,14 +110,16 @@ abstract class Application
* @throws \LogicException
* @return \mako\application\Application
*/
- public static function start(string $applicationPath)
+ public static function start(string $applicationPath): Application
{
if(!empty(static::$instance))
{
throw new LogicException('The application has already been started.');
}
- return static::$instance = new static($applicationPath);
+ static::$instance = new static($applicationPath);
+
+ return static::$instance->boot();
}
/**
@@ -128,7 +128,7 @@ abstract class Application
* @throws \LogicException
* @return \mako\application\Application
*/
- public static function instance()
+ public static function instance(): Application
{
if(empty(static::$instance))
{
@@ -480,8 +480,10 @@ abstract class Application
/**
* Boots the application.
+ *
+ * @return \mako\application\Application
*/
- protected function boot(): void
+ public function boot(): Application
{
// Set up the framework core
@@ -506,6 +508,10 @@ abstract class Application
// Boot packages
$this->bootPackages();
+
+ // Return application instnace
+
+ return $this;
}
/** | Made Application::boot() method public and removed it from the constructor | mako-framework_framework | train | php |
8d8062190ddd0452088f6ea917267ed993a70990 | diff --git a/activesupport/lib/active_support/i18n.rb b/activesupport/lib/active_support/i18n.rb
index <HASH>..<HASH> 100644
--- a/activesupport/lib/active_support/i18n.rb
+++ b/activesupport/lib/active_support/i18n.rb
@@ -7,4 +7,3 @@ rescue LoadError => e
end
I18n.load_path << "#{File.dirname(__FILE__)}/locale/en.yml"
-ActiveSupport.run_load_hooks(:i18n) | I<I>n is always loaded on boot by Active Model or Action Pack, so no need for supporting lazy hooks. | rails_rails | train | rb |
9ec08fabd95f43651ceec8e95ac9e6485dc57526 | diff --git a/internetarchive/search.py b/internetarchive/search.py
index <HASH>..<HASH> 100644
--- a/internetarchive/search.py
+++ b/internetarchive/search.py
@@ -80,6 +80,11 @@ class Search(object):
default_params['count'] = 10000
else:
default_params['output'] = 'json'
+ # In the beta endpoint 'scope' was called 'index'.
+ # Let's support both for a while.
+ if 'index' in params:
+ params['scope'] = params['index']
+ del params['index']
self.params = default_params.copy()
self.params.update(params) | Support both 'index' and 'scope' params for alternate indexes.
In the beta endpoint, the scope param was called index. Let's support
both for a while so we don't break peoples scripts. | jjjake_internetarchive | train | py |
8e4d334e43b30f879c77ca22abb734570235746b | diff --git a/src/extensions/cytoscape.renderer.canvas.js b/src/extensions/cytoscape.renderer.canvas.js
index <HASH>..<HASH> 100644
--- a/src/extensions/cytoscape.renderer.canvas.js
+++ b/src/extensions/cytoscape.renderer.canvas.js
@@ -763,7 +763,9 @@
if (r.zoomData.freeToZoom) {
e.preventDefault();
- var diff = e.wheelDeltaY / 1000 || e.detail / -8.4;
+ var diff = e.wheelDeltaY / 1000 || e.detail / -32;
+
+ console.log(diff)
if( cy.panningEnabled() && cy.zoomingEnabled() ){
cy.zoom({level: cy.zoom() * Math.pow(10, diff), position: {x: unpos[0], y: unpos[1]}}); | better wheel scroll on ff & ie | cytoscape_cytoscape.js | train | js |
21934636fee80fba2964f96c96dbf018b9bc90f8 | diff --git a/spec/requests/default_role_authorization_spec.rb b/spec/requests/default_role_authorization_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/requests/default_role_authorization_spec.rb
+++ b/spec/requests/default_role_authorization_spec.rb
@@ -19,17 +19,14 @@ describe 'Default role-based authorization API' do
end
it 'includes all posts' do
- expected = {
- 'posts'=> [
- hash_including('id' => post.id,
- 'author_id' => post.author.id,
- 'content' => post.content),
- hash_including('id' => other_post.id,
- 'author_id' => other_post.author.id,
- 'content' => other_post.content)
- ]
- }
- expect(json).to include(expected)
+ expect(json).to include(
+ hash_including('id' => post.id,
+ 'author_id' => post.author.id,
+ 'content' => post.content),
+ hash_including('id' => other_post.id,
+ 'author_id' => other_post.author.id,
+ 'content' => other_post.content)
+ )
end
end | The dummy app does not include root in json | G5_g5_authenticatable | train | rb |
ba56d44564bb68b63ad1831930899e4bab7ab218 | diff --git a/core/src/main/java/org/kohsuke/stapler/export/NamedPathPruner.java b/core/src/main/java/org/kohsuke/stapler/export/NamedPathPruner.java
index <HASH>..<HASH> 100644
--- a/core/src/main/java/org/kohsuke/stapler/export/NamedPathPruner.java
+++ b/core/src/main/java/org/kohsuke/stapler/export/NamedPathPruner.java
@@ -175,6 +175,8 @@ public final class NamedPathPruner extends TreePruner {
}
public @Override TreePruner accept(Object node, Property prop) {
+ if (prop.merge) return this;
+
Tree subtree = tree.children.get(prop.name);
if (subtree==null) subtree=tree.children.get("*");
return subtree != null ? new NamedPathPruner(subtree) : null; | merge property doesn't impact NamedPathPruner | stapler_stapler | train | java |
d479a8ef4f049af573c17c8e7d161354ce56bcfb | diff --git a/ncclient/transport/ssh.py b/ncclient/transport/ssh.py
index <HASH>..<HASH> 100644
--- a/ncclient/transport/ssh.py
+++ b/ncclient/transport/ssh.py
@@ -285,6 +285,8 @@ class SSHSession(Session):
while self.is_alive() and (self is not threading.current_thread()):
self.join(10)
+ if self._channel:
+ self._channel.close()
self._channel = None
self._connected = False | Close the channel when closing SSH session
Avoid to keep some FD opened | ncclient_ncclient | train | py |
187357d44150f673c68ea3bea55301e64b000bba | diff --git a/src/Models/BaseElement.php b/src/Models/BaseElement.php
index <HASH>..<HASH> 100644
--- a/src/Models/BaseElement.php
+++ b/src/Models/BaseElement.php
@@ -266,8 +266,8 @@ class BaseElement extends DataObject implements CMSPreviewable
{
parent::onBeforeWrite();
- if ($areaID = $this->ParentID) {
- if ($elementalArea = ElementalArea::get()->filter('ID', $areaID)->first()) {
+ if($areaID = $this->ParentID) {
+ if ($elementalArea = ElementalArea::get()->byID($areaID)) {
$elementalArea->write();
}
}
diff --git a/src/Models/ElementalArea.php b/src/Models/ElementalArea.php
index <HASH>..<HASH> 100644
--- a/src/Models/ElementalArea.php
+++ b/src/Models/ElementalArea.php
@@ -56,7 +56,8 @@ class ElementalArea extends DataObject
public function onBeforeWrite()
{
parent::onBeforeWrite();
- $this->SearchContent = $this->renderSearchContent();
+ // this is currently throwing errors on write. Given search isn't working at all on ss4 yet, disable for now
+// $this->SearchContent = $this->renderSearchContent();
}
/** | TEMP: Disable renderSearchContent
renderSearchContent is currently throwing errors on publish. | dnadesign_silverstripe-elemental | train | php,php |
c488e259f456348801217e8ea16cc57b12d62ab1 | diff --git a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php
index <HASH>..<HASH> 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Elastic/Indexer.php
@@ -21,7 +21,7 @@ use igorw;
class Indexer
{
- /** @var Elasticsearch\Client */
+ /** @var \Elasticsearch\Client */
private $client;
private $options;
private $logger;
@@ -66,6 +66,8 @@ class Indexer
$params['index'] = $this->options['index'];
$params['type'] = self::TYPE_RECORD;
$params['body'][self::TYPE_RECORD] = $this->getRecordMapping();
+
+ // @todo This must throw a new indexation if a mapping is edited
$this->client->indices()->putMapping($params);
}
@@ -119,7 +121,7 @@ class Indexer
// Optimize index
$params = array('index' => $this->options['index']);
$this->client->indices()->optimize($params);
-
+ $this->restoreShardRefreshing();
} catch (Exception $e) {
$this->restoreShardRefreshing();
throw $e; | Fix the refresh interval not resseting to the original value | alchemy-fr_Phraseanet | train | php |
bbfc6d65f6f4fee3135766257ab3f0a2e18ecd48 | diff --git a/lib/pliny/error_reporters/rollbar.rb b/lib/pliny/error_reporters/rollbar.rb
index <HASH>..<HASH> 100644
--- a/lib/pliny/error_reporters/rollbar.rb
+++ b/lib/pliny/error_reporters/rollbar.rb
@@ -19,7 +19,7 @@ module Pliny
def fetch_scope(context:, rack_env:)
scope = {}
- if rack_env.has_key?("rack.input")
+ unless rack_env.empty?
scope[:request] = proc { extract_request_data_from_rack(rack_env) }
end
scope | More generic check for rack_env being populated | interagent_pliny | train | rb |
ce7b830f6c9ecdfb8f67b6d100d4ae7d301d734e | diff --git a/addon/components/sl-menu.js b/addon/components/sl-menu.js
index <HASH>..<HASH> 100644
--- a/addon/components/sl-menu.js
+++ b/addon/components/sl-menu.js
@@ -364,7 +364,7 @@ export default Ember.Component.extend( StreamEnabled, {
selectLeft() {
const selectionsLength = this.get( 'selections' ).length;
- if ( 1 === selectionsLength ) {
+ if ( 1 === selectionsLength || this.get( 'showingAll' ) ) {
this.selectPrevious();
} else if ( selectionsLength > 1 ) {
this.selectParent();
@@ -562,7 +562,7 @@ export default Ember.Component.extend( StreamEnabled, {
selectRight() {
const selections = this.get( 'selections' );
- if ( 1 === selections.length ) {
+ if ( 1 === selections.length || this.get( 'showingAll' ) ) {
this.selectNext();
} else if ( selections.length > 1 ) {
this.selectSubMenu(); | Add handling of showingAll state in selectLeft and selectRight | softlayer_sl-ember-components | train | js |
8562aecc9976866a255d2f64d9196c15e319cc3e | diff --git a/src/HttpSmokeTestCase.php b/src/HttpSmokeTestCase.php
index <HASH>..<HASH> 100644
--- a/src/HttpSmokeTestCase.php
+++ b/src/HttpSmokeTestCase.php
@@ -64,7 +64,7 @@ abstract class HttpSmokeTestCase extends KernelTestCase
{
$this->setUp();
$requestDataSetGeneratorFactory = new RequestDataSetGeneratorFactory();
- /* @var $requestDataSetGenerators \Shopsys\HttpSmokeTesting\RequestDataSetGenerator[] */
+ /** @var \Shopsys\HttpSmokeTesting\RequestDataSetGenerator[] $requestDataSetGenerators */
$requestDataSetGenerators = [];
$allRouteInfo = $this->getRouterAdapter()->getAllRouteInfo(); | unified variables annotations (#<I>) | shopsys_http-smoke-testing | train | php |
d40c6222861d5cdff3100faf04c7c325118be743 | diff --git a/spyderlib/widgets/externalshell/sitecustomize.py b/spyderlib/widgets/externalshell/sitecustomize.py
index <HASH>..<HASH> 100644
--- a/spyderlib/widgets/externalshell/sitecustomize.py
+++ b/spyderlib/widgets/externalshell/sitecustomize.py
@@ -85,7 +85,8 @@ except ImportError:
basestring = (str,)
def execfile(filename, namespace):
# Open a source file correctly, whatever its encoding is
- exec(compile(open(filename, 'rb').read(), filename, 'exec'), namespace)
+ with open(filename, 'rb') as f:
+ exec(compile(f.read(), filename, 'exec'), namespace)
#============================================================================== | Consoles: Correctly close a file when executing it on Python 3
Fixes #<I> | spyder-ide_spyder | train | py |
9d920c6ee964aa2624c98238a3498da144bae77e | diff --git a/Str.php b/Str.php
index <HASH>..<HASH> 100644
--- a/Str.php
+++ b/Str.php
@@ -170,6 +170,23 @@ class Str
}
/**
+ * Get the smallest possible portion of a string between two given values.
+ *
+ * @param string $subject
+ * @param string $from
+ * @param string $to
+ * @return string
+ */
+ public static function betweenFirst($subject, $from, $to)
+ {
+ if ($from === '' || $to === '') {
+ return $subject;
+ }
+
+ return static::before(static::after($subject, $from), $to);
+ }
+
+ /**
* Convert a value to camel case.
*
* @param string $value
diff --git a/Stringable.php b/Stringable.php
index <HASH>..<HASH> 100644
--- a/Stringable.php
+++ b/Stringable.php
@@ -131,6 +131,18 @@ class Stringable implements JsonSerializable
}
/**
+ * Get the smallest possible portion of a string between two given values.
+ *
+ * @param string $from
+ * @param string $to
+ * @return static
+ */
+ public function betweenFirst($from, $to)
+ {
+ return new static(Str::betweenFirst($this->value, $from, $to));
+ }
+
+ /**
* Convert a value to camel case.
*
* @return static | Added betweenFirst (#<I>) | illuminate_support | train | php,php |
f6b80de0bddf790e3729e39713c8690095119293 | diff --git a/huey/backends/base.py b/huey/backends/base.py
index <HASH>..<HASH> 100644
--- a/huey/backends/base.py
+++ b/huey/backends/base.py
@@ -99,3 +99,6 @@ class BaseDataStore(object):
def flush(self):
raise NotImplementedError
+
+
+Components = (BaseQueue, BaseDataStore, BaseSchedule)
diff --git a/huey/backends/dummy.py b/huey/backends/dummy.py
index <HASH>..<HASH> 100644
--- a/huey/backends/dummy.py
+++ b/huey/backends/dummy.py
@@ -81,3 +81,6 @@ class DummyDataStore(BaseDataStore):
def flush(self):
self._results = {}
+
+
+Components = (DummyQueue, DummyDataStore, DummySchedule)
diff --git a/huey/backends/redis_backend.py b/huey/backends/redis_backend.py
index <HASH>..<HASH> 100644
--- a/huey/backends/redis_backend.py
+++ b/huey/backends/redis_backend.py
@@ -111,3 +111,6 @@ class RedisDataStore(BaseDataStore):
def flush(self):
self.conn.delete(self.storage_name)
+
+
+Components = (RedisBlockingQueue, RedisDataStore, RedisSchedule) | Adding a class-level "Component" object | coleifer_huey | train | py,py,py |
d6cc098cf7fb1281179c0912609150c77df2633b | diff --git a/utils/make-phar.php b/utils/make-phar.php
index <HASH>..<HASH> 100644
--- a/utils/make-phar.php
+++ b/utils/make-phar.php
@@ -183,10 +183,7 @@ $finder
->in( WP_CLI_VENDOR_DIR . '/mustache' )
->in( WP_CLI_VENDOR_DIR . '/rmccue/requests' )
->in( WP_CLI_VENDOR_DIR . '/composer' )
- ->in( WP_CLI_VENDOR_DIR . '/symfony/finder' )
- ->in( WP_CLI_VENDOR_DIR . '/symfony/polyfill-ctype' )
- ->in( WP_CLI_VENDOR_DIR . '/symfony/polyfill-mbstring' )
- ->in( WP_CLI_VENDOR_DIR . '/symfony/process' )
+ ->in( WP_CLI_VENDOR_DIR . '/symfony' )
->in( WP_CLI_VENDOR_DIR . '/myclabs/deep-copy' )
->notName( 'behat-tags.php' )
->notPath( '#(?:[^/]+-command|php-cli-tools)/vendor/#' ) // For running locally, in case have composer installed or symlinked them. | Include main symfony folder | wp-cli_wp-cli-bundle | train | php |
c57a358c9d2aa1d286543291d876a571ab99e502 | diff --git a/cmd/generic-handlers.go b/cmd/generic-handlers.go
index <HASH>..<HASH> 100644
--- a/cmd/generic-handlers.go
+++ b/cmd/generic-handlers.go
@@ -194,7 +194,7 @@ func setTimeValidityHandler(h http.Handler) http.Handler {
func (h timeValidityHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
aType := getRequestAuthType(r)
- if aType != authTypeAnonymous && aType != authTypeJWT {
+ if aType == authTypeSigned || aType == authTypeSignedV2 || aType == authTypeStreamingSigned {
// Verify if date headers are set, if not reject the request
amzDate, apiErr := parseAmzDateHeader(r)
if apiErr != ErrNone { | Validate date header only for Signed{,V2} and StreamingSigned. (#<I>)
Fixes #<I> | minio_minio | train | go |
ae6c8ba2f14e374f764e5003850807a5db0b4c17 | diff --git a/lib/elastic_apm/injectors/action_dispatch.rb b/lib/elastic_apm/injectors/action_dispatch.rb
index <HASH>..<HASH> 100644
--- a/lib/elastic_apm/injectors/action_dispatch.rb
+++ b/lib/elastic_apm/injectors/action_dispatch.rb
@@ -17,10 +17,10 @@ module ElasticAPM
end
end
- register(
- 'ActionDispatch::ShowExceptions',
- 'action_dispatch/show_exception',
- ActionDispatchInjector.new
- )
+ # register(
+ # 'ActionDispatch::ShowExceptions',
+ # 'action_dispatch/show_exception',
+ # ActionDispatchInjector.new
+ # )
end
end | Disable ActionDispatch injector until tested | elastic_apm-agent-ruby | train | rb |
e1d772c1e876ecf5637866bcc99c6452894a3101 | diff --git a/lib/VideoCoverFallback.js b/lib/VideoCoverFallback.js
index <HASH>..<HASH> 100644
--- a/lib/VideoCoverFallback.js
+++ b/lib/VideoCoverFallback.js
@@ -44,9 +44,9 @@ class VideoCoverFallback extends Component {
}
}
- updateContainerRatio = (ref = this.containerRef) => {
- if (ref) {
- const { width, height } = ref.getBoundingClientRect();
+ updateContainerRatio = () => {
+ if (this.containerRef) {
+ const { width, height } = this.containerRef.getBoundingClientRect();
this.setState({
outerRatio: width / height,
}); | fix ref lookup
using default param was not a good idea | tkloht_react-video-cover | train | js |
4100782b1b9392ecbbbace94cd5de3af56621edb | diff --git a/law/util.py b/law/util.py
index <HASH>..<HASH> 100644
--- a/law/util.py
+++ b/law/util.py
@@ -843,8 +843,9 @@ def interruptable_popen(*args, **kwargs):
interrupt_callback(p)
# when the process is still alive, send SIGTERM to gracefully terminate it
+ pgid = os.getpgid(p.pid)
if p.poll() is None:
- os.killpg(os.getpgid(p.pid), signal.SIGTERM)
+ os.killpg(pgid, signal.SIGTERM)
# when a kill_timeout is set, and the process is still running after that period,
# send SIGKILL to force its termination
@@ -856,7 +857,9 @@ def interruptable_popen(*args, **kwargs):
# the process terminated, exit the loop
break
else:
- os.killpg(os.getpgid(p.pid), signal.SIGKILL)
+ # check the status again to avoid race conditinos
+ if p.poll() is None:
+ os.killpg(pgid, signal.SIGKILL)
# transparently reraise
raise | Avoid race conditions in util.interruptable_popen. | riga_law | train | py |
7c6c9b79a0b14599362aaefb4494576d533d303c | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -2,7 +2,7 @@
//
'use strict';
-module.exports = function umlPlugin(md, name, options) {
+module.exports = function umlPlugin(md, options) {
function generateSourceDefault(umlCode) {
var deflate = require('./lib/deflate.js'); | Fix args because 'name' is unused and that ignore options wrongly | gmunguia_markdown-it-plantuml | train | js |
4dc6a0b2356a1823d9bad176e5b476aa273a0d17 | diff --git a/aeron-cluster/src/test/java/io/aeron/cluster/StartClusterFromTruncatedRecordingLogTest.java b/aeron-cluster/src/test/java/io/aeron/cluster/StartClusterFromTruncatedRecordingLogTest.java
index <HASH>..<HASH> 100644
--- a/aeron-cluster/src/test/java/io/aeron/cluster/StartClusterFromTruncatedRecordingLogTest.java
+++ b/aeron-cluster/src/test/java/io/aeron/cluster/StartClusterFromTruncatedRecordingLogTest.java
@@ -338,6 +338,7 @@ public class StartClusterFromTruncatedRecordingLogTest
clusteredMediaDrivers[index] = ClusteredMediaDriver.launch(
new MediaDriver.Context()
.aeronDirectoryName(aeronDirName)
+ .warnIfDirectoryExists(false)
.threadingMode(ThreadingMode.SHARED)
.termBufferSparseFile(true)
.multicastFlowControlSupplier(new MinMulticastFlowControlSupplier())
@@ -400,6 +401,7 @@ public class StartClusterFromTruncatedRecordingLogTest
new MediaDriver.Context()
.threadingMode(ThreadingMode.SHARED)
.aeronDirectoryName(aeronDirName)
+ .warnIfDirectoryExists(false)
.dirDeleteOnStart(true));
client = AeronCluster.connect( | [Java] Stop warning on restart as it is expected for test. | real-logic_aeron | train | java |
85ff0e385018c02627ecded532e722312f46eb74 | diff --git a/ceph_deploy/cli.py b/ceph_deploy/cli.py
index <HASH>..<HASH> 100644
--- a/ceph_deploy/cli.py
+++ b/ceph_deploy/cli.py
@@ -4,6 +4,7 @@ import logging
import pushy
import textwrap
import sys
+from string import join
import ceph_deploy
from . import exc
@@ -143,5 +144,7 @@ def main(args=None, namespace=None):
root_logger.addHandler(fh)
sudo_pushy.patch()
-
+
+ LOG.info("Invoked (%s): %s" %(ceph_deploy.__version__,
+ join(sys.argv, " ")))
return args.func(args) | ceph-deploy should log command line args
add Log.info in cli.main to output cli args and ceph_deploy version
Fixes <I> | ceph_ceph-deploy | train | py |
8842be8c6c66f62248b829b1c79fe9b79d1d9f71 | diff --git a/src/worker.js b/src/worker.js
index <HASH>..<HASH> 100644
--- a/src/worker.js
+++ b/src/worker.js
@@ -56,7 +56,7 @@ const workerServer = function workerServer(options: OptionsType) {
log(chalk.bold.blue(queueName), chalk.yellow.bold('[paused]'));
if (timeoutInMS && ! pausedQueues[queueName]) {
- setTimeout(function() {
+ setTimeout(() => {
log(chalk.bold.blue(queueName), chalk.green.bold('[resuming]'));
return this.resume(queueName);
}, timeoutInMS); | Worker - Fixed resume after pause | knledg_distraught | train | js |
43faa8069eefbce927cabc3a19bfa34e495186f9 | diff --git a/js/repeater.js b/js/repeater.js
index <HASH>..<HASH> 100755
--- a/js/repeater.js
+++ b/js/repeater.js
@@ -96,8 +96,7 @@
});
this.$prevBtn.on('click.fu.repeater', $.proxy(this.previous, this));
this.$primaryPaging.find('.combobox').on('changed.fu.combobox', function (evt, data) {
- self.$element.trigger('pageChanged.fu.repeater', [data.text, data]);
- self.pageInputChange(data.text);
+ self.pageInputChange(data.text, data);
});
this.$search.on('searched.fu.search cleared.fu.search', function (e, value) {
self.$element.trigger('searchChanged.fu.repeater', value);
@@ -473,13 +472,13 @@
});
},
- pageInputChange: function (val) {
+ pageInputChange: function (val, data) {
var pageInc;
if (val !== this.lastPageInput) {
this.lastPageInput = val;
val = parseInt(val, 10) - 1;
pageInc = val - this.currentPage;
- this.$element.trigger('pageChanged.fu.repeater', val);
+ this.$element.trigger('pageChanged.fu.repeater', [val, data]);
this.render({
pageIncrement: pageInc
}); | Stop repeater from triggering pageChange twice | ExactTarget_fuelux | train | js |
d17a958431d5bbf5db55bbbfab5583e4dcea3687 | diff --git a/composer.json b/composer.json
index <HASH>..<HASH> 100644
--- a/composer.json
+++ b/composer.json
@@ -48,7 +48,7 @@
"minimum-stability": "dev",
"require": {
"oat-sa/oatbox-extension-installer": "dev-master",
- "oat-sa/lib-test-cat" : "0.2.0"
+ "oat-sa/lib-test-cat" : "1.0.0"
},
"autoload": {
"psr-4": {
diff --git a/manifest.php b/manifest.php
index <HASH>..<HASH> 100755
--- a/manifest.php
+++ b/manifest.php
@@ -29,7 +29,7 @@ return array(
'label' => 'QTI test model',
'description' => 'TAO QTI test implementation',
'license' => 'GPL-2.0',
- 'version' => '11.15.0',
+ 'version' => '12.0.0',
'author' => 'Open Assessment Technologies',
'requires' => array(
'taoTests' => '>=6.4.0',
diff --git a/scripts/update/Updater.php b/scripts/update/Updater.php
index <HASH>..<HASH> 100644
--- a/scripts/update/Updater.php
+++ b/scripts/update/Updater.php
@@ -1558,5 +1558,8 @@ class Updater extends \common_ext_ExtensionUpdater {
$this->setVersion('11.15.0');
}
+
+ $this->skip('11.15.0', '12.0.0');
+
}
} | Bump to version <I> and update cat dependency | oat-sa_extension-tao-testqti | train | json,php,php |
be7f0ef37b9657798927891a379be4e85da60d75 | diff --git a/spec/unit/hiera/scope_spec.rb b/spec/unit/hiera/scope_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/unit/hiera/scope_spec.rb
+++ b/spec/unit/hiera/scope_spec.rb
@@ -90,4 +90,11 @@ describe Hiera::Scope do
expect(scope.include?("calling_module")).to eq(true)
end
end
+
+ describe "#call_function" do
+ it "should delegate a call to call_function to the real scope" do
+ expect(real).to receive(:call_function).once
+ scope.call_function('some_function', [1,2,3])
+ end
+ end
end | (PUP-<I>) Add unit test asserting Hiera::Scope delegates call_function | puppetlabs_puppet | train | rb |
e316302be70c190541850ee1e6ea9d33ef58e17c | diff --git a/src/vdom.js b/src/vdom.js
index <HASH>..<HASH> 100644
--- a/src/vdom.js
+++ b/src/vdom.js
@@ -258,7 +258,7 @@ function patchContent(parent, content, oldContent) {
}
function canPatch(v1, v2) {
- return v1.key === v2.key;
+ return (v1.key == null && v2.key == null) || v1.key === v2.key;
}
export function diffChildren(
@@ -348,7 +348,7 @@ export function diffChildren(
var upperLimit = k + oldRem;
newStart = k;
while (newStart < upperLimit) {
- patch(children[newStart++], oldChildren[oldStart++]);
+ patch(children[newStart++], oldChildren[oldStart++], parent);
}
oldCh = oldChildren[oldEnd];
appendChildren(
@@ -375,7 +375,7 @@ export function diffChildren(
upperLimit = k + newRem;
oldStart = k;
while (oldStart < upperLimit) {
- patch(children[newStart++], oldChildren[oldStart++]);
+ patch(children[newStart++], oldChildren[oldStart++], parent);
}
removeChildren(parent, oldChildren, oldStart, oldEnd);
return; | fix #<I> (inplace patch calls must provide parent arg) | yelouafi_petit-dom | train | js |
9b1225da423fafcc63edee2492b720fad6151f03 | diff --git a/go/teams/request_test.go b/go/teams/request_test.go
index <HASH>..<HASH> 100644
--- a/go/teams/request_test.go
+++ b/go/teams/request_test.go
@@ -107,7 +107,6 @@ func TestAccessRequestIgnore(t *testing.T) {
}); err != nil {
t.Fatal(err)
}
- require.NoError(t, tc.G.UIDMapper.ClearUIDFullName(context.Background(), tc.G, u1.User.GetUID()))
// owner lists requests, sees u1 request
err = tc.Logout()
@@ -115,6 +114,7 @@ func TestAccessRequestIgnore(t *testing.T) {
if err := owner.Login(tc.G); err != nil {
t.Fatal(err)
}
+ require.NoError(t, tc.G.UIDMapper.ClearUIDFullName(context.Background(), tc.G, u1.User.GetUID()))
reqs, err := ListRequests(context.Background(), tc.G, nil)
if err != nil {
t.Fatal(err) | TeamAccessRequest - UID on the profile that's requesting a list | keybase_client | train | go |
7a751b591d38dac59aefd6995ef6fa88f73625a6 | diff --git a/lib/Report.php b/lib/Report.php
index <HASH>..<HASH> 100644
--- a/lib/Report.php
+++ b/lib/Report.php
@@ -4,5 +4,13 @@ namespace PHPShopify;
class Report extends ShopifyResource
{
+ /**
+ * @inheritDoc
+ */
protected $resourceKey = 'report';
+
+ /**
+ * @inheritDoc
+ */
+ public $countEnabled = false;
}
\ No newline at end of file
diff --git a/tests/ReportTest.php b/tests/ReportTest.php
index <HASH>..<HASH> 100644
--- a/tests/ReportTest.php
+++ b/tests/ReportTest.php
@@ -18,9 +18,4 @@ class ReportTest extends TestSimpleResource
public $putArray = array(
"name" => "A new app report - updated",
);
-
- /**
- * @inheritDoc
- */
- public $countEnabled = false;
}
\ No newline at end of file | count() not available for Report resource. (put in the wrong place by last commit). | phpclassic_php-shopify | train | php,php |
6c1b112df7bec2908771b310477729be1065cda3 | diff --git a/trustar/tag_client.py b/trustar/tag_client.py
index <HASH>..<HASH> 100644
--- a/trustar/tag_client.py
+++ b/trustar/tag_client.py
@@ -52,9 +52,9 @@ class TagClient(object):
"""
Deletes a tag from a specific report, in a specific enclave.
- :param report_id: The ID of the report
- :param tag_id: ID of the tag to delete
- :param id_type: indicates whether the ID internal or an external ID provided by the user
+ :param string report_id: The ID of the report
+ :param string tag_id: ID of the tag to delete
+ :param string id_type: indicates whether the ID internal or an external ID provided by the user
:return: The response body.
"""
@@ -68,7 +68,7 @@ class TagClient(object):
Retrieves all tags present in the given enclaves. If the enclave list is empty, the tags returned include all
tags for all enclaves the user has access to.
- :param enclave_ids: list of enclave IDs
+ :param (string) list enclave_ids: list of enclave IDs
:return: The list of |Tag| objects.
"""
@@ -80,7 +80,7 @@ class TagClient(object):
"""
Get all indicator tags for a set of enclaves.
- :param enclave_ids: list of enclave IDs
+ :param (string) list enclave_ids: list of enclave IDs
:return: The list of |Tag| objects.
""" | added types for params in a few docstrings. | trustar_trustar-python | train | py |
64ae49b2d62fc57b4ffaeadb3079a031674932f9 | diff --git a/src/main/java/com/jnape/palatable/lambda/io/IO.java b/src/main/java/com/jnape/palatable/lambda/io/IO.java
index <HASH>..<HASH> 100644
--- a/src/main/java/com/jnape/palatable/lambda/io/IO.java
+++ b/src/main/java/com/jnape/palatable/lambda/io/IO.java
@@ -317,9 +317,8 @@ public abstract class IO<A> implements Monad<A, IO<?>>, MonadError<Throwable, A,
if (!ref.computed) {
return monitorSync(ref, io(() -> {
if (!ref.computed) {
- A a = io.unsafePerformIO();
+ ref.value = io.unsafePerformIO();
ref.computed = true;
- ref.value = a;
}
})).flatMap(constantly(io(() -> ref.value)));
} | This is a safer order of assignment | palatable_lambda | train | java |
d9ee1069607d32f3ac5a61c96f09162f0ed80a81 | diff --git a/lib/fit4ruby/Monitoring_B.rb b/lib/fit4ruby/Monitoring_B.rb
index <HASH>..<HASH> 100644
--- a/lib/fit4ruby/Monitoring_B.rb
+++ b/lib/fit4ruby/Monitoring_B.rb
@@ -25,8 +25,8 @@ module Fit4Ruby
# record structures used in the FIT file.
class Monitoring_B < FitDataRecord
- attr_accessor :file_id, :device_infos, :software, :monitoring_infos,
- :monitorings
+ attr_accessor :file_id, :field_descriptions, :device_infos, :software,
+ :monitoring_infos, :monitorings
# Create a new Monitoring_B object.
# @param field_values [Hash] A Hash that provides initial values for
@@ -36,6 +36,7 @@ module Fit4Ruby
@num_sessions = 0
@file_id = FileId.new
+ @field_descriptions = []
@device_infos = []
@softwares = nil
@monitoring_infos = [] | Add field_description Array to Monitoring_B records.
It's required for all top-level records even if they don't support
developer fields. | scrapper_fit4ruby | train | rb |
2cc0872e05deada7855e81b7c33d2f4ee4b4291c | diff --git a/internal/service/s3/bucket_policy.go b/internal/service/s3/bucket_policy.go
index <HASH>..<HASH> 100644
--- a/internal/service/s3/bucket_policy.go
+++ b/internal/service/s3/bucket_policy.go
@@ -93,6 +93,12 @@ func resourceBucketPolicyRead(d *schema.ResourceData, meta interface{}) error {
Bucket: aws.String(d.Id()),
})
+ if !d.IsNewResource() && tfresource.NotFound(err) {
+ log.Printf("[WARN] S3 Bucket Policy (%s) not found, removing from state", d.Id())
+ d.SetId("")
+ return nil
+ }
+
v := ""
if err == nil && pol.Policy != nil {
v = aws.StringValue(pol.Policy) | r/s3_bucket_policy: add check if bucket was deleted | terraform-providers_terraform-provider-aws | train | go |
22fc0c2a97efd1b647848b10ca7172f7d92c39c1 | diff --git a/core-bundle/src/Entity/TrustedDevice.php b/core-bundle/src/Entity/TrustedDevice.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/Entity/TrustedDevice.php
+++ b/core-bundle/src/Entity/TrustedDevice.php
@@ -148,6 +148,10 @@ class TrustedDevice
public function getDeviceFamily(): ?string
{
+ if ('Other' === $this->deviceFamily) {
+ return '-';
+ }
+
return $this->deviceFamily;
} | Show "-" if the device family is "Other" (see #<I>)
Description
-----------
| Q | A
| -----------------| ---
| Fixed issues | Fixes #<I>
| Docs PR or issue | -
Not sure if that is the best place to "fix" this though. We could also change it in the templates only.
Commits
-------
<I>e<I> Show "-" if the device family is "Other" | contao_contao | train | php |
ee78890f227760c68098325ae68eee01ec6eff49 | diff --git a/main.go b/main.go
index <HASH>..<HASH> 100644
--- a/main.go
+++ b/main.go
@@ -21,9 +21,8 @@ var (
fid = flag.String("id", "0xBEEF", "Id of this server")
timeout = flag.Duration("timeout", 10*time.Second, "Request Timeout")
laddr = flag.String("l", ":8080", "HTTP service address (e.g., ':8080')")
- dir = flag.String("d", "", "Directory to store wal files and snapshot files")
-
- peers = etcdhttp.Peers{}
+ dir = flag.String("data-dir", "", "Path to the data directory")
+ peers = etcdhttp.Peers{}
)
func init() {
@@ -44,7 +43,7 @@ func main() {
if *dir == "" {
*dir = fmt.Sprintf("%v", *fid)
- log.Printf("main: no data dir is given, use default data dir ./%s", *dir)
+ log.Printf("main: no data-dir is given, use default data-dir ./%s", *dir)
}
if err := os.MkdirAll(*dir, 0700); err != nil {
log.Fatal(err) | main: use data-dir as the path to data directory flag | etcd-io_etcd | train | go |
c44141fa1ddf3046a46ff82d3f1b6cb672da6e4b | diff --git a/journal/main.py b/journal/main.py
index <HASH>..<HASH> 100644
--- a/journal/main.py
+++ b/journal/main.py
@@ -111,8 +111,12 @@ def record_entries(journal_location, entries):
date_header = current_date.strftime("%a %I:%M:%S %Y-%m-%d") + "\n"
with open(build_journal_path(journal_location, current_date), "a") as date_file:
entry_output = date_header
- for entry in entries:
- entry_output += "-" + entry + "\n"
+ # old style
+ # for entry in entries:
+ # entry_output += "-" + entry + "\n"
+
+ # new style
+ entry_output += '-' + ' '.join(entries) + "\n"
entry_output += "\n"
date_file.write(entry_output) | feature change: condense all arguments by default to one entry.
this was confusing people and seems easier by default | askedrelic_journal | train | py |
887257bf874b1f3166f4158a316c56f5cfbdee89 | diff --git a/lib/typhoeus/request.rb b/lib/typhoeus/request.rb
index <HASH>..<HASH> 100644
--- a/lib/typhoeus/request.rb
+++ b/lib/typhoeus/request.rb
@@ -92,19 +92,19 @@ module Typhoeus
r.response
end
- def self.get(url, params)
+ def self.get(url, params = {})
run(url, params.merge(:method => :get))
end
- def self.post(url, params)
+ def self.post(url, params = {})
run(url, params.merge(:method => :post))
end
- def self.put(url, params)
+ def self.put(url, params = {})
run(url, params.merge(:method => :put))
end
- def self.delete(url, params)
+ def self.delete(url, params = {})
run(url, params.merge(:method => :delete))
end
end | made the options optional on the quick request methods | typhoeus_typhoeus | train | rb |
7c7ba2a37ddfb0c15305abaa4fcf21cc8ac01655 | diff --git a/src/python/dxpy/utils/exec_utils.py b/src/python/dxpy/utils/exec_utils.py
index <HASH>..<HASH> 100644
--- a/src/python/dxpy/utils/exec_utils.py
+++ b/src/python/dxpy/utils/exec_utils.py
@@ -93,6 +93,9 @@ def run(function_name=None, function_input=None):
job = {'function': function_name, 'input': function_input}
job['input'] = resolve_job_refs_in_test(job['input'])
+ with open("job_error_reserved_space", "w") as fh:
+ fh.write("This file contains reserved space for writing job errors in case the filesystem becomes full.\n" + " "*1024*64)
+
print "Invoking", job.get('function'), "with", job.get('input')
try:
@@ -106,6 +109,10 @@ def run(function_name=None, function_input=None):
except Exception as e:
if dxpy.JOB_ID is not None:
os.chdir(dx_working_dir)
+ try:
+ os.unlink("job_error_reserved_space")
+ except:
+ pass
with open("job_error.json", "w") as fh:
fh.write(json.dumps({"error": {"type": "AppInternalError", "message": unicode(e)}}) + "\n")
raise | Add space reserve for job_error.json (for out of space conditions) to dxpy execution harness | dnanexus_dx-toolkit | train | py |
6e7cf94a1a98b5b2627818594306216b9cb30b79 | diff --git a/lib/hash_diff/comparison.rb b/lib/hash_diff/comparison.rb
index <HASH>..<HASH> 100644
--- a/lib/hash_diff/comparison.rb
+++ b/lib/hash_diff/comparison.rb
@@ -16,15 +16,14 @@ module HashDiff
protected
def find_differences(&reporter)
- combined_attribute_keys.reduce({ }, &reduction_strategy(reporter))
+ combined_attribute_keys.each_with_object({ }, &reduction_strategy(reporter))
end
private
def reduction_strategy(reporter)
- lambda do |diff, key|
+ lambda do |key, diff|
diff[key] = report(key, reporter) if not equal?(key)
- diff
end
end | Switching iterators for a better fit. | CodingZeal_hash_diff | train | rb |
b6b4d1e3aae625e2faa2d257f04a6168ece2ff02 | diff --git a/lib/main.js b/lib/main.js
index <HASH>..<HASH> 100644
--- a/lib/main.js
+++ b/lib/main.js
@@ -142,6 +142,10 @@ module.exports = function(api_key) {
}
get("/watchlist_candidates/" + encodeURIComponent(watchlist_candidate_id), {}, cb);
},
+ // // TODO get del fn to actually work
+ // del: function(watchlist_candidate_id, cb) {
+ // del('/watchlist_candidates/' + encodeURIComponent(watchlist_candidate_id), {}, cb);
+ // },
list: function(count, offset, cb) {
var nArgs = normalizeArguments(arguments);
get("/watchlist_candidates/", { | implemented watchlist_candidates functionality for node wrapper; still need to write tests for & document it | BlockScore_blockscore-node | train | js |
2a049a01f2ae7795d16ce28fbf785429f340baec | diff --git a/mock.js b/mock.js
index <HASH>..<HASH> 100644
--- a/mock.js
+++ b/mock.js
@@ -234,10 +234,10 @@ module.exports = {
__esModule: true,
...Reanimated,
+ ...ReanimatedV2,
default: {
...Reanimated,
- ...ReanimatedV2,
},
Transitioning: {
diff --git a/src/Animated.js b/src/Animated.js
index <HASH>..<HASH> 100644
--- a/src/Animated.js
+++ b/src/Animated.js
@@ -4,7 +4,6 @@ import {
addWhitelistedNativeProps,
addWhitelistedUIProps,
} from './ConfigHelper';
-import * as reanimated2 from './reanimated2';
import * as reanimated1 from './reanimated1';
const Animated = {
@@ -19,8 +18,6 @@ const Animated = {
addWhitelistedUIProps,
// reanimated 1
...reanimated1,
- // reanimated 2
- ...reanimated2,
};
export * from './reanimated2'; | Remove Reanimated 2 from default exports (#<I>)
## Description
After an internal discussion with @Szymon<I> we concluded that reanimated 2 should be exported only via named exports.
Default exports are antipattern in es6 (they prevent tree-shaking for example).
This PR is a breaking change so we may wait with merging it. | kmagiera_react-native-reanimated | train | js,js |
67815e80b92a45c0a8f75c04a5c2761a44616d6f | diff --git a/src/builder-functions.js b/src/builder-functions.js
index <HASH>..<HASH> 100644
--- a/src/builder-functions.js
+++ b/src/builder-functions.js
@@ -36,7 +36,7 @@ String.prototype.asEmail = function(){
return function(incrementer){
return{
name:fieldName,
- value: "email"+incrementer+"@email.com"
+ value: "email"+incrementer+"@example.com"
};
};
}; | Use example.com for fixture email
- Now Register.com has `email.com`. If someone buy the domain, they can get the mail from generated address.
- IANA provides `example.com` for documentation purpose. But sometimes we can use it for testing purpose. <URL> | jcteague_autofixturejs | train | js |
3e78e73f35faa9c2ea413c81c74bdc7fbc0145c1 | diff --git a/angr/procedures/stubs/ReturnUnconstrained.py b/angr/procedures/stubs/ReturnUnconstrained.py
index <HASH>..<HASH> 100644
--- a/angr/procedures/stubs/ReturnUnconstrained.py
+++ b/angr/procedures/stubs/ReturnUnconstrained.py
@@ -5,14 +5,13 @@ import angr
######################################
class ReturnUnconstrained(angr.SimProcedure):
- def run(self, resolves=None): #pylint:disable=arguments-differ
+ def run(self): #pylint:disable=arguments-differ
#pylint:disable=attribute-defined-outside-init
- self.resolves = resolves
if self.successors is not None:
self.successors.artifacts['resolves'] = resolves
- o = self.state.se.Unconstrained("unconstrained_ret_%s" % self.resolves, self.state.arch.bits)
+ o = self.state.se.Unconstrained("unconstrained_ret_%s" % self.display_name, self.state.arch.bits)
#if 'unconstrained_ret_9_64' in o.variables:
# __import__('ipdb').set_trace()
return o | Fixed the variables created by the ReturnUnconstrained simprocedure | angr_angr | train | py |
2a3bab834bd13c065997ada9c59a4041dbb810fa | diff --git a/lib/daru/view/adapters/highcharts.rb b/lib/daru/view/adapters/highcharts.rb
index <HASH>..<HASH> 100644
--- a/lib/daru/view/adapters/highcharts.rb
+++ b/lib/daru/view/adapters/highcharts.rb
@@ -2,6 +2,7 @@ require 'lazy_high_charts'
require_relative 'highcharts/iruby_notebook'
require_relative 'highcharts/display'
require_relative 'highcharts/core_ext/string'
+require 'daru'
module Daru
module View
diff --git a/lib/daru/view/adapters/nyaplot.rb b/lib/daru/view/adapters/nyaplot.rb
index <HASH>..<HASH> 100644
--- a/lib/daru/view/adapters/nyaplot.rb
+++ b/lib/daru/view/adapters/nyaplot.rb
@@ -1,6 +1,7 @@
require 'nyaplot'
require_relative 'nyaplot/iruby_notebook'
+require 'daru'
module Daru
module View | require daru in highcharts.rb and nyaplot.rb | SciRuby_daru-view | train | rb,rb |
849740e6ccabe1994d1cbc9ca1edc14664a0dafb | diff --git a/tests/unit/framework/YiiBaseTest.php b/tests/unit/framework/YiiBaseTest.php
index <HASH>..<HASH> 100644
--- a/tests/unit/framework/YiiBaseTest.php
+++ b/tests/unit/framework/YiiBaseTest.php
@@ -47,7 +47,6 @@ class YiiBaseTest extends TestCase
public function testGetVersion()
{
- echo Yii::getVersion();
$this->assertTrue((boolean)preg_match('~\d+\.\d+(?:\.\d+)?(?:-\w+)?~', \Yii::getVersion()));
} | Fixed YiiBaseTest echo
it echoed Yii version which is not necessary | yiisoft_yii2-debug | train | php |
b8947cf0c24aa36f4499305478c88dd3711984f7 | diff --git a/src/Component/Ssh/Client.php b/src/Component/Ssh/Client.php
index <HASH>..<HASH> 100644
--- a/src/Component/Ssh/Client.php
+++ b/src/Component/Ssh/Client.php
@@ -207,7 +207,7 @@ class Client
}
if ($host->has('config_file')) {
- $options = array_merge($options, ['-F', $host->getConfigFile()]);
+ $options = array_merge($options, ['-F', parse_home_dir($host->getConfigFile())]);
}
if ($host->has('identity_file')) { | Expand ~ in config_file | deployphp_deployer | train | php |
7acd48ce2a907b515301c984bede92361e91abb4 | diff --git a/tests/providers/ssn.py b/tests/providers/ssn.py
index <HASH>..<HASH> 100644
--- a/tests/providers/ssn.py
+++ b/tests/providers/ssn.py
@@ -81,10 +81,6 @@ class TestPlPL(unittest.TestCase):
self.assertEqual(pl_checksum([8, 1, 1, 2, 1, 4, 1, 1, 8, 7]), 6)
def test_calculate_month(self):
- self.assertEqual(pl_calculate_mouth(datetime.strptime('1 1 1800', '%m %d %Y')), 81)
- self.assertEqual(pl_calculate_mouth(datetime.strptime('12 1 1800', '%m %d %Y')), 92)
- self.assertEqual(pl_calculate_mouth(datetime.strptime('1 1 1899', '%m %d %Y')), 81)
-
self.assertEqual(pl_calculate_mouth(datetime.strptime('1 1 1900', '%m %d %Y')), 1)
self.assertEqual(pl_calculate_mouth(datetime.strptime('12 1 1900', '%m %d %Y')), 12)
self.assertEqual(pl_calculate_mouth(datetime.strptime('1 1 1999', '%m %d %Y')), 1) | Removal of year <I> test case | joke2k_faker | train | py |
dab4c80e616b8cf6d8da5b1892587a8ff004a06b | diff --git a/lib/sqlstmt/sqlstmt.rb b/lib/sqlstmt/sqlstmt.rb
index <HASH>..<HASH> 100644
--- a/lib/sqlstmt/sqlstmt.rb
+++ b/lib/sqlstmt/sqlstmt.rb
@@ -9,6 +9,8 @@ require 'sqlstmt/to_sql'
# namely, to build the statement gradually and in no particular order, even the statement type
# for example, we might build a statement and add a where clause to it
# and some step later on would determine the statement type
+# also, looking to the future of supporting other dialects of SQL, I think the same will be true there
+# meaning, we don't the choice of SQL dialect to be allowed at any time
class SqlStmt
attr_reader :fields, :tables, :joins, :wheres
Table = Struct.new(:str, :name, :alias, :index) | doc: also add a note about future language support | atpsoft_sqlstmt | train | rb |
44cb8328f2625242190a5ead333da836ccab2a51 | diff --git a/lib/trestle/configuration.rb b/lib/trestle/configuration.rb
index <HASH>..<HASH> 100644
--- a/lib/trestle/configuration.rb
+++ b/lib/trestle/configuration.rb
@@ -4,6 +4,9 @@ module Trestle
option :site_title, "Trestle Admin"
+ option :path, "/admin"
+ option :automount, true
+
option :default_navigation_icon, "fa fa-arrow-circle-o-right"
option :menus, []
diff --git a/spec/trestle/configuration_spec.rb b/spec/trestle/configuration_spec.rb
index <HASH>..<HASH> 100644
--- a/spec/trestle/configuration_spec.rb
+++ b/spec/trestle/configuration_spec.rb
@@ -7,6 +7,14 @@ describe Trestle::Configuration do
expect(config).to have_accessor(:site_title).with_default("Trestle Admin")
end
+ it "has a path configuration option" do
+ expect(config).to have_accessor(:path).with_default("/admin")
+ end
+
+ it "has an automount configuration option" do
+ expect(config).to have_accessor(:automount).with_default(true)
+ end
+
it "has a default navigation icon configuration option" do
expect(config).to have_accessor(:default_navigation_icon).with_default("fa fa-arrow-circle-o-right")
end | Add configuration options for mount path and automount | TrestleAdmin_trestle | train | rb,rb |
bb1e0845651167ecf1f2527c33cfa89b41199399 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -32,8 +32,8 @@ function isVashLibrary(fileName){
return (/^vash-runtime$/i).test(fileName);
}
-function postProcessVashTemplate(strJavascript, absolteFileLocation){
- var dirName = path.dirname(absolteFileLocation);
+function postProcessVashTemplate(strJavascript, absoluteFileLocation){
+ var dirName = path.dirname(absoluteFileLocation);
return rerequire(strJavascript, function(){
@@ -69,7 +69,7 @@ function writeCompiledTemplate(strJavascript, absoluteFileName){
}), absoluteFileName);
moduleLocation = lookup[absoluteFileName] = __dirname + '/.temp/' + counter++ + '_'+basename + '.js';
- fs.writeFileSync(moduleLocation, moduleContents);
+ fs.writeFileSync(path.normalize(moduleLocation), moduleContents);
return moduleLocation;
} | make sure to call path.normalize | chevett_vashify | train | js |
62db938884cb0cc43e85af67a300bcf9f58807dd | diff --git a/recipe/symfony4.php b/recipe/symfony4.php
index <HASH>..<HASH> 100644
--- a/recipe/symfony4.php
+++ b/recipe/symfony4.php
@@ -10,7 +10,7 @@ namespace Deployer;
require_once __DIR__ . '/common.php';
set('shared_dirs', ['var/log', 'var/sessions']);
-set('shared_files', ['.env.local']);
+set('shared_files', ['.env']);
set('writable_dirs', ['var']);
set('migrations_config', ''); | Update symfony4.php (#<I>)
The .env and .env.<environment> files should be committed to the shared repository because they are the same for all developers and machines. However, the env files ending in .local (.env.local and .env.<environment>.local) should not be committed because only you will use them. In fact, the .gitignore file that comes with Symfony prevents them from being committed.
<URL> | deployphp_deployer | train | php |
8d189a16592bc61634eb52e3976821f8b5d37639 | diff --git a/lib/rtp-connect/version.rb b/lib/rtp-connect/version.rb
index <HASH>..<HASH> 100644
--- a/lib/rtp-connect/version.rb
+++ b/lib/rtp-connect/version.rb
@@ -1,6 +1,6 @@
module RTP
# The RTPConnect library version string.
- VERSION = "1.0b"
+ VERSION = "1.0"
end
\ No newline at end of file | Gem release version <I>. | dicom_rtp-connect | train | rb |
095c1c092ec991a7dca3ab0748c326007f25cb4e | diff --git a/openhtf/__init__.py b/openhtf/__init__.py
index <HASH>..<HASH> 100644
--- a/openhtf/__init__.py
+++ b/openhtf/__init__.py
@@ -264,7 +264,7 @@ class Test(object):
try:
final_state = self._executor.finalize()
- _LOG.debug('Test completed for %s, saving to history and outputting.',
+ _LOG.debug('Test completed for %s, outputting now.',
final_state.test_record.metadata['test_name'])
for output_cb in self._test_options.output_callbacks:
try: | Remove leftover reference to history (#<I>) | google_openhtf | train | py |
0dd84b316bcd862810e0128846567a031c61fe36 | diff --git a/test_project/test_project/urls.py b/test_project/test_project/urls.py
index <HASH>..<HASH> 100644
--- a/test_project/test_project/urls.py
+++ b/test_project/test_project/urls.py
@@ -17,6 +17,7 @@ from django.conf import settings
from django.conf.urls import include
from django.contrib import admin
+
try:
from django.urls import re_path # Django >= 4.0
except ImportError: | I said, make linter happy. This is the last warning | ivelum_djangoql | train | py |
60a3556798c8622b319d5c1e16e6ead50c98655d | diff --git a/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java b/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java
index <HASH>..<HASH> 100644
--- a/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java
+++ b/src/main/java/nl/hsac/fitnesse/fixture/util/selenium/SeleniumHelper.java
@@ -47,6 +47,9 @@ public class SeleniumHelper {
" return document.elementFromPoint(x,y);\n" +
"} else { return null; }";
+ // Regex to find our own 'fake xpath function' in xpath 'By' content
+ private final static Pattern X_PATH_NORMALIZED = Pattern.compile("normalized\\((.+?(\\(\\))?)\\)");
+
private final List<WebElement> currentIFramePath = new ArrayList<WebElement>(4);
private int frameDepthOnLastAlertError;
private DriverFactory factory;
@@ -667,8 +670,6 @@ public class SeleniumHelper {
return By.cssSelector(selector);
}
- private final static Pattern X_PATH_NORMALIZED = Pattern.compile("normalized\\((.+?(\\(\\))?)\\)");
-
/**
* Creates By based on xPath, supporting placeholder replacement.
* It also supports the fictional 'normalized()' function that does whitespace normalization, that also | Follow standard conventions to place static field | fhoeben_hsac-fitnesse-fixtures | train | java |
7bd2e4850b9f3014a1203b7a0e013f046c618eff | diff --git a/lib/copperegg/metrics.rb b/lib/copperegg/metrics.rb
index <HASH>..<HASH> 100644
--- a/lib/copperegg/metrics.rb
+++ b/lib/copperegg/metrics.rb
@@ -23,11 +23,9 @@ module CopperEgg
return
end
- def samples(group_name, metricname, starttime, endtime)
+ def samples(group_name, metricname, starttime=nil, duration=nil, sample_size=nil)
return if group_name.nil?
return if metricname.nil?
- return if endtime.nil? || endtime == Time.now.to_i
- return if starttime.nil? || starttime == Time.now.to_i - 300
metric_name = []
metrics = {}
@@ -40,8 +38,10 @@ module CopperEgg
metric_gid = [metrics]
query[group_name] = metric_gid
params["queries"] = query
+ params["starttime"] = starttime if !starttime.nil?
+ params["duration"] = duration if !duration.nil?
+ params["sample_size"] = sample_size if !sample_size.nil?
- p params
samples = @util.make_api_get_request("/samples.json", @apikey, params)
return samples
end | Add support for starttime, duration, and sample_size to samples GET | CopperEgg_copperegg-ruby | train | rb |
bd78c63159c01ca4b3d6c79d896e89c4820a1472 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -1,6 +1,6 @@
from setuptools import setup, find_packages
-version = '2.0a4'
+version = '2.0a5'
LONG_DESCRIPTION = """
Using django-avatar | Bumped to <I>a5. | grantmcconnaughey_django-avatar | train | py |
d8d6675cb54f82ad712df2974de057618bf4ea2c | diff --git a/lib/arjdbc/mysql/adapter.rb b/lib/arjdbc/mysql/adapter.rb
index <HASH>..<HASH> 100644
--- a/lib/arjdbc/mysql/adapter.rb
+++ b/lib/arjdbc/mysql/adapter.rb
@@ -179,8 +179,16 @@ module ::ArJdbc
end
end
+ # DATABASE STATEMENTS ======================================
+
+ def exec_insert(sql, name, binds)
+ execute sql, name, binds
+ end
+ alias :exec_update :exec_insert
+ alias :exec_delete :exec_insert
+
# SCHEMA STATEMENTS ========================================
-
+
def structure_dump #:nodoc:
if supports_views?
sql = "SHOW FULL TABLES WHERE Table_type = 'BASE TABLE'"
@@ -490,13 +498,6 @@ module ActiveRecord
end
alias_chained_method :columns, :query_cache, :jdbc_columns
- protected
- def exec_insert(sql, name, binds)
- execute sql, name, binds
- end
- alias :exec_update :exec_insert
- alias :exec_delete :exec_insert
-
# some QUOTING caching :
@@quoted_table_names = {} | put (mysql) db statements where they belong | jruby_activerecord-jdbc-adapter | train | rb |
84eebaefcde1fbf0b468c221a2506b9efc8aaf10 | diff --git a/Model/Grid.php b/Model/Grid.php
index <HASH>..<HASH> 100644
--- a/Model/Grid.php
+++ b/Model/Grid.php
@@ -45,14 +45,23 @@ class Grid
public function getSelectorUrl($selectorField, $selectorValue)
{
- $uri = $this->urlTool->changeRequestQueryString(
- $this->requestUri,
- array(
- $this->getSelectorFieldFormName() => $selectorField,
- $this->getSelectorValueFormName() => $selectorValue
- )
- );
-
+ if (!$this->isSelectorSelected($selectorField, $selectorValue)) {
+ $uri = $this->urlTool->changeRequestQueryString(
+ $this->requestUri,
+ array(
+ $this->getSelectorFieldFormName() => $selectorField,
+ $this->getSelectorValueFormName() => $selectorValue
+ )
+ );
+ } else {
+ $uri = $this->urlTool->changeRequestQueryString(
+ $this->requestUri,
+ array(
+ $this->getSelectorFieldFormName() => '',
+ $this->getSelectorValueFormName() => ''
+ )
+ );
+ }
return $uri;
} | remove the selector when you clicked on the button selected | kitpages_KitpagesDataGridBundle | train | php |
8d678062e75e752eb63a2ebfb81e39a18a66acaf | diff --git a/client/src/models/memberlist.js b/client/src/models/memberlist.js
index <HASH>..<HASH> 100644
--- a/client/src/models/memberlist.js
+++ b/client/src/models/memberlist.js
@@ -36,8 +36,8 @@ _kiwi.model.MemberList = Backbone.Collection.extend({
// b has modes but a doesn't so b should appear first
return 1;
}
- a_nick = a.get("nick").toLocaleUpperCase();
- b_nick = b.get("nick").toLocaleUpperCase();
+ a_nick = a.get("nick").toLocaleLowerCase();
+ b_nick = b.get("nick").toLocaleLowerCase();
// Lexicographical sorting
if (a_nick < b_nick) {
return -1; | Nicklist ordering more in-line with other clients | prawnsalad_KiwiIRC | train | js |
7398fe999ba856d7ce37ac9a633f1580b508b4e2 | diff --git a/server.js b/server.js
index <HASH>..<HASH> 100644
--- a/server.js
+++ b/server.js
@@ -3,15 +3,31 @@
*/
var Server = require('./lib/server');
-var server = new Server('./applications');
-server.start(getPort());
+var args = getArguments();
-// Get port from command line argument "-p" or fallback to 3000.
-function getPort() {
+var server = new Server(args.path);
+server.start(args.port);
+
+// Get port and applications folder path from command line arguments. Use port
+// from "-p" or fallback to 3000. Default folder is ./applicaions.
+function getArguments() {
var port = 3000;
+ var path = './applications';
var args = process.argv.slice(2);
- if (args.length && args.shift() === '-p') {
- port = args.shift() || port;
+
+ while (args.length) {
+ var arg = args.shift();
+ switch (arg) {
+ case '-p':
+ port = args.shift();
+ break;
+ default:
+ path = arg;
+ }
}
- return port;
+
+ return {
+ port: port,
+ path: path
+ };
} | Allowing to pass applications folder when starting server with server.js. | recidive_choko | train | js |
2d6fc9761345249323b83e969ab853793d783b85 | diff --git a/internal/storage/scsi/scsi.go b/internal/storage/scsi/scsi.go
index <HASH>..<HASH> 100644
--- a/internal/storage/scsi/scsi.go
+++ b/internal/storage/scsi/scsi.go
@@ -69,8 +69,20 @@ func Mount(controller, lun uint8, target string, readonly bool) (err error) {
flags |= unix.MS_RDONLY
data = "noload"
}
- if err := unixMount(source, target, "ext4", flags, data); err != nil {
- return err
+
+ start := time.Now()
+ for {
+ if err := unixMount(source, target, "ext4", flags, data); err != nil {
+ // The `source` found by controllerLunToName can take some time
+ // before its actually available under `/dev/sd*`. Retry while we
+ // wait for `source` to show up.
+ if err == unix.ENOENT && time.Since(start) < DeviceLookupTimeout {
+ time.Sleep(10 * time.Millisecond)
+ continue
+ }
+ return err
+ }
+ break
}
return nil
} | Retry SCSI mount on source ENOENT | Microsoft_hcsshim | train | go |
063393987ad5010fac0dc88b1237d3de9694ed44 | diff --git a/cluster.go b/cluster.go
index <HASH>..<HASH> 100644
--- a/cluster.go
+++ b/cluster.go
@@ -34,6 +34,8 @@ type ClusterOptions struct {
ReadOnly bool
// Allows routing read-only commands to the closest master or slave node.
RouteByLatency bool
+ // Allows routing read-only commands to the random master or slave node.
+ RouteRandomly bool
// Following options are copied from Options struct.
@@ -473,6 +475,12 @@ func (c *clusterState) slotClosestNode(slot int) (*clusterNode, error) {
return node, nil
}
+func (c *clusterState) slotRandomNode(slot int) *clusterNode {
+ nodes := c.slotNodes(slot)
+ n := rand.Intn(len(nodes))
+ return nodes[n]
+}
+
func (c *clusterState) slotNodes(slot int) []*clusterNode {
if slot >= 0 && slot < len(c.slots) {
return c.slots[slot]
@@ -639,6 +647,11 @@ func (c *ClusterClient) cmdSlotAndNode(cmd Cmder) (int, *clusterNode, error) {
return slot, node, err
}
+ if c.opt.RouteRandomly {
+ node := state.slotRandomNode(slot)
+ return slot, node, nil
+ }
+
node, err := state.slotSlaveNode(slot)
return slot, node, err
} | Add option to balance load between master node and replica nodes (#<I>)
* Add option to balance load between master node and replica nodes | go-redis_redis | train | go |
1df343958e0cfacc35c3d46ed17bbdd55bb9cd20 | diff --git a/templates/src/routes/Home/Home.js b/templates/src/routes/Home/Home.js
index <HASH>..<HASH> 100644
--- a/templates/src/routes/Home/Home.js
+++ b/templates/src/routes/Home/Home.js
@@ -16,7 +16,7 @@ const HomePage = () => (
<Layout className={s.content}>
<h1>Welcome!</h1>
<p>
- This website is build with <a href="https://github.com/kriasoft/react-app">React App
+ This website is built with <a href="https://github.com/kriasoft/react-app">React App
SDK</a> — CLI tools and templates for authoring React/Redux apps with just a single dev
dependency and zero configuration. It is powered by popular front-end dev tools such
as <a href="http://babeljs.io/">Babel</a> | [Template] Fix typo in routes/Home | thangngoc89_electron-react-app | train | js |
bb07a48543bbbb79072dbd253ef3dda8d25a5118 | diff --git a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java
index <HASH>..<HASH> 100644
--- a/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java
+++ b/java/client/test/org/openqa/selenium/testing/drivers/TestIgnorance.java
@@ -167,7 +167,9 @@ public class TestIgnorance {
}
public void setBrowser(Browser browser) {
- this.browser = checkNotNull(browser, "Browser to use must be set");
+ this.browser = checkNotNull(
+ browser,
+ "Browser to use must be set. Do this by setting the 'selenium.browser' system property");
addIgnoresForBrowser(browser, ignoreComparator);
} | Better error message in tests about how to select a browser to use.
Does not change production code. | SeleniumHQ_selenium | train | java |
3311e9a949d40c6ad58e4b3232c8801ff5718234 | diff --git a/cassandra/connection.py b/cassandra/connection.py
index <HASH>..<HASH> 100644
--- a/cassandra/connection.py
+++ b/cassandra/connection.py
@@ -199,6 +199,7 @@ class Connection(object):
return
self.is_closed = True
+ log.debug("Closing connection to %s" % (self.host,))
if self._read_watcher:
self._read_watcher.stop()
if self._write_watcher:
@@ -353,6 +354,9 @@ class Connection(object):
self.push(msg.to_string(request_id, compression=self.compressor))
return request_id
+ def wait_for_response(self, msg):
+ return self.wait_for_responses(msg)[0]
+
def wait_for_responses(self, *msgs):
waiter = ResponseWaiter(len(msgs))
for i, msg in enumerate(msgs): | Implement missing Connection.wait_for_response() | datastax_python-driver | train | py |
3e10c5efb96a852deb8d6337286af78e1cf84057 | diff --git a/src/lib/UI/Config/Provider/FieldType/RichText/AlloyEditor.php b/src/lib/UI/Config/Provider/FieldType/RichText/AlloyEditor.php
index <HASH>..<HASH> 100644
--- a/src/lib/UI/Config/Provider/FieldType/RichText/AlloyEditor.php
+++ b/src/lib/UI/Config/Provider/FieldType/RichText/AlloyEditor.php
@@ -1,5 +1,9 @@
<?php
+/**
+ * @copyright Copyright (C) eZ Systems AS. All rights reserved.
+ * @license For full copyright and license information view LICENSE file distributed with this source code.
+ */
declare(strict_types=1);
namespace EzSystems\EzPlatformAdminUi\UI\Config\Provider\FieldType\RichText;
@@ -14,7 +18,8 @@ class AlloyEditor implements ProviderInterface
/**
* @param array $alloyEditorConfiguration
*/
- public function __construct(array $alloyEditorConfiguration) {
+ public function __construct(array $alloyEditorConfiguration)
+ {
$this->alloyEditorConfiguration = $alloyEditorConfiguration;
}
@@ -24,7 +29,7 @@ class AlloyEditor implements ProviderInterface
public function getConfig(): array
{
return [
- 'extraPlugins' => $this->getExtraPlugins()
+ 'extraPlugins' => $this->getExtraPlugins(),
];
} | Aligned code style with php-cs-fixer rules | ezsystems_ezplatform-admin-ui | train | php |
8df213241cc134caa43042a94441322644c565da | diff --git a/src/pyshark/capture/file_capture.py b/src/pyshark/capture/file_capture.py
index <HASH>..<HASH> 100644
--- a/src/pyshark/capture/file_capture.py
+++ b/src/pyshark/capture/file_capture.py
@@ -21,7 +21,6 @@ class FileCapture(Capture):
:param keep_packets: Whether to keep packets after reading them via next(). Used to conserve memory when reading
large caps (can only be used along with the "lazy" option!)
:param input_file: File path of the capture (PCAP, PCAPNG)
- :param bpf_filter: A BPF (tcpdump) filter to apply on the cap before reading.
:param display_filter: A display (wireshark) filter to apply on the cap before reading it.
:param only_summaries: Only produce packet summaries, much faster but includes very little information.
:param decryption_key: Optional key used to encrypt and decrypt captured traffic.
@@ -75,4 +74,4 @@ class FileCapture(Capture):
if self.keep_packets:
return '<%s %s>' % (self.__class__.__name__, self.input_filename)
else:
- return '<%s %s (%d packets)>' % (self.__class__.__name__, self.input_filename, len(self._packets))
\ No newline at end of file
+ return '<%s %s (%d packets)>' % (self.__class__.__name__, self.input_filename, len(self._packets)) | Removed non-existent keyword from docs | KimiNewt_pyshark | train | py |
1c7f5c3adf68d7615f97b74646016cfda82a3747 | diff --git a/rah_backup.php b/rah_backup.php
index <HASH>..<HASH> 100644
--- a/rah_backup.php
+++ b/rah_backup.php
@@ -112,11 +112,16 @@ class rah_backup {
private $filestamp = '';
/**
- * @var array Path to created backup file
- * @todo requires remodelling
+ * @var array Path to created backup files
*/
public $created = array();
+
+ /**
+ * @var array Path to deleted backup files
+ */
+
+ public $deleted = array();
/**
* @var array List of invoked messages
@@ -769,10 +774,12 @@ EOF;
foreach($this->get_backups() as $name => $file) {
if(in_array($name, $selected)) {
+ $this->deleted[] = $file;
@unlink($file['path']);
}
}
+ callback_event('rah_backup.deleted', $this->deleted);
$this->browser(gTxt('rah_backup_removed'));
} | Introduces "rah_backup.deleted" callback event. | gocom_rah_backup | train | php |
b00b853c281b5860735a426cca78852ed0003740 | diff --git a/parser/parser_test.go b/parser/parser_test.go
index <HASH>..<HASH> 100644
--- a/parser/parser_test.go
+++ b/parser/parser_test.go
@@ -34,6 +34,12 @@ func (self *QueryParserSuite) TestInvalidFromClause(c *C) {
// Make sure that GetQueryStringWithTimeCondition() works for regex
// merge queries.
+func (self *QueryParserSuite) TestMergeMultipleRegex(c *C) {
+ query := "select * from merge(/.*foo.*/, /.*bar.*/)"
+ _, err := ParseQuery(query)
+ c.Assert(err, NotNil)
+}
+
func (self *QueryParserSuite) TestParseMergeGetString(c *C) {
f := func(r *regexp.Regexp) []string {
return []string{"foobar"} | add a test to make sure merge cannot be used with multiple regexes | influxdata_influxdb | train | go |
21dcc8f4da5c02e783f3248fecb0ddb257d3ee32 | diff --git a/core-bundle/src/EventListener/InitializeSystemListener.php b/core-bundle/src/EventListener/InitializeSystemListener.php
index <HASH>..<HASH> 100644
--- a/core-bundle/src/EventListener/InitializeSystemListener.php
+++ b/core-bundle/src/EventListener/InitializeSystemListener.php
@@ -363,7 +363,7 @@ class InitializeSystemListener extends AbstractScopeAwareListener
define('REQUEST_TOKEN', $this->tokenManager->getToken($this->csrfTokenName)->getValue());
}
- if (!$_POST || null === $request) {
+ if (null === $request || 'POST' !== $request->getRealMethod()) {
return;
} | [Core] Use the request object to check the request type in the initialize system listener. | contao_contao | train | php |
fc978ee00a76dcee47472a87aa9c5812ea82a84a | diff --git a/go/proc/proc_test.go b/go/proc/proc_test.go
index <HASH>..<HASH> 100644
--- a/go/proc/proc_test.go
+++ b/go/proc/proc_test.go
@@ -93,7 +93,9 @@ func testPid(t *testing.T, port string, want int) {
resp, err = http.Get(fmt.Sprintf("http://localhost:%s%s", port, pidURL))
var retryableErr bool
if err != nil {
- if strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "EOF") {
+ if strings.Contains(err.Error(), "connection refused") || strings.Contains(err.Error(), "EOF") ||
+ strings.Contains(err.Error(), "net/http: transport closed before response was received") ||
+ strings.Contains(err.Error(), "http: can't write HTTP request on broken connection") {
retryableErr = true
}
} | proc: Whitelist two more transient errors in the unit test. | vitessio_vitess | train | go |
f7b41e6c5b3a8581017ab1dd580a1577415b9fcd | diff --git a/src/amqp/Driver.php b/src/amqp/Driver.php
index <HASH>..<HASH> 100644
--- a/src/amqp/Driver.php
+++ b/src/amqp/Driver.php
@@ -67,6 +67,9 @@ class Driver extends BaseDriver implements BootstrapInterface
$this->_channel->basic_publish($message, '', $this->queueName);
}
+ /**
+ * Listens amqp-queue and runs new jobs.
+ */
public function listen()
{
$this->open();
@@ -83,6 +86,9 @@ class Driver extends BaseDriver implements BootstrapInterface
}
}
+ /**
+ * Opens connection and channel
+ */
protected function open()
{
if ($this->_channel) return;
@@ -91,6 +97,9 @@ class Driver extends BaseDriver implements BootstrapInterface
$this->_channel->queue_declare($this->queueName);
}
+ /**
+ * Closes connection and channel
+ */
protected function close()
{
if (!$this->_channel) return; | AMQP driver inline docs | yiisoft_yii2-queue | train | php |
4cba5e32df06c98ce2322205f1b8494da7197e9b | diff --git a/raiden/tests/integration/network/proxies/test_token_network.py b/raiden/tests/integration/network/proxies/test_token_network.py
index <HASH>..<HASH> 100644
--- a/raiden/tests/integration/network/proxies/test_token_network.py
+++ b/raiden/tests/integration/network/proxies/test_token_network.py
@@ -177,7 +177,7 @@ def test_token_network_proxy(
)
msg = "Trying a deposit to an inexisting channel must fail."
- with pytest.raises(RaidenUnrecoverableError, message=msg, match="does not exist"):
+ with pytest.raises(RaidenUnrecoverableError, message=msg, match="was not opened"):
c1_token_network_proxy.set_total_deposit(
given_block_identifier="latest",
channel_identifier=1,
@@ -365,7 +365,10 @@ def test_token_network_proxy(
)
msg = "depositing to a closed channel must fail"
- match = "setTotalDeposit call will fail. Channel is already closed"
+ match = (
+ f"The channel was not opened at the provided block (latest). "
+ f"This call should never have been attempted."
+ )
with pytest.raises(RaidenRecoverableError, message=msg, match=match):
c2_token_network_proxy.set_total_deposit(
given_block_identifier=blocknumber_prior_to_close, | Fix test matches for set_total_deposit | raiden-network_raiden | train | py |
a331b9f39bc272936b25d03d4f065258846c9f38 | diff --git a/lib/techs/html.js b/lib/techs/html.js
index <HASH>..<HASH> 100644
--- a/lib/techs/html.js
+++ b/lib/techs/html.js
@@ -14,7 +14,7 @@ const additionalFreezeExtsRe = /\.(?:css|js|swf)$/;
* @const
* @type {RegExp}
*/
-const allIncRe = /<!--[\s\S]*?-->|href="(.+?)"|src="(.+?)"/g;
+const allIncRe = /<!-->|<!--[^\[<][\s\S]*?-->|href="(.+?)"|src="(.+?)"/g;
exports.Tech = INHERIT(CSSBASE.Tech, { | freeze the links within the IE conditional comments | borschik_borschik | train | js |
5f80be3f779b6cae4c7215b26e7f5e1cf9a262ec | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -13,6 +13,7 @@ setup(
'Intended Audience :: Science/Research',
'License :: OSI Approved :: MIT License',
'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
'Topic :: Utilities',
],
description='Toolbox for Serenata de Amor project',
@@ -39,5 +40,5 @@ setup(
scripts=['serenata_toolbox/serenata-toolbox'],
url=REPO_URL,
python_requires='>=3.6',
- version='15.1.4',
+ version='15.1.5',
) | Allow the toolbox to be installed in Python <I> | okfn-brasil_serenata-toolbox | train | py |
281ff3fc967a7b30e5282c12ffced5a65769fb57 | diff --git a/gulpfile.js b/gulpfile.js
index <HASH>..<HASH> 100644
--- a/gulpfile.js
+++ b/gulpfile.js
@@ -28,9 +28,11 @@ var sprite_icons = require(enduro.enduro_path + '/libs/build_tools/sprite_icons'
gulp.enduro_refresh = function (callback) {
logger.log('Refresh', true, 'enduro_render_events')
- enduro.actions.render(function () {
- callback()
- }, true)
+ enduro.actions.render()
+ .then(() => {
+ callback()
+ })
+
}
// * ———————————————————————————————————————————————————————— * //
diff --git a/test/libs/test_utilities.js b/test/libs/test_utilities.js
index <HASH>..<HASH> 100644
--- a/test/libs/test_utilities.js
+++ b/test/libs/test_utilities.js
@@ -39,6 +39,7 @@ test_utilities.prototype.before = function (local_enduro, project_name, scaffold
}
test_utilities.prototype.after = function () {
+ console.log('test over')
var self = this
return self.delete_testfolder() | fixed render syntax in gulp enduro_refresh | Gottwik_Enduro | train | js,js |
723ba551b1e00deca4a0f7cbb316eaee49136866 | diff --git a/examples/disassemble.py b/examples/disassemble.py
index <HASH>..<HASH> 100644
--- a/examples/disassemble.py
+++ b/examples/disassemble.py
@@ -59,7 +59,10 @@ codebuf = ctypes.create_string_buffer(length)
ctypes.memmove(codebuf, ctypes.c_char_p(incr.address.ptr), length)
print("Compiled %d bytes starting at 0x%x" % (length, incr.address))
+def hexbytes(b):
+ return "".join(map(lambda x: hex(x)[2:] + " ", b))
+
# Capstone is smart enough to stop at the first RET-like instruction.
md = capstone.Cs(capstone.CS_ARCH_X86, capstone.CS_MODE_64)
for i in md.disasm(codebuf, incr.address.ptr):
- print("0x%x %s %s" % (i.address, i.mnemonic, i.op_str))
+ print("0x%x %-15s%s %s" % (i.address, hexbytes(i.bytes), i.mnemonic, i.op_str)) | Adds hex bytes in disassembly example | cslarsen_lyn | train | py |
55600863d54ef7cb23017f596ad8894ff33b17c2 | diff --git a/webdriver_manager/cache.py b/webdriver_manager/cache.py
index <HASH>..<HASH> 100644
--- a/webdriver_manager/cache.py
+++ b/webdriver_manager/cache.py
@@ -59,7 +59,7 @@ class CacheManager:
with open(path, "wb") as code:
code.write(response.content)
code.close()
- return file(path)
+ return file(path, "rb")
def _get_filename_from_response(self, response, driver):
try: | cache zip file mode fixed to be compatible with windows platform | SergeyPirogov_webdriver_manager | train | py |
f444541ae168d332698f5ab560c8cd9c0c2a08a0 | diff --git a/harpoon/ship/syncer.py b/harpoon/ship/syncer.py
index <HASH>..<HASH> 100644
--- a/harpoon/ship/syncer.py
+++ b/harpoon/ship/syncer.py
@@ -108,8 +108,8 @@ class Syncer(object):
conf.harpoon.stdout.write(part.encode('utf-8', 'replace'))
conf.harpoon.stdout.flush()
- # And stop the loop!
- break
+ # And stop the loop!
+ break
except KeyboardInterrupt:
raise | Wow, that's embarassing | delfick_harpoon | train | py |
07e472c12e022ce07e33b0b2f8428b63e180257d | diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb
index <HASH>..<HASH> 100644
--- a/spec/spec_helper.rb
+++ b/spec/spec_helper.rb
@@ -2,7 +2,7 @@ require "byebug"
require "bundler/setup"
require "capybara/sessionkeeper"
-Dir[File.join(File.dirname(__FILE__), "..", "spec", "support", "**/*.rb")].each {|f| require f}
+Dir[File.join(File.dirname(__FILE__), "..", "spec", "support", "**/*.rb")].sort.each {|f| require f}
RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure | Fix with Lint/NonDeterministicRequireOrder | kyamaguchi_capybara-sessionkeeper | train | rb |
b31eab26dad6ece46f32f6502eb67c412eb5aee9 | diff --git a/search/plugins/ezplatformsearch/ezplatformsearch.php b/search/plugins/ezplatformsearch/ezplatformsearch.php
index <HASH>..<HASH> 100644
--- a/search/plugins/ezplatformsearch/ezplatformsearch.php
+++ b/search/plugins/ezplatformsearch/ezplatformsearch.php
@@ -81,6 +81,17 @@ class eZPlatformSearch implements ezpSearchEngine
try
{
+ // If the method is called for restoring from trash we'll be inside a transaction,
+ // meaning created Location(s) will not be visible outside of it.
+ // We check that Content's Locations are visible from the new stack, if not Content
+ // will be registered for indexing.
+ foreach ( $contentObject->assignedNodes() as $node )
+ {
+ $this->persistenceHandler->locationHandler()->load(
+ $node->attribute( 'node_id' )
+ );
+ }
+
$content = $this->persistenceHandler->contentHandler()->load(
(int)$contentObject->attribute( 'id' ),
(int)$contentObject->attribute( 'current_version' ) | Fixed: indexing Locations when restoring from trash | netgen_ezplatformsearch | train | php |
3bc736fb892330a32fb52b78156a588fb7cdce87 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -57,7 +57,7 @@ function Pagelet(options) {
this._pipe = options.pipe; // Actual pipe instance.
this._params = options.params; // Params extracted from the route.
this._temper = options.temper; // Attach the Temper instance.
- this._append = options.append || false; // Append content client-side.
+ this._append = !options.parent; // Append content client-side.
this._bootstrap = options.bootstrap || {}; // Reference to bootstrap Pagelet.
this.debug = debug('pagelet:'+ this.name); // Namespaced debug method
@@ -896,7 +896,7 @@ Pagelet.readable('conditional', function conditional(req, list, fn) {
var pagelet = this;
if ('function' !== typeof fn) {
- fn = list
+ fn = list;
list = [];
} | [fix] simplify append boolean | bigpipe_pagelet | train | js |
4f676702c325e7bee517b07995cb4255a71aaf6e | diff --git a/lib/geminabox/disk_cache.rb b/lib/geminabox/disk_cache.rb
index <HASH>..<HASH> 100644
--- a/lib/geminabox/disk_cache.rb
+++ b/lib/geminabox/disk_cache.rb
@@ -43,11 +43,28 @@ module Geminabox
end
def read(key_hash)
- read_int(key_hash) { |path| File.read(path) }
+ read_int(key_hash) do |path|
+ begin
+ File.read(path)
+ rescue Errno::ENOENT
+ # There is a possibility that the file is removed by another process
+ # after checking File.exist?. Return nil if the file does not exist.
+ nil
+ end
+ end
end
def marshal_read(key_hash)
- read_int(key_hash) { |path| Marshal.load(File.open(path)) }
+ read_int(key_hash) do |path|
+ begin
+ Marshal.load(File.open(path))
+ rescue Errno::ENOENT, EOFError
+ # There is a possibility that the file is removed by another process.
+ # Marshal.load raises EOFError if the file is removed after File.open(path) succeeds.
+ # Return nil if the file does not exist.
+ nil
+ end
+ end
end
def read_int(key_hash) | disk_cache.rb: ignore Errno::ENOENT, and EOFError
There is a possibility that the file is removed by another process
after checking File.exist?. | geminabox_geminabox | train | rb |
cab6d58693fdcfbc14573749364ddd4f2acb79c0 | diff --git a/src/Phing/Task/System/PhingTask.php b/src/Phing/Task/System/PhingTask.php
index <HASH>..<HASH> 100644
--- a/src/Phing/Task/System/PhingTask.php
+++ b/src/Phing/Task/System/PhingTask.php
@@ -423,7 +423,7 @@ class PhingTask extends Task
}
$this->overrideProperties();
- $this->phingFile = $this->phingFile ?? 'build.xml';
+ $this->phingFile = $this->phingFile ?? Phing::DEFAULT_BUILD_FILENAME;
$fu = new FileUtils();
$file = $fu->resolveFile($this->dir, $this->phingFile); | Use constant for buildfile name (#<I>) | phingofficial_phing | 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.