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
7b91e1f8508cfc7d4943e834bc27982bb2e6e82b
diff --git a/src/Utils.php b/src/Utils.php index <HASH>..<HASH> 100644 --- a/src/Utils.php +++ b/src/Utils.php @@ -680,9 +680,10 @@ class Utils 'Arg absolutePath contains . or .. directory part[' . $existing . '].' ); } - if (!mkdir($existing, $mode)) { + if (!file_exists($existing) && !mkdir($existing, $mode)) { + // @todo: We shouldn't need to ask file_exists() here. throw new \RuntimeException( - 'Failed to create dir[' . $existing . '] with mode[' . decoct($mode) . '.' + 'Failed to create dir[' . $existing . '] with mode[' . decoct($mode) . '].' ); } if ($group_write && !chmod($existing, $mode)) {
ensurePath() fixed, however not pretty.
simplecomplex_php-utils
train
php
f1240f08c1a4da26ee75d8d7b79426573987ce0d
diff --git a/autograd/container_types.py b/autograd/container_types.py index <HASH>..<HASH> 100644 --- a/autograd/container_types.py +++ b/autograd/container_types.py @@ -110,6 +110,15 @@ def dict_untake(x, idx, template): dict_untake.defvjp(lambda g, ans, vs, gvs, x, idx, template : dict_take(g, idx)) dict_untake.defvjp_is_zero(argnums=(1, 2)) +def make_dict(pairs): + keys, vals = zip(*pairs) + return _make_dict(make_list(*keys), make_list(*vals)) +@primitive +def _make_dict(keys, vals): + return dict(zip(keys, vals)) +_make_dict.defvjp(lambda g, ans, vs, gvs, keys, vals: [g[key] for key in keys], + argnum=1) + class DictVSpace(VSpace): def __init__(self, value): self.shape = {k : vspace(v) for k, v in iteritems(value)}
add container_types.make_dict, c.f. #<I> no tests (since there are no tests for make_list or make_tuple either, though we probably should add some)
HIPS_autograd
train
py
c11651462fe14149a1660ac7bdb1ac6ef331b590
diff --git a/PromiseFileReader.js b/PromiseFileReader.js index <HASH>..<HASH> 100644 --- a/PromiseFileReader.js +++ b/PromiseFileReader.js @@ -5,7 +5,7 @@ function readAs (file, as) { return new Promise(function(resolve, reject) { const reader = new FileReader() reader.onload = function(e) { resolve(e.target.result) } - reader.onerror = function(e) { reject('Error reading' + file.name + ': ' + e.target.result) } + reader.onerror = function(e) { reject(new Error('Error reading' + file.name + ': ' + e.target.result)) } reader['readAs' + as](file) }) }
Reject with Error instance (#7)
jahredhope_promise-file-reader
train
js
1b3704135958ca119e7106a7ea2a05e2d0cf4b56
diff --git a/src/BackgroundProcess.php b/src/BackgroundProcess.php index <HASH>..<HASH> 100644 --- a/src/BackgroundProcess.php +++ b/src/BackgroundProcess.php @@ -64,7 +64,7 @@ class BackgroundProcess if(count(preg_split("/\n/", $result)) > 2) { return true; } - } catch(Exception $e) {} + } catch(\Exception $e) {} return false; } @@ -81,7 +81,7 @@ class BackgroundProcess if (!preg_match('/No such process/', $result)) { return true; } - } catch (Exception $e) {} + } catch (\Exception $e) {} return false; }
Fix for calling Exception from within a namespace Calling the Exception class from within a namespace has php assuming Exception is a class belonging to the namespace, can be fixed by prepending the class name with "\".
cocur_background-process
train
php
b4ac7924b0859cf92e82a1ada224216d5b748676
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -70,17 +70,22 @@ function telekit_cmd(telekit) { let command = parse(context.update); if (command) { - if (command.entities[0].type == 'bot_command') { - context.isCommand = true; - context.command = command; + command.name = command.entities[0].name; + command.mention = command.entities[0].mention; - telekit.emit('command', context); - telekit.emit(`/${context.command.entities[0].name}`, context); - if (telekit.command) telekit.command(context); - telekit.middleware.transmit('command', context); + context.isCommand = true; + context.command = command; - return; + telekit.emit('command', context); + telekit.emit(`/${context.command.entities[0].name}`, context); + + if (telekit.command) { + telekit.command(context); } + + telekit.middleware.transmit('command', context); + + return; } context.isCommand = false;
Changed: now `command` has access to first entity into `command.name` and `command.mention`
telekits_telekit-cmd
train
js
4eaf67fcbe9e17d041d409a2878c66f5d0802ee7
diff --git a/lib/seory/runtime.rb b/lib/seory/runtime.rb index <HASH>..<HASH> 100644 --- a/lib/seory/runtime.rb +++ b/lib/seory/runtime.rb @@ -1,5 +1,6 @@ # TODO move somewhere require 'active_support/all' +require 'seory' module Seory class Runtime @@ -12,6 +13,10 @@ module Seory @controller = controller end + def assigns(name) + @controller.view_assigns[name.to_s] + end + Seory::CONTENTS.each do |name| define_method(name) { calculate_content_for(name) } end diff --git a/spec/seory/runtime_spec.rb b/spec/seory/runtime_spec.rb index <HASH>..<HASH> 100644 --- a/spec/seory/runtime_spec.rb +++ b/spec/seory/runtime_spec.rb @@ -36,4 +36,14 @@ describe Seory::Runtime do specify { expect(seory.title).to eq 'EDIT | My Site' } end end + + context 'Access controller assigns(instance variables)' do + before do + allow(controller).to receive(:view_assigns).and_return('products' => [:products] * 42) + + page_contents.define(:title) { "Good Shop with #{assigns(:products).size} products!" } + end + + specify { expect(seory.title).to eq 'Good Shop with 42 products!' } + end end
Add Runtime#assigns() to access controller ivar
esminc_seory
train
rb,rb
18e6a75f3edda53fd7f26d3207e57b8e158f44ce
diff --git a/lib/GoCardless/Bill.php b/lib/GoCardless/Bill.php index <HASH>..<HASH> 100644 --- a/lib/GoCardless/Bill.php +++ b/lib/GoCardless/Bill.php @@ -75,22 +75,4 @@ class GoCardless_Bill { } - /** - * Create a bill under an existing pre-auth - * - * @param array $params Parameters to use to create the bill - * - * @return object The result of the cancel query - */ - public function create($params) { - - $endpoint = self::$endpoint; - - $params['http_authorization'] = true; - - return new self($this->client, $this->client->request('post', $endpoint, - $params)); - - } - }
Remove unnecessary create function from Bill class Bills must be created under a preauth so use the create_bill method of the PreAuthorization class
gocardless_gocardless-legacy-php
train
php
81748b00bb5ff1cdfbcfe3ce2e8d5e4961a09dce
diff --git a/src/share/classes/com/sun/tools/javac/file/Locations.java b/src/share/classes/com/sun/tools/javac/file/Locations.java index <HASH>..<HASH> 100644 --- a/src/share/classes/com/sun/tools/javac/file/Locations.java +++ b/src/share/classes/com/sun/tools/javac/file/Locations.java @@ -327,7 +327,9 @@ public class Locations { */ protected LocationHandler(Location location, OptionName... options) { this.location = location; - this.options = EnumSet.copyOf(Arrays.asList(options)); + this.options = options.length == 0 ? + EnumSet.noneOf(OptionName.class): + EnumSet.copyOf(Arrays.asList(options)); } // TODO: TEMPORARY, while Options still used for command line options
<I>: Java SE build fails on call to CreateSymbols Reviewed-by: jjg
wmdietl_jsr308-langtools
train
java
f74180e431bd7617db7d535c08ffb8fc3ba371d3
diff --git a/test/ExerciseRunner/CgiRunnerTest.php b/test/ExerciseRunner/CgiRunnerTest.php index <HASH>..<HASH> 100644 --- a/test/ExerciseRunner/CgiRunnerTest.php +++ b/test/ExerciseRunner/CgiRunnerTest.php @@ -351,7 +351,7 @@ class CgiRunnerTest extends PHPUnit_Framework_TestCase $this->expectOutputString($exp); $success = $this->runner->run( - new Input('app', ['program' => '']), + new Input('app', ['program' => 'not-existing-file.php']), $output ); $this->assertFalse($success);
Some PHP versions are printing warnings if empty filename passed to cgi
php-school_php-workshop
train
php
ca02043194c7f464e65559347bc6ee2539554762
diff --git a/src/compiler/codegen/events.js b/src/compiler/codegen/events.js index <HASH>..<HASH> 100644 --- a/src/compiler/codegen/events.js +++ b/src/compiler/codegen/events.js @@ -36,10 +36,10 @@ const modifierCode: { [key: string]: string } = { export function genHandlers ( events: ASTElementHandlers, - native: boolean, + isNative: boolean, warn: Function ): string { - let res = native ? 'nativeOn:{' : 'on:{' + let res = isNative ? 'nativeOn:{' : 'on:{' for (const name in events) { const handler = events[name] // #5330: warn click.right, since right clicks do not actually fire click events.
avoid using native as identifier (close #<I>)
IOriens_wxml-transpiler
train
js
ab49a6415ba653ba4949bb2bbde5b10c49e4cf7b
diff --git a/autofit/optimize/non_linear/non_linear.py b/autofit/optimize/non_linear/non_linear.py index <HASH>..<HASH> 100644 --- a/autofit/optimize/non_linear/non_linear.py +++ b/autofit/optimize/non_linear/non_linear.py @@ -61,11 +61,6 @@ class NonLinearOptimizer(object): conf.instance.general.get('output', 'log_level', str).replace(" ", "").upper()] try: - os.makedirs(self.image_path) - except FileExistsError: - pass - - try: os.makedirs(self.pdf_path) except FileExistsError: pass
don't make image_path dirs in nonlinear
rhayes777_PyAutoFit
train
py
733f2e9ca49912fb7c0f4ad79f5d274ca6717c9c
diff --git a/libraries/mako/Arr.php b/libraries/mako/Arr.php index <HASH>..<HASH> 100644 --- a/libraries/mako/Arr.php +++ b/libraries/mako/Arr.php @@ -147,6 +147,23 @@ class Arr { return (bool) count(array_filter(array_keys($array), 'is_string')); } + + /** + * Returns an array of values from an array. + * + * @access public + * @param array $array Array to pluck from + * @param string $key Array key + * @return array + */ + + public static function pluck(array $array, $key) + { + return array_map(function($value) use ($key) + { + return is_object($value) ? $value->$key : $value[$key]; + }, $array); + } } /** -------------------- End of file --------------------**/ \ No newline at end of file
Added Arr::pluck
mako-framework_framework
train
php
6e4370ec91659c6b8dc597c645b2d5152713dba5
diff --git a/src/AccessControl/Authentication.php b/src/AccessControl/Authentication.php index <HASH>..<HASH> 100644 --- a/src/AccessControl/Authentication.php +++ b/src/AccessControl/Authentication.php @@ -482,6 +482,27 @@ class Authentication } /** + * Hash or unset a password value from the user entity. + * + * @param Entity\Users $userEntity + * + * @return Entity\Users + */ + public function hashUserPassword(Entity\Users $userEntity) + { + if ($userEntity->getPassword() && $userEntity->getPassword() !== '**dontchange**') { + // Hashstrength has a default of '10', don't allow less than '8'. + $hashStrength = max($this->app['config']->get('general/hash_strength'), 8); + $hasher = new PasswordHash($hashStrength, true); + $userEntity->setPassword($hasher->HashPassword($userEntity->getPassword())); + } else { + unset($userEntity->password); + } + + return $userEntity; + } + + /** * Log out the currently logged in user. * * @return boolean
Make a public hashUserPassword() function available in app['authentication']
bolt_bolt
train
php
24398dd4ccc934703a166f309e29ee166020c0f0
diff --git a/master/buildbot/db/connector.py b/master/buildbot/db/connector.py index <HASH>..<HASH> 100644 --- a/master/buildbot/db/connector.py +++ b/master/buildbot/db/connector.py @@ -318,19 +318,6 @@ class DBConnector(service.MultiService): # BuildRequest-manipulation methods - def get_buildername_for_brid(self, brid): - assert isinstance(brid, (int, long)) - return self.runInteractionNow(self._txn_get_buildername_for_brid, brid) - def _txn_get_buildername_for_brid(self, t, brid): - assert isinstance(brid, (int, long)) - t.execute(self.quoteq("SELECT buildername FROM buildrequests" - " WHERE id=?"), - (brid,)) - r = t.fetchall() - if not r: - return None - return r[0][0] - # used by BuildRequestStatus.getBuilds def get_buildnums_for_brid(self, brid): return self.runInteractionNow(self._txn_get_buildnums_for_brid, brid)
remove now-unused get_buildername_for_brid
buildbot_buildbot
train
py
0f79d988b5a72e38fb4ea09b68cab190efe1e189
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,10 +1,7 @@ require "simplecov" require "codeclimate-test-reporter" -unless ENV["SKIP_CODE_CLIMATE_TEST_REPORTER"] == "true" - CodeClimate::TestReporter.start -end - +CodeClimate::TestReporter.start SimpleCov.formatter = SimpleCov::Formatter::MultiFormatter[ SimpleCov::Formatter::HTMLFormatter ]
Removing unnecessary test from spec_helper
myfreecomm_emites-client-ruby
train
rb
ad0ebba054078429805bb461c5b3064f325a0575
diff --git a/packages/spark-core/test/integration/spec/plugins/credentials.js b/packages/spark-core/test/integration/spec/plugins/credentials.js index <HASH>..<HASH> 100644 --- a/packages/spark-core/test/integration/spec/plugins/credentials.js +++ b/packages/spark-core/test/integration/spec/plugins/credentials.js @@ -197,6 +197,29 @@ describe(`spark-core`, function() { }); + describe(`when the api responds with a 401`, () => { + it(`refreshes the access token`, () => { + const spark = new Spark({ + credentials: { + authorization: user.token + } + }); + const initialToken = user.token; + // eslint-disable-next-line camelcase + spark.credentials.authorization.access_token = `invalid`; + spark.request({ + service: `conversation`, + method: `GET`, + resource: `build_info` + }) + .then((res) => { + assert.equal(res.statusCode, 200); + assert.notEqual(spark.credentials.authorization.apiToken.access_token, initialToken); + }); + + }); + }); + }); }); });
test(spark-core): prove that token refresh works
webex_spark-js-sdk
train
js
62f90e68cdabf8fa1266d283b70d8e81b48b3a34
diff --git a/pkglib/pkglib/setuptools/command/depgraph.py b/pkglib/pkglib/setuptools/command/depgraph.py index <HASH>..<HASH> 100644 --- a/pkglib/pkglib/setuptools/command/depgraph.py +++ b/pkglib/pkglib/setuptools/command/depgraph.py @@ -142,7 +142,7 @@ class depgraph(Command, CommandMixin): else: import networkx g = networkx.DiGraph() - dependency.get_requirements_from_ws(working_set, g) + dependency.get_graph_from_ws(working_set, g) if self.what_requires is not None: g = self._filter_nodes_leading_to(g, self.what_requires)
Fixing incorrect name due to using old AHL name.
manahl_pytest-plugins
train
py
9b43eb93ce9b408f98657d9d6a1b9eaffd2675c7
diff --git a/lib/jsduck/render/subproperties.rb b/lib/jsduck/render/subproperties.rb index <HASH>..<HASH> 100644 --- a/lib/jsduck/render/subproperties.rb +++ b/lib/jsduck/render/subproperties.rb @@ -55,6 +55,7 @@ module JsDuck "<span class='pre'>#{p[:name]}</span> : ", p[:html_type], p[:optional] ? " (optional)" : "", + p[:new] ? render_new : "", "<div class='sub-desc'>", p[:doc], p[:default] ? "<p>Defaults to: <code>#{Util::HTML.escape(p[:default])}</code></p>" : "", @@ -65,6 +66,17 @@ module JsDuck ] end + def render_new + signature = TagRegistry.get_by_name(:new).signature + return [ + "<span class='signature'>", + "<span class='new' title='#{signature[:tooltip]}'>", + signature[:long], + "</span>", + "</span>", + ] + end + def render_since(param) TagRegistry.get_by_name(:since).to_html(param) end
Display @new star next to new parameters.
senchalabs_jsduck
train
rb
61e4f6f55271d3687d29dee410253123d851ea73
diff --git a/test/src/test/java/hudson/tasks/junit/JUnitResultArchiverTest.java b/test/src/test/java/hudson/tasks/junit/JUnitResultArchiverTest.java index <HASH>..<HASH> 100644 --- a/test/src/test/java/hudson/tasks/junit/JUnitResultArchiverTest.java +++ b/test/src/test/java/hudson/tasks/junit/JUnitResultArchiverTest.java @@ -37,6 +37,7 @@ import org.jvnet.hudson.test.recipes.LocalData; import com.gargoylesoftware.htmlunit.html.HtmlForm; import com.gargoylesoftware.htmlunit.html.HtmlPage; import static org.junit.Assert.*; +import org.junit.Assume; import org.junit.Before; import org.junit.Rule; import org.junit.Test; @@ -76,6 +77,7 @@ public class JUnitResultArchiverTest { @LocalData @Test public void slave() throws Exception { + Assume.assumeFalse("TimeoutException from basic", "https://jenkins.ci.cloudbees.com/job/core/job/jenkins_main_trunk/".equals(System.getenv("JOB_URL"))); DumbSlave s = j.createOnlineSlave(); project.setAssignedLabel(s.getSelfLabel());
Skipping slave test on PR builder since it often fails.
jenkinsci_jenkins
train
java
3e5e6c60d5608a1bd4a8cb5c2b558fcb168b45db
diff --git a/includes/extras/functions.en.php b/includes/extras/functions.en.php index <HASH>..<HASH> 100644 --- a/includes/extras/functions.en.php +++ b/includes/extras/functions.en.php @@ -44,8 +44,3 @@ function ordinal_suffix_en($n) { return 'rd'; return 'th'; } - -function century_localisation_en($n) { - return $n.ordinal_suffix_en($n); -} -?> diff --git a/includes/extras/functions.pl.php b/includes/extras/functions.pl.php index <HASH>..<HASH> 100644 --- a/includes/extras/functions.pl.php +++ b/includes/extras/functions.pl.php @@ -194,18 +194,3 @@ function getFirstRelationsName_pl($pid) { if (!empty($pname)) return trim($pname); else return $fname; } - -function century_localisation_pl($n, $show=true) { - $arab = array(1, 4, 5, 9, 10); - $roman = array("I", "IV", "V", "IX", "X"); - $roman_century = ""; - for ($i=4; $i>=0; $i--) { - while ($n>=$arab[$i]) { - $n-=$arab[$i]; - $roman_century .= $roman[$i]; - } - } - if ($show) return $roman_century." w."; - else return $roman_century; -} -?>
Remove old century_localisation_XX functions. This is now translated using gettext()
fisharebest_webtrees
train
php,php
f43d84b5819ba07334996a52ca8cf9027754e8d6
diff --git a/src/elements/db/SuperTableBlockQuery.php b/src/elements/db/SuperTableBlockQuery.php index <HASH>..<HASH> 100644 --- a/src/elements/db/SuperTableBlockQuery.php +++ b/src/elements/db/SuperTableBlockQuery.php @@ -10,6 +10,7 @@ use Craft; use craft\base\Element; use craft\base\ElementInterface; use craft\base\Field; +use craft\db\Table; use craft\db\Query; use craft\elements\db\ElementQuery; use craft\helpers\Db; @@ -272,6 +273,17 @@ class SuperTableBlockQuery extends ElementQuery $this->subQuery->andWhere(Db::parseParam('supertableblocks.typeId', $this->typeId)); } + // Ignore revision/draft blocks by default + if (!$this->id && !$this->ownerId) { + // todo: we will need to expand on this when Super Table blocks can be nested. + $this->subQuery + ->innerJoin(Table::ELEMENTS . ' owners', '[[owners.id]] = [[supertableblocks.ownerId]]') + ->andWhere([ + 'owners.draftId' => null, + 'owners.revisionId' => null, + ]); + } + return parent::beforePrepare(); }
Block queries no longer include blocks owned by drafts or revisions by default.
verbb_super-table
train
php
bcb3a329e1fa88f90f64280aa4c6522032e5321f
diff --git a/ipyxact/ipxact_yaml.py b/ipyxact/ipxact_yaml.py index <HASH>..<HASH> 100644 --- a/ipyxact/ipxact_yaml.py +++ b/ipyxact/ipxact_yaml.py @@ -66,6 +66,12 @@ enumeratedValue: enumeratedValues: CHILDREN: - enumeratedValue +reset: + MEMBERS: + value: IpxactInt +resets: + CHILD: + - reset field: MEMBERS: name: str @@ -73,9 +79,12 @@ field: bitOffset: IpxactInt bitWidth: IpxactInt modifiedWriteValue: str + readAction: str testable: str volatile: IpxactBool access: str + CHILD: + - resets CHILDREN: - enumeratedValues file:
Additional fields in YAML was added
olofk_ipyxact
train
py
30bf61a49a83fdcb48fbf8580bd8ed001498180b
diff --git a/identify/identify.py b/identify/identify.py index <HASH>..<HASH> 100644 --- a/identify/identify.py +++ b/identify/identify.py @@ -136,7 +136,7 @@ def parse_shebang(bytesio): return () first_line = bytesio.readline() try: - first_line = first_line.decode('US-ASCII') + first_line = first_line.decode('UTF-8') except UnicodeDecodeError: return ()
Use UTF-8 to decode the shebang line
chriskuehl_identify
train
py
4187d47a7fb7eb7ab720a27f0e0ef8617c4b353a
diff --git a/packages/origin.js/src/ipfs-service.js b/packages/origin.js/src/ipfs-service.js index <HASH>..<HASH> 100644 --- a/packages/origin.js/src/ipfs-service.js +++ b/packages/origin.js/src/ipfs-service.js @@ -87,8 +87,15 @@ class IpfsService { reject('Got ipfs cat stream err:' + err) }) stream.on('end', () => { - this.mapCache.set(ipfsHashStr, res) - resolve(res) + let parsedResponse; + try { + parsedResponse = JSON.parse(res) + } catch (error) { + reject(`Failed to parse response JSON: ${error}`) + return; + } + this.mapCache.set(ipfsHashStr, parsedResponse) + resolve(parsedResponse) }) }) })
Parse JSON after retrieving from IPFS
OriginProtocol_origin-js
train
js
1611b0bf4b302b089ceb417b03ee9164afd6151e
diff --git a/src/test/java/org/jbake/template/ModelExtractorsTest.java b/src/test/java/org/jbake/template/ModelExtractorsTest.java index <HASH>..<HASH> 100644 --- a/src/test/java/org/jbake/template/ModelExtractorsTest.java +++ b/src/test/java/org/jbake/template/ModelExtractorsTest.java @@ -91,13 +91,13 @@ public class ModelExtractorsTest { ModelExtractors.getInstance().registerExtractorsForCustomTypes(newDocumentType); //expect: - assertThat(ModelExtractors.getInstance().keySet().size()).isEqualTo(16); + assertThat(ModelExtractors.getInstance().keySet().size()).isEqualTo(17); //when: ModelExtractors.getInstance().reset(); //then: - assertThat(ModelExtractors.getInstance().keySet().size()).isEqualTo(14); + assertThat(ModelExtractors.getInstance().keySet().size()).isEqualTo(15); } }
Updated ModelExtractorsTest to reflect the new model extractor being that has been added.
jbake-org_jbake
train
java
ede46956e54e173a0ac3ec6f936f15e7a924dd33
diff --git a/spec/unit/api_spec.rb b/spec/unit/api_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/api_spec.rb +++ b/spec/unit/api_spec.rb @@ -43,7 +43,7 @@ describe WebMock::API do end end - context "when args are an emtpy hash" do + context "when args are an empty hash" do subject {klass.new.hash_including({})} it "creates 'HashIncludingMatcher' with an empty hash" do @@ -72,4 +72,4 @@ describe WebMock::API do end end -end \ No newline at end of file +end
Tweaked a spelling mistake in a test context
bblimke_webmock
train
rb
f1e56d5e4ee4272676d70e53ac07d14f7199db61
diff --git a/src/RestResources/Users/MeResource.php b/src/RestResources/Users/MeResource.php index <HASH>..<HASH> 100644 --- a/src/RestResources/Users/MeResource.php +++ b/src/RestResources/Users/MeResource.php @@ -22,18 +22,16 @@ use Rhubarb\Scaffolds\Saas\Landlord\LoginProviders\SaasLoginProvider; class MeResource extends UserResource { - private $user; - - public function __construct($resourceIdentifier = null, $parentResource = null) + public function __construct($parentResource = null) { - parent::__construct($resourceIdentifier, $parentResource); + parent::__construct($parentResource); // If the user is authenticated we can simply get the logged in model. Otherwise this // will throw an exception. $login = new SaasLoginProvider(); - $this->user = $login->getModel(); + $this->model = $login->getModel(); - $this->_id = $this->user->UniqueIdentifier; + $this->_id = $this->model->UniqueIdentifier; } protected function getColumns() @@ -43,9 +41,4 @@ class MeResource extends UserResource return $columns; } - - public function getModel() - { - return $this->user; - } } \ No newline at end of file
fix for me resource returnign a collection?
RhubarbPHP_Scaffold.Saas.Landlord
train
php
75700cdfbafdbb599bb37aa0f6f443e15db709f4
diff --git a/scan/lib/scan/version.rb b/scan/lib/scan/version.rb index <HASH>..<HASH> 100644 --- a/scan/lib/scan/version.rb +++ b/scan/lib/scan/version.rb @@ -1,4 +1,4 @@ module Scan - VERSION = "0.10.1" + VERSION = "0.11.0" DESCRIPTION = "The easiest way to run tests of your iOS and Mac app" end
[scan] Version bump (#<I>) * [scan] Version bump * [scan] Add automatic detection of derived data path (#<I>) * [scan] Skip showing GitHub issues for build errors (#<I>) * [scan] Version bump
fastlane_fastlane
train
rb
2b9a7507b9d622ba2b3398f1636768aa2eb96ef1
diff --git a/packages/@vue/cli-service/generator/index.js b/packages/@vue/cli-service/generator/index.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli-service/generator/index.js +++ b/packages/@vue/cli-service/generator/index.js @@ -66,4 +66,9 @@ module.exports = (api, options) => { devDependencies: deps[options.cssPreprocessor] }) } + + // additional tooling configurations + if (options.configs) { + api.extendPackage(options.configs) + } } diff --git a/packages/@vue/cli/lib/options.js b/packages/@vue/cli/lib/options.js index <HASH>..<HASH> 100644 --- a/packages/@vue/cli/lib/options.js +++ b/packages/@vue/cli/lib/options.js @@ -15,7 +15,8 @@ const presetSchema = createSchema(joi => joi.object().keys({ router: joi.boolean(), vuex: joi.boolean(), cssPreprocessor: joi.string().only(['sass', 'less', 'stylus']), - plugins: joi.object().required() + plugins: joi.object().required(), + configs: joi.object() })) const schema = createSchema(joi => joi.object().keys({
feat: allow specifying additional configs in preset
vuejs_vue-cli
train
js,js
6925ee4035f5b78c0c6ccd1413d02e24a2a163e6
diff --git a/docs/build/search.js b/docs/build/search.js index <HASH>..<HASH> 100644 --- a/docs/build/search.js +++ b/docs/build/search.js @@ -25,7 +25,7 @@ const createFolder = (folder) => { } const createIndex = (data) => { - const requiredFields = [ levelName + '0', levelName + '1', 'url' ] + const requiredFields = [ levelName + '0', 'url' ] const missingFields = requiredFields.filter( (requiredField) => !data[ requiredField ] ) @@ -275,8 +275,7 @@ const processChildren = (parent, entry, entries, level) => { const processMenuItem = (menuItem, entries, level = 0) => { const entryItem = { - [ levelName + '0' ]: 'Documentation', - [ levelName + '1' ]: menuItem.name, + [ levelName + level ]: menuItem.name, content: '', anchor: '', url: '/' + menuItem.path
feat(docs): additional change to search
quasarframework_quasar
train
js
0db7467b4cbec4f89ce05b54ab626ddae4a069e6
diff --git a/constructs/digraph.py b/constructs/digraph.py index <HASH>..<HASH> 100644 --- a/constructs/digraph.py +++ b/constructs/digraph.py @@ -55,18 +55,24 @@ class DirectedGraph(object): else: yield (u, v) - def successors_iter(self, node): + def successors_iter(self, node, include_data=False): if not self.has_node(node): raise ValueError("Node %r not found" % (node)) - for succ in six.iterkeys(self._adj[node]): - yield succ + for (succ, data) in six.iteritems(self._adj[node]): + if include_data: + yield (succ, data) + else: + yield succ - def predecessors_iter(self, node): + def predecessors_iter(self, node, include_data=False): if not self.has_node(node): raise ValueError("Node %r not found" % (node)) for (pred, connected_to) in six.iteritems(self._adj): if node in connected_to: - yield pred + if include_data: + yield (pred, connected_to[node]) + else: + yield pred def remove_node(self, node): if not self.has_node(node):
Allow pred/succ to return data
harlowja_constructs
train
py
91824816c1caaf489425217f96e287fb83a8e1a2
diff --git a/docs/source/conf.py b/docs/source/conf.py index <HASH>..<HASH> 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -14,6 +14,8 @@ import os +import haas._version + # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. @@ -57,9 +59,9 @@ copyright = u'2013-2014, Simon Jagoe' # built documents. # # The short X.Y version. -version = '0.5' +version = haas._version.version # The full version, including alpha/beta/rc tags. -release = '0.5.0.dev' +release = haas._version.full_version # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages.
use generated version in docs config
scalative_haas
train
py
416b89ccd04a00ad3fe641bf900fdccdd5d32cc5
diff --git a/src/Core/Router.php b/src/Core/Router.php index <HASH>..<HASH> 100644 --- a/src/Core/Router.php +++ b/src/Core/Router.php @@ -218,6 +218,7 @@ class Router case HttpMethods::PATCH: $data = $this->cypher->decode(file_get_contents('php://input')); parse_str($data, $patchData); + $patchData = array_merge($_GET, $patchData); return $patchData ?: []; break;
add get params in post request
php-rest-server_core
train
php
39172303ce3bddaf3c352f18560a7dbaa83b16d8
diff --git a/c7n/resources/asg.py b/c7n/resources/asg.py index <HASH>..<HASH> 100644 --- a/c7n/resources/asg.py +++ b/c7n/resources/asg.py @@ -31,7 +31,7 @@ from c7n.filters import ( from c7n.manager import resources from c7n.query import QueryResourceManager -from c7n.offhours import Time, OffHour, OnHour +from c7n.offhours import OffHour, OnHour from c7n.tags import TagActionFilter, DEFAULT_TAG, TagCountFilter, TagTrim from c7n.utils import ( local_session, query_instances, type_schema, chunks, get_retry) @@ -41,8 +41,6 @@ log = logging.getLogger('custodian.asg') filters = FilterRegistry('asg.filters') actions = ActionRegistry('asg.actions') - -filters.register('time', Time) filters.register('offhour', OffHour) filters.register('onhour', OnHour) filters.register('tag-count', TagCountFilter)
get rid of time filter, it wasnt usable directly and was causing overly lax schema validation (#<I>)
cloud-custodian_cloud-custodian
train
py
f2f499291e8536d5996208df370095393a36c0f9
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -322,7 +322,7 @@ slackAPI.prototype.getSlackData = function() { }; slackAPI.prototype.sendTyping = function(channel) { - sendSock({'type': 'typing', channel: channel}); + this.sendSock({'type': 'typing', channel: channel}); return this; };
Fixed issue with sendTyping prototype method
xBytez_slackbotapi
train
js
87d6f36e370c98f2f42af900f098a3f18db82eda
diff --git a/lib/softlayer/NetworkStorage.rb b/lib/softlayer/NetworkStorage.rb index <HASH>..<HASH> 100644 --- a/lib/softlayer/NetworkStorage.rb +++ b/lib/softlayer/NetworkStorage.rb @@ -260,24 +260,13 @@ module SoftLayer end if options_hash[:network_storage_server_type] - [ :datacenter, :domain, :hostname ].each do |option| + [ :datacenter, :domain, :hostname, :tags ].each do |option| if options_hash[option] network_storage_object_filter.modify do |filter| filter.accept(option_to_filter_path[option].call(network_storage_type, options_hash[:network_storage_server_type])).when_it is(options_hash[option]) end end end - - if options_hash[:tags] - network_storage_object_filter.set_criteria_for_key_path(option_to_filter_path[:tags].call(network_storage_type, options_hash[:network_storage_server_type]), - { - 'operation' => 'in', - 'options' => [{ - 'name' => 'data', - 'value' => options_hash[:tags].collect{ |tag_value| tag_value.to_s } - }] - }) - end end account_service = softlayer_client[:Account]
Update ObjectFilter usage in NetworkStorage to accommodate the new object filters that was missed in the last round of cleanup
softlayer_softlayer-ruby
train
rb
433cd46d4e1d58a8dad6d05540f7dc236edf8d4a
diff --git a/examples/fluidsim/fluidsim.py b/examples/fluidsim/fluidsim.py index <HASH>..<HASH> 100644 --- a/examples/fluidsim/fluidsim.py +++ b/examples/fluidsim/fluidsim.py @@ -79,11 +79,12 @@ def plot_matrix(ax, mat, t, render=False): if __name__ == '__main__': simulation_timesteps = 100 + basepath = os.path.dirname(__file__) print("Loading initial and target states...") - init_smoke = imread('init_smoke.png')[:,:,0] + init_smoke = imread(os.path.join(basepath, 'init_smoke.png'))[:,:,0] #target = imread('peace.png')[::2,::2,3] - target = imread('skull.png')[::2,::2] + target = imread(os.path.join(basepath, 'skull.png'))[::2,::2] rows, cols = target.shape init_dx_and_dy = np.zeros((2, rows, cols)).ravel()
make examples/fluidsim/fluidsim.py work by fixing data file path generation
HIPS_autograd
train
py
55238e3b5bbb29dcf252d68239ddf764ecce9c4c
diff --git a/lib/connections/service.go b/lib/connections/service.go index <HASH>..<HASH> 100644 --- a/lib/connections/service.go +++ b/lib/connections/service.go @@ -713,7 +713,7 @@ func (s *service) ConnectionStatus() map[string]ConnectionStatusEntry { } func (s *service) setConnectionStatus(address string, err error) { - if errors.Cause(err) != context.Canceled { + if errors.Cause(err) == context.Canceled { return }
lib/connections: Actually record connection errors (#<I>)
syncthing_syncthing
train
go
6bf3f1ef40822f8aefb3b4d86e177cb0f5d5eedc
diff --git a/src/Illuminate/Support/ClassLoader.php b/src/Illuminate/Support/ClassLoader.php index <HASH>..<HASH> 100644 --- a/src/Illuminate/Support/ClassLoader.php +++ b/src/Illuminate/Support/ClassLoader.php @@ -28,7 +28,7 @@ class ClassLoader { foreach (static::$directories as $directory) { - if (file_exists($path = $directory.'/'.$class)) + if (file_exists($path = $directory.DIRECTORY_SEPARATOR.$class)) { require_once $path;
Using the directory separator consistently through the autoloader.
laravel_framework
train
php
108fed737ccda9347818f584ecb38c3404b7595b
diff --git a/index.php b/index.php index <HASH>..<HASH> 100644 --- a/index.php +++ b/index.php @@ -985,14 +985,6 @@ if ( $show_page_layout ) $tpl->setVariable( "site", $site ); - if ( isset( $tpl_vars ) and is_array( $tpl_vars ) ) - { - foreach( $tpl_vars as $tpl_var_name => $tpl_var_value ) - { - $tpl->setVariable( $tpl_var_name, $tpl_var_value ); - } - } - if ( $ini->variable( 'DebugSettings', 'DisplayDebugWarnings' ) == 'enabled' ) { // Make sure any errors or warnings are reported
Removed: unused code since late <I> Variable $tpl_vars is not defined anymore since 9a<I>b<I>dfa<I>eb<I>f<I>ab9ed<I>c<I>d0fd
ezsystems_ezpublish-legacy
train
php
1b91b0807688845791b068eed086d17666b341e0
diff --git a/src/main/java/hex/gbm/DTree.java b/src/main/java/hex/gbm/DTree.java index <HASH>..<HASH> 100644 --- a/src/main/java/hex/gbm/DTree.java +++ b/src/main/java/hex/gbm/DTree.java @@ -720,7 +720,7 @@ public class DTree extends Iced { if( cm != null && domain != null ) { // Top row of CM assert cm._arr.length==domain.length; - DocGen.HTML.section(sb,"Confusion Matrix"); + DocGen.HTML.title(sb,"Scoring"); if( testKey == null ) { if (_have_cv_results) sb.append("<div class=\"alert\">Reported on ").append(num_folds).append("-fold cross-validated training data</div>"); @@ -734,8 +734,11 @@ public class DTree extends Iced { rs.replace("key", testKey); DocGen.HTML.paragraph(sb,rs.toString()); } - // generate HTML for CM - cm.toHTML(sb, domain); + if (validAUC == null) { //AUC shows the CM already + // generate HTML for CM + DocGen.HTML.section(sb, "Confusion Matrix"); + cm.toHTML(sb, domain); + } } if( errs != null ) {
Avoid displaying the CM twice for binary classifiers.
h2oai_h2o-2
train
java
b43960f909d306098359dc63811f1b496ce7a4ec
diff --git a/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/FlowSockets.js b/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/FlowSockets.js index <HASH>..<HASH> 100644 --- a/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/FlowSockets.js +++ b/structr-ui/src/main/resources/structr/js/flow-editor/src/js/editor/FlowSockets.js @@ -13,7 +13,7 @@ export class FlowSockets { let dataSource = new D3NE.Socket('dataSource', 'Data Source Node', 'The connected node will provide data for this node.'); let dataSources = new D3NE.Socket('dataSources', 'Data Source Nodes', 'The connected nodes will provide data for this node.'); - let dataTarget = new D3NE.Socket('dataTarget', 'Data Target Node', 'Connect to a node\'s prev port.'); + let dataTarget = new D3NE.Socket('dataTarget', 'Data Target Node', 'Connect to a node\'s DataSource port.'); dataTarget.combineWith(dataSource); dataTarget.combineWith(dataSources); this._sockets['dataSource'] = dataSource;
Fixes error in socket description of flow node.
structr_structr
train
js
9544e8227f037931f8a0282185e9bc4139fb8f64
diff --git a/tests/JoliTypo/Tests/FrenchTest.php b/tests/JoliTypo/Tests/FrenchTest.php index <HASH>..<HASH> 100644 --- a/tests/JoliTypo/Tests/FrenchTest.php +++ b/tests/JoliTypo/Tests/FrenchTest.php @@ -8,7 +8,7 @@ class FrenchTest extends \PHPUnit_Framework_TestCase const TOFIX = <<<TOFIX <p>Ceci est à remplacer par une fâble :p</p> -<pre>Oh, du "code"!</pre> +<pre>Oh, du "code" encodé, mais pas double encodé: &amp;!</pre> <p>Le mec a fini sa course en 2'33" contre 2'44" pour le second !</p> @@ -26,7 +26,7 @@ TOFIX; const FIXED = <<<FIXED <p>Ceci est &agrave; remplacer par une f&acirc;ble&nbsp;:p</p> -<pre>Oh, du "code"!</pre> +<pre>Oh, du "code" encod&eacute;, mais pas double encod&eacute;: &amp;!</pre> <p>Le mec a fini sa course en 2'33" contre 2'44" pour le second&nbsp;!</p>
Add a little test on double encoding [\DOMDocument is stressing me]
jolicode_JoliTypo
train
php
bccee9e28325c5f105569f9c21a0e1987c4b0352
diff --git a/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php b/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php index <HASH>..<HASH> 100644 --- a/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php +++ b/lib/Doctrine/DBAL/Migrations/Tools/Console/Command/ExecuteCommand.php @@ -92,7 +92,7 @@ EOT } if ($execute) { - $version->execute($direction, (boolean) $input->getOption('dry-run')); + $version->execute($direction, (boolean) $input->getOption('dry-run'), $timeAllqueries); } else { $output->writeln('<error>Migration cancelled!</error>'); }
fix for bug It was not possible to call the time all queries option with the execute command because the option was not passed to the Version Class.
doctrine_migrations
train
php
9e7e9c69da2091edf2cf9dfa5c1f7bcca045dbb8
diff --git a/lib/strong_migrations.rb b/lib/strong_migrations.rb index <HASH>..<HASH> 100644 --- a/lib/strong_migrations.rb +++ b/lib/strong_migrations.rb @@ -143,7 +143,7 @@ Otherwise, remove the force option.", execute call, so cannot help you here. Please make really sure that what you're doing is safe before proceeding, then wrap it in a safety_assured { ... } block.", - change_column_null: + change_column_null: "Passing a default value to change_column_null runs a single UPDATE query, which can cause downtime. Instead, backfill the existing rows in the Rails console or a separate migration with disable_ddl_transaction!. @@ -156,7 +156,7 @@ class Backfill%{migration_name} < ActiveRecord::Migration%{migration_suffix} end end", - add_foreign_key: + add_foreign_key: "New foreign keys are validated by default. This acquires an AccessExclusiveLock, which is expensive on large tables. Instead, validate it in a separate migration with a more agreeable RowShareLock.
Fixed indentation [skip ci]
ankane_strong_migrations
train
rb
a65cf6cb25c9433057f8b63c59e097e7f9d22108
diff --git a/test/test_ssl.py b/test/test_ssl.py index <HASH>..<HASH> 100644 --- a/test/test_ssl.py +++ b/test/test_ssl.py @@ -6,7 +6,7 @@ Unit tests for L{OpenSSL.SSL}. from sys import platform from socket import socket -from os import makedirs, symlink +from os import makedirs from os.path import join from unittest import main @@ -223,15 +223,13 @@ class ContextTests(TestCase): """ capath = self.mktemp() makedirs(capath) - cafile = join(capath, 'cert.pem') + # Hash value computed manually with c_rehash to avoid depending on + # c_rehash in the test suite. + cafile = join(capath, 'c7adac82.0') fObj = file(cafile, 'w') fObj.write(cleartextCertificatePEM) fObj.close() - # Hash value computed manually with c_rehash to avoid depending on - # c_rehash in the test suite. - symlink('cert.pem', join(capath, 'c7adac82.0')) - self._load_verify_locations_test(None, capath)
Avoid using symlink, since we cannot use it on windows
pyca_pyopenssl
train
py
e83e6a1ad47834a21feb0585c0bd2e25c536d98f
diff --git a/src/generateDoc.js b/src/generateDoc.js index <HASH>..<HASH> 100644 --- a/src/generateDoc.js +++ b/src/generateDoc.js @@ -79,11 +79,15 @@ module.exports = async function generateDoc(pushToGithub) { builtDocs = true; } } + } - if (pushToGithub && builtDocs) { + if (builtDocs) { + console.log('Successfully built docs'); + if (pushToGithub) { await execa('git', ['add', 'docs']); await execa('git', ['commit', '-m', 'doc: rebuild docs [ci skip]']); await execa('git', ['push', 'origin', 'master']); + console.log('Committed and pushed to GitHub'); } } };
fix: also publish custom-built docs
cheminfo_tools
train
js
3372bade0c5aee8c30c507832c842d6533608f61
diff --git a/porunga/tests/test_main.py b/porunga/tests/test_main.py index <HASH>..<HASH> 100644 --- a/porunga/tests/test_main.py +++ b/porunga/tests/test_main.py @@ -9,7 +9,7 @@ class TestManager(unittest.TestCase): manager = get_manager() commands = manager.get_commands() - self.assertIn('test', commands) + self.assertTrue('test' in commands) test_command = commands['test'] - self.assertIsInstance(test_command, PorungaTestCommand) + self.assertTrue(isinstance(test_command, PorungaTestCommand))
Test updated to work with Python <I>
lukaszb_porunga
train
py
c1fc5010f0979da9029c0736246e521dd0c756a7
diff --git a/lib/pkgcloud/core/compute/bootstrapper.js b/lib/pkgcloud/core/compute/bootstrapper.js index <HASH>..<HASH> 100644 --- a/lib/pkgcloud/core/compute/bootstrapper.js +++ b/lib/pkgcloud/core/compute/bootstrapper.js @@ -178,6 +178,11 @@ Bootstrapper.prototype.createServer = function (options) { createOptions.flavor = options.flavorId; } + // XXX(mmalecki): DigitalOcean-specific + if (options.keyIds) { + createOptions.keyIds = options.keyIds; + } + // // Remark: If there are any parameters specific to this // compute provider then set them appropriately before diff --git a/lib/pkgcloud/digitalocean/compute/client/servers.js b/lib/pkgcloud/digitalocean/compute/client/servers.js index <HASH>..<HASH> 100644 --- a/lib/pkgcloud/digitalocean/compute/client/servers.js +++ b/lib/pkgcloud/digitalocean/compute/client/servers.js @@ -115,6 +115,11 @@ exports.createServer = function createServer(options, callback) { ? options.image.id : options.image; + // XXX(mmalecki) Integrate with existing keys API + if (options.keyIds) { + createOptions.qs.ssh_key_ids = options.keyIds.join(','); + } + return this.request(createOptions, function (err, body, res) { return err ? callback(err)
[api] Pass `ssh_key_ids` to DigitalOcean
pkgcloud_pkgcloud
train
js,js
6cf6f0841f3242b6e4d384f967a457d43b21b82f
diff --git a/provider.go b/provider.go index <HASH>..<HASH> 100644 --- a/provider.go +++ b/provider.go @@ -124,6 +124,15 @@ func Provide(c *gin.Context) { return } if task, err := getMesosTask(reqParams.TaskId); err == nil { + if len(task.Statuses) == 0 { + atomic.AddInt32(&state.Stats.Denied, 1) + c.JSON(403, struct { + Status string `json:"status"` + Ok bool `json:"ok"` + Error string `json:"error"` + }{string(state.Status), false, errTaskNotFresh.Error()}) + return + } startTime := time.Unix(0, int64(task.Statuses[len(task.Statuses)-1].Timestamp*1000000000)) if time.Now().Sub(startTime) > config.MaxTaskLife { atomic.AddInt32(&state.Stats.Denied, 1)
If task has no status, deny the request.
nemosupremo_vault-gatekeeper
train
go
bac79745ce352ca32c33e33d3047b0175c2f7532
diff --git a/features/lib/step_definitions/profile_steps.rb b/features/lib/step_definitions/profile_steps.rb index <HASH>..<HASH> 100644 --- a/features/lib/step_definitions/profile_steps.rb +++ b/features/lib/step_definitions/profile_steps.rb @@ -1,5 +1,5 @@ Given /^the following profiles? (?:are|is) defined:$/ do |profiles| - step 'a file named "cucumber.yml" with:', profiles + write_file 'cucumber.yml', profiles end Then /^the (.*) profile should be used$/ do |profile|
Use the Aruba API instead of a step in a step def
cucumber_cucumber-ruby
train
rb
8480b5a80e9f322d6ff8c7563075c25c54fdb86d
diff --git a/dashboard/app/lib/javascripts/dashboard/routers/apps.js b/dashboard/app/lib/javascripts/dashboard/routers/apps.js index <HASH>..<HASH> 100644 --- a/dashboard/app/lib/javascripts/dashboard/routers/apps.js +++ b/dashboard/app/lib/javascripts/dashboard/routers/apps.js @@ -32,8 +32,9 @@ Dashboard.routers.Apps = Marbles.Router.createClass({ // and allow them to expire when navigating away var view = Dashboard.primaryView; if (view && view.isMounted() && view.constructor.displayName === "Views.App") { - if (view.state.app) { - var appMeta = view.state.app.meta; + var app = view.state.app; + var appMeta = app ? app.meta : null; + if (app && appMeta) { if (event.nextHandler.router === this) { if (view.props.selectedTab !== event.nextParams[0].shtab) { if (view.props.selectedTab === "pulls") {
dashboard: Fix apps router: not all apps have meta
flynn_flynn
train
js
542fd2e09079170089698aa973b9c3e5faa1be28
diff --git a/src/Robo/Tasks/DrushTask.php b/src/Robo/Tasks/DrushTask.php index <HASH>..<HASH> 100644 --- a/src/Robo/Tasks/DrushTask.php +++ b/src/Robo/Tasks/DrushTask.php @@ -249,6 +249,9 @@ class DrushTask extends CommandStack { $this->options[$correspondingCommand] = $this->arguments; $this->arguments = ''; } + elseif (isset($this->arguments) && !empty($this->arguments)) { + throw new TaskException($this, "A drush command must be added to the stack before setting arguments: {$this->arguments}"); + } } /** @@ -281,7 +284,7 @@ class DrushTask extends CommandStack { * Overriding CommandArguments::option to default option separator to '='. */ public function option($option, $value = NULL, $separator = '=') { - $this->traitOption($option, $value, $separator); + return $this->traitOption($option, $value, $separator); } /**
Halt task execution when options set before drush command. (#<I>) * Return $this in override of option method in drush task. * Halt task execution when options set before drush command.
acquia_blt
train
php
33b6b1d9824af5f66fa5e444ca689b4fca3e3689
diff --git a/webpack.prod.config.js b/webpack.prod.config.js index <HASH>..<HASH> 100644 --- a/webpack.prod.config.js +++ b/webpack.prod.config.js @@ -42,7 +42,7 @@ module.exports = { entry: { 'polyfills': './src/polyfills.ts', 'vendor': './src/vendor.ts', - 'main': './src/main.ts' + 'app': './src/main.ts' }, // Config for our build files
chore(webpack.prod): correct app designation
inchingorg_xdata-web
train
js
8ced7e50588d1c334a3d4e0b3304777cbc764c27
diff --git a/Configuration/TCA/Overrides/tt_address.php b/Configuration/TCA/Overrides/tt_address.php index <HASH>..<HASH> 100644 --- a/Configuration/TCA/Overrides/tt_address.php +++ b/Configuration/TCA/Overrides/tt_address.php @@ -1,5 +1,14 @@ <?php defined('TYPO3_MODE') or die(); -// Enable language synchronisation for the category field -$GLOBALS['TCA']['tt_address']['columns']['categories']['config']['behaviour']['allowLanguageSynchronization'] = true; +call_user_func(static function () { + // Enable language synchronisation for the category field + $GLOBALS['TCA']['tt_address']['columns']['categories']['config']['behaviour']['allowLanguageSynchronization'] = true; + + $versionInformation = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Core\Information\Typo3Version::class); + if ($versionInformation->getMajorVersion() === 11) { + $GLOBALS['TCA']['tt_address']['columns']['sys_language_uid']['config'] = [ + 'type' => 'language' + ]; + } +});
[TASK] Use TCA type language in TYPO3 <I>
FriendsOfTYPO3_tt_address
train
php
49e67b525ea2d5ac596a4517780022db245d7c6b
diff --git a/system/Database/BaseBuilder.php b/system/Database/BaseBuilder.php index <HASH>..<HASH> 100644 --- a/system/Database/BaseBuilder.php +++ b/system/Database/BaseBuilder.php @@ -214,6 +214,14 @@ class BaseBuilder protected $binds = []; /** + * Collects the key count for named parameters + * in the Query object. + * + * @var array + */ + protected $bindsKeyCount = []; + + /** * Some databases, like SQLite, do not by default * allow limiting of delete clauses. * @@ -3402,12 +3410,11 @@ class BaseBuilder return $key; } - $count = 0; - - while (array_key_exists($key . $count, $this->binds)) + if (!array_key_exists($key, $this->bindsKeyCount)) { - ++$count; + $this->bindsKeyCount[$key] = 0; } + $count = $this->bindsKeyCount[$key]++; $this->binds[$key . $count] = [ $value,
Fix insert key binding performance issue in BaseBuilder::setBinding function
codeigniter4_CodeIgniter4
train
php
05f027c6fc89ebc731da91ead64628c0e7e093da
diff --git a/cmd/cmd.go b/cmd/cmd.go index <HASH>..<HASH> 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -281,7 +281,7 @@ Options: } dir, _ := client.ExpandUser(args["--path"].(string)) // create the target dir if necessary - if err := os.MkdirAll(dir, 0700); err != nil { + if err := os.MkdirAll(dir, 0755); err != nil { return err } // download and save the unit files to the specified path @@ -312,7 +312,7 @@ Options: if err != nil { return err } - if err = ioutil.WriteFile(dest, data, 0600); err != nil { + if err = ioutil.WriteFile(dest, data, 0644); err != nil { return err } fmt.Printf("Refreshed %s from %s\n", unit, branch)
fix(cmd): create unit files as readable to all users
deis_deis
train
go
2d690eb86f8a5f4c9acd21658142116f1acc5205
diff --git a/scripts/build-min.js b/scripts/build-min.js index <HASH>..<HASH> 100644 --- a/scripts/build-min.js +++ b/scripts/build-min.js @@ -54,7 +54,7 @@ async function build() { }); const esUnminResult = minify({ - [srcName]: esModule.code + [esUnminName]: esModule.code }, { warnings: 'verbose', ecma: 5, @@ -71,7 +71,7 @@ async function build() { }); const esMinResult = minify({ - [srcName]: esUnminResult.code + [esUnminName]: esUnminResult.code }, { warnings: 'verbose', ecma: 5, @@ -96,7 +96,7 @@ async function build() { }); const umdUnminResult = minify({ - [srcName]: umdModule.code + [umdUnminName]: umdModule.code }, { warnings: 'verbose', ecma: 5, @@ -113,7 +113,7 @@ async function build() { }); const umdMinResult = minify({ - [srcName]: umdUnminResult.code + [umdUnminName]: umdUnminResult.code }, { warnings: 'verbose', ecma: 5,
Fix source mapping for es version
stevenschobert_instafeed.js
train
js
5cf6b03700b48bd9fa224c9d7fb3da3f2da32012
diff --git a/lib/hocon/version.rb b/lib/hocon/version.rb index <HASH>..<HASH> 100644 --- a/lib/hocon/version.rb +++ b/lib/hocon/version.rb @@ -1,5 +1,5 @@ module Hocon module Version - STRING = '1.2.2.SNAPSHOT' + STRING = '1.2.2' end end
(GEM) update hocon version to <I>
puppetlabs_ruby-hocon
train
rb
8c38bc768de1c589df0ad3206e8b56ae398e6f0b
diff --git a/housekeeper/server/app.py b/housekeeper/server/app.py index <HASH>..<HASH> 100644 --- a/housekeeper/server/app.py +++ b/housekeeper/server/app.py @@ -90,8 +90,9 @@ def cases(): 'per_page': 30, 'missing': missing_category, } - cases_q = api.cases(query_str=qargs['query_str'], - missing=qargs['missing']) + version = 'v4' if qargs['missing'] == 'delivered' else None + cases_q = api.cases(query_str=qargs['query_str'], missing=qargs['missing'], + version=version) cases_page = cases_q.paginate(page, per_page=qargs['per_page']) return render_template('cases.html', cases=cases_page, qargs=qargs)
only show v4 runs to be delivered
Clinical-Genomics_housekeeper
train
py
a33a1ae0299733232db68255f80687cdb3320b20
diff --git a/lib/jsonapi/resource.rb b/lib/jsonapi/resource.rb index <HASH>..<HASH> 100644 --- a/lib/jsonapi/resource.rb +++ b/lib/jsonapi/resource.rb @@ -398,7 +398,7 @@ module JSONAPI def model_name(model, options = {}) @_model_name = model.to_sym - model_hint(model: @_model_name, resource: self) unless options[:model_hint] == false + model_hint(model: @_model_name, resource: self) unless options[:add_model_hint] == false end def model_hint(model: _model_name, resource: _type) diff --git a/test/fixtures/active_record.rb b/test/fixtures/active_record.rb index <HASH>..<HASH> 100644 --- a/test/fixtures/active_record.rb +++ b/test/fixtures/active_record.rb @@ -1434,7 +1434,7 @@ module Legacy end class FlatPostResource < JSONAPI::Resource - model_name "Legacy::FlatPost", model_hint: false + model_name "Legacy::FlatPost", add_model_hint: false model_hint model: "Legacy::FlatPost", resource: FlatPostResource
Rename option to skip model_hints for model_name method
cerebris_jsonapi-resources
train
rb,rb
7c8a5cc81c68f8119bf0d3f8d9e3feba82664a44
diff --git a/go/service/rekey_test.go b/go/service/rekey_test.go index <HASH>..<HASH> 100644 --- a/go/service/rekey_test.go +++ b/go/service/rekey_test.go @@ -160,7 +160,7 @@ func TestRekeyNeededUserClose(t *testing.T) { select { case <-rekeyHandler.notifyComplete: - case <-time.After(2 * time.Second): + case <-time.After(20 * time.Second): t.Fatal("timeout waiting for rekeyHandler.notifyComplete") }
Increase test timeout to <I>s
keybase_client
train
go
a81fc84109077827f6c28ac20fc063ecc11ce5fa
diff --git a/lib/cortex/version.rb b/lib/cortex/version.rb index <HASH>..<HASH> 100644 --- a/lib/cortex/version.rb +++ b/lib/cortex/version.rb @@ -1,3 +1,3 @@ module Cortex - VERSION = '0.5.0' + VERSION = '0.6.0' end
Bumping the version number to <I>
cortex-cms_cortex-client-ruby
train
rb
040e0fdaacb767d61ef07a41098ebb9c998738e4
diff --git a/spec/unit/interface/action_spec.rb b/spec/unit/interface/action_spec.rb index <HASH>..<HASH> 100755 --- a/spec/unit/interface/action_spec.rb +++ b/spec/unit/interface/action_spec.rb @@ -350,7 +350,7 @@ describe Puppet::Interface::Action do option("-q", "--action-quux") { after_action { |_,_,_| report :action_quux } } option("-a") { after_action { |_,_,_| report :a } } option("--action-baz") { after_action { |_,_,_| report :action_baz } } - when_invoked { |options| warn options.inspect } + when_invoked { } end option("-u", "--face-quux") { after_action { |_,_,_| report :face_quux } } option("-f") { after_action { |_,_,_| report :f } }
(Maint.) Fix accidental debug output in tests. Reviewed-By: Daniel Pittman
puppetlabs_puppet
train
rb
da6353ee0afa0abe7d71c9b0137d9c8a4986c702
diff --git a/lib/linters/property_units.js b/lib/linters/property_units.js index <HASH>..<HASH> 100644 --- a/lib/linters/property_units.js +++ b/lib/linters/property_units.js @@ -47,9 +47,13 @@ module.exports = { } } + const position = node.positionBy({ + word: node.value + }); + results.push({ - column: node.source.start.column + node.raws.between.length + property.length + value.source.start.column - 1, - line: node.source.start.line + value.source.start.line - 1, + column: position.column, + line: position.line, message: util.format(this.message.unit, unit, property) }); });
Refactor propertyUnits position reporting (#<I>)
lesshint_lesshint
train
js
e4c187f7b23e85a16f3f3a8171e7c834e4012ea9
diff --git a/virtualchain/lib/blockchain/transactions.py b/virtualchain/lib/blockchain/transactions.py index <HASH>..<HASH> 100644 --- a/virtualchain/lib/blockchain/transactions.py +++ b/virtualchain/lib/blockchain/transactions.py @@ -501,6 +501,7 @@ def get_nulldata_txs_in_blocks( workpool, bitcoind_opts, blocks_ids ): block_slice = blocks_ids[ (slice_count * slice_len) : min((slice_count+1) * slice_len, len(blocks_ids)) ] if len(block_slice) == 0: + log.debug("Zero-length block slice") break start_slice_time = time.time()
Warn when we have a zero-length slice to process
blockstack_virtualchain
train
py
bae1224b07b174a1c23a9fc3bc50ff7747fca7f1
diff --git a/webimageloader/src/com/webimageloader/util/Android.java b/webimageloader/src/com/webimageloader/util/Android.java index <HASH>..<HASH> 100644 --- a/webimageloader/src/com/webimageloader/util/Android.java +++ b/webimageloader/src/com/webimageloader/util/Android.java @@ -2,7 +2,7 @@ package com.webimageloader.util; import android.os.Build; -public class Android { +public class Android extends Build.VERSION_CODES { /** * Check the api level of the device we're running on * @param level API level
Let version helper class have version codes
lexs_webimageloader
train
java
bb0476064b3bc818e3cf1636a12fecc2a02e67a7
diff --git a/andes/core/documenter.py b/andes/core/documenter.py index <HASH>..<HASH> 100644 --- a/andes/core/documenter.py +++ b/andes/core/documenter.py @@ -2,6 +2,7 @@ Documenter class for ANDES models. """ +import inspect from collections import OrderedDict from andes.utils.tab import make_doc_table, math_wrap @@ -391,10 +392,9 @@ class Documenter: else: out += model_header + f'Model <{self.class_name}> in Group <{self.parent.group}>\n' + model_header - if self.__doc__ is not None: - if self.parent.__doc__ is not None: - out += self.parent.__doc__ - out += '\n' # this fixes the indentation for the next line + if self.parent.__doc__ is not None: + out += inspect.cleandoc(self.parent.__doc__) + out += '\n\n' # this fixes the indentation for the next line # add tables out += self._param_doc(max_width=max_width, export=export)
Fix style of docstring in modelref.
cuihantao_andes
train
py
429b3a26c29d712292be44f43fd7f957d550c920
diff --git a/src/Report.php b/src/Report.php index <HASH>..<HASH> 100644 --- a/src/Report.php +++ b/src/Report.php @@ -382,6 +382,8 @@ class Report extends Element { } } elseif (is_array($val)) { return $val; + } elseif ($val === false) { + return str_ireplace('$F{' . $field . '}', '0', $text); } else { return str_ireplace(array('$F{' . $field . '}'), array(($val)), $text); }
replace "false" by "0" (fix bugs on "print when expression")
QuilhaSoft_JasperPHP
train
php
0a6f106871bafb35a28f8426494d234a8c197622
diff --git a/packages/appframe/src/react/__specs__/storyshots.spec.js b/packages/appframe/src/react/__specs__/storyshots.spec.js index <HASH>..<HASH> 100644 --- a/packages/appframe/src/react/__specs__/storyshots.spec.js +++ b/packages/appframe/src/react/__specs__/storyshots.spec.js @@ -3,9 +3,7 @@ import initStoryshots, { snapshotWithOptions } from '@storybook/addon-storyshots' -jest.mock('@pluralsight/ps-design-system-storybook-addon-theme') - -const createNodeMock = el => document.createElement('div') +const createNodeMock = () => document.createElement('div') initStoryshots({ configPath: path.resolve(__dirname, '../../../.storybook'),
test(appframe): update snapshot
pluralsight_design-system
train
js
7323e030f951d791a0f8c2ba46f7d4c8e65798ce
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -9,15 +9,6 @@ var human = require('pretty-hrtime') , util = require('util'); /** - * All the different name spaces that are currently using this module. - * - * @type {Array} - * @private - */ -var namespaces = [] - , max; - -/** * Check if the terminal we're using allows the use of colors. * * @type {Boolean} @@ -81,15 +72,6 @@ function factory(name, options) { if (!Array.isArray(options.stream)) options.stream = [options.stream]; // - // Add the namespace an re-calculate the max-length of the namespace so we can - // have a consistent indentation. - // - namespaces.push(name); - max = Math.max.apply(Math, namespaces.map(function map(namespace) { - return namespace.toString().length; - })); - - // // The actual debug function which does the logging magic. // return function debug(line) { @@ -102,11 +84,6 @@ function factory(name, options) { line = [ // - // Add extra padding so all log messages start at the same line. - // - (new Array(max + 1 - name.length)).join(' '), - - // // Add the colorized namespace. // options.ansi,
[minor] Don't pad the output, it get's anoying to read if you have long namespaces
3rd-Eden_diagnostics
train
js
e6c137e58ba85b184d2a34213695102728bb3842
diff --git a/cgutils/cgroup.py b/cgutils/cgroup.py index <HASH>..<HASH> 100644 --- a/cgutils/cgroup.py +++ b/cgutils/cgroup.py @@ -24,7 +24,7 @@ import errno from cgutils import host from cgutils import process -from . import fileops +from cgutils import fileops if sys.version_info.major == 3:
cgroup: tweak for doctest
peo3_cgroup-utils
train
py
025644fc8aa3afb6dcba38e3dce03c228c4365f8
diff --git a/pymacaron/test.py b/pymacaron/test.py index <HASH>..<HASH> 100644 --- a/pymacaron/test.py +++ b/pymacaron/test.py @@ -38,6 +38,8 @@ class PyMacaronTestCase(testcase.PyMacaronTestCase): super().setUp() self.maxDiff = None self.host, self.port, self.token = load_port_host_token() + proto = 'https' if self.port == 443 else 'http' + self.base_url = '%s://%s:%s' % (proto, self.host, self.port) def assertIsVersion(self, j): self.assertTrue(type(j['version']) is str)
Add base_url as attribute to PyMacaronTestCase instance
pymacaron_pymacaron
train
py
ebc3f5fce8fa0507dfa1bfc777e5629aa7a84efd
diff --git a/src/Str.php b/src/Str.php index <HASH>..<HASH> 100644 --- a/src/Str.php +++ b/src/Str.php @@ -568,6 +568,8 @@ final class Str implements \Countable { * * This operation is case-sensitive * + * The empty string (as a search string) is not considered to be a part of any other string + * * If the given search string is not found anywhere, an empty string is returned * * @param string $search the search string that should delimit the end diff --git a/tests/index.php b/tests/index.php index <HASH>..<HASH> 100644 --- a/tests/index.php +++ b/tests/index.php @@ -225,6 +225,7 @@ assert((string) $testStrObj->beforeFirst('d w☺rl') === 'Hello Hello w☺rl'); assert((string) $testStrObj->beforeFirst('w☺rld') === 'Hello Hello '); assert((string) $testStrObj->beforeFirst('W☺rld') === ''); assert((string) $testStrObj->beforeFirst('x') === ''); +assert((string) $testStrObj->beforeFirst('') === ''); assert((string) $testStrObj->beforeLast('Hello') === 'Hello '); assert((string) $testStrObj->beforeLast('o H') === 'Hell'); assert((string) $testStrObj->beforeLast('d w☺rl') === 'Hello Hello w☺rl');
Clarify existing behavior of 'beforeFirst' with empty needle
delight-im_PHP-Str
train
php,php
c711356222fb5e86944a549931f1264933678706
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 @@ -34,6 +34,7 @@ import salt.utils.event import salt.utils.atomicfile import salt.utils.thin import salt.utils.verify +import salt.utils.validate.ssh from salt._compat import string_types from salt.utils import is_windows @@ -176,6 +177,7 @@ class SSH(object): else: self.event = None self.opts = opts + self.opts['_ssh_version'] = salt.utils.validate.ssh.version() self.tgt_type = self.opts['selected_target_option'] \ if self.opts['selected_target_option'] else 'glob' self.roster = salt.roster.Roster(opts, opts.get('roster'))
Add the ssh version to the opts
saltstack_salt
train
py
5dd1316fd9c050bc654fa91c7397ea731e041cf4
diff --git a/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js b/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js index <HASH>..<HASH> 100644 --- a/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js +++ b/packages/node_modules/@webex/plugin-meetings/test/unit/spec/meeting/index.js @@ -716,10 +716,12 @@ describe('plugin-meetings', () => { describe('#parseMeetingInfo', () => { it('should parse meeting info, set values, and return null', () => { meeting.parseMeetingInfo({ - convoId: uuid1, - locusUrl: url1, - sipMeetingUri: test1, - owner: test2 + body: { + convoId: uuid1, + locusUrl: url1, + sipMeetingUri: test1, + owner: test2 + } }); assert.equal(meeting.convoId, uuid1); assert.equal(meeting.locusUrl, url1);
fix(meeting): fix uts
webex_spark-js-sdk
train
js
1f3cbfcb36818ca91b694412dfc52526adef282f
diff --git a/cumulusci/tasks/robotframework/lint.py b/cumulusci/tasks/robotframework/lint.py index <HASH>..<HASH> 100644 --- a/cumulusci/tasks/robotframework/lint.py +++ b/cumulusci/tasks/robotframework/lint.py @@ -46,9 +46,9 @@ class RobotLint(BaseTask): W: 2, 0: No suite documentation (RequireSuiteDocumentation) E: 30, 0: No testcase documentation (RequireTestDocumentation) - To see a list of all configured options, set the 'list' option to True: + To see a list of all configured rules, set the 'list' option to True: - cci task run robot_list -o list True + cci task run robot_lint -o list True """
Fixed a typo in a docstring
SFDO-Tooling_CumulusCI
train
py
6fe457063675bc9450d18de663713151c6499275
diff --git a/Swat/SwatTableViewColumn.php b/Swat/SwatTableViewColumn.php index <HASH>..<HASH> 100644 --- a/Swat/SwatTableViewColumn.php +++ b/Swat/SwatTableViewColumn.php @@ -609,6 +609,9 @@ class SwatTableViewColumn extends SwatCellRendererContainer $first = true; foreach ($this->renderers as $renderer) { + if (!$renderer->visible) + continue; + if ($first) $first = false; else
Fix problem where invisible cell-renderers were still outputting an empty wrapper div (this would only occur for columns with more than one renderer, one or more of which was invisible) svn commit r<I>
silverorange_swat
train
php
6314d032c263a54ff4b1e2b8959db5ee796bcb0e
diff --git a/skflow/io/dask_io.py b/skflow/io/dask_io.py index <HASH>..<HASH> 100644 --- a/skflow/io/dask_io.py +++ b/skflow/io/dask_io.py @@ -38,6 +38,14 @@ def _get_divisions(df): divisions.insert(0, 0) return divisions +def _construct_dask_df_with_divisions(df): + divisions = _get_divisions(df) + name = 'csv-index' + df._name + dsk = {(name, i): (_add_to_index, (df._name, i), divisions[i]) for i in range(df.npartitions)} + columns = df.columns + from toolz import merge + return dd.DataFrame(merge(dsk, df.dask), name, columns, divisions) + def extract_dask_data(data): """Extract data from dask.Series for predictors""" if isinstance(data, dd.Series):
+ _construct_dask_df_with_divisions for dask_io
tensorflow_skflow
train
py
54e222866aab18c9bcd90c22532892e53a0da5ee
diff --git a/state/vm_app_state.go b/state/vm_app_state.go index <HASH>..<HASH> 100644 --- a/state/vm_app_state.go +++ b/state/vm_app_state.go @@ -229,8 +229,13 @@ func (vas *VMAppState) Sync() { if deleted { continue } - storageRoot := currentAccount.StorageRoot - storage.Load(storageRoot.Bytes()) + var storageRoot []byte + if currentAccount.StorageRoot.IsZero() { + storageRoot = nil + } else { + storageRoot = currentAccount.StorageRoot.Bytes() + } + storage.Load(storageRoot) } if value.IsZero() { _, removed := storage.Remove(key)
Check StorageRoot for Zero before state.Load() again. Closes #<I>
tendermint_tendermint
train
go
9e8de67ca9afdad85fec81dd0f3cb92c6d3c40ee
diff --git a/app-web/BitTorrentTracker.php b/app-web/BitTorrentTracker.php index <HASH>..<HASH> 100644 --- a/app-web/BitTorrentTracker.php +++ b/app-web/BitTorrentTracker.php @@ -917,7 +917,6 @@ class BitTorrentTracker_Request extends Request } class BitTorrentTracker_TorrentImporter extends Request { - public $inited = FALSE; public $concurrencyLimit = 5; public $dir; public $handle; @@ -958,7 +957,6 @@ class BitTorrentTracker_TorrentImporter extends Request class BitTorrentTracker_RatingUpdate extends Request { - public $inited = FALSE; public $processing = 0; public $concurrencyLimit = 1; public function run() diff --git a/app-web/Chat.php b/app-web/Chat.php index <HASH>..<HASH> 100644 --- a/app-web/Chat.php +++ b/app-web/Chat.php @@ -625,7 +625,6 @@ class ChatSession } class Chat_MsgQueueRequest extends Request { - public $inited = FALSE; public function run() { foreach ($this->appInstance->tags as $tag) {$tag->touch();}
Little cleanup (removed some unused properties).
kakserpom_phpdaemon
train
php,php
4915d51ca2593a743cecbab9597ad6a1314bdbed
diff --git a/src/Resque/Worker.php b/src/Resque/Worker.php index <HASH>..<HASH> 100644 --- a/src/Resque/Worker.php +++ b/src/Resque/Worker.php @@ -257,7 +257,7 @@ class Worker { $this->queueDelayed(); if ($this->blocking) { - $this->log('Pop blocking with timeout of '.$this->interval_string(), Logger::INFO); + $this->log('Pop blocking with timeout of '.$this->interval_string(), Logger::DEBUG); $this->updateProcLine('Worker: waiting for job on '.implode(',', $this->queues).' with blocking timeout '.$this->interval_string()); } else { $this->updateProcLine('Worker: waiting for job on '.implode(',', $this->queues).' with interval '.$this->interval_string()); @@ -267,7 +267,7 @@ class Worker { if (!$job instanceof Job) { if (!$this->blocking) { - $this->log('Sleeping for '.$this->interval_string(), Logger::INFO); + $this->log('Sleeping for '.$this->interval_string(), Logger::DEBUG); sleep($this->interval); }
Change worker wait log level to DEBUG from INFO This is a bit subjective, but having "Pop blocking ..." or "Sleeping ..." flooding the logs is undesirable in production environments, but I do want INFO level logs for things such as job success. Bumping it down to DEBUG just reduces the rate at which the logs grow significantly.
mjphaynes_php-resque
train
php
5416a9aa44f679c3faceb5ae7b082ff4bbddce1b
diff --git a/calendar/lib.php b/calendar/lib.php index <HASH>..<HASH> 100644 --- a/calendar/lib.php +++ b/calendar/lib.php @@ -1252,8 +1252,6 @@ function calendar_get_default_courses($ignoreref = false) { else { $courses = get_my_courses($USER->id, 'visible DESC', null, false); } - // Make sure global events are included - $courses[0] = true; return $courses; }
MDL-<I>: Fixed bug in previous commits. - warnings being displayed in developer mode. - caused by patch from patch series not being applied.
moodle_moodle
train
php
9021d4ec6c8e52dc9b75d5c00060c1bdc6d0b06a
diff --git a/src/String/StringTools.php b/src/String/StringTools.php index <HASH>..<HASH> 100644 --- a/src/String/StringTools.php +++ b/src/String/StringTools.php @@ -107,6 +107,7 @@ class StringTools public static function makePlural($singular) { $singulars = [ + 'ey' => 'eys', 'day' => 'days', "ch" => "ches", "s" => "ses",
Updating the string replacement to support for "ey"
RhubarbPHP_Rhubarb
train
php
e88898b95734252eade85d9fbce36bfa0ef5cc97
diff --git a/pages/Favorites/components/FavoritesList/style.js b/pages/Favorites/components/FavoritesList/style.js index <HASH>..<HASH> 100644 --- a/pages/Favorites/components/FavoritesList/style.js +++ b/pages/Favorites/components/FavoritesList/style.js @@ -13,6 +13,7 @@ import variables from 'Styles/variables'; const container = css({ background: colors.background, flexGrow: 1, + paddingTop: variables.gap.xsmall, }).toString(); const image = css({ diff --git a/styles/variables.js b/styles/variables.js index <HASH>..<HASH> 100644 --- a/styles/variables.js +++ b/styles/variables.js @@ -10,6 +10,7 @@ const materialShadow = 'rgba(0, 0, 0, .117647) 0 1px 6px, rgba(0, 0, 0, .117647) export default { materialShadow, gap: { + xsmall: 4, small: 8, big: 16, bigger: 20,
CON-<I> - additional gap on top of favorites page
shopgate_pwa
train
js,js
bb2719dcfa7c8c1428eb1bd591ee9113ae736099
diff --git a/core/eolearn/tests/test_eodata.py b/core/eolearn/tests/test_eodata.py index <HASH>..<HASH> 100644 --- a/core/eolearn/tests/test_eodata.py +++ b/core/eolearn/tests/test_eodata.py @@ -294,7 +294,7 @@ class TestSavingLoading(unittest.TestCase): eopatch.save(tmpdirname, file_format='npy') # load original patch - eopatch_before = EOPatch.load(tmpdirname) + eopatch_before = EOPatch.load(tmpdirname, mmap=False) # force exception during saving (case sensitivity), backup is reloaded eopatch.data_timeless['Mask'] = mask @@ -314,12 +314,12 @@ class TestSavingLoading(unittest.TestCase): eopatch.save(tmpdirname, file_format='npy') # load original patch - eopatch_before = EOPatch.load(tmpdirname) + eopatch_before = EOPatch.load(tmpdirname, mmap=False) # update original patch eopatch.data_timeless['mask2'] = mask eopatch.save(tmpdirname, file_format='npy', overwrite=True) - eopatch_after = EOPatch.load(tmpdirname) + eopatch_after = EOPatch.load(tmpdirname, mmap=False) # should be different self.assertNotEqual(eopatch_before, eopatch_after)
Disable mmap in tests, otherwise a temporary directory cannot be deleted on Windows
sentinel-hub_eo-learn
train
py
5928b5c6521f416c8a40f6b1a88ada93143d5bde
diff --git a/extensions/jupyter_shoebot/shoebot_kernel/kernel.py b/extensions/jupyter_shoebot/shoebot_kernel/kernel.py index <HASH>..<HASH> 100644 --- a/extensions/jupyter_shoebot/shoebot_kernel/kernel.py +++ b/extensions/jupyter_shoebot/shoebot_kernel/kernel.py @@ -34,12 +34,12 @@ class ShoebotKernel(Kernel): exc = None try: bot.run(code, break_on_error=True) + png_data = open('_temp.png', 'r').read() + # quote and encode PNG data for passing JSON response to Jupyter + png_string = urllib.quote_plus(base64.b64encode(png_data)) except Exception as e: import traceback exc = traceback.format_exc(e) - png_data = open('_temp.png', 'r').read() - # quote and encode PNG data for passing JSON response to Jupyter - png_string = urllib.quote_plus(base64.b64encode(png_data)) if not silent: if exc:
Errors are now properly caught
shoebot_shoebot
train
py
5377b82612b9e2a3fb60ea68bda2e016ca43e988
diff --git a/tools/phantomjs/render.js b/tools/phantomjs/render.js index <HASH>..<HASH> 100644 --- a/tools/phantomjs/render.js +++ b/tools/phantomjs/render.js @@ -57,7 +57,7 @@ var rootScope = body.injector().get('$rootScope'); if (!rootScope) {return false;} - var panels = angular.element('div.panel:visible').length; + var panels = angular.element('plugin-component').length; return rootScope.panelsRendered >= panels; });
Phantom render.js is incorrectly retrieving number of active panels (#<I>) Fixes #<I>
grafana_grafana
train
js
4e525a2a2b59bfc4c9752425589fe8c45a8720db
diff --git a/activerecord/lib/active_record/associations/belongs_to_association.rb b/activerecord/lib/active_record/associations/belongs_to_association.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/associations/belongs_to_association.rb +++ b/activerecord/lib/active_record/associations/belongs_to_association.rb @@ -12,7 +12,7 @@ module ActiveRecord target.destroy raise ActiveRecord::Rollback unless target.destroyed? when :destroy_async - id = owner.send(reflection.foreign_key.to_sym) + id = owner.public_send(reflection.foreign_key.to_sym) primary_key_column = reflection.active_record_primary_key.to_sym enqueue_destroy_association(
Every foreign_key column is supposed to be a public method
rails_rails
train
rb
c755142b58d31fc93b3e28fc57ddf142fa44709e
diff --git a/spec/lib/finders/finder/enumerator_spec.rb b/spec/lib/finders/finder/enumerator_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/finders/finder/enumerator_spec.rb +++ b/spec/lib/finders/finder/enumerator_spec.rb @@ -172,7 +172,7 @@ describe CMSScanner::Finders::Finder::Enumerator do stub_request(:get, target_urls.key(2)).to_return(status: 200, body: 'rspec') end - it 'yield the expected items' do + it 'yield the expected item' do expect { |b| finder.enumerate(target_urls, opts, &b) }.to yield_with_args(Typhoeus::Response, 2) end end @@ -207,6 +207,18 @@ describe CMSScanner::Finders::Finder::Enumerator do ) end end + + context 'when one header matches but the other not, using negative look-arounds' do + let(:opts) { super().merge(exclude_content: /\A((?!x\-cacheable)[\s\S])*\z/i) } + + before do + stub_request(:head, target_urls.keys.last).and_return(status: 200, headers: { 'x-cacheable' => 'YES' }) + end + + it 'yield the expected item' do + expect { |b| finder.enumerate(target_urls, opts, &b) }.to yield_with_args(Typhoeus::Response, 2) + end + end end context 'when check_full_response' do
Adds specs to ensure --exclude-content-based works with negative patterns
wpscanteam_CMSScanner
train
rb
41bb9389f93bcd106f1dc8b0006cda9fe0b2643a
diff --git a/lib/accessly.rb b/lib/accessly.rb index <HASH>..<HASH> 100644 --- a/lib/accessly.rb +++ b/lib/accessly.rb @@ -1,5 +1,6 @@ require "accessly/version" require "accessly/query" +require "accessly/policy/base" require "accessly/permission/grant" require "accessly/permission/revoke" require "accessly/models/permitted_action"
we need to export our base policy on the gem
lessonly_accessly
train
rb
911eb654bfabd38f7e00e57500e713b0b68c65ca
diff --git a/Gulpfile.js b/Gulpfile.js index <HASH>..<HASH> 100644 --- a/Gulpfile.js +++ b/Gulpfile.js @@ -12,7 +12,7 @@ var PACKAGE_SEARCH_PATH = (process.env.NODE_PATH ? process.env.NODE_PATH + path. gulp.task('clean', function () { - return del(['lib', '.screenshots']); + return del('lib'); }); gulp.task('lint', function () { diff --git a/test/testcafe/screenshot-test.js b/test/testcafe/screenshot-test.js index <HASH>..<HASH> 100644 --- a/test/testcafe/screenshot-test.js +++ b/test/testcafe/screenshot-test.js @@ -1,11 +1,14 @@ import path from 'path'; +import del from 'del'; import { expect } from 'chai'; import { statSync } from 'fs'; import { tmpNameSync as getTempFileName } from 'tmp'; fixture `Screenshot` - .page('https://google.com'); + .page('https://google.com') + .beforeEach(() => del('.screenshots/*')) + .afterEach(() => del('.screenshots/*')); test('Take screenshot', async t => { var screenshotName = getTempFileName({ template: 'screenshot-XXXXXX.png' });
Refactor tests (closes #3) (#4)
DevExpress_testcafe-browser-provider-saucelabs
train
js,js
632135ce4c1d8d3d9a36771aab4137260018e84b
diff --git a/cmd/swarm/swarm-snapshot/create_test.go b/cmd/swarm/swarm-snapshot/create_test.go index <HASH>..<HASH> 100644 --- a/cmd/swarm/swarm-snapshot/create_test.go +++ b/cmd/swarm/swarm-snapshot/create_test.go @@ -21,6 +21,7 @@ import ( "fmt" "io/ioutil" "os" + "runtime" "sort" "strconv" "strings" @@ -33,6 +34,10 @@ import ( // It runs a few "create" commands with different flag values and loads generated // snapshot files to validate their content. func TestSnapshotCreate(t *testing.T) { + if runtime.GOOS == "windows" { + t.Skip() + } + for _, v := range []struct { name string nodes int
cmd/swarm/swarm-snapshot: disable tests on windows (#<I>)
ethereum_go-ethereum
train
go
e7d2cce0110e09171fac4520762895612b60aa2b
diff --git a/cbamf/opt/optimize.py b/cbamf/opt/optimize.py index <HASH>..<HASH> 100644 --- a/cbamf/opt/optimize.py +++ b/cbamf/opt/optimize.py @@ -147,9 +147,9 @@ def update_state_global(s, block, data, keep_time=True, **kwargs): #pos: bpos = s.create_block('pos') if (bpos & block).sum() > 0: - raise NotImplementedError("updating the particle positions is hard") - #Mostly because I don't know wtf ns is in s.obj.update() - #ns = "n's" = numbers. Do s.obj.rad.size to get n, then update rad, type + new_pos_params = new_state[bpos].copy().reshape(-1,3) + s.obj.pos = new_pos_params + s.obj.initialize(s.zscale) #rad: brad = s.create_block('rad') if (brad & block).sum() > 0:
adding positional support for lm optimization in update state globals
peri-source_peri
train
py
4e6c4caf5db122d03ff1e2674ad89f536c5cdb68
diff --git a/transport/grpc/doc.go b/transport/grpc/doc.go index <HASH>..<HASH> 100644 --- a/transport/grpc/doc.go +++ b/transport/grpc/doc.go @@ -85,7 +85,7 @@ // myTransportCredentials := credentials.NewTLS(myTLSConfig) // myChooser := peer.NewSingle( // hostport.Identify("127.0.0.1:4443"), -// t.NewDialer(DialerCredentials(myTransportCredentials)), +// grpcTransport.NewDialer(DialerCredentials(myTransportCredentials)), // ) // myserviceOutbound := grpcTransport.NewOutbound(myChooser) // dispatcher := yarpc.NewDispatcher(yarpc.Config{
copypasta error in transport/grpc/doc.go (#<I>) The example was unclear and resulted in a question from a user. This clarifies it.
yarpc_yarpc-go
train
go
53e736fe014023b63403a888701c22ea2a1cf75c
diff --git a/python/ray/rllib/models/catalog.py b/python/ray/rllib/models/catalog.py index <HASH>..<HASH> 100644 --- a/python/ray/rllib/models/catalog.py +++ b/python/ray/rllib/models/catalog.py @@ -132,7 +132,8 @@ class ModelCatalog(object): print("Observation shape is {}".format(obs_shape)) if env_name in cls._registered_preprocessor: - return cls._registered_preprocessor[env_name](options) + return cls._registered_preprocessor[env_name]( + env.observation_space, options) if obs_shape == (): print("Using one-hot preprocessor for discrete envs.") diff --git a/python/ray/rllib/test/test_catalog.py b/python/ray/rllib/test/test_catalog.py index <HASH>..<HASH> 100644 --- a/python/ray/rllib/test/test_catalog.py +++ b/python/ray/rllib/test/test_catalog.py @@ -3,7 +3,7 @@ from ray.rllib.models.preprocessors import Preprocessor class FakePreprocessor(Preprocessor): - def __init__(self, options): + def _init(self): pass
[rllib] Small fix for supporting custom preprocessors (#<I>) * Small fix for supporting custom preprocessors * PEP8 * fix test
ray-project_ray
train
py,py
e345d30117ac92150b44c790b419d4edc0c16f6a
diff --git a/core/src/main/java/org/primefaces/extensions/component/localized/LocalizedRenderer.java b/core/src/main/java/org/primefaces/extensions/component/localized/LocalizedRenderer.java index <HASH>..<HASH> 100644 --- a/core/src/main/java/org/primefaces/extensions/component/localized/LocalizedRenderer.java +++ b/core/src/main/java/org/primefaces/extensions/component/localized/LocalizedRenderer.java @@ -24,6 +24,7 @@ package org.primefaces.extensions.component.localized; import java.io.IOException; import java.nio.file.Files; import java.nio.file.Path; +import java.nio.file.Paths; import java.util.Locale; import javax.el.ExpressionFactory; @@ -133,7 +134,7 @@ public class LocalizedRenderer extends CoreRenderer { } protected Path existingPath(final String first, final String... more) { - final Path path = Path.of(first, more); + final Path path = Paths.get(first, more); return path.toFile().exists() ? path : null; }
#<I> Localized Java 8 support (#<I>)
primefaces-extensions_core
train
java
b52920c756f83af74548e6e441537193c01da348
diff --git a/docs/src/components/Button/index.js b/docs/src/components/Button/index.js index <HASH>..<HASH> 100644 --- a/docs/src/components/Button/index.js +++ b/docs/src/components/Button/index.js @@ -3,21 +3,24 @@ import cx from "classnames" import styles from "./index.css" -const Button = (props) => ( - <span - role="button" - { ...props } - className={ cx({ - [props.className]: true, - [styles.button]: true, - [styles.light]: props.light, - [styles.vivid]: props.vivid, - [styles.huge]: props.huge, - }) } - > - { props.children } - </span> -) +const Button = (props) => { + const { className, light, vivid, huge, ...otherProps } = props + return ( + <span + role="button" + { ...otherProps } + className={ cx({ + [className]: true, + [styles.button]: true, + [styles.light]: light, + [styles.vivid]: vivid, + [styles.huge]: huge, + }) } + > + { props.children } + </span> + ) +} Button.propTypes = { children: PropTypes.node,
Docs: avoid new React <I> warnings for Button component
phenomic_phenomic
train
js
946ac19651842e3509aad0c68c8174eda24117df
diff --git a/tethne/readers/base.py b/tethne/readers/base.py index <HASH>..<HASH> 100644 --- a/tethne/readers/base.py +++ b/tethne/readers/base.py @@ -175,8 +175,6 @@ class FTParser(IterParser): msg = f.read() result = chardet.detect(msg) - #self.buffer = open(self.path, 'r').read() - self.buffer = codecs.open(self.path, "r", result['encoding'].encode("utf-8")) self.at_eof = False
removed open file line which is not used anymore
diging_tethne
train
py
00660a2405e43b650a95d007492368689b3b1eda
diff --git a/salt/modules/moosefs.py b/salt/modules/moosefs.py index <HASH>..<HASH> 100644 --- a/salt/modules/moosefs.py +++ b/salt/modules/moosefs.py @@ -144,7 +144,7 @@ def getgoal(path, opts=None): out = __salt__['cmd.run_all'](cmd) output = out['stdout'].splitlines() - if not 'r' in opts: + if 'r' not in opts: goal = output[0].split(': ') ret = { 'goal': goal[1],
Fix PEP8 E<I> - test for membership should be "not in"
saltstack_salt
train
py