commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
d1b50f2f1d4ea3bf4b55c8997cba9fe47c1aa377 | fix saving | api/models.py | api/models.py | """
GRT Models
"""
from __future__ import unicode_literals
import os
import uuid as pyuuid
from django.conf import settings
from django.db import models
from django.contrib.auth.models import User
class GalaxyInstance(models.Model):
"""A single galaxy site. Corresponds to a single galaxy.ini"""
# Optional
... | Python | 0.000001 | @@ -192,16 +192,61 @@
rt User%0A
+from django.core.urlresolvers import reverse%0A
%0A%0Aclass
@@ -1988,16 +1988,124 @@
mport%5D%0A%0A
+ def get_absolute_url(self):%0A return reverse('galaxy-instance-detail', kwargs=%7B'slug': self.pk%7D)%0A%0A
def
|
5768d1ebcfec46e564c8b420773d911c243327ff | Fix non-threadsafe failure in serializer - now using thread local serializer instance. | dddp/msg.py | dddp/msg.py | """Django DDP utils for DDP messaging."""
import collections
from django.core.serializers import get_serializer
_SERIALIZER = None
def obj_change_as_msg(obj, msg):
"""Generate a DDP msg for obj with specified msg type."""
global _SERIALIZER
if _SERIALIZER is None:
_SERIALIZER = get_serializer('ddp... | Python | 0 | @@ -39,25 +39,44 @@
%22%22%22%0A
-import collection
+from dddp import THREAD_LOCAL as thi
s%0Afr
@@ -129,26 +129,107 @@
er%0A%0A
-_SERIALIZER = None
+%0Adef serializer_factory():%0A %22%22%22Make a new DDP serializer.%22%22%22%0A return get_serializer('ddp')()%0A
%0A%0Ade
@@ -329,81 +329,31 @@
-global _... |
3676809c9d44abf8b48810b58488ba519c21254d | use new API for thawing deps | repository/netrepos/instructionsets.py | repository/netrepos/instructionsets.py | #
# Copyright (c) 2004 Specifix, Inc.
#
# This program is distributed under the terms of the Common Public License,
# version 1.0. A copy of this license should have been distributed with this
# source file in a file called LICENSE. If it is not present, the license
# is always available at http://www.opensource.org/li... | Python | 0 | @@ -1568,17 +1568,42 @@
ps.deps.
-T
+InstructionSetDependency.t
hawDepen
@@ -1615,24 +1615,16 @@
(frozen)
-
%0A %0A
|
0a42ec9eeccc5969bf1eb8a92cd7d66ade4daf76 | Make executable | ddgquery.py | ddgquery.py | import os, time
# use python3
while True:
os.system("espeak -v en-us 'What would you like to know about?'")
#time.sleep(4)
query = input("What would you like to know about?\n")
if query == "help":
print("Add -u to get a helpful URL\nAdd -l to launch the URL in your browser\nAdd -s to get a Duck... | Python | 0.999996 | @@ -1,8 +1,32 @@
+#! /usr/bin/env python%0A%0A
import o
|
40dca64ee4307669b80f8a2e4328176c50f179f2 | use trailing slash for non-URL crumbs so sequential non-URL crumbs get a separator...this means there's always an ending slash (may fix that later) | repository/templatetags/breadcrumbs.py | repository/templatetags/breadcrumbs.py | # Based on http://djangosnippets.org/snippets/1289/
# with modifications to use bootstrap breadcrumb styles
from django import template
from django.template import Node, Variable
from django.utils.encoding import smart_unicode
from django.template.defaulttags import url
from django.template import VariableDoesNotExist... | Python | 0 | @@ -3213,16 +3213,54 @@
%22%3Cli%3E%25s
+ %3Cspan class=%5C%22divider%5C%22%3E/%3C/span%3E
%3C/li%3E%22 %25
|
6c1e5e312996f83be3ed52a3e046cc135a3fd888 | Add vhost_root to Bootstrap#upload_config_files | __init__.py | __init__.py | from fabric.api import local, run, sudo, prefix, cd, env
from fabric.contrib import django
from fabric.contrib.files import upload_template, append
from fabric.contrib.console import confirm
from fabric import tasks
from fabric.utils import abort, puts
from django.conf import settings
django.settings_module('settings... | Python | 0.000001 | @@ -2997,32 +2997,88 @@
ig_files(self):%0A
+ vhost_root = '/var/www/vhosts/%25(domain)s' %25 env%0A
kwargs =
|
f6b91953a5595b1f5a29a5bb69b3c9bc61e1b885 | I am an idiot | api/result.py | api/result.py | """
ApiResult class
"""
from datetime import datetime
from typing import Dict
from discord import Embed
from api import datetime_input_format, datetime_output_format, trim_string
class ApiResult(object):
"""
API Result object
"""
#taken from https://rpcs3.net/compatibility
STATUS_NOTHING = 0x455... | Python | 0.998675 | @@ -2916,16 +2916,23 @@
+ desc =
%22Produc
|
338e2ba155df0759113c65ced6be6714092b9aaf | Use Alex's awesome new version of the GtkQuartz theme engine | packages/gtk-quartz-engine.py | packages/gtk-quartz-engine.py | Package ('gtk-quartz-engine', 'master',
sources = [ 'git://github.com/jralls/gtk-quartz-engine.git' ],
override_properties = { 'configure':
'libtoolize --force --copy && '
'aclocal && '
'autoheader && '
'automake --add-missing && '
'autoconf && '
'./configure --prefix=%{prefix}'
}
)
| Python | 0 | @@ -68,14 +68,16 @@
com/
-jralls
+nirvanai
/gtk
|
12130cef6c9b08e0928ed856972ace3c2000e6f8 | Fix error accessing class variable | mooc_aggregator_restful_api/udacity.py | mooc_aggregator_restful_api/udacity.py | '''
This module retrieves the course catalog and overviews of the Udacity API
Link to Documentation:
https://s3.amazonaws.com/content.udacity-data.com/techdocs/UdacityCourseCatalogAPIDocumentation-v0.pdf
'''
import json
import requests
class UdacityAPI(object):
'''
This class defines attributes and method... | Python | 0.000004 | @@ -472,16 +472,27 @@
sts.get(
+UdacityAPI.
UDACITY_
|
ecf685c157ac3b59641f0c4327d147b6c14ba17b | Remove debugging message. | djangofm/gobbler/models.py | djangofm/gobbler/models.py | # Libre.fm -- a free network service for sharing your music listening habits
#
# Copyright (C) 2009 Libre.fm Project
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of ... | Python | 0.000001 | @@ -1349,37 +1349,8 @@
d):%0A
- print %22set password%22%0A
|
8d8a2fb7f1ec5a14a329e8aaaa9dd1815981cf40 | fix rounding error | motmot/realtime_image_analysis/slow.py | motmot/realtime_image_analysis/slow.py | import numpy
def do_bg_maint( running_mean_im,
hw_roi_frame,
max_frame_size,
ALPHA,
running_mean8u_im,
fastframef32_tmp,
running_sumsqf,
mean2,
std2,
running_stdframe... | Python | 0.000765 | @@ -2208,32 +2208,44 @@
ean8u_im%5B:,:%5D =
+numpy.round(
running_mean_im.
@@ -2247,29 +2247,8 @@
n_im
-.astype( numpy.uint8
)%0A%0A
|
ac63fca5b1e688fb465431fd1760db6b1c766fea | Bump to version 0.14 | openspending/_version.py | openspending/_version.py | __version__ = '0.13.1'
| Python | 0 | @@ -15,9 +15,9 @@
'0.1
-3.1
+4.0
'%0A
|
b7b23f9840af377f37617f3bbb79556342d74133 | replace prints with calls to logger | __main__.py | __main__.py | #/usr/bin/env python2
import web
import ConfigParser
_config_file_list = ['./jim.cfg', '/etc/jim.cfg']
_config_file_parser = ConfigParser.RawConfigParser()
_config_ok = True
try:
_config_file_list = _config_file_parser.read(_config_file_list)
except:
print("cannot parse configuration file(s)")
_config_ok ... | Python | 0 | @@ -27,16 +27,27 @@
ort web%0A
+import log%0A
import C
@@ -59,16 +59,43 @@
Parser%0A%0A
+_log = log.TrivialLogger()%0A
_config_
@@ -292,21 +292,26 @@
pt:%0A
-print
+_log.error
(%22cannot
@@ -400,21 +400,26 @@
0:%0A
-print
+_log.error
(%22no con
@@ -475,21 +475,25 @@
se:%0A
-print
+_log.info
(%22u... |
ba97f70c2d213f92ce73d1e13921ff7c6bf35991 | fix /compare/ link | __main__.py | __main__.py | import os
import subprocess
import sys
GIT_PATH = '/opt/'
def _open_pipe(cmd, cwd=None):
return subprocess.Popen(cmd, stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE, cwd=cwd)
def git_path(repo):
return os.path.join(GIT_PATH, repo... | Python | 0 | @@ -2434,17 +2434,19 @@
ous_tag%7D
-/
+...
%7Btag%7D'.f
@@ -2456,98 +2456,8 @@
at(%0A
- team=team,%0A repo=repo,%0A
|
6a5a7a1e1eafa91543d8e274e63d258332149a29 | Update __version__.py | orcidfind/__version__.py | orcidfind/__version__.py | # Single source of metadata about the project that's used by setup.py and
# docs/conf.py
# Some segments of public version identifer (PEP 440)
VERSION_RELEASE = "0.1"
VERSION_PRE_RELEASE = "a4" # e.g., "a4", "b1", "rc3" or "" (final release)
VERSION_POST_RELEASE = "" # e.g., ".post1"
VERSION = VERSION_RELEASE + ... | Python | 0.000002 | @@ -185,17 +185,17 @@
ASE = %22a
-4
+5
%22 # e
@@ -335,28 +335,29 @@
LEASE + VERSION_POST_RELEASE
+%0A
|
37899ad1e6120a14c053e09b3233a97fdfb9bb6d | add trash option | organize/actions/copy.py | organize/actions/copy.py | import logging
import os
import shutil
from organize.utils import Mapping, find_unused_filename, fullpath
from .action import Action
from .trash import Trash
logger = logging.getLogger(__name__)
CONFLICT_OPTIONS = ("rename_new", "rename_old", "skip", "overwrite")
class Copy(Action):
"""
Copy a file to a... | Python | 0.000001 | @@ -248,16 +248,25 @@
%22skip%22,
+ %22trash%22,
%22overwr
@@ -4388,24 +4388,26 @@
st=%25s, o
-verwrite
+n_conflict
=%25s)%22 %25
@@ -4424,18 +4424,20 @@
, self.o
-verwrite
+n_conflict
)%0A
|
9ffe02ac6f35b12952392585ab92cabf60234c50 | fix potential issue with mutation | treeano/sandbox/sensitivity_analysis.py | treeano/sandbox/sensitivity_analysis.py | """
from "Deep Inside Convolutional Networks: Visualising Image Classification
Models and Saliency Maps"
http://arxiv.org/abs/1312.6034
"""
import theano
import theano.tensor as T
import treeano
import canopy
class SensitivityAnalysisOutput(canopy.handlers.NetworkHandlerImpl):
"""
adds a new input and outpu... | Python | 0.000041 | @@ -3552,24 +3552,100 @@
in inputs%0A%0A
+ # make a copy of inputs so that we can mutate%0A inputs = dict(inputs)%0A
inputs%5B%22
|
66d6bed7f79cb10f699b5fc72f2ab7011379e5c1 | Fix this docstring | owapi/blizz_interface.py | owapi/blizz_interface.py | """
Interface that uses Blizzard's pages as the source.
"""
import functools
import logging
import asyncio
import traceback
from lxml import etree
import aiohttp
from kyoukai.context import HTTPRequestContext
from owapi import util
B_BASE_URL = "https://playoverwatch.com/en-us/"
B_PAGE_URL = B_BASE_URL + "career/{... | Python | 0.999999 | @@ -606,14 +606,12 @@
rom
-Master
+Play
Over
|
c212c2e19f325a3f7074db1993c4a737d62d2761 | Add itertools.product as a filter (#32991) | lib/ansible/plugins/filter/mathstuff.py | lib/ansible/plugins/filter/mathstuff.py | # (c) 2014, Brian Coca <bcoca@ansible.com>
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.... | Python | 0 | @@ -4031,16 +4031,58 @@
atorial%0A
+ 'product': itertools.product,%0A
|
d032d2597525e02fd71a524c5a9619c09c640365 | Bump version number. | coffin/__init__.py | coffin/__init__.py | """
Coffin
~~~~~~
`Coffin <http://www.github.com/dcramer/coffin>` is a package that resolves the
impedance mismatch between `Django <http://www.djangoproject.com/>` and `Jinja2
<http://jinja.pocoo.org/2/>` through various adapters. The aim is to use Coffin
as a drop-in replacement for Django's template system to whate... | Python | 0 | @@ -532,15 +532,8 @@
'6'
-, 'dev'
)%0A__
|
5261e7b75718b866f95285bd03171c861175dccc | Move question into random_questions function | collection/srvy.py | collection/srvy.py | #!/usr/bin/python
import sys
import time
from time import sleep
from datetime import datetime
import random
import sqlite3
import csv
from configparser import ConfigParser
try:
from gpiozero import Button
except ImportError:
print("gpiozero is not installed.")
pass
try:
import pygame
except ImportErro... | Python | 0.999999 | @@ -1101,24 +1101,84 @@
in loop.%22%22%22%0A
+ question = get_current_questions(question_csv_location)%0A
return r
@@ -2231,64 +2231,8 @@
)%0A%0A%0A
-question = get_current_questions(question_csv_location)%0A
main
|
93e8e63c3cf8d360af018b6ce3abe224b8ad374c | Add further testinfra tests | molecule/default/tests/test_default.py | molecule/default/tests/test_default.py | def test_apt_preferences_docker_compose_file(host):
f = host.file("/etc/apt/preferences.d/docker-compose")
assert f.exists
assert f.is_file
def test_apt_preferences_docker_file(host):
f = host.file("/etc/apt/preferences.d/docker")
assert f.exists
assert f.is_file
| Python | 0 | @@ -263,28 +263,306 @@
exists%0A assert f.is_file%0A
+%0A%0Adef test_systemd_overlay_file(host):%0A f = host.file(%22/etc/systemd/system/docker.service.d/overlay.conf%22)%0A assert f.exists%0A assert f.is_file%0A%0A%0Adef test_limits_file(host):%0A f = host.file(%22/etc/security/limits.d/docker.conf%22)... |
e4442eb72a2a937c8f5bca9f6b2c479f9f15bb51 | Fix #3826, sort all file lists in moz.build (#3827) | bin/update_mozbuild.py | bin/update_mozbuild.py | #!.venv/bin/python
import argparse
import os
import io
import re
skipFiles = [
"manifest.json.template"
]
def getFullFileList(outputLoc, dirName):
result = {dirName: []}
for entry in os.listdir(outputLoc):
if os.path.isdir(os.path.join(outputLoc, entry)):
result.update(getFullFileLis... | Python | 0.000001 | @@ -1242,16 +1242,23 @@
'%22.join(
+sorted(
fileList
@@ -1263,16 +1263,17 @@
st%5Bdir%5D)
+)
+ %22'%5Cn%5D
|
574105cc7f383a107ff30a87e259be49aa0b5d21 | Fix a misplaced line | msoffcrypto/method/ecma376_standard.py | msoffcrypto/method/ecma376_standard.py | import logging
import io
from hashlib import sha1
from struct import pack, unpack
from cryptography.hazmat.backends import default_backend
from cryptography.hazmat.primitives.ciphers import Cipher, algorithms, modes
logger = logging.getLogger(__name__)
logger.addHandler(logging.NullHandler())
class ECMA376Standard:... | Python | 1 | @@ -2141,113 +2141,8 @@
t):%0A
- logger.debug(%5Bpassword, hex(algId), hex(algIdHash), hex(providerType), keySize, saltSize, salt%5D)%0A
@@ -2588,13 +2588,16 @@
A376
-Agile
+Standard
.mak
@@ -2715,32 +2715,137 @@
rue%0A '''%0A
+ logger.debug(%5Bpassword, hex(algId), hex(algIdHash), hex(pr... |
4992cda20695b79b6d238f2a448ba8aa713dcb2f | Fix error with package tags type | murano/packages/application_package.py | murano/packages/application_package.py | # Copyright (c) 2014 Mirantis 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 agreed to in writ... | Python | 0.000154 | @@ -1854,13 +1854,12 @@
urn
-tuple
+list
(sel
|
06883c488182ef23a84b75cbad47e05e63a8ceb6 | Use agent 8 signature (#9516) | activemq_xml/datadog_checks/activemq_xml/activemq_xml.py | activemq_xml/datadog_checks/activemq_xml/activemq_xml.py | # (C) Datadog, Inc. 2018-present
# All rights reserved
# Licensed under a 3-clause BSD style license (see LICENSE)
from xml.etree import ElementTree
import requests
from six import iteritems
from datadog_checks.base import AgentCheck
from datadog_checks.base.config import _is_affirmative
QUEUE_URL = "/admin/xml/queu... | Python | 0 | @@ -733,24 +733,17 @@
k(self,
-instance
+_
):%0A
@@ -751,16 +751,21 @@
url =
+self.
instance
@@ -794,24 +794,29 @@
stom_tags =
+self.
instance.get
@@ -845,32 +845,37 @@
ax_queues = int(
+self.
instance.get(%22ma
@@ -917,32 +917,37 @@
ax_topics = int(
+self.
instance.get(%22ma
@@ -1002,16 +1002,21 @@... |
8dc853e90b587b9245b87c14f5cb2e93215d3283 | Change test_output data structure to dict of dict | tests/convergence_tests/sphere_lspr.py | tests/convergence_tests/sphere_lspr.py | from pygbe.util import an_solution
from convergence_lspr import (mesh_ratio, run_convergence, picklesave, pickleload,
report_results, mesh)
def main():
print('{:-^60}'.format('Running sphere_lspr test'))
try:
test_outputs = pickleload()
except FileNotFoundError:
... | Python | 0.000311 | @@ -665,131 +665,344 @@
%5D =
-%5BN, iterations, expected_rate, Cext_0, Time%5D%0A%0A picklesave(test_outputs)%0A%0A # load data for analysis%0A N, iterations,
+%7B'N': N, 'iterations': iterations,%0A 'expected_rate': expected_rate, 'Cext_0': Cext_0,%0A ... |
cd4aa7364c82a464f0cd29ad45431e00c413b3f2 | return utc timestamps | pagecountssearch/search.py | pagecountssearch/search.py | import argparse
import collections
import datetime
import functools
import gzip
import io
import itertools
import sys
from urllib.parse import quote, unquote
import pathlib
from .sortedcollection import SortedCollection
__all__ = ('Finder', 'search', 'build_index')
DATETIME_PATTERN = '%Y%m%d-%H%M%S'
Record = colle... | Python | 0.999999 | @@ -77,18 +77,8 @@
zip%0A
-import io%0A
impo
@@ -3058,22 +3058,33 @@
p):%0A
-return
+naive_timestamp =
datetim
@@ -3131,16 +3131,107 @@
PATTERN)
+%0A timestamp = naive_timestamp.replace(tzinfo=datetime.timezone.utc)%0A return timestamp
%0A%0Aparse_
|
0ac869ce67017c9ffb8a8b32ff57346980144371 | use global es in reindexers | corehq/ex-submodules/pillowtop/reindexer/reindexer.py | corehq/ex-submodules/pillowtop/reindexer/reindexer.py | from pillowtop.es_utils import set_index_reindex_settings, \
set_index_normal_settings, get_index_info_from_pillow, initialize_mapping_if_necessary
from pillowtop.pillow.interface import PillowRuntimeContext
class PillowReindexer(object):
def __init__(self, pillow, change_provider):
self.pillow = pil... | Python | 0 | @@ -1,20 +1,58 @@
+from corehq.elastic import get_es_new%0A
from pillowtop.es_ut
@@ -2295,23 +2295,16 @@
csearch=
-pillow.
get_es_n
|
f5600008defcd5fe4c9c397c0b7170f6f5e9a5e4 | Add header info and submodule imports to init | __init__.py | __init__.py | Python | 0 | @@ -1 +1,379 @@
+__author__ = %22Justin Kitzes, Mark Wilber, Chloe Lewis%22%0A__copyright__ = %22Copyright 2012, Regents of University of California%22%0A__credits__ = %5B%5D%0A__license__ = %22BSD 2-clause%22%0A__version__ = %220.1%22%0A__maintainer__ = %22Justin Kitzes%22%0A__email__ = %22jkitzes@berkeley.edu%22%0A__... | |
5281d535f67dfa2cebd8f70ee1f342c213d11b29 | change filename | __init__.py | __init__.py | from .pyglow import *
| Python | 0.000109 | @@ -3,11 +3,11 @@
om .
-pyg
+PyG
low
|
67406893c1b9b727f313a374affe9868ec986fa6 | Bump to 2.6.2c1. | __init__.py | __init__.py | """distutils
The main package for the Python Module Distribution Utilities. Normally
used from a setup script as
from distutils.core import setup
setup (...)
"""
# This module should be kept compatible with Python 2.1.
__revision__ = "$Id$"
# Distutils version
#
# Please coordinate with Marc-Andre Lemburg ... | Python | 0.000001 | @@ -587,16 +587,18 @@
= %222.6.
+2c
1%22%0A#--en
|
b913e6d1b4323dbc52fbe2697dc9bf7fa2b80c24 | Add Python 2 deprecation warning, closes #1179 | __init__.py | __init__.py | from __future__ import absolute_import, division, print_function
import logging
import os
import sys
logging.getLogger("dials").addHandler(logging.NullHandler())
# Invert FPE trap defaults, https://github.com/cctbx/cctbx_project/pull/324
if "boost.python" in sys.modules:
import boost.python
boost.python.ext... | Python | 0 | @@ -94,16 +94,331 @@
port sys
+%0Aimport warnings%0A%0Aif sys.version_info.major == 2:%0A warnings.warn(%0A %22Python 2 is no longer fully supported. Please consider using the DIALS 2.2 release branch. %22%0A %22For more information on Python 2.7 support please go to https://github.com/dials/dials/iss... |
b0e00a905da20bc0609a5a5fa53442482fcba091 | Add "--check-ignore" option | test/acid.py | test/acid.py | #!/usr/bin/env python
"""Test that autopep8 runs without crashing on various Python files."""
import contextlib
import os
import sys
import subprocess
import tempfile
import tokenize
@contextlib.contextmanager
def red(file_object):
"""Red context."""
if file_object.isatty():
RED = '\033[91m'
... | Python | 0.999028 | @@ -653,16 +653,33 @@
nore='',
+ check_ignore='',
verbose
@@ -679,32 +679,32 @@
verbose=False):%0A
-
%22%22%22Run autop
@@ -1638,16 +1638,31 @@
e_option
+ + check_ignore
,%0A
@@ -4188,16 +4188,214 @@
ult='')%0A
+ parser.add_option('--check-ignore',%0A help='comma-separated erro... |
9d085f0478ca55b59390515c82ca3e367cef5522 | Replace Bootstrap's html5shiv with es5-shim. | app/assets.py | app/assets.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask.ext.assets import Environment, Bundle
css_application = Bundle(
'less/main.less',
filters='less',
debug=False,
output='gen/app.css'
)
css_all = Bundle(
# 'vendor/some/library.css',
css_application,
filters='cssmin',
output='gen... | Python | 0.000002 | @@ -1046,86 +1046,25 @@
dor/
-bootstrap/assets/js/html5shiv.js',%0A 'vendor/bootstrap/assets/js/respond.min
+es5-shim/es5-shim
.js'
|
12c57f6b785167c4f9e6427520360ce64d845e96 | Fix documentation links in Edward2 docstring. | tensorflow_probability/python/experimental/edward2/__init__.py | tensorflow_probability/python/experimental/edward2/__init__.py | # Copyright 2018 The TensorFlow Probability Authors.
#
# 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 o... | Python | 0.000004 | @@ -836,32 +836,45 @@
bability/python/
+experimental/
edward2/README.m
@@ -1001,16 +1001,29 @@
/python/
+experimental/
edward2/
|
1ec3a57e53e52cc8b8188dcdcb5eeb773cbead18 | Allow autonomous modes to be marked as disabled | robot/robot/src/autonomous/__init__.py | robot/robot/src/autonomous/__init__.py | '''
Implements an autonomous mode management program. Example usage:
from autonomous import AutonomousModeManager
components = {'drive': drive,
'component1': component1, ... }
autonomous = AutonomousModeManager(components)
class MyRobot(w... | Python | 0.000001 | @@ -2697,32 +2697,335 @@
continue%0A
+ %0A # don't allow the driver to select this mode %0A if hasattr(instance, 'DISABLED') and instance.DISABLED:%0A print(%22Warning: autonomous mode %25s is marked as disabled%22 %25 instance.M... |
9736dcfebaeca8cfbc730dc547e34bb4ca5d1768 | Remove some of the "useless keys", they're not so useless. | south/creator/freezer.py | south/creator/freezer.py | """
Handles freezing of models into FakeORMs.
"""
import sys
from django.db import models
from django.contrib.contenttypes.generic import GenericRelation
from south.orm import FakeORM
from south.utils import auto_model
from south import modelsinspector
def freeze_apps(apps):
"""
Takes a list of app labels, ... | Python | 0.000116 | @@ -5455,43 +5455,19 @@
%22, %22
-upload_to%22, %22verbose_name%22, %22storag
+verbose_nam
e%22%5D%0A
|
324f178926392293527b4aafa64a4c9a7a4d28c7 | Change an invalid constant name | spam_lists/validation.py | spam_lists/validation.py | # -*- coding: utf-8 -*-
'''
This module contains functions responsible for
validating arguments for other functions and
methods provided by the library
'''
from __future__ import unicode_literals
import functools
import re
from future.moves.urllib.parse import urlparse
import validators
from .exceptions import Inva... | Python | 0.000031 | @@ -642,25 +642,25 @@
ators)%0A%0A
-url_regex
+URL_REGEX
= re.co
@@ -1165,17 +1165,17 @@
h =
-url_regex
+URL_REGEX
.mat
|
cc9d516605878e8cc3b003727908c3791a026ca6 | Raise exceptions with list of issues to show all of them immediately | runtime_typecheck/runtime_typecheck.py | runtime_typecheck/runtime_typecheck.py | #!/usr/bin/env python3
from functools import wraps
import inspect
from typing import (Union,
Tuple,
Any,
TypeVar,
Type,
List)
def check_type(obj, candidate_type, reltype='invariant') -> bool:
if reltype not in ['in... | Python | 0 | @@ -225,51 +225,293 @@
)%0A%0A%0A
-def check_type(obj, candidate_type,
+class DetailedTypeError(TypeError):%0A issues = %5B%5D%0A%0A def __init__(self, issues: List%5BTuple%5Bstr, str, str%5D%5D):%0A self.issues = issues%0A super().__init__(f'typing issues found:%7Bissues%7D')%0A%0A%0Adef check_typ... |
eee59888b5bf03727ac28f52c1c7ede52e85feae | update SQL | s3-dynamo-sync-check/case_alignment.py | s3-dynamo-sync-check/case_alignment.py | import argparse
import logging.config
import threadpool
import traceback
from lib.connection import Connection
from lib.s3 import S3
from lib.dynamodb import DynamoDB
from lib.mssql import MSSql
LOG_PATH = "/tmp/case_err.log"
def nonsync_logging(request, (success, key)):
"""non-sync item will be logged here
... | Python | 0.000002 | @@ -1943,32 +1943,24 @@
ry(%22
-SELECT top 100
+select
SHA1
-FROM
+from
Fil
@@ -1969,17 +1969,16 @@
nfo WITH
-
(NOLOCK)
@@ -1982,80 +1982,69 @@
CK)
-WHERE BINARY_CHECKSUM(sha1) = BINARY_CHECKSUM(Upper(sha1)) ORDER BY sha1
+where sha1 COLLATE SQL_Latin1_General_CP1_CS_AS = upper(sha1)
%22)%0A
|
b4e2d34edcbc404f6c90f76b67bcc5fe26f0945f | Remove imp and just use importlib to avoid memory error when showing versions | pandas/util/print_versions.py | pandas/util/print_versions.py | import os
import platform
import sys
import struct
import subprocess
import codecs
def get_sys_info():
"Returns system information as a dict"
blob = []
# get full commit hash
commit = None
if os.path.isdir(".git") and os.path.isdir("pandas"):
try:
pipe = subprocess.Popen('git... | Python | 0 | @@ -76,16 +76,33 @@
codecs%0A
+import importlib%0A
%0A%0Adef ge
@@ -1591,23 +1591,8 @@
e):%0A
- import imp%0A
@@ -3464,170 +3464,8 @@
ry:%0A
- try:%0A mod = imp.load_module(modname, *imp.find_module(modname))%0A except (ImportError):%0A import importlib%... |
c47dc4004a12010e32c16fbabb64fb682eee16cb | Define parseArgs | gsm.py | gsm.py | import sys
from os import path
from subprocess import call
import json
from pprint import pprint
" Terminal Colors "
class bcolors:
HEADER = '\033[95m'
OKBLUE = '\033[94m'
OKGREEN = '\033[92m'
WARNING = '\033[93m'
FAIL = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'... | Python | 0.998561 | @@ -462,24 +462,50 @@
es = dict()%0A
+ cmd = str('install');%0A
_jsonExi
@@ -522,16 +522,16 @@
(False)%0A
-
%0A %22 P
@@ -872,21 +872,8 @@
ion)
-%0A pass
%0A%0A
@@ -894,32 +894,158 @@
def run(self):%0A
+ # parse args%0A if self.parseArgs() == True:%0A # install%0A ... |
3a34ef949cdbe11dcf066cf1ca2e3567c89d57de | Make flake happy | tests/plugins/helpers/test_interact.py | tests/plugins/helpers/test_interact.py | from collections import namedtuple
from unittest import TestCase
from spock.plugins.helpers.clientinfo import PlayerPosition
from spock.plugins.helpers.interact import *
Packet = namedtuple('Packet', 'ident data')
class DataDict(dict):
def __init__(self, **kwargs):
super(DataDict, self).__init__(**kwarg... | Python | 0.000214 | @@ -58,16 +58,17 @@
estCase%0A
+%0A
from spo
@@ -162,17 +162,116 @@
import
-*
+%5C%0A ATTACK_ENTITY, INTERACT_ENTITY, InteractPlugin, PLAYER_HEIGHT%0Afrom spock.vector import Vector3
%0A%0A%0APacke
@@ -3804,29 +3804,62 @@
ion,
- Vector3(-1, 255, -1)
+%0A %7B'x': -1, 'y': 255, 'z': -1%7... |
045256f13ed1bfc3e9cca6897548760145101ff0 | simplify test executor | iatidataquality/test_queue.py | iatidataquality/test_queue.py |
import sys, os, json, ckan, urllib2
from datetime import date, datetime
import models, dqprocessing, dqparsetests, \
dqfunctions, queue
import dqprocessing
from lxml import etree
from iatidataquality import db
# FIXME: this should be in config
download_queue='iati_tests_queue'
def aggregate_results(runtime, pac... | Python | 0.00182 | @@ -724,249 +724,520 @@
l()%0A
-
%0A
-for test in tests:%0A if not test.id in test_functions:%0A continue%0A try:%0A if test_functions%5Btest.id%5D(xmldata):%0A the_result = 1%0A else:%0A the_result = 0%0A
+def add_result(test_id, th... |
86a5ebd7562dece822b62c618ceba98088fb3bc5 | Add a search interface to assign policies | ibmcnx/cnx/LibraryPolicies.py | ibmcnx/cnx/LibraryPolicies.py | ######
# Work with Libraries - add policies
#
# Author: Christoph Stoettner
# Mail: christoph.stoettner@stoeps.de
# Documentation: http://scripting101.stoeps.de
#
# Version: 2.0
# Date: 2014-06-04
#
# License: Apache 2.0
#
# TODO: Create a Search Filter to get a list of lib... | Python | 0 | @@ -3793,25 +3793,25 @@
find('id=')+
-5
+3
:result.find
@@ -3818,18 +3818,18 @@
('id=')+
-41
+39
%5D%0A
@@ -3865,17 +3865,18 @@
nd('
-nam
+titl
e=')+
-5
+6
:res
@@ -3881,25 +3881,34 @@
esult.find('
-i
+ownerUserI
d=')-2%5D%0A
@@ -5403,16 +5403,29 @@
100 )%0A%0A
+LibDetails =
getLibra
@@ -5469,16 ... |
e1530b228d54c9d8d3d5b11070d8b70692068dfd | Handle nil internaldate values | imapclient/response_parser.py | imapclient/response_parser.py | # Copyright (c) 2014, Menno Smits
# Released subject to the New BSD License
# Please see http://en.wikipedia.org/wiki/BSD_licenses
"""
Parsing for IMAP command responses with focus on FETCH responses as
returned by imaplib.
Initially inspired by http://effbot.org/zone/simple-iterator-parser.htm
"""
# TODO more exact... | Python | 0.000279 | @@ -4759,24 +4759,155 @@
imes=True):%0A
+ # Observed in https://sentry.nylas.com/sentry/sync-prod/group/5907/%0A if date_string.upper() == b'NIL':%0A return None%0A%0A
try:%0A
|
5b8725caecd01ccb4d0d3e0c40b910cbdf19258b | Fix country form input | spotify_country_top_n.py | spotify_country_top_n.py | import requests
import webbrowser
import json
import urllib.request
import urllib.parse
import re
token = "Bearer " + input("OAuth Token: ") #BQDWxOubOFzx8fjeDi9E3Npt_fd9GiGXVgdiC3tS9LWHgajM3dRe2w3DjVVtjv0ZgHZAKt6zw2cD9PEBcLf-TFxtpOnb89THvPNMH-gbAO9Ho_8eSchxzO7JdaQ1Rg6eLBmzGIPjUp-5NM9Umpk62uKuAwPw7kSB0fb_B1uYdR... | Python | 0.999745 | @@ -590,16 +590,43 @@
%22Country
+ in ISO 3166-1 alpha-2 form
: %22),%0D%0A
|
3168e8b43e77a10c54a57345d2c06f9f4e4800c7 | Allow Parameters to set defaults for TemplateResource | heat/engine/resources/template_resource.py | heat/engine/resources/template_resource.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
#
# 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 applicab... | Python | 0.000037 | @@ -2702,16 +2702,17 @@
ontinue%0A
+%0A
@@ -2719,40 +2719,64 @@
-elif v.type() == properties.LIST
+val = self.properties%5Bn%5D%0A%0A if val is not None
:%0A
@@ -2855,55 +2855,38 @@
-val = self.properties%5Bn%5D%0A if val
+if v.type() == properties.LIST
:%0A
@@ -29... |
21f0c1294afc4cd53c0212dbf051744a8bb222a8 | fix bugs | skitai/corequest/httpbase/sync_proxy.py | skitai/corequest/httpbase/sync_proxy.py | # testing purpose WAS sync service
from . import task
from rs4 import webtest
from rs4.cbutil import tuple_cb
import random
from urllib.parse import urlparse, urlunparse
from skitai import exceptions
import xmlrpc.client
import sys
from aquests.client import synconnect
class RPCResponse:
def __init__ (self... | Python | 0.000001 | @@ -995,24 +995,37 @@
sponse =
+ None, expt =
None):%0A
@@ -1008,32 +1008,32 @@
, expt = None):%0A
-
self.sta
@@ -1077,24 +1077,51 @@
= response
+%0A self.__expt = expt
%0A %0A
@@ -1755,24 +1755,20 @@
self.__
-response
+expt
:
@@ -1798,24 +1798,20 @@
self.__
-respo... |
195f0d5eec3d69ae6ffb1a52d151ad72fcb027a6 | Shorten the may_fail_with_warning GM comparison list | slave/skia_slave_scripts/compare_gms.py | slave/skia_slave_scripts/compare_gms.py | #!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
""" Compare the generated GM images to the baselines """
# System-level imports
import os
import sys
from build_step import Build... | Python | 0.999966 | @@ -716,906 +716,61 @@
x86-
-Debug',%0A 'Test-Ubuntu12-ShuttleA-ATI5770-x86-Debug-Trybot',%0A 'Test-Ubuntu12-ShuttleA-ATI5770-x86-Release',%0A 'Test-Ubuntu12-ShuttleA-ATI5770-x86-Release-Trybot',%0A 'Test-Win7-ShuttleA-HD2000-x86_64-Debug',%0A 'Test-Win7-ShuttleA-HD2000-x86_64-Debug-... |
d27c91b9fed08970685d0908ad25397f5d16defb | Use DeviceInfo in tasmota (#58604) | homeassistant/components/tasmota/mixins.py | homeassistant/components/tasmota/mixins.py | """Tasmota entity mixins."""
from __future__ import annotations
import logging
from typing import Any
from hatasmota.entity import (
TasmotaAvailability as HATasmotaAvailability,
TasmotaEntity as HATasmotaEntity,
TasmotaEntityConfig,
)
from hatasmota.models import DiscoveryHashType
from homeassistant.com... | Python | 0 | @@ -2005,10 +2005,32 @@
urn
-%7B%22
+DeviceInfo(%0A
conn
@@ -2040,11 +2040,9 @@
ions
-%22:
+=
%7B(CO
@@ -2089,17 +2089,26 @@
ty.mac)%7D
-%7D
+%0A )
%0A%0A @p
|
3bbd08d9c9c1397fc03c6ff05f0d8e400eccc960 | Use ColorMode enum in unifiled (#70548) | homeassistant/components/unifiled/light.py | homeassistant/components/unifiled/light.py | """Support for Unifi Led lights."""
from __future__ import annotations
import logging
from unifiled import unifiled
import voluptuous as vol
from homeassistant.components.light import (
ATTR_BRIGHTNESS,
COLOR_MODE_BRIGHTNESS,
PLATFORM_SCHEMA,
LightEntity,
)
from homeassistant.const import CONF_HOST, ... | Python | 0 | @@ -211,35 +211,8 @@
-COLOR_MODE_BRIGHTNESS,%0A
PLAT
@@ -222,16 +222,31 @@
M_SCHEMA
+,%0A ColorMode
,%0A Li
@@ -1793,26 +1793,25 @@
mode = C
-OLOR_MODE_
+olorMode.
BRIGHTNE
@@ -1853,18 +1853,17 @@
= %7BC
-OLOR_MODE_
+olorMode.
BRIG
|
74b41eb7c2953a5dbb8146730da18d562aad9d3e | fix hdx tests | hdx_exports/tests/test_hdx_export_set.py | hdx_exports/tests/test_hdx_export_set.py | # -*- coding: utf-8 -*-
import json
import unittest
from hdx_exports.hdx_export_set import HDXExportSet
from feature_selection.feature_selection import FeatureSelection
from django.contrib.gis.geos import GEOSGeometry
from hdx.data.hdxobject import HDXError
DAKAR_GEOJSON_POLYGON = json.dumps({
"type": "Polyg... | Python | 0.000001 | @@ -1236,32 +1236,47 @@
et(%0A
+dataset_prefix=
%22hot_dakar%22,%0A
@@ -1276,32 +1276,37 @@
r%22,%0A
+name=
%22Dakar Urban Are
@@ -1313,32 +1313,39 @@
a%22,%0A
+extent=
DAKAR_GEOJSON_PO
@@ -1425,32 +1425,50 @@
ct?%0A
+feature_selection=
BASIC_FEATURE_SE
@@ -148... |
a51a07cd8d1ee6f38fbe34be0530b7d208e8579b | Use pytest skipif in test_ssh | into/backends/tests/test_ssh.py | into/backends/tests/test_ssh.py | from __future__ import absolute_import, division, print_function
import pytest
paramiko = pytest.importorskip('paramiko')
import pandas as pd
import numpy as np
import re
import os
import sys
from into.utils import tmpfile, filetext
from into.directory import _Directory, Directory
from into.backends.ssh import SSH, ... | Python | 0.000001 | @@ -521,16 +521,8 @@
port
- skipif,
ON_
@@ -546,16 +546,45 @@
socket%0A%0A
+skipif = pytest.mark.skipif%0A%0A
try:%0A
@@ -4621,36 +4621,24 @@
)).all()%0A%0A%0A@
-pytest.mark.
skipif(ON_TR
@@ -4677,36 +4677,24 @@
== (3, 3),%0A
-
reas
@@ -5282,28 +5282,16 @@
(b))%0A%0A%0A@
-pytest.mark.
... |
8b5828d88cca103a86eeb9cd243b1be311353f9f | Fix bug in constructing the base search url in sadmin | selvbetjening/sadmin2/views/generic.py | selvbetjening/sadmin2/views/generic.py | from django.contrib import messages
from django.core.paginator import Paginator, PageNotAnInteger, EmptyPage
from django.http.response import HttpResponseRedirect
from django.shortcuts import render
from django.conf import settings
from selvbetjening.sadmin2.decorators import sadmin_prerequisites
from selvbetjening.sa... | Python | 0.000001 | @@ -3413,24 +3413,160 @@
num_pages)%0A%0A
+ if getattr(settings, 'FORCE_SCRIPT_NAME', None) is None:%0A prefix = ''%0A else:%0A prefix = settings.FORCE_SCRIPT_NAME%0A%0A
context.
@@ -3718,50 +3718,14 @@
%25 (
-getattr(settings, 'FORCE_SCRIPT_NAME', '')
+prefix
, re
|
0f8595e8a7e8b423f3dd7205b9aa84a11830fcf1 | Fix retry when Met config entry fails (#70012) | homeassistant/components/met/__init__.py | homeassistant/components/met/__init__.py | """The met component."""
from __future__ import annotations
from collections.abc import Callable
from datetime import timedelta
import logging
from random import randrange
from types import MappingProxyType
from typing import Any
import metno
from homeassistant.config_entries import ConfigEntry
from homeassistant.co... | Python | 0 | @@ -519,16 +519,72 @@
sistant%0A
+from homeassistant.exceptions import HomeAssistantError%0A
from hom
@@ -958,16 +958,69 @@
AIN,%0A)%0A%0A
+# Dedicated Home Assistant endpoint - do not change!%0A
URL = %22h
@@ -2597,16 +2597,104 @@
ad_ok%0A%0A%0A
+class CannotConnect(HomeAssistantError):%0A %22%22%22Unable to c... |
e851fc13dc8061464fcd0a551b320b915c0cca52 | Fix deleting and readding nws entry (#34555) | homeassistant/components/nws/__init__.py | homeassistant/components/nws/__init__.py | """The National Weather Service integration."""
import asyncio
import datetime
import logging
from pynws import SimpleNWS
import voluptuous as vol
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import CONF_API_KEY, CONF_LATITUDE, CONF_LONGITUDE
from homeassistant.core import HomeAssista... | Python | 0 | @@ -1584,45 +1584,8 @@
%22%22%22%0A
- hass.data.setdefault(DOMAIN, %7B%7D)%0A
@@ -2824,30 +2824,78 @@
)%0A
-%0A
-hass.data%5BDOMAIN%5D
+nws_hass_data = hass.data.setdefault(DOMAIN, %7B%7D)%0A nws_hass_data
%5Bent
|
18f9017b7eb627e1b56096f16bad02095cfbfa53 | Return appropriate JSON when CSRF token fails | alexandria/views/user.py | alexandria/views/user.py | import logging
log = logging.getLogger(__name__)
from pyramid.view import (
view_config,
view_defaults,
)
from pyramid.exceptions import BadCSRFToken
from pyramid.httpexceptions import (
HTTPSeeOther,
HTTPNotFound,
HTTPUnprocessableEntity,
HTTPBadRequest,
... | Python | 0.000067 | @@ -2855,16 +2855,377 @@
equest.response%0A
+%0A @view_config(%0A context=BadCSRFToken,%0A containment='..traversal.User',%0A renderer='json',%0A )%0A def bad_csrf(self):%0A self.request.response.status = 400%0A return %7B%0A 'errors': %7B%... |
bfb4a1c3b2363d0c1288ae201567840583dbb8a1 | Add lat/lng to cafe and roaster models. | pdxroasters/roaster/models.py | pdxroasters/roaster/models.py | import re
from django.db import models
from django.template.defaultfilters import slugify
def format_phone_number(phone):
phone = re.sub('[^\w]', '', phone)
if (len(phone) == 10):
return '(%s) %s-%s' % (phone[:3], phone[3:6], phone[6:10])
else:
return ''
class Cafe(models.Model):
name... | Python | 0 | @@ -495,32 +495,204 @@
0, blank=True,)%0A
+ lat = models.DecimalField(max_digits=9, decimal_places=6, blank=True, null=True,)%0A lng = models.DecimalField(max_digits=9, decimal_places=6, blank=True, null=True,)%0A
# TODO: Hour
@@ -1514,32 +1514,204 @@
ld(blank=True,)%0A
+ lat = models.DecimalField(max_d... |
a1052c02a11539d34a7c12c7a86d103c2b445b52 | Fix and improve BRIEF example | doc/examples/plot_brief.py | doc/examples/plot_brief.py | """
=======================
BRIEF binary descriptor
=======================
This example demonstrates the BRIEF binary description algorithm.
The descriptor consists of relatively few bits and can be computed using
a set of intensity difference tests. The short binary descriptor results
in low memory footprint and ve... | Python | 0.000002 | @@ -378,17 +378,8 @@
c.%0A%0A
-However,
BRIE
@@ -416,22 +416,19 @@
variance
- and s
+. S
cale-inv
@@ -441,17 +441,17 @@
e can be
-%0A
+
achieved
@@ -453,17 +453,17 @@
ieved by
-
+%0A
detectin
@@ -514,175 +514,8 @@
s.%0A%0A
-The ORB feature detection and binary description algorithm is an extension to%0Athe ... |
dc3aa4f174e2d29c93f1cd54be933e3aa95010b5 | fix construction of WorkflowInformation | sldc/chaining.py | sldc/chaining.py | # -*- coding: utf-8 -*-
from abc import ABCMeta, abstractmethod
from shapely.affinity import translate
from information import ChainInformation, WorkflowInformationCollection, WorkflowInformation
from sldc import ImageWindow
from logging import Loggable, SilentLogger
__author__ = "Romain Mormont <r.mormont@student.... | Python | 0 | @@ -3328,16 +3328,20 @@
%5B%5D, %5B%5D,
+ %5B%5D,
None)%0A
|
284befadcfd3e4785067d827c67958d01b80d4a2 | fix method name (underscore prefix) | perfrunner/tests/rebalance.py | perfrunner/tests/rebalance.py | import time
from perfrunner.tests import PerfTest
from multiprocessing import Event
def with_delay(method):
def wrapper(self, *args, **kwargs):
time.sleep(self.rebalance_settings.start_after)
method(self, *args, **kwargs)
time.sleep(self.rebalance_settings.stop_after)
self.shutdo... | Python | 0.000001 | @@ -1006,17 +1006,16 @@
def
-_
run(self
|
f12904db6c83f4914018e385edce0d1757e030fc | Add memory quota for r4.8xlarge instances | perfrunner/utils/templater.py | perfrunner/utils/templater.py | from argparse import ArgumentParser
import yaml
from jinja2 import Environment, FileSystemLoader, Template
from logger import logger
from perfrunner.utils.cloudrunner import CloudRunner
MEMORY_QUOTAS = {
'm4.2xlarge': 26624, # 32GB RAM
'm4.4xlarge': 56320, # 64GB RAM
'r4.2xlarge': 54272, # 61GB RAM... | Python | 0 | @@ -353,16 +353,55 @@
2GB RAM%0A
+ 'r4.8xlarge': 209920, # 244GB RAM%0A
%7D%0A%0AOUTPU
|
b719bd4faf4c852b71dc185bb389707577a29516 | refactor code. | clothing/models.py | clothing/models.py | from django.core.exceptions import ValidationError
from django.db import models
from django.utils.translation import ugettext_lazy as _
from ophasebase.models import Ophase
from staff.models import Person
class Type(models.Model):
class Meta:
verbose_name = _("Art")
verbose_name_plural = _("Arten... | Python | 0.000006 | @@ -1233,16 +1233,21 @@
last
+_char
= input
@@ -1316,21 +1316,16 @@
-base_
value =
@@ -1352,35 +1352,8 @@
:30%7D
-%0A value = base_value
.get
@@ -1357,16 +1357,21 @@
get(last
+_char
, 0)%0A%0A
@@ -1463,108 +1463,41 @@
e =
-0%0A if last == 'L':%0A x_value = 1%0A ... |
d42bc1bb41ef443104e6a5853e6d75fbbb0d7a4a | add debug mesg `instance in instance list` | clustercron/elb.py | clustercron/elb.py | # clustercron/elb.py
# vim: ts=4 et sw=4 sts=4 ft=python fenc=UTF-8 ai
# -*- coding: utf-8 -*-
'''
clustercron.elb
---------------
'''
from __future__ import unicode_literals
import logging
import socket
import boto.ec2.elb
from .compat import PY3
if PY3:
from urllib.request import Request
from urllib.requ... | Python | 0 | @@ -2130,24 +2130,352 @@
_service%5B0%5D%0A
+ logger.debug('This instance master: %25s', res)%0A logger.debug(%0A 'This instance in %60instances in service%60 list: %25s',%0A instance_id in instances_in_service%0A )%0A logger.debug(%0A 'This instance in %60a... |
b75e7c633e72bd2df62d8a2dabe2240b8a1815fd | Add examples to the sub-commands | pip/commands/configuration.py | pip/commands/configuration.py | import logging
import os
import subprocess
from pip.basecommand import Command
from pip.configuration import Configuration, kinds
from pip.exceptions import PipError
from pip.locations import venv_config_file
from pip.status_codes import SUCCESS, ERROR
from pip.utils import get_prog
logger = logging.getLogger(__name_... | Python | 0.000005 | @@ -4632,14 +4632,22 @@
rgs,
+ %22list%22,
n=0)%0A
-
%0A
@@ -4818,32 +4818,46 @@
get_n_args(args,
+ %22get %5Bname%5D%22,
n=1)%0A va
@@ -5019,16 +5019,38 @@
gs(args,
+ %22set %5Bname%5D %5Bvalue%5D%22,
n=2)%0A
@@ -5210,16 +5210,32 @@
gs(args,
+ %22unset %5Bname%5D%22,
n=1)%0A
@@ -5849,19 +584... |
624745fbb311877f5b2251cf3eefe0cc15b5cca2 | add some code for document | pagrant/commands/test.py | pagrant/commands/test.py | #!/usr/bin/python
#coding:utf8
__author__ = ['markshao']
import os
from optparse import Option
from nose import main
from pagrant.basecommand import Command
from pagrant.commands.init import PAGRANT_CONFIG_FILE_NAME
from pagrant.environment import Environment
from pagrant.exceptions import PagrantConfigError, TestE... | Python | 0.000002 | @@ -397,16 +397,30 @@
ptions%5D
+%5Bnose-options%5D
%22%22%22%0A
@@ -755,16 +755,164 @@
=False,%0A
+ help=%22if set --newvm , the test will fisrt create the new vm against %22 %5C%0A %22the Pagrantfile and destroy them after test%22%0A
|
3f147f229692329181da14217d095556fd5d2f92 | move post-mortem and profile back to the pairsamtools base | pairsamtools/__init__.py | pairsamtools/__init__.py | # -*- coding: utf-8 -*-
"""
pairsamtools
~~~~~~~~~~~~
CLI tools to process mapped Hi-C data
:copyright: (c) 2017 Massachusetts Institute of Technology
:author: Mirny Lab
:license: MIT
"""
__version__ = '0.0.1-dev'
import click
import functools
import sys
CONTEXT_SETTINGS = {
'help_option_names': ['-h', '--he... | Python | 0 | @@ -418,27 +418,943 @@
GS)%0A
-def cli():%0A pass
+@click.option(%0A '--post-mortem', %0A help=%22Post mortem debugging%22, %0A is_flag=True,%0A default=False%0A)%0A%0A@click.option(%0A '--output-profile', %0A help=%22Profile performance with Python cProfile and dump the statistics %22%0A ... |
298163b0e765de364fe1f9eef2c1cc783f3c7404 | Add FloatArgument | pale/arguments/number.py | pale/arguments/number.py | from pale.errors.validation import ArgumentError
from .base import BaseArgument
class IntegerArgument(BaseArgument):
value_type = 'integer'
allowed_types = (int, long)
min_value = None
max_value = None
def validate(self, item, item_name):
if item is None:
item = self.default
... | Python | 0.000001 | @@ -1847,8 +1847,1776 @@
urn doc%0A
+%0A%0Aclass FloatArgument(BaseArgument):%0A value_type = 'float'%0A allowed_types = (float, )%0A min_value = None%0A max_value = None%0A%0A def validate(self, item, item_name):%0A if item is None:%0A item = self.default%0A%0A if item is None:... |
f3517847990f2007956c319a7784dbfc2d73b91a | Remove formatting | ellipsis.py | ellipsis.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
import os
import subprocess
import sys
cwd = os.getcwd()
home = os.getenv('HOME')
devnull = open(os.devnull, 'w')
def find_svn_root(path):
try:
svn_cmd = ['/usr/bin/svn', 'info']
svn_info = subprocess.check_output(svn_cmd, stderr=devnull).decode()
... | Python | 0.000035 | @@ -1000,66 +1000,8 @@
-1%5D%0A
- git_tag = %22%5C033%5B1;31m%7B0%7D%5C033%5B1;37m%22.format(repo_name)%0A
@@ -1098,67 +1098,8 @@
-1%5D%0A
- svn_tag = %22%5C033%5B1;34m%7B0%7D%5C033%5B1;37m%22.format(repo_name)%0A
@@ -1130,15 +1130,17 @@
ot,
-svn_tag
+repo_name
)%0Ael
@@ -1352,46 +1352,9 @@
int... |
3fcda3af7062ff8681f0ec096b896ba862495944 | Update page_set_smoke_test to check for mix states in page set. | tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py | tools/telemetry/telemetry/unittest_util/page_set_smoke_test.py | # Copyright 2014 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import logging
import os
import unittest
from telemetry.core import browser_credentials
from telemetry.core import discover
from telemetry.page import page_... | Python | 0 | @@ -456,16 +456,156 @@
Case):%0A%0A
+ def setUp(self):%0A # Make sure the added failure message is appended to the default failure%0A # message.%0A self.longMessage = True%0A%0A
def Ch
@@ -4506,24 +4506,590 @@
lay_name))%0A%0A
+ def CheckSharedStates(self, page_set):%0A if not page_set.allow_mixed_st... |
fa40dfcca214011b85c8bf081bc55b4f534acf24 | Fix cors 'l's | jal_stats/jal_stats/settings.py | jal_stats/jal_stats/settings.py | """
Django settings for jal_stats project.
Generated by 'django-admin startproject' using Django 1.8.5.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build pa... | Python | 0.000128 | @@ -3345,18 +3345,18 @@
ORIGIN_A
-ll
+LL
OW_ALL =
|
c9ed81608ea6d017dbe23e012d0e137c1ce9ef10 | remove eddy from test | neurodocker/interfaces/tests/test_fsl.py | neurodocker/interfaces/tests/test_fsl.py | """Tests for neurodocker.interfaces.FSL"""
from neurodocker.interfaces.tests import utils
class TestFSL(object):
def test_docker(self):
specs = {
'pkg_manager': 'yum',
'instructions': [
('base', 'centos:7'),
('fsl', {'version': '5.0.10', 'eddy_5011... | Python | 0.000003 | @@ -299,37 +299,18 @@
: '5.0.1
-0', 'eddy_5011': True
+1'
%7D),%0A
|
0a98e91d5b30e5282ad90cfedcf0162ce290a0e9 | fix many replace player_config | flowplayer/templatetags/flowplayer_tags.py | flowplayer/templatetags/flowplayer_tags.py | from django.conf import settings
from django.db.models.query import QuerySet
from django.template import Node, TemplateSyntaxError
from django.template import Library, Variable, loader, Context
# ID of current flowplayer being rendered (global to ensure unique)
FLOWPLAYER_ITERATOR = 0
register = Library()
class Flo... | Python | 0.000001 | @@ -1037,16 +1037,47 @@
A_URL)%0A%0A
+ def render(self, context):%0A
@@ -1403,24 +1403,29 @@
%0A if
+self.
player_class
@@ -1521,16 +1521,21 @@
_CONFIG%5B
+self.
player_c
@@ -1546,40 +1546,8 @@
%5D)%0A%0A
- def render(self, context):%0A%0A
|
3355ca79a507254e5b3e7149070ae263afc6f292 | Bump up number of active runs to 20k. | tracker/src/main/workflows/filter-variants-workflow/filter-variants-workflow.py | tracker/src/main/workflows/filter-variants-workflow/filter-variants-workflow.py | from airflow import DAG
from airflow.operators import BashOperator, PythonOperator
from datetime import datetime, timedelta
import os
import logging
from subprocess import call
import tracker.model
from tracker.model.analysis_run import *
from tracker.util.workflow_common import *
def filter_variants(**kwargs):
... | Python | 0 | @@ -2177,17 +2177,17 @@
urrency=
-1
+2
0000, ma
@@ -2204,16 +2204,17 @@
uns=2000
+0
)%0A%0A%0Astar
|
d6b361411b4414e5841652b513ef42b13f34169e | Test for high overlap | fmriprep/workflows/bold/tests/test_util.py | fmriprep/workflows/bold/tests/test_util.py | ''' Testing module for fmriprep.workflows.bold.util '''
import pytest
import os
import numpy as np
from nipype.utils.filemanip import fname_presuffix
from nilearn.image import load_img
from ..util import init_bold_reference_wf
def symmetric_overlap(img1, img2):
mask1 = load_img(img1).get_data() > 0
mask2 = l... | Python | 0 | @@ -2288,9 +2288,9 @@
lap
-%3C
+%3E
0.9
|
fa4ce93305c30a2a2974e73314e0726e46caff9e | Comment out some unused overridden methods (that wouldn't have worked anyway yet). Also, change the get_*_thumbnail_tag method to escape rather than urlquote the url (it's already been through iri_to_uri, but it could contain an ampersand) | sorl/thumbnail/fields.py | sorl/thumbnail/fields.py | import os.path
from django.db.models.fields import ImageField
from django.utils.html import urlquote
from django.utils.safestring import mark_safe
from django.utils.functional import curry
from django.conf import settings
from main import DjangoThumbnail
REQUIRED_ARGS = ('size',)
ALL_ARGS = {
'size': 'requested_... | Python | 0.000027 | @@ -60,47 +60,8 @@
eld%0A
-from django.utils.html import urlquote%0A
from
@@ -144,16 +144,53 @@
t curry%0A
+from django.utils.html import escape%0A
from dja
@@ -247,16 +247,62 @@
humbnail
+%0A#from utils import delete_thumbnails (TODO:)
%0A%0AREQUIR
@@ -2342,24 +2342,81 @@
_func)%0A%0A
+# TODO: saving the f... |
4824b929bfa7a18a9f7796a9b93ad17909feeb56 | Switch parameter has been added. | lib/opentuner/streamjit/sjparameters.py | lib/opentuner/streamjit/sjparameters.py | import deps #fix sys.path
import opentuner
from opentuner.search.manipulator import (IntegerParameter,
FloatParameter)
class sjIntegerParameter(IntegerParameter):
def __init__(self, name, min, max,value, javaClassPath = None, **kwargs):
self.value = value
self.javaClassPa... | Python | 0 | @@ -152,16 +152,33 @@
arameter
+, SwitchParameter
)%0A%0Aclass
@@ -868,119 +868,810 @@
Path
-%09%09%0A%0Aif __name__ == '__main__':%0A%09ip = IntegerParameter(%22suman%22, 2, 7)%0A%09sjip = sjIntegerParameter(%22ss%22, 3, 56, 45
+%0A%0Aclass sjSwitchParameter(SwitchParameter):%0A%09def __init__(self, name, universeT... |
d6ff7f066c99f33eb88094e117283dc303df6a38 | Add pkcs12 module to binding | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "trusted",
"sources": [
"src/node/main.cpp",
"src/node/helper.cpp",
"src/node/stdafx.cpp",
"src/node/utils/wlog.cpp",
"src/node/utils/wrap.cpp",
"src/node/p... | Python | 0 | @@ -838,32 +838,76 @@
ki/wchain.cpp%22,%0A
+ %22src/node/pki/wpkcs12.cpp%22,%0A
@@ -1951,32 +1951,78 @@
ki/cipher.cpp%22,%0A
+ %22src/wrapper/pki/pkcs12.cpp%22,%0A
|
531dcc85b3579712ab5576a50e7dd10457444fb4 | remove old class definitions | ecmwf_models/__init__.py | ecmwf_models/__init__.py | import pkg_resources
try:
__version__ = pkg_resources.get_distribution(__name__).version
except:
__version__ = 'unknown'
from ecmwf_models.interface import ERAInterimImg
from ecmwf_models.interface import ERAInterimDs
| Python | 0.999965 | @@ -127,102 +127,4 @@
wn'%0A
-%0Afrom ecmwf_models.interface import ERAInterimImg%0Afrom ecmwf_models.interface import ERAInterimDs%0A
|
977cf58125a204010197c95827457843503e2c5b | Disable BSF Campus for RCA Alliance Française | ideascube/conf/kb_rca_alliancefrancaise.py | ideascube/conf/kb_rca_alliancefrancaise.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'Alliance française de Bangui'
| Python | 0 | @@ -133,8 +133,110 @@
Bangui'%0A
+%0A# Disable BSF Campus for now%0AHOME_CARDS = %5Bcard for card in HOME_CARDS if card%5B'id'%5D != 'bsfcampus'%5D%0A
|
5ba36cb51fc2d93dd05430c3f5a0d24262b32985 | Remove unnecessary type change | common/gradient.py | common/gradient.py | # coding: utf-8
import numpy as np
def _numerical_gradient_1d(f, x):
h = 1e-4 # 0.0001
grad = np.zeros_like(x)
for idx in range(x.size):
tmp_val = x[idx]
x[idx] = float(tmp_val) + h
fxh1 = f(x) # f(x+h)
x[idx] = tmp_val - h
fxh2 = f(x) # f(x-h)
... | Python | 0.000003 | @@ -934,38 +934,31 @@
x%5Bidx%5D =
-float(
tmp_val
-)
+ h%0A
@@ -1161,28 +1161,29 @@
%0A %0A return grad
+%0A
|
6c7a5078a44aced7e406321077288211f5887e48 | use wildcards, add include dir | binding.gyp | binding.gyp | {
"targets": [
{
"target_name": "test",
"type": "executable",
"sources": [
"CppUnitLite/StackTest.cpp",
"CppUnitLite/StackMain.cpp",
"src/test/hello.cc"
],
"libraries": [
"Release/libCppUnitLite"
],
"include_dirs": [
"."
],
... | Python | 0 | @@ -188,13 +188,29 @@
est/
-hello
+*.cc%22,%0A %22src/*
.cc%22
@@ -318,16 +318,64 @@
%22.%22
+,%0A %22INCHI-1-API/INCHI_API%22,%0A %22src%22
%0A %5D
@@ -833,16 +833,83 @@
inchi%22,%0A
+ %22include_dirs%22: %5B%0A %22./INCHI-1-API/INCHI_API%22%0A %5D,%0A
%22s
@... |
ab42cc26e8a994974cb5beb1550715e6f838d7cb | fix file outputting | BUN/bunpack.py | BUN/bunpack.py | #!/usr/bin/env python
import struct, sys
from PIL import Image
u8 = struct.Struct('<B')
def convert_palette(pal):
result = []
s = struct.Struct('<BBB')
for i in range(len(pal) // 3):
result.append(s.unpack_from(pal, i * 3))
return result
def extract_image(data, offset, pal):
width = u8.unpack_from(data, of... | Python | 0.000003 | @@ -1525,16 +1525,19 @@
it(path)
+%5B1%5D
%0A %0A tr
@@ -2093,16 +2093,169 @@
4)%5B0%5D)%0A%0A
+ if not os.path.exists(filename):%0A try:%0A os.mkdir(filename)%0A except:%0A print('Unable to create path ' + filename + '!')%0A return%0A
%0A for i
|
d5cb8ea39236f52f3ee9d2f9f8485dc5f737a5bb | Send a message every few minutes to keep Travis happy | allTests.py | allTests.py | #!/usr/bin/env python
#Copyright (C) 2011 by Benedict Paten (benedictpaten@gmail.com)
#
#Released under the MIT license, see LICENSE.txt
import unittest
import os
from cactus.setup.cactus_setupTest import TestCase as setupTest
from cactus.blast.cactus_blastTest import TestCase as blastTest
from cactus.pipeline.cactus... | Python | 0 | @@ -156,16 +156,57 @@
mport os
+%0Afrom threading import Thread%0Aimport time
%0A%0Afrom c
@@ -1213,16 +1213,203 @@
orTest%0A%0A
+def keepAlive():%0A %22%22%22Keep Travis tests from failing prematurely by outputting to stdout every few minutes.%22%22%22%0A while True:%0A time.sleep(240)%0A print ... |
56dfbeb33a07661ce0cecb176143b6613bfef147 | Add setter for option settings | pentai/gui/my_setting.py | pentai/gui/my_setting.py | from kivy.uix.gridlayout import GridLayout
from kivy.uix.checkbox import CheckBox
from kivy.uix.slider import Slider
from kivy.uix.label import Label
from kivy.clock import Clock
from kivy.properties import *
from kivy.uix.spinner import Spinner, SpinnerOption
from kivy.config import Config
import pentai.gui.scale as... | Python | 0.000001 | @@ -1816,24 +1816,25 @@
alue = val%0A%0A
+%0A
class MySpin
@@ -3059,17 +3059,17 @@
nt_x = .
-5
+6
%0A
@@ -3259,32 +3259,37 @@
get(l)%0A%0A
+self.
dl = TinyLabel(t
@@ -3311,16 +3311,21 @@
+self.
dl.size_
@@ -3352,32 +3352,37 @@
self.add_widget(
+self.
dl)%0A%0A sel
@@ -3540,32 +3... |
a94bbac73a40f85e0239bbab72c0ffce5258f707 | Update test_geocoding.py | _unittests/ut_data/test_geocoding.py | _unittests/ut_data/test_geocoding.py | # -*- coding: utf-8 -*-
"""
@brief test log(time=16s)
"""
import os
import unittest
import warnings
import pandas
from pyquickhelper.loghelper import fLOG
from pyquickhelper.pycode import add_missing_development_version, get_temp_folder, is_travis_or_appveyor, ExtTestCase
class TestGeocoding(ExtTestCase):
d... | Python | 0.000001 | @@ -152,16 +152,30 @@
ort fLOG
+, get_password
%0Afrom py
@@ -200,16 +200,22 @@
import
+(%0A
add_miss
@@ -278,16 +278,20 @@
ppveyor,
+%0A
ExtTest
@@ -294,16 +294,17 @@
TestCase
+)
%0A%0A%0Aclass
@@ -1130,140 +1130,8 @@
key%0A
- with warnings.catch_warnings():%0A warnings.simplefilte... |
3a29127f6d11c06c4cdba7c9e41ff64b0204830e | Update to 0.8.4 version | spec_cleaner/__init__.py | spec_cleaner/__init__.py | # vim: set ts=4 sw=4 et: coding=UTF-8
# Copyright (c) 2015, SUSE LINUX Products GmbH, Nuernberg, Germany
# All rights reserved.
# See COPYING for details.
import os
import sys
import argparse
from .rpmexception import RpmWrongArgs, RpmException
from .rpmcleaner import RpmSpecCleaner
__version__ = '0.8.3'
def pro... | Python | 0 | @@ -305,9 +305,9 @@
0.8.
-3
+4
'%0A%0A%0A
|
3449961b6d2fbfaaa44c773ef3a60b3d6386d00a | Add strain energy | peripydic/problem/dic.py | peripydic/problem/dic.py | # -*- coding: utf-8 -*-
#@author: ilyass.tabiai@polymtl.ca
#@author: rolland.delorme@polymtl.ca
#@author: patrick.diehl@polymtl.ca
from ..util import neighbor
import numpy as np
## Copmutes extension and force states out of displacement/nodes data obtained
# from the VIC3D CSV (DIC data)
class DIC_problem():
## ... | Python | 0.000007 | @@ -1407,16 +1407,29 @@
t_class)
+%0A
%0A%0A
@@ -1465,17 +1465,69 @@
ry.act)%0A
+ self.strain_energy = mat_class.strain_energy
%0A
-
## C
@@ -1563,16 +1563,16 @@
PD node%0A
-
# @p
@@ -1593,32 +1593,33 @@
object containi
+n
g data from the
|
6ed431ad8c41e678ed8362054a1d6404b9b48bab | Apply MyPy rule. | compile_api_doc.py | compile_api_doc.py | # -*- coding: utf-8 -*-
"""Compile documentation from modules."""
__author__ = "Yuan Chang"
__copyright__ = "Copyright (C) 2016-2020"
__license__ = "AGPL"
__email__ = "pyslvs@gmail.com"
from typing import get_type_hints, List, Iterator, Iterable, Any
from types import ModuleType
from os import walk
from os.path impo... | Python | 0 | @@ -546,22 +546,16 @@
ist%5Bstr%5D
- = ...
%0A __p
@@ -574,14 +574,8 @@
str%5D
- = ...
%0A%0A%0Ad
|
9485b8d16bc41f20de0dbce0c4bc253d6dcca206 | Fix file size type in EditingRevisionFileSchema | indico/modules/events/editing/schemas.py | indico/modules/events/editing/schemas.py | # This file is part of Indico.
# Copyright (C) 2002 - 2019 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
from markupsafe import escape
from marshmallow import fields, pos... | Python | 0.000001 | @@ -1665,38 +1665,35 @@
size = fields.
-String
+Int
(attribute='file
|
9ca7135ac70fdddff3d193dc34692205fb5d6339 | Update the editable service endpoint | indico/modules/events/editing/service.py | indico/modules/events/editing/service.py | # This file is part of Indico.
# Copyright (C) 2002 - 2020 CERN
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the MIT License; see the
# LICENSE file for more details.
from __future__ import unicode_literals
import requests
from werkzeug.urls import url_parse
import indic... | Python | 0.000001 | @@ -5164,32 +5164,19 @@
/%7B%7D/
-contributions/%7B%7D/editing
+editable/%7B%7D
/%7B%7D'
@@ -5260,23 +5260,17 @@
ble.
-contribution_id
+type.name
,%0A
@@ -5288,25 +5288,32 @@
ditable.
-type.name
+contribution_id,
%0A
|
5a532efd860ad764f11412bf4cde51e00068c08f | Test deleting metadata | spiff/inventory/tests.py | spiff/inventory/tests.py | """
This file demonstrates writing tests using the unittest module. These will pass
when you run "manage.py test".
Replace this with more appropriate tests for your application.
"""
from django.test import TestCase
from spiff.api.tests import APITestMixin, withPermission, withLogin, withoutPermission
import models
c... | Python | 0.000001 | @@ -1623,16 +1623,456 @@
alue')%0A%0A
+ @withPermission('inventory.read_resource')%0A @withPermission('inventory.read_metadata')%0A @withPermission('inventory.delete_metadata')%0A def testDeleteMeta(self):%0A self.addMeta(self.resource, 'meta-test', 'meta-test-value')%0A meta = self.getMeta()%0A self.asse... |
7955a13caae162730429d8792ea1d4d48398e548 | change permissions on __main__.py | pimat_server/__main__.py | pimat_server/__main__.py | #!/usr/bin/python
import datetime
import logging
import signal
import sys
import time
import Adafruit_DHT
import RPi.GPIO as GPIO
import configparser
from scheduler import add_schedule, remove_all
from relays import Relays
GPIO.setmode(GPIO.BCM)
# define the pin that goes to the circuit
pin_to_circuit = 27
dht_pin =... | Python | 0.000022 | |
82acbc312b36bfdf4e1a0a1c26019d2c5879e036 | Fix context processor settings to support Django 1.7 | nodeconductor/server/admin/settings.py | nodeconductor/server/admin/settings.py | ADMIN_INSTALLED_APPS = (
'fluent_dashboard',
'admin_tools',
'admin_tools.theming',
'admin_tools.menu',
'admin_tools.dashboard',
'django.contrib.admin',
)
# FIXME: Move generic (not related to admin) context processors to base_settings
ADMIN_TEMPLATE_CONTEXT_PROCESSORS = (
'django.contrib.au... | Python | 0.000004 | @@ -253,16 +253,122 @@
ettings%0A
+# Note: replace 'django.core.context_processors' with 'django.template.context_processors' in Django 1.8+%0A
ADMIN_TE
@@ -511,54 +511,8 @@
s',%0A
- 'django.core.context_processors.request',%0A
@@ -678,16 +678,60 @@
ors.
-static',
+request', # required by django-admin-too... |
80decc9f1b645579b47a08eb2dcc9707acfb8922 | Add draw on each slice | hw4.py | hw4.py | import sys
import glob
import os.path
import cv2
import numpy as np
def bresenham(start, end):
# Setup initial conditions
x1, y1 = start
x2, y2 = end
dx = x2 - x1
dy = y2 - y1
# Determine how steep the line is
is_steep = abs(dy) > abs(dx)
# Rotate line
if is_steep:
x1, y... | Python | 0.000001 | @@ -1530,17 +1530,16 @@
d):%0A
-#
img = cv
@@ -2485,16 +2485,88 @@
R2GRAY)%0A
+ draw_img_with_target_line(gray, (startx, starty), (endx, endy))%0A
|
cc9533798e00bb375422a559c750b7031e0f9e88 | Add socket url for experiments | polyaxon_client/experiment.py | polyaxon_client/experiment.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, division, print_function
from polyaxon_schemas.experiment import (
ExperimentConfig,
ExperimentJobConfig,
ExperimentStatusConfig,
ExperimentJobStatusConfig
)
from polyaxon_client.base import PolyaxonClient
from polyaxon_client.exceptions ... | Python | 0 | @@ -631,24 +631,29 @@
t(self._get_
+http_
url(), param
@@ -672,32 +672,32 @@
age(page=page))%0A
-
expe
@@ -1099,32 +1099,37 @@
d_url(self._get_
+http_
url(), experimen
@@ -1511,32 +1511,37 @@
d_url(self._get_
+http_
url(), experimen
@@ -1928,32 +1928,37 @@
d_url(self._get_
+http_
url(), experimen
... |
73b8a715aceec43cb80724d1e076a05ff7aaf71d | Define commits_average property | app/models.py | app/models.py | from datetime import datetime
from app import slack, redis, app
from app.redis import RedisModel
class Channel(RedisModel):
__prefix__ = '#'
@staticmethod
def load_from_slack():
"""Update channel list from slack"""
slack_response = slack.channels.list()
if not slack_response.succ... | Python | 0.00029 | @@ -1098,24 +1098,185 @@
M:%25S.%25fZ%22)%0A%0A
+ @property%0A def commits_average(self):%0A if 'days' in self and self.days %3E 0:%0A return self.commits_total / self.days%0A%0A return 0.0%0A%0A
@staticm
@@ -2174,24 +2174,16 @@
-
= dateti
|
d9943ea49bd16d3efdb7270df33cca158123aa8a | make code more robust | addons/website/models/ir_ui_view.py | addons/website/models/ir_ui_view.py | # -*- coding: utf-8 -*-
import copy
from lxml import etree, html
from openerp.osv import osv, fields
class view(osv.osv):
_inherit = "ir.ui.view"
_columns = {
'inherit_option_id': fields.many2one('ir.ui.view','Optional Inheritancy'),
'inherited_option_ids': fields.one2many('ir.ui.view','inher... | Python | 0.000013 | @@ -1159,35 +1159,35 @@
if
-type(view) in (str, unicode
+isinstance(view, basestring
):%0A
@@ -1367,28 +1367,42 @@
+el
if
-type(view) == int
+isinstance(view, (int, long))
:%0A
@@ -1517,32 +1517,32 @@
ontext=context)%0A
-
retu
@@ -1545,24 +1545,25 @@
return view%0A
+%0A
try:
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.