text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Fix import in tests build | import * as dateCompare from "../../date/compare";
import * as dateFormat from "../../date/format";
import * as domAttr from "../../dom/attr";
import * as domCSS from "../../dom/css";
import * as domEvents from "../../dom/events";
import * as domManipulate from "../../dom/manipulate";
import * as domTraverse from "../.... | import * as dateCompare from "../../date/compare";
import * as dateFormat from "../../date/format";
import * as domClasses from "../../dom/classes";
import * as domCSS from "../../dom/css";
import * as domEvents from "../../dom/events";
import * as domManipulate from "../../dom/manipulate";
import * as domTraverse from... |
Remove whitespace from name when checking for bye | from django.core.exceptions import ValidationError
from django.template.defaultfilters import slugify
import re
NAME_REGULAR_EXPRESSION = re.compile(r'^[a-zA-Z0-9]+[\w\-\.: ]*$')
def greater_than_zero(value):
"""Checks if value is greater than zero"""
if value <= 0:
raise ValidationError("Value must ... | from django.core.exceptions import ValidationError
from django.template.defaultfilters import slugify
import re
NAME_REGULAR_EXPRESSION = re.compile(r'^[a-zA-Z0-9]+[\w\-\.: ]*$')
def greater_than_zero(value):
"""Checks if value is greater than zero"""
if value <= 0:
raise ValidationError("Value must ... |
Change the unit of timeout | // straw-ios-service-http.js
// This library depends on es6 Promise.
/**
* @class
* @singleton
*/
straw.service.http = (function (straw) {
'use strict';
var exports = {};
var core = straw.core;
var Promise = window.Promise;
/**
* @method
* Perform `GET` method.
*
* @para... | // straw-ios-service-http.js
// This library depends on es6 Promise.
/**
* @class
* @singleton
*/
straw.service.http = (function (straw) {
'use strict';
var exports = {};
var core = straw.core;
var Promise = window.Promise;
/**
* @method
* Perform `GET` method.
*
* @para... |
Add annoy dependency for Trimap | from setuptools import setup, find_packages
setup(name='rnaseq-lib',
version='1.0a27',
description='Library of convenience functions related to current research',
url='http://github.com/jvivian/rnaseq-lib',
author='John Vivian',
author_email='jtvivian@gmail.com',
license='MIT',
... | from setuptools import setup, find_packages
setup(name='rnaseq-lib',
version='1.0a27',
description='Library of convenience functions related to current research',
url='http://github.com/jvivian/rnaseq-lib',
author='John Vivian',
author_email='jtvivian@gmail.com',
license='MIT',
... |
Add actions argument to say function | 'use strict';
const Bot = require('./bot');
class SmoochApiBot extends Bot {
constructor(options) {
super(options);
this.name = options.name;
this.avatarUrl = options.avatarUrl;
}
say(text, actions) {
const api = this.store.getApi();
let message = Object.assign({
... | 'use strict';
const Bot = require('./bot');
class SmoochApiBot extends Bot {
constructor(options) {
super(options);
this.name = options.name;
this.avatarUrl = options.avatarUrl;
}
say(text) {
const api = this.store.getApi();
let message = Object.assign({
... |
Change the name of the format function in the source class | <?php
/*
* This file is part of the DataGridBundle.
*
* (c) Stanislav Turza <sorien@mail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sorien\DataGridBundle\Grid\Mapping;
/**
* @Annotation
*/
c... | <?php
/*
* This file is part of the DataGridBundle.
*
* (c) Stanislav Turza <sorien@mail.com>
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Sorien\DataGridBundle\Grid\Mapping;
/**
* @Annotation
*/
c... |
[kucoin] Allow to specify (optional) timespan on trade history params. | package org.knowm.xchange.kucoin.service;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.service.trade.params.TradeHistoryParamCurrencyPair;
import org.knowm.xchange.service.trade.params.TradeHistoryParamPaging;
import org.knowm.xchange.service.trade.params.TradeHistoryParamsTimeSpan;
import... | package org.knowm.xchange.kucoin.service;
import org.knowm.xchange.currency.CurrencyPair;
import org.knowm.xchange.service.trade.params.TradeHistoryParamCurrencyPair;
import org.knowm.xchange.service.trade.params.TradeHistoryParamPaging;
public class KucoinTradeHistoryParams implements TradeHistoryParamCurrencyPair, ... |
Add back correct lost file | package seedu.taskman.storage;
import seedu.taskman.commons.exceptions.IllegalValueException;
import seedu.taskman.model.tag.Tag;
import javax.xml.bind.annotation.XmlValue;
/**
* JAXB-friendly adapted version of the Tag.
*/
public class XmlAdaptedTag {
@XmlValue
public String tagName;
/**
* No-a... | package seedu.taskman.storage;
import seedu.taskman.commons.exceptions.IllegalValueException;
import seedu.taskman.model.tag.Tag;
import javax.xml.bind.annotation.XmlValue;
/**
* JAXB-friendly adapted version of the Tag.
*/
public class XmlAdaptedTag {
@XmlValue
public String tagName;
/**
* No-a... |
Read sentry release from service if available | import Ember from 'ember';
import config from '../config/environment';
export function initialize(application) {
if (Ember.get(config, 'sentry.development') === true) {
return;
}
if (!config.sentry) {
throw new Error('`sentry` should be configured when not in development mode.');
}
const {
dsn... | import Ember from 'ember';
import config from '../config/environment';
export function initialize(application) {
if (Ember.get(config, 'sentry.development') === true) {
return;
}
if (!config.sentry) {
throw new Error('`sentry` should be configured when not in development mode.');
}
const {
dsn... |
Add basic documentation to ModelReport | from copy import deepcopy
class ModelReport(object):
"""
An abstraction of a model report that wraps access to various sections
of the report.
"""
"""
:param raw_report: the dict representation of model report JSON
:type: dict
"""
def __init__(self, raw_report):
self._raw_r... | from copy import deepcopy
class ModelReport(object):
"""
An abstraction of a model report that wraps access to various sections
of the report.
"""
"""
:param raw_report: the dict representation of model report JSON
:type: dict
"""
def __init__(self, raw_report):
self._raw_r... |
Fix for tags not being cleaned up | define([
'goo/fsmpack/statemachine/actions/Action',
'goo/entities/components/ProximityComponent'
],
/** @lends */
function(
Action,
ProximityComponent
) {
'use strict';
function TagAction(/*id, settings*/) {
Action.apply(this, arguments);
}
TagAction.prototype = Object.create(Action.prototype);
TagAction.p... | define([
'goo/fsmpack/statemachine/actions/Action',
'goo/entities/components/ProximityComponent'
],
/** @lends */
function(
Action,
ProximityComponent
) {
'use strict';
function TagAction(/*id, settings*/) {
Action.apply(this, arguments);
}
TagAction.prototype = Object.create(Action.prototype);
TagAction.p... |
Fix templates building on OS X | #!/usr/bin/env python3
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from sys import platform
import subprocess
import glob
import os
ver = os.environ.get("PKGVER") or subprocess.run(['git', 'describe', '--tags'],
stdout=subprocess.PIPE).stdout.decode().strip()
setup(... | #!/usr/bin/env python3
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
from sys import platform
import subprocess
import glob
import os
ver = os.environ.get("PKGVER") or subprocess.run(['git', 'describe', '--tags'],
stdout=subprocess.PIPE).stdout.decode().strip()
setup... |
Create log dir if it doesn't exist | <?php
namespace Sleeti\Logging;
class Logger {
protected $container;
protected $handler;
protected $loggers;
public function __construct($container) {
$this->container = $container;
if (!is_dir($this->container['settings']['logging']['path']) && $this->container['settings']['logging']['enabled']) {
mkd... | <?php
namespace Sleeti\Logging;
class Logger {
protected $container;
protected $handler;
protected $loggers;
public function __construct($container) {
$this->container = $container;
$logfile = $this->container['settings']['logging']['path'] . 'sleeti.log';
$this->handler = new \Monolog\Handler\Rot... |
Allow to call wordpress functions using WP helper | <?php
namespace Ampersand;
use Ampersand\Config;
use Ampersand\Http\Session;
use Ampersand\Helpers\URL;
use Ampersand\Helpers\WP;
class Render {
private static $twig;
public static function getTwig() {
if(!self::$twig){
\Twig_Autoloader::register();
$cache = Config::get('cache') ? Config::get('c... | <?php
namespace Ampersand;
use Ampersand\Config;
use Ampersand\Http\Session;
use Ampersand\Helpers\URL;
class Render {
private static $twig;
public static function getTwig() {
if(!self::$twig){
\Twig_Autoloader::register();
$cache = Config::get('cache') ? Config::get('cache').'/' : false;
... |
Fix a breaking change due to the angular dependency update | import angular from 'angular'
import 'angular-aria'
import 'angular-i18n/nl-nl'
import 'angular-sanitize'
const moduleDependencies = [
// Main modules
'dpDetail',
'dpDataSelection',
// Shared module
'dpShared',
'ngAria',
]
// eslint-disable-next-line angular/di
angular.module('atlas', moduleDependencies)... | import angular from 'angular'
import 'angular-aria'
import 'angular-i18n/nl-nl'
import 'angular-sanitize'
const moduleDependencies = [
// Main modules
'dpDetail',
'dpDataSelection',
// Shared module
'dpShared',
'ngAria',
]
// eslint-disable-next-line angular/di
angular.module('atlas', moduleDependencies)... |
Modify parsing logic for last_modified in JSON | # Stdlib imports
from datetime import datetime
from pytz import timezone
# Core Django imports
from django.utils.timezone import utc
# Imports from app
from sync_center.models import Map, KML
def get_update_id_list(model_name, req_data):
db_data = None
if model_name == 'map':
db_data = Map.objects.... | # Stdlib imports
from datetime import datetime
from pytz import timezone
# Core Django imports
from django.utils.timezone import utc
# Imports from app
from sync_center.models import Map, KML
def get_update_id_list(model_name, req_data):
db_data = None
if model_name == 'map':
db_data = Map.objects.... |
Remove sentinel from config. Travis won't pass if a sentinel is set | //Copyright 2012 Telefonica Investigación y Desarrollo, S.A.U
//
//This file is part of RUSH.
//
// RUSH is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
// License as published by the Free Software Foundation, either version 3 of the License, or (at your opt... | //Copyright 2012 Telefonica Investigación y Desarrollo, S.A.U
//
//This file is part of RUSH.
//
// RUSH is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public
// License as published by the Free Software Foundation, either version 3 of the License, or (at your opt... |
Fix deprecation warning: DATABASE_* -> DATABASES | from os.path import dirname, join
TEST_ROOT = dirname(__file__)
INSTALLED_APPS = ('adminfiles', 'tests',
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.auth',
'django.contrib.sessio... | from os.path import dirname, join
TEST_ROOT = dirname(__file__)
INSTALLED_APPS = ('adminfiles', 'tests',
'django.contrib.contenttypes',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.auth',
'django.contrib.sessio... |
Fix functional test for policy type listing
This patch fixes the funtional test for policy type listing. We have
changed the names of builtin policy types.
Change-Id: I9f04ab2a4245e8946db3a0255658676cc5f600ab | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... |
fix(this._super): Add this._super calls to avoid weird JS breaking behaviour | (function($){
$.entwine('userswitcher', function($){
$('form.userswitcher select').entwine({
onchange : function(){
this.parents('form:first').submit();
this._super();
}
});
$('form.userswitcher .Actions').entwine({
onmatch : function(){
this.hide();
this._super();
}
});
$('bod... | (function($){
$.entwine('userswitcher', function($){
$('form.userswitcher select').entwine({
onchange : function(){
this.parents('form:first').submit();
}
});
$('form.userswitcher .Actions').entwine({
onmatch : function(){
this.hide();
}
});
$('body').entwine({
onmatch : function(){... |
Add an interface to change table_name | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... | # encoding: utf-8
"""
.. codeauthor:: Tsuyoshi Hombashi <tsuyoshi.hombashi@gmail.com>
"""
from __future__ import absolute_import
from ..interface import TableLoaderInterface
class TableLoaderManager(TableLoaderInterface):
def __init__(self, loader):
self.__loader = loader
@property
def loader... |
Improve JVM launch time message | /*
* Copyright (c) 2015-2019 Dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... | /*
* Copyright (c) 2015-2019 Dzikoysk
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agre... |
Use the render shortcut which defaults to RequestContext and allows passing a status code | from django.contrib.auth.decorators import login_required
from django.shortcuts import render
__author__ = 'Quantum'
def generic_message(request, title, message, status=None):
return render(request, 'generic_message.jade', {
'message': message,
'title': title
}, status=status)
class TitleMi... | from django.contrib.auth.decorators import login_required
from django.shortcuts import render_to_response
from django.template import RequestContext
__author__ = 'Quantum'
def generic_message(request, title, message):
return render_to_response('generic_message.jade', {
'message': message,
'title'... |
[API][Product] Remove custom latest products endpoint | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Core\Repository;
use Doctrine\ORM\QueryBuilder;
... | <?php
/*
* This file is part of the Sylius package.
*
* (c) Paweł Jędrzejewski
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
declare(strict_types=1);
namespace Sylius\Component\Core\Repository;
use Doctrine\ORM\QueryBuilder;
... |
Use the user-set language in twig filter | <?php
namespace Grav\Plugin;
use \Grav\Common\Grav;
class AdminTwigExtension extends \Twig_Extension
{
protected $grav;
public function __construct()
{
$this->grav = Grav::instance();
$this->lang = $this->grav['user']->language;
}
/**
* Returns extension name.
*
* ... | <?php
namespace Grav\Plugin;
use \Grav\Common\Grav;
class AdminTwigExtension extends \Twig_Extension
{
protected $grav;
public function __construct()
{
$this->grav = Grav::instance();
}
/**
* Returns extension name.
*
* @return string
*/
public function getName()
... |
Use non-circle social icons in footer | import quotes from '../util/quotes.js';
export default {
isLoggedIn: false,
showMenu: false,
circleIcons: false,
toast: null,
quote: {
text: null,
author: null,
current: Math.floor(Math.random() * quotes.length),
},
files: {
cwd: '',
content: [],
... | import quotes from '../util/quotes.js';
export default {
isLoggedIn: false,
showMenu: false,
circleIcons: true,
toast: null,
quote: {
text: null,
author: null,
current: Math.floor(Math.random() * quotes.length),
},
files: {
cwd: '',
content: [],
... |
fix: Make error handling use full parser list
There was a bug in the error handling that made the the loop over parser
return the error instead of continuing to the next parser. | const parsers = require('../parsers')
const transform = require('../transform')
const request = require('../request')
const { ConnectionFailedError, EmptyParseOutputError } = require('../errors')
async function parse(parser, text) {
const parsed = await parsers[parser](text)
if (!parsed) throw new EmptyParseOutput... | const parsers = require('../parsers')
const transform = require('../transform')
const request = require('../request')
const { ConnectionFailedError, EmptyParseOutputError } = require('../errors')
async function parse(parser, text) {
const parsed = await parsers[parser](text)
if (!parsed) throw new EmptyParseOutput... |
Fix the order payments validation of 0 amount. | <?php
namespace WickedReports\Api\Item;
use Respect\Validation\Validator as v;
class OrderPayment extends BaseItem {
/**
* @var array
*/
protected $dates = ['PaymentDate'];
/**
* @return v
*/
protected static function validation()
{
return v::arrayType()
... | <?php
namespace WickedReports\Api\Item;
use Respect\Validation\Validator as v;
class OrderPayment extends BaseItem {
/**
* @var array
*/
protected $dates = ['PaymentDate'];
/**
* @return v
*/
protected static function validation()
{
return v::arrayType()
... |
Make WordPress link open in new window | <!-- footer -->
<footer class="footer" role="contentinfo">
<!-- copyright -->
<p class="copyright">
© <?php echo esc_html( date( 'Y' ) ); ?> Copyright <?php bloginfo( 'name' ); ?>. <?php esc_html_e( 'Powered by', 'html5blank' ); ?>
<a href="//wordpress.org" target="_blank">WordPress</a> &a... | <!-- footer -->
<footer class="footer" role="contentinfo">
<!-- copyright -->
<p class="copyright">
© <?php echo esc_html( date( 'Y' ) ); ?> Copyright <?php bloginfo( 'name' ); ?>. <?php esc_html_e( 'Powered by', 'html5blank' ); ?>
<a href="//wordpress.org">WordPress</a> & <a href="//h... |
Fix a exception in the case that an Alert first get exposed, an
exception is thrown due to the size of the Alert value elements is
empty. | package com.linkedin.helix.monitoring.mbeans;
import com.linkedin.helix.alerts.AlertValueAndStatus;
public class ClusterAlertItem implements ClusterAlertItemMBean
{
String _alertItemName;
double _alertValue;
int _alertFired;
AlertValueAndStatus _valueAndStatus;
public ClusterAlertItem(String name, Aler... | package com.linkedin.helix.monitoring.mbeans;
import com.linkedin.helix.alerts.AlertValueAndStatus;
public class ClusterAlertItem implements ClusterAlertItemMBean
{
String _alertItemName;
double _alertValue;
int _alertFired;
AlertValueAndStatus _valueAndStatus;
public ClusterAlertItem(String name, Aler... |
Fix issue with null value in tables | <?php namespace Anomaly\RelationshipFieldType;
use Anomaly\Streams\Platform\Addon\FieldType\FieldTypeModifier;
use Anomaly\Streams\Platform\Model\EloquentModel;
/**
* Class RelationshipFieldTypeModifier
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author R... | <?php namespace Anomaly\RelationshipFieldType;
use Anomaly\Streams\Platform\Addon\FieldType\FieldTypeModifier;
use Anomaly\Streams\Platform\Model\EloquentModel;
/**
* Class RelationshipFieldTypeModifier
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author R... |
Use test sources as the default in configuration (and improve warning message, when falling back to) | import logging
from lib.config import Config
from lib.sources.decklinkavsource import DeckLinkAVSource
from lib.sources.imgvsource import ImgVSource
from lib.sources.tcpavsource import TCPAVSource
from lib.sources.testsource import TestSource
from lib.sources.videoloopsource import VideoLoopSource
log = logging.getLo... | import logging
from lib.config import Config
from lib.sources.decklinkavsource import DeckLinkAVSource
from lib.sources.imgvsource import ImgVSource
from lib.sources.tcpavsource import TCPAVSource
from lib.sources.testsource import TestSource
from lib.sources.videoloopsource import VideoLoopSource
log = logging.getLo... |
Fix payload structure for text | const request = require('request'),
TOKEN = process.env.PAGE_ACCESS_TOKEN;
/**
* Send message to API.
*
* @param {object} json Data to send.
* @param {function} callback Called at end.
*/
module.exports = (json, callback = null) => {
request({
json,
method: 'POST',
qs: {access_token: TOKEN}... | const request = require('request'),
TOKEN = process.env.PAGE_ACCESS_TOKEN;
/**
* Send message to API.
*
* @param {object} json Data to send.
* @param {function} callback Called at end.
*/
module.exports = (json, callback = null) => {
request({
json,
method: 'POST',
qs: {access_token: TOKEN}... |
Add test for getAllResponseHeaders after an abort | var sys = require("util")
,assert = require("assert")
,XMLHttpRequest = require("../XMLHttpRequest").XMLHttpRequest
,xhr = new XMLHttpRequest()
,http = require("http");
// Test server
var server = http.createServer(function (req, res) {
// Test setRequestHeader
assert.equal("Foobar", req.headers["x-test"])... | var sys = require("util")
,assert = require("assert")
,XMLHttpRequest = require("../XMLHttpRequest").XMLHttpRequest
,xhr = new XMLHttpRequest()
,http = require("http");
// Test server
var server = http.createServer(function (req, res) {
// Test setRequestHeader
assert.equal("Foobar", req.headers["x-test"])... |
Use method instead of property | // Include needed files
var fluffbot = require('../lib/fluffbot')
var discord = require('discord.js')
var event = require('../lib/event')
// Instantiate bots
var fluffbot = new fluffbot()
discord = new discord.Client({autoReconnect:true})
discord.login(fluffbot.settings.bot_token)
// Initiate the playing game to say... | // Include needed files
var fluffbot = require('../lib/fluffbot')
var discord = require('discord.js')
var event = require('../lib/event')
// Instantiate bots
var fluffbot = new fluffbot()
discord = new discord.Client({autoReconnect:true})
discord.login(fluffbot.settings.bot_token)
// Initiate the playing game to say... |
Apply connectDropTarget to element instead of ref / domNode | import React from 'react'
import { DropTarget } from 'react-dnd'
import BigCalendar from 'react-big-calendar'
import { updateEventTime } from './dropActions'
import cn from 'classnames';
/* drop targets */
const dropTarget = {
drop(props, monitor, backgroundWrapper) {
const event = monitor.getItem();
const ... | import React from 'react'
import { DropTarget } from 'react-dnd'
import BigCalendar from 'react-big-calendar'
import { findDOMNode } from 'react-dom'
import { updateEventTime } from './dropActions'
import cn from 'classnames';
/* drop targets */
const dropTarget = {
drop(props, monitor, backgroundWrapper) {
con... |
Use 'errors' instead of 'result' | 'use strict';
var gonzales = require('gonzales-pe');
var linters = [
require('./linters/space_before_brace')
];
exports.lint = function (data, path, config) {
var ast = this.parseAST(data);
var errors = [];
ast.map(function (node) {
var i;
for (i = 0; i < linters.length; i++) {
... | 'use strict';
var gonzales = require('gonzales-pe');
var linters = [
require('./linters/space_before_brace')
];
exports.lint = function (data, path, config) {
var ast = this.parseAST(data);
var result = [];
ast.map(function (node) {
var i;
for (i = 0; i < linters.length; i++) {
... |
Update model.js for syntax error
It was bothering me.. | var chai = require('chai');
var should = chai.should();
var User = require('../models/User');
describe('User Model', function() {
it('should create a new user', function(done) {
var user = new User({
email: 'test@gmail.com',
password: 'password'
});
user.save(function(err) {
if (err) re... | var chai = require('chai');
var should = chai.should();
var User = require('../models/User');
describe('User Model', function() {
it('should create a new user', function(done) {
var user = new User({
email: 'test@gmail.com',
password: 'password'
});
user.save(function(err) {
if (err) re... |
flake8: Fix all warnings in sets app | from django.db import models
from django.utils import timezone
from comics.core.models import Comic
class Set(models.Model):
name = models.SlugField(
max_length=100, unique=True,
help_text='The set identifier')
add_new_comics = models.BooleanField(
default=False,
help_text='Au... | from django.db import models
from django.utils import timezone
from comics.core.models import Comic
class Set(models.Model):
name = models.SlugField(max_length=100, unique=True,
help_text='The set identifier')
add_new_comics = models.BooleanField(default=False,
help_text='Automatically add ne... |
Fix thumbnail route when it's fetched from api | /* globals BUILDCONFIG */
export default (app) => {
class ThumbnailService {
constructor(authService) {
'ngInject';
this.authService = authService;
}
getBestFitUrl(thumbnails, size) {
let url = thumbnails.reduce((thumb, next) => {
if (Math... | export default (app) => {
class ThumbnailService {
constructor(authService) {
'ngInject';
this.authService = authService;
}
getBestFitUrl(thumbnails, size) {
let url = thumbnails.reduce((thumb, next) => {
if (Math.abs(size - next.widthPx) ... |
Add missing R class to WebView resource rewriting.
We weren't rewriting the resources for web_contents_delegate_android,
resulting in crashes any time a resource was loaded by that component
(e.g. popup bubbles for HTML form validation failures). Add it to the
list and also clean up outdated comments here that refer t... | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package com.android.webview.chromium;
/**
* Helper class used to fix up resource ids.
*/
class ResourceRewriter {
/**
* Rewrite the R 'constan... | // Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
package com.android.webview.chromium;
/**
* Helper class used to fix up resource ids.
* This is mostly a copy of the code in frameworks/base/core/java/... |
Reduce the name of a function | #!/usr/bin/env python
import rospy,copy
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
from pimouse_ros.msg import LightSensorValues
class WallStop():
def __init__(self):
self.cmd_vel = rospy.Publisher('/cmd_vel',Twist,queue_size=1)
self.sensor_values = Light... | #!/usr/bin/env python
import rospy,copy
from geometry_msgs.msg import Twist
from std_srvs.srv import Trigger, TriggerResponse
from pimouse_ros.msg import LightSensorValues
class WallStop():
def __init__(self):
self.cmd_vel = rospy.Publisher('/cmd_vel',Twist,queue_size=1)
self.sensor_values = Light... |
Change app name. Added getItems method | // app.shoppingListService.js
(function() {
"use strict";
angular.module("ShoppingListApp")
.service("ShoppingListService", ShoppingListService);
ShoppingListService.$inject = ["$q", "WeightLossFilterService"];
function ShoppingListService($q, WeightLossFilterService) {
let service = this;
// L... | // app.shoppingListService.js
(function() {
"use strict";
angular.module("MyApp")
.service("ShoppingListService", ShoppingListService);
ShoppingListService.$inject = ["$q", "WeightLossFilterService"];
function ShoppingListService($q, WeightLossFilterService) {
let service = this;
// List of Sho... |
Put Sitemap link in footer | <footer>
<div id="footer-newsletter">
<div class="container">
<p>
Get our Newsletter:
<form action="" method="post">
<input type="text" class="form-control form-footer-newsletter" placeholder="Your E-Mail adress" />
<input t... | <footer>
<div id="footer-newsletter">
<div class="container">
<p>
Get our Newsletter:
<form action="" method="post">
<input type="text" class="form-control form-footer-newsletter" placeholder="Your E-Mail adress" />
<input t... |
Add next query param to signup url | import Ember from 'ember';
import config from 'ember-get-config';
export default Ember.Service.extend({
store: Ember.inject.service(),
id: config.PREPRINTS.provider,
provider: Ember.computed('id', function() {
const id = this.get('id');
if (!id)
return;
return this
... | import Ember from 'ember';
import config from 'ember-get-config';
export default Ember.Service.extend({
store: Ember.inject.service(),
id: config.PREPRINTS.provider,
provider: Ember.computed('id', function() {
const id = this.get('id');
if (!id)
return;
return this
... |
Use post data cause form values won't be here. | <?php namespace Anomaly\UsersModule\User\Validation;
use Anomaly\UsersModule\User\Contract\UserInterface;
use Anomaly\UsersModule\User\Login\LoginFormBuilder;
use Anomaly\UsersModule\User\UserAuthenticator;
use Symfony\Component\HttpFoundation\Response;
/**
* Class ValidateCredentials
*
* @link http://pyr... | <?php namespace Anomaly\UsersModule\User\Validation;
use Anomaly\UsersModule\User\Contract\UserInterface;
use Anomaly\UsersModule\User\Contract\UserRepositoryInterface;
use Anomaly\UsersModule\User\Login\LoginFormBuilder;
use Anomaly\UsersModule\User\UserAuthenticator;
use Symfony\Component\HttpFoundation\Response;
/... |
Add to javadoc about thread safety in a processor in a route | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... | /**
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may... |
Fix ISE if the UA header is missing | /**
* Module dependencies.
*/
var config = require('lib/config');
var jade = require('jade');
var path = require('path');
var resolve = path.resolve;
var t = require('t-component');
var html = jade.renderFile(resolve(__dirname, 'index.jade'), { config: config, t: t });
var express = require('express');
var app = mod... | /**
* Module dependencies.
*/
var config = require('lib/config');
var jade = require('jade');
var path = require('path');
var resolve = path.resolve;
var t = require('t-component');
var html = jade.renderFile(resolve(__dirname, 'index.jade'), { config: config, t: t });
var express = require('express');
var app = mod... |
Add performance budgeting to babel/postcss/extract-text e2e test | const webpack2 = require('../../index')
// Need to write it like this instead of destructuring so it runs on Node 4.x w/o transpiling
const addPlugins = webpack2.addPlugins
const createConfig = webpack2.createConfig
const entryPoint = webpack2.entryPoint
const performance = webpack2.performance
const setOutput = webpa... | const webpack2 = require('../../index')
// Need to write it like this instead of destructuring so it runs on Node 4.x w/o transpiling
const addPlugins = webpack2.addPlugins
const createConfig = webpack2.createConfig
const entryPoint = webpack2.entryPoint
const setOutput = webpack2.setOutput
const webpack = webpack2.we... |
Disable duplicate check mode for merging-- this can cause events to be thrown out for MC data. | import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
import subprocess
import os
import sys
options = VarParsing('analysis')
options.register('chirp', default=None, mytype=VarParsing.varType.string)
options.register('inputs', mult=VarParsing.multiplicity.list, mytype=VarParsin... | import FWCore.ParameterSet.Config as cms
from FWCore.ParameterSet.VarParsing import VarParsing
import subprocess
import os
import sys
options = VarParsing('analysis')
options.register('chirp', default=None, mytype=VarParsing.varType.string)
options.register('inputs', mult=VarParsing.multiplicity.list, mytype=VarParsin... |
Add an assert to make mypy check pass again | #!/usr/bin/env python
import os.path
import sys
import subprocess
import unittest
tests_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.dirname(tests_dir))
import secretstorage
if __name__ == '__main__':
major, minor, patch = sys.version_info[:3]
print('Running with Python %d.%d.%d (SecretStorage from ... | #!/usr/bin/env python
import os.path
import sys
import subprocess
import unittest
tests_dir = os.path.dirname(__file__)
sys.path.insert(0, os.path.dirname(tests_dir))
import secretstorage
if __name__ == '__main__':
major, minor, patch = sys.version_info[:3]
print('Running with Python %d.%d.%d (SecretStorage from ... |
examples: Fix typo on pull example
Signed-off-by: Theodore Keloglou <a07b7322a11cee41c8267d5dc5751e643be543a6@gmail.com> | package main
import (
"fmt"
"os"
"gopkg.in/src-d/go-git.v4"
. "gopkg.in/src-d/go-git.v4/_examples"
)
// Pull changes from a remote repository
func main() {
CheckArgs("<path>")
path := os.Args[1]
// We instantiate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
Chec... | package main
import (
"fmt"
"os"
"gopkg.in/src-d/go-git.v4"
. "gopkg.in/src-d/go-git.v4/_examples"
)
// Pull changes from a remote repository
func main() {
CheckArgs("<path>")
path := os.Args[1]
// We instance\iate a new repository targeting the given path (the .git folder)
r, err := git.PlainOpen(path)
Ch... |
Include all of the files in test coverage report | const webpackConfig = require('./webpack.config.babel')({env: 'test'});
const testGlob = 'src/**/*.test.js';
const srcGlob = 'src/**/!(*.test|*.stub).js';
module.exports = config => {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [ testGlob, srcGlob ],
exclude: ['src/bootstrap.js']... | const webpackConfig = require('./webpack.config.babel')({env: 'test'});
const fileGlob = 'src/**/*.test.js';
module.exports = config => {
config.set({
basePath: '',
frameworks: ['mocha', 'chai'],
files: [ fileGlob ],
preprocessors: {
[fileGlob]: ['webpack']
},
webpack: webpackConfig,
... |
Write each tag from newline | <?php
namespace common\widgets;
use app\modules\article\models\Tag;
use yii\base\Widget;
use yii\bootstrap\Html;
/**
* Class TagsInputWidget
* @package common\widgets
* @property Tag[] $tags
*/
class TagsWidget extends Widget
{
public function run()
{
$html = '';
foreach ($this->tags as $t... | <?php
namespace common\widgets;
use app\modules\article\models\Tag;
use yii\base\Widget;
use yii\bootstrap\Html;
/**
* Class TagsInputWidget
* @package common\widgets
* @property Tag[] $tags
*/
class TagsWidget extends Widget
{
public function run()
{
$html = '';
foreach ($this->tags as $t... |
Correct "Doc test pane" to "Dock test pane"
This PR so far only changes the string displayed in the UI. The rest of the code still refers to this option as `doccontainer`. Should all these instances also be changed to `dockcontainer`?
As an aside, it seems to be called a container in one option ("Hide container") b... | /* globals jQuery,QUnit */
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
QUnit.config.urlConfig.push({ id: 'nojshint', label: 'Disable JSHint'});
QUnit.config.urlConfig.push({ id: 'doccontainer', label: 'Dock test pane'});
QUnit.config.testTimeout = 60000; //Default Test Timeout 60 Second... | /* globals jQuery,QUnit */
QUnit.config.urlConfig.push({ id: 'nocontainer', label: 'Hide container'});
QUnit.config.urlConfig.push({ id: 'nojshint', label: 'Disable JSHint'});
QUnit.config.urlConfig.push({ id: 'doccontainer', label: 'Doc test pane'});
QUnit.config.testTimeout = 60000; //Default Test Timeout 60 Seconds... |
Exclude fetch errors from tracking (based on error code). | /**
* Cache data.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... | /**
* Cache data.
*
* Site Kit by Google, Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless r... |
Stop claiming support for 2.6
I don't even have a Python 2.6 interpreter. | from setuptools import setup
setup(
name="ftfy",
version='3.3.0',
maintainer='Luminoso Technologies, Inc.',
maintainer_email='info@luminoso.com',
license="MIT",
url='http://github.com/LuminosoInsight/python-ftfy',
platforms=["any"],
description="Fixes some problems with Unicode text aft... | from setuptools import setup
setup(
name="ftfy",
version='3.3.0',
maintainer='Luminoso Technologies, Inc.',
maintainer_email='info@luminoso.com',
license="MIT",
url='http://github.com/LuminosoInsight/python-ftfy',
platforms=["any"],
description="Fixes some problems with Unicode text aft... |
Add example of using the Load method on the Markup object | var markup = null;
$(function() {
var markupTools = MarkupTools('.button-bar > div');
markup = Markup('#pdf-markup', markupTools);
$(markup).on('update add', function() {
$('#result').text(JSON.stringify(markup.Serialize()));
});
$(markupTools).on('browse', function(e, settings) {
... | var markup = null;
$(function() {
var markupTools = MarkupTools('.button-bar > div');
markup = Markup('#pdf-markup', markupTools);
$(markup).on('update add', function() {
$('#result').text(JSON.stringify(markup.Serialize()));
});
$(markupTools).on('browse', function(e, settings) {
... |
Fix typo in requrie that breaks on case-sensitive FS | var Game = require('./game');
var GameArtist = require('./artists/gameartist');
var EventDispatcher = require('./eventdispatcher');
var utils = require('./utils');
var EventLogger = require('./eventlogger');
var PlaybackDispatcher = require('./playbackdispatcher');
var Landmine = window.Landmine || {};
Landmine.start... | var Game = require('./game');
var GameArtist = require('./artists/gameartist');
var EventDispatcher = require('./eventdispatcher');
var utils = require('./utils');
var EventLogger = require('./eventLogger');
var PlaybackDispatcher = require('./playbackdispatcher');
var Landmine = window.Landmine || {};
Landmine.start... |
Fix the bug causing all the requests getting parsed by the path code | package txtdirect
import (
"fmt"
"regexp"
"strings"
)
var dockerRegexs = map[string]string{
"_catalog": "^/v2/_catalog$",
"tags": "^/v2/(.*)/tags/(.*)",
"manifests": "^/v2/(.*)/manifests/(.*)",
"blobs": "^/v2/(.*)/blobs/(.*)",
}
var DockerRegex = regexp.MustCompile("^\\/v2\\/(.*\\/(tags|manifests|bl... | package txtdirect
import (
"fmt"
"regexp"
"strings"
)
var dockerRegexs = map[string]string{
"_catalog": "^/v2/_catalog$",
"tags": "^/v2/(.*)/tags/(.*)",
"manifests": "^/v2/(.*)/manifests/(.*)",
"blobs": "^/v2/(.*)/blobs/(.*)",
}
var DockerRegex = regexp.MustCompile("^\\/v2\\/(.*\\/(tags|manifests|bl... |
Reorder imports in alphabetical order | import graphqlapi.utils as utils
from graphqlapi.exceptions import RequestException
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphql.parser import GraphQLParser
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... | import graphqlapi.utils as utils
from graphql.parser import GraphQLParser
from graphqlapi.interceptor import ExecuteBatch, TestDataSource
from graphqlapi.exceptions import RequestException
interceptors = [
ExecuteBatch(),
TestDataSource()
]
def proxy_request(payload: dict):
graphql_ast = parse_query(pay... |
Use https for s3 links | <?php
/*
* This file is part of flagrow/upload.
*
* Copyright (c) Flagrow.
*
* http://flagrow.github.io
*
* For the full copyright and license information, please view the license.md
* file that was distributed with this source code.
*/
namespace Flagrow\Upload\Adapters;
use Flagrow\Upload\Contracts\UploadA... | <?php
/*
* This file is part of flagrow/upload.
*
* Copyright (c) Flagrow.
*
* http://flagrow.github.io
*
* For the full copyright and license information, please view the license.md
* file that was distributed with this source code.
*/
namespace Flagrow\Upload\Adapters;
use Flagrow\Upload\Contracts\UploadA... |
Move promisified functions out of the actual function that uses them. | import fs from 'fs';
import path from 'path';
import promisify from 'es6-promisify';
import {
InvalidFile,
InvalidJsonString
} from './errors';
const fileReadPromise = promisify(fs.readFile);
const fileWritePromise = promisify(fs.writeFile);
export function convertOneFile(fileName, destFileName) {
const readFil... | import fs from 'fs';
import path from 'path';
import promisify from 'es6-promisify';
import {
InvalidFile,
InvalidJsonString
} from './errors';
export function convertOneFile(fileName, destFileName) {
const fileReadPromise = promisify(fs.readFile);
const fileWritePromise = promisify(fs.writeFile);
const r... |
Use submit button in demo app capture screen, works in old browsers | /*
*
* Run with node examples/simple.js
*
* Go to http://localhost:8282 and have fun!
*
*/
var busterServer = require("../lib/buster-server");
var http = require("http");
var fs = require("fs");
var bs = Object.create(busterServer);
var sess = bs.createSession({
load: ["/test.js"],
resources: {
... | /*
*
* Run with node examples/simple.js
*
* Go to http://localhost:8282 and have fun!
*
*/
var busterServer = require("../lib/buster-server");
var http = require("http");
var fs = require("fs");
var bs = Object.create(busterServer);
var sess = bs.createSession({
load: ["/test.js"],
resources: {
... |
Fix the depends argument of the C Extension | from setuptools import setup, Extension, find_packages
from glob import glob
from os import path
import sys
def version():
with open('src/iteration_utilities/__init__.py') as f:
for line in f:
if line.startswith('__version__'):
return line.split(r"'")[1]
_iteration_utilitie... | from setuptools import setup, Extension, find_packages
from glob import glob
from os import path
import sys
def version():
with open('src/iteration_utilities/__init__.py') as f:
for line in f:
if line.startswith('__version__'):
return line.split(r"'")[1]
_iteration_utilitie... |
Fix ini_get() for boolean values | <?php
namespace Gaufrette\Functional\Adapter;
use Gaufrette\Adapter\Apc;
use Gaufrette\Filesystem;
class ApcTest extends FunctionalTestCase
{
public function setUp()
{
if (!extension_loaded('apc')) {
return $this->markTestSkipped('The APC extension is not available.');
} elseif (!... | <?php
namespace Gaufrette\Functional\Adapter;
use Gaufrette\Adapter\Apc;
use Gaufrette\Filesystem;
class ApcTest extends FunctionalTestCase
{
public function setUp()
{
if (!extension_loaded('apc')) {
return $this->markTestSkipped('The APC extension is not available.');
} elseif (!... |
Add wsgi_intercept to the dependencies list | #! /usr/bin/env python
from setuptools import setup, find_packages
setup(
name='armet',
version='0.3.0-pre',
description='Clean and modern framework for creating RESTful APIs.',
author='Concordus Applications',
author_email='support@concordusapps.com',
url='http://github.com/armet/python-armet... | #! /usr/bin/env python
from setuptools import setup, find_packages
setup(
name='armet',
version='0.3.0-pre',
description='Clean and modern framework for creating RESTful APIs.',
author='Concordus Applications',
author_email='support@concordusapps.com',
url='http://github.com/armet/python-armet... |
Use 0.3.3 hosts mgmt plugin because 0.3.4 is borked. | from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
execfile('substance/_version.py')
install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko', 'netaddr', 'requests', 'tinydb', 'python_hosts=0.3.3', 'jinja2']
setup(name='substance',
version=__versio... | from setuptools import setup, find_packages
with open('README.rst') as f:
readme = f.read()
execfile('substance/_version.py')
install_requires = ['setuptools>=1.1.3', 'PyYAML', 'tabulate', 'paramiko', 'netaddr', 'requests', 'tinydb', 'python_hosts', 'jinja2']
setup(name='substance',
version=__version__,
... |
internal: Use ErrUnknownProvider in tests as well | package main
import (
"reflect"
"testing"
)
func TestGetMetadataProvider(t *testing.T) {
tests := []struct {
desc string
name string
err error
}{
{
desc: "supported provider",
name: "digitalocean",
err: nil,
},
{
desc: "unknown provider",
name: "not-supported",
err: ErrUnknownProv... | package main
import (
"errors"
"reflect"
"testing"
)
func TestGetMetadataProvider(t *testing.T) {
tests := []struct {
desc string
name string
err error
}{
{
desc: "supported provider",
name: "digitalocean",
err: nil,
},
{
desc: "unknown provider",
name: "not-supported",
err: erro... |
Call Filter constructor to allow for common Filter options | var Filter = require('broccoli-filter')
var coffeeScript = require('coffee-script')
module.exports = CoffeeScriptFilter
CoffeeScriptFilter.prototype = Object.create(Filter.prototype)
CoffeeScriptFilter.prototype.constructor = CoffeeScriptFilter
function CoffeeScriptFilter (inputTree, options) {
if (!(this instanceof... | var Filter = require('broccoli-filter')
module.exports = CoffeeScriptFilter
CoffeeScriptFilter.prototype = Object.create(Filter.prototype)
CoffeeScriptFilter.prototype.constructor = CoffeeScriptFilter
function CoffeeScriptFilter (inputTree, options) {
if (!(this instanceof CoffeeScriptFilter)) return new CoffeeScrip... |
Use fork of trayhost, where needed functionality will be added. | package main
import (
"fmt"
"io/ioutil"
"runtime"
"github.com/shurcooL/trayhost"
)
func main() {
runtime.LockOSThread()
menuItems := trayhost.MenuItems{
trayhost.MenuItem{
Title: "Instant Share",
Handler: func() {
fmt.Println("TODO: grab content, content-type of clipboard")
fmt.Println("TODO: ... | package main
import (
"fmt"
"io/ioutil"
"runtime"
"github.com/overlordtm/trayhost"
)
// TODO: Factor into trayhost.
func trayhost_NewSeparatorMenuItem() trayhost.MenuItem { return trayhost.MenuItem{Title: ""} }
func main() {
runtime.LockOSThread()
menuItems := trayhost.MenuItems{
trayhost.MenuItem{
Titl... |
Allow user to set a different database | if (Meteor.isServer) {
const _resetDatabase = function (options) {
if (process.env.NODE_ENV !== 'development') {
throw new Error(
'resetDatabase is not allowed outside of a development mode. ' +
'Aborting.'
);
}
options = options || {};
var excludedCollections = ['system.i... | if (Meteor.isServer) {
const _resetDatabase = function (options) {
if (process.env.NODE_ENV !== 'development') {
throw new Error(
'resetDatabase is not allowed outside of a development mode. ' +
'Aborting.'
);
}
options = options || {};
var excludedCollections = ['system.i... |
Update quickjs installer per latest upstream changes
Closes #87. | // Copyright 2019 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// <https://apache.org/licenses/LICENSE-2.0>.
//
// Unless required by applicable law or agreed to in writing... | // Copyright 2019 Google Inc.
//
// Licensed under the Apache License, Version 2.0 (the “License”);
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
// <https://apache.org/licenses/LICENSE-2.0>.
//
// Unless required by applicable law or agreed to in writing... |
Use BorderBehavior instead of the deprecated MarkupComponentBorder
git-svn-id: 5a74b5304d8e7e474561603514f78b697e5d94c4@1180802 13f79535-47bb-0310-9956-ffa450edef68 | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... | /*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may ... |
Remove unnecessary IE check for placeholder | var app = {
Profiles: null
}; // Let's namespace our app's functions in here.
(function($) {
$().ready(function() {
$('html').removeClass('no-js').addClass('js');
// Return the current locale (found in the body attribute
// as a data attribute).
app.locale = $('body').data('loc... | var app = {
Profiles: null
}; // Let's namespace our app's functions in here.
(function($) {
$().ready(function() {
$('html').removeClass('no-js').addClass('js');
// Return the current locale (found in the body attribute
// as a data attribute).
app.locale = $('body').data('loc... |
Check against dir when copying assets
Now a declaration like
```javascript
{
from: './extra',
to: '.'
}
```
will work as expected. Previously `from` expected to find a file in this
case and failed as a result. This can be possibly cleaned up further. | 'use strict';
var fs = require('fs');
var path = require('path');
var async = require('async');
var cpr = require('cpr');
var cp = require('cp');
exports.copyExtraAssets = function(buildDir, assets, cb) {
assets = assets || [];
async.forEach(assets, function(asset, cb) {
var from = asset.from;
var stats... | 'use strict';
var fs = require('fs');
var path = require('path');
var async = require('async');
var cpr = require('cpr');
var cp = require('cp');
exports.copyExtraAssets = function(buildDir, assets, cb) {
assets = assets || [];
async.forEach(assets, function(asset, cb) {
var from = asset.from;
if(from.... |
Add model Sync to repo. | from peewee import SqliteDatabase, OperationalError
__all__ = [
'BaseDatabase',
]
class BaseDatabase:
"""The base database class to be used with Peewee.
"""
def __init__(self, url=None):
self.url = url
self.db = SqliteDatabase(None)
def initialize(self, url=None):
if... | from peewee import SqliteDatabase, OperationalError
__all__ = [
'BaseDatabase',
]
class BaseDatabase:
"""The base database class to be used with Peewee.
"""
def __init__(self, url=None):
self.url = url
self.db = SqliteDatabase(None)
def initialize(self, url=None):
if... |
Update mock requirement from <2.1,>=2.0 to >=2.0,<3.1
Updates the requirements on [mock](https://github.com/testing-cabal/mock) to permit the latest version.
- [Release notes](https://github.com/testing-cabal/mock/releases)
- [Changelog](https://github.com/testing-cabal/mock/blob/master/CHANGELOG.rst)
- [Commits](http... | from setuptools import setup, find_packages
setup(
name='panoptes_client',
url='https://github.com/zooniverse/panoptes-python-client',
author='Adam McMaster',
author_email='adam@zooniverse.org',
version='1.1.1',
packages=find_packages(),
include_package_data=True,
install_requires=[
... | from setuptools import setup, find_packages
setup(
name='panoptes_client',
url='https://github.com/zooniverse/panoptes-python-client',
author='Adam McMaster',
author_email='adam@zooniverse.org',
version='1.1.1',
packages=find_packages(),
include_package_data=True,
install_requires=[
... |
Change printing format of results | var valueEnv = new EnvGlobal();
var typeEnv = new EnvGlobal();
catchEvent(window, "load", setup);
function setup(event) {
setupEvents(event);
document.getElementById("outputArea").value = "> ";
}
function setupEvents(event) {
catchEvent(document.getElementById("inputForm"), "submit", evalForm)
}
function eval... | var valueEnv = new EnvGlobal();
var typeEnv = new EnvGlobal();
catchEvent(window, "load", setup);
function setup(event) {
setupEvents(event);
document.getElementById("outputArea").value = "> ";
}
function setupEvents(event) {
catchEvent(document.getElementById("inputForm"), "submit", evalForm)
}
function eval... |
Fix typo in comment
(reported on the pydotorg mailing list). | # Import smtplib for the actual sending function
import smtplib
# Here are the email package modules we'll need
from email.MIMEImage import MIMEImage
from email.MIMEMultipart import MIMEMultipart
COMMASPACE = ', '
# Create the container (outer) email message.
msg = MIMEMultipart()
msg['Subject'] = 'Our family reunio... | # Import smtplib for the actual sending function
import smtplib
# Here are the email pacakge modules we'll need
from email.MIMEImage import MIMEImage
from email.MIMEMultipart import MIMEMultipart
COMMASPACE = ', '
# Create the container (outer) email message.
msg = MIMEMultipart()
msg['Subject'] = 'Our family reunio... |
Add broccoli-sass as a dependency | 'use strict';
module.exports = {
normalizeEntityName: function() {},
afterInstall: function() {
return this.addPackagesToProject([
{ name: 'liquid-fire', target: '0.17.1' },
{ name: 'ember-rl-dropdown', target: 'git+https://git@github.com/alphasights/ember-rl-dropdown.git' },
{ name: 'ember-... | 'use strict';
module.exports = {
normalizeEntityName: function() {},
afterInstall: function() {
return this.addPackagesToProject([
{ name: 'liquid-fire', target: '0.17.1' },
{ name: 'ember-rl-dropdown', target: 'git+https://git@github.com/alphasights/ember-rl-dropdown.git' },
{ name: 'ember-... |
Disable spellcheck/auto correct as there are platform issues with it | /*
* Copyright 2015 Hewlett-Packard Development Company, L.P.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
*/
define([], function () {
"use strict";
function displayPromotions() {
return true;
}
function requestParams(qu... | /*
* Copyright 2015 Hewlett-Packard Development Company, L.P.
* Licensed under the MIT License (the "License"); you may not use this file except in compliance with the License.
*/
define([], function () {
"use strict";
function displayPromotions() {
return true;
}
function requestParams(qu... |
Rewrite Vimeo to use the new scope selection system | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... | import foauth.providers
class Vimeo(foauth.providers.OAuth1):
# General info about the provider
provider_url = 'http://vimeo.com/'
docs_url = 'http://developer.vimeo.com/apis/advanced'
category = 'Videos'
# URLs to interact with the API
request_token_url = 'https://vimeo.com/oauth/request_tok... |
Add CLI arguments for printing AST and bytecode | package main
import (
"flag"
"fmt"
"io/ioutil"
"log"
"runtime"
)
func main() {
runtime.GOMAXPROCS(2)
// Flag initialization
var printAST, printInst bool
flag.BoolVar(&printAST, "ast", false, "Print abstract syntax tree structure")
flag.BoolVar(&printInst, "bytecode", false, "Print comprehensive bytecode in... | package main
import (
"flag"
// "fmt"
"io/ioutil"
"log"
"runtime"
)
func main() {
runtime.GOMAXPROCS(2)
flag.Parse()
if flag.NArg() != 1 {
flag.Usage()
log.Fatalf("FILE: the .rb file to execute")
}
file := flag.Arg(0)
buffer, err := ioutil.ReadFile(file)
if err != nil {
log.Fatal(err)
}
p := &L... |
Test identifier reader inside lexer test | package eparser
import (
"testing"
)
func TestLex(t *testing.T) {
l := newLexer()
res, errs := l.Lex("some_var123 **= (7 ** (3 + 4 - 2)) << 1.23 % 0.3")
expected := []tokenType{
IDENT, POW_EQ, LPAREN, INT, POW, LPAREN, INT, ADD, INT, SUB, INT,
RPAREN, RPAREN, LSH, FLOAT, REM, FLOAT, EOL,
}
if errs != nil {... | package eparser
import (
"testing"
)
func TestLex(t *testing.T) {
l := newLexer()
res, errs := l.Lex("a **= (7 ** (3 + 4 - 2)) << 1.23 % 0.3")
expected := []tokenType{
IDENT, POW_EQ, LPAREN, INT, POW, LPAREN, INT, ADD, INT, SUB, INT,
RPAREN, RPAREN, LSH, FLOAT, REM, FLOAT, EOL,
}
if errs != nil {
t.Error... |
Set ServiceProvider to be eagerly loaded (not deferred) | <?php namespace Felixkiss\UniqueWithValidator;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Factory;
class UniqueWithValidatorServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = false;
... | <?php namespace Felixkiss\UniqueWithValidator;
use Illuminate\Support\ServiceProvider;
use Illuminate\Validation\Factory;
class UniqueWithValidatorServiceProvider extends ServiceProvider
{
/**
* Indicates if loading of the provider is deferred.
*
* @var bool
*/
protected $defer = true;
... |
Remove space character from the replace function | <?php
namespace Swis\LaravelFulltext;
class TermBuilder {
public static function terms($search){
$wildcards = config('laravel-fulltext.enable_wildcards');
// Remove every boolean operator (+, -, > <, ( ), ~, *, ", @distance) from the search query
// else we will break the MySQL query.
... | <?php
namespace Swis\LaravelFulltext;
class TermBuilder {
public static function terms($search){
$wildcards = config('laravel-fulltext.enable_wildcards');
// Remove every boolean operator (+, -, > <, ( ), ~, *, ", @distance) from the search query
// else we will break the MySQL query.
... |
Fix Trades Widget to count by isPositive rather than IRR | package name.abuchen.portfolio.ui.views.dashboard;
import java.util.List;
import com.ibm.icu.text.MessageFormat;
import name.abuchen.portfolio.model.Dashboard.Widget;
import name.abuchen.portfolio.snapshot.trades.Trade;
import name.abuchen.portfolio.ui.views.trades.TradeDetailsView;
import name.abuchen.portfolio.uti... | package name.abuchen.portfolio.ui.views.dashboard;
import java.util.List;
import com.ibm.icu.text.MessageFormat;
import name.abuchen.portfolio.model.Dashboard.Widget;
import name.abuchen.portfolio.snapshot.trades.Trade;
import name.abuchen.portfolio.ui.views.trades.TradeDetailsView;
import name.abuchen.portfolio.uti... |
Add second escape backslash to namespace strings | <?php
namespace Gt\Dom;
/**
* Represents any web page loaded in the browser and serves as an entry point
* into the web page's content, the DOM tree (including elements such as
* <body> or <table>).
*/
class Document extends \DOMDocument {
use LiveProperty, ParentNode;
public function __construct($document = null... | <?php
namespace Gt\Dom;
/**
* Represents any web page loaded in the browser and serves as an entry point
* into the web page's content, the DOM tree (including elements such as
* <body> or <table>).
*/
class Document extends \DOMDocument {
use LiveProperty, ParentNode;
public function __construct($document = null... |
Allow the listener to be set to null | package com.markupartist.crimesweeper;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.MapView;
import android.content.Context;
import android.location.Location;
import java.util.List;
public class PlayerLocationOverlay extends MyLocationOverlay {
private CrimeLocationHitListener... | package com.markupartist.crimesweeper;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.MapView;
import android.content.Context;
import android.location.Location;
import java.util.List;
public class PlayerLocationOverlay extends MyLocationOverlay {
private CrimeLocationHitListener... |
Use proper description of what gets transferred
Signed-off-by: Julius Härtl <bf353fa4999f2f148afcc6d8ee6cb1ee74cc07c3@bitgrid.net> | <?php
namespace OCA\Deck\Command;
use OCA\Deck\Service\BoardService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
final class TransferOwnership extends Comman... | <?php
namespace OCA\Deck\Command;
use OCA\Deck\Service\BoardService;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
final class TransferOwnership extends Comman... |
Make unit test more stable | package at.ac.tuwien.kr.alpha.common;
import at.ac.tuwien.kr.alpha.grounder.parser.ProgramParser;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Copyright (c) 2018, the Alpha Team.
*/
public class RuleTest {
private final ProgramParser parser = new ProgramParser();
@Test
public void... | package at.ac.tuwien.kr.alpha.common;
import at.ac.tuwien.kr.alpha.grounder.parser.ProgramParser;
import org.junit.Test;
import static org.junit.Assert.assertEquals;
/**
* Copyright (c) 2018, the Alpha Team.
*/
public class RuleTest {
private final ProgramParser parser = new ProgramParser();
@Test
public void... |
TEST use same amount of noise for frank wolfe test as for other test. Works now that C is scaled correctly :) |
from numpy.testing import assert_array_equal
from pystruct.models import GridCRF
from pystruct.datasets import generate_blocks_multinomial
from pystruct.learners import FrankWolfeSSVM
def test_multinomial_blocks_frankwolfe():
X, Y = generate_blocks_multinomial(n_samples=50, noise=0.5,
... |
from numpy.testing import assert_array_equal
from pystruct.models import GridCRF
from pystruct.datasets import generate_blocks_multinomial
from pystruct.learners import FrankWolfeSSVM
def test_multinomial_blocks_frankwolfe():
X, Y = generate_blocks_multinomial(n_samples=50, noise=0.4,
... |
Fix deprecation warnings due to invalid escape sequences. | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... | import six
import sys
import test_helper
import unittest
from authy import AuthyException
from authy.api import AuthyApiClient
from authy.api.resources import Tokens
from authy.api.resources import Users
class ApiClientTest(unittest.TestCase):
def setUp(self):
self.api = AuthyApiClient(test_helper.API_K... |
Make the mobile menu available in "/mail/"
Summary: Ref T13244. See <https://discourse.phabricator-community.org/t/left-hand-menu-not-responsive-on-mobile/2358>.
Test Plan: {F6184160}
Reviewers: amckinley
Reviewed By: amckinley
Maniphest Tasks: T13244
Differential Revision: https://secure.phabricator.com/D20093 | <?php
final class PhabricatorMetaMTAMailListController
extends PhabricatorMetaMTAController {
public function handleRequest(AphrontRequest $request) {
$controller = id(new PhabricatorApplicationSearchController())
->setQueryKey($request->getURIData('queryKey'))
->setSearchEngine(new PhabricatorMet... | <?php
final class PhabricatorMetaMTAMailListController
extends PhabricatorMetaMTAController {
public function handleRequest(AphrontRequest $request) {
$controller = id(new PhabricatorApplicationSearchController())
->setQueryKey($request->getURIData('queryKey'))
->setSearchEngine(new PhabricatorMet... |
Fix logic in any logic filter | package in.twizmwaz.cardinal.module.modules.filter.type.logic;
import in.twizmwaz.cardinal.module.ModuleCollection;
import in.twizmwaz.cardinal.module.modules.filter.FilterModule;
import in.twizmwaz.cardinal.module.modules.filter.FilterState;
import static in.twizmwaz.cardinal.module.modules.filter.FilterState.ALLOW;... | package in.twizmwaz.cardinal.module.modules.filter.type.logic;
import in.twizmwaz.cardinal.module.ModuleCollection;
import in.twizmwaz.cardinal.module.modules.filter.FilterModule;
import in.twizmwaz.cardinal.module.modules.filter.FilterState;
import static in.twizmwaz.cardinal.module.modules.filter.FilterState.ALLOW;... |
Define WP_ADMIN before loading WordPress
... where "loading WordPress" also includes loading plugins and themes.
Also, define WP_NETWORK_ADMIN and WP_USER_ADMIN, for completeness.
see #385 | <?php
// Can be used by plugins/themes to check if wp-cli is running or not
define( 'WP_CLI', true );
define( 'WP_CLI_VERSION', '0.10.0-alpha' );
include WP_CLI_ROOT . 'utils.php';
include WP_CLI_ROOT . 'dispatcher.php';
include WP_CLI_ROOT . 'class-wp-cli.php';
include WP_CLI_ROOT . 'class-wp-cli-command.php';
incl... | <?php
// Can be used by plugins/themes to check if wp-cli is running or not
define( 'WP_CLI', true );
define( 'WP_CLI_VERSION', '0.10.0-alpha' );
include WP_CLI_ROOT . 'utils.php';
include WP_CLI_ROOT . 'dispatcher.php';
include WP_CLI_ROOT . 'class-wp-cli.php';
include WP_CLI_ROOT . 'class-wp-cli-command.php';
incl... |
Set celery to ignore results | import os
import logging
from celery import Celery
from temp_config.set_environment import DeployEnv
runtime_env = DeployEnv()
runtime_env.load_deployment_environment()
redis_server = os.environ.get('REDIS_HOSTNAME')
redis_port = os.environ.get('REDIS_PORT')
celery_tasks = [
'hms_flask.modules.hms_controller',
... | import os
import logging
from celery import Celery
from temp_config.set_environment import DeployEnv
runtime_env = DeployEnv()
runtime_env.load_deployment_environment()
redis_server = os.environ.get('REDIS_HOSTNAME')
redis_port = os.environ.get('REDIS_PORT')
celery_tasks = [
'hms_flask.modules.hms_controller',
... |
Return 1 in gulp when the build failed | 'use strict';
var source = require('vinyl-source-stream')
var streamify = require('gulp-streamify')
var browserify = require('browserify')
var babelify = require('babelify')
var uglify = require('gulp-uglify')
var rename = require('gulp-rename')
var gulp = require('gulp')
var del = require('del')
var exitS... | 'use strict';
var source = require('vinyl-source-stream')
var streamify = require('gulp-streamify')
var browserify = require('browserify')
var babelify = require('babelify')
var uglify = require('gulp-uglify')
var rename = require('gulp-rename')
var gulp = require('gulp')
var del = require('del')
var paths... |
Refactor JS To have Reusuable Functions | $(document).ready( function () {
$('#signup').click(function(event){
event.preventDefault();
$('#screen_block').show();
$('#signup_modal').show();
});
$('#screen_block').click(function(event){
event.preventDefault();
clear_modals();
});
$('#login').click(function(event){
event.preven... | $(document).ready( function () {
$('#signup').click(function(event){
event.preventDefault();
$('#screen_block').show();
$('#signup_modal').show();
});
$('#screen_block').click(function(event){
event.preventDefault();
$('#screen_block').hide();
$('#login_modal').hide();
$('#signup_mod... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.