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 |
|---|---|---|---|---|---|---|---|
33f35afe991dd1a3c0ba1868cceee32a4e45b8e4 | version bump patch | filetype/__init__.py | filetype/__init__.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from .filetype import * # noqa
from .helpers import * # noqa
from .match import * # noqa
# Current package semver version
__version__ = version = '1.0.5'
| Python | 0 | @@ -217,7 +217,7 @@
1.0.
-5
+6
'%0A
|
b2859bfde66d7d91f98e3cfb61e205c1d2f5dbfe | Make CommentFactory use fuzzy attrs | hackernews_scraper/test/factories.py | hackernews_scraper/test/factories.py | import factory
class ItemFactory(factory.Factory):
FACTORY_FOR = dict
objectID = 21
created_at_i = 42
title = "Test item"
class CommentFactory(factory.Factory):
FACTORY_FOR = dict
created_at = "2014-04-03T10:17:28.000Z"
title = "Test comment"
url = "www.google.com"
comment_text... | Python | 0 | @@ -1,18 +1,121 @@
-import factory
+from datetime import datetime, timedelta%0Aimport factory%0Afrom factory.fuzzy import FuzzyText, FuzzyInteger%0Aimport time
%0A%0A%0Ac
@@ -310,74 +310,228 @@
-created_at = %222014-04-03T10:17:28.000Z%22%0A title = %22Test comment%22
+@factory.sequence%0A def created_at(n... |
8039e38ae806bc3aecfa2cb9824ebfd1c9fdc10e | Revert "Potential fix for cell caching issue" | powershell_kernel/powershell_proxy.py | powershell_kernel/powershell_proxy.py | import threading
try:
import queue
except ImportError:
import Queue as queue
from threading import Timer
from time import sleep
class ReplReader(threading.Thread):
def __init__(self, repl):
super(ReplReader, self).__init__()
self.repl = repl
self.daemon = True
self.queue = q... | Python | 0 | @@ -627,41 +627,8 @@
epl%0A
- self.expected_carets = 1%0A
@@ -668,16 +668,16 @@
r(repl)%0A
+
@@ -1675,61 +1675,8 @@
'%5Cn'
-%0A self.expected_carets = input.count('%5Cn')
%0A%0A
@@ -2737,91 +2737,8 @@
%5E':%0A
- self.expected_carets -= 1%0A if self.expected... |
fc03e0fdf3e7389ee668d66cf7224df2aaaaa95b | set write permissions for cfg_group on vyos-migrate.log | python/vyos/migrator.py | python/vyos/migrator.py | # Copyright 2019 VyOS maintainers and contributors <maintainers@vyos.io>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Lesser General Public
# License as published by the Free Software Foundation; either
# version 2.1 of the License, or (at your option) any lat... | Python | 0 | @@ -2823,16 +2823,100 @@
e.log')%0A
+ # on creation, allow write permission for cfg_group%0A os.umask(0o113)%0A
|
c1d3f48ca717f627ca461c73f5be308a57fbdcf7 | MOVE handler_name to dict | wood/wood.py | wood/wood.py |
"""
Wood author: thislight
Copyright 2016 thislight
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 la... | Python | 0.000005 | @@ -1358,16 +1358,52 @@
._time,%0A
+ handler_name=self.__name__,%0A
@@ -1512,35 +1512,8 @@
info
-,handler_name=self.__name__
)%0A
|
5e1e0ba1dca301eb597fb319c68280f7ee761037 | Add twopeasandtheirpod and simplyrecipes to __init__ | recipe_scrapers/__init__.py | recipe_scrapers/__init__.py | import re
from .allrecipes import AllRecipes
SCRAPERS = {
AllRecipes.host(): AllRecipes,
}
def url_path_to_dict(path):
pattern = (r'^'
r'((?P<schema>.+?)://)?'
r'((?P<user>.+?)(:(?P<password>.*?))?@)?'
r'(?P<host>.*?)'
r'(:(?P<port>\d+?))?'
... | Python | 0.000004 | @@ -43,56 +43,240 @@
pes%0A
-%0A%0ASCRAPERS = %7B%0A AllRecipes.host(): AllRecipes
+from .simplyrecipes import SimplyRecipes%0Afrom .twopeasandtheirpod import TwoPeasAndTheirPod%0A%0A%0ASCRAPERS = %7B%0A AllRecipes.host(): AllRecipes,%0A SimplyRecipes.host(): SimplyRecipes,%0A TwoPeasAndTheirPod.host(): Tw... |
5fd70e01f648da6dfc994bfe0e5c666c69fa9e45 | return None (null) in preference to empty string when recipe yield is unavailable | recipe_scrapers/vegolosi.py | recipe_scrapers/vegolosi.py | from ._abstract import AbstractScraper
from ._utils import get_minutes, get_yields, normalize_string
class Vegolosi(AbstractScraper):
@classmethod
def host(cls):
return "vegolosi.it"
def title(self):
return self.soup.find("h1").get_text().strip()
def preparation_time(self):
p... | Python | 0.000089 | @@ -1287,26 +1287,8 @@
ent)
-%0A return %22%22
%0A%0A
|
c88b7d5fa934e25ae426d8b918d6eb8de414682d | Add missing _ssl constant. Close PyCQA/pylint#2629 | astroid/brain/brain_ssl.py | astroid/brain/brain_ssl.py | # Copyright (c) 2016 Claudiu Popa <pcmanticore@gmail.com>
# Copyright (c) 2016 Ceridwen <ceridwenv@gmail.com>
# Licensed under the LGPL: https://www.gnu.org/licenses/old-licenses/lgpl-2.1.en.html
# For details: https://github.com/PyCQA/astroid/blob/master/COPYING.LESSER
"""Astroid hooks for the ssl library."""
from ... | Python | 0.000006 | @@ -3479,16 +3479,50 @@
TLSv1_2%0A
+ from _ssl import PROTOCOL_TLS%0A
%22%22%22%0A
|
631270eeafad8fd6b20973673f6d6e8b733e9029 | enable email | quant/tool/email_box.py | quant/tool/email_box.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from email.mime.text import MIMEText
from quant import config
import smtplib
mail_to = ["aiai373824745_wy@163.com"]
mail_host = "smtp.163.com"
mail_user = "aiai373824745_wy@163.com"
'''163邮箱smtp生成的密码'''
mail_pass = config.EMAIL_PASSWORD_163
mail_subject = 'logging'
def ... | Python | 0.00004 | @@ -336,16 +336,18 @@
nt):%0A
+ #
pass%0A
@@ -347,18 +347,16 @@
pass%0A
- #
me = %22Q
@@ -387,26 +387,24 @@
er + %22%3E%22%0A
- #
msg = MIMET
@@ -457,26 +457,24 @@
'utf-8')%0A
- #
msg%5B'Subjec
@@ -491,26 +491,24 @@
_subject%0A
- #
msg%5B'From'%5D
@@ -516,18 +516,16 @@
= me%0A
- #
... |
cca16ade9257464352917586a5beeb69a05373e8 | Add a TODO for b/150599675 and temporarily remove the assertion of `p13n_metrics['epoch_1']`. | tensorflow_federated/python/research/personalization/p13n_utils_test.py | tensorflow_federated/python/research/personalization/p13n_utils_test.py | # Lint as: python3
# Copyright 2020, The TensorFlow Federated 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 ... | Python | 0.000009 | @@ -881,44 +881,21 @@
%22%0A
-ds = collections.OrderedDict(%5B('x',
+x = np.array(
%5B%5B-1
@@ -933,71 +933,124 @@
0%5D%5D)
-,
%0A
- ('y', %5B%5B1.0%5D, %5B1.0%5D, %5B1.0%5D%5D)%5D
+y = np.array(%5B%5B1.0%5D, %5B1.0%5D, %5B1.0%5D%5D)%0A ds = collections.OrderedDict(x=x.astype(np.f... |
5ae8b38eba7e04effa530d8419df05840bc2478e | Fix flake8 warning | unyt/__init__.py | unyt/__init__.py | """
The unyt package.
Note that the symbols defined in :mod:`unyt.physical_constants` and
:mod:`unyt.unit_symbols` are importable from this module. For example::
>>> from unyt import km, clight
>>> print((km/clight).to('ns'))
3335.64095198152 ns
In addition, the following functions and classes are import... | Python | 0 | @@ -2685,16 +2685,30 @@
se_units
+ # NOQA: F401
%0A%0A%0A# fun
|
0caec903579e4cf3f22ea3e5ea1df3ecd8ad0fe3 | remove nigthly test hgemm_asm | test/nightly.py | test/nightly.py | #
# These nightly tests are slow but have good coverage. Fast tests with less coverage are in pre_checkin.py.
#
# To execute this test file, apt-get install python-pytest, then
# PYTHONPATH=. py.test -v test/nightly.py
#
# To run test directly, with complete output:
# mkdir build && cd build
# python ../Tensile/T... | Python | 0.016036 | @@ -1612,124 +1612,8 @@
bly%0A
-def test_hgemm_asm(tmpdir):%0A Tensile.Tensile(%5BTensile.TensileConfigPath(%22test_hgemm_asm.yaml%22), tmpdir.strpath%5D)%0A
def
|
018da9b9a268900344a8d72230b6315d4aaeb1ae | Fix MusicBrainz sample. | test/samples.py | test/samples.py | #!/usr/bin/env python3
# Copyright (c) 2009, Karoly Lorentey <karoly@lorentey.hu>
import unittest
import os
import os.path
import warnings
import stagger
from stagger.id3 import *
def list_id3(path):
for root, dirs, files in os.walk(path):
dirs.sort()
for file in sorted(files):
if fi... | Python | 0 | @@ -1369,16 +1369,17 @@
return%0A%0A
+%0A
@@ -1394,70 +1394,28 @@
rub
-iTunes-produced invalid frames with frameids ending with space
+known invalid frames
.%0A
@@ -1576,16 +1576,127 @@
th(%22 %22):
+ # iTunes%0A del tag%5Bkey%5D%0A if tag.version == 4 and key == %22XS... |
931cfb8025f45535b3bb839ebfa5191074a76b15 | Fix log capture on py3 | test/service.py | test/service.py | import logging
import re
import select
import subprocess
import threading
import time
__all__ = [
'ExternalService',
'SpawnedService',
]
class ExternalService(object):
def __init__(self, host, port):
logging.info("Using already running service at %s:%d", host, port)
self.host = host
... | Python | 0 | @@ -1309,32 +1309,48 @@
dout.append(line
+.decode('utf-8')
)%0A%0A i
|
94fc7881052fea4e7d83f35e41fab4f5ed108f34 | fix styling | spectate/utils.py | spectate/utils.py | from collections.abc import Mapping
class Sentinel:
__slots__ = "_name"
def __init__(self, name):
self._name = name
def __repr__(self):
return self._name # pragma: no cover
| Python | 0.000001 | @@ -1,42 +1,4 @@
-from collections.abc import Mapping%0A%0A%0A
clas
@@ -33,16 +33,17 @@
%22_name%22%0A
+%0A
def
|
243a3e185a8984e3d0daa0bb19a4e9a3ae11d7c7 | Fix student ranking detail page | app/soc/modules/gci/views/models/student_ranking.py | app/soc/modules/gci/views/models/student_ranking.py | #!/usr/bin/env python2.5
#
# Copyright 2010 the Melange 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 applic... | Python | 0.000001 | @@ -3269,17 +3269,21 @@
entity.
-d
+taskD
ifficult
@@ -3283,16 +3283,18 @@
fficulty
+()
.value%0A
|
800ef1d1305f125695073732f4b6155d6f0cb445 | Update rasa/cli/interactive.py | rasa/cli/interactive.py | rasa/cli/interactive.py | import argparse
import os
from typing import List, Text
import rasa.cli.train as train
from rasa.cli.arguments import interactive as arguments
from rasa import data, model
# noinspection PyProtectedMember
from rasa.cli.utils import get_validated_path, print_error
from rasa.constants import (
DEFAULT_DATA_PATH,
... | Python | 0 | @@ -979,17 +979,24 @@
lp=%22
-s
+S
ave
+story
file
+s
in
@@ -1005,16 +1005,79 @@
e format
+. In this format user messages will be included in the stories.
%22%0A )%0A
|
7329757e1ad30e327c1ae823a8302c79482d6b9c | Update BUILD_OSS to 4632 | src/data/version/mozc_version_template.bzl | src/data/version/mozc_version_template.bzl | # Copyright 2010-2021, Google Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list of conditions and ... | Python | 0 | @@ -1605,18 +1605,18 @@
OSS = 46
+3
2
-4
%0A%0A# Numb
|
e243e907e58047e18c0a16e061f7aa718e3b5854 | Remove unavailable imports | statsmodels/compat/__init__.py | statsmodels/compat/__init__.py | from .python import ( # noqa:F401
PY3, PY37,
bytes, str, unicode, string_types,
asunicode, asbytes, asstr, asstr2, asunicode_nested, asbytes_nested,
range, zip, filter, map,
lrange, lzip, lmap, lfilter,
cStringIO, StringIO, BytesIO,
cPickle, pickle,
iteritems, iterkeys, itervalues,
... | Python | 0 | @@ -124,42 +124,8 @@
tr2,
- asunicode_nested, asbytes_nested,
%0A
@@ -376,173 +376,539 @@
-strchar,%0A isfileobj,%0A open_latin1,%0A builtins,%0A getargspec,%0A input,%0A getexception,%0A advance_iterator, next,%0A callable,%0A get_function_name,
+builtins,%0A getargspec,%0A ... |
0629b30ade8b619697e8cc28d651904e742cd70e | Correct inst method names in system info, add Docker version (#36360) | homeassistant/helpers/system_info.py | homeassistant/helpers/system_info.py | """Helper to gather system info."""
import os
import platform
from typing import Dict
from homeassistant.const import __version__ as current_version
from homeassistant.loader import bind_hass
from homeassistant.util.package import is_virtual_env
from .typing import HomeAssistantType
@bind_hass
async def async_get_s... | Python | 0 | @@ -1322,18 +1322,13 @@
t Co
-re on Dock
+ntain
er%22%0A
@@ -1374,29 +1374,16 @@
_object%5B
-%0A
%22install
@@ -1393,25 +1393,16 @@
on_type%22
-%0A
%5D = %22Hom
@@ -1421,40 +1421,8 @@
Core
- in a Python Virtual Environment
%22%0A%0A
@@ -1781,16 +1781,75 @@
hassis%22)
+%0A info_objec... |
7db13e76adda42f458f3564884c7b32909f3ec87 | Fix for issue #220 | hpedockerplugin/request_validator.py | hpedockerplugin/request_validator.py | from collections import OrderedDict
from oslo_log import log as logging
import hpedockerplugin.exception as exception
LOG = logging.getLogger(__name__)
def validate_request(contents):
operations_map = OrderedDict()
operations_map['virtualCopyOf,scheduleName'] = \
_validate_snapshot_schedule_opts
... | Python | 0 | @@ -779,16 +779,64 @@
rcg_opts
+%0A operations_map%5B'help'%5D = _validate_help_opt
%0A%0A if
@@ -4180,16 +4180,31 @@
ctDelay'
+, 'compression'
%5D%0A _v
@@ -4246,28 +4246,147 @@
ume', contents, valid_opts)%0A
+%0A%0Adef _validate_help_opt(contents):%0A valid_opts = %5B'help'%5D%0A _validate_opts('d... |
bc638d11be50f8480d1f103d3a25484c6ccb52b7 | clean code in disocvery_json_view.py and add comments | hs_core/views/discovery_json_view.py | hs_core/views/discovery_json_view.py | import simplejson as json
from django.http import HttpResponse
from haystack.query import SearchQuerySet
from django import forms
from haystack.forms import FacetedSearchForm
from haystack.generic_views import FacetedSearchView
from django.core import serializers
from hs_core.discovery_form import DiscoveryForm
class ... | Python | 0 | @@ -74,244 +74,219 @@
ack.
-query import SearchQuerySet%0Afrom django import forms%0Afrom haystack.forms import FacetedSearchForm%0A
+generic_views import FacetedSearchView%0Afrom hs_core.discovery_form import DiscoveryForm%0A%0A# View class for generating JSON data format
from
-h
+H
aystack
-.generic_views import... |
c1b19af7229d582f7bd474a05a679cf45e3c9bf8 | add proxy + fix import modules | tests/basics.py | tests/basics.py | # -*- coding: utf-8 -*-
"""
@author: Nicolas Rivet
test the connection to IG API
do some basic operations
"""
from ig.ig_service import IGservice as igs
import ig.ig_tools as igt
def main():
"""Main module for testing."""
#get config for demo API
proxy_user, proxy_password, api_key, use... | Python | 0 | @@ -115,36 +115,133 @@
%0D%0A%0D%0A
-from ig.ig_service
+import sys%0D%0Aimport os%0D%0Asys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..', 'ig')))%0D%0A%0D%0A
import
-IG
+ig_
serv
@@ -263,11 +263,8 @@
ort
-ig.
ig_t
@@ -506,16 +506,26 @@
vice=igs
+.IGservice
(usernam
@@ -565,55 +5... |
e18a80ac32b93e12e0faf03d97ccf7104d1db1ac | Update constants.py | azurecloudify/constants.py | azurecloudify/constants.py | ########
# Copyright (c) 2015 GigaSpaces Technologies Ltd. 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... | Python | 0.000001 | @@ -777,1088 +777,10 @@
= '
-Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiIsIng1dCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSIsImtpZCI6Ik1uQ19WWmNBVGZNNXBPWWlKSE1iYTlnb0VLWSJ9.eyJhdWQiOiJodHRwczovL21hbmFnZW1lbnQuY29yZS53aW5kb3dzLm5ldC8iLCJpc3MiOiJodHRwczovL3N0cy53aW5kb3dzLm5ldC9lOGY4M2RkZi00ZGVlLTRlMWQtYjc3YS1mZjNkZGFhZjUyZ... |
08fe4ba4e2804baff972ee0a430ebe0b6ea1e0b2 | prepare compatibility | folderless/models.py | folderless/models.py | # coding: utf-8
from __future__ import unicode_literals
import hashlib
import os
from django.core.exceptions import ValidationError
from django.core.files.base import File as DjangoFile
from django.utils.encoding import python_2_unicode_compatible
from django.db import models
from django.core import urlresolvers
from ... | Python | 0 | @@ -601,16 +601,23 @@
r%0A%0Afrom
+django.
conf imp
|
d23a68d464c62cdefb76dbe5855110374680ae61 | Add coverage metrics to python code | regulations/settings/dev.py | regulations/settings/dev.py | from .base import *
DEBUG = True
TEMPLATE_DEBUG = DEBUG
STATICFILES_DIRS = (
root('static'),
)
OFFLINE_OUTPUT_DIR = '/tmp/'
INSTALLED_APPS += (
'django_nose',
)
NOSE_ARGS = [
'--exclude-dir=regulations/uitests'
]
try:
from local_settings import *
except ImportError:
pass
| Python | 0.000004 | @@ -182,16 +182,74 @@
RGS = %5B%0A
+ '--with-coverage',%0A '--cover-package=regulations',%0A
'--e
|
6b5d4f43b5d22f70db6d08f8093f88785359a404 | Implement DirectoryTarget | streaming_form_data/targets.py | streaming_form_data/targets.py | import hashlib
from typing import Callable, Optional
class BaseTarget:
"""
Targets determine what to do with some input once the parser is done
processing it. Any new Target should inherit from this base class and
override the :code:`data_received` function.
Attributes:
multipart_filename... | Python | 0 | @@ -2816,24 +2816,944 @@
d.close()%0A%0A%0A
+class DirectoryTarget(BaseTarget):%0A %22%22%22DirectoryTarget writes (streams) the different input to an on-disk directory.%22%22%22%0A%0A def __init__(%0A self, directorypath: str, allow_overwrite: bool = True, *args, **kwargs%0A ):%0A super().__ini... |
addee10ba5d79faa6223eedab00fec8cabe1e464 | fix attributeerror | private_storage/storage/s3boto3.py | private_storage/storage/s3boto3.py | try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django.utils.deconstruct import deconstructible
from private_storage import appconfig
from storages.backends.s3boto3 import S3Boto3Storage
from storages.utils import setting
@deconstructible
class Priva... | Python | 0.000002 | @@ -1217,24 +1217,29 @@
UCKET_ACL',
+self.
default_acl)
|
410287c307bc0a967cac7845d8f706daf30cfa9d | Bump node16 from `16.14.2` to `16.15.0` | node_archives.bzl | node_archives.bzl | load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
def repositories():
# Node (https://nodejs.org/en/about/releases/)
# Follow Node's maintainence schedule and support all LTS versions that are not end of life
http_archive(
name = "nodejs12_amd64",
build_file = "//nodejs:B... | Python | 0 | @@ -1050,72 +1050,72 @@
= %22
-57e02c27eb5e52f560f72d96240e898cb52818dc9fc50f45478ce39ece38583a
+d1c1de461be10bfd9c70ebae47330fb1b4ab0a98ad730823fb1340e34993edee
%22,%0A
@@ -1139,35 +1139,35 @@
ix = %22node-v16.1
-4.2
+5.0
-linux-x64/%22,%0A
@@ -1227,35 +1227,35 @@
s.org/dist/v16.1
-4.2
+5.0
/node-v16.14.2-l
... |
2bb57c932f3337fe5df24040523920f399a88fb2 | The function apply_template has been renamed to display. | trac/File.py | trac/File.py | # -*- coding: iso8859-1 -*-
#
# Copyright (C) 2003, 2004 Edgewall Software
# Copyright (C) 2003, 2004 Jonas Borgstrm <jonas@edgewall.com>
#
# Trac 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... | Python | 0.999875 | @@ -1450,22 +1450,15 @@
def
-apply_template
+display
(se
|
f2bd0ddb3341eb9f0ecf090650494deb871bcea4 | Add ensembl tasks to the main luigi wrapper | luigi/tasks/genome_mapping/__init__.py | luigi/tasks/genome_mapping/__init__.py | # -*- coding: utf-8 -*-
"""
Copyright [2009-2018] EMBL-European Bioinformatics Institute
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 requir... | Python | 0.000001 | @@ -4014,32 +4014,123 @@
requires(self):%0A
+ yield RetrieveEnsemblAssemblies()%0A yield RetrieveEnsemblGenomesAssemblies()%0A
yield Ge
|
f5202cc14ee928753c6955a315432d6a8a88f932 | Test for the dummy put_info_records() method. | pyexodus/tests/test_writing_exodus.py | pyexodus/tests/test_writing_exodus.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
:copyright:
Lion Krischer (lionkrischer@gmail.com), 2016
:license:
MIT License
"""
import os
import h5netcdf
import numpy as np
from pyexodus import exodus
def test_initialization(tmpdir):
filename = os.path.join(tmpdir.strpath, "example.e")
e = exo... | Python | 0 | @@ -6438,16 +6438,497 @@
e%5B%22shape%22%5D, key%0A
+%0A%0Adef test_put_info_records(tmpdir):%0A %22%22%22%0A Does currently not do anything.%0A %22%22%22%0A filename = os.path.join(tmpdir.strpath, %22example.e%22)%0A%0A e = exodus(filename,%0A mode=%22w%22,%0A title=%22Examp... |
8cc36a325e8bedb7894f31fe049aee1aef903811 | remove unused code | examples/glyphs/buttons_server.py | examples/glyphs/buttons_server.py | from __future__ import print_function
from bokeh.browserlib import view
from bokeh.document import Document
from bokeh.plotting import curdoc
from bokeh.models.widgets import (
VBox, Icon,
Button, Toggle, Dropdown,
CheckboxGroup, RadioGroup,
CheckboxButtonGroup, RadioButtonGroup,
)
from bokeh.models i... | Python | 0.000017 | @@ -298,38 +298,8 @@
,%0A)%0A
-from bokeh.models import Plot%0A
from
|
992fb00e8499ce19c952527eb9135754303cb365 | abbreviation list in sentence tokenizer | src/indicnlp/tokenize/sentence_tokenize.py | src/indicnlp/tokenize/sentence_tokenize.py | # Copyright Anoop Kunchukuttan 2014 - present
#
# This file is part of Indic NLP Library.
#
# Indic NLP Library 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 o... | Python | 0.999636 | @@ -1000,19 +1000,20 @@
acronym_
-cha
+abbv
r(text,l
@@ -1036,16 +1036,39 @@
ars = %7B
+%0A ## acronym%0A
'%E0%A4%8F', '%E0%A4%8E'
@@ -1835,32 +1835,33 @@
'%E0%A5%9B%E0%A5%87%E0%A4%A1%E0%A5%8D',
+%0A
%0A %7D
@@ -1844,30 +1844,97 @@
%0A
-
+%0A ## abbreviation... |
5a582564e3fcf97aba0e9595807e1cdecb408210 | add data integration to sync sequence | frappe/model/sync.py | frappe/model/sync.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# MIT License. See license.txt
from __future__ import unicode_literals, print_function
"""
Sync's doctype and docfields from txt files to database
perms will get synced only if none exist
"""
import frappe
import os
from frappe.modules.import_file ... | Python | 0 | @@ -898,17 +898,20 @@
field%22),
-
+%0A%09%09%09
(%22core%22,
@@ -922,17 +922,20 @@
cperm%22),
-
+%0A%09%09%09
(%22core%22,
@@ -947,17 +947,20 @@
_role%22),
-
+%0A%09%09%09
(%22core%22,
@@ -992,17 +992,20 @@
%22user%22),
-
+%0A%09%09%09
(%22core%22,
@@ -1013,17 +1013,20 @@
%22role%22),
-
+%0A%09%09%09
(%... |
3a85eff683f9d717958d06faca71c2fb7aaa8394 | fix encoding issues by decoding html before Souping it | trunc/web.py | trunc/web.py | # -*- coding: utf-8 -*-
"""
*********
trunc.web
*********
This module provides classes for accessing web pages."""
from __future__ import absolute_import, print_function
import time
from bs4 import BeautifulSoup as Soup
from urllib import FancyURLopener
from .util import fibonacci_number
class MyOpener(FancyURLo... | Python | 0.000002 | @@ -167,16 +167,30 @@
nction%0A%0A
+import codecs%0A
import t
@@ -1071,16 +1071,41 @@
delay=1
+, encoding='windows-1251'
):%0A
@@ -1287,16 +1287,65 @@
%60%601%60%60)%0A
+ :param encoding: encoding of the webpage%0A
@@ -1438,16 +1438,49 @@
= delay
+%0A self.encoding = encoding
%0A%... |
93cab6327aef7386dba6f293a22099272af6af10 | create resouce only if not exist | src/infrastructure/annotations/requires.py | src/infrastructure/annotations/requires.py | '''
Created on Jun 19, 2013
@author: mpastern
'''
from src.resource.resourcemanager import ResourceManager
from src.errors.resourcemanagernotfounderror import ResourceManagerNotFoundError
class resources(object):
def __init__(self, params):
self.params = params
def __call__(self, original_func):
... | Python | 0 | @@ -628,18 +628,16 @@
class()%0A
-#
@@ -675,55 +675,28 @@
get(
-):%0A# rm_instance.add()%0A
+get_only=True):%0A
|
53b867272c0d33c783fe1bd5dbb40baf14683910 | Set top matches with GT as labeled in RCNN | frcnn/rcnn_target.py | frcnn/rcnn_target.py | import tensorflow as tf
import sonnet as snt
import numpy as np
from .utils.bbox_transform import bbox_transform, unmap
from .utils.bbox import bbox_overlaps
class RCNNTarget(snt.AbstractModule):
"""
Generate RCNN target tensors for both probabilities and bounding boxes.
TODO: We should unify this modul... | Python | 0 | @@ -3592,16 +3592,268 @@
label%5D%0A%0A
+ # Finally we get the closest proposal for each ground truth box and mark it as positive.%0A # TODO: Check when not tired%0A gt_argmax_overlaps = overlaps.argmax(axis=0)%0A proposals_label%5Bgt_argmax_overlaps%5D = gt_boxes%5B:,4%5D + 1%0A%0A
... |
71b4c326e18ce7e3d0b6aaab5203b3a403a85810 | Update solution_2.py | Problem033/Python/solution_2.py | Problem033/Python/solution_2.py | import math
frac=1.0
for b in range(1,10):
for a in range(1,b):
for c in range(1,10):
if (a*10+b)/(b*10+c)==a/c:
frac*=(a/c)
print(math.ceil(1/frac))
| Python | 0.000002 | @@ -5,16 +5,18 @@
rt math%0A
+%0A%0A
frac=1.0
@@ -16,16 +16,17 @@
rac=1.0%0A
+%0A
for b in
@@ -161,16 +161,33 @@
*=(a/c)%0A
+ %0A
print(ma
|
6d7e597ce216093d52ecdcb7db5c087dc6040bb1 | Fix initiation of settings object | fullcalendar/conf.py | fullcalendar/conf.py | from datetime import timedelta
from django.conf import settings as django_settings
default = {
'FULLCALENDAR_FIRST_WEEKDAY': 0,
'FULLCALENDAR_OCCURRENCE_DURATION': timedelta(hours=1),
'FULLCALENDAR_SITE_COLORS': {}
}
settings = object()
for key, value in default.items():
setattr(settings, key,
... | Python | 0.000004 | @@ -240,15 +240,41 @@
s =
-object(
+type('SettingsDummy', (), default
)%0A%0Af
|
741cda41b8a74cd21ce157c00c1a2b45f6e3ab5c | Use sys.maxint for first backfill max_id | twick/cli.py | twick/cli.py | #!/usr/bin/env python
import sys, os
import re
import argparse
import dataset
import logging
from datetime import datetime
from time import sleep
from getpass import getpass
from search import Search
from persistence import get_last_id, get_first_id, store_response
import settings
logging.basicConfig()
logger = loggin... | Python | 0.000023 | @@ -1966,34 +1966,26 @@
_id
-- 1) if first_id else None
+or sys.maxint) - 1
%0A
|
52e614f811fb9dfcd0dde46de43f13731a3717a5 | Reformat doc string for txStatHat.__init__ | txstathat.py | txstathat.py | # -*- coding: utf-8 -*-
"""StatHat bindings"""
from __future__ import division, print_function, unicode_literals
import urllib
from twisted.web.client import getPage
try:
from OpenSSL import SSL # noqa
have_ssl = True
except:
have_ssl = False
API_URI = b'http{}://api.stathat.com/ez'.format(b's' if h... | Python | 0 | @@ -490,22 +490,61 @@
-*
+Does no network activity.%0A%0A :param
ezkey
-* is
+:
you
+r
API
@@ -589,42 +589,8 @@
ult.
- Does no%0A network activity.
%0A%0A
|
74d5f5c1fe49d0f574a923fc490cd064f3cd52c5 | allow specifying random state | galstreams/random.py | galstreams/random.py |
import astropy.coordinates as coord
import astropy.units as u
import numpy as np
__all__ = ['get_uniform_spherical_angles', 'get_uniform_sphere']
@u.quantity_input(lon_lim=u.deg, lat_lim=u.deg)
def get_uniform_spherical_angles(size=1,
lon_lim=[0., 360]*u.deg,
... | Python | 0.000001 | @@ -348,16 +348,68 @@
0%5D*u.deg
+,%0A random_state=None
):%0A %22
@@ -577,32 +577,43 @@
.units.Quantity%60
+ (optional)
%0A The lon
@@ -736,32 +736,43 @@
.units.Quantity%60
+ (optional)
%0A The lat
@@ -858,24 +858,179 @@
gular units.
+%0A random_state : %60num... |
d668626739c8fe3de9a79743e95a209dd9596059 | Add identifier attribute to reftrack node | src/jukeboxmaya/mayaplugins/jbreftrack.py | src/jukeboxmaya/mayaplugins/jbreftrack.py | import maya.OpenMayaMPx as OpenMayaMPx
import maya.OpenMaya as OpenMaya
from jukeboxcore.errors import PluginInitError, PluginUninitError
class JB_ReftrackNode(OpenMayaMPx.MPxNode):
"""A node to track references
Stores the associated refernce node, typ (asset, cache, shader, cam, lightrig etc), children, an... | Python | 0 | @@ -2719,16 +2719,249 @@
le_id)%0A%0A
+ # the identifier attribute, we need to order the reftracks in the id permanently%0A cls.identifier_attr = nAttr.create('identifier', 'id', OpenMaya.MFnNumericData.kInt, -1)%0A cls.addAttribute(cls.identifier_attr)%0A%0A
@cla
|
6f39dd808f91b6f018571315d13eaccf2f70cd24 | Update Chapter22/primeNum.py improved rabinMiller() docstring readability | books/CrackingCodesWithPython/Chapter22/primeNum.py | books/CrackingCodesWithPython/Chapter22/primeNum.py | """Prime Number Sieve
Implements a series of functions that determine if a given number is prime.
Attributes:
LOW_PRIMES (list): List containing prime numbers <= 100 (aka 'low primes').
Note:
* https://www.nostarch.com/crackingcodes/ (BSD Licensed)
"""
import math, random
def isPrimeTrialDiv(num: int) ->... | Python | 0 | @@ -1901,20 +1901,21 @@
test to
-test
+check
if a gi
|
1a8a77accdc3e6e968dbb365abee717f8ca0ffb4 | update videoserver for new mjpg-streamer | src/machinetalk/videoserver/videoserver.py | src/machinetalk/videoserver/videoserver.py | #!/usr/bin/python2
import os
import sys
import time
from stat import *
import subprocess
import threading
import socket
import argparse
import ConfigParser
from machinekit import service
from machinekit import config
class VideoDevice:
process = None
service = None
txtRecord = None
sdname = ''
f... | Python | 0 | @@ -214,16 +214,78 @@
onfig%0A%0A%0A
+MJPG_STREAMER_PLUGIN_PATH = '/usr/local/lib/mjpg-streamer/'%0A%0A%0A
class Vi
@@ -2772,25 +2772,33 @@
h =
-'/usr/local/lib/'
+MJPG_STREAMER_PLUGIN_PATH
%0A
|
c7a4bfdeb8e20d4469dac85370f640cb944db0d9 | Remove python2 support | src/chattymarkov/database/__init__.py | src/chattymarkov/database/__init__.py | """Chattymarkov database submodule.
This submodule gathers all the supported database formats.
"""
import six
from .databases import JSONFileDatabase, MemoryDatabase, RedisDatabase
class ChattymarkovDatabaseError(Exception):
"""Base exception class for chattymarkov.database related errors."""
class UnknownData... | Python | 0.000011 | @@ -97,19 +97,8 @@
%22%22%22%0A
-import six%0A
from
@@ -2568,70 +2568,8 @@
')%0A%0A
- if six.PY2:%0A port = unicode(port) # noqa%0A%0A
|
a565a09ee0ed64b2879004db2f21e360b41d92cb | Update stock_quant_package_dimension/models/stock_quant_package.py | stock_quant_package_dimension/models/stock_quant_package.py | stock_quant_package_dimension/models/stock_quant_package.py | # Copyright 2019 Camptocamp SA
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl)
from odoo import api, fields, models
class StockQuantPackage(models.Model):
_inherit = "stock.quant.package"
pack_weight = fields.Float("Pack Weight")
pack_length = fields.Integer("Pack Length", help="length")
... | Python | 0 | @@ -239,21 +239,8 @@
oat(
-%22Pack Weight%22
)%0A
|
b2b123b15f178e81737127a4dda399a31ebb5240 | Update Dice_Probability.py | Week2-Python-Libraries-and-Concepts-Used-in-Research/Dice_Probability.py | Week2-Python-Libraries-and-Concepts-Used-in-Research/Dice_Probability.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Tue Jan 17 16:26:48 2017
@author: lamahamadeh
source:
-------
Video 2.4.2: Examples Involving Randomness
Week 2 Overview/Python Libraries and Concepts Used in Research
Using python for research
Harvard
online course provided by edx.org
url: https://courses... | Python | 0.000001 | @@ -102,16 +102,99 @@
hamadeh%0A
+%22%22%22%0A%0A#First: Python-based implementation %0A#------------------------------------%0A'''
%0Asource:
@@ -524,21 +524,19 @@
3b36e8/%0A
-%22%22%22%0A%0A
+'''
%0A#roll a
@@ -691,27 +691,8 @@
es%0A%0A
-import numpy as np%0A
impo
@@ -1857,12 +1857,507 @@
show()%0A%0A
+#------... |
79ddd4d0038b16f8d19f31faeb338ed4f48bbadb | fix assembler_name return type | src/py/gopythongo/assemblers/virtualenv.py | src/py/gopythongo/assemblers/virtualenv.py | # -* encoding: utf-8 *-
import argparse
import os
from gopythongo.assemblers import BaseAssembler
from gopythongo.utils import ErrorMessage, highlight, run_process, print_info, create_script_path
class VirtualEnvAssembler(BaseAssembler):
@property
def assembler_name(self):
return "virtualenv"
de... | Python | 0.00001 | @@ -276,16 +276,23 @@
me(self)
+ -%3E str
:%0A
|
67c4d077ee4693290bf9883e90e4ed381b3cd227 | Fix a mistake. | python/matplotlib/hist_logscale_xy.py | python/matplotlib/hist_logscale_xy.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# See:
# -
import numpy as np
import matplotlib.pyplot as plt
# SETUP #######################################################################
# histtype : [‘bar’ | ‘barstacked’ | ‘step’ | ‘stepfilled’]
HIST_TYPE='bar'
ALPHA=0.5
# MAKE DATA ###########################... | Python | 0.003448 | @@ -1050,16 +1050,17 @@
t(212)%0A%0A
+v
min = np
@@ -1078,16 +1078,17 @@
.min())%0A
+v
max = np
@@ -1129,21 +1129,23 @@
ace(
+v
min,
+v
max, 50)
@@ -1144,22 +1144,17 @@
50)
-
# %3C-
-creat
+mak
e a
@@ -1168,16 +1168,17 @@
rom 10**
+v
min to 1
@@ -1180,16 +1180,17 @@
to 10**
+v
max%0A%0Apri
|
7c2b503745d9898d5edbb03ef25b0936253ba44c | Make it DRY | nsone/__init__.py | nsone/__init__.py | #
# Copyright (c) 2014 NSONE, Inc.
#
# License under The MIT License (MIT). See LICENSE in project root.
#
from .config import Config
version = "0.9.15"
class NSONE:
def __init__(self, apiKey=None, config=None, configFile=None, keyID=None):
"""
Create a new top level NSONE API object
:... | Python | 0.000996 | @@ -5185,33 +5185,21 @@
.'.join(
-domain.split('.')
+parts
%5B1:%5D)%0A
|
69e1a8ddfc86c3ce63100e6fe91b65afc07fdce3 | Change settings.py to use os.environ | oktan/settings.py | oktan/settings.py | """
Django settings for oktan project.
Generated by 'django-admin startproject' using Django 1.11.
For more information on this file, see
https://docs.djangoproject.com/en/1.11/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.11/ref/settings/
"""
import os
# ... | Python | 0 | @@ -593,16 +593,18 @@
klist/%0A%0A
+#
# SECURI
@@ -829,22 +829,30 @@
T_KEY =
-config
+os.environ.get
('SECRET
@@ -868,20 +868,29 @@
BUG = co
-nfig
+s.environ.get
('DEBUG'
@@ -986,22 +986,30 @@
default=
-config
+os.environ.get
('DATABA
@@ -2488,17 +2488,35 @@
tabases%0A
-%0A
+# local database%0A#
DATABASE
@... |
7245554cc85cd9dc3d4151c754f7d0916af10a12 | Version up 1.2.911 | dedupsqlfs/__init__.py | dedupsqlfs/__init__.py | # -*- coding: utf8 -*-
# Documentation. {{{1
"""
This Python library implements a file system in user space using FUSE. It's
called DedupFS because the file system's primary feature is deduplication,
which enables it to store virtually unlimited copies of files because data
is only stored once.
In addition to dedupli... | Python | 0 | @@ -988,17 +988,17 @@
%221.2.91
-0
+1
%22%0A%0A# Che
|
5bbb238a2ca137cb555a590d0c9a5673d88c8e7f | Version 1.2.943 | dedupsqlfs/__init__.py | dedupsqlfs/__init__.py | # -*- coding: utf8 -*-
# Documentation. {{{1
"""
This Python library implements a file system in user space using FUSE. It's
called DedupFS because the file system's primary feature is deduplication,
which enables it to store virtually unlimited copies of files because data
is only stored once.
In addition to dedupli... | Python | 0 | @@ -988,17 +988,17 @@
%221.2.94
-2
+3
%22%0A%0A# Che
|
51fd99b238667fa5e5d43647a9b29f76b536e18b | Check for "error" in the log file and if found fail the test. | tests/itests.py | tests/itests.py | # -*- coding: utf-8 -*-
# vim: set fileencodings=utf-8
#
# Docker Integration Tests
from __future__ import absolute_import
import re
import sys
import time
from psycopg2 import connect
from unittest import TestCase
class InvalidState(Exception):
pass
class DockerBaseTestCase(TestCase):
def __init__(self... | Python | 0 | @@ -3065,16 +3065,96 @@
rint(l)%0A
+ if %22error%22 in l.lower():%0A self.fail(%22Error in logs%22)%0A
|
4f95023ef9214e669e540392e5b43ee5e4c4d28f | delete useless code | image_classification/caffe2paddle.py | image_classification/caffe2paddle.py | import os
import functools
import inspect
import struct
import numpy as np
import caffe
def __default_not_set_callback__(kwargs, name):
return name not in kwargs or kwargs[name] is None
def wrap_param_default(param_names=None,
default_factory=None,
not_set_callback=... | Python | 0.000021 | @@ -3206,335 +3206,8 @@
ype%0A
- print layer_name, layer_type, len(layer_params)%0A if layer_type == %22BatchNorm%22:%0A print layer_params%5B0%5D.data.shape, layer_params%5B%0A 1%5D.data.shape, layer_params%5B2%5D.data, type(%0A layer_para... |
e300d739bf0040b76a0deee75cc01b1410ba8953 | change image field to name in CatalogoLandsat serializer | indicarprocess/tmsapi/serializers.py | indicarprocess/tmsapi/serializers.py | # -*- coding: utf-8 -*-
from rest_framework.serializers import ModelSerializer, SerializerMethodField
from catalogo.models import CatalogoLandsat
class LandsatSerializer(ModelSerializer):
southwest = SerializerMethodField()
northeast = SerializerMethodField()
class Meta:
model = CatalogoLandsat
... | Python | 0 | @@ -263,16 +263,51 @@
dField()
+%0A name = SerializerMethodField()
%0A%0A cl
@@ -371,12 +371,11 @@
= %5B'
-imag
+nam
e',
@@ -827,8 +827,83 @@
obj)%5B0%5D%0A
+%0A def get_name(self, obj):%0A return obj.image.replace('.tif', '')%0A
|
05a8f2a2e499b25472fbaf1b06e899f589a7101f | fix migration | editor/migrations/0003_auto_20150125_0430.py | editor/migrations/0003_auto_20150125_0430.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
from editor.models import Source, Category
# add root data for Source and Category model
def add_root_data(apps, schema_editor):
cat = Category(name ="root", parent=None)
cat.save()
source = Source(
... | Python | 0.000001 | @@ -141,17 +141,25 @@
Category
+, Format
%0A
-
%0A# add r
@@ -517,16 +517,72 @@
d(cat)%0A%0A
+ f = Format(name =%22root%22, parent=None)%0A f.save()%0A%0A
def reve
@@ -739,16 +739,70 @@
delete()
+%0A for f in Format.objects.all():%0A f.delete()
%0A%0Aclass
@@ -995,14 +995,15 @@
evert),%0A
-
... |
1cfd11d1a6aa1d949067e5b24b5bfb2cca10ad09 | add index | requestspool/paction/all.py | requestspool/paction/all.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
"""
Copyright (c) 2014 windpro
Author : windpro
E-mail : windprog@gmail.com
Date : 14/12/26
Desc :
"""
from httpappengine.decorator import url
from httpappengine.helper import not_found
from httplib import responses
from requestspool.util import get_route
... | Python | 0.000607 | @@ -313,19 +313,16 @@
route%0A%0A%0A
-%0A%0A%0A
def all_
@@ -2645,8 +2645,104 @@
return s
+%0A%0A@url(%22/%22, %22GET%22)%0Adef index(environ, start_response):%0A return check(environ, start_response)
|
110a74f839b5e6158d380f20d28652fb4dec8e2c | Solve issue #163 | lib/tower_cli/resources/project.py | lib/tower_cli/resources/project.py | # Copyright 2015, Ansible, Inc.
# Luke Sneeringer <lsneeringer@ansible.com>
#
# 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 requi... | Python | 0.001415 | @@ -4192,32 +4192,65 @@
if monitor
+ and answer.get('changed', False)
:%0A re
|
53df723a1574e62b4a74d56667c131793cf6c506 | add retrieve all users and one user queries | users_handler.py | users_handler.py | from models.users import User
class UsersHandler:
def __init__(self, DB):
self.db = DB
def create_user(self, user_data):
collection = self.db.users
new_user = User(user_data)
collection.insert_one(new_user.__dict__)
| Python | 0.000001 | @@ -22,16 +22,110 @@
ort User
+%0Aimport logging%0A%0Alogging.basicConfig(format='%25(levelname)s: %25(message)s', level=logging.DEBUG)
%0A%0Aclass
@@ -261,16 +261,113 @@
b.users%0A
+ user = collection.find_one(%7B%22username%22: user_data%5B%22username%22%5D%7D)%0A if not user:%0A
@@ -3... |
efdf57f4f688c66402c5b18152f2448a100a55a9 | Generate departures region by region | busstops/management/commands/generate_departures.py | busstops/management/commands/generate_departures.py | from datetime import date, timedelta
from django.core.management.base import BaseCommand
from django.db import transaction
from txc import txc
from ...models import Service, Journey, StopUsageUsage, StopPoint
from ...utils import get_files_from_zipfile
ONE_DAY = timedelta(days=1)
def handle_timetable(service, timet... | Python | 0.999999 | @@ -157,16 +157,24 @@
s import
+ Region,
Service
@@ -340,16 +340,60 @@
%0A if
+hasattr(timetable, 'operating_profile') and
day.week
@@ -1942,16 +1942,560 @@
ages)%0A%0A%0A
+@transaction.atomic%0Adef handle_region(region):%0A Journey.objects.filter(service__region=region).delete()%0A day = date.today()%... |
0d5d1263af2fca0955c4db0f603af11c321fe624 | Fix the class name for del_dynamic_range | lib/python2.6/aquilon/server/commands/del_dynamic_range.py | lib/python2.6/aquilon/server/commands/del_dynamic_range.py | # ex: set expandtab softtabstop=4 shiftwidth=4: -*- cpy-indent-level: 4; indent-tabs-mode: nil -*-
#
# Copyright (C) 2009,2010 Contributor
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the EU DataGrid Software License. You should
# have received a copy of the license... | Python | 0.999991 | @@ -1846,11 +1846,11 @@
mand
-Add
+Del
Dyna
|
b0735d710bfaa4939a01f44e0b830cca155151c3 | Make sure the versionFile is closed even in the face of an exception | documents/versionHelper.py | documents/versionHelper.py | import datetime
from django.template.loader import render_to_string
from lxml import etree
class XMLContent:
DTBOOK_NAMESPACE = "http://www.daisy.org/z3986/2005/dtbook/"
XML_NAMESPACE = "http://www.w3.org/XML/1998/namespace"
FIELD_ATTRIBUTE_MAP = {
'subject' : "dc:Subject",
'descripti... | Python | 0.000001 | @@ -2834,21 +2834,12 @@
-versionFile =
+with
ope
@@ -2849,25 +2849,42 @@
ilePath)
-%0A
+ as versionFile:%0A
self.tre
@@ -2867,32 +2867,35 @@
nFile:%0A
+
self.tree = etre
@@ -2919,36 +2919,8 @@
le)%0A
- versionFile.close()%0A
|
d809c3cef9761edbf984ea9a8cf066a2f474c58d | fix integration tests | test/integration/013_context_var_tests/test_context_vars.py | test/integration/013_context_var_tests/test_context_vars.py | from nose.plugins.attrib import attr
from test.integration.base import DBTIntegrationTest
import dbt.flags
class TestContextVars(DBTIntegrationTest):
def setUp(self):
DBTIntegrationTest.setUp(self)
self.fields = [
'this',
'this.name',
'this.schema',
... | Python | 0 | @@ -2338,32 +2338,41 @@
rs_013%22.%22context
+__dbt_tmp
%22')%0A self
@@ -2522,32 +2522,41 @@
able'%5D, 'context
+__dbt_tmp
')%0A%0A self
@@ -3247,16 +3247,25 @@
%22context
+__dbt_tmp
%22')%0A
@@ -3431,16 +3431,25 @@
'context
+__dbt_tmp
')%0A%0A
|
d0cbf5b21f12db17ac4970ffaaeed801b3bd0753 | Add '--report-as-gtimelog' option | timeflow/cli.py | timeflow/cli.py | import datetime as dt
import os
import sys
import subprocess
from argparse import ArgumentParser
import timeflow
def log(args):
timeflow.write_to_log_file(args.message)
def _call_editor(editor, filename):
editor = editor.split()
subprocess.call(editor + [timeflow.LOG_FILE])
def edit(args):
if ar... | Python | 0.999836 | @@ -2016,18 +2016,45 @@
s.report
+ or args.report_as_gtimelog
:%0A
-
@@ -2201,24 +2201,52 @@
o%0A )%0A
+ if args.report:%0A
time
@@ -2294,88 +2294,64 @@
rt)%0A
-%0A work_time, slack_time, today_work_time =
+ elif args.report_as_g
time
-f
lo
-w.calculate_stats(%0A ... |
7674437d752be0791688533dd1409fa083672bb2 | Switch from dictionary to namedtuple | genes/java/config.py | genes/java/config.py | #!/usr/bin/env python
def config():
return {
'is-oracle': True,
'version': 'oracle-java8',
}
| Python | 0.000003 | @@ -15,16 +15,117 @@
python%0A
+from collections import namedtuple%0A%0A%0AJavaConfig = namedtuple('JavaConfig', %5B'is_oracle', 'version'%5D)%0A
%0A%0Adef co
@@ -147,9 +147,19 @@
urn
-%7B
+JavaConfig(
%0A
@@ -167,21 +167,18 @@
-'
is
--
+_
oracle
-':
+=
True
@@ -191,19 +191,16 @@
-'
version
-'... |
3d62410c84a83f963a5e12e459f04bb263978940 | Clean up | src/boardFrame.py | src/boardFrame.py | from PIL import Image, ImageTk
from Tkinter import Frame, Button
class BoardFrame(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.configure(background="#336600")
# Divide screen in horizontal zones
self.topFrame = Frame(self)
self.bottomFrame = Fr... | Python | 0.000002 | @@ -393,18 +393,16 @@
%0A
- #
self.bo
@@ -422,22 +422,19 @@
k(side=%22
-bot
to
-m
+p
%22, fill=
@@ -457,73 +457,8 @@
rue)
-%0A self.bottomFrame.pack(side=%22top%22, fill=%22x%22, expand=True)
%0A%0A
@@ -820,32 +820,54 @@
ame(self.topLeft
+, background=%22#336600%22
)%0A self.w
@@ -896,1... |
becf684fc06890679f4c0cdfed1761962e16a343 | Make extra_context at browse_repository view not overriding provided variables | vcs/web/simplevcs/views/repository.py | vcs/web/simplevcs/views/repository.py | from django.contrib import messages
from django.template import RequestContext
from django.shortcuts import render_to_response
from vcs.exceptions import VCSError
def browse_repository(request, repository, template_name, revision=None,
node_path='', extra_context={}):
"""
Generic repository browser.
... | Python | 0.00001 | @@ -549,16 +549,122 @@
xt = %7B%7D%0A
+ for key, value in extra_context.items():%0A context%5Bkey%5D = callable(value) and value() or value%0A%0A
try:
@@ -896,113 +896,8 @@
rr))
-%0A for key, value in extra_context.items():%0A context%5Bkey%5D = callable(value) and value() or value
%0A%0A
|
7ecaeba33a4fe559f6122953581e533720cb2404 | Add select mkl libs (#22580) | var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py | var/spack/repos/builtin/packages/intel-oneapi-mkl/package.py | # Copyright 2013-2021 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from sys import platform
from spack import *
class IntelOneapiMkl(IntelOneApiLibraryPackage):
"""Intel oneAPI MKL.... | Python | 0 | @@ -975,8 +975,294 @@
n 'mkl'%0A
+%0A @property%0A def libs(self):%0A lib_path = '%7B0%7D/%7B1%7D/latest/lib/intel64'.format(self.prefix, self.component_dir)%0A mkl_libs = %5B'libmkl_intel_ilp64', 'libmkl_sequential', 'libmkl_core'%5D%0A return find_libraries(mkl_libs, root=lib_path, shared=... |
67cea85323195440330580cc3731447956a4ad32 | add default user settings packet | litecord/managers/user_settings.py | litecord/managers/user_settings.py |
class SettingsManager:
"""User settings manager.
Provides functions for users to change their settings and retrieve them back.
Attributes
----------
server: :class:`LitecordServer`
Litecord server instance.
settings_coll: `mongo collection`
User settings MongoDB collection... | Python | 0.000009 | @@ -879,16 +879,928 @@
ings = %7B
+%0A 'timezone_offset': 0,%0A 'theme': 'dark',%0A 'status': 'online',%0A 'show_current_game': False,%0A 'restricted_guilds': %5B%5D,%0A 'render_reactions': True,%0A 'render_embeds:... |
f5838692d711e6c8d0b8f0dc7716ea28707df4f2 | Add default for playlist_dir | beetsplug/smartplaylist.py | beetsplug/smartplaylist.py | # This file is part of beets.
# Copyright 2013, Dang Mai <contact@dangmai.net>.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restriction, including
# without limitation the right... | Python | 0.000001 | @@ -2188,16 +2188,56 @@
, m3u))%0A
+ import pdb; pdb.set_trace()%0A
@@ -2559,16 +2559,50 @@
: None,%0A
+ 'playlist_dir': u'.',%0A
|
603a59785f24aa98662e72d954b3aa0521ad0629 | Make repeatability tests for severities specified by CLI | test/unit/vint/linting/config/test_config_cmdargs_source.py | test/unit/vint/linting/config/test_config_cmdargs_source.py | import unittest
from test.asserting.config_source import ConfigSourceAssertion
from vint.linting.config.config_cmdargs_source import ConfigCmdargsSource
from vint.linting.level import Level
class TestConfigFileSource(ConfigSourceAssertion, unittest.TestCase):
def test_get_config_dict(self):
expected_conf... | Python | 0.000001 | @@ -305,196 +305,910 @@
e
-xpected_config_dict = %7B%0A 'cmdargs': %7B%0A 'verbose': True,%0A 'severity': Level.WARNING,%0A 'max-violations': 10,%0A %7D,%0A %7D%0A
+nv = %7B%0A 'cmdargs': %7B%0A 'verbose': True,%0A ... |
a45e41bdbf7356816a153aef8d06ee803324e1a6 | Add a description to the add-enclosure example script help output | examples/scripts/add-enclosure.py | examples/scripts/add-enclosure.py | #!/usr/bin/env python3
###
# (C) Copyright 2015 Hewlett-Packard Development Company, L.P.
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation t... | Python | 0.000001 | @@ -3832,29 +3832,8 @@
rue,
- description='Usage',
%0A
@@ -3911,16 +3911,315 @@
ormatter
+,%0A description='''%0A This example script will import an enclosure into HP OneView as a%0A managed device. The Onboard Administrator needs to have IP Address%0A configured for ... |
54cea5e302820c35025e1afc64b2058a48c5b174 | Implement pop in the data storage module | desertbot/datastore.py | desertbot/datastore.py | import json
import os
class DataStore(object):
def __init__(self, storagePath, defaultsPath):
self.storagePath = storagePath
self.defaultsPath = defaultsPath
self.data = {}
self.load()
def load(self):
# if a file data/defaults/<module>.json exists, it has priority on l... | Python | 0.000001 | @@ -1510,19 +1510,16 @@
save()%0A
-
%0A def
@@ -1889,12 +1889,111 @@
faultValue)%0A
+%0A def pop(self, key):%0A data = self.data.pop(key)%0A self.save()%0A return data%0A
|
c96ec5e3f2aca63fb705310773fcdc6960b2efa9 | Update method will update if a matching record exists, else create a new record. | datums/models/base.py | datums/models/base.py | from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import sessionmaker, scoped_session
from sqlalchemy import create_engine
import os
# Initialize Base class
Base = declarative_base()
metadata = Base.metadata
session_maker = sessionmaker()
session = scoped_session(session_maker)
engine = cre... | Python | 0 | @@ -1057,24 +1057,114 @@
update it.
+ If a record matching the instance id does not already exist,%0A create a new record.
%0A '''
@@ -1368,24 +1368,78 @@
ion.commit()
+%0A else:%0A cls.get_or_create(**kwargs)
%0A%0A @class
@@ -2816,32 +2816,126 @@
session.commit()
+%0A ... |
59c4b6c7d96e0871469e816a847f823bad3b6748 | Use protocol argument to link rather than manual protocol replacement. | velruse/utils.py | velruse/utils.py | """Utilities for the auth functionality"""
import sys
import uuid
try:
import simplejson as json
except ImportError:
import json
import webob.exc as exc
from routes import URLGenerator
from openid.oidutil import autoSubmitHTML
from webob import Response
from velruse.baseconvert import base_encode
from velrus... | Python | 0 | @@ -4015,32 +4015,62 @@
_to(self, req):%0A
+ if self.protocol:%0A
return_t
@@ -4111,68 +4111,19 @@
True
-)%0A # post-process the return_to protocol.%0A if
+, protocol=
self
@@ -4131,29 +4131,26 @@
protocol
-:%0A
+)%0A
if retu
@@ -4145,392 +4145,73 @@
- if retu... |
9f4fbb1db8e96a798bca1ae72d8cae8b90ba7d60 | Add Message.fields() shortcut to iterating message fields | venom/message.py | venom/message.py | from abc import ABCMeta
from collections import MutableMapping
from collections import OrderedDict
from typing import Any, Dict, Type
from venom.fields import Field, FieldDescriptor
from venom.util import meta
class OneOf(object):
def __init__(self, *choices):
self.choices = choices
# TODO helper fu... | Python | 0.000003 | @@ -126,16 +126,26 @@
ct, Type
+, Iterable
%0A%0Afrom v
@@ -166,15 +166,8 @@
port
- Field,
Fie
@@ -1431,16 +1431,26 @@
r, Field
+Descriptor
%5D%0A __
@@ -1951,16 +1951,123 @@
ems()%7D%0A%0A
+ @classmethod%0A def fields(cls) -%3E Iterable%5BFieldDescriptor%5D:%0A return cls.__fields__.values()%0A... |
bacf7dda4baa7aa930a613394d90f29bf83f6209 | Fix windowsservice.py | executor_worker/windowsservice.py | executor_worker/windowsservice.py | '''
windowsservice.py: runs node_worker.js as a Windows service
HOWTO:
Install http://sourceforge.net/projects/pywin32/
.\windowsservice.py addservicelogon kevin
.\windowsservice.py --username .\kevin --password secret install
.\windowsservice.py start
.\windowsservice.py stop
.\windowsservice.py remove
Work... | Python | 0.000021 | @@ -4185,16 +4185,34 @@
codecs%0D%0A
+ try:%0D%0A
@@ -4228,32 +4228,115 @@
('secpol.inf')%0D%0A
+ except OSError as e:%0D%0A if e.errno != 2:%0D%0A raise%0D%0A
subproce
|
e3753ac4b2c24c43014aab8121a34b9ad76d6b7a | update tests to v2.1.1 (#1597) (#1597) | exercises/hamming/hamming_test.py | exercises/hamming/hamming_test.py | import unittest
import hamming
# Tests adapted from `problem-specifications//canonical-data.json` @ v2.1.0
class HammingTest(unittest.TestCase):
def test_empty_strands(self):
self.assertEqual(hamming.distance("", ""), 0)
def test_identical_strands(self):
self.assertEqual(hamming.distance("... | Python | 0 | @@ -101,17 +101,17 @@
@ v2.1.
-0
+1
%0A%0Aclass
|
d47cfd7c1a4dd22ab175539dcb0e3702a21f8bb7 | Move scaling factors to constant and explain | ynr/apps/moderation_queue/management/commands/moderation_queue_detect_faces_in_queued_images.py | ynr/apps/moderation_queue/management/commands/moderation_queue_detect_faces_in_queued_images.py | import json
import boto3
from django.core.management.base import BaseCommand, CommandError
from moderation_queue.models import QueuedImage
class Command(BaseCommand):
def handle(self, **options):
rekognition = boto3.client("rekognition", "eu-west-1")
attributes = ["ALL"]
any_failed = ... | Python | 0 | @@ -137,16 +137,269 @@
Image%0A%0A%0A
+# These magic values are because the AWS API crops faces quite tightly by%0A# default, meaning we literally just get the face. These values are about%0A# right or, they are more right than the default crop.%0AMIN_SCALING_FACTOR = 0.3%0AMAX_SCALING_FACTOR = 2%0A%0A%0A
class Co
@@... |
a0e0f7867e8e9805fb035a8db75e9d187fc06f3b | fix merge | rest_framework_social_oauth2/views.py | rest_framework_social_oauth2/views.py | # -*- coding: utf-8 -*-
import json
from braces.views import CsrfExemptMixin
from oauth2_provider.ext.rest_framework import OAuth2Authentication
from oauth2_provider.models import Application, AccessToken
from oauth2_provider.settings import oauth2_settings
from oauth2_provider.views.mixins import OAuthLibMixin
from r... | Python | 0.000001 | @@ -1044,16 +1044,65 @@
uestCore
+%0A permission_classes = (permissions.AllowAny,)
%0A%0A de
|
d5bce66b6f9647a8bf8102acf6bd100c5bb70864 | decode the string | proxy/src/gosa/proxy/mqtt_relay.py | proxy/src/gosa/proxy/mqtt_relay.py | import logging
from lxml import objectify, etree
from zope.interface import implementer
from gosa.common import Environment
from gosa.common.components import PluginRegistry
from gosa.common.components.mqtt_handler import MQTTHandler
from gosa.common.event import EventMaker
from gosa.common.handler import IInterface... | Python | 1 | @@ -5600,16 +5600,51 @@
ring(xml
+, pretty_print=True).decode('utf-8'
)%0A%0A
|
e13a74ae4e1884017593143e01e8882d7e802d7b | clean up imports | src/compas_rhino/geometry/__init__.py | src/compas_rhino/geometry/__init__.py | """
********************************************************************************
geometry
********************************************************************************
.. currentmodule:: compas_rhino.geometry
Classes
=======
.. autosummary::
:toctree: generated/
:nosignatures:
RhinoGeometry
R... | Python | 0.000001 | @@ -215,1169 +215,62 @@
ry%0A%0A
-Classes%0A=======%0A%0A.. autosummary::%0A :toctree: generated/%0A :nosignatures:%0A%0A RhinoGeometry%0A RhinoBox%0A RhinoCircle%0A RhinoCone%0A RhinoCurve%0A RhinoCylinder%0A RhinoEllipse%0A RhinoLine%0A RhinoMesh%0A RhinoPlane%0A RhinoPoint%0A ... |
e81e57140fd1010feaa2f2e05df77b370eb92087 | Update affected / failing test. | st2actions/tests/unit/test_pythonrunner.py | st2actions/tests/unit/test_pythonrunner.py | # Licensed to the StackStorm, Inc ('StackStorm') 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 not use th... | Python | 0 | @@ -1362,16 +1362,233 @@
w.py')%0A%0A
+# Note: runner inherits parent args which doesn't work with tests since test pass additional%0A# unrecognized args%0Amock_sys = mock.Mock()%0Amock_sys.argv = %5B%5D%0A%0A%0A@mock.patch('st2actions.runners.pythonrunner.sys', mock_sys)
%0Aclass P
|
3fb93c4b839457430180f65f1feae4c7abdba0ac | tag celery syslog messages | dbaas/dbaas/celery.py | dbaas/dbaas/celery.py | from __future__ import absolute_import
import os
import logging
from datetime import timedelta
from celery import Celery
from django.conf import settings
from dbaas import celeryconfig
from logging.handlers import SysLogHandler
from celery.log import redirect_stdouts_to_logger
from celery.signals import after_setu... | Python | 0 | @@ -727,16 +727,24 @@
('dbaas:
+ #celery
%25(name)
|
c0f917c6098b18479a69fe129a0fd19d11f67df7 | Fix startup | src/btsoot.py | src/btsoot.py | Python | 0.000004 | @@ -0,0 +1,1337 @@
+#!/usr/bin/env python3.5%0A#MIT License%0A#%0A#Copyright (c) 2016 Paul Kramme%0A#%0A#Permission is hereby granted, free of charge, to any person obtaining a copy%0A#of this software and associated documentation files (the %22Software%22), to deal%0A#in the Software without restriction, including wit... | |
5cee2f6bc69a203cc9d20d50f375c3744c4b8753 | Remove self from args passed to super | decisiontree/forms.py | decisiontree/forms.py | #!/usr/bin/env python
# vim: ai ts=4 sts=4 et sw=4
from django import forms
from django.contrib.auth.models import User
from decisiontree.models import Answer, Entry, Question, Tag, TagNotification, Transition, Tree, TreeState
from decisiontree.utils import parse_tags, edit_string_for_tags
class AnswerForm(forms.Mo... | Python | 0 | @@ -3119,38 +3119,32 @@
self).__init__(
-self,
*args, **kwargs)
|
a468ad4a8f28fb7c88f56869ae68de7b4b55ff39 | Fix 'ResultSet has no len' bug in delete_insert_test | delete_insert_test.py | delete_insert_test.py | import random
import threading
import uuid
from cassandra import ConsistencyLevel
from cassandra.query import SimpleStatement
from dtest import Tester
class DeleteInsertTest(Tester):
"""
Examines scenarios around deleting data and adding data back with the same key
"""
def __init__(self, *args, **k... | Python | 0.000002 | @@ -1184,20 +1184,26 @@
return
+list(
rows
+)
%0A%0A de
@@ -2574,21 +2574,27 @@
ert len(
+list(
rows)
+)
== len(
|
21620653125f33fd0d19c1bb2f16b51ec3c853f9 | fix tmin/tmax | ASC/SkyPie.py | ASC/SkyPie.py | #! /usr/bin/env python
#
# Takes about 15" fpr 1400 images on laptop with a local fast disk
#
import matplotlib.pyplot as plt
import numpy as np
import sys
date = ''
table = sys.argv[1]
png = table + '.png'
twopi = 2*np.pi
# table of time index (1...N) and median sky brightness (50,000 is very bright)
(t,s) = np.... | Python | 0.00001 | @@ -37,17 +37,17 @@
ut 15%22 f
-p
+o
r 1400 i
@@ -84,16 +84,66 @@
ast disk
+ (100%25 cpu)%0A# But 60%22 on the Xeon, but at 300%25 cpu
%0A#%0Aimpor
@@ -204,18 +204,8 @@
ys%0A%0A
-date = ''%0A
tabl
@@ -277,26 +277,25 @@
of
-time index (1...N)
+decimal hour time
and
@@ -470,65 +470,147 @@
t1)%0A
+%0A
#
-deg... |
d84034db71abac46ef765f1640f3efa6712f5c42 | Update RegisterHandler.py | Handlers/RegisterHandler.py | Handlers/RegisterHandler.py | # -*- coding: utf-8 -*-
import logging
from Handlers.BaseHandler import BaseHandler
from Tools import PostgreSQL, VerifyFields
logger = logging.getLogger(__name__)
class RegisterHandler(BaseHandler):
"""handle / endpoint"""
def initialize(self):
self.conn = PostgreSQL.get_session()
def get(sel... | Python | 0.000001 | @@ -230,80 +230,8 @@
%22%22%0A%0A
- def initialize(self):%0A self.conn = PostgreSQL.get_session()%0A%0A
|
a7160ce9345b14e656ce702b187048347b843811 | update test_with_count_combination.py | tests/unit/selection/modules/test_with_count_combination.py | tests/unit/selection/modules/test_with_count_combination.py | # Tai Sakuma <tai.sakuma@gmail.com>
import itertools
import pytest
try:
import unittest.mock as mock
except ImportError:
import mock
from alphatwirl.selection.modules import AllwCount, AnywCount, NotwCount
##__________________________________________________________________||
class MockEventSelection(object)... | Python | 0.000002 | @@ -484,28 +484,34 @@
_%7C%7C%0A
-def test_combination
+@pytest.fixture()%0Adef tree
():%0A
@@ -1460,24 +1460,329 @@
.add(all1)%0A%0A
+ return dict(%0A alls=(all0, all1, all2, all3),%0A anys=(any1, ),%0A nots=(not1, ),%0A sels=(sel1, sel2, sel3, sel4, sel5)%0A )%0A%0A##_____________... |
19b251a41ad26d7dabaf571b9bb90b82b9108d4b | fix hostname config issue | vint/cerf_api.py | vint/cerf_api.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import logging
import json
from urlparse import urljoin
import requests
__author__ = 'tchen'
logger = logging.getLogger(__name__)
DEFAULT_HOSTNAME = 'http://exam.tchen.me'
#DEFAULT_HOSTNAME = 'http://localhost:8000'
class Request(object):
hostname ... | Python | 0.000004 | @@ -368,24 +368,56 @@
authcode):%0A
+ from misc import config%0A
self
@@ -492,16 +492,155 @@
i_path%0A%0A
+ if config:%0A try:%0A self.hostname = config.get('global', 'host')%0A except:%0A pass%0A%0A
def
@@ -1481,32 +1481,89 @@
lobal',... |
63153322b9b4ef8d852c8e8a1621a724b8a56ac7 | Update mongo_future_return.py | salt/returners/mongo_future_return.py | salt/returners/mongo_future_return.py | # -*- coding: utf-8 -*-
'''
Return data to a mongodb server
Required python modules: pymongo
This returner will send data from the minions to a MongoDB server. To
configure the settings for your MongoDB server, add the following lines
to the minion config files:
.. code-block:: yaml
mongo.db: <database name>
... | Python | 0 | @@ -1806,24 +1806,71 @@
ngo.version%0A
+ version = '.'.join(version.split('.')%5B:2%5D)%0A
HAS_PYMO
|
98d0e2d5aaff184afc598bef67491632c0eab066 | Add save_load and get_load to mongo returner | salt/returners/mongo_future_return.py | salt/returners/mongo_future_return.py | '''
Return data to a mongodb server
Required python modules: pymongo
This returner will send data from the minions to a MongoDB server. To
configure the settings for your MongoDB server, add the following lines
to the minion config files::
mongo.db: <database name>
mongo.host: <server ip address>
mongo... | Python | 0 | @@ -1886,24 +1886,315 @@
rt(sdata)%0A%0A%0A
+def save_load(jid, load):%0A '''%0A Save the load for a given job id%0A '''%0A conn, db = _get_conn()%0A col = db%5Bjid%5D%0A col.insert(load)%0A%0A%0Adef get_load(jid):%0A '''%0A Returnt he load asociated with a given job id%0A '''%0A conn, db... |
0aaa9000f8cf545bd5bfa41b6538d56c91dbde97 | Update base box in sample config too | sampleconfigs/makebs.config.sample.py | sampleconfigs/makebs.config.sample.py | #!/usr/bin/env python2
# You will need to alter these before running ./makebuildserver
# Name of the base box to use...
basebox = "raring32"
# Location where raring32.box can be found, if you don't already have
# it. Could be set to https://f-droid.org/raring32.box if you like...
baseboxurl = "/shares/software/OS an... | Python | 0 | @@ -126,19 +126,20 @@
ebox = %22
-rar
+test
ing32%22%0A%0A
@@ -218,118 +218,217 @@
it.
-Could be set to https://f-droid.org/raring32.box if you like...%0Abaseboxurl = %22/shares/software/OS and Boot/rar
+For security reasons, it's recommended that you make your own%0A# in a secure environment using trusted media (s... |
ce062240f9ff137a7f585d7f13f1144cca22e2e9 | Tweak to notebook -> .py export, at Fernando's suggestion. | IPython/nbformat/v2/nbpy.py | IPython/nbformat/v2/nbpy.py | """Read and write notebooks as regular .py files.
Authors:
* Brian Granger
"""
#-----------------------------------------------------------------------------
# Copyright (C) 2008-2011 The IPython Development Team
#
# Distributed under the terms of the BSD License. The full license is in
# the file COPYING, dist... | Python | 0 | @@ -3882,32 +3882,50 @@
lines = %5B
+u'# coding: utf-8'
%5D%0A lines.
@@ -3939,28 +3939,8 @@
%5Bu'#
- coding: utf-8', u'#
%3Cnb
|
f5ea4c44480b0beafd7d22b50228d50d3130e7a2 | support for deleting files when using utils-process in auto-mode | utils/process.py | utils/process.py | #!/usr/bin/env python
# Copyright (C) 2010-2014 Cuckoo Foundation.
# This file is part of Cuckoo Sandbox - http://www.cuckoosandbox.org
# See the file 'docs/LICENSE' for copying permission.
import os
import sys
import time
import logging
import argparse
import multiprocessing
logging.basicConfig(level=logging.INFO)
l... | Python | 0 | @@ -464,16 +464,68 @@
Config%0A
+from lib.cuckoo.common.constants import CUCKOO_ROOT%0A
from lib
@@ -799,22 +799,63 @@
ss(aid,
-report
+target=None, copy_path=None, report=False, auto
=False):
@@ -1067,16 +1067,249 @@
ORTED)%0A%0A
+ if auto:%0A if cfg.cuckoo.delete_original and os.path.exists(t... |
bcf6e41b489b5447186c063193d32714856bdfc7 | Add some example docs | InvenTree/plugin/samples/integration/custom_panel_sample.py | InvenTree/plugin/samples/integration/custom_panel_sample.py | """
Sample plugin which renders custom panels on certain pages
"""
from plugin import IntegrationPluginBase
from plugin.mixins import PanelMixin
from part.views import PartDetail
from stock.views import StockLocationDetail
class CustomPanelSample(PanelMixin, IntegrationPluginBase):
"""
A sample plugin which... | Python | 0.000001 | @@ -879,24 +879,303 @@
request):%0A%0A
+ %22%22%22%0A You can decide at run-time which custom panels you want to display!%0A%0A - Display on every page%0A - Only on a single page or set of pages%0A - Only for a specific instance (e.g. part)%0A - Based on the user viewing the ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.