text stringlengths 17 1.47k | positive stringlengths 673 4.43k | negative stringlengths 677 2.81k |
|---|---|---|
Support CDATA with leading spaces | <?php declare(strict_types=1);
/**
* Created by PhpStorm.
* User: alex
* Date: 26/10/14
* Time: 00:26
*/
namespace FeedIo\Rule;
use FeedIo\Feed\NodeInterface;
use FeedIo\RuleAbstract;
class Description extends RuleAbstract
{
const NODE_NAME = 'description';
/**
* @param NodeInterface $node
* ... | <?php declare(strict_types=1);
/**
* Created by PhpStorm.
* User: alex
* Date: 26/10/14
* Time: 00:26
*/
namespace FeedIo\Rule;
use FeedIo\Feed\NodeInterface;
use FeedIo\RuleAbstract;
class Description extends RuleAbstract
{
const NODE_NAME = 'description';
/**
* @param NodeInterface $node
* ... |
Add a redirect message when logging out. | <?php
namespace FluxBB\Web\Controllers;
use FluxBB\Server\Exception\Exception;
use FluxBB\Server\Exception\ValidationFailed;
use FluxBB\Web\Controller;
class AuthController extends Controller
{
public function registerForm()
{
return $this->view('register');
}
public function register()
... | <?php
namespace FluxBB\Web\Controllers;
use FluxBB\Server\Exception\Exception;
use FluxBB\Server\Exception\ValidationFailed;
use FluxBB\Web\Controller;
class AuthController extends Controller
{
public function registerForm()
{
return $this->view('register');
}
public function register()
... |
Fix SHARE capitalization, use self-referential query | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.db.models import F
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def ... | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from scripts import utils as script_utils
from osf.models import PreprintService
from website.preprints.tasks import on_preprint_updated
logger = logging.getLogger(__name__)
def update_share_preprint_modified_... |
Fix to Select View Template for rendering Models selected from dropdown | <dl class="dl-horizontal">
<dt>
{{ $attributeTitle }}
</dt>
<dd>
@if ($value)
@if (is_scalar($value))
@if (array_key_exists($value, $options['options']))
{{ $options['options'][$value] }}
@else
{{ $value }}
... | <dl class="dl-horizontal">
<dt>
{{ $attributeTitle }}
</dt>
<dd>
@if ($value)
@if (is_scalar($value))
@if (array_key_exists($value, $options['options']))
{{ $options['options'][$value] }}
@else
{{ $value }}
... |
Allow to use single quotes in import |
'use strict';
var path = require('path');
var fs = require('fs');
var through = require('through2');
var glob = require('glob');
module.exports = function() {
var process = function(filename) {
var replaceString = '';
if (fs.statSync(filename).isDirectory()) {
// Ignore directories ... |
'use strict';
var path = require('path');
var fs = require('fs');
var through = require('through2');
var glob = require('glob');
module.exports = function() {
var process = function(filename) {
var replaceString = '';
if (fs.statSync(filename).isDirectory()) {
// Ignore directories ... |
Use ifPresent() to avoid calling get() | package com.suse.salt.netapi.calls.modules;
import com.suse.salt.netapi.calls.LocalCall;
import com.google.gson.reflect.TypeToken;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* salt.modules.state
*/
public class State {
... | package com.suse.salt.netapi.calls.modules;
import com.suse.salt.netapi.calls.LocalCall;
import com.google.gson.reflect.TypeToken;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.Map;
import java.util.Optional;
/**
* salt.modules.state
*/
public class State {
... |
Fix missing service of type "IReCaptchaValidatorFactory"
fixes #7
Please consider updating 1.5.x with php <5.6 syntax `->setImplement('Minetro\Forms\reCAPTCHA\IReCaptchaValidatorFactory')` | <?php
namespace Minetro\Forms\reCAPTCHA;
use Nette\DI\CompilerExtension;
use Nette\PhpGenerator\ClassType;
/**
* @author Milan Felix Sulc <sulcmil@gmail.com>
*/
final class ReCaptchaExtension extends CompilerExtension
{
/** @var array */
private $defaults = [
'secretKey' => NULL,
'siteKey'... | <?php
namespace Minetro\Forms\reCAPTCHA;
use Nette\DI\CompilerExtension;
use Nette\PhpGenerator\ClassType;
/**
* @author Milan Felix Sulc <sulcmil@gmail.com>
*/
final class ReCaptchaExtension extends CompilerExtension
{
/** @var array */
private $defaults = [
'secretKey' => NULL,
'siteKey'... |
Add support for beta versions to update notifier | import Npm from 'silent-npm-registry-client';
import boxen from 'boxen';
import chalk from 'chalk';
import pkg from '../package.json';
export default function() {
return new Promise(function(resolve) {
const params = {
timeout: 1000,
package: pkg.name,
auth: {}
};
const npm = new Npm()... | import Npm from 'silent-npm-registry-client';
import boxen from 'boxen';
import chalk from 'chalk';
import pkg from '../package.json';
export default function() {
return new Promise(function(resolve) {
const params = {
timeout: 1000,
package: pkg.name,
auth: {}
};
const npm = new Npm()... |
Increase Karma's browserNoActivityTimeout to fight timeouts in CI | // Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon-chai', '@angular/cli'],
plugins: [
require('karma-mocha')... | // Karma configuration file, see link for more information
// https://karma-runner.github.io/0.13/config/configuration-file.html
module.exports = function (config) {
config.set({
basePath: '',
frameworks: ['mocha', 'sinon-chai', '@angular/cli'],
plugins: [
require('karma-mocha')... |
Fix deoplete variable naming and conditional logic
* Module-level variables should be CAPITALIZED.
* if len(my_list) != 0 can be more-safely changed to "if my_list"
* An empty list if falsey, a non-empty list is truthy. We're also safe
from unexpected "None" values now.
* Cleans up unnecessary comments that someho... | from .base import Base
COMPLETE_OUTPUTS = "g:LanguageClient_omniCompleteResults"
class Source(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = "LanguageClient"
self.mark = "[LC]"
self.rank = 1000
self.min_pattern_length = 1
self.filetypes = vim.e... | from .base import Base
CompleteOutputs = "g:LanguageClient_omniCompleteResults"
class Source(Base):
def __init__(self, vim):
super().__init__(vim)
self.name = "LanguageClient"
self.mark = "[LC]"
self.rank = 1000
self.min_pattern_length = 1
self.filetypes = vim.ev... |
Fix issue where title was incorrectly used - it's name | <?php namespace Anomaly\UsersModule\Role\Table;
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
/**
* Class RoleTableBuilder
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
* @package Anomaly\UsersModule\Role... | <?php namespace Anomaly\UsersModule\Role\Table;
use Anomaly\Streams\Platform\Ui\Table\TableBuilder;
/**
* Class RoleTableBuilder
*
* @link http://pyrocms.com/
* @author PyroCMS, Inc. <support@pyrocms.com>
* @author Ryan Thompson <ryan@pyrocms.com>
* @package Anomaly\UsersModule\Role... |
Remove support for 2.4 & 2.8 | /* eslint-env node */
module.exports = {
scenarios: [
{
name: 'ember-release',
bower: {
dependencies: {
'ember': 'components/ember#release'
},
resolutions: {
'ember': 'release'
}
},
npm: {
devDependencies: {
'ember-sourc... | /* eslint-env node */
module.exports = {
scenarios: [
{
name: 'ember-lts-2.4',
bower: {
dependencies: {
'ember': 'components/ember#lts-2-4'
},
resolutions: {
'ember': 'lts-2-4'
}
},
npm: {
devDependencies: {
'ember-sourc... |
Add extension_modueles to the default configuration | '''
Parse CLI options
'''
# Import python libs
import os
import copy
import argparse
# Import pkgcmp libs
import pkgcmp.scan
# Import third party libs
import yaml
DEFAULTS = {'cachedir': '/var/cache/pkgcmp',
'extension_modules': ''}
def parse():
'''
Parse!!
'''
parser = argparse.ArgumentP... | '''
Parse CLI options
'''
# Import python libs
import os
import copy
import argparse
# Import pkgcmp libs
import pkgcmp.scan
# Import third party libs
import yaml
DEFAULTS = {'cachedir': '/var/cache/pkgcmp'}
def parse():
'''
Parse!!
'''
parser = argparse.ArgumentParser(description='The pkgcmp map gen... |
Add unit support for spacers | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
from styles import adjustUnits
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of f... | # -*- coding: utf-8 -*-
# See LICENSE.txt for licensing terms
#$HeadURL$
#$LastChangedDate$
#$LastChangedRevision$
import shlex
from reportlab.platypus import Spacer
from flowables import *
def parseRaw(data):
"""Parse and process a simple DSL to handle creation of flowables.
Supported (ca... |
Remove url commented in google sevice. | "use strict";
(function () {
angular
.module("conpa")
.factory("googleService", googleService);
googleService.$inject = ["$http"];
function googleService($http) {
var service = {
quoteLookup: quoteLookup
};
return service;
function quoteLookup(... | "use strict";
// http://www.google.com/finance/match?matchtype=matchall&q=msft
// http://www.google.com/finance/match?&q=?matchtype=matchall&q=msft
(function () {
angular
.module("conpa")
.factory("googleService", googleService);
googleService.$inject = ["$http"];
function googleService($h... |
Add new topic button to index page | @extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-12">
@if (! Auth::guest())
<div class="text-right">
<a href="{{ action('TopicController@create') }}">
... | @extends('layouts.app')
@section('content')
<div class="container">
<div class="row">
<div class="col-md-8 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">Home</div>
<div class="panel-body">
<table class="table t... |
Add Laravel 5.5 Package Command | <?php
namespace meesoverdevest\wp_on_laravel;
use Illuminate\Support\ServiceProvider;
use meesoverdevest\wp_on_laravel\Commands\InstallWordPress;
class WPServiceProvider extends ServiceProvider
{
protected $commands = [
'meesoverdevest\wp_on_laravel\Commands\InstallWordPress'
];
/**
* Boot... | <?php
namespace meesoverdevest\wp_on_laravel;
use Illuminate\Support\ServiceProvider;
use meesoverdevest\wp_on_laravel\Commands\InstallWordPress;
class WPServiceProvider extends ServiceProvider
{
protected $commands = [
'meesoverdevest\wp_on_laravel\Commands\InstallWordPress'
];
/**
* Boot... |
Fix the Waypoint Details for nodes without links. |
import React from 'react';
class WaypointLinks extends React.Component {
constructor(props) {
super(props);
this.state = {
link: null
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
var value = undefined;
if (event.target.value)
value =... |
import React from 'react';
class WaypointLinks extends React.Component {
constructor(props) {
super(props);
this.state = {
link: null
};
this.handleChange = this.handleChange.bind(this);
}
handleChange(event) {
var value = undefined;
if (event.target.value)
value =... |
Fix stop video on modal close | import React from 'react';
import PropTypes from 'prop-types';
import YTPlayer from 'youtube-player';
import styles from './Modal.scss';
const Modal = ({ title, isGallery, trailerId, children, id }) => {
window.onclick = ({ target }) => {
if (target.id === id) closeModal();
};
const closeModal = () => {
... | import React from 'react';
import PropTypes from 'prop-types';
import YTPlayer from 'youtube-player';
import styles from './Modal.scss';
let player;
const Modal = ({ title, isGallery, trailerId, children, id }) => {
window.onclick = ({ target }) => {
if (target.id === id) closeModal();
};
const closeModal ... |
Make raw_params an optional argument in Submessage | from . import Message
class Submessage(object):
need_lock_object = True
def __init__(self, obj, message_id, sender, raw_params=None, need_lock_object=True):
self.obj = obj
self.sender = sender
self.message_id = message_id
self.raw_params = raw_params
self.need_lock_obj... | from . import Message
class Submessage(object):
need_lock_object = True
def __init__(self, obj, message_id, sender, raw_params, need_lock_object=True):
self.obj = obj
self.sender = sender
self.message_id = message_id
self.raw_params = raw_params
self.need_lock_object =... |
Remove unused conditon which cant hold anyway | package name.abuchen.portfolio.util;
public class Isin
{
private static final String CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //$NON-NLS-1$
public static final String PATTERN = "[A-Z]{2}[A-Z0-9]{9}\\d"; //$NON-NLS-1$
private Isin()
{
}
public static final boolean isValid(String is... | package name.abuchen.portfolio.util;
public class Isin
{
private static final String CHARACTERS = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ"; //$NON-NLS-1$
public static final String PATTERN = "[A-Z]{2}[A-Z0-9]{9}\\d"; //$NON-NLS-1$
private Isin()
{
}
public static final boolean isValid(String is... |
Fix bug where additional properties in objection models were not be omitted | 'use strict';
// Exports
export default (BaseModel) => {
class Model extends BaseModel {
$toDatabaseJson() {
const jsonSchema = this.constructor.jsonSchema;
const pick = jsonSchema && jsonSchema.properties;
let omit;
if (!pick) {
omit = this.... | 'use strict';
// Exports
export default (BaseModel) => {
class Model extends BaseModel {
$toDatabaseJson() {
const omit = this.constructor.getRelations();
return this.$$toJson(true, omit, null);
}
$beforeValidate(jsonSchema, json, opt) {
const schema = su... |
Fix an issue with repeated messages in json execution output provider.
git-svn-id: 555d7295f8287ebc42f8316c6775e40d702c4756@1726 3942dd89-8c5d-46d7-aeed-044bccf3e60c | import logging
from flask import render_template, request, Response, redirect, flash
from flask import Module, escape
from flexget.webui import register_plugin, manager, BufferQueue
from Queue import Empty
from flask.helpers import jsonify
execute = Module(__name__, url_prefix='/execute')
log = logging.getLo... | import logging
from flask import render_template, request, Response, redirect, flash
from flask import Module, escape
from flexget.webui import register_plugin, manager, BufferQueue
from Queue import Empty
from flask.helpers import jsonify
execute = Module(__name__, url_prefix='/execute')
log = logging.getLo... |
Store relative paths when creating a backup in a .zip file.
svn path=/trunk/eXist/; revision=6315 | package org.exist.backup;
import java.io.*;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry;
/**
* Implementation of BackupWriter that writes to a zip file.
*/
public class ZipWriter implements BackupWriter {
private String currentPath;
private ZipOutputStream out;
priv... | package org.exist.backup;
import java.io.*;
import java.util.zip.ZipOutputStream;
import java.util.zip.ZipEntry;
/**
* Implementation of BackupWriter that writes to a zip file.
*/
public class ZipWriter implements BackupWriter {
private String currentPath;
private ZipOutputStream out;
priv... |
Fix how we set 'build_dir' and 'install_dir' options from 'install' options --
irrelevant because this file is about to go away, but oh well. | """install_ext
Implement the Distutils "install_ext" command to install extension modules."""
# created 1999/09/12, Greg Ward
__revision__ = "$Id$"
from distutils.core import Command
from distutils.util import copy_tree
class install_ext (Command):
description = "install C/C++ extension modules"
user... | """install_ext
Implement the Distutils "install_ext" command to install extension modules."""
# created 1999/09/12, Greg Ward
__revision__ = "$Id$"
from distutils.core import Command
from distutils.util import copy_tree
class install_ext (Command):
description = "install C/C++ extension modules"
user... |
Index the Atlas data by version and provider | from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vag... | from __future__ import unicode_literals, print_function
import json
import urllib2
class Box(object):
"""Downloads and parses metainformation about a Vagrant box"""
def __init__(self, publisher, name):
"""Extract metainformation for a Vagrant box.
publisher -- Atlas owner
name -- Vag... |
Make the sprint layout a bit easier to look at | '''
Create a visual representation of the various DAGs defined
'''
import sys
import requests
import networkx as nx
import matplotlib.pyplot as plt
if __name__ == '__main__':
g = nx.DiGraph()
labels = {
'edges': {},
'nodes': {},
}
for routeKey, routeMap in requests.get(sys.argv[1]).j... | '''
Create a visual representation of the various DAGs defined
'''
import sys
import requests
import networkx as nx
import matplotlib.pyplot as plt
if __name__ == '__main__':
g = nx.DiGraph()
labels = {
'edges': {},
'nodes': {},
}
nodes = {}
for routeKey, routeMap in requests.ge... |
Add parenthesis to print statement | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... | from builtins import range
import sys
sys.path.insert(1,"../../../")
import h2o
from tests import pyunit_utils
##
# Test out the cor() functionality
# If NAs in the frame, they are skipped in calculation unless na.rm = F
# If any categorical columns, throw an error
##
import numpy as np
def cor_test():
iris... |
Add a count to support non sequential dialog closes | import React, { Component, PureComponent } from 'react';
import PropTypes from 'prop-types';
import { getNodeFromSelector } from './util';
/**
Provides an HOC component for ensuring container is non-scrollable during component
lifecycle.
**/
export default function withNonScrollable(Portal) {
let portalVisibleCo... | import React, { Component, PureComponent } from 'react';
import PropTypes from 'prop-types';
import { getNodeFromSelector } from './util';
/**
Provides an HOC component for ensuring container is non-scrollable during component
lifecycle.
**/
export default function withNonScrollable(Portal) {
return class NonScr... |
Remove random bit of code
I have no idea what that is doing there. It is not called from
what I can tell, and the tests work without it. And it makes no
sense whatsoever, create a message each time you retrieve the
conversation info??!?!?! | from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.exceptions import PermissionDenied
from foodsaving.conversations.models import Conversation, ConversationMessage
class ConversationSerializer(serializers.ModelSerializer):
class Meta:
model ... | from django.utils.translation import ugettext_lazy as _
from rest_framework import serializers
from rest_framework.exceptions import PermissionDenied
from foodsaving.conversations.models import Conversation, ConversationMessage
class ConversationSerializer(serializers.ModelSerializer):
class Meta:
model ... |
Check query.id before fetching data from youtube-api | var _ = require('underscore');
var moment = require('moment');
var Promise = require('promise');
var fetch = require('./../fetch');
var cache = require('../cache');
var VideoModel = require('../../db/videos/models/Video');
var saveVideo = require('../../db/videos/saveVideo');
var getVideos =... | var _ = require('underscore');
var moment = require('moment');
var Promise = require('promise');
var fetch = require('./../fetch');
var cache = require('../cache');
var VideoModel = require('../../db/videos/models/Video');
var saveVideo = require('../../db/videos/saveVideo');
var getVideos =... |
Make it work by default |
'use strict';
var glob = require('glob'),
_ = require('underscore'),
ParallelExec = require('./lib/ParallelExec'),
BehatTask = require('./lib/BehatTask'),
defaults = {
src: './**/*.feature',
bin: './bin/behat',
cwd: './',
config: './behat.yml',
flags: '',
... |
'use strict';
var glob = require('glob'),
_ = require('underscore'),
ParallelExec = require('./lib/ParallelExec'),
BehatTask = require('./lib/BehatTask'),
defaults = {
src: './**/*.feature',
bin: './bin/behat',
cwd: './',
config: './behat.yml',
flags: '',
... |
system: Remove constructor/destructor from static L10nFactory | <?php
/**
* Factory class for providing Localization implementations
* @author M2Mobi, Heinz Wiesinger
*/
class L10nFactory
{
/**
* Instance of the L10nProvider
* @var array
*/
private static $lprovider;
/**
* This method returns an object with the appropriate localization
* i... | <?php
/**
* Factory class for providing Localization implementations
* @author M2Mobi, Heinz Wiesinger
*/
class L10nFactory
{
/**
* Instance of the L10nProvider
* @var array
*/
private static $lprovider;
/**
* Constructor
*/
public function __construct()
{
}
... |
Set `pydev_message` only if `additional_info` exists. | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... | # -*- coding: utf-8 -*-
import threading
def pytest_exception_interact(node, call, report):
"""
Drop into PyCharm debugger, if available, on uncaught exceptions.
"""
try:
import pydevd
from pydevd import pydevd_tracing
except ImportError:
pass
else:
exctype, val... |
Update tests for molecule 3 compatibility | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/molecule3/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"... | import pytest
import os
import shutil
from subprocess import call
from cookiecutter.main import cookiecutter
playbook_setup_commands = ['pip install -r https://raw.githubusercontent.com/nephelaiio/ansible-role-requirements/master/requirements.txt']
playbook_setup_success = 0
playbook_test_command = "molecule test"
pl... |
Use last_build_result instead of last_build_status | define(
[
'jquery',
'backbone',
'underscore',
'moment'
],
function ($, Backbone, _, moment) {
"use strict";
return Backbone.Model.extend({
url : function() {
var base = $('body').data('api-url') + '/repos';
return... | define(
[
'jquery',
'backbone',
'underscore',
'moment'
],
function ($, Backbone, _, moment) {
"use strict";
return Backbone.Model.extend({
url : function() {
var base = $('body').data('api-url') + '/repos';
return... |
Create index on Question.when for faster ordered queries. | from django.db import models
from django.contrib.auth.models import User
from quizzardous.utils import slugify
class Question(models.Model):
"""Represents a question asked by a user."""
class Meta:
ordering = ['-when']
question = models.TextField()
# A slug is actually required, but if it's e... | from django.db import models
from django.contrib.auth.models import User
from quizzardous.utils import slugify
class Question(models.Model):
"""Represents a question asked by a user."""
class Meta:
ordering = ['-when']
question = models.TextField()
# A slug is actually required, but if it's e... |
Set the default cartoCSS version when generating the MapConfig | var _ = require('underscore');
var LayerGroupConfig = {};
var DEFAULT_CARTOCSS_VERSION = '2.1.0';
LayerGroupConfig.generate = function (options) {
var layers = options.layers;
var dataviews = options.dataviews;
var config = { layers: [] };
_.each(layers, function (layer) {
if (layer.isVisible()) {
v... | var _ = require('underscore');
var LayerGroupConfig = {};
LayerGroupConfig.generate = function (options) {
var layers = options.layers;
var dataviews = options.dataviews;
var config = { layers: [] };
_.each(layers, function (layer) {
if (layer.isVisible()) {
var layerConfig = {
type: layer.ge... |
feat: Improve annotating of code segements | import re
class ArtifactAnnotator:
excluded_types = set(['heading', 'code'])
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
... | import re
class ArtifactAnnotator:
def linkify_artifacts(marked_tree, artifacts):
big_string = ArtifactAnnotator._marked_tree_to_big_string(marked_tree)
for artifact in artifacts:
link = '(%s "GHOSTDOC-TOKEN")' % artifact['_id']
for token in artifact['tokens']:
... |
Use multiple run for local karma | /* global process */
module.exports = function (config) {
config.set({
browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ],
singleRun: !!process.env.CONTINUOUS_INTEGRATION,
frameworks: [ 'mocha' ],
files: [
'https://cdnjs.cloudflare.com/ajax/libs/react... | /* global process */
module.exports = function (config) {
config.set({
browsers: [ process.env.CONTINUOUS_INTEGRATION ? 'Firefox' : 'Chrome' ],
singleRun: true,
frameworks: [ 'mocha' ],
files: [
'https://cdnjs.cloudflare.com/ajax/libs/react/0.14.0/react-with-addons.js',
... |
Add backends as explicit package | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
readme = o... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
os.system('python setup.py bdist_wheel upload')
sys.exit()
readme = o... |
Add food to the perception handler | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... | """
Module that holds classes that represent an agent's perception handler.
"""
import abc
import world
import structure
class PerceptionHandler(object):
"""
Abstract perception handler class.
"""
@abc.abstractmethod
def perceive(self, agent, world):
"""
Generates a percept given ... |
Fix migration that fails on postgres | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0027_auto_20150513_2005'),
]
operations = [
migrations.CreateModel(
name='Location',
... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('studygroups', '0027_auto_20150513_2005'),
]
operations = [
migrations.CreateModel(
name='Location',
... |
Add modal options to sidebar | module.exports = {
api: [
{
type: 'category',
label: 'Navigation',
items: [
'component',
'root',
'stack',
'modal',
'overlay'
]
},
{
type: 'category',
label: 'Layouts',
items: [
'layout-layout',
'layout-compon... | module.exports = {
api: [
{
type: 'category',
label: 'Navigation',
items: [
'component',
'root',
'stack',
'modal',
'overlay'
]
},
{
type: 'category',
label: 'Layouts',
items: [
'layout-layout',
'layout-compon... |
[import] Reduce batch size to 128kb | const MAX_PAYLOAD_SIZE = 1024 * 256 // 256KB
function batchDocuments(docs) {
let currentBatch = []
let currentBatchSize = 0
const batches = [currentBatch]
docs.forEach(doc => {
const docSize = JSON.stringify(doc).length
const newBatchSize = currentBatchSize + docSize
// If this document pushes us... | const MAX_PAYLOAD_SIZE = 1024 * 512 // 512KB
function batchDocuments(docs) {
let currentBatch = []
let currentBatchSize = 0
const batches = [currentBatch]
docs.forEach(doc => {
const docSize = JSON.stringify(doc).length
const newBatchSize = currentBatchSize + docSize
// If this document pushes us... |
Update query to use nodes | import requests
GITHUB_API_URL = "https://api.github.com/graphql"
QUERY = """
query($repository_owner:String!,
$repository_name: String!,
$count: Int!) {
repository(owner: $repository_owner,
name: $repository_name) {
refs(last: $count,refPrefix:"refs/tags/") {
nodes {
... | import requests
GITHUB_API_URL = "https://api.github.com/graphql"
QUERY = """
query($repository_owner:String!, $repository_name: String!, $count: Int!) {
repository(
owner: $repository_owner,
name: $repository_name) {
refs(last: $count,refPrefix:"refs/tags/") {
edges {
node{
... |
Remove trailing slash from realpath call
realpath returns paths without trailing slashes. This change makes
that clearer in the call | <?php
namespace Bugsnag\BugsnagBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class BugsnagExtension exte... | <?php
namespace Bugsnag\BugsnagBundle\DependencyInjection;
use Symfony\Component\Config\FileLocator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\YamlFileLoader;
use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class BugsnagExtension exte... |
Improve the top bar for the error messages. | package com.sb.elsinore.html;
import java.io.IOException;
import org.rendersnake.HtmlCanvas;
import org.rendersnake.Renderable;
import com.sb.elsinore.LaunchControl;
import static org.rendersnake.HtmlAttributesFactory.*;
/**
* Create a top bar for the web page.
* @author Doug Edey
*/
public class TopBar impleme... | package com.sb.elsinore.html;
import java.io.IOException;
import org.rendersnake.HtmlCanvas;
import org.rendersnake.Renderable;
import com.sb.elsinore.LaunchControl;
import static org.rendersnake.HtmlAttributesFactory.*;
/**
* Create a top bar for the web page.
* @author Doug Edey
*/
public class TopBar impleme... |
Remove sensitivity to time warnings in formatter output | <?php
namespace Matcher;
use PhpSpec\Exception\Example\FailureException;
use PhpSpec\Matcher\MatcherInterface;
use Symfony\Component\Console\Tester\ApplicationTester;
class ApplicationOutputMatcher implements MatcherInterface
{
/**
* Checks if matcher supports provided subject and matcher name.
*
... | <?php
namespace Matcher;
use PhpSpec\Exception\Example\FailureException;
use PhpSpec\Matcher\MatcherInterface;
use Symfony\Component\Console\Tester\ApplicationTester;
class ApplicationOutputMatcher implements MatcherInterface
{
/**
* Checks if matcher supports provided subject and matcher name.
*
... |
Add a method to get the value objects built internally. | <?PHP
/**
* A common interface for all value objects.
*
*
* @author Adamo Crespi <hello@aerendir.me>
* @copyright Copyright (c) 2015, Adamo Crespi
* @license MIT License
*/
namespace SerendipityHQ\Component\ValueObjects\Common;
/**
* Implements basic constructor for complex value objects.
*/
t... | <?PHP
/**
* A common interface for all value objects.
*
*
* @author Adamo Crespi <hello@aerendir.me>
* @copyright Copyright (c) 2015, Adamo Crespi
* @license MIT License
*/
namespace SerendipityHQ\Component\ValueObjects\Common;
/**
* Implements basic constructor for complex value objects.
*/
t... |
CRM-4904: Refactor email body sync
- Fix migrations | <?php
namespace Oro\Bundle\EmailBundle\Migrations\Schema\v1_20;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedSqlMigrationQuery;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
use Oro\Bundle\MigrationBundle\Migration\SqlM... | <?php
namespace Oro\Bundle\EmailBundle\Migrations\Schema\v1_20;
use Doctrine\DBAL\Schema\Schema;
use Oro\Bundle\MigrationBundle\Migration\Migration;
use Oro\Bundle\MigrationBundle\Migration\ParametrizedSqlMigrationQuery;
use Oro\Bundle\MigrationBundle\Migration\QueryBag;
use Oro\Bundle\MigrationBundle\Migration\SqlM... |
Add error info when lock exists | import logging
try:
import click
from lockfile import LockFile, LockTimeout
except ImportError:
click = None
logger = logging.getLogger('spoppy.main')
def get_version():
return '1.2.2'
if click:
@click.command()
@click.argument('username', required=False)
@click.argument('password', req... | import logging
try:
import click
from lockfile import LockFile, LockTimeout
except ImportError:
click = None
logger = logging.getLogger('spoppy.main')
def get_version():
return '1.2.2'
if click:
@click.command()
@click.argument('username', required=False)
@click.argument('password', req... |
chore(cleanup): Remove old code for copying test-module | var utils = require('utils')
, env = utils.bootstrapEnv()
, moduleLdr = env.moduleLoader
, injector = require('injector')
, ncp = require('ncp')
, path = require('path')
, async = require('async');
describe('ModuleLoader', function() {
it('should load modules', fu... | var utils = require('utils')
, env = utils.bootstrapEnv()
, moduleLdr = env.moduleLoader
, injector = require('injector')
, ncp = require('ncp')
, path = require('path')
, async = require('async');
describe('ModuleLoader', function() {
before(function(done) {
... |
Add index.js to the tests / complexity runner
Signed-off-by: Henrique Vicente <d390f26e2f50ad5716a9c69c58de1f5df9730e3b@gmail.com> | /*
* grunt-cli-config
* https://github.com/henvic/grunt-cli-config
*
* Copyright (c) 2014 Henrique Vicente
* Licensed under the MIT license.
*/
'use strict';
module.exports = function exports(grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'in... | /*
* grunt-cli-config
* https://github.com/henvic/grunt-cli-config
*
* Copyright (c) 2014 Henrique Vicente
* Licensed under the MIT license.
*/
'use strict';
module.exports = function exports(grunt) {
grunt.initConfig({
jshint: {
all: [
'Gruntfile.js',
'ta... |
Exclude inactive comics from sets editing, effectively throwing them out of the set when saved | import datetime
from django import forms
from django.template.defaultfilters import slugify
from comics.core.models import Comic
from comics.sets.models import Set
class NewSetForm(forms.ModelForm):
class Meta:
model = Set
fields = ('name',)
def save(self, commit=True):
set = super(N... | import datetime
from django import forms
from django.template.defaultfilters import slugify
from comics.core.models import Comic
from comics.sets.models import Set
class NewSetForm(forms.ModelForm):
class Meta:
model = Set
fields = ('name',)
def save(self, commit=True):
set = super(N... |
Allow method chaining after serveSwagger | import {json} from "body-parser";
import {Router} from "express";
import * as validate from "./validate-middleware";
import * as convert from "./convert";
export default function convexpress (options) {
const router = Router().use(json());
router.swagger = {
swagger: "2.0",
host: options.host,... | import {json} from "body-parser";
import {Router} from "express";
import * as validate from "./validate-middleware";
import * as convert from "./convert";
export default function convexpress (options) {
const router = Router().use(json());
router.swagger = {
swagger: "2.0",
host: options.host,... |
Configure debug_toolbar to not fail. | from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'schwag.views.home', name='home'),
url(r'^... | from django.conf.urls import patterns, include, url
from django.conf import settings
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
urlpatterns = patterns('',
url(r'^$', 'schwag.views.home', name='home'),
url(r'^... |
Enhance bad response exception CS. | <?php
/**
* @author Lev Semin <lev@darvin-studio.ru>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\AdminBundle\Security... | <?php
/**
* @author Lev Semin <lev@darvin-studio.ru>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\AdminBundle\Security... |
Mark as compatible with Python 3 with the proper classifier. | import os
from setuptools import find_packages
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
DESCR = ('This package provides a Deform autocomplete widget that '
'st... | import os
from setuptools import find_packages
from setuptools import setup
here = os.path.abspath(os.path.dirname(__file__))
README = open(os.path.join(here, 'README.rst')).read()
CHANGES = open(os.path.join(here, 'CHANGES.rst')).read()
DESCR = ('This package provides a Deform autocomplete widget that '
'st... |
Update Entity database table name | <?php
namespace WiContactAPI\V1\Rest\Contact;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="WiContactAPI\V1\Rest\Contact\ContactCollection")
* @ORM\Table(name="contacts")
*/
class ContactEntity
{
/**
*
* @var int @ORM\Id
* @ORM\Column(type="integer")
... | <?php
namespace WiContactAPI\V1\Rest\Contact;
use Doctrine\ORM\Mapping as ORM;
/**
* @ORM\Entity(repositoryClass="WiContactAPI\V1\Rest\Contact\ContactCollection")
* @ORM\Table(name="contact")
*/
class ContactEntity
{
/**
*
* @var int @ORM\Id
* @ORM\Column(type="integer")
... |
Expatistan: Switch to using the api_result.abstract for firstline | (function(env) {
env.ddg_spice_expatistan = function(api_result) {
"use strict";
if(!api_result || api_result.status !== 'OK') {
return Spice.failed('expatistan');
}
Spice.add({
id: "expatistan",
name: "Answer",
data: api_result,
... | (function(env) {
env.ddg_spice_expatistan = function(api_result) {
"use strict";
if(!api_result || api_result.status !== 'OK') {
return Spice.failed('expatistan');
}
Spice.add({
id: "expatistan",
name: "Answer",
data: api_result,
... |
Make short unit extraction script idempotent | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../..'))
import owid_grapher.wsgi
from grapher_admin.models import Variable
# use this script to extract and write short forms of unit of measurement for all variables that already exit in the db
common_short_units = ['$', '£', '€', '%']
all_variable... | import os
import sys
sys.path.insert(1, os.path.join(sys.path[0], '../..'))
import owid_grapher.wsgi
from grapher_admin.models import Variable
# use this script to extract and write short forms of unit of measurement for all variables that already exit in the db
common_short_units = ['$', '£', '€', '%']
all_variable... |
Change the DB VM seed | <?php
use Illuminate\Database\Seeder;
use REBELinBLUE\Deployer\Server;
class ServerTableSeeder extends Seeder
{
public function run()
{
DB::table('servers')->delete();
Server::create([
'name' => 'Web VM',
'ip_address' => '192.168.33.50',
'user' ... | <?php
use Illuminate\Database\Seeder;
use REBELinBLUE\Deployer\Server;
class ServerTableSeeder extends Seeder
{
public function run()
{
DB::table('servers')->delete();
Server::create([
'name' => 'Web VM',
'ip_address' => '192.168.33.50',
'user' ... |
Support cloning in UncDirectory constructor | class UncDirectory(object):
def __init__(self, path, username=None, password=None):
if hasattr(path, 'path') and hasattr(path, 'username') and hasattr(path, 'password'):
self.path = path.path
self.username = path.username
self.password = path.password
else:
... | class UncDirectory(object):
def __init__(self, path, username=None, password=None):
self.path = path
self.username = username
self.password = password
def __eq__(self, other):
try:
return (self.get_normalized_path() == other.get_normalized_path()
... |
[Fluid] Add lineMarker for template to identifier to prevent flickering | package com.cedricziel.idea.fluid.codeInsight;
import com.cedricziel.idea.fluid.lang.psi.FluidFile;
import com.cedricziel.idea.fluid.util.FluidUtil;
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo;
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider;
import com.intellij.codeInsight.na... | package com.cedricziel.idea.fluid.codeInsight;
import com.cedricziel.idea.fluid.lang.psi.FluidFile;
import com.cedricziel.idea.fluid.util.FluidUtil;
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerInfo;
import com.intellij.codeInsight.daemon.RelatedItemLineMarkerProvider;
import com.intellij.codeInsight.na... |
Remove unnecessary trailing slash in host config | <?php
namespace Bundle\ApcBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class ApcExtension extends Extension
{
public function configLoad($conf... | <?php
namespace Bundle\ApcBundle\DependencyInjection;
use Symfony\Component\DependencyInjection\Extension\Extension;
use Symfony\Component\DependencyInjection\Loader\XmlFileLoader;
use Symfony\Component\DependencyInjection\ContainerBuilder;
class ApcExtension extends Extension
{
public function configLoad($conf... |
Remove unecessary ifram param in headerAction | <?php
namespace Biopen\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class CoreController extends Controller
{
public function homeAction()
{
$em = $this->get('doctrine_mongodb')->getManager();
// ... | <?php
namespace Biopen\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class CoreController extends Controller
{
public function homeAction()
{
$em = $this->get('doctrine_mongodb')->getManager();
// ... |
Handle case of undefined document list as result of search | module.exports = function($http, $state, $location, $q, DocumentApiService,
DocumentRouteService, DocumentService, GlobalService, UserService, MathJaxService) {
console.log('SEARCH SERVICE')
var deferred = $q.defer();
var apiServer = GlobalService.apiServer()
t... | module.exports = function($http, $state, $location, $q, DocumentApiService,
DocumentRouteService, DocumentService, GlobalService, UserService, MathJaxService) {
console.log('SEARCH SERVICE')
var deferred = $q.defer();
var apiServer = GlobalService.apiServer()
t... |
Add back rotatation for scroll job. | import scrollphat
from pijobs.scrollphatjob import ScrollphatJob
class ScrollJob(ScrollphatJob):
def default_options(self):
opts = {
'brightness': 2,
'interval': 0.1,
'sleep': 1.0,
}
return opts
def init(self):
self.set_brightness... | import scrollphat
from pijobs.scrollphatjob import ScrollphatJob
class ScrollJob(ScrollphatJob):
def default_options(self):
opts = {
'brightness': 2,
'interval': 0.1,
'sleep': 1.0,
}
return opts
def init(self):
self.set_brightness... |
Fix AJAX response class constructor. | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\Utils\HttpFoundat... | <?php
/**
* @author Igor Nikolaev <igor.sv.n@gmail.com>
* @copyright Copyright (c) 2015, Darvin Studio
* @link https://www.darvin-studio.ru
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Darvin\Utils\HttpFoundat... |
Make StringMatch questions use new choice type | /**
* Copyright 2016 James Sharkey
*
* 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... | /**
* Copyright 2016 James Sharkey
*
* 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... |
Fix bug in BeanExtractor (DynaBeanItem was not recognized) | package org.tylproject.vaadin.addon.utils;
import com.vaadin.addon.jpacontainer.EntityItem;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
import org.vaadin.viritin.DynaBeanItem;
import org.vaadin.viritin.ListContainer;
/**
* Extracts bean from an Item, depending on the Container implementation
... | package org.tylproject.vaadin.addon.utils;
import com.vaadin.addon.jpacontainer.EntityItem;
import com.vaadin.data.Item;
import com.vaadin.data.util.BeanItem;
import org.vaadin.viritin.DynaBeanItem;
import org.vaadin.viritin.ListContainer;
/**
* Extracts bean from an Item, depending on the Container implementation
... |
Use ->guard() instead of ->driver().
Signed-off-by: crynobone <e1a543840a942eb68427510a8a483282a7bfeddf@gmail.com> | <?php namespace Orchestra\Auth;
use Orchestra\Authorization\Policy;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Auth\AuthServiceProvider as ServiceProvider;
use Orchestra\Contracts\Authorization\Factory as FactoryContract;
class AuthServiceProvider extends ServiceProvider
{
/**
* Register... | <?php namespace Orchestra\Auth;
use Orchestra\Authorization\Policy;
use Illuminate\Contracts\Foundation\Application;
use Illuminate\Auth\AuthServiceProvider as ServiceProvider;
use Orchestra\Contracts\Authorization\Factory as FactoryContract;
class AuthServiceProvider extends ServiceProvider
{
/**
* Register... |
Add a vararg constructor for the Tabbed Panel | package lt.inventi.wicket.component.bootstrap.tab;
import java.util.Arrays;
import java.util.List;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.IModel;
import org.apach... | package lt.inventi.wicket.component.bootstrap.tab;
import java.util.List;
import org.apache.wicket.extensions.markup.html.tabs.ITab;
import org.apache.wicket.markup.html.WebMarkupContainer;
import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.model.IModel;
import org.apache.wicket.util.string.Stri... |
Fix extra in case of fragmented sources | from collections import namedtuple
Event = namedtuple('Event', ['id', 'type', 'data'])
def parse(source):
eid = None
etype = None
data = []
retry = None
extra = ''
dispatch = False
cursor = 0
lines = source.splitlines()
for line in lines:
if not line:
... | from collections import namedtuple
Event = namedtuple('Event', ['id', 'type', 'data'])
def parse(source):
eid = None
etype = None
data = []
retry = None
extra = ''
dispatch = False
lines = source.splitlines()
for line in lines:
if dispatch:
extra += line + '\n... |
Change the name "name" to "key" to support the backend structure of holding annotation elements | /**
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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.o... | /**
* Copyright (c) 2018, WSO2 Inc. (http://www.wso2.org) All Rights Reserved.
*
* WSO2 Inc. licenses this file to you 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.o... |
Use a private I/O thread pool for failure detector | /*
* 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
* distribut... | /*
* 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
* distribut... |
Update company logos if they didn't previously have one but they do now | <?php
namespace GoRemote\Model;
class CompanyModel
{
public $id = 0;
public $name;
public $url = '';
public $twitter;
public $logo;
public function insert(\Doctrine\DBAL\Connection $db)
{
$duplicateId = $db->fetchAssoc(
'select companyid, url, logo from companies where name=?',
[
(string) $this->na... | <?php
namespace GoRemote\Model;
class CompanyModel
{
public $id = 0;
public $name;
public $url = '';
public $twitter;
public $logo;
public function insert(\Doctrine\DBAL\Connection $db)
{
$duplicateId = $db->fetchAssoc(
'select companyid, url, logo from companies where name=?',
[
(string) $this->na... |
Make sure we always use the same filename for the fixtures translations.
This way the translations do not contain accidental changes. | import json
import os
from django.core.management.commands.makemessages import Command as BaseCommand
from bluebottle.clients.utils import get_currencies
class Command(BaseCommand):
""" Extend the makemessages to include some of the fixtures """
fixtures = [
('bb_projects', 'project_data.json'),
... | import json
import tempfile
from django.core.management.commands.makemessages import Command as BaseCommand
from bluebottle.clients.utils import get_currencies
class Command(BaseCommand):
""" Extend the makemessages to include some of the fixtures """
fixtures = [
('bb_projects', 'project_data.json... |
Rename tests to better reflect field meaning | package de.innoaccel.wamp.server.converter;
import de.innoaccel.wamp.server.Websocket;
import de.innoaccel.wamp.server.message.Message;
import org.junit.Test;
import java.io.IOException;
abstract public class GeneralMessageTests<T extends Message>
{
protected JsonParsingConverter<T> converter;
@Test(expecte... | package de.innoaccel.wamp.server.converter;
import de.innoaccel.wamp.server.Websocket;
import de.innoaccel.wamp.server.message.Message;
import org.junit.Test;
import java.io.IOException;
abstract public class GeneralMessageTests<T extends Message>
{
protected JsonParsingConverter<T> converter;
@Test(expecte... |
Clarify arguments in tests slightly | from planterbox import (
step,
hook,
)
hooks_run = set()
@hook('before', 'feature')
def before_feature_hook(feature_suite):
global hooks_run
hooks_run.add(('before', 'feature'))
@hook('before', 'scenario')
def before_scenario_hook(test):
global hooks_run
hooks_run.add(('before', 'scenario'... | from planterbox import (
step,
hook,
)
hooks_run = set()
@hook('before', 'feature')
def before_feature_hook(feature_suite):
global hooks_run
hooks_run.add(('before', 'feature'))
@hook('before', 'scenario')
def before_scenario_hook(scenario_test):
global hooks_run
hooks_run.add(('before', '... |
Change code to be compliant with PEP 8
This change camel cased functions for underscored function names and
properties. | import subprocess
import os
class PHPLint:
def __init__(self):
self.silent = False
def set_silent_lint(self, is_silent):
self.silent = is_silent
def lint(self, path):
if os.path.isfile(path):
self.lint_file(path)
elif os.path.isdir(path):
self.lint_... | import subprocess
import os
class PHPLint:
def __init__(self):
self.silent = False
def setSilentLint(self, isSilent):
self.silent = isSilent
def lint(self, path):
if os.path.isfile(path):
self.lintFile(path)
elif os.path.isdir(path):
self.lintDir(pa... |
Disable native pi calculator test for the moment | package com.github.michaelkhw.playground.pi;
import com.github.michaelkhw.playground.timer.NanoTimer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.util.Arrays;
import java.util.Collection;
import static org.junit.Assert.assertEquals;
/**
* Created by m... | package com.github.michaelkhw.playground.pi;
import com.github.michaelkhw.playground.timer.NanoTimer;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.junit.runners.Parameterized;
import java.util.Arrays;
import java.util.Collection;
import static org.junit.Assert.assertEquals;
/**
* Created by m... |
Add missed traits for controller | <?php
namespace GeniusTS\Preferences\Controllers;
use GeniusTS\Preferences\Models\Domain;
use GeniusTS\Preferences\Models\Element;
use GeniusTS\Preferences\Models\Setting;
use GeniusTS\Preferences\PreferencesManager;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Symfony\Component\HttpFoundation\Response;
use Geni... | <?php
namespace GeniusTS\Preferences\Controllers;
use GeniusTS\Preferences\Models\Domain;
use GeniusTS\Preferences\Models\Element;
use GeniusTS\Preferences\Models\Setting;
use GeniusTS\Preferences\PreferencesManager;
use Symfony\Component\HttpFoundation\Response;
use GeniusTS\Preferences\Requests\SettingsRequest;
/... |
Add logging filter for checking that the app is actually deployed
(imported from commit 77bd7e008fdea4033e18a91d206999f9714e0f74) | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
... | import logging
import traceback
from hashlib import sha256
from datetime import datetime, timedelta
# Adapted http://djangosnippets.org/snippets/2242/ by user s29 (October 25, 2010)
class _RateLimitFilter(object):
last_error = datetime.min
def filter(self, record):
from django.conf import settings
... |
Remove code prototype code where the settings variables were being modified, this code works in single threaded servers but might not work on multithreaded servers. | from django.conf import settings
from crits.config.config import CRITsConfig
def modify_configuration(forms, analyst):
"""
Modify the configuration with the submitted changes.
:param config_form: The form data.
:type config_form: dict
:param analyst: The user making the modifications.
:type a... | from django.conf import settings
from crits.config.config import CRITsConfig
def modify_configuration(forms, analyst):
"""
Modify the configuration with the submitted changes.
:param config_form: The form data.
:type config_form: dict
:param analyst: The user making the modifications.
:type a... |
Add fixture for the advert in the blog sidebar advert. | from django.core.management.base import BaseCommand
from us_ignite.snippets.models import Snippet
FIXTURES = [
{
'slug': 'home-box',
'name': 'UP NEXT: LOREM IPSUM',
'body': '',
'url_text': 'GET INVOLVED',
'url': '',
},
{
'slug': 'featured',
'name': ... | from django.core.management.base import BaseCommand
from us_ignite.snippets.models import Snippet
FIXTURES = [
{
'slug': 'home-box',
'name': 'UP NEXT: LOREM IPSUM',
'body': '',
'url_text': 'GET INVOLVED',
'url': '',
},
{
'slug': 'featured',
'name': ... |
Exclude @ngrx modules from preloading | var path = require('path');
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
module.exports = {
devtool: 'source-map',
debug: true,
entry: {
'@angular': [
'rxjs',
'reflect-metadata',
'zone.js'
],
'common': ['es6-shim'],
'app': './s... | var path = require('path');
var webpack = require('webpack');
var CommonsChunkPlugin = webpack.optimize.CommonsChunkPlugin;
module.exports = {
devtool: 'source-map',
debug: true,
entry: {
'@angular': [
'rxjs',
'reflect-metadata',
'zone.js'
],
'common': ['es6-shim'],
'app': './s... |
Add help text for roll command | import random
import re
from cardinal.decorators import command, help
def parse_roll(arg):
# some people might separate with commas
arg = arg.rstrip(',')
if match := re.match(r'^(\d+)?d(\d+)$', arg):
num_dice = match.group(1)
sides = match.group(2)
elif match := re.match(r'^d?(\d+)$'... | import random
import re
from cardinal.decorators import command
def parse_roll(arg):
# some people might separate with commas
arg = arg.rstrip(',')
if match := re.match(r'^(\d+)?d(\d+)$', arg):
num_dice = match.group(1)
sides = match.group(2)
elif match := re.match(r'^d?(\d+)$', arg)... |
Move button to top-left, need to adjust margins and padding | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
class Story extends Component{
onProfilePressed() {
this.props.navigator.push({
title: 'Story',
component: Profile
})
}
render() {
return (
<View style={s... | import React, { Component } from 'react';
import {
StyleSheet,
Text,
View,
TouchableHighlight,
} from 'react-native';
class Story extends Component{
onProfilePressed() {
this.props.navigator.push({
title: 'Story',
component: Profile
})
}
render() {
return (
<View style={s... |
Adjust query selector for location of image | window.addEventListener("click", notifyExtension);
function notifyExtension(e) {
console.log("igcs.js: click on ${e}");
if (e.target.classList.contains("coreSpriteHeartFull")) {
var parser = document.createElement('a');
parser.href = e.target.closest("article").querySelector("header a").href;
var bio ... | window.addEventListener("click", notifyExtension);
function notifyExtension(e) {
console.log("igcs.js: click on ${e}");
if (e.target.classList.contains("coreSpriteHeartFull")) {
var parser = document.createElement('a');
parser.href = e.target.closest("article").querySelector("header a").href;
var bio ... |
Fix case-sensitive filename in storage test | import json
import os
from mock import patch
import pytest
from inmemorystorage.storage import InMemoryStorage
TEST_DATA_PATH = os.path.join(os.path.dirname(__file__), 'images')
@pytest.mark.django_db
def test_alternate_storage(admin_client, settings):
"""Verify can plugin alternate storage backend"""
set... | import json
import os
from mock import patch
import pytest
from inmemorystorage.storage import InMemoryStorage
TEST_DATA_PATH = os.path.join(os.path.dirname(__file__), 'images')
@pytest.mark.django_db
def test_alternate_storage(admin_client, settings):
"""Verify can plugin alternate storage backend"""
set... |
Remove temp directory creation... not worth it | import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time
class Environment(object):
def __init__(self, *args, **kwargs):
self.environ = os.environ.copy()
self.config = {}
self.cbchome = None
if 'CBC_HOME' in kwargs:
... | import os
from .exceptions import IncompleteEnv
from tempfile import TemporaryDirectory
import time
class Environment(object):
def __init__(self, *args, **kwargs):
self.environ = os.environ.copy()
self.config = {}
self.cbchome = None
if 'CBC_HOME' in kwargs:
... |
Change manage.py to require Pillow 2.0. This is to avoid PIL import errors for Mac users | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
version = '2.6.dev0'
setup(
name="django-photologue",
version=version,
description="Powerful image management for the Django web framework.",
author="Jus... | #/usr/bin/env python
import os
from setuptools import setup, find_packages
ROOT_DIR = os.path.dirname(__file__)
SOURCE_DIR = os.path.join(ROOT_DIR)
version = '2.6.dev0'
setup(
name="django-photologue",
version=version,
description="Powerful image management for the Django web framework.",
author="Jus... |
Make shapes reappear when navigating back to the homepage | function setupNavigation() {
if (document.getElementById("navigation") == null) {
return;
}
var anchors = document.getElementsByTagName("a");
var sub_navigation_bars = document.getElementsByClassName("sub-navigation");
for (var i = 0; i < anchors.length; i++) {
if (anchors[i].p... | function setupNavigation() {
var anchors = document.getElementsByTagName("a");
var sub_navigation_bars = document.getElementsByClassName("sub-navigation");
for (var i = 0; i < anchors.length; i++) {
if (anchors[i].parentElement.id == "main-navigation" && anchors[i].innerHTML != "Home") {
... |
Fix dangling default in kwargs 'shell_cmd' | import sublime, sublime_plugin
import os
def wrapped_exec(self, *args, **kwargs):
settings = sublime.load_settings("SublimeExterminal.sublime-settings")
if settings.get('enabled') and kwargs.get('use_exterminal', True):
wrapper = settings.get('exec_wrapper')
try:
she... | import sublime, sublime_plugin
import os
def wrapped_exec(self, *args, **kwargs):
settings = sublime.load_settings("SublimeExterminal.sublime-settings")
if settings.get('enabled') and kwargs.get('use_exterminal', True):
wrapper = settings.get('exec_wrapper')
try:
she... |
Add missing column to cache table | <?php
/**
* Migration: 0
* Started: 20/05/2021
*
* @package Nails
* @subpackage module-geo-ip
* @category Database Migration
* @author Nails Dev Team
*/
namespace Nails\GeoIp\Database\Migration;
use Nails\Common\Console\Migrate\Base;
/**
* Class Migration0
*
* @package Nails\GeoIp\Database\M... | <?php
/**
* Migration: 0
* Started: 20/05/2021
*
* @package Nails
* @subpackage module-geo-ip
* @category Database Migration
* @author Nails Dev Team
*/
namespace Nails\GeoIp\Database\Migration;
use Nails\Common\Console\Migrate\Base;
/**
* Class Migration0
*
* @package Nails\GeoIp\Database\M... |
Introduce scope_types in server password policy
oslo.policy introduced the scope_type feature which can
control the access level at system-level and project-level.
- https://docs.openstack.org/oslo.policy/latest/user/usage.html#setting-scope
- http://specs.openstack.org/openstack/keystone-specs/specs/keystone/queens... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# 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 r... | # Copyright 2016 Cloudbase Solutions Srl
# All Rights Reserved.
#
# 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 r... |
Update Tags name length to 320 characters;
per https://github.com/UseMuffin/Slug/pull/25#issuecomment-225242866; | <?php
namespace Muffin\Slug\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
class TagsFixture extends TestFixture
{
public $table = 'slug_tags';
public $fields = [
'id' => ['type' => 'integer'],
'namespace' => ['type' => 'string', 'length' => 255, 'null' => true],
'slug' => ['ty... | <?php
namespace Muffin\Slug\Test\Fixture;
use Cake\TestSuite\Fixture\TestFixture;
class TagsFixture extends TestFixture
{
public $table = 'slug_tags';
public $fields = [
'id' => ['type' => 'integer'],
'namespace' => ['type' => 'string', 'length' => 255, 'null' => true],
'slug' => ['ty... |
Check for dev version of zmq per @minrk's request | #-----------------------------------------------------------------------------
# Copyright (C) 2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#------------------------------------------------... | #-----------------------------------------------------------------------------
# Copyright (C) 2010 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING.txt, distributed as part of this software.
#------------------------------------------------... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.