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 |
|---|---|---|---|---|---|---|---|
625d250c7eabcf48292590a6b0ca57f1b3cc7c49 | Add meshprocessing scratch | scratch/meshprocessing.py | scratch/meshprocessing.py | Python | 0.000001 | @@ -0,0 +1,1712 @@
+import networkx as nx%0Afrom time import time%0Aimport numpy as np%0A%0Adef mesh2graph(faces):%0A %22%22%22 Converts a triangular mesh to a graph only taking%0A the connectivity into account %22%22%22%0A g = nx.Graph()%0A for i in range(len(faces)):%0A g.add_edge(faces%5Bi,0%5D, f... | |
6a13511db8401a17a5c6feb7071af821211c2836 | Create sitemap urls | opps/sitemaps/urls.py | opps/sitemaps/urls.py | Python | 0.000207 | @@ -0,0 +1,728 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Afrom django.conf.urls import patterns, url%0Afrom django.contrib.sitemaps import views as sitemap_views%0A%0Afrom opps.sitemaps.sitemaps import GenericSitemap, InfoDisct%0A%0A%0Asitemaps = %7B%0A 'articles': GenericSitemap(InfoDisct(), priority=0.6... | |
a2309df146fd9870f4ec4dd6f422af5a37a037c1 | Add a spacer pixel between images. [ci skip] | examples/utils.py | examples/utils.py | import climate
import pickle
import gzip
import numpy as np
import os
import tempfile
logging = climate.get_logger(__name__)
climate.enable_default_logging()
try:
import matplotlib.pyplot as plt
except ImportError:
logging.critical('please install matplotlib to run the examples!')
raise
try:
import ... | Python | 0.000003 | @@ -2397,20 +2397,36 @@
os((
-s * n, s * n
+(s+1) * n - 1, (s+1) * n - 1
, ch
@@ -2534,17 +2534,21 @@
img%5Br *
-s
+(s+1)
:(r+1) *
@@ -2552,26 +2552,58 @@
) *
-s, c * s:(c+1) * s
+(s+1) - 1,%0A c * (s+1):(c+1) * (s+1) - 1
%5D =
|
78d926434ff1ad6ade0764ac18cca2413a5beccb | Bump dev version in master | fabric/version.py | fabric/version.py | """
Current Fabric version constant plus version pretty-print method.
This functionality is contained in its own module to prevent circular import
problems with ``__init__.py`` (which is loaded by setup.py during installation,
which in turn needs access to this version information.)
"""
from subprocess import Popen, ... | Python | 0 | @@ -602,20 +602,20 @@
(1,
-2
+3
, 0, '
-final
+alpha
', 0
|
f18dc77d49a7c5154df11232f645dbb8e0f897dd | Remove bias | models/dual_encoder.py | models/dual_encoder.py | import tensorflow as tf
import numpy as np
from models import helpers
FLAGS = tf.flags.FLAGS
def get_embeddings(hparams):
if hparams.glove_path and hparams.vocab_path:
tf.logging.info("Loading Glove embeddings...")
vocab_array, vocab_dict = helpers.load_vocab(hparams.vocab_path)
glove_vectors, glove_dic... | Python | 0.000017 | @@ -2035,16 +2035,18 @@
r())%0A
+ #
b = tf.
@@ -2177,12 +2177,8 @@
, M)
- + b
%0A
|
04d122d88bb9f71843df924e048b12de1976b847 | Add missing migration | src/keybar/migrations/0008_entry_salt.py | src/keybar/migrations/0008_entry_salt.py | Python | 0.0002 | @@ -0,0 +1,439 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('keybar', '0007_remove_entry_key'),%0A %5D%0A%0A operations = %5B%0A migrations.AddField(%... | |
3ac5648f8f3ab9e2dd6d93002f63c65bedb3e637 | Patch beanstalkd collector | src/collectors/beanstalkd/beanstalkd.py | src/collectors/beanstalkd/beanstalkd.py | # coding=utf-8
"""
Collects the following from beanstalkd:
- Server statistics via the 'stats' command
- Per tube statistics via the 'stats-tube' command
#### Dependencies
* beanstalkc
"""
import re
import diamond.collector
try:
import beanstalkc
beanstalkc # workaround for pyflakes issue #13
ex... | Python | 0.00001 | @@ -411,16 +411,62 @@
ector):%0A
+ SKIP_LIST = %5B'version', 'id', 'hostname'%5D%0A
COUN
@@ -1996,20 +1996,29 @@
tat
-!= 'version'
+not in self.SKIP_LIST
:%0A
|
531da297c57c7b359c37a743095c10e7ad0592cf | Add test_container | tests/test_container.py | tests/test_container.py | Python | 0.000003 | @@ -0,0 +1,486 @@
+import pdir%0A%0A%0Adef test_acting_like_a_list():%0A dadada = 1%0A cadada = 1%0A vadada = 1%0A apple1 = 1%0A xapple2 = 1%0A result, correct = pdir(), dir()%0A assert len(correct) == len(result)%0A%0A for x, y in zip(correct, result):%0A assert x == y%0A%0A%0Adef test_a... | |
ddf296682cce9e367bc73a33117c969a8def6ee7 | Fix PEP8 error | tests/test_operators.py | tests/test_operators.py | import unittest
from nose.tools import *
from gargoyle.operators.comparable import *
from gargoyle.operators.identity import *
from gargoyle.operators.misc import *
class BaseCondition(object):
def test_has_label(self):
ok_(self.condition.label)
def test_has_description(self):
ok_(self.condi... | Python | 0.000012 | @@ -3618,16 +3618,17 @@
False)%0A%0A
+%0A
class Te
|
79ebedc800c31b47bd0cc340de06dafcd6ade7f9 | Add TwrOauth basic test | tests/test_twr_oauth.py | tests/test_twr_oauth.py | Python | 0 | @@ -0,0 +1,2641 @@
+#!/usr/bin/env python%0A#%0A# Copyright (c) 2013 Martin Abente Lahaye. - tch@sugarlabs.org%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, i... | |
d15c8eaca5fb115b8600a8e743ae73a9edba9a5b | Initialize P04_datetimeModule | books/AutomateTheBoringStuffWithPython/Chapter15/P04_datetimeModule.py | books/AutomateTheBoringStuffWithPython/Chapter15/P04_datetimeModule.py | Python | 0.000008 | @@ -0,0 +1,678 @@
+# This program uses the datetime module to manipulate dates and times.%0A%0A# The datetime Module%0Aimport datetime, time%0Aprint(datetime.datetime.now())%0A%0Adt = datetime.datetime(2015, 10, 21, 16, 29, 0)%0Aprint((dt.year, dt.month, dt.day))%0Aprint((dt.hour, dt.minute, dt.second))%0A%0Aprint(date... | |
8106c22a5c05f438eb9c6436af054fd1e72b103c | Add SK_IGNORE_FASTER_TEXT_FIX define for staging Skia change. | public/blink_skia_config.gyp | public/blink_skia_config.gyp | #
# Copyright (C) 2012 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 an... | Python | 0.000004 | @@ -2273,16 +2273,55 @@
IES=1',%0A
+ 'SK_IGNORE_FASTER_TEXT_FIX',%0A
|
bb940826d78e44a4098023e83d788b3d915b9b1f | Revert "Add the GitHub-supported format extensions." | grip/constants.py | grip/constants.py | # The supported extensions, as defined by https://github.com/github/markup
supported_extensions = [
'.markdown', '.mdown', '.mkdn', '.md',
'.textile',
'.rdoc',
'.org',
'.creole',
'.mediawiki', '.wiki',
'.rst',
'.asciidoc', '.adoc', '.asc',
'.pod',
]
# The default filenames when no ... | Python | 0 | @@ -96,195 +96,27 @@
= %5B
-%0A '.markdown', '.mdown', '.mkdn', '.md',%0A '.textile',%0A '.rdoc',%0A '.org',%0A '.creole',%0A '.mediawiki', '.wiki',%0A '.rst',%0A '.asciidoc', '.adoc', '.asc',%0A '.pod',%0A%5D%0A
+'.md', '.markdown'%5D
%0A%0A#
|
d1952cd6549e3136e802ac17ecee0fd182455729 | Revert "Add Projects Team name to Alert-Mail subject" | src/sentry/plugins/sentry_mail/models.py | src/sentry/plugins/sentry_mail/models.py | """
sentry.plugins.sentry_mail.models
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2013 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
import sentry
from django.conf import settings
from django.core.urlresolvers import reverse
from django.utils.safestring ... | Python | 0 | @@ -2115,36 +2115,8 @@
ect%0A
- team = project.team%0A
@@ -2138,14 +2138,8 @@
%5B%7B0%7D
- - %7B1%7D
%5D AL
@@ -2144,17 +2144,17 @@
ALERT: %7B
-2
+1
%7D'.forma
@@ -2160,47 +2160,8 @@
at(%0A
- team.name.encode('utf-8'),%0A
|
f5718764185ce1149ed291601e4fe28f9cd2be06 | add single list module for mini-stl (Python) | python/mini-stl/single_list.py | python/mini-stl/single_list.py | Python | 0 | @@ -0,0 +1,3082 @@
+#!/usr/bin/python -e%0A# -*- encoding: utf-8 -*-%0A#%0A# Copyright (c) 2013 ASMlover. All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A#%0A# * Redistributions of sour... | |
0be7f2fe05588d93eb478a4fa648d310055b3ce7 | Add experimental generation code to make drafts from raster images | pyweaving/generators/raster.py | pyweaving/generators/raster.py | Python | 0 | @@ -0,0 +1,1232 @@
+from .. import Draft%0Afrom PIL import Image%0A%0A%0Adef point_threaded(im, warp_color=(0, 0, 0), weft_color=(255, 255, 255),%0A shafts=40, max_float=8, repeats=2):%0A %22%22%22%0A Given an image, generate a point-threaded drawdown that attempts to%0A represent the image. ... | |
de325dbe53bbd28eddcbbf188f2689474994249b | add migration for new version of storedmessages | osmaxx-py/osmaxx/third_party_apps/stored_messages/migrations/0002_message_url.py | osmaxx-py/osmaxx/third_party_apps/stored_messages/migrations/0002_message_url.py | Python | 0 | @@ -0,0 +1,402 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('stored_messages', '0001_initial'),%0A %5D%0A%0A operations = %5B%0A migrations.AddField(%... | |
1472011cb8cd323357626443f714284feedfed62 | add merge of ACIS provided data | scripts/climodat/use_acis.py | scripts/climodat/use_acis.py | Python | 0 | @@ -0,0 +1,1921 @@
+%22%22%22Use data provided by ACIS to replace climodat data%22%22%22%0Aimport requests%0Aimport sys%0Aimport psycopg2%0Aimport datetime%0A%0ASERVICE = %22http://data.rcc-acis.org/StnData%22%0A%0A%0Adef safe(val):%0A if val in %5B'M', 'S'%5D:%0A return None%0A if val == 'T':%0A re... | |
b333d95f3f4187b9d9b480ba8ff4985a62d65f41 | Add tests for nginx version | tests/pytests/unit/modules/test_nginx.py | tests/pytests/unit/modules/test_nginx.py | Python | 0.999999 | @@ -0,0 +1,736 @@
+import pytest%0Aimport salt.modules.nginx as nginx%0Afrom tests.support.mock import patch%0A%0A%0A@pytest.fixture%0Adef configure_loader_modules():%0A return %7Bnginx: %7B%7D%7D%0A%0A%0A@pytest.mark.parametrize(%0A %22expected_version,nginx_output%22,%0A %5B%0A (%221.2.3%22, %22nginx ... | |
e77b9a5dff36b3318759a18a786c7cc08bb8ac3e | Create Scramble_String.py | Array/Scramble_String.py | Array/Scramble_String.py | Python | 0.000081 | @@ -0,0 +1,1721 @@
+Given a string s1, we may represent it as a binary tree by partitioning it to two non-empty substrings recursively.%0A%0ABelow is one possible representation of s1 = %22great%22:%0A%0A great%0A / %5C%0A gr eat%0A / %5C / %5C%0Ag r e at%0A / %5C%0A a t%0ATo s... | |
f25b69a6ad6777576e31d0b01c4fc2c2bbe02788 | Create new.py | simple_mqtt/templates/new.py | simple_mqtt/templates/new.py | Python | 0.000001 | @@ -0,0 +1 @@
+%0A
| |
0ee5d568ddc1f37abedb94f32d6b7da0439e6a4d | Create title_retriever.py | solutions/title_retriever.py | solutions/title_retriever.py | Python | 0.000003 | @@ -0,0 +1,711 @@
+'''%0AScript that will scrape the title of the given website%0A'''%0A%0Aimport urllib%0Aimport re%0A%0Adef getstock(title):%0A regex = '%3Ctitle%3E(.+?)%3C/title%3E' #find all contents within title braces%0A pattern = re.compile(regex) #converts regex into a pattern that can be understood by re... | |
071da9c0668d495e052baf5ad4d5bc9e068aa6a7 | Create dict2xml.py | dict2xml.py | dict2xml.py | Python | 0 | @@ -0,0 +1,931 @@
+# Python Dictionary to XML converter%0A# Written by github.com/Pilfer%0A# @CodesStuff%0Aclass dict2xml:%0A def __init__(self, debug = False):%0A self.debug = debug%0A if self.debug:%0A print %22json2xml class has been loaded%22%0A%0A def genXML(self,xmldict):%0A ... | |
320da5dcc192d654d09ea631e9684f26e97795c0 | add mitm script | reversing/400a-graphic/mitm.py | reversing/400a-graphic/mitm.py | Python | 0 | @@ -0,0 +1,1132 @@
+vals = %5B0xdeadbeef,0xcafebabe,0xdeadbabe,0x8badf00d,0xb16b00b5,0xcafed00d,0xdeadc0de,0xdeadfa11,0xdefec8ed,0xdeadfeed,0xfee1dead,0xfaceb00b,0xfacefeed,0x000ff1ce,0x12345678,0x743029ab,0xdeed1234,0x00000000,0x11111111,0x11111112,0x11111113,0x42424242%5D%0A%0Astart = 0xdeadbeef%0Atarget = 0x764c648c... | |
0733ef7d32f5a4731cdfce652733e67b2ed023b4 | Fix podnapisi download | subliminal/providers/podnapisi.py | subliminal/providers/podnapisi.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
import io
import logging
import re
import xml.etree.ElementTree
import zipfile
import babelfish
import bs4
import guessit
import requests
from . import Provider
from .. import __version__
from ..exceptions import InvalidSubtitle, ProviderNotAvailable, Prov... | Python | 0 | @@ -6133,16 +6133,21 @@
ubtitle.
+page_
link%5B38:
|
b46fa327b62d114cedefe1a38cf383189dcb5092 | Fix doc language | doc/conf.py | doc/conf.py | import sys
from os.path import abspath
from pathlib import Path
from json import loads as json_loads
ROOT = Path(__file__).resolve().parent
sys.path.insert(0, abspath("."))
# -- General configuration ------------------------------------------------
project = "pptrees"
version = "1.0.8"
copyright = "2020, tdene"
au... | Python | 0 | @@ -1969,18 +1969,20 @@
guage =
+%22
en
+%22
%0A%0Aexclud
|
056bd290a4df08876109ef4e2da1115783a06f25 | Add examples for setting classes attribute | examples/classes.py | examples/classes.py | Python | 0 | @@ -0,0 +1,1756 @@
+from flask_table import Table, Col%0A%0A%0A%22%22%22If we want to put an HTML class onto the table element, we can set%0Athe %22classes%22 attribute on the table class. This should be an iterable%0Aof that are joined together and all added as classes. If none are set,%0Athen no class is added to the... | |
3e5587f087bdb24f1b13ec54725f27ddca629869 | Make sure remember_rejected sets the config modified flag on the right feed when entries expire. | flexget/plugins/filter/remember_rejected.py | flexget/plugins/filter/remember_rejected.py | import logging
from datetime import datetime, timedelta
from sqlalchemy import Column, Integer, String, Unicode, DateTime, ForeignKey, and_, Index
from sqlalchemy.orm import relation
from flexget import schema
from flexget.event import event
from flexget.plugin import register_plugin, register_parser_option, register_f... | Python | 0.000003 | @@ -3694,16 +3694,34 @@
.name))%0A
+ else:%0A
@@ -3743,16 +3743,20 @@
d items%0A
+
@@ -3791,32 +3791,135 @@
(RememberEntry).
+filter(RememberEntry.feed_id == old_feed.id).%5C%0A
filter(RememberE
@@ -3966,16 +3966,20 @@
... |
f16187d5943158d82fc87611f998283789b5ecdf | Add libarchive 3.1.2 | packages/libarchive.py | packages/libarchive.py | Python | 0.000004 | @@ -0,0 +1,231 @@
+Package ('libarchive', '3.1.2', sources = %5B'http://libarchive.org/downloads/%25%7Bname%7D-%25%7Bversion%7D.tar.gz'%5D,%0A%09configure_flags = %5B%0A%09'--enable-bsdtar=shared',%0A%09'--enable-bsdcpio=shared',%0A%09'--disable-silent-rules',%0A%09'--without-nettle'%5D%0A)%0A
| |
b9b2b87f0d630de931765c1c9f448e295440e611 | Create fetch_qt_version.py | fetch_qt_version.py | fetch_qt_version.py | Python | 0 | @@ -0,0 +1,2146 @@
+%22%22%22Module to return the Qt version of a Qt codebase.%0A%0AThis module provides a function that returns the version of a Qt codebase, given%0Athe toplevel qt5 repository directory. Note, the %60qt5%60 directory applies to both%0AQt 5.x and Qt 6.x%0A%0AIf it is run standalone with a python inter... | |
1ae4f976c22dd3c07de6882f9a18b0be606ff5e3 | Check for empty dataset | km3pipe/utils/streamds.py | km3pipe/utils/streamds.py | # coding=utf-8
"""
Access the KM3NeT StreamDS DataBase service.
Usage:
streamds
streamds list
streamds upload CSV_FILE
streamds info STREAM
streamds get STREAM [PARAMETERS...]
streamds (-h | --help)
streamds --version
Options:
STREAM Name of the stream.
CSV_FILE Tab separat... | Python | 0.000015 | @@ -2995,24 +2995,104 @@
return
+%0A %0A if len(df) == 0:%0A log.critical(%22Empty dataset.%22)%0A return
%0A%0A print(
|
f9b38f675df9752a4b5309df059c6d15a1e1b3c2 | Add module for range support. | ex_range.py | ex_range.py | Python | 0 | @@ -0,0 +1,1405 @@
+from collections import namedtuple%0A%0Afrom vintage_ex import EX_RANGE_REGEXP%0Aimport location%0A%0A%0AEX_RANGE = namedtuple('ex_range', 'left left_offset separator right right_offset')%0A%0A%0Adef get_range_parts(range):%0A parts = EX_RANGE_REGEXP.search(range).groups()%0A return EX_RANGE(%... | |
15cf6b5d35e2fbaf39d419ddbe5da1b16247ccaa | add test_parse_table_options.py | tests/test_parse_table_options.py | tests/test_parse_table_options.py | Python | 0.000005 | @@ -0,0 +1,1766 @@
+#!/usr/bin/env python3%0A%22%22%22%0A%60header%60 and %60markdown%60 is checked by %60test_to_bool%60 instead%0A%22%22%22%0Afrom .context import pandoc_tables%0Aimport panflute%0A%0A%0Adef test_parse_table_options():%0A options = %7B%0A 'caption': None,%0A 'alignment': None,%0A ... | |
71dd485685a481f21e03af6db5a4bc1f91a64ce9 | Add service settings migration | nodeconductor/structure/migrations/0018_service_settings_plural_form.py | nodeconductor/structure/migrations/0018_service_settings_plural_form.py | Python | 0 | @@ -0,0 +1,441 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('structure', '0017_add_azure_service_type'),%0A %5D%0A%0A operations = %5B%0A migrations.A... | |
578f532bb7a6c75dd6526b9fe130879e0a7cc0e6 | Pick best out of two outputs | session2/select_best_output.py | session2/select_best_output.py | Python | 1 | @@ -0,0 +1,1393 @@
+import argparse, logging, codecs%0Afrom nltk.translate.bleu_score import sentence_bleu as bleu%0A%0A%0Adef setup_args():%0A parser = argparse.ArgumentParser()%0A parser.add_argument('out1', help = 'Output 1')%0A parser.add_argument('out2', help = 'Output 2')%0A parser.add_argument('input... | |
3509585cd14bb51fb00b60df1dcb295bc561d679 | Add _version.py file | py/desidatamodel/_version.py | py/desidatamodel/_version.py | Python | 0.000004 | @@ -0,0 +1,28 @@
+__version__ = '0.2.0.dev71'%0A
| |
b3383e6c428eccdd67ddc4cfa90e6d22da35412a | Add lib/sccache.py helper script | script/lib/sccache.py | script/lib/sccache.py | Python | 0.000001 | @@ -0,0 +1,564 @@
+import os%0Aimport sys%0A%0Afrom config import TOOLS_DIR%0A%0A%0AVERSION = '0.2.6'%0ASUPPORTED_PLATFORMS = %7B%0A 'cygwin': 'windows',%0A 'darwin': 'mac',%0A 'linux2': 'linux',%0A 'win32': 'windows',%0A%7D%0A%0A%0Adef is_platform_supported(platform):%0A return platform in SUPPORTED_PLATFORMS%0A%... | |
8302536cafa07a078cfb6629b5e9cc85e1798e1e | Add Appalachian Regional Commission. | inspectors/arc.py | inspectors/arc.py | Python | 0 | @@ -0,0 +1,2227 @@
+#!/usr/bin/env python%0A%0Aimport datetime%0Aimport logging%0Aimport os%0Afrom urllib.parse import urljoin%0A%0Afrom bs4 import BeautifulSoup%0Afrom utils import utils, inspector%0A%0A# http://www.arc.gov/oig%0A# Oldest report: 2003%0A%0A# options:%0A# standard since/year options for a year range ... | |
d834216bcc93eac7b324d95498d9580e3f769dfa | Add Government Printing Office. | inspectors/gpo.py | inspectors/gpo.py | Python | 0 | @@ -0,0 +1,2671 @@
+#!/usr/bin/env python%0A%0Aimport datetime%0Aimport logging%0Afrom urllib.parse import urljoin%0A%0Afrom bs4 import BeautifulSoup%0Afrom utils import utils, inspector%0A%0A# http://www.gpo.gov/oig/%0A# Oldest report: 2004%0A%0A# options:%0A# standard since/year options for a year range to fetch fr... | |
d3c9a6bdc1b8cfb56f9ad408f5257b9ac518b2ac | Add preprocessor | scripts/preprocess.py | scripts/preprocess.py | Python | 0.000138 | @@ -0,0 +1,1553 @@
+#!/usr/bin/env python%0A%0Aimport argparse%0Aimport os%0A%0A%0Adef preprocess(path):%0A includes = set()%0A res = %5B%5D%0A%0A def preprocess_line(path, line):%0A if line.strip().startswith('#'):%0A line = line.strip()%0A if line.startswith('#include') and len(l... | |
e285c097be60f9db5fae075f21b7450f403640d2 | add scaffold for an AvailabilityAssessment class | python/cvmfs/availability.py | python/cvmfs/availability.py | Python | 0 | @@ -0,0 +1,1100 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated by Ren%C3%A9 Meusel%0AThis file is part of the CernVM File System auxiliary tools.%0A%22%22%22%0A%0Aimport cvmfs%0A%0Aclass WrongRepositoryType(Exception):%0A def __init__(self, repo, expected_type):%0A assert repo.type ... | |
0e9da5d0099b9c7b527250d6bf8051242e77103a | Add script for showing the results | triangular_lattice/distances_analyze.py | triangular_lattice/distances_analyze.py | Python | 0 | @@ -0,0 +1,1566 @@
+#!/usr/bin/env python%0A# -*- coding:utf-8 -*-%0A#%0A# written by Shotaro Fujimoto%0A# 2016-10-12%0A%0Aimport numpy as np%0Aimport matplotlib.pyplot as plt%0Afrom mpl_toolkits.mplot3d.axes3d import Axes3D%0A%0A%0Aif __name__ == '__main__':%0A%0A # result_data_path = %22./results/data/distances/be... | |
29e170f9f92f8327c71a9dfc2b9fb9e18947db72 | create predictions on pre-trained models | source/generate_predictions.py | source/generate_predictions.py | Python | 0.000001 | @@ -0,0 +1,981 @@
+import numpy as np%0Aimport pandas as pd%0Afrom sklearn.externals import joblib%0A%0Afrom data_preprocessing import join_strings%0Afrom model import mlb, count_vectorizer_test_x, tfidf_vectorizer_test_x, file_cnt, file_tfidf%0A%0Acount_vectorizer_model, tfidf_vectorizer_model = joblib.load(file_cnt),... | |
c6358b282ea28dd113c9053dab0fe2fa66f4d59d | Allow metrics to start with a braces expression | webapp/graphite/render/grammar.py | webapp/graphite/render/grammar.py | from graphite.thirdparty.pyparsing import *
ParserElement.enablePackrat()
grammar = Forward()
expression = Forward()
# Literals
intNumber = Combine(
Optional('-') + Word(nums)
)('integer')
floatNumber = Combine(
Optional('-') + Word(nums) + Literal('.') + Word(nums)
)('float')
aString = quotedString('string')
... | Python | 0.000005 | @@ -1035,16 +1035,25 @@
bine(%0A
+Optional(
Word(val
@@ -1066,16 +1066,17 @@
icChars)
+)
+%0A Com
|
1fdd1f306d45f6aeee91c7f016f7c37286ee3b3b | clear signing | lang/python/examples/howto/clear-sign-file.py | lang/python/examples/howto/clear-sign-file.py | Python | 0 | @@ -0,0 +1,2027 @@
+#!/usr/bin/env python3%0A# -*- coding: utf-8 -*-%0A%0Afrom __future__ import absolute_import, division, unicode_literals%0A%0A# Copyright (C) 2018 Ben McGinnes %3Cben@gnupg.org%3E%0A#%0A# This program is free software; you can redistribute it and/or modify it under%0A# the terms of the GNU General P... | |
c199892e07217f164ae694d510b206bfa771090b | remove unused import | src/vmw/vco/components.py | src/vmw/vco/components.py | # Copyright (c) 2001-2010 Twisted Matrix Laboratories.
# 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 rights
# to use, copy, modify, me... | Python | 0.000001 | @@ -1144,20 +1144,8 @@
ace,
- implements,
dec
|
5fcdad9f147ec20f5b6427feb1a02e862f9bfbe9 | version bump | standard_form/__init__.py | standard_form/__init__.py | __version__ = '1.1.0' | Python | 0.000001 | @@ -16,6 +16,6 @@
1.1.
-0
+1
'
|
26e339f8f7a43d61a801a6dc82d55b70a3e6cc73 | add a withFlag param to extract_tags | jieba/analyse/tfidf.py | jieba/analyse/tfidf.py | # encoding=utf-8
from __future__ import absolute_import
import os
import jieba
import jieba.posseg
from operator import itemgetter
_get_module_path = lambda path: os.path.normpath(os.path.join(os.getcwd(),
os.path.dirname(__file__), path))
_get_abs_path = jieba._get_abs... | Python | 0.000001 | @@ -2578,16 +2578,32 @@
owPOS=()
+, withFlag=False
):%0A
@@ -3059,16 +3059,220 @@
ltered.%0A
+ - withFlag: only work with allowPOS is not empty.%0A if True, return a list of pair(word, weight) like posseg.cut%0A if False, return a list of words%0A
... |
f76c06acf52094cd13cdf7087fa8d3914c2b992a | Add interactive module | sirius/interactive.py | sirius/interactive.py | Python | 0.000001 | @@ -0,0 +1,405 @@
+%0A%22%22%22Interactive sirius module%0A%0AUse this module to define variables and functions to be globally available when%0Ausing%0A%0A 'from sirius.interactive import *'%0A%22%22%22%0A%0Afrom pyaccel.interactive import *%0Aimport sirius.SI_V07 as si_model%0Aimport sirius.BO_V901 as bo_model%0A%0... | |
f1e6926f964877acc3bfe0d667a199861b431ed7 | add test_xadc | software/test_xadc.py | software/test_xadc.py | Python | 0.000001 | @@ -0,0 +1,319 @@
+def main(wb):%0A%09wb.open()%0A%09regs = wb.regs%0A%09# # #%0A%09print(%22temperature: %25f%C2%B0C%22 %25(regs.xadc_temperature.read()*503.975/4096 - 273.15))%0A%09print(%22vccint: %25fV%22 %25(regs.xadc_vccint.read()/4096*3))%0A%09print(%22vccaux: %25fV%22 %25(regs.xadc_vccaux.read()/4096*3))%0A%09p... | |
c2dab85f24e648c66daae847f19b605271ed858b | Add more threader tests | spec/threader_spec.py | spec/threader_spec.py | from expects import expect, be
from doublex import Spy, Mock
from pysellus import threader
with description('the threader module'):
with it('should create as many threads as keys * values in the supplied dict'):
a_stream = Mock()
another_stream = Mock()
foo = Spy()
a_function = Sp... | Python | 0 | @@ -1,12 +1,86 @@
+import queue%0Afrom functools import partial%0A%0Afrom doublex import Spy, Mock%0A
from expects
@@ -110,33 +110,48 @@
doublex
- import Spy, Mock
+_expects import have_been_called
%0A%0Afrom p
@@ -266,24 +266,33 @@
as
-keys *
+the sum of len(
values
- in
+) of
the
@@ -440,32 +440,33 @@
unc... |
e6a137026ff9b84814199517a452d354e121a476 | Create quiz_3.py | laboratorios/quiz_3.py | laboratorios/quiz_3.py | Python | 0.001596 | @@ -0,0 +1,386 @@
+#dado un intervalo de tiempo en segundos, calcular los segundos restantes %0A#corresponden para convertirse exactamente en minutos. Este programa debe %0A#funcionar para 5 oportunidades.%0A%0Achance = 0%0Asegundos_restantes = 0%0Awhile chance %3C 5:%0A%09segundos = int (input(%22Introduzca sus segund... | |
58ac46511964ca1dd3de25d2b6053eb785e3e281 | Add outlier detection util script. | util/detect-outliers.py | util/detect-outliers.py | Python | 0 | @@ -0,0 +1,2389 @@
+#!/usr/bin/env python2%0A#%0A# Detect outlier faces (not of the same person) in a directory%0A# of aligned images.%0A# Brandon Amos%0A# 2016/02/14%0A#%0A# Copyright 2015-2016 Carnegie Mellon University%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use th... | |
dad13d26aaf58ea186891e138ac9a10153363c8a | add vicon data extraction | script_r448_vicon_process.py | script_r448_vicon_process.py | Python | 0.000001 | @@ -0,0 +1,519 @@
+import pickle%0Aimport signal_processing as sig_proc%0A%0Adir_name = '../data/r448/r448_131022_rH/'%0A%0Aimg_ext = '.png'%0Asave_img = True%0Ashow = False%0Asave_obj = True%0A%0Asp = sig_proc.Signal_processing(save_img, show, img_ext)%0A%0Afilename='p0_3RW05'%0Afile_events=sp.load_csv(dir_name+filena... | |
b46e7e31c5476c48e2a53d5a632354700d554174 | Add test_html_fetchers | tests/test_html_fetchers.py | tests/test_html_fetchers.py | Python | 0.000001 | @@ -0,0 +1,1604 @@
+import os%0Aimport sys%0Asys.path.insert(0, os.path.dirname(os.path.dirname(os.path.abspath(__file__))))%0A%0Aimport unittest%0Afrom unittest import mock%0A%0Afrom web_scraper.core import html_fetchers%0A%0A%0Adef mocked_requests_get(*args, **kwargs):%0A%09%22%22%22this method will be used by the mo... | |
b4f8e8d38636a52d3d4b199fdc670ff93eca33f6 | Add prototype for filters module. | mltils/filters.py | mltils/filters.py | Python | 0 | @@ -0,0 +1,192 @@
+# pylint: disable=missing-docstring, invalid-name, import-error%0A%0A%0Aclass VarianceFilter(object):%0A pass%0A%0A%0Aclass SimilarityFilter(object):%0A pass%0A%0A%0Aclass CorrelationFilter(object):%0A pass%0A
| |
b0f5c33461d08325581cc0ad272c7f2b39b8dc66 | Fix typo. | metpy/calc/__init__.py | metpy/calc/__init__.py | import basic
from basic import *
__all__ == []
__all__.extend(basic.__all__)
| Python | 0.001604 | @@ -36,17 +36,16 @@
_all__ =
-=
%5B%5D%0A__al
|
167712a6640abca106bbcd50daf5dc22ba90083d | Fix log formatting | src/sentry/tasks/email.py | src/sentry/tasks/email.py | """
sentry.tasks.email
~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import, print_function
import logging
from django.core.mail import get_connection
from sentry.tasks.base import inst... | Python | 0.000005 | @@ -838,17 +838,16 @@
up %25r',
-(
user, gr
@@ -850,17 +850,16 @@
, group)
-)
%0A
|
5e1c58db69adad25307d23c240b905eaf68e1671 | Add fade animation | src/fade_animation.py | src/fade_animation.py | Python | 0.000001 | @@ -0,0 +1,1950 @@
+import animation, colorsys%0A%0Adef colorunpack(color):%0A color = int(color)%0A return ((color %3E%3E 16) / 255,%0A ((color %3E%3E 8) & 255) / 0xff,%0A (color & 0xff) / 0xff)%0Adef colorpack(color):%0A return sum(int(color%5Bi%5D * 0xff) %3C%3C (16 - 8*i) for i in ran... | |
f537abe2ff1826a9decd9dace5597cbc4f7f318b | Add 1.6 | 1_arrays_hashtables/string_compression.py | 1_arrays_hashtables/string_compression.py | Python | 0.999996 | @@ -0,0 +1,794 @@
+def compress(string):%0A count_array = %5B%5D%0A element_count = 1%0A for index, character in enumerate(string%5B1:%5D):%0A print(character, string%5Bindex%5D)%0A if string%5Bindex%5D == character:%0A element_count = element_count + 1%0A else:%0A co... | |
296efcc28e19fc76371496881a546f1ca52dc622 | add nagios check for iembot availability | nagios/check_iembot.py | nagios/check_iembot.py | Python | 0 | @@ -0,0 +1,404 @@
+%22%22%22Ensure iembot is up.%22%22%22%0Aimport sys%0A%0Aimport requests%0A%0A%0Adef main():%0A %22%22%22Go Main Go.%22%22%22%0A req = requests.get('http://iembot:9004/room/kdmx.xml')%0A if req.status_code == 200:%0A print(%22OK - len(kdmx.xml) is %25s%22 %25 (len(req.content), ))%0A ... | |
1d0c0741f1605f3786a752288161c679ab271ea2 | Add a utility file for aggregating decorators | website/addons/osfstorage/decorators.py | website/addons/osfstorage/decorators.py | Python | 0.000001 | @@ -0,0 +1,1574 @@
+import functools%0A%0Afrom webargs import Arg%0Afrom webargs import core%0A%0Afrom framework.auth.decorators import must_be_signed%0A%0Afrom website.models import User%0Afrom framework.exceptions import HTTPError%0Afrom website.addons.osfstorage import utils%0Afrom website.project.decorators import ... | |
bb8e7ee023d678e68d1da3018bf6d1d3d36d55bd | Create new package (#6588) | var/spack/repos/builtin/packages/perl-statistics-descriptive/package.py | var/spack/repos/builtin/packages/perl-statistics-descriptive/package.py | Python | 0 | @@ -0,0 +1,1639 @@
+##############################################################################%0A# Copyright (c) 2013-2017, Lawrence Livermore National Security, LLC.%0A# Produced at the Lawrence Livermore National Laboratory.%0A#%0A# This file is part of Spack.%0A# Created by Todd Gamblin, tgamblin@llnl.gov, All r... | |
12f7dddcbe8c7c2160bf8de8f7a9c3082b950003 | Create longest-harmonious-subsequence.py | Python/longest-harmonious-subsequence.py | Python/longest-harmonious-subsequence.py | Python | 0.999951 | @@ -0,0 +1,448 @@
+# Time: O(n)%0A# Space: O(n)%0A%0Aclass Solution(object):%0A def findLHS(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: int%0A %22%22%22%0A lookup = collections.defaultdict(int)%0A result = 0%0A for num in nums:%0A loo... | |
d7cc3d6590d1d6d46bdf780b93e76ea6aa50334d | Create peak-index-in-a-mountain-array.py | Python/peak-index-in-a-mountain-array.py | Python/peak-index-in-a-mountain-array.py | Python | 0.032261 | @@ -0,0 +1,932 @@
+# Time: O(logn)%0A# Space: O(1)%0A%0A# Let's call an array A a mountain if the following properties hold:%0A#%0A# A.length %3E= 3%0A# There exists some 0 %3C i %3C A.length - 1%0A# such that A%5B0%5D %3C A%5B1%5D %3C ... A%5Bi-1%5D %3C A%5Bi%5D %3E A%5Bi+1%5D %3E ... %3E A%5BA.length - 1%5D%0A# Give... | |
64eab4beaf4e00d47423ea027ec6f40129ee2e95 | Create execi-3.py | execi-3.py | execi-3.py | Python | 0.000001 | @@ -0,0 +1,171 @@
+n1 = int(input(%22Digite um valor: %22))%0Aif n1 %3C 0:%0A print (n1 * -1)%0Aelif n1 %3E 10:%0A n2 = int(input(%22Digite outro valor: %22))%0A print (n1 - n2)%0Aelse:%0A print (n1/5.0)%0A
| |
7dce21cc8fa3b81e150ed6586db8ca80cd537fc7 | Add compat module to test package | test/compat.py | test/compat.py | Python | 0 | @@ -0,0 +1,614 @@
+# -*- coding: utf-8 -*-%0A'''%0AA common module for compatibility related imports and%0Adefinitions used during testing%0A'''%0A%0Afrom __future__ import unicode_literals%0Aimport unittest%0A%0Afrom six import assertCountEqual, PY2%0A%0Atry:%0A from unittest.mock import Mock, MagicMock, patch # @N... | |
9a97847419ad569b1f9f3d302507aca8544944e2 | test file | test_scheme.py | test_scheme.py | Python | 0.000002 | @@ -0,0 +1,320 @@
+import unittest%0Aimport scheme_mongo%0Aclass TestScheme(unittest.TestCase):%0A def runTest(self):%0A mongo_uri = %22mongodb://localhost/test.in%22%0A wrapper = scheme_mongo.open(mongo_uri)%0A assert wrapper%0A for result in wrapper:%0A print result%0A%0Aif _... | |
fc95c998dc8c3caee3e0a4590b96c9ed7e0321a7 | add a test suite for Division | test_htmlgen/block.py | test_htmlgen/block.py | Python | 0 | @@ -0,0 +1,276 @@
+from unittest import TestCase%0A%0Afrom asserts import assert_equal%0A%0Afrom htmlgen import Division%0A%0A%0Aclass DivisionTest(TestCase):%0A%0A def test_render(self):%0A div = Division()%0A div.append(%22Test%22)%0A assert_equal(%5Bb%22%3Cdiv%3E%22, b%22Test%22, b%22%3C/div%... | |
e4980879f0f4a0d223cccc99a486fb62cbe5807f | change models.py | physics/models.py | physics/models.py | from django.db import models
class Student(models.Model):
"""Student Info"""
stu_id = models.CharField(u'学号', max_length=30, primary_key=True)
name = models.CharField(u'姓名', max_length=30)
password = models.CharField(u'密码', max_length=30)
def __unicode__(self):
return '{stu_id} {name}'.fo... | Python | 0.000001 | @@ -588,32 +588,37 @@
odels.TextField(
+u'%E9%A2%98%E7%9B%AE'
)%0A content =
@@ -630,24 +630,29 @@
s.TextField(
+u'%E9%80%89%E9%A1%B9'
)%0A answer
@@ -671,16 +671,23 @@
arField(
+u'%E7%AD%94%E6%A1%88',
max_leng
@@ -827,24 +827,31 @@
s.TextField(
+u'%E9%80%9A%E7%9F%A5%E6%A0%87%E9%A2%98'
)%0A conten
@@... |
964d1f97df600308b23b6a91b9de8811795509a4 | Add a test for the @cachit decorator. | sympy/core/tests/test_cache.py | sympy/core/tests/test_cache.py | Python | 0 | @@ -0,0 +1,217 @@
+from sympy.core.cache import cacheit%0A%0Adef test_cacheit_doc():%0A @cacheit%0A def testfn():%0A %22test docstring%22%0A pass%0A%0A assert testfn.__doc__ == %22test docstring%22%0A assert testfn.__name__ == %22testfn%22%0A
| |
a8ddae9343683ca69067eecbece5ecff6d4e5d1d | Add myStrom switch platform | homeassistant/components/switch/mystrom.py | homeassistant/components/switch/mystrom.py | Python | 0 | @@ -0,0 +1,3335 @@
+%22%22%22%0Ahomeassistant.components.switch.mystrom%0A~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~%0ASupport for myStrom switches.%0A%0AFor more details about this component, please refer to the documentation at%0Ahttps://home-assistant.io/components/switch.mystrom/%0A%22%22%22%0Aimport logging%0Aimport ... | |
fbf5ecffb4249e7f881f53f30625a47a6e779592 | Create selective_array_reversing.py | selective_array_reversing.py | selective_array_reversing.py | Python | 0.000166 | @@ -0,0 +1,352 @@
+#Kunal Gautam%0A#Codewars : @Kunalpod%0A#Problem name: Selective Array Reversing%0A#Problem level: 6 kyu%0A%0Adef sel_reverse(arr,l):%0A li=%5B%5D%0A if not l:%0A return arr%0A for i in range(0,len(arr),l):%0A if i+l%3Elen(arr):%0A li+=(list(reversed(arr%5Bi:%5D)))%0... | |
afe8e16be43b5e66df0f7bf14832f77009aab151 | Create __init__.py | oauth/__init__.py | oauth/__init__.py | Python | 0.000429 | @@ -0,0 +1,2553 @@
+#!/usr/bin/python%0A# -*- coding: utf-8 -*-%0A%22%22%22%0ACreated by bu on 2017-05-10%0A%22%22%22%0Afrom __future__ import unicode_literals%0Aimport json as complex_json%0Aimport requests%0Afrom utils import verify_sign%0Afrom utils import get_sign%0A%0A%0Aclass RequestClient(object):%0A __header... | |
a3bbd175ef5640843cb16b0166b462ffaed25242 | standardize logging interface for fs-drift | fsd_log.py | fsd_log.py | Python | 0 | @@ -0,0 +1,420 @@
+import logging%0A# standardize use of logging module in fs-drift%0A%0Adef start_log(prefix):%0A log = logging.getLogger(prefix)%0A h = logging.StreamHandler()%0A log_format = prefix + ' %25(asctime)s - %25(levelname)s - %25(message)s'%0A formatter = logging.Formatter(log_format)%0A h.s... | |
52e71001b7e775daaaaf42280ebe06c31291b595 | Add a simplemeshtest variant where all AJ packets of one node are always dropped | tests/failmeshtest.py | tests/failmeshtest.py | Python | 0.000002 | @@ -0,0 +1,2447 @@
+#!/usr/bin/env python%0A%0Afrom twisted.internet import reactor%0Afrom mesh import Mesh, MeshNode, packet_type, ATTEMPT_JOIN%0Aimport sys%0A%0ANUMNODES = 5%0ANUMPACKETS = 10%0ADELAY = 0.1%0A%0A%0Anodes = %5B%5D%0A# We're optimists%0Asuccess = True%0A%0Aclass TestMeshNode(MeshNode):%0A nodes = 1%0A%... | |
57fc053939702f4baf04604a9226873c98526ae5 | Add test for Moniker | tests/lsp/test_moniker.py | tests/lsp/test_moniker.py | Python | 0.000001 | @@ -0,0 +1,3557 @@
+############################################################################%0A# Copyright(c) Open Law Library. All rights reserved. #%0A# See ThirdPartyNotices.txt in the project root for additional notices. #%0A# ... | |
20c4df8c61ee1f625ebd77c8613fc470a3e87438 | add another lazy function | lazy_function/another_lazy_class.py | lazy_function/another_lazy_class.py | Python | 0.000217 | @@ -0,0 +1,615 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0Aclass lazy_property(object):%0A def __init__(self, func, name=None, doc=None):%0A self._func = func%0A self._name = name or func.func_name%0A self.__doc__ = doc or func.__doc__%0A%0A def __get__(self, obj, objtype=None):%0A ... | |
1d8fccf6943adf40c77d5d2df002330719dcfcd1 | test for S3Sync | tests/test_s3_sync.py | tests/test_s3_sync.py | Python | 0 | @@ -0,0 +1,931 @@
+import os%0Aimport unittest%0Afrom pathlib import Path%0A%0Aimport mock%0A%0Afrom taskcat._s3_sync import S3Sync%0A%0A%0Aclass TestS3Sync(unittest.TestCase):%0A def test_init(self):%0A m_s3_client = mock.Mock()%0A m_s3_client.list_objects_v2.return_value = %7B%0A %22Conten... | |
0f1cf524c2b90d77e17d516a30d62632ebb5ed2f | Add pipeline for untar'ing GCS blobs. | datathon/datathon_etl_pipelines/generic_imagining/untar_gcs.py | datathon/datathon_etl_pipelines/generic_imagining/untar_gcs.py | Python | 0 | @@ -0,0 +1,1936 @@
+r%22%22%22Untar .tar and .tar.gz GCS files.%22%22%22%0A%0Afrom __future__ import absolute_import%0Afrom __future__ import division%0Afrom __future__ import print_function%0A%0Aimport argparse%0Aimport apache_beam as beam%0Afrom apache_beam.options.pipeline_options import PipelineOptions%0Afrom apach... | |
d68d4e8c1adfa1cdc9577d133c48717b504092e5 | Test extension | tests/testcallable.py | tests/testcallable.py | # Copyright (C) 2007-2011 Michael Foord & the mock team
# E-mail: fuzzyman AT voidspace DOT org DOT uk
# http://www.voidspace.org.uk/python/mock/
from tests.support import is_instance, unittest2, X
from mock import (
Mock, MagicMock, NonCallableMagicMock,
NonCallableMock, patch, create_autospec
)
"""
Note th... | Python | 0.000001 | @@ -191,16 +191,27 @@
test2, X
+, SomeClass
%0A%0Afrom m
@@ -2248,32 +2248,339 @@
pass%0A%0A
+ class Sub(CallableX):%0A pass%0A%0A class Multi(SomeClass, Sub):%0A pass%0A%0A class OldStyle:%0A def __call__(self):%0A pass%0A%0A clas... |
4302389b1e4e5ba753b2f76427408910c05f683c | replace our single use of assertEquals with assertEqual | tests/thirdparty_tests.py | tests/thirdparty_tests.py | # -*- coding: utf-8 -*-
#
# Copyright (C) 2008 John Paulett (john -at- paulett.org)
# All rights reserved.
#
# This software is licensed as described in the file COPYING, which
# you should have received as part of this distribution.
import unittest
import jsonpickle
RSS_DOC = """<?xml version="1.0" encoding="utf-8"... | Python | 0 | @@ -2746,17 +2746,16 @@
ertEqual
-s
(self.do
|
0bf6f0b6021b2ca3801b0d68c0ee63e39ddc36df | Make a ValueBuffer class | proj/avg_pdti8/util.py | proj/avg_pdti8/util.py | Python | 0 | @@ -0,0 +1,2358 @@
+#!/bin/env python%0A# Copyright 2021 Google LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# https://www.apache.org/licenses/LICENSE-2.0%0A#%0A#... | |
f2f4accf304cfe1aaed042f7df35bc0ee86a6c59 | Add enums for service/record/assignment/transaction type | netsgiro/enums.py | netsgiro/enums.py | Python | 0.000001 | @@ -0,0 +1,1291 @@
+from enum import IntEnum%0A%0A%0Aclass ServiceType(IntEnum):%0A NONE = 0%0A OCR_GIRO = 9%0A AVTALEGIRO = 21%0A%0A%0Aclass RecordType(IntEnum):%0A TRANSMISSION_START = 10%0A ASSIGNMENT_START = 20%0A TRANSACTION_AMOUNT_1 = 30%0A TRANSACTION_AMOUNT_2 = 31%0A TRANSACTION_AMOUNT_3... | |
ca16e36b79e9c7dcd5cb31d899ef9c50ebf602c1 | add unit test for _nearest_neighbor() | urbanaccess/tests/test_network.py | urbanaccess/tests/test_network.py | Python | 0.000002 | @@ -0,0 +1,1333 @@
+import pytest%0Aimport pandas as pd%0Afrom urbanaccess import network%0A%0A%0A@pytest.fixture%0Adef nearest_neighbor_dfs():%0A data = %7B%0A 'id': (1, 2, 3),%0A 'x': %5B-122.267546, -122.264479, -122.219119%5D,%0A 'y': %5B37.802919, 37.808042, 37.782288%5D%0A %7D%0A osm... | |
6c4253c1ddf12c7255ed9c68b566b957d85b7048 | use closing output (test is not yet ready) | utest/reporting/test_reporting.py | utest/reporting/test_reporting.py | from StringIO import StringIO
import os
import unittest
from robot.reporting.resultwriter import ResultWriter, Result
from robot.output import LOGGER
from robot.result.executionresult import ExecutionResult
from robot.result.testsuite import TestSuite
from robot.utils.asserts import assert_true, assert_equals
LOGGER... | Python | 0 | @@ -3969,24 +3969,64 @@
etvalue())%0A%0A
+ #TODO: Find a way to test split_log%0A
def _tes
@@ -4115,24 +4115,29 @@
s.log =
-StringIO
+ClosingOutput
()%0A
|
7c5dbbcd1de6376a025117fe8f00516f2fcbb40d | Add regressiontest for crypto_onetimeauth_verify | tests/unit/test_auth_verify.py | tests/unit/test_auth_verify.py | Python | 0.004908 | @@ -0,0 +1,1867 @@
+# Import nacl libs%0Aimport libnacl%0A%0A# Import python libs%0Aimport unittest%0A%0A%0Aclass TestAuthVerify(unittest.TestCase):%0A '''%0A Test onetimeauth functions%0A '''%0A def test_auth_verify(self):%0A msg = b'Anybody can invent a cryptosystem he cannot break himself. Except ... | |
80ccffb269b04af02224c1121c41d4e7c503bc30 | Add unit test for intersperse | tests/util/test_intersperse.py | tests/util/test_intersperse.py | Python | 0.000001 | @@ -0,0 +1,482 @@
+# This file is part of rinohtype, the Python document preparation system.%0A#%0A# Copyright (c) Brecht Machiels.%0A#%0A# Use of this source code is subject to the terms of the GNU Affero General%0A# Public License v3. See the LICENSE file or http://www.gnu.org/licenses/.%0A%0A%0Afrom rinoh.util impor... | |
8f18a1b75b68d8c97efd57673b160a9ceda608a3 | Add Manifest class | manifest.py | manifest.py | Python | 0 | @@ -0,0 +1,23 @@
+__author__ = 'fervent'%0A
| |
e56d9337cc5c63ef61afe8ffdee2019e19af0963 | Add test for resolved issue 184 | test/test_issue184.py | test/test_issue184.py | Python | 0 | @@ -0,0 +1,893 @@
+from rdflib.term import Literal%0Afrom rdflib.term import URIRef%0Afrom rdflib.graph import ConjunctiveGraph%0A%0Adef test_escaping_of_triple_doublequotes():%0A %22%22%22%0A Issue 186 - Check escaping of multiple doublequotes.%0A A serialization/deserialization roundtrip of a certain class o... | |
0988a2a18688a8b8e07d94e1609405c17bbe717d | Add test suite for the playlist plugin | test/test_playlist.py | test/test_playlist.py | Python | 0 | @@ -0,0 +1,2888 @@
+# -*- coding: utf-8 -*-%0A# This file is part of beets.%0A# Copyright 2016, Thomas Scholtes.%0A#%0A# Permission is hereby granted, free of charge, to any person obtaining%0A# a copy of this software and associated documentation files (the%0A# %22Software%22), to deal in the Software without restrict... | |
d7c4e7bcf366965c808e7807d8f37640dc2af281 | Add tests for image_pull_policy | tests/test_objects.py | tests/test_objects.py | """
Test functions used to create k8s objects
"""
from kubespawner.objects import make_pod_spec, make_pvc_spec
def test_make_simplest_pod():
"""
Test specification of the simplest possible pod specification
"""
assert make_pod_spec(
name='test',
image_spec='jupyter/singleuser:latest',
... | Python | 0.000002 | @@ -469,33 +469,76 @@
m_guarantee=None
+,%0A image_pull_policy='IfNotPresent',
%0A
-
) == %7B%0A
@@ -777,32 +777,87 @@
leuser:latest%22,%0A
+ %22imagePullPolicy%22: %22IfNotPresent%22,%0A
@@ -1828,24 +1828,67 @@
ntee='512Mi'
+,%0A image_pull_policy='IfNot... |
71577ec62406c0119ea2282a3011ebbc368a3a04 | add test_pollbot.py | tests/test_pollbot.py | tests/test_pollbot.py | Python | 0.000007 | @@ -0,0 +1,412 @@
+#!/usr/bin/env python3%0A%0Aimport pytest%0Aimport poll_bot%0A%0Aclass TestPollBot:%0A%0A%09def test_extract_emoji(self):%0A%09%09lines_and_emojis = %7B%0A%09%09%09' M)-ystery meat': 'M',%0A%09%09%09'%F0%9F%90%95 dog sandwiches': '%F0%9F%90%95',%0A%09%09%09'3 blind mice': '3',%0A%09%09%09'%F0%9F%87%B... | |
1e9980aff2370b96171011f7fa50d4517957fa86 | Add a script to check TOI coverage for a bbox and zoom range | tilepack/check_toi.py | tilepack/check_toi.py | Python | 0 | @@ -0,0 +1,1512 @@
+import mercantile%0Aimport argparse%0A%0Adef main():%0A parser = argparse.ArgumentParser()%0A parser.add_argument('min_lon',%0A type=float,%0A help='Bounding box minimum longitude/left')%0A parser.add_argument('min_lat',%0A type=float,%0A help='Bounding box minim... | |
14f9aa65f9a92f074846ea6861539f4f4fa18926 | Handle CalledProcessError when removing files from downloaded zip file | tools/download_jar.py | tools/download_jar.py | #!/usr/bin/python
# Copyright (C) 2013 The Android Open Source Project
#
# 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 ap... | Python | 0.000023 | @@ -4503,16 +4503,25 @@
args.o)%0A
+ try:%0A
check_
@@ -4558,16 +4558,118 @@
xclude)%0A
+ except CalledProcessError as err:%0A print('error removing files from zip: %25s' %25 err, file=stderr)%0A
else:%0A
|
17654378a6039203ead1c711b6bb8f7fb3ad8680 | add Ermine ELF dumper. | tools/dump-ermine-elfs.py | tools/dump-ermine-elfs.py | Python | 0 | @@ -0,0 +1,2399 @@
+#!/usr/bin/env python%0A#%0A# Copyright (C) 2013 Mikkel Krautz %3Cmikkel@krautz.dk%3E%0A#%0A# All rights reserved.%0A#%0A# Redistribution and use in source and binary forms, with or without%0A# modification, are permitted provided that the following conditions%0A# are met:%0A#%0A# - Redistributions ... | |
654e2bf70b4a47adb53d8a0b17f0257e84c7bdf8 | read in data, check things look sensible. Note: need to change unknowns in group col so we have a more usable data type in the pandas dataframe. | main.py | main.py | Python | 0 | @@ -0,0 +1,231 @@
+# Data modelling challenge.%0A%0A__author__ = 'Remus Knowles %3Cremknowles@gmail.com%3E'%0A%0Aimport pandas as pd%0A%0AF_DATA = r'data challenge test.csv'%0A%0Adef main():%0A%09df = pd.read_csv(F_DATA)%0A%0A%09print df.head()%0A%0Aif __name__ == '__main__':%0A%09main()
| |
0046f5276c9572fbc40080cc2201a89ee37b96b2 | Create mwis.py | mwis.py | mwis.py | Python | 0.000005 | @@ -0,0 +1,782 @@
+weights = %5Bint(l) for l in open('mwis.txt')%5D%5B1:%5D%0A%0Adef mwis(weights):%0A%0A n = len(weights)%0A%0A weights = %5B0%5D + weights%0A%0A maxsetweight = %5B0, weights%5B1%5D%5D%0A%0A for i in range(2, n + 1):%0A maxsetweight.append(max(maxsetweight%5Bi - 1%5D, maxsetweight%5B... | |
572a47ab8b05f8e93ec5e1b415cb56387d4279ca | add m_restart.py | pyscf/nao/m_restart.py | pyscf/nao/m_restart.py | Python | 0.000026 | @@ -0,0 +1,1872 @@
+%0A#An HDF5 file is a container for two kinds of objects: datasets (array-like collections of data), and groups (folder-like containers that hold datasets).%0A#Groups work like dictionaries, and datasets work like NumPy arrays%0A%0Adef read_rst_h5py (filename=None):%0A import h5py ,os%0A if fi... | |
a0c303e9c1f7ac75e078e6f3ae9586ba68a24f63 | add the solution | python/oj/mergeSort.py | python/oj/mergeSort.py | Python | 0.000256 | @@ -0,0 +1,736 @@
+#!/usr/bin/python%0A# coding:utf8%0A%0A'''%0A@author: shaoyuliang%0A@contact: mshao@splunk.com%0A@since: 7/16/14%0A%0A'''%0A%0A# https://oj.leetcode.com/problems/merge-sorted-array/%0A%0Aclass Solution:%0A # @param A a list of integers%0A # @param m an integer, length of A%0A # @param B a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.