commit
stringlengths
40
40
old_file
stringlengths
4
118
new_file
stringlengths
4
118
old_contents
stringlengths
0
2.94k
new_contents
stringlengths
1
4.43k
subject
stringlengths
15
444
message
stringlengths
16
3.45k
lang
stringclasses
1 value
license
stringclasses
13 values
repos
stringlengths
5
43.2k
prompt
stringlengths
17
4.58k
response
stringlengths
1
4.43k
prompt_tagged
stringlengths
58
4.62k
response_tagged
stringlengths
1
4.43k
text
stringlengths
132
7.29k
text_tagged
stringlengths
173
7.33k
8ceca4a068031e049ef906e0ce4f5c03b3db6a48
migrations/versions/0201_another_letter_org.py
migrations/versions/0201_another_letter_org.py
"""empty message Revision ID: 0201_another_letter_org Revises: 0200_another_letter_org Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0201_another_letter_org' down_revision = '0200_another_letter_org' from alembic import op NEW_ORGANISATIONS = [ ('509', 'Hackn...
Add letter organisation for Hackney Council
Add letter organisation for Hackney Council
Python
mit
alphagov/notifications-api,alphagov/notifications-api
Add letter organisation for Hackney Council
"""empty message Revision ID: 0201_another_letter_org Revises: 0200_another_letter_org Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0201_another_letter_org' down_revision = '0200_another_letter_org' from alembic import op NEW_ORGANISATIONS = [ ('509', 'Hackn...
<commit_before><commit_msg>Add letter organisation for Hackney Council<commit_after>
"""empty message Revision ID: 0201_another_letter_org Revises: 0200_another_letter_org Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0201_another_letter_org' down_revision = '0200_another_letter_org' from alembic import op NEW_ORGANISATIONS = [ ('509', 'Hackn...
Add letter organisation for Hackney Council"""empty message Revision ID: 0201_another_letter_org Revises: 0200_another_letter_org Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0201_another_letter_org' down_revision = '0200_another_letter_org' from alembic import op...
<commit_before><commit_msg>Add letter organisation for Hackney Council<commit_after>"""empty message Revision ID: 0201_another_letter_org Revises: 0200_another_letter_org Create Date: 2017-06-29 12:44:16.815039 """ # revision identifiers, used by Alembic. revision = '0201_another_letter_org' down_revision = '0200_an...
da186d5d36239f052dfb64e30b0e28ec830bf15d
scripts/calculate_handlebar_inertia.py
scripts/calculate_handlebar_inertia.py
#!/usr/bin/env python # -*- coding: utf-8 -*- """This script estimates the inertia of the handlebars and upper part of the steering column (everything above the torque sensor) about the steer axis. Although we expect this value to be small, it still influences the dynamics of the system and influences the values we rea...
Add script to calculate handlebar inertia
Add script to calculate handlebar inertia Script takes a protobuf log as input. The Kollmorgen actual torque is converted from DAC values to N-m. The steer encoder count is converted to an angular acceleration using a Savitzky-Golay filter with window size 11 and polynomial order 3. The handlebar inertia is calculated...
Python
bsd-2-clause
oliverlee/phobos,oliverlee/phobos,oliverlee/phobos,oliverlee/phobos
Add script to calculate handlebar inertia Script takes a protobuf log as input. The Kollmorgen actual torque is converted from DAC values to N-m. The steer encoder count is converted to an angular acceleration using a Savitzky-Golay filter with window size 11 and polynomial order 3. The handlebar inertia is calculated...
#!/usr/bin/env python # -*- coding: utf-8 -*- """This script estimates the inertia of the handlebars and upper part of the steering column (everything above the torque sensor) about the steer axis. Although we expect this value to be small, it still influences the dynamics of the system and influences the values we rea...
<commit_before><commit_msg>Add script to calculate handlebar inertia Script takes a protobuf log as input. The Kollmorgen actual torque is converted from DAC values to N-m. The steer encoder count is converted to an angular acceleration using a Savitzky-Golay filter with window size 11 and polynomial order 3. The hand...
#!/usr/bin/env python # -*- coding: utf-8 -*- """This script estimates the inertia of the handlebars and upper part of the steering column (everything above the torque sensor) about the steer axis. Although we expect this value to be small, it still influences the dynamics of the system and influences the values we rea...
Add script to calculate handlebar inertia Script takes a protobuf log as input. The Kollmorgen actual torque is converted from DAC values to N-m. The steer encoder count is converted to an angular acceleration using a Savitzky-Golay filter with window size 11 and polynomial order 3. The handlebar inertia is calculated...
<commit_before><commit_msg>Add script to calculate handlebar inertia Script takes a protobuf log as input. The Kollmorgen actual torque is converted from DAC values to N-m. The steer encoder count is converted to an angular acceleration using a Savitzky-Golay filter with window size 11 and polynomial order 3. The hand...
2316dddecc7891d1544ef72485afd067ef759c6b
examples/xpath_test.py
examples/xpath_test.py
""" NOTE: Using CSS Selectors is better than using XPath! XPath Selectors break very easily with website changes. """ from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_xpath(self): self.open("https://xkcd.com/1319/") self.assert_element('//img') self.assert_elem...
Add an example test with XPath selectors
Add an example test with XPath selectors
Python
mit
seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase
Add an example test with XPath selectors
""" NOTE: Using CSS Selectors is better than using XPath! XPath Selectors break very easily with website changes. """ from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_xpath(self): self.open("https://xkcd.com/1319/") self.assert_element('//img') self.assert_elem...
<commit_before><commit_msg>Add an example test with XPath selectors<commit_after>
""" NOTE: Using CSS Selectors is better than using XPath! XPath Selectors break very easily with website changes. """ from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_xpath(self): self.open("https://xkcd.com/1319/") self.assert_element('//img') self.assert_elem...
Add an example test with XPath selectors""" NOTE: Using CSS Selectors is better than using XPath! XPath Selectors break very easily with website changes. """ from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_xpath(self): self.open("https://xkcd.com/1319/") self.assert_e...
<commit_before><commit_msg>Add an example test with XPath selectors<commit_after>""" NOTE: Using CSS Selectors is better than using XPath! XPath Selectors break very easily with website changes. """ from seleniumbase import BaseCase class MyTestClass(BaseCase): def test_xpath(self): self.open("https...
893a624f8a6646c9211ee6510869ad1b2aae3312
incubation/epub_for_kobo_py/hello.py
incubation/epub_for_kobo_py/hello.py
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including witho...
Add a project in the 'incubator'.
Add a project in the 'incubator'.
Python
mit
jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets,jeremiedecock/snippets
Add a project in the 'incubator'.
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including witho...
<commit_before><commit_msg>Add a project in the 'incubator'.<commit_after>
#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software without restriction, including witho...
Add a project in the 'incubator'.#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to deal # in the Software wit...
<commit_before><commit_msg>Add a project in the 'incubator'.<commit_after>#!/usr/bin/env python3 # -*- coding: utf-8 -*- # Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org) # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "...
829ed9d8de8f1df73d24edbd2f9c52438eab8858
common_configs/utils.py
common_configs/utils.py
#-*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals def merge_items(base, new_items): """ Merges two lists and eliminates duplicates :type base: list :type new_items: list :rtype: list """ for item in new_items: if not item in...
Include merge_items helper for merging config lists and eliminating dupes
Include merge_items helper for merging config lists and eliminating dupes
Python
bsd-3-clause
nigma/django-common-configs,nigma/django-common-configs
Include merge_items helper for merging config lists and eliminating dupes
#-*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals def merge_items(base, new_items): """ Merges two lists and eliminates duplicates :type base: list :type new_items: list :rtype: list """ for item in new_items: if not item in...
<commit_before><commit_msg>Include merge_items helper for merging config lists and eliminating dupes<commit_after>
#-*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals def merge_items(base, new_items): """ Merges two lists and eliminates duplicates :type base: list :type new_items: list :rtype: list """ for item in new_items: if not item in...
Include merge_items helper for merging config lists and eliminating dupes#-*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals def merge_items(base, new_items): """ Merges two lists and eliminates duplicates :type base: list :type new_items: list ...
<commit_before><commit_msg>Include merge_items helper for merging config lists and eliminating dupes<commit_after>#-*- coding: utf-8 -*- from __future__ import absolute_import, division, print_function, unicode_literals def merge_items(base, new_items): """ Merges two lists and eliminates duplicates :ty...
6edee679e6c3478369175fa53fd3520d9b39abf1
gen_transfer.py
gen_transfer.py
from redis import Redis from chain import Transaction from user import LazyUser from config import * import json if __name__ == '__main__': r = Redis() hero = LazyUser() receiver = LazyUser() t = Transaction( prev_hash=r.get(PREV_HASH_KEY), transaction_type='SEND', sender=hero....
Add a script that allows transfer of bitcoins between two users
Add a script that allows transfer of bitcoins between two users
Python
mit
paramsingh/lazycoin,paramsingh/lazycoin,paramsingh/lazycoin
Add a script that allows transfer of bitcoins between two users
from redis import Redis from chain import Transaction from user import LazyUser from config import * import json if __name__ == '__main__': r = Redis() hero = LazyUser() receiver = LazyUser() t = Transaction( prev_hash=r.get(PREV_HASH_KEY), transaction_type='SEND', sender=hero....
<commit_before><commit_msg>Add a script that allows transfer of bitcoins between two users<commit_after>
from redis import Redis from chain import Transaction from user import LazyUser from config import * import json if __name__ == '__main__': r = Redis() hero = LazyUser() receiver = LazyUser() t = Transaction( prev_hash=r.get(PREV_HASH_KEY), transaction_type='SEND', sender=hero....
Add a script that allows transfer of bitcoins between two usersfrom redis import Redis from chain import Transaction from user import LazyUser from config import * import json if __name__ == '__main__': r = Redis() hero = LazyUser() receiver = LazyUser() t = Transaction( prev_hash=r.get(PREV_H...
<commit_before><commit_msg>Add a script that allows transfer of bitcoins between two users<commit_after>from redis import Redis from chain import Transaction from user import LazyUser from config import * import json if __name__ == '__main__': r = Redis() hero = LazyUser() receiver = LazyUser() t = Tr...
6cd85f616d933c006abb45f4d682194157df4005
morse_trainer/test_receive_group.py
morse_trainer/test_receive_group.py
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Test of grouping - make the receive boxgroup. """ from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QApplication, QWidget, QRadioButton from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QGroupBox class GroupBox(QWidget): def __init__...
Test program for the 'Receive' group control
Test program for the 'Receive' group control
Python
mit
rzzzwilson/morse,rzzzwilson/morse
Test program for the 'Receive' group control
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Test of grouping - make the receive boxgroup. """ from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QApplication, QWidget, QRadioButton from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QGroupBox class GroupBox(QWidget): def __init__...
<commit_before><commit_msg>Test program for the 'Receive' group control<commit_after>
#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Test of grouping - make the receive boxgroup. """ from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QApplication, QWidget, QRadioButton from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QGroupBox class GroupBox(QWidget): def __init__...
Test program for the 'Receive' group control#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Test of grouping - make the receive boxgroup. """ from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QApplication, QWidget, QRadioButton from PyQt5.QtWidgets import QHBoxLayout, QVBoxLayout, QGridLayout, QGroupBox ...
<commit_before><commit_msg>Test program for the 'Receive' group control<commit_after>#!/usr/bin/python3 # -*- coding: utf-8 -*- """ Test of grouping - make the receive boxgroup. """ from PyQt5.QtCore import pyqtSignal from PyQt5.QtWidgets import QApplication, QWidget, QRadioButton from PyQt5.QtWidgets import QHBoxLay...
85896d2fc168278c2cadeb3ddb02830591c2fd8e
tests/mpath_test.py
tests/mpath_test.py
import unittest import os from utils import create_sparse_tempfile from gi.repository import BlockDev if not BlockDev.is_initialized(): BlockDev.init(None, None) class MpathTestCase(unittest.TestCase): def setUp(self): self.dev_file = create_sparse_tempfile("mpath_test", 1024**3) succ, loop = ...
Add tests for what we can easily test from the mpath plugin
Add tests for what we can easily test from the mpath plugin Testing mpath is generally not easy as we would need actual multipath devices that are kind of hard to setup on top of loop devices.
Python
lgpl-2.1
atodorov/libblockdev,rhinstaller/libblockdev,dashea/libblockdev,dashea/libblockdev,rhinstaller/libblockdev,rhinstaller/libblockdev,vpodzime/libblockdev,snbueno/libblockdev,atodorov/libblockdev,snbueno/libblockdev,vpodzime/libblockdev,vpodzime/libblockdev,atodorov/libblockdev
Add tests for what we can easily test from the mpath plugin Testing mpath is generally not easy as we would need actual multipath devices that are kind of hard to setup on top of loop devices.
import unittest import os from utils import create_sparse_tempfile from gi.repository import BlockDev if not BlockDev.is_initialized(): BlockDev.init(None, None) class MpathTestCase(unittest.TestCase): def setUp(self): self.dev_file = create_sparse_tempfile("mpath_test", 1024**3) succ, loop = ...
<commit_before><commit_msg>Add tests for what we can easily test from the mpath plugin Testing mpath is generally not easy as we would need actual multipath devices that are kind of hard to setup on top of loop devices.<commit_after>
import unittest import os from utils import create_sparse_tempfile from gi.repository import BlockDev if not BlockDev.is_initialized(): BlockDev.init(None, None) class MpathTestCase(unittest.TestCase): def setUp(self): self.dev_file = create_sparse_tempfile("mpath_test", 1024**3) succ, loop = ...
Add tests for what we can easily test from the mpath plugin Testing mpath is generally not easy as we would need actual multipath devices that are kind of hard to setup on top of loop devices.import unittest import os from utils import create_sparse_tempfile from gi.repository import BlockDev if not BlockDev.is_initi...
<commit_before><commit_msg>Add tests for what we can easily test from the mpath plugin Testing mpath is generally not easy as we would need actual multipath devices that are kind of hard to setup on top of loop devices.<commit_after>import unittest import os from utils import create_sparse_tempfile from gi.repository...
bc7f9eba295cf1a3d9d8036ac1db993b6a37b58c
umibukela/models.py
umibukela/models.py
from django.db import models class Partner(models.Model): short_name = models.CharField(max_length=200) full_name = models.CharField(max_length=200) physical_address = models.CharField(max_length=200) contact_person = models.CharField(max_length=200) telephone = models.CharField(max_length=200) ...
Add very rough, potientially unusable model for field names
Add very rough, potientially unusable model for field names
Python
mit
Code4SA/umibukela,Code4SA/umibukela,Code4SA/umibukela,Code4SA/umibukela
Add very rough, potientially unusable model for field names
from django.db import models class Partner(models.Model): short_name = models.CharField(max_length=200) full_name = models.CharField(max_length=200) physical_address = models.CharField(max_length=200) contact_person = models.CharField(max_length=200) telephone = models.CharField(max_length=200) ...
<commit_before><commit_msg>Add very rough, potientially unusable model for field names<commit_after>
from django.db import models class Partner(models.Model): short_name = models.CharField(max_length=200) full_name = models.CharField(max_length=200) physical_address = models.CharField(max_length=200) contact_person = models.CharField(max_length=200) telephone = models.CharField(max_length=200) ...
Add very rough, potientially unusable model for field namesfrom django.db import models class Partner(models.Model): short_name = models.CharField(max_length=200) full_name = models.CharField(max_length=200) physical_address = models.CharField(max_length=200) contact_person = models.CharField(max_leng...
<commit_before><commit_msg>Add very rough, potientially unusable model for field names<commit_after>from django.db import models class Partner(models.Model): short_name = models.CharField(max_length=200) full_name = models.CharField(max_length=200) physical_address = models.CharField(max_length=200) c...
c434d182d2f6e0535314e8fcdbac01324bf9395b
tasks.py
tasks.py
from invoke import run, task @task def deploy(): print('So you want to deploy? Let\'s get started.') # Static Files. print('- Run the stylesheets through Compass using "Production" settings...') run('compass compile -e production --force -q') print('- Collecting the static files and throwing them...
Add our little deploy script to H!B.
Add our little deploy script to H!B.
Python
apache-2.0
hello-base/web,hello-base/web,hello-base/web,hello-base/web
Add our little deploy script to H!B.
from invoke import run, task @task def deploy(): print('So you want to deploy? Let\'s get started.') # Static Files. print('- Run the stylesheets through Compass using "Production" settings...') run('compass compile -e production --force -q') print('- Collecting the static files and throwing them...
<commit_before><commit_msg>Add our little deploy script to H!B.<commit_after>
from invoke import run, task @task def deploy(): print('So you want to deploy? Let\'s get started.') # Static Files. print('- Run the stylesheets through Compass using "Production" settings...') run('compass compile -e production --force -q') print('- Collecting the static files and throwing them...
Add our little deploy script to H!B.from invoke import run, task @task def deploy(): print('So you want to deploy? Let\'s get started.') # Static Files. print('- Run the stylesheets through Compass using "Production" settings...') run('compass compile -e production --force -q') print('- Collectin...
<commit_before><commit_msg>Add our little deploy script to H!B.<commit_after>from invoke import run, task @task def deploy(): print('So you want to deploy? Let\'s get started.') # Static Files. print('- Run the stylesheets through Compass using "Production" settings...') run('compass compile -e produc...
3f7b1ceb95b0f918f03d08e9b796c88d85764280
logicaldelete/managers.py
logicaldelete/managers.py
from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it provides named q...
from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it provides named q...
Use get_queryset instead of get_query_set
Use get_queryset instead of get_query_set Starting in Django 1.8, get_query_set will now be get_queryset. This change was announced as part of the Django 1.6 release and now in Django 1.7 throws a RemovedInDjango18Warning. See: https://docs.djangoproject.com/en/1.7/releases/1.6/#get-query-set-and-similar-methods-rena...
Python
mit
pinax/pinax-models,naringas/pinax-models,Ubiwhere/pinax-models
from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it provides named q...
from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it provides named q...
<commit_before>from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it p...
from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it provides named q...
from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it provides named q...
<commit_before>from django.db import models from logicaldelete.query import LogicalDeleteQuerySet class LogicalDeletedManager(models.Manager): """ A manager that serves as the default manager for `logicaldelete.models.Model` providing the filtering out of logically deleted objects. In addition, it p...
debc76258e35aaa9ebc1eaeb717b82d7bded2bb5
ceph_deploy/tests/test_cli_admin.py
ceph_deploy/tests/test_cli_admin.py
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'admin', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy admin' in result assert 'positional arguments' in result assert 'optional a...
Add CLI test for "ceph-deploy admin"
[RM-11694] Add CLI test for "ceph-deploy admin" Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>
Python
mit
Vicente-Cheng/ceph-deploy,SUSE/ceph-deploy,alfredodeza/ceph-deploy,ceph/ceph-deploy,isyippee/ceph-deploy,imzhulei/ceph-deploy,trhoden/ceph-deploy,isyippee/ceph-deploy,ghxandsky/ceph-deploy,Vicente-Cheng/ceph-deploy,zhouyuan/ceph-deploy,SUSE/ceph-deploy-to-be-deleted,ghxandsky/ceph-deploy,osynge/ceph-deploy,SUSE/ceph-de...
[RM-11694] Add CLI test for "ceph-deploy admin" Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'admin', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy admin' in result assert 'positional arguments' in result assert 'optional a...
<commit_before><commit_msg>[RM-11694] Add CLI test for "ceph-deploy admin" Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after>
import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'admin', '--help'], stdout=subprocess.PIPE, ) as p: result = p.stdout.read() assert 'usage: ceph-deploy admin' in result assert 'positional arguments' in result assert 'optional a...
[RM-11694] Add CLI test for "ceph-deploy admin" Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com>import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'admin', '--help'], stdout=subprocess.PIPE, ) as p: result =...
<commit_before><commit_msg>[RM-11694] Add CLI test for "ceph-deploy admin" Signed-off-by: Travis Rhoden <e5e44d6dbac12e32e01c3bb8b67940d8b42e225b@redhat.com><commit_after>import pytest import subprocess def test_help(tmpdir, cli): with cli( args=['ceph-deploy', 'admin', '--help'], stdout=subproce...
a79c484349e852551e84411125bd88978a2fe52b
makemigrations.py
makemigrations.py
#!/usr/bin/env python import os import sys import django from django.conf import settings DEFAULT_SETTINGS = dict( INSTALLED_APPS=[ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sites", "pinax.documents", "pinax.documents.tests" ], DATABASE...
Add a script to help manage migrations
Add a script to help manage migrations
Python
mit
pinax/pinax-documents
Add a script to help manage migrations
#!/usr/bin/env python import os import sys import django from django.conf import settings DEFAULT_SETTINGS = dict( INSTALLED_APPS=[ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sites", "pinax.documents", "pinax.documents.tests" ], DATABASE...
<commit_before><commit_msg>Add a script to help manage migrations<commit_after>
#!/usr/bin/env python import os import sys import django from django.conf import settings DEFAULT_SETTINGS = dict( INSTALLED_APPS=[ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sites", "pinax.documents", "pinax.documents.tests" ], DATABASE...
Add a script to help manage migrations#!/usr/bin/env python import os import sys import django from django.conf import settings DEFAULT_SETTINGS = dict( INSTALLED_APPS=[ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sites", "pinax.documents", "pina...
<commit_before><commit_msg>Add a script to help manage migrations<commit_after>#!/usr/bin/env python import os import sys import django from django.conf import settings DEFAULT_SETTINGS = dict( INSTALLED_APPS=[ "django.contrib.auth", "django.contrib.contenttypes", "django.contrib.sites",...
ee6da6e9004dd0ef38e1ab62fd39825efd3f9a92
program_synthesis/naps/pipelines/print_naps.py
program_synthesis/naps/pipelines/print_naps.py
""" Print several solutions from the NAPS dataset. """ from program_synthesis.naps.pipelines.read_naps import read_naps_dataset from program_synthesis.naps.uast import uast_pprint if __name__ == "__main__": for name, ds in zip(("trainA", "trainB", "test"), read_naps_dataset()): print("DATASET %s" % name)...
Add demo of how to print/view UAST
Add demo of how to print/view UAST
Python
apache-2.0
nearai/program_synthesis,nearai/program_synthesis
Add demo of how to print/view UAST
""" Print several solutions from the NAPS dataset. """ from program_synthesis.naps.pipelines.read_naps import read_naps_dataset from program_synthesis.naps.uast import uast_pprint if __name__ == "__main__": for name, ds in zip(("trainA", "trainB", "test"), read_naps_dataset()): print("DATASET %s" % name)...
<commit_before><commit_msg>Add demo of how to print/view UAST<commit_after>
""" Print several solutions from the NAPS dataset. """ from program_synthesis.naps.pipelines.read_naps import read_naps_dataset from program_synthesis.naps.uast import uast_pprint if __name__ == "__main__": for name, ds in zip(("trainA", "trainB", "test"), read_naps_dataset()): print("DATASET %s" % name)...
Add demo of how to print/view UAST""" Print several solutions from the NAPS dataset. """ from program_synthesis.naps.pipelines.read_naps import read_naps_dataset from program_synthesis.naps.uast import uast_pprint if __name__ == "__main__": for name, ds in zip(("trainA", "trainB", "test"), read_naps_dataset()): ...
<commit_before><commit_msg>Add demo of how to print/view UAST<commit_after>""" Print several solutions from the NAPS dataset. """ from program_synthesis.naps.pipelines.read_naps import read_naps_dataset from program_synthesis.naps.uast import uast_pprint if __name__ == "__main__": for name, ds in zip(("trainA", ...
9a6ad07049dc4bfdb2677f7a503851a193ee454d
iteration_schemes.py
iteration_schemes.py
# -*- coding: utf-8 -*- """ Created on Tue Jan 10 14:51:07 2017 @author: sakurai """ import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from fuel.schemes import BatchSizeScheme, ShuffledScheme class NPairLossScheme(BatchSizeScheme): def __init__(self, labels, batch...
Implement an iteration scheme for N-pair-mc-loss
Implement an iteration scheme for N-pair-mc-loss
Python
mit
ronekko/deep_metric_learning
Implement an iteration scheme for N-pair-mc-loss
# -*- coding: utf-8 -*- """ Created on Tue Jan 10 14:51:07 2017 @author: sakurai """ import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from fuel.schemes import BatchSizeScheme, ShuffledScheme class NPairLossScheme(BatchSizeScheme): def __init__(self, labels, batch...
<commit_before><commit_msg>Implement an iteration scheme for N-pair-mc-loss<commit_after>
# -*- coding: utf-8 -*- """ Created on Tue Jan 10 14:51:07 2017 @author: sakurai """ import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from fuel.schemes import BatchSizeScheme, ShuffledScheme class NPairLossScheme(BatchSizeScheme): def __init__(self, labels, batch...
Implement an iteration scheme for N-pair-mc-loss# -*- coding: utf-8 -*- """ Created on Tue Jan 10 14:51:07 2017 @author: sakurai """ import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from fuel.schemes import BatchSizeScheme, ShuffledScheme class NPairLossScheme(BatchS...
<commit_before><commit_msg>Implement an iteration scheme for N-pair-mc-loss<commit_after># -*- coding: utf-8 -*- """ Created on Tue Jan 10 14:51:07 2017 @author: sakurai """ import numpy as np import matplotlib.pyplot as plt from sklearn.preprocessing import LabelEncoder from fuel.schemes import BatchSizeScheme, Shuf...
06166ca6e48831510525bbffe14a9c84b3bfd098
randomDistributionTest.py
randomDistributionTest.py
import random import sys testSizes = [ 5, 13, 23, 37, 47, 61, 111 ] usernameList = map(lambda u: u[0:-1], sys.stdin.readlines()) userrand = random.Random() for numElements in testSizes: summary = dict() for i in range(numElements): summary[i] = 0 for username in usernameList: userrand.seed(use...
Check the spread of the sampled nodes given keys as input
Check the spread of the sampled nodes given keys as input
Python
mit
danianr/NINJa,danianr/NINJa,danianr/NINJa
Check the spread of the sampled nodes given keys as input
import random import sys testSizes = [ 5, 13, 23, 37, 47, 61, 111 ] usernameList = map(lambda u: u[0:-1], sys.stdin.readlines()) userrand = random.Random() for numElements in testSizes: summary = dict() for i in range(numElements): summary[i] = 0 for username in usernameList: userrand.seed(use...
<commit_before><commit_msg>Check the spread of the sampled nodes given keys as input<commit_after>
import random import sys testSizes = [ 5, 13, 23, 37, 47, 61, 111 ] usernameList = map(lambda u: u[0:-1], sys.stdin.readlines()) userrand = random.Random() for numElements in testSizes: summary = dict() for i in range(numElements): summary[i] = 0 for username in usernameList: userrand.seed(use...
Check the spread of the sampled nodes given keys as inputimport random import sys testSizes = [ 5, 13, 23, 37, 47, 61, 111 ] usernameList = map(lambda u: u[0:-1], sys.stdin.readlines()) userrand = random.Random() for numElements in testSizes: summary = dict() for i in range(numElements): summary[i] = 0 ...
<commit_before><commit_msg>Check the spread of the sampled nodes given keys as input<commit_after>import random import sys testSizes = [ 5, 13, 23, 37, 47, 61, 111 ] usernameList = map(lambda u: u[0:-1], sys.stdin.readlines()) userrand = random.Random() for numElements in testSizes: summary = dict() for i in ...
93faafef2686802743dd6b58ca7bbbe53672cf9f
py/shortest-unsorted-continuous-subarray.py
py/shortest-unsorted-continuous-subarray.py
class Solution(object): def findUnsortedSubarray(self, nums): """ :type nums: List[int] :rtype: int """ stackl, stackr = [], [] stopl, stopr = False, False for i, n in enumerate(nums): if not stackl or stackl[-1] <= n: if not stopl:...
Add py solution for 581. Shortest Unsorted Continuous Subarray
Add py solution for 581. Shortest Unsorted Continuous Subarray 581. Shortest Unsorted Continuous Subarray: https://leetcode.com/problems/shortest-unsorted-continuous-subarray/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 581. Shortest Unsorted Continuous Subarray 581. Shortest Unsorted Continuous Subarray: https://leetcode.com/problems/shortest-unsorted-continuous-subarray/
class Solution(object): def findUnsortedSubarray(self, nums): """ :type nums: List[int] :rtype: int """ stackl, stackr = [], [] stopl, stopr = False, False for i, n in enumerate(nums): if not stackl or stackl[-1] <= n: if not stopl:...
<commit_before><commit_msg>Add py solution for 581. Shortest Unsorted Continuous Subarray 581. Shortest Unsorted Continuous Subarray: https://leetcode.com/problems/shortest-unsorted-continuous-subarray/<commit_after>
class Solution(object): def findUnsortedSubarray(self, nums): """ :type nums: List[int] :rtype: int """ stackl, stackr = [], [] stopl, stopr = False, False for i, n in enumerate(nums): if not stackl or stackl[-1] <= n: if not stopl:...
Add py solution for 581. Shortest Unsorted Continuous Subarray 581. Shortest Unsorted Continuous Subarray: https://leetcode.com/problems/shortest-unsorted-continuous-subarray/class Solution(object): def findUnsortedSubarray(self, nums): """ :type nums: List[int] :rtype: int """ ...
<commit_before><commit_msg>Add py solution for 581. Shortest Unsorted Continuous Subarray 581. Shortest Unsorted Continuous Subarray: https://leetcode.com/problems/shortest-unsorted-continuous-subarray/<commit_after>class Solution(object): def findUnsortedSubarray(self, nums): """ :type nums: List[...
671cb655ce975931bb15bf17f1feffe5b89c9a75
bd_rate_jm.py
bd_rate_jm.py
#!/usr/bin/env python3 from numpy import * from scipy import * from scipy.interpolate import interp1d import sys a = loadtxt(sys.argv[1]); b = loadtxt(sys.argv[2]); rates = [0.005,0.02,0.06,0.2]; ra = a[:,2]*8./a[:,1] rb = b[:,2]*8./b[:,1]; interp_type = 'cubic'; met_name = [' PSNR', ' PSNRHVS', ' SSIM', 'FASTS...
Add Python implementation of bd_rate.
Add Python implementation of bd_rate.
Python
mit
tdaede/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy,tdaede/awcy
Add Python implementation of bd_rate.
#!/usr/bin/env python3 from numpy import * from scipy import * from scipy.interpolate import interp1d import sys a = loadtxt(sys.argv[1]); b = loadtxt(sys.argv[2]); rates = [0.005,0.02,0.06,0.2]; ra = a[:,2]*8./a[:,1] rb = b[:,2]*8./b[:,1]; interp_type = 'cubic'; met_name = [' PSNR', ' PSNRHVS', ' SSIM', 'FASTS...
<commit_before><commit_msg>Add Python implementation of bd_rate.<commit_after>
#!/usr/bin/env python3 from numpy import * from scipy import * from scipy.interpolate import interp1d import sys a = loadtxt(sys.argv[1]); b = loadtxt(sys.argv[2]); rates = [0.005,0.02,0.06,0.2]; ra = a[:,2]*8./a[:,1] rb = b[:,2]*8./b[:,1]; interp_type = 'cubic'; met_name = [' PSNR', ' PSNRHVS', ' SSIM', 'FASTS...
Add Python implementation of bd_rate.#!/usr/bin/env python3 from numpy import * from scipy import * from scipy.interpolate import interp1d import sys a = loadtxt(sys.argv[1]); b = loadtxt(sys.argv[2]); rates = [0.005,0.02,0.06,0.2]; ra = a[:,2]*8./a[:,1] rb = b[:,2]*8./b[:,1]; interp_type = 'cubic'; met_name = [' ...
<commit_before><commit_msg>Add Python implementation of bd_rate.<commit_after>#!/usr/bin/env python3 from numpy import * from scipy import * from scipy.interpolate import interp1d import sys a = loadtxt(sys.argv[1]); b = loadtxt(sys.argv[2]); rates = [0.005,0.02,0.06,0.2]; ra = a[:,2]*8./a[:,1] rb = b[:,2]*8./b[:,1];...
4d5d931c03d742588454e53ee7a579fce400edca
tests/test_units/test_route_escapes.py
tests/test_units/test_route_escapes.py
import unittest from routes.route import Route class TestRouteEscape(unittest.TestCase): def test_normal_route(self): r = Route('test', '/foo/bar') self.assertEqual(r.routelist, ['/foo/bar']) def test_route_with_backslash(self): r = Route('test', '/foo\\\\bar') self.a...
Add tests for backslash escapes in route paths
Add tests for backslash escapes in route paths
Python
mit
webknjaz/routes,bbangert/routes
Add tests for backslash escapes in route paths
import unittest from routes.route import Route class TestRouteEscape(unittest.TestCase): def test_normal_route(self): r = Route('test', '/foo/bar') self.assertEqual(r.routelist, ['/foo/bar']) def test_route_with_backslash(self): r = Route('test', '/foo\\\\bar') self.a...
<commit_before><commit_msg>Add tests for backslash escapes in route paths<commit_after>
import unittest from routes.route import Route class TestRouteEscape(unittest.TestCase): def test_normal_route(self): r = Route('test', '/foo/bar') self.assertEqual(r.routelist, ['/foo/bar']) def test_route_with_backslash(self): r = Route('test', '/foo\\\\bar') self.a...
Add tests for backslash escapes in route pathsimport unittest from routes.route import Route class TestRouteEscape(unittest.TestCase): def test_normal_route(self): r = Route('test', '/foo/bar') self.assertEqual(r.routelist, ['/foo/bar']) def test_route_with_backslash(self): r ...
<commit_before><commit_msg>Add tests for backslash escapes in route paths<commit_after>import unittest from routes.route import Route class TestRouteEscape(unittest.TestCase): def test_normal_route(self): r = Route('test', '/foo/bar') self.assertEqual(r.routelist, ['/foo/bar']) def tes...
f1f8a455b71980ec3df83db3ff1d9175f0c3d900
openpathsampling/visit_all_states.py
openpathsampling/visit_all_states.py
import openpathsampling as paths def default_state_progress_report(n_steps, found_states, all_states, timestep=None): report_str = "Ran {n_steps} steps " if timestep is not None: report_str += "[{traj_time}]".format(str(n_steps * timestep)) report_str += (". Found ...
Add start to visit all states ensemble
Add start to visit all states ensemble
Python
mit
dwhswenson/openpathsampling,choderalab/openpathsampling,dwhswenson/openpathsampling,choderalab/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openpathsampling,choderalab/openpathsampling,openpathsampling/openpathsampling,dwhswenson/openpathsampling,openpathsampling/openpathsampling,openpathsampling/openp...
Add start to visit all states ensemble
import openpathsampling as paths def default_state_progress_report(n_steps, found_states, all_states, timestep=None): report_str = "Ran {n_steps} steps " if timestep is not None: report_str += "[{traj_time}]".format(str(n_steps * timestep)) report_str += (". Found ...
<commit_before><commit_msg>Add start to visit all states ensemble<commit_after>
import openpathsampling as paths def default_state_progress_report(n_steps, found_states, all_states, timestep=None): report_str = "Ran {n_steps} steps " if timestep is not None: report_str += "[{traj_time}]".format(str(n_steps * timestep)) report_str += (". Found ...
Add start to visit all states ensembleimport openpathsampling as paths def default_state_progress_report(n_steps, found_states, all_states, timestep=None): report_str = "Ran {n_steps} steps " if timestep is not None: report_str += "[{traj_time}]".format(str(n_steps * t...
<commit_before><commit_msg>Add start to visit all states ensemble<commit_after>import openpathsampling as paths def default_state_progress_report(n_steps, found_states, all_states, timestep=None): report_str = "Ran {n_steps} steps " if timestep is not None: report_str ...
14926079ea76bbeba718d4ce59e944fa40a7581f
prepopulate-boundaries.py
prepopulate-boundaries.py
#!/usr/bin/env python from osgeo import ogr from osgeo import osr from glob import glob import os import os.path import re import shutil shutil.rmtree('boundaries', True) os.mkdir('boundaries') t_srs = osr.SpatialReference() t_srs.ImportFromEPSG(26915) def get_zips(): for fn in glob('counties/*.txt'): fo...
Create a python script to create initial boundaries faster
Create a python script to create initial boundaries faster It also makes the boundaries in the EPSG:26915 SRS
Python
mit
simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic,simonsonc/mn-glo-mosaic
Create a python script to create initial boundaries faster It also makes the boundaries in the EPSG:26915 SRS
#!/usr/bin/env python from osgeo import ogr from osgeo import osr from glob import glob import os import os.path import re import shutil shutil.rmtree('boundaries', True) os.mkdir('boundaries') t_srs = osr.SpatialReference() t_srs.ImportFromEPSG(26915) def get_zips(): for fn in glob('counties/*.txt'): fo...
<commit_before><commit_msg>Create a python script to create initial boundaries faster It also makes the boundaries in the EPSG:26915 SRS<commit_after>
#!/usr/bin/env python from osgeo import ogr from osgeo import osr from glob import glob import os import os.path import re import shutil shutil.rmtree('boundaries', True) os.mkdir('boundaries') t_srs = osr.SpatialReference() t_srs.ImportFromEPSG(26915) def get_zips(): for fn in glob('counties/*.txt'): fo...
Create a python script to create initial boundaries faster It also makes the boundaries in the EPSG:26915 SRS#!/usr/bin/env python from osgeo import ogr from osgeo import osr from glob import glob import os import os.path import re import shutil shutil.rmtree('boundaries', True) os.mkdir('boundaries') t_srs = osr.Sp...
<commit_before><commit_msg>Create a python script to create initial boundaries faster It also makes the boundaries in the EPSG:26915 SRS<commit_after>#!/usr/bin/env python from osgeo import ogr from osgeo import osr from glob import glob import os import os.path import re import shutil shutil.rmtree('boundaries', Tru...
0051c05964220ef8e80bddda2a1010a088aa60c7
spacy/tests/serialize/test_serialize_parser.py
spacy/tests/serialize/test_serialize_parser.py
# coding: utf-8 from __future__ import unicode_literals from ..util import make_tempdir from ...pipeline import NeuralDependencyParser as Parser import pytest def test_serialize_parser_roundtrip_bytes(en_vocab): parser = Parser(en_vocab) parser.model, _ = parser.Model(0) parser_b = parser.to_bytes() ...
Add tests for serializing parser
Add tests for serializing parser
Python
mit
explosion/spaCy,spacy-io/spaCy,aikramer2/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,recognai/spaCy,recognai/spaCy,aikramer2/spaCy,aikramer2/spaCy,recognai/spaCy,explosion/spaCy,recognai/spaCy,honnibal/spaCy,honnibal/spaCy,explosion/spaCy,aikramer2/spaCy,honnibal/spaCy,recognai/sp...
Add tests for serializing parser
# coding: utf-8 from __future__ import unicode_literals from ..util import make_tempdir from ...pipeline import NeuralDependencyParser as Parser import pytest def test_serialize_parser_roundtrip_bytes(en_vocab): parser = Parser(en_vocab) parser.model, _ = parser.Model(0) parser_b = parser.to_bytes() ...
<commit_before><commit_msg>Add tests for serializing parser<commit_after>
# coding: utf-8 from __future__ import unicode_literals from ..util import make_tempdir from ...pipeline import NeuralDependencyParser as Parser import pytest def test_serialize_parser_roundtrip_bytes(en_vocab): parser = Parser(en_vocab) parser.model, _ = parser.Model(0) parser_b = parser.to_bytes() ...
Add tests for serializing parser# coding: utf-8 from __future__ import unicode_literals from ..util import make_tempdir from ...pipeline import NeuralDependencyParser as Parser import pytest def test_serialize_parser_roundtrip_bytes(en_vocab): parser = Parser(en_vocab) parser.model, _ = parser.Model(0) ...
<commit_before><commit_msg>Add tests for serializing parser<commit_after># coding: utf-8 from __future__ import unicode_literals from ..util import make_tempdir from ...pipeline import NeuralDependencyParser as Parser import pytest def test_serialize_parser_roundtrip_bytes(en_vocab): parser = Parser(en_vocab) ...
e5007a5729fdf6cdd743b247cb0ab65613f90656
bumblebee_status/modules/contrib/optman.py
bumblebee_status/modules/contrib/optman.py
"""Displays currently active gpu by optimus-manager Requires the following packages: * optimus-manager """ import subprocess import core.module import core.widget class Module(core.module.Module): def __init__(self, config, theme): super().__init__(config, theme, core.widget.Widget(self.output)) ...
Add active gpu module using optimus-manager
Add active gpu module using optimus-manager
Python
mit
tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status
Add active gpu module using optimus-manager
"""Displays currently active gpu by optimus-manager Requires the following packages: * optimus-manager """ import subprocess import core.module import core.widget class Module(core.module.Module): def __init__(self, config, theme): super().__init__(config, theme, core.widget.Widget(self.output)) ...
<commit_before><commit_msg>Add active gpu module using optimus-manager<commit_after>
"""Displays currently active gpu by optimus-manager Requires the following packages: * optimus-manager """ import subprocess import core.module import core.widget class Module(core.module.Module): def __init__(self, config, theme): super().__init__(config, theme, core.widget.Widget(self.output)) ...
Add active gpu module using optimus-manager"""Displays currently active gpu by optimus-manager Requires the following packages: * optimus-manager """ import subprocess import core.module import core.widget class Module(core.module.Module): def __init__(self, config, theme): super().__init__(config...
<commit_before><commit_msg>Add active gpu module using optimus-manager<commit_after>"""Displays currently active gpu by optimus-manager Requires the following packages: * optimus-manager """ import subprocess import core.module import core.widget class Module(core.module.Module): def __init__(self, config...
78d19287bd1e560ae063d2971e393df54b87f93d
py/number-complement.py
py/number-complement.py
class Solution(object): def findComplement(self, num): """ :type num: int :rtype: int """ n = num n |= (n >> 1) n |= (n >> 2) n |= (n >> 4) n |= (n >> 8) n |= (n >> 16) return n ^ num
Add py solution for 476. Number Complement
Add py solution for 476. Number Complement 476. Number Complement: https://leetcode.com/problems/number-complement/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 476. Number Complement 476. Number Complement: https://leetcode.com/problems/number-complement/
class Solution(object): def findComplement(self, num): """ :type num: int :rtype: int """ n = num n |= (n >> 1) n |= (n >> 2) n |= (n >> 4) n |= (n >> 8) n |= (n >> 16) return n ^ num
<commit_before><commit_msg>Add py solution for 476. Number Complement 476. Number Complement: https://leetcode.com/problems/number-complement/<commit_after>
class Solution(object): def findComplement(self, num): """ :type num: int :rtype: int """ n = num n |= (n >> 1) n |= (n >> 2) n |= (n >> 4) n |= (n >> 8) n |= (n >> 16) return n ^ num
Add py solution for 476. Number Complement 476. Number Complement: https://leetcode.com/problems/number-complement/class Solution(object): def findComplement(self, num): """ :type num: int :rtype: int """ n = num n |= (n >> 1) n |= (n >> 2) n |= (n ...
<commit_before><commit_msg>Add py solution for 476. Number Complement 476. Number Complement: https://leetcode.com/problems/number-complement/<commit_after>class Solution(object): def findComplement(self, num): """ :type num: int :rtype: int """ n = num n |= (n >> 1...
42b651bd1a3d6994c6eb727ff8cc66e5699d9cd2
sahgutils/spatialtools.py
sahgutils/spatialtools.py
"""A collection of tools for spatial data and GIS tasks. """ def point_in_poly(pnt, poly): """Calculate whether a point lies inside a polygon Algorithm is based on the ray-tracing procedure described at http://geospatialpython.com/2011/01/point-in-polygon.html Parameters ---------- pnt : seq...
Add a point in polygon routine
ENH: Add a point in polygon routine
Python
bsd-3-clause
sahg/SAHGutils
ENH: Add a point in polygon routine
"""A collection of tools for spatial data and GIS tasks. """ def point_in_poly(pnt, poly): """Calculate whether a point lies inside a polygon Algorithm is based on the ray-tracing procedure described at http://geospatialpython.com/2011/01/point-in-polygon.html Parameters ---------- pnt : seq...
<commit_before><commit_msg>ENH: Add a point in polygon routine<commit_after>
"""A collection of tools for spatial data and GIS tasks. """ def point_in_poly(pnt, poly): """Calculate whether a point lies inside a polygon Algorithm is based on the ray-tracing procedure described at http://geospatialpython.com/2011/01/point-in-polygon.html Parameters ---------- pnt : seq...
ENH: Add a point in polygon routine"""A collection of tools for spatial data and GIS tasks. """ def point_in_poly(pnt, poly): """Calculate whether a point lies inside a polygon Algorithm is based on the ray-tracing procedure described at http://geospatialpython.com/2011/01/point-in-polygon.html Para...
<commit_before><commit_msg>ENH: Add a point in polygon routine<commit_after>"""A collection of tools for spatial data and GIS tasks. """ def point_in_poly(pnt, poly): """Calculate whether a point lies inside a polygon Algorithm is based on the ray-tracing procedure described at http://geospatialpython.co...
dc5d1341031e642ccf1b586dd2e81e6e99e76e0d
scripts/setup-tracing-for-project.py
scripts/setup-tracing-for-project.py
#!/usr/bin/python # This is a small helper script to add the required database entries # to enable tracing of a particular project with treelines, # connectors, etc. This should really be done in a larger project # creation script. # You may need to install psycopg2, e.g. with: # sudo apt-get install python-psycop...
Add a helper script to add the required db entries to enable tracing for a project
Add a helper script to add the required db entries to enable tracing for a project
Python
agpl-3.0
fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID,htem/CATMAID,htem/CATMAID,fzadow/CATMAID,fzadow/CATMAID,htem/CATMAID
Add a helper script to add the required db entries to enable tracing for a project
#!/usr/bin/python # This is a small helper script to add the required database entries # to enable tracing of a particular project with treelines, # connectors, etc. This should really be done in a larger project # creation script. # You may need to install psycopg2, e.g. with: # sudo apt-get install python-psycop...
<commit_before><commit_msg>Add a helper script to add the required db entries to enable tracing for a project<commit_after>
#!/usr/bin/python # This is a small helper script to add the required database entries # to enable tracing of a particular project with treelines, # connectors, etc. This should really be done in a larger project # creation script. # You may need to install psycopg2, e.g. with: # sudo apt-get install python-psycop...
Add a helper script to add the required db entries to enable tracing for a project#!/usr/bin/python # This is a small helper script to add the required database entries # to enable tracing of a particular project with treelines, # connectors, etc. This should really be done in a larger project # creation script. # Y...
<commit_before><commit_msg>Add a helper script to add the required db entries to enable tracing for a project<commit_after>#!/usr/bin/python # This is a small helper script to add the required database entries # to enable tracing of a particular project with treelines, # connectors, etc. This should really be done in...
a468de144929b7d5633dd0738e9eaf5940d1b6c7
other/unterm-generator.py
other/unterm-generator.py
"""Demonstrated an error garbage collecting an h5py object at Python shutdown https://github.com/h5py/h5py/issues/1495 """ import h5py def yield_groups(filename): with h5py.File(filename, 'r') as fh: for group in fh: yield group filename = "file_with_10_groups.hdf5" grp_generator = yield_gro...
Add script demonstrating issue gh-1495
Add script demonstrating issue gh-1495
Python
bsd-3-clause
h5py/h5py,h5py/h5py,h5py/h5py
Add script demonstrating issue gh-1495
"""Demonstrated an error garbage collecting an h5py object at Python shutdown https://github.com/h5py/h5py/issues/1495 """ import h5py def yield_groups(filename): with h5py.File(filename, 'r') as fh: for group in fh: yield group filename = "file_with_10_groups.hdf5" grp_generator = yield_gro...
<commit_before><commit_msg>Add script demonstrating issue gh-1495<commit_after>
"""Demonstrated an error garbage collecting an h5py object at Python shutdown https://github.com/h5py/h5py/issues/1495 """ import h5py def yield_groups(filename): with h5py.File(filename, 'r') as fh: for group in fh: yield group filename = "file_with_10_groups.hdf5" grp_generator = yield_gro...
Add script demonstrating issue gh-1495"""Demonstrated an error garbage collecting an h5py object at Python shutdown https://github.com/h5py/h5py/issues/1495 """ import h5py def yield_groups(filename): with h5py.File(filename, 'r') as fh: for group in fh: yield group filename = "file_with_10_...
<commit_before><commit_msg>Add script demonstrating issue gh-1495<commit_after>"""Demonstrated an error garbage collecting an h5py object at Python shutdown https://github.com/h5py/h5py/issues/1495 """ import h5py def yield_groups(filename): with h5py.File(filename, 'r') as fh: for group in fh: ...
f35b1282eba2d305d18c5b041518cdecd86dab59
tests/test_views.py
tests/test_views.py
""" Tests for the frontend. """ import unittest import ga4gh.server as server import ga4gh.cli class TestFrontend(unittest.TestCase): def setUp(self): self.app = server.app.test_client() def testServer(self): self.assertTrue('404' in self.app.get('/').data) # TODO: Fill in actual test ...
Add a small unit test for the frontend.
Add a small unit test for the frontend.
Python
apache-2.0
dcolligan/server,hjellinek/server,hjellinek/server,ekalosak/server,ohsu-computational-biology/server,ekalosak/server,srblum/server,pcingola/server,adamnovak/server,ga4gh/server,adamnovak/server,shajoezhu/server,shajoezhu/server,srblum/hackathon-server,pcingola/server,diekhans/ga4gh-server,saupchurch/server,saupchurch/s...
Add a small unit test for the frontend.
""" Tests for the frontend. """ import unittest import ga4gh.server as server import ga4gh.cli class TestFrontend(unittest.TestCase): def setUp(self): self.app = server.app.test_client() def testServer(self): self.assertTrue('404' in self.app.get('/').data) # TODO: Fill in actual test ...
<commit_before><commit_msg>Add a small unit test for the frontend.<commit_after>
""" Tests for the frontend. """ import unittest import ga4gh.server as server import ga4gh.cli class TestFrontend(unittest.TestCase): def setUp(self): self.app = server.app.test_client() def testServer(self): self.assertTrue('404' in self.app.get('/').data) # TODO: Fill in actual test ...
Add a small unit test for the frontend.""" Tests for the frontend. """ import unittest import ga4gh.server as server import ga4gh.cli class TestFrontend(unittest.TestCase): def setUp(self): self.app = server.app.test_client() def testServer(self): self.assertTrue('404' in self.app.get('/')....
<commit_before><commit_msg>Add a small unit test for the frontend.<commit_after>""" Tests for the frontend. """ import unittest import ga4gh.server as server import ga4gh.cli class TestFrontend(unittest.TestCase): def setUp(self): self.app = server.app.test_client() def testServer(self): se...
05648421c1fa77f6f339f68be2c43bb7952e918a
pymatgen/__init__.py
pymatgen/__init__.py
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Arm...
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Arm...
Remove zopen in pymatgen root.
Remove zopen in pymatgen root.
Python
mit
sonium0/pymatgen,rousseab/pymatgen,rousseab/pymatgen,yanikou19/pymatgen,Bismarrck/pymatgen,ctoher/pymatgen,yanikou19/pymatgen,yanikou19/pymatgen,Bismarrck/pymatgen,Bismarrck/pymatgen,migueldiascosta/pymatgen,sonium0/pymatgen,ctoher/pymatgen,Dioptas/pymatgen,sonium0/pymatgen,migueldiascosta/pymatgen,Bismarrck/pymatgen,B...
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Arm...
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Arm...
<commit_before>__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", ...
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Arm...
__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", "Rickard Arm...
<commit_before>__author__ = ", ".join(["Shyue Ping Ong", "Anubhav Jain", "Geoffroy Hautier", "William Davidson Richard", "Stephen Dacek", "Sai Jayaraman", "Michael Kocher", "Dan Gunter", "Shreyas Cholia", "Vincent L Chevrier", ...
aad87fe5e924de73eea7b1a34ea9412d2cc0705d
scripts/simple_blend.py
scripts/simple_blend.py
import numpy as np import os import sys sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) from utils.data_paths import SUBMISSIONS_DIR_PATH OUTPUT_FILE_PATH = os.path.join(SUBMISSIONS_DIR_PATH, 'simple_blend.dta') PREDICTION_FILE_PATHS = [os.path.join(SUBMISSIONS_DIR_PATH, 'predictions1.dt...
Add simplest blending script to apply fixed weights
Add simplest blending script to apply fixed weights
Python
mit
jvanbrug/netflix,jvanbrug/netflix
Add simplest blending script to apply fixed weights
import numpy as np import os import sys sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) from utils.data_paths import SUBMISSIONS_DIR_PATH OUTPUT_FILE_PATH = os.path.join(SUBMISSIONS_DIR_PATH, 'simple_blend.dta') PREDICTION_FILE_PATHS = [os.path.join(SUBMISSIONS_DIR_PATH, 'predictions1.dt...
<commit_before><commit_msg>Add simplest blending script to apply fixed weights<commit_after>
import numpy as np import os import sys sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) from utils.data_paths import SUBMISSIONS_DIR_PATH OUTPUT_FILE_PATH = os.path.join(SUBMISSIONS_DIR_PATH, 'simple_blend.dta') PREDICTION_FILE_PATHS = [os.path.join(SUBMISSIONS_DIR_PATH, 'predictions1.dt...
Add simplest blending script to apply fixed weightsimport numpy as np import os import sys sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) from utils.data_paths import SUBMISSIONS_DIR_PATH OUTPUT_FILE_PATH = os.path.join(SUBMISSIONS_DIR_PATH, 'simple_blend.dta') PREDICTION_FILE_PATHS = [...
<commit_before><commit_msg>Add simplest blending script to apply fixed weights<commit_after>import numpy as np import os import sys sys.path.append(os.path.abspath(os.path.dirname(os.path.dirname(__file__)))) from utils.data_paths import SUBMISSIONS_DIR_PATH OUTPUT_FILE_PATH = os.path.join(SUBMISSIONS_DIR_PATH, 'sim...
6810fdd7156b9839acee7a27aae57041850603e0
examples/fosdem_2015/power.py
examples/fosdem_2015/power.py
from zeroservices import ZeroMQMedium, ResourceService from zeroservices.backend.mongodb import MongoDBCollection class PowerCollection(MongoDBCollection): def __init__(self, *args, **kwargs): super(PowerCollection, self).__init__(*args, **kwargs) self.collection.ensure_index([('description', 'te...
Add missing file in fosdem 2015 example
Add missing file in fosdem 2015 example
Python
mit
Lothiraldan/ZeroServices
Add missing file in fosdem 2015 example
from zeroservices import ZeroMQMedium, ResourceService from zeroservices.backend.mongodb import MongoDBCollection class PowerCollection(MongoDBCollection): def __init__(self, *args, **kwargs): super(PowerCollection, self).__init__(*args, **kwargs) self.collection.ensure_index([('description', 'te...
<commit_before><commit_msg>Add missing file in fosdem 2015 example<commit_after>
from zeroservices import ZeroMQMedium, ResourceService from zeroservices.backend.mongodb import MongoDBCollection class PowerCollection(MongoDBCollection): def __init__(self, *args, **kwargs): super(PowerCollection, self).__init__(*args, **kwargs) self.collection.ensure_index([('description', 'te...
Add missing file in fosdem 2015 examplefrom zeroservices import ZeroMQMedium, ResourceService from zeroservices.backend.mongodb import MongoDBCollection class PowerCollection(MongoDBCollection): def __init__(self, *args, **kwargs): super(PowerCollection, self).__init__(*args, **kwargs) self.colle...
<commit_before><commit_msg>Add missing file in fosdem 2015 example<commit_after>from zeroservices import ZeroMQMedium, ResourceService from zeroservices.backend.mongodb import MongoDBCollection class PowerCollection(MongoDBCollection): def __init__(self, *args, **kwargs): super(PowerCollection, self).__i...
72f484c35a79d7be6dc04e7ac108b05652bc1f36
readthedocs/core/tasks.py
readthedocs/core/tasks.py
"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) @task(queue='web') def send_email_task(recipient, subject, template, template_html, contex...
"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) EMAIL_TIME_LIMIT = 30 @task(queue='web', time_limit=EMAIL_TIME_LIMIT) def send_email_task...
Add timeout to email task
Add timeout to email task Email task needs a timeout, as there were some cases where celery caused the task to hang.
Python
mit
safwanrahman/readthedocs.org,pombredanne/readthedocs.org,rtfd/readthedocs.org,pombredanne/readthedocs.org,tddv/readthedocs.org,safwanrahman/readthedocs.org,tddv/readthedocs.org,davidfischer/readthedocs.org,davidfischer/readthedocs.org,rtfd/readthedocs.org,rtfd/readthedocs.org,pombredanne/readthedocs.org,davidfischer/re...
"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) @task(queue='web') def send_email_task(recipient, subject, template, template_html, contex...
"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) EMAIL_TIME_LIMIT = 30 @task(queue='web', time_limit=EMAIL_TIME_LIMIT) def send_email_task...
<commit_before>"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) @task(queue='web') def send_email_task(recipient, subject, template, templa...
"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) EMAIL_TIME_LIMIT = 30 @task(queue='web', time_limit=EMAIL_TIME_LIMIT) def send_email_task...
"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) @task(queue='web') def send_email_task(recipient, subject, template, template_html, contex...
<commit_before>"""Basic tasks""" import logging from celery import task from django.conf import settings from django.core.mail import EmailMultiAlternatives from django.template.loader import get_template log = logging.getLogger(__name__) @task(queue='web') def send_email_task(recipient, subject, template, templa...
00ff016a7f45784a786c0bbebfe31a64291e9bbd
logistic_regression/logistic_regression.py
logistic_regression/logistic_regression.py
#!/usr/bin/env python import numpy as np def sigmoid(x): return 1.0 / (1 + np.exp(-x)) def test_sigmoid(): x = 0 print("Input x: {}, the sigmoid value is: {}".format(x, sigmoid(x))) def main(): # Prepare dataset train_features = np.array([[1, 0, 26], [0, 1, 25]], dtype=np.float) train_labels = np.arr...
Add logistic regression without batch
Add logistic regression without batch
Python
mit
tobegit3hub/ml_implementation,erwin00776/copy_ml_implements
Add logistic regression without batch
#!/usr/bin/env python import numpy as np def sigmoid(x): return 1.0 / (1 + np.exp(-x)) def test_sigmoid(): x = 0 print("Input x: {}, the sigmoid value is: {}".format(x, sigmoid(x))) def main(): # Prepare dataset train_features = np.array([[1, 0, 26], [0, 1, 25]], dtype=np.float) train_labels = np.arr...
<commit_before><commit_msg>Add logistic regression without batch<commit_after>
#!/usr/bin/env python import numpy as np def sigmoid(x): return 1.0 / (1 + np.exp(-x)) def test_sigmoid(): x = 0 print("Input x: {}, the sigmoid value is: {}".format(x, sigmoid(x))) def main(): # Prepare dataset train_features = np.array([[1, 0, 26], [0, 1, 25]], dtype=np.float) train_labels = np.arr...
Add logistic regression without batch#!/usr/bin/env python import numpy as np def sigmoid(x): return 1.0 / (1 + np.exp(-x)) def test_sigmoid(): x = 0 print("Input x: {}, the sigmoid value is: {}".format(x, sigmoid(x))) def main(): # Prepare dataset train_features = np.array([[1, 0, 26], [0, 1, 25]], dt...
<commit_before><commit_msg>Add logistic regression without batch<commit_after>#!/usr/bin/env python import numpy as np def sigmoid(x): return 1.0 / (1 + np.exp(-x)) def test_sigmoid(): x = 0 print("Input x: {}, the sigmoid value is: {}".format(x, sigmoid(x))) def main(): # Prepare dataset train_feature...
8d3c6d208027d4e19592a3e849f4ec2700722613
tests/test_add_language/test_main.py
tests/test_add_language/test_main.py
# tests.test_add_language.test_save_bible_data # coding=utf-8 from __future__ import unicode_literals import nose.tools as nose from mock import patch import utilities.add_language as add_lang from tests.test_add_language import set_up, tear_down from tests.test_add_language.decorators import redirect_stdout @nose...
Add initial tests for main add_language functions
Add initial tests for main add_language functions
Python
mit
caleb531/youversion-suggest,caleb531/youversion-suggest
Add initial tests for main add_language functions
# tests.test_add_language.test_save_bible_data # coding=utf-8 from __future__ import unicode_literals import nose.tools as nose from mock import patch import utilities.add_language as add_lang from tests.test_add_language import set_up, tear_down from tests.test_add_language.decorators import redirect_stdout @nose...
<commit_before><commit_msg>Add initial tests for main add_language functions<commit_after>
# tests.test_add_language.test_save_bible_data # coding=utf-8 from __future__ import unicode_literals import nose.tools as nose from mock import patch import utilities.add_language as add_lang from tests.test_add_language import set_up, tear_down from tests.test_add_language.decorators import redirect_stdout @nose...
Add initial tests for main add_language functions# tests.test_add_language.test_save_bible_data # coding=utf-8 from __future__ import unicode_literals import nose.tools as nose from mock import patch import utilities.add_language as add_lang from tests.test_add_language import set_up, tear_down from tests.test_add_l...
<commit_before><commit_msg>Add initial tests for main add_language functions<commit_after># tests.test_add_language.test_save_bible_data # coding=utf-8 from __future__ import unicode_literals import nose.tools as nose from mock import patch import utilities.add_language as add_lang from tests.test_add_language impor...
7418fb63eda14f277bcfb66cea27838736d0f43a
tools/compare_branches.py
tools/compare_branches.py
#!/usr/bin/env python import argparse import subprocess from collections import OrderedDict def main(): args = get_args() local_commits = get_local_commits() other_commits = get_other_commits(args.branch, args.path) local_subjects = set(local_commits.values()) for commitish, subject in other_comm...
Add helper to compare branches
Add helper to compare branches
Python
mit
thusoy/salt-states,thusoy/salt-states,thusoy/salt-states,thusoy/salt-states
Add helper to compare branches
#!/usr/bin/env python import argparse import subprocess from collections import OrderedDict def main(): args = get_args() local_commits = get_local_commits() other_commits = get_other_commits(args.branch, args.path) local_subjects = set(local_commits.values()) for commitish, subject in other_comm...
<commit_before><commit_msg>Add helper to compare branches<commit_after>
#!/usr/bin/env python import argparse import subprocess from collections import OrderedDict def main(): args = get_args() local_commits = get_local_commits() other_commits = get_other_commits(args.branch, args.path) local_subjects = set(local_commits.values()) for commitish, subject in other_comm...
Add helper to compare branches#!/usr/bin/env python import argparse import subprocess from collections import OrderedDict def main(): args = get_args() local_commits = get_local_commits() other_commits = get_other_commits(args.branch, args.path) local_subjects = set(local_commits.values()) for co...
<commit_before><commit_msg>Add helper to compare branches<commit_after>#!/usr/bin/env python import argparse import subprocess from collections import OrderedDict def main(): args = get_args() local_commits = get_local_commits() other_commits = get_other_commits(args.branch, args.path) local_subjects...
4a44069abbb88f29a1fa236511f2f31c10564cad
strong_typing/versioned_struct.py
strong_typing/versioned_struct.py
# -*- coding: utf-8 -*- # Standard library from distutils.version import StrictVersion from copy import deepcopy from struct import StructMeta, Struct class VersionedStructMeta(StructMeta): def __init__(cls, name, bases, attrs, **kwargs): docu = """ %s (current version: %s): Description: %s :Parameters: ...
Add the untested, undocumented feature: VersionedStruct
Add the untested, undocumented feature: VersionedStruct
Python
bsd-3-clause
aldebaran/strong_typing
Add the untested, undocumented feature: VersionedStruct
# -*- coding: utf-8 -*- # Standard library from distutils.version import StrictVersion from copy import deepcopy from struct import StructMeta, Struct class VersionedStructMeta(StructMeta): def __init__(cls, name, bases, attrs, **kwargs): docu = """ %s (current version: %s): Description: %s :Parameters: ...
<commit_before><commit_msg>Add the untested, undocumented feature: VersionedStruct<commit_after>
# -*- coding: utf-8 -*- # Standard library from distutils.version import StrictVersion from copy import deepcopy from struct import StructMeta, Struct class VersionedStructMeta(StructMeta): def __init__(cls, name, bases, attrs, **kwargs): docu = """ %s (current version: %s): Description: %s :Parameters: ...
Add the untested, undocumented feature: VersionedStruct# -*- coding: utf-8 -*- # Standard library from distutils.version import StrictVersion from copy import deepcopy from struct import StructMeta, Struct class VersionedStructMeta(StructMeta): def __init__(cls, name, bases, attrs, **kwargs): docu = """ %s (cu...
<commit_before><commit_msg>Add the untested, undocumented feature: VersionedStruct<commit_after># -*- coding: utf-8 -*- # Standard library from distutils.version import StrictVersion from copy import deepcopy from struct import StructMeta, Struct class VersionedStructMeta(StructMeta): def __init__(cls, name, bases...
deffe34fe1c9255697d37390a95b157b9b068923
dcore/linear_solvers.py
dcore/linear_solvers.py
class TimesteppingSolver(object): """ Base class for timestepping linear solvers for dcore. This is a dummy base class where the input is just copied to the output. :arg state: x_in :class:`.Function` object for the input :arg state: x_out :class:`.Function` object for the output """ def ...
Create a base class for timestepping solvers
Create a base class for timestepping solvers
Python
mit
firedrakeproject/dcore,firedrakeproject/gusto
Create a base class for timestepping solvers
class TimesteppingSolver(object): """ Base class for timestepping linear solvers for dcore. This is a dummy base class where the input is just copied to the output. :arg state: x_in :class:`.Function` object for the input :arg state: x_out :class:`.Function` object for the output """ def ...
<commit_before><commit_msg>Create a base class for timestepping solvers<commit_after>
class TimesteppingSolver(object): """ Base class for timestepping linear solvers for dcore. This is a dummy base class where the input is just copied to the output. :arg state: x_in :class:`.Function` object for the input :arg state: x_out :class:`.Function` object for the output """ def ...
Create a base class for timestepping solversclass TimesteppingSolver(object): """ Base class for timestepping linear solvers for dcore. This is a dummy base class where the input is just copied to the output. :arg state: x_in :class:`.Function` object for the input :arg state: x_out :class:`.Funct...
<commit_before><commit_msg>Create a base class for timestepping solvers<commit_after>class TimesteppingSolver(object): """ Base class for timestepping linear solvers for dcore. This is a dummy base class where the input is just copied to the output. :arg state: x_in :class:`.Function` object for the i...
3ac421e5adcd5780985a6598acb60b8f0447f048
src/scripts/build_tests.py
src/scripts/build_tests.py
#!/usr/bin/python3 """ This configures and builds with many different sub-configurations in an attempt to flush out missing feature macro checks, etc. There is probably no reason for you to run this. Unless you want to. (C) 2017 Jack Lloyd Botan is released under the Simplified BSD License (see license.txt) """ im...
Add script that runs build+test across many configs, reports errors
Add script that runs build+test across many configs, reports errors
Python
bsd-2-clause
Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,randombit/botan,randombit/botan,webmaster128/botan,webmaster128/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,randombit/botan,randombit/botan,Rohde-Schwarz-Cybersecurity/botan,webmaster128/botan,Rohde-Schwarz-Cybersecuri...
Add script that runs build+test across many configs, reports errors
#!/usr/bin/python3 """ This configures and builds with many different sub-configurations in an attempt to flush out missing feature macro checks, etc. There is probably no reason for you to run this. Unless you want to. (C) 2017 Jack Lloyd Botan is released under the Simplified BSD License (see license.txt) """ im...
<commit_before><commit_msg>Add script that runs build+test across many configs, reports errors<commit_after>
#!/usr/bin/python3 """ This configures and builds with many different sub-configurations in an attempt to flush out missing feature macro checks, etc. There is probably no reason for you to run this. Unless you want to. (C) 2017 Jack Lloyd Botan is released under the Simplified BSD License (see license.txt) """ im...
Add script that runs build+test across many configs, reports errors#!/usr/bin/python3 """ This configures and builds with many different sub-configurations in an attempt to flush out missing feature macro checks, etc. There is probably no reason for you to run this. Unless you want to. (C) 2017 Jack Lloyd Botan is ...
<commit_before><commit_msg>Add script that runs build+test across many configs, reports errors<commit_after>#!/usr/bin/python3 """ This configures and builds with many different sub-configurations in an attempt to flush out missing feature macro checks, etc. There is probably no reason for you to run this. Unless you...
06d763cd3a9651a1af785216b8665d09f11c4e1a
src/postgres/migrations/0007_fix_user_id_proposal_id_in_review.py
src/postgres/migrations/0007_fix_user_id_proposal_id_in_review.py
from django.db import migrations ALTER_REVIEW_PROPOSAL_ID = """ ALTER TABLE "reviews_review" alter COLUMN "proposal_id" SET DATA TYPE bigint; """ ALTER_REVIEW_REVIEWER_ID = """ ALTER TABLE "reviews_review" alter COLUMN "reviewer_id" SET DATA TYPE bigint; """ class Migration(migrations.Migrat...
Fix review and user pk in postgresql
Fix review and user pk in postgresql
Python
mit
pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016
Fix review and user pk in postgresql
from django.db import migrations ALTER_REVIEW_PROPOSAL_ID = """ ALTER TABLE "reviews_review" alter COLUMN "proposal_id" SET DATA TYPE bigint; """ ALTER_REVIEW_REVIEWER_ID = """ ALTER TABLE "reviews_review" alter COLUMN "reviewer_id" SET DATA TYPE bigint; """ class Migration(migrations.Migrat...
<commit_before><commit_msg>Fix review and user pk in postgresql<commit_after>
from django.db import migrations ALTER_REVIEW_PROPOSAL_ID = """ ALTER TABLE "reviews_review" alter COLUMN "proposal_id" SET DATA TYPE bigint; """ ALTER_REVIEW_REVIEWER_ID = """ ALTER TABLE "reviews_review" alter COLUMN "reviewer_id" SET DATA TYPE bigint; """ class Migration(migrations.Migrat...
Fix review and user pk in postgresqlfrom django.db import migrations ALTER_REVIEW_PROPOSAL_ID = """ ALTER TABLE "reviews_review" alter COLUMN "proposal_id" SET DATA TYPE bigint; """ ALTER_REVIEW_REVIEWER_ID = """ ALTER TABLE "reviews_review" alter COLUMN "reviewer_id" SET DATA TYPE bigint; ""...
<commit_before><commit_msg>Fix review and user pk in postgresql<commit_after>from django.db import migrations ALTER_REVIEW_PROPOSAL_ID = """ ALTER TABLE "reviews_review" alter COLUMN "proposal_id" SET DATA TYPE bigint; """ ALTER_REVIEW_REVIEWER_ID = """ ALTER TABLE "reviews_review" alter COLUMN "revi...
634440b794598b8a3c935a1ee6e4fa722d1c1cea
direct/src/directtools/DirectGlobals.py
direct/src/directtools/DirectGlobals.py
from PandaModules import Vec3, Point3 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible', 'gridBack', 'unpickable'] # For linmath operations X_AXIS = Vec3(1,0,0) Y_AXIS = Vec3(0,1,0) Z_AXIS = Vec3(0,0,1) NEG_X_AXIS = Vec3(-1,0,0) NEG_Y_AXIS = Vec3(0,-1,0) NEG_Z_AXIS = Vec3(0,0,-1) ZERO_V...
Put all direct globals in one file
Put all direct globals in one file
Python
bsd-3-clause
jjkoletar/panda3d,matthiascy/panda3d,mgracer48/panda3d,brakhane/panda3d,grimfang/panda3d,grimfang/panda3d,matthiascy/panda3d,grimfang/panda3d,chandler14362/panda3d,Wilee999/panda3d,cc272309126/panda3d,tobspr/panda3d,chandler14362/panda3d,grimfang/panda3d,hj3938/panda3d,brakhane/panda3d,brakhane/panda3d,Wilee999/panda3d...
Put all direct globals in one file
from PandaModules import Vec3, Point3 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible', 'gridBack', 'unpickable'] # For linmath operations X_AXIS = Vec3(1,0,0) Y_AXIS = Vec3(0,1,0) Z_AXIS = Vec3(0,0,1) NEG_X_AXIS = Vec3(-1,0,0) NEG_Y_AXIS = Vec3(0,-1,0) NEG_Z_AXIS = Vec3(0,0,-1) ZERO_V...
<commit_before><commit_msg>Put all direct globals in one file<commit_after>
from PandaModules import Vec3, Point3 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible', 'gridBack', 'unpickable'] # For linmath operations X_AXIS = Vec3(1,0,0) Y_AXIS = Vec3(0,1,0) Z_AXIS = Vec3(0,0,1) NEG_X_AXIS = Vec3(-1,0,0) NEG_Y_AXIS = Vec3(0,-1,0) NEG_Z_AXIS = Vec3(0,0,-1) ZERO_V...
Put all direct globals in one filefrom PandaModules import Vec3, Point3 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible', 'gridBack', 'unpickable'] # For linmath operations X_AXIS = Vec3(1,0,0) Y_AXIS = Vec3(0,1,0) Z_AXIS = Vec3(0,0,1) NEG_X_AXIS = Vec3(-1,0,0) NEG_Y_AXIS = Vec3(0,-1,0...
<commit_before><commit_msg>Put all direct globals in one file<commit_after>from PandaModules import Vec3, Point3 UNPICKABLE = ['x-disc-visible', 'y-disc-visible', 'z-disc-visible', 'gridBack', 'unpickable'] # For linmath operations X_AXIS = Vec3(1,0,0) Y_AXIS = Vec3(0,1,0) Z_AXIS = Vec3(0,0,1) NEG_X_AXI...
e0e94c2196b6df22763d84564913440f55ad4977
RFTOCSV.py
RFTOCSV.py
import os import glob import csv from string import Template import sys, traceback import datetime from collections import OrderedDict try : CSV_FILE_PATH = 'DailyRainTest.csv' RF_DIR_PATH = './OUTPUT/RF/' UPPER_CATCHMENT_WEIGHTS = { 'Attanagalla' : 1/7, # 1 'Daraniyagala' : 1/7, # 2 ...
Read WRF output and write to CSV
Read WRF output and write to CSV - Read data values of Upper Catchment stations and take the avg using Theissen polygen method and write into CSV file
Python
apache-2.0
gihankarunarathne/udp,gihankarunarathne/udp
Read WRF output and write to CSV - Read data values of Upper Catchment stations and take the avg using Theissen polygen method and write into CSV file
import os import glob import csv from string import Template import sys, traceback import datetime from collections import OrderedDict try : CSV_FILE_PATH = 'DailyRainTest.csv' RF_DIR_PATH = './OUTPUT/RF/' UPPER_CATCHMENT_WEIGHTS = { 'Attanagalla' : 1/7, # 1 'Daraniyagala' : 1/7, # 2 ...
<commit_before><commit_msg>Read WRF output and write to CSV - Read data values of Upper Catchment stations and take the avg using Theissen polygen method and write into CSV file<commit_after>
import os import glob import csv from string import Template import sys, traceback import datetime from collections import OrderedDict try : CSV_FILE_PATH = 'DailyRainTest.csv' RF_DIR_PATH = './OUTPUT/RF/' UPPER_CATCHMENT_WEIGHTS = { 'Attanagalla' : 1/7, # 1 'Daraniyagala' : 1/7, # 2 ...
Read WRF output and write to CSV - Read data values of Upper Catchment stations and take the avg using Theissen polygen method and write into CSV fileimport os import glob import csv from string import Template import sys, traceback import datetime from collections import OrderedDict try : CSV_FILE_PATH = 'Dail...
<commit_before><commit_msg>Read WRF output and write to CSV - Read data values of Upper Catchment stations and take the avg using Theissen polygen method and write into CSV file<commit_after>import os import glob import csv from string import Template import sys, traceback import datetime from collections import Ord...
8eeaa69574ee723a4e3d435140814c5776e97055
trunk/metpy/bl/sim/mos.py
trunk/metpy/bl/sim/mos.py
#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(v...
#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(v...
Change to import gravity constant from constants file.
Change to import gravity constant from constants file. git-svn-id: acf0ef94bfce630b1a882387fc03ab8593ec6522@23 150532fb-1d5b-0410-a8ab-efec50f980d4
Python
bsd-3-clause
Unidata/MetPy,dopplershift/MetPy,jrleeman/MetPy,ahaberlie/MetPy,ShawnMurd/MetPy,Unidata/MetPy,ahaberlie/MetPy,deeplycloudy/MetPy,jrleeman/MetPy,ahill818/MetPy,dopplershift/MetPy
#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(v...
#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(v...
<commit_before>#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(...
#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(v...
#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(uw,2)+N.power(v...
<commit_before>#!/usr/bin/python import numpy as N def u_star(u,v,w): ''' Compute the friction velocity, u_star, from the timeseries of the velocity \ components u, v, and w (an nD array) ''' from metpy.bl.turb.fluxes import rs as R rs = R(u,v,w) uw = rs[3] vw = rs[4] us = N.power(N.power(...
8d00057b474f169de468225afdc72aed9f5baf93
vctk/backend/__init__.py
vctk/backend/__init__.py
# coding: utf-8 from vctk import Analyzer, Synthesizer, SpeechParameters import world class WORLD(Analyzer, Synthesizer): """ WORLD-based speech analyzer & synthesizer TODO: support platinum """ def __init__(self, period=5.0, fs=44100, f0_...
Add concrete class `WORLD` that implements `Analyzer` and `Synthesizer`
Add concrete class `WORLD` that implements `Analyzer` and `Synthesizer`
Python
mit
k2kobayashi/sprocket
Add concrete class `WORLD` that implements `Analyzer` and `Synthesizer`
# coding: utf-8 from vctk import Analyzer, Synthesizer, SpeechParameters import world class WORLD(Analyzer, Synthesizer): """ WORLD-based speech analyzer & synthesizer TODO: support platinum """ def __init__(self, period=5.0, fs=44100, f0_...
<commit_before><commit_msg>Add concrete class `WORLD` that implements `Analyzer` and `Synthesizer`<commit_after>
# coding: utf-8 from vctk import Analyzer, Synthesizer, SpeechParameters import world class WORLD(Analyzer, Synthesizer): """ WORLD-based speech analyzer & synthesizer TODO: support platinum """ def __init__(self, period=5.0, fs=44100, f0_...
Add concrete class `WORLD` that implements `Analyzer` and `Synthesizer`# coding: utf-8 from vctk import Analyzer, Synthesizer, SpeechParameters import world class WORLD(Analyzer, Synthesizer): """ WORLD-based speech analyzer & synthesizer TODO: support platinum """ def __init__(self, ...
<commit_before><commit_msg>Add concrete class `WORLD` that implements `Analyzer` and `Synthesizer`<commit_after># coding: utf-8 from vctk import Analyzer, Synthesizer, SpeechParameters import world class WORLD(Analyzer, Synthesizer): """ WORLD-based speech analyzer & synthesizer TODO: support plati...
ad5d76d82acec8fe06eec8a8f3bfb9bcfd12a70f
alltheitems.py
alltheitems.py
#!/usr/bin/env python3 """ Wurstmineberg: All The Items """ import bottle application = bottle.Bottle() document_root = '/var/www/alltheitems.wurstmineberg.de' @application.route('/') def show_index(): """The index page.""" return bottle.static_file('index.html', root=document_root) @application.route('/all...
Make the website a bottle app
Make the website a bottle app
Python
mit
wurstmineberg/alltheitems.wurstmineberg.de,wurstmineberg/alltheitems.wurstmineberg.de
Make the website a bottle app
#!/usr/bin/env python3 """ Wurstmineberg: All The Items """ import bottle application = bottle.Bottle() document_root = '/var/www/alltheitems.wurstmineberg.de' @application.route('/') def show_index(): """The index page.""" return bottle.static_file('index.html', root=document_root) @application.route('/all...
<commit_before><commit_msg>Make the website a bottle app<commit_after>
#!/usr/bin/env python3 """ Wurstmineberg: All The Items """ import bottle application = bottle.Bottle() document_root = '/var/www/alltheitems.wurstmineberg.de' @application.route('/') def show_index(): """The index page.""" return bottle.static_file('index.html', root=document_root) @application.route('/all...
Make the website a bottle app#!/usr/bin/env python3 """ Wurstmineberg: All The Items """ import bottle application = bottle.Bottle() document_root = '/var/www/alltheitems.wurstmineberg.de' @application.route('/') def show_index(): """The index page.""" return bottle.static_file('index.html', root=document_ro...
<commit_before><commit_msg>Make the website a bottle app<commit_after>#!/usr/bin/env python3 """ Wurstmineberg: All The Items """ import bottle application = bottle.Bottle() document_root = '/var/www/alltheitems.wurstmineberg.de' @application.route('/') def show_index(): """The index page.""" return bottle.s...
3e5e5fe542ed30274604b580cb6b0ff816bcda2a
tests/example_peninsula.py
tests/example_peninsula.py
from parcels import NEMOGrid, Particle from argparse import ArgumentParser def pensinsula_example(filename, npart): """Example configuration of particle flow around an idealised Peninsula :arg filename: Basename of the input grid file set :arg npart: Number of particles to intialise""" # Open grid f...
Add example configuration for the pensinsula test case
Pensinsula: Add example configuration for the pensinsula test case This initialises a set of particles, advects them for 24h and plots their final position to screen.
Python
mit
OceanPARCELS/parcels,OceanPARCELS/parcels
Pensinsula: Add example configuration for the pensinsula test case This initialises a set of particles, advects them for 24h and plots their final position to screen.
from parcels import NEMOGrid, Particle from argparse import ArgumentParser def pensinsula_example(filename, npart): """Example configuration of particle flow around an idealised Peninsula :arg filename: Basename of the input grid file set :arg npart: Number of particles to intialise""" # Open grid f...
<commit_before><commit_msg>Pensinsula: Add example configuration for the pensinsula test case This initialises a set of particles, advects them for 24h and plots their final position to screen.<commit_after>
from parcels import NEMOGrid, Particle from argparse import ArgumentParser def pensinsula_example(filename, npart): """Example configuration of particle flow around an idealised Peninsula :arg filename: Basename of the input grid file set :arg npart: Number of particles to intialise""" # Open grid f...
Pensinsula: Add example configuration for the pensinsula test case This initialises a set of particles, advects them for 24h and plots their final position to screen.from parcels import NEMOGrid, Particle from argparse import ArgumentParser def pensinsula_example(filename, npart): """Example configuration of par...
<commit_before><commit_msg>Pensinsula: Add example configuration for the pensinsula test case This initialises a set of particles, advects them for 24h and plots their final position to screen.<commit_after>from parcels import NEMOGrid, Particle from argparse import ArgumentParser def pensinsula_example(filename, np...
34c3f085add407f7fe2860ef9abc06bdd47482df
examples/rotatinglog.py
examples/rotatinglog.py
# Use with --log-config option: # volttron --log-config rotatinglog.py { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'agent': { '()': 'volttron.platform.agent.utils.AgentFormatter', }, }, 'handlers': { 'rotating': { 'class': 'l...
Implement log rotation in config file.
Implement log rotation in config file.
Python
bsd-2-clause
schandrika/volttron,schandrika/volttron,schandrika/volttron,schandrika/volttron
Implement log rotation in config file.
# Use with --log-config option: # volttron --log-config rotatinglog.py { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'agent': { '()': 'volttron.platform.agent.utils.AgentFormatter', }, }, 'handlers': { 'rotating': { 'class': 'l...
<commit_before><commit_msg>Implement log rotation in config file.<commit_after>
# Use with --log-config option: # volttron --log-config rotatinglog.py { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'agent': { '()': 'volttron.platform.agent.utils.AgentFormatter', }, }, 'handlers': { 'rotating': { 'class': 'l...
Implement log rotation in config file.# Use with --log-config option: # volttron --log-config rotatinglog.py { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'agent': { '()': 'volttron.platform.agent.utils.AgentFormatter', }, }, 'handlers': { ...
<commit_before><commit_msg>Implement log rotation in config file.<commit_after># Use with --log-config option: # volttron --log-config rotatinglog.py { 'version': 1, 'disable_existing_loggers': False, 'formatters': { 'agent': { '()': 'volttron.platform.agent.utils.AgentFormatter', ...
ef337b8fa5234f8a89178d24449e0146fa92e19c
farmers_api/farmers/tests.py
farmers_api/farmers/tests.py
from django.core.exceptions import ValidationError from django.test import TestCase from .models import Farmer class FarmerModelTest(TestCase): def test_string_representation(self): farmer = Farmer(first_name='John', surname='Smith', town='Harrogate') self.assertEqual(str(farmer), '%s %s' % ...
Add unit test for the Farmer model
Add unit test for the Farmer model
Python
bsd-2-clause
tm-kn/farmers-api
Add unit test for the Farmer model
from django.core.exceptions import ValidationError from django.test import TestCase from .models import Farmer class FarmerModelTest(TestCase): def test_string_representation(self): farmer = Farmer(first_name='John', surname='Smith', town='Harrogate') self.assertEqual(str(farmer), '%s %s' % ...
<commit_before><commit_msg>Add unit test for the Farmer model<commit_after>
from django.core.exceptions import ValidationError from django.test import TestCase from .models import Farmer class FarmerModelTest(TestCase): def test_string_representation(self): farmer = Farmer(first_name='John', surname='Smith', town='Harrogate') self.assertEqual(str(farmer), '%s %s' % ...
Add unit test for the Farmer modelfrom django.core.exceptions import ValidationError from django.test import TestCase from .models import Farmer class FarmerModelTest(TestCase): def test_string_representation(self): farmer = Farmer(first_name='John', surname='Smith', town='Harrogate') self.asse...
<commit_before><commit_msg>Add unit test for the Farmer model<commit_after>from django.core.exceptions import ValidationError from django.test import TestCase from .models import Farmer class FarmerModelTest(TestCase): def test_string_representation(self): farmer = Farmer(first_name='John', surname='Smi...
d99170f1aa6dd885354804f20c82cfff7662266c
tempest/tests/services/compute/test_limits_client.py
tempest/tests/services/compute/test_limits_client.py
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Add unit test for method show_limits
Add unit test for method show_limits This patch adds unit test for limits_client. Specific about method show_limits. Change-Id: I03acbf807d388d5d6c61dafff0f2d9a07520775f
Python
apache-2.0
tonyli71/tempest,Juniper/tempest,tonyli71/tempest,flyingfish007/tempest,openstack/tempest,JioCloud/tempest,roopali8/tempest,LIS/lis-tempest,Tesora/tesora-tempest,hayderimran7/tempest,bigswitch/tempest,Juniper/tempest,vedujoshi/tempest,zsoltdudas/lis-tempest,masayukig/tempest,pczerkas/tempest,dkalashnik/tempest,hayderim...
Add unit test for method show_limits This patch adds unit test for limits_client. Specific about method show_limits. Change-Id: I03acbf807d388d5d6c61dafff0f2d9a07520775f
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
<commit_before><commit_msg>Add unit test for method show_limits This patch adds unit test for limits_client. Specific about method show_limits. Change-Id: I03acbf807d388d5d6c61dafff0f2d9a07520775f<commit_after>
# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required ...
Add unit test for method show_limits This patch adds unit test for limits_client. Specific about method show_limits. Change-Id: I03acbf807d388d5d6c61dafff0f2d9a07520775f# Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use t...
<commit_before><commit_msg>Add unit test for method show_limits This patch adds unit test for limits_client. Specific about method show_limits. Change-Id: I03acbf807d388d5d6c61dafff0f2d9a07520775f<commit_after># Copyright 2015 NEC Corporation. All rights reserved. # # Licensed under the Apache License, Version 2....
e3ec476cd844235ce8a8e9b089a4c0d46185eb72
core/management/commands/delete_old_sessions.py
core/management/commands/delete_old_sessions.py
from datetime import datetime from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session """ >>> def clean(count): ... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]): ... s.delete() ... if str(idx).endswith('000'): print idx ... p...
Add delete old sessions command
Add delete old sessions command
Python
mit
pydanny/djangopackages,pydanny/djangopackages,nanuxbe/djangopackages,nanuxbe/djangopackages,QLGu/djangopackages,pydanny/djangopackages,QLGu/djangopackages,QLGu/djangopackages,nanuxbe/djangopackages
Add delete old sessions command
from datetime import datetime from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session """ >>> def clean(count): ... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]): ... s.delete() ... if str(idx).endswith('000'): print idx ... p...
<commit_before><commit_msg>Add delete old sessions command<commit_after>
from datetime import datetime from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session """ >>> def clean(count): ... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]): ... s.delete() ... if str(idx).endswith('000'): print idx ... p...
Add delete old sessions commandfrom datetime import datetime from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session """ >>> def clean(count): ... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]): ... s.delete() ... if str(idx).end...
<commit_before><commit_msg>Add delete old sessions command<commit_after>from datetime import datetime from django.core.management.base import BaseCommand from django.contrib.sessions.models import Session """ >>> def clean(count): ... for idx, s in enumerate(Session.objects.filter(expire_date__lt=now)[:count+1]): ....
fec4ff648c65decf17707929e3d44789c50fde4f
carseour/__init__.py
carseour/__init__.py
import mmap from carseour.definitions import GameInstance, SHARED_MEMORY_VERSION def _get_mmapped(): # could we use ctypes.sizeof(GameInstance) instead here? A too large value results in access denied, # 8k works for now return mmap.mmap(0, 8000, tagname='$pcars$') def _validate_instance(instance): if...
Add methods to retrieve a game instance backed live by shared memory or to retrieve a copy of the current state of the memory.
Add methods to retrieve a game instance backed live by shared memory or to retrieve a copy of the current state of the memory.
Python
mit
matslindh/carseour,matslindh/carseour
Add methods to retrieve a game instance backed live by shared memory or to retrieve a copy of the current state of the memory.
import mmap from carseour.definitions import GameInstance, SHARED_MEMORY_VERSION def _get_mmapped(): # could we use ctypes.sizeof(GameInstance) instead here? A too large value results in access denied, # 8k works for now return mmap.mmap(0, 8000, tagname='$pcars$') def _validate_instance(instance): if...
<commit_before><commit_msg>Add methods to retrieve a game instance backed live by shared memory or to retrieve a copy of the current state of the memory.<commit_after>
import mmap from carseour.definitions import GameInstance, SHARED_MEMORY_VERSION def _get_mmapped(): # could we use ctypes.sizeof(GameInstance) instead here? A too large value results in access denied, # 8k works for now return mmap.mmap(0, 8000, tagname='$pcars$') def _validate_instance(instance): if...
Add methods to retrieve a game instance backed live by shared memory or to retrieve a copy of the current state of the memory.import mmap from carseour.definitions import GameInstance, SHARED_MEMORY_VERSION def _get_mmapped(): # could we use ctypes.sizeof(GameInstance) instead here? A too large value results in ac...
<commit_before><commit_msg>Add methods to retrieve a game instance backed live by shared memory or to retrieve a copy of the current state of the memory.<commit_after>import mmap from carseour.definitions import GameInstance, SHARED_MEMORY_VERSION def _get_mmapped(): # could we use ctypes.sizeof(GameInstance) inst...
149b54a921841f546fa43ebbf37cdffe5c3a93af
module1-2/new_integrals.py
module1-2/new_integrals.py
# Кириллов Алексей, ИУ7-22 # Работа с интегралами из меню def f(x): return x*x def parabola(a,b,n): s = 0 h = (b-a)/n for i in range(n): s += f(a+i*h) + 4 * f(a+i*h+h/2) + f(a+i*h+h) s *= h/6 return s def Integral(a,b,n=0,e=1): if not n: n = 1 ...
Work with integrals from menu
Work with integrals from menu
Python
mit
aspadm/labworks
Work with integrals from menu
# Кириллов Алексей, ИУ7-22 # Работа с интегралами из меню def f(x): return x*x def parabola(a,b,n): s = 0 h = (b-a)/n for i in range(n): s += f(a+i*h) + 4 * f(a+i*h+h/2) + f(a+i*h+h) s *= h/6 return s def Integral(a,b,n=0,e=1): if not n: n = 1 ...
<commit_before><commit_msg>Work with integrals from menu<commit_after>
# Кириллов Алексей, ИУ7-22 # Работа с интегралами из меню def f(x): return x*x def parabola(a,b,n): s = 0 h = (b-a)/n for i in range(n): s += f(a+i*h) + 4 * f(a+i*h+h/2) + f(a+i*h+h) s *= h/6 return s def Integral(a,b,n=0,e=1): if not n: n = 1 ...
Work with integrals from menu# Кириллов Алексей, ИУ7-22 # Работа с интегралами из меню def f(x): return x*x def parabola(a,b,n): s = 0 h = (b-a)/n for i in range(n): s += f(a+i*h) + 4 * f(a+i*h+h/2) + f(a+i*h+h) s *= h/6 return s def Integral(a,b,n=0,e=1): if n...
<commit_before><commit_msg>Work with integrals from menu<commit_after># Кириллов Алексей, ИУ7-22 # Работа с интегралами из меню def f(x): return x*x def parabola(a,b,n): s = 0 h = (b-a)/n for i in range(n): s += f(a+i*h) + 4 * f(a+i*h+h/2) + f(a+i*h+h) s *= h/6 return ...
a0739545ebb9ef469be1f1c1034231b76fdb8c6a
Lib/test/test_plistlib.py
Lib/test/test_plistlib.py
# Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os from test import test_support class TestPlistlib(unittest.TestCase): def tearDown(self): try: os.unlink(test_support.TESTFN) except: pass def _create(self): pl = plistlib...
Test suite for the plistlib module.
Test suite for the plistlib module.
Python
mit
sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator
Test suite for the plistlib module.
# Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os from test import test_support class TestPlistlib(unittest.TestCase): def tearDown(self): try: os.unlink(test_support.TESTFN) except: pass def _create(self): pl = plistlib...
<commit_before><commit_msg>Test suite for the plistlib module.<commit_after>
# Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os from test import test_support class TestPlistlib(unittest.TestCase): def tearDown(self): try: os.unlink(test_support.TESTFN) except: pass def _create(self): pl = plistlib...
Test suite for the plistlib module.# Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os from test import test_support class TestPlistlib(unittest.TestCase): def tearDown(self): try: os.unlink(test_support.TESTFN) except: pass def _...
<commit_before><commit_msg>Test suite for the plistlib module.<commit_after># Copyright (C) 2003 Python Software Foundation import unittest import plistlib import os from test import test_support class TestPlistlib(unittest.TestCase): def tearDown(self): try: os.unlink(test_support.TESTFN) ...
aec8653089f37d53d13e1526ce2379a05e66604d
Utilities/Maintenance/GeneratePythonDownloadsPage.py
Utilities/Maintenance/GeneratePythonDownloadsPage.py
#!/usr/bin/env python #========================================================================= # # Copyright Insight Software Consortium # # 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 ...
Add script to generate download links used on simpleitk.org
Add script to generate download links used on simpleitk.org
Python
apache-2.0
InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,richardbeare/SimpleITK,richardbeare/SimpleITK,SimpleITK/SimpleITK,InsightSoftwareConsortium/SimpleITK,InsightSoftwareConsortium/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,blowekamp/SimpleITK,SimpleITK/SimpleITK,richardbeare/SimpleITK,blowekamp/SimpleITK,Sim...
Add script to generate download links used on simpleitk.org
#!/usr/bin/env python #========================================================================= # # Copyright Insight Software Consortium # # 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 ...
<commit_before><commit_msg>Add script to generate download links used on simpleitk.org<commit_after>
#!/usr/bin/env python #========================================================================= # # Copyright Insight Software Consortium # # 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 ...
Add script to generate download links used on simpleitk.org#!/usr/bin/env python #========================================================================= # # Copyright Insight Software Consortium # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance wi...
<commit_before><commit_msg>Add script to generate download links used on simpleitk.org<commit_after>#!/usr/bin/env python #========================================================================= # # Copyright Insight Software Consortium # # Licensed under the Apache License, Version 2.0 (the "License"); # you may ...
6a1755e28edcdcc7d86cce713d7fd8d640a898fd
tests/test_aquire.py
tests/test_aquire.py
import pytest @pytest.fixture def testdir_with_map(testdir): testdir.makefile('.yaml', map=''' version: 1 environments: mock_env: roles: mock: - mocker.example: greeting: Hello World ''') testdir.makepyfile(mocker=''...
Add a basic test to make sure acquisition works
Add a basic test to make sure acquisition works
Python
mpl-2.0
sangoma/pytestlab
Add a basic test to make sure acquisition works
import pytest @pytest.fixture def testdir_with_map(testdir): testdir.makefile('.yaml', map=''' version: 1 environments: mock_env: roles: mock: - mocker.example: greeting: Hello World ''') testdir.makepyfile(mocker=''...
<commit_before><commit_msg>Add a basic test to make sure acquisition works<commit_after>
import pytest @pytest.fixture def testdir_with_map(testdir): testdir.makefile('.yaml', map=''' version: 1 environments: mock_env: roles: mock: - mocker.example: greeting: Hello World ''') testdir.makepyfile(mocker=''...
Add a basic test to make sure acquisition worksimport pytest @pytest.fixture def testdir_with_map(testdir): testdir.makefile('.yaml', map=''' version: 1 environments: mock_env: roles: mock: - mocker.example: greeting: Hello W...
<commit_before><commit_msg>Add a basic test to make sure acquisition works<commit_after>import pytest @pytest.fixture def testdir_with_map(testdir): testdir.makefile('.yaml', map=''' version: 1 environments: mock_env: roles: mock: - mocker.examp...
a5361a632ee392ee318258976fca33b8baef7fba
sc2reader/exceptions.py
sc2reader/exceptions.py
class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MutipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_events=[], buffer=No...
class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MultipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_events=[], buffer=N...
Fix a typo in MultipleMatchingFilesError.
Fix a typo in MultipleMatchingFilesError.
Python
mit
vlaufer/sc2reader,GraylinKim/sc2reader,ggtracker/sc2reader,ggtracker/sc2reader,dsjoerg/sc2reader,GraylinKim/sc2reader,StoicLoofah/sc2reader,vlaufer/sc2reader,StoicLoofah/sc2reader,dsjoerg/sc2reader
class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MutipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_events=[], buffer=No...
class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MultipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_events=[], buffer=N...
<commit_before>class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MutipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_event...
class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MultipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_events=[], buffer=N...
class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MutipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_events=[], buffer=No...
<commit_before>class SC2ReaderError(Exception): pass class MPQError(SC2ReaderError): pass class NoMatchingFilesError(SC2ReaderError): pass class MutipleMatchingFilesError(SC2ReaderError): pass class ReadError(SC2ReaderError): def __init__(self, msg, type, code, location, replay=None, game_event...
33535ae325e15c7341c6330cf1caa756cfa09831
tests/lib/test_coins.py
tests/lib/test_coins.py
import electrumx.lib.coins as coins def test_bitcoin_cash(): raw_header = bytes.fromhex( "00000020df975c121dcbc18bbb7ddfd0419fc368b45db86b48c87e0" "1000000000000000036ae3dd40a10a40d3050de13ca546a2f81589d" "e2d2f317925a43a115437e2381f5bf535b94da0118ac8df8c5" ) height = 540000 el...
Add test for BCH electrum header
Add test for BCH electrum header
Python
mit
thelazier/electrumx,thelazier/electrumx
Add test for BCH electrum header
import electrumx.lib.coins as coins def test_bitcoin_cash(): raw_header = bytes.fromhex( "00000020df975c121dcbc18bbb7ddfd0419fc368b45db86b48c87e0" "1000000000000000036ae3dd40a10a40d3050de13ca546a2f81589d" "e2d2f317925a43a115437e2381f5bf535b94da0118ac8df8c5" ) height = 540000 el...
<commit_before><commit_msg>Add test for BCH electrum header<commit_after>
import electrumx.lib.coins as coins def test_bitcoin_cash(): raw_header = bytes.fromhex( "00000020df975c121dcbc18bbb7ddfd0419fc368b45db86b48c87e0" "1000000000000000036ae3dd40a10a40d3050de13ca546a2f81589d" "e2d2f317925a43a115437e2381f5bf535b94da0118ac8df8c5" ) height = 540000 el...
Add test for BCH electrum headerimport electrumx.lib.coins as coins def test_bitcoin_cash(): raw_header = bytes.fromhex( "00000020df975c121dcbc18bbb7ddfd0419fc368b45db86b48c87e0" "1000000000000000036ae3dd40a10a40d3050de13ca546a2f81589d" "e2d2f317925a43a115437e2381f5bf535b94da0118ac8df8c5" ...
<commit_before><commit_msg>Add test for BCH electrum header<commit_after>import electrumx.lib.coins as coins def test_bitcoin_cash(): raw_header = bytes.fromhex( "00000020df975c121dcbc18bbb7ddfd0419fc368b45db86b48c87e0" "1000000000000000036ae3dd40a10a40d3050de13ca546a2f81589d" "e2d2f317925...
4fb24d18cefc76b8622b53427a064fc430b9bfee
tests/test_search.py
tests/test_search.py
from . import TestCase from memopol.search.templatetags.search_tags import simple_search_shortcut class TestSearchTemplateTags(TestCase): def test_simple_search_shortcut(self): url = simple_search_shortcut('country:FR or country:BR') self.assertEqual(url, "/search/?q=country%3AFR%20or%20country%3...
Add a basic test for simple_search_shortcut templatetag
[enh] Add a basic test for simple_search_shortcut templatetag
Python
agpl-3.0
yohanboniface/memopol-core,yohanboniface/memopol-core,yohanboniface/memopol-core
[enh] Add a basic test for simple_search_shortcut templatetag
from . import TestCase from memopol.search.templatetags.search_tags import simple_search_shortcut class TestSearchTemplateTags(TestCase): def test_simple_search_shortcut(self): url = simple_search_shortcut('country:FR or country:BR') self.assertEqual(url, "/search/?q=country%3AFR%20or%20country%3...
<commit_before><commit_msg>[enh] Add a basic test for simple_search_shortcut templatetag<commit_after>
from . import TestCase from memopol.search.templatetags.search_tags import simple_search_shortcut class TestSearchTemplateTags(TestCase): def test_simple_search_shortcut(self): url = simple_search_shortcut('country:FR or country:BR') self.assertEqual(url, "/search/?q=country%3AFR%20or%20country%3...
[enh] Add a basic test for simple_search_shortcut templatetagfrom . import TestCase from memopol.search.templatetags.search_tags import simple_search_shortcut class TestSearchTemplateTags(TestCase): def test_simple_search_shortcut(self): url = simple_search_shortcut('country:FR or country:BR') se...
<commit_before><commit_msg>[enh] Add a basic test for simple_search_shortcut templatetag<commit_after>from . import TestCase from memopol.search.templatetags.search_tags import simple_search_shortcut class TestSearchTemplateTags(TestCase): def test_simple_search_shortcut(self): url = simple_search_shortc...
8222d728aa4a3e6032d3ea527bdaae3b053a6aed
tests/test_stream.py
tests/test_stream.py
#!/usr/bin/env python import cle import nose import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_stream(): dirpath = os.path.join(test_location, "x86_64") filepath = os.path.join(dirpath, "fauxware") filestream = open(filepath, 'rb') ...
Add a test for loading files as a stream
Add a test for loading files as a stream
Python
bsd-2-clause
chubbymaggie/cle,angr/cle
Add a test for loading files as a stream
#!/usr/bin/env python import cle import nose import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_stream(): dirpath = os.path.join(test_location, "x86_64") filepath = os.path.join(dirpath, "fauxware") filestream = open(filepath, 'rb') ...
<commit_before><commit_msg>Add a test for loading files as a stream<commit_after>
#!/usr/bin/env python import cle import nose import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_stream(): dirpath = os.path.join(test_location, "x86_64") filepath = os.path.join(dirpath, "fauxware") filestream = open(filepath, 'rb') ...
Add a test for loading files as a stream#!/usr/bin/env python import cle import nose import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_stream(): dirpath = os.path.join(test_location, "x86_64") filepath = os.path.join(dirpath, "fauxware")...
<commit_before><commit_msg>Add a test for loading files as a stream<commit_after>#!/usr/bin/env python import cle import nose import os test_location = str(os.path.join(os.path.dirname(os.path.realpath(__file__)), '../../binaries/tests')) def test_stream(): dirpath = os.path.join(test_location, "x86_64") fil...
a182ee1b7bbf00c3605fb363d0751b5959652263
ingestor/luigi_tasks.py
ingestor/luigi_tasks.py
import luigi import logging _log = logging.getLogger() class ImportLandsatScene(luigi.Task): dataset_path = luigi.Parameter() def requires(self): yield Reproject(dataset_path) yield Tile(dataset_path) yield ImportToNetCDFs(dataset_path) yield RecordInDatabase(dataset_path) ...
Add very very preliminary template for luigi-isation of ingestion
Add very very preliminary template for luigi-isation of ingestion
Python
bsd-3-clause
omad/datacube-experiments
Add very very preliminary template for luigi-isation of ingestion
import luigi import logging _log = logging.getLogger() class ImportLandsatScene(luigi.Task): dataset_path = luigi.Parameter() def requires(self): yield Reproject(dataset_path) yield Tile(dataset_path) yield ImportToNetCDFs(dataset_path) yield RecordInDatabase(dataset_path) ...
<commit_before><commit_msg>Add very very preliminary template for luigi-isation of ingestion<commit_after>
import luigi import logging _log = logging.getLogger() class ImportLandsatScene(luigi.Task): dataset_path = luigi.Parameter() def requires(self): yield Reproject(dataset_path) yield Tile(dataset_path) yield ImportToNetCDFs(dataset_path) yield RecordInDatabase(dataset_path) ...
Add very very preliminary template for luigi-isation of ingestion import luigi import logging _log = logging.getLogger() class ImportLandsatScene(luigi.Task): dataset_path = luigi.Parameter() def requires(self): yield Reproject(dataset_path) yield Tile(dataset_path) yield ImportToNet...
<commit_before><commit_msg>Add very very preliminary template for luigi-isation of ingestion<commit_after> import luigi import logging _log = logging.getLogger() class ImportLandsatScene(luigi.Task): dataset_path = luigi.Parameter() def requires(self): yield Reproject(dataset_path) yield Til...
1fcbd94d99fa7ea28330dbfb69c5b24d34ebcdd5
python/count-inversions.py
python/count-inversions.py
def countInversions(list): if len(list) == 1: return list, 0; else: middle = int(len(list)/2) A = list[:middle] B = list[middle:] left, a = countInversions(A) right, b = countInversions(B) result, c = countSplitInversions(left, right) return result, a + b + c def countSplitInversions(A, B): # Copi...
Add algorithm to count number of inversions in an array using divide and conquer
Add algorithm to count number of inversions in an array using divide and conquer
Python
mit
HiccupinGminor/tidbits,HiccupinGminor/tidbits
Add algorithm to count number of inversions in an array using divide and conquer
def countInversions(list): if len(list) == 1: return list, 0; else: middle = int(len(list)/2) A = list[:middle] B = list[middle:] left, a = countInversions(A) right, b = countInversions(B) result, c = countSplitInversions(left, right) return result, a + b + c def countSplitInversions(A, B): # Copi...
<commit_before><commit_msg>Add algorithm to count number of inversions in an array using divide and conquer<commit_after>
def countInversions(list): if len(list) == 1: return list, 0; else: middle = int(len(list)/2) A = list[:middle] B = list[middle:] left, a = countInversions(A) right, b = countInversions(B) result, c = countSplitInversions(left, right) return result, a + b + c def countSplitInversions(A, B): # Copi...
Add algorithm to count number of inversions in an array using divide and conquerdef countInversions(list): if len(list) == 1: return list, 0; else: middle = int(len(list)/2) A = list[:middle] B = list[middle:] left, a = countInversions(A) right, b = countInversions(B) result, c = countSplitInversions(l...
<commit_before><commit_msg>Add algorithm to count number of inversions in an array using divide and conquer<commit_after>def countInversions(list): if len(list) == 1: return list, 0; else: middle = int(len(list)/2) A = list[:middle] B = list[middle:] left, a = countInversions(A) right, b = countInversion...
5a28355cf49b8e2bbc265163d5c94b470dd34ba4
util/noslang_scraper.py
util/noslang_scraper.py
""" This script grabs data from the slang dictionary http://www.noslang.com/dictionary and converts it into a python dictionary for serialization. Obviously contingent on noslang's format consistency. Jesse Mu """ from bs4 import BeautifulSoup import requests try: import cPickle as pickle except ImportError: ...
Add scraper for noslang abbrevations
Add scraper for noslang abbrevations This will be used for tweet preprocessing.
Python
mit
jayelm/twittersa,jayelm/twittersa
Add scraper for noslang abbrevations This will be used for tweet preprocessing.
""" This script grabs data from the slang dictionary http://www.noslang.com/dictionary and converts it into a python dictionary for serialization. Obviously contingent on noslang's format consistency. Jesse Mu """ from bs4 import BeautifulSoup import requests try: import cPickle as pickle except ImportError: ...
<commit_before><commit_msg>Add scraper for noslang abbrevations This will be used for tweet preprocessing.<commit_after>
""" This script grabs data from the slang dictionary http://www.noslang.com/dictionary and converts it into a python dictionary for serialization. Obviously contingent on noslang's format consistency. Jesse Mu """ from bs4 import BeautifulSoup import requests try: import cPickle as pickle except ImportError: ...
Add scraper for noslang abbrevations This will be used for tweet preprocessing.""" This script grabs data from the slang dictionary http://www.noslang.com/dictionary and converts it into a python dictionary for serialization. Obviously contingent on noslang's format consistency. Jesse Mu """ from bs4 import Beautif...
<commit_before><commit_msg>Add scraper for noslang abbrevations This will be used for tweet preprocessing.<commit_after>""" This script grabs data from the slang dictionary http://www.noslang.com/dictionary and converts it into a python dictionary for serialization. Obviously contingent on noslang's format consistenc...
6e658a93b9e91b30f0902f741b2f90d9ecc18021
numba/exttypes/validators.py
numba/exttypes/validators.py
# -*- coding: utf-8 -*- """ Validate method signatures and inheritance compatiblity. """ import types import warnings import inspect import numba from numba import * from numba import error from numba import typesystem from numba.minivect import minitypes #----------------------------------------------------------...
Add extension types validator module
Add extension types validator module
Python
bsd-2-clause
GaZ3ll3/numba,gdementen/numba,stuartarchibald/numba,cpcloud/numba,numba/numba,pitrou/numba,sklam/numba,pitrou/numba,pitrou/numba,ssarangi/numba,shiquanwang/numba,GaZ3ll3/numba,sklam/numba,numba/numba,ssarangi/numba,gdementen/numba,jriehl/numba,seibert/numba,GaZ3ll3/numba,IntelLabs/numba,stuartarchibald/numba,cpcloud/nu...
Add extension types validator module
# -*- coding: utf-8 -*- """ Validate method signatures and inheritance compatiblity. """ import types import warnings import inspect import numba from numba import * from numba import error from numba import typesystem from numba.minivect import minitypes #----------------------------------------------------------...
<commit_before><commit_msg>Add extension types validator module<commit_after>
# -*- coding: utf-8 -*- """ Validate method signatures and inheritance compatiblity. """ import types import warnings import inspect import numba from numba import * from numba import error from numba import typesystem from numba.minivect import minitypes #----------------------------------------------------------...
Add extension types validator module# -*- coding: utf-8 -*- """ Validate method signatures and inheritance compatiblity. """ import types import warnings import inspect import numba from numba import * from numba import error from numba import typesystem from numba.minivect import minitypes #----------------------...
<commit_before><commit_msg>Add extension types validator module<commit_after># -*- coding: utf-8 -*- """ Validate method signatures and inheritance compatiblity. """ import types import warnings import inspect import numba from numba import * from numba import error from numba import typesystem from numba.minivect i...
cd992f1fbe4d7469cdc3d9a88863c61157cf90cc
content/test/gpu/gpu_tests/pixel_expectations.py
content/test/gpu/gpu_tests/pixel_expectations.py
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leopard, snowleopar...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leopard, snowleopar...
Remove failing expectations for pixel tests.
Remove failing expectations for pixel tests. R=kbr@chromium.org BUG=252046, 371592 NOTRY=true Review URL: https://codereview.chromium.org/282953002 git-svn-id: de016e52bd170d2d4f2344f9bf92d50478b649e0@270785 0039d316-1c4b-4281-b951-d872f2087c98
Python
bsd-3-clause
Just-D/chromium-1,crosswalk-project/chromium-crosswalk-efl,Fireblend/chromium-crosswalk,markYoungH/chromium.src,Jonekee/chromium.src,M4sse/chromium.src,dushu1203/chromium.src,hgl888/chromium-crosswalk,krieger-od/nwjs_chromium.src,bright-sparks/chromium-spacewalk,crosswalk-project/chromium-crosswalk-efl,jaruba/chromium....
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leopard, snowleopar...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leopard, snowleopar...
<commit_before># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leop...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leopard, snowleopar...
# Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leopard, snowleopar...
<commit_before># Copyright 2014 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. from telemetry.page import test_expectations # Valid expectation conditions are: # # Operating systems: # win, xp, vista, win7, mac, leop...
5b4fdc751eecf9248a075535a86a4d40a78e737e
py/find-all-numbers-disappeared-in-an-array.py
py/find-all-numbers-disappeared-in-an-array.py
class Solution(object): def findDisappearedNumbers(self, nums): """ :type nums: List[int] :rtype: List[int] """ for i, v in enumerate(nums, 1): while v != i: a, b = i - 1, v - 1 if nums[a] != nums[b]: nums[a], nu...
Add py solution for 448. Find All Numbers Disappeared in an Array
Add py solution for 448. Find All Numbers Disappeared in an Array 448. Find All Numbers Disappeared in an Array: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 448. Find All Numbers Disappeared in an Array 448. Find All Numbers Disappeared in an Array: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/
class Solution(object): def findDisappearedNumbers(self, nums): """ :type nums: List[int] :rtype: List[int] """ for i, v in enumerate(nums, 1): while v != i: a, b = i - 1, v - 1 if nums[a] != nums[b]: nums[a], nu...
<commit_before><commit_msg>Add py solution for 448. Find All Numbers Disappeared in an Array 448. Find All Numbers Disappeared in an Array: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/<commit_after>
class Solution(object): def findDisappearedNumbers(self, nums): """ :type nums: List[int] :rtype: List[int] """ for i, v in enumerate(nums, 1): while v != i: a, b = i - 1, v - 1 if nums[a] != nums[b]: nums[a], nu...
Add py solution for 448. Find All Numbers Disappeared in an Array 448. Find All Numbers Disappeared in an Array: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/class Solution(object): def findDisappearedNumbers(self, nums): """ :type nums: List[int] :rtype: List[int]...
<commit_before><commit_msg>Add py solution for 448. Find All Numbers Disappeared in an Array 448. Find All Numbers Disappeared in an Array: https://leetcode.com/problems/find-all-numbers-disappeared-in-an-array/<commit_after>class Solution(object): def findDisappearedNumbers(self, nums): """ :type ...
5384fff5ceaa694109b6a6efa790877aabd5be7e
spacy/tests/regression/test_issue1305.py
spacy/tests/regression/test_issue1305.py
import pytest @pytest.mark.models('en') def test_issue1305(EN): '''Test lemmatization of English VBZ''' assert EN.vocab.morphology.lemmatizer('works', 'verb') == set(['work']) doc = EN(u'This app works well') assert doc[2].lemma_ == 'work'
Add test for 1305: Incorrect lemmatization of VBZ for English
Add test for 1305: Incorrect lemmatization of VBZ for English
Python
mit
honnibal/spaCy,aikramer2/spaCy,aikramer2/spaCy,aikramer2/spaCy,aikramer2/spaCy,aikramer2/spaCy,explosion/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,spacy-io/spaCy,recognai/spaCy,honnibal/spaCy,spacy-io/spaCy,recognai/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,explosion/spaCy,recognai/s...
Add test for 1305: Incorrect lemmatization of VBZ for English
import pytest @pytest.mark.models('en') def test_issue1305(EN): '''Test lemmatization of English VBZ''' assert EN.vocab.morphology.lemmatizer('works', 'verb') == set(['work']) doc = EN(u'This app works well') assert doc[2].lemma_ == 'work'
<commit_before><commit_msg>Add test for 1305: Incorrect lemmatization of VBZ for English<commit_after>
import pytest @pytest.mark.models('en') def test_issue1305(EN): '''Test lemmatization of English VBZ''' assert EN.vocab.morphology.lemmatizer('works', 'verb') == set(['work']) doc = EN(u'This app works well') assert doc[2].lemma_ == 'work'
Add test for 1305: Incorrect lemmatization of VBZ for Englishimport pytest @pytest.mark.models('en') def test_issue1305(EN): '''Test lemmatization of English VBZ''' assert EN.vocab.morphology.lemmatizer('works', 'verb') == set(['work']) doc = EN(u'This app works well') assert doc[2].lemma_ == 'work'
<commit_before><commit_msg>Add test for 1305: Incorrect lemmatization of VBZ for English<commit_after>import pytest @pytest.mark.models('en') def test_issue1305(EN): '''Test lemmatization of English VBZ''' assert EN.vocab.morphology.lemmatizer('works', 'verb') == set(['work']) doc = EN(u'This app works wel...
5a27efc55634efb52efe238488c6078ba397b2dc
ereuse_devicehub/scripts/updates/re_materialize_events_in_devices.py
ereuse_devicehub/scripts/updates/re_materialize_events_in_devices.py
import pymongo from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.device.hooks import MaterializeEvents from ereuse_devicehub.resources.event.device import DeviceEventDomain from ereuse_devicehub.scripts.updates.update import Update from ereuse_devicehub.utils import Nami...
Add ReMaterializeEventsInDevices to use in update.py
Add ReMaterializeEventsInDevices to use in update.py
Python
agpl-3.0
eReuse/DeviceHub,eReuse/DeviceHub
Add ReMaterializeEventsInDevices to use in update.py
import pymongo from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.device.hooks import MaterializeEvents from ereuse_devicehub.resources.event.device import DeviceEventDomain from ereuse_devicehub.scripts.updates.update import Update from ereuse_devicehub.utils import Nami...
<commit_before><commit_msg>Add ReMaterializeEventsInDevices to use in update.py<commit_after>
import pymongo from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.device.hooks import MaterializeEvents from ereuse_devicehub.resources.event.device import DeviceEventDomain from ereuse_devicehub.scripts.updates.update import Update from ereuse_devicehub.utils import Nami...
Add ReMaterializeEventsInDevices to use in update.pyimport pymongo from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.device.hooks import MaterializeEvents from ereuse_devicehub.resources.event.device import DeviceEventDomain from ereuse_devicehub.scripts.updates.update i...
<commit_before><commit_msg>Add ReMaterializeEventsInDevices to use in update.py<commit_after>import pymongo from ereuse_devicehub.resources.device.domain import DeviceDomain from ereuse_devicehub.resources.device.hooks import MaterializeEvents from ereuse_devicehub.resources.event.device import DeviceEventDomain from ...
833a61b13dbd10bc3c3016fbd1874ecd98cc7753
cla_backend/apps/legalaid/migrations/0022_default_contact_for_research_methods.py
cla_backend/apps/legalaid/migrations/0022_default_contact_for_research_methods.py
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations import uuid from cla_common.constants import RESEARCH_CONTACT_VIA def create_default_contact_for_research_methods(apps, schema_editor): ContactResearchMethods = apps.get_model("legalaid", "ContactResearchMethod") ...
Create default conatct for research methods
Create default conatct for research methods
Python
mit
ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend,ministryofjustice/cla_backend
Create default conatct for research methods
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations import uuid from cla_common.constants import RESEARCH_CONTACT_VIA def create_default_contact_for_research_methods(apps, schema_editor): ContactResearchMethods = apps.get_model("legalaid", "ContactResearchMethod") ...
<commit_before><commit_msg>Create default conatct for research methods<commit_after>
# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations import uuid from cla_common.constants import RESEARCH_CONTACT_VIA def create_default_contact_for_research_methods(apps, schema_editor): ContactResearchMethods = apps.get_model("legalaid", "ContactResearchMethod") ...
Create default conatct for research methods# -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations import uuid from cla_common.constants import RESEARCH_CONTACT_VIA def create_default_contact_for_research_methods(apps, schema_editor): ContactResearchMethods = apps.get_mod...
<commit_before><commit_msg>Create default conatct for research methods<commit_after># -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations import uuid from cla_common.constants import RESEARCH_CONTACT_VIA def create_default_contact_for_research_methods(apps, schema_editor): ...
6d7999a54745fc2d0451b8cf6eff7a87162ababa
tools/dmqmc/finite_temp_analysis.py
tools/dmqmc/finite_temp_analysis.py
#!/usr/bin/python '''finite_temp_analysis.py [options] file_1 file_2 ... file_N Analyse the output of a HANDE DMQMC calculation by averaging temperature-dependent data across beta loops.''' import pandas as pd from os import path import sys sys.path.append(path.join(path.abspath(path.dirname(sys.argv[0])), 'pyblock')...
Work begun on replacing old DMQMC script with a pyhande-based script.
Work begun on replacing old DMQMC script with a pyhande-based script.
Python
lgpl-2.1
hande-qmc/hande,ruthfranklin/hande,hande-qmc/hande,hande-qmc/hande,hande-qmc/hande,hande-qmc/hande
Work begun on replacing old DMQMC script with a pyhande-based script.
#!/usr/bin/python '''finite_temp_analysis.py [options] file_1 file_2 ... file_N Analyse the output of a HANDE DMQMC calculation by averaging temperature-dependent data across beta loops.''' import pandas as pd from os import path import sys sys.path.append(path.join(path.abspath(path.dirname(sys.argv[0])), 'pyblock')...
<commit_before><commit_msg>Work begun on replacing old DMQMC script with a pyhande-based script.<commit_after>
#!/usr/bin/python '''finite_temp_analysis.py [options] file_1 file_2 ... file_N Analyse the output of a HANDE DMQMC calculation by averaging temperature-dependent data across beta loops.''' import pandas as pd from os import path import sys sys.path.append(path.join(path.abspath(path.dirname(sys.argv[0])), 'pyblock')...
Work begun on replacing old DMQMC script with a pyhande-based script.#!/usr/bin/python '''finite_temp_analysis.py [options] file_1 file_2 ... file_N Analyse the output of a HANDE DMQMC calculation by averaging temperature-dependent data across beta loops.''' import pandas as pd from os import path import sys sys.path...
<commit_before><commit_msg>Work begun on replacing old DMQMC script with a pyhande-based script.<commit_after>#!/usr/bin/python '''finite_temp_analysis.py [options] file_1 file_2 ... file_N Analyse the output of a HANDE DMQMC calculation by averaging temperature-dependent data across beta loops.''' import pandas as p...
b7c84f47dd261e8270f2f9d4a37aacac316516a4
CodeFights/knapsackLight.py
CodeFights/knapsackLight.py
#!/usr/local/bin/python # Code Fights Knapsack Problem def knapsackLight(value1, weight1, value2, weight2, maxW): if weight1 + weight2 <= maxW: return value1 + value2 else: return max([v for v, w in zip((value1, value2), (weight1, weight2)) if w <= maxW] + [0]) def main():...
Set up Code Fights knapsack light problem
Set up Code Fights knapsack light problem
Python
mit
HKuz/Test_Code
Set up Code Fights knapsack light problem
#!/usr/local/bin/python # Code Fights Knapsack Problem def knapsackLight(value1, weight1, value2, weight2, maxW): if weight1 + weight2 <= maxW: return value1 + value2 else: return max([v for v, w in zip((value1, value2), (weight1, weight2)) if w <= maxW] + [0]) def main():...
<commit_before><commit_msg>Set up Code Fights knapsack light problem<commit_after>
#!/usr/local/bin/python # Code Fights Knapsack Problem def knapsackLight(value1, weight1, value2, weight2, maxW): if weight1 + weight2 <= maxW: return value1 + value2 else: return max([v for v, w in zip((value1, value2), (weight1, weight2)) if w <= maxW] + [0]) def main():...
Set up Code Fights knapsack light problem#!/usr/local/bin/python # Code Fights Knapsack Problem def knapsackLight(value1, weight1, value2, weight2, maxW): if weight1 + weight2 <= maxW: return value1 + value2 else: return max([v for v, w in zip((value1, value2), (weight1, weight2)) ...
<commit_before><commit_msg>Set up Code Fights knapsack light problem<commit_after>#!/usr/local/bin/python # Code Fights Knapsack Problem def knapsackLight(value1, weight1, value2, weight2, maxW): if weight1 + weight2 <= maxW: return value1 + value2 else: return max([v for v, w in zip((value1, ...
d190a376442dd5e9516b7bef802369a5fe318f03
find_primes.py
find_primes.py
#!/usr/bin/env python2 def find_primes(limit): primes = [] for candidate in range(2, limit + 1): candidate_ok = True for divisor in range(2, candidate): if candidate % divisor == 0: candidate_ok = False break if candidate_ok: pr...
Implement the 'trial division' algorithm.
Implement the 'trial division' algorithm.
Python
mit
ipqb/bootcamp-primes-activity
Implement the 'trial division' algorithm.
#!/usr/bin/env python2 def find_primes(limit): primes = [] for candidate in range(2, limit + 1): candidate_ok = True for divisor in range(2, candidate): if candidate % divisor == 0: candidate_ok = False break if candidate_ok: pr...
<commit_before><commit_msg>Implement the 'trial division' algorithm.<commit_after>
#!/usr/bin/env python2 def find_primes(limit): primes = [] for candidate in range(2, limit + 1): candidate_ok = True for divisor in range(2, candidate): if candidate % divisor == 0: candidate_ok = False break if candidate_ok: pr...
Implement the 'trial division' algorithm.#!/usr/bin/env python2 def find_primes(limit): primes = [] for candidate in range(2, limit + 1): candidate_ok = True for divisor in range(2, candidate): if candidate % divisor == 0: candidate_ok = False break...
<commit_before><commit_msg>Implement the 'trial division' algorithm.<commit_after>#!/usr/bin/env python2 def find_primes(limit): primes = [] for candidate in range(2, limit + 1): candidate_ok = True for divisor in range(2, candidate): if candidate % divisor == 0: c...
2b880e0a06c41bb17f21fdcca979311a5a478958
problem_49.py
problem_49.py
from time import time from problem_35 import is_prime def is_list_of_permutations(ls): permutations = set([''.join(set(str(num))) for num in ls]) return len(permutations) == 1 def main(): primes = [i for i in range(1000, 10000) if is_prime(i)] primes_set = set(primes) found_lists = [] while...
Add problem 49, prime permutations/same diff sequence
Add problem 49, prime permutations/same diff sequence
Python
mit
dimkarakostas/project-euler
Add problem 49, prime permutations/same diff sequence
from time import time from problem_35 import is_prime def is_list_of_permutations(ls): permutations = set([''.join(set(str(num))) for num in ls]) return len(permutations) == 1 def main(): primes = [i for i in range(1000, 10000) if is_prime(i)] primes_set = set(primes) found_lists = [] while...
<commit_before><commit_msg>Add problem 49, prime permutations/same diff sequence<commit_after>
from time import time from problem_35 import is_prime def is_list_of_permutations(ls): permutations = set([''.join(set(str(num))) for num in ls]) return len(permutations) == 1 def main(): primes = [i for i in range(1000, 10000) if is_prime(i)] primes_set = set(primes) found_lists = [] while...
Add problem 49, prime permutations/same diff sequencefrom time import time from problem_35 import is_prime def is_list_of_permutations(ls): permutations = set([''.join(set(str(num))) for num in ls]) return len(permutations) == 1 def main(): primes = [i for i in range(1000, 10000) if is_prime(i)] pri...
<commit_before><commit_msg>Add problem 49, prime permutations/same diff sequence<commit_after>from time import time from problem_35 import is_prime def is_list_of_permutations(ls): permutations = set([''.join(set(str(num))) for num in ls]) return len(permutations) == 1 def main(): primes = [i for i in r...
eb5ca1f54e5631c57a735044ca34063d72e6fc4d
ynr/apps/official_documents/management/commands/official_documents_check_hashes.py
ynr/apps/official_documents/management/commands/official_documents_check_hashes.py
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from compat import BufferDictWriter import requests import hashlib from django.core.management.base import BaseCommand from official_documents.models import OfficialDocument class Command(BaseCommand): help = "Check the hash of a ...
Add management command for checking SOPN files after download
Add management command for checking SOPN files after download
Python
agpl-3.0
DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative
Add management command for checking SOPN files after download
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from compat import BufferDictWriter import requests import hashlib from django.core.management.base import BaseCommand from official_documents.models import OfficialDocument class Command(BaseCommand): help = "Check the hash of a ...
<commit_before><commit_msg>Add management command for checking SOPN files after download<commit_after>
# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from compat import BufferDictWriter import requests import hashlib from django.core.management.base import BaseCommand from official_documents.models import OfficialDocument class Command(BaseCommand): help = "Check the hash of a ...
Add management command for checking SOPN files after download# -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from compat import BufferDictWriter import requests import hashlib from django.core.management.base import BaseCommand from official_documents.models import OfficialDocument ...
<commit_before><commit_msg>Add management command for checking SOPN files after download<commit_after># -*- coding: utf-8 -*- from __future__ import print_function, unicode_literals from compat import BufferDictWriter import requests import hashlib from django.core.management.base import BaseCommand from official_do...
865eda47ddcec937ab22fa39503cebb11a754a69
examples/line_example.py
examples/line_example.py
# -*- coding: utf-8 -*- '''Test of Folium polylines''' import folium # Coordinates are 15 points on the great circle from Boston to # San Francisco. # Reference: http://williams.best.vwh.net/avform.htm#Intermediate coordinates = [ [ 42.3581 , -71.0636 ], [ 42.82995815, -74.78991444], [ 43.1792...
Add simple example demonstrating line()
Add simple example demonstrating line()
Python
mit
zhoujh30/folium,koldunovn/folium,shankari/folium,BibMartin/folium,QuLogic/folium,kod3r/folium,koldunovn/folium,talespaiva/folium,koldunovn/folium,talespaiva/folium,talespaiva/folium,python-visualization/folium,LACMTA/folium,QuLogic/folium,UDST/folium,andrewgiessel/folium,xujun10110/folium,themiurgo/folium,BibMartin/fol...
Add simple example demonstrating line()
# -*- coding: utf-8 -*- '''Test of Folium polylines''' import folium # Coordinates are 15 points on the great circle from Boston to # San Francisco. # Reference: http://williams.best.vwh.net/avform.htm#Intermediate coordinates = [ [ 42.3581 , -71.0636 ], [ 42.82995815, -74.78991444], [ 43.1792...
<commit_before><commit_msg>Add simple example demonstrating line()<commit_after>
# -*- coding: utf-8 -*- '''Test of Folium polylines''' import folium # Coordinates are 15 points on the great circle from Boston to # San Francisco. # Reference: http://williams.best.vwh.net/avform.htm#Intermediate coordinates = [ [ 42.3581 , -71.0636 ], [ 42.82995815, -74.78991444], [ 43.1792...
Add simple example demonstrating line()# -*- coding: utf-8 -*- '''Test of Folium polylines''' import folium # Coordinates are 15 points on the great circle from Boston to # San Francisco. # Reference: http://williams.best.vwh.net/avform.htm#Intermediate coordinates = [ [ 42.3581 , -71.0636 ], [ 42.8...
<commit_before><commit_msg>Add simple example demonstrating line()<commit_after># -*- coding: utf-8 -*- '''Test of Folium polylines''' import folium # Coordinates are 15 points on the great circle from Boston to # San Francisco. # Reference: http://williams.best.vwh.net/avform.htm#Intermediate coordinates = [ [ ...
ac6bdbee50c4f5feb54d111f98a29d31099f7e7f
plugins/groups/migrations/0004_auto_20150508_1300.py
plugins/groups/migrations/0004_auto_20150508_1300.py
"""Move github urls into custom properties.""" # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType import json def migrate_github_urls(apps, schema_editor): """Mo...
Migrate Github URL to custom properties
Migrate Github URL to custom properties
Python
mit
happeninghq/happening,happeninghq/happening,jscott1989/happening,jscott1989/happening,jscott1989/happening,jscott1989/happening,happeninghq/happening,happeninghq/happening
Migrate Github URL to custom properties
"""Move github urls into custom properties.""" # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType import json def migrate_github_urls(apps, schema_editor): """Mo...
<commit_before><commit_msg>Migrate Github URL to custom properties<commit_after>
"""Move github urls into custom properties.""" # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType import json def migrate_github_urls(apps, schema_editor): """Mo...
Migrate Github URL to custom properties"""Move github urls into custom properties.""" # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import ContentType import json def migrate_gith...
<commit_before><commit_msg>Migrate Github URL to custom properties<commit_after>"""Move github urls into custom properties.""" # -*- coding: utf-8 -*- from __future__ import unicode_literals from django.db import migrations from django.contrib.auth import get_user_model from django.contrib.contenttypes.models import C...
0cdd3213d0da5241b1a266db7d698d569bf10faa
bin/get-ec2-ip.py
bin/get-ec2-ip.py
#!/usr/bin/env /Users/alexrudy/.pyenv/versions/bitly-boto/bin/python import boto3 import click import re import tempfile from pathlib import Path @click.command() @click.option("--name", type=str, help="Name of the EC2 instance to query for.", required=True) @click.option("--hostname", type=str, help="Hostname in the...
Add a script to get an EC2 IP address and add to SSH config.
Add a script to get an EC2 IP address and add to SSH config.
Python
mit
alexrudy/dotfiles,alexrudy/dotfiles,alexrudy/dotfiles
Add a script to get an EC2 IP address and add to SSH config.
#!/usr/bin/env /Users/alexrudy/.pyenv/versions/bitly-boto/bin/python import boto3 import click import re import tempfile from pathlib import Path @click.command() @click.option("--name", type=str, help="Name of the EC2 instance to query for.", required=True) @click.option("--hostname", type=str, help="Hostname in the...
<commit_before><commit_msg>Add a script to get an EC2 IP address and add to SSH config.<commit_after>
#!/usr/bin/env /Users/alexrudy/.pyenv/versions/bitly-boto/bin/python import boto3 import click import re import tempfile from pathlib import Path @click.command() @click.option("--name", type=str, help="Name of the EC2 instance to query for.", required=True) @click.option("--hostname", type=str, help="Hostname in the...
Add a script to get an EC2 IP address and add to SSH config.#!/usr/bin/env /Users/alexrudy/.pyenv/versions/bitly-boto/bin/python import boto3 import click import re import tempfile from pathlib import Path @click.command() @click.option("--name", type=str, help="Name of the EC2 instance to query for.", required=True)...
<commit_before><commit_msg>Add a script to get an EC2 IP address and add to SSH config.<commit_after>#!/usr/bin/env /Users/alexrudy/.pyenv/versions/bitly-boto/bin/python import boto3 import click import re import tempfile from pathlib import Path @click.command() @click.option("--name", type=str, help="Name of the EC...
dc53989363609e237586ab744bc900bcb979b14c
fabfile.py
fabfile.py
from fabric.api import cd, run def deploy(): with cd('who-broke-build-slack'): run('git reset --hard HEAD') run('git pull origin master') run('cp ../settings.py .') try: run("kill $(ps -ef | grep [w]ho_broke_build | awk '{print $2}')") except: pass ...
Add fab command to deploy
Add fab command to deploy
Python
mit
prontodev/who-broke-build-slack,prontodev/who-broke-build-slack,zkan/who-broke-build-slack,mrteera/who-broke-build-slack,mrteera/who-broke-build-slack,zkan/who-broke-build-slack
Add fab command to deploy
from fabric.api import cd, run def deploy(): with cd('who-broke-build-slack'): run('git reset --hard HEAD') run('git pull origin master') run('cp ../settings.py .') try: run("kill $(ps -ef | grep [w]ho_broke_build | awk '{print $2}')") except: pass ...
<commit_before><commit_msg>Add fab command to deploy<commit_after>
from fabric.api import cd, run def deploy(): with cd('who-broke-build-slack'): run('git reset --hard HEAD') run('git pull origin master') run('cp ../settings.py .') try: run("kill $(ps -ef | grep [w]ho_broke_build | awk '{print $2}')") except: pass ...
Add fab command to deployfrom fabric.api import cd, run def deploy(): with cd('who-broke-build-slack'): run('git reset --hard HEAD') run('git pull origin master') run('cp ../settings.py .') try: run("kill $(ps -ef | grep [w]ho_broke_build | awk '{print $2}')") e...
<commit_before><commit_msg>Add fab command to deploy<commit_after>from fabric.api import cd, run def deploy(): with cd('who-broke-build-slack'): run('git reset --hard HEAD') run('git pull origin master') run('cp ../settings.py .') try: run("kill $(ps -ef | grep [w]ho_br...
c27736f169330cb2ffcba3f3260c6e5242c84f4d
scripts/40-convert_to_tcx.py
scripts/40-convert_to_tcx.py
#!/usr/bin/python # # Script to run the FIT-to-TCX converter on every new FIT file that is being # downloaded by Garmin-Extractor. # # Adjust the fittotcx path to point to where you have put the FIT-to-TCX files. # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, ...
Add a script that converts FIT files to TCX files
Add a script that converts FIT files to TCX files - Requires FIT-to-TCX to convert files - Requires you to set the fittotcx variable to work
Python
mit
ddboline/Garmin-Forerunner-610-Extractor_fork
Add a script that converts FIT files to TCX files - Requires FIT-to-TCX to convert files - Requires you to set the fittotcx variable to work
#!/usr/bin/python # # Script to run the FIT-to-TCX converter on every new FIT file that is being # downloaded by Garmin-Extractor. # # Adjust the fittotcx path to point to where you have put the FIT-to-TCX files. # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, ...
<commit_before><commit_msg>Add a script that converts FIT files to TCX files - Requires FIT-to-TCX to convert files - Requires you to set the fittotcx variable to work<commit_after>
#!/usr/bin/python # # Script to run the FIT-to-TCX converter on every new FIT file that is being # downloaded by Garmin-Extractor. # # Adjust the fittotcx path to point to where you have put the FIT-to-TCX files. # # Copyright (c) 2012, Gustav Tiger <gustav@tiger.name> # # Permission is hereby granted, free of charge, ...
Add a script that converts FIT files to TCX files - Requires FIT-to-TCX to convert files - Requires you to set the fittotcx variable to work#!/usr/bin/python # # Script to run the FIT-to-TCX converter on every new FIT file that is being # downloaded by Garmin-Extractor. # # Adjust the fittotcx path to point to where y...
<commit_before><commit_msg>Add a script that converts FIT files to TCX files - Requires FIT-to-TCX to convert files - Requires you to set the fittotcx variable to work<commit_after>#!/usr/bin/python # # Script to run the FIT-to-TCX converter on every new FIT file that is being # downloaded by Garmin-Extractor. # # Adj...
38597c1a0a65ff99f3f1779b17a98e1e3d4e8f71
backend/scripts/copyproj.py
backend/scripts/copyproj.py
#!/usr/bin/env python from optparse import OptionParser import rethinkdb as r import sys import shutil import os import errno def mkdirp(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise ...
Add script to copy over project files to a directory tree.
Add script to copy over project files to a directory tree.
Python
mit
materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org,materials-commons/materialscommons.org
Add script to copy over project files to a directory tree.
#!/usr/bin/env python from optparse import OptionParser import rethinkdb as r import sys import shutil import os import errno def mkdirp(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise ...
<commit_before><commit_msg>Add script to copy over project files to a directory tree.<commit_after>
#!/usr/bin/env python from optparse import OptionParser import rethinkdb as r import sys import shutil import os import errno def mkdirp(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdir(path): pass else: raise ...
Add script to copy over project files to a directory tree.#!/usr/bin/env python from optparse import OptionParser import rethinkdb as r import sys import shutil import os import errno def mkdirp(path): try: os.makedirs(path) except OSError as exc: if exc.errno == errno.EEXIST and os.path.isdi...
<commit_before><commit_msg>Add script to copy over project files to a directory tree.<commit_after>#!/usr/bin/env python from optparse import OptionParser import rethinkdb as r import sys import shutil import os import errno def mkdirp(path): try: os.makedirs(path) except OSError as exc: if e...
58895272867683d40f41e2082e9947ba1c80caeb
indra/tests/test_sofia.py
indra/tests/test_sofia.py
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from nose.plugins.attrib import attr from indra.sources import sofia @attr('webservice', 'nonpublic') def test_text_process_webservice(): txt = 'rainfall causes floods' sp = sofia.process_text(txt) as...
Add test for SOFIA text processing
Add test for SOFIA text processing
Python
bsd-2-clause
pvtodorov/indra,johnbachman/indra,bgyori/indra,sorgerlab/belpy,bgyori/indra,pvtodorov/indra,pvtodorov/indra,johnbachman/indra,sorgerlab/indra,johnbachman/belpy,johnbachman/belpy,pvtodorov/indra,johnbachman/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/belpy
Add test for SOFIA text processing
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from nose.plugins.attrib import attr from indra.sources import sofia @attr('webservice', 'nonpublic') def test_text_process_webservice(): txt = 'rainfall causes floods' sp = sofia.process_text(txt) as...
<commit_before><commit_msg>Add test for SOFIA text processing<commit_after>
from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from nose.plugins.attrib import attr from indra.sources import sofia @attr('webservice', 'nonpublic') def test_text_process_webservice(): txt = 'rainfall causes floods' sp = sofia.process_text(txt) as...
Add test for SOFIA text processingfrom __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from nose.plugins.attrib import attr from indra.sources import sofia @attr('webservice', 'nonpublic') def test_text_process_webservice(): txt = 'rainfall causes floods' s...
<commit_before><commit_msg>Add test for SOFIA text processing<commit_after>from __future__ import absolute_import, print_function, unicode_literals from builtins import dict, str from nose.plugins.attrib import attr from indra.sources import sofia @attr('webservice', 'nonpublic') def test_text_process_webservice():...
38481618f02521d31f69fccb3bfc72a708d25d35
django/publicmapping/redisutils.py
django/publicmapping/redisutils.py
## Utilities for Redis - mostly just a function for generating keys ## def key_gen(**kwargs): """ Key generator for linux. Determines key based on parameters supplied in kwargs. Keyword Parameters: @keyword geounit1: portable_id of a geounit @keyword geounit2: portable_id of a geounit @key...
Add redis utility for generating keys
Add redis utility for generating keys
Python
apache-2.0
JimCallahanOrlando/DistrictBuilder,JimCallahanOrlando/DistrictBuilder,JimCallahanOrlando/DistrictBuilder,JimCallahanOrlando/DistrictBuilder
Add redis utility for generating keys
## Utilities for Redis - mostly just a function for generating keys ## def key_gen(**kwargs): """ Key generator for linux. Determines key based on parameters supplied in kwargs. Keyword Parameters: @keyword geounit1: portable_id of a geounit @keyword geounit2: portable_id of a geounit @key...
<commit_before><commit_msg>Add redis utility for generating keys<commit_after>
## Utilities for Redis - mostly just a function for generating keys ## def key_gen(**kwargs): """ Key generator for linux. Determines key based on parameters supplied in kwargs. Keyword Parameters: @keyword geounit1: portable_id of a geounit @keyword geounit2: portable_id of a geounit @key...
Add redis utility for generating keys## Utilities for Redis - mostly just a function for generating keys ## def key_gen(**kwargs): """ Key generator for linux. Determines key based on parameters supplied in kwargs. Keyword Parameters: @keyword geounit1: portable_id of a geounit @keyword geouni...
<commit_before><commit_msg>Add redis utility for generating keys<commit_after>## Utilities for Redis - mostly just a function for generating keys ## def key_gen(**kwargs): """ Key generator for linux. Determines key based on parameters supplied in kwargs. Keyword Parameters: @keyword geounit1: por...
41b27191becb90d452bbf210821f7f94eb8870f2
taskwiki/cache.py
taskwiki/cache.py
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
Add initial implementation of the bulk updates
Cache: Add initial implementation of the bulk updates
Python
mit
Spirotot/taskwiki,phha/taskwiki
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
<commit_before>import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() ...
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() self.tw...
<commit_before>import copy import vim from taskwiki.task import VimwikiTask class TaskCache(object): """ A cache that holds all the tasks in the given file and prevents multiple redundant taskwarrior calls. """ def __init__(self, tw): self.uuid_cache = dict() self.cache = dict() ...
20a14eb74f79eac93c73af662ab8e997ba38ed27
tests/cli_test.py
tests/cli_test.py
"""tldextract integration tests.""" import sys import pytest from tldextract.cli import main def test_cli_no_input(monkeypatch): monkeypatch.setattr(sys, "argv", ["tldextract"]) with pytest.raises(SystemExit) as ex: main() assert ex.value.code == 1 def test_cli_parses_args(monkeypatch): ...
Add basic CLI test coverage
Add basic CLI test coverage
Python
bsd-3-clause
john-kurkowski/tldextract
Add basic CLI test coverage
"""tldextract integration tests.""" import sys import pytest from tldextract.cli import main def test_cli_no_input(monkeypatch): monkeypatch.setattr(sys, "argv", ["tldextract"]) with pytest.raises(SystemExit) as ex: main() assert ex.value.code == 1 def test_cli_parses_args(monkeypatch): ...
<commit_before><commit_msg>Add basic CLI test coverage<commit_after>
"""tldextract integration tests.""" import sys import pytest from tldextract.cli import main def test_cli_no_input(monkeypatch): monkeypatch.setattr(sys, "argv", ["tldextract"]) with pytest.raises(SystemExit) as ex: main() assert ex.value.code == 1 def test_cli_parses_args(monkeypatch): ...
Add basic CLI test coverage"""tldextract integration tests.""" import sys import pytest from tldextract.cli import main def test_cli_no_input(monkeypatch): monkeypatch.setattr(sys, "argv", ["tldextract"]) with pytest.raises(SystemExit) as ex: main() assert ex.value.code == 1 def test_cli_par...
<commit_before><commit_msg>Add basic CLI test coverage<commit_after>"""tldextract integration tests.""" import sys import pytest from tldextract.cli import main def test_cli_no_input(monkeypatch): monkeypatch.setattr(sys, "argv", ["tldextract"]) with pytest.raises(SystemExit) as ex: main() ass...
4dae49f56d4055bbc40cf339183a659f5eb761dd
nbstripout.py
nbstripout.py
#!/usr/bin/env python """ Clear outputs of IPython notebooks. By default, it prints the notebooks without outputs into stdout. When the --inplace option is given, all files will be overwritten. """ import sys from IPython.nbformat import current as nbformat def clear_outputs(nb): """Clear output of notebook ...
Add a script to clear outputs from notebooks
Add a script to clear outputs from notebooks Currently, it only supports in-place conversion.
Python
bsd-3-clause
ipython/ipython,ipython/ipython
Add a script to clear outputs from notebooks Currently, it only supports in-place conversion.
#!/usr/bin/env python """ Clear outputs of IPython notebooks. By default, it prints the notebooks without outputs into stdout. When the --inplace option is given, all files will be overwritten. """ import sys from IPython.nbformat import current as nbformat def clear_outputs(nb): """Clear output of notebook ...
<commit_before><commit_msg>Add a script to clear outputs from notebooks Currently, it only supports in-place conversion.<commit_after>
#!/usr/bin/env python """ Clear outputs of IPython notebooks. By default, it prints the notebooks without outputs into stdout. When the --inplace option is given, all files will be overwritten. """ import sys from IPython.nbformat import current as nbformat def clear_outputs(nb): """Clear output of notebook ...
Add a script to clear outputs from notebooks Currently, it only supports in-place conversion.#!/usr/bin/env python """ Clear outputs of IPython notebooks. By default, it prints the notebooks without outputs into stdout. When the --inplace option is given, all files will be overwritten. """ import sys from IPython...
<commit_before><commit_msg>Add a script to clear outputs from notebooks Currently, it only supports in-place conversion.<commit_after>#!/usr/bin/env python """ Clear outputs of IPython notebooks. By default, it prints the notebooks without outputs into stdout. When the --inplace option is given, all files will be ov...
3b5e295b42cfe0ecfa868f5f602ee25c097fcd81
cms_genome_browser/urls.py
cms_genome_browser/urls.py
from django.conf.urls import patterns, url from cms_genome_browser.views import BrowserListView, BrowserDetailView urlpatterns = patterns('', url(r'^$', BrowserListView.as_view(), name='browser_list'), url(r'^(?P<slug>[^/]+)$', BrowserDetailView.as_view(), name='browser_detail'), )
Define URL patterns for Browser list and detail views
Define URL patterns for Browser list and detail views
Python
bsd-3-clause
mfcovington/djangocms-genome-browser,mfcovington/djangocms-genome-browser,mfcovington/djangocms-genome-browser
Define URL patterns for Browser list and detail views
from django.conf.urls import patterns, url from cms_genome_browser.views import BrowserListView, BrowserDetailView urlpatterns = patterns('', url(r'^$', BrowserListView.as_view(), name='browser_list'), url(r'^(?P<slug>[^/]+)$', BrowserDetailView.as_view(), name='browser_detail'), )
<commit_before><commit_msg>Define URL patterns for Browser list and detail views<commit_after>
from django.conf.urls import patterns, url from cms_genome_browser.views import BrowserListView, BrowserDetailView urlpatterns = patterns('', url(r'^$', BrowserListView.as_view(), name='browser_list'), url(r'^(?P<slug>[^/]+)$', BrowserDetailView.as_view(), name='browser_detail'), )
Define URL patterns for Browser list and detail viewsfrom django.conf.urls import patterns, url from cms_genome_browser.views import BrowserListView, BrowserDetailView urlpatterns = patterns('', url(r'^$', BrowserListView.as_view(), name='browser_list'), url(r'^(?P<slug>[^/]+)$', BrowserDetailView.as_view(), n...
<commit_before><commit_msg>Define URL patterns for Browser list and detail views<commit_after>from django.conf.urls import patterns, url from cms_genome_browser.views import BrowserListView, BrowserDetailView urlpatterns = patterns('', url(r'^$', BrowserListView.as_view(), name='browser_list'), url(r'^(?P<slug...
249728ae9888eaa83c0e22d60b0ed443de1ae707
cms_lab_members/cms_app.py
cms_lab_members/cms_app.py
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from cms_lab_members.menu import LabMembersMenu class LabMembersApp(CMSApp): name = _("Lab Member App") urls = ["lab_members.urls"] app_name = "lab_me...
Add Lab Members CMS app
Add Lab Members CMS app
Python
bsd-3-clause
mfcovington/djangocms-lab-members,mfcovington/djangocms-lab-members
Add Lab Members CMS app
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from cms_lab_members.menu import LabMembersMenu class LabMembersApp(CMSApp): name = _("Lab Member App") urls = ["lab_members.urls"] app_name = "lab_me...
<commit_before><commit_msg>Add Lab Members CMS app<commit_after>
# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from cms_lab_members.menu import LabMembersMenu class LabMembersApp(CMSApp): name = _("Lab Member App") urls = ["lab_members.urls"] app_name = "lab_me...
Add Lab Members CMS app# -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from cms_lab_members.menu import LabMembersMenu class LabMembersApp(CMSApp): name = _("Lab Member App") urls = ["lab_members.urls"]...
<commit_before><commit_msg>Add Lab Members CMS app<commit_after># -*- coding: utf-8 -*- from django.utils.translation import ugettext_lazy as _ from cms.app_base import CMSApp from cms.apphook_pool import apphook_pool from cms_lab_members.menu import LabMembersMenu class LabMembersApp(CMSApp): name = _("Lab Mem...
155966c9d2e02714988e9284dffe6ad25c26dd58
salt/modules/slsutil.py
salt/modules/slsutil.py
# -*- coding: utf-8 -*- ''' Utility functions for use with or in SLS files ''' from __future__ import absolute_import from salt.utils.dictupdate import merge, update update.__doc__ = update.__doc__ + '''\ CLI Example: .. code-block:: shell salt '*' slsutil.update '{foo: Foo}' '{bar: Bar}' ''' merge.__doc__ =...
Add execution module for working in sls files
Add execution module for working in sls files
Python
apache-2.0
saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt
Add execution module for working in sls files
# -*- coding: utf-8 -*- ''' Utility functions for use with or in SLS files ''' from __future__ import absolute_import from salt.utils.dictupdate import merge, update update.__doc__ = update.__doc__ + '''\ CLI Example: .. code-block:: shell salt '*' slsutil.update '{foo: Foo}' '{bar: Bar}' ''' merge.__doc__ =...
<commit_before><commit_msg>Add execution module for working in sls files<commit_after>
# -*- coding: utf-8 -*- ''' Utility functions for use with or in SLS files ''' from __future__ import absolute_import from salt.utils.dictupdate import merge, update update.__doc__ = update.__doc__ + '''\ CLI Example: .. code-block:: shell salt '*' slsutil.update '{foo: Foo}' '{bar: Bar}' ''' merge.__doc__ =...
Add execution module for working in sls files# -*- coding: utf-8 -*- ''' Utility functions for use with or in SLS files ''' from __future__ import absolute_import from salt.utils.dictupdate import merge, update update.__doc__ = update.__doc__ + '''\ CLI Example: .. code-block:: shell salt '*' slsutil.update '{...
<commit_before><commit_msg>Add execution module for working in sls files<commit_after># -*- coding: utf-8 -*- ''' Utility functions for use with or in SLS files ''' from __future__ import absolute_import from salt.utils.dictupdate import merge, update update.__doc__ = update.__doc__ + '''\ CLI Example: .. code-bloc...
962b6374a1fe81a0650c7a840e8cc990ede6b65a
sharing_variables.py
sharing_variables.py
# Sharing variables # Example code to use a shared threshold variable for all ReLUs # Create var and pass it to relu() function import tensorflow as tf import numpy as np def relu(X, threshold): with tf.name_scope('relu'): #[...........] return tf.maximum(z, threshold, name='max') threshold = tf....
Add code on how to share variables
Add code on how to share variables Add code on sharing variables between different nodes in the graph
Python
mit
KT12/hands_on_machine_learning
Add code on how to share variables Add code on sharing variables between different nodes in the graph
# Sharing variables # Example code to use a shared threshold variable for all ReLUs # Create var and pass it to relu() function import tensorflow as tf import numpy as np def relu(X, threshold): with tf.name_scope('relu'): #[...........] return tf.maximum(z, threshold, name='max') threshold = tf....
<commit_before><commit_msg>Add code on how to share variables Add code on sharing variables between different nodes in the graph<commit_after>
# Sharing variables # Example code to use a shared threshold variable for all ReLUs # Create var and pass it to relu() function import tensorflow as tf import numpy as np def relu(X, threshold): with tf.name_scope('relu'): #[...........] return tf.maximum(z, threshold, name='max') threshold = tf....
Add code on how to share variables Add code on sharing variables between different nodes in the graph# Sharing variables # Example code to use a shared threshold variable for all ReLUs # Create var and pass it to relu() function import tensorflow as tf import numpy as np def relu(X, threshold): with tf.name_scop...
<commit_before><commit_msg>Add code on how to share variables Add code on sharing variables between different nodes in the graph<commit_after># Sharing variables # Example code to use a shared threshold variable for all ReLUs # Create var and pass it to relu() function import tensorflow as tf import numpy as np def ...
ed33f5cd2871cd2e484119dbe3ce962f3ae15c5d
core/tests/test_mngment.py
core/tests/test_mngment.py
from django.core.management import call_command from .utils import BaseTestCase as TestCase from core.models import User, Group, Game, GameTag import sys from cStringIO import StringIO class CommandsTestCase(TestCase): def test_makedata(self): "Test makedata command." # Want to hide STDOUT becaus...
Add mngment command test case.
Add mngment command test case.
Python
mit
joshsamara/game-website,joshsamara/game-website,joshsamara/game-website
Add mngment command test case.
from django.core.management import call_command from .utils import BaseTestCase as TestCase from core.models import User, Group, Game, GameTag import sys from cStringIO import StringIO class CommandsTestCase(TestCase): def test_makedata(self): "Test makedata command." # Want to hide STDOUT becaus...
<commit_before><commit_msg>Add mngment command test case.<commit_after>
from django.core.management import call_command from .utils import BaseTestCase as TestCase from core.models import User, Group, Game, GameTag import sys from cStringIO import StringIO class CommandsTestCase(TestCase): def test_makedata(self): "Test makedata command." # Want to hide STDOUT becaus...
Add mngment command test case.from django.core.management import call_command from .utils import BaseTestCase as TestCase from core.models import User, Group, Game, GameTag import sys from cStringIO import StringIO class CommandsTestCase(TestCase): def test_makedata(self): "Test makedata command." ...
<commit_before><commit_msg>Add mngment command test case.<commit_after>from django.core.management import call_command from .utils import BaseTestCase as TestCase from core.models import User, Group, Game, GameTag import sys from cStringIO import StringIO class CommandsTestCase(TestCase): def test_makedata(self):...
2312feefcac891645c5e02d3b75a97bbc96bc205
uniqueids/tasks.py
uniqueids/tasks.py
from celery.task import Task from celery.utils.log import get_task_logger from familyconnect_registration import utils logger = get_task_logger(__name__) class AddUniqueIDToIdentity(Task): def run(self, identity, unique_id, write_to, **kwargs): """ identity: the identity to receive the payl...
Add identity patching for post unique ID generation
Add identity patching for post unique ID generation
Python
bsd-3-clause
praekelt/familyconnect-registration,praekelt/familyconnect-registration
Add identity patching for post unique ID generation
from celery.task import Task from celery.utils.log import get_task_logger from familyconnect_registration import utils logger = get_task_logger(__name__) class AddUniqueIDToIdentity(Task): def run(self, identity, unique_id, write_to, **kwargs): """ identity: the identity to receive the payl...
<commit_before><commit_msg>Add identity patching for post unique ID generation<commit_after>
from celery.task import Task from celery.utils.log import get_task_logger from familyconnect_registration import utils logger = get_task_logger(__name__) class AddUniqueIDToIdentity(Task): def run(self, identity, unique_id, write_to, **kwargs): """ identity: the identity to receive the payl...
Add identity patching for post unique ID generationfrom celery.task import Task from celery.utils.log import get_task_logger from familyconnect_registration import utils logger = get_task_logger(__name__) class AddUniqueIDToIdentity(Task): def run(self, identity, unique_id, write_to, **kwargs): """ ...
<commit_before><commit_msg>Add identity patching for post unique ID generation<commit_after>from celery.task import Task from celery.utils.log import get_task_logger from familyconnect_registration import utils logger = get_task_logger(__name__) class AddUniqueIDToIdentity(Task): def run(self, identity, unique...
60368c4b7d3d48945381aac89e95217a58c1e3a4
politics/__init__.py
politics/__init__.py
# encoding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License")...
Add module info for politics.
Add module info for politics.
Python
apache-2.0
chrismattmann/politics-hacking
Add module info for politics.
# encoding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License")...
<commit_before><commit_msg>Add module info for politics.<commit_after>
# encoding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, Version 2.0 # (the "License")...
Add module info for politics.# encoding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses this file to You under the Apache License, ...
<commit_before><commit_msg>Add module info for politics.<commit_after># encoding: utf-8 # Licensed to the Apache Software Foundation (ASF) under one or more # contributor license agreements. See the NOTICE file distributed with # this work for additional information regarding copyright ownership. # The ASF licenses th...
3cb26b7b3d62dbff5e457ee6b3ed30283c8d0e62
python/util/Openable.py
python/util/Openable.py
from __future__ import absolute_import, division, print_function, unicode_literals class Openable(object): def __init__(self): self.is_open = True def close(self): self.is_open = False def __enter__(self): return self def __exit__(self, type, value, traceback): self.close()
Add missing files from Mac
Add missing files from Mac
Python
mit
rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh,rec/echomesh
Add missing files from Mac
from __future__ import absolute_import, division, print_function, unicode_literals class Openable(object): def __init__(self): self.is_open = True def close(self): self.is_open = False def __enter__(self): return self def __exit__(self, type, value, traceback): self.close()
<commit_before><commit_msg>Add missing files from Mac<commit_after>
from __future__ import absolute_import, division, print_function, unicode_literals class Openable(object): def __init__(self): self.is_open = True def close(self): self.is_open = False def __enter__(self): return self def __exit__(self, type, value, traceback): self.close()
Add missing files from Macfrom __future__ import absolute_import, division, print_function, unicode_literals class Openable(object): def __init__(self): self.is_open = True def close(self): self.is_open = False def __enter__(self): return self def __exit__(self, type, value, traceback): self...
<commit_before><commit_msg>Add missing files from Mac<commit_after>from __future__ import absolute_import, division, print_function, unicode_literals class Openable(object): def __init__(self): self.is_open = True def close(self): self.is_open = False def __enter__(self): return self def __exit_...
cb0f24cd872b254ecbf8697a2d3cc09a4512d523
py/relative-ranks.py
py/relative-ranks.py
from operator import itemgetter class Solution(object): def findRelativeRanks(self, nums): """ :type nums: List[int] :rtype: List[str] """ withRank = list(enumerate(sorted(list(enumerate(nums)), key=itemgetter(1), reverse=True), 1)) top3 = ["Gold Medal", "Silver Medal...
Add py solution for 506. Relative Ranks
Add py solution for 506. Relative Ranks 506. Relative Ranks: https://leetcode.com/problems/relative-ranks/
Python
apache-2.0
ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode
Add py solution for 506. Relative Ranks 506. Relative Ranks: https://leetcode.com/problems/relative-ranks/
from operator import itemgetter class Solution(object): def findRelativeRanks(self, nums): """ :type nums: List[int] :rtype: List[str] """ withRank = list(enumerate(sorted(list(enumerate(nums)), key=itemgetter(1), reverse=True), 1)) top3 = ["Gold Medal", "Silver Medal...
<commit_before><commit_msg>Add py solution for 506. Relative Ranks 506. Relative Ranks: https://leetcode.com/problems/relative-ranks/<commit_after>
from operator import itemgetter class Solution(object): def findRelativeRanks(self, nums): """ :type nums: List[int] :rtype: List[str] """ withRank = list(enumerate(sorted(list(enumerate(nums)), key=itemgetter(1), reverse=True), 1)) top3 = ["Gold Medal", "Silver Medal...
Add py solution for 506. Relative Ranks 506. Relative Ranks: https://leetcode.com/problems/relative-ranks/from operator import itemgetter class Solution(object): def findRelativeRanks(self, nums): """ :type nums: List[int] :rtype: List[str] """ withRank = list(enumerate(sort...
<commit_before><commit_msg>Add py solution for 506. Relative Ranks 506. Relative Ranks: https://leetcode.com/problems/relative-ranks/<commit_after>from operator import itemgetter class Solution(object): def findRelativeRanks(self, nums): """ :type nums: List[int] :rtype: List[str] "...
fb3c09c08e4c40230f6434708c61f27587c7e5d7
lintcode/Medium/179_Update_Bits.py
lintcode/Medium/179_Update_Bits.py
class Solution: #@param n, m: Two integer #@param i, j: Two bit positions #return: An integer def updateBits(self, n, m, i, j): # write your code here def twosComplement(num): result = num if (result < 0): result *= -1 result = resu...
Add solution to lintcode problem 179
Add solution to lintcode problem 179
Python
mit
Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode
Add solution to lintcode problem 179
class Solution: #@param n, m: Two integer #@param i, j: Two bit positions #return: An integer def updateBits(self, n, m, i, j): # write your code here def twosComplement(num): result = num if (result < 0): result *= -1 result = resu...
<commit_before><commit_msg>Add solution to lintcode problem 179<commit_after>
class Solution: #@param n, m: Two integer #@param i, j: Two bit positions #return: An integer def updateBits(self, n, m, i, j): # write your code here def twosComplement(num): result = num if (result < 0): result *= -1 result = resu...
Add solution to lintcode problem 179class Solution: #@param n, m: Two integer #@param i, j: Two bit positions #return: An integer def updateBits(self, n, m, i, j): # write your code here def twosComplement(num): result = num if (result < 0): result...
<commit_before><commit_msg>Add solution to lintcode problem 179<commit_after>class Solution: #@param n, m: Two integer #@param i, j: Two bit positions #return: An integer def updateBits(self, n, m, i, j): # write your code here def twosComplement(num): result = num ...
8cd3f3370bcf89e4b78a0bbffa2246f467facb52
problem1/steiner-prim.py
problem1/steiner-prim.py
import networkx as nx from heapq import * from sys import argv def main(): G = nx.read_gml(argv[1]) terms = [i for i,d in G.nodes(data=True) if d['T']] edges = [] number_of_components = len(terms) heaps = {} for t in terms: ...
Add partial solution using combination of Prim
Add partial solution using combination of Prim
Python
mit
karulont/combopt
Add partial solution using combination of Prim
import networkx as nx from heapq import * from sys import argv def main(): G = nx.read_gml(argv[1]) terms = [i for i,d in G.nodes(data=True) if d['T']] edges = [] number_of_components = len(terms) heaps = {} for t in terms: ...
<commit_before><commit_msg>Add partial solution using combination of Prim<commit_after>
import networkx as nx from heapq import * from sys import argv def main(): G = nx.read_gml(argv[1]) terms = [i for i,d in G.nodes(data=True) if d['T']] edges = [] number_of_components = len(terms) heaps = {} for t in terms: ...
Add partial solution using combination of Primimport networkx as nx from heapq import * from sys import argv def main(): G = nx.read_gml(argv[1]) terms = [i for i,d in G.nodes(data=True) if d['T']] edges = [] number_of_components = len(terms) h...
<commit_before><commit_msg>Add partial solution using combination of Prim<commit_after>import networkx as nx from heapq import * from sys import argv def main(): G = nx.read_gml(argv[1]) terms = [i for i,d in G.nodes(data=True) if d['T']] edges = [] num...
d31fb1a875cbec26a6bcc4a0401467ed02fc4051
examples/pos/postagging.py
examples/pos/postagging.py
import collections import itertools from nltk.corpus import brown import numpy import chainer import chainer.functions as F import chainer.links as L import chainer.optimizers as O class CRF(chainer.Chain): def __init__(self, n_vocab, n_pos): super(CRF, self).__init__( embed=L.EmbedID(n_voc...
Make a pos-tagging example using CRF
Make a pos-tagging example using CRF
Python
mit
okuta/chainer,keisuke-umezawa/chainer,hvy/chainer,niboshi/chainer,okuta/chainer,okuta/chainer,okuta/chainer,chainer/chainer,chainer/chainer,ronekko/chainer,jnishi/chainer,wkentaro/chainer,hvy/chainer,keisuke-umezawa/chainer,wkentaro/chainer,anaruse/chainer,keisuke-umezawa/chainer,niboshi/chainer,tkerola/chainer,pfnet/c...
Make a pos-tagging example using CRF
import collections import itertools from nltk.corpus import brown import numpy import chainer import chainer.functions as F import chainer.links as L import chainer.optimizers as O class CRF(chainer.Chain): def __init__(self, n_vocab, n_pos): super(CRF, self).__init__( embed=L.EmbedID(n_voc...
<commit_before><commit_msg>Make a pos-tagging example using CRF<commit_after>
import collections import itertools from nltk.corpus import brown import numpy import chainer import chainer.functions as F import chainer.links as L import chainer.optimizers as O class CRF(chainer.Chain): def __init__(self, n_vocab, n_pos): super(CRF, self).__init__( embed=L.EmbedID(n_voc...
Make a pos-tagging example using CRFimport collections import itertools from nltk.corpus import brown import numpy import chainer import chainer.functions as F import chainer.links as L import chainer.optimizers as O class CRF(chainer.Chain): def __init__(self, n_vocab, n_pos): super(CRF, self).__init_...
<commit_before><commit_msg>Make a pos-tagging example using CRF<commit_after>import collections import itertools from nltk.corpus import brown import numpy import chainer import chainer.functions as F import chainer.links as L import chainer.optimizers as O class CRF(chainer.Chain): def __init__(self, n_vocab,...
282a8d120d486f15cc1e5cd9e1432c1100e722bf
examples/nogallery/create_a_dummy_hdf5_file.py
examples/nogallery/create_a_dummy_hdf5_file.py
import numpy as np import km3pipe as kp class APump(kp.Pump): def configure(self): self.index = 0 def process(self, blob): data = {'a': self.index * np.arange(5), 'b': np.arange(5) ** self.index} data2 = {'c': self.index * np.arange(10, dtype='f4') + 0.1, ...
Add a dummy script which creates an hdf5 file
Add a dummy script which creates an hdf5 file
Python
mit
tamasgal/km3pipe,tamasgal/km3pipe
Add a dummy script which creates an hdf5 file
import numpy as np import km3pipe as kp class APump(kp.Pump): def configure(self): self.index = 0 def process(self, blob): data = {'a': self.index * np.arange(5), 'b': np.arange(5) ** self.index} data2 = {'c': self.index * np.arange(10, dtype='f4') + 0.1, ...
<commit_before><commit_msg>Add a dummy script which creates an hdf5 file<commit_after>
import numpy as np import km3pipe as kp class APump(kp.Pump): def configure(self): self.index = 0 def process(self, blob): data = {'a': self.index * np.arange(5), 'b': np.arange(5) ** self.index} data2 = {'c': self.index * np.arange(10, dtype='f4') + 0.1, ...
Add a dummy script which creates an hdf5 fileimport numpy as np import km3pipe as kp class APump(kp.Pump): def configure(self): self.index = 0 def process(self, blob): data = {'a': self.index * np.arange(5), 'b': np.arange(5) ** self.index} data2 = {'c': self.index * n...
<commit_before><commit_msg>Add a dummy script which creates an hdf5 file<commit_after>import numpy as np import km3pipe as kp class APump(kp.Pump): def configure(self): self.index = 0 def process(self, blob): data = {'a': self.index * np.arange(5), 'b': np.arange(5) ** self.in...
6ee8ee2467d9c61b03a268a6b8d8ea9bc3cfe9e0
Lib/defcon/tools/fuzzyNumber.py
Lib/defcon/tools/fuzzyNumber.py
class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return '[%d %d]' % (self.value, self.threshold) def __cmp__(self, other): if abs(self.value - other.value) < self.threshold: retur...
class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return "[%f %f]" % (self.value, self.threshold) def __cmp__(self, other): if hasattr(other, "value"): if abs(self.value - other.va...
Allow for comparing to objects other than FuzzyNumber objects.
Allow for comparing to objects other than FuzzyNumber objects.
Python
mit
anthrotype/defcon,moyogo/defcon,typemytype/defcon,typesupply/defcon,adrientetar/defcon
class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return '[%d %d]' % (self.value, self.threshold) def __cmp__(self, other): if abs(self.value - other.value) < self.threshold: retur...
class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return "[%f %f]" % (self.value, self.threshold) def __cmp__(self, other): if hasattr(other, "value"): if abs(self.value - other.va...
<commit_before>class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return '[%d %d]' % (self.value, self.threshold) def __cmp__(self, other): if abs(self.value - other.value) < self.threshold: ...
class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return "[%f %f]" % (self.value, self.threshold) def __cmp__(self, other): if hasattr(other, "value"): if abs(self.value - other.va...
class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return '[%d %d]' % (self.value, self.threshold) def __cmp__(self, other): if abs(self.value - other.value) < self.threshold: retur...
<commit_before>class FuzzyNumber(object): def __init__(self, value, threshold): self.value = value self.threshold = threshold def __repr__(self): return '[%d %d]' % (self.value, self.threshold) def __cmp__(self, other): if abs(self.value - other.value) < self.threshold: ...
fbd185f06c1cd890fe5aa365a02a8ffd1de60405
course_discovery/apps/course_metadata/migrations/0064_auto_20171018_1528.py
course_discovery/apps/course_metadata/migrations/0064_auto_20171018_1528.py
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-18 15:28 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('course_metadata', '0063_auto_20171005_1931'), ] operations = [ migrations.RemoveFie...
Remove unused fields for Subject via migration
Remove unused fields for Subject via migration
Python
agpl-3.0
edx/course-discovery,edx/course-discovery,edx/course-discovery,edx/course-discovery
Remove unused fields for Subject via migration
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-18 15:28 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('course_metadata', '0063_auto_20171005_1931'), ] operations = [ migrations.RemoveFie...
<commit_before><commit_msg>Remove unused fields for Subject via migration<commit_after>
# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-18 15:28 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('course_metadata', '0063_auto_20171005_1931'), ] operations = [ migrations.RemoveFie...
Remove unused fields for Subject via migration# -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-18 15:28 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('course_metadata', '0063_auto_20171005_1931'), ] ...
<commit_before><commit_msg>Remove unused fields for Subject via migration<commit_after># -*- coding: utf-8 -*- # Generated by Django 1.11.3 on 2017-10-18 15:28 from __future__ import unicode_literals from django.db import migrations class Migration(migrations.Migration): dependencies = [ ('course_metada...
f3cfd7b980b1feda747b3142dd99a18e77a0e3cf
publisher/cms_toolbars.py
publisher/cms_toolbars.py
import logging from django.conf import settings from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool from cms.utils.urlutils import admin_reverse from publisher.models import PublisherStateModel log = logging.getLogger(__name__) ...
Add django CMS toolbar entry
Add django CMS toolbar entry
Python
bsd-3-clause
wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai,wearehoods/django-model-publisher-ai
Add django CMS toolbar entry
import logging from django.conf import settings from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool from cms.utils.urlutils import admin_reverse from publisher.models import PublisherStateModel log = logging.getLogger(__name__) ...
<commit_before><commit_msg>Add django CMS toolbar entry<commit_after>
import logging from django.conf import settings from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool from cms.utils.urlutils import admin_reverse from publisher.models import PublisherStateModel log = logging.getLogger(__name__) ...
Add django CMS toolbar entry import logging from django.conf import settings from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool from cms.utils.urlutils import admin_reverse from publisher.models import PublisherStateModel log = l...
<commit_before><commit_msg>Add django CMS toolbar entry<commit_after> import logging from django.conf import settings from django.utils.translation import ugettext_lazy as _ from cms.toolbar_base import CMSToolbar from cms.toolbar_pool import toolbar_pool from cms.utils.urlutils import admin_reverse from publisher.m...
9397e9da1c22ce7bb461586a929f70e48c39a9a1
exercises/chapter_08/exercise_08_09/exercise_08_09.py
exercises/chapter_08/exercise_08_09/exercise_08_09.py
# 8-9. Magicians def show_magicians(names): """Print each magician in the list""" for name in names: print (name) magicians = [ "Harry Houdini", "David Cooperfield", "Criss Angel", "David Blaine", ] show_magicians(magicians)
Add solution to exercise 8.9.
Add solution to exercise 8.9.
Python
mit
HenrikSamuelsson/python-crash-course
Add solution to exercise 8.9.
# 8-9. Magicians def show_magicians(names): """Print each magician in the list""" for name in names: print (name) magicians = [ "Harry Houdini", "David Cooperfield", "Criss Angel", "David Blaine", ] show_magicians(magicians)
<commit_before><commit_msg>Add solution to exercise 8.9.<commit_after>
# 8-9. Magicians def show_magicians(names): """Print each magician in the list""" for name in names: print (name) magicians = [ "Harry Houdini", "David Cooperfield", "Criss Angel", "David Blaine", ] show_magicians(magicians)
Add solution to exercise 8.9.# 8-9. Magicians def show_magicians(names): """Print each magician in the list""" for name in names: print (name) magicians = [ "Harry Houdini", "David Cooperfield", "Criss Angel", "David Blaine", ] show_magicians(magicians)
<commit_before><commit_msg>Add solution to exercise 8.9.<commit_after># 8-9. Magicians def show_magicians(names): """Print each magician in the list""" for name in names: print (name) magicians = [ "Harry Houdini", "David Cooperfield", "Criss Angel", "David Blaine", ] show_magicians(magicians)