commit
stringlengths
40
40
old_file
stringlengths
4
150
new_file
stringlengths
4
150
old_contents
stringlengths
0
3.26k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
501
message
stringlengths
15
4.06k
lang
stringclasses
4 values
license
stringclasses
13 values
repos
stringlengths
5
91.5k
diff
stringlengths
0
4.35k
edef5ae25b7228cf8b769a171305e9f9c32eeabb
app/test_ghmarkup.py
app/test_ghmarkup.py
# encoding: utf-8 import unittest import ghmarkup class test_ghmarkup(unittest.TestCase): def test_unadorned_text(self): self.assertEqual("<p>\nfoo\n</p>", ghmarkup.ghmarkup("foo")) def test_bold(self): self.assertEqual("<p>\nthe <strong>quick</strong> brown fox\n</p>", ghmarkup.ghmarkup( "the *qui...
Add some tests for the wiki markup.
Add some tests for the wiki markup.
Python
apache-2.0
jkingdon/ghilbert,kryptine/ghilbert,raphlinus/ghilbert,kryptine/ghilbert,raphlinus/ghilbert,raphlinus/ghilbert,raphlinus/ghilbert,jkingdon/ghilbert
--- +++ @@ -0,0 +1,42 @@ +# encoding: utf-8 + +import unittest +import ghmarkup + +class test_ghmarkup(unittest.TestCase): + def test_unadorned_text(self): + self.assertEqual("<p>\nfoo\n</p>", ghmarkup.ghmarkup("foo")) + + def test_bold(self): + self.assertEqual("<p>\nthe <strong>quick</strong> brown fox\n</p...
056de4daf1a00f677d3f9bccebae849dc49e7c48
checks/check_with_hue_and_saturation.py
checks/check_with_hue_and_saturation.py
from __future__ import print_function, division import imgaug as ia import imgaug.augmenters as iaa def main(): image = ia.quokka_square(size=(128, 128)) images = [] for i in range(15): aug = iaa.WithHueAndSaturation(iaa.WithChannels(0, iaa.Add(i*20))) images.append(aug.augment_image(imag...
Add check script for WithHueAndSaturation
Add check script for WithHueAndSaturation
Python
mit
aleju/imgaug,aleju/ImageAugmenter,aleju/imgaug
--- +++ @@ -0,0 +1,22 @@ +from __future__ import print_function, division +import imgaug as ia +import imgaug.augmenters as iaa + + +def main(): + image = ia.quokka_square(size=(128, 128)) + images = [] + + for i in range(15): + aug = iaa.WithHueAndSaturation(iaa.WithChannels(0, iaa.Add(i*20))) + ...
b05f95fb3e67ef2d13d67bf369e10c679a8b55cf
find_site_packages.py
find_site_packages.py
import site from distutils.sysconfig import get_python_lib print("Your main site-packages directory:") print(get_python_lib()) print print("All global site-packages directories on your system:") print(site.getsitepackages())
Add script to find site-packages dirs.
Add script to find site-packages dirs.
Python
bsd-3-clause
audreyr/useful
--- +++ @@ -0,0 +1,11 @@ +import site +from distutils.sysconfig import get_python_lib + +print("Your main site-packages directory:") +print(get_python_lib()) + +print + +print("All global site-packages directories on your system:") +print(site.getsitepackages()) +
f12dba1134b8c9b42dc607e3e672de0e1cc2a4d1
examples/copy.py
examples/copy.py
from opterator import opterate @opterate def main(filename1, filename2, recursive=False, backup=False, suffix='~', *other_filenames): '''An example copy script with some example parameters that might be used in a copy command. @param recursive store_true -r --recursive copy directories ...
Add an examples directory to illustrate operator usage.
Add an examples directory to illustrate operator usage.
Python
mit
buchuki/opterator
--- +++ @@ -0,0 +1,24 @@ +from opterator import opterate +@opterate +def main(filename1, filename2, recursive=False, backup=False, + suffix='~', *other_filenames): + '''An example copy script with some example parameters that might + be used in a copy command. + + @param recursive store_true -r --...
65bae0d38b96fde3e3dd54cdc915e99b661b974a
web_tools.py
web_tools.py
import urllib, subprocess, random, re from bs4 import BeautifulSoup # http://www.crummy.com/software/BeautifulSoup/bs4/doc/# import socket, struct, binascii class Web(): def getHeader(self, url): """Get Header Info""" http_r = urllib.urlopen(url) if http_r.code == 200: return http_r.headers e...
Add Web tools: getHeader, getParticularClass, getLinks, errorHandling, bannerGrapper
Add Web tools: getHeader, getParticularClass, getLinks, errorHandling, bannerGrapper
Python
mit
rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network,rudolfvavra/network
--- +++ @@ -0,0 +1,85 @@ +import urllib, subprocess, random, re +from bs4 import BeautifulSoup # http://www.crummy.com/software/BeautifulSoup/bs4/doc/# +import socket, struct, binascii + +class Web(): + + def getHeader(self, url): + """Get Header Info""" + http_r = urllib.urlopen(url) + if http_r.code == 2...
b264313d48a66b847a1cfa6459745f2d35e10cee
tests/conftest.py
tests/conftest.py
import os import subprocess import sys def _is_pip_installed(): try: import pip # NOQA return True except ImportError: return False def _is_in_ci(): ci_name = os.environ.get('CUPY_CI', '') return ci_name != '' def pytest_configure(config): # Print installed packages ...
Print installed packages in pytest
Print installed packages in pytest
Python
mit
cupy/cupy,cupy/cupy,cupy/cupy,cupy/cupy
--- +++ @@ -0,0 +1,23 @@ +import os +import subprocess +import sys + + +def _is_pip_installed(): + try: + import pip # NOQA + return True + except ImportError: + return False + + +def _is_in_ci(): + ci_name = os.environ.get('CUPY_CI', '') + return ci_name != '' + + +def pytest_config...
c31eae3d02889a5517782bcaf20406c72bc0de14
actions/cloudbolt_plugins/aws/poll_for_init_complete.py
actions/cloudbolt_plugins/aws/poll_for_init_complete.py
import sys import time from infrastructure.models import Server from jobs.models import Job TIMEOUT = 600 def is_reachable(server): """ :type server: Server """ instance_id = server.ec2serverinfo.instance_id ec2_region = server.ec2serverinfo.ec2_region rh = server.resource_handler.cast() ...
Add AWS poll for init complete plug-in.
Add AWS poll for init complete plug-in.
Python
apache-2.0
CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge
--- +++ @@ -0,0 +1,52 @@ +import sys +import time + +from infrastructure.models import Server +from jobs.models import Job + +TIMEOUT = 600 + + +def is_reachable(server): + """ + :type server: Server + """ + instance_id = server.ec2serverinfo.instance_id + ec2_region = server.ec2serverinfo.ec2_region +...
ee91d78412ce57d35fbba3bbe13f646c90756027
addons/stock_account/migrations/8.0.1.1/post-migrate.py
addons/stock_account/migrations/8.0.1.1/post-migrate.py
# -*- coding: utf-8 -*- ############################################################################## # # Author: Guewen Baconnier # Copyright 2014 Camptocamp SA # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU Affero General Public License as # pu...
Migrate product_template.cost_method to property (in stock_account)
Migrate product_template.cost_method to property (in stock_account)
Python
agpl-3.0
0k/OpenUpgrade,grap/OpenUpgrade,blaggacao/OpenUpgrade,csrocha/OpenUpgrade,0k/OpenUpgrade,grap/OpenUpgrade,damdam-s/OpenUpgrade,csrocha/OpenUpgrade,csrocha/OpenUpgrade,OpenUpgrade-dev/OpenUpgrade,Endika/OpenUpgrade,kirca/OpenUpgrade,OpenUpgrade/OpenUpgrade,hifly/OpenUpgrade,hifly/OpenUpgrade,OpenUpgrade-dev/OpenUpgrade,...
--- +++ @@ -0,0 +1,48 @@ +# -*- coding: utf-8 -*- +############################################################################## +# +# Author: Guewen Baconnier +# Copyright 2014 Camptocamp SA +# +# This program is free software: you can redistribute it and/or modify +# it under the terms of the GNU Affer...
8e75202872dd640c28173e2070b234165774f9db
buhmm/misc.py
buhmm/misc.py
# encoding: utf-8 """ Miscellaneous functions. """ from __future__ import division import numpy as np def logspace_int(limit, num=50): """ Returns (approximately) logarithmically spaced integers from 0 to `limit`. This is often more appropriate than calling `np.logspace(...).astype(int)`, or somethi...
Add function to generate logarithmically spaced integers.
Add function to generate logarithmically spaced integers.
Python
mit
chebee7i/buhmm
--- +++ @@ -0,0 +1,67 @@ +# encoding: utf-8 +""" +Miscellaneous functions. + +""" +from __future__ import division + +import numpy as np + +def logspace_int(limit, num=50): + """ + Returns (approximately) logarithmically spaced integers from 0 to `limit`. + + This is often more appropriate than calling `np.l...
b5db260f9499b7bdd5c13dc0c59c1ad6ad2d37fc
datastore/management/commands/dev_seed.py
datastore/management/commands/dev_seed.py
from django.utils.timezone import now, timedelta from django.core.management.base import BaseCommand from datastore.models import * from django.contrib.auth.models import User from oauth2_provider.models import AccessToken, get_application_model from datetime import datetime ApplicationModel = get_application_model() ...
Automate initial seeding of user and oauth for development
Automate initial seeding of user and oauth for development
Python
mit
impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore,impactlab/oeem-energy-datastore
--- +++ @@ -0,0 +1,31 @@ +from django.utils.timezone import now, timedelta +from django.core.management.base import BaseCommand +from datastore.models import * +from django.contrib.auth.models import User +from oauth2_provider.models import AccessToken, get_application_model +from datetime import datetime + +Applicat...
88b9ab92c5fe3374dba27c1d8c1d0b0b0e7411b7
tests/test_footnotes.py
tests/test_footnotes.py
from MarkdownEditing.tests import DereferrablePanelTestCase class TestMdeReferenceNewFootnoteCommand(DereferrablePanelTestCase): def test_new_footnote_in_first_line(self): self.setBlockText( """ # Test 1 First inline. Second inline. Third inli...
Add simple test for `mde_reference_new_footnote` command
Tests: Add simple test for `mde_reference_new_footnote` command Start to ensure not to break existing functions.
Python
mit
SublimeText-Markdown/MarkdownEditing
--- +++ @@ -0,0 +1,78 @@ +from MarkdownEditing.tests import DereferrablePanelTestCase + + +class TestMdeReferenceNewFootnoteCommand(DereferrablePanelTestCase): + + def test_new_footnote_in_first_line(self): + self.setBlockText( + """ + # Test 1 + + First inline. + ...
74b31ba7fec330ec167c2e001f60695272da71b8
pages/views.py
pages/views.py
from django.views import generic from django.contrib.auth.models import Group from django_countries.fields import Country from hosting.models import Profile, Place from hosting.utils import sort_by_name class AboutView(generic.TemplateView): template_name = 'pages/about.html' about = AboutView.as_view() class ...
from django.views import generic from django.contrib.auth.models import Group from hosting.models import Place from hosting.utils import sort_by_name class AboutView(generic.TemplateView): template_name = 'pages/about.html' about = AboutView.as_view() class TermsAndConditionsView(generic.TemplateView): tem...
Fix numbers in LO list.
Fix numbers in LO list.
Python
agpl-3.0
batisteo/pasportaservo,tejo-esperanto/pasportaservo,tejo-esperanto/pasportaservo,tejo-esperanto/pasportaservo,tejo-esperanto/pasportaservo,batisteo/pasportaservo,batisteo/pasportaservo,batisteo/pasportaservo
--- +++ @@ -1,8 +1,7 @@ from django.views import generic from django.contrib.auth.models import Group -from django_countries.fields import Country -from hosting.models import Profile, Place +from hosting.models import Place from hosting.utils import sort_by_name class AboutView(generic.TemplateView): @@ -21,7...
5c8c8585b19a9031cacad6a21fa4990560933e02
commpy/examples/wifi80211_conv_encode_decode.py
commpy/examples/wifi80211_conv_encode_decode.py
# Authors: CommPy contributors # License: BSD 3-Clause import math import matplotlib.pyplot as plt import numpy as np import commpy.channels as chan # ================================================================================================== # Complete example using Commpy Wifi 802.11 physical parameters # =...
Add example of usage of the simulation of 802.11
Add example of usage of the simulation of 802.11
Python
bsd-3-clause
veeresht/CommPy
--- +++ @@ -0,0 +1,34 @@ +# Authors: CommPy contributors +# License: BSD 3-Clause + +import math + +import matplotlib.pyplot as plt +import numpy as np + +import commpy.channels as chan +# ================================================================================================== +# Complete example using Comm...
a75effa9489e41915b624084c61fba144003b448
utils/test_h5py.py
utils/test_h5py.py
""" Simple test of a parallel build of h5py (from h5py's documentation). http://h5py.readthedocs.org/en/latest/mpi.html#using-parallel-hdf5-from-h5py If you've built h5py properly against a parallel build of hdf5, you should be able to run this code with:: $ mpiexec -n 4 python test_h5py.py and then check the o...
Add a simple test of one's h5py installation.
Add a simple test of one's h5py installation.
Python
bsd-3-clause
RaoUmer/distarray,enthought/distarray,RaoUmer/distarray,enthought/distarray
--- +++ @@ -0,0 +1,37 @@ +""" +Simple test of a parallel build of h5py (from h5py's documentation). + +http://h5py.readthedocs.org/en/latest/mpi.html#using-parallel-hdf5-from-h5py + +If you've built h5py properly against a parallel build of hdf5, you should be +able to run this code with:: + + $ mpiexec -n 4 pytho...
736b1453087ebf3f813fcb499ba0fd5ccaad965d
login/migrations/0003_auto_20160805_1311.py
login/migrations/0003_auto_20160805_1311.py
# -*- coding: utf-8 -*- # Generated by Django 1.9.5 on 2016-08-05 11:11 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('login', '0002_auto_20160228_1805'), ] operations = [ migrations.RenameModel( ...
Add oep user for wiki auth
Add oep user for wiki auth
Python
agpl-3.0
openego/oeplatform,openego/oeplatform,tom-heimbrodt/oeplatform,openego/oeplatform,openego/oeplatform,tom-heimbrodt/oeplatform,tom-heimbrodt/oeplatform
--- +++ @@ -0,0 +1,19 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.9.5 on 2016-08-05 11:11 +from __future__ import unicode_literals + +from django.db import migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('login', '0002_auto_20160228_1805'), + ] + + operations = ...
ec742a7572f94d8864444379ce91a4de32c45715
actionizer.py
actionizer.py
#! /usr/bin/python import numpy as np import os from sklearn import datasets MESSAGES_DIR = "data/messages/" JUDGMENTS_PATH = "data/judgments/judgments.txt" def load_messages(): messages = [] for filename in os.listdir(MESSAGES_DIR): with open(MESSAGES_DIR + filename) as message_file: mes...
Add functions to read in message data and parse targets.
Add functions to read in message data and parse targets.
Python
mit
chiubaka/actionizer
--- +++ @@ -0,0 +1,37 @@ +#! /usr/bin/python + +import numpy as np +import os +from sklearn import datasets + +MESSAGES_DIR = "data/messages/" +JUDGMENTS_PATH = "data/judgments/judgments.txt" + +def load_messages(): + messages = [] + for filename in os.listdir(MESSAGES_DIR): + with open(MESSAGES_DIR + fi...
564613521716161ca09ed127acfec984ca1ab48a
apirus_abc.py
apirus_abc.py
#!/usr/bin/env python """ The APIRUS API as an Abstract Base Class """ from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals from abc import ABCMeta, abstractmethod class APIRUS: """ ABC for the API for Regular,...
Add a start for an ABC for the API
Add a start for an ABC for the API
Python
cc0-1.0
ocefpaf/APIRUS,ioos/APIRUS
--- +++ @@ -0,0 +1,40 @@ +#!/usr/bin/env python + +""" +The APIRUS API as an Abstract Base Class + +""" + +from __future__ import absolute_import +from __future__ import division +from __future__ import print_function +from __future__ import unicode_literals + +from abc import ABCMeta, abstractmethod + + +class APIRU...
1f947d6cfe05f32ffa6566714e5aeeb74543a932
osf/migrations/0095_migration_comments.py
osf/migrations/0095_migration_comments.py
from __future__ import unicode_literals from django.db import migrations import logging logger = logging.getLogger(__file__) def update_comment_root_target(state, *args, **kwargs): Comment = state.get_model('osf', 'comment') comments = Comment.objects.filter(is_deleted=False) count = 0 for comment i...
from __future__ import unicode_literals import logging from django.db import migrations from django_bulk_update.helper import bulk_update logger = logging.getLogger(__file__) def update_comment_root_target(state, *args, **kwargs): Comment = state.get_model('osf', 'comment') comments = Comment.objects.exclud...
Fix loading root_target in migration
Fix loading root_target in migration Migrations don't allow accessing generic foreign keys, so we need to load root_target manually. Also: * add more logging * Bulk-update comments
Python
apache-2.0
caseyrollins/osf.io,pattisdr/osf.io,HalcyonChimera/osf.io,erinspace/osf.io,mfraezz/osf.io,mfraezz/osf.io,felliott/osf.io,sloria/osf.io,aaxelb/osf.io,icereval/osf.io,felliott/osf.io,mattclark/osf.io,baylee-d/osf.io,Johnetordoff/osf.io,erinspace/osf.io,pattisdr/osf.io,sloria/osf.io,Johnetordoff/osf.io,mfraezz/osf.io,icer...
--- +++ @@ -1,26 +1,32 @@ from __future__ import unicode_literals +import logging from django.db import migrations -import logging +from django_bulk_update.helper import bulk_update logger = logging.getLogger(__file__) def update_comment_root_target(state, *args, **kwargs): Comment = state.get_model(...
bdf40e28126e9e18ac9ea069659686e37e70f34d
Lib/test/test_future3.py
Lib/test/test_future3.py
from __future__ import nested_scopes from __future__ import division from __future__ import nested_scopes def f(x): def g(y): return y // x return g print f(2)(5)
Add test case to cover multiple future statements on separate lines of a module.
Add test case to cover multiple future statements on separate lines of a module.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
--- +++ @@ -0,0 +1,11 @@ +from __future__ import nested_scopes +from __future__ import division +from __future__ import nested_scopes + +def f(x): + def g(y): + return y // x + return g + + +print f(2)(5)
00fc071687661a0f27e61cef74a3d6af0dadf38b
OnionLauncher/torctl.py
OnionLauncher/torctl.py
import stem.process def startTor(config): process = stem.process.launch_tor_with_config(config, take_ownership = True) return process def stopTor(process): if "kil" in dir(process): process.kill()
Add initial code for starting Tor
Add initial code for starting Tor
Python
bsd-2-clause
neelchauhan/OnionLauncher
--- +++ @@ -0,0 +1,10 @@ +import stem.process + +def startTor(config): + process = stem.process.launch_tor_with_config(config, take_ownership = True) + + return process + +def stopTor(process): + if "kil" in dir(process): + process.kill()
85736989c7f3049d9d6c107e9dac385a751d0ba4
image_processing/steganography/python/steganography.py
image_processing/steganography/python/steganography.py
from __future__ import print_function from PIL import Image def encode(image, string_to_encode): image_data = list(image.getdata()) bin_string = "".join(["{0:08b}".format(ord(c)) for c in string_to_encode]) print("Initial pixel values: ") print(image_data[:25], end=" ") print(",....") j = 0 ...
Change folder structure. Add Python folder
Change folder structure. Add Python folder
Python
cc0-1.0
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs...
--- +++ @@ -0,0 +1,61 @@ +from __future__ import print_function +from PIL import Image + +def encode(image, string_to_encode): + image_data = list(image.getdata()) + bin_string = "".join(["{0:08b}".format(ord(c)) for c in string_to_encode]) + + print("Initial pixel values: ") + print(image_data[:25], end=...
e81f63798b84d26a29db79603efb0458ac25d374
accounts/migrations/0006_auto_20170325_1024.py
accounts/migrations/0006_auto_20170325_1024.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.5 on 2017-03-25 10:24 from __future__ import unicode_literals from django.contrib.auth.models import User from django.db import migrations from accounts.models import Account def link_user_accounts(apps, schema_editor): ''' Link every Django user objects to...
Add auto-link between User and Account models in migration
Add auto-link between User and Account models in migration
Python
mit
Atilla106/members.atilla.org,Atilla106/members.atilla.org,Atilla106/members.atilla.org,Atilla106/members.atilla.org,Atilla106/members.atilla.org
--- +++ @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.5 on 2017-03-25 10:24 +from __future__ import unicode_literals + +from django.contrib.auth.models import User +from django.db import migrations + +from accounts.models import Account + + +def link_user_accounts(apps, schema_editor): + ''...
3c49ca199fe41f0ca434b0fdc00ab76e7b134289
src/ggrc/migrations/versions/20160510122526_44ebc240800b_remove_response_relationships.py
src/ggrc/migrations/versions/20160510122526_44ebc240800b_remove_response_relationships.py
# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: dan@reciprocitylabs.com # Maintained By: peter@reciprocitylabs.com """ Remove relationships related to deleted response objects Create Date: 2016-...
Fix error message when expanding data asset
Fix error message when expanding data asset
Python
apache-2.0
selahssea/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,kr41/ggrc-core,AleksNeStu/ggrc-core,plamut/ggrc-core,andrei-karalionak/ggrc-core,edofic/ggrc-core,josthkko/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,and...
--- +++ @@ -0,0 +1,37 @@ +# Copyright (C) 2016 Google Inc., authors, and contributors <see AUTHORS file> +# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> +# Created By: dan@reciprocitylabs.com +# Maintained By: peter@reciprocitylabs.com + +""" +Remove relationships related to deleted re...
e7aa94722c3657fb4b0dfacb4c1e432438e4670a
flexget/tests/test_move.py
flexget/tests/test_move.py
import pytest @pytest.mark.usefixtures('tmpdir') class TestMove: config = """ tasks: test_move: mock: - title: a movie location: __tmp__/movie.mkv accept_all: yes move: # Take advantage that path validation allows non-ex...
Add very basic move plugin test
Add very basic move plugin test
Python
mit
crawln45/Flexget,ianstalk/Flexget,ianstalk/Flexget,crawln45/Flexget,Flexget/Flexget,malkavi/Flexget,Flexget/Flexget,malkavi/Flexget,ianstalk/Flexget,crawln45/Flexget,malkavi/Flexget,Flexget/Flexget,malkavi/Flexget,crawln45/Flexget,Flexget/Flexget
--- +++ @@ -0,0 +1,23 @@ +import pytest + + +@pytest.mark.usefixtures('tmpdir') +class TestMove: + config = """ + tasks: + test_move: + mock: + - title: a movie + location: __tmp__/movie.mkv + accept_all: yes + move: + # Take adv...
f7f8d7c6a92aa5d2d491674df14df46768f8b037
show_sample_entry.py
show_sample_entry.py
#!/usr/bin/python3 # Copyright (c) 2016 Eric Eisenhart # This software is released under an MIT-style license. # See LICENSE.md for full details. import sys import pprint import feedparser import argparse feedparser.PREFERRED_XML_PARSERS.remove('drv_libxml2') # 0 is command itself: if len(sys.argv) == 2: feed_url =...
Add helper tool to help with examining entries in a feed.
Add helper tool to help with examining entries in a feed.
Python
mit
freiheit/discord_feedbot,freiheit/discord_rss_bot,freiheit/discord_feedbot,freiheit/discord_rss_bot
--- +++ @@ -0,0 +1,20 @@ +#!/usr/bin/python3 +# Copyright (c) 2016 Eric Eisenhart +# This software is released under an MIT-style license. +# See LICENSE.md for full details. + +import sys +import pprint +import feedparser +import argparse +feedparser.PREFERRED_XML_PARSERS.remove('drv_libxml2') + +# 0 is command itse...
31e1b7837f101ead043b1d85eaa281d32c00c13b
django_auth_policy/migrations/0003_auto_20150410_0408.py
django_auth_policy/migrations/0003_auto_20150410_0408.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('django_auth_policy', '0002_users_nullable'), ] operations = [ migrations.AlterField( model_name='passwordchange'...
Add migration which no longer allows blank user representation fields
Add migration which no longer allows blank user representation fields
Python
bsd-3-clause
Dreamsolution/django-auth-policy,mcella/django-auth-policy,Dreamsolution/django-auth-policy,mcella/django-auth-policy
--- +++ @@ -0,0 +1,32 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import models, migrations + + +class Migration(migrations.Migration): + + dependencies = [ + ('django_auth_policy', '0002_users_nullable'), + ] + + operations = [ + migrations.AlterField...
15013cde32597c6414ba731461d881080083bf24
lib/ansible/modules/cloud/openstack/os_server_facts.py
lib/ansible/modules/cloud/openstack/os_server_facts.py
#!/usr/bin/python # Copyright (c) 2014 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
Add OpenStack Server facts module
Add OpenStack Server facts module
Python
mit
thaim/ansible,thaim/ansible
--- +++ @@ -0,0 +1,76 @@ +#!/usr/bin/python + +# Copyright (c) 2014 Hewlett-Packard Development Company, L.P. +# +# This module 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 Licen...
c11b0f905ad844ef95bd779d3277318e357fdef0
oscar/management/commands/oscar_fork_statics.py
oscar/management/commands/oscar_fork_statics.py
import logging import os import shutil from django.db.models import get_model from django.conf import settings from django.core.management.base import BaseCommand, CommandError ProductAlert = get_model('customer', 'ProductAlert') logger = logging.getLogger(__name__) class Command(BaseCommand): """ Copy Osc...
Add management command for forking Oscar's statics
Add management command for forking Oscar's statics This makes it easier for FEDs to get started styling a new Oscar project. It copies all of Oscar's statics into a specified folder and checks whether the new folder is in STATICFILES_DIRS. Fixes #463
Python
bsd-3-clause
jlmadurga/django-oscar,spartonia/django-oscar,WadeYuChen/django-oscar,makielab/django-oscar,josesanch/django-oscar,taedori81/django-oscar,faratro/django-oscar,vovanbo/django-oscar,DrOctogon/unwash_ecom,anentropic/django-oscar,mexeniz/django-oscar,kapt/django-oscar,WillisXChen/django-oscar,jinnykoo/wuyisj.com,sasha0/dja...
--- +++ @@ -0,0 +1,41 @@ +import logging +import os +import shutil + +from django.db.models import get_model +from django.conf import settings +from django.core.management.base import BaseCommand, CommandError + +ProductAlert = get_model('customer', 'ProductAlert') + +logger = logging.getLogger(__name__) + + +class C...
a4eb88bcd351c65aee85a2586b1c2eeb52dcd0e4
tests/terminal_tests/DifferentGrammarsTest.py
tests/terminal_tests/DifferentGrammarsTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 23.06.2017 16:39 :Licence GNUv3 Part of grammpy """ from unittest import TestCase from grammpy import Terminal class TempClass: pass class TerminalCreationTest(TestCase): def test_noneClass(self): ter1 = Terminal(0, None) ter2 = Ter...
Add tests for Terminal when grammar is different so terminals should not be equal
Add tests for Terminal when grammar is different so terminals should not be equal
Python
mit
PatrikValkovic/grammpy
--- +++ @@ -0,0 +1,71 @@ +#!/usr/bin/env python +""" +:Author Patrik Valkovic +:Created 23.06.2017 16:39 +:Licence GNUv3 +Part of grammpy + +""" +from unittest import TestCase +from grammpy import Terminal + + +class TempClass: + pass + + +class TerminalCreationTest(TestCase): + def test_noneClass(self): + ...
101cdcaf3fff6c10e5c519f1ed409feefeff313a
tests/views/test_admin_committee_questions.py
tests/views/test_admin_committee_questions.py
import os from builtins import str from tests import PMGLiveServerTestCase from pmg.models import db, Committee from tests.fixtures import dbfixture, UserData, CommitteeData, MembershipData from werkzeug.datastructures import FileStorage from io import BytesIO class TestAdminCommitteeQuestions(PMGLiveServerTestCase):...
Add first test for committee question uploads
Add first test for committee question uploads
Python
apache-2.0
Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2
--- +++ @@ -0,0 +1,42 @@ +import os +from builtins import str +from tests import PMGLiveServerTestCase +from pmg.models import db, Committee +from tests.fixtures import dbfixture, UserData, CommitteeData, MembershipData +from werkzeug.datastructures import FileStorage +from io import BytesIO + + +class TestAdminCommi...
d4bfe2f59d2552d211caddf90ceefcf27a06f08a
spdx/writers/yaml.py
spdx/writers/yaml.py
from __future__ import absolute_import from __future__ import print_function from __future__ import unicode_literals import ruamel.yaml as yaml from spdx.writers.tagvalue import InvalidDocumentError from spdx.writers.jsonyaml import Writer import rdflib def write_document(document, out, validate=True): if valida...
Add YAML documents creating capability.
Add YAML documents creating capability. Signed-off-by: Xavier Figueroa <2556c6f4facc1e5829d3394b9ce7316a84702c26@gmail.com>
Python
apache-2.0
spdx/tools-python
--- +++ @@ -0,0 +1,21 @@ +from __future__ import absolute_import +from __future__ import print_function +from __future__ import unicode_literals + +import ruamel.yaml as yaml +from spdx.writers.tagvalue import InvalidDocumentError +from spdx.writers.jsonyaml import Writer +import rdflib + +def write_document(document...
079be3496b22d1ac08408dcee13bca02bb20babd
articles/migrations/0010_auto_20180817_2321.py
articles/migrations/0010_auto_20180817_2321.py
# Generated by Django 2.0.8 on 2018-08-17 23:21 from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('articles', '0009_auto_20180727_1437'), ] operations = [ migrations.AlterField( model_name='arti...
Add migration for blank kicker
Add migration for blank kicker
Python
mit
thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline,thepoly/Pipeline
--- +++ @@ -0,0 +1,19 @@ +# Generated by Django 2.0.8 on 2018-08-17 23:21 + +from django.db import migrations, models +import django.db.models.deletion + + +class Migration(migrations.Migration): + + dependencies = [ + ('articles', '0009_auto_20180727_1437'), + ] + + operations = [ + migrations...
237ce6e8bc8534411825c9477f7cc8d6f3bfa570
tests/functional/test_contact_page.py
tests/functional/test_contact_page.py
from .base import FunctionalTest class ContactPageTest(FunctionalTest): def test_contact_page_navigation(self): self.browser.get(self.live_server_url) self.browser.set_window_size(1024, 768) contact_link = self.browser.find_element_by_link_text('CONTACT US') contact_link.click(...
Add Contact Page functional tests
Add Contact Page functional tests
Python
bsd-3-clause
andela-kndungu/compshop,kevgathuku/compshop,kevgathuku/compshop,andela-kndungu/compshop,andela-kndungu/compshop,kevgathuku/compshop,kevgathuku/compshop,andela-kndungu/compshop
--- +++ @@ -0,0 +1,18 @@ +from .base import FunctionalTest + + +class ContactPageTest(FunctionalTest): + + def test_contact_page_navigation(self): + self.browser.get(self.live_server_url) + + self.browser.set_window_size(1024, 768) + + contact_link = self.browser.find_element_by_link_text('CON...
42fc7eda507037de7df4bc148b3d798b2871bba5
scripts/make_user_admin.py
scripts/make_user_admin.py
#!/usr/bin/env python """ Extract email adresses from adhocracy. Emails from deleted users won't be exported. """ from datetime import datetime from sqlalchemy import and_, or_ from adhocracy.model import Group, Membership, meta, User # boilerplate code. copy that import os import sys sys.path.insert(0, os.path.abs...
Add script to make a user the global admin
Add script to make a user the global admin
Python
agpl-3.0
liqd/adhocracy,liqd/adhocracy,SysTheron/adhocracy,phihag/adhocracy,phihag/adhocracy,alkadis/vcv,alkadis/vcv,SysTheron/adhocracy,SysTheron/adhocracy,alkadis/vcv,DanielNeugebauer/adhocracy,liqd/adhocracy,alkadis/vcv,phihag/adhocracy,phihag/adhocracy,phihag/adhocracy,liqd/adhocracy,DanielNeugebauer/adhocracy,DanielNeugeba...
--- +++ @@ -0,0 +1,39 @@ +#!/usr/bin/env python +""" +Extract email adresses from adhocracy. Emails from deleted users won't be +exported. +""" +from datetime import datetime + +from sqlalchemy import and_, or_ + +from adhocracy.model import Group, Membership, meta, User + +# boilerplate code. copy that +import os +i...
1692e53b86f830cdde631437de3ad746d5225fc6
clover/__init__.py
clover/__init__.py
# This is here simply to aid migration to trefoil. It will be removed in a future version! import sys import warnings import trefoil warnings.simplefilter('always', DeprecationWarning) warnings.warn( "the package name 'clover' has been deprecated; use 'trefoil' instead", DeprecationWarning) sys.modules['cl...
Add shim for clover package name and deprecation warning
Add shim for clover package name and deprecation warning
Python
bsd-3-clause
consbio/clover,consbio/clover
--- +++ @@ -0,0 +1,13 @@ +# This is here simply to aid migration to trefoil. It will be removed in a future version! + +import sys +import warnings + +import trefoil + +warnings.simplefilter('always', DeprecationWarning) +warnings.warn( + "the package name 'clover' has been deprecated; use 'trefoil' instead", + ...
ce31b68b98802291c2d6e6871ba20f4711617f45
test/on_yubikey/test_interfaces.py
test/on_yubikey/test_interfaces.py
from .util import DestructiveYubikeyTestCase from ykman import driver_fido, driver_otp, driver_ccid class TestInterfaces(DestructiveYubikeyTestCase): def test_switch_interfaces(self): next(driver_fido.open_devices()).read_config() next(driver_otp.open_devices()).read_config() next(driver_...
Add integration test for switching interfaces
Add integration test for switching interfaces
Python
bsd-2-clause
Yubico/yubikey-manager,Yubico/yubikey-manager
--- +++ @@ -0,0 +1,19 @@ +from .util import DestructiveYubikeyTestCase +from ykman import driver_fido, driver_otp, driver_ccid + + +class TestInterfaces(DestructiveYubikeyTestCase): + + def test_switch_interfaces(self): + next(driver_fido.open_devices()).read_config() + next(driver_otp.open_devices()...
887a81f21033a0694bccec9ac07470b95569646b
tests/uri/test_uri_query.py
tests/uri/test_uri_query.py
import pytest from httoop import URI @pytest.mark.parametrize('query_string,query', [ (b'', ()), (b'&', ()), (b'&&', ()), # (b'=', ((u'', u''),)), # (b'=a', ((u'', u'a'),)), (b'a', ((u'a', u''),)), (b'a=', ((u'a', u''),)), (b'&a=b', ((u'a', u'b'),)), (b'&&a=b&&b=c&d=f&', ((u'a', u'b'), (u'b', u'c'), (u'd', u'f...
Add basic query string tests
Add basic query string tests
Python
mit
spaceone/httoop,spaceone/httoop,spaceone/httoop
--- +++ @@ -0,0 +1,37 @@ +import pytest +from httoop import URI + + +@pytest.mark.parametrize('query_string,query', [ + (b'', ()), + (b'&', ()), + (b'&&', ()), +# (b'=', ((u'', u''),)), +# (b'=a', ((u'', u'a'),)), + (b'a', ((u'a', u''),)), + (b'a=', ((u'a', u''),)), + (b'&a=b', ((u'a', u'b'),)), + (b'&&a=b&&b=c&d=f&'...
523e98fd4d91beff0f3e1b25bf5e61209bcc00ee
unittests/test_networking.py
unittests/test_networking.py
import pytest import ipaddress from lab import network @pytest.mark.parametrize('ip', [ '127.0.0.1', '::1' ]) def test_ping(ip): network.ping(ip) @pytest.mark.parametrize('ip, expected', [ ('127.0.0.1', 4), ('::1', 6) ]) def test_addr_version_detection(ip, expected): assert network.get_addr_...
Add a set of tests for the network module
Add a set of tests for the network module
Python
mpl-2.0
sangoma/pytestlab
--- +++ @@ -0,0 +1,37 @@ +import pytest +import ipaddress +from lab import network + + +@pytest.mark.parametrize('ip', [ + '127.0.0.1', + '::1' +]) +def test_ping(ip): + network.ping(ip) + + +@pytest.mark.parametrize('ip, expected', [ + ('127.0.0.1', 4), + ('::1', 6) +]) +def test_addr_version_detectio...
17c39350788c9d371b6810dcc0bf82dd1fd93be1
tests/rules/test_brew_uninstall.py
tests/rules/test_brew_uninstall.py
import pytest from tests.utils import Command from thefuck.rules.brew_uninstall import get_new_command, match @pytest.fixture def stdout(): return ("Uninstalling /usr/local/Cellar/tbb/4.4-20160916... (118 files, 1.9M)\n" "tbb 4.4-20160526, 4.4-20160722 are still installed.\n" "Remove all v...
Test `brew uninstall --force` suggestion
Test `brew uninstall --force` suggestion
Python
mit
Clpsplug/thefuck,SimenB/thefuck,SimenB/thefuck,mlk/thefuck,scorphus/thefuck,nvbn/thefuck,Clpsplug/thefuck,mlk/thefuck,nvbn/thefuck,scorphus/thefuck
--- +++ @@ -0,0 +1,31 @@ +import pytest +from tests.utils import Command +from thefuck.rules.brew_uninstall import get_new_command, match + + +@pytest.fixture +def stdout(): + return ("Uninstalling /usr/local/Cellar/tbb/4.4-20160916... (118 files, 1.9M)\n" + "tbb 4.4-20160526, 4.4-20160722 are still ins...
c44ce1e29e8af7808dda8f80e65a92842dd8144a
py/binary-watch.py
py/binary-watch.py
from operator import mul class Solution(object): def dfs(self, rem, cur, depth): if depth == 10: h = sum(map(mul, cur[:4], [1, 2, 4, 8])) m = sum(map(mul, cur[4:], [1, 2, 4, 8, 16, 32])) if h < 12 and m < 60: yield '{}:{:02d}'.format(h, m) else: ...
Add py solution for 401. Binary Watch
Add py solution for 401. Binary Watch 401. Binary Watch: https://leetcode.com/problems/binary-watch/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
--- +++ @@ -0,0 +1,23 @@ +from operator import mul +class Solution(object): + def dfs(self, rem, cur, depth): + if depth == 10: + h = sum(map(mul, cur[:4], [1, 2, 4, 8])) + m = sum(map(mul, cur[4:], [1, 2, 4, 8, 16, 32])) + if h < 12 and m < 60: + yield '{}:{:...
c83ec7a33334c253362f93b991c396d3d1338ea4
tests/ChromskyForm/OneRuleWithMultipleNonterminalsTest.py
tests/ChromskyForm/OneRuleWithMultipleNonterminalsTest.py
#!/usr/bin/env python """ :Author Patrik Valkovic :Created 28.08.2017 14:37 :Licence GNUv3 Part of grammpy-transforms """ from unittest import TestCase, main from grammpy import * from grammpy_transforms import ContextFree class S(Nonterminal): pass class A(Nonterminal): pass class B(Nonterminal): pass class C(Nonte...
Add test with single rule with three nonterminals for chromsky normal form transformation
Add test with single rule with three nonterminals for chromsky normal form transformation
Python
mit
PatrikValkovic/grammpy
--- +++ @@ -0,0 +1,63 @@ +#!/usr/bin/env python +""" +:Author Patrik Valkovic +:Created 28.08.2017 14:37 +:Licence GNUv3 +Part of grammpy-transforms + +""" + +from unittest import TestCase, main +from grammpy import * +from grammpy_transforms import ContextFree + +class S(Nonterminal): pass +class A(Nonterminal): pas...
62ef8f6c90d3d1ed0d850a893e9711d410dfeb16
entities/migrations/0045_auto_20160922_1330.py
entities/migrations/0045_auto_20160922_1330.py
# -*- coding: utf-8 -*- # Generated by Django 1.10.1 on 2016-09-22 11:30 from __future__ import unicode_literals from django.db import migrations def set_groupcontent_group(apps, schema_editor): Group1 = apps.get_model('entities.Group') Group2 = apps.get_model('groups.Group') GroupContent = apps.get_mode...
Add migration to fix groupcontent foreign key
Add migration to fix groupcontent foreign key
Python
agpl-3.0
stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten,stadtgestalten/stadtgestalten
--- +++ @@ -0,0 +1,26 @@ +# -*- coding: utf-8 -*- +# Generated by Django 1.10.1 on 2016-09-22 11:30 +from __future__ import unicode_literals + +from django.db import migrations + + +def set_groupcontent_group(apps, schema_editor): + Group1 = apps.get_model('entities.Group') + Group2 = apps.get_model('groups.Gro...
eb5f3db33bf607b21dfc132127e873c9722c687e
workalendar/brazil_holidays_set.py
workalendar/brazil_holidays_set.py
from .registry import registry from workalendar.america import Brazil, BrazilBankCalendar # Commemorative holidays list COMMEMORATIVE_HOLIDAYS = [ 'Consciência Negra', ] def brazil_all_holidays_set(year): "Returns all holidays in brazil with their respective type and coverage" holidays_set = [] # ...
Add script to get all brazilian state with their respective type and coverage
Add script to get all brazilian state with their respective type and coverage
Python
mit
novafloss/workalendar,novapost/workalendar,jaraco/calendra
--- +++ @@ -0,0 +1,51 @@ +from .registry import registry +from workalendar.america import Brazil, BrazilBankCalendar + + +# Commemorative holidays list +COMMEMORATIVE_HOLIDAYS = [ + 'Consciência Negra', +] + + +def brazil_all_holidays_set(year): + "Returns all holidays in brazil with their respective type and c...
3134a061d9bd1d80fd99d223537f6c046a862d31
release_notes_prep.py
release_notes_prep.py
# Find head of current branch and merge commit of last release # Get merges in between current_branch_head = '8dfeae34' last_release_head = '3550d330' cmd = 'git log --oneline --merges %s ^%s' % (current_branch_head, last_release_head) import subprocess merge_commits = subprocess.check_output(cmd, shell=True).split('\n...
Add script to id missing CHANGELOG entries
Add script to id missing CHANGELOG entries
Python
apache-2.0
Kitware/girder,Xarthisius/girder,Xarthisius/girder,girder/girder,data-exp-lab/girder,manthey/girder,manthey/girder,jbeezley/girder,RafaelPalomar/girder,Kitware/girder,kotfic/girder,girder/girder,girder/girder,RafaelPalomar/girder,kotfic/girder,Xarthisius/girder,Xarthisius/girder,manthey/girder,data-exp-lab/girder,Kitwa...
--- +++ @@ -0,0 +1,32 @@ +# Find head of current branch and merge commit of last release +# Get merges in between +current_branch_head = '8dfeae34' +last_release_head = '3550d330' +cmd = 'git log --oneline --merges %s ^%s' % (current_branch_head, last_release_head) +import subprocess +merge_commits = subprocess.check...
98f37bb6fff90d9a4385ceea5454f0b5146e6dee
wagtail/wagtailimages/rich_text.py
wagtail/wagtailimages/rich_text.py
from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.formats import get_image_format class ImageEmbedHandler(object): """ ImageEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-embedtype="image". The resulting element in ...
from wagtail.wagtailimages.models import get_image_model from wagtail.wagtailimages.formats import get_image_format class ImageEmbedHandler(object): """ ImageEmbedHandler will be invoked whenever we encounter an element in HTML content with an attribute of data-embedtype="image". The resulting element in ...
Remove bare except in unnecessary try block
Remove bare except in unnecessary try block From a comment by @gasman on #1684: > It appears the try/catch in ImageEmbedHandler was added here: 74b9f43 > > Since the rest of the commit doesn't deal with images at all, and the > commit makes it clear that the corresponding change to > MediaEmbedHandler was intended to...
Python
bsd-3-clause
mikedingjan/wagtail,Toshakins/wagtail,nutztherookie/wagtail,quru/wagtail,mayapurmedia/wagtail,iansprice/wagtail,mixxorz/wagtail,zerolab/wagtail,iansprice/wagtail,takeflight/wagtail,gogobook/wagtail,mixxorz/wagtail,hamsterbacke23/wagtail,FlipperPA/wagtail,kurtw/wagtail,davecranwell/wagtail,chrxr/wagtail,nrsimha/wagtail,...
--- +++ @@ -31,15 +31,12 @@ Image = get_image_model() try: image = Image.objects.get(id=attrs['id']) - format = get_image_format(attrs['format']) - - if for_editor: - try: - return format.image_to_editor_html(image, attrs['alt']) -...
487a4c070d37fc201c9863119d6b0cee405439e4
ckanofworms/upgrades/20130100501_drop_indexes.py
ckanofworms/upgrades/20130100501_drop_indexes.py
#! /usr/bin/env python # -*- coding: utf-8 -*- # CKAN-of-Worms -- A logger for errors found in CKAN datasets # By: Emmanuel Raviart <emmanuel@raviart.com> # # Copyright (C) 2013 Etalab # http://github.com/etalab/ckan-of-worms # # This file is part of CKAN-of-Worms. # # CKAN-of-Worms is free software; you can redistri...
Add upgrade script to fully rebuild indexes.
Add upgrade script to fully rebuild indexes.
Python
agpl-3.0
etalab/ckan-of-worms,etalab/ckan-of-worms
--- +++ @@ -0,0 +1,77 @@ +#! /usr/bin/env python +# -*- coding: utf-8 -*- + + +# CKAN-of-Worms -- A logger for errors found in CKAN datasets +# By: Emmanuel Raviart <emmanuel@raviart.com> +# +# Copyright (C) 2013 Etalab +# http://github.com/etalab/ckan-of-worms +# +# This file is part of CKAN-of-Worms. +# +# CKAN-of-...
e42718a59d9c0bffed524f5764ee119cb616085e
py/accounts-merge.py
py/accounts-merge.py
from collections import defaultdict class Solution(object): def accountsMerge(self, accounts): """ :type accounts: List[List[str]] :rtype: List[List[str]] """ parent = dict() def find_root(a): if parent[a] != a: parent[a] = find_root(parent...
Add py solution for 721. Accounts Merge
Add py solution for 721. Accounts Merge 721. Accounts Merge: https://leetcode.com/problems/accounts-merge/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
--- +++ @@ -0,0 +1,33 @@ +from collections import defaultdict +class Solution(object): + def accountsMerge(self, accounts): + """ + :type accounts: List[List[str]] + :rtype: List[List[str]] + """ + parent = dict() + def find_root(a): + if parent[a] != a: + ...
bbd07d4cd43eb9c6a5d60dca2b815d0286b2eda3
list_issues_by_milestone.py
list_issues_by_milestone.py
from gitlab import Gitlab from configparser import ConfigParser import sys __author__ = 'Cedric RICARD' config = ConfigParser() config.read_file(open('defaults.cfg')) def connect_to_gitlab(): gl = Gitlab(config.get('gitlab', 'url'), config.get('gitlab', 'key')) gl.auth() return gl def list_issues(gl, ...
Add script to produce a changelog
Add script to produce a changelog
Python
agpl-3.0
11h42/gitlab-tools
--- +++ @@ -0,0 +1,60 @@ +from gitlab import Gitlab +from configparser import ConfigParser +import sys + +__author__ = 'Cedric RICARD' + +config = ConfigParser() +config.read_file(open('defaults.cfg')) + + +def connect_to_gitlab(): + gl = Gitlab(config.get('gitlab', 'url'), config.get('gitlab', 'key')) + gl.aut...
86c8f3311efaf6bc4f1ef5bda4213ec07f36a7fd
tests/cpydiff/core_function_moduleattr.py
tests/cpydiff/core_function_moduleattr.py
""" categories: Core,Functions description: Function objects do not have the ``__module__`` attribute cause: MicroPython is optimized for reduced code size and RAM usage. workaround: Use ``sys.modules[function.__globals__['__name__']]`` for non-builtin modules. """ def f(): pass print(f.__module__)
Add test and workaround for function.__module__ attr.
tests/cpydiff: Add test and workaround for function.__module__ attr. MicroPython does not store any reference from a function object to the module it was defined in, but there is a way to use function.__globals__ to indirectly get the module. See issue #7259. Signed-off-by: Damien George <99e6b749acbfbe2a596df99e91d...
Python
mit
pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython,pfalcon/micropython
--- +++ @@ -0,0 +1,13 @@ +""" +categories: Core,Functions +description: Function objects do not have the ``__module__`` attribute +cause: MicroPython is optimized for reduced code size and RAM usage. +workaround: Use ``sys.modules[function.__globals__['__name__']]`` for non-builtin modules. +""" + + +def f(): + pa...
4e53ea6ea9e3f5f409014221c000486bc188769f
tools/heapcheck/PRESUBMIT.py
tools/heapcheck/PRESUBMIT.py
# Copyright (c) 2010 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. """ See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts for more details on the presubmit API built into gcl. """ def CheckChang...
Add presubmit checks for suppressions.
Heapchecker: Add presubmit checks for suppressions. BUG=none TEST=none Review URL: http://codereview.chromium.org/3197014 git-svn-id: http://src.chromium.org/svn/trunk/src@57132 4ff67af0-8c30-449e-8e8b-ad334ec8d88c Former-commit-id: 8ac37d84cf01f879652cb455c925bb75bee0bc34
Python
bsd-3-clause
meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-ux/meego-app-browser,meego-tablet-u...
--- +++ @@ -0,0 +1,43 @@ +# Copyright (c) 2010 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. + +""" +See http://dev.chromium.org/developers/how-tos/depottools/presubmit-scripts +for more details on the presubmit API b...
f0a721f2dbc4b8b9354e459d45325a08a646e09b
py/longest-increasing-path-in-a-matrix.py
py/longest-increasing-path-in-a-matrix.py
from collections import Counter class Solution(object): def dfs(self, dp, matrix, x, y, w, h): v = matrix[x][y] if dp[x, y] == 0: dp[x, y] = 1 + max( 0 if x == 0 or matrix[x - 1][y] <= v else self.dfs(dp, matrix, x - 1, y, w, h), 0 if y == 0 or matrix[x][y...
Add py solution for 329. Longest Increasing Path in a Matrix
Add py solution for 329. Longest Increasing Path in a Matrix 329. Longest Increasing Path in a Matrix: https://leetcode.com/problems/longest-increasing-path-in-a-matrix/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
--- +++ @@ -0,0 +1,30 @@ +from collections import Counter +class Solution(object): + def dfs(self, dp, matrix, x, y, w, h): + v = matrix[x][y] + if dp[x, y] == 0: + dp[x, y] = 1 + max( + 0 if x == 0 or matrix[x - 1][y] <= v else self.dfs(dp, matrix, x - 1, y, w, h), + ...
5c3cdc7a23fc1b0733b8b8bb9266c6d8c419dcd4
py/minimum-ascii-delete-sum-for-two-strings.py
py/minimum-ascii-delete-sum-for-two-strings.py
class Solution(object): def minimumDeleteSum(self, s1, s2): """ :type s1: str :type s2: str :rtype: int """ prev = [0] for c in s2: prev.append(prev[-1] + ord(c)) for i1, c1 in enumerate(s1, 1): nxtRow = [0] * (len(s2) + 1) ...
Add py solution for 712. Minimum ASCII Delete Sum for Two Strings
Add py solution for 712. Minimum ASCII Delete Sum for Two Strings 712. Minimum ASCII Delete Sum for Two Strings: https://leetcode.com/problems/minimum-ascii-delete-sum-for-two-strings/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
--- +++ @@ -0,0 +1,22 @@ +class Solution(object): + def minimumDeleteSum(self, s1, s2): + """ + :type s1: str + :type s2: str + :rtype: int + """ + prev = [0] + for c in s2: + prev.append(prev[-1] + ord(c)) + for i1, c1 in enumerate(s1, 1): + ...
d77cff9cc75b949b63d9497db54a5d86aabf9281
tests/test_manual.py
tests/test_manual.py
from tests.helper import ExternalVersionTestCase class ManualTest(ExternalVersionTestCase): def test_manual(self): self.assertEqual(self.sync_get_version("example", {"manual": "Meow"}), "Meow")
Add a testcase for Manual
Add a testcase for Manual
Python
mit
lilydjwg/nvchecker
--- +++ @@ -0,0 +1,6 @@ +from tests.helper import ExternalVersionTestCase + + +class ManualTest(ExternalVersionTestCase): + def test_manual(self): + self.assertEqual(self.sync_get_version("example", {"manual": "Meow"}), "Meow")
d3731c0b3c15b6f321a91121300de4da7d47acca
tests/test_module.py
tests/test_module.py
#!/usr/bin/env python # # Copyright 2011-2012 Splunk, Inc. # # Licensed under the Apache License, Version 2.0 (the "License"): you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable...
Move module namespace test to a separate test script.
Move module namespace test to a separate test script.
Python
apache-2.0
splunk/splunk-sdk-python,ww9rivers/splunk-sdk-python,kkirsche/splunk-sdk-python,lowtalker/splunk-sdk-python,sullivanmatt/splunk-sdk-python,kkirsche/splunk-sdk-python,kkirsche/splunk-sdk-python,kkirsche/splunk-sdk-python,splunk/splunk-sdk-python
--- +++ @@ -0,0 +1,50 @@ +#!/usr/bin/env python +# +# Copyright 2011-2012 Splunk, Inc. +# +# Licensed under the Apache License, Version 2.0 (the "License"): you may +# not use this file except in compliance with the License. You may obtain +# a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2...
7e4aab6980519fd8124e36a6f8fd4415eaf8a4e7
tests/test_tracer.py
tests/test_tracer.py
import os import nose import tracer import logging l = logging.getLogger("tracer.tests.test_tracer") bin_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries')) pov_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "povs")) test_data_location = str(os.path.di...
Add a single testcase for the tracer
Add a single testcase for the tracer
Python
bsd-2-clause
schieb/angr,tyb0807/angr,tyb0807/angr,f-prettyland/angr,iamahuman/angr,angr/angr,angr/tracer,schieb/angr,iamahuman/angr,angr/angr,iamahuman/angr,schieb/angr,f-prettyland/angr,tyb0807/angr,f-prettyland/angr,angr/angr
--- +++ @@ -0,0 +1,54 @@ +import os +import nose +import tracer + +import logging +l = logging.getLogger("tracer.tests.test_tracer") + +bin_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries')) +pov_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), "povs"))...
c108147bd1d421443010640ea4ed206d4d0131e5
mrfilesys.py
mrfilesys.py
#!/usr/bin/env python # ## mrfilesys ## ## This program provides an interface to retrieve information about Moira filesystems. ## It could also provide the writing functions, but the developer of this software does ## not have access to test that functionality nor is insane enough to set up a test Moira ## server. # ...
Add a tool to insepct filesystems.
Add a tool to insepct filesystems.
Python
mit
vasilvv/mrtools,vasilvv/mrtools
--- +++ @@ -0,0 +1,70 @@ +#!/usr/bin/env python + +# +## mrfilesys +## +## This program provides an interface to retrieve information about Moira filesystems. +## It could also provide the writing functions, but the developer of this software does +## not have access to test that functionality nor is insane enough to...
7a0a82ea85fa9f09af7dc63437744db5d199c902
Clean_Energy_Outlook/Ridge_pred_solar.py
Clean_Energy_Outlook/Ridge_pred_solar.py
# import libraries import numpy as np import pandas as pd import matplotlib.pyplot as plt from sklearn import linear_model from sklearn.model_selection import train_test_split # define the function to predict solar data in the future def pred_nuclear(samplefile, filelist): # read data data = pd.read_csv(samplefile...
Add code for ridge prediction for solar energy
Add code for ridge prediction for solar energy
Python
mit
uwkejia/Clean-Energy-Outlook
--- +++ @@ -0,0 +1,47 @@ +# import libraries +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from sklearn import linear_model +from sklearn.model_selection import train_test_split + +# define the function to predict solar data in the future +def pred_nuclear(samplefile, filelist): + # read...
b87c9002aeabde283f2cf5e37de311fb3469af2b
lib/ansible/modules/cloud/openstack/os_client_config.py
lib/ansible/modules/cloud/openstack/os_client_config.py
#!/usr/bin/python # Copyright (c) 2015 Hewlett-Packard Development Company, L.P. # # This module is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any late...
Add OpenStack Client Config module
Add OpenStack Client Config module All of the ansible OpenStack modules are driven by a clouds.yaml config file which is processed by os-client-config. Expose the data returned by that library to enable playbooks to iterate over available clouds.
Python
mit
thaim/ansible,thaim/ansible
--- +++ @@ -0,0 +1,70 @@ +#!/usr/bin/python + +# Copyright (c) 2015 Hewlett-Packard Development Company, L.P. +# +# This module 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 Licen...
0da1480903e965597fd4450c8dea28a7d8bd6a44
graph/Python/kahn_algorithm.py
graph/Python/kahn_algorithm.py
from collections import defaultdict #Class to represent a graph class Graph: def __init__(self,vertices): self.graph = defaultdict(list) #dictionary containing adjacency List self.V = vertices #No. of vertices # function to add an edge to graph def addEdge(self,u,v): self.graph[...
Add Kahn's algorithm in python
Add Kahn's algorithm in python
Python
cc0-1.0
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs...
--- +++ @@ -0,0 +1,82 @@ + +from collections import defaultdict + +#Class to represent a graph +class Graph: + def __init__(self,vertices): + self.graph = defaultdict(list) #dictionary containing adjacency List + self.V = vertices #No. of vertices + + # function to add an edge to graph + def ...
71cd470f727c61330d22fda8b9a9f94e47b6353f
avena/tests/test-logistic.py
avena/tests/test-logistic.py
#!/usr/bin/env python from numpy import all, array, random from .. import logistic def test_logistic(): x = random.random_sample(100) x *= 10.0 x -= 5.0 for k in [1.0, 2.0, 5.0, 10.0]: y = logistic._logistic(k, x) assert all(y >= 0.0) and all(y <= 1.0) if __name__ == '__main__': ...
Add a unit test for the logistic module.
Add a unit test for the logistic module.
Python
isc
eliteraspberries/avena
--- +++ @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +from numpy import all, array, random + +from .. import logistic + + +def test_logistic(): + x = random.random_sample(100) + x *= 10.0 + x -= 5.0 + for k in [1.0, 2.0, 5.0, 10.0]: + y = logistic._logistic(k, x) + assert all(y >= 0.0) and all(...
24cf12a47c95883fc431d4ee295bbe763a107c93
snippet_parser/cs.py
snippet_parser/cs.py
from base import * class SnippetParser(SnippetParserBase): def strip_template(self, template, normalize, collapse): if self.is_citation_needed(template): # These templates often contain other information # (date/justification), so we drop it all here return CITATION_NEED...
Drop dates and comments from Czech templates.
Drop dates and comments from Czech templates. Former-commit-id: 2291964afbbb8f2d896bb069bb37f24afc2fb081
Python
mit
eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,eggpi/citationhunt,guilherme-pg/citationhunt,guilherme-pg/citationhunt
--- +++ @@ -0,0 +1,9 @@ +from base import * + +class SnippetParser(SnippetParserBase): + def strip_template(self, template, normalize, collapse): + if self.is_citation_needed(template): + # These templates often contain other information + # (date/justification), so we drop it all here...
682f942799c15acadea1a707261ed606b4c1e245
mailqueue/migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py
mailqueue/migrations/0003_auto__add_field_mailermessage_bcc_address__add_field_mailermessage_las.py
# -*- coding: utf-8 -*- import datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'MailerMessage.bcc_address' db.add_column('mailqueue_mailermessage', 'bcc_address', ...
Add migrations for new fields.
Add migrations for new fields.
Python
mit
winfieldco/django-mail-queue,styrmis/django-mail-queue,Goury/django-mail-queue,dstegelman/django-mail-queue,dstegelman/django-mail-queue,Goury/django-mail-queue
--- +++ @@ -0,0 +1,46 @@ +# -*- coding: utf-8 -*- +import datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + # Adding field 'MailerMessage.bcc_address' + db.add_column('mailqueue_m...
358f94e58557f9c2cec21a2ec8fb55cb8def0e34
plot_prior_misses.py
plot_prior_misses.py
# Run h264dec on a single file compiled with PRIOR_STATS and then run this script # Outputs timeseries plot at /tmp/misses.pdf import matplotlib.pyplot as plt from matplotlib.backends.backend_pdf import PdfPages import os def temporal_misses(key): values = data[key] numbins = 100 binsize = len(values) // n...
Add pyplot script for plotting prior miss timeseries
Add pyplot script for plotting prior miss timeseries
Python
bsd-2-clause
eastlhu/losslessh264,erillfire/wusunyasuo,itplanes/losslessh264,xiangshuai/losslessh264,xiangshuai/losslessh264,noname007/losslessh264,TonySheh/losslessh264,common2015/losslessh264,krsjoseph/losslessh264,krsjoseph/losslessh264,sunfei/losslessh264,sunfei/losslessh264,aquar25/losslessh264,yurenyong123/losslessh264,lioonl...
--- +++ @@ -0,0 +1,36 @@ +# Run h264dec on a single file compiled with PRIOR_STATS and then run this script +# Outputs timeseries plot at /tmp/misses.pdf +import matplotlib.pyplot as plt +from matplotlib.backends.backend_pdf import PdfPages +import os + +def temporal_misses(key): + values = data[key] + numbins ...
91d37572785bb3a336407fb085ba47ea281f6729
recordlinkage/rl_logging.py
recordlinkage/rl_logging.py
"""Logging utilities.""" # Copyright 2015 The TensorFlow Authors. 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 # # ...
Add logging module based on tensorflow
Add logging module based on tensorflow
Python
bsd-3-clause
J535D165/recordlinkage,J535D165/recordlinkage
--- +++ @@ -0,0 +1,65 @@ +"""Logging utilities.""" + +# Copyright 2015 The TensorFlow Authors. 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....
5e7866a897562b87f0c0ffa763c08f91c1aacccd
tests/test_cli.py
tests/test_cli.py
from __future__ import print_function, division, absolute_import import glob from os.path import basename import py.path import pytest from psautohint.autohint import ACFontError from psautohint.__main__ import main as psautohint from . import DATA_DIR UFO_FONTS = glob.glob("%s/*/*/font.ufo" % DATA_DIR) OTF_FONTS ...
Add some basic CLI tests
Add some basic CLI tests Wasn’t that hard!
Python
apache-2.0
khaledhosny/psautohint,khaledhosny/psautohint
--- +++ @@ -0,0 +1,41 @@ +from __future__ import print_function, division, absolute_import + +import glob +from os.path import basename +import py.path +import pytest + +from psautohint.autohint import ACFontError +from psautohint.__main__ import main as psautohint + +from . import DATA_DIR + + +UFO_FONTS = glob.glob...
e77bb03ecb85bd90cd542eb5dddbda8c2af3df53
tp/netlib/objects/ObjectExtra/Wormhole.py
tp/netlib/objects/ObjectExtra/Wormhole.py
from xstruct import pack from objects import Object class Wormhole(Object): """\ The Wormhole is a top level object that links to locations together. It was added as a quick hack to make the Risk ruleset a little easier to play. It has 3 int64 arguments which are the "other end" of the wormhole. """ subtype =...
Add a wormhole object as a quick-hack to make risk connections work. (Pending tp04 being finished.)
Add a wormhole object as a quick-hack to make risk connections work. (Pending tp04 being finished.)
Python
lgpl-2.1
thousandparsec/libtpproto-py,thousandparsec/libtpproto-py
--- +++ @@ -0,0 +1,44 @@ + +from xstruct import pack +from objects import Object + +class Wormhole(Object): + """\ + The Wormhole is a top level object that links to locations together. + + It was added as a quick hack to make the Risk ruleset a little easier to play. + + It has 3 int64 arguments which are the "other...
15fec2dc39dbac26f006171b7a5d0547fb40f254
get_google_token.py
get_google_token.py
#!/usr/bin/env python import os import sys import webbrowser from oauth2client.client import OAuth2WebServerFlow def get_credentials(scopes): flow = OAuth2WebServerFlow( client_id=os.environ['GOOGLE_CLIENT_ID'], client_secret=os.environ['GOOGLE_CLIENT_SECRET'], scope=' '.join(scopes), ...
Add first draft of Google refresh-token script
Add first draft of Google refresh-token script
Python
bsd-2-clause
myersjustinc/stitchbot
--- +++ @@ -0,0 +1,36 @@ +#!/usr/bin/env python +import os +import sys +import webbrowser + +from oauth2client.client import OAuth2WebServerFlow + + +def get_credentials(scopes): + flow = OAuth2WebServerFlow( + client_id=os.environ['GOOGLE_CLIENT_ID'], + client_secret=os.environ['GOOGLE_CLIENT_SECRET...
bbfc5549fb632d535ed1934e0d2bd1226ccd4507
openquake/commands/webui.py
openquake/commands/webui.py
# -*- coding: utf-8 -*- # vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright (c) 2016, GEM Foundation # OpenQuake is free software: you can redistribute it and/or modify it # under the terms of the GNU Affero General Public License as published # by the Free Software Foundation, either version 3 of the Licen...
Add a command to start the WebUI using oq
Add a command to start the WebUI using oq The django development server is started in foreground on localhost:8800. Meant to be used with multi_user = false but works also if true.
Python
agpl-3.0
gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine,gem/oq-engine
--- +++ @@ -0,0 +1,50 @@ +# -*- coding: utf-8 -*- +# vim: tabstop=4 shiftwidth=4 softtabstop=4 + +# Copyright (c) 2016, GEM Foundation + +# OpenQuake is free software: you can redistribute it and/or modify it +# under the terms of the GNU Affero General Public License as published +# by the Free Software Founda...
0433c32cd4212947517e57b6dc24d7d215123df9
workers/data_refinery_workers/downloaders/test_utils.py
workers/data_refinery_workers/downloaders/test_utils.py
import os from django.test import TestCase, tag from typing import List from unittest.mock import patch, call from urllib.error import URLError from data_refinery_workers.downloaders import utils class UtilsTestCase(TestCase): def test_no_jobs_to_create(self): """Make sure this function doesn't raise an ...
Add unit test to make sure no work isn't an error.
Add unit test to make sure no work isn't an error.
Python
bsd-3-clause
data-refinery/data_refinery,data-refinery/data_refinery,data-refinery/data_refinery
--- +++ @@ -0,0 +1,15 @@ +import os + +from django.test import TestCase, tag +from typing import List +from unittest.mock import patch, call +from urllib.error import URLError + +from data_refinery_workers.downloaders import utils + +class UtilsTestCase(TestCase): + def test_no_jobs_to_create(self): + """Ma...
8f21fcc4611bba391761df517de8dec3c8e53d9a
scripts/data_download/rais/create_all_files.py
scripts/data_download/rais/create_all_files.py
import os import commands import time import logging import sys if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']): print "ERROR! Use:\n python scripts/data_download/rais/create_files.py en/pt output_path\n" exit() logging.basicConfig(filename=os.path.abspath(os.path.join(sys.argv[2],str(sys.argv[...
Add file to create all files to rais.
Add file to create all files to rais.
Python
mit
DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site,DataViva/dataviva-site
--- +++ @@ -0,0 +1,16 @@ +import os +import commands +import time +import logging +import sys + +if len(sys.argv) != 3 or (sys.argv[1:][0] not in ['pt', 'en']): + print "ERROR! Use:\n python scripts/data_download/rais/create_files.py en/pt output_path\n" + exit() + +logging.basicConfig(filename=os.path.abspath(...
177a1fdb394eee4a41a3667b0f138a1f2d8b59ca
viewer_examples/plugins/probabilistic_hough.py
viewer_examples/plugins/probabilistic_hough.py
import numpy as np from skimage import data from skimage import draw from skimage.transform import probabilistic_hough_line from skimage.viewer import ImageViewer from skimage.viewer.widgets import Slider from skimage.viewer.plugins.overlayplugin import OverlayPlugin from skimage.viewer.plugins.canny import CannyPlug...
Add example of connected viewers/plugins
Add example of connected viewers/plugins
Python
bsd-3-clause
chintak/scikit-image,blink1073/scikit-image,michaelpacer/scikit-image,rjeli/scikit-image,dpshelio/scikit-image,michaelaye/scikit-image,oew1v07/scikit-image,almarklein/scikit-image,paalge/scikit-image,robintw/scikit-image,bsipocz/scikit-image,ClinicalGraphics/scikit-image,SamHames/scikit-image,chintak/scikit-image,jwigg...
--- +++ @@ -0,0 +1,45 @@ +import numpy as np + +from skimage import data +from skimage import draw +from skimage.transform import probabilistic_hough_line + +from skimage.viewer import ImageViewer +from skimage.viewer.widgets import Slider +from skimage.viewer.plugins.overlayplugin import OverlayPlugin +from skimage....
47410ebd3ae30cc22df106d233e2184d417c2b42
cerbero/tools/depstracker.py
cerbero/tools/depstracker.py
# cerbero - a multi-platform build system for Open Source software # Copyright (C) 2013 Andoni Morales Alastruey <ylatuya@gmail.com> # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Library General Public # License as published by the Free Software Foundation; eit...
Add a new tool to list libraries deps
Add a new tool to list libraries deps
Python
lgpl-2.1
freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,BigBrother-International/gst-cerbero,BigBrother-International/gst-cerbero,freedesktop-unofficial-mirror/gstreamer-sdk__cerbero,BigBrother-International/gst-cerbero,freedesktop-unofficial-mirror/gstreamer-sdk__cerbe...
--- +++ @@ -0,0 +1,63 @@ +# cerbero - a multi-platform build system for Open Source software +# Copyright (C) 2013 Andoni Morales Alastruey <ylatuya@gmail.com> +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Library General Public +# License as published by ...
6038c707fe91a4cbf54a364c12f7086b19505f8b
setup.py
setup.py
#!/usr/bin/env python from setuptools import setup setup( name='datacube-experiments', description='Experimental Datacube v2 Ingestor', version='0.0.1', packages=['ingestor'], url='http://github.com/omad/datacube-experiments', install_requires=[ 'click', 'eodatasets', '...
Allow package to be installed with command line ingestor tool
Allow package to be installed with command line ingestor tool
Python
bsd-3-clause
omad/datacube-experiments
--- +++ @@ -0,0 +1,22 @@ +#!/usr/bin/env python + +from setuptools import setup + +setup( + name='datacube-experiments', + description='Experimental Datacube v2 Ingestor', + version='0.0.1', + packages=['ingestor'], + url='http://github.com/omad/datacube-experiments', + install_requires=[ + '...
87e8d128fcd944c265c06bc82d8947fcdbb2c360
pyconcz_2016/team/models.py
pyconcz_2016/team/models.py
from django.db import models class Organizer(models.Model): full_name = models.CharField(max_length=200) email = models.EmailField( default='', blank=True, help_text="This is private") twitter = models.CharField(max_length=255, blank=True) github = models.CharField(max_length=255, blan...
from django.db import models class Organizer(models.Model): full_name = models.CharField(max_length=200) email = models.EmailField( default='', blank=True, help_text="This is private") twitter = models.CharField(max_length=255, blank=True) github = models.CharField(max_length=255, blan...
Revert "Revert "Add string representation of organizer object""
Revert "Revert "Add string representation of organizer object"" This reverts commit 36aff772ba6720acb8f629e89954162f98a932e3.
Python
mit
benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,benabraham/cz.pycon.org-2017,benabraham/cz.pycon.org-2017,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2016,pyvec/cz.pycon.org-2017,pyvec/cz.pycon.org-2017
--- +++ @@ -11,3 +11,6 @@ photo = models.ImageField(upload_to='team/pyconcz2016/') published = models.BooleanField(default=False) + + def __str__(self): + return self.full_name
e9fe49f04c23580755f3c828e01fcdd4ddb9385f
intern/migrations/0038_auto_20190525_2221.py
intern/migrations/0038_auto_20190525_2221.py
# Generated by Django 2.2.1 on 2019-05-25 20:21 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('intern', '0037_auto_20190525_2142'), ] operations = [ migrations.AlterField( model_name='date', name='created', ...
Add auto now fields to intern models
Add auto now fields to intern models
Python
mit
n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb,n2o/dpb
--- +++ @@ -0,0 +1,22 @@ +# Generated by Django 2.2.1 on 2019-05-25 20:21 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + dependencies = [ + ('intern', '0037_auto_20190525_2142'), + ] + + operations = [ + migrations.AlterField( + model_name='...
c9ddb5075e5157ddecaea5b1a975700faabdfb4b
tests/api/test_committee_meeting_attendance_excel_export.py
tests/api/test_committee_meeting_attendance_excel_export.py
from tests import PMGTestCase from tests.fixtures import dbfixture, CommitteeMeetingData class TestCommitteeMeetingAttendanceExcelExport(PMGTestCase): def setUp(self): super(TestCommitteeMeetingAttendanceExcelExport, self).setUp() self.fx = dbfixture.data(CommitteeMeetingData) self.fx.set...
Add smoke test for attendance excel export
Add smoke test for attendance excel export
Python
apache-2.0
Code4SA/pmg-cms-2,Code4SA/pmg-cms-2,Code4SA/pmg-cms-2
--- +++ @@ -0,0 +1,20 @@ +from tests import PMGTestCase +from tests.fixtures import dbfixture, CommitteeMeetingData + + +class TestCommitteeMeetingAttendanceExcelExport(PMGTestCase): + def setUp(self): + super(TestCommitteeMeetingAttendanceExcelExport, self).setUp() + + self.fx = dbfixture.data(Commi...
81b1cf6973dde3ca23bbe5ac071d3decad81079a
pydsa/sleep_sort.py
pydsa/sleep_sort.py
from time import sleep from threading import Timer # Sleep Sort ;) # Complexity: O(max(input)+n) def sleep_sort(a): """ Sorts the list 'a' using Sleep sort algorithm >>> from pydsa import sleep_sort >>> a = [3, 4, 2] >>> sleep_sort(a) [2, 3, 4] """ sleep_sort.result = [] def add1...
from time import sleep from threading import Timer # Sleep Sort ;) # Complexity: O(max(input)+n) def sleep_sort(a): """ Sorts the list 'a' using Sleep sort algorithm >>> from pydsa import sleep_sort >>> a = [3, 4, 2] >>> sleep_sort(a) [2, 3, 4] """ sleep_sort.result = [] def ad...
Format code according to PEP8
Format code according to PEP8
Python
bsd-3-clause
rehassachdeva/pydsa,aktech/pydsa
--- +++ @@ -3,6 +3,7 @@ # Sleep Sort ;) # Complexity: O(max(input)+n) + def sleep_sort(a): """ @@ -15,11 +16,14 @@ """ sleep_sort.result = [] + def add1(x): sleep_sort.result.append(x) + mx = a[0] for v in a: - if mx < v: mx = v + if mx < v: + m...
f5c654941f8dd5eb64775d680d677993a829963c
lookupdict.py
lookupdict.py
#!/usr/bin/env python # coding: utf-8 # Copyright (C) USC Information Sciences Institute # Author: Vladimir M. Zaytsev <zaytsev@usc.edu> # URL: <http://nlg.isi.edu/> # For more information, see README.md # For license information, see LICENSE """ Simple dictionary lookup script. Finds given word in mokujin dictionary...
Add script to lookup term dictionary.
Add script to lookup term dictionary.
Python
apache-2.0
zaycev/mokujin
--- +++ @@ -0,0 +1,43 @@ +#!/usr/bin/env python +# coding: utf-8 + +# Copyright (C) USC Information Sciences Institute +# Author: Vladimir M. Zaytsev <zaytsev@usc.edu> +# URL: <http://nlg.isi.edu/> +# For more information, see README.md +# For license information, see LICENSE + +""" +Simple dictionary lookup script. ...
cc1c0d386b2e657c9f1f80a0e1ac1a4375df377b
mygpoauth/login/migrations/0001_case_insensitive_username.py
mygpoauth/login/migrations/0001_case_insensitive_username.py
from django.db import migrations class Migration(migrations.Migration): """ Create a unique case-insensitive index on the username column """ dependencies = [ ('auth', '0001_initial'), ] operations = [ migrations.RunSQL( 'CREATE UNIQUE INDEX user_case_insensitive_unique '...
Add case-insensitive unique index for username
Add case-insensitive unique index for username
Python
agpl-3.0
gpodder/mygpo-auth,gpodder/mygpo-auth
--- +++ @@ -0,0 +1,17 @@ +from django.db import migrations + + +class Migration(migrations.Migration): + """ Create a unique case-insensitive index on the username column """ + + dependencies = [ + ('auth', '0001_initial'), + ] + + operations = [ + migrations.RunSQL( + 'CREATE UNI...
422b5c763039865d69ee15f3b95a84596ba41c77
api/migrations/0006_alter_site_metadata_fields.py
api/migrations/0006_alter_site_metadata_fields.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('api', '0005_sitemetadata'), ] operations = [ migrations.AlterModelOptions( name='sitemetadata', opti...
Apply Meta changed & field default to SiteMetadata
Apply Meta changed & field default to SiteMetadata
Python
apache-2.0
CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend,CCI-MOC/GUI-Frontend
--- +++ @@ -0,0 +1,23 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('api', '0005_sitemetadata'), + ] + + operations = [ + migrations.AlterModelOptions( + ...
1c5f2bd553666607328ca16816db882cd5496364
tests/test_client.py
tests/test_client.py
from flask import url_for from app import user_datastore from app.models import Post from tests.general import AppTestCase class TestClient(AppTestCase): def setUp(self): super().setUp() self.client = self.app.test_client(use_cookies=True) # Create user and log in user_datastore....
Add test case for post creation
Add test case for post creation
Python
mit
Encrylize/flask-blogger,Encrylize/flask-blogger,Encrylize/flask-blogger
--- +++ @@ -0,0 +1,27 @@ +from flask import url_for + +from app import user_datastore +from app.models import Post +from tests.general import AppTestCase + + +class TestClient(AppTestCase): + def setUp(self): + super().setUp() + self.client = self.app.test_client(use_cookies=True) + + # Create...
aff3f5dab0d01c1b7e74adca88ba3096cb0b9106
tests/people/test_utils.py
tests/people/test_utils.py
import datetime from components.people.utils import calculate_age, calculate_average_age def test_calculate_age(): birthdate = datetime.date.today() - datetime.timedelta(days=731) target = datetime.date.today() - datetime.timedelta(days=365) assert calculate_age(birthdate) == 2 assert calculate_age(b...
Test our age calculation utilities.
Test our age calculation utilities.
Python
apache-2.0
hello-base/web,hello-base/web,hello-base/web,hello-base/web
--- +++ @@ -0,0 +1,18 @@ +import datetime + +from components.people.utils import calculate_age, calculate_average_age + + +def test_calculate_age(): + birthdate = datetime.date.today() - datetime.timedelta(days=731) + target = datetime.date.today() - datetime.timedelta(days=365) + assert calculate_age(birthd...
7caf1988d5bf3c509f8c05c12cc3c9c6aa1ab33a
poster/graphics/export_tensorboard_values.py
poster/graphics/export_tensorboard_values.py
""" This script has to be called with the event file as argument The resulting values can be plotted """ import sys import tensorflow as tf CEEs = [] my_tag = "CAE/cross_entropy_error" for e in tf.train.summary_iterator(sys.argv[1]): for v in e.summary.value: if v.tag == my_tag: CEEs.append((e....
Add script for exporting values from tensorboard event file
Add script for exporting values from tensorboard event file
Python
apache-2.0
gangchill/nip-convnet,gangchill/nip-convnet
--- +++ @@ -0,0 +1,22 @@ +""" +This script has to be called with the event file as argument +The resulting values can be plotted +""" +import sys +import tensorflow as tf + +CEEs = [] +my_tag = "CAE/cross_entropy_error" +for e in tf.train.summary_iterator(sys.argv[1]): + for v in e.summary.value: + if v.tag...
54ad132d9abe545d61b1af34ffe9d7f5c2822a57
strings/string_permutation/python/spicyyboi_permute_string.py
strings/string_permutation/python/spicyyboi_permute_string.py
""" Gives all permutations of a string given as user input. Example: Input: Please enter the string: test Output: t e te s ts es tes t tt et tet st tst est test """ def permute(string): ...
Add string permutation in python
Add string permutation in python Add a second implementation of string permutation in python. The implementation doesn't use external libraries such as iterables.
Python
cc0-1.0
ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovski/al-go-rithms,ZoranPandovs...
--- +++ @@ -0,0 +1,42 @@ +""" +Gives all permutations of a string given as user input. + +Example: + Input: Please enter the string: test + Output: + t + e + te + s + ts + es + tes + t + tt + et + tet + st + tst + ...
c275c2611643d80d275af0430c5df2a94594caf0
cms_genome_browser/cms_app.py
cms_genome_browser/cms_app.py
from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from django.utils.translation import ugettext_lazy as _ class BrowserApp(CMSApp): name = _("Genome Browser App") urls = ["cms_genome_browser.urls"] app_name = "cms_genome_browser" apphook_pool.register(BrowserApp)
Create BrowserApp app hook for CMS
Create BrowserApp app hook for CMS
Python
bsd-3-clause
mfcovington/djangocms-genome-browser,mfcovington/djangocms-genome-browser,mfcovington/djangocms-genome-browser
--- +++ @@ -0,0 +1,10 @@ +from cms.app_base import CMSApp +from cms.apphook_pool import apphook_pool +from django.utils.translation import ugettext_lazy as _ + +class BrowserApp(CMSApp): + name = _("Genome Browser App") + urls = ["cms_genome_browser.urls"] + app_name = "cms_genome_browser" + +apphook_pool.re...
1015225a00b37f6b2322a6ad0450079178c03d17
examples/fdroid_clean_repos.py
examples/fdroid_clean_repos.py
#!/usr/bin/env python3 # # an fdroid plugin for resetting app VCSs to the latest version for the metadata import argparse import logging from fdroidserver import _, common, metadata from fdserver.exeption import VCSException fdroid_summary = 'reset app VCSs to the latest version' def main(): parser = argparse...
Add plugin to cleanup app VCSs
Add plugin to cleanup app VCSs
Python
agpl-3.0
f-droid/fdroidserver,f-droid/fdroidserver,f-droid/fdroidserver,f-droid/fdroidserver,f-droid/fdroidserver
--- +++ @@ -0,0 +1,39 @@ +#!/usr/bin/env python3 +# +# an fdroid plugin for resetting app VCSs to the latest version for the metadata + +import argparse +import logging + +from fdroidserver import _, common, metadata + +from fdserver.exeption import VCSException + +fdroid_summary = 'reset app VCSs to the latest versi...
74305170ee64a0129d5c8eec8d908e4a8696d038
jobs/migrations/0012_auto_20170809_1849.py
jobs/migrations/0012_auto_20170809_1849.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.apps import apps as global_apps from django.contrib.contenttypes.management import update_contenttypes from django.db import models, migrations from django.utils.timezone import now MARKER = '.. Migrated from django_comments_xtd.Comment model...
Migrate old comments over jobs.JobReviewComment
Migrate old comments over jobs.JobReviewComment Fixes #591
Python
apache-2.0
manhhomienbienthuy/pythondotorg,python/pythondotorg,manhhomienbienthuy/pythondotorg,manhhomienbienthuy/pythondotorg,proevo/pythondotorg,Mariatta/pythondotorg,Mariatta/pythondotorg,python/pythondotorg,python/pythondotorg,Mariatta/pythondotorg,Mariatta/pythondotorg,proevo/pythondotorg,proevo/pythondotorg,python/pythondot...
--- +++ @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- +from __future__ import unicode_literals + +from django.apps import apps as global_apps +from django.contrib.contenttypes.management import update_contenttypes +from django.db import models, migrations +from django.utils.timezone import now + +MARKER = '.. Migrated fr...
1921c82e1a8f0a60ed665184c49647b38ea4978c
scripts/proc_sleep_timer.py
scripts/proc_sleep_timer.py
# Kills process by image name after a specified timeout # Useful as a sleep timer for some apps that don't support it natively, like VLC # Works only on Windows! # Example usage: python proc_sleep_timer vlc.exe 3600 import sched, time, subprocess, sys if (len(sys.argv) != 3): print("Usage: python proc_sleep_timer.py ...
Add simple sleep timer script for Windows
Add simple sleep timer script for Windows
Python
mit
iluxonchik/python-general-repo
--- +++ @@ -0,0 +1,19 @@ +# Kills process by image name after a specified timeout +# Useful as a sleep timer for some apps that don't support it natively, like VLC +# Works only on Windows! +# Example usage: python proc_sleep_timer vlc.exe 3600 +import sched, time, subprocess, sys + +if (len(sys.argv) != 3): + print(...
4a9d402b5917b052cae60f4d9d15cbf906dadf7d
split_data.py
split_data.py
import glob import os import tqdm import numpy as np import shutil from bird import loader as l source_dir = "./datasets/birdClef2016Whole/" classes = os.listdir(os.path.join(source_dir, "train")) percentage_validation_sampels = 0.10 progress = tqdm.tqdm(range(len(classes))) class_segmentss = [(c, glob.glob(os.path....
Add script to split dataset into validation and training data
Add script to split dataset into validation and training data
Python
mit
johnmartinsson/bird-species-classification,johnmartinsson/bird-species-classification
--- +++ @@ -0,0 +1,38 @@ +import glob +import os +import tqdm +import numpy as np +import shutil +from bird import loader as l + +source_dir = "./datasets/birdClef2016Whole/" +classes = os.listdir(os.path.join(source_dir, "train")) + +percentage_validation_sampels = 0.10 + +progress = tqdm.tqdm(range(len(classes))) +...
50117a2576ab8d002d95e36b5dccfb4e16122622
move_forvo.py
move_forvo.py
"""Move and rename pronunciations downloaded from forvo for easier Anki creation.""" import os import shutil import time FROM_DIR = '' TO_DIR = '' while True: for f in os.listdir(FROM_DIR): if f[:17] == 'pronunciation_de_': print('moving ' + f) shutil.move(os.path.join(FROM_DIR, f), os.path.jo...
Move forvo downloads for easier Anki creation.
Move forvo downloads for easier Anki creation.
Python
mit
AndrzejR/Scripts
--- +++ @@ -0,0 +1,15 @@ +"""Move and rename pronunciations downloaded from forvo for easier Anki creation.""" + +import os +import shutil +import time + +FROM_DIR = '' +TO_DIR = '' + +while True: + for f in os.listdir(FROM_DIR): + if f[:17] == 'pronunciation_de_': + print('moving ' + f) + shutil.move(os.path.j...
eca911a1b1623368f991dbf47002c0b59abc15db
script/lib/config.py
script/lib/config.py
#!/usr/bin/env python NODE_VERSION = 'v0.11.10' BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' LIBCHROMIUMCONTENT_COMMIT = '1df8e7cdac8aa74c91c19ae0691ce512d560ab3e'
#!/usr/bin/env python NODE_VERSION = 'v0.11.10' BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' LIBCHROMIUMCONTENT_COMMIT = 'aa4874a6bcc51fdd87ca7ae0928514ce83645988'
Update libchromiumcontent: Suppress CFAllocator warning.
Update libchromiumcontent: Suppress CFAllocator warning.
Python
mit
jjz/electron,Ivshti/electron,howmuchcomputer/electron,simonfork/electron,takashi/electron,SufianHassan/electron,micalan/electron,tylergibson/electron,Gerhut/electron,mattdesl/electron,edulan/electron,edulan/electron,d-salas/electron,gerhardberger/electron,micalan/electron,brenca/electron,stevekinney/electron,pandoraui/...
--- +++ @@ -2,4 +2,4 @@ NODE_VERSION = 'v0.11.10' BASE_URL = 'https://gh-contractor-zcbenz.s3.amazonaws.com/libchromiumcontent' -LIBCHROMIUMCONTENT_COMMIT = '1df8e7cdac8aa74c91c19ae0691ce512d560ab3e' +LIBCHROMIUMCONTENT_COMMIT = 'aa4874a6bcc51fdd87ca7ae0928514ce83645988'
c4f1e95860febcb738d9b9c0cca5ad3c6365024b
control/calibrate_esc.py
control/calibrate_esc.py
"""Programs the ESC.""" from control import driver as driver_module from control.driver import Driver from control.test.dummy_logger import DummyLogger from control.test.dummy_telemetry import DummyTelemetry def main(): """Main function.""" # First, shut the damn car up throttle_percentage = 0.0 # And...
Add script to calibrate the ESC
Add script to calibrate the ESC
Python
mit
bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc,bskari/sparkfun-avc
--- +++ @@ -0,0 +1,55 @@ +"""Programs the ESC.""" +from control import driver as driver_module +from control.driver import Driver +from control.test.dummy_logger import DummyLogger +from control.test.dummy_telemetry import DummyTelemetry + + +def main(): + """Main function.""" + # First, shut the damn car up + ...
2daf2087583b57c3339a923889c9bb4132f1db34
benchexec/tools/coveritest.py
benchexec/tools/coveritest.py
# This file is part of BenchExec, a framework for reliable benchmarking: # https://github.com/sosy-lab/benchexec # # SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> # # SPDX-License-Identifier: Apache-2.0 import benchexec.tools.cpachecker as cpachecker class Tool(cpachecker.Tool): """Tool...
Add tool info for CoVeriTest
Add tool info for CoVeriTest
Python
apache-2.0
sosy-lab/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,dbeyer/benchexec,ultimate-pa/benchexec,dbeyer/benchexec,sosy-lab/benchexec,ultimate-pa/benchexec
--- +++ @@ -0,0 +1,25 @@ +# This file is part of BenchExec, a framework for reliable benchmarking: +# https://github.com/sosy-lab/benchexec +# +# SPDX-FileCopyrightText: 2007-2020 Dirk Beyer <https://www.sosy-lab.org> +# +# SPDX-License-Identifier: Apache-2.0 + +import benchexec.tools.cpachecker as cpachecker + + +cl...
cab9ef8d58adeceaf94d8855aa6d598d7fa01f33
src/tests/ggrc/converters/test_export_csv.py
src/tests/ggrc/converters/test_export_csv.py
# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> # Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> # Created By: miha@reciprocitylabs.com # Maintained By: miha@reciprocitylabs.com from os.path import abspath, dirname, join from flask.json import dumps from te...
Add export csv template tests
Add export csv template tests
Python
apache-2.0
edofic/ggrc-core,edofic/ggrc-core,NejcZupec/ggrc-core,hasanalom/ggrc-core,jmakov/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,selahssea/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,jmakov/ggrc-core,hyperNURb/ggrc-core,hyperNURb/ggrc-core,hyperNURb/ggrc-core,plamut/ggrc-core,NejcZupec/ggrc-core,josthkko/ggrc...
--- +++ @@ -0,0 +1,50 @@ +# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file> +# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file> +# Created By: miha@reciprocitylabs.com +# Maintained By: miha@reciprocitylabs.com + +from os.path import abspath, dirname, join +fro...
8da9a8ffe4f5fc8773c96cc6aef96bf4f0b7c01c
examples/find-bt.py
examples/find-bt.py
#!/usr/bin/env python2 # # This file is Public Domain and provided only for documentation purposes. # # Run : python2 ./find-bt.py # # Note: This will happily run with Python3 too, I just picked a common baseline # import gi gi.require_version('Ldm', '1.0') from gi.repository import Ldm, GObject class BluezPlugin(Ldm...
Add demo on finding bluetooth host controllers
examples: Add demo on finding bluetooth host controllers Signed-off-by: Ikey Doherty <d8d992cf0016e35c2a8339d5e7d44bebd12a2d77@solus-project.com>
Python
lgpl-2.1
solus-project/linux-driver-management,solus-project/linux-driver-management
--- +++ @@ -0,0 +1,48 @@ +#!/usr/bin/env python2 +# +# This file is Public Domain and provided only for documentation purposes. +# +# Run : python2 ./find-bt.py +# +# Note: This will happily run with Python3 too, I just picked a common baseline +# + +import gi +gi.require_version('Ldm', '1.0') +from gi.repository imp...
b3ad1a33715f3db4b06e1196958b4248f9a8039d
django_generic_counter/south_migrations/0003_auto__chg_field_counter_count.py
django_generic_counter/south_migrations/0003_auto__chg_field_counter_count.py
# -*- coding: utf-8 -*- from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Changing field 'Counter.count' db.alter_column(u'django_generic_counte...
Add south migration for new field type.
Add south migration for new field type.
Python
unlicense
0x07Ltd/django-generic-counter,0x07Ltd/django-generic-counter
--- +++ @@ -0,0 +1,29 @@ +# -*- coding: utf-8 -*- +from south.utils import datetime_utils as datetime +from south.db import db +from south.v2 import SchemaMigration +from django.db import models + + +class Migration(SchemaMigration): + + def forwards(self, orm): + + # Changing field 'Counter.count' + ...
3189b82167955e713fcc6e92d34b220feeb122a7
tests/test_verbosity.py
tests/test_verbosity.py
import unittest import numpy as np import cpnest.model class GaussianModel(cpnest.model.Model): """ A simple gaussian model with parameters mean and sigma """ names=['mean','sigma'] bounds=[[-5,5],[0.05,1]] data = np.array([x for x in np.random.normal(0.5,0.5,size=10)]) analyticZ = np.log(0...
Add unit tests for different verbosity levels
Add unit tests for different verbosity levels
Python
mit
johnveitch/cpnest
--- +++ @@ -0,0 +1,45 @@ +import unittest +import numpy as np +import cpnest.model + +class GaussianModel(cpnest.model.Model): + """ + A simple gaussian model with parameters mean and sigma + """ + names=['mean','sigma'] + bounds=[[-5,5],[0.05,1]] + data = np.array([x for x in np.random.normal(0.5,0...
c88243305254cab3a504a6cfb6990173da0e478b
nucleus/rna/migrations/0004_auto_20211005_1522.py
nucleus/rna/migrations/0004_auto_20211005_1522.py
# Generated by Django 2.2.13 on 2021-10-05 15:22 from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('rna', '0003_auto_20210930_1841'), ] operations = [ migrations.AlterField( model_name='release', name='product', ...
Add migration for new release products list
Add migration for new release products list
Python
mpl-2.0
mozilla/nucleus,mozilla/nucleus,mozilla/nucleus,mozilla/nucleus
--- +++ @@ -0,0 +1,18 @@ +# Generated by Django 2.2.13 on 2021-10-05 15:22 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('rna', '0003_auto_20210930_1841'), + ] + + operations = [ + migrations.AlterField( + model_name='...
8f7769a0122fb0d9479209ed2239dd0687f301a1
plugin/core/test_url.py
plugin/core/test_url.py
from .url import (filename_to_uri, uri_to_filename) import unittest class WindowsTests(unittest.TestCase): @unittest.skipUnless(sys.platform.startswith("win"), "requires Windows") def test_converts_path_to_uri(self): self.assertEqual("file:///C:/dir%20ectory/file.txt", filename_to_uri("c:\\dir ectory\\file.tx...
Add test for url handling in Windows
Add test for url handling in Windows
Python
mit
tomv564/LSP
--- +++ @@ -0,0 +1,13 @@ +from .url import (filename_to_uri, uri_to_filename) +import unittest + + +class WindowsTests(unittest.TestCase): + + @unittest.skipUnless(sys.platform.startswith("win"), "requires Windows") + def test_converts_path_to_uri(self): + self.assertEqual("file:///C:/dir%20ectory/file.txt", file...
b4048b9a9ba9f7a9d1ac03e4a0d57c5c6e1b4471
editorconfig/versiontools.py
editorconfig/versiontools.py
"""EditorConfig version tools Provides ``join_version`` and ``split_version`` classes for converting __version__ strings to VERSION tuples and vice versa. """ import re __all__ = ['join_version', 'split_version'] _version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)(\..*)?$', re.VERBOSE) def join_version(version_tup...
"""EditorConfig version tools Provides ``join_version`` and ``split_version`` classes for converting __version__ strings to VERSION tuples and vice versa. """ import re __all__ = ['join_version', 'split_version'] _version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)(\..*)?$', re.VERBOSE) def join_version(version_tup...
Fix version string format for development versions
Fix version string format for development versions
Python
bsd-2-clause
benjifisher/editorconfig-vim,benjifisher/editorconfig-vim,VictorBjelkholm/editorconfig-vim,pocke/editorconfig-vim,johnfraney/editorconfig-vim,pocke/editorconfig-vim,johnfraney/editorconfig-vim,pocke/editorconfig-vim,benjifisher/editorconfig-vim,VictorBjelkholm/editorconfig-vim,VictorBjelkholm/editorconfig-vim,johnfrane...
--- +++ @@ -18,7 +18,7 @@ """Return a string representation of version from given VERSION tuple""" version = "%s.%s.%s" % version_tuple[:3] if version_tuple[3] != "final": - version += ".%s" % version_tuple[3] + version += "-%s" % version_tuple[3] return version