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 |
|---|---|---|---|---|---|
e4737668cb052873fb9088534f3c4d337600e803 | diff --git a/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java b/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java
index <HASH>..<HASH> 100755
--- a/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java
+++ b/dropwizard-core/src/main/java/com/yammer/dropwizard/config/Environment.java
@@ -339,8 +339,8 @@ public class Environment extends AbstractLifeCycle {
* @param name the name of the Jersey property
* @see ResourceConfig
*/
- public Object getJerseyProperty(String name) {
- return config.getProperties().get(name);
+ public <T> T getJerseyProperty(String name) {
+ return (T) config.getProperties().get(name);
} | Pushing casting into the getter. | dropwizard_dropwizard | train | java |
f861395356ed6444e930f6531a165ea1e139ce62 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -12,7 +12,8 @@ setup(name='hamlpy',
url = 'http://github.com/jessemiller/HamlPy',
license = 'MIT',
install_requires = [
- 'pygments'
+ 'Django',
+ 'pygments'
],
entry_points = {
'console_scripts' : ['hamlpy = hamlpy.hamlpy:convert_files', | Readd Django because it,s really needed | jessemiller_HamlPy | train | py |
bbd1194bb9cfa01f5e755767c1a4ed7a01cc5eb1 | diff --git a/lib/Client.js b/lib/Client.js
index <HASH>..<HASH> 100644
--- a/lib/Client.js
+++ b/lib/Client.js
@@ -584,7 +584,7 @@ class Client extends EventEmitter {
if(!options.content && !options.file && !options.embeds) {
return Promise.reject(new Error("No content, file, or embeds"));
}
- if(options.content && options.disableEveryone !== undefined ? options.disableEveryone : this.options.disableEveryone) {
+ if(options.content && (options.disableEveryone !== undefined ? options.disableEveryone : this.options.disableEveryone)) {
options.content = options.content.replace(/@everyone/g, "@\u200beveryone").replace(/@here/g, "@\u200bhere");
}
return this.requestHandler.request("POST", Constants.Endpoints.WEBHOOK_TOKEN(webhookID, token) + (options.wait ? "?wait=true" : ""), true, { | fix this one-liner (#<I>) | abalabahaha_eris | train | js |
2ccb8f62edd5d1ce039e663591964b9066fd2f4e | diff --git a/excelize.go b/excelize.go
index <HASH>..<HASH> 100644
--- a/excelize.go
+++ b/excelize.go
@@ -273,6 +273,9 @@ func replaceStyleRelationshipsNameSpaceBytes(contentMarshal []byte) []byte {
// </row>
//
func (f *File) UpdateLinkedValue() error {
+ wb := f.workbookReader()
+ // recalculate formulas
+ wb.CalcPr = nil
for _, name := range f.GetSheetMap() {
xlsx, err := f.workSheetReader(name)
if err != nil { | Remove calculated properties to make recalculate formulas in some spreadsheet applications, such as Kingsoft WPS | 360EntSecGroup-Skylar_excelize | train | go |
f2ed7bb50180281a480eeb8204880fb2df9348eb | diff --git a/lib/rails_best_practices/version.rb b/lib/rails_best_practices/version.rb
index <HASH>..<HASH> 100644
--- a/lib/rails_best_practices/version.rb
+++ b/lib/rails_best_practices/version.rb
@@ -1,4 +1,4 @@
# encoding: utf-8
module RailsBestPractices
- VERSION = "1.5.1"
+ VERSION = "1.5.2"
end | Bumping version to <I> | flyerhzm_rails_best_practices | train | rb |
0732f13743afda0a3fa235f738c0c78258c3bb9d | diff --git a/object/datastore.go b/object/datastore.go
index <HASH>..<HASH> 100644
--- a/object/datastore.go
+++ b/object/datastore.go
@@ -269,6 +269,34 @@ func (d Datastore) AttachedHosts(ctx context.Context) ([]*HostSystem, error) {
return hosts, nil
}
+// AttachedHosts returns hosts that have this Datastore attached, accessible and writable and are members of the given cluster.
+func (d Datastore) AttachedClusterHosts(ctx context.Context, cluster *ComputeResource) ([]*HostSystem, error) {
+ var hosts []*HostSystem
+
+ clusterHosts, err := cluster.Hosts(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ attachedHosts, err := d.AttachedHosts(ctx)
+ if err != nil {
+ return nil, err
+ }
+
+ refs := make(map[types.ManagedObjectReference]bool)
+ for _, host := range attachedHosts {
+ refs[host.Reference()] = true
+ }
+
+ for _, host := range clusterHosts {
+ if refs[host.Reference()] {
+ hosts = append(hosts, host)
+ }
+ }
+
+ return hosts, nil
+}
+
func (d Datastore) Stat(ctx context.Context, file string) (types.BaseFileInfo, error) {
b, err := d.Browser(ctx)
if err != nil { | Introduce AttachedClusterHosts
A datastore could be attached to different hosts in different
clusters. | vmware_govmomi | train | go |
d958dc3077fcbfaa4a6af8488b721ed1ad8a2dde | diff --git a/src/js/core/height-match.js b/src/js/core/height-match.js
index <HASH>..<HASH> 100644
--- a/src/js/core/height-match.js
+++ b/src/js/core/height-match.js
@@ -59,7 +59,7 @@ export default function (UIkit) {
},
- events: ['resize']
+ events: ['load', 'resize']
}, | Fix height-match not working on initial page load
The uk-height-match attribute does not work on the initial page load, only when the browser window is resized. | uikit_uikit | train | js |
ea633f57870cef9df2849c0c23a42fe49f0357c9 | diff --git a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php
index <HASH>..<HASH> 100644
--- a/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php
+++ b/src/Symfony/Component/HttpKernel/EventListener/RouterListener.php
@@ -35,6 +35,7 @@ class RouterListener implements EventSubscriberInterface
private $matcher;
private $context;
private $logger;
+ private $request;
/**
* Constructor.
@@ -72,9 +73,10 @@ class RouterListener implements EventSubscriberInterface
*/
public function setRequest(Request $request = null)
{
- if (null !== $request) {
+ if (null !== $request && $this->request !== $request) {
$this->context->fromRequest($request);
}
+ $this->request = $request;
}
public function onKernelRequest(GetResponseEvent $event) | [HttpKernel] Avoid updating the context if the request did not change
Due to the BC $this->setRequest() call in the onKernelRequest method, the
request is set twice every time in Symfony, and RequestContext::fromRequest
takes 1ms to run here so if we can skip one call it is a win. | symfony_symfony | train | php |
d3265737cae62e27a5d4cfac4b35a0f1cb3c54c4 | diff --git a/atrcopy/kboot.py b/atrcopy/kboot.py
index <HASH>..<HASH> 100644
--- a/atrcopy/kboot.py
+++ b/atrcopy/kboot.py
@@ -75,6 +75,11 @@ def add_xexboot_header(bytes, bootcode=None, title="DEMO", author="an atari user
if bootcode is None:
bootcode = np.fromstring(xexboot_header, dtype=np.uint8)
+ else:
+ # don't insert title or author in user supplied bootcode; would have to
+ # assume that the user supplied everything desired in their own code!
+ title = ""
+ author = ""
bootsize = np.alen(bootcode)
v = bootcode[9:11].view(dtype="<u2")
v[0] = xex_size | Don't insert title or author when user supplies bootcode for XEX header | robmcmullen_atrcopy | train | py |
ebe76c862353abce3be10d950432d78f9ec8b234 | diff --git a/lib/Thelia/ImportExport/Export/Type/MailingExport.php b/lib/Thelia/ImportExport/Export/Type/MailingExport.php
index <HASH>..<HASH> 100644
--- a/lib/Thelia/ImportExport/Export/Type/MailingExport.php
+++ b/lib/Thelia/ImportExport/Export/Type/MailingExport.php
@@ -26,7 +26,7 @@ class MailingExport extends AbstractExport
protected $orderAndAliases = [
'newsletter.ID' => 'Identifier',
'newsletter.EMAIL' => 'Email',
- 'newsletter.FISTNAME' => 'FirstName',
+ 'newsletter.FIRSTNAME' => 'FirstName',
'newsletter.LASTNAME' => 'LastName'
]; | fix MailingExport FIRSTNAME | thelia_core | train | php |
0cbd9c94efe11a57ebb9423b55e8e10db04ca7b8 | diff --git a/src/main/java/org/camunda/bpm/model/bpmn/Bpmn.java b/src/main/java/org/camunda/bpm/model/bpmn/Bpmn.java
index <HASH>..<HASH> 100644
--- a/src/main/java/org/camunda/bpm/model/bpmn/Bpmn.java
+++ b/src/main/java/org/camunda/bpm/model/bpmn/Bpmn.java
@@ -45,10 +45,10 @@ public class Bpmn {
/** the singleton instance of {@link Bpmn}. If you want to customize the behavior of Bpmn,
* replace this instance with an instance of a custom subclass of {@link Bpmn}. */
- public static final Bpmn INSTANCE = new Bpmn();
+ public static Bpmn INSTANCE = new Bpmn();
/** the parser used by the Bpmn implementation. */
- private final BpmnParser bpmnParser = new BpmnParser();
+ private BpmnParser bpmnParser = new BpmnParser();
private final ModelBuilder bpmnModelBuilder;
/** The {@link Model}
@@ -162,7 +162,7 @@ public class Bpmn {
/**
* Register known types of the BPMN model
*/
- private Bpmn() {
+ protected Bpmn() {
bpmnModelBuilder = ModelBuilder.createInstance("BPMN Model");
doRegisterTypes(bpmnModelBuilder);
bpmnModel = bpmnModelBuilder.build(); | chore(Bpmn): make some fields non-public | camunda_camunda-bpmn-model | train | java |
030cded464166a462d072e426c67b662454b2f36 | diff --git a/host/state.go b/host/state.go
index <HASH>..<HASH> 100644
--- a/host/state.go
+++ b/host/state.go
@@ -133,6 +133,9 @@ func (s *State) Restore(backend Backend, buffers host.LogBuffers) (func(), error
// generate a new job id, this is a new job
newJob := job.Dup()
newJob.ID = cluster.GenerateJobID(s.id, "")
+ if _, ok := newJob.Config.Env["FLYNN_JOB_ID"]; ok {
+ newJob.Config.Env["FLYNN_JOB_ID"] = newJob.ID
+ }
log.Printf("resurrecting %s as %s", job.ID, newJob.ID)
s.AddJob(newJob)
backend.Run(newJob, nil, nil) | host: Update FLYNN_JOB_ID for resurrected jobs | flynn_flynn | train | go |
cfd6d8ee1df9ce6a26a3cb205dc62446f60595e6 | diff --git a/Facades/Validator.php b/Facades/Validator.php
index <HASH>..<HASH> 100755
--- a/Facades/Validator.php
+++ b/Facades/Validator.php
@@ -3,7 +3,7 @@
namespace Illuminate\Support\Facades;
/**
- * @method static \Illuminate\Contracts\Validation\Validator make(array $data, array $rules, array $messages = [], array $customAttributes = [])
+ * @method static \Illuminate\Contracts\Validation\Validator|\Illuminate\Validation\Validator make(array $data, array $rules, array $messages = [], array $customAttributes = [])
* @method static void includeUnvalidatedArrayKeys()
* @method static void excludeUnvalidatedArrayKeys()
* @method static void extend(string $rule, \Closure|string $extension, string $message = null) | Update return type hint for Validator::make() (#<I>)
I've added `\Illuminate\Validation\Validator` as one of the allowed return types of the `Validator::make()` method of the `Validator` Facade.
without it the `->validateWithBag` will be not be detected by the IDE, rendering an error of `Undefined method 'validateWithBag'.` | illuminate_support | train | php |
c8a05c55675a9c93a55e0dea183b8332dbb65844 | diff --git a/flask_appbuilder/console.py b/flask_appbuilder/console.py
index <HASH>..<HASH> 100644
--- a/flask_appbuilder/console.py
+++ b/flask_appbuilder/console.py
@@ -194,7 +194,7 @@ def babel_extract(config, input, output, target):
Babel, Extracts and updates all messages marked for translation
"""
click.echo(click.style('Starting Extractions config:{0} input:{1} output:{2}'.format(config, input, output), fg='green'))
- os.popen('pybabel extract -F {0} -k lazy_gettext -k gettext -o {1} {2}'.format(config, output, input))
+ os.popen('pybabel extract -F {0} -k lazy_gettext -k gettext -k __ -k _ -o {1} {2}'.format(config, output, input))
click.echo(click.style('Starting Update target:{0}'.format(target), fg='green'))
os.popen('pybabel update -N -i {0} -d {1}'.format(output, target))
click.echo(click.style('Finish, you can start your translations', fg='green')) | add `__` and `_` to the keywords of pybabel extract | dpgaspar_Flask-AppBuilder | train | py |
b400aeb6714e9ce9f58e031e81af752638b792f9 | diff --git a/tasks/docs.rb b/tasks/docs.rb
index <HASH>..<HASH> 100755
--- a/tasks/docs.rb
+++ b/tasks/docs.rb
@@ -157,19 +157,15 @@ namespace :docs_site do
# - what to do about "lazy default" for default?
def properties_list(properties)
properties.map do |property|
- if property["deprecated"] # we don't want to document deprecated properties
- nil
- else
- {
- "property" => property["name"],
- "ruby_type" => friendly_types_list(property["is"]),
- "required" => property["required"],
- "default_value" => friendly_default_value(property),
- # "allowed_values" => property["equal_to"].join(', '),
- "new_in" => property["introduced"],
- "description_list" => [{ "markdown" => property["description"] }],
- }
- end
+ {
+ "property" => property["name"],
+ "ruby_type" => friendly_types_list(property["is"]),
+ "required" => property["required"],
+ "default_value" => friendly_default_value(property),
+ # "allowed_values" => property["equal_to"].join(', '),
+ "new_in" => property["introduced"],
+ "description_list" => [{ "markdown" => property["description"] }],
+ }
end
end | Remove some property deprecation logic from the generator
We nuke these out of the list early on now | chef_chef | train | rb |
68e848343996cc958b07e40f2e009c5fb25e4b3c | diff --git a/src/Webpay/Oneclick/MallRefundTransactionResponse.php b/src/Webpay/Oneclick/MallRefundTransactionResponse.php
index <HASH>..<HASH> 100644
--- a/src/Webpay/Oneclick/MallRefundTransactionResponse.php
+++ b/src/Webpay/Oneclick/MallRefundTransactionResponse.php
@@ -28,6 +28,9 @@ class MallRefundTransactionResponse
$balance = isset($json["balance"]) ? $json["balance"] : null;
$this->setBalance($balance);
+
+ $responseCode = isset($json["response_code"]) ? $json["response_code"] : null;
+ $this->setResponseCode($responseCode);
}
/** | Add missing response code set logic oneclick mall refund | TransbankDevelopers_transbank-sdk-php | train | php |
8759a25a4db0ea1d9a24eb66a2c2764d922f4943 | diff --git a/generators/generator-base.js b/generators/generator-base.js
index <HASH>..<HASH> 100644
--- a/generators/generator-base.js
+++ b/generators/generator-base.js
@@ -1923,7 +1923,7 @@ module.exports = class extends Generator {
}
content +=
' // jhipster-needle-i18n-language-webpack - JHipster will add/remove languages in this array\n' +
- ' ]';
+ ' ]';
jhipsterUtils.replaceContent({
file: fullPath, | Format webpack common file when new language is added [ci skip] | jhipster_generator-jhipster | train | js |
b830f28c2e7fc5331bebf875e74330ad1a353e38 | diff --git a/src/lang-hs.js b/src/lang-hs.js
index <HASH>..<HASH> 100644
--- a/src/lang-hs.js
+++ b/src/lang-hs.js
@@ -77,7 +77,7 @@ PR.registerLangHandler(
// dashes -> '--' {'-'}
// opencom -> '{-'
// closecom -> '-}'
- [PR.PR_COMMENT, /^(?:(?:--+(?:[^\r\n\x0C_:\"\'\(\),;\[\]`\{\}][^\r\n\x0C_]*)?(?=[\x0C\r\n]|$))|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],
+ [PR.PR_COMMENT, /^(?:(?:--+(?:[^\r\n\x0C]*)?)|(?:\{-(?:[^-]|-+[^-\}])*-\}))/],
// reservedid -> case | class | data | default | deriving | do
// | else | if | import | in | infix | infixl | infixr
// | instance | let | module | newtype | of | then | bug <I>: haskell line comments could not contain curly brackets. | google_code-prettify | train | js |
f21143d011ad1ef10f8f4709f581bbe620b6e4b4 | diff --git a/test/e2e/specs/wp-signup-spec.js b/test/e2e/specs/wp-signup-spec.js
index <HASH>..<HASH> 100755
--- a/test/e2e/specs/wp-signup-spec.js
+++ b/test/e2e/specs/wp-signup-spec.js
@@ -1299,7 +1299,7 @@ describe( `[${ host }] Sign Up (${ screenSize }, ${ locale })`, function() {
StartPage.getStartURL( {
culture: locale,
flow: 'subdomain',
- query: 'vertical=a8c.1',
+ query: 'vertical=art',
} )
);
const designTypePage = await DesignTypePage.Expect( driver ); | Fix subdomains test by using vertical name (#<I>) | Automattic_wp-calypso | train | js |
7fddc11f5256bea8c8a7550ed447a1d37ddfedd4 | diff --git a/foolbox/adversarial.py b/foolbox/adversarial.py
index <HASH>..<HASH> 100644
--- a/foolbox/adversarial.py
+++ b/foolbox/adversarial.py
@@ -75,6 +75,21 @@ class Adversarial(object):
def original_class(self):
return self.__original_class
+ @property
+ def _model(self): # pragma: no cover
+ """Should not be used."""
+ return self.__model
+
+ @property
+ def _criterion(self): # pragma: no cover
+ """Should not be used."""
+ return self.__criterion
+
+ @property
+ def _distance(self): # pragma: no cover
+ """Should not be used."""
+ return self.__distance
+
def normalized_distance(self, image):
"""Calculates the distance of a given image to the
original image. | added properties for internal use (#<I>)
* added properties for internal use
* added no coverage comments | bethgelab_foolbox | train | py |
4a63d416ba64467ec1f6348fe63d7d8ea441a589 | diff --git a/types/convert_test.go b/types/convert_test.go
index <HASH>..<HASH> 100644
--- a/types/convert_test.go
+++ b/types/convert_test.go
@@ -986,8 +986,9 @@ func (s *testTypeConvertSuite) TestConvertJSONToDecimal(c *C) {
for _, tt := range tests {
j, err := json.ParseBinaryFromString(tt.In)
c.Assert(err, IsNil)
- casted, _ := ConvertJSONToDecimal(new(stmtctx.StatementContext), j)
- c.Assert(casted.Compare(tt.Out), Equals, 0)
+ casted, err := ConvertJSONToDecimal(new(stmtctx.StatementContext), j)
+ c.Assert(err, IsNil, Commentf("input: %v", tt.In))
+ c.Assert(casted.Compare(tt.Out), Equals, 0, Commentf("%#v != %#v", casted, tt.Out))
}
} | types: add more info in test to investigate the fail cause (#<I>) | pingcap_tidb | train | go |
51c74f265fd8b17e7af4956f63cde0d362505557 | diff --git a/python/setup.py b/python/setup.py
index <HASH>..<HASH> 100644
--- a/python/setup.py
+++ b/python/setup.py
@@ -86,6 +86,25 @@ def getversion():
return pkgversion
+if 'MAKEFLAGS' in os.environ:
+ # if setup.py is called from cmake, it reads and uses the MAKEFLAGS
+ # environment variable, which in turn gets picked up on by scikit-build.
+ # However, scikit-build uses make install to move the built .so to the
+ # right object, still in the build tree. This make invocation honours
+ # DESTDIR, which leads to unwanted items in the destination tree.
+ #
+ # If the MAKEFLAGS env var is set, remove DESTDIR from it.
+ #
+ # Without this: make install DESTDIR=/tmp
+ # /tmp/src/segyio/python/_skbuild/linux-x86_64-3.5/cmake-install/segyio/_segyio.so
+ # /tmp/usr/local/lib/python2.7/site-packages/segyio/_segyio.so
+ #
+ # with this the _skbuild install is gone
+ makeflags = os.environ['MAKEFLAGS']
+ flags = makeflags.split(' ')
+ flags = [flag for flag in flags if not flag.startswith('DESTDIR=')]
+ os.environ['MAKEFLAGS'] = ' '.join(flags)
+
skbuild.setup(
name = 'segyio',
description = 'Simple & fast IO for SEG-Y files', | Remove DESTDIR from MAKEFLAGS env var in setup.py
The scikit-build internal install step must specifically not respect
DESTDIR, as it is a part of the python library build phase, not install
phase. | equinor_segyio | train | py |
50ca099b8512f4d32f3e4517c502bc0aa37bab3a | diff --git a/lib/em-systemcommand/version.rb b/lib/em-systemcommand/version.rb
index <HASH>..<HASH> 100644
--- a/lib/em-systemcommand/version.rb
+++ b/lib/em-systemcommand/version.rb
@@ -1,5 +1,5 @@
module Em
module Systemcommand
- VERSION = "2.0.1"
+ VERSION = "2.0.2"
end
end | bumped version number to <I> | leoc_em-systemcommand | train | rb |
5e2f4c8497071c78b82b2497f572b8b2b74b220d | diff --git a/src/Discord/Repository/AbstractRepository.php b/src/Discord/Repository/AbstractRepository.php
index <HASH>..<HASH> 100755
--- a/src/Discord/Repository/AbstractRepository.php
+++ b/src/Discord/Repository/AbstractRepository.php
@@ -114,7 +114,7 @@ abstract class AbstractRepository implements ArrayAccess, Countable, IteratorAgg
false
)->then(function ($response) use ($deferred) {
$this->fill([]);
-
+
foreach ($response as $value) {
$value = array_merge($this->vars, (array) $value);
$part = $this->factory->create($this->part, $value, true);
@@ -199,6 +199,10 @@ abstract class AbstractRepository implements ArrayAccess, Countable, IteratorAgg
*/
public function delete($part)
{
+ if (! ($part instanceof Part)) {
+ $part = $this->factory->part($this->part, ['id' => $part], true);
+ }
+
if (! $part->created) {
return \React\Promise\reject(new \Exception('You cannot delete a non-existant part.'));
} | Added the ability to delete parts from repositories by ID | teamreflex_DiscordPHP | train | php |
8c411d03209b615a01b20febdf8c2fddc9bbdcee | diff --git a/languagetool-core/src/main/java/org/languagetool/rules/AbstractFindSuggestionsFilter.java b/languagetool-core/src/main/java/org/languagetool/rules/AbstractFindSuggestionsFilter.java
index <HASH>..<HASH> 100644
--- a/languagetool-core/src/main/java/org/languagetool/rules/AbstractFindSuggestionsFilter.java
+++ b/languagetool-core/src/main/java/org/languagetool/rules/AbstractFindSuggestionsFilter.java
@@ -45,10 +45,10 @@ public abstract class AbstractFindSuggestionsFilter extends RuleFilter {
public RuleMatch acceptRuleMatch(RuleMatch match, Map<String, String> arguments, int patternTokenPos,
AnalyzedTokenReadings[] patternTokens) throws IOException {
- if (match.getSentence().getText().contains("saperçoit")) {
- int ii=0;
- ii++;
- }
+// if (match.getSentence().getText().contains("saperçoit")) {
+// int ii=0;
+// ii++;
+// }
List<String> replacements = new ArrayList<>();
String wordFrom = getRequired("wordFrom", arguments); | [fr] comment out lines for debugging | languagetool-org_languagetool | train | java |
1bf639b391aa967f2c92fe98d3ec0b44bb9b12f2 | diff --git a/flag_string.go b/flag_string.go
index <HASH>..<HASH> 100644
--- a/flag_string.go
+++ b/flag_string.go
@@ -90,10 +90,7 @@ func (c *Context) String(name string) string {
func lookupString(name string, set *flag.FlagSet) string {
f := set.Lookup(name)
if f != nil {
- parsed, err := f.Value.String(), error(nil)
- if err != nil {
- return ""
- }
+ parsed := f.Value.String()
return parsed
}
return "" | remove useless variable declarations (#<I>) | urfave_cli | train | go |
96123224f928c0b386f22ebf6f2b85eba3d319d6 | diff --git a/zinnia/__init__.py b/zinnia/__init__.py
index <HASH>..<HASH> 100644
--- a/zinnia/__init__.py
+++ b/zinnia/__init__.py
@@ -1,5 +1,5 @@
"""Zinnia"""
-__version__ = '0.19.1.dev0'
+__version__ = '0.20'
__license__ = 'BSD License'
__author__ = 'Fantomas42' | Bumping to version <I> | Fantomas42_django-blog-zinnia | train | py |
72bd04aa0345357cddf747207717312e2425abb2 | diff --git a/lib/endpoint.js b/lib/endpoint.js
index <HASH>..<HASH> 100644
--- a/lib/endpoint.js
+++ b/lib/endpoint.js
@@ -119,7 +119,7 @@ Endpoint.prototype._readPrelude = function _readPrelude() {
Endpoint.prototype._initializeDataFlow = function _initializeDataFlow(role, settings) {
var firstStreamId, compressorRole, decompressorRole;
if (role === 'CLIENT') {
- firstStreamId = 3;
+ firstStreamId = 1;
compressorRole = 'REQUEST';
decompressorRole = 'RESPONSE';
} else { | Endpoint: reverting to 1 as first client stream ID. | molnarg_node-http2-protocol | train | js |
2d22414e60172bf6700089ba47f00b76a00912fd | diff --git a/ru/validation.php b/ru/validation.php
index <HASH>..<HASH> 100644
--- a/ru/validation.php
+++ b/ru/validation.php
@@ -60,7 +60,7 @@ return array(
"required_if" => "Поле :attribute обязательно для заполнения, когда :other равно :value.",
"required_with" => "Поле :attribute обязательно для заполнения, когда :values указано.",
"required_without" => "Поле :attribute обязательно для заполнения, когда :values не указано.",
- "required_without_all" => "The :attribute field is required when none of :values are present.",
+ "required_without_all" => "Поле :attribute обязательно для заполнения, когда ни одно из :values не указано.",
"same" => "Значение :attribute должно совпадать с :other.",
"size" => array(
"numeric" => "Поле :attribute должно быть :size.", | Adds russian translation for validation.required_without_all | caouecs_Laravel-lang | train | php |
7eb1df165082d02e9b85cdce7e04993ee5735810 | diff --git a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java
index <HASH>..<HASH> 100644
--- a/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java
+++ b/spring-boot-project/spring-boot-tools/spring-boot-gradle-plugin/src/test/java/org/springframework/boot/gradle/junit/GradleCompatibilitySuite.java
@@ -39,7 +39,7 @@ import org.springframework.boot.gradle.testkit.GradleBuild;
public final class GradleCompatibilitySuite extends Suite {
private static final List<String> GRADLE_VERSIONS = Arrays.asList("default", "4.1",
- "4.2", "4.3", "4.4.1", "4.5.1", "4.6", "4.7", "4.8.1", "4.9", "4.10");
+ "4.2", "4.3", "4.4.1", "4.5.1", "4.6", "4.7", "4.8.1", "4.9", "4.10.2");
public GradleCompatibilitySuite(Class<?> clazz) throws InitializationError {
super(clazz, createRunners(clazz)); | Test the Gradle Plugin against Gradle <I>
Closes gh-<I> | spring-projects_spring-boot | train | java |
339e76afecd0f65debac15d0f5f1460f3083717b | diff --git a/audio/audio.go b/audio/audio.go
index <HASH>..<HASH> 100644
--- a/audio/audio.go
+++ b/audio/audio.go
@@ -619,8 +619,6 @@ func (p *playerImpl) Seek(offset time.Duration) error {
}
p.m.Lock()
- defer p.m.Unlock()
-
o := int64(offset) * bytesPerSample * int64(p.sampleRate) / int64(time.Second)
o &= mask
@@ -630,12 +628,15 @@ func (p *playerImpl) Seek(offset time.Duration) error {
}
pos, err := seeker.Seek(o, io.SeekStart)
if err != nil {
+ p.m.Unlock()
return err
}
p.buf = nil
p.pos = pos
p.srcEOF = false
+ p.m.Unlock()
+
p.seekCh <- struct{}{}
<-p.seekedCh
return nil | audio: Bug fix: Dead lock at seeking
When sending something to channels, a lock should not be used,
or the receiver side might be using the same lock.
Bug: #<I> | hajimehoshi_ebiten | train | go |
96de38c3ab9021cd0bbb7a7230b99967a034b59e | diff --git a/user/edit_form.php b/user/edit_form.php
index <HASH>..<HASH> 100644
--- a/user/edit_form.php
+++ b/user/edit_form.php
@@ -54,7 +54,7 @@ class user_edit_form extends moodleform {
if ($langsel = $mform->getElementValue('lang')) {
$lang = reset($langsel);
// check lang exists
- if (get_string_manager()->translation_exists($lang, false)) {
+ if (!get_string_manager()->translation_exists($lang, false)) {
$lang_el =& $mform->getElement('lang');
$lang_el->setValue($CFG->lang);
}
diff --git a/user/editadvanced_form.php b/user/editadvanced_form.php
index <HASH>..<HASH> 100644
--- a/user/editadvanced_form.php
+++ b/user/editadvanced_form.php
@@ -74,7 +74,7 @@ class user_editadvanced_form extends moodleform {
if ($langsel = $mform->getElementValue('lang')) {
$lang = reset($langsel);
// check lang exists
- if (get_string_manager()->translation_exists($lang, false)) {
+ if (!get_string_manager()->translation_exists($lang, false)) {
$lang_el =& $mform->getElement('lang');
$lang_el->setValue($CFG->lang);
} | MDL-<I> fixed regression in last commit, sorry | moodle_moodle | train | php,php |
1df81d4c6c178593ac9e24b328ab98a9d1d8a5a4 | diff --git a/lib/vestal_versions.rb b/lib/vestal_versions.rb
index <HASH>..<HASH> 100644
--- a/lib/vestal_versions.rb
+++ b/lib/vestal_versions.rb
@@ -59,8 +59,7 @@ module LaserLemon
if versions.empty?
versions.create(:changes => attributes, :number => 1)
else
- reset_version
- versions.create(:changes => changes, :number => (version.to_i + 1))
+ versions.create(:changes => changes, :number => (last_version + 1))
end
reset_version | Avoided an extra query used to find the new version number during version creation. | laserlemon_vestal_versions | train | rb |
d6fe166ec191f183487823e2d1a0f2f48626c5b7 | diff --git a/tests/Integration/Validation/ValidationTest.php b/tests/Integration/Validation/ValidationTest.php
index <HASH>..<HASH> 100644
--- a/tests/Integration/Validation/ValidationTest.php
+++ b/tests/Integration/Validation/ValidationTest.php
@@ -3,6 +3,7 @@
namespace Tests\Integration\Validation;
use Illuminate\Contracts\Config\Repository as ConfigRepository;
+use Nuwave\Lighthouse\Support\AppVersion;
use Tests\TestCase;
/**
@@ -309,12 +310,16 @@ class ValidationTest extends TestCase
')
->assertGraphQLValidationError('bar', 'The bar must be at least 2 characters.');
+ $message = AppVersion::atLeast(8.32)
+ ? 'The bar must not be greater than 3 characters.'
+ : 'The bar may not be greater than 3 characters.';
+
$this
->graphQL(/** @lang GraphQL */ '
{
foo(bar: "fasdf")
}
')
- ->assertGraphQLValidationError('bar', 'The bar may not be greater than 3 characters.');
+ ->assertGraphQLValidationError('bar', $message);
}
} | Adapt ValidationTest to changed error message in Laravel 8 (#<I>) | nuwave_lighthouse | train | php |
71673bae7a9f146038355fc9b2ab5ad1991e1207 | diff --git a/lib/scorpio/google_api_document.rb b/lib/scorpio/google_api_document.rb
index <HASH>..<HASH> 100644
--- a/lib/scorpio/google_api_document.rb
+++ b/lib/scorpio/google_api_document.rb
@@ -177,11 +177,9 @@ module Scorpio
# check we haven't got anything that shouldn't go in a openapi document
openapi = ycomb do |rec|
proc do |object|
- if object.is_a?(Scorpio::JSON::Node)
- rec.call(object.content)
- elsif object.is_a?(Hash)
+ if object.respond_to?(:to_hash)
object.map { |k, v| {rec.call(k) => rec.call(v)} }.inject({}, &:update)
- elsif object.is_a?(Array)
+ elsif object.respond_to?(:to_ary)
object.map(&rec)
elsif object.is_a?(Symbol)
object.to_s | use duck typing when recursing google api document for conversion to openapi | notEthan_jsi | train | rb |
ecf27a9ebaea1b7453575ff26cb98379638ea946 | diff --git a/internal/goofys_test.go b/internal/goofys_test.go
index <HASH>..<HASH> 100644
--- a/internal/goofys_test.go
+++ b/internal/goofys_test.go
@@ -232,7 +232,7 @@ func (s *GoofysTest) setupDefaultEnv(t *C) (bucket string) {
"zero": bytes.NewReader([]byte{}),
}
- bucket = RandStringBytesMaskImprSrc(16)
+ bucket = "goofys-test-" + RandStringBytesMaskImprSrc(16)
s.setupEnv(t, bucket, s.env)
return bucket
}
@@ -1159,6 +1159,7 @@ func (s *GoofysTest) TestWriteAnonymous(t *C) {
s.fs.flags.TypeCacheTTL = 1 * time.Minute
fileName := "test"
+
createOp := fuseops.CreateFileOp{
Parent: s.getRoot(t).Id,
Name: fileName, | use a more unique name so its easier to bulk delete stray buckets | kahing_goofys | train | go |
ddf9a52ba8b03ae16e2269f02672e0e853d5a67a | diff --git a/examples/example.go b/examples/example.go
index <HASH>..<HASH> 100644
--- a/examples/example.go
+++ b/examples/example.go
@@ -21,6 +21,7 @@ func getRecords(ksis *kinesis.Kinesis, streamName, ShardId string) {
args.Add("ShardIterator", shardIterator)
resp11, err := ksis.GetRecords(args)
if err != nil {
+ time.Sleep(1000 * time.Millisecond)
continue
} | also sleep in rate-limit error handler | sendgridlabs_go-kinesis | train | go |
0ab8da8d8d59273dac9a5abfb2658d1cb8bdc7ca | diff --git a/lib/inline_svg/transform_pipeline/transformations/description.rb b/lib/inline_svg/transform_pipeline/transformations/description.rb
index <HASH>..<HASH> 100644
--- a/lib/inline_svg/transform_pipeline/transformations/description.rb
+++ b/lib/inline_svg/transform_pipeline/transformations/description.rb
@@ -1,12 +1,13 @@
module InlineSvg::TransformPipeline::Transformations
class Description < Transformation
def transform(doc)
- doc = Nokogiri::XML::Document.parse(doc.to_html)
- node = Nokogiri::XML::Node.new('desc', doc)
- node.content = value
- doc.search('svg desc').each { |node| node.remove }
- doc.at_css('svg').prepend_child(node)
- doc
+ with_svg(doc) do |svg|
+ node = Nokogiri::XML::Node.new("desc", doc)
+ node.content = value
+
+ svg.search("desc").each { |node| node.remove }
+ svg.prepend_child(node)
+ end
end
end
end | Handle documents without SVG root elements | jamesmartin_inline_svg | train | rb |
1ebddb05d498e1f3aeb5f94ca3fa18dfbff9886b | diff --git a/torequests/main.py b/torequests/main.py
index <HASH>..<HASH> 100644
--- a/torequests/main.py
+++ b/torequests/main.py
@@ -7,7 +7,6 @@ from concurrent.futures import (
ProcessPoolExecutor,
ThreadPoolExecutor,
as_completed,
- wait,
)
from concurrent.futures._base import Error, Executor, Future, TimeoutError
from concurrent.futures.thread import _threads_queues, _WorkItem
@@ -94,7 +93,10 @@ class NewExecutorPoolMixin(Executor):
def wait_futures_done(self, tasks=None):
# ignore the order of tasks
tasks = tasks or self._all_futures
- fs = [f.x for f in wait(tasks).done]
+ fs = []
+ for f in as_completed(tasks):
+ fs.append(f.x)
+ # fs = [f.x for f in wait(tasks).done]
return fs | fix #9 tPool.x can not be stop by keyboardinterupt | ClericPy_torequests | train | py |
6b0bb3fd654e2952ce70bf125505377d21ccbbc4 | diff --git a/aiotg/chat.py b/aiotg/chat.py
index <HASH>..<HASH> 100644
--- a/aiotg/chat.py
+++ b/aiotg/chat.py
@@ -63,6 +63,45 @@ class Chat:
**options
)
+ def get_chat(self):
+ """
+ Get information about the chat.
+ """
+ return self.bot.api_call(
+ "getChat",
+ chat_id=str(self.id)
+ )
+
+ def get_chat_administrators(self):
+ """
+ Get a list of administrators in a chat. Chat must not be private.
+ """
+ return self.bot.api_call(
+ "getChatAdministrators",
+ chat_id=str(self.id)
+ )
+
+ def get_chat_members_count(self):
+ """
+ Get the number of members in a chat.
+ """
+ return self.bot.api_call(
+ "getChatMembersCount",
+ chat_id=str(self.id)
+ )
+
+ def get_chat_member(self, user_id):
+ """
+ Get information about a member of a chat.
+
+ :param int user_id: Unique identifier of the target user
+ """
+ return self.bot.api_call(
+ "getChatMember",
+ chat_id=str(self.id),
+ user_id=str(user_id)
+ )
+
send_sticker = partialmethod(_send_to_chat, "sendSticker")
def send_audio(self, audio, **options): | Added new Telegram methods(#<I>)
getChat, getChatAdministrators, getChatMembersCount, getChatMember | szastupov_aiotg | train | py |
b8c68cacf4371745e8e2fe6d2e651fde070bd4fa | diff --git a/spec/main-spec.js b/spec/main-spec.js
index <HASH>..<HASH> 100644
--- a/spec/main-spec.js
+++ b/spec/main-spec.js
@@ -23,6 +23,11 @@ describe('RangePool', function() {
for (i = 0; i < 10; i++) {
pool.getWorker()
}
+ let total = 0
+ pool.workers.forEach(function(worker) {
+ total += worker.limitIndex - worker.startIndex
+ })
+ expect(total).toBe(500)
})
it('cries if we try to create a worker on a completed pool', function() {
const pool = getRangePool(500)
@@ -150,6 +155,7 @@ describe('RangePool', function() {
workerB.advance(5)
const poolClone = RangePool.unserialize(pool.serialize())
+ poolClone.workers.forEach(worker => worker.setActive(true))
expect(pool.length).toEqual(poolClone.length)
expect(pool.hasCompleted()).toEqual(poolClone.hasCompleted())
expect([...pool.workers]).toEqual([...poolClone.workers]) | :white_check_mark: Add more specs | steelbrain_range-pool | train | js |
792124f34a8b75afb6cd366171db79dc926334d0 | diff --git a/irc/client.py b/irc/client.py
index <HASH>..<HASH> 100644
--- a/irc/client.py
+++ b/irc/client.py
@@ -89,14 +89,6 @@ except Exception:
VERSION_STRING = 'unknown'
VERSION = ()
-# TODO
-# ----
-# (maybe) color parser convenience functions
-# documentation (including all event types)
-# (maybe) add awareness of different types of ircds
-# send data asynchronously to the server (and DCC connections)
-# (maybe) automatically close unused, passive DCC connections after a while
-
# NOTES
# -----
# connection.quit() only sends QUIT to the server. | Remove TODOs. Features can be ticket as needed/desired. | jaraco_irc | train | py |
500e3c62f5477ab2ac9ede949390335490379ec1 | diff --git a/src/objective/fields.py b/src/objective/fields.py
index <HASH>..<HASH> 100644
--- a/src/objective/fields.py
+++ b/src/objective/fields.py
@@ -53,9 +53,19 @@ class Mapping(core.Field):
_type = dict
+ def _create_serialize_type(self, value, environment=None):
+ """Resolve the type for serialization."""
+
+ return self._type()
+
+ def _create_deserialize_type(self, value, environment=None):
+ """Resolve the type for deserialization."""
+
+ return self._type()
+
def _serialize(self, value, environment=None):
- mapping = self._type()
+ mapping = self._create_serialize_type(value, environment)
invalids = []
@@ -87,7 +97,7 @@ class Mapping(core.Field):
"""
# traverse items and match against validated struct
- mapping = self._type()
+ mapping = self._create_deserialize_type(value, environment)
invalids = [] | added methods for de/serialization types creation | diefans_objective | train | py |
4351227ebd8fec1513cd97479d56d33f0b935ff0 | diff --git a/src/Web/WebClient.php b/src/Web/WebClient.php
index <HASH>..<HASH> 100644
--- a/src/Web/WebClient.php
+++ b/src/Web/WebClient.php
@@ -53,6 +53,7 @@ class WebClient
const OPERA = 21;
const ANDROIDTABLET = 22;
const EDGE = 23;
+ const BLINK = 24;
/**
* @var integer The detected platform on which the web client runs.
@@ -381,6 +382,10 @@ class WebClient
{
$this->engine = self::EDGE;
}
+ elseif (stripos($userAgent, 'Chrome') !== false || (stripos($userAgent, 'Opera') !== false && stripos($userAgent, 'Presto') == false))
+ {
+ $this->engine = self::BLINK;
+ }
elseif (stripos($userAgent, 'AppleWebKit') !== false || stripos($userAgent, 'blackberry') !== false)
{
// Evidently blackberry uses WebKit and doesn't necessarily report it. Bad RIM. | Add Blink Web engine
Add the Blink Web engine that chrome and Opera now run on | joomla-framework_application | train | php |
438c887b3a4d35c5a0222e472af4a327efd062ed | diff --git a/jquery.datetimepicker.js b/jquery.datetimepicker.js
index <HASH>..<HASH> 100644
--- a/jquery.datetimepicker.js
+++ b/jquery.datetimepicker.js
@@ -583,9 +583,12 @@
options.onShow&&options.onShow.call&&(onShow=options.onShow.call(datetimepicker,datetimepicker.data('xdsoft_datetime').currentTime,datetimepicker.data('input')));
if( onShow!==false ){
var setPos = function(){
- var offset = datetimepicker.data('input').offset(), top = offset.top+datetimepicker.data('input')[0].offsetHeight-1;
+ var offset = datetimepicker.data('input').offset(), top = offset.top+datetimepicker.data('input')[0].offsetHeight-1, left = offset.left;
if( top+datetimepicker[0].offsetHeight>$('body').height() )
top = offset.top-datetimepicker[0].offsetHeight+1;
+ if( left+datetimepicker[0].offsetWidth>$('body').width() )
+ left = offset.left-datetimepicker[0].offsetWidth+datetimepicker.data('input')[0].offsetWidth;
+
datetimepicker.css({
left:offset.left,
top:top | Added condition to check if there is enough space on the right side of an input field
When the input field is close to the right side of the page and the calendar width
is bigger than the width of input field + right offset then calendard will be placed
on the left side of the field (by default it's placed on the right side). | xdan_datetimepicker | train | js |
17193c02e5b1d06f544c2e80a05da212efcdb2f2 | diff --git a/client/client.go b/client/client.go
index <HASH>..<HASH> 100644
--- a/client/client.go
+++ b/client/client.go
@@ -210,14 +210,12 @@ func (c *Conn) Loop() error {
if err := c.Pong(msg); err != nil {
return err
}
- log.Printf("Sent PONG.")
}
if msg.Command == "ERROR" {
// After sending QUIT, the server acknowledges it with an ERROR
// command.
if c.sentQUIT {
- log.Printf("Received QUIT acknowledgement. Closing connection.")
return c.conn.Close()
}
} | Remove some overly verbose logging | horgh_irc | train | go |
27b37b3073e96c83eb44df7aa9e681f19379c87c | diff --git a/src/DayPicker.js b/src/DayPicker.js
index <HASH>..<HASH> 100644
--- a/src/DayPicker.js
+++ b/src/DayPicker.js
@@ -1,5 +1,3 @@
-/* eslint-disable react/no-did-update-set-state */
-
import React, { Component } from 'react';
import PropTypes from 'prop-types';
@@ -171,6 +169,7 @@ export class DayPicker extends Component {
!DateUtils.isSameMonth(prevProps.month, this.props.month)
) {
const currentMonth = this.getCurrentMonthFromProps(this.props);
+ // eslint-disable-next-line react/no-did-update-set-state
this.setState({ currentMonth });
}
} | Allow setState in cdu | gpbl_react-day-picker | train | js |
d874f8b546d8fae95bc92d8461b8189e51cb731b | diff --git a/examples/src/main/python/sql.py b/examples/src/main/python/sql.py
index <HASH>..<HASH> 100644
--- a/examples/src/main/python/sql.py
+++ b/examples/src/main/python/sql.py
@@ -18,6 +18,7 @@
from __future__ import print_function
import os
+import sys
from pyspark import SparkContext
from pyspark.sql import SQLContext
@@ -50,7 +51,11 @@ if __name__ == "__main__":
# A JSON dataset is pointed to by path.
# The path can be either a single text file or a directory storing text files.
- path = os.path.join(os.environ['SPARK_HOME'], "examples/src/main/resources/people.json")
+ if len(sys.argv) < 2:
+ path = "file://" + \
+ os.path.join(os.environ['SPARK_HOME'], "examples/src/main/resources/people.json")
+ else:
+ path = sys.argv[1]
# Create a DataFrame from the file(s) pointed to by path
people = sqlContext.jsonFile(path)
# root | [PySpark][Minor] Update sql example, so that can read file correctly
To run Spark, default will read file from HDFS if we don't set the schema. | apache_spark | train | py |
1097daf12134c8738b6a0f41433b719a703218a5 | diff --git a/html/pfappserver/root/static/js/node.js b/html/pfappserver/root/static/js/node.js
index <HASH>..<HASH> 100644
--- a/html/pfappserver/root/static/js/node.js
+++ b/html/pfappserver/root/static/js/node.js
@@ -120,7 +120,9 @@ NodeView.prototype.readNode = function(e) {
NodeView.prototype.readViolations = function(e) {
var btn = $(e.target);
- var target = $(btn.attr("href"));
+ var name = btn.attr("href");
+ var target = $(name.substr(name.indexOf('#')));
+ var url = btn.attr("data-href");
if (target.children().length == 0)
target.load(btn.attr("data-href"), function() {
target.find('.switch').bootstrapSwitch(); | IE: Fix loading of violations in node editor | inverse-inc_packetfence | train | js |
2e67b90ad226d439741ae6093c5665d6fbe580ed | diff --git a/manager/lib/bixby/modules/metrics.rb b/manager/lib/bixby/modules/metrics.rb
index <HASH>..<HASH> 100644
--- a/manager/lib/bixby/modules/metrics.rb
+++ b/manager/lib/bixby/modules/metrics.rb
@@ -183,7 +183,7 @@ class Metrics < API
metadata[:tenant_id] = check.agent.host.org.tenant.id
# save
- time = Time.at(result["timestamp"])
+ time = result["timestamp"].to_i
metric["metrics"].each do |k,v|
key = "#{base}#{k}"
put(key, v, time, metadata) | integer value will do for timestamp | chetan_bixby-agent | train | rb |
4eb3e9ad067c91260e71d967f6432408cee496aa | diff --git a/uuid.js b/uuid.js
index <HASH>..<HASH> 100644
--- a/uuid.js
+++ b/uuid.js
@@ -139,12 +139,6 @@
// cycle to simulate higher resolution clock
var nsecs = options.nsecs != null ? options.nsecs : _lastNSecs + 1;
- // Per 4.2.1.2 If generator creates more than one uuid per 100-ns
- // interval, throw an error
- if (nsecs >= 10000) {
- throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
- }
-
// Time since last uuid creation (in msecs)
var dt = (msecs - _lastMSecs) + (nsecs - _lastNSecs)/10000;
@@ -160,6 +154,12 @@
nsecs = 0;
}
+ // Per 4.2.1.2 If generator creates more than one uuid per 100-ns
+ // interval, throw an error
+ if (nsecs >= 10000) {
+ throw new Error('uuid.v1(): Can\'t create more than 10M uuids/sec');
+ }
+
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq; | Don't throw the error so early, might result in unnecessary errors. | kelektiv_node-uuid | train | js |
ae2982556526f4ef7e9955433cfd73a43acf4c27 | diff --git a/src/pydoc_markdown/contrib/renderers/mkdocs.py b/src/pydoc_markdown/contrib/renderers/mkdocs.py
index <HASH>..<HASH> 100644
--- a/src/pydoc_markdown/contrib/renderers/mkdocs.py
+++ b/src/pydoc_markdown/contrib/renderers/mkdocs.py
@@ -97,7 +97,12 @@ class MkdocsRenderer(Struct):
def _visit(page, path):
def _update_nodes(x):
- x.visible = _match(page, x)
+ x.visible = x.visible and _match(page, x)
+ # Make sure all parents are visible as well.
+ while x and x.visible:
+ x = x.parent
+ if x:
+ x.visible = True
clone = copy.deepcopy(graph)
clone.visit(_update_nodes)
yield path, page, clone.modules
@@ -150,5 +155,5 @@ class MkdocsRenderer(Struct):
yaml.dump(config, fp)
@override
- def get_resolver(self, _graph):
- return None # TODO
+ def get_resolver(self, graph):
+ return self.markdown.get_resolver(graph) | MkdocsRenderer.get_resolver() returns the MarkdownRenderers resolver to at least link within the same file. Make sure parent objects are visible when a child was selected | NiklasRosenstein_pydoc-markdown | train | py |
b3277ab8780b8338c9f697ae80996aa1408fb2d8 | diff --git a/setup.py b/setup.py
index <HASH>..<HASH> 100644
--- a/setup.py
+++ b/setup.py
@@ -19,7 +19,9 @@ import setuptools
setup(
name='amptrac',
version='0.0',
- description='',
+ url='https://github.com/tomprince/amptrac',
+ description="Client for twisted's amp interface to trac",
+ license='MIT',
author='Tom Prince',
author_email='tom.prince@ualberta.net',
packages=['amptrac', 'amptrac.scripts', 'amptrac.test'], | Update license in setup.py. | twisted-infra_amptrac | train | py |
586ca75bcc185d20e6ae9cde4de15304266cfdf9 | diff --git a/make/configFile.js b/make/configFile.js
index <HASH>..<HASH> 100644
--- a/make/configFile.js
+++ b/make/configFile.js
@@ -49,8 +49,11 @@ const
module.exports = class ConfigFile {
- constructor () {
+ constructor (readSourceFiles = false) {
this.read();
+ if (readSourceFiles) {
+ this.readSourceFiles();
+ }
}
getFileName () { | Enables reading source files during construction (#<I>) | ArnaudBuchholz_gpf-js | train | js |
3bfbd676502e4672ff00c8bea876c904087d7042 | diff --git a/lib/net/ssh/authentication/session.rb b/lib/net/ssh/authentication/session.rb
index <HASH>..<HASH> 100644
--- a/lib/net/ssh/authentication/session.rb
+++ b/lib/net/ssh/authentication/session.rb
@@ -68,7 +68,12 @@ module Net; module SSH; module Authentication
attempted << name
debug { "trying #{name}" }
- method = Methods.const_get(name.split(/\W+/).map { |p| p.capitalize }.join).new(self, :key_manager => key_manager)
+ begin
+ method = Methods.const_get(name.split(/\W+/).map { |p| p.capitalize }.join).new(self, :key_manager => key_manager)
+ rescue NameError => ne
+ debug{"Mechanism #{name} was requested, but isn't a known type. Ignoring it."}
+ next
+ end
return true if method.authenticate(next_service, username, password)
rescue Net::SSH::Authentication::DisallowedMethod | Avoid dying when unsupported auth mechanisms are defined (e.g. kerberos-related) | net-ssh_net-ssh | train | rb |
c0964e863ac9579bbce28ea435f5fd8057e01bbe | diff --git a/web_resources/lib/predDB.js b/web_resources/lib/predDB.js
index <HASH>..<HASH> 100644
--- a/web_resources/lib/predDB.js
+++ b/web_resources/lib/predDB.js
@@ -140,6 +140,14 @@ function JSONRPC_send_method(method_name, parameters, function_to_call) {
});
}
+function call_and_save(method_name, parameters) {
+ callback_func = function(returnedData) {
+ window.last_function_return = returnedData
+ console.log(returnedData)
+ }
+ JSONRPC_send_method(method_name, parameters, callback_func)
+}
+
function to_upper_case(str) {
return str.toUpperCase()
} | add helper function call_and_save to call arbitrary middleware functions | probcomp_crosscat | train | js |
f24ca4313609ffd67a6e20d7010ec01aabe57f7f | diff --git a/src/Twig/EasyAdminTwigExtension.php b/src/Twig/EasyAdminTwigExtension.php
index <HASH>..<HASH> 100644
--- a/src/Twig/EasyAdminTwigExtension.php
+++ b/src/Twig/EasyAdminTwigExtension.php
@@ -117,7 +117,7 @@ class EasyAdminTwigExtension extends AbstractExtension
return sprintf('%s #%s', \get_class($value), $value->getId());
}
- return sprintf('%s #%s', \get_class($value), substr(md5(sspl_object_hash($value)), 0, 7));
+ return sprintf('%s #%s', \get_class($value), substr(md5(spl_object_hash($value)), 0, 7));
}
return ''; | fixed typo spl_object_hash in twig extension | EasyCorp_EasyAdminBundle | train | php |
e5d899e0ad47c55bb31be7415842926eba2ea7cd | diff --git a/omnibus_overrides.rb b/omnibus_overrides.rb
index <HASH>..<HASH> 100644
--- a/omnibus_overrides.rb
+++ b/omnibus_overrides.rb
@@ -1,6 +1,6 @@
# DO NOT EDIT. Generated by "rake dependencies". Edit version_policy.rb instead.
override :rubygems, version: "2.6.4"
-override :bundler, version: "1.12.3"
+override :bundler, version: "1.11.2"
override "libffi", version: "3.2.1"
override "libiconv", version: "1.14"
override "liblzma", version: "5.2.2" | use a version ofm bundler that we have | chef_chef | train | rb |
f5c8c7a4eaf5fe77ec94b618cdce1873e0149c67 | diff --git a/js/gemini.js b/js/gemini.js
index <HASH>..<HASH> 100644
--- a/js/gemini.js
+++ b/js/gemini.js
@@ -301,8 +301,8 @@ module.exports = class gemini extends Exchange {
};
const ticker = await this.publicGetPubtickerSymbol (this.extend (request, params));
const timestamp = this.safeInteger (ticker['volume'], 'timestamp');
- const baseCurrency = this.safeString (market, 'base');
- const quoteCurrency = this.safeString (market, 'quote');
+ const baseCurrency = market['base']; // unified structures are guaranteed to have unified fields
+ const quoteCurrency = market['quote']; // so we don't need safe-methods for unified structures
const last = this.safeFloat (ticker, 'last');
return {
'symbol': symbol, | gemini fetchTicker minor edit for unified market structure | ccxt_ccxt | train | js |
7a680a8045cbd619be20f1a54a819e341bb643dd | diff --git a/src/BayesianModel.py b/src/BayesianModel.py
index <HASH>..<HASH> 100644
--- a/src/BayesianModel.py
+++ b/src/BayesianModel.py
@@ -11,16 +11,15 @@ class BayesianModel(nx.DiGraph):
--------------
add_nodes('node1', 'node2', ...)
add_edges(('node1', 'node2', ...), ('node3', 'node4', ...))
- set_states('node1', ('state1', 'state2', ...))
+ add_states('node1', ('state1', 'state2', ...))
get_states('node1')
add_rule_for_states('node1', ('state2', 'state1', ...))
add_rule_for_parents('node1', ('parent1', 'parent2', ...))
get_parents('node1')
- set_cpd('node1', cpd1)
+ add_tablularcpd('node1', cpd1)
get_cpd('node1')
- set_observed(observations, reset=False)
- reset_observed('node1', ...)
- reset_observed()
+ add_observations(observations, reset=False)
+ reset_observed_nodes('node1', ...)
is_observed('node1')
active_trail_nodes('node1')
is_active_trail('node1', 'node2') | Changed the docstring of the class BayesianModel to reflect the changes in the function-names | pgmpy_pgmpy | train | py |
8479f215e01ed9a00529e43506e2d942b268f679 | diff --git a/client.go b/client.go
index <HASH>..<HASH> 100644
--- a/client.go
+++ b/client.go
@@ -389,10 +389,7 @@ func (cl *Client) acceptConnections(l net.Listener) {
return
}
if err != nil {
- log.Print(err)
- // I think something harsher should happen here? Our accept
- // routine just fucked off.
- return
+ log.Printf("error accepting connection: %s", err)
}
go func() {
if reject { | Don't return if there's an error accepting
This happens if there's too many file descriptors, and left the client unresponsive. | anacrolix_torrent | train | go |
633949862fc486675145a5943371ad05612f9692 | diff --git a/tests/StreamServerNodeTest.php b/tests/StreamServerNodeTest.php
index <HASH>..<HASH> 100644
--- a/tests/StreamServerNodeTest.php
+++ b/tests/StreamServerNodeTest.php
@@ -9,7 +9,7 @@ class StreamServerNodeTest extends \PHPUnit_Framework_TestCase {
const CLASS_NAME = '\noFlash\CherryHttp\StreamServerNode';
/**
- * @var StreamServerNode.php:38
+ * @var \Psr\Log\LoggerInterface
*/
private $loggerMock; | Corrected PHPDoc for loggerMock in StreamServerNodeTest. | kiler129_CherryHttp | train | php |
802de379f828bf23be95970fb00326a3b80b5e5b | diff --git a/lib/enumerize/attribute.rb b/lib/enumerize/attribute.rb
index <HASH>..<HASH> 100644
--- a/lib/enumerize/attribute.rb
+++ b/lib/enumerize/attribute.rb
@@ -17,6 +17,11 @@ module Enumerize
@default_value = find_default_value(options[:default])
raise ArgumentError, 'invalid default value' unless @default_value
end
+
+ # Define methods to get each value
+ @values.each do |name, value|
+ define_method(name) { value.value }
+ end
end
def find_default_value(value) | Defined methods to get the value of enums from the class Ex:
User.role.admin #=> 2 | brainspec_enumerize | train | rb |
e60b67e89665b2bbb5618cb3aa7a944fb75bfd76 | diff --git a/src/interfaces/mpqc.py b/src/interfaces/mpqc.py
index <HASH>..<HASH> 100644
--- a/src/interfaces/mpqc.py
+++ b/src/interfaces/mpqc.py
@@ -57,6 +57,7 @@ class MpqcJob(object):
self.filename = filename
self.title = title
self.input_molecule = input_molecule
+ self.ran = False
self.summary = {}
def write_input(self, f):
@@ -156,6 +157,7 @@ class MpqcJob(object):
if not self.completed:
raise ExternalError("Output file of external job is not complete (%s)" % self.filename)
self.process_output_summary()
+ self.ran = True
return recycled | Added ran attribute to MPQC jobs. | molmod_molmod | train | py |
fca08e846505e8bf416380ee04d871e2ed9eace2 | diff --git a/tests/test_spark_launcher.py b/tests/test_spark_launcher.py
index <HASH>..<HASH> 100644
--- a/tests/test_spark_launcher.py
+++ b/tests/test_spark_launcher.py
@@ -58,3 +58,12 @@ def test_spark_driver_memory():
c.conf.spark.driver.memory = "5g"
c._set_environment_variables()
assert '--driver-memory 5g' in os.environ['PYSPARK_SUBMIT_ARGS']
+
+
+@pytest.mark.xfail(True, reason="Config parameter priority not sorted out yet")
+def test_config_priority():
+ c = sparklauncher.SparkConfiguration()
+ c.driver_memory = "4g"
+ c.conf.spark.driver.memory = "5g"
+ c._set_environment_variables()
+ assert '--driver-memory 5g' in os.environ['PYSPARK_SUBMIT_ARGS'] | TST: Add test that exposes config priority issue | Valassis-Digital-Media_spylon | train | py |
2ffc013354110cdf60f8145d021baa3f3dd19c29 | diff --git a/src/request/sign-message/SignMessage.js b/src/request/sign-message/SignMessage.js
index <HASH>..<HASH> 100644
--- a/src/request/sign-message/SignMessage.js
+++ b/src/request/sign-message/SignMessage.js
@@ -32,6 +32,9 @@ class SignMessage {
/** @type {HTMLInputElement} */
const $message = ($page.querySelector('#message'));
+ /** @type {HTMLInputElement} */
+ const $tabSize = ($page.querySelector("#tabselect"));
+
// Loads last used size from localStorage.
let loadedSize = localStorage.getItem("tab-size");
if (!loadedSize) loadedSize = "8"; | Fixed missing variable.
This is why we test even after copying from working source lol | nimiq_keyguard-next | train | js |
e9e844d0eaf79be2b6f14abae8ba68b30483af3c | diff --git a/lib/fluent/config/dsl.rb b/lib/fluent/config/dsl.rb
index <HASH>..<HASH> 100644
--- a/lib/fluent/config/dsl.rb
+++ b/lib/fluent/config/dsl.rb
@@ -67,7 +67,11 @@ module Fluent
proxy.element.instance_exec(&block)
@elements.push(proxy.to_config_element)
else
- @attrs[name.to_s] = value.to_s
+ @attrs[name.to_s] = if value.is_a?(Array) || value.is_a?(Hash)
+ JSON.dump(value)
+ else
+ value.to_s
+ end
end
self | Support array / hash in DSL | fluent_fluentd | train | rb |
bdecd8ded5e44136ac0748cfa9f9ed07580d2a1a | diff --git a/lib/adapters/idb.js b/lib/adapters/idb.js
index <HASH>..<HASH> 100644
--- a/lib/adapters/idb.js
+++ b/lib/adapters/idb.js
@@ -189,6 +189,7 @@ function IdbPouch(opts, callback) {
}
var results = [];
+ var fetchedDocs = {};
var docsWritten = 0;
function writeMetaData(e) {
@@ -203,7 +204,14 @@ function IdbPouch(opts, callback) {
return;
}
var currentDoc = docInfos.shift();
- var req = txn.objectStore(DOC_STORE).get(currentDoc.metadata.id);
+ var id = currentDoc.metadata.id;
+
+ if (id in fetchedDocs) {
+ // if newEdits=false, can re-use the same id from this batch
+ return updateDoc(fetchedDocs[id], currentDoc);
+ }
+
+ var req = txn.objectStore(DOC_STORE).get(id);
req.onsuccess = function process_docRead(event) {
var oldDoc = event.target.result;
if (!oldDoc) {
@@ -381,6 +389,7 @@ function IdbPouch(opts, callback) {
delete metadata.deletedOrLocal;
delete metadata.winningRev;
results.push(docInfo);
+ fetchedDocs[docInfo.metadata.id] = docInfo.metadata;
utils.call(callback);
};
}; | (#<I>) - add fetchedDocs optimization to idb
Follow-up to #<I>. If it's good enough for
websql, then it's good enough for idb. | pouchdb_pouchdb | train | js |
7cee3ec66e0630eabf6acb03daed462cb358e779 | diff --git a/lib/systemd/journal/navigable.rb b/lib/systemd/journal/navigable.rb
index <HASH>..<HASH> 100644
--- a/lib/systemd/journal/navigable.rb
+++ b/lib/systemd/journal/navigable.rb
@@ -29,9 +29,9 @@ module Systemd
# Move the read pointer by `offset` entries.
# @param [Integer] offset how many entries to move the read pointer by.
# If this value is positive, the read pointer moves forward. Otherwise,
- # it moves backwards.
+ # it moves backwards. Defaults to moving forward one entry.
# @return [Integer] number of entries the read pointer actually moved.
- def move(offset)
+ def move(offset = 1)
offset > 0 ? move_next_skip(offset) : move_previous_skip(-offset)
end | default to moving forward one entry for move() | ledbettj_systemd-journal | train | rb |
ac0394e7ed143caee1fd39e95961848015ffa36b | diff --git a/etcd/etcd.go b/etcd/etcd.go
index <HASH>..<HASH> 100644
--- a/etcd/etcd.go
+++ b/etcd/etcd.go
@@ -52,8 +52,15 @@ type EtcdAdapter struct {
}
func (r *EtcdAdapter) Ping() error {
- rr := etcd.NewRawRequest("GET", "version", nil, nil)
- _, err := r.client.SendRequest(rr)
+ var err error
+ if r.client != nil {
+ rr := etcd.NewRawRequest("GET", "version", nil, nil)
+ _, err = r.client.SendRequest(rr)
+ } else {
+ rr := etcd2.NewRawRequest("GET", "version", nil, nil)
+ _, err = r.client2.SendRequest(rr)
+ }
+
if err != nil {
return err
} | Fix bug in etcd backend when connecting to etcd2 | gliderlabs_registrator | train | go |
ea06037a69dab400fb17eed02f95fca7ef507c19 | diff --git a/Cmfcmf/OpenWeatherMap/Forecast.php b/Cmfcmf/OpenWeatherMap/Forecast.php
index <HASH>..<HASH> 100644
--- a/Cmfcmf/OpenWeatherMap/Forecast.php
+++ b/Cmfcmf/OpenWeatherMap/Forecast.php
@@ -67,7 +67,7 @@ class Forecast extends CurrentWeather
$windSpeedUnit = 'mps';
}
- $this->wind = new Wind(new Unit($xml->windSpeed['mps'], $windSpeedUnit, $xml->windSpeed['name']), new Unit($xml->windDirection['value'], $xml->windDirection['code'], $xml->windDirection['name']));
+ $this->wind = new Wind(new Unit($xml->windSpeed['mps'], $windSpeedUnit, $xml->windSpeed['name']), new Unit($xml->windDirection['deg'], $xml->windDirection['code'], $xml->windDirection['name']));
$this->clouds = new Unit($xml->clouds['all'], $xml->clouds['unit'], $xml->clouds['value']);
$this->precipitation = new Unit($xml->precipitation['value'], null, $xml->precipitation['type']);
$this->sun = new Sun(new \DateTime($xml->city->sun['rise']), new \DateTime($xml->city->sun['set'])); | Fix wind direction retrieval, closes #<I>. | cmfcmf_OpenWeatherMap-PHP-Api | train | php |
3aaaf4d4e32cef43f9d4d0cf7c02c6dc63a51ad6 | diff --git a/lib/cc/cli/version_checker.rb b/lib/cc/cli/version_checker.rb
index <HASH>..<HASH> 100644
--- a/lib/cc/cli/version_checker.rb
+++ b/lib/cc/cli/version_checker.rb
@@ -65,8 +65,12 @@ module CC
begin
uri = URI.parse(ENV.fetch("CODECLIMATE_VERSIONS_URL", DEFAULT_VERSIONS_URL))
uri.query = { version: version, uid: global_config.uuid }.to_query
+
+ request = Net::HTTP::Get.new(uri)
+ request["User-Agent"] = user_agent
+
Net::HTTP.start(uri.host, uri.port, open_timeout: 5, read_timeout: 5, ssl_timeout: 5, use_ssl: uri.scheme == "https") do |http|
- http.request_get(uri)
+ http.request(request)
end
end
end
@@ -82,6 +86,10 @@ module CC
@version ||= Version.new.version
end
+ def user_agent
+ "Code Climate CLI #{version}"
+ end
+
def global_config
@global_config ||= GlobalConfig.new
end | Set custom user agent for version check requests (#<I>)
We want to be able to keep track of requests from the CLI | codeclimate_codeclimate | train | rb |
9af7bf1aeebab66a01d8ee3dd3a2c63072707388 | diff --git a/src/FieldGroup/FieldGroup.js b/src/FieldGroup/FieldGroup.js
index <HASH>..<HASH> 100644
--- a/src/FieldGroup/FieldGroup.js
+++ b/src/FieldGroup/FieldGroup.js
@@ -2,7 +2,6 @@ import React, { PureComponent, Children, cloneElement } from 'react'
import PropTypes from 'prop-types'
import classnames from 'classnames'
import omit from 'lodash/omit'
-import defaults from 'lodash/defaults'
import { injectSheet } from '../theme'
import { isolateMixin } from '../style/mixins'
@@ -138,10 +137,7 @@ export default class FieldGroup extends PureComponent {
else if (i === count)
groupPosition = 'end'
i++
- return cloneElement(
- child,
- defaults({}, child.props, {...props, disabled, variation, groupPosition})
- )
+ return cloneElement(child, {...props, disabled, variation, groupPosition})
})}
</div>
) | Fix overriding field group children props | rambler-digital-solutions_rambler-ui | train | js |
69083edab02f05c590e73c16cb46c4403fb2494e | diff --git a/lib/intercom-rails/auto_include_filter.rb b/lib/intercom-rails/auto_include_filter.rb
index <HASH>..<HASH> 100644
--- a/lib/intercom-rails/auto_include_filter.rb
+++ b/lib/intercom-rails/auto_include_filter.rb
@@ -60,7 +60,7 @@ module IntercomRails
def enabled_for_environment?
enabled_environments = IntercomRails.config.enabled_environments
return true if enabled_environments.nil?
- enabled_environments.include?(Rails.env)
+ enabled_environments.map(&:to_s).include?(Rails.env)
end
end | Ensure that we're comparing strings when checking envs | intercom_intercom-rails | train | rb |
627d2968a5d304c6daf1d3e14ad987898d3dd0b9 | diff --git a/rapidoid-oauth/src/main/java/org/rapidoid/oauth/OAuthTokenHandler.java b/rapidoid-oauth/src/main/java/org/rapidoid/oauth/OAuthTokenHandler.java
index <HASH>..<HASH> 100644
--- a/rapidoid-oauth/src/main/java/org/rapidoid/oauth/OAuthTokenHandler.java
+++ b/rapidoid-oauth/src/main/java/org/rapidoid/oauth/OAuthTokenHandler.java
@@ -105,7 +105,7 @@ public class OAuthTokenHandler implements Handler {
x.sessionSet("_user", user);
U.must(x.user() == user);
- return x.redirect("/");
+ return x.goBack(0);
} else {
String error = x.param("error");
if (error != null) { | Improved login flow (to navigate to the last page after a login). | rapidoid_rapidoid | train | java |
d10a77f9a2000e62317970a853b1240aedf2f3a5 | diff --git a/pkg/cmd/cli/describe/projectstatus.go b/pkg/cmd/cli/describe/projectstatus.go
index <HASH>..<HASH> 100644
--- a/pkg/cmd/cli/describe/projectstatus.go
+++ b/pkg/cmd/cli/describe/projectstatus.go
@@ -449,13 +449,12 @@ func describeDeploymentPodSummaryInline(deploy *kapi.ReplicationController, incl
return s
}
change := ""
- if changing, ok := deployutil.DeploymentDesiredReplicas(deploy); ok {
- switch {
- case changing < deploy.Spec.Replicas:
- change = fmt.Sprintf(" reducing to %d", changing)
- case changing > deploy.Spec.Replicas:
- change = fmt.Sprintf(" growing to %d", changing)
- }
+ desired := deploy.Spec.Replicas
+ switch {
+ case desired < deploy.Status.Replicas:
+ change = fmt.Sprintf(" reducing to %d", desired)
+ case desired > deploy.Status.Replicas:
+ change = fmt.Sprintf(" growing to %d", desired)
}
return fmt.Sprintf(" - %s%s", s, change)
} | describe: Use spec.replicas when describing a deployment
The desired replicas annotation that was used so far isn't updated so it cannot represent the desired replicas number of a deployment | openshift_origin | train | go |
e33322649d6ef403df2e803b9f6ca95a4abdea9e | diff --git a/src/Label.php b/src/Label.php
index <HASH>..<HASH> 100644
--- a/src/Label.php
+++ b/src/Label.php
@@ -40,6 +40,11 @@ class Label extends Element
return $this->element->valid();
}
+ public function getValue()
+ {
+ return $this->element->getValue();
+ }
+
public function raw()
{
return $this->txt; | forward getValue to underlying element | monolyth-php_formulaic | train | php |
6f9aa1b88892de8fcf5c9895ac9c25b45f96378f | diff --git a/cmd/helm/repo.go b/cmd/helm/repo.go
index <HASH>..<HASH> 100644
--- a/cmd/helm/repo.go
+++ b/cmd/helm/repo.go
@@ -65,8 +65,7 @@ func runRepoList(cmd *cobra.Command, args []string) error {
return err
}
if len(f.Repositories) == 0 {
- fmt.Println("No repositories to show")
- return nil
+ return errors.New("no repositories to show")
}
table := uitable.New()
table.MaxColWidth = 50 | fix(helm): change helm repo list to return error when empty
Following other commands, an empty list should return an error. | helm_helm | train | go |
13bb4d153a31b745812da0296dab418534871f82 | diff --git a/builder/qemu/builder.go b/builder/qemu/builder.go
index <HASH>..<HASH> 100644
--- a/builder/qemu/builder.go
+++ b/builder/qemu/builder.go
@@ -398,6 +398,7 @@ func (b *Builder) Run(ui packer.Ui, hook packer.Hook, cache packer.Cache) (packe
Host: commHost,
SSHConfig: sshConfig,
SSHPort: commPort,
+ WinRMPort: commPort,
},
)
} | qemu builder now needs to explicitly set WinRMPort for StepConnect
Same as vbox builders, aligns qemu with changes to
helper/communicator/step_connect.go introduced by PR #<I> | hashicorp_packer | train | go |
7e272efde7fd9571b0de8add889ea34a7ffab989 | diff --git a/samcli/commands/init/interactive_init_flow.py b/samcli/commands/init/interactive_init_flow.py
index <HASH>..<HASH> 100644
--- a/samcli/commands/init/interactive_init_flow.py
+++ b/samcli/commands/init/interactive_init_flow.py
@@ -29,10 +29,6 @@ Generating application:
-----------------------
Location: {location}
Output Directory: {output_dir}
-
-To do this without interactive prompts, you can run:
-
- sam init --location {location} --output-dir {output_dir}
""".format(
location=location, output_dir=output_dir
)
@@ -89,10 +85,6 @@ Dependency Manager: {dependency_manager}
Application Template: {app_template}
Output Directory: {output_dir}
-Non-interactive init command with parameters:
-
- sam init --name {name} --runtime {runtime} --dependency-manager {dependency_manager} --app-template {app_template} --output-dir {output_dir}
-
Next steps can be found in the README file at {output_dir}/{name}/README.md
""".format(
name=name, | Remove non-interactive command explainer (#<I>) | awslabs_aws-sam-cli | train | py |
fcc227c08ac4df55200a2739445d67b81e85ad03 | diff --git a/lib/framework/rho/rhoviewhelpers.rb b/lib/framework/rho/rhoviewhelpers.rb
index <HASH>..<HASH> 100644
--- a/lib/framework/rho/rhoviewhelpers.rb
+++ b/lib/framework/rho/rhoviewhelpers.rb
@@ -142,8 +142,9 @@ module Rho
amurl << '/' << application.to_s << '/' if application
amurl << model.to_s
- if action.nil? or ( !defined?(RHO_WP7) && action == 'create') or action == 'index'
- amurl << query << fragment
+ is_bb6 = System::get_property('platform') == 'Blackberry' && (System::get_property('os_version').split('.')[0].to_i >= 6)
+ if action.nil? or ( !defined?(RHO_WP7) && !is_bb6 && action == 'create' ) or action == 'index'
+ amurl << query << fragment
else
amurl << '/' << (id.nil? ? action : id + '/' + action) << query << fragment
end | :create action fix for BB6 platform | rhomobile_rhodes | train | rb |
f9e8f31588642d551ed42c04ac143d5218bdac0c | diff --git a/scripts/budo.js b/scripts/budo.js
index <HASH>..<HASH> 100644
--- a/scripts/budo.js
+++ b/scripts/budo.js
@@ -17,7 +17,7 @@ var consts = {
ENTRY: './src/index.js',
DIST: 'dist/aframe.js',
BUILD: 'build/aframe.js',
- WATCH: 'examples/**/*',
+ WATCH: 'examples/**/*', // Additional files to watch for LiveReload
PORT: 9000
}; | add comment for clarity on why src/lib/etc is not needed | aframevr_aframe | train | js |
d879e61343f1c6d35963722be652ea155917ebc7 | diff --git a/src/Neuron/Core/Template.php b/src/Neuron/Core/Template.php
index <HASH>..<HASH> 100755
--- a/src/Neuron/Core/Template.php
+++ b/src/Neuron/Core/Template.php
@@ -42,9 +42,13 @@ class Template
* Create a template.
* @param $template
*/
- public function __construct ($template = null)
+ public function __construct ($template = null, $values = array ())
{
$this->template = $template;
+
+ foreach ($values as $name => $value) {
+ $this->set ($name, $value);
+ }
}
/** | Template set methods should return the template itself. | CatLabInteractive_Neuron | train | php |
137a43cf5b1049fc73b8cdb3bca69ae1807eda93 | diff --git a/lib/brightbox-cli/tables.rb b/lib/brightbox-cli/tables.rb
index <HASH>..<HASH> 100644
--- a/lib/brightbox-cli/tables.rb
+++ b/lib/brightbox-cli/tables.rb
@@ -83,7 +83,7 @@ module Brightbox
if options[:vertical]
data options[:fields].collect { |k| [k, row[k]].join("\t") }.join("\n")
else
- data options[:fields].collect { |k| row[k] }.join("\t")
+ data options[:fields].collect { |k| row[k].is_a?(Array) ? row[k].join(',') : row[k] }.join("\t")
end
end
else | Join arrays before they are passed to simple table output | brightbox_brightbox-cli | train | rb |
2c0a33bcdc1d772ba64c45ed1bff4458f9889bdc | diff --git a/pytest-server-fixtures/pytest_server_fixtures/base2.py b/pytest-server-fixtures/pytest_server_fixtures/base2.py
index <HASH>..<HASH> 100644
--- a/pytest-server-fixtures/pytest_server_fixtures/base2.py
+++ b/pytest-server-fixtures/pytest_server_fixtures/base2.py
@@ -123,7 +123,7 @@ class TestServerV2(Workspace):
elif self._server_class == 'kubernetes':
return KubernetesServer(self.get_cmd, self.env, image=self.image)
else:
- raise "Invalid server class: {}".format(server_class)
+ raise "Invalid server class: {}".format(self._server_class)
def _wait_for_go(self, start_interval=0.1, retries_per_interval=3, retry_limit=28, base=2.0):
""" | fix an undeclared variable in TestServerV2 | manahl_pytest-plugins | train | py |
da6d5669b33127879bc549d609eef222fd315183 | diff --git a/pkg/scheduler/framework/plugins/helper/node_affinity.go b/pkg/scheduler/framework/plugins/helper/node_affinity.go
index <HASH>..<HASH> 100644
--- a/pkg/scheduler/framework/plugins/helper/node_affinity.go
+++ b/pkg/scheduler/framework/plugins/helper/node_affinity.go
@@ -65,7 +65,6 @@ func NodeMatchesNodeAffinity(affinity *v1.NodeAffinity, node *v1.Node) bool {
// nodeMatchesNodeSelector checks if a node's labels satisfy a list of node selector terms,
// terms are ORed, and an empty list of terms will match nothing.
func nodeMatchesNodeSelector(node *v1.Node, nodeSelector *v1.NodeSelector) bool {
- // TODO(#96164): parse this error earlier in the plugin so we only need to do it once per Pod.
matches, _ := corev1.MatchNodeSelectorTerms(node, nodeSelector)
return matches
} | Remove outdated TODO in node_affinity.go | kubernetes_kubernetes | train | go |
bac088f8a35a67f91c74b0f9f76420b2d7fd9367 | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -12,7 +12,7 @@ function findClosestSemverMatch(semverString, semverStringArray) {
return Math.abs(
(parsedSemverA.major * 100 + parsedSemverA.minor * 10 + parsedSemverA.patch) -
- (parsedSemverB.major * 100 + parsedSemverB.minor * 10 + parsedSemverB.patch),
+ (parsedSemverB.major * 100 + parsedSemverB.minor * 10 + parsedSemverB.patch)
)
}) | Removed trailing comma | pastelsky_semver-closest | train | js |
b846f3af2bb0ca817ba2d066fb957dfc03c4d501 | diff --git a/safe/definitions/hazard.py b/safe/definitions/hazard.py
index <HASH>..<HASH> 100644
--- a/safe/definitions/hazard.py
+++ b/safe/definitions/hazard.py
@@ -367,12 +367,8 @@ hazard_volcano = {
'compulsory_fields': [hazard_value_field],
'fields': hazard_fields,
'extra_fields': [hazard_name_field],
-<<<<<<< HEAD
- 'layer_modes': [layer_mode_classified, layer_mode_continuous],
+ 'layer_modes': [layer_mode_classified],
'disabled_exposures': [exposure_place]
-=======
- 'layer_modes': [layer_mode_classified]
->>>>>>> Fix wizard flow.
}
hazard_all = [
hazard_flood, | Fix letfover problem from rebasing. | inasafe_inasafe | train | py |
95fa353ee928a42de1923d0f961e40d4ce201443 | diff --git a/builtin/providers/atlas/resource_artifact.go b/builtin/providers/atlas/resource_artifact.go
index <HASH>..<HASH> 100644
--- a/builtin/providers/atlas/resource_artifact.go
+++ b/builtin/providers/atlas/resource_artifact.go
@@ -138,7 +138,7 @@ func resourceArtifactRead(d *schema.ResourceData, meta interface{}) error {
} else if len(vs) > 1 {
return fmt.Errorf(
"Got %d results for '%s/%s', only one is allowed",
- user, name, len(vs))
+ len(vs), user, name)
}
v := vs[0] | builtin/providers/atlas: vet fix
Fixes the following vet report:
builtin/providers/atlas/resource_artifact.go:<I>: arg user for printf verb %d of wrong type: string | hashicorp_terraform | train | go |
e032103bb2fa09520665edbb7a6a6f91f7c7e0e3 | diff --git a/src/Rebing/GraphQL/GraphQL.php b/src/Rebing/GraphQL/GraphQL.php
index <HASH>..<HASH> 100644
--- a/src/Rebing/GraphQL/GraphQL.php
+++ b/src/Rebing/GraphQL/GraphQL.php
@@ -138,7 +138,7 @@ class GraphQL
}
}
- public function addType($class, $name = null)
+ public function addType(string $class, string $name = null): void
{
if (! $name) {
$type = is_object($class) ? $class : app($class); | Add types to \Rebing\GraphQL\GraphQL::addType | rebing_graphql-laravel | train | php |
efcd436f26946216eadc0c8e3c8ea0b0b337509c | diff --git a/examples/js/Editor.js b/examples/js/Editor.js
index <HASH>..<HASH> 100644
--- a/examples/js/Editor.js
+++ b/examples/js/Editor.js
@@ -1,8 +1,6 @@
(function () {
var
- D = Flotr.DOM,
-
ID_EXAMPLE_EDIT = '#example-edit',
ID_EXAMPLE_EDITOR = '#example-editor',
ID_EXAMPLE_RUN = '#example-run', | Removed reference to Flotr.DOM. | HumbleSoftware_Flotr2 | train | js |
face26d285065b236d361652e0291cf56c1426da | diff --git a/views/js/controller/manageMedia.js b/views/js/controller/manageMedia.js
index <HASH>..<HASH> 100644
--- a/views/js/controller/manageMedia.js
+++ b/views/js/controller/manageMedia.js
@@ -20,12 +20,6 @@ define([
start : function(){
var $previewer = $('.previewer');
- $('#edit-media').off()
- .on('click', function(){
- var action = {binding : "load", url: helpers._url('editMedia', 'MediaImport', 'taoMediaManager')};
- binder.exec(action, {classUri : $(this).data('classuri'), id : $(this).data('uri')} || this._resourceContext);
- });
-
var file = {};
file.url = $previewer.data('url');
file.mime = $previewer.data('type');
@@ -40,6 +34,12 @@ define([
}
$previewer.previewer(file);
});
+
+ $('#edit-media').off()
+ .on('click', function(){
+ var action = {binding : "load", url: helpers._url('editMedia', 'MediaImport', 'taoMediaManager')};
+ binder.exec(action, {classUri : $(this).data('classuri'), id : $(this).data('uri')} || this._resourceContext);
+ });
}
}; | put var declaration at the beginning of the method | oat-sa_extension-tao-mediamanager | train | js |
f7a596b728dce7a63e3fa74c9c5dc90397e64ef5 | diff --git a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
index <HASH>..<HASH> 100644
--- a/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
+++ b/server/src/test/java/com/ning/billing/jaxrs/TestJaxrsBase.java
@@ -24,7 +24,7 @@ import java.util.Iterator;
import java.util.Map;
import javax.inject.Inject;
-import javax.servlet.http.HttpServlet;
+import javax.servlet.Servlet;
import org.eclipse.jetty.servlet.FilterHolder;
import org.joda.time.LocalDate;
@@ -89,7 +89,7 @@ public class TestJaxrsBase extends KillbillClient {
protected static final int DEFAULT_HTTP_TIMEOUT_SEC = 6000; // 5;
@Inject
- protected OSGIServiceRegistration<HttpServlet> servletRouter;
+ protected OSGIServiceRegistration<Servlet> servletRouter;
protected static TestKillbillGuiceListener listener; | server: fix Guice injection failure in TestJaxrsBase | killbill_killbill | train | java |
36dd2533641d0db289e0f411ff82dcf0f63dd6fb | diff --git a/src/rlpx/peer.js b/src/rlpx/peer.js
index <HASH>..<HASH> 100644
--- a/src/rlpx/peer.js
+++ b/src/rlpx/peer.js
@@ -39,6 +39,7 @@ class Peer extends EventEmitter {
// Auth, Ack, Header, Body
this._state = 'Auth'
+ this._weHello = null
this._hello = null
this._nextPacketSize = 307
@@ -238,7 +239,9 @@ class Peer extends EventEmitter {
this._connected = true
this._pingIntervalId = setInterval(() => this._sendPing(), PING_INTERVAL)
- this.emit('connect')
+ if (this._weHello) {
+ this.emit('connect')
+ }
break
case PREFIXES.DISCONNECT:
@@ -301,7 +304,12 @@ class Peer extends EventEmitter {
this._id
]
- this._sendMessage(PREFIXES.HELLO, rlp.encode(payload))
+ if (!this._closed) {
+ this._sendMessage(PREFIXES.HELLO, rlp.encode(payload))
+ if (this._hello) {
+ this.emit('connect')
+ }
+ }
}
_sendPing () { | Only send connect event after both HELLO msgs are exchanged (fixes unreliable upper-protocol communication start) | ethereumjs_ethereumjs-vm | train | js |
d50bdec5ef543acba8484e2a9792a4b4faa03780 | diff --git a/tasks/qunit.js b/tasks/qunit.js
index <HASH>..<HASH> 100644
--- a/tasks/qunit.js
+++ b/tasks/qunit.js
@@ -98,6 +98,8 @@ module.exports = function(grunt) {
if (failed > 0) {
grunt.log.writeln();
logFailedAssertions();
+ } else if (total === 0) {
+ grunt.warn('0/0 assertions ran (' + duration + 'ms)');
} else {
grunt.log.ok();
}
@@ -151,6 +153,7 @@ module.exports = function(grunt) {
grunt.util.async.forEachSeries(urls, function(url, next) {
var basename = path.basename(url);
grunt.verbose.subhead('Testing ' + url).or.write('Testing ' + url);
+ console.log(); // add newline
// Reset current module.
currentModule = null; | Adding failure condition upon no tests run in a single test module/file instead of only on a qunit test target | gruntjs_grunt-contrib-qunit | train | js |
170b40df8aebf52e67edb8148f9bcedec59fdd81 | diff --git a/test/lib/model.js b/test/lib/model.js
index <HASH>..<HASH> 100644
--- a/test/lib/model.js
+++ b/test/lib/model.js
@@ -31,7 +31,7 @@ var modelBatch = function(typeName, className, testSchema, testData) {
var classKey = 'and we get its '+className+' class export';
var instKey;
- if ("aeiouAEIOU".indexOf(typeName.charCodeAt(0)) !== -1) {
+ if ("aeiouAEIOU".indexOf(typeName.charAt(0)) !== -1) {
instKey = 'and we create an '+typeName+' instance';
} else {
instKey = 'and we create a '+typeName+' instance'; | charCodeAt => charAt | pump-io_pump.io | train | js |
43ed24dfb7188f896ba7e49523a9604464ad2cbe | diff --git a/src/Gordalina/Easypay/Response/FetchAllPayments.php b/src/Gordalina/Easypay/Response/FetchAllPayments.php
index <HASH>..<HASH> 100644
--- a/src/Gordalina/Easypay/Response/FetchAllPayments.php
+++ b/src/Gordalina/Easypay/Response/FetchAllPayments.php
@@ -10,6 +10,7 @@
*/
namespace Gordalina\Easypay\Response;
+use Gordalina\Easypay\Payment\PaymentComplete;
class FetchAllPayments extends AbstractResponse implements ResponseInterface
{
@@ -43,7 +44,11 @@ class FetchAllPayments extends AbstractResponse implements ResponseInterface
'ep_status' => 'status',
'ep_message' => 'message',
'ep_num_records' => 'recordCount',
- 'ref_detail' => array('records', function (array $payments) {
+ 'ref_detail' => array('records', function (array $payments) use ($content) {
+ if($content['ep_num_records'] == 1) {
+ return [PaymentComplete::fromArray($payments)];
+ }
+
return FetchAllPayments::normalizePayments($payments);
})
)); | Solved an error if the response only contains one value
Easypay response ref field is not a multidimensional array if only one record is returned. | gordalina_easypay-php | train | php |
d25f04e3af7db5677149a7bf6ab771a3449edebf | diff --git a/index.js b/index.js
index <HASH>..<HASH> 100644
--- a/index.js
+++ b/index.js
@@ -42,7 +42,8 @@ function Passport(Users, config) {
github: {
clientID: process.env.GITHUB_CLIENT_ID,
clientSecret: process.env.GITHUB_CLIENT_SECRET,
- callbackURL: process.env.GITHUB_CALLBACK_URL
+ callbackURL: process.env.GITHUB_CALLBACK_URL,
+ scope: ['user:email']
},
otp: {
codeField: process.env.OTP_CODE_FIELD || 'passcode', | fix: added scope to main strategy for github | ladjs_passport | train | js |
9927568d980d57851e182bb87c395a3c2a7cbce3 | diff --git a/modules/cms/classes/ComponentBase.php b/modules/cms/classes/ComponentBase.php
index <HASH>..<HASH> 100644
--- a/modules/cms/classes/ComponentBase.php
+++ b/modules/cms/classes/ComponentBase.php
@@ -277,23 +277,4 @@ abstract class ComponentBase extends Extendable
return $default;
}
-
- /**
- * @deprecated Returns a defined property or parameter value.
- * @todo Remove this method if year >= 2015
- * @see Docs: Components > External Parameters
- * @param $name The property or parameter name to look for.
- * @param $default A default value to return if no value is found.
- * @return string
- */
- public function propertyOrParam($name, $default = null)
- {
- $value = $this->property($name, $default);
-
- if (substr($value, 0, 1) == ':') {
- return $this->param(substr($value, 1), $default);
- }
-
- return $value;
- }
} | Removed the deprecated propertyOrParam() | octobercms_october | train | php |
b63de2d6f36a57271085bca624a125846c4038c8 | diff --git a/sample-config.js b/sample-config.js
index <HASH>..<HASH> 100644
--- a/sample-config.js
+++ b/sample-config.js
@@ -15,7 +15,7 @@ config.debug = false; // for additional logging / debugging
config.watch = {
- // see https://github.com/askmike/gekko#supported-exchanges
+ // see https://gekko.wizb.it/docs/introduction/supported_exchanges.html
exchange: 'poloniex',
currency: 'USDT',
asset: 'BTC', | point to supported exchanges page on doc site, see #<I> | askmike_gekko | train | js |
Subsets and Splits
Java Commits in Train Set
Queries for all entries where the diff_languages column is 'java', providing a filtered dataset but without deeper analysis.
Java Commits Test Data
Returns a subset of 5000 entries from the dataset where the programming language difference is Java, providing basic filtering for exploration.
Java Commits Sample
Retrieves the first 1,000 records where the 'diff_languages' column is 'java', providing limited insight into the specific data entries.
Java Commits Validation Sample
Retrieves a sample of entries from the validation dataset where the diff languages are Java, providing limited insight into specific Java-related data points.
Java Commits in Validation
This query retrieves a limited sample of entries from the validation dataset where the programming language difference is Java, providing basic filtering with minimal insight.
Java Commits Sample
This query retrieves a sample of 100 records where the 'diff_languages' is 'java', providing basic filtering but limited analytical value.
Java Commits Sample
Retrieves 100 samples where the language difference is Java, providing basic filtering but minimal analytical value.
Java Commits Sample
Retrieves 10 samples where the diff_languages column is 'java', providing basic examples of data entries with this specific language.
Java Commits Validation Sample
Retrieves 1,000 records where the differences in languages are marked as Java, providing a snapshot of that specific subset but limited to raw data.
Java Commits Sample
This query retrieves 1000 random samples from the dataset where the programming language is Java, offering limited insight beyond raw data.