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
146bcccfdbcacc2c62778f6f81672db4f36a9745
diff --git a/src/server/pfs/cmds/cmds.go b/src/server/pfs/cmds/cmds.go index <HASH>..<HASH> 100644 --- a/src/server/pfs/cmds/cmds.go +++ b/src/server/pfs/cmds/cmds.go @@ -1324,7 +1324,7 @@ func putFileHelper(c *client.APIClient, pfc client.PutFileClient, } putFile := func(reader io.ReadSeeker) error { if split == "" { - if overwrite { + if overwrite && reader != os.Stdin { return sync.PushFile(c, pfc, client.NewFile(repo, commit, path), reader) } _, err := pfc.PutFile(repo, commit, path, reader)
Fix bug that crashed put file -o from stdin.
pachyderm_pachyderm
train
go
ebd0d00b859bf438d61aa31d478e3c27b9745fae
diff --git a/src/main/java/org/minimalj/model/Keys.java b/src/main/java/org/minimalj/model/Keys.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/minimalj/model/Keys.java +++ b/src/main/java/org/minimalj/model/Keys.java @@ -95,7 +95,7 @@ public class Keys { property = new ChainedProperty(enclosingProperty, property); } - boolean fill = !type.getName().startsWith("java"); + boolean fill = !type.getName().startsWith("java") && !type.isArray(); if (fill && depth < 6) { fillFields(value, property, depth + 1); }
Keys: don't fail for arrays Normally arrays are not allowed in model entities. It's not possible to persist arrays. At least not yet probably byte[] will be added. But for the password field a char[] is used.
BrunoEberhard_minimal-j
train
java
94a0298c8675529a0faef000c42e7e7ac2199e1f
diff --git a/lib/peer.js b/lib/peer.js index <HASH>..<HASH> 100644 --- a/lib/peer.js +++ b/lib/peer.js @@ -22,6 +22,7 @@ function Peer(id, options) { port: util.CLOUD_PORT, key: 'peerjs', path: '/', + token: util.randomToken(), config: util.defaultConfig }, options); this.options = options; @@ -150,7 +151,7 @@ Peer.prototype._retrieveId = function(cb) { Peer.prototype._initialize = function(id) { var self = this; this.id = id; - this.socket.start(this.id); + this.socket.start(this.id, this.options.token); } /** Handles messages from the server. */ diff --git a/lib/socket.js b/lib/socket.js index <HASH>..<HASH> 100644 --- a/lib/socket.js +++ b/lib/socket.js @@ -21,10 +21,9 @@ util.inherits(Socket, EventEmitter); /** Check in with ID or get one from server. */ -Socket.prototype.start = function(id) { +Socket.prototype.start = function(id, token) { this.id = id; - var token = util.randomToken(); this._httpUrl += '/' + id + '/' + token; this._wsUrl += '&id='+id+'&token='+token;
Expose connection token in Peer options
peers_peerjs
train
js,js
456158f54a149166e6e8ace5b8baf44581c724a2
diff --git a/build_package.py b/build_package.py index <HASH>..<HASH> 100644 --- a/build_package.py +++ b/build_package.py @@ -19,6 +19,7 @@ except ImportError: # Should not happen, but at worst in most case this is the s from pip._vendor.packaging.version import parse as Version, InvalidVersion DEFAULT_DEST_FOLDER = "./dist" +OMITTED_RELEASE_PACKAGES = ['azure-keyvault'] def create_package(name, dest_folder=DEFAULT_DEST_FOLDER): absdirpath = os.path.abspath(name) @@ -31,6 +32,7 @@ def travis_build_package(): This method prints on stdout for Travis. Return is obj to pass to sys.exit() directly """ + travis_tag = os.environ.get('TRAVIS_TAG') if not travis_tag: print("TRAVIS_TAG environment variable is not present") @@ -48,6 +50,10 @@ def travis_build_package(): print("Version must be a valid PEP440 version (version is: {})".format(version)) return "Version must be a valid PEP440 version (version is: {})".format(version) + if name.lower() in OMITTED_RELEASE_PACKAGES: + print("The input package {} has been disabled for release from Travis.CI.".format(name)) + return + abs_dist_path = Path(os.environ['TRAVIS_BUILD_DIR'], 'dist') create_package(name, str(abs_dist_path))
Adding Azure-Keyvault To List of Omitted Releases (#<I>) * list of packages that are to be ignored * moving omittedreleases to global. * updating capitalization
Azure_azure-sdk-for-python
train
py
bb8e2ce8d755f285ffa46d0205a9b27827ae0947
diff --git a/java/server/src/org/openqa/selenium/grid/Main.java b/java/server/src/org/openqa/selenium/grid/Main.java index <HASH>..<HASH> 100644 --- a/java/server/src/org/openqa/selenium/grid/Main.java +++ b/java/server/src/org/openqa/selenium/grid/Main.java @@ -17,8 +17,6 @@ package org.openqa.selenium.grid; -import static java.util.Comparator.comparing; - import org.openqa.selenium.cli.CliCommand; import org.openqa.selenium.cli.WrappedPrintWriter; @@ -40,6 +38,8 @@ import java.util.TreeSet; import java.util.logging.Level; import java.util.logging.Logger; +import static java.util.Comparator.comparing; + public class Main { private static final Logger LOG = Logger.getLogger(Main.class.getName()); @@ -65,7 +65,7 @@ public class Main { jars.add(file); } } else { - System.err.println("WARNING: Extension file or directory does not exist: " + file); + LOG.warning("WARNING: Extension file or directory does not exist: " + file); } }
[grid] Use logging rather than syserr to log warnings
SeleniumHQ_selenium
train
java
a4e36f3077f7ff3b10865d09dff2f022f22bb805
diff --git a/lib/ronin/platform/overlay.rb b/lib/ronin/platform/overlay.rb index <HASH>..<HASH> 100644 --- a/lib/ronin/platform/overlay.rb +++ b/lib/ronin/platform/overlay.rb @@ -125,6 +125,7 @@ module Ronin @exts_dir = File.join(@path,EXTS_DIR) @uri = uri @repository = Repository.new(@path,Media.types[media]) + @activated = false initialize_metadata() @@ -200,7 +201,7 @@ module Ronin # Specifies whether the overlay has been activated. # def activated? - lib_dirs.any? { |path| $LOAD_PATH.include?(path) } + @activated == true end # @@ -220,6 +221,7 @@ module Ronin init_path = File.join(@path,LIB_DIR,INIT_FILE) load init_path if File.file?(init_path) + @activated = true return true end @@ -232,6 +234,8 @@ module Ronin paths = lib_dirs $LOAD_PATH.reject! { |path| paths.include?(path) } + + @activated = false return true end
Added a @activated bit to Overlay.
ronin-ruby_ronin
train
rb
4a933496bcc78017d5a28f2883fb25800c98795d
diff --git a/client/assets/src/models/application.js b/client/assets/src/models/application.js index <HASH>..<HASH> 100644 --- a/client/assets/src/models/application.js +++ b/client/assets/src/models/application.js @@ -768,7 +768,8 @@ _kiwi.model.Application = function () { nick = _kiwi.app.panels().active.get('name'); } - _kiwi.app.connections.active_connection.gateway.raw('WHOIS ' + nick + ' ' + nick); + if (nick) + _kiwi.app.connections.active_connection.gateway.raw('WHOIS ' + nick + ' ' + nick); }
Don't send empty WHOIS commands
prawnsalad_KiwiIRC
train
js
25e7f3f3688b1f87c297ee40a9fdf9d339932689
diff --git a/src/view/MainViewManager.js b/src/view/MainViewManager.js index <HASH>..<HASH> 100644 --- a/src/view/MainViewManager.js +++ b/src/view/MainViewManager.js @@ -1056,8 +1056,8 @@ define(function (require, exports, module) { $(exports).triggerHandler("paneLayoutChange", [_orientation]); - // if new pane was created, make it the active pane - if (newPane) { + // if new pane was created, and original pane is not empty, make new pane the active pane + if (newPane && getWorkingSetSize(firstPane.id) > 0) { setActivePaneId(newPane.id); } }
set focus in new pane only if there is a file in original pane
adobe_brackets
train
js
3c19cb12b975c08c664941a580466ef95f168243
diff --git a/config/muxer.go b/config/muxer.go index <HASH>..<HASH> 100644 --- a/config/muxer.go +++ b/config/muxer.go @@ -50,6 +50,7 @@ func makeMuxer(h host.Host, tpts []MsMuxC) (mux.Transport, error) { if _, ok := transportSet[tptC.ID]; ok { return nil, fmt.Errorf("duplicate muxer transport: %s", tptC.ID) } + transportSet[tptC.ID] = struct{}{} } for _, tptC := range tpts { tpt, err := tptC.MuxC(h)
Ensure we filter duplicate transports in muxer Similar to secure transports in config, if we don't add the transport to the set, we'll never identify duplicates.
libp2p_go-libp2p
train
go
61180eec938e41989a443ba899a55a8f6c87a8f9
diff --git a/testing/code/test_source.py b/testing/code/test_source.py index <HASH>..<HASH> 100644 --- a/testing/code/test_source.py +++ b/testing/code/test_source.py @@ -624,6 +624,28 @@ def test_comment_in_statement() -> None: ) +def test_source_with_decorator() -> None: + """Test behavior with Source / Code().source with regard to decorators.""" + from _pytest.compat import get_real_func + + @pytest.mark.foo + def deco_mark(): + pass + + src = inspect.getsource(deco_mark) + assert str(Source(deco_mark, deindent=False)) == src + assert src.startswith(" @pytest.mark.foo") + + @pytest.fixture + def deco_fixture(): + pass + + src = inspect.getsource(deco_fixture) + assert src == " @pytest.fixture\n def deco_fixture():\n pass\n" + assert str(Source(deco_fixture)).startswith("@functools.wraps(function)") + assert str(Source(get_real_func(deco_fixture), deindent=False)) == src + + def test_single_line_else() -> None: source = getstatement(1, "if False: 2\nelse: 3") assert str(source) == "else: 3"
Test behavior of Source with regard to decorators Unlinke `inspect.getsource` it does not unwrap functions.
pytest-dev_pytest
train
py
fc309d0982f24f170cc2fe86a76a483e126e6d68
diff --git a/tests/SitemapPageTest.php b/tests/SitemapPageTest.php index <HASH>..<HASH> 100644 --- a/tests/SitemapPageTest.php +++ b/tests/SitemapPageTest.php @@ -5,11 +5,14 @@ class SitemapPageTest extends FunctionalTest { protected static $use_draft_site = true; + /** + * Note: this test depends on the "starter" theme being installed and configured as default + */ public function testSitemapShowsNavigationTitleNotNormalTitle() { $response = $this->get('sitemap'); $parser = new CSSContentParser($response->getBody()); - $els = $parser->getBySelector('.sitemap li.first span.title'); - $this->assertEquals('Top page nav 1', (string) $els[0]); + $elements = $parser->getBySelector('.sitemap li.first .sitemap-link'); + $this->assertNotEmpty($elements); + $this->assertEquals('Top page nav 1', (string) $elements[0]); } - }
FIX SitemapTest referencing default theme, changed to use starter
silverstripe_cwp
train
php
a6ca7b8a35912e51a8a32b457563209e12b5dc87
diff --git a/lib/compile.js b/lib/compile.js index <HASH>..<HASH> 100644 --- a/lib/compile.js +++ b/lib/compile.js @@ -58,8 +58,8 @@ function Compile(structure, opts) { function buildToken(ruleName, token) { if (typeof(token) === 'string') { - if (token !== 'null') return token; - else return undefined; + if (token === 'null') return undefined; + return token; } if (token instanceof RegExp) {
lib/compile: clarify string "null" case in buildToken
kach_nearley
train
js
7e5aff8ea7456c90f0e362c1e23a192416cbbab7
diff --git a/mode.go b/mode.go index <HASH>..<HASH> 100644 --- a/mode.go +++ b/mode.go @@ -39,16 +39,12 @@ var modeName = DebugMode func init() { mode := os.Getenv(ENV_GIN_MODE) - if mode == "" { - SetMode(DebugMode) - } else { - SetMode(mode) - } + SetMode(mode) } func SetMode(value string) { switch value { - case DebugMode: + case DebugMode, "": ginMode = debugCode case ReleaseMode: ginMode = releaseCode
simple code and increase coverage (#<I>)
gin-gonic_gin
train
go
074f1dd38b4195b8b6bd06cee58d1616b88b01a5
diff --git a/src/SwaggerUI/Silex/Provider/SwaggerUIServiceProvider.php b/src/SwaggerUI/Silex/Provider/SwaggerUIServiceProvider.php index <HASH>..<HASH> 100644 --- a/src/SwaggerUI/Silex/Provider/SwaggerUIServiceProvider.php +++ b/src/SwaggerUI/Silex/Provider/SwaggerUIServiceProvider.php @@ -2,14 +2,8 @@ namespace SwaggerUI\Silex\Provider; -use Twig_Autoloader, - Twig_Loader_Filesystem, - Twig_Environment; - - use Silex\Application; use Silex\ServiceProviderInterface; -use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
Removed use statements for Twig (no longer necessary)
kbrabrand_silex-swagger-ui
train
php
26d9c24df88ae877c71437d6343cb1fe5fe46e92
diff --git a/__workbench__/superv/platform/src/Packs/Nucleo/Observer.php b/__workbench__/superv/platform/src/Packs/Nucleo/Observer.php index <HASH>..<HASH> 100644 --- a/__workbench__/superv/platform/src/Packs/Nucleo/Observer.php +++ b/__workbench__/superv/platform/src/Packs/Nucleo/Observer.php @@ -6,6 +6,26 @@ use Illuminate\Database\Eloquent\Model; class Observer { + public function creating(Model $model) + { + $rules = []; + $attributes = []; + + foreach ($model->prototype()->fields as $field) { + if ($field->slug === $model->getKeyName()) { + continue; + } + + if ($field->hasRules()) { + $rules[$field->slug] = $field->rules; + $attributes[$field->slug] = sprintf('%s.%s', $model->getTable(), $field->slug); + } + } + + $validator = validator($model->toArray(), $rules, [], $attributes); + $validator->validate(); + } + public function created(Model $model) { $struct = Struct::create(
Validation should be slightly different when creating
superv_platform
train
php
5b8d837a92ce31dc9d7c389befa0a66cc36f8ea1
diff --git a/lib/google_play_search/app.rb b/lib/google_play_search/app.rb index <HASH>..<HASH> 100644 --- a/lib/google_play_search/app.rb +++ b/lib/google_play_search/app.rb @@ -4,7 +4,6 @@ module GooglePlaySearch attr_accessor :id, :name, :url, :developer, :category, :logo_url, :short_description, :rating, :reviews, :price, :version, :installs, :last_updated def get_all_details() - puts self.url html = open(self.url).read() @google_play_html = Nokogiri::HTML(html) @@ -12,7 +11,7 @@ module GooglePlaySearch self.last_updated = get_last_updated self.installs = get_installs self - end + end private @@ -28,4 +27,4 @@ module GooglePlaySearch @google_play_html.search("div[itemprop='numDownloads']").first.content.strip end end -end +end \ No newline at end of file
fixed ident problems. removed logging statement
grantchen_google_play_search
train
rb
23a791a66b02160cfb25ec2b8d74a0e123051b46
diff --git a/grip/__init__.py b/grip/__init__.py index <HASH>..<HASH> 100644 --- a/grip/__init__.py +++ b/grip/__init__.py @@ -14,5 +14,5 @@ __version__ = '2.0.1' from . import command from .constants import supported_extensions, default_filenames from .renderer import render_content, render_page -from .server import create_app, serve +from .server import create_app, serve, clear_cache from .exporter import export
Export clear_cache through the API.
joeyespo_grip
train
py
eb896725004283ab53047735dcd308fd934acdd7
diff --git a/horizon/horizon/dashboards/nova/keypairs/forms.py b/horizon/horizon/dashboards/nova/keypairs/forms.py index <HASH>..<HASH> 100644 --- a/horizon/horizon/dashboards/nova/keypairs/forms.py +++ b/horizon/horizon/dashboards/nova/keypairs/forms.py @@ -24,6 +24,7 @@ from django import http from django import shortcuts from django.contrib import messages from django.core import validators +from django.utils.http import urlquote from django.utils.translation import ugettext as _ from novaclient import exceptions as novaclient_exceptions @@ -40,7 +41,7 @@ class DeleteKeypair(forms.SelfHandlingForm): def handle(self, request, data): try: LOG.info('Deleting keypair "%s"' % data['keypair_id']) - api.keypair_delete(request, data['keypair_id']) + api.keypair_delete(request, urlquote(data['keypair_id'])) messages.info(request, _('Successfully deleted keypair: %s') % data['keypair_id']) except novaclient_exceptions.ClientException, e:
Added urlquote call around keypair name in delete form. Fixed bug <I>. Change-Id: Ie<I>c0c<I>a2b<I>a4e<I>a<I>d<I>ef<I>c2e5ddc
openstack_horizon
train
py
ab2cd1caa583fd36b0a3c11d24a5b38b8ef1d5d2
diff --git a/resource_aws_elb.go b/resource_aws_elb.go index <HASH>..<HASH> 100644 --- a/resource_aws_elb.go +++ b/resource_aws_elb.go @@ -177,6 +177,11 @@ func resourceAwsElb() *schema.Resource { Computed: true, }, + "zone_id": &schema.Schema{ + Type: schema.TypeString, + Computed: true, + }, + "tags": tagsSchema(), }, } @@ -281,6 +286,7 @@ func resourceAwsElbRead(d *schema.ResourceData, meta interface{}) error { d.Set("name", *lb.LoadBalancerName) d.Set("dns_name", *lb.DNSName) + d.Set("zone_id", *lb.CanonicalHostedZoneNameID) d.Set("internal", *lb.Scheme == "internal") d.Set("availability_zones", lb.AvailabilityZones) d.Set("instances", flattenInstances(lb.Instances))
provider/aws: Expose zone_id from elb
terraform-providers_terraform-provider-aws
train
go
8edc90e113790f81810fb612bce82e1f959aa1a3
diff --git a/andes/core/block.py b/andes/core/block.py index <HASH>..<HASH> 100644 --- a/andes/core/block.py +++ b/andes/core/block.py @@ -1807,6 +1807,8 @@ class Piecewise(Block): The first range (-inf, x0) applies `fun_0`, and the last range (x_{n-1}, +inf) applies the last function `fun_n`. + The function returns zero if no condition is met. + Parameters ---------- points : list, tuple @@ -1837,7 +1839,7 @@ class Piecewise(Block): args.append(f'({self.funs[i]}, {self.u.name} <= {self.points[i]})') args.append(f'({self.funs[i + 1]}, {self.u.name} > {self.points[-1]})') - args_comma = ', '.join(args) + args_comma = ', '.join(args) + ', (0, True)' pw_fun = f'Piecewise({args_comma}, evaluate=False)' self.y.v_str = pw_fun
Added fallback condition for Piecewise.
cuihantao_andes
train
py
6b2b87e22a0fd46a0f2908504d147f08b9420993
diff --git a/lavalink/__init__.py b/lavalink/__init__.py index <HASH>..<HASH> 100644 --- a/lavalink/__init__.py +++ b/lavalink/__init__.py @@ -4,7 +4,7 @@ __title__ = 'Lavalink' __author__ = 'Devoxin' __license__ = 'MIT' __copyright__ = 'Copyright 2017-present Devoxin' -__version__ = '4.0.1' +__version__ = '4.0.2' import inspect diff --git a/lavalink/models.py b/lavalink/models.py index <HASH>..<HASH> 100644 --- a/lavalink/models.py +++ b/lavalink/models.py @@ -84,7 +84,7 @@ class AudioTrack: def __init__(self, data: dict, requester: int, **extra): try: if isinstance(data, AudioTrack): - extra = data.extra + extra = {**data.extra, **extra} data = data._raw self._raw = data
Fix extra kwargs not being accounted for in track duplication (#<I>) * Account for extra kwargs in AudioTrack cloning * <I>
Devoxin_Lavalink.py
train
py,py
efad956e389f7cf570eeddfa0d7f6ac5aa71ff5c
diff --git a/gpiozero/pins/data.py b/gpiozero/pins/data.py index <HASH>..<HASH> 100644 --- a/gpiozero/pins/data.py +++ b/gpiozero/pins/data.py @@ -122,7 +122,7 @@ BPLUS_BOARD = """\ {style:white on green}| {J8:{style} col2}{style:white on green} J8 {style:black on white}+===={style:reset} {style:white on green}| {J8:{style} col1}{style:white on green} {style:black on white}| USB{style:reset} {style:white on green}| {style:black on white}+===={style:reset} -{style:white on green}| {style:bold}Pi Model {model:3s}V{pcb_revision:3s}{style:normal} |{style:reset} +{style:white on green}| {style:bold}Pi Model {model:4s}V{pcb_revision:3s}{style:normal} |{style:reset} {style:white on green}| {style:on black}+----+{style:on green} {style:black on white}+===={style:reset} {style:white on green}| {style:on black}|D|{style:on green} {style:on black}|SoC |{style:on green} {style:black on white}| USB{style:reset} {style:white on green}| {style:on black}|S|{style:on green} {style:on black}| |{style:on green} {style:black on white}+===={style:reset}
Leave 4 spaces for model name before PCB version on ascii-art Pi
RPi-Distro_python-gpiozero
train
py
26c38972ab49c392ba79bb748325ec90c789d298
diff --git a/app/helpers/resque_helper.rb b/app/helpers/resque_helper.rb index <HASH>..<HASH> 100644 --- a/app/helpers/resque_helper.rb +++ b/app/helpers/resque_helper.rb @@ -4,7 +4,7 @@ module ResqueHelper def classes_in_failure - Resque.redis.lrange(:failed,0,-1).collect{|job| Resque.decode(job)['payload']['class']}.uniq + (Resque.redis.lrange(:failed,0,-1) || []).collect{|job| Resque.decode(job)['payload']['class']}.uniq end def flash_helper
jruby seems to give a nil back instead on an empty array
kevintyll_resque_manager
train
rb
4960f6a37e26f08bd43419debd1df99bca80391f
diff --git a/test/io/conekta/OrderTest.java b/test/io/conekta/OrderTest.java index <HASH>..<HASH> 100644 --- a/test/io/conekta/OrderTest.java +++ b/test/io/conekta/OrderTest.java @@ -223,7 +223,7 @@ public class OrderTest extends ConektaBase{ // @Test public void testSuccessfulOrderCapture() throws JSONException, Error, ErrorList { - validOrder.put("preauthorize", true); + validOrder.put("pre_authorize", true); validOrder.put("customer_info", customerInfo); JSONArray chargesArray = new JSONArray(); chargesArray.put(validCharge);
Fix pre_authorize to capture an order
conekta_conekta-java
train
java
d405d460ee19a3cdfb9b5e68e68e10f8e87bb80f
diff --git a/temperusb/device_library.py b/temperusb/device_library.py index <HASH>..<HASH> 100644 --- a/temperusb/device_library.py +++ b/temperusb/device_library.py @@ -55,7 +55,7 @@ DEVICE_LIBRARY = { type=TemperType.FM75, ), "TEMPer1V1.4": TemperConfig( - temp_sens_offsets=[2, 4], + temp_sens_offsets=[2], hum_sens_offsets=None, type=TemperType.FM75, ),
Add support for TEMPer1V<I>
padelt_temper-python
train
py
dffd5bb5ca0c96ee2b72c8d91292c139193afc86
diff --git a/cmd/juju/bootstrap_test.go b/cmd/juju/bootstrap_test.go index <HASH>..<HASH> 100644 --- a/cmd/juju/bootstrap_test.go +++ b/cmd/juju/bootstrap_test.go @@ -245,10 +245,10 @@ var bootstrapTests = []bootstrapTest{{ err: `failed to bootstrap environment: cannot build tools for "ppc64el" using a machine running on "amd64"`, }, { info: "--upload-tools rejects non-supported arch", - version: "1.3.3-saucy-arm64", - hostArch: "arm64", + version: "1.3.3-saucy-mips64", + hostArch: "mips64", args: []string{"--upload-tools"}, - err: `failed to bootstrap environment: environment "peckham" of type dummy does not support instances running on "arm64"`, + err: `failed to bootstrap environment: environment "peckham" of type dummy does not support instances running on "mips64"`, }, { info: "--upload-tools always bumps build number", version: "1.2.3.4-raring-amd64",
fix test, arm<I> is not longer an impossible architecture
juju_juju
train
go
38136fd804fad3b400836cd30d15b31cb7cd7d50
diff --git a/lib/client/api.go b/lib/client/api.go index <HASH>..<HASH> 100644 --- a/lib/client/api.go +++ b/lib/client/api.go @@ -2546,7 +2546,7 @@ func (tc *TeleportClient) Login(ctx context.Context) (*Key, error) { var response *auth.SSHLoginResponse switch authType := pr.Auth.Type; { - case authType == constants.Local && pr.Auth.Local.Name == constants.PasswordlessConnector: + case authType == constants.Local && pr.Auth.Local != nil && pr.Auth.Local.Name == constants.PasswordlessConnector: // Sanity check settings. if !pr.Auth.AllowPasswordless { return nil, trace.BadParameter("passwordless disallowed by cluster settings")
Avoid possible panic when checking ping response (#<I>)
gravitational_teleport
train
go
8b6543c824174f6e68e9a17aa1886e6be1d211ed
diff --git a/biodata-models/src/main/java/org/opencb/biodata/models/clinical/qc/SampleQcVariantStats.java b/biodata-models/src/main/java/org/opencb/biodata/models/clinical/qc/SampleQcVariantStats.java index <HASH>..<HASH> 100644 --- a/biodata-models/src/main/java/org/opencb/biodata/models/clinical/qc/SampleQcVariantStats.java +++ b/biodata-models/src/main/java/org/opencb/biodata/models/clinical/qc/SampleQcVariantStats.java @@ -25,6 +25,7 @@ import org.opencb.commons.annotations.DataField; import java.util.Map; +//To force github actions to compile public class SampleQcVariantStats { @DataField(id = "id", indexed = true,
Force github actions rebuild to check previous error
opencb_biodata
train
java
75e824d639fd03636fbf1e8c4360e7408415ecc5
diff --git a/examples/application/src/table.js b/examples/application/src/table.js index <HASH>..<HASH> 100644 --- a/examples/application/src/table.js +++ b/examples/application/src/table.js @@ -114,6 +114,9 @@ define([ init: function (data, children) { this.data = this.context.data[data.bind]; setBinders.call(this, this.children); + console.log(this.bindings.firstname===this.children.firstname) + this.children.firstname = 'vasja'; + console.log(this.bindings.firstname) parseBinders.call(this, this.data, this.bindings); } diff --git a/src/widget/dom.js b/src/widget/dom.js index <HASH>..<HASH> 100644 --- a/src/widget/dom.js +++ b/src/widget/dom.js @@ -39,8 +39,9 @@ define([ var oldEl = node.el, newEl = oldEl.cloneNode(false); - var item = utils.extend({}, node, {el: newEl}); - console.log(item) + var item = utils.extend({}, node); + item.el = newEl; +// console.log(item) return new Element(item); }, text: function (node, text) {
Added binders, and improve clone function.
gunins_richtemplate
train
js,js
899cd79ffe1c77315d09e3f9e4ac18537f8b2136
diff --git a/src/FormKit/Element.php b/src/FormKit/Element.php index <HASH>..<HASH> 100644 --- a/src/FormKit/Element.php +++ b/src/FormKit/Element.php @@ -263,7 +263,7 @@ class Element * * @var array */ - public $children = array(); + protected $_children = array(); /** @@ -391,31 +391,31 @@ class Element public function prepend($child) { - array_splice($this->children,0,0,$child); + array_splice($this->_children,0,0,$child); return $this; } public function insertChild($child) { - array_splice($this->children,0,0,$child); + array_splice($this->_children,0,0,$child); return $this; } public function append($child) { - $this->children[] = $child; + $this->_children[] = $child; return $this; } public function addChild($child) { - $this->children[] = $child; + $this->_children[] = $child; return $this; } public function hasChildren() { - return ! empty($this->children); + return ! empty($this->_children); } public function renderNodes($nodes) @@ -445,7 +445,7 @@ class Element public function renderChildren() { - return $this->renderNodes($this->children); + return $this->renderNodes($this->_children); } /**
set $children member as protected and renamed to _children
corneltek_FormKit
train
php
a047285371476dcd0682b7a74d1e01f9b64d1a6d
diff --git a/src/writer.js b/src/writer.js index <HASH>..<HASH> 100644 --- a/src/writer.js +++ b/src/writer.js @@ -7,10 +7,10 @@ import fs from 'fs'; import path from 'path'; import mkdirp from 'mkdirp'; import {stripColor} from 'chalk'; -import Promise from 'promise'; +import {denodeify} from 'promise'; -const mkdir = Promise.denodeify(mkdirp); -const writeFile = Promise.denodeify(fs.writeFile); +const mkdir = denodeify(mkdirp); +const writeFile = denodeify(fs.writeFile); /** * Creates the output folder and writes formatted text to a file.
refactor(writer): destructure denodeify import
olegskl_gulp-stylelint
train
js
91e179c6593eb8ab0c55bd10f05cf3a9542a6459
diff --git a/test/unit/conftest.py b/test/unit/conftest.py index <HASH>..<HASH> 100644 --- a/test/unit/conftest.py +++ b/test/unit/conftest.py @@ -40,6 +40,8 @@ class PatchedDriver(OriginalDriver): def close(self): pass + def is_alive(self): + pass class FakeDevice(BaseTestDouble): """Device test double."""
Patched is_alive test failing
napalm-automation-community_napalm-fortios
train
py
a65dfe0d007f06c234478924078384bea5526d40
diff --git a/lib/dr/base/bool.rb b/lib/dr/base/bool.rb index <HASH>..<HASH> 100644 --- a/lib/dr/base/bool.rb +++ b/lib/dr/base/bool.rb @@ -1,12 +1,13 @@ module DR module Bool extend(self) - def to_bool(el, default=nil, allow_nil: true) + def to_bool(el, default=nil, allow_nil: true, string_fallback: true) case el when String string=el.chomp return true if string =~ (/(true|t|yes|y|1)$/i) return false if string.empty? || string =~ (/(false|f|no|n|0)$/i) + return el if string_fallback when Integer return ! (el == 0) when ::Process::Status @@ -18,6 +19,7 @@ module DR #we don't return !!el because we don't want nil to be false but to #give an error end + return el if string_fallback and el.is_a?(Symbol) return default unless default.nil? return nil if el.nil? and allow_nil raise ArgumentError.new("Invalid value for Boolean: \"#{el}\"")
bool.rb: allow to keep Strings/Symbols
DamienRobert_drain
train
rb
4559754f38e853d08a1a614aa23f0c0d276122b1
diff --git a/js/src/MarketMap.js b/js/src/MarketMap.js index <HASH>..<HASH> 100644 --- a/js/src/MarketMap.js +++ b/js/src/MarketMap.js @@ -655,6 +655,7 @@ var MarketMap = figure.Figure.extend({ tooltip_widget_creation_promise.then(function(view) { that.tooltip_view = view; that.tooltip_div.node().appendChild(view.el); + view.trigger("displayed", {"add_to_dom_only": true}); }); } },
triggering display for market map tooltip view
bloomberg_bqplot
train
js
021bd74447412326d021c689340371760272b3b8
diff --git a/src/EntityFinder.php b/src/EntityFinder.php index <HASH>..<HASH> 100644 --- a/src/EntityFinder.php +++ b/src/EntityFinder.php @@ -180,7 +180,9 @@ class EntityFinder { $table = $this->metadata->getTable(); if (!empty($this->with)) { - $fieldName = "{$table}.{$fieldName}"; + if(strpos($fieldName, '.') === false) { + $fieldName = "{$table}.{$fieldName}"; + } } $this->manager->commit();
Allow filtering by other tables' fields
bugadani_ORMiny
train
php
ae1d03fc51bb22ed59517ee6f92c560417fdb049
diff --git a/examples/run_ner.py b/examples/run_ner.py index <HASH>..<HASH> 100644 --- a/examples/run_ner.py +++ b/examples/run_ner.py @@ -13,7 +13,7 @@ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. -""" Fine-tuning the library models for named entity recognition on CoNLL-2003 (Bert). """ +""" Fine-tuning the library models for named entity recognition on CoNLL-2003 (Bert or Roberta). """ from __future__ import absolute_import, division, print_function
Add roberta to doc
huggingface_pytorch-pretrained-BERT
train
py
1e8efdf1be962d97366641b77518099eea6b31b9
diff --git a/jira/resources.py b/jira/resources.py index <HASH>..<HASH> 100644 --- a/jira/resources.py +++ b/jira/resources.py @@ -117,6 +117,13 @@ class Resource(object): if 'reporter' not in data['fields']: logging.warning("autofix: setting reporter to '%s' and retrying the update." % self._options['autofix']) data['fields']['reporter'] = {'name': self._options['autofix']} + + if "Issues must be assigned." in error_list: + if 'assignee' not in data['fields']: + logging.warning("autofix: setting assignee to '%s' for %s and retrying the update." % (self._options['autofix'], self.key)) + data['fields']['assignee'] = {'name': self._options['autofix']} + # for some reason the above approach fails on Jira 5.2.11 so we need to change the assignee before + if "Issue type is a sub-task but parent issue key or id not specified." in error_list: logging.warning("autofix: trying to fix sub-task without parent by converting to it to bug") data['fields']['issuetype'] = {"name": "Bug"}
Added code to deal with failure to update issue because it has no assignee, this can happen when the current assignee is invalid.
pycontribs_jira
train
py
c842db8f17fbec85dddf30154b7984d1a5eea876
diff --git a/app/models/fiat_publication/message.rb b/app/models/fiat_publication/message.rb index <HASH>..<HASH> 100644 --- a/app/models/fiat_publication/message.rb +++ b/app/models/fiat_publication/message.rb @@ -29,8 +29,8 @@ module FiatPublication # scope :priority, lambda { where(priority: 1).includes(:comments, :tasks) } # scope :unlabeled, lambda { where(label: ["",nil]).includes(:comments, :tasks) } - # scope :open, lambda { where(closed: [0,nil]) } - # scope :closed, lambda { where(closed: 1) } + scope :open, lambda { where(closed: [0,nil]) } + scope :closed, lambda { where(closed: 1) } # scope :ticket, lambda { where(label: 1).includes(:comments, :tasks) } # scope :snoozed, lambda { where.not(snooze: [nil,0]).includes(:comments, :tasks) } # scope :excluded, lambda { where(excluded: 1) }
Added open/closed to messages
fiatinsight_fiat_publication
train
rb
5e8218a2fb5b0c63df4394e299ad75fec2494b29
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ setup( 'appdirs==1.4.3', 'docopt==0.6.2', 'prompt-toolkit==1.0', - 'python-slugify==1.2.1', + 'python-slugify==1.2.2', ], packages=['withtool'], classifiers=[
Upgrade dependency python-slugify to ==<I>
renanivo_with
train
py
4513ab0319779834e6da136c8b470ba5390306ff
diff --git a/floyd/cli/experiment.py b/floyd/cli/experiment.py index <HASH>..<HASH> 100644 --- a/floyd/cli/experiment.py +++ b/floyd/cli/experiment.py @@ -123,7 +123,6 @@ def info(job_name_or_id): except FloydException: experiment = ExperimentClient().get(job_name_or_id) - experiment = ExperimentClient().get(job_name_or_id) task_instance_id = get_module_task_instance_id(experiment.task_instances) task_instance = TaskInstanceClient().get(task_instance_id) if task_instance_id else None table = [["Job name", normalize_job_name(experiment.name)],
Remove extraneous getExpt call
floydhub_floyd-cli
train
py
97618bcadb2987ff8becfa5d1069ff0a45f7534a
diff --git a/src/Router.php b/src/Router.php index <HASH>..<HASH> 100644 --- a/src/Router.php +++ b/src/Router.php @@ -29,7 +29,7 @@ use function strtr; */ class Router { - const VERSION = '3.0.5.pre.1'; + const VERSION = '3.0.5'; private $control = ''; private $forceSlash = false;
Attogram Router <I>
attogram_router
train
php
38847e637c12b64bc7f3d9c2a97167405b518c32
diff --git a/lib/excon/middlewares/idempotent.rb b/lib/excon/middlewares/idempotent.rb index <HASH>..<HASH> 100644 --- a/lib/excon/middlewares/idempotent.rb +++ b/lib/excon/middlewares/idempotent.rb @@ -4,8 +4,12 @@ module Excon def error_call(datum) if datum[:idempotent] if datum.has_key?(:request_block) - Excon.display_warning('Excon requests with a :request_block can not be :idempotent.') - datum[:idempotent] = false + if datum[:request_block].respond_to?(:rewind) + datum[:request_block].rewind + else + Excon.display_warning('Excon requests with a :request_block must implement #rewind in order to be :idempotent.') + datum[:idempotent] = false + end end if datum.has_key?(:pipeline) Excon.display_warning("Excon requests can not be :idempotent when pipelining.")
attempt to rewind request_block in idempotent before giving up
excon_excon
train
rb
447f7ceaa22a8b69bac7c0775334ed98a75d2f38
diff --git a/GPy/models_modules/gplvm.py b/GPy/models_modules/gplvm.py index <HASH>..<HASH> 100644 --- a/GPy/models_modules/gplvm.py +++ b/GPy/models_modules/gplvm.py @@ -9,11 +9,11 @@ from ..core import priors from ..core import GP from ..likelihoods import Gaussian from .. import util +from ..util.linalg import pca def initialise_latent(init, input_dim, Y): Xr = np.random.randn(Y.shape[0], input_dim) if init.lower() == 'pca': - from ..util.linalg import pca PC = pca(Y, input_dim)[0] Xr[:PC.shape[0], :PC.shape[1]] = PC return Xr
Moving imports, attempting to update RTD
SheffieldML_GPy
train
py
ceabc732f58d55eb4e5ac8530db222feaaadfaa2
diff --git a/cwltool/workflow.py b/cwltool/workflow.py index <HASH>..<HASH> 100644 --- a/cwltool/workflow.py +++ b/cwltool/workflow.py @@ -566,8 +566,11 @@ class Workflow(Process): builder = self._init_job(job_order, runtimeContext) #relativeJob=copy.deepcopy(builder.job) if runtimeContext.research_obj: - runtimeContext.research_obj.make_fs_access = runtimeContext.make_fs_access - runtimeContext.research_obj.create_job(self.job, builder.job) + if not runtimeContext.research_obj.make_fs_access: + runtimeContext.research_obj.make_fs_access = runtimeContext.make_fs_access + if runtimeContext.toplevel: + # Record primary-job.json + runtimeContext.research_obj.create_job(self.job, builder.job) job = WorkflowJob(self, runtimeContext) yield job
only record create_job on top level workflow
common-workflow-language_cwltool
train
py
ef3c6ecdea29ce427f1868ee37d0580185290140
diff --git a/py/tests/unit/with_runtime_sparkling/test_automl.py b/py/tests/unit/with_runtime_sparkling/test_automl.py index <HASH>..<HASH> 100644 --- a/py/tests/unit/with_runtime_sparkling/test_automl.py +++ b/py/tests/unit/with_runtime_sparkling/test_automl.py @@ -159,12 +159,13 @@ def testBlendingDataFrameHasImpactOnAutoMLStackedEnsambleModels(classificationDa automl = setParametersForTesting(H2OAutoML()) automl.fit(trainingDateset) defaultLeaderboard = separateEnsembleModels(prepareLeaderboardForComparison(automl.getLeaderboard())) + automl.getLeaderboard().show(truncate=False) automl = setParametersForTesting(H2OAutoML()).setBlendingDataFrame(blendingDataset) automl.fit(trainingDateset) leaderboardWithBlendingFrameSet = separateEnsembleModels(prepareLeaderboardForComparison(automl.getLeaderboard())) - assert defaultLeaderboard[0].count() == 2 + assert defaultLeaderboard[0].count() == 3 unit_test_utils.assert_data_frames_have_different_values(defaultLeaderboard[0], leaderboardWithBlendingFrameSet[0]) unit_test_utils.assert_data_frames_are_identical(defaultLeaderboard[1], leaderboardWithBlendingFrameSet[1])
[SW-<I>] Update AutoML Tests to Consider 3 StackEnsamble Models in Leaderboard (#<I>)
h2oai_sparkling-water
train
py
c57f84dcf7fbf769b15e891e1254e08de1c163de
diff --git a/bin/cli.js b/bin/cli.js index <HASH>..<HASH> 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -142,18 +142,6 @@ function (chunk) { //convert to normal array so we can concatenate var _chunk = typedToArray(chunk); - //check if chunk is bigger than frame - if (_chunk.length > FRAME_SIZE) { - // if so, we'll extract stuff from it frame by frame, until we're left with something that's short enough to buffer - while (_chunk.length > FRAME_SIZE) { - var frame = _chunk.slice(0, FRAME_SIZE); - _chunk.splice(0, HOP_SIZE); - extractFeatures(frame); - if (!opt.options.p) process.stdout.write("-"); - frameCount++; - } - } - buffer = buffer.concat(_chunk); //if we're long enough, splice the frame, and extract features on it while (buffer.length >= FRAME_SIZE) {
fix(cli): stop double extracting in certain cases
meyda_meyda
train
js
2643cb0bb8e581f877dbdb597f8f3615d61fb574
diff --git a/packages/neos-ui-editors/src/Editors/Image/Components/Controls/index.js b/packages/neos-ui-editors/src/Editors/Image/Components/Controls/index.js index <HASH>..<HASH> 100644 --- a/packages/neos-ui-editors/src/Editors/Image/Components/Controls/index.js +++ b/packages/neos-ui-editors/src/Editors/Image/Components/Controls/index.js @@ -50,7 +50,7 @@ export default class Controls extends PureComponent { style="lighter" onClick={onChooseFromLocalFileSystem} className={style.button} - title={i18nRegistry.translate('Neos.Neos:Modules:media.chooseFile')} + title={i18nRegistry.translate('Neos.Media.Browser:Main:chooseFile')} /> <IconButton icon="remove"
BUGFIX: Correct translation for choose image closes #<I>
neos_neos-ui
train
js
bdee2bd12c4278049cf95becc4f56bd9265f4aae
diff --git a/lib/oauth2.js b/lib/oauth2.js index <HASH>..<HASH> 100755 --- a/lib/oauth2.js +++ b/lib/oauth2.js @@ -139,7 +139,7 @@ Strategy.prototype.makeRequest = function makeRequest(options, done) { } // CASE: request library error e.q. connection refused else { - done(new errors.IgnitionError({ + return done(new errors.IgnitionError({ statusCode: err.statusCode, code: err.code, message: err.message,
πŸ› return statement was missing no issue
TryGhost_passport-ghost
train
js
7759d7a03972d0eee548cab0b8fa6a604c63b121
diff --git a/modules/orionode/Gruntfile.js b/modules/orionode/Gruntfile.js index <HASH>..<HASH> 100755 --- a/modules/orionode/Gruntfile.js +++ b/modules/orionode/Gruntfile.js @@ -197,7 +197,7 @@ module.exports = function(grunt) { // Dynamic configuration grunt.config("requirejs.compile.options", util.mixin(grunt.config("nodeBuildConfig"), { - optimize: "uglify2", + optimize: "none", generateSourceMaps: generateSourceMaps, appDir: staging, baseUrl: "./",
Repo cloning failing in dev and int org-ids/web-ide-issues#<I>
eclipse_orion.client
train
js
97f42784533707edcb7adb9056e903921094ca80
diff --git a/js/angular/components/modal/modal.js b/js/angular/components/modal/modal.js index <HASH>..<HASH> 100644 --- a/js/angular/components/modal/modal.js +++ b/js/angular/components/modal/modal.js @@ -232,11 +232,12 @@ if(!attached && html.length > 0) { var modalEl = container.append(element); - scope.active = state; $compile(element)(scope); attached = true; } + + scope.active = state; }); }
Fix active state of modal Set modal active state regardless of whether modal content is updated
zurb_foundation-apps
train
js
ac3cb93f9c689e6982976294dd5f29853213ba8b
diff --git a/lib/tessel/deployment/rust.js b/lib/tessel/deployment/rust.js index <HASH>..<HASH> 100644 --- a/lib/tessel/deployment/rust.js +++ b/lib/tessel/deployment/rust.js @@ -71,7 +71,7 @@ exportables.preBundle = function(opts) { // executable. exportables.tarBundle = function(opts) { if (opts.rustcc === true) { - opts.rustcc = 'http://rustcc.tessel.io:49160'; + opts.rustcc = 'http://rustcc.tessel.io'; } if (opts.rustcc) {
Strips port from rustcc default server.
tessel_t2-cli
train
js
361ed7d59795c3f6bd2f13bc8855e2fe76815a8f
diff --git a/src/Plugin/Manager.php b/src/Plugin/Manager.php index <HASH>..<HASH> 100644 --- a/src/Plugin/Manager.php +++ b/src/Plugin/Manager.php @@ -773,7 +773,12 @@ class Manager $sHash = $this->generateHash(); $sOutFile = (($this->bMinifyJs) ? $sHash . '.min.js' : $sHash . '.js'); - if(!is_file($this->sJsAppDir . $sOutFile) ) + if(!is_dir($this->sJsAppDir)) + { + @mkdir($this->sJsAppDir); + } + + if(!is_file($this->sJsAppDir . $sOutFile)) { file_put_contents($this->sJsAppDir . $sOutFile, $sScript); }
When merging javascript files, the library attemps to create their directory.
jaxon-php_jaxon-core
train
php
4ec355e22b5caf6ff76f9b8c4377095f4f9ae6e2
diff --git a/ci.py b/ci.py index <HASH>..<HASH> 100644 --- a/ci.py +++ b/ci.py @@ -40,7 +40,7 @@ def ci(python="python", codecov="codecov", coverage_file="coverage.xml"): Run the most common CI tasks """ # Upgrade pip and setuptools and install dependencies - import pip + import pip._internal as pip pip.main(["install"] + DEPENDENCIES + REQUIREMENTS + ["-U"]) # Build the installation wheel dist_type = "bdist_wheel" if not SDIST else "sdist"
Fix issue with pip==<I> on CI
RedFantom_ttkthemes
train
py
13857c49b8470e6698426f433deb364ba5d64d96
diff --git a/security/BasicAuth.php b/security/BasicAuth.php index <HASH>..<HASH> 100755 --- a/security/BasicAuth.php +++ b/security/BasicAuth.php @@ -28,6 +28,7 @@ class BasicAuth extends Object { */ static function requireLogin($realm, $permissionCode) { if(!Security::database_is_ready() || Director::is_cli()) return true; + $authenticated = false; if(isset($_SERVER['PHP_AUTH_USER']) && isset($_SERVER['PHP_AUTH_PW'])) { $member = MemberAuthenticator::authenticate(array( @@ -35,13 +36,11 @@ class BasicAuth extends Object { 'Password' => $_SERVER['PHP_AUTH_PW'], ), null); - if($member) { - $authenticated = true; - } + if($member || Member::currentUser()) $authenticated = true; } // If we've failed the authentication mechanism, then show the login form - if(!isset($authenticated)) { + if(!$authenticated) { header("WWW-Authenticate: Basic realm=\"$realm\""); header($_SERVER['SERVER_PROTOCOL'] . ' 401 Unauthorized');
BUGFIX #<I> BasicAuth should check if there's already a current member logged in before asking for a login/password git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/sapphire/branches/<I>@<I> <I>b<I>ca-7a2a-<I>-9d3b-<I>d<I>a<I>a9
silverstripe_silverstripe-framework
train
php
7aad47b9bbd81aa3e8bc37992b81bdf69b687036
diff --git a/django_socketio/management/commands/runserver_socketio.py b/django_socketio/management/commands/runserver_socketio.py index <HASH>..<HASH> 100644 --- a/django_socketio/management/commands/runserver_socketio.py +++ b/django_socketio/management/commands/runserver_socketio.py @@ -57,6 +57,7 @@ class Command(BaseCommand): server.serve_forever() except KeyboardInterrupt: if RELOAD: + server.kill() print print "Reloading..." restart_with_reloader()
Added a call to server.kill() for improved reload support.
stephenmcd_django-socketio
train
py
721f5052bf533f769af8cd930f89de60a316def5
diff --git a/lib/bugsnag.php b/lib/bugsnag.php index <HASH>..<HASH> 100644 --- a/lib/bugsnag.php +++ b/lib/bugsnag.php @@ -433,12 +433,25 @@ class Bugsnag { $requestData['request'] = array(); $requestData['request']['url'] = self::getCurrentUrl(); $requestData['request']['httpMethod'] = $_SERVER['REQUEST_METHOD']; + if(!empty($_POST)) { $requestData['request']['params'] = $_POST; + } else { + if(stripos($_SERVER['CONTENT_TYPE'], 'application/json') === 0) { + $requestData['request']['params'] = json_decode(file_get_contents('php://input')); + } } + $requestData['request']['ip'] = self::getRequestIp(); $requestData['request']['userAgent'] = $_SERVER['HTTP_USER_AGENT']; + if(function_exists("getallheaders")) { + $headers = getallheaders(); + if(!empty($headers)) { + $requestData['request']['headers'] = $headers; + } + } + // Session Tab if(!empty($_SESSION)) { $requestData['session'] = $_SESSION;
Populate request params from json post data and send headers to bugsnag if possible
bugsnag_bugsnag-php
train
php
0b07a809c9ba30c27936527393ed1ec1b83b3532
diff --git a/lib/codemirror.js b/lib/codemirror.js index <HASH>..<HASH> 100644 --- a/lib/codemirror.js +++ b/lib/codemirror.js @@ -2907,7 +2907,7 @@ var CodeMirror = (function() { var keyNames = {3: "Enter", 8: "Backspace", 9: "Tab", 13: "Enter", 16: "Shift", 17: "Ctrl", 18: "Alt", 19: "Pause", 20: "CapsLock", 27: "Esc", 32: "Space", 33: "PageUp", 34: "PageDown", 35: "End", 36: "Home", 37: "Left", 38: "Up", 39: "Right", 40: "Down", 44: "PrintScrn", 45: "Insert", - 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 186: ";", 187: "=", 188: ",", + 46: "Delete", 59: ";", 91: "Mod", 92: "Mod", 93: "Mod", 127: "Delete", 186: ";", 187: "=", 188: ",", 189: "-", 190: ".", 191: "/", 192: "`", 219: "[", 220: "\\", 221: "]", 222: "'", 63276: "PageUp", 63277: "PageDown", 63275: "End", 63273: "Home", 63234: "Left", 63232: "Up", 63235: "Right", 63233: "Down", 63302: "Insert", 63272: "Delete"};
Added delete key code for KHTML
codemirror_CodeMirror
train
js
41fd476011a31ba855e56f5d016a8c11c5f3097d
diff --git a/photutils/aperture_core.py b/photutils/aperture_core.py index <HASH>..<HASH> 100644 --- a/photutils/aperture_core.py +++ b/photutils/aperture_core.py @@ -191,7 +191,8 @@ class PixelAperture(Aperture): if input ``error`` is not `None`. """ - def area(): + @abc.abstractmethod + def area(self): """ Area of aperture.
Make PixelAperture.area and abstract method
astropy_photutils
train
py
b575d45cc76623255e0cbe4a72f85f85b9d588ee
diff --git a/mousedb/veterinary/models.py b/mousedb/veterinary/models.py index <HASH>..<HASH> 100644 --- a/mousedb/veterinary/models.py +++ b/mousedb/veterinary/models.py @@ -36,7 +36,7 @@ class MedicalCondition(models.Model): The slug field is not updated upon repeated saves, only on the first save for persistence. There is also an optional notes field for extra information.''' - name = models.CharField(max_length = 100) + name = models.CharField(max_length = 100, unique=True) slug = models.SlugField(max_length = 100, editable=False) notes = models.TextField(blank=True, null=True) created = models.DateTimeField(auto_now_add=True) @@ -62,7 +62,7 @@ class MedicalTreatment(models.Model): There is one required field (name), the treatment name and one auto-generated field (slug).''' - name = models.CharField(max_length = 100) + name = models.CharField(max_length = 100, unique=True) slug = models.SlugField(max_length = 100, editable=False) def __unicode__(self):
Made name fields on MedicalCondition and MedicalTreatment unique. Closes #<I>.
davebridges_mousedb
train
py
59c46a514c5ae4491b9d4483b0c32bad8c202bee
diff --git a/index.js b/index.js index <HASH>..<HASH> 100644 --- a/index.js +++ b/index.js @@ -4,6 +4,10 @@ var traverse = require('traverse'), tcoLabel = { type: 'Identifier', name: 'tco' + }, + resultIdentifier = { + type: 'Identifier', + name: '__tcor' }; function returnValue(r) { @@ -14,10 +18,7 @@ function returnValue(r) { expression: { type: 'AssignmentExpression', operator: '=', - left: { - type: 'Identifier', - name: 'result' - }, + left: resultIdentifier, right: r.argument } }, { @@ -91,10 +92,7 @@ function optimizeFunction(f) { type: 'VariableDeclaration', declarations: [{ type: 'VariableDeclarator', - id: { - type: 'Identifier', - name: 'result', - }, + id: resultIdentifier, init: null }], kind: 'var' @@ -114,10 +112,7 @@ function optimizeFunction(f) { } }, { type: 'ReturnStatement', - argument: { - type: 'Identifier', - name: 'result' - } + argument: resultIdentifier }]; }
Change from 'result' identifier to '__tcor'
puffnfresh_brushtail
train
js
7ccbbef51fe3e6bed1afccffe663034908478015
diff --git a/spec/lib/rd_spec.rb b/spec/lib/rd_spec.rb index <HASH>..<HASH> 100644 --- a/spec/lib/rd_spec.rb +++ b/spec/lib/rd_spec.rb @@ -161,15 +161,5 @@ describe RDee do end end - it "should not allow opera_options when not using opera" do - RDee.configure do |config| - config.opera_options = {opera_options: 'option'} - end - expect(watir_browser).to receive(:new).with(:firefox) - RDee.watir_browser(:firefox) - RDee.configure do |config| - config.opera_options = nil - end - end end end
removed test for opera spec since I am not support opera
cheezy_RDee
train
rb
66fc33987f49c742ecfe066198e88f4186b99025
diff --git a/skip.js b/skip.js index <HASH>..<HASH> 100644 --- a/skip.js +++ b/skip.js @@ -1,3 +1,4 @@ -if (process.platform === 'win32') { +const platform = process.env.npm_config_platform || process.platform +if (platform === 'win32') { process.exit(1) }
Don't skip building if cross-compiling (#7)
vweevers_win-version-info
train
js
cf2166d0e888b92a4ec4e41e1f8b6c75df7a3ee0
diff --git a/Routing/DocumentUrlGenerator.php b/Routing/DocumentUrlGenerator.php index <HASH>..<HASH> 100644 --- a/Routing/DocumentUrlGenerator.php +++ b/Routing/DocumentUrlGenerator.php @@ -110,11 +110,7 @@ class DocumentUrlGenerator extends ProviderBasedGenerator implements VersatileGe */ public function supports($name) { - if ($name instanceof SeoAwareInterface) { - return true; - } else { - return false; - } + return $name instanceof SeoAwareInterface; } /** * @param mixed $name @@ -127,8 +123,8 @@ class DocumentUrlGenerator extends ProviderBasedGenerator implements VersatileGe { if ($name instanceof SeoAwareInterface) { return 'The route object is fit for parsing to generate() method'; - } else { - return 'Given route object must be an instance of SeoAwareInterface'; } + + return 'Given route object must be an instance of SeoAwareInterface'; } }
Improve code. (#<I>)
ongr-io_RouterBundle
train
php
621762222ff01cc0a03d72dc8d016cfefc299283
diff --git a/core-bundle/src/Resources/contao/classes/DataContainer.php b/core-bundle/src/Resources/contao/classes/DataContainer.php index <HASH>..<HASH> 100644 --- a/core-bundle/src/Resources/contao/classes/DataContainer.php +++ b/core-bundle/src/Resources/contao/classes/DataContainer.php @@ -579,11 +579,11 @@ abstract class DataContainer extends \Backend $fileBrowserTypes = []; $pickerBuilder = \System::getContainer()->get('contao.picker.builder'); - foreach (['file' => 'image', 'link' => 'file'] as $context => $type) + foreach (['file' => 'image', 'link' => 'file'] as $context => $fileBrowserType) { if ($pickerBuilder->supportsContext($context)) { - $fileBrowserTypes[] = $type; + $fileBrowserTypes[] = $fileBrowserType; } } @@ -598,7 +598,7 @@ abstract class DataContainer extends \Backend $updateMode = $objTemplate->parse(); - unset($file, $type, $pickerBuilder, $fileBrowserTypes); + unset($file, $type, $pickerBuilder, $fileBrowserTypes, $fileBrowserType); } // Handle multi-select fields in "override all" mode
[Core] Correctly add the file browser types to the template (see #<I>).
contao_contao
train
php
6e441aa1ef6da5f1e4653f8ea36e4b9b9e492a50
diff --git a/src/nu/validator/xml/CharacterUtil.java b/src/nu/validator/xml/CharacterUtil.java index <HASH>..<HASH> 100644 --- a/src/nu/validator/xml/CharacterUtil.java +++ b/src/nu/validator/xml/CharacterUtil.java @@ -31,10 +31,10 @@ import java.util.regex.Pattern; */ public class CharacterUtil { - private final static Pattern MINIMAL = Pattern.compile("[^\\x09\\x0A\\x0D\\u0020-\\uFFFD]"); + private final static Pattern MINIMAL = Pattern.compile("[^\\x09\\x0A\\x0D\\u0020-\\uFFFD\\uD800-\\uDBFF\\uDC00–\\uDFFF]"); // FIXME include UTF-16 representations of U+?FFFE and U+?FFFF. - private final static Pattern PRUDENT = Pattern.compile("[^\\x09\\x0A\\x0D\\u0020-\\uFFFD]|\\uFEFF|[\\x7F-\\x9F]|[\\uFDD0-\\uFDDF]"); + private final static Pattern PRUDENT = Pattern.compile("[^\\x09\\x0A\\x0D\\u0020-\\uFFFD\\uD800-\\uDBFF\\uDC00–\\uDFFF]|\\uFEFF|[\\x7F-\\x9F]|[\\uFDD0-\\uFDDF]"); public static String scrubCharacterData(CharSequence data) { Matcher m = MINIMAL.matcher(data);
Don't scrub out emoji or other astral-plan chars
validator_validator
train
java
f403e149f9559207c5342c4b5da41a9a6bb889c4
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -1,7 +1,7 @@ from setuptools import setup, find_packages setup( name = "beekeeper", - version = "0.5", + version = "0.6b", packages = ['beekeeper'], author = "Jesse Shapiro", author_email = "jesse@bedrockdata.com",
Automatic renaming objs/actions/vars breaks compatibility with <I>, so flagging as <I> (prerelease, as other changes may be coming)
haikuginger_beekeeper
train
py
9cb503f7b041c271121a1d3ed60e43b9f72174da
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -5,7 +5,7 @@ from setuptools import setup setup( name="PyTumblr", - version="0.0.5", + version="0.0.6", description="A Python API v2 wrapper for Tumblr", author="John Bunting", author_email="johnb@tumblr.com",
Bumping the version on pypi
tumblr_pytumblr
train
py
483e9a2a33fd7af4efd7eb11da87d801c8fc3027
diff --git a/src/forms/SubscriptionFormFactory.php b/src/forms/SubscriptionFormFactory.php index <HASH>..<HASH> 100644 --- a/src/forms/SubscriptionFormFactory.php +++ b/src/forms/SubscriptionFormFactory.php @@ -122,7 +122,7 @@ class SubscriptionFormFactory ->getControlPrototype() ->addAttributes(['class' => 'autosize']); - $form->addSelect('address_id', 'subscriptions.data.subscriptions.fields.address_id', $this->addressesRepository->addressesSelect($user, 'print')) + $form->addSelect('address_id', 'subscriptions.data.subscriptions.fields.address_id', $this->addressesRepository->addressesSelect($user, false)) ->setPrompt('--'); $form->addHidden('user_id', $user->id);
set crowdfunding address as subscriptions address after payment remp/novydenik#<I> + allow all address types in subscription and payment form
remp2020_crm-subscriptions-module
train
php
96112f80785f0e5adf5d22ffaf6507487d75d286
diff --git a/src/js/utils/Rest.js b/src/js/utils/Rest.js index <HASH>..<HASH> 100644 --- a/src/js/utils/Rest.js +++ b/src/js/utils/Rest.js @@ -15,10 +15,10 @@ export function buildParams (object) { if (null !== value && undefined !== value) { if (Array.isArray(value)) { for (let i = 0; i < value.length; i++) { - params.push(property + '=' + value[i]); + params.push(property + '=' + encodeURIComponent(value[i])); } } else { - params.push(property + '=' + value); + params.push(property + '=' + encodeURIComponent(value)); } } }
Add missing encodeURIComponent to Rest.
grommet_grommet
train
js
f47e80e9e6f3e406bf0060482468b0c81f92364a
diff --git a/inputs/File.js b/inputs/File.js index <HASH>..<HASH> 100644 --- a/inputs/File.js +++ b/inputs/File.js @@ -23,7 +23,8 @@ var component = dd.createClass({ name: field.name, className: 'form-control', style: {border: 0, boxShadow: 'none', paddingLeft: 0, paddingRight: 0}, - onChange: this.__onChange + onChange: this.__onChange, + multiple: field.multiple === true ? true : false }); } });
added multiple file support to file input type
espeakers_react-loose-forms.bootstrap3
train
js
14a85f776fcb526f046d91aa8b10d1499c505080
diff --git a/lib/puppet/provider/package/pacman.rb b/lib/puppet/provider/package/pacman.rb index <HASH>..<HASH> 100644 --- a/lib/puppet/provider/package/pacman.rb +++ b/lib/puppet/provider/package/pacman.rb @@ -3,7 +3,11 @@ require 'set' require 'uri' Puppet::Type.type(:package).provide :pacman, :parent => Puppet::Provider::Package do - desc "Support for the Package Manager Utility (pacman) used in Archlinux." + desc "Support for the Package Manager Utility (pacman) used in Archlinux. + + This provider supports the `install_options` attribute, which allows command-line flags to be passed to pacman. + These options should be specified as a string (e.g. '--flag'), a hash (e.g. {'--flag' => 'value'}), + or an array where each element is either a string or a hash." commands :pacman => "/usr/bin/pacman" # Yaourt is a common AUR helper which, if installed, we can use to query the AUR
(docs) Add note about install_options to pacman provider
puppetlabs_puppet
train
rb
7236586124878cc35d34b138f441810106dff388
diff --git a/marrow/mailer/address.py b/marrow/mailer/address.py index <HASH>..<HASH> 100644 --- a/marrow/mailer/address.py +++ b/marrow/mailer/address.py @@ -52,6 +52,8 @@ class Address(object): return unicode(self) == other elif isinstance(other, bytes): return bytes(self) == other + elif isinstance(other, tuple): + return (self.name, self.address) == other return NotImplemented def __ne__(self, other): diff --git a/tests/test_message.py b/tests/test_message.py index <HASH>..<HASH> 100644 --- a/tests/test_message.py +++ b/tests/test_message.py @@ -75,7 +75,7 @@ class TestBasicMessage(unittest.TestCase): def test_smtp_from_as_envelope(self): message = self.build_message() - message.smtp_from = 'devnull@example.com' + message.sender = 'devnull@example.com' self.assertEqual('devnull@example.com', str(message.envelope)) def test_subject_with_umlaut(self):
Further fixes; added missing tuple comparison to Address.__eq__.
marrow_mailer
train
py,py
869c26990ac5742ffad16c040a1cdaf8c66efb76
diff --git a/src/Yubikey.php b/src/Yubikey.php index <HASH>..<HASH> 100644 --- a/src/Yubikey.php +++ b/src/Yubikey.php @@ -373,7 +373,7 @@ class Yubikey /* Case 2. Verify signature first */ $rows = explode("\r\n", trim($str)); $response = array(); - while (list($key, $val) = each($rows)) { + foreach ($rows as $val) { /* = is also used in BASE64 encoding so we only replace the first = by # which is not used in BASE64 */ $val = preg_replace('/=/', '#', $val, 1); $row = explode("#", $val);
Converted each() call to a foreach as each() is deprecated in php version <I>.
bitbeans_Yubikey
train
php
fa573e3fe2b37c5e9902ad171ad27f8e6dad83ec
diff --git a/src/Http/Resources/HCUserResource.php b/src/Http/Resources/HCUserResource.php index <HASH>..<HASH> 100644 --- a/src/Http/Resources/HCUserResource.php +++ b/src/Http/Resources/HCUserResource.php @@ -32,14 +32,14 @@ namespace HoneyComb\Core\Http\Resources; use Carbon\Carbon; use HoneyComb\Core\Models\Acl\HCAclRole; use HoneyComb\Core\Models\HCUser; -use HoneyComb\Starter\DTO\HCBaseDTO; +use HoneyComb\Starter\DTO\HCBaseResource; use Illuminate\Support\Collection; /** * Class HCUserResource * @package HoneyComb\Core\Http\Resources */ -class HCUserResource extends HCBaseDTO +class HCUserResource extends HCBaseResource { /** * @var string
refactory DTO -> Services
honey-comb_core
train
php
1f386b13c789da5b4f30565bfb0c8eb559675f8f
diff --git a/mod/data/preset.php b/mod/data/preset.php index <HASH>..<HASH> 100644 --- a/mod/data/preset.php +++ b/mod/data/preset.php @@ -61,7 +61,8 @@ $presets = data_get_available_presets($context); $strdelete = get_string('deleted', 'data'); foreach ($presets as &$preset) { if (!empty($preset->userid)) { - $presetuser = $DB->get_record('user', array('id'=>$preset->userid), 'id,firstname,lastname', MUST_EXIST); + $namefields = get_all_user_name_fields(true); + $presetuser = $DB->get_record('user', array('id' => $preset->userid), 'id, ' . $namefields, MUST_EXIST); $preset->description = $preset->name.' ('.fullname($presetuser, true).')'; } else { $preset->userid = 0;
MDL-<I> mod_data: added missing additional name fields
moodle_moodle
train
php
83e1aa7d8b2d4f3f6ae00cbd97e931e15618f670
diff --git a/src/main/java/org/whitesource/fs/FSAConfiguration.java b/src/main/java/org/whitesource/fs/FSAConfiguration.java index <HASH>..<HASH> 100644 --- a/src/main/java/org/whitesource/fs/FSAConfiguration.java +++ b/src/main/java/org/whitesource/fs/FSAConfiguration.java @@ -304,7 +304,7 @@ public class FSAConfiguration { boolean mavenResolveDependencies = FSAConfiguration.getBooleanProperty(config, ConfigPropertyKeys.MAVEN_RESOLVE_DEPENDENCIES, true); String[] mavenIgnoredScopes = FSAConfiguration.getListProperty(config, ConfigPropertyKeys.MAVEN_IGNORED_SCOPES, null); - boolean mavenAggregateModules = FSAConfiguration.getBooleanProperty(config, ConfigPropertyKeys.MAVEN_AGGREGATE_MODULES, true); + boolean mavenAggregateModules = FSAConfiguration.getBooleanProperty(config, ConfigPropertyKeys.MAVEN_AGGREGATE_MODULES, false); boolean dependenciesOnly = FSAConfiguration.getBooleanProperty(config, ConfigPropertyKeys.DEPENDENCIES_ONLY, false);
WSE-<I> FSA Config Parameters - Change default for maven.aggregateModules to false false means - separated projects in Jira true means - all the project modules will be under same project in Jira
whitesource_fs-agent
train
java
92e7af87693b44bc3b6afc28bc255ed54ea6363e
diff --git a/abydos/distance/_yjhhr.py b/abydos/distance/_yjhhr.py index <HASH>..<HASH> 100644 --- a/abydos/distance/_yjhhr.py +++ b/abydos/distance/_yjhhr.py @@ -176,10 +176,11 @@ class YJHHR(_TokenDistance): .. versionadded:: 0.4.0 """ + distance = self.dist_abs(src, tar) union = self._union_card() if union == 0: return 0.0 - return self.dist_abs(src, tar)/self._union_card() + return distance/union if __name__ == '__main__':
dist_abs needs to come first (and trigger tokenization)
chrislit_abydos
train
py
7dddec679957199abcacaa8a4dbf654ca8abc02c
diff --git a/pkg/kubelet/config/config.go b/pkg/kubelet/config/config.go index <HASH>..<HASH> 100644 --- a/pkg/kubelet/config/config.go +++ b/pkg/kubelet/config/config.go @@ -159,13 +159,10 @@ func (s *podStorage) Merge(source string, change interface{}) error { // deliver update notifications switch s.mode { case PodConfigNotificationIncremental: - if firstSet { - s.updates <- kubetypes.PodUpdate{Pods: s.MergedState().([]*api.Pod), Op: kubetypes.SET, Source: source} - } if len(deletes.Pods) > 0 { s.updates <- *deletes } - if len(adds.Pods) > 0 { + if len(adds.Pods) > 0 || firstSet { s.updates <- *adds } if len(updates.Pods) > 0 {
Switch to empty ADD PodUpdate for PodConfigNotificationIncremental mode
kubernetes_kubernetes
train
go
1417e56f28a8ac37f59ece67f3ffb286804fa124
diff --git a/eth/vm/forks/berlin/transactions.py b/eth/vm/forks/berlin/transactions.py index <HASH>..<HASH> 100644 --- a/eth/vm/forks/berlin/transactions.py +++ b/eth/vm/forks/berlin/transactions.py @@ -348,6 +348,9 @@ class TypedTransaction(SignedTransactionMethods, SignedTransactionAPI, Transacti return TypedReceipt(ACCESS_LIST_TRANSACTION_TYPE, inner_receipt) + def __hash__(self) -> int: + return hash((self.type_id, self._inner)) + class BerlinTransactionBuilder(TransactionBuilderAPI): """ @@ -379,7 +382,10 @@ class BerlinTransactionBuilder(TransactionBuilderAPI): @classmethod def serialize(cls, obj: SignedTransactionAPI) -> bytes: - return cls.legacy_signed.serialize(obj) + if isinstance(obj, TypedTransaction): + return TypedTransaction.serialize(obj) + else: + return cls.legacy_signed.serialize(obj) @classmethod def create_unsigned_transaction(cls,
Finalize EIP-<I>: Serialize Typed Transactions Also, rlp objects must be hashable. Pass fixtures/BlockchainTests/GeneralStateTests/stEIP<I>/addressOpcodes.json:addressOpcodes_d0g0v0_Berlin
ethereum_py-evm
train
py
a88c8e91079e9b2a7733952537952b2980c0f1d1
diff --git a/blocks/course_summary/block_course_summary.php b/blocks/course_summary/block_course_summary.php index <HASH>..<HASH> 100644 --- a/blocks/course_summary/block_course_summary.php +++ b/blocks/course_summary/block_course_summary.php @@ -2,7 +2,11 @@ class CourseBlock_course_summary extends MoodleBlock { function CourseBlock_course_summary ($course) { - $this->title = get_string('blockname','block_course_summary'); + if (empty($course->category)) { // Site level + $this->title = get_string('frontpagedescription'); + } else { + $this->title = get_string('blockname','block_course_summary'); + } $this->content_type = BLOCK_TYPE_TEXT; $this->course = $course; $this->version = 2004052600;
Show a different string on the site page (instead of Course Summary)
moodle_moodle
train
php
3f53941289fd1c23fb06edf3851c07c5ec2af43e
diff --git a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageGrpcWriteChannel.java b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageGrpcWriteChannel.java index <HASH>..<HASH> 100644 --- a/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageGrpcWriteChannel.java +++ b/gcsio/src/main/java/com/google/cloud/hadoop/gcsio/GoogleCloudStorageGrpcWriteChannel.java @@ -209,7 +209,7 @@ public final class GoogleCloudStorageGrpcWriteChannel streamFinished = lastReadBytes == -1 || pipeSource.read() == -1; pipeSource.reset(); - return ByteString.copyFrom(data, 0, bytesToRead); + return ByteString.copyFrom(data, 0, bytesRead); } private boolean chunkFinished(int chunkSize) {
Fix bug in GrpcWriteChannel I found this one when I wrote the tests for the write path. The writeChannel was always sending chunks of 8MB (even when there was less data). Since the remaining bytes were null characters they were getting stripped out by the server, so the result was correct, but that's a pretty silly waste of bandwidth! Change-Id: I9eedd<I>ef7c<I>d3a<I>b<I>b4de<I>c<I>b
GoogleCloudPlatform_bigdata-interop
train
java
476e50eb6a0e63f2b459a0db70c609f43a0145a1
diff --git a/spec/unit/directory_renderer_spec.rb b/spec/unit/directory_renderer_spec.rb index <HASH>..<HASH> 100644 --- a/spec/unit/directory_renderer_spec.rb +++ b/spec/unit/directory_renderer_spec.rb @@ -156,4 +156,18 @@ RSpec.describe TTY::Tree::DirectoryRenderer do "└── dir2\n", ].join) end + + it "doesn't show dirs with files exceeding limit" do + tree = within_dir(fixtures_path) do + TTY::Tree.new('large_dir', file_limit: 4) + end + + expect(tree.render).to eq([ + "large_dir\n", + "β”œβ”€β”€ huge_dir\n", + "β”œβ”€β”€ large1\n", + "β”œβ”€β”€ large2\n", + "└── large3\n", + ].join) + end end
Ensure file limit is handled by renderer correctly.
piotrmurach_tty-tree
train
rb
016803c47eb0c86240d8310af3b48f61d159a264
diff --git a/src/Manifest.js b/src/Manifest.js index <HASH>..<HASH> 100644 --- a/src/Manifest.js +++ b/src/Manifest.js @@ -86,7 +86,7 @@ function Manifest(output, path) { // supported mode this._display = json.display; } else { - output.warning("Unsupported value '" + json.display + "' in manifest.json"); + output.warning("Unsupported value '" + json.display + "' for 'display' in manifest.json"); } } @@ -107,7 +107,7 @@ function Manifest(output, path) { // supported mode this._orientation = json.orientation; } else { - output.warning("Unsupported value '" + json.orientation + "' in manifest.json"); + output.warning("Unsupported value '" + json.orientation + "' for 'orientation' in manifest.json"); } }
Manifest: improve warning message when manifest fields are invalid (fix xwalk-<I>)
crosswalk-project_crosswalk-app-tools
train
js
acec025471ca86569d4cede221df71c7ca1df489
diff --git a/pages/tests/test_selenium.py b/pages/tests/test_selenium.py index <HASH>..<HASH> 100644 --- a/pages/tests/test_selenium.py +++ b/pages/tests/test_selenium.py @@ -85,7 +85,11 @@ class SeleniumTestCase(TestCase, LiveServerTestCase): def tearDown(self): self.browser.close() - self.browser.quit() + try: + self.browser.quit() + except OSError: + # http://stackoverflow.com/questions/42705674/python-selenium-phantomjs-quit-error + pass super(SeleniumTestCase, self).tearDown() def url_change(self, id):
Pass over the bad file descriptor error
batiste_django-page-cms
train
py
b5c4aa67f2b2d8b774a7a23cf82f2f1bbffc3310
diff --git a/Controller/EmailController.php b/Controller/EmailController.php index <HASH>..<HASH> 100644 --- a/Controller/EmailController.php +++ b/Controller/EmailController.php @@ -131,7 +131,7 @@ class EmailController extends ContainerAware // Submit form if ('POST' === $request->getMethod()) { - $form->bindRequest($request); + $form->bind($request); if ($form->isValid()) { $em = $this->container->get('doctrine.orm.entity_manager'); diff --git a/Controller/LayoutController.php b/Controller/LayoutController.php index <HASH>..<HASH> 100644 --- a/Controller/LayoutController.php +++ b/Controller/LayoutController.php @@ -62,7 +62,7 @@ class LayoutController extends Controller // Submit form if ('POST' === $request->getMethod()) { - $form->bindRequest($request); + $form->bind($request); if ($form->isValid()) { $em->persist($translation); $em->flush(); @@ -125,7 +125,7 @@ class LayoutController extends Controller )); // Submit form if ('POST' === $request->getMethod()) { - $form->bindRequest($request); + $form->bind($request); if ($form->isValid()) { $em = $this->get('doctrine.orm.entity_manager');
fix deprecated method call (bindRequest)
lexik_LexikMailerBundle
train
php,php
919e4091bb65c75c483b97e349ff35aef26796c4
diff --git a/tests/integration/empty.php b/tests/integration/empty.php index <HASH>..<HASH> 100644 --- a/tests/integration/empty.php +++ b/tests/integration/empty.php @@ -25,10 +25,41 @@ class emptyExistsTestCase extends WatchmanTestCase { 'expression' => 'exists' )); + $exists = array(); + foreach ($results['files'] as $file) { + $exists[] = $file['name']; + } + sort($exists); + + $this->assertEqual( + array('empty', 'notempty'), + $exists + ); + + unlink("$root/empty"); + + // Wait for change to be observed + $this->assertFileList($root, array( + 'notempty' + )); + + $results = $this->watchmanCommand('query', $root, array( + 'expression' => 'exists' + )); + $this->assertEqual( 'notempty', $results['files'][0]['name'] ); + + $results = $this->watchmanCommand('query', $root, array( + 'expression' => array('not', 'exists') + )); + + $this->assertEqual( + 'empty', + $results['files'][0]['name'] + ); } }
Do a better job at the empty/exists unit test
facebook_watchman
train
php
0558c2aed0d23591ca41683d95fa8d4ce25ea8ba
diff --git a/lib/appsignal/railtie.rb b/lib/appsignal/railtie.rb index <HASH>..<HASH> 100644 --- a/lib/appsignal/railtie.rb +++ b/lib/appsignal/railtie.rb @@ -2,7 +2,7 @@ module Appsignal class Railtie < Rails::Railtie rake_tasks do - require 'tasks/appsignal_tasks' if Appsignal.active + require 'tasks/appsignal_tasks' end initializer "appsignal.configure_rails_initialization" do |app|
Load rake tasks if gem is not active
appsignal_appsignal-ruby
train
rb
f9f9c5332a674fb8c3a26be47dd3f1d9fda4693b
diff --git a/lib/px.js b/lib/px.js index <HASH>..<HASH> 100644 --- a/lib/px.js +++ b/lib/px.js @@ -112,7 +112,7 @@ return index; } else { - return this.data[index].replace(/"/g, ''); + return this.data[index].replace(/"|'/g, ''); } },
px.datum now strips single as well as double quotes
fod_px.js
train
js
d9716a97d7bbe4c79f489ecaf8fa136121d75a44
diff --git a/Lib/fontbakery/specifications/googlefonts.py b/Lib/fontbakery/specifications/googlefonts.py index <HASH>..<HASH> 100644 --- a/Lib/fontbakery/specifications/googlefonts.py +++ b/Lib/fontbakery/specifications/googlefonts.py @@ -4343,3 +4343,26 @@ def check_regression_missing_glyphs(ttFont, gfonts_ttFont): ', '.join(hex_codepoints))) else: yield PASS, ('Font has all the glyphs from the previous release') + + +@register_test +@test( + id='com.google.fonts/test/155' + , conditions=['font_metadata'] +) +def check_METADATA_copyright_notices_match_name_table_entries(ttFont, font_metadata): + """"Copyright notice name entry matches those on METADATA.pb ?""" + from fontbakery.constants import NAMEID_COPYRIGHT_NOTICE + failed = False + for nameRecord in ttFont['name'].names: + string = nameRecord.string.decode(nameRecord.getEncoding()) + if nameRecord.nameID == NAMEID_COPYRIGHT_NOTICE and\ + string != font_metadata.copyright: + failed = True + yield FAIL, ("Copyright notice name entry ('{}')" + " differs from copyright field on" + " METADATA.pb ('{}').").format(unidecode(string), + font_metadata.copyright) + if not failed: + yield PASS, ("Copyright notice name entry matches" + " those on METADATA.pb fields.")
new test: com.google.fonts/test/<I> "Copyright notice name entry matches those on METADATA.pb ?" (issue #<I>)
googlefonts_fontbakery
train
py
c9b153e70e94208565ecfa397cfb66ae26909f31
diff --git a/src/Monii/AggregateEventStorage/Fixtures/Blogging/Post.php b/src/Monii/AggregateEventStorage/Fixtures/Blogging/Post.php index <HASH>..<HASH> 100644 --- a/src/Monii/AggregateEventStorage/Fixtures/Blogging/Post.php +++ b/src/Monii/AggregateEventStorage/Fixtures/Blogging/Post.php @@ -17,7 +17,7 @@ class Post private $tags; /** - * @var array + * @var Comment[] */ private $comments;
Correct the docblock type for an array of objects
depot_depot-testing-fixtures
train
php
5a3a348f5541542e38d8df20930ceb19c91a2515
diff --git a/tds/src/main/java/thredds/server/admin/SpringDocController.java b/tds/src/main/java/thredds/server/admin/SpringDocController.java index <HASH>..<HASH> 100644 --- a/tds/src/main/java/thredds/server/admin/SpringDocController.java +++ b/tds/src/main/java/thredds/server/admin/SpringDocController.java @@ -14,16 +14,16 @@ import org.springframework.web.servlet.mvc.method.annotation.RequestMappingHandl * @since 10/23/13 * @see " http://www.java-allandsundry.com/2012/03/endpoint-documentation-controller-for.html" */ -@Controller +//@Controller public class SpringDocController { private final RequestMappingHandlerMapping handlerMapping; - @Autowired + //@Autowired public SpringDocController(RequestMappingHandlerMapping handlerMapping) { this.handlerMapping = handlerMapping; } - @RequestMapping(value = "/requestMaps", method = RequestMethod.GET) + //@RequestMapping(value = "/requestMaps", method = RequestMethod.GET) public void show(Model model) { model.addAttribute("handlerMethods", this.handlerMapping.getHandlerMethods()); }
fileServer, DLwriter as annotated controller; fix problems in catalog controllers
Unidata_thredds
train
java
102ec394b667b662e738425d333b1017d6af0467
diff --git a/config.go b/config.go index <HASH>..<HASH> 100644 --- a/config.go +++ b/config.go @@ -155,9 +155,9 @@ func newConfig() (config quick.Config) { exampleHostConf.SecretAccessKey = globalSecretAccessKey conf.Hosts[exampleHostURL] = exampleHostConf - conf.Hosts["http*://s3*.amazonaws.com"] = s3HostConf - conf.Hosts["http://play.minio.io:9000"] = playHostConfig - conf.Hosts["http://dl.minio.io:9000"] = dlHostConfig + conf.Hosts["s3*.amazonaws.com"] = s3HostConf + conf.Hosts["play.minio.io:9000"] = playHostConfig + conf.Hosts["dl.minio.io:9000"] = dlHostConfig aliases := make(map[string]string) aliases["s3"] = "https://s3.amazonaws.com"
filepath.Match on http prefixed globURL will fail if matched with only u.Host, config can have non absolute globURLs
minio_mc
train
go
5cbf1fae5e577942bdf4744c4df998e294ab92ba
diff --git a/lib/framy_mp3.rb b/lib/framy_mp3.rb index <HASH>..<HASH> 100644 --- a/lib/framy_mp3.rb +++ b/lib/framy_mp3.rb @@ -4,4 +4,15 @@ require "framy_mp3/id3_tag" require "framy_mp3/file" module FramyMP3 + + def self.merge(*files) + raise ArgumentError, "all files must be FramyMP3::File" if files.any? { |file| !file.is_a?(FramyMP3::File) } + raise ArgumentError, "expected at least one file" unless files.count.positive? + outfile = files.first.dup + files[1..-1].each do |file| + outfile.frames.push(*file.frames) + end + outfile + end + end
[feature] Added Module method for merging mp3 files without reencoding (<I>m)
kobsy_framy_mp3
train
rb
ddadf94785cc4ca785bacd5eb319904943178897
diff --git a/parsl/dataflow/dflow.py b/parsl/dataflow/dflow.py index <HASH>..<HASH> 100644 --- a/parsl/dataflow/dflow.py +++ b/parsl/dataflow/dflow.py @@ -371,10 +371,8 @@ class DataFlowKernel(object): outer_task_id = task_record['id'] - try: - res = self._unwrap_remote_exception_wrapper(inner_app_future) - - except Exception as e: + if inner_app_future.exception(): + e = inner_app_future.exception() logger.debug("Task {} failed due to failure of inner join future".format(outer_task_id)) # We keep the history separately, since the future itself could be # tossed. @@ -388,6 +386,7 @@ class DataFlowKernel(object): task_record['app_fu'].set_exception(e) else: + res = inner_app_future.result() self._complete_task(task_record, States.exec_done, res) self._log_std_streams(task_record)
Do not unwrap joinapp future exceptions unnecessarily (#<I>) An AppFuture will always present its exception as a future.exception(), not as a RemoteWrapper. RemoteWrappers are used at the executor future layer.
Parsl_parsl
train
py
fd7ca6ebca354e8509c4ec32bd343ab0aa511452
diff --git a/activerecord/lib/active_record/relation/query_methods.rb b/activerecord/lib/active_record/relation/query_methods.rb index <HASH>..<HASH> 100644 --- a/activerecord/lib/active_record/relation/query_methods.rb +++ b/activerecord/lib/active_record/relation/query_methods.rb @@ -763,7 +763,7 @@ module ActiveRecord # end # def none - where("1=0").extending!(NullRelation) + spawn.none! end def none! # :nodoc:
Call `spawn` and bang method for `none` All query methods calls `spawn` and bang method, but only `none` is not.
rails_rails
train
rb
cf041d583245eacb0c5a21baf0cfcee7e5bafe31
diff --git a/tcex/profile/migrate.py b/tcex/profile/migrate.py index <HASH>..<HASH> 100644 --- a/tcex/profile/migrate.py +++ b/tcex/profile/migrate.py @@ -312,7 +312,8 @@ class Migrate: kvstore_data: Optional[dict] = profile_data['stage'].get('redis', None) if kvstore_data is not None: del profile_data['stage']['redis'] - profile_data['stage']['kvstore'] = kvstore_data + if 'kvstore' not in profile_data['stage'].keys(): + profile_data['stage']['kvstore'] = kvstore_data @staticmethod def stage_threatconnect_data(profile_data: dict) -> None:
minor update to fix issue with kvstore data in profiles not properly being staged
ThreatConnect-Inc_tcex
train
py
3b1ef7c7cbe16a3ebba3a420544e8856fbc6d871
diff --git a/setup.py b/setup.py index <HASH>..<HASH> 100644 --- a/setup.py +++ b/setup.py @@ -27,7 +27,7 @@ if __name__ == '__main__': url='http://github.com/VUIIS/PyCap', version=redcap.__version__, download_url='http://github.com/VUIIS/PyCap', - long_description=open('README.md').read() + '\n\n', + long_description=open('README.rst').read() + '\n\n', packages=['redcap'], platforms='any', classifiers=(
change README to rst
redcap-tools_PyCap
train
py
a6c77863a5e208af39449dfffb6a1eeb492a435c
diff --git a/gems/core/lib/torquebox/msc.rb b/gems/core/lib/torquebox/msc.rb index <HASH>..<HASH> 100644 --- a/gems/core/lib/torquebox/msc.rb +++ b/gems/core/lib/torquebox/msc.rb @@ -71,11 +71,10 @@ module TorqueBox return nil if war_meta_data.nil? # no web component in this application jboss_web_meta_data = war_meta_data.getMergedJBossWebMetaData virtual_host = jboss_web_meta_data.virtual_hosts.first || 'default-host' - virtual_host = %Q("#{virtual_host}") if virtual_host.include?('.') context_path = jboss_web_meta_data.context_root context_path = "/#{context_path}" unless context_path.start_with?('/') - service_string = "jboss.web.deployment.#{virtual_host}.#{context_path}" - service_name = org.jboss.msc.service.ServiceName.parse(service_string) + deployment_service_name = org.jboss.msc.service.ServiceName.parse("jboss.web.deployment") + service_name = deployment_service_name.append(virtual_host).append(context_path) get_service(service_name).value end end
Let ServiceName handle quoting and scaping of parts for us
torquebox_torquebox
train
rb
138de2c6099b4ec7f9b9854ffbcd5b0695f8ed9a
diff --git a/lib/pyfrc/physics/core.py b/lib/pyfrc/physics/core.py index <HASH>..<HASH> 100644 --- a/lib/pyfrc/physics/core.py +++ b/lib/pyfrc/physics/core.py @@ -320,6 +320,25 @@ class PhysicsInterface: ''' with self._lock: return self.x, self.y, self.angle + + def get_offset(self, x, y): + ''' + Computes how far away and at what angle a coordinate is + located. + + Distance is returned in feet, angle is returned in degrees + + :returns: distance,angle offset of the given x,y coordinate + + .. versionadded:: 2018.1.7 + ''' + with self._lock: + dx = self.x - x + dy = self.y - y + + distance = math.hypot(dx, dy) + angle = math.atan2(dy, dx) + return distance, math.degrees(angle) def _get_vector(self): '''
physics: Add utility function to help with computing distance to specified target
robotpy_pyfrc
train
py
21ce8eac9b9bd8e14e3396caf2e30751889e26cb
diff --git a/activerecord/lib/active_record/base.rb b/activerecord/lib/active_record/base.rb index <HASH>..<HASH> 100755 --- a/activerecord/lib/active_record/base.rb +++ b/activerecord/lib/active_record/base.rb @@ -1609,30 +1609,6 @@ module ActiveRecord #:nodoc: end end - def construct_order(order, scope) - orders = [] - - scoped_order = scope[:order] if scope - if order - orders << order - orders << scoped_order if scoped_order && scoped_order != order - elsif scoped_order - orders << scoped_order - end - - orders.reject {|o| o.blank?} - end - - def construct_limit(limit, scope) - limit ||= scope[:limit] if scope - limit - end - - def construct_offset(offset, scope) - offset ||= scope[:offset] if scope - offset - end - # Merges includes so that the result is a valid +include+ def merge_includes(first, second) (Array.wrap(first) + Array.wrap(second)).uniq
Remove stale construct_* methods
rails_rails
train
rb