text stringlengths 16 4.96k | positive stringlengths 321 2.24k | negative stringlengths 310 2.21k |
|---|---|---|
Remove @version that uses svn revision as it makes useless differences when comparing svn with github
git-svn-id: 5ccfe34f605a6c2f9041ff2965ab60012c62539a@1788653 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 redundant method. Use your first lambda expression. | package pl.niekoniecznie.polar.filesystem;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ak on 07.04.15.
*/
public class PolarFile {
private final PolarFileSystem fs = new PolarFileSystem();
private final String path;
public PolarFile(String path) {
... | package pl.niekoniecznie.polar.filesystem;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;
/**
* Created by ak on 07.04.15.
*/
public class PolarFile {
private final PolarFileSystem fs = new PolarFileSystem();
private final String path;
public PolarFile(String path) {
... |
Fix browsable API in test project - add staticfiles app. | import os
DEBUG = True
BASE_DIR = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
SECRET_KEY = '_'
MIDDLEWARE_CLASSES = ()
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.conten... | import os
DEBUG = True
BASE_DIR = os.path.dirname(__file__)
DATABASES = {
'default': {
'ENGINE': 'django.db.backends.sqlite3',
'NAME': os.path.join(BASE_DIR, 'db.sqlite3'),
}
}
SECRET_KEY = '_'
MIDDLEWARE_CLASSES = ()
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.conten... |
Remove support for Python 2, bump version to 3.0.0 | #!/usr/bin/env python
from setuptools import setup
setup(
name='pycron',
version='3.0.0',
description='Simple cron-like parser, which determines if current datetime matches conditions.',
author='Kimmo Huoman',
author_email='kipenroskaposti@gmail.com',
license='MIT',
keywords='cron parser',
... | #!/usr/bin/env python
from setuptools import setup
setup(
name='pycron',
version='1.0.0',
description='Simple cron-like parser, which determines if current datetime matches conditions.',
author='Kimmo Huoman',
author_email='kipenroskaposti@gmail.com',
license='MIT',
keywords='cron parser',
... |
Set content title for photo uploader. | <?php
include_once("../includes/start.php");
$title = 'Photo Uploader';
$tpl->set('title', $title);
$tpl->set('contenttitle',
$title . "<sup style='color: green;'>Beta</sup>");
$tpl->set('js', 'uploader.js');
$tpl->set('previous', false, true);
if (isset($_GET['previous'])) {
... | <?php
include_once("../includes/start.php");
$title = 'Photo Uploader';
$tpl->set('title', $title);
$tpl->set('js', 'uploader.js');
$tpl->set('previous', false, true);
if (isset($_GET['previous'])) {
$previous = array();
$query = "SELECT `Filename`, `DateUploaded` FROM `photo_processin... |
Fix failing imports in Python 2 | from __future__ import absolute_import
import logging
import os
from django import template
from django.conf import settings
from django.contrib.staticfiles import finders
from django.utils.safestring import mark_safe
from svg.exceptions import SVGNotFound
logger = logging.getLogger(__name__)
register = template.Lib... | import logging
import os
from django import template
from django.conf import settings
from django.contrib.staticfiles import finders
from django.utils.safestring import mark_safe
from svg.exceptions import SVGNotFound
logger = logging.getLogger(__name__)
register = template.Library()
@register.simple_tag
def svg(f... |
Reimplement Blob, switch to sha256 | import json
import hashlib
from wdim import exceptions
from wdim.client import fields
from wdim.client.storable import Storable
class Blob(Storable):
HASH_METHOD = 'sha256'
_id = fields.StringField(unique=True)
data = fields.DictField()
@classmethod
async def create(cls, data):
sha = h... | import json
import hashlib
from wdim.client.storable import Storable
class Blob(Storable):
HASH_METHOD = 'sha1'
@classmethod
def _create(cls, data):
sha = hashlib(cls.HASH_METHOD, json.dumps(data))
return cls(sha, data)
@classmethod
def _from_document(cls, document):
re... |
Set default balance to be 0.0
OPEN - task 79: Create Party Module
http://github.com/DevOpsDistilled/OpERP/issues/issue/79 | package devopsdistilled.operp.server.data.entity.account;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import devopsdistilled.operp.server.data.entity.Entiti;
@MappedSuperclass
public abstract class Account e... | package devopsdistilled.operp.server.data.entity.account;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.MappedSuperclass;
import devopsdistilled.operp.server.data.entity.Entiti;
@MappedSuperclass
public abstract class Account e... |
Fix determination of article owner userID for article comment notifications
See #2649 | <?php
namespace wcf\system\user\notification\object\type;
use wcf\data\comment\Comment;
use wcf\data\comment\CommentList;
use wcf\system\user\notification\object\CommentUserNotificationObject;
use wcf\system\WCF;
/**
* Represents a comment notification object type for comments on articles.
*
* @author Joshua Ruesw... | <?php
namespace wcf\system\user\notification\object\type;
use wcf\data\comment\Comment;
use wcf\data\comment\CommentList;
use wcf\system\user\notification\object\CommentUserNotificationObject;
use wcf\system\WCF;
/**
* Represents a comment notification object type for comments on articles.
*
* @author Joshua Ruesw... |
Add test case for iter_source_code | import os
import sys
import pytest
from hypothesis_auto import auto_pytest_magic
from isort import main
from isort.settings import DEFAULT_CONFIG
auto_pytest_magic(main.sort_imports)
def test_iter_source_code(tmpdir):
tmp_file = tmpdir.join("file.py")
tmp_file.write("import os, sys\n")
assert tuple(mai... | import os
import sys
import pytest
from hypothesis_auto import auto_pytest_magic
from isort import main
auto_pytest_magic(main.sort_imports)
def test_is_python_file():
assert main.is_python_file("file.py")
assert main.is_python_file("file.pyi")
assert main.is_python_file("file.pyx")
assert not main... |
Update binding for lint test | <?php
namespace TwigBridge\Tests\Command\Lint;
use TwigBridge\Tests\Base as BridgeBase;
use Mockery as m;
use Symfony\Component\Console\Output\StreamOutput;
use TwigBridge\Command\Lint;
class Base extends BridgeBase
{
protected function getApplication(array $customConfig = [])
{
$app = parent::getApp... | <?php
namespace TwigBridge\Tests\Command\Lint;
use TwigBridge\Tests\Base as BridgeBase;
use Mockery as m;
use Symfony\Component\Console\Output\StreamOutput;
use TwigBridge\Command\Lint;
class Base extends BridgeBase
{
protected function getApplication(array $customConfig = [])
{
$app = parent::getApp... |
Fix missing page action (popup icon) on page reload
Related to #25. | import openDevToolsWindow from './openWindow';
const menus = [
{ id: 'devtools-left', title: 'To left' },
{ id: 'devtools-right', title: 'To right' },
{ id: 'devtools-bottom', title: 'To bottom' },
{ id: 'devtools-panel', title: 'In panel' }
];
let pageUrl;
let pageTab;
let shortcuts = {};
chrome.commands.get... | import openDevToolsWindow from './openWindow';
const menus = [
{ id: 'devtools-left', title: 'To left' },
{ id: 'devtools-right', title: 'To right' },
{ id: 'devtools-bottom', title: 'To bottom' },
{ id: 'devtools-panel', title: 'In panel' }
];
let pageUrl;
let pageTab;
let shortcuts = {};
chrome.commands.get... |
Allow setting schema version to -1. |
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.cli.cmd;
import java.util.Map;
import org.jsimpledb.cli.CliSession;
import org.jsimpledb.parse.ParseException;
import org.jsimpledb.util.ParseContext;
public class SetSchemaVersionCommand extends AbstractCommand {
public ... |
/*
* Copyright (C) 2015 Archie L. Cobbs. All rights reserved.
*/
package org.jsimpledb.cli.cmd;
import java.util.Map;
import org.jsimpledb.cli.CliSession;
import org.jsimpledb.parse.ParseException;
import org.jsimpledb.util.ParseContext;
public class SetSchemaVersionCommand extends AbstractCommand {
public ... |
Make `injectBabelPlugin` compatible with older webpack versions
Specifically, this is needed for people using React StoryBook. | const path = require('path');
const babelLoaderMatcher = function(rule) {
return rule.loader && rule.loader.indexOf(`babel-loader${path.sep}`) != -1;
}
const getLoader = function(rules, matcher) {
var loader;
rules.some(rule => {
return loader = matcher(rule)
? rule
: getLoader(rule.use || rule... | const path = require('path');
const babelLoaderMatcher = function(rule) {
return rule.loader && rule.loader.indexOf(`babel-loader${path.sep}`) != -1;
}
const getLoader = function(rules, matcher) {
var loader;
rules.some(rule => {
return loader = matcher(rule)
? rule
: getLoader(rule.use || rule... |
Use the JsonMixin for the names model. | from flask import url_for
from standard_names import StandardName
from ..core import db, JsonMixin
class NameJsonSerializer(JsonMixin):
__public_fields__ = set(['href', 'id', 'name', 'object', 'quantity',
'operators'])
class Name(NameJsonSerializer, db.Model):
__tablename__ = '... | #from flask_security import UserMixin, RoleMixin
from standard_names import StandardName
from ..core import db
class Name(db.Model):
__tablename__ = 'names'
__bind_key__ = 'names'
id = db.Column(db.Integer, primary_key=True)
name = db.Column(db.Text)
def __init__(self, name):
self.name =... |
Attach GitHubPolyglot to root and remove this.init() | // This file generates the client script
// Dependencies
var Fs = require("fs")
, GitHubColors = require("github-colors")
, UglifyJS = require("uglify-js")
;
const TEMPLATE = "(function (root) {\n"
+ " var GitHubColors = __GITHUB_COLORS__;\n"
+ " __GITHUB_POLYGLOT__\n"
... | // This file generates the client script
// Dependencies
var Fs = require("fs")
, GitHubColors = require("github-colors")
, UglifyJS = require("uglify-js")
;
const TEMPLATE = "(function (root) {\n"
+ " var GitHubColors = __GITHUB_COLORS__;\n"
+ " __GITHUB_POLYGLOT__\n"
... |
Allow any king of geometry to data observatory analysis | 'use strict';
var dot = require('dot');
dot.templateSettings.strip = false;
var Node = require('../node');
var TYPE = 'data-observatory-measure';
var PARAMS = {
source: Node.PARAM.NODE(Node.GEOMETRY.ANY),
final_column: Node.PARAM.STRING,
segment_name: Node.PARAM.STRING,
percent: Node.PARAM.NULLABLE(N... | 'use strict';
var dot = require('dot');
dot.templateSettings.strip = false;
var Node = require('../node');
var TYPE = 'data-observatory-measure';
var PARAMS = {
source: Node.PARAM.NODE(Node.GEOMETRY.POLYGON),
final_column: Node.PARAM.STRING,
segment_name: Node.PARAM.STRING,
percent: Node.PARAM.NULLAB... |
Remove mention of user data in bt test | var bt = require('../src/bluetooth').Bluetooth;
var remote_addr = "<BT device address";
function findDevice(item) {
return item.address == remote_addr;
}
bt.on('started', function() {
console.log('onstarted');
bt.start_scan();
});
bt.on('scan', function(device) {
console.log('onscan: '+ device);
var device = J... | var bt = require('../src/bluetooth').Bluetooth;
var remote_addr = "A4:E4:B8:6C:38:B9";
function findDevice(item) {
return item.address == remote_addr;
}
bt.on('started', function() {
console.log('onstarted');
bt.start_scan();
});
bt.on('scan', function(device) {
console.log('onscan: '+ device);
var device = JS... |
Add homebrew redux middleware to catch all errors.. |
import {createStore, applyMiddleware, compose} from 'redux'
import {electronEnhancer} from 'redux-electron-enhancer'
import createLogger from 'redux-cli-logger'
import createSagaMiddleware from 'redux-saga'
import sagas from '../sagas'
import reducer from '../reducers'
import env from '../env'
const crashGetter = (s... |
import {createStore, applyMiddleware, compose} from 'redux'
import {electronEnhancer} from 'redux-electron-enhancer'
import createLogger from 'redux-cli-logger'
import createSagaMiddleware from 'redux-saga'
import sagas from '../sagas'
import reducer from '../reducers'
import env from '../env'
const middleware = [
... |
Increase the timeout for connecting to html5test.com | <?php
namespace HTML5test\Automate;
use GuzzleHttp\Client;
class HTML5test {
public function __construct($config) {
$this->config = $config;
$this->client = new Client([
'base_uri' => $this->config['endpoint'],
'timeout' => 20.0
]);
}
public function ... | <?php
namespace HTML5test\Automate;
use GuzzleHttp\Client;
class HTML5test {
public function __construct($config) {
$this->config = $config;
$this->client = new Client([
'base_uri' => $this->config['endpoint'],
'timeout' => 5.0
]);
}
public function g... |
Make waiting message more precise | <?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once __DIR__ . '/../vendor/autoload.php';
$connected = false;
while (!$connected) {
try {
$app = \eCampApp::CreateSetup();
$sm = $app->getServiceManager();
/** @var \Doctrine\ORM\EntityManager $em */
$em = $sm->get... | <?php
error_reporting(E_ALL);
ini_set('display_errors', 1);
require_once __DIR__ . '/../vendor/autoload.php';
$connected = false;
while (!$connected) {
try {
$app = \eCampApp::CreateSetup();
$sm = $app->getServiceManager();
/** @var \Doctrine\ORM\EntityManager $em */
$em = $sm->get... |
Load statics like posts and pages. Documentation. | #!/usr/bin/python3
import argparse, sys
from src import Configurator, Builder, Loader
def main():
""" Parse command line arguments and execute passed subcommands. """
# Parse subcommand
parser = argparse.ArgumentParser(description='Pythonic static sites generator')
subparsers = parser.add_subparsers... | #!/usr/bin/python3
import argparse, sys
from src import Configurator, Builder, Loader
def main():
""" Parse command line arguments and execute passed subcommands. """
# Parse subcommand
parser = argparse.ArgumentParser(description='Pythonic static sites generator')
subparsers = parser.add_subparsers... |
Set response content type of a json response to application/json | import os
import json
from flask import Flask
from flask import make_response
from flask import request
from flask import json
import services
app = Flask(__name__)
digitransitAPIService = services.DigitransitAPIService()
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/test')
def digit... | import os
import json
from flask import Flask
from flask import request
from flask import json
import services
app = Flask(__name__)
digitransitAPIService = services.DigitransitAPIService()
@app.route('/')
def hello_world():
return 'Hello World!'
@app.route('/test')
def digitransit_test():
return json.d... |
Throw exception if no login credentials are provided | #
# HamperAuthenticator is the class to handle the authentication part of the provisioning portal.
# Instantiate with the email and password you want, it'll pass back the cookie jar if successful,
# or an error message on failure
#
from helpers.driver import HamperDriver
from helpers.error import HamperError
from term... | #
# HamperAuthenticator is the class to handle the authentication part of the provisioning portal.
# Instantiate with the email and password you want, it'll pass back the cookie jar if successful,
# or an error message on failure
#
from helpers.driver import HamperDriver
from helpers.error import HamperError
from term... |
Convert exceptions in a type-safe manner to string before string cats | """This module is about testing the logger."""
import sys
from unittest import TestCase
LOGGER = sys.modules["Rainmeter.logger"]
class TestFunctions(TestCase):
"""Test class wrapper using unittest."""
# pylint: disable=W0703; This is acceptable since we are testing it not failing
def test_info(self):... | """This module is about testing the logger."""
import sys
from unittest import TestCase
LOGGER = sys.modules["Rainmeter.logger"]
class TestFunctions(TestCase):
"""Test class wrapper using unittest."""
# pylint: disable=W0703; This is acceptable since we are testing it not failing
def test_info(self):... |
Improve the code, return most collisions. Work on hex strings. | from matasano.util.converters import hex_to_bytestr
if __name__ == "__main__":
chal_file = open("matasano/data/c8.txt", 'r');
coll_count = {}
for idx, line in enumerate(chal_file):
count = 0
ct = line[:-1]
for i in range(0, len(ct), 32):
for j in range(i+32, len(ct), 3... | from matasano.util.converters import hex_to_bytestr
from Crypto.Cipher import AES
if __name__ == "__main__":
chal_file = open("matasano/data/c8.txt", 'r');
for line in chal_file:
ct = hex_to_bytestr(line[:-1])
for i in range(0, len(ct), 16):
for j in range(i+16, len(ct), 16):
... |
Allow user to be retrieved from JWT with passport (req.user) | var passport = require('passport');
var passportJWT = require('passport-jwt');
var ExtractJwt = passportJWT.ExtractJwt;
var Strategy = passportJWT.Strategy;
var jwtSecret = require('./localvars.js').jwtSecret;
var User = require('../../db/models/User');
// passport-jwt config
var cfg = {
jwtSecret: jwtSecret,
jwtS... | var passport = require('passport');
var passportJWT = require('passport-jwt');
var ExtractJwt = passportJWT.ExtractJwt;
var Strategy = passportJWT.Strategy;
var jwtSecret = require('./localvars.js').jwtSecret;
// passport-jwt config
var cfg = {
jwtSecret: jwtSecret,
jwtSession: { session: false }
};
var params = ... |
Add todo for integrating shariff. | export default class Home {
render() {
return (
<footer className="pure-u-2-3 center">
<ul>
<li>
<div className="shariff" data-theme="grey"
data-services="["twitter","googleplus","facebook","mail","info"]"></d... | export default class Home {
render() {
return (
<footer className="pure-u-2-3 center">
<ul>
<li>
<div className="shariff" data-theme="grey"
data-services="["twitter","googleplus","facebook","mail","info"]"></d... |
Update deps to use new UI helpers | Package.describe({
"summary": "Add feature flagging to Meteor"
});
Package.on_use(function (api) {
api.use('coffeescript', ['server', 'client']);
api.use(['deps','ui','templating', 'jquery'], 'client');
api.use('underscore', 'server');
api.use('accounts-base', ['client'])
api.add_files('server/... | Package.describe({
"summary": "Add feature flagging to Meteor"
});
Package.on_use(function (api) {
api.use('coffeescript', ['server', 'client']);
api.use(['deps','handlebars','jquery'], 'client');
api.use('underscore', 'server');
api.use('accounts-base', ['client'])
api.add_files('server/server... |
Clear the transaction after committing it | <?php
namespace PhpInPractice\Matters\Aggregate\Transaction;
use EventStore\EventStoreInterface;
use EventStore\WritableEvent;
use EventStore\WritableEventCollection;
use PhpInPractice\Matters\Aggregate\Transaction as TransactionInterface;
class SingleStream implements TransactionInterface
{
/** @var EventStoreI... | <?php
namespace PhpInPractice\Matters\Aggregate\Transaction;
use EventStore\EventStoreInterface;
use EventStore\WritableEvent;
use EventStore\WritableEventCollection;
use PhpInPractice\Matters\Aggregate\Transaction as TransactionInterface;
class SingleStream implements TransactionInterface
{
/**
* @var Even... |
fix(not-found-component): Make menu available in not-found routes
Move NotFound component back into App children | import React from 'react';
import {render} from 'react-dom';
import { Router, Route, applyRouterMiddleware} from 'react-router';
let history;
if(typeof process !== "undefined" && process.env.NODE_ENV === "production") {
history = require('react-router/lib/hashHistory');
} else {
history = require('react-router/lib/... | import React from 'react';
import {render} from 'react-dom';
import { Router, Route, applyRouterMiddleware} from 'react-router';
let history;
if(typeof process !== "undefined" && process.env.NODE_ENV === "production") {
history = require('react-router/lib/hashHistory');
} else {
history = require('react-router/lib/... |
SDC-6927: Add additional data formats to DataParser processor
Added all data formats that seems "plausible" for a processor. E.g.
all of them except of:
* SDC_JSON
* BINARY
* TEXT
* DATAGRAM
* WHOLE_FILE
Change-Id: Ibbc048f7171d34141715a84e29300b0d2fa364ff
Reviewed-on: https://review.streamsets.net/9604
Tested-by: S... | /**
* Copyright 2017 StreamSets 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... | /**
* Copyright 2017 StreamSets 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agree... |
Fix calendarId not being returned in response | package com.google.step.coffee.data;
import com.google.appengine.api.datastore.*;
import com.google.step.coffee.entity.Event;
public class EventStore {
private DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
/**
* Saves the event to the database. Returns an <code>Event</code>
* ... | package com.google.step.coffee.data;
import com.google.appengine.api.datastore.*;
import com.google.step.coffee.entity.Event;
public class EventStore {
private DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();
/**
* Saves the event to the database. Returns an <code>Event</code>
* ... |
Add plain Python 2 and 3 to package metadata | import os
import setuptools
setuptools.setup(
name='factory_djoy',
version='0.5',
description='Factories for Django, creating valid instances every time',
url='http://github.com/jamescooke/factory_djoy',
author='James Cooke',
author_email='github@jamescooke.info',
license='MIT',
pac... | import os
import setuptools
setuptools.setup(
name='factory_djoy',
version='0.5',
description='Factories for Django, creating valid instances every time',
url='http://github.com/jamescooke/factory_djoy',
author='James Cooke',
author_email='github@jamescooke.info',
license='MIT',
pac... |
Use Heroku instance of webapp if not in DEBUG mode. | import logging
import logging.handlers
DEBUG = True
LOG_FORMAT = '[%(asctime)s: %(levelname)s] %(message)s'
if DEBUG:
LOG_LEVEL = logging.DEBUG
else:
LOG_LEVEL = logging.WARN
LOG_COLOR = True
PORT = 8000
TORNADO_SETTINGS = {}
TORNADO_SETTINGS['debug'] = DEBUG
TORNADO_SETTINGS['xsrf_cookies'] = False
TORNADO... | import logging
import logging.handlers
DEBUG = True
LOG_FORMAT = '[%(asctime)s: %(levelname)s] %(message)s'
if DEBUG:
LOG_LEVEL = logging.DEBUG
else:
LOG_LEVEL = logging.WARN
LOG_COLOR = True
PORT = 8000
TORNADO_SETTINGS = {}
TORNADO_SETTINGS['debug'] = DEBUG
TORNADO_SETTINGS['xsrf_cookies'] = False
TORNADO... |
Add a todo item to run() | import argparse
import importlib
import logging
import os
logger = logging.getLogger(__name__)
description = "An automated grading tool for programming assignments."
subcommands = {
"init": "grader.init",
"new": "grader.new",
"image": "grader.image",
"grade": "grader.grade"
}
def run():
"""Scri... | import argparse
import importlib
import logging
import os
logger = logging.getLogger(__name__)
description = "An automated grading tool for programming assignments."
subcommands = {
"init": "grader.init",
"new": "grader.new",
"image": "grader.image",
"grade": "grader.grade"
}
def run():
# Confi... |
Mark resuable uploads as broken if they are | """Download from urls any uploads from outside sources"""
import logging
from django.utils.timezone import now
from django.core.management.base import BaseCommand, CommandError
from apps.uploads.models import DropboxUploadFile, ManualUploadFile, ResumableUploadFile
LOGGER = logging.getLogger('apps.uploads')
class Co... |
import logging
LOGGER = logging.getLogger('apps.uploads')
from django.core.management.base import BaseCommand, CommandError
from apps.uploads.models import DropboxUploadFile, ManualUploadFile
class Command(BaseCommand):
help = """Regular run of new dropbox links:
manage.py process_uploads
"""
def... |
Mark fields except appropriateness as readonly | from import_export import fields, resources
from .models import Review
class ReviewResource(resources.ModelResource):
reviewer = fields.Field(
attribute='reviewer__email',
readonly=True,
)
proposal = fields.Field(
attribute='proposal__title',
readonly=True,
)
stag... | from import_export import fields, resources
from .models import Review
class ReviewResource(resources.ModelResource):
reviewer = fields.Field(
attribute='reviewer__email',
readonly=True,
)
proposal = fields.Field(
attribute='proposal__title',
readonly=True,
)
cla... |
Fix virtual scrolling for table with local data. | import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { getContext, mapProps, compose } from 'recompose';
import { visibleRowIdsSelector, classNamesForComponentSelector, stylesForComponentSelector } from '../selectors/localSelectors';
const ComposedTableBodyContainer = OriginalCompon... | import React, { PropTypes } from 'react';
import { connect } from 'react-redux';
import { getContext, mapProps, compose } from 'recompose';
import { visibleRowIdsSelector, classNamesForComponentSelector, stylesForComponentSelector } from '../selectors/localSelectors';
const ComposedTableBodyContainer = OriginalCompon... |
Disable test untestable without x server | package org.jrebirth.af.core.command.basic.multi;
import org.jrebirth.af.core.command.basic.BasicCommandTest;
import org.junit.Ignore;
import org.junit.Test;
@Ignore("JavaFX can't be run in headless mode yet")
public class MultiCommandTest extends BasicCommandTest {
@Test
public void sequentialTe... | package org.jrebirth.af.core.command.basic.multi;
import org.jrebirth.af.core.command.basic.BasicCommandTest;
import org.junit.Test;
//@Ignore("JavaFX can't be run in headless mode yet")
public class MultiCommandTest extends BasicCommandTest {
@Test
public void sequentialTest1() {
System.... |
Add missing file level doc-block | <?php
/**
* Zend Framework (http://framework.zend.com/)
*
* @link http://github.com/zendframework/zf2 for the canonical source repository
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com)
* @license http://framework.zend.com/license/new-bsd New BSD License
*/
namespace ... | <?php
namespace Zend\Config;
use Zend\ServiceManager\AbstractPluginManager;
class WriterPluginManager extends AbstractPluginManager
{
protected $invokableClasses = array(
'php' => 'Zend\Config\Writer\PhpArray',
'ini' => 'Zend\Config\Writer\Ini',
'json' => 'Zend\Config\Writer\Json',
... |
Fix uglify script no longer running. | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Project settings
simg: {
// configurable paths
scriptPath: 'src',
distPath: 'dist',
bowerPath: 'lib',
testPath: 'test'
},
pkg: grunt.file.readJSON('package.json'),
uglify: {
... | module.exports = function(grunt) {
// Project configuration.
grunt.initConfig({
// Project settings
simg: {
// configurable paths
scriptPath: 'src',
distPath: 'dist',
bowerPath: 'lib',
testPath: 'test'
},
pkg: grunt.file.readJSON('package.json'),
uglify: {
... |
Change typo in inactivate provider service | package com.smcpartners.shape.usecases.inactivate_provider;
import com.smcpartners.shape.shared.dto.common.BooleanValueDTO;
import com.smcpartners.shape.shared.dto.shape.request.IntEntityIdRequestDTO;
import com.smcpartners.shape.shared.usecasecommon.UseCaseException;
import javax.ws.rs.Consumes;
import javax.ws.rs.P... | package com.smcpartners.shape.usecases.inactivate_provider;
import com.smcpartners.shape.shared.dto.common.BooleanValueDTO;
import com.smcpartners.shape.shared.dto.shape.request.IntEntityIdRequestDTO;
import com.smcpartners.shape.shared.usecasecommon.UseCaseException;
import javax.ws.rs.Consumes;
import javax.ws.rs.P... |
Load connectors before saving operator | /* global App */
App.OperatorController = Ember.ObjectController.extend({
fullType: function() {
return this.get('package') + '::' + this.get('type');
}.property('type', 'package'),
statusLabel: function() {
var status = this.get('model').get('status');
if (status === 'none')
return 'Not init... | /* global App */
App.OperatorController = Ember.ObjectController.extend({
fullType: function() {
return this.get('package') + '::' + this.get('type');
}.property('type', 'package'),
statusLabel: function() {
var status = this.get('model').get('sta... |
Add missing Station super() call | import { EventEmitter } from 'events'
import PouchDB from 'pouchdb'
import Serial from '../serial'
import Classifier from './classifier'
import { parser, dataHandler } from './data-handler'
/**
* Handles everything a Station should.
* Brings Serial, data parsing and database saving together.
*/
export default class... | import { EventEmitter } from 'events'
import PouchDB from 'pouchdb'
import Serial from '../serial'
import Classifier from './classifier'
import { parser, dataHandler } from './data-handler'
/**
* Handles everything a Station should.
* Brings Serial, data parsing and database saving together.
*/
export default class... |
Add modal for ipad links | <?php
function ipadPopUpScript(){
?>
jQuery("a[href$='http://bullettstoreat.wpengine.com/p/ipad-magazine-subscription/']").attr('data-reveal-id', 'ipadPopUp');
<?php
}
function ipadPopUpModal(){
?>
jQuery('#colophon').after('<div id="ipadPopUp" class="reveal-modal"><h2>We'+
'are opening a new tab.</h2><p class... | <?php
function ipadPopUpScript(){
?>
jQuery("a[href$='http://bullettstoreat.wpengine.com/p/ipad-magazine-subscription/']").attr('data-reveal-id', 'ipadPopUp');
<?php
}
function ipadPopUpModal(){
?>
jQuery('#colophon').after('<div id="ipadPopUp" class="reveal-modal"><h2>We'+
'are opening a new tab.</h2><p class... |
Add example text to CLI --help | #!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var shelfiesAmazonLinker = require('./');
var argv = process.argv.slice(2);
var copypaste = require('copy-paste').silent();
var chalk = require('chalk');
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Examp... | #!/usr/bin/env node
'use strict';
var pkg = require('./package.json');
var shelfiesAmazonLinker = require('./');
var argv = process.argv.slice(2);
var copypaste = require('copy-paste').silent();
var chalk = require('chalk');
function help() {
console.log([
'',
' ' + pkg.description,
'',
' Examp... |
Fix the order issue of menu items | console.log("menu-fill");
var menu_env = $("#menu-env");
function createLinkItem (item) {
var _a = $("<a/>", { href: item.link });
$("<i/>", { class: item.icon }).appendTo(_a);
$("<span/>", { text: " " + item.name }).appendTo(_a);
return _a;
}
function createSingleLevelMenuItem (item) {
return $("<li/>").... | console.log("menu-fill");
var menu_env = $("#menu-env");
var item1 = menu_env_data[0];
var item2 = menu_env_data[1];
function createLinkItem (item) {
var _a = $("<a/>", { href: item.link });
$("<i/>", { class: item.icon }).appendTo(_a);
$("<span/>", { text: " " + item.name }).appendTo(_a);
return _a;
}
fu... |
Remove kansface repo from input. | package floobits;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.InputValidator;
import com.intellij.openapi... | package floobits;
import java.net.MalformedURLException;
import java.net.URL;
import javax.swing.JFrame;
import javax.swing.JOptionPane;
import com.intellij.openapi.actionSystem.AnAction;
import com.intellij.openapi.actionSystem.AnActionEvent;
import com.intellij.openapi.ui.InputValidator;
import com.intellij.openapi... |
Remove manual alias because it is added automatically with config plugin | <?php
/**
* HiDev plugin for license generation.
*
* @link https://github.com/hiqdev/hidev-license
* @package hidev-license
* @license BSD-3-Clause
* @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
*/
return [
'controllerMap' => [
'LICENSE' => [
'class' => \hidev... | <?php
/**
* HiDev plugin for license generation.
*
* @link https://github.com/hiqdev/hidev-license
* @package hidev-license
* @license BSD-3-Clause
* @copyright Copyright (c) 2015-2017, HiQDev (http://hiqdev.com/)
*/
return [
'controllerMap' => [
'LICENSE' => [
'class' => \hidev... |
Fix test error when coverage is not installed | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Simon Jagoe
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import, unicode_literals
try:
import coverage
from ..cover... | # -*- coding: utf-8 -*-
# Copyright (c) 2013-2014 Simon Jagoe
# All rights reserved.
#
# This software may be modified and distributed under the terms
# of the 3-clause BSD license. See the LICENSE.txt file for details.
from __future__ import absolute_import, unicode_literals
try:
import coverage
except ImportErr... |
Change != to !=== in Rule.channelMatches | /* jshint node: true */
'use strict';
module.exports = Rule;
function Rule(configRule) {
for (var property in configRule) {
if (configRule.hasOwnProperty(property)) {
this[property] = configRule[property];
}
}
}
// This expects just the rawMessage from a SlackTextMessage.
Rule.prototype.match = fun... | /* jshint node: true */
'use strict';
module.exports = Rule;
function Rule(configRule) {
for (var property in configRule) {
if (configRule.hasOwnProperty(property)) {
this[property] = configRule[property];
}
}
}
// This expects just the rawMessage from a SlackTextMessage.
Rule.prototype.match = fun... |
Add constructor that does not require id. | /*
* Copyright 2016 Attribyte, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... | /*
* Copyright 2016 Attribyte, 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to i... |
Revert "tests: Don't redefine PYTHONPATH"
This reverts commit 6be5cc0f1b1d34521fa8d8c91ca1cc2a96a65b69. | from __future__ import unicode_literals
import os
import subprocess
import sys
import unittest
import mopidy
class HelpTest(unittest.TestCase):
def test_help_has_mopidy_options(self):
mopidy_dir = os.path.dirname(mopidy.__file__)
args = [sys.executable, mopidy_dir, '--help']
process = su... | from __future__ import unicode_literals
import os
import subprocess
import sys
import unittest
import mopidy
class HelpTest(unittest.TestCase):
def test_help_has_mopidy_options(self):
mopidy_dir = os.path.dirname(mopidy.__file__)
args = [sys.executable, mopidy_dir, '--help']
python_path ... |
Fix missing new line symbol for last line in notebook cell | # coding: utf-8
import sys, getopt
import os
import json
import datetime
from subprocess import call
current_date = str(datetime.datetime.now()).replace(' ', '!')
output_file_name = './tmp_itorch_exec-'+current_date+'.lua'
if __name__ == "__main__":
if len(sys.argv) > 0:
input_file = open(sys.argv[1], 'r')
wit... | # coding: utf-8
import sys, getopt
import os
import json
import datetime
from subprocess import call
current_date = str(datetime.datetime.now()).replace(' ', '!')
output_file_name = './tmp_itorch_exec-'+current_date+'.lua'
if __name__ == "__main__":
if len(sys.argv) > 0:
input_file = open(sys.argv[1], 'r')
wit... |
Revert "adding JSON to the list of extensions that should be compressed"
This reverts commit c90513519febf8feeea78b06da6a467bb1085948. | 'use strict';
var es = require('event-stream'),
path = require('path'),
zlib = require('zlib');
var compressibles = [
'.js',
'.css',
'.html'
];
function isCompressibleFile( file ) {
var ext = path.extname( file.path ).toLowerCase();
return ( compressibles.indexOf( ext ) > -1 );
}
module.exports = function() ... | 'use strict';
var es = require('event-stream'),
path = require('path'),
zlib = require('zlib');
var compressibles = [
'.js',
'.json',
'.css',
'.html'
];
function isCompressibleFile( file ) {
var ext = path.extname( file.path ).toLowerCase();
return ( compressibles.indexOf( ext ) > -1 );
}
module.exports = f... |
Change string formatting to use format | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... | from django.db import models
from .. import abstract_models
from ..manager import PageManager
class PageType(abstract_models.AbstractPageType):
class Meta:
app_label = 'fancypages'
class VisibilityType(abstract_models.AbstractVisibilityType):
class Meta:
app_label = 'fancypages'
class Fan... |
Move back session storage creation | import { hot } from 'react-hot-loader/root';
import React from 'react';
import { ProtonApp, useAuthentication } from 'react-components';
import sentry from 'proton-shared/lib/helpers/sentry';
import * as config from './config';
import PrivateApp from './PrivateApp';
import PublicApp from './PublicApp';
import './app.... | import { hot } from 'react-hot-loader/root';
import React from 'react';
import { ProtonApp, useAuthentication, useInstance } from 'react-components';
import createSecureSessionStorage from 'proton-shared/lib/createSecureSessionStorage';
import { MAILBOX_PASSWORD_KEY, UID_KEY } from 'proton-shared/lib/constants';
import... |
Add explicit language specifier to test.
git-svn-id: 4c4cc70b1ef44ba2b7963015e681894188cea27e@354048 91177308-0d34-0410-b5e6-96231b3b80d8 | """Test that importing modules in C++ works as expected."""
from __future__ import print_function
from distutils.version import StrictVersion
import unittest2
import os
import time
import lldb
import platform
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import ll... | """Test that importing modules in C++ works as expected."""
from __future__ import print_function
from distutils.version import StrictVersion
import unittest2
import os
import time
import lldb
import platform
from lldbsuite.test.decorators import *
from lldbsuite.test.lldbtest import *
from lldbsuite.test import ll... |
Remove --dev from composer install.
composer install installs dev dependencies by default. | #!/usr/bin/env php
<?php
chdir(__DIR__);
$returnStatus = null;
passthru('composer install', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
$phpcsCommand = './vendor/bin/phpcs --standard=' . __DIR__ . '/vendor/dominionenterprises/dws-coding-standard/DWS -n src tests *.php';
passthru($phpcsCommand, $returnSt... | #!/usr/bin/env php
<?php
chdir(__DIR__);
$returnStatus = null;
passthru('composer install --dev', $returnStatus);
if ($returnStatus !== 0) {
exit(1);
}
$phpcsCommand = './vendor/bin/phpcs --standard=' . __DIR__ . '/vendor/dominionenterprises/dws-coding-standard/DWS -n src tests *.php';
passthru($phpcsCommand, $re... |
Support `thread_ts` parameter for Incoming Webhook | package slack
import (
"bytes"
"encoding/json"
"net/http"
"github.com/pkg/errors"
)
type WebhookMessage struct {
Username string `json:"username,omitempty"`
IconEmoji string `json:"icon_emoji,omitempty"`
IconURL string `json:"icon_url,omitempty"`
Channel string `json:"cha... | package slack
import (
"bytes"
"encoding/json"
"net/http"
"github.com/pkg/errors"
)
type WebhookMessage struct {
Username string `json:"username,omitempty"`
IconEmoji string `json:"icon_emoji,omitempty"`
IconURL string `json:"icon_url,omitempty"`
Channel string `json:"cha... |
Add animation to toggle presentation video block | (function(){
generateHTML();
$(document).ready(function(){
$('a.node.expanded').each(expandListToggle);
$('.my-name').fadeIn("slow");
$('.headlogolinks a').hover(fadeInLink, fadeOutLink);
$('.menu-button').on('click', showMainContent);
$('a.node').on('click', expandListToggle);
$('.video-li... | (function(){
generateHTML();
$(document).ready(function(){
$('a.node.expanded').each(expandListToggle);
$('.my-name').fadeIn("slow");
$('.headlogolinks a').hover(fadeInLink, fadeOutLink);
$('.menu-button').on('click', showMainContent);
$('a.node').on('click', expandListToggle);
$('.about-me... |
Add error listeners to socket server | var ws = require('nodejs-websocket');
/**
* Triggers when connections is established
* @param connection
* @private
*/
function _onConnection(connection) {
console.log('Connections is established');
connection.on('error', console.error.bind(console.error));
connection.on('close', console.log.bind(console.log... | var ws = require('nodejs-websocket');
/**
* Triggers when connections is established
* @param connection
* @private
*/
function _onConnection(connection) {
connection.on('close', console.log.bind(console.log, 'Connection is closed -'));
}
/**
* Returns Server
* @param {String} port
* @returns {Object}
*/
fu... |
Fix an issue with parameter validation | var isFunction = require('lodash.isfunction');
var joi = require('joi');
var pc = require('pascal-case');
/* Public */
function attach(schema) {
var attachments = {};
schema &&
schema._inner &&
schema._inner.children &&
schema._inner.children.forEach(function (child) {
attachments[pc(child.key)] = {
... | var isFunction = require('lodash.isfunction');
var joi = require('joi');
var pc = require('pascal-case');
/* Public */
function attach(schema) {
var attachments = {};
schema &&
schema._inner &&
schema._inner.children &&
schema._inner.children.forEach(function (child) {
attachments[pc(child.key)] = {
... |
Set frameset to 100%,0% on load. | function receiveMessage(event) {
var commentPath,
frameURL;
// get url of comment
commentPath = event.data.commentURL;
frameURL = "https://news.ycombinator.com/" + commentPath;
showComments( frameURL )
}
var showComments = function( URL ) {
var commentFrame,
frameset;
frameset = document.querySelector( ... | function receiveMessage(event) {
var commentPath,
frameURL;
// get url of comment
commentPath = event.data.commentURL;
frameURL = "https://news.ycombinator.com/" + commentPath;
showComments( frameURL )
}
var showComments = function( URL ) {
var commentFrame,
frameset;
frameset = document.querySelector( ... |
Update test depending on environment (BO or FO) | <?php
namespace OpenOrchestra\ModelBundle\Tests\Functional\Repository;
use OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* Class ContentTypeRepositoryTest
*
* @group integrationTest
*/
class ContentTypeRepositoryTest extends Ke... | <?php
namespace OpenOrchestra\ModelBundle\Tests\Functional\Repository;
use OpenOrchestra\ModelInterface\Repository\ContentTypeRepositoryInterface;
use Symfony\Bundle\FrameworkBundle\Test\KernelTestCase;
/**
* Class ContentTypeRepositoryTest
*
* @group integrationTest
*/
class ContentTypeRepositoryTest extends Ke... |
Remove test for adding feedback | # -*- coding: utf-8 -*-
from django.test import TestCase, client
from .models import Feedback
client = client.Client()
class FeedbackTest(TestCase):
def test_add_feedback(self):
pass
# before_add = Feedback.objects.count()
# response = client.post('/feedback/add/', {
# 'name... | # -*- coding: utf-8 -*-
from django.test import TestCase, client
from .models import Feedback
client = client.Client()
class FeedbackTest(TestCase):
def test_add_feedback(self):
before_add = Feedback.objects.count()
response = client.post('/feedback/add/', {
'name': 'Пандо Пандев',
... |
Use managed transfer for uploading | import pandas as pd
import gzip
import boto3
import re
import io
def default_key_map(key):
return re.sub('_input', '_output', key)
class S3Dest():
def __init__(self, key_map=default_key_map):
self.key_map = key_map
def skip_keys(self, bucket, source_prefix):
s3 = boto3.resource('s3')
... | import pandas as pd
import gzip
import boto3
import re
def default_key_map(key):
return re.sub('_input', '_output', key)
class S3Dest():
def __init__(self, key_map=default_key_map):
self.key_map = key_map
def skip_keys(self, bucket, source_prefix):
s3 = boto3.resource('s3')
obj... |
Make search parameter match template parameter name | from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
from wagtail.core.models import Page
from wagtail.search.models import Query
def search(request):
search_query = request.GET.get('q', None)
page = request.GET.get('page', 1)
# Search
if searc... | from django.core.paginator import EmptyPage, PageNotAnInteger, Paginator
from django.shortcuts import render
from wagtail.core.models import Page
from wagtail.search.models import Query
def search(request):
search_query = request.GET.get('query', None)
page = request.GET.get('page', 1)
# Search
if s... |
Add missing package name and bump version | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.5.1',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='Hous... | from setuptools import setup
def readme():
with open('README.rst') as f:
return f.read()
setup(name='housecanary',
version='0.5',
description='Client Wrapper for the HouseCanary API',
long_description=readme(),
url='http://github.com/housecanary/hc-api-python',
author='HouseC... |
Add comment to new safe_execute function | #!/usr/bin/env python
from time import sleep, time
from fabric.api import execute, task, env
import app_config
import sys
import traceback
def safe_execute(*args, **kwargs):
"""
Wrap execute() so that all exceptions are caught and logged.
"""
try:
execute(*args, **kwargs)
except:
... | #!/usr/bin/env python
from time import sleep, time
from fabric.api import execute, task, env
import app_config
import sys
import traceback
def safe_execute(*args, **kwargs):
try:
execute(*args, **kwargs)
except:
print "ERROR [timestamp: %d]: Here's the traceback" % time()
ex_type, ex,... |
parse(): Allow passing a string since we're just going to .read() the FH | #!/usr/bin/env python
import re
import datetime
from collections import namedtuple
SUBTITLE_REGEX = re.compile(r'''\
(\d+)
(\d+:\d+:\d+,\d+) --> (\d+:\d+:\d+,\d+)
(.+)
''')
Subtitle = namedtuple('Subtitle', ['index', 'start', 'end', 'content'])
def parse_time(time):
hours, minutes, seconds, milliseconds = map(... | #!/usr/bin/env python
import re
import datetime
from collections import namedtuple
SUBTITLE_REGEX = re.compile(r'''\
(\d+)
(\d+:\d+:\d+,\d+) --> (\d+:\d+:\d+,\d+)
(.+)
''')
Subtitle = namedtuple('Subtitle', ['index', 'start', 'end', 'content'])
def parse_time(time):
hours, minutes, seconds, milliseconds = map(... |
Clarify variable naming for below | 'use strict'
var EventEmitter = require('events').EventEmitter
var dot = require('dot-prop')
var Symbol = require('es6-symbol')
var traverse = require('traverse')
module.exports = EventsTree
var EVENTS = Symbol('events')
function EventsTree () {
this.tree = {}
}
EventsTree.prototype.node = function node (path) {... | 'use strict'
var EventEmitter = require('events').EventEmitter
var dot = require('dot-prop')
var Symbol = require('es6-symbol')
var traverse = require('traverse')
module.exports = EventsTree
var EVENTS = Symbol('events')
function EventsTree () {
this.tree = {}
}
EventsTree.prototype.node = function node (path) {... |
Fix up reference to moved module. | compiler.modulator.compiled = def(
[
ephox.bolt.kernel.modulator.compiled,
compiler.tools.io
],
function (delegate, io) {
var create = function () {
var instance = delegate.create.apply(null, arguments);
var can = function () {
return instance.can.apply(null, arguments);
};... | compiler.modulator.compiled = def(
[
ephox.bolt.module.modulator.compiled,
compiler.tools.io
],
function (delegate, io) {
var create = function () {
var instance = delegate.create.apply(null, arguments);
var can = function () {
return instance.can.apply(null, arguments);
};... |
Use better type definitions for the array API custom types | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
__all__ = ['Array', 'Device', 'Dtype', 'SupportsDLPac... | """
This file defines the types for type annotations.
These names aren't part of the module namespace, but they are used in the
annotations in the function signatures. The functions in the module are only
valid for inputs that match the given type annotations.
"""
__all__ = ['Array', 'Device', 'Dtype', 'SupportsDLPac... |
Fix file not found error on directory | import subprocess
from functools import wraps
import os
extensions = {}
def extension(f):
# keep unwrapped function
unwrapped = f
@wraps(f)
def wrapper(**kwargs):
wrapper.settings = dict(kwargs)
return unwrapped
extensions[f.__name__] = wrapper
return wrapper
@extension
de... | import subprocess
from functools import wraps
import os
extensions = {}
def extension(f):
# keep unwrapped function
unwrapped = f
@wraps(f)
def wrapper(**kwargs):
wrapper.settings = dict(kwargs)
return unwrapped
extensions[f.__name__] = wrapper
return wrapper
@extension
de... |
Add failing test case regarding input.value($Element) | describe("value", function() {
"use strict";
var div, input;
beforeEach(function() {
div = DOM.create("div>a+a");
input = DOM.create("input[value=foo]");
});
it("should replace child element(s) from node with provided element", function() {
expect(div[0].childNodes.length).toBe(2);
expect(d... | describe("value", function() {
"use strict";
var div, input;
beforeEach(function() {
div = DOM.create("div>a+a");
input = DOM.create("input[value=foo]");
});
it("should replace child element(s) from node with provided element", function() {
expect(div[0].childNodes.length).toBe(2);
expect(d... |
Update quote on the Blog page | <div class="page-header">
<h2 class="text-center text-orange">
<?php echo i4web_title(); ?>
</h2>
<?php
if ( is_post_type_archive('i4web_portfolio') ){ //If the page displayed is the portfolio archive of the Porftolio Custom Post Type
echo '<p class="text-center">Here you will find examples of my work... | <div class="page-header">
<h2 class="text-center text-orange">
<?php echo i4web_title(); ?>
</h2>
<?php
if ( is_post_type_archive('i4web_portfolio') ){ //If the page displayed is the portfolio archive of the Porftolio Custom Post Type
echo '<p class="text-center">Here you will find examples of my work... |
fix: Update data explorations data sets to samples | # importing modules/ libraries
import pandas as pd
# loading the data
aisles_df = pd.read_csv('Data/aisles.csv')
print(aisles_df.head())
departments_df = pd.read_csv('Data/departments.csv')
print(departments_df.head())
order_products__prior_df = pd.read_csv('Data/order_products__prior_sample.csv')
print(order_produc... | # importing modules/ libraries
import pandas as pd
import random
# loading the data
aisles_df = pd.read_csv('Data/aisles.csv')
print(aisles_df.head())
departments_df = pd.read_csv('Data/departments.csv')
print(departments_df.head())
#n = 32434489
#s = round(0.1 * n)
#skip = sorted(random.sample(range(1,n), n-s))
ord... |
Fix backward compatibility of migrations | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-17 18:27
from __future__ import unicode_literals
from django.db import migrations, models
try:
import django.contrib.auth.validators
extra_kwargs = {'validators': [django.contrib.auth.validators.ASCIIUsernameValidator()]}
except ImportError:
e... | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2017-03-17 18:27
from __future__ import unicode_literals
import django.contrib.auth.validators
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('users', '0013_profile_event_reminder_time'),
]
... |
Add more info to interface | <?php
namespace Tonic\Component\ApiLayer\ModelTransformer;
/**
* Responsible for object transformation.
*/
interface ModelTransformerInterface
{
/**
* Does transformer support transformation to target class?
*
* @param object|array|\Traversable $object
* @param string $tar... | <?php
namespace Tonic\Component\ApiLayer\ModelTransformer;
/**
* Responsible for object transformation.
*/
interface ModelTransformerInterface
{
/**
* Does transformer support transformation to target class?
*
* @param object|array|\Traversable $object
* @param string $tar... |
Allow telegram bot name to be configured | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... | <?php
return [
/*
|--------------------------------------------------------------------------
| Third Party Services
|--------------------------------------------------------------------------
|
| This file is for storing the credentials for third party services such
| as Stripe, Mailgun, ... |
:art: Make installPackages work with buffers | 'use babel'
import {BufferedProcess} from 'atom'
export function installPackages(packageNames, callback, failedCallback) {
const extractionRegex = /Installing (.*?) to .*? (.*)/
return new Promise(function(resolve, reject) {
let errorContents = []
const parameters = ['install'].concat(packageNames)
p... | 'use babel'
import {BufferedProcess} from 'atom'
export function installPackages(packageNames, callback) {
return new Promise(function(resolve, reject) {
const stdErr = []
new BufferedProcess({
command: atom.packages.getApmPath(),
args: ['--production', 'install'].concat(packageNames),
opt... |
Add a test for the validate-collated tree output | # -*- coding: utf-8 -*-
# ###
# Copyright (c) 2016, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import io
import mimetypes
import os.path
import sys
import tempfile
import unittest
from lxml import etre... | # -*- coding: utf-8 -*-
# ###
# Copyright (c) 2016, Rice University
# This software is subject to the provisions of the GNU Affero General
# Public License version 3 (AGPLv3).
# See LICENCE.txt for details.
# ###
import mimetypes
import os.path
import tempfile
import unittest
try:
from unittest import mock
except ... |
Remove unneeded jinja2 import in markdown example | # build.py
#!/usr/bin/env python3
import os
# Markdown to HTML library
# https://pypi.org/project/Markdown/
import markdown
from staticjinja import Site
markdowner = markdown.Markdown(output_format="html5")
def md_context(template):
with open(template.filename) as f:
markdown_content = f.read()
r... | # build.py
#!/usr/bin/env python3
import os
import jinja2
# Markdown to HTML library
# https://pypi.org/project/Markdown/
import markdown
from staticjinja import Site
markdowner = markdown.Markdown(output_format="html5")
def md_context(template):
with open(template.filename) as f:
markdown_content = f.re... |
Fix lint issue and review comments
Change-Id: I02a53961b6411247ef06d84dad7b533cb97d89f7 | # Copyright 2015 Google Inc. 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 required by applicable law or a... | # Copyright 2015 Google Inc. 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 required by applicable law or a... |
Add `-v` and `--version` flags
Closes #18 | #!/usr/bin/env node
var path = require('path');
var findup = require('findup-sync');
var minimist = require('minimist');
var resolve = require('resolve').sync;
var logger = require('../lib/core/logger');
var argv = minimist(process.argv.slice(2), {
alias: {v: 'version'}
});
if (argv._[0] === 'init') {
require... | #!/usr/bin/env node
var path = require('path');
var findup = require('findup-sync');
var minimist = require('minimist');
var resolve = require('resolve').sync;
var logger = require('../lib/core/logger');
var argv = minimist(process.argv.slice(2));
if (argv._[0] === 'init') {
require('./init')();
}
else {
var ba... |
fix(sqlite): Update metadata filename when writing
After https://github.com/pelias/whosonfirst/pull/389 and
https://github.com/pelias/wof-admin-lookup/pull/229, WOF metafiles are
expected to follow the pattern `whosonfirst-data-${layer}-latest.csv`. We
missed the code that creates fake metafiles after exporting from S... |
const fs = require('fs');
const path = require('path');
// handler for all metatdata streams
module.exports.MetaDataFiles = function MetaDataFiles( metaDir ){
let streams = {};
this.stats = {};
this.write = function( row ){
let keys = Object.keys(row);
// first time writing to this meta file
if( !s... |
const fs = require('fs');
const path = require('path');
// handler for all metatdata streams
module.exports.MetaDataFiles = function MetaDataFiles( metaDir ){
let streams = {};
this.stats = {};
this.write = function( row ){
let keys = Object.keys(row);
// first time writing to this meta file
if( !s... |
[DEL] Remove required property on some fields | # -*- coding: utf-8 -*-
from odoo import fields, models
class Employee(models.Model):
_name = 'tmc.hr.employee'
_order = 'name'
name = fields.Char()
internal_number = fields.Char(
size=3
)
docket_number = fields.Integer()
bank_account_number = fields.Char()
bank_branch =... | # -*- coding: utf-8 -*-
from odoo import fields, models
class Employee(models.Model):
_name = 'tmc.hr.employee'
_order = 'name'
name = fields.Char()
internal_number = fields.Char(
size=3,
required=True
)
docket_number = fields.Integer(
required=True
)
bank... |
Move skip link right after body tag | <?php
/**
* Template for header
*
* <head> section and everything up until <div id="content">
*
* @Author: Roni Laukkarinen
* @Date: 2020-05-11 13:17:32
* @Last Modified by: Roni Laukkarinen
* @Last Modified time: 2021-02-25 13:47:40
*
* @package air-light
*/
namespace Air_Light;
?>
<!doctype html>
<htm... | <?php
/**
* Template for header
*
* <head> section and everything up until <div id="content">
*
* @Author: Roni Laukkarinen
* @Date: 2020-05-11 13:17:32
* @Last Modified by: Timi Wahalahti
* @Last Modified time: 2020-11-19 11:24:53
*
* @package air-light
*/
namespace Air_Light;
?>
<!doctype html>
<html ... |
Rewrite Disqus to use the new scope selection system | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... | from oauthlib.oauth2.draft25 import utils
import foauth.providers
def token_uri(service, token, r):
params = [((u'access_token', token)), ((u'api_key', service.client_id))]
r.url = utils.add_params_to_uri(r.url, params)
return r
class Disqus(foauth.providers.OAuth2):
# General info about the provide... |
Change example from Null Island to Santiago, Chile | var point = require('turf-point');
/**
* Takes a bounding box and a cell depth and outputs points in a grid.
*
* @module turf/grid
* @param {Array<number>} extent extent in [xmin, ymin, xmax, ymax] order
* @param {Number} depth how many cells to output
* @return {FeatureCollection} grid as FeatureCollection with... | var point = require('turf-point');
/**
* Takes a bounding box and a cell depth and outputs points in a grid.
*
* @module turf/grid
* @param {Array<number>} extent extent in [xmin, ymin, xmax, ymax] order
* @param {Number} depth how many cells to output
* @return {FeatureCollection} grid as FeatureCollection with... |
Add unit test for make_thumb_url() | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... | #!/usr/bin/env python
# -*- coding: latin-1 -*-
"""Unit tests."""
import unittest
import commonsdownloader
class TestCommonsDownloader(unittest.TestCase):
"""Testing methods from commonsdownloader."""
def test_clean_up_filename(self):
"""Test clean_up_filename."""
values = [('Example.jpg',... |
Clear all caches after refreshing records | package org.strangeforest.tcb.stats.jobs;
import org.slf4j.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.context.annotation.*;
import org.springframework.scheduling.annotation.*;
import org.springframework.stereotype.*;
import org.strangeforest.tcb.stats.service.*;
@Component
@P... | package org.strangeforest.tcb.stats.jobs;
import org.slf4j.*;
import org.springframework.beans.factory.annotation.*;
import org.springframework.context.annotation.*;
import org.springframework.scheduling.annotation.*;
import org.springframework.stereotype.*;
import org.strangeforest.tcb.stats.service.*;
@Component
@P... |
Add required newline at end of file | // file: example/approle.js
process.env.DEBUG = 'node-vault'; // switch on debug mode
const vault = require('./../src/index')();
const mountPoint = 'approle';
const roleName = 'test-role';
vault.auths()
.then((result) => {
if (result.hasOwnProperty('approle/')) return undefined;
return vault.enableAuth({
mou... | // file: example/approle.js
process.env.DEBUG = 'node-vault'; // switch on debug mode
const vault = require('./../src/index')();
const mountPoint = 'approle';
const roleName = 'test-role';
vault.auths()
.then((result) => {
if (result.hasOwnProperty('approle/')) return undefined;
return vault.enableAuth({
mou... |
Add 'inversedBy' attribute on ManyToOne association with Tag entity
Without this attribute the entity mapping information won't be considered valid. | <?php
namespace Fogs\TaggingBundle\Entity;
use \FPN\TagBundle\Entity\Tagging as BaseTagging;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\UniqueConstraint;
/**
* Fogs\TaggingBundle\Entity\Tagging
*
* @ORM\Table(uniqueConstraints={@UniqueConstraint(name="tagging_idx", columns={"tag_id", "re... | <?php
namespace Fogs\TaggingBundle\Entity;
use \FPN\TagBundle\Entity\Tagging as BaseTagging;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\ORM\Mapping\UniqueConstraint;
/**
* Fogs\TaggingBundle\Entity\Tagging
*
* @ORM\Table(uniqueConstraints={@UniqueConstraint(name="tagging_idx", columns={"tag_id", "reso... |
Fix typeTest for deep attrs | 'use strict';
const { mapValues, get } = require('../../utilities');
const isObject = function (value) {
return value.constructor === Object;
};
const isObjectArray = function (value) {
return Array.isArray(value) && value.every(isObject);
};
const typeTest = ({ test: testFunc, message }) => name => ({
test (... | 'use strict';
const { mapValues } = require('../../utilities');
const isObject = function (value) {
return value.constructor === Object;
};
const isObjectArray = function (value) {
return Array.isArray(value) && value.every(isObject);
};
const typeTest = ({ test: testFunc, message }) => name => ({
test ({ [na... |
Allow filtering by author name | from tastypie.authorization import DjangoAuthorization
from tastypie import fields
from tastypie.resources import ModelResource, ALL_WITH_RELATIONS
from quotations.apps.quotations import models as quotations_models
from quotations.libs.auth import MethodAuthentication
from quotations.libs.serializers import Serializer
... | from tastypie.authorization import DjangoAuthorization
from tastypie import fields
from tastypie.resources import ModelResource, ALL_WITH_RELATIONS
from quotations.apps.quotations import models as quotations_models
from quotations.libs.auth import MethodAuthentication
from quotations.libs.serializers import Serializer
... |
Fix detection on Windows 10 Anniversary | const DRAW_SIZE = 32;
function newContext() {
const canvas = document.createElement('canvas');
canvas.width = canvas.height = DRAW_SIZE * 2;
return canvas.getContext('2d');
}
export function prepareCanvasContext(context) {
if (!context) {
context = newContext();
context.fillStyle = "#000";
context... | const DRAW_SIZE = 32;
function newContext() {
const canvas = document.createElement('canvas');
canvas.width = canvas.height = DRAW_SIZE * 2;
return canvas.getContext('2d');
}
export function prepareCanvasContext(context) {
if (!context) {
context = newContext();
context.fillStyle = "#000";
context... |
Use config to load available id providers | "use strict";
var db = require('../../models');
var config = require('../../config');
var authHelper = require('../../lib/auth-helper');
module.exports = function(app) {
var logger = app.get('logger');
app.get('/logout', function(req, res) {
req.logout();
res.redirect('/');
});
app.get('/protected',... | "use strict";
var db = require('../../models');
var config = require('../../config');
var authHelper = require('../../lib/auth-helper');
module.exports = function(app) {
var logger = app.get('logger');
app.get('/logout', function(req, res) {
req.logout();
res.redirect('/');
});
app.get('/protected',... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.