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
9d8817f1d794bcc0ef4056e7b628cc6d1bc26251
diff --git a/src/BotApi.php b/src/BotApi.php index <HASH>..<HASH> 100644 --- a/src/BotApi.php +++ b/src/BotApi.php @@ -783,6 +783,26 @@ class BotApi 'user_id' => $userId, ]); } + + /** + * Use this method to unban a previously kicked user in a supergroup. + * The user will not return to the group automatically, but will be able to join via link, etc. + * The bot must be an administrator in the group for this to work. Returns True on success. + * + * @param int|string $chatId Unique identifier for the target group + * or username of the target supergroup (in the format @supergroupusername) + * @param int $userId Unique identifier of the target user + * + * @return bool + */ + public function unbanChatMember($chatId, $userId) { + return $this->call('unbanChatMember', [ + 'chat_id' => $chatId, + 'user_id' => $userId + ]); + } + + /** * Close curl */ public function __destruct()
added unbanChatMember method
TelegramBot_Api
train
php
d9eee0757658d12d954e49711d4c3875b94b97b5
diff --git a/src/sap.m/src/sap/m/Avatar.js b/src/sap.m/src/sap/m/Avatar.js index <HASH>..<HASH> 100644 --- a/src/sap.m/src/sap/m/Avatar.js +++ b/src/sap.m/src/sap/m/Avatar.js @@ -131,9 +131,6 @@ sap.ui.define([ fallbackIcon: {type: "string", group: "Data", defaultValue: null}, /** * Determines the background color of the control. - * - * <b>Note:</b> By using background colors from the predefined sets, - * your colors can later be customized from the Theme Designer. */ backgroundColor: {type: "sap.m.AvatarColor", group: "Appearance", defaultValue: AvatarColor.Accent6},
[INTERNAL] sap.m.Avatar: Control jsdoc improved The text in jsdoc was referring to another system's ability to perform a task which is not actually possible. Change-Id: I8aff3ee2af<I>aec<I>c6e9d5aa<I>f0bb0e4fc<I>
SAP_openui5
train
js
cf8aa0a7b247e094a55c31db5df27d8e66f79a9b
diff --git a/run.go b/run.go index <HASH>..<HASH> 100644 --- a/run.go +++ b/run.go @@ -130,23 +130,9 @@ func (i *imageDumperGame) Layout(outsideWidth, outsideHeight int) (screenWidth, // RunGame starts the main loop and runs the game. // game's Update function is called every tick to update the game logic. -// game's Draw function is, if it exists, called every frame to draw the screen. +// game's Draw function is called every frame to draw the screen. // game's Layout function is called when necessary, and you can specify the logical screen size by the function. // -// game must implement Game interface. -// Game's Draw function is optional, but it is recommended to implement Draw to seperate updating the logic and -// rendering. -// -// RunGame is a more flexibile form of Run due to game's Layout function. -// You can make a resizable window if you use RunGame, while you cannot if you use Run. -// RunGame is more sophisticated way than Run and hides the notion of 'scale'. -// -// While Run specifies the window size, RunGame does not. -// You need to call SetWindowSize before RunGame if you want. -// Otherwise, a default window size is adopted. -// -// Some functions (ScreenScale, SetScreenScale, SetScreenSize) are not available with RunGame. -// // On browsers, it is strongly recommended to use iframe if you embed an Ebiten application in your website. // // RunGame must be called on the main thread.
ebiten: Fix old and wrong comments
hajimehoshi_ebiten
train
go
a8000629a7595fc60ebbebd43ef299788097a6da
diff --git a/rna-seq-pipeline/rna-seq_pipeline_multi_sample.py b/rna-seq-pipeline/rna-seq_pipeline_multi_sample.py index <HASH>..<HASH> 100644 --- a/rna-seq-pipeline/rna-seq_pipeline_multi_sample.py +++ b/rna-seq-pipeline/rna-seq_pipeline_multi_sample.py @@ -125,8 +125,7 @@ def docker_call(tool, tool_parameters, work_dir): Makes subprocess call of a command to a docker container. work_dir MUST BE AN ABSOLUTE PATH or the call will fail. """ - # base_docker_call = 'sudo docker run -v {}:/data'.format(work_dir) - base_docker_call = 'docker run -v {}:/data'.format(work_dir) + base_docker_call = 'sudo docker run -v {}:/data'.format(work_dir) call = base_docker_call.split() + [tool] + tool_parameters try: subprocess.check_call(call)
Unless the user script is being run on a CGCloud-launched cluster docker calls must use Sudo.
BD2KGenomics_toil-scripts
train
py
0757d3fcbb84dcd036f758917845cddb4d6ac028
diff --git a/lib/you_shall_not_pass/version.rb b/lib/you_shall_not_pass/version.rb index <HASH>..<HASH> 100644 --- a/lib/you_shall_not_pass/version.rb +++ b/lib/you_shall_not_pass/version.rb @@ -1,3 +1,3 @@ module YouShallNotPass - VERSION = "0.0.3" + VERSION = "0.1.0" end
Releasing version <I>
iachettifederico_you_shall_not_pass
train
rb
c1520de1cd35d98019573e90433c8f0da1e6384d
diff --git a/lib/helpers.js b/lib/helpers.js index <HASH>..<HASH> 100644 --- a/lib/helpers.js +++ b/lib/helpers.js @@ -139,11 +139,15 @@ Helpers.ParseDIDL = function (didl, host, port, trackUri) { } Helpers.ParseDIDLItem = function (item, host, port, trackUri) { + let albumArtURI = item['upnp:albumArtURI'] || null + if (albumArtURI && Array.isArray(albumArtURI)) { + albumArtURI = albumArtURI.length > 0 ? albumArtURI[0] : null + } let track = { title: item['r:streamContent'] || item['dc:title'] || null, artist: item['dc:creator'] || null, album: item['upnp:album'] || null, - albumArtURI: item['upnp:albumArtURI'] || null + albumArtURI } if (trackUri) track.uri = trackUri if (host && port && track.albumArtURI && !track.albumArtURI.startsWith('http://')) {
Handle when albumArtURI is an Array If the albumArtURI of an item is an Array, the first item is picked
bencevans_node-sonos
train
js
c1c6080b18a6e203233be6241669ac287df8933a
diff --git a/glymur/lib/config.py b/glymur/lib/config.py index <HASH>..<HASH> 100644 --- a/glymur/lib/config.py +++ b/glymur/lib/config.py @@ -145,9 +145,8 @@ def get_configdir(): if 'HOME' in os.environ and os.name != 'nt': # HOME is set by WinPython to something unusual, so we don't - # want that. + # necessarily want that. return os.path.join(os.environ['HOME'], '.config', 'glymur') - if os.name == 'nt': - # Windows. - return os.path.join(os.path.expanduser('~'), 'glymur') + # Last stand. Should handle windows... others? + return os.path.join(os.path.expanduser('~'), 'glymur')
Windows if-statement is now a catch-all for config file location. Closes #<I>, again.
quintusdias_glymur
train
py
23ee03840d36e3e117613670aa881dc1c7dfb0db
diff --git a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java index <HASH>..<HASH> 100644 --- a/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java +++ b/gremlin-test/src/main/java/org/apache/tinkerpop/gremlin/process/computer/GraphComputerTest.java @@ -1043,7 +1043,7 @@ public class GraphComputerTest extends AbstractGremlinProcessTest { @Override public void workerIterationStart(final Memory memory) { -// assertEquals(memory.getIteration(), memory.<Integer>get("test").intValue()); + assertEquals(memory.getIteration(), memory.<Integer>get("test").intValue()); final long time = System.nanoTime(); if (!memory.isInitialIteration()) assertNotEquals(-1l, TIMER_KEEPER.get());
had a commented out assert() when figuring out a bug in Spark. Uncommented. All good.
apache_tinkerpop
train
java
3b27f2f7f3aa736dde3f12a045925d873b31bed7
diff --git a/cr8/run_crate.py b/cr8/run_crate.py index <HASH>..<HASH> 100644 --- a/cr8/run_crate.py +++ b/cr8/run_crate.py @@ -280,7 +280,7 @@ class CrateNode(contextlib.ExitStack): try: wait_until( lambda: show_spinner() and _ensure_running(proc) and self.http_host, - timeout=30 + timeout=60 ) host = self.addresses.http.host port = self.addresses.http.port
Increase run-crate start-up timeout to <I> seconds Should be enough to start up CrateDB on a raspberry
mfussenegger_cr8
train
py
974629bbcba1cf3d7021ddd1c42162a0e38365e1
diff --git a/libkbfs/reporter_kbpki.go b/libkbfs/reporter_kbpki.go index <HASH>..<HASH> 100644 --- a/libkbfs/reporter_kbpki.go +++ b/libkbfs/reporter_kbpki.go @@ -43,6 +43,7 @@ var noErrorNames = map[string]bool{ "Gemfile": true, // rvm "devfs": true, // lsof? KBFS-823 "_mtn": true, // emacs on Linux + "_MTN": true, // emacs on Linux "docker-machine": true, // docker shell stuff "HEAD": true, // git shell "Keybase.app": true, // some OSX mount thing
reporter_kbpki: ignore _MTN (looked up by emacs on Linux) (#<I>)
keybase_client
train
go
63ccb440dfcbf2abc887ce1de97861459ac1a793
diff --git a/upload/install/model/install/install.php b/upload/install/model/install/install.php index <HASH>..<HASH> 100644 --- a/upload/install/model/install/install.php +++ b/upload/install/model/install/install.php @@ -46,7 +46,7 @@ class Install extends \Opencart\System\Engine\Model { } $sql = rtrim($sql, ",\n") . "\n"; - $sql .= ") ENGINE=" . $table['engine'] . " CHARSET=" . $table['charset'] . " COLLATE=" . $table['collate'] . ";\n"; + $sql .= ") ENGINE=" . $table['engine'] . " CHARSET=" . $table['charset'] . " ROW_FORMAT=DYNAMIC COLLATE=" . $table['collate'] . ";\n"; $db->query($sql); }
Update install.php hot fix bug Index column size too large. The maximum column size is <I> bytes (maybe need another better way) <URL>
opencart_opencart
train
php
00e5923908f642cf42d6d73f96edaf58bb13d06e
diff --git a/yt_array.py b/yt_array.py index <HASH>..<HASH> 100644 --- a/yt_array.py +++ b/yt_array.py @@ -595,9 +595,13 @@ class YTArray(np.ndarray): units, and returns it. Optionally, an equivalence can be specified to convert to an - equivalent quantity which is not in the same dimensions. All - additional keyword arguments are passed to the equivalency if - necessary. + equivalent quantity which is not in the same dimensions. + + .. note:: + + All additional keyword arguments are passed to the + equivalency, which should be used if that particular + equivalency requires them. Parameters ---------- @@ -641,9 +645,13 @@ class YTArray(np.ndarray): bare NumPy array. Optionally, an equivalence can be specified to convert to an - equivalent quantity which is not in the same dimensions. All - additional keyword arguments are passed to the equivalency if - necessary. + equivalent quantity which is not in the same dimensions. + + .. note:: + + All additional keyword arguments are passed to the + equivalency, which should be used if that particular + equivalency requires them. Parameters ----------
Make docstrings clearer and more explicit
yt-project_unyt
train
py
d43a3a7146d6686fe60877cb9e825f46e7d572cb
diff --git a/Console/Command/ResqueShell.php b/Console/Command/ResqueShell.php index <HASH>..<HASH> 100755 --- a/Console/Command/ResqueShell.php +++ b/Console/Command/ResqueShell.php @@ -137,7 +137,12 @@ class ResqueShell extends Shell { $path = App::pluginPath('Resque') . 'Vendor' . DS . 'php-resque' . DS; $log_path = $this->log_path; - $bootstrap_path = App::pluginPath('Resque') . 'Lib' . DS . 'ResqueBootstrap.php'; + + if (file_exists(APP . 'Lib' . DS . 'ResqueBootstrap.php')) { + $bootstrap_path = APP . 'Lib' . DS . 'ResqueBootstrap.php'; + } else { + $bootstrap_path = App::pluginPath('Resque') . 'Lib' . DS . 'ResqueBootstrap.php'; + } $this->out("<warning>Forking new PHP Resque worker service</warning> (<info>queue:</info>{$queue} <info>user:</info>{$user})"); $cmd = 'nohup sudo -u '.$user.' bash -c "cd ' .
Allow overriding the ResqueBootstrap.php file from the app
wa0x6e_Cake-Resque
train
php
aead1460178c87672d9164ea08bbac6ed53f5c5e
diff --git a/lib/oauth.js b/lib/oauth.js index <HASH>..<HASH> 100644 --- a/lib/oauth.js +++ b/lib/oauth.js @@ -159,17 +159,17 @@ module.exports = OAuth = (function() { * Public: get authenticate URL * ---------------------------- * - * params - Object with: - * + token: [Required] String with `oauth_token` from `OAuth.requestToken` + * token - [Required] String with `oauth_token` from + * `OAuth.requestToken`. * callback - Callback Function * * Returns a callback with an Error object as the first parameter and a string * with the URL to which redirect users as second parameter. **/ - OAuth.prototype.authenticate = function(params, callback) { + OAuth.prototype.authenticate = function(token, callback) { var self = this; - if ((params.token == null) || (typeof params.token !== 'string')) { + if ((token == null) || (typeof token !== 'string')) { return callback(new Error( 'Error: Twitter:OAuth.authenticate requires a token as first argument.' )); @@ -177,7 +177,7 @@ module.exports = OAuth = (function() { return callback( null, - self.uri.authenticate + "?oauth_token=" + params.token + self.uri.authenticate + "?oauth_token=" + token ); };
lib/oauth#authenticate just gets `token` as a param
ghostbar_twitter-rest-lite
train
js
746bef21e0f4a8e9cc633b28829c7ec81ca33f3c
diff --git a/Generator/PluginType.php b/Generator/PluginType.php index <HASH>..<HASH> 100644 --- a/Generator/PluginType.php +++ b/Generator/PluginType.php @@ -88,6 +88,16 @@ class PluginType extends BaseGenerator { ]); }, ), + // TODO: Argh, do something about this mess of relative / qualified + // class names! + 'base_class_short_name' => [ + 'computed' => TRUE, + 'default' => function($component_data) { + $short_class_name = $component_data['annotation_class']; + + return $short_class_name; + }, + ], 'base_class' => [ 'label' => 'Base class', 'computed' => TRUE, @@ -97,7 +107,7 @@ class PluginType extends BaseGenerator { '%module', 'Plugin', $component_data['plugin_relative_namespace'], - $component_data['annotation_class'] . 'Base', + $component_data['base_class_short_name'], ]); }, ], @@ -210,7 +220,7 @@ class PluginType extends BaseGenerator { 'relative_class_name' => array_merge( ['Plugin'], $plugin_relative_namespace_pieces, - [$this->component_data['annotation_class'] . 'Base'] + [$this->component_data['base_class_short_name']] ), 'parent_class_name' => '\Drupal\Component\Plugin\PluginBase', 'interfaces' => [
Fixed plugin type base class not using the computed property for the class name.
drupal-code-builder_drupal-code-builder
train
php
69a5b2cbbe356876b767993358a1806ac6c5695f
diff --git a/app/src/components/mainWindow/mainWindow.js b/app/src/components/mainWindow/mainWindow.js index <HASH>..<HASH> 100644 --- a/app/src/components/mainWindow/mainWindow.js +++ b/app/src/components/mainWindow/mainWindow.js @@ -199,7 +199,7 @@ function createMainWindow(inpOptions, onAppQuit, setDockBadge) { return; } // eslint-disable-next-line no-param-reassign - event.guest = createNewWindow(urlToGo); + event.newGuest = createNewWindow(urlToGo); }; const sendParamsOnDidFinishLoad = (window) => {
Fix Gmail complaining window creation was prevented by a popup blocker (PR #<I>) By changing incorrect window `guest` property to `newGuest`. See <URL>` will prevent Electron from > automatically creating a new BrowserWindow. If you call > `event.preventDefault()` and manually create a new BrowserWindow > then you must set `event.newGuest` to reference the new BrowserWindow > instance, failing to do so may result in unexpected behavior.
jiahaog_nativefier
train
js
fcfa56ac472b1231c0f0bed107532f05a94ebd82
diff --git a/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java b/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java +++ b/src/main/java/org/primefaces/component/datatable/DataTableRenderer.java @@ -119,11 +119,13 @@ public class DataTableRenderer extends DataRenderer { if (filters != null) { for (FilterState filterState : filters) { UIColumn column = table.findColumn(filterState.getColumnKey()); - filterMetadata.add( + if (column != null) { + filterMetadata.add( new FilterMeta( - column, - column.getValueExpression(DataTable.PropertyKeys.filterBy.toString()), - filterState.getFilterValue())); + column, + column.getValueExpression(DataTable.PropertyKeys.filterBy.toString()), + filterState.getFilterValue())); + } } table.setFilterMetadata(filterMetadata);
fixed NPE from #<I>
primefaces_primefaces
train
java
3b95362d33baf91b456039636ac0552d14b5e88e
diff --git a/src/main/java/org/sikuli/slides/sikuli/RegionSelector.java b/src/main/java/org/sikuli/slides/sikuli/RegionSelector.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/sikuli/slides/sikuli/RegionSelector.java +++ b/src/main/java/org/sikuli/slides/sikuli/RegionSelector.java @@ -186,7 +186,7 @@ public class RegionSelector { private ScreenRegion doDirectionalSearch(ImageTarget imageTarget, SlideTargetRegion slideTargetRegion, int direction) { - ScreenRegion fullScreenRegion=new DesktopScreenRegion(); + ScreenRegion fullScreenRegion=SikuliController.getFullScreenRegion(); List<ScreenRegion> directionScreenRegions; if(direction==TOP){ directionScreenRegions=getTopScreenRegionList();
use screen id constant to support external monitor mode
sikuli_sikuli-slides
train
java
0d1969c58676913ffef4bc14bb22770f033c1e34
diff --git a/src/Utils.php b/src/Utils.php index <HASH>..<HASH> 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -48,11 +48,6 @@ abstract class Utils $dom = self::loadXML($xml); $xpath = new DOMXPath($dom); $nodes = $xpath->query(str_repeat('//' . $tagName, 1 + $nestingLevel)); - if (!$nodes) - { - return $xml; - } - foreach ($nodes as $node) { $node->parentNode->removeChild($node);
Utils: removed alternative code path from removeTag()
s9e_TextFormatter
train
php
39bb6b87be8311e8815a13fc46323eead53b7778
diff --git a/lib/travis/services/find_build.rb b/lib/travis/services/find_build.rb index <HASH>..<HASH> 100644 --- a/lib/travis/services/find_build.rb +++ b/lib/travis/services/find_build.rb @@ -47,9 +47,6 @@ module Travis ActiveRecord::Associations::Preloader.new(build, [:matrix, :commit, :request]).run ActiveRecord::Associations::Preloader.new(build.matrix, :log, select: [:id, :job_id, :updated_at]).run ActiveRecord::Associations::Preloader.new(build.matrix, :annotations).run - build.matrix.each do |job| - job.config = {} if params[:exclude_config] - end build end end
don't blank out the job config in find_build
travis-ci_travis-core
train
rb
bc0c4e59ead7faa27a7c8f7ed55393fd27c339b7
diff --git a/src/system.config.js b/src/system.config.js index <HASH>..<HASH> 100644 --- a/src/system.config.js +++ b/src/system.config.js @@ -38,7 +38,7 @@ var systemConfig = { * http://localhost:9010/ when you're running tests. The window/tab can be left * open and the tests will automatically occur there during the build. */ - browsers: ['PhantomJS'] + browsers: [] }, e2e: { // Enable / disable running end-to-end tests in dev mode @@ -53,7 +53,7 @@ var systemConfig = { * http://localhost:9011/ when you're running tests. The window/tab can be left * open and the tests will automatically occur there during the build. */ - browsers: ['PhantomJS'] + browsers: [] }, mocks: { /**
fix(test): run tests with no browser started automatically Implements Solution 2: Remove PhantomJS from system.config.js Closes #<I>
w11k_fabs
train
js
c3c5148aeda1e2bc0b57cadb0560bb9802295a43
diff --git a/src/MadeYourDay/Contao/CustomElements.php b/src/MadeYourDay/Contao/CustomElements.php index <HASH>..<HASH> 100644 --- a/src/MadeYourDay/Contao/CustomElements.php +++ b/src/MadeYourDay/Contao/CustomElements.php @@ -929,6 +929,16 @@ class CustomElements } } + // The getInstance calls are neccessary to keep the contao instance + // stack intact and prevent an "Invalid connection resource" exception + if (TL_MODE === 'BE') { + \BackendUser::getInstance(); + } + else if(TL_MODE === 'FE') { + \FrontendUser::getInstance(); + } + \Database::getInstance(); + $contents = array(); $contents[] = '<?php' . "\n"; $contents[] = '$fileCacheHash = ' . var_export($cacheHash, true) . ';' . "\n";
Fixed "Invalid connection resource" exception
madeyourday_contao-rocksolid-custom-elements
train
php
876daf8e930ab0043ddc0e1fe5399360ef9d74d7
diff --git a/db/seeds.rb b/db/seeds.rb index <HASH>..<HASH> 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -70,6 +70,7 @@ Role.allow 'admin_role', [:read, :delete, :sync], "sync_management" Role.allow 'admin_role', [:read], "packages" Role.allow 'admin_role', [:read], "errata" Role.allow 'admin_role', [:create, :delete, :read], "search" +Role.allow 'admin_role', [:read], "operations" #These are candlepin proxy actions Role.allow 'admin_role', [:create, :read, :update, :delete, :import], "owners"
adding missing operations resource_type to seeds
Katello_katello
train
rb
47eb9cff368fb508c9ef51cb6a84b555fc4d8a6f
diff --git a/kafka/kafka.go b/kafka/kafka.go index <HASH>..<HASH> 100644 --- a/kafka/kafka.go +++ b/kafka/kafka.go @@ -1,5 +1,3 @@ -package kafka - /** * Copyright 2016 Confluent Inc. * @@ -251,6 +249,7 @@ package kafka // possible complications with blocking Poll() calls. // // Note: The Confluent Kafka Go client is safe for concurrent use. +package kafka import ( "fmt"
kafka.go: revert partial f9fce7ae to reinstate package docs The "package .." stanza needs to follow the package docs comment, but a previous commit moved the stanza to the top of the file which caused the package docs to be ignored by 'godoc'.
confluentinc_confluent-kafka-go
train
go
a6cb15106e418eac360dd65343302129a9cad477
diff --git a/probe.js b/probe.js index <HASH>..<HASH> 100644 --- a/probe.js +++ b/probe.js @@ -86,7 +86,7 @@ Probe.prototype.error = function errorTrace(event, order, value) { Probe.prototype.make = function make(name) { assert(name, 'new probes need a name'); - + var probe = Probe.New(); probe.module = name; @@ -103,7 +103,7 @@ Probe.NewWithTracer = function NewWithTracer(tracer) { var probe = Probe.New(); probe.tracer = tracer; - probe.module = '/'; + probe.module = 'ROOT'; return probe; }; diff --git a/test/test.js b/test/test.js index <HASH>..<HASH> 100644 --- a/test/test.js +++ b/test/test.js @@ -16,7 +16,7 @@ test('happy path', function (t) { jtrace.on(yes, function (facets, values) { t.equals(facets.event, 'test'); t.equals(facets.rank, 001); - t.deepEquals(facets.module, '/'); + t.deepEquals(facets.module, 'ROOT'); t.deepEquals(item, values); });
rename / to ROOT module
groundwater_node-lib-trace
train
js,js
60a8d29330fd27d07c15127690a8a3424435a53d
diff --git a/lib/jsi/base.rb b/lib/jsi/base.rb index <HASH>..<HASH> 100644 --- a/lib/jsi/base.rb +++ b/lib/jsi/base.rb @@ -443,11 +443,8 @@ module JSI def jsi_modified_copy(&block) if @jsi_ptr.root? modified_document = @jsi_ptr.modified_document_copy(@jsi_document, &block) - self.class.new(Base::NOINSTANCE, - jsi_document: modified_document, - jsi_ptr: @jsi_ptr, - jsi_schema_base_uri: @jsi_schema_base_uri, - jsi_schema_resource_ancestors: @jsi_schema_resource_ancestors, # this can only be empty but included for consistency + jsi_schemas.new_jsi(modified_document, + uri: jsi_schema_base_uri, ) else modified_jsi_root_node = @jsi_root_node.jsi_modified_copy do |root|
Base#jsi_modified_copy reinstantiates the root with SchemaSet#new_jsi
notEthan_jsi
train
rb
75d1a187bdb1b267859379a8896874119874e47e
diff --git a/script/enable_i2c.js b/script/enable_i2c.js index <HASH>..<HASH> 100755 --- a/script/enable_i2c.js +++ b/script/enable_i2c.js @@ -27,7 +27,16 @@ var fs = require('fs'); var iniBuilder = require('ini-builder'); console.log('Checking if I2C is enabled at boot time'); -var config = iniBuilder.parse(fs.readFileSync('/boot/config.txt').toString(), { commentDelimiter: '#' }); + +var config = ''; + +try { + config = fs.readFileSync('/boot/config.txt').toString() +} catch (e) { +} + +config = iniBuilder.parse(config, { commentDelimiter: '#' }) + var changes = false; var i2c_arm = iniBuilder.find(config, ['dtparam', 'i2c_arm']);
Run enable_i2c.js where /boot/config.txt does not exist
nebrius_raspi-i2c
train
js
0a5c345889c23b828da2fd4e7fa0463d21b776c6
diff --git a/salt/client/ssh/__init__.py b/salt/client/ssh/__init__.py index <HASH>..<HASH> 100644 --- a/salt/client/ssh/__init__.py +++ b/salt/client/ssh/__init__.py @@ -409,6 +409,10 @@ class SSH(object): running.pop(host) if len(rets) >= len(self.targets): break + # Sleep when limit or all threads started + if len(running) >= self.opts.get('ssh_max_procs', 25) or len(self.targets) >= len(running): + time.sleep(0.1) + def run_iter(self): '''
Fix for high cpu usage by salt-ssh
saltstack_salt
train
py
379d6b20695769517d331e0546ed4f307c59762d
diff --git a/lib/opal/parser/lexer.rb b/lib/opal/parser/lexer.rb index <HASH>..<HASH> 100644 --- a/lib/opal/parser/lexer.rb +++ b/lib/opal/parser/lexer.rb @@ -421,13 +421,13 @@ module Opal end def heredoc_identifier - if @scanner.scan(/(-?)['"]?(\w+)['"]?/) + if scan(/(-?)['"]?(\w+)['"]?/) heredoc = @scanner[2] self.strterm = new_strterm(:heredoc, heredoc, heredoc) # if ruby code at end of line after heredoc, we have to store it to # parse after heredoc is finished parsing - end_of_line = @scanner.scan(/.*\n/) + end_of_line = scan(/.*\n/) self.strterm[:scanner] = StringScanner.new(end_of_line) if end_of_line != "\n" self.yylval = heredoc
Always use #scan() and never @scanner directly [lexer]
opal_opal
train
rb
50aecb0c6c22d012d843f807f333fdac7a01f65b
diff --git a/src/HtmlPage.php b/src/HtmlPage.php index <HASH>..<HASH> 100644 --- a/src/HtmlPage.php +++ b/src/HtmlPage.php @@ -217,7 +217,7 @@ class HtmlPage implements Linkable, ContentElementInterface, StatusCodeContainer */ public function getLinks() { - return array_values($this->getStyleLinks() + array_filter($this->headElements, function(HeadElement $element) { + return array_merge($this->getStyleLinks(), array_filter($this->headElements, function(HeadElement $element) { return $element instanceof LinkInterface; })); }
More stable way of merging the 2 kinds of links.
Crell_HtmlModel
train
php
f85c61f63357aebc849d972de8e806d9dc40cc63
diff --git a/src/playbacks/html5_audio/html5_audio.js b/src/playbacks/html5_audio/html5_audio.js index <HASH>..<HASH> 100644 --- a/src/playbacks/html5_audio/html5_audio.js +++ b/src/playbacks/html5_audio/html5_audio.js @@ -77,7 +77,9 @@ class HTML5Audio extends Playback { } play() { - this.el.src = this.options.src + if (this.el.src !== this.options.src) { + this.el.src = this.options.src + } this.el.play() this.trigger(Events.PLAYBACK_PLAY); }
html5 audio: fix seek back on play (closes #<I>)
clappr_clappr
train
js
1d7a1d18832541cd74adcc6072e99a91205c9460
diff --git a/lib/ansiblelint/version.py b/lib/ansiblelint/version.py index <HASH>..<HASH> 100644 --- a/lib/ansiblelint/version.py +++ b/lib/ansiblelint/version.py @@ -1 +1 @@ -__version__ = '3.4.0' +__version__ = '3.4.1'
Update version to <I> Mistagged <I> on an out-of-sync repo
ansible_ansible-lint
train
py
8464e7ab53de5f6449c7fbe616ff4233eb6ae25b
diff --git a/gandi/cli/commands/vm.py b/gandi/cli/commands/vm.py index <HASH>..<HASH> 100644 --- a/gandi/cli/commands/vm.py +++ b/gandi/cli/commands/vm.py @@ -232,7 +232,7 @@ def create(gandi, datacenter, memory, cores, ip_version, bandwidth, login, pwd = click.prompt('password', hide_input=True, confirmation_prompt=True) - if not password: + if not pwd: gandi.echo('/!\ Please be aware that you did not provide a password, ' 'some services like console will not be able to work.')
Don't show console password warning when creating a vm if password is provided
Gandi_gandi.cli
train
py
e1269e8ed048e5900c02482ce50f12ead0055c1a
diff --git a/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AADAuthenticationFilterAutoConfiguration.java b/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AADAuthenticationFilterAutoConfiguration.java index <HASH>..<HASH> 100644 --- a/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AADAuthenticationFilterAutoConfiguration.java +++ b/azure-spring-boot/src/main/java/com/microsoft/azure/spring/autoconfigure/aad/AADAuthenticationFilterAutoConfiguration.java @@ -7,7 +7,6 @@ package com.microsoft.azure.spring.autoconfigure.aad; import com.microsoft.azure.telemetry.TelemetryData; import com.microsoft.azure.telemetry.TelemetryProxy; -import com.microsoft.azure.utils.PropertyLoader; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
removes unused import (#<I>)
Microsoft_azure-spring-boot
train
java
2210c554dacba6c5918ff87142f3ad845c549010
diff --git a/shared/teams/team/settings-tab/index.js b/shared/teams/team/settings-tab/index.js index <HASH>..<HASH> 100644 --- a/shared/teams/team/settings-tab/index.js +++ b/shared/teams/team/settings-tab/index.js @@ -76,7 +76,9 @@ const SetMemberShowcase = (props: SettingProps) => ( <Text type="BodySmall"> {props.yourOperations.setMemberShowcase ? 'Your profile will mention this team. Team description and number of members will be public.' - : "Admins aren't allowing members to publish this team on their profile."} + : props.yourOperations.joinTeam + ? 'You must join this team to publish it on your profile.' + : "Admins aren't allowing members to publish this team on their profile."} </Text> </Box> </Box>
prompt implicit admins who have not joined yet (#<I>)
keybase_client
train
js
b2fa759ea384be213d24981ca9f2d0e2a9c7a364
diff --git a/Classes/Command/DocumentationCommandController.php b/Classes/Command/DocumentationCommandController.php index <HASH>..<HASH> 100644 --- a/Classes/Command/DocumentationCommandController.php +++ b/Classes/Command/DocumentationCommandController.php @@ -62,7 +62,7 @@ class DocumentationCommandController extends CommandController implements Single $this->sendAndExit(1); } if ($targetFile === NULL) { - $this->output($xsdSchema); + echo $xsdSchema; } else { file_put_contents($targetFile, $xsdSchema); }
[BUGFIX] Direct echo of XSD to avoid console formatting
TYPO3-Console_TYPO3-Console
train
php
588d31d03b3010d6e3dad999b30e23c614d1a8f9
diff --git a/lib/jsduck/options.rb b/lib/jsduck/options.rb index <HASH>..<HASH> 100644 --- a/lib/jsduck/options.rb +++ b/lib/jsduck/options.rb @@ -137,6 +137,7 @@ module JsDuck # enable all warnings except :link_auto Logger.set_warning(:all, true) Logger.set_warning(:link_auto, false) + Logger.set_warning(:param_count, false) end # Make options object behave like hash.
Disable the param_count warning by default.
senchalabs_jsduck
train
rb
0ce041cd3814c8d00948681d7a69393ca7b16bb3
diff --git a/lib/index.js b/lib/index.js index <HASH>..<HASH> 100644 --- a/lib/index.js +++ b/lib/index.js @@ -48,6 +48,7 @@ options = options || {}; var makeApiCall = require('./internal/make-api-call').inject(options); + var deprecate = require('util').deprecate; var makeApiMethod = function(apiConfig) { return function(query, callback, customParams) { @@ -88,7 +89,7 @@ reverseGeocode: makeApiMethod(geocode.reverseGeocode), places: makeApiMethod(places.places), placesNearby: makeApiMethod(places.placesNearby), - placesRadar: makeApiMethod(places.placesRadar), + placesRadar: deprecate(makeApiMethod(places.placesRadar), 'placesRadar is deprecated, see http://goo.gl/BGiumE'), place: makeApiMethod(places.place), placesPhoto: makeApiMethod(places.placesPhoto), placesAutoComplete: makeApiMethod(places.placesAutoComplete),
Mark places radar search as deprecated.
googlemaps_google-maps-services-js
train
js
773a636949dbfa9186c27aa0626be6a274b0e573
diff --git a/tests/compiler_test.js b/tests/compiler_test.js index <HASH>..<HASH> 100644 --- a/tests/compiler_test.js +++ b/tests/compiler_test.js @@ -131,4 +131,21 @@ exports.test_lda_indy = function(test){ var code = compiler.semantic(ast); test.deepEqual(code, [0xb1, 0x20]); test.done(); -}; \ No newline at end of file +}; + +exports.test_invalid_token = function(test){ + try { + var tokens = compiler.lexical('.invalid #TOKEN'); + test.fail(); + }catch(e){ + test.equal("Lexical Error" , e.name); + test.equal("Lexical Error Message" , e.message); + test.equal(1 , e.erros.length); + test.equal("Invalid Token" , e.erros[0].name); + test.equal(1 , e.erros[0].line); + test.equal(10 , e.erros[0].column); + test.equal("#TOKEN" , e.erros[0].value); + test.equal("Token #TOKEN at line 1 column 10 is invalid" , e.erros[0].message); + } + test.done(); +};
added a test_invalid_token on compiler_test
gutomaia_nodeNES
train
js
3081f2845862f589b2dab8a3a1b5650a7b42854c
diff --git a/pymatgen/apps/borg/tests/test_hive.py b/pymatgen/apps/borg/tests/test_hive.py index <HASH>..<HASH> 100644 --- a/pymatgen/apps/borg/tests/test_hive.py +++ b/pymatgen/apps/borg/tests/test_hive.py @@ -52,7 +52,7 @@ class VaspToComputedEntryDroneTest(unittest.TestCase): self.assertAlmostEqual(entry.energy, 0.5559329) self.assertIsInstance(entry, ComputedStructureEntry) self.assertIsNotNone(entry.structure) - self.assertEqual(len(entry.parameters["history"]), 2) + # self.assertEqual(len(entry.parameters["history"]), 2) def test_to_from_dict(self): d = self.structure_drone.as_dict()
Remove hisotry test. If people do not want to implement tests properly, the BDFL will unilaterally remove these changes.
materialsproject_pymatgen
train
py
979fc0d69857d736c82dc8a3afea224e0199a39b
diff --git a/library/src/main/java/com/mikepenz/materialdrawer/adapter/BaseDrawerAdapter.java b/library/src/main/java/com/mikepenz/materialdrawer/adapter/BaseDrawerAdapter.java index <HASH>..<HASH> 100644 --- a/library/src/main/java/com/mikepenz/materialdrawer/adapter/BaseDrawerAdapter.java +++ b/library/src/main/java/com/mikepenz/materialdrawer/adapter/BaseDrawerAdapter.java @@ -108,7 +108,7 @@ public abstract class BaseDrawerAdapter extends RecyclerView.Adapter<RecyclerVie //fix wrong remembered position if (position < previousSelection) { - previousSelection = previousSelection + 1; + previousSelection = previousSelection - 1; } }
* fix selection not removed if items were removed
mikepenz_MaterialDrawer
train
java
30c1a6069aa56ef5eeba4c4116efc2f8a8526ab9
diff --git a/gcs/gcstesting/bucket_tests.go b/gcs/gcstesting/bucket_tests.go index <HASH>..<HASH> 100644 --- a/gcs/gcstesting/bucket_tests.go +++ b/gcs/gcstesting/bucket_tests.go @@ -76,8 +76,8 @@ type bucketTest struct { var _ bucketTestSetUpInterface = &bucketTest{} func (t *bucketTest) setUpBucketTest(deps BucketTestDeps) { - t.bucket = deps.bucket - t.clock = deps.clock + t.bucket = deps.Bucket + t.clock = deps.Clock t.ctx = context.Background() } diff --git a/gcs/gcstesting/register_bucket_tests.go b/gcs/gcstesting/register_bucket_tests.go index <HASH>..<HASH> 100644 --- a/gcs/gcstesting/register_bucket_tests.go +++ b/gcs/gcstesting/register_bucket_tests.go @@ -27,10 +27,10 @@ import ( // Dependencies needed for tests registered by RegisterBucketTests. type BucketTestDeps struct { // An initialized, empty bucket. - bucket gcs.Bucket + Bucket gcs.Bucket // A clock matching the bucket's notion of time. - clock timeutil.Clock + Clock timeutil.Clock } // An interface that all bucket tests must implement.
Oops, export bucket and clock fields.
jacobsa_gcloud
train
go,go
8b2053d3489d746ae0e7cbd52356fa8996c57c7d
diff --git a/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java b/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java index <HASH>..<HASH> 100644 --- a/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java +++ b/src/share/classes/com/sun/tools/javac/parser/JavadocTokenizer.java @@ -428,6 +428,7 @@ public class JavadocTokenizer extends JavaTokenizer { } } finally { scanned = true; + comment_reader = null; if (docComment != null && docComment.matches("(?sm).*^\\s*@deprecated( |$).*")) { deprecatedFlag = true;
<I>: javadoc OutOfMemory error results in several jdk8 tl nightly failures Reviewed-by: ksrini
wmdietl_jsr308-langtools
train
java
fe454332704fcca0488e40822f446ef5b007e56f
diff --git a/spec/js_serializer_spec.rb b/spec/js_serializer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/js_serializer_spec.rb +++ b/spec/js_serializer_spec.rb @@ -50,10 +50,6 @@ describe JsDuck::Js::Serializer do test("var foo, bar = 5;") end - it "variable declaration with let" do - test("let foo = true;") - end - it "assignment of function expression" do test("foo = function (a) {};") end
Eliminate test for let expression. That's not supported by RKelly, and really not needed in practice.
senchalabs_jsduck
train
rb
759d06180b98af8b8bf0fe0a01ecc65f633130fa
diff --git a/pymbar/__init__.py b/pymbar/__init__.py index <HASH>..<HASH> 100644 --- a/pymbar/__init__.py +++ b/pymbar/__init__.py @@ -31,10 +31,19 @@ __license__ = "LGPL" __maintainer__ = "Michael R. Shirts and John D. Chodera" __email__ = "michael.shirts@virginia.edu,choderaj@mskcc.org" -from pymbar import timeseries, testsystems, confidenceintervals, version +from pymbar import timeseries, testsystems, confidenceintervals from pymbar.mbar import MBAR from pymbar.bar import BAR, BARzero from pymbar.exp import EXP, EXPGauss +try: + from pymbar import version +except: + # Fill in information manually. + # TODO: See if we can at least get the git revision info in here. + version = 'dev' + full_version = 'dev' + git_revision = 'dev' + isrelease = False __all__ = ['EXP', 'EXPGauss', 'BAR', 'BARzero', 'MBAR', 'timeseries', 'testsystems', 'confidenceintervals', 'utils']
Attempted workaround for version travis conda issue.
choderalab_pymbar
train
py
413957fa59ad5f88b5bba0a3a70b3786c8cb2002
diff --git a/apns2/client.py b/apns2/client.py index <HASH>..<HASH> 100644 --- a/apns2/client.py +++ b/apns2/client.py @@ -22,7 +22,7 @@ class APNsClient(object): self.__connection = HTTP20Connection(server, port, ssl_context=ssl_context) def send_notification(self, token_hex, notification, priority=NotificationPriority.Immediate, topic=None): - json_payload = dumps(notification.dict(), ensure_ascii=False, separators=(',',':')).encode('utf-8') + json_payload = dumps(notification.dict(), ensure_ascii=False, separators=(',', ':')).encode('utf-8') headers = { 'apns-priority': priority.value
Update client.py according to PEP8
Pr0Ger_PyAPNs2
train
py
278183c7e727f875fb2eae8ceba29bfd4b01afc2
diff --git a/eth/backend.go b/eth/backend.go index <HASH>..<HASH> 100644 --- a/eth/backend.go +++ b/eth/backend.go @@ -449,14 +449,10 @@ func (s *Ethereum) Start() error { ClientString: s.net.Name, ProtocolVersion: ProtocolVersion, }) - - if s.net.MaxPeers > 0 { - err := s.net.Start() - if err != nil { - return err - } + err := s.net.Start() + if err != nil { + return err } - // periodically flush databases go s.syncDatabases() diff --git a/p2p/server.go b/p2p/server.go index <HASH>..<HASH> 100644 --- a/p2p/server.go +++ b/p2p/server.go @@ -275,9 +275,6 @@ func (srv *Server) Start() (err error) { if srv.PrivateKey == nil { return fmt.Errorf("Server.PrivateKey must be set to a non-nil key") } - if srv.MaxPeers <= 0 { - return fmt.Errorf("Server.MaxPeers must be > 0") - } if srv.newTransport == nil { srv.newTransport = newRLPX }
eth, p2p: start the p2p server even if maxpeers == 0
ethereum_go-ethereum
train
go,go
aba8f58575818be8765fb0ff90eb85282f15c0c4
diff --git a/tohu/generators_NEW.py b/tohu/generators_NEW.py index <HASH>..<HASH> 100644 --- a/tohu/generators_NEW.py +++ b/tohu/generators_NEW.py @@ -175,8 +175,13 @@ class SelectOne(TohuUltraBaseGenerator): return cur_values[idx] def reset(self, seed): + logger.debug(f"Ignoring explicit reset() on derived generator: {self}") + + def reset_clone(self, seed): + logger.warning("TODO: rename method reset_clone() to reset_dependent_generator() because ExtractAttribute is not a direct clone") if seed is not None: self.randgen.seed(seed) + #self.gen.reset(seed) return self
Make SelectOne a proper derived generator
maxalbert_tohu
train
py
b0bca269244d5e5e17a9a8fede49e881bc0db8d9
diff --git a/num2words/lang_ES_CO.py b/num2words/lang_ES_CO.py index <HASH>..<HASH> 100644 --- a/num2words/lang_ES_CO.py +++ b/num2words/lang_ES_CO.py @@ -20,7 +20,7 @@ from __future__ import unicode_literals, print_function from .lang_EU import Num2Word_EU -class Num2Word_ES(Num2Word_EU): +class Num2Word_ES_CO(Num2Word_EU): # //CHECK: Is this sufficient?? def set_high_numwords(self, high): max = 3 + 6*len(high) diff --git a/num2words/lang_ES_VE.py b/num2words/lang_ES_VE.py index <HASH>..<HASH> 100644 --- a/num2words/lang_ES_VE.py +++ b/num2words/lang_ES_VE.py @@ -20,7 +20,7 @@ from __future__ import unicode_literals, print_function from .lang_EU import Num2Word_EU -class Num2Word_ES(Num2Word_EU): +class Num2Word_ES_VE(Num2Word_EU): # //CHECK: Is this sufficient?? def set_high_numwords(self, high): max = 3 + 6*len(high)
[IMP]Adds new files for ES_CO and ES_VE.
savoirfairelinux_num2words
train
py,py
e5b834921c539ca4472e36dd969d6746b4de218d
diff --git a/core/src/main/java/hudson/model/Run.java b/core/src/main/java/hudson/model/Run.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/hudson/model/Run.java +++ b/core/src/main/java/hudson/model/Run.java @@ -1523,7 +1523,7 @@ public abstract class Run <JobT extends Job<JobT,RunT>,RunT extends Run<JobT,Run } /** - * Used in {@link RunExecution#run} to indicates that a fatal error in a build + * Used in {@link Run.RunExecution#run} to indicates that a fatal error in a build * is reported to {@link BuildListener} and the build should be simply aborted * without further recording a stack trace. */
IntelliJ complains about this. Not sure if it's a real problem
jenkinsci_jenkins
train
java
7519a98ecc30608ea838326bd39b0fd2f5b10445
diff --git a/test/consumer.py b/test/consumer.py index <HASH>..<HASH> 100644 --- a/test/consumer.py +++ b/test/consumer.py @@ -73,7 +73,7 @@ class TestFetcher(object): response = associate(body, self.assoc_secret, self.assoc_handle) self.num_assocs += 1 return self.response(url, response) - + user_page_pat = '''\ <html> <head> @@ -208,7 +208,7 @@ def test_construct(): assert oidc.store is store_sentinel assert oidc.fetcher is fetcher_sentinel assert oidc.immediate - + oidc = OpenIDConsumer(store_sentinel, fetcher=None) f = oidc.fetcher assert hasattr(f, 'get')
[project @ M-x whitespace-cleanup]
openid_python-openid
train
py
66c51f2016ba72033939edffbf910362edd036f1
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -27,6 +27,10 @@ export class RangePool { for (const worker of this.workers) { if (!worker.hasCompleted()) { + if (!worker.isActive()) { + return worker.activate() + } + const percentage = worker.getCompletionPercentage() const diff = worker.getIndexLimit() - worker.getCurrentIndex() lastWorker = worker @@ -46,7 +50,7 @@ export class RangePool { if (this.hasCompleted()) { throw new Error('Can not add a new worker on a completed pool') } - return this.registerWorker(new PoolWorker(this.getCompletedSteps(), this.length)) + return this.registerWorker(new PoolWorker(this.getCompletedSteps(), this.length)).activate() } const workLeft = lazyWorker.getRemaining() @@ -61,7 +65,7 @@ export class RangePool { } hasWorkingWorker(): boolean { for (const worker of this.workers) { - if (!worker.hasCompleted()) { + if (!worker.hasCompleted() && worker.isActive()) { return true } }
:new: Use existing non-finished workers if available This way we won't be creating gaps in the pool and will be completing the work in it's entirety
steelbrain_range-pool
train
js
d3eaeec13d5e286bb02ae92ca7ef8a7c7e8d1cdb
diff --git a/bin/svgfont2svgicons.js b/bin/svgfont2svgicons.js index <HASH>..<HASH> 100755 --- a/bin/svgfont2svgicons.js +++ b/bin/svgfont2svgicons.js @@ -7,6 +7,7 @@ var svgfont2svgicons = require(__dirname + '/../src/index.js') var fontStream = Fs.createReadStream(process.argv[2]); var iconProvider = svgfont2svgicons(); +var unamedIconCount = 0; fontStream.pipe(iconProvider); @@ -15,7 +16,10 @@ iconProvider.on('readable', function() { while(null !== glyph) { glyph = iconProvider.read(); if(glyph) { - glyphPath = path.join(process.argv[3], glyph.name + '.svg'); + glyphPath = path.join( + process.argv[3], + (glyph.name || 'icon' + (++unamedIconCount) + '.svg') + ); console.log('Saving glyph "' + glyph.name + '" to "' + glyphPath + '"'); glyph.stream.pipe(Fs.createWriteStream(glyphPath)); }
Taking in count unamed icons
nfroidure_svgfont2svgicons
train
js
6933e50c150f7db1622afc425c466591bf4d1afb
diff --git a/lib/plugins/static.js b/lib/plugins/static.js index <HASH>..<HASH> 100644 --- a/lib/plugins/static.js +++ b/lib/plugins/static.js @@ -35,7 +35,7 @@ function serveStatic(opts) { req.path())); return; } else if (!stats.isFile()) { - next(new ResourceNotFoundError(req.path())); + next(new ResourceNotFoundError('%s does not exist', req.path())); return; }
#<I> - serveStatic does not append
restify_plugins
train
js
80d0489d96729e3ef8bdc27d5cba11af0b6d49a8
diff --git a/tests/test_request.py b/tests/test_request.py index <HASH>..<HASH> 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -93,7 +93,7 @@ def server_thread(server): request = server.get_request() server.process_request(*request) server.server_close() - server.socket.close() + # server.socket.close() class TestQuery(object):
test - More time for the client to fetch the data returned
DinoTools_python-overpy
train
py
426f687c5da51110ab14abdb0bae24fcb3d12eff
diff --git a/lib/class.OS_Linux.php b/lib/class.OS_Linux.php index <HASH>..<HASH> 100644 --- a/lib/class.OS_Linux.php +++ b/lib/class.OS_Linux.php @@ -455,7 +455,7 @@ class OS_Linux extends OS_Unix_Common { $return = array(); // hddtemp? - if (array_key_exists('hddtemp', (array)$this->settings['temps']) && !empty($this->settings['temps']['hddtemp'])) { + if (array_key_exists('hddtemp', (array)$this->settings['temps']) && !empty($this->settings['temps']['hddtemp']) && isset($this->settings['hddtemp'])) { try { // Initiate class $hddtemp = new GetHddTemp($this->settings); @@ -487,7 +487,7 @@ class OS_Linux extends OS_Unix_Common { } // mbmon? - if (array_key_exists('mbmon', (array)$this->settings['temps']) && !empty($this->settings['temps']['mbmon'])) { + if (array_key_exists('mbmon', (array)$this->settings['temps']) && !empty($this->settings['temps']['mbmon']) && isset($this->settings['mbmon'])) { try { // Initiate class $mbmon = new GetMbMon;
Adding array index checks In test suite, config details are missing for hddtemp/mbmon in the test config, which caused phpunit to spit invalid index errors. This is now safeguarded against using isset()'s
jrgp_linfo
train
php
e85ab25b1f1cf04ad1764d47e884be4f3873c072
diff --git a/lib/ooor/errors.rb b/lib/ooor/errors.rb index <HASH>..<HASH> 100644 --- a/lib/ooor/errors.rb +++ b/lib/ooor/errors.rb @@ -25,6 +25,8 @@ module Ooor return ValueError.new(method, faultCode, faultString, *args) elsif faultCode =~ /ValidateError/ return ValidationError.new(method, faultCode, faultString, *args) + elsif faultCode =~ /AccessDenied/ + return UnAuthorizedError.new(method, faultCode, faultString, *args) elsif faultCode =~ /AuthenticationError: Credentials not provided/ return InvalidSessionError.new(method, faultCode, faultString, *args) else
properly generates UnAuthorizedError
akretion_ooor
train
rb
90c3c9a156509257d9c6b1b40e6db1da08cb08eb
diff --git a/db/sql.php b/db/sql.php index <HASH>..<HASH> 100644 --- a/db/sql.php +++ b/db/sql.php @@ -302,9 +302,8 @@ class SQL extends \PDO { // This requires SUPER privilege! $rows=array(); foreach ($this->exec($val[0],NULL,$ttl) as $row) { - $field=trim($row[$val[1]],'\'"[]`'); - if (!$fields || in_array($field,$fields)) - $rows[$field]=array( + if (!$fields || in_array($row[$val[1]],$fields)) + $rows[$row[$val[1]]]=array( 'type'=>$row[$val[2]], 'pdo_type'=> preg_match('/int\b|int(?=eger)|bool/i',
Revert to prior schema detection (Issue #<I>)
bcosca_fatfree-core
train
php
2bb85240f3d781b009129d950287fab0b95a92b1
diff --git a/smart_selects/views.py b/smart_selects/views.py index <HASH>..<HASH> 100644 --- a/smart_selects/views.py +++ b/smart_selects/views.py @@ -1,5 +1,6 @@ from django.http import HttpResponse from django.db.models import Q +from django.utils.six import iteritems try: from django.apps import apps @@ -41,7 +42,7 @@ def do_filter(qs, keywords, exclude=False): Support for multiple-selected parent values. """ and_q = Q() - for keyword, value in keywords.iteritems(): + for keyword, value in iteritems(keywords): values = value.split(",") if len(values) > 0: or_q = Q()
Fix python 3 compatibility issue Using iteritems() to iterate dicts isn't supported by Python 3. Applied a solution that supports both Python 2 and 3.
digi604_django-smart-selects
train
py
43b77462b5019fedd13e39f0f9a23579cf3bf219
diff --git a/molgenis-api-tests/src/test/java/org/molgenis/api/tests/rest/v2/RestControllerV2IT.java b/molgenis-api-tests/src/test/java/org/molgenis/api/tests/rest/v2/RestControllerV2IT.java index <HASH>..<HASH> 100644 --- a/molgenis-api-tests/src/test/java/org/molgenis/api/tests/rest/v2/RestControllerV2IT.java +++ b/molgenis-api-tests/src/test/java/org/molgenis/api/tests/rest/v2/RestControllerV2IT.java @@ -269,7 +269,7 @@ public class RestControllerV2IT .all() .header(X_MOLGENIS_TOKEN, testUserToken) .when() - .get(API_V2 + "sys_sec_User?aggs=x==active;y==superuser") + .get(API_V2 + "sys_sec_User?aggs=x==active;y==superuser;distinct==active") .then() .statusCode(OKE) .body("aggs.matrix[0][0]", Matchers.equalTo(1));
Use distinct query to prevent test users to interfere with the aggregate result
molgenis_molgenis
train
java
4f70193055e2db6ba393748ec1a1820b23ab0233
diff --git a/src/tests/org/owasp/html/AntiSamyTest.java b/src/tests/org/owasp/html/AntiSamyTest.java index <HASH>..<HASH> 100644 --- a/src/tests/org/owasp/html/AntiSamyTest.java +++ b/src/tests/org/owasp/html/AntiSamyTest.java @@ -49,7 +49,7 @@ import junit.framework.TestSuite; public class AntiSamyTest extends TestCase { static final boolean RUN_KNOWN_FAILURES = false; - static final boolean DISABLE_INTERNETS = true; + static final boolean DISABLE_INTERNETS = false; private static HtmlSanitizer.Policy makePolicy(Appendable buffer) { final HtmlStreamRenderer renderer = HtmlStreamRenderer.create(
re-enable internet tests inherited from AntiSamy
OWASP_java-html-sanitizer
train
java
de917684f4913592e7c43feff20fa3fa6b0e52be
diff --git a/pyemma/msm/tests/test_bayesian_hmsm.py b/pyemma/msm/tests/test_bayesian_hmsm.py index <HASH>..<HASH> 100644 --- a/pyemma/msm/tests/test_bayesian_hmsm.py +++ b/pyemma/msm/tests/test_bayesian_hmsm.py @@ -320,5 +320,19 @@ class TestBHMMSpecialCases(unittest.TestCase): assert strajs[0][0] == 2 assert strajs[0][6] == 2 + def test_initialized_bhmm(self): + import pyemma.datasets + import pyemma.msm + + obs = pyemma.datasets.load_2well_discrete().dtraj_T100K_dt10 + + init_hmm = pyemma.msm.estimate_hidden_markov_model(obs, 2, 10) + bay_hmm = pyemma.msm.estimators.BayesianHMSM(nstates=init_hmm.nstates, lag=init_hmm.lag, + init_hmsm=init_hmm) + bay_hmm.estimate(obs) + + assert np.isclose(bay_hmm.stationary_distribution.sum(), 1) + + if __name__ == "__main__": unittest.main()
[TestBHMMSpecialCases] added test for initialized bhmm
markovmodel_PyEMMA
train
py
5d1671bb9bf53a61f5c8db8a00f8c62adcf33e81
diff --git a/integration_tests/root_test.go b/integration_tests/root_test.go index <HASH>..<HASH> 100644 --- a/integration_tests/root_test.go +++ b/integration_tests/root_test.go @@ -3,12 +3,17 @@ package wl_integration_test import ( . "github.com/onsi/ginkgo" . "github.com/onsi/gomega" + "github.com/robdimsdale/wl" ) var _ = Describe("basic root functionality", func() { It("gets root correctly", func() { - root, err := client.Root() - Expect(err).NotTo(HaveOccurred()) + var err error + var root wl.Root + Eventually(func() error { + root, err = client.Root() + return err + }).Should(Succeed()) Expect(root.ID).To(BeNumerically(">", 0)) })
Reduce flakiness in root test. [#<I>]
robdimsdale_wl
train
go
15c2c4dd23f4140bc579d660b9396722cbc4694a
diff --git a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php index <HASH>..<HASH> 100644 --- a/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php +++ b/tests/Doctrine/Tests/ORM/Tools/EntityGeneratorTest.php @@ -548,9 +548,9 @@ class EntityGeneratorTest extends \Doctrine\Tests\OrmTestCase )), array(array( 'fieldName' => 'decimal', - 'phpType' => 'float', + 'phpType' => 'string', 'dbType' => 'decimal', - 'value' => 33.33 + 'value' => '33.33' ), )); }
Updated EntityGeneratorTest::testEntityTypeAlias
doctrine_orm
train
php
f8b5083348621444c5bb48ae1c1c9381785d722a
diff --git a/lib/deployml/project.rb b/lib/deployml/project.rb index <HASH>..<HASH> 100644 --- a/lib/deployml/project.rb +++ b/lib/deployml/project.rb @@ -159,13 +159,15 @@ module DeploYML end def load_server! - unless Servers.has_key?(@config.server_name) - raise(InvalidConfig,"Unknown Server #{@config.server_name} given under the :server option",caller) - end + if @config.server_name + unless Servers.has_key?(@config.server_name) + raise(InvalidConfig,"Unknown Server #{@config.server_name} given under the :server option",caller) + end - extend SERVERS[@config.server_name] + extend SERVERS[@config.server_name] - initialize_server() if self.respond_to?(:initialize_server) + initialize_server() if self.respond_to?(:initialize_server) + end end end
Only load the Server module if a server was defined in deploy.yml.
postmodern_deployml
train
rb
c7155f41c2eaa29ac3183878d4318d0c1a713c70
diff --git a/module/base/src/cache.js b/module/base/src/cache.js index <HASH>..<HASH> 100644 --- a/module/base/src/cache.js +++ b/module/base/src/cache.js @@ -7,7 +7,7 @@ const { execSync } = require('child_process'); const appCore = require('./_app-core'); function isOlder(cacheStat, fullStat) { - return cacheStat.ctimeMs < fullStat.ctimeMs || cacheStat.mtimeMs < fullStat.mtimeMs || cacheStat.atimeMs < fullStat.atimeMs; + return cacheStat.ctimeMs < fullStat.ctimeMs || cacheStat.mtimeMs < fullStat.mtimeMs; } class Cache {
No longer consider access time for staleness, only mtime and ctime
travetto_travetto
train
js
00adaf9c2fe59bcf2321cd47972939a95c90b9e2
diff --git a/buildbot/slave/commands.py b/buildbot/slave/commands.py index <HASH>..<HASH> 100644 --- a/buildbot/slave/commands.py +++ b/buildbot/slave/commands.py @@ -196,6 +196,7 @@ class LogFileWatcher: return # no file to work with self.f = open(self.logfile, "rb") self.started = True + self.f.seek(self.f.tell(), 0) while True: data = self.f.read(10000) if not data:
Seek to current file position to clear EOF status on Mac OS X. Mac OS X and Linux differ in behaviour when reading from a file that has previously reached EOF. On Linux, any new data that has been appended to the file will be returned. On Mac OS X, the empty string will always be returned. Seeking to the current position in the file resets the EOF flag on Mac OS X and will allow future reads to work as intended.
buildbot_buildbot
train
py
ee7f2f440030cc1034fea47df5022d2de0617ed1
diff --git a/src/Adapters/PostgreSQL.php b/src/Adapters/PostgreSQL.php index <HASH>..<HASH> 100644 --- a/src/Adapters/PostgreSQL.php +++ b/src/Adapters/PostgreSQL.php @@ -19,6 +19,31 @@ class PostgreSQL extends SQL { return $this->client->exec("TRUNCATE TABLE $this->table") !== false; } + + /** + * {@inheritdoc} + */ + public function set($key, $value, $expire = 0) + { + $value = $this->serialize($value); + $expire = $this->expire($expire); + + $this->clearExpired(); + + $statement = $this->client->prepare( + "INSERT INTO $this->table (k, v, e) + VALUES (:key, :value, :expire) + ON CONFLICT (k) DO UPDATE SET v=EXCLUDED.v, e=EXCLUDED.e" + ); + + $statement->execute([ + ':key' => $key, + ':value' => $value, + ':expire' => $expire, + ]); + + return $statement->rowCount() === 1; + } /** * {@inheritdoc}
Postgres set on conflict update Since version <I> postgres (<I> latest) has on conflict update set syntax. This syntax avoids lots of error record in postgres logs (duplicate key error). <URL>
matthiasmullie_scrapbook
train
php
2ae80fce0979dc7790e955fa812df8456d504b68
diff --git a/qualysapi/config.py b/qualysapi/config.py index <HASH>..<HASH> 100644 --- a/qualysapi/config.py +++ b/qualysapi/config.py @@ -86,17 +86,17 @@ class QualysConnectConfig: self.max_retries = int(self.max_retries) #Get template ID... user will need to set this to pull back CSV reports - if not self._cfgparse.has_option('qualys', 'template_id'): + if not self._cfgparse.has_option(self._section, 'template_id'): self.report_template_id = qcs.defaults['template_id'] else: - self.report_template_id = self._cfgparse.get('qualys', 'template_id') + self.report_template_id = self._cfgparse.get(self._section, 'template_id') try: self.report_template_id = int(self.report_template_id) except Exception: logger.error('Report Template ID Must be set and be an integer') print('Value template ID must be an integer.') exit(1) - self._cfgparse.set('qualys', 'template_id', str(self.report_template_id)) + self._cfgparse.set(self._section, 'template_id', str(self.report_template_id)) self.report_template_id = int(self.report_template_id) # Proxy support
changed section on VulnWhisperer functions
paragbaxi_qualysapi
train
py
7455f7d65dc0f74049995af7db98c8b29a6fbd41
diff --git a/test/functional/ft_5_on_error.rb b/test/functional/ft_5_on_error.rb index <HASH>..<HASH> 100644 --- a/test/functional/ft_5_on_error.rb +++ b/test/functional/ft_5_on_error.rb @@ -127,5 +127,30 @@ class FtOnErrorTest < Test::Unit::TestCase assert_trace(pdef, 'failed.') end + + def test_with_concurrence + + pdef = Ruote.process_definition do + sequence do + concurrence :on_error => 'emil' do + alpha + error 'nada0' + error 'nada1' + end + echo 'done.' + end + end + + acount = 0 + ecount = 0 + @engine.register_participant(:alpha) { |wi| acount += 1 } + @engine.register_participant(:emil) { |wi| ecount += 1 } + + #noisy + + assert_trace pdef, 'done.' + assert_equal 1, acount + assert_equal 1, ecount + end end
added test about concurrence :on_error => 'x'
jmettraux_ruote
train
rb
2a057f0aca5705649f9dd7b668ad6d96a9a6ca45
diff --git a/includes/functions-html.php b/includes/functions-html.php index <HASH>..<HASH> 100644 --- a/includes/functions-html.php +++ b/includes/functions-html.php @@ -564,7 +564,7 @@ function yourls_table_add_row( $keyword, $url, $title = '', $ip, $clicks, $times 'onclick' => "remove_link('$id');return false;", ) ); - $actions = yourls_apply_filter( 'table_add_row_action_array', $actions ); + $actions = yourls_apply_filter( 'table_add_row_action_array', $actions, $keyword ); // Action link buttons: the HTML $action_links = '';
Extend filter-hook "table_add_row_action_array" Closes #<I>
YOURLS_YOURLS
train
php
1a807e585d79bc01eeeaffd4bdd24b96f129f743
diff --git a/src/rez/build_process.py b/src/rez/build_process.py index <HASH>..<HASH> 100644 --- a/src/rez/build_process.py +++ b/src/rez/build_process.py @@ -291,6 +291,13 @@ class LocalSequentialBuildProcess(StandardBuildProcess): """A BuildProcess that sequentially builds the variants of the current package, on the local host. """ + + def _use_existing_context_file(self, rxt_file): + if os.path.exists(rxt_file): + if os.path.getmtime(self.package.metafile) < os.path.getmtime(rxt_file): + return True + return False + def _build(self, install_path, build_path, clean=False, install=False): base_install_path = self._get_base_install_path(install_path) nvariants = max(self.package.num_variants, 1) @@ -314,7 +321,8 @@ class LocalSequentialBuildProcess(StandardBuildProcess): # resolve build environment and save to file rxt_path = os.path.join(build_subdir, "build.rxt") - if os.path.exists(rxt_path): + + if self._use_existing_context_file(rxt_path): self._pr("Loading existing environment context...") r = ResolvedContext.load(rxt_path) else:
+ Only reuse the context if the package.yaml hasn't changed.
nerdvegas_rez
train
py
a0fa04f618eb82583b5a25dbc322e32290db0b5c
diff --git a/src/application/shared/main.js b/src/application/shared/main.js index <HASH>..<HASH> 100644 --- a/src/application/shared/main.js +++ b/src/application/shared/main.js @@ -0,0 +1,19 @@ +// const jsToHtml = require("@chooie/js_to_html"); + +function createJsToHtmlPreprocessor(logger, basePath, args, config) { + const log = logger.create("preprocessor.js"); + + return function(content, file, done) { + log.debug("Procesing '%s'.", file.originalPath); + file.path = file.originalPath.replace(/\.js$/, ".html"); + log.debug("Content '%s'.", content); + done(content); + }; +} + +createJsToHtmlPreprocessor.$inject = ["logger", "config.basePath", "args", "config.pugPreprocessor"]; + +// PUBLISH DI MODULE +module.exports = { + "preprocessor:pug": ["factory", createJsToHtmlPreprocessor] +};
Log the content the preprocessor receives
chooie_karma-js_to_html-preprocessor
train
js
3b734b004ad49eec3cc144dc79f2cbd1742f1e90
diff --git a/packages/router5/modules/core/navigation.js b/packages/router5/modules/core/navigation.js index <HASH>..<HASH> 100644 --- a/packages/router5/modules/core/navigation.js +++ b/packages/router5/modules/core/navigation.js @@ -42,7 +42,7 @@ export default function withNavigation(router) { * Navigate to a route * @param {String} routeName The route name * @param {Object} [routeParams] The route params - * @param {Object} [options] The navigation options (`replace`, `reload`) + * @param {Object} [options] The navigation options (`replace`, `reload`, `skipTransition`) * @param {Function} [done] A done node style callback (err, state) * @return {Function} A cancel function */ @@ -98,6 +98,11 @@ export default function withNavigation(router) { const fromState = sameStates ? null : router.getState(); + if (opts.skipTransition) { + done(null, toState); + return noop; + } + // Transition return transitionToState(toState, fromState, opts, (err, state) => { if (err) {
feat: add navigation option to skip transition
router5_router5
train
js
65e553abe09ca6914ef1b75dd7b0d24d2b291e75
diff --git a/blimpy/io/hdf_reader.py b/blimpy/io/hdf_reader.py index <HASH>..<HASH> 100644 --- a/blimpy/io/hdf_reader.py +++ b/blimpy/io/hdf_reader.py @@ -26,10 +26,12 @@ def examine_h5(h5): verblob = h5.attrs["VERSION"] else: oops("examine_h5: HDF5 VERSION attribute missing") - try: + if type(verblob) == str: + version = float(verblob) + elif type(verblob) == bytes or type(verblob) == np.bytes_: version = float(verblob.decode("utf-8")) - except: - oops("examine_h5: HDF5 VERSION attribute is corrupted, saw {}".format(verblob)) + else: + oops("examine_h5: HDF5 VERSION attribute is neither str nor bytes, saw {}".format(verblob)) if not "data" in h5: oops("examine_h5: HDF5 data matrix missing") if h5["data"].ndim != 3:
Sometimes, the type(VERSION) = numpy.bytes_ This was observed in the data centre using pytest. When run interactively, the same file yielded a VERSION of type bytes. And, for some files, type(VERSION) = str.
UCBerkeleySETI_blimpy
train
py
61494180c3b723e8d95d2860dbf814e4f7c36763
diff --git a/generator/classes/propel/engine/builder/om/php5/PHP5BasicPeerBuilder.php b/generator/classes/propel/engine/builder/om/php5/PHP5BasicPeerBuilder.php index <HASH>..<HASH> 100644 --- a/generator/classes/propel/engine/builder/om/php5/PHP5BasicPeerBuilder.php +++ b/generator/classes/propel/engine/builder/om/php5/PHP5BasicPeerBuilder.php @@ -362,7 +362,7 @@ if (Propel::isInit()) { * @return array The PHP to DB name map for this peer * @throws PropelException Any exceptions caught during processing will be * rethrown wrapped into a PropelException. - * @todo Consider having template build the array rather than doing it at runtime. + * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this. */ public static function getPhpNameMap() { @@ -436,7 +436,7 @@ if (Propel::isInit()) { */ public static function alias(\$alias, \$column) { - return \$alias . substr(\$column, strlen(".$this->getPeerClassname()."::TABLE_NAME)); + return str_replace(".$this->getPeerClassname()."::TABLE_NAME.'.', \$alias.'.', \$column); } "; } // addAliasMethod
#<I> (from: synace). Improved substitution in alias() method.
propelorm_Propel
train
php
b12c637a6073e52b859b9258b6ad8486127db9bd
diff --git a/controller/extjs/tests/Controller/ExtJS/Coupon/DefaultTest.php b/controller/extjs/tests/Controller/ExtJS/Coupon/DefaultTest.php index <HASH>..<HASH> 100644 --- a/controller/extjs/tests/Controller/ExtJS/Coupon/DefaultTest.php +++ b/controller/extjs/tests/Controller/ExtJS/Coupon/DefaultTest.php @@ -60,7 +60,7 @@ class Controller_ExtJS_Coupon_DefaultTest extends MW_Unittest_Testcase 'condition' => (object) array( '&&' => array( 0 => array( '~=' => (object) array( 'coupon.provider' => 'FixedRebate' ) ), - 1 => array( '==' => (object) array( 'coupon.editor' => 'coupon:test' ) ) + 1 => array( '==' => (object) array( 'coupon.editor' => 'core:unittest' ) ) ) ), 'sort' => 'coupon.label',
Fixes coupon ExtJS controller test
Arcavias_arcavias-core
train
php
271961ecb1b7eea779fb760c3c83aaa42418013d
diff --git a/ryu/lib/packet/bgp.py b/ryu/lib/packet/bgp.py index <HASH>..<HASH> 100644 --- a/ryu/lib/packet/bgp.py +++ b/ryu/lib/packet/bgp.py @@ -2332,7 +2332,8 @@ class _FlowSpecPrefixBase(_FlowSpecComponentBase, IPAddrPrefix): def __init__(self, length, addr, type_=None): super(_FlowSpecPrefixBase, self).__init__(type_) self.length = length - self.addr = addr + prefix = "%s/%s" % (addr, length) + self.addr = str(netaddr.ip.IPNetwork(prefix).network) @classmethod def parse_body(cls, buf):
packet/bgp: Add the address converter for Flow Specification Argument "addr" of "_FlowSpecPrefixBase" must be specified in the network address. If argument "addr" specified in the host address, this patch converts the given address into the network address.
osrg_ryu
train
py
87436eecc72e5dc046e9de6fd5c5a1e8f7a91ba9
diff --git a/xmlnuke-php5/src/Xmlnuke/Util/CreatePhp5Project.php b/xmlnuke-php5/src/Xmlnuke/Util/CreatePhp5Project.php index <HASH>..<HASH> 100644 --- a/xmlnuke-php5/src/Xmlnuke/Util/CreatePhp5Project.php +++ b/xmlnuke-php5/src/Xmlnuke/Util/CreatePhp5Project.php @@ -294,6 +294,21 @@ class CreatePhp5Project unlink ("$HTTPDOCS/common"); CreatePhp5Project::executeShell( "ln -sf", array("$XMLNUKE/xmlnuke-common", "$HTTPDOCS/common") ); } + + // Rename Dist Files + $directory = new \RecursiveDirectoryIterator($xmlnuke); + $iterator = new \RecursiveIteratorIterator($directory); + $regex = new \RegexIterator($iterator, '/\.dist$/i', \RecursiveRegexIterator::GET_MATCH); + + foreach ($regex as $filename=>$pattern) + { + $newFile = str_replace($pattern[0], '', $filename); + if (!file_exists($newFile)) + { + copy($filename, $newFile); + } + } + return true; }
Copy all dist files after composer update
byjg_xmlnuke
train
php
d44f7e46238a809d9f9561a24c691d93148a5b2d
diff --git a/Gruntfile.js b/Gruntfile.js index <HASH>..<HASH> 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -170,6 +170,10 @@ module.exports = function(grunt) { files: ['**/yui/src/**/*.js'], tasks: ['yui'] }, + gherkinlint: { + files: ['**/tests/behat/*.feature'], + tasks: ['gherkinlint'] + } }, shifter: { options: { @@ -349,6 +353,7 @@ module.exports = function(grunt) { // Run them all!. grunt.task.run('css'); grunt.task.run('js'); + grunt.task.run('gherkinlint'); } }; @@ -363,6 +368,7 @@ module.exports = function(grunt) { grunt.config('uglify.amd.files', [{expand: true, src: files, rename: uglifyRename}]); grunt.config('shifter.options.paths', files); grunt.config('stylelint.less.src', files); + grunt.config('gherkinlint.options.files', files); changedFiles = Object.create(null); }, 200);
MDL-<I> behat: Add gherkin lint to watch and startup
moodle_moodle
train
js
3905263175b048e00f35a08fe005b96128c0e4a3
diff --git a/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php b/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php index <HASH>..<HASH> 100644 --- a/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php +++ b/src/PeskyCMF/Scaffold/Form/ImagesFormInput.php @@ -89,7 +89,12 @@ class ImagesFormInput extends FormInput { $table = $this->getScaffoldSectionConfig()->getTable(); $record = $this->getScaffoldSectionConfig()->getTable()->newRecord(); if ($table instanceof KeyValueTableInterface) { - $record->fromData([$record::getPrimaryKeyColumnName() => 0, $this->getTableColumn()->getName() => $value], true); + $fakeData = [$record::getPrimaryKeyColumnName() => 0, $this->getTableColumn()->getName() => $value]; + $fkName = $table->getMainForeignKeyColumnName(); + if ($fkName) { + $fakeData[$fkName] = array_get($data, $fkName); + } + $record->fromData($fakeData, true); } else { $record->fromData($data, !empty($data[$record::getPrimaryKeyColumnName()])); }
ImagesFormInput::doDefaultValueConversionByType() - added foreign key value for key-value table's record so it can be used in ImagesColumn to create path to files based on foreign key value
swayok_PeskyCMF
train
php
341071a0f54c0297e0af55cceb1df7b112676771
diff --git a/lib/fog/aws/models/ec2/server.rb b/lib/fog/aws/models/ec2/server.rb index <HASH>..<HASH> 100644 --- a/lib/fog/aws/models/ec2/server.rb +++ b/lib/fog/aws/models/ec2/server.rb @@ -12,7 +12,7 @@ module Fog attribute :group_id, 'groupId' attribute :image_id, 'imageId' attribute :state, 'instanceState' - attribute :flavor, 'instanceType' + attribute :flavor_id, 'instanceType' attribute :kernel_id, 'kernelId' attribute :key_name, 'keyName' attribute :created_at, 'launchTime' @@ -44,12 +44,16 @@ module Fog # @group_id = new_security_group.name # end - def flavor - @flavor || 'm1.small' + def flavor_id + @flavor && @flavor.id || 'm1.small' end def flavor=(new_flavor) - @flavor = new_flavor.id + @flavor = new_flavor + end + + def flavor + @flavor || connection.flavors.all.detect {|flavor| flavor.id == @flavor_id} end def key_pair @@ -78,9 +82,12 @@ module Fog end end + def ready? + @state == 'running' + end + def reboot requires :id - connection.reboot_instances(@id) true end
cleanup flavor handling for aws.servers, add ready?
fog_fog
train
rb
52d77a788f01ac8b88af9a1e07258b4a4d724d40
diff --git a/src/SearchControl.js b/src/SearchControl.js index <HASH>..<HASH> 100644 --- a/src/SearchControl.js +++ b/src/SearchControl.js @@ -398,9 +398,12 @@ export class SearchControl extends Control { * @private */ updateDropdown_ () { - let inputContainsDropdown = (this.features_.indexOf(this.selectedFeature_) > -1) + let inputContainsDropdown = (this.features_.length === 1) && (this.features_[0] === this.selectedFeature_) - if ((this.features_.length > 1) || !inputContainsDropdown) { + if (inputContainsDropdown || (this.features_.length === 0)) { + this.dropdownActive_ = false + return this.dropdown_.slideUp().then(() => this.changed()) + } else { let length = Math.min(this.amountDropdownEntries_, this.features_.length) let entries = [] let handlers = [] @@ -415,9 +418,6 @@ export class SearchControl extends Control { this.dropdown_.setEntries(entries, handlers) this.dropdownActive_ = true return this.dropdown_.slideDown().then(() => this.changed()) - } else { - this.dropdownActive_ = false - return this.dropdown_.slideUp().then(() => this.changed()) } }
Hiding dropdown properly (#<I>)
KlausBenndorf_guide4you
train
js
ec0f767ab2a6e2744bcde82f8c08ca9da4847a13
diff --git a/penman/model.py b/penman/model.py index <HASH>..<HASH> 100644 --- a/penman/model.py +++ b/penman/model.py @@ -7,13 +7,25 @@ Semantic models for interpreting graphs. from penman import graph class Model(object): - def __init__(self, relations=None): - if not relations: - relations = {} - self.relations = relations + + def __init__(self, + top_identifier:str = 'top', + top_role:str = 'TOP', + nodetype_role:str = 'instance', + relations:dict = None): + self.top_identifier = top_identifier + self.top_role = top_role + self.nodetype_role = nodetype_role + self.relations = relations or {} + + @classmethod + def from_dict(cls, d): + return cls(**d) def is_inverted(self, triple: graph.BasicTriple) -> bool: - role = triple[1] + return self.is_role_inverted(triple[1]) + + def is_role_inverted(self, role: str) -> bool: return role not in self.relations and role.endswith('-of') def invert(self, triple: graph.BasicTriple) -> graph.BasicTriple: @@ -27,7 +39,7 @@ class Model(object): return (target, inverse, source) def normalize(self, triple: graph.BasicTriple) -> graph.BasicTriple: - if self.is_inverted(triple): + if self.is_role_inverted(triple[1]): triple = self.invert(triple) return triple
Add Model.is_role_inverted() Also move some properties from the codec class.
goodmami_penman
train
py
8750841c588e8ab7a9ce02112bfa46794abcc982
diff --git a/tests/acceptance/steps/config_update.py b/tests/acceptance/steps/config_update.py index <HASH>..<HASH> 100644 --- a/tests/acceptance/steps/config_update.py +++ b/tests/acceptance/steps/config_update.py @@ -22,7 +22,7 @@ from .util import update_topic_config from kafka_utils.util.zookeeper import ZK -@when(u'we set the configuration of the topic to 10 bytes') +@when(u'we set the configuration of the topic to 0 bytes') def step_impl1(context): context.output = update_topic_config( context.topic,
updating @when in behave test from <I> to 0
Yelp_kafka-utils
train
py
2d8fe9b63d493e9adbf9da429ec1531b8b5ac9cb
diff --git a/src/index.js b/src/index.js index <HASH>..<HASH> 100644 --- a/src/index.js +++ b/src/index.js @@ -265,10 +265,7 @@ class ReactInteractive extends React.Component { this.computeState(), this.p.props, // create dummy 'event' object that caused the state change, will be passed to onStateChange - { type: 'forcestate', - persist: () => {}, - preventDefault: () => {}, - stopPropagation: () => {} } + dummyEvent('forcestate') ); }
Use dummy event creator for forceState event
rafrex_react-interactive
train
js
da0320cdaf6d88661b089d0558044c1932d36b05
diff --git a/core/Http.php b/core/Http.php index <HASH>..<HASH> 100644 --- a/core/Http.php +++ b/core/Http.php @@ -414,7 +414,7 @@ class Piwik_Http } else { - $response = @file_get_contents($aUrl, 0, $ctx); + $response = file_get_contents($aUrl, 0, $ctx); $fileLength = Piwik_Common::strlen($response); }
Removing silent fail to display errors when they occur eg. Unable to find the wrapper "https" - did you forget to enable it when you configured PHP? which requires to uncomment from php.ini: ;extension=php_openssl.dll git-svn-id: <URL>
matomo-org_matomo
train
php
81ece9e53a8203307979117fe46a98ec1a512776
diff --git a/lib/stagehand/staging/commit_entry.rb b/lib/stagehand/staging/commit_entry.rb index <HASH>..<HASH> 100644 --- a/lib/stagehand/staging/commit_entry.rb +++ b/lib/stagehand/staging/commit_entry.rb @@ -32,7 +32,11 @@ module Stagehand end def record - @record ||= delete_operation? ? build_production_record : record_class.find_by_id(record_id) + @record ||= delete_operation? ? build_production_record : record_class.find_by_id(record_id) if content_operation? + end + + def content_operation? + record_id? && table_name? end def insert_operation?
Don't try to return a record if there is none.
culturecode_stagehand
train
rb
c404f40daa44ebd9f921992c1904980a5734caf7
diff --git a/lib/close_enough.rb b/lib/close_enough.rb index <HASH>..<HASH> 100644 --- a/lib/close_enough.rb +++ b/lib/close_enough.rb @@ -1,5 +1,5 @@ require 'damerau-levenshtein' -require 'close_enough/extensions' +require_relative 'close_enough/extensions' module CloseEnough 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 @@ -1,5 +1,5 @@ require 'rspec' -require 'coveralls' +#require 'coveralls' require File.expand_path("../../lib/close_enough", __FILE__) -Coveralls.wear! \ No newline at end of file +#Coveralls.wear! \ No newline at end of file
Comment out Coveralls until File::new is fixed.
ruby-jokes_close_enough
train
rb,rb
8d8edde171cbbaceec1868611c1872717da5c45e
diff --git a/lib/route.js b/lib/route.js index <HASH>..<HASH> 100644 --- a/lib/route.js +++ b/lib/route.js @@ -187,7 +187,7 @@ function Route(options) { this.name = options.name || false; this.url = options.url || options.path; - this.log = options.log.child({name: self.name}, true); + this.log = options.log.child({route_name: self.name}, true); // Setup DTrace probes, if applicable addProbes(this.dtrace, this.probe);
minor change to bunyan logger in route.js
restify_plugins
train
js
1d57303c2b2b341b778f86f216d363de5ab1eeaa
diff --git a/test/libs/router.spec.js b/test/libs/router.spec.js index <HASH>..<HASH> 100644 --- a/test/libs/router.spec.js +++ b/test/libs/router.spec.js @@ -457,7 +457,7 @@ describe('Class Router', () => { }); - describe('_isFloat', () => { + describe('_isNumeric', () => { it('should check if passed value is number or not', () => {
test/libs/router.spec.js: correct describe description from _isFloat to _isNumber
SerkanSipahi_app-decorators
train
js
be2220feb73876f54af0fd339790f983be5b18f6
diff --git a/glue_vispy_viewers/volume/volume_visual.py b/glue_vispy_viewers/volume/volume_visual.py index <HASH>..<HASH> 100644 --- a/glue_vispy_viewers/volume/volume_visual.py +++ b/glue_vispy_viewers/volume/volume_visual.py @@ -38,6 +38,7 @@ from __future__ import absolute_import, division, print_function +from distutils.version import LooseVersion from collections import defaultdict import numpy as np @@ -52,6 +53,8 @@ from ..extern.vispy.scene.visuals import create_visual_node from .shaders import get_shaders +NUMPY_LT_1_13 = LooseVersion(np.__version__) < LooseVersion('1.13') + class MultiVolumeVisual(VolumeVisual): """ @@ -247,7 +250,11 @@ class MultiVolumeVisual(VolumeVisual): data -= clim[0] data *= 1 / (clim[1] - clim[0]) - np.nan_to_num(data, copy=False) + + if NUMPY_LT_1_13: + data[np.isnan(data)] = 0. + else: + np.nan_to_num(data, copy=False) self.shared_program['u_volumetex_{0:d}'.format(index)].set_data(data)
Fixed compatibility with older Numpy versions
glue-viz_glue-vispy-viewers
train
py
49277654674d4de4c141d44f97077087baa565a5
diff --git a/src/org/mozilla/javascript/ScriptRuntime.java b/src/org/mozilla/javascript/ScriptRuntime.java index <HASH>..<HASH> 100644 --- a/src/org/mozilla/javascript/ScriptRuntime.java +++ b/src/org/mozilla/javascript/ScriptRuntime.java @@ -1092,19 +1092,19 @@ public class ScriptRuntime { * See ECMA 10.1.4 */ public static Scriptable bind(Scriptable scope, String id) { - Scriptable obj = scope; - while (obj != null && !ScriptableObject.hasProperty(obj, id)) { - obj = obj.getParentScope(); + while (!ScriptableObject.hasProperty(scope, id)) { + scope = scope.getParentScope(); + if (scope == null) { + break; + } } - return obj; + return scope; } public static Scriptable getBase(Scriptable scope, String id) { - Scriptable obj = scope; - while (obj != null) { - if (ScriptableObject.hasProperty(obj, id)) - return obj; - obj = obj.getParentScope(); + Scriptable base = bind(scope, id); + if (base != null) { + return base; } throw NativeGlobal.constructError( Context.getContext(), "ReferenceError",
As the scope parameter for the bind and getBase methods should never be null, make sure they trigger NullPointerException on "scope == null" to detect bad API usage earlier.
mozilla_rhino
train
java
6bfae30cd6e9c28f4ccfa3e16476bc57546cfeff
diff --git a/detect_secrets/plugins/common/ini_file_parser.py b/detect_secrets/plugins/common/ini_file_parser.py index <HASH>..<HASH> 100644 --- a/detect_secrets/plugins/common/ini_file_parser.py +++ b/detect_secrets/plugins/common/ini_file_parser.py @@ -1,6 +1,9 @@ from __future__ import unicode_literals -import configparser +try: + from backports import configparser +except ImportError: # pragma: no cover + import configparser import re
:bug: Patch backports configparser too We previously patched configparser with `EfficientParsingError`, however this did not patch the backports version present on Python 2.
Yelp_detect-secrets
train
py
578b9e5a65b00470651346e923dbfb9db4da8a46
diff --git a/test.js b/test.js index <HASH>..<HASH> 100644 --- a/test.js +++ b/test.js @@ -22,4 +22,4 @@ FS.open("zip.zip", "r", "0666", function(err, fd) { var readFromFileDescriptor = reader.toObject('utf-8'); console.log(readFromFileDescriptor); assert.deepEqual(readFromBuffer, readFromFileDescriptor, 'READ from Buffer MUST be equal to READ from file descriptor'); -}); \ No newline at end of file +});
Add missing newline at end of file
kriskowal_zip
train
js
a7a7bb9cb8050d77cd948ce1a9205e7e35c23d0e
diff --git a/iotilecore/RELEASE.md b/iotilecore/RELEASE.md index <HASH>..<HASH> 100644 --- a/iotilecore/RELEASE.md +++ b/iotilecore/RELEASE.md @@ -2,9 +2,14 @@ All major changes in each released version of `iotile-core` are listed here. +## 4.0.1 + +- Actually drop python2 support + ## 4.0.0 - Drop python2 support +- This version was not officially released ## 3.27.2 diff --git a/iotilecore/setup.py b/iotilecore/setup.py index <HASH>..<HASH> 100644 --- a/iotilecore/setup.py +++ b/iotilecore/setup.py @@ -82,6 +82,7 @@ setup( author_email="info@arch-iot.com", url="https://github.com/iotile/coretools/iotilecore", keywords=["iotile", "arch", "embedded", "hardware"], + python_requires=">=3.5, <4", classifiers=[ "Programming Language :: Python", "Development Status :: 5 - Production/Stable", diff --git a/iotilecore/version.py b/iotilecore/version.py index <HASH>..<HASH> 100644 --- a/iotilecore/version.py +++ b/iotilecore/version.py @@ -1 +1 @@ -version = "4.0.0" +version = "4.0.1"
Fix the new major release version to actually enforce py3
iotile_coretools
train
md,py,py
497244b93e70ef02dbe52e651230675d79e9d2e9
diff --git a/src/errors.js b/src/errors.js index <HASH>..<HASH> 100644 --- a/src/errors.js +++ b/src/errors.js @@ -12,6 +12,7 @@ export class SassDocError extends Error { export class Warning extends SassDocError { constructor(message) { super(message); + this.message = message; // rm when native class support. } get name() {
Bring back property inheritance workaround - Introduced with the Babel <I>.* upgrade
SassDoc_sassdoc
train
js
d16c597850eb454caf99c13f286b13926414a452
diff --git a/Kwf/Assets/Provider/CssByJs.php b/Kwf/Assets/Provider/CssByJs.php index <HASH>..<HASH> 100644 --- a/Kwf/Assets/Provider/CssByJs.php +++ b/Kwf/Assets/Provider/CssByJs.php @@ -15,7 +15,7 @@ class Kwf_Assets_Provider_CssByJs extends Kwf_Assets_Provider_Abstract $fn = $dependency->getFileNameWithType(); $match = false; foreach ($this->_paths as $p) { - if (substr($p, 0, strpos($p, '/')) == substr($fn, 0, strpos($fn, '/'))) { + if ($p == substr($fn, 0, strlen($p))) { $match = true; } }
don't just use type of path, use whole path to activate cssbyjs
koala-framework_koala-framework
train
php
8c00e9421becdafb332faeeb810221d53c620742
diff --git a/plugins/oauth/server/providers/base.py b/plugins/oauth/server/providers/base.py index <HASH>..<HASH> 100644 --- a/plugins/oauth/server/providers/base.py +++ b/plugins/oauth/server/providers/base.py @@ -111,8 +111,8 @@ class ProviderBase(model_importer.ModelImporter): resp.raise_for_status() except requests.HTTPError: raise RestException( - 'Got %s from %s, response="%s".' % ( - resp.status_code, kwargs['url'], content + 'Got %s code from provider, response="%s".' % ( + resp.status_code, content ), code=502) try:
Fix a small security issue in OAuth This prevents possibly private information from leaking in an error message.
girder_girder
train
py
f17131afe4965fbde6ad5b6715e6e51759d41d6e
diff --git a/src/JmesPath/Parser.php b/src/JmesPath/Parser.php index <HASH>..<HASH> 100644 --- a/src/JmesPath/Parser.php +++ b/src/JmesPath/Parser.php @@ -397,18 +397,7 @@ class Parser private function parse_T_LBRACE(array $token) { $token = $this->match(array(Lexer::T_IDENTIFIER => true, Lexer::T_NUMBER => true)); - $value = $token['value']; - $nextToken = $this->peek(); - - if ($nextToken['type'] == Lexer::T_RBRACE && - ($token['type'] == Lexer::T_NUMBER || $token['type'] == Lexer::T_IDENTIFIER) - ) { - // A simple index extraction - $this->stack[] = array('field', $value); - $this->nextToken(); - } else { - $this->parseMultiBrace($token); - } + $this->parseMultiBrace($token); } private function parseMultiBracket(array $token)
Removing simple token extraction from multi-select-hash because it is invalid
jmespath_jmespath.php
train
php