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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
f02f8f5a68bd26d1ece32c50482729b7774b6e2a | scripts/simple-analysis.py | scripts/simple-analysis.py | #!/usr/bin/python
from __future__ import print_function, division
import networkx
from reddit_meatspace.models import MeetupConnections
connections = MeetupConnections._byID("2013")
digraph = networkx.DiGraph()
for connection, timestamp in connections._values().iteritems():
left, right = connection.split(":")
... | Add a simple script for looking at connections. | Add a simple script for looking at connections.
| Python | bsd-3-clause | reddit/reddit-plugin-meatspace,reddit/reddit-plugin-meatspace,reddit/reddit-plugin-meatspace | Add a simple script for looking at connections. | #!/usr/bin/python
from __future__ import print_function, division
import networkx
from reddit_meatspace.models import MeetupConnections
connections = MeetupConnections._byID("2013")
digraph = networkx.DiGraph()
for connection, timestamp in connections._values().iteritems():
left, right = connection.split(":")
... | <commit_before><commit_msg>Add a simple script for looking at connections.<commit_after> | #!/usr/bin/python
from __future__ import print_function, division
import networkx
from reddit_meatspace.models import MeetupConnections
connections = MeetupConnections._byID("2013")
digraph = networkx.DiGraph()
for connection, timestamp in connections._values().iteritems():
left, right = connection.split(":")
... | Add a simple script for looking at connections.#!/usr/bin/python
from __future__ import print_function, division
import networkx
from reddit_meatspace.models import MeetupConnections
connections = MeetupConnections._byID("2013")
digraph = networkx.DiGraph()
for connection, timestamp in connections._values().iterit... | <commit_before><commit_msg>Add a simple script for looking at connections.<commit_after>#!/usr/bin/python
from __future__ import print_function, division
import networkx
from reddit_meatspace.models import MeetupConnections
connections = MeetupConnections._byID("2013")
digraph = networkx.DiGraph()
for connection, ... | |
39b63523634801fe8ef2cca03e11b3875d84cdbd | flare/flare_io.py | flare/flare_io.py | from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
f = open(filename, 'w')
... | from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename: str, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
with open(filename,... | Tweak syntax for f.close() concision, add typehints | Tweak syntax for f.close() concision, add typehints | Python | mit | mir-group/flare,mir-group/flare | from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
f = open(filename, 'w')
... | from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename: str, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
with open(filename,... | <commit_before>from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
f = open(... | from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename: str, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
with open(filename,... | from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
f = open(filename, 'w')
... | <commit_before>from flare.struc import Structure
from typing import List
from json import dump, load
from flare.util import NumpyEncoder
def md_trajectory_to_file(filename, structures: List[Structure]):
"""
Take a list of structures and write them to a json file.
:param filename:
:param structures:
"""
f = open(... |
cb0d6124ea31e8fb9ff8957072a2b881b882127e | examples/hero9_timelapse_webcam.py | examples/hero9_timelapse_webcam.py | import sys
import time
from goprocam import GoProCamera, constants
import threading
import logging
"""
I use PM2 to start my GoPro cameras, using a Raspberry Pi 4, works perfectly.
pm2 start timelapse.py --cron "30 7 * * *" --log timelapse.log --no-autorestart
This script will overrride some settings for reliability... | Add Timelapse script for sunrise timelapses | Add Timelapse script for sunrise timelapses
| Python | mit | KonradIT/gopro-py-api,KonradIT/gopro-py-api | Add Timelapse script for sunrise timelapses | import sys
import time
from goprocam import GoProCamera, constants
import threading
import logging
"""
I use PM2 to start my GoPro cameras, using a Raspberry Pi 4, works perfectly.
pm2 start timelapse.py --cron "30 7 * * *" --log timelapse.log --no-autorestart
This script will overrride some settings for reliability... | <commit_before><commit_msg>Add Timelapse script for sunrise timelapses<commit_after> | import sys
import time
from goprocam import GoProCamera, constants
import threading
import logging
"""
I use PM2 to start my GoPro cameras, using a Raspberry Pi 4, works perfectly.
pm2 start timelapse.py --cron "30 7 * * *" --log timelapse.log --no-autorestart
This script will overrride some settings for reliability... | Add Timelapse script for sunrise timelapsesimport sys
import time
from goprocam import GoProCamera, constants
import threading
import logging
"""
I use PM2 to start my GoPro cameras, using a Raspberry Pi 4, works perfectly.
pm2 start timelapse.py --cron "30 7 * * *" --log timelapse.log --no-autorestart
This script w... | <commit_before><commit_msg>Add Timelapse script for sunrise timelapses<commit_after>import sys
import time
from goprocam import GoProCamera, constants
import threading
import logging
"""
I use PM2 to start my GoPro cameras, using a Raspberry Pi 4, works perfectly.
pm2 start timelapse.py --cron "30 7 * * *" --log time... | |
4651e178ddbeac9211f8170e2e20f8a35ff0e3ab | ocradmin/plugins/test_nodetree.py | ocradmin/plugins/test_nodetree.py | #!/usr/bin/python
import os
import sys
import json
sys.path.append(os.path.abspath(".."))
os.environ['DJANGO_SETTINGS_MODULE'] = 'ocradmin.settings'
sys.path.insert(0, "lib")
from nodetree import script
from nodetree.manager import ModuleManager
def run(nodelist, outpath):
manager = ModuleManager()
manager.... | Add a simple CLI script for writing out results of scripts | Add a simple CLI script for writing out results of scripts
| Python | apache-2.0 | vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium,vitorio/ocropodium | Add a simple CLI script for writing out results of scripts | #!/usr/bin/python
import os
import sys
import json
sys.path.append(os.path.abspath(".."))
os.environ['DJANGO_SETTINGS_MODULE'] = 'ocradmin.settings'
sys.path.insert(0, "lib")
from nodetree import script
from nodetree.manager import ModuleManager
def run(nodelist, outpath):
manager = ModuleManager()
manager.... | <commit_before><commit_msg>Add a simple CLI script for writing out results of scripts<commit_after> | #!/usr/bin/python
import os
import sys
import json
sys.path.append(os.path.abspath(".."))
os.environ['DJANGO_SETTINGS_MODULE'] = 'ocradmin.settings'
sys.path.insert(0, "lib")
from nodetree import script
from nodetree.manager import ModuleManager
def run(nodelist, outpath):
manager = ModuleManager()
manager.... | Add a simple CLI script for writing out results of scripts#!/usr/bin/python
import os
import sys
import json
sys.path.append(os.path.abspath(".."))
os.environ['DJANGO_SETTINGS_MODULE'] = 'ocradmin.settings'
sys.path.insert(0, "lib")
from nodetree import script
from nodetree.manager import ModuleManager
def run(node... | <commit_before><commit_msg>Add a simple CLI script for writing out results of scripts<commit_after>#!/usr/bin/python
import os
import sys
import json
sys.path.append(os.path.abspath(".."))
os.environ['DJANGO_SETTINGS_MODULE'] = 'ocradmin.settings'
sys.path.insert(0, "lib")
from nodetree import script
from nodetree.m... | |
23138ab91e5ac0ecf92a0968bf8e4abfa7d0c763 | removedups.py | removedups.py | import hashlib, csv, os
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
def process_directory_csv(current_dir_fullpath, sub_dir_list, files, csvwriter):
for file i... | Remove duplicates in all subdirectories - working raw version. | Remove duplicates in all subdirectories - working raw version.
| Python | apache-2.0 | alprab/utils | Remove duplicates in all subdirectories - working raw version. | import hashlib, csv, os
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
def process_directory_csv(current_dir_fullpath, sub_dir_list, files, csvwriter):
for file i... | <commit_before><commit_msg>Remove duplicates in all subdirectories - working raw version.<commit_after> | import hashlib, csv, os
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
def process_directory_csv(current_dir_fullpath, sub_dir_list, files, csvwriter):
for file i... | Remove duplicates in all subdirectories - working raw version.import hashlib, csv, os
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdigest()
def process_directory_csv(current... | <commit_before><commit_msg>Remove duplicates in all subdirectories - working raw version.<commit_after>import hashlib, csv, os
def md5(fname):
hash_md5 = hashlib.md5()
with open(fname, "rb") as f:
for chunk in iter(lambda: f.read(4096), b""):
hash_md5.update(chunk)
return hash_md5.hexdi... | |
99395e345f74bbedd29fd45eebe0738a3b5f4729 | ckanext/archiver/tests/test_api.py | ckanext/archiver/tests/test_api.py | import pytest
import tempfile
from ckan import model
from ckan import plugins
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckanext.archiver import model as archiver_model
from ckanext.archiver.tasks import update_package
@pytest.mark.usefixtures('with_plugins')
@pytest.mark.ckan_config... | Test api endpoint for package show | Test api endpoint for package show
| Python | mit | ckan/ckanext-archiver,ckan/ckanext-archiver,ckan/ckanext-archiver | Test api endpoint for package show | import pytest
import tempfile
from ckan import model
from ckan import plugins
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckanext.archiver import model as archiver_model
from ckanext.archiver.tasks import update_package
@pytest.mark.usefixtures('with_plugins')
@pytest.mark.ckan_config... | <commit_before><commit_msg>Test api endpoint for package show<commit_after> | import pytest
import tempfile
from ckan import model
from ckan import plugins
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckanext.archiver import model as archiver_model
from ckanext.archiver.tasks import update_package
@pytest.mark.usefixtures('with_plugins')
@pytest.mark.ckan_config... | Test api endpoint for package showimport pytest
import tempfile
from ckan import model
from ckan import plugins
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckanext.archiver import model as archiver_model
from ckanext.archiver.tasks import update_package
@pytest.mark.usefixtures('with_... | <commit_before><commit_msg>Test api endpoint for package show<commit_after>import pytest
import tempfile
from ckan import model
from ckan import plugins
from ckan.tests import factories
import ckan.tests.helpers as helpers
from ckanext.archiver import model as archiver_model
from ckanext.archiver.tasks import update_... | |
797249c42c8c1c0d6eda05dbf9e9d16d2706b373 | h2o-py/tests/testdir_algos/deepwater/pyunit_lenet_deepwater.py | h2o-py/tests/testdir_algos/deepwater/pyunit_lenet_deepwater.py | from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deepwater import H2ODeepWaterEstimator
def deepwater_lenet():
print("Test checks if Deep Water works fine with a multiclass image dataset")
frame = h2... | Add LeNet example with custom scoring and train_samples_per_iteration. | Add LeNet example with custom scoring and train_samples_per_iteration.
| Python | apache-2.0 | mathemage/h2o-3,h2oai/h2o-3,spennihana/h2o-3,spennihana/h2o-3,michalkurka/h2o-3,h2oai/h2o-3,michalkurka/h2o-3,spennihana/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,mathemage/h2o-3,h2oai/h2o-dev,mathemage/h2o-3,h2oai/h2o-3,mathemage/h2o-3,h2oai/h2o-dev,h2oai/h2o-dev,michalkurka/h2o-3,jangorecki/h2o-3,michalkurka/h2o-3,spe... | Add LeNet example with custom scoring and train_samples_per_iteration. | from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deepwater import H2ODeepWaterEstimator
def deepwater_lenet():
print("Test checks if Deep Water works fine with a multiclass image dataset")
frame = h2... | <commit_before><commit_msg>Add LeNet example with custom scoring and train_samples_per_iteration.<commit_after> | from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deepwater import H2ODeepWaterEstimator
def deepwater_lenet():
print("Test checks if Deep Water works fine with a multiclass image dataset")
frame = h2... | Add LeNet example with custom scoring and train_samples_per_iteration.from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deepwater import H2ODeepWaterEstimator
def deepwater_lenet():
print("Test checks if... | <commit_before><commit_msg>Add LeNet example with custom scoring and train_samples_per_iteration.<commit_after>from __future__ import print_function
import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.deepwater import H2ODeepWaterEstimator
def d... | |
8cdbbbaf33cd09bc742761ce8cd5b79b185710cd | webtool/server/management/commands/timer_update.py | webtool/server/management/commands/timer_update.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import io
import datetime
from django.core.management.base import BaseCommand
from server.models import Instruction, Tour, Talk, Session, Season
from server.views.bulletin impo... | Introduce a timer based update of activities | Introduce a timer based update of activities
| Python | bsd-2-clause | wodo/WebTool3,wodo/WebTool3,wodo/WebTool3,wodo/WebTool3 | Introduce a timer based update of activities | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import io
import datetime
from django.core.management.base import BaseCommand
from server.models import Instruction, Tour, Talk, Session, Season
from server.views.bulletin impo... | <commit_before><commit_msg>Introduce a timer based update of activities<commit_after> | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import io
import datetime
from django.core.management.base import BaseCommand
from server.models import Instruction, Tour, Talk, Session, Season
from server.views.bulletin impo... | Introduce a timer based update of activities# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import io
import datetime
from django.core.management.base import BaseCommand
from server.models import Instruction, Tour, Talk, Ses... | <commit_before><commit_msg>Introduce a timer based update of activities<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
import io
import datetime
from django.core.management.base import BaseCommand
from server.m... | |
6693172856655329d99f038d54b1d8819fc1a9b6 | scripts/examples/02-Board-Control/native_emitters.py | scripts/examples/02-Board-Control/native_emitters.py | import time
@micropython.asm_thumb
def asm():
movw(r0, 42)
@micropython.viper
def viper(a, b):
return a + b
@micropython.native
def native(a, b):
return a + b
print(asm())
print(viper(1, 2))
print(native(1, 2))
| Add native code emitters example. | Add native code emitters example.
| Python | mit | kwagyeman/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,openmv/openmv,openmv/openmv,iabdalkader/openmv,iabdalkader/openmv,kwagyeman/openmv,kwagyeman/openmv,iabdalkader/openmv,kwagyeman/openmv | Add native code emitters example. | import time
@micropython.asm_thumb
def asm():
movw(r0, 42)
@micropython.viper
def viper(a, b):
return a + b
@micropython.native
def native(a, b):
return a + b
print(asm())
print(viper(1, 2))
print(native(1, 2))
| <commit_before><commit_msg>Add native code emitters example.<commit_after> | import time
@micropython.asm_thumb
def asm():
movw(r0, 42)
@micropython.viper
def viper(a, b):
return a + b
@micropython.native
def native(a, b):
return a + b
print(asm())
print(viper(1, 2))
print(native(1, 2))
| Add native code emitters example.import time
@micropython.asm_thumb
def asm():
movw(r0, 42)
@micropython.viper
def viper(a, b):
return a + b
@micropython.native
def native(a, b):
return a + b
print(asm())
print(viper(1, 2))
print(native(1, 2))
| <commit_before><commit_msg>Add native code emitters example.<commit_after>import time
@micropython.asm_thumb
def asm():
movw(r0, 42)
@micropython.viper
def viper(a, b):
return a + b
@micropython.native
def native(a, b):
return a + b
print(asm())
print(viper(1, 2))
print(native(1, 2))
| |
fa6060a21767a0b5b2b3a10e4301e0c1a30134cb | i8c/tests/test_opt_lit0_cmp_before_bra.py | i8c/tests/test_opt_lit0_cmp_before_bra.py | from i8c.tests import TestCase
SOURCE1 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load NULL
beq return_the_null
deref ptr
return
return_the_null:
"""
SOURCE2 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load ... | Test the lit0,cmp before bra eliminator | Test the lit0,cmp before bra eliminator
| Python | lgpl-2.1 | gbenson/i8c | Test the lit0,cmp before bra eliminator | from i8c.tests import TestCase
SOURCE1 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load NULL
beq return_the_null
deref ptr
return
return_the_null:
"""
SOURCE2 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load ... | <commit_before><commit_msg>Test the lit0,cmp before bra eliminator<commit_after> | from i8c.tests import TestCase
SOURCE1 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load NULL
beq return_the_null
deref ptr
return
return_the_null:
"""
SOURCE2 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load ... | Test the lit0,cmp before bra eliminatorfrom i8c.tests import TestCase
SOURCE1 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load NULL
beq return_the_null
deref ptr
return
return_the_null:
"""
SOURCE2 = """\
define test::optimize_cmp_bra_const_const returns pt... | <commit_before><commit_msg>Test the lit0,cmp before bra eliminator<commit_after>from i8c.tests import TestCase
SOURCE1 = """\
define test::optimize_cmp_bra_const_const returns ptr
argument ptr x
dup
load NULL
beq return_the_null
deref ptr
return
return_the_null:
"""
SOURCE2 = """\
define test... | |
a3a48824b36ef62edaf128379f1baec5482166e7 | src/nodeconductor_saltstack/migrations/0005_resource_error_message.py | src/nodeconductor_saltstack/migrations/0005_resource_error_message.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_saltstack', '0004_remove_useless_spl_fields'),
]
operations = [
migrations.AddField(
model_name='d... | Save error_message for resources (SAAS-982) | Save error_message for resources (SAAS-982)
| Python | mit | opennode/nodeconductor-saltstack | Save error_message for resources (SAAS-982) | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_saltstack', '0004_remove_useless_spl_fields'),
]
operations = [
migrations.AddField(
model_name='d... | <commit_before><commit_msg>Save error_message for resources (SAAS-982)<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_saltstack', '0004_remove_useless_spl_fields'),
]
operations = [
migrations.AddField(
model_name='d... | Save error_message for resources (SAAS-982)# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_saltstack', '0004_remove_useless_spl_fields'),
]
operations = [
mig... | <commit_before><commit_msg>Save error_message for resources (SAAS-982)<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('nodeconductor_saltstack', '0004_remove_useless_spl_fields... | |
779fb015913a17fcb8fb290515845e6b47c3ae50 | latex2markdown.py | latex2markdown.py | """
A Very simple tool to convert latex documents to markdown documents
"""
import re
span_substitutions = [
(r'\\emph\{(.+)\}', r'*\1*'),
(r'\\textbf\{(.+)\}', r'**\1**'),
(r'\\verb;(.+);', r'`\1`'),
(r'\\includegraphics\{(.+)\}', r''),
]
def convert_span_elements(line... | Create the converter (with span-conversion functionality) | Create the converter (with span-conversion functionality)
| Python | mit | jladan/latex2markdown | Create the converter (with span-conversion functionality) | """
A Very simple tool to convert latex documents to markdown documents
"""
import re
span_substitutions = [
(r'\\emph\{(.+)\}', r'*\1*'),
(r'\\textbf\{(.+)\}', r'**\1**'),
(r'\\verb;(.+);', r'`\1`'),
(r'\\includegraphics\{(.+)\}', r''),
]
def convert_span_elements(line... | <commit_before><commit_msg>Create the converter (with span-conversion functionality)<commit_after> | """
A Very simple tool to convert latex documents to markdown documents
"""
import re
span_substitutions = [
(r'\\emph\{(.+)\}', r'*\1*'),
(r'\\textbf\{(.+)\}', r'**\1**'),
(r'\\verb;(.+);', r'`\1`'),
(r'\\includegraphics\{(.+)\}', r''),
]
def convert_span_elements(line... | Create the converter (with span-conversion functionality)"""
A Very simple tool to convert latex documents to markdown documents
"""
import re
span_substitutions = [
(r'\\emph\{(.+)\}', r'*\1*'),
(r'\\textbf\{(.+)\}', r'**\1**'),
(r'\\verb;(.+);', r'`\1`'),
(r'\\includegraphics\{(.+)\}... | <commit_before><commit_msg>Create the converter (with span-conversion functionality)<commit_after>"""
A Very simple tool to convert latex documents to markdown documents
"""
import re
span_substitutions = [
(r'\\emph\{(.+)\}', r'*\1*'),
(r'\\textbf\{(.+)\}', r'**\1**'),
(r'\\verb;(.+);', r'`\1... | |
6014dab06ed2275c5703ab9f9e63272656733c69 | moj_utils/rest.py | moj_utils/rest.py | from django.conf import settings
def retrieve_all_pages(api_endpoint, **kwargs):
"""
Some MTP apis are paginated, this method loads all pages into a single results list
:param api_endpoint: slumber callable, e.g. `[api_client].cashbook.transactions.locked.get`
:param kwargs: additional arguments to pa... | Add retrieve_all_pages util method from mtp-cashbook | Add retrieve_all_pages util method from mtp-cashbook
This method is duplicated in functionality in multiple
front end apps.
| Python | mit | ministryofjustice/django-utils,ministryofjustice/django-utils | Add retrieve_all_pages util method from mtp-cashbook
This method is duplicated in functionality in multiple
front end apps. | from django.conf import settings
def retrieve_all_pages(api_endpoint, **kwargs):
"""
Some MTP apis are paginated, this method loads all pages into a single results list
:param api_endpoint: slumber callable, e.g. `[api_client].cashbook.transactions.locked.get`
:param kwargs: additional arguments to pa... | <commit_before><commit_msg>Add retrieve_all_pages util method from mtp-cashbook
This method is duplicated in functionality in multiple
front end apps.<commit_after> | from django.conf import settings
def retrieve_all_pages(api_endpoint, **kwargs):
"""
Some MTP apis are paginated, this method loads all pages into a single results list
:param api_endpoint: slumber callable, e.g. `[api_client].cashbook.transactions.locked.get`
:param kwargs: additional arguments to pa... | Add retrieve_all_pages util method from mtp-cashbook
This method is duplicated in functionality in multiple
front end apps.from django.conf import settings
def retrieve_all_pages(api_endpoint, **kwargs):
"""
Some MTP apis are paginated, this method loads all pages into a single results list
:param api_en... | <commit_before><commit_msg>Add retrieve_all_pages util method from mtp-cashbook
This method is duplicated in functionality in multiple
front end apps.<commit_after>from django.conf import settings
def retrieve_all_pages(api_endpoint, **kwargs):
"""
Some MTP apis are paginated, this method loads all pages int... | |
c675fe2a82733ef210bf287df277f8ae956a4295 | rarbg-get.py | rarbg-get.py | #!env /usr/bin/python3
import sys
import urllib.parse
import urllib.request
def main():
search = sys.argv[1]
url = 'http://rarbg.to/torrents.php?order=seeders&by=DESC&search='
url = url + search
print(url)
req = urllib.request.Request(url, headers={'User-Agent' : "Magic Browser"})
resp = urlli... | Add beginning of main script | Add beginning of main script
| Python | mit | jadams/rarbg-get | Add beginning of main script | #!env /usr/bin/python3
import sys
import urllib.parse
import urllib.request
def main():
search = sys.argv[1]
url = 'http://rarbg.to/torrents.php?order=seeders&by=DESC&search='
url = url + search
print(url)
req = urllib.request.Request(url, headers={'User-Agent' : "Magic Browser"})
resp = urlli... | <commit_before><commit_msg>Add beginning of main script<commit_after> | #!env /usr/bin/python3
import sys
import urllib.parse
import urllib.request
def main():
search = sys.argv[1]
url = 'http://rarbg.to/torrents.php?order=seeders&by=DESC&search='
url = url + search
print(url)
req = urllib.request.Request(url, headers={'User-Agent' : "Magic Browser"})
resp = urlli... | Add beginning of main script#!env /usr/bin/python3
import sys
import urllib.parse
import urllib.request
def main():
search = sys.argv[1]
url = 'http://rarbg.to/torrents.php?order=seeders&by=DESC&search='
url = url + search
print(url)
req = urllib.request.Request(url, headers={'User-Agent' : "Magic... | <commit_before><commit_msg>Add beginning of main script<commit_after>#!env /usr/bin/python3
import sys
import urllib.parse
import urllib.request
def main():
search = sys.argv[1]
url = 'http://rarbg.to/torrents.php?order=seeders&by=DESC&search='
url = url + search
print(url)
req = urllib.request.Re... | |
d2bcba204d36a8ffd1e6a1ed79b89fcb6f1c88c5 | ideas/test_kmc.py | ideas/test_kmc.py | # This code will test out the idea of using kmc to
# 1. quickly enumerate the k-mers
# 2. intersect these with the training database, output as fasta
# 3. use that reduced fasta of intersecting kmers as the query to CMash
####################################################################
# First, I will need to dump... | Add file to test out kmc approach. Dump training k-mers to fasta file | Add file to test out kmc approach. Dump training k-mers to fasta file
| Python | bsd-3-clause | dkoslicki/CMash,dkoslicki/CMash | Add file to test out kmc approach. Dump training k-mers to fasta file | # This code will test out the idea of using kmc to
# 1. quickly enumerate the k-mers
# 2. intersect these with the training database, output as fasta
# 3. use that reduced fasta of intersecting kmers as the query to CMash
####################################################################
# First, I will need to dump... | <commit_before><commit_msg>Add file to test out kmc approach. Dump training k-mers to fasta file<commit_after> | # This code will test out the idea of using kmc to
# 1. quickly enumerate the k-mers
# 2. intersect these with the training database, output as fasta
# 3. use that reduced fasta of intersecting kmers as the query to CMash
####################################################################
# First, I will need to dump... | Add file to test out kmc approach. Dump training k-mers to fasta file# This code will test out the idea of using kmc to
# 1. quickly enumerate the k-mers
# 2. intersect these with the training database, output as fasta
# 3. use that reduced fasta of intersecting kmers as the query to CMash
############################... | <commit_before><commit_msg>Add file to test out kmc approach. Dump training k-mers to fasta file<commit_after># This code will test out the idea of using kmc to
# 1. quickly enumerate the k-mers
# 2. intersect these with the training database, output as fasta
# 3. use that reduced fasta of intersecting kmers as the que... | |
02ad029840b2e770bc802fd7f8504498cb0f756d | lib/ansible/plugins/test/mathstuff.py | lib/ansible/plugins/test/mathstuff.py | # (c) 2016, Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... | Add `issubset` and `issuperset` tests | Add `issubset` and `issuperset` tests
| Python | mit | thaim/ansible,thaim/ansible | Add `issubset` and `issuperset` tests | # (c) 2016, Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... | <commit_before><commit_msg>Add `issubset` and `issuperset` tests<commit_after> | # (c) 2016, Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# Ansible is di... | Add `issubset` and `issuperset` tests# (c) 2016, Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option)... | <commit_before><commit_msg>Add `issubset` and `issuperset` tests<commit_after># (c) 2016, Ansible, Inc
#
# This file is part of Ansible
#
# Ansible is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation, either versio... | |
bf86584829f56f91b363f251d77f3157f952db0f | tests/test_cyprep.py | tests/test_cyprep.py | import unittest
import numpy as np
import yatsm._cyprep
class TestCyPrep(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Test data
n_band = 7
n_mask = 50
n_images = 1000
cls.data = np.random.randint(
0, 10000, size=(n_band, n_images)).astype(np.i... | Add tests for masking of data based on being within a range of values | Add tests for masking of data based on being within a range of values
| Python | mit | ceholden/yatsm,c11/yatsm,jmorton/yatsm,valpasq/yatsm,ceholden/yatsm,valpasq/yatsm,jmorton/yatsm,c11/yatsm,jmorton/yatsm | Add tests for masking of data based on being within a range of values | import unittest
import numpy as np
import yatsm._cyprep
class TestCyPrep(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Test data
n_band = 7
n_mask = 50
n_images = 1000
cls.data = np.random.randint(
0, 10000, size=(n_band, n_images)).astype(np.i... | <commit_before><commit_msg>Add tests for masking of data based on being within a range of values<commit_after> | import unittest
import numpy as np
import yatsm._cyprep
class TestCyPrep(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Test data
n_band = 7
n_mask = 50
n_images = 1000
cls.data = np.random.randint(
0, 10000, size=(n_band, n_images)).astype(np.i... | Add tests for masking of data based on being within a range of valuesimport unittest
import numpy as np
import yatsm._cyprep
class TestCyPrep(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Test data
n_band = 7
n_mask = 50
n_images = 1000
cls.data = np.rando... | <commit_before><commit_msg>Add tests for masking of data based on being within a range of values<commit_after>import unittest
import numpy as np
import yatsm._cyprep
class TestCyPrep(unittest.TestCase):
@classmethod
def setUpClass(cls):
# Test data
n_band = 7
n_mask = 50
n_i... | |
aa78a2670766b0a5e093a1876cb402ed513573bd | openfisca_france/scripts/parameters/explore_parameters_unit.py | openfisca_france/scripts/parameters/explore_parameters_unit.py | # -*- coding: utf-8 -*-
from openfisca_core.parameters import ParameterNode, Scale
from openfisca_france import FranceTaxBenefitSystem
tax_benefit_system = FranceTaxBenefitSystem()
parameters = tax_benefit_system.parameters
def get_parameters_by_unit(parameter, parameters_by_unit = None):
if parameters_by_uni... | Add script to explore parameters units | Add script to explore parameters units
| Python | agpl-3.0 | antoinearnoud/openfisca-france,antoinearnoud/openfisca-france,sgmap/openfisca-france,sgmap/openfisca-france | Add script to explore parameters units | # -*- coding: utf-8 -*-
from openfisca_core.parameters import ParameterNode, Scale
from openfisca_france import FranceTaxBenefitSystem
tax_benefit_system = FranceTaxBenefitSystem()
parameters = tax_benefit_system.parameters
def get_parameters_by_unit(parameter, parameters_by_unit = None):
if parameters_by_uni... | <commit_before><commit_msg>Add script to explore parameters units<commit_after> | # -*- coding: utf-8 -*-
from openfisca_core.parameters import ParameterNode, Scale
from openfisca_france import FranceTaxBenefitSystem
tax_benefit_system = FranceTaxBenefitSystem()
parameters = tax_benefit_system.parameters
def get_parameters_by_unit(parameter, parameters_by_unit = None):
if parameters_by_uni... | Add script to explore parameters units# -*- coding: utf-8 -*-
from openfisca_core.parameters import ParameterNode, Scale
from openfisca_france import FranceTaxBenefitSystem
tax_benefit_system = FranceTaxBenefitSystem()
parameters = tax_benefit_system.parameters
def get_parameters_by_unit(parameter, parameters_by_... | <commit_before><commit_msg>Add script to explore parameters units<commit_after># -*- coding: utf-8 -*-
from openfisca_core.parameters import ParameterNode, Scale
from openfisca_france import FranceTaxBenefitSystem
tax_benefit_system = FranceTaxBenefitSystem()
parameters = tax_benefit_system.parameters
def get_par... | |
26ab37868e67b5b815cf8df67cc04876ff44c148 | tests/rules_tests/isValid_tests/NongrammarEntitiesTest.py | tests/rules_tests/isValid_tests/NongrammarEntitiesTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
from .grammar import *
class NongrammarEntitiesTest(TestCase):
pass
if __name__ == '__main__':
main() | Add file for Nongrammar entities tests | Add file for Nongrammar entities tests
| Python | mit | PatrikValkovic/grammpy | Add file for Nongrammar entities tests | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
from .grammar import *
class NongrammarEntitiesTest(TestCase):
pass
if __name__ == '__main__':
main() | <commit_before><commit_msg>Add file for Nongrammar entities tests<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
from .grammar import *
class NongrammarEntitiesTest(TestCase):
pass
if __name__ == '__main__':
main() | Add file for Nongrammar entities tests#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
from .grammar import *
class NongrammarEntitiesTest(TestCase):
pass
if __name__ == '__main__':
m... | <commit_before><commit_msg>Add file for Nongrammar entities tests<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
from .grammar import *
class NongrammarEntitiesTest(TestCase):
... | |
fa3a02e6660ce556defc2f2c6008c6eb24eb71c1 | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Sampler.py | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/Sampler.py | import time
import wave
import pygame
import numpy
import Axon
from Axon.SchedulingComponent import SchedulingComponent
class WavVoice(SchedulingComponent):
bufferSize = 1024
def __init__(self, fileName, **argd):
super(WavVoice, self).__init__(**argd)
self.on = False
self.wavFile = wa... | Add a simple sampler for playing wav files triggered by note on messages | Add a simple sampler for playing wav files triggered by note on messages
| Python | apache-2.0 | sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia,sparkslabs/kamaelia | Add a simple sampler for playing wav files triggered by note on messages | import time
import wave
import pygame
import numpy
import Axon
from Axon.SchedulingComponent import SchedulingComponent
class WavVoice(SchedulingComponent):
bufferSize = 1024
def __init__(self, fileName, **argd):
super(WavVoice, self).__init__(**argd)
self.on = False
self.wavFile = wa... | <commit_before><commit_msg>Add a simple sampler for playing wav files triggered by note on messages<commit_after> | import time
import wave
import pygame
import numpy
import Axon
from Axon.SchedulingComponent import SchedulingComponent
class WavVoice(SchedulingComponent):
bufferSize = 1024
def __init__(self, fileName, **argd):
super(WavVoice, self).__init__(**argd)
self.on = False
self.wavFile = wa... | Add a simple sampler for playing wav files triggered by note on messagesimport time
import wave
import pygame
import numpy
import Axon
from Axon.SchedulingComponent import SchedulingComponent
class WavVoice(SchedulingComponent):
bufferSize = 1024
def __init__(self, fileName, **argd):
super(WavVoice, se... | <commit_before><commit_msg>Add a simple sampler for playing wav files triggered by note on messages<commit_after>import time
import wave
import pygame
import numpy
import Axon
from Axon.SchedulingComponent import SchedulingComponent
class WavVoice(SchedulingComponent):
bufferSize = 1024
def __init__(self, file... | |
4e3644234fab9cb14a3d511b24bce3ed8a1446e0 | tests/scales/test_minor.py | tests/scales/test_minor.py | # Copyright (c) Paul R. Tagliamonte <tag@pault.ag>, 2015
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | Add in a minor testcase. | Add in a minor testcase.
| Python | mit | paultag/python-muse | Add in a minor testcase. | # Copyright (c) Paul R. Tagliamonte <tag@pault.ag>, 2015
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | <commit_before><commit_msg>Add in a minor testcase.<commit_after> | # Copyright (c) Paul R. Tagliamonte <tag@pault.ag>, 2015
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify,... | Add in a minor testcase.# Copyright (c) Paul R. Tagliamonte <tag@pault.ag>, 2015
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the righ... | <commit_before><commit_msg>Add in a minor testcase.<commit_after># Copyright (c) Paul R. Tagliamonte <tag@pault.ag>, 2015
#
# 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... | |
6f8c64ed6f99493811cab54137a1eed44d851260 | scripts/GetGroupAndModuleFromClassName.py | scripts/GetGroupAndModuleFromClassName.py | #!/usr/bin/env python
""" Given the path to the ITK Source Dir
print group and module of a given class
for instance, try:
./GetGroupAndModuleFromClassName /path/to/ITK Image
"""
import sys
import os
itk_dir = sys.argv[1]
cmakefile = os.path.join( itk_dir, 'CMake', 'UseITK.cmake' )
if not os.path.exists( cmakefi... | Add python script to get group and module given a class name | Add python script to get group and module given a class name
| Python | apache-2.0 | InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples,InsightSoftwareConsortium/ITKExamples | Add python script to get group and module given a class name | #!/usr/bin/env python
""" Given the path to the ITK Source Dir
print group and module of a given class
for instance, try:
./GetGroupAndModuleFromClassName /path/to/ITK Image
"""
import sys
import os
itk_dir = sys.argv[1]
cmakefile = os.path.join( itk_dir, 'CMake', 'UseITK.cmake' )
if not os.path.exists( cmakefi... | <commit_before><commit_msg>Add python script to get group and module given a class name<commit_after> | #!/usr/bin/env python
""" Given the path to the ITK Source Dir
print group and module of a given class
for instance, try:
./GetGroupAndModuleFromClassName /path/to/ITK Image
"""
import sys
import os
itk_dir = sys.argv[1]
cmakefile = os.path.join( itk_dir, 'CMake', 'UseITK.cmake' )
if not os.path.exists( cmakefi... | Add python script to get group and module given a class name#!/usr/bin/env python
""" Given the path to the ITK Source Dir
print group and module of a given class
for instance, try:
./GetGroupAndModuleFromClassName /path/to/ITK Image
"""
import sys
import os
itk_dir = sys.argv[1]
cmakefile = os.path.join( itk_di... | <commit_before><commit_msg>Add python script to get group and module given a class name<commit_after>#!/usr/bin/env python
""" Given the path to the ITK Source Dir
print group and module of a given class
for instance, try:
./GetGroupAndModuleFromClassName /path/to/ITK Image
"""
import sys
import os
itk_dir = sys... | |
acc5c52011db4c8edc615ae3e0cad9cea4fe58b8 | spreadflow_observer_fs/test/test_source.py | spreadflow_observer_fs/test/test_source.py | # -*- coding: utf-8 -*-
# pylint: disable=too-many-public-methods
"""
Integration tests for spreadflow filesystem observer source.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import copy
from bson import BSON
from datetime import datetime
from t... | Add basic test for filesystem observer source | Add basic test for filesystem observer source
| Python | mit | znerol/spreadflow-observer-fs,spreadflow/spreadflow-observer-fs | Add basic test for filesystem observer source | # -*- coding: utf-8 -*-
# pylint: disable=too-many-public-methods
"""
Integration tests for spreadflow filesystem observer source.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import copy
from bson import BSON
from datetime import datetime
from t... | <commit_before><commit_msg>Add basic test for filesystem observer source<commit_after> | # -*- coding: utf-8 -*-
# pylint: disable=too-many-public-methods
"""
Integration tests for spreadflow filesystem observer source.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import copy
from bson import BSON
from datetime import datetime
from t... | Add basic test for filesystem observer source# -*- coding: utf-8 -*-
# pylint: disable=too-many-public-methods
"""
Integration tests for spreadflow filesystem observer source.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import unicode_literals
import copy
from bson imp... | <commit_before><commit_msg>Add basic test for filesystem observer source<commit_after># -*- coding: utf-8 -*-
# pylint: disable=too-many-public-methods
"""
Integration tests for spreadflow filesystem observer source.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import uni... | |
5273a97ab1da4b809573617d3fc01705c322992f | thecut/authorship/tests/test_forms.py | thecut/authorship/tests/test_forms.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from django import forms
from mock import patch
from test_app.models import AuthorshipModel
from thecut.authorship.factories import UserFactory
from thecut.authorship.forms import AuthorshipMixin
class Au... | Add tests for form mixin. | Add tests for form mixin.
| Python | apache-2.0 | thecut/thecut-authorship | Add tests for form mixin. | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from django import forms
from mock import patch
from test_app.models import AuthorshipModel
from thecut.authorship.factories import UserFactory
from thecut.authorship.forms import AuthorshipMixin
class Au... | <commit_before><commit_msg>Add tests for form mixin.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from django import forms
from mock import patch
from test_app.models import AuthorshipModel
from thecut.authorship.factories import UserFactory
from thecut.authorship.forms import AuthorshipMixin
class Au... | Add tests for form mixin.# -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from django import forms
from mock import patch
from test_app.models import AuthorshipModel
from thecut.authorship.factories import UserFactory
from thecut.authorship.forms import A... | <commit_before><commit_msg>Add tests for form mixin.<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import, unicode_literals
from django.test import TestCase
from django import forms
from mock import patch
from test_app.models import AuthorshipModel
from thecut.authorship.factories import UserFact... | |
e838b6d53f131badfbb7b51b4eb268ebb5d7c450 | spacy/tests/matcher/test_entity_id.py | spacy/tests/matcher/test_entity_id.py | from __future__ import unicode_literals
import spacy
from spacy.vocab import Vocab
from spacy.matcher import Matcher
from spacy.tokens.doc import Doc
from spacy.attrs import *
import pytest
@pytest.fixture
def en_vocab():
return spacy.get_lang_class('en').Defaults.create_vocab()
def test_init_matcher(en_vocab)... | Add tests for using the new Entity ID tracking in the rule matcher | Add tests for using the new Entity ID tracking in the rule matcher
| Python | mit | banglakit/spaCy,spacy-io/spaCy,recognai/spaCy,explosion/spaCy,raphael0202/spaCy,aikramer2/spaCy,oroszgy/spaCy.hu,Gregory-Howard/spaCy,Gregory-Howard/spaCy,aikramer2/spaCy,banglakit/spaCy,raphael0202/spaCy,honnibal/spaCy,banglakit/spaCy,raphael0202/spaCy,recognai/spaCy,spacy-io/spaCy,oroszgy/spaCy.hu,raphael0202/spaCy,b... | Add tests for using the new Entity ID tracking in the rule matcher | from __future__ import unicode_literals
import spacy
from spacy.vocab import Vocab
from spacy.matcher import Matcher
from spacy.tokens.doc import Doc
from spacy.attrs import *
import pytest
@pytest.fixture
def en_vocab():
return spacy.get_lang_class('en').Defaults.create_vocab()
def test_init_matcher(en_vocab)... | <commit_before><commit_msg>Add tests for using the new Entity ID tracking in the rule matcher<commit_after> | from __future__ import unicode_literals
import spacy
from spacy.vocab import Vocab
from spacy.matcher import Matcher
from spacy.tokens.doc import Doc
from spacy.attrs import *
import pytest
@pytest.fixture
def en_vocab():
return spacy.get_lang_class('en').Defaults.create_vocab()
def test_init_matcher(en_vocab)... | Add tests for using the new Entity ID tracking in the rule matcherfrom __future__ import unicode_literals
import spacy
from spacy.vocab import Vocab
from spacy.matcher import Matcher
from spacy.tokens.doc import Doc
from spacy.attrs import *
import pytest
@pytest.fixture
def en_vocab():
return spacy.get_lang_cla... | <commit_before><commit_msg>Add tests for using the new Entity ID tracking in the rule matcher<commit_after>from __future__ import unicode_literals
import spacy
from spacy.vocab import Vocab
from spacy.matcher import Matcher
from spacy.tokens.doc import Doc
from spacy.attrs import *
import pytest
@pytest.fixture
def ... | |
9a6ca54f7cca0bd5f21f0bc590a034e7e3e05b6e | src/icp/apps/user/migrations/0002_add_userprofiles_to_existing_users.py | src/icp/apps/user/migrations/0002_add_userprofiles_to_existing_users.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.postgres.fields
from django.conf import settings
def create_user_profiles_for_existing_users(apps, schema_editor):
User = apps.get_model('auth', 'User')
UserProfile = apps.get_model('... | Add migration to add userprofiles to existing users | Add migration to add userprofiles to existing users
All existing users on staging/production will be users of the Pollination Mapper app.
Refs #290
| Python | apache-2.0 | project-icp/bee-pollinator-app,project-icp/bee-pollinator-app,project-icp/bee-pollinator-app,project-icp/bee-pollinator-app | Add migration to add userprofiles to existing users
All existing users on staging/production will be users of the Pollination Mapper app.
Refs #290 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.postgres.fields
from django.conf import settings
def create_user_profiles_for_existing_users(apps, schema_editor):
User = apps.get_model('auth', 'User')
UserProfile = apps.get_model('... | <commit_before><commit_msg>Add migration to add userprofiles to existing users
All existing users on staging/production will be users of the Pollination Mapper app.
Refs #290<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.postgres.fields
from django.conf import settings
def create_user_profiles_for_existing_users(apps, schema_editor):
User = apps.get_model('auth', 'User')
UserProfile = apps.get_model('... | Add migration to add userprofiles to existing users
All existing users on staging/production will be users of the Pollination Mapper app.
Refs #290# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.postgres.fields
from django.conf import set... | <commit_before><commit_msg>Add migration to add userprofiles to existing users
All existing users on staging/production will be users of the Pollination Mapper app.
Refs #290<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.contrib.po... | |
1bb1ececfcd548d52a28b713f4ee7eb4e710da85 | keras_tf_multigpu/examples/fchollet_inception3_multigpu.py | keras_tf_multigpu/examples/fchollet_inception3_multigpu.py | import tensorflow as tf
from keras.applications import InceptionV3
from keras.utils import multi_gpu_model
import numpy as np
num_samples = 1000
height = 224
width = 224
num_classes = 1000
gpu_count = 2
# Instantiate the base model
# (here, we do it on CPU, which is optional).
with tf.device('/cpu:0' if gpu_count > ... | Add an example of using fchollet multi_gpu_model on InceptionV3. | Add an example of using fchollet multi_gpu_model on InceptionV3.
Adapted from Keras example - parameterized number of GPUs, fixed imports,
different model class, fixed device placement for single GPU.
| Python | mit | rossumai/keras-multi-gpu,rossumai/keras-multi-gpu | Add an example of using fchollet multi_gpu_model on InceptionV3.
Adapted from Keras example - parameterized number of GPUs, fixed imports,
different model class, fixed device placement for single GPU. | import tensorflow as tf
from keras.applications import InceptionV3
from keras.utils import multi_gpu_model
import numpy as np
num_samples = 1000
height = 224
width = 224
num_classes = 1000
gpu_count = 2
# Instantiate the base model
# (here, we do it on CPU, which is optional).
with tf.device('/cpu:0' if gpu_count > ... | <commit_before><commit_msg>Add an example of using fchollet multi_gpu_model on InceptionV3.
Adapted from Keras example - parameterized number of GPUs, fixed imports,
different model class, fixed device placement for single GPU.<commit_after> | import tensorflow as tf
from keras.applications import InceptionV3
from keras.utils import multi_gpu_model
import numpy as np
num_samples = 1000
height = 224
width = 224
num_classes = 1000
gpu_count = 2
# Instantiate the base model
# (here, we do it on CPU, which is optional).
with tf.device('/cpu:0' if gpu_count > ... | Add an example of using fchollet multi_gpu_model on InceptionV3.
Adapted from Keras example - parameterized number of GPUs, fixed imports,
different model class, fixed device placement for single GPU.import tensorflow as tf
from keras.applications import InceptionV3
from keras.utils import multi_gpu_model
import numpy... | <commit_before><commit_msg>Add an example of using fchollet multi_gpu_model on InceptionV3.
Adapted from Keras example - parameterized number of GPUs, fixed imports,
different model class, fixed device placement for single GPU.<commit_after>import tensorflow as tf
from keras.applications import InceptionV3
from keras.... | |
8c7fc2382db0ec9c901f6c2c2b00971f3ee7c3cc | logintokens/tests/test_backends.py | logintokens/tests/test_backends.py | """logintokens app unittests for backends
"""
from time import sleep
from django.test import TestCase, Client
from django.contrib.auth import get_user_model, authenticate
from logintokens.tokens import default_token_generator
USER = get_user_model()
class EmailOnlyAuthenticationBackendTest(TestCase):
"""Test... | Add tests for custom authentication backend | Add tests for custom authentication backend
| Python | mit | randomic/aniauth-tdd,randomic/aniauth-tdd | Add tests for custom authentication backend | """logintokens app unittests for backends
"""
from time import sleep
from django.test import TestCase, Client
from django.contrib.auth import get_user_model, authenticate
from logintokens.tokens import default_token_generator
USER = get_user_model()
class EmailOnlyAuthenticationBackendTest(TestCase):
"""Test... | <commit_before><commit_msg>Add tests for custom authentication backend<commit_after> | """logintokens app unittests for backends
"""
from time import sleep
from django.test import TestCase, Client
from django.contrib.auth import get_user_model, authenticate
from logintokens.tokens import default_token_generator
USER = get_user_model()
class EmailOnlyAuthenticationBackendTest(TestCase):
"""Test... | Add tests for custom authentication backend"""logintokens app unittests for backends
"""
from time import sleep
from django.test import TestCase, Client
from django.contrib.auth import get_user_model, authenticate
from logintokens.tokens import default_token_generator
USER = get_user_model()
class EmailOnlyAuthe... | <commit_before><commit_msg>Add tests for custom authentication backend<commit_after>"""logintokens app unittests for backends
"""
from time import sleep
from django.test import TestCase, Client
from django.contrib.auth import get_user_model, authenticate
from logintokens.tokens import default_token_generator
USER ... | |
54ca48a2b8cbd53cd6506fdbce47d16f03a28a7d | tests/test_sorting_and_searching/test_bubble_sort.py | tests/test_sorting_and_searching/test_bubble_sort.py | import unittest
from aids.sorting_and_searching.bubble_sort import bubble_sort
class BubbleSortTestCase(unittest.TestCase):
'''
Unit tests for bubble sort
'''
def setUp(self):
self.example_1 = [2, 5, 4, 3, 1]
def test_bubble_sort(self):
bubble_sort(self.example_1)
self.a... | Add unit tests for bubble sort | Add unit tests for bubble sort
| Python | mit | ueg1990/aids | Add unit tests for bubble sort | import unittest
from aids.sorting_and_searching.bubble_sort import bubble_sort
class BubbleSortTestCase(unittest.TestCase):
'''
Unit tests for bubble sort
'''
def setUp(self):
self.example_1 = [2, 5, 4, 3, 1]
def test_bubble_sort(self):
bubble_sort(self.example_1)
self.a... | <commit_before><commit_msg>Add unit tests for bubble sort<commit_after> | import unittest
from aids.sorting_and_searching.bubble_sort import bubble_sort
class BubbleSortTestCase(unittest.TestCase):
'''
Unit tests for bubble sort
'''
def setUp(self):
self.example_1 = [2, 5, 4, 3, 1]
def test_bubble_sort(self):
bubble_sort(self.example_1)
self.a... | Add unit tests for bubble sortimport unittest
from aids.sorting_and_searching.bubble_sort import bubble_sort
class BubbleSortTestCase(unittest.TestCase):
'''
Unit tests for bubble sort
'''
def setUp(self):
self.example_1 = [2, 5, 4, 3, 1]
def test_bubble_sort(self):
bubble_sort(... | <commit_before><commit_msg>Add unit tests for bubble sort<commit_after>import unittest
from aids.sorting_and_searching.bubble_sort import bubble_sort
class BubbleSortTestCase(unittest.TestCase):
'''
Unit tests for bubble sort
'''
def setUp(self):
self.example_1 = [2, 5, 4, 3, 1]
def tes... | |
67596d081059a004e5f7ab15f7972773fdf2f15e | tests/syft/grid/messages/setup_msg_test.py | tests/syft/grid/messages/setup_msg_test.py | # syft absolute
import syft as sy
from syft.core.io.address import Address
from syft.grid.messages.setup_messages import CreateInitialSetUpMessage
from syft.grid.messages.setup_messages import CreateInitialSetUpResponse
from syft.grid.messages.setup_messages import GetSetUpMessage
from syft.grid.messages.setup_messages... | ADD PyGrid SetupService message tests | ADD PyGrid SetupService message tests
| Python | apache-2.0 | OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft,OpenMined/PySyft | ADD PyGrid SetupService message tests | # syft absolute
import syft as sy
from syft.core.io.address import Address
from syft.grid.messages.setup_messages import CreateInitialSetUpMessage
from syft.grid.messages.setup_messages import CreateInitialSetUpResponse
from syft.grid.messages.setup_messages import GetSetUpMessage
from syft.grid.messages.setup_messages... | <commit_before><commit_msg>ADD PyGrid SetupService message tests<commit_after> | # syft absolute
import syft as sy
from syft.core.io.address import Address
from syft.grid.messages.setup_messages import CreateInitialSetUpMessage
from syft.grid.messages.setup_messages import CreateInitialSetUpResponse
from syft.grid.messages.setup_messages import GetSetUpMessage
from syft.grid.messages.setup_messages... | ADD PyGrid SetupService message tests# syft absolute
import syft as sy
from syft.core.io.address import Address
from syft.grid.messages.setup_messages import CreateInitialSetUpMessage
from syft.grid.messages.setup_messages import CreateInitialSetUpResponse
from syft.grid.messages.setup_messages import GetSetUpMessage
f... | <commit_before><commit_msg>ADD PyGrid SetupService message tests<commit_after># syft absolute
import syft as sy
from syft.core.io.address import Address
from syft.grid.messages.setup_messages import CreateInitialSetUpMessage
from syft.grid.messages.setup_messages import CreateInitialSetUpResponse
from syft.grid.message... | |
478072e8350d03655364ea9147bbe21bafabbcce | geotrek/feedback/tests/test_template_tags.py | geotrek/feedback/tests/test_template_tags.py | from datetime import datetime
from django.test import TestCase
from geotrek.authent.tests.factories import UserFactory, UserProfileFactory
from geotrek.feedback.templatetags.feedback_tags import (
predefined_emails, resolved_intervention_info, status_ids_and_colors)
from geotrek.feedback.tests.factories import (P... | Add tests for template tags | Add tests for template tags
| Python | bsd-2-clause | makinacorpus/Geotrek,makinacorpus/Geotrek,makinacorpus/Geotrek,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,GeotrekCE/Geotrek-admin,makinacorpus/Geotrek | Add tests for template tags | from datetime import datetime
from django.test import TestCase
from geotrek.authent.tests.factories import UserFactory, UserProfileFactory
from geotrek.feedback.templatetags.feedback_tags import (
predefined_emails, resolved_intervention_info, status_ids_and_colors)
from geotrek.feedback.tests.factories import (P... | <commit_before><commit_msg>Add tests for template tags<commit_after> | from datetime import datetime
from django.test import TestCase
from geotrek.authent.tests.factories import UserFactory, UserProfileFactory
from geotrek.feedback.templatetags.feedback_tags import (
predefined_emails, resolved_intervention_info, status_ids_and_colors)
from geotrek.feedback.tests.factories import (P... | Add tests for template tagsfrom datetime import datetime
from django.test import TestCase
from geotrek.authent.tests.factories import UserFactory, UserProfileFactory
from geotrek.feedback.templatetags.feedback_tags import (
predefined_emails, resolved_intervention_info, status_ids_and_colors)
from geotrek.feedbac... | <commit_before><commit_msg>Add tests for template tags<commit_after>from datetime import datetime
from django.test import TestCase
from geotrek.authent.tests.factories import UserFactory, UserProfileFactory
from geotrek.feedback.templatetags.feedback_tags import (
predefined_emails, resolved_intervention_info, st... | |
8355cb358d14589a194926d37beeb5af7af2a591 | falmer/events/migrations/0012_auto_20170905_1208.py | falmer/events/migrations/0012_auto_20170905_1208.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-05 11:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0011_auto_20170905_1028'),
]
operations = [
migrations.AlterField... | Increase event image url limit from 200 | Increase event image url limit from 200
| Python | mit | sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer,sussexstudent/falmer | Increase event image url limit from 200 | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-05 11:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0011_auto_20170905_1028'),
]
operations = [
migrations.AlterField... | <commit_before><commit_msg>Increase event image url limit from 200<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-05 11:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0011_auto_20170905_1028'),
]
operations = [
migrations.AlterField... | Increase event image url limit from 200# -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-05 11:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '0011_auto_20170905_1028'),
]
opera... | <commit_before><commit_msg>Increase event image url limit from 200<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-09-05 11:08
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('events', '00... | |
a16b4401f37f08d8cb5e1f9ec1b7d4a3221360ab | test/test_regular_extrusion.py | test/test_regular_extrusion.py | # -*- coding: utf-8 -*-
"""Creates regular cube mesh by extrusion.
"""
import pygmsh
from helpers import compute_volume
def test():
x = 5
y = 4
z = 3
x_layers = 10
y_layers = 5
z_layers = 3
geom = pygmsh.built_in.Geometry()
p = geom.add_point([0, 0, 0], 1)
_, l, _ = geom.extrude(p... | Add test case for regular extrusion | Add test case for regular extrusion
| Python | bsd-3-clause | nschloe/python4gmsh | Add test case for regular extrusion | # -*- coding: utf-8 -*-
"""Creates regular cube mesh by extrusion.
"""
import pygmsh
from helpers import compute_volume
def test():
x = 5
y = 4
z = 3
x_layers = 10
y_layers = 5
z_layers = 3
geom = pygmsh.built_in.Geometry()
p = geom.add_point([0, 0, 0], 1)
_, l, _ = geom.extrude(p... | <commit_before><commit_msg>Add test case for regular extrusion<commit_after> | # -*- coding: utf-8 -*-
"""Creates regular cube mesh by extrusion.
"""
import pygmsh
from helpers import compute_volume
def test():
x = 5
y = 4
z = 3
x_layers = 10
y_layers = 5
z_layers = 3
geom = pygmsh.built_in.Geometry()
p = geom.add_point([0, 0, 0], 1)
_, l, _ = geom.extrude(p... | Add test case for regular extrusion# -*- coding: utf-8 -*-
"""Creates regular cube mesh by extrusion.
"""
import pygmsh
from helpers import compute_volume
def test():
x = 5
y = 4
z = 3
x_layers = 10
y_layers = 5
z_layers = 3
geom = pygmsh.built_in.Geometry()
p = geom.add_point([0, 0, ... | <commit_before><commit_msg>Add test case for regular extrusion<commit_after># -*- coding: utf-8 -*-
"""Creates regular cube mesh by extrusion.
"""
import pygmsh
from helpers import compute_volume
def test():
x = 5
y = 4
z = 3
x_layers = 10
y_layers = 5
z_layers = 3
geom = pygmsh.built_in.... | |
7bd6f3e7751deecfc3cd555fc071d722c856802c | chips/compiler/builtins.py | chips/compiler/builtins.py | #!/usr/bin/env python
"""Support Library for builtin Functionality"""
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2013, Jonathan P Dawson"
__version__ = "0.1"
builtins="""
unsigned unsigned_divide_xxxx(unsigned dividend, unsigned divisor){
unsigned denom = divisor;
unsigned bit = 1;
unsigned... | Implement division using built in library function | Implement division using built in library function
| Python | mit | dawsonjon/Chips-2.0,dawsonjon/Chips-2.0,dawsonjon/Chips-2.0,dawsonjon/Chips-2.0,dawsonjon/Chips-2.0 | Implement division using built in library function | #!/usr/bin/env python
"""Support Library for builtin Functionality"""
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2013, Jonathan P Dawson"
__version__ = "0.1"
builtins="""
unsigned unsigned_divide_xxxx(unsigned dividend, unsigned divisor){
unsigned denom = divisor;
unsigned bit = 1;
unsigned... | <commit_before><commit_msg>Implement division using built in library function<commit_after> | #!/usr/bin/env python
"""Support Library for builtin Functionality"""
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2013, Jonathan P Dawson"
__version__ = "0.1"
builtins="""
unsigned unsigned_divide_xxxx(unsigned dividend, unsigned divisor){
unsigned denom = divisor;
unsigned bit = 1;
unsigned... | Implement division using built in library function#!/usr/bin/env python
"""Support Library for builtin Functionality"""
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2013, Jonathan P Dawson"
__version__ = "0.1"
builtins="""
unsigned unsigned_divide_xxxx(unsigned dividend, unsigned divisor){
unsigned d... | <commit_before><commit_msg>Implement division using built in library function<commit_after>#!/usr/bin/env python
"""Support Library for builtin Functionality"""
__author__ = "Jon Dawson"
__copyright__ = "Copyright (C) 2013, Jonathan P Dawson"
__version__ = "0.1"
builtins="""
unsigned unsigned_divide_xxxx(unsigned di... | |
9316bc07c77e2f51332a40bf430cef117f4d89e1 | util/check_dockerfile_coverage.py | util/check_dockerfile_coverage.py | import yaml
import os
import pathlib2
import itertools
import argparse
import logging
import sys
TRAVIS_BUILD_DIR = os.environ.get("TRAVIS_BUILD_DIR")
CONFIG_FILE_PATH = pathlib2.Path(TRAVIS_BUILD_DIR, "util", "parsefiles_config.yml")
LOGGER = logging.getLogger(__name__)
def check_coverage(containers):
# open con... | Add script to check for Dockerfile coverage | Add script to check for Dockerfile coverage
| Python | agpl-3.0 | rue89-tech/configuration,stvstnfrd/configuration,michaelsteiner19/open-edx-configuration,armaan/edx-configuration,hastexo/edx-configuration,armaan/edx-configuration,stvstnfrd/configuration,gsehub/configuration,stvstnfrd/configuration,hks-epod/configuration,open-craft/configuration,edx/configuration,open-craft/configura... | Add script to check for Dockerfile coverage | import yaml
import os
import pathlib2
import itertools
import argparse
import logging
import sys
TRAVIS_BUILD_DIR = os.environ.get("TRAVIS_BUILD_DIR")
CONFIG_FILE_PATH = pathlib2.Path(TRAVIS_BUILD_DIR, "util", "parsefiles_config.yml")
LOGGER = logging.getLogger(__name__)
def check_coverage(containers):
# open con... | <commit_before><commit_msg>Add script to check for Dockerfile coverage<commit_after> | import yaml
import os
import pathlib2
import itertools
import argparse
import logging
import sys
TRAVIS_BUILD_DIR = os.environ.get("TRAVIS_BUILD_DIR")
CONFIG_FILE_PATH = pathlib2.Path(TRAVIS_BUILD_DIR, "util", "parsefiles_config.yml")
LOGGER = logging.getLogger(__name__)
def check_coverage(containers):
# open con... | Add script to check for Dockerfile coverageimport yaml
import os
import pathlib2
import itertools
import argparse
import logging
import sys
TRAVIS_BUILD_DIR = os.environ.get("TRAVIS_BUILD_DIR")
CONFIG_FILE_PATH = pathlib2.Path(TRAVIS_BUILD_DIR, "util", "parsefiles_config.yml")
LOGGER = logging.getLogger(__name__)
def... | <commit_before><commit_msg>Add script to check for Dockerfile coverage<commit_after>import yaml
import os
import pathlib2
import itertools
import argparse
import logging
import sys
TRAVIS_BUILD_DIR = os.environ.get("TRAVIS_BUILD_DIR")
CONFIG_FILE_PATH = pathlib2.Path(TRAVIS_BUILD_DIR, "util", "parsefiles_config.yml")
... | |
805708048f493ca538a9e0b8d9d40ae1d4baf2c3 | keepalive-race/keep-alive-race.py | keepalive-race/keep-alive-race.py | #!/usr/bin/python3
"""
This script demonstrates a race condition with HTTP/1.1 keepalive
"""
import decimal
import json
import subprocess
import time
import threading
import requests
requests.packages.urllib3.disable_warnings()
CREDS = json.loads(subprocess.check_output(
"openstack --os-cloud devstack token issue... | Add a tool to reproduce HTTP KeepAlive races in OpenStack gate jobs. | Add a tool to reproduce HTTP KeepAlive races in OpenStack gate jobs.
Based on https://github.com/mikem23/keepalive-race
Change-Id: I11f66bf39c6cc2609ee0dbff97ac7b104767ac2b
| Python | apache-2.0 | JordanP/openstack-snippets,JordanP/openstack-snippets | Add a tool to reproduce HTTP KeepAlive races in OpenStack gate jobs.
Based on https://github.com/mikem23/keepalive-race
Change-Id: I11f66bf39c6cc2609ee0dbff97ac7b104767ac2b | #!/usr/bin/python3
"""
This script demonstrates a race condition with HTTP/1.1 keepalive
"""
import decimal
import json
import subprocess
import time
import threading
import requests
requests.packages.urllib3.disable_warnings()
CREDS = json.loads(subprocess.check_output(
"openstack --os-cloud devstack token issue... | <commit_before><commit_msg>Add a tool to reproduce HTTP KeepAlive races in OpenStack gate jobs.
Based on https://github.com/mikem23/keepalive-race
Change-Id: I11f66bf39c6cc2609ee0dbff97ac7b104767ac2b<commit_after> | #!/usr/bin/python3
"""
This script demonstrates a race condition with HTTP/1.1 keepalive
"""
import decimal
import json
import subprocess
import time
import threading
import requests
requests.packages.urllib3.disable_warnings()
CREDS = json.loads(subprocess.check_output(
"openstack --os-cloud devstack token issue... | Add a tool to reproduce HTTP KeepAlive races in OpenStack gate jobs.
Based on https://github.com/mikem23/keepalive-race
Change-Id: I11f66bf39c6cc2609ee0dbff97ac7b104767ac2b#!/usr/bin/python3
"""
This script demonstrates a race condition with HTTP/1.1 keepalive
"""
import decimal
import json
import subprocess
import t... | <commit_before><commit_msg>Add a tool to reproduce HTTP KeepAlive races in OpenStack gate jobs.
Based on https://github.com/mikem23/keepalive-race
Change-Id: I11f66bf39c6cc2609ee0dbff97ac7b104767ac2b<commit_after>#!/usr/bin/python3
"""
This script demonstrates a race condition with HTTP/1.1 keepalive
"""
import decim... | |
48da7ceb86387d3cb6fd53f50110232813123ecc | tests/pytests/unit/roster/test_ansible.py | tests/pytests/unit/roster/test_ansible.py | import pytest
import salt.roster.ansible as ansible
from tests.support.mock import patch
@pytest.mark.xfail
@pytest.mark.parametrize(
"which_value",
[False, None],
)
def test_virtual_returns_False_if_ansible_inventory_doesnt_exist(which_value):
with patch("salt.utils.path.which", autospec=True, return_val... | Add tests for ansible roster virtual | Add tests for ansible roster virtual
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add tests for ansible roster virtual | import pytest
import salt.roster.ansible as ansible
from tests.support.mock import patch
@pytest.mark.xfail
@pytest.mark.parametrize(
"which_value",
[False, None],
)
def test_virtual_returns_False_if_ansible_inventory_doesnt_exist(which_value):
with patch("salt.utils.path.which", autospec=True, return_val... | <commit_before><commit_msg>Add tests for ansible roster virtual<commit_after> | import pytest
import salt.roster.ansible as ansible
from tests.support.mock import patch
@pytest.mark.xfail
@pytest.mark.parametrize(
"which_value",
[False, None],
)
def test_virtual_returns_False_if_ansible_inventory_doesnt_exist(which_value):
with patch("salt.utils.path.which", autospec=True, return_val... | Add tests for ansible roster virtualimport pytest
import salt.roster.ansible as ansible
from tests.support.mock import patch
@pytest.mark.xfail
@pytest.mark.parametrize(
"which_value",
[False, None],
)
def test_virtual_returns_False_if_ansible_inventory_doesnt_exist(which_value):
with patch("salt.utils.pa... | <commit_before><commit_msg>Add tests for ansible roster virtual<commit_after>import pytest
import salt.roster.ansible as ansible
from tests.support.mock import patch
@pytest.mark.xfail
@pytest.mark.parametrize(
"which_value",
[False, None],
)
def test_virtual_returns_False_if_ansible_inventory_doesnt_exist(wh... | |
59e546ae5afe22aab967e5376c8799e29ccbd86a | directoryFileContentCmp.py | directoryFileContentCmp.py | #! /usr/env/python
import os
import hashlib
import sys
bufsize = 65536
# Path1 = '/Users/kirkchambers/Desktop'
# Path2 = '/Users/kirkchambers/DataSets'
def generate_file_digests_for(path):
path_set = set()
for item in os.walk(path):
(directory, _subdirectories, files) = item
for file in files:
if (file[0] ==... | Add the basic version of my file comparison script | Add the basic version of my file comparison script
| Python | mit | kirkchambe/random_scripts | Add the basic version of my file comparison script | #! /usr/env/python
import os
import hashlib
import sys
bufsize = 65536
# Path1 = '/Users/kirkchambers/Desktop'
# Path2 = '/Users/kirkchambers/DataSets'
def generate_file_digests_for(path):
path_set = set()
for item in os.walk(path):
(directory, _subdirectories, files) = item
for file in files:
if (file[0] ==... | <commit_before><commit_msg>Add the basic version of my file comparison script<commit_after> | #! /usr/env/python
import os
import hashlib
import sys
bufsize = 65536
# Path1 = '/Users/kirkchambers/Desktop'
# Path2 = '/Users/kirkchambers/DataSets'
def generate_file_digests_for(path):
path_set = set()
for item in os.walk(path):
(directory, _subdirectories, files) = item
for file in files:
if (file[0] ==... | Add the basic version of my file comparison script#! /usr/env/python
import os
import hashlib
import sys
bufsize = 65536
# Path1 = '/Users/kirkchambers/Desktop'
# Path2 = '/Users/kirkchambers/DataSets'
def generate_file_digests_for(path):
path_set = set()
for item in os.walk(path):
(directory, _subdirectories, fi... | <commit_before><commit_msg>Add the basic version of my file comparison script<commit_after>#! /usr/env/python
import os
import hashlib
import sys
bufsize = 65536
# Path1 = '/Users/kirkchambers/Desktop'
# Path2 = '/Users/kirkchambers/DataSets'
def generate_file_digests_for(path):
path_set = set()
for item in os.walk... | |
c3afc6c28530c3dfc3bd57d9a1841a60bf92ba4f | tools/perf/benchmarks/netsim_top25.py | tools/perf/benchmarks/netsim_top25.py | # Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites under simulated cab... | # Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites under simulated cab... | Fix bug which caused page cyclers to always clear cache before load. | [Telemetry] Fix bug which caused page cyclers to always clear cache before load.
Previously, the cache clearing bit would apply when the netsim benchmark was
imported. This fixes it so that it only applies when it is used.
BUG=256492
NOTRY=True
TBR=dtu@chromium.org
Review URL: https://codereview.chromium.org/1855000... | Python | bsd-3-clause | mohamed--abdel-maksoud/chromium.src,patrickm/chromium.src,chuan9/chromium-crosswalk,jaruba/chromium.src,Chilledheart/chromium,littlstar/chromium.src,fujunwei/chromium-crosswalk,jaruba/chromium.src,chuan9/chromium-crosswalk,Pluto-tv/chromium-crosswalk,TheTypoMaster/chromium-crosswalk,mogoweb/chromium-crosswalk,hgl888/ch... | # Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites under simulated cab... | # Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites under simulated cab... | <commit_before># Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites unde... | # Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites under simulated cab... | # Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites under simulated cab... | <commit_before># Copyright 2013 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 import test
from perf_tools import page_cycler
class NetsimTop25(test.Test):
"""Measures load time of the top 25 sites unde... |
fe145fd87db777d9eeb361688d502b1b3ec4b2e1 | Transformation.py | Transformation.py | # -*- coding:utf-8 -*-
# ***************************************************************************
# Transformation.py
# -------------------
# update : 2013-11-13
# copyright : (C) 2013 by Michaël Roy
# email :... | Add a new Model-View-Projection matrix tool. | Add a new Model-View-Projection matrix tool.
| Python | mit | microy/MeshToolkit,microy/PyMeshToolkit,microy/MeshToolkit,microy/PyMeshToolkit | Add a new Model-View-Projection matrix tool. | # -*- coding:utf-8 -*-
# ***************************************************************************
# Transformation.py
# -------------------
# update : 2013-11-13
# copyright : (C) 2013 by Michaël Roy
# email :... | <commit_before><commit_msg>Add a new Model-View-Projection matrix tool.<commit_after> | # -*- coding:utf-8 -*-
# ***************************************************************************
# Transformation.py
# -------------------
# update : 2013-11-13
# copyright : (C) 2013 by Michaël Roy
# email :... | Add a new Model-View-Projection matrix tool.# -*- coding:utf-8 -*-
# ***************************************************************************
# Transformation.py
# -------------------
# update : 2013-11-13
# copyright : (C) 201... | <commit_before><commit_msg>Add a new Model-View-Projection matrix tool.<commit_after># -*- coding:utf-8 -*-
# ***************************************************************************
# Transformation.py
# -------------------
# update : 2013-... | |
68dbfedf90fb9e6c922971deaeccad148a258a70 | tests/test_dynamic_ecore_extension.py | tests/test_dynamic_ecore_extension.py | import pytest
from pyecore.ecore import *
import pyecore.ecore as ecore
from ordered_set import OrderedSet
def test__EModelElement_extension():
A = EClass('A', superclass=(EModelElement.eClass))
a = A()
assert a.eAnnotations == OrderedSet()
annotation = EAnnotation(source='testAnnot')
annotation.... | Add tests for PyEcore extension (EClass/EModelElement tests) | Add tests for PyEcore extension (EClass/EModelElement tests)
| Python | bsd-3-clause | aranega/pyecore,pyecore/pyecore | Add tests for PyEcore extension (EClass/EModelElement tests) | import pytest
from pyecore.ecore import *
import pyecore.ecore as ecore
from ordered_set import OrderedSet
def test__EModelElement_extension():
A = EClass('A', superclass=(EModelElement.eClass))
a = A()
assert a.eAnnotations == OrderedSet()
annotation = EAnnotation(source='testAnnot')
annotation.... | <commit_before><commit_msg>Add tests for PyEcore extension (EClass/EModelElement tests)<commit_after> | import pytest
from pyecore.ecore import *
import pyecore.ecore as ecore
from ordered_set import OrderedSet
def test__EModelElement_extension():
A = EClass('A', superclass=(EModelElement.eClass))
a = A()
assert a.eAnnotations == OrderedSet()
annotation = EAnnotation(source='testAnnot')
annotation.... | Add tests for PyEcore extension (EClass/EModelElement tests)import pytest
from pyecore.ecore import *
import pyecore.ecore as ecore
from ordered_set import OrderedSet
def test__EModelElement_extension():
A = EClass('A', superclass=(EModelElement.eClass))
a = A()
assert a.eAnnotations == OrderedSet()
... | <commit_before><commit_msg>Add tests for PyEcore extension (EClass/EModelElement tests)<commit_after>import pytest
from pyecore.ecore import *
import pyecore.ecore as ecore
from ordered_set import OrderedSet
def test__EModelElement_extension():
A = EClass('A', superclass=(EModelElement.eClass))
a = A()
as... | |
40431228c8535f325b005bb52485cae87a8be714 | tests/unit/modules/test_napalm_acl.py | tests/unit/modules/test_napalm_acl.py | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Anthony Shaw <anthonyshaw@apache.org>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (... | Add test module for napalm_acl | Add test module for napalm_acl
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add test module for napalm_acl | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Anthony Shaw <anthonyshaw@apache.org>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (... | <commit_before><commit_msg>Add test module for napalm_acl<commit_after> | # -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Anthony Shaw <anthonyshaw@apache.org>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
from tests.support.mock import (... | Add test module for napalm_acl# -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Anthony Shaw <anthonyshaw@apache.org>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from tests.support.unit import TestCase, skipIf
fr... | <commit_before><commit_msg>Add test module for napalm_acl<commit_after># -*- coding: utf-8 -*-
'''
:codeauthor: :email:`Anthony Shaw <anthonyshaw@apache.org>`
'''
# Import Python Libs
from __future__ import absolute_import
# Import Salt Testing Libs
from tests.support.mixins import LoaderModuleMockMixin
from test... | |
841fb156fff3d257d39afdc9d3d4e587427fe2cf | Source/Scm/wb_scm_project_place_holder.py | Source/Scm/wb_scm_project_place_holder.py | '''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
===========================================================... | Add new file missed in earlier commit place holder for projects that do not load for some reason | Add new file missed in earlier commit
place holder for projects that do not load for some reason | Python | apache-2.0 | barry-scott/git-workbench,barry-scott/scm-workbench,barry-scott/scm-workbench,barry-scott/git-workbench,barry-scott/scm-workbench | Add new file missed in earlier commit
place holder for projects that do not load for some reason | '''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
===========================================================... | <commit_before><commit_msg>Add new file missed in earlier commit
place holder for projects that do not load for some reason<commit_after> | '''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have received as part of this distribution.
===========================================================... | Add new file missed in earlier commit
place holder for projects that do not load for some reason'''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file LICENSE.txt,
which you should have rece... | <commit_before><commit_msg>Add new file missed in earlier commit
place holder for projects that do not load for some reason<commit_after>'''
====================================================================
Copyright (c) 2016 Barry A Scott. All rights reserved.
This software is licensed as described in the file... | |
5114f177741b105f33819b98415702e53b52eb01 | corehq/apps/hqadmin/management/commands/update_site_setup.py | corehq/apps/hqadmin/management/commands/update_site_setup.py | from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
from django.conf import settings
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'site_address',
help="the new site address that should b... | Add script to update site setup which is used at places like password reset email | Add script to update site setup which is used at places like password reset email [skip ci] | Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq | Add script to update site setup which is used at places like password reset email [skip ci] | from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
from django.conf import settings
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'site_address',
help="the new site address that should b... | <commit_before><commit_msg>Add script to update site setup which is used at places like password reset email [skip ci]<commit_after> | from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
from django.conf import settings
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add_argument(
'site_address',
help="the new site address that should b... | Add script to update site setup which is used at places like password reset email [skip ci]from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
from django.conf import settings
class Command(BaseCommand):
def add_arguments(self, parser):
parser.add... | <commit_before><commit_msg>Add script to update site setup which is used at places like password reset email [skip ci]<commit_after>from django.core.management.base import BaseCommand, CommandError
from django.contrib.sites.models import Site
from django.conf import settings
class Command(BaseCommand):
def add_ar... | |
8b4c34e84d306b5f9021de47bc3ae9050e2fc2b3 | compare_clouds.py | compare_clouds.py | #!/usr/bin/env python3
from pathlib import Path
"""Code for comparing point clouds"""
cloud1Path = Path("./data/reconstructions/2016_10_24__17_43_17/reference.ply")
cloud2Path = Path("./data/reconstructions/2016_10_24__17_43_17/high_quality.ply")
from load_ply import load_ply
cloud1PointData = load_ply(cloud1Path)... | Fix loading of ply files exported by meshlab | Fix loading of ply files exported by meshlab
| Python | mit | drewm1980/multi_view_stereo_benchmark,drewm1980/multi_view_stereo_benchmark,drewm1980/multi_view_stereo_benchmark | Fix loading of ply files exported by meshlab | #!/usr/bin/env python3
from pathlib import Path
"""Code for comparing point clouds"""
cloud1Path = Path("./data/reconstructions/2016_10_24__17_43_17/reference.ply")
cloud2Path = Path("./data/reconstructions/2016_10_24__17_43_17/high_quality.ply")
from load_ply import load_ply
cloud1PointData = load_ply(cloud1Path)... | <commit_before><commit_msg>Fix loading of ply files exported by meshlab<commit_after> | #!/usr/bin/env python3
from pathlib import Path
"""Code for comparing point clouds"""
cloud1Path = Path("./data/reconstructions/2016_10_24__17_43_17/reference.ply")
cloud2Path = Path("./data/reconstructions/2016_10_24__17_43_17/high_quality.ply")
from load_ply import load_ply
cloud1PointData = load_ply(cloud1Path)... | Fix loading of ply files exported by meshlab#!/usr/bin/env python3
from pathlib import Path
"""Code for comparing point clouds"""
cloud1Path = Path("./data/reconstructions/2016_10_24__17_43_17/reference.ply")
cloud2Path = Path("./data/reconstructions/2016_10_24__17_43_17/high_quality.ply")
from load_ply import load... | <commit_before><commit_msg>Fix loading of ply files exported by meshlab<commit_after>#!/usr/bin/env python3
from pathlib import Path
"""Code for comparing point clouds"""
cloud1Path = Path("./data/reconstructions/2016_10_24__17_43_17/reference.ply")
cloud2Path = Path("./data/reconstructions/2016_10_24__17_43_17/high... | |
0bf7d9fb20a3d2588ffc0e8341ec2af3df5fe300 | depot/tests/test_depot_index.py | depot/tests/test_depot_index.py | from django.test import TestCase, Client
from depot.models import Depot
def create_depot(name, state):
return Depot.objects.create(name=name, active=state)
class DepotIndexTestCase(TestCase):
def test_depot_index_template(self):
response = self.client.get('/depots/')
self.assertTemplateUsed... | Add test for depot index page | Add test for depot index page
| Python | agpl-3.0 | verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool,verleihtool/verleihtool | Add test for depot index page | from django.test import TestCase, Client
from depot.models import Depot
def create_depot(name, state):
return Depot.objects.create(name=name, active=state)
class DepotIndexTestCase(TestCase):
def test_depot_index_template(self):
response = self.client.get('/depots/')
self.assertTemplateUsed... | <commit_before><commit_msg>Add test for depot index page<commit_after> | from django.test import TestCase, Client
from depot.models import Depot
def create_depot(name, state):
return Depot.objects.create(name=name, active=state)
class DepotIndexTestCase(TestCase):
def test_depot_index_template(self):
response = self.client.get('/depots/')
self.assertTemplateUsed... | Add test for depot index pagefrom django.test import TestCase, Client
from depot.models import Depot
def create_depot(name, state):
return Depot.objects.create(name=name, active=state)
class DepotIndexTestCase(TestCase):
def test_depot_index_template(self):
response = self.client.get('/depots/')
... | <commit_before><commit_msg>Add test for depot index page<commit_after>from django.test import TestCase, Client
from depot.models import Depot
def create_depot(name, state):
return Depot.objects.create(name=name, active=state)
class DepotIndexTestCase(TestCase):
def test_depot_index_template(self):
... | |
cc79ee252e09ade17961d03265c61a87e270bd88 | nototools/map_pua_emoji.py | nototools/map_pua_emoji.py | #!/usr/bin/python
#
# Copyright 2014 Google Inc. 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 by... | Make color emoji use character sequences instead of PUA. | Make color emoji use character sequences instead of PUA.
The bitmap emoji tools are extended to create GSUB rules for character
sequences. The images are renamed to code the character sequence in their
filenames. New images are created for ASCII digits and number sign. A new
script is added to add cmaps to the file... | Python | apache-2.0 | davelab6/nototools,anthrotype/nototools,pathumego/nototools,googlei18n/nototools,davelab6/nototools,pahans/nototools,moyogo/nototools,googlefonts/nototools,namemealrady/nototools,googlei18n/nototools,moyogo/nototools,dougfelt/nototools,googlefonts/nototools,pahans/nototools,googlei18n/nototools,googlefonts/nototools,da... | Make color emoji use character sequences instead of PUA.
The bitmap emoji tools are extended to create GSUB rules for character
sequences. The images are renamed to code the character sequence in their
filenames. New images are created for ASCII digits and number sign. A new
script is added to add cmaps to the file... | #!/usr/bin/python
#
# Copyright 2014 Google Inc. 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 by... | <commit_before><commit_msg>Make color emoji use character sequences instead of PUA.
The bitmap emoji tools are extended to create GSUB rules for character
sequences. The images are renamed to code the character sequence in their
filenames. New images are created for ASCII digits and number sign. A new
script is add... | #!/usr/bin/python
#
# Copyright 2014 Google Inc. 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 by... | Make color emoji use character sequences instead of PUA.
The bitmap emoji tools are extended to create GSUB rules for character
sequences. The images are renamed to code the character sequence in their
filenames. New images are created for ASCII digits and number sign. A new
script is added to add cmaps to the file... | <commit_before><commit_msg>Make color emoji use character sequences instead of PUA.
The bitmap emoji tools are extended to create GSUB rules for character
sequences. The images are renamed to code the character sequence in their
filenames. New images are created for ASCII digits and number sign. A new
script is add... | |
3adcefcad4fc3ecb85aa4a22e8b3c4bf5ca4e6f5 | test/integration/ggrc/converters/test_import_update.py | test/integration/ggrc/converters/test_import_update.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects """
def setUp(self):
TestCase.setUp(sel... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for bulk updates with CSV import."""
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects... | Add tests for revision updates via import | Add tests for revision updates via import
This tests checks if new revisions were added for object updated via CSV
import.
| Python | apache-2.0 | edofic/ggrc-core,selahssea/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,andrei-karalionak/ggrc-core,AleksNeStu/ggrc-core,selahssea/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,edofic/ggrc-core,jo... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects """
def setUp(self):
TestCase.setUp(sel... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for bulk updates with CSV import."""
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects... | <commit_before># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects """
def setUp(self):
Tes... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Tests for bulk updates with CSV import."""
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects... | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects """
def setUp(self):
TestCase.setUp(sel... | <commit_before># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
from integration.ggrc.converters import TestCase
from ggrc import models
class TestImportUpdates(TestCase):
""" Test importing of already existing objects """
def setUp(self):
Tes... |
e48caa4bb61cce466ad5eb9bffbfba8e33312474 | python/example_code/ec2/terminate_instances.py | python/example_code/ec2/terminate_instances.py | # snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourcedescription:[terminate_instances.py demonstrates how to terminate an Amazon EC2 instance.]
# snippet-service:[ec2]
# snippet-keyword:[Amazon EC2]
# snippet-keyword:[Python]
# snippet-keyword:[AWS SDK for Python (Bot... | Add Python EC2 TerminateInstances example | Add Python EC2 TerminateInstances example
Merge pull request #504 from awsdocs/scalwas_ec2 | Python | apache-2.0 | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a... | Add Python EC2 TerminateInstances example
Merge pull request #504 from awsdocs/scalwas_ec2 | # snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourcedescription:[terminate_instances.py demonstrates how to terminate an Amazon EC2 instance.]
# snippet-service:[ec2]
# snippet-keyword:[Amazon EC2]
# snippet-keyword:[Python]
# snippet-keyword:[AWS SDK for Python (Bot... | <commit_before><commit_msg>Add Python EC2 TerminateInstances example
Merge pull request #504 from awsdocs/scalwas_ec2<commit_after> | # snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourcedescription:[terminate_instances.py demonstrates how to terminate an Amazon EC2 instance.]
# snippet-service:[ec2]
# snippet-keyword:[Amazon EC2]
# snippet-keyword:[Python]
# snippet-keyword:[AWS SDK for Python (Bot... | Add Python EC2 TerminateInstances example
Merge pull request #504 from awsdocs/scalwas_ec2# snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourcedescription:[terminate_instances.py demonstrates how to terminate an Amazon EC2 instance.]
# snippet-service:[ec2]
# snippet... | <commit_before><commit_msg>Add Python EC2 TerminateInstances example
Merge pull request #504 from awsdocs/scalwas_ec2<commit_after># snippet-comment:[These are tags for the AWS doc team's sample catalog. Do not remove.]
# snippet-sourcedescription:[terminate_instances.py demonstrates how to terminate an Amazon EC2 ins... | |
58fee826ab5298f7de036bf320bbc109b853eec8 | tendrl/commons/manager/__init__.py | tendrl/commons/manager/__init__.py | import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread = central_store_... | import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread = central_store_... | Add null check for sds sync thread which can be optional | Add null check for sds sync thread which can be optional
Signed-off-by: anmolbabu <3d38fb1e9c5ff2662fc415254efcdfedb95b84d5@gmail.com>
| Python | lgpl-2.1 | Tendrl/commons,rishubhjain/commons,r0h4n/commons | import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread = central_store_... | import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread = central_store_... | <commit_before>import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread =... | import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread = central_store_... | import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread = central_store_... | <commit_before>import abc
import logging
import six
from tendrl.commons import jobs
LOG = logging.getLogger(__name__)
@six.add_metaclass(abc.ABCMeta)
class Manager(object):
def __init__(
self,
sds_sync_thread,
central_store_thread,
):
self._central_store_thread =... |
e5a39d4e17a0555cb242731b34f0ee480367b4fe | foireminder/foireminder/reminders/tasks.py | foireminder/foireminder/reminders/tasks.py | from django.utils import timezone
from .models import ReminderRequest, EmailReminder
def send_todays_notifications(self):
today = timezone.now()
reminders = ReminderRequest.objects.filter(
start__year=today.year,
start__month=today.month,
start__day=today.da
)
for reminder in ... | Add task that sends out notifications | Add task that sends out notifications | Python | mit | stefanw/foireminder,stefanw/foireminder | Add task that sends out notifications | from django.utils import timezone
from .models import ReminderRequest, EmailReminder
def send_todays_notifications(self):
today = timezone.now()
reminders = ReminderRequest.objects.filter(
start__year=today.year,
start__month=today.month,
start__day=today.da
)
for reminder in ... | <commit_before><commit_msg>Add task that sends out notifications<commit_after> | from django.utils import timezone
from .models import ReminderRequest, EmailReminder
def send_todays_notifications(self):
today = timezone.now()
reminders = ReminderRequest.objects.filter(
start__year=today.year,
start__month=today.month,
start__day=today.da
)
for reminder in ... | Add task that sends out notificationsfrom django.utils import timezone
from .models import ReminderRequest, EmailReminder
def send_todays_notifications(self):
today = timezone.now()
reminders = ReminderRequest.objects.filter(
start__year=today.year,
start__month=today.month,
start__da... | <commit_before><commit_msg>Add task that sends out notifications<commit_after>from django.utils import timezone
from .models import ReminderRequest, EmailReminder
def send_todays_notifications(self):
today = timezone.now()
reminders = ReminderRequest.objects.filter(
start__year=today.year,
st... | |
c58c58d5bf1394e04e30f5eeb298818558be027f | tests/rules_tests/clearAfterNonTermRemove/__init__.py | tests/rules_tests/clearAfterNonTermRemove/__init__.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 17.08.2017 22:06
:Licence GNUv3
Part of grammpy
""" | Add directory for tests of rules removin | Add directory for tests of rules removin
| Python | mit | PatrikValkovic/grammpy | Add directory for tests of rules removin | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 17.08.2017 22:06
:Licence GNUv3
Part of grammpy
""" | <commit_before><commit_msg>Add directory for tests of rules removin<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 17.08.2017 22:06
:Licence GNUv3
Part of grammpy
""" | Add directory for tests of rules removin#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 17.08.2017 22:06
:Licence GNUv3
Part of grammpy
""" | <commit_before><commit_msg>Add directory for tests of rules removin<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 17.08.2017 22:06
:Licence GNUv3
Part of grammpy
""" | |
d40fb122d7083b9735728df15120ed682431be79 | scripts/make_fhes_seeds.py | scripts/make_fhes_seeds.py | import yaml
import sys
import numpy as np
from astropy.table import Table
from astropy.coordinates import SkyCoord
from fermipy.catalog import *
from fermipy.utils import *
def get_coord(name,tab):
row = tab[tab['Source_Name'] == name]
return SkyCoord(float(row['RAJ2000']), float(row['DEJ2000']),unit='deg')
... | Create script for generating analysis seeds. | Create script for generating analysis seeds.
| Python | bsd-3-clause | woodmd/haloanalysis,woodmd/haloanalysis | Create script for generating analysis seeds. | import yaml
import sys
import numpy as np
from astropy.table import Table
from astropy.coordinates import SkyCoord
from fermipy.catalog import *
from fermipy.utils import *
def get_coord(name,tab):
row = tab[tab['Source_Name'] == name]
return SkyCoord(float(row['RAJ2000']), float(row['DEJ2000']),unit='deg')
... | <commit_before><commit_msg>Create script for generating analysis seeds.<commit_after> | import yaml
import sys
import numpy as np
from astropy.table import Table
from astropy.coordinates import SkyCoord
from fermipy.catalog import *
from fermipy.utils import *
def get_coord(name,tab):
row = tab[tab['Source_Name'] == name]
return SkyCoord(float(row['RAJ2000']), float(row['DEJ2000']),unit='deg')
... | Create script for generating analysis seeds.import yaml
import sys
import numpy as np
from astropy.table import Table
from astropy.coordinates import SkyCoord
from fermipy.catalog import *
from fermipy.utils import *
def get_coord(name,tab):
row = tab[tab['Source_Name'] == name]
return SkyCoord(float(row['RA... | <commit_before><commit_msg>Create script for generating analysis seeds.<commit_after>import yaml
import sys
import numpy as np
from astropy.table import Table
from astropy.coordinates import SkyCoord
from fermipy.catalog import *
from fermipy.utils import *
def get_coord(name,tab):
row = tab[tab['Source_Name'] =... | |
d1ee86414d45c571571d75434b8c2256b0120732 | py/binary-tree-tilt.py | py/binary-tree-tilt.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findTilt(self, root):
"""
:type root: TreeNode
:rtype: int
"""
return self.do... | Add py solution for 563. Binary Tree Tilt | Add py solution for 563. Binary Tree Tilt
563. Binary Tree Tilt: https://leetcode.com/problems/binary-tree-tilt/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 563. Binary Tree Tilt
563. Binary Tree Tilt: https://leetcode.com/problems/binary-tree-tilt/ | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findTilt(self, root):
"""
:type root: TreeNode
:rtype: int
"""
return self.do... | <commit_before><commit_msg>Add py solution for 563. Binary Tree Tilt
563. Binary Tree Tilt: https://leetcode.com/problems/binary-tree-tilt/<commit_after> | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def findTilt(self, root):
"""
:type root: TreeNode
:rtype: int
"""
return self.do... | Add py solution for 563. Binary Tree Tilt
563. Binary Tree Tilt: https://leetcode.com/problems/binary-tree-tilt/# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def find... | <commit_before><commit_msg>Add py solution for 563. Binary Tree Tilt
563. Binary Tree Tilt: https://leetcode.com/problems/binary-tree-tilt/<commit_after># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = N... | |
925ff38344b5058ce196877e1fdcf79a1d1f6719 | ue4/tests/test_messaging.py | ue4/tests/test_messaging.py | import pytest
from m2u.ue4 import connection
def test_send_message_size():
"""Send a big message, larger than buffer size, so the server has to
read multiple chunks.
"""
message = "TestMessageSize " + ("abcdefg" * 5000)
connection.connect()
result = connection.send_message(message)
asser... | Add basic test for checking messages are received correctly | Add basic test for checking messages are received correctly
| Python | mit | m2u/m2u | Add basic test for checking messages are received correctly | import pytest
from m2u.ue4 import connection
def test_send_message_size():
"""Send a big message, larger than buffer size, so the server has to
read multiple chunks.
"""
message = "TestMessageSize " + ("abcdefg" * 5000)
connection.connect()
result = connection.send_message(message)
asser... | <commit_before><commit_msg>Add basic test for checking messages are received correctly<commit_after> | import pytest
from m2u.ue4 import connection
def test_send_message_size():
"""Send a big message, larger than buffer size, so the server has to
read multiple chunks.
"""
message = "TestMessageSize " + ("abcdefg" * 5000)
connection.connect()
result = connection.send_message(message)
asser... | Add basic test for checking messages are received correctlyimport pytest
from m2u.ue4 import connection
def test_send_message_size():
"""Send a big message, larger than buffer size, so the server has to
read multiple chunks.
"""
message = "TestMessageSize " + ("abcdefg" * 5000)
connection.connec... | <commit_before><commit_msg>Add basic test for checking messages are received correctly<commit_after>import pytest
from m2u.ue4 import connection
def test_send_message_size():
"""Send a big message, larger than buffer size, so the server has to
read multiple chunks.
"""
message = "TestMessageSize " +... | |
ff700e5d6fc5e0c5062f687110563d7f0312a3f0 | server/tests/test_admin.py | server/tests/test_admin.py | """General functional tests for the API endpoints."""
from django.test import TestCase, Client
# from django.urls import reverse
from rest_framework import status
from server.models import ApiKey, User
# from api.v2.tests.tools import SalAPITestCase
class AdminTest(TestCase):
"""Test the admin site is configu... | Set up test suite to ensure server admin routes are added. | Set up test suite to ensure server admin routes are added.
| Python | apache-2.0 | sheagcraig/sal,salopensource/sal,salopensource/sal,sheagcraig/sal,salopensource/sal,sheagcraig/sal,sheagcraig/sal,salopensource/sal | Set up test suite to ensure server admin routes are added. | """General functional tests for the API endpoints."""
from django.test import TestCase, Client
# from django.urls import reverse
from rest_framework import status
from server.models import ApiKey, User
# from api.v2.tests.tools import SalAPITestCase
class AdminTest(TestCase):
"""Test the admin site is configu... | <commit_before><commit_msg>Set up test suite to ensure server admin routes are added.<commit_after> | """General functional tests for the API endpoints."""
from django.test import TestCase, Client
# from django.urls import reverse
from rest_framework import status
from server.models import ApiKey, User
# from api.v2.tests.tools import SalAPITestCase
class AdminTest(TestCase):
"""Test the admin site is configu... | Set up test suite to ensure server admin routes are added."""General functional tests for the API endpoints."""
from django.test import TestCase, Client
# from django.urls import reverse
from rest_framework import status
from server.models import ApiKey, User
# from api.v2.tests.tools import SalAPITestCase
class ... | <commit_before><commit_msg>Set up test suite to ensure server admin routes are added.<commit_after>"""General functional tests for the API endpoints."""
from django.test import TestCase, Client
# from django.urls import reverse
from rest_framework import status
from server.models import ApiKey, User
# from api.v2.t... | |
0c29b431a0f5ce9115d7acdcaaabbd27546949c6 | chmvh_website/contact/tests/views/test_success_view.py | chmvh_website/contact/tests/views/test_success_view.py | from django.test import RequestFactory
from django.urls import reverse
from contact.views import SuccessView
class TestSuccessView(object):
"""Test cases for the success view"""
url = reverse('contact:success')
def test_get(self, rf: RequestFactory):
"""Test sending a GET request to the view.
... | Add test for contact success view. | Add test for contact success view.
| Python | mit | cdriehuys/chmvh-website,cdriehuys/chmvh-website,cdriehuys/chmvh-website | Add test for contact success view. | from django.test import RequestFactory
from django.urls import reverse
from contact.views import SuccessView
class TestSuccessView(object):
"""Test cases for the success view"""
url = reverse('contact:success')
def test_get(self, rf: RequestFactory):
"""Test sending a GET request to the view.
... | <commit_before><commit_msg>Add test for contact success view.<commit_after> | from django.test import RequestFactory
from django.urls import reverse
from contact.views import SuccessView
class TestSuccessView(object):
"""Test cases for the success view"""
url = reverse('contact:success')
def test_get(self, rf: RequestFactory):
"""Test sending a GET request to the view.
... | Add test for contact success view.from django.test import RequestFactory
from django.urls import reverse
from contact.views import SuccessView
class TestSuccessView(object):
"""Test cases for the success view"""
url = reverse('contact:success')
def test_get(self, rf: RequestFactory):
"""Test sen... | <commit_before><commit_msg>Add test for contact success view.<commit_after>from django.test import RequestFactory
from django.urls import reverse
from contact.views import SuccessView
class TestSuccessView(object):
"""Test cases for the success view"""
url = reverse('contact:success')
def test_get(self,... | |
c650d64247d63d2af7a8168795e7edae5c9ef6ef | realtime-plot.py | realtime-plot.py | import time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
self.axis_x = deque(maxlen=max_entries)
self.axis_y = deque(maxlen=max_entries)
self.axes = axes
self.max_entries = max_entries
... | Add realtime chart plotting example | Add realtime chart plotting example | Python | mit | voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts,voidabhi/python-scripts | Add realtime chart plotting example | import time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
self.axis_x = deque(maxlen=max_entries)
self.axis_y = deque(maxlen=max_entries)
self.axes = axes
self.max_entries = max_entries
... | <commit_before><commit_msg>Add realtime chart plotting example<commit_after> | import time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
self.axis_x = deque(maxlen=max_entries)
self.axis_y = deque(maxlen=max_entries)
self.axes = axes
self.max_entries = max_entries
... | Add realtime chart plotting exampleimport time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
self.axis_x = deque(maxlen=max_entries)
self.axis_y = deque(maxlen=max_entries)
self.axes = axes
sel... | <commit_before><commit_msg>Add realtime chart plotting example<commit_after>import time, random
import math
from collections import deque
start = time.time()
class RealtimePlot:
def __init__(self, axes, max_entries = 100):
self.axis_x = deque(maxlen=max_entries)
self.axis_y = deque(maxlen=max_entr... | |
f7e4ca11c7bfc35bf0fd6becd2a5d5fdd2ca5ed5 | src/main/python/partition_data.py | src/main/python/partition_data.py | import csv;
import random;
import sys;
in_file = str(sys.argv[1])
out_file = str(sys.argv[2])
num_partitions = int(sys.argv[3])
header = [];
partitions = [];
for i in range(num_partitions):
partitions.append([])
# Load all the training rows
row_num = 0;
with open(in_file) as file:
reader = csv.reader(file);
... | Add a script to split data with partitions. | Add a script to split data with partitions.
| Python | mit | juckele/ddr-grader,juckele/ddr-grader | Add a script to split data with partitions. | import csv;
import random;
import sys;
in_file = str(sys.argv[1])
out_file = str(sys.argv[2])
num_partitions = int(sys.argv[3])
header = [];
partitions = [];
for i in range(num_partitions):
partitions.append([])
# Load all the training rows
row_num = 0;
with open(in_file) as file:
reader = csv.reader(file);
... | <commit_before><commit_msg>Add a script to split data with partitions.<commit_after> | import csv;
import random;
import sys;
in_file = str(sys.argv[1])
out_file = str(sys.argv[2])
num_partitions = int(sys.argv[3])
header = [];
partitions = [];
for i in range(num_partitions):
partitions.append([])
# Load all the training rows
row_num = 0;
with open(in_file) as file:
reader = csv.reader(file);
... | Add a script to split data with partitions.import csv;
import random;
import sys;
in_file = str(sys.argv[1])
out_file = str(sys.argv[2])
num_partitions = int(sys.argv[3])
header = [];
partitions = [];
for i in range(num_partitions):
partitions.append([])
# Load all the training rows
row_num = 0;
with open(in_fil... | <commit_before><commit_msg>Add a script to split data with partitions.<commit_after>import csv;
import random;
import sys;
in_file = str(sys.argv[1])
out_file = str(sys.argv[2])
num_partitions = int(sys.argv[3])
header = [];
partitions = [];
for i in range(num_partitions):
partitions.append([])
# Load all the tr... | |
645507ed9ec43b354880673fbc75afe169ef6697 | tests/unit/test_handlers.py | tests/unit/test_handlers.py | from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| Add test capturing bad implementation of contains handler. | Add test capturing bad implementation of contains handler.
| Python | bsd-3-clause | jawilson/pmxbot,jawilson/pmxbot | Add test capturing bad implementation of contains handler. | from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| <commit_before><commit_msg>Add test capturing bad implementation of contains handler.<commit_after> | from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| Add test capturing bad implementation of contains handler.from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about #foo', channel='bar')
| <commit_before><commit_msg>Add test capturing bad implementation of contains handler.<commit_after>from pmxbot import core
def test_contains_always_match():
"""
Contains handler should always match if no rate is specified.
"""
handler = core.ContainsHandler(name='#', func=None)
assert handler.match('Tell me about... | |
b3e9075e819402f93f7dc2e29b61e3e621ab7355 | impy/imputations/tests/test_averaging_imputations.py | impy/imputations/tests/test_averaging_imputations.py | """test_averaging_imputations.py"""
import unittest
import numpy as np
from impy.imputations import mean_imputation
from impy.imputations import mode_imputation
from impy.imputations import median_imputation
from impy.datasets import random_int
class TestAveraging(unittest.TestCase):
""" Tests for Averaging """
... | Add unit tests for avging imputations | Add unit tests for avging imputations
| Python | mit | eltonlaw/impyute | Add unit tests for avging imputations | """test_averaging_imputations.py"""
import unittest
import numpy as np
from impy.imputations import mean_imputation
from impy.imputations import mode_imputation
from impy.imputations import median_imputation
from impy.datasets import random_int
class TestAveraging(unittest.TestCase):
""" Tests for Averaging """
... | <commit_before><commit_msg>Add unit tests for avging imputations<commit_after> | """test_averaging_imputations.py"""
import unittest
import numpy as np
from impy.imputations import mean_imputation
from impy.imputations import mode_imputation
from impy.imputations import median_imputation
from impy.datasets import random_int
class TestAveraging(unittest.TestCase):
""" Tests for Averaging """
... | Add unit tests for avging imputations"""test_averaging_imputations.py"""
import unittest
import numpy as np
from impy.imputations import mean_imputation
from impy.imputations import mode_imputation
from impy.imputations import median_imputation
from impy.datasets import random_int
class TestAveraging(unittest.TestCas... | <commit_before><commit_msg>Add unit tests for avging imputations<commit_after>"""test_averaging_imputations.py"""
import unittest
import numpy as np
from impy.imputations import mean_imputation
from impy.imputations import mode_imputation
from impy.imputations import median_imputation
from impy.datasets import random_i... | |
17ae9e25663d029af11236584b4c759c895ae830 | util/fileIngredients.py | util/fileIngredients.py | #!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import with_statement
import re
def fileContains(f, s, isRegex):
if isRege... | Improve and consolidate condition scripts of Lithium to support timeouts and regex via optparse. r=Jesse | Improve and consolidate condition scripts of Lithium to support timeouts and regex via optparse. r=Jesse
| Python | mpl-2.0 | nth10sd/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz,MozillaSecurity/funfuzz,nth10sd/funfuzz,MozillaSecurity/funfuzz | Improve and consolidate condition scripts of Lithium to support timeouts and regex via optparse. r=Jesse | #!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import with_statement
import re
def fileContains(f, s, isRegex):
if isRege... | <commit_before><commit_msg>Improve and consolidate condition scripts of Lithium to support timeouts and regex via optparse. r=Jesse<commit_after> | #!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
from __future__ import with_statement
import re
def fileContains(f, s, isRegex):
if isRege... | Improve and consolidate condition scripts of Lithium to support timeouts and regex via optparse. r=Jesse#!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL... | <commit_before><commit_msg>Improve and consolidate condition scripts of Lithium to support timeouts and regex via optparse. r=Jesse<commit_after>#!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You... | |
05aa314ac9b5d38bb7a30e30aced9b27b2797888 | python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep/test_syntax.py | python/ql/test/experimental/dataflow/tainttracking/defaultAdditionalTaintStep/test_syntax.py | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | Add tests for non-async constructs | Python: Add tests for non-async constructs
| Python | mit | github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql,github/codeql | Python: Add tests for non-async constructs | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | <commit_before><commit_msg>Python: Add tests for non-async constructs<commit_after> | # Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHECKING
if TYPE_CHECKING:
from ..taintlib... | Python: Add tests for non-async constructs# Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomplete to work
from typing import TYPE_CHEC... | <commit_before><commit_msg>Python: Add tests for non-async constructs<commit_after># Add taintlib to PATH so it can be imported during runtime without any hassle
import sys; import os; sys.path.append(os.path.dirname(os.path.dirname((__file__))))
from taintlib import *
# This has no runtime impact, but allows autocomp... | |
c1fcf54b63de95c85a9505d83062d8b320b1cbdf | python/example_code/cloudfront/update_distribution_certificate.py | python/example_code/cloudfront/update_distribution_certificate.py | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | Add python cloudfront update_distribution example to replace ACM Certificate | Add python cloudfront update_distribution example to replace ACM Certificate
Add python cloudfront update_distribution example to replace ACM Certificate
| Python | apache-2.0 | awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,awsdocs/aws-doc-sdk-examples,a... | Add python cloudfront update_distribution example to replace ACM Certificate
Add python cloudfront update_distribution example to replace ACM Certificate | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | <commit_before><commit_msg>Add python cloudfront update_distribution example to replace ACM Certificate
Add python cloudfront update_distribution example to replace ACM Certificate<commit_after> | # Copyright 2010-2018 Amazon.com, Inc. or its affiliates. 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. A copy of
# the License is located at
#
# http://aws.amazon.com/apache2.0/
#
# or in the "license" file ac... | Add python cloudfront update_distribution example to replace ACM Certificate
Add python cloudfront update_distribution example to replace ACM Certificate# Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"). You
# may not use t... | <commit_before><commit_msg>Add python cloudfront update_distribution example to replace ACM Certificate
Add python cloudfront update_distribution example to replace ACM Certificate<commit_after># Copyright 2010-2018 Amazon.com, Inc. or its affiliates. All Rights Reserved.
#
# Licensed under the Apache License, Version... | |
75a882bf38c88d73e38d13fbb8b1499ff4ae4ea6 | scripts/remove_after_use/set_meetings_users_fullnames_to_guids.py | scripts/remove_after_use/set_meetings_users_fullnames_to_guids.py | import sys
import logging
import django
from django.db import transaction
django.setup()
from osf.models import OSFUser
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def main():
dry_run = '--dry' in sys.argv
with transaction.atomic():
users = OSFUser.objects.filter(ful... | Add migration for changing users added by OSF for meetings with emails for fullnames to their guid | Add migration for changing users added by OSF for meetings with emails for fullnames to their guid
| Python | apache-2.0 | felliott/osf.io,adlius/osf.io,felliott/osf.io,adlius/osf.io,saradbowman/osf.io,HalcyonChimera/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,CenterForOpenScience/osf.io,mfraezz/osf.io,adlius/osf.io,felliott/osf.io,mattclark/osf.io,cslzchen/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,pattisdr/osf.io,brianjgeiger/... | Add migration for changing users added by OSF for meetings with emails for fullnames to their guid | import sys
import logging
import django
from django.db import transaction
django.setup()
from osf.models import OSFUser
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def main():
dry_run = '--dry' in sys.argv
with transaction.atomic():
users = OSFUser.objects.filter(ful... | <commit_before><commit_msg>Add migration for changing users added by OSF for meetings with emails for fullnames to their guid<commit_after> | import sys
import logging
import django
from django.db import transaction
django.setup()
from osf.models import OSFUser
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def main():
dry_run = '--dry' in sys.argv
with transaction.atomic():
users = OSFUser.objects.filter(ful... | Add migration for changing users added by OSF for meetings with emails for fullnames to their guidimport sys
import logging
import django
from django.db import transaction
django.setup()
from osf.models import OSFUser
logger = logging.getLogger(__name__)
logging.basicConfig(level=logging.INFO)
def main():
dry_r... | <commit_before><commit_msg>Add migration for changing users added by OSF for meetings with emails for fullnames to their guid<commit_after>import sys
import logging
import django
from django.db import transaction
django.setup()
from osf.models import OSFUser
logger = logging.getLogger(__name__)
logging.basicConfig(l... | |
a6b35a9a94b2e4b32c2236258812b44e81184515 | corehq/apps/users/management/commands/fix_location_user_data.py | corehq/apps/users/management/commands/fix_location_user_data.py | from corehq.apps.locations.models import Location
from corehq.apps.users.models import CommCareUser
from dimagi.utils.couch.database import iter_docs
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = "domain"
help = "Fix location user data for mobile workers.... | Add management command for resyncing mobile worker location user data | Add management command for resyncing mobile worker location user data
| Python | bsd-3-clause | dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq | Add management command for resyncing mobile worker location user data | from corehq.apps.locations.models import Location
from corehq.apps.users.models import CommCareUser
from dimagi.utils.couch.database import iter_docs
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = "domain"
help = "Fix location user data for mobile workers.... | <commit_before><commit_msg>Add management command for resyncing mobile worker location user data<commit_after> | from corehq.apps.locations.models import Location
from corehq.apps.users.models import CommCareUser
from dimagi.utils.couch.database import iter_docs
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
args = "domain"
help = "Fix location user data for mobile workers.... | Add management command for resyncing mobile worker location user datafrom corehq.apps.locations.models import Location
from corehq.apps.users.models import CommCareUser
from dimagi.utils.couch.database import iter_docs
from django.core.management.base import BaseCommand, CommandError
class Command(BaseCommand):
a... | <commit_before><commit_msg>Add management command for resyncing mobile worker location user data<commit_after>from corehq.apps.locations.models import Location
from corehq.apps.users.models import CommCareUser
from dimagi.utils.couch.database import iter_docs
from django.core.management.base import BaseCommand, Command... | |
415717bddb00ca650bef61a5c6054a7b47575b56 | jaspyx/tests/visitor/test_break.py | jaspyx/tests/visitor/test_break.py | import ast
from jaspyx.ast_util import ast_store, ast_load
from jaspyx.tests.visitor.v8_helper import V8Helper
class TestBreak(V8Helper):
def test_break(self):
assert self.run(
[
ast.Assign(
[ast_store('i')],
ast.Num(0),
)... | Implement unit test for break. | Implement unit test for break. | Python | mit | iksteen/jaspyx,ztane/jaspyx | Implement unit test for break. | import ast
from jaspyx.ast_util import ast_store, ast_load
from jaspyx.tests.visitor.v8_helper import V8Helper
class TestBreak(V8Helper):
def test_break(self):
assert self.run(
[
ast.Assign(
[ast_store('i')],
ast.Num(0),
)... | <commit_before><commit_msg>Implement unit test for break.<commit_after> | import ast
from jaspyx.ast_util import ast_store, ast_load
from jaspyx.tests.visitor.v8_helper import V8Helper
class TestBreak(V8Helper):
def test_break(self):
assert self.run(
[
ast.Assign(
[ast_store('i')],
ast.Num(0),
)... | Implement unit test for break.import ast
from jaspyx.ast_util import ast_store, ast_load
from jaspyx.tests.visitor.v8_helper import V8Helper
class TestBreak(V8Helper):
def test_break(self):
assert self.run(
[
ast.Assign(
[ast_store('i')],
... | <commit_before><commit_msg>Implement unit test for break.<commit_after>import ast
from jaspyx.ast_util import ast_store, ast_load
from jaspyx.tests.visitor.v8_helper import V8Helper
class TestBreak(V8Helper):
def test_break(self):
assert self.run(
[
ast.Assign(
... | |
495da73f305a2a0e79a28d251b5b93caea06656d | mediagenerator/filters/uglifier.py | mediagenerator/filters/uglifier.py | from django.conf import settings
from django.utils.encoding import smart_str
from mediagenerator.generators.bundles.base import Filter
class Uglifier(Filter):
def __init__(self, **kwargs):
super(Uglifier, self).__init__(**kwargs)
assert self.filetype == 'js', (
'Uglifier only supports c... | Add UglifyJS as a filter. | Add UglifyJS as a filter.
| Python | bsd-3-clause | Carlangueitor/django-mediagenerator,adieu/django-mediagenerator,Carlangueitor/django-mediagenerator,adieu/django-mediagenerator | Add UglifyJS as a filter. | from django.conf import settings
from django.utils.encoding import smart_str
from mediagenerator.generators.bundles.base import Filter
class Uglifier(Filter):
def __init__(self, **kwargs):
super(Uglifier, self).__init__(**kwargs)
assert self.filetype == 'js', (
'Uglifier only supports c... | <commit_before><commit_msg>Add UglifyJS as a filter.<commit_after> | from django.conf import settings
from django.utils.encoding import smart_str
from mediagenerator.generators.bundles.base import Filter
class Uglifier(Filter):
def __init__(self, **kwargs):
super(Uglifier, self).__init__(**kwargs)
assert self.filetype == 'js', (
'Uglifier only supports c... | Add UglifyJS as a filter.from django.conf import settings
from django.utils.encoding import smart_str
from mediagenerator.generators.bundles.base import Filter
class Uglifier(Filter):
def __init__(self, **kwargs):
super(Uglifier, self).__init__(**kwargs)
assert self.filetype == 'js', (
... | <commit_before><commit_msg>Add UglifyJS as a filter.<commit_after>from django.conf import settings
from django.utils.encoding import smart_str
from mediagenerator.generators.bundles.base import Filter
class Uglifier(Filter):
def __init__(self, **kwargs):
super(Uglifier, self).__init__(**kwargs)
ass... | |
96ed06f1f3dab3aa9d0f8150c41a5c1b943a86b0 | frappe/tests/test_config.py | frappe/tests/test_config.py | # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import unittest
import frappe
from frappe.config import get_modules_from_all_apps_for_user
class TestConfig(unittest.TestCase):
def test_get_modules(self):
frappe_modules = frappe.get_all("Module Def", filters={"app_n... | Add test for config module | test: Add test for config module
| Python | mit | StrellaGroup/frappe,frappe/frappe,StrellaGroup/frappe,frappe/frappe,StrellaGroup/frappe,frappe/frappe | test: Add test for config module | # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import unittest
import frappe
from frappe.config import get_modules_from_all_apps_for_user
class TestConfig(unittest.TestCase):
def test_get_modules(self):
frappe_modules = frappe.get_all("Module Def", filters={"app_n... | <commit_before><commit_msg>test: Add test for config module<commit_after> | # Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import unittest
import frappe
from frappe.config import get_modules_from_all_apps_for_user
class TestConfig(unittest.TestCase):
def test_get_modules(self):
frappe_modules = frappe.get_all("Module Def", filters={"app_n... | test: Add test for config module# Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import unittest
import frappe
from frappe.config import get_modules_from_all_apps_for_user
class TestConfig(unittest.TestCase):
def test_get_modules(self):
frappe_modules = frappe.get_a... | <commit_before><commit_msg>test: Add test for config module<commit_after># Copyright (c) 2022, Frappe Technologies Pvt. Ltd. and Contributors
# License: MIT. See LICENSE
import unittest
import frappe
from frappe.config import get_modules_from_all_apps_for_user
class TestConfig(unittest.TestCase):
def test_get_modul... | |
f1ccab2168dea1b0827f4ca929f0036e84170a76 | go/base/tests/test_views.py | go/base/tests/test_views.py | """Test for go.base.utils."""
from mock import patch, Mock
from django.core.urlresolvers import reverse
from go.base.tests.utils import VumiGoDjangoTestCase
class BaseViewsTestCase(VumiGoDjangoTestCase):
def cross_domain_xhr(self, url):
return self.client.post(reverse('cross_domain_xhr'), {'url': url})
... | Add tests for cross domain xhr view | Add tests for cross domain xhr view
| Python | bsd-3-clause | praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go,praekelt/vumi-go | Add tests for cross domain xhr view | """Test for go.base.utils."""
from mock import patch, Mock
from django.core.urlresolvers import reverse
from go.base.tests.utils import VumiGoDjangoTestCase
class BaseViewsTestCase(VumiGoDjangoTestCase):
def cross_domain_xhr(self, url):
return self.client.post(reverse('cross_domain_xhr'), {'url': url})
... | <commit_before><commit_msg>Add tests for cross domain xhr view<commit_after> | """Test for go.base.utils."""
from mock import patch, Mock
from django.core.urlresolvers import reverse
from go.base.tests.utils import VumiGoDjangoTestCase
class BaseViewsTestCase(VumiGoDjangoTestCase):
def cross_domain_xhr(self, url):
return self.client.post(reverse('cross_domain_xhr'), {'url': url})
... | Add tests for cross domain xhr view"""Test for go.base.utils."""
from mock import patch, Mock
from django.core.urlresolvers import reverse
from go.base.tests.utils import VumiGoDjangoTestCase
class BaseViewsTestCase(VumiGoDjangoTestCase):
def cross_domain_xhr(self, url):
return self.client.post(reverse(... | <commit_before><commit_msg>Add tests for cross domain xhr view<commit_after>"""Test for go.base.utils."""
from mock import patch, Mock
from django.core.urlresolvers import reverse
from go.base.tests.utils import VumiGoDjangoTestCase
class BaseViewsTestCase(VumiGoDjangoTestCase):
def cross_domain_xhr(self, url):... | |
5578d11f45e9c41ab9c4311f2bed48b9c24d9bf5 | tests/grammar_term-nonterm_test/NonterminalHaveTest.py | tests/grammar_term-nonterm_test/NonterminalHaveTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
""" | Create file for Nonterminal have method | Create file for Nonterminal have method
| Python | mit | PatrikValkovic/grammpy | Create file for Nonterminal have method | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
""" | <commit_before><commit_msg>Create file for Nonterminal have method<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
""" | Create file for Nonterminal have method#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
""" | <commit_before><commit_msg>Create file for Nonterminal have method<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
""" | |
913c9a10b2eb3b3d9de108a82a3251b2c0de0e10 | cybox/test/objects/hostname_test.py | cybox/test/objects/hostname_test.py | # Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from cybox.objects.hostname_object import Hostname
from cybox.test.objects import ObjectTestCase
class TestHostname(ObjectTestCase, unittest.TestCase):
object_type = "HostnameObjectType"
k... | Add test for Hostname object | Add test for Hostname object
| Python | bsd-3-clause | CybOXProject/python-cybox | Add test for Hostname object | # Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from cybox.objects.hostname_object import Hostname
from cybox.test.objects import ObjectTestCase
class TestHostname(ObjectTestCase, unittest.TestCase):
object_type = "HostnameObjectType"
k... | <commit_before><commit_msg>Add test for Hostname object<commit_after> | # Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from cybox.objects.hostname_object import Hostname
from cybox.test.objects import ObjectTestCase
class TestHostname(ObjectTestCase, unittest.TestCase):
object_type = "HostnameObjectType"
k... | Add test for Hostname object# Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from cybox.objects.hostname_object import Hostname
from cybox.test.objects import ObjectTestCase
class TestHostname(ObjectTestCase, unittest.TestCase):
object_type ... | <commit_before><commit_msg>Add test for Hostname object<commit_after># Copyright (c) 2014, The MITRE Corporation. All rights reserved.
# See LICENSE.txt for complete terms.
import unittest
from cybox.objects.hostname_object import Hostname
from cybox.test.objects import ObjectTestCase
class TestHostname(ObjectTestC... | |
514aca20c6f076a86819d7180f36c3b2e8bcc33b | tests/integration_tests/test_tensorflow_integration.py | tests/integration_tests/test_tensorflow_integration.py | from __future__ import print_function
import os
import tempfile
import pytest
import keras
from keras import layers
from keras.utils.test_utils import get_test_data
from keras.utils.test_utils import keras_test
@pytest.mark.skipif(keras.backend.backend() != 'tensorflow', reason='Requires TF backend')
@keras_test
def... | Add integration test checking compatibility of Keras models with TF optimizers. | Add integration test checking compatibility of Keras models with TF optimizers.
| Python | apache-2.0 | keras-team/keras,keras-team/keras | Add integration test checking compatibility of Keras models with TF optimizers. | from __future__ import print_function
import os
import tempfile
import pytest
import keras
from keras import layers
from keras.utils.test_utils import get_test_data
from keras.utils.test_utils import keras_test
@pytest.mark.skipif(keras.backend.backend() != 'tensorflow', reason='Requires TF backend')
@keras_test
def... | <commit_before><commit_msg>Add integration test checking compatibility of Keras models with TF optimizers.<commit_after> | from __future__ import print_function
import os
import tempfile
import pytest
import keras
from keras import layers
from keras.utils.test_utils import get_test_data
from keras.utils.test_utils import keras_test
@pytest.mark.skipif(keras.backend.backend() != 'tensorflow', reason='Requires TF backend')
@keras_test
def... | Add integration test checking compatibility of Keras models with TF optimizers.from __future__ import print_function
import os
import tempfile
import pytest
import keras
from keras import layers
from keras.utils.test_utils import get_test_data
from keras.utils.test_utils import keras_test
@pytest.mark.skipif(keras.b... | <commit_before><commit_msg>Add integration test checking compatibility of Keras models with TF optimizers.<commit_after>from __future__ import print_function
import os
import tempfile
import pytest
import keras
from keras import layers
from keras.utils.test_utils import get_test_data
from keras.utils.test_utils import... | |
24d742e444c84df99629d8a6aff7ca7e6c90f995 | scheduler/misc/detect_stuck_active_invs.py | scheduler/misc/detect_stuck_active_invs.py | #!/usr/bin/env python
# Copyright 2018 The LUCI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | Add adhoc script to detect jobs with stuck ActiveInvocations list. | [scheduler] Add adhoc script to detect jobs with stuck ActiveInvocations list.
R=a30c74fa30536fe7ea81ed6dec202e35e149e1fd@chromium.org
BUG=852142
Change-Id: Idae7f05c5045a72ff85db8587f8bd74c0b80fb06
Reviewed-on: https://chromium-review.googlesource.com/1098463
Reviewed-by: Andrii Shyshkalov <a30c74fa30536fe7ea81ed6de... | Python | apache-2.0 | luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go,luci/luci-go | [scheduler] Add adhoc script to detect jobs with stuck ActiveInvocations list.
R=a30c74fa30536fe7ea81ed6dec202e35e149e1fd@chromium.org
BUG=852142
Change-Id: Idae7f05c5045a72ff85db8587f8bd74c0b80fb06
Reviewed-on: https://chromium-review.googlesource.com/1098463
Reviewed-by: Andrii Shyshkalov <a30c74fa30536fe7ea81ed6de... | #!/usr/bin/env python
# Copyright 2018 The LUCI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | <commit_before><commit_msg>[scheduler] Add adhoc script to detect jobs with stuck ActiveInvocations list.
R=a30c74fa30536fe7ea81ed6dec202e35e149e1fd@chromium.org
BUG=852142
Change-Id: Idae7f05c5045a72ff85db8587f8bd74c0b80fb06
Reviewed-on: https://chromium-review.googlesource.com/1098463
Reviewed-by: Andrii Shyshkalov... | #!/usr/bin/env python
# Copyright 2018 The LUCI Authors.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable ... | [scheduler] Add adhoc script to detect jobs with stuck ActiveInvocations list.
R=a30c74fa30536fe7ea81ed6dec202e35e149e1fd@chromium.org
BUG=852142
Change-Id: Idae7f05c5045a72ff85db8587f8bd74c0b80fb06
Reviewed-on: https://chromium-review.googlesource.com/1098463
Reviewed-by: Andrii Shyshkalov <a30c74fa30536fe7ea81ed6de... | <commit_before><commit_msg>[scheduler] Add adhoc script to detect jobs with stuck ActiveInvocations list.
R=a30c74fa30536fe7ea81ed6dec202e35e149e1fd@chromium.org
BUG=852142
Change-Id: Idae7f05c5045a72ff85db8587f8bd74c0b80fb06
Reviewed-on: https://chromium-review.googlesource.com/1098463
Reviewed-by: Andrii Shyshkalov... | |
cf78037980a9345c12b1e2562bc4eda63cea95b3 | test/functionalities/backticks/TestBackticksWithoutATarget.py | test/functionalities/backticks/TestBackticksWithoutATarget.py | """
Test that backticks without a target should work (not infinite looping).
"""
import os, time
import unittest2
import lldb
from lldbtest import *
class BackticksWithNoTargetTestCase(TestBase):
mydir = "functionalities/backticks"
def test_backticks_no_target(self):
"""A simple test of backticks wi... | Add a simple regression test to go with r143260. CommandInterpreter::PreprocessCommand() should not infinite loop when a target has not been specified yet. | Add a simple regression test to go with r143260.
CommandInterpreter::PreprocessCommand() should not infinite loop
when a target has not been specified yet.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@143274 91177308-0d34-0410-b5e6-96231b3b80d8
| Python | apache-2.0 | apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,apple/swift-lldb,llvm-mirror/lldb,apple/swift-lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb,llvm-mirror/lldb | Add a simple regression test to go with r143260.
CommandInterpreter::PreprocessCommand() should not infinite loop
when a target has not been specified yet.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@143274 91177308-0d34-0410-b5e6-96231b3b80d8 | """
Test that backticks without a target should work (not infinite looping).
"""
import os, time
import unittest2
import lldb
from lldbtest import *
class BackticksWithNoTargetTestCase(TestBase):
mydir = "functionalities/backticks"
def test_backticks_no_target(self):
"""A simple test of backticks wi... | <commit_before><commit_msg>Add a simple regression test to go with r143260.
CommandInterpreter::PreprocessCommand() should not infinite loop
when a target has not been specified yet.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@143274 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after> | """
Test that backticks without a target should work (not infinite looping).
"""
import os, time
import unittest2
import lldb
from lldbtest import *
class BackticksWithNoTargetTestCase(TestBase):
mydir = "functionalities/backticks"
def test_backticks_no_target(self):
"""A simple test of backticks wi... | Add a simple regression test to go with r143260.
CommandInterpreter::PreprocessCommand() should not infinite loop
when a target has not been specified yet.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@143274 91177308-0d34-0410-b5e6-96231b3b80d8"""
Test that backticks without a target should work (not infinite... | <commit_before><commit_msg>Add a simple regression test to go with r143260.
CommandInterpreter::PreprocessCommand() should not infinite loop
when a target has not been specified yet.
git-svn-id: b33bab8abb5b18c12ee100cd7761ab452d00b2b0@143274 91177308-0d34-0410-b5e6-96231b3b80d8<commit_after>"""
Test that backticks w... | |
ff2fb40e961fe7b0c3f6dd6e91d8fb79a865a631 | src/ggrc_basic_permissions/migrations/versions/20131108224846_37b63b122038_hide_the_auditorread.py | src/ggrc_basic_permissions/migrations/versions/20131108224846_37b63b122038_hide_the_auditorread.py |
"""Hide the AuditorReader role by changing its scope.
Revision ID: 37b63b122038
Revises: 1ff082d26157
Create Date: 2013-11-08 22:48:46.956836
"""
# revision identifiers, used by Alembic.
revision = '37b63b122038'
down_revision = '1ff082d26157'
import sqlalchemy as sa
from alembic import op
from datetime import dat... | Hide the AuditorReader role in the system role assignment modal by placing it in an "implied" scope. | Hide the AuditorReader role in the system role assignment modal by
placing it in an "implied" scope.
| Python | apache-2.0 | josthkko/ggrc-core,uskudnik/ggrc-core,selahssea/ggrc-core,prasannav7/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,kr41/ggrc-core,kr41/ggrc-core,vladan-m/ggrc-core,NejcZupec/ggrc-core,edofic/ggrc-core,hasanalom/ggrc-core,hasanalom/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,josthkko/ggrc-core,andrei-karalio... | Hide the AuditorReader role in the system role assignment modal by
placing it in an "implied" scope. |
"""Hide the AuditorReader role by changing its scope.
Revision ID: 37b63b122038
Revises: 1ff082d26157
Create Date: 2013-11-08 22:48:46.956836
"""
# revision identifiers, used by Alembic.
revision = '37b63b122038'
down_revision = '1ff082d26157'
import sqlalchemy as sa
from alembic import op
from datetime import dat... | <commit_before><commit_msg>Hide the AuditorReader role in the system role assignment modal by
placing it in an "implied" scope.<commit_after> |
"""Hide the AuditorReader role by changing its scope.
Revision ID: 37b63b122038
Revises: 1ff082d26157
Create Date: 2013-11-08 22:48:46.956836
"""
# revision identifiers, used by Alembic.
revision = '37b63b122038'
down_revision = '1ff082d26157'
import sqlalchemy as sa
from alembic import op
from datetime import dat... | Hide the AuditorReader role in the system role assignment modal by
placing it in an "implied" scope.
"""Hide the AuditorReader role by changing its scope.
Revision ID: 37b63b122038
Revises: 1ff082d26157
Create Date: 2013-11-08 22:48:46.956836
"""
# revision identifiers, used by Alembic.
revision = '37b63b122038'
do... | <commit_before><commit_msg>Hide the AuditorReader role in the system role assignment modal by
placing it in an "implied" scope.<commit_after>
"""Hide the AuditorReader role by changing its scope.
Revision ID: 37b63b122038
Revises: 1ff082d26157
Create Date: 2013-11-08 22:48:46.956836
"""
# revision identifiers, used... | |
6e535a2d597f172d9342fb8a547335890c474b49 | src/config-sample.py | src/config-sample.py | FLASK_SECRET_KEY = 'Enter a Flask Secret Key'
# OAuth Credentials. You can find them on
# https://www.yelp.com/developers/v3/manage_app
YELP_CLIENT_ID = 'Enter Yelp Client ID'
YELP_CLIENT_SECRET = 'Enter Yelp Client Secret'
| Add a sample config file | Add a sample config file
| Python | mit | byanofsky/playa-vista-neighborhood,byanofsky/playa-vista-neighborhood,byanofsky/playa-vista-neighborhood | Add a sample config file | FLASK_SECRET_KEY = 'Enter a Flask Secret Key'
# OAuth Credentials. You can find them on
# https://www.yelp.com/developers/v3/manage_app
YELP_CLIENT_ID = 'Enter Yelp Client ID'
YELP_CLIENT_SECRET = 'Enter Yelp Client Secret'
| <commit_before><commit_msg>Add a sample config file<commit_after> | FLASK_SECRET_KEY = 'Enter a Flask Secret Key'
# OAuth Credentials. You can find them on
# https://www.yelp.com/developers/v3/manage_app
YELP_CLIENT_ID = 'Enter Yelp Client ID'
YELP_CLIENT_SECRET = 'Enter Yelp Client Secret'
| Add a sample config fileFLASK_SECRET_KEY = 'Enter a Flask Secret Key'
# OAuth Credentials. You can find them on
# https://www.yelp.com/developers/v3/manage_app
YELP_CLIENT_ID = 'Enter Yelp Client ID'
YELP_CLIENT_SECRET = 'Enter Yelp Client Secret'
| <commit_before><commit_msg>Add a sample config file<commit_after>FLASK_SECRET_KEY = 'Enter a Flask Secret Key'
# OAuth Credentials. You can find them on
# https://www.yelp.com/developers/v3/manage_app
YELP_CLIENT_ID = 'Enter Yelp Client ID'
YELP_CLIENT_SECRET = 'Enter Yelp Client Secret'
| |
22298d91fff788c37395cdad9245b3e7ed20cfdf | python/opencv/opencv_2/images/display_image_with_matplotlib.py | python/opencv/opencv_2/images/display_image_with_matplotlib.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Display image: display an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/... | Add a snippet (Python OpenCV). | Add a snippet (Python OpenCV).
| 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 snippet (Python OpenCV). | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Display image: display an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/... | <commit_before><commit_msg>Add a snippet (Python OpenCV).<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Display image: display an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/en/latest/py_tutorials/py_gui/... | Add a snippet (Python OpenCV).#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Display image: display an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https://opencv-python-tutroals.readthedocs.org/... | <commit_before><commit_msg>Add a snippet (Python OpenCV).<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
"""
OpenCV - Display image: display an image given in arguments
Required: opencv library (Debian: aptitude install python-opencv)
See: https:... | |
ba9e4c6b003cc002e5bc7216da960e47f9fe5424 | copper_imidazole_csv_allnitrogen.py | copper_imidazole_csv_allnitrogen.py | #!/usr/bin/env python2
import orca_parser
from copper_imidazole_analysis import CopperImidazoleAnalysis
import argparse
import csv
cia = CopperImidazoleAnalysis()
parser = argparse.ArgumentParser(description="Given pathnames of ORCA output files, make a dump of all nitrogen parameters to a CSV file.")
parser.add_ar... | Print information about all nitrogens. | Print information about all nitrogens.
| Python | mpl-2.0 | berquist/orcaparse | Print information about all nitrogens. | #!/usr/bin/env python2
import orca_parser
from copper_imidazole_analysis import CopperImidazoleAnalysis
import argparse
import csv
cia = CopperImidazoleAnalysis()
parser = argparse.ArgumentParser(description="Given pathnames of ORCA output files, make a dump of all nitrogen parameters to a CSV file.")
parser.add_ar... | <commit_before><commit_msg>Print information about all nitrogens.<commit_after> | #!/usr/bin/env python2
import orca_parser
from copper_imidazole_analysis import CopperImidazoleAnalysis
import argparse
import csv
cia = CopperImidazoleAnalysis()
parser = argparse.ArgumentParser(description="Given pathnames of ORCA output files, make a dump of all nitrogen parameters to a CSV file.")
parser.add_ar... | Print information about all nitrogens.#!/usr/bin/env python2
import orca_parser
from copper_imidazole_analysis import CopperImidazoleAnalysis
import argparse
import csv
cia = CopperImidazoleAnalysis()
parser = argparse.ArgumentParser(description="Given pathnames of ORCA output files, make a dump of all nitrogen para... | <commit_before><commit_msg>Print information about all nitrogens.<commit_after>#!/usr/bin/env python2
import orca_parser
from copper_imidazole_analysis import CopperImidazoleAnalysis
import argparse
import csv
cia = CopperImidazoleAnalysis()
parser = argparse.ArgumentParser(description="Given pathnames of ORCA outpu... | |
eb0772fc6c30d98b83bf1c8e7d83af21066ae45b | data_structures/Stack/Python/Stack.py | data_structures/Stack/Python/Stack.py | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | Add peek method and implementation | Add peek method and implementation
| Python | cc0-1.0 | Deepak345/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,ZoranPandovski/al-go-rithms,manikTharaka/al-go-rithms,Deepak345/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,Cnidarias/al-go-rithms,EUNIX-TRIX/al-go-rithms,manikTharaka/al-go-rithms,ZoranPandovski/al-go-rithms,EUNIX-TRIX/al-go-r... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | <commit_before># Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | # Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
# If the stack... | <commit_before># Author: AlexBanks97
# Purpose: LIFO Stack implementation using python array.
# Date: October 15th 2017
class Stack(object):
def __init__(self):
# Initialize stack as empty array
self.stack = []
# Return and remove the last element of the stack array.
def pop(self):
... |
825c4d613915d43aea2e6ee0bc5d5b49ed0a4500 | emission/analysis/classification/segmentation/section_segmentation.py | emission/analysis/classification/segmentation/section_segmentation.py | # Standard imports
import attrdict as ad
import numpy as np
import datetime as pydt
# Our imports
import emission.analysis.classification.cleaning.location_smoothing as ls
import emission.analysis.point_features as pf
import emission.storage.decorations.location_queries as lq
def segment_into_sections(trip):
poin... | Create a simple method to segment a trip into sections | Create a simple method to segment a trip into sections
This is purely based on the activity detection by android.
It assumes that we have all activity updates. It uses a fairly naive algorithm
with a threshold of 60% confidence, ignoring STILL, TILTING and UNKNOWN
movements, and segmenting every time the mode changes... | Python | bsd-3-clause | shankari/e-mission-server,joshzarrabi/e-mission-server,joshzarrabi/e-mission-server,sunil07t/e-mission-server,yw374cornell/e-mission-server,e-mission/e-mission-server,e-mission/e-mission-server,yw374cornell/e-mission-server,yw374cornell/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,shankari/e-mis... | Create a simple method to segment a trip into sections
This is purely based on the activity detection by android.
It assumes that we have all activity updates. It uses a fairly naive algorithm
with a threshold of 60% confidence, ignoring STILL, TILTING and UNKNOWN
movements, and segmenting every time the mode changes... | # Standard imports
import attrdict as ad
import numpy as np
import datetime as pydt
# Our imports
import emission.analysis.classification.cleaning.location_smoothing as ls
import emission.analysis.point_features as pf
import emission.storage.decorations.location_queries as lq
def segment_into_sections(trip):
poin... | <commit_before><commit_msg>Create a simple method to segment a trip into sections
This is purely based on the activity detection by android.
It assumes that we have all activity updates. It uses a fairly naive algorithm
with a threshold of 60% confidence, ignoring STILL, TILTING and UNKNOWN
movements, and segmenting ... | # Standard imports
import attrdict as ad
import numpy as np
import datetime as pydt
# Our imports
import emission.analysis.classification.cleaning.location_smoothing as ls
import emission.analysis.point_features as pf
import emission.storage.decorations.location_queries as lq
def segment_into_sections(trip):
poin... | Create a simple method to segment a trip into sections
This is purely based on the activity detection by android.
It assumes that we have all activity updates. It uses a fairly naive algorithm
with a threshold of 60% confidence, ignoring STILL, TILTING and UNKNOWN
movements, and segmenting every time the mode changes... | <commit_before><commit_msg>Create a simple method to segment a trip into sections
This is purely based on the activity detection by android.
It assumes that we have all activity updates. It uses a fairly naive algorithm
with a threshold of 60% confidence, ignoring STILL, TILTING and UNKNOWN
movements, and segmenting ... | |
5f2cd26054adff5a1fbf9ba5d56766b972f46670 | leakcheck/thread-key-gen.py | leakcheck/thread-key-gen.py | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in RSA and DSA key generation. 0.12 and
# older held the GIL during these operations. Subsequent versions release it
# during them.
from threading import Thread
from OpenSSL.crypto import TYPE_RSA, TYPE_DSA, PKe... | Add a multithreaded stress tester for key generation. Hopefully provides additional confidence that that code is correct with respect to threading. | Add a multithreaded stress tester for key generation. Hopefully provides additional confidence that that code is correct with respect to threading. | Python | apache-2.0 | mhils/pyopenssl,kediacorporation/pyopenssl,reaperhulk/pyopenssl,r0ro/pyopenssl,mhils/pyopenssl,daodaoliang/pyopenssl,elitest/pyopenssl,kjav/pyopenssl,kediacorporation/pyopenssl,alex/pyopenssl,lvh/pyopenssl,samv/pyopenssl,Lukasa/pyopenssl,mitghi/pyopenssl,msabramo/pyOpenSSL,reaperhulk/pyopenssl,hynek/pyopenssl,pyca/pyop... | Add a multithreaded stress tester for key generation. Hopefully provides additional confidence that that code is correct with respect to threading. | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in RSA and DSA key generation. 0.12 and
# older held the GIL during these operations. Subsequent versions release it
# during them.
from threading import Thread
from OpenSSL.crypto import TYPE_RSA, TYPE_DSA, PKe... | <commit_before><commit_msg>Add a multithreaded stress tester for key generation. Hopefully provides additional confidence that that code is correct with respect to threading.<commit_after> | # Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in RSA and DSA key generation. 0.12 and
# older held the GIL during these operations. Subsequent versions release it
# during them.
from threading import Thread
from OpenSSL.crypto import TYPE_RSA, TYPE_DSA, PKe... | Add a multithreaded stress tester for key generation. Hopefully provides additional confidence that that code is correct with respect to threading.# Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in RSA and DSA key generation. 0.12 and
# older held the GIL durin... | <commit_before><commit_msg>Add a multithreaded stress tester for key generation. Hopefully provides additional confidence that that code is correct with respect to threading.<commit_after># Copyright (C) Jean-Paul Calderone
# See LICENSE for details.
#
# Stress tester for thread-related bugs in RSA and DSA key generat... | |
4820013e207947fe7ff94777cd8dcf1ed474eab1 | migrations/versions/fb6a6554b21_add_account_lockout_fields_to_user.py | migrations/versions/fb6a6554b21_add_account_lockout_fields_to_user.py | """Add account lockout fields to User
Revision ID: fb6a6554b21
Revises: 1f9b411bf6df
Create Date: 2015-10-29 01:07:27.930095
"""
# revision identifiers, used by Alembic.
revision = 'fb6a6554b21'
down_revision = '1f9b411bf6df'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gene... | Add migration for account lockout fields on User | Add migration for account lockout fields on User
| Python | mit | richgieg/flask-now,richgieg/flask-now | Add migration for account lockout fields on User | """Add account lockout fields to User
Revision ID: fb6a6554b21
Revises: 1f9b411bf6df
Create Date: 2015-10-29 01:07:27.930095
"""
# revision identifiers, used by Alembic.
revision = 'fb6a6554b21'
down_revision = '1f9b411bf6df'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gene... | <commit_before><commit_msg>Add migration for account lockout fields on User<commit_after> | """Add account lockout fields to User
Revision ID: fb6a6554b21
Revises: 1f9b411bf6df
Create Date: 2015-10-29 01:07:27.930095
"""
# revision identifiers, used by Alembic.
revision = 'fb6a6554b21'
down_revision = '1f9b411bf6df'
from alembic import op
import sqlalchemy as sa
def upgrade():
### commands auto gene... | Add migration for account lockout fields on User"""Add account lockout fields to User
Revision ID: fb6a6554b21
Revises: 1f9b411bf6df
Create Date: 2015-10-29 01:07:27.930095
"""
# revision identifiers, used by Alembic.
revision = 'fb6a6554b21'
down_revision = '1f9b411bf6df'
from alembic import op
import sqlalchemy a... | <commit_before><commit_msg>Add migration for account lockout fields on User<commit_after>"""Add account lockout fields to User
Revision ID: fb6a6554b21
Revises: 1f9b411bf6df
Create Date: 2015-10-29 01:07:27.930095
"""
# revision identifiers, used by Alembic.
revision = 'fb6a6554b21'
down_revision = '1f9b411bf6df'
f... | |
6fabbe85bb74788641897daf8b162eac3d47b0aa | data_crunching/indonesia_timeseries/download_indonesia_prices.py | data_crunching/indonesia_timeseries/download_indonesia_prices.py | #!/usr/bin/env python2
import urllib2
import shutil
import re
import sys
import datetime
from lxml import etree
usage_str = """
This scripts downloads daily food prices from http://m.pip.kementan.org/index.php (Indonesia).
Provide date in DD/MM/YYYY format.
Example:
./download_indonesia_prices.py 15/03/2013
""... | Add script for downloading Indonesia price data | Add script for downloading Indonesia price data
(http://m.pip.kementan.org/index.php)
| Python | bsd-3-clause | FAB4D/humanitas,FAB4D/humanitas,FAB4D/humanitas | Add script for downloading Indonesia price data
(http://m.pip.kementan.org/index.php) | #!/usr/bin/env python2
import urllib2
import shutil
import re
import sys
import datetime
from lxml import etree
usage_str = """
This scripts downloads daily food prices from http://m.pip.kementan.org/index.php (Indonesia).
Provide date in DD/MM/YYYY format.
Example:
./download_indonesia_prices.py 15/03/2013
""... | <commit_before><commit_msg>Add script for downloading Indonesia price data
(http://m.pip.kementan.org/index.php)<commit_after> | #!/usr/bin/env python2
import urllib2
import shutil
import re
import sys
import datetime
from lxml import etree
usage_str = """
This scripts downloads daily food prices from http://m.pip.kementan.org/index.php (Indonesia).
Provide date in DD/MM/YYYY format.
Example:
./download_indonesia_prices.py 15/03/2013
""... | Add script for downloading Indonesia price data
(http://m.pip.kementan.org/index.php)#!/usr/bin/env python2
import urllib2
import shutil
import re
import sys
import datetime
from lxml import etree
usage_str = """
This scripts downloads daily food prices from http://m.pip.kementan.org/index.php (Indonesia).
Provide ... | <commit_before><commit_msg>Add script for downloading Indonesia price data
(http://m.pip.kementan.org/index.php)<commit_after>#!/usr/bin/env python2
import urllib2
import shutil
import re
import sys
import datetime
from lxml import etree
usage_str = """
This scripts downloads daily food prices from http://m.pip.keme... | |
a795d94a9c885b97ab5bffc313524ae46626d556 | tools/analyze_code_size.py | tools/analyze_code_size.py |
import os
import re
import sys
import optparse
MARKER_START_FUNCS = "// EMSCRIPTEN_START_FUNCS"
MARKER_END_FUNCS = "// EMSCRIPTEN_END_FUNCS"
FUNCTION_CODE_RE = re.compile(
r"function (?P<name>[a-zA-Z0-9_]+)(?P<defn>.*?)((?=function)|(?=$))"
)
def analyze_code_size(fileobj, opts):
funcs = {}
name_re = Non... | Add simple function-size analysis tool. | Add simple function-size analysis tool.
| Python | mit | pypyjs/pypyjs,perkinslr/pypyjs,perkinslr/pypyjs,perkinslr/pypyjs,albertjan/pypyjs,pombredanne/pypyjs,albertjan/pypyjs,perkinslr/pypyjs,pombredanne/pypyjs,pypyjs/pypyjs,trinketapp/pypyjs,pypyjs/pypyjs,pypyjs/pypyjs,perkinslr/pypyjs,trinketapp/pypyjs,albertjan/pypyjs | Add simple function-size analysis tool. |
import os
import re
import sys
import optparse
MARKER_START_FUNCS = "// EMSCRIPTEN_START_FUNCS"
MARKER_END_FUNCS = "// EMSCRIPTEN_END_FUNCS"
FUNCTION_CODE_RE = re.compile(
r"function (?P<name>[a-zA-Z0-9_]+)(?P<defn>.*?)((?=function)|(?=$))"
)
def analyze_code_size(fileobj, opts):
funcs = {}
name_re = Non... | <commit_before><commit_msg>Add simple function-size analysis tool.<commit_after> |
import os
import re
import sys
import optparse
MARKER_START_FUNCS = "// EMSCRIPTEN_START_FUNCS"
MARKER_END_FUNCS = "// EMSCRIPTEN_END_FUNCS"
FUNCTION_CODE_RE = re.compile(
r"function (?P<name>[a-zA-Z0-9_]+)(?P<defn>.*?)((?=function)|(?=$))"
)
def analyze_code_size(fileobj, opts):
funcs = {}
name_re = Non... | Add simple function-size analysis tool.
import os
import re
import sys
import optparse
MARKER_START_FUNCS = "// EMSCRIPTEN_START_FUNCS"
MARKER_END_FUNCS = "// EMSCRIPTEN_END_FUNCS"
FUNCTION_CODE_RE = re.compile(
r"function (?P<name>[a-zA-Z0-9_]+)(?P<defn>.*?)((?=function)|(?=$))"
)
def analyze_code_size(fileobj, ... | <commit_before><commit_msg>Add simple function-size analysis tool.<commit_after>
import os
import re
import sys
import optparse
MARKER_START_FUNCS = "// EMSCRIPTEN_START_FUNCS"
MARKER_END_FUNCS = "// EMSCRIPTEN_END_FUNCS"
FUNCTION_CODE_RE = re.compile(
r"function (?P<name>[a-zA-Z0-9_]+)(?P<defn>.*?)((?=function)|(?... | |
bfaeeec3f5f5582822e2918491090815a606ba44 | test/test_api.py | test/test_api.py | # -*- coding: utf-8 -*-
import warthog.api
def test_public_exports():
exports = set([item for item in dir(warthog.api) if not item.startswith('_')])
declared = set(warthog.api.__all__)
assert exports == declared, 'Exports and __all__ members should match'
| Add test to make sure imports and __all__ matches | Add test to make sure imports and __all__ matches
| Python | mit | smarter-travel-media/warthog | Add test to make sure imports and __all__ matches | # -*- coding: utf-8 -*-
import warthog.api
def test_public_exports():
exports = set([item for item in dir(warthog.api) if not item.startswith('_')])
declared = set(warthog.api.__all__)
assert exports == declared, 'Exports and __all__ members should match'
| <commit_before><commit_msg>Add test to make sure imports and __all__ matches<commit_after> | # -*- coding: utf-8 -*-
import warthog.api
def test_public_exports():
exports = set([item for item in dir(warthog.api) if not item.startswith('_')])
declared = set(warthog.api.__all__)
assert exports == declared, 'Exports and __all__ members should match'
| Add test to make sure imports and __all__ matches# -*- coding: utf-8 -*-
import warthog.api
def test_public_exports():
exports = set([item for item in dir(warthog.api) if not item.startswith('_')])
declared = set(warthog.api.__all__)
assert exports == declared, 'Exports and __all__ members should match'
| <commit_before><commit_msg>Add test to make sure imports and __all__ matches<commit_after># -*- coding: utf-8 -*-
import warthog.api
def test_public_exports():
exports = set([item for item in dir(warthog.api) if not item.startswith('_')])
declared = set(warthog.api.__all__)
assert exports == declared, 'E... | |
48857638694ceca08c64d7b9c6825e2178c53279 | pylearn2/utils/doc.py | pylearn2/utils/doc.py | """
Documentation-related helper classes/functions
"""
class soft_wraps:
"""
A Python decorator which concatenates two functions' docstrings: one
function is defined at initialization and the other one is defined when
soft_wraps is called.
This helps reduce the ammount of documentation to write: ... | Add function decorator to improve functools.wraps | Add function decorator to improve functools.wraps
| Python | bsd-3-clause | goodfeli/pylearn2,JesseLivezey/pylearn2,TNick/pylearn2,fulmicoton/pylearn2,pkainz/pylearn2,Refefer/pylearn2,woozzu/pylearn2,kastnerkyle/pylearn2,CIFASIS/pylearn2,mclaughlin6464/pylearn2,hyqneuron/pylearn2-maxsom,aalmah/pylearn2,bartvm/pylearn2,JesseLivezey/pylearn2,nouiz/pylearn2,lamblin/pylearn2,CIFASIS/pylearn2,junbo... | Add function decorator to improve functools.wraps | """
Documentation-related helper classes/functions
"""
class soft_wraps:
"""
A Python decorator which concatenates two functions' docstrings: one
function is defined at initialization and the other one is defined when
soft_wraps is called.
This helps reduce the ammount of documentation to write: ... | <commit_before><commit_msg>Add function decorator to improve functools.wraps<commit_after> | """
Documentation-related helper classes/functions
"""
class soft_wraps:
"""
A Python decorator which concatenates two functions' docstrings: one
function is defined at initialization and the other one is defined when
soft_wraps is called.
This helps reduce the ammount of documentation to write: ... | Add function decorator to improve functools.wraps"""
Documentation-related helper classes/functions
"""
class soft_wraps:
"""
A Python decorator which concatenates two functions' docstrings: one
function is defined at initialization and the other one is defined when
soft_wraps is called.
This hel... | <commit_before><commit_msg>Add function decorator to improve functools.wraps<commit_after>"""
Documentation-related helper classes/functions
"""
class soft_wraps:
"""
A Python decorator which concatenates two functions' docstrings: one
function is defined at initialization and the other one is defined whe... | |
7ff614950163b1fb6a8fe0fef5b8de9bfa3a9d85 | transmutagen/tests/test_partialfrac.py | transmutagen/tests/test_partialfrac.py | from sympy import together, expand_complex, re, im, symbols
from ..partialfrac import t
def test_re_form():
theta, alpha = symbols('theta, alpha')
# Check that this doesn't change
re_form = together(expand_complex(re(alpha/(t - theta))))
assert re_form == (t*re(alpha) - re(alpha)*re(theta) -
... | Add a test for the hard-coded re() partial frac form | Add a test for the hard-coded re() partial frac form
| Python | bsd-3-clause | ergs/transmutagen,ergs/transmutagen | Add a test for the hard-coded re() partial frac form | from sympy import together, expand_complex, re, im, symbols
from ..partialfrac import t
def test_re_form():
theta, alpha = symbols('theta, alpha')
# Check that this doesn't change
re_form = together(expand_complex(re(alpha/(t - theta))))
assert re_form == (t*re(alpha) - re(alpha)*re(theta) -
... | <commit_before><commit_msg>Add a test for the hard-coded re() partial frac form<commit_after> | from sympy import together, expand_complex, re, im, symbols
from ..partialfrac import t
def test_re_form():
theta, alpha = symbols('theta, alpha')
# Check that this doesn't change
re_form = together(expand_complex(re(alpha/(t - theta))))
assert re_form == (t*re(alpha) - re(alpha)*re(theta) -
... | Add a test for the hard-coded re() partial frac formfrom sympy import together, expand_complex, re, im, symbols
from ..partialfrac import t
def test_re_form():
theta, alpha = symbols('theta, alpha')
# Check that this doesn't change
re_form = together(expand_complex(re(alpha/(t - theta))))
assert re_f... | <commit_before><commit_msg>Add a test for the hard-coded re() partial frac form<commit_after>from sympy import together, expand_complex, re, im, symbols
from ..partialfrac import t
def test_re_form():
theta, alpha = symbols('theta, alpha')
# Check that this doesn't change
re_form = together(expand_comple... | |
8dc7a1e239dc22dd4eb69cfe1754586e3a1690dc | tests/test_run_js.py | tests/test_run_js.py | import os
from py2js import JavaScript
def f(x):
return x
def test(func, run):
func_source = str(JavaScript(func))
run_file = "/tmp/run.js"
with open(run_file, "w") as f:
f.write(func_source)
f.write("\n")
f.write(run)
r = os.system('js -f defs.js -f %s' % run_file)
as... | Test javascript using the "js" | Test javascript using the "js"
| Python | mit | qsnake/py2js,mattpap/py2js,chrivers/pyjaco,buchuki/pyjaco,mattpap/py2js,chrivers/pyjaco,chrivers/pyjaco,buchuki/pyjaco,buchuki/pyjaco,qsnake/py2js | Test javascript using the "js" | import os
from py2js import JavaScript
def f(x):
return x
def test(func, run):
func_source = str(JavaScript(func))
run_file = "/tmp/run.js"
with open(run_file, "w") as f:
f.write(func_source)
f.write("\n")
f.write(run)
r = os.system('js -f defs.js -f %s' % run_file)
as... | <commit_before><commit_msg>Test javascript using the "js"<commit_after> | import os
from py2js import JavaScript
def f(x):
return x
def test(func, run):
func_source = str(JavaScript(func))
run_file = "/tmp/run.js"
with open(run_file, "w") as f:
f.write(func_source)
f.write("\n")
f.write(run)
r = os.system('js -f defs.js -f %s' % run_file)
as... | Test javascript using the "js"import os
from py2js import JavaScript
def f(x):
return x
def test(func, run):
func_source = str(JavaScript(func))
run_file = "/tmp/run.js"
with open(run_file, "w") as f:
f.write(func_source)
f.write("\n")
f.write(run)
r = os.system('js -f def... | <commit_before><commit_msg>Test javascript using the "js"<commit_after>import os
from py2js import JavaScript
def f(x):
return x
def test(func, run):
func_source = str(JavaScript(func))
run_file = "/tmp/run.js"
with open(run_file, "w") as f:
f.write(func_source)
f.write("\n")
... | |
3dd71c02ea1fa9e39054bd82bf9e8657ec77d6b9 | tools/get_chat_id.py | tools/get_chat_id.py | #! /usr/bin/python3
# -*- coding:utf-8 -*-
# by antoine@2ohm.fr
import sys
import time
import telepot
def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
print("\tchat_id: {}".format(chat_id))
if content_type == 'text' and msg['text'] == '/start':
ans = """
Hello <b>{first_na... | Add a script to recover the chat_id | Add a script to recover the chat_id
| Python | apache-2.0 | a2ohm/ProgressBot | Add a script to recover the chat_id | #! /usr/bin/python3
# -*- coding:utf-8 -*-
# by antoine@2ohm.fr
import sys
import time
import telepot
def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
print("\tchat_id: {}".format(chat_id))
if content_type == 'text' and msg['text'] == '/start':
ans = """
Hello <b>{first_na... | <commit_before><commit_msg>Add a script to recover the chat_id<commit_after> | #! /usr/bin/python3
# -*- coding:utf-8 -*-
# by antoine@2ohm.fr
import sys
import time
import telepot
def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
print("\tchat_id: {}".format(chat_id))
if content_type == 'text' and msg['text'] == '/start':
ans = """
Hello <b>{first_na... | Add a script to recover the chat_id#! /usr/bin/python3
# -*- coding:utf-8 -*-
# by antoine@2ohm.fr
import sys
import time
import telepot
def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
print("\tchat_id: {}".format(chat_id))
if content_type == 'text' and msg['text'] == '/start':
... | <commit_before><commit_msg>Add a script to recover the chat_id<commit_after>#! /usr/bin/python3
# -*- coding:utf-8 -*-
# by antoine@2ohm.fr
import sys
import time
import telepot
def handle(msg):
content_type, chat_type, chat_id = telepot.glance(msg)
print("\tchat_id: {}".format(chat_id))
if content_type... | |
fed2e3f9bdb3a00b077b5e7df1aed4d927b77b6c | tests/clifford_test.py | tests/clifford_test.py | """Test for the Clifford algebra drudge."""
from drudge import CliffordDrudge, Vec, inner_by_delta
def test_clifford_drudge_by_quaternions(spark_ctx):
"""Test basic functionality of Clifford drudge by quaternions.
"""
dr = CliffordDrudge(
spark_ctx, inner=lambda v1, v2: -inner_by_delta(v1, v2)
... | Add test for Clifford drudge by quaternions | Add test for Clifford drudge by quaternions
| Python | mit | tschijnmo/drudge,tschijnmo/drudge,tschijnmo/drudge | Add test for Clifford drudge by quaternions | """Test for the Clifford algebra drudge."""
from drudge import CliffordDrudge, Vec, inner_by_delta
def test_clifford_drudge_by_quaternions(spark_ctx):
"""Test basic functionality of Clifford drudge by quaternions.
"""
dr = CliffordDrudge(
spark_ctx, inner=lambda v1, v2: -inner_by_delta(v1, v2)
... | <commit_before><commit_msg>Add test for Clifford drudge by quaternions<commit_after> | """Test for the Clifford algebra drudge."""
from drudge import CliffordDrudge, Vec, inner_by_delta
def test_clifford_drudge_by_quaternions(spark_ctx):
"""Test basic functionality of Clifford drudge by quaternions.
"""
dr = CliffordDrudge(
spark_ctx, inner=lambda v1, v2: -inner_by_delta(v1, v2)
... | Add test for Clifford drudge by quaternions"""Test for the Clifford algebra drudge."""
from drudge import CliffordDrudge, Vec, inner_by_delta
def test_clifford_drudge_by_quaternions(spark_ctx):
"""Test basic functionality of Clifford drudge by quaternions.
"""
dr = CliffordDrudge(
spark_ctx, inn... | <commit_before><commit_msg>Add test for Clifford drudge by quaternions<commit_after>"""Test for the Clifford algebra drudge."""
from drudge import CliffordDrudge, Vec, inner_by_delta
def test_clifford_drudge_by_quaternions(spark_ctx):
"""Test basic functionality of Clifford drudge by quaternions.
"""
dr... | |
09a0689b8e521c1d5c0ea68ac448dc9ae7abcff5 | fitsHeader.py | fitsHeader.py | #!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
from astropy.io import fits
from pydoc import pager
import argparse
def _parser():
parser = argparse.ArgumentParser(description='View the header of a fits file')
parser.add_argument('input', help='File name of fits file... | Read the header of a fits file and/or look up a single key (case insensitive). | Read the header of a fits file and/or look up a
single key (case insensitive).
| Python | mit | DanielAndreasen/astro_scripts | Read the header of a fits file and/or look up a
single key (case insensitive). | #!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
from astropy.io import fits
from pydoc import pager
import argparse
def _parser():
parser = argparse.ArgumentParser(description='View the header of a fits file')
parser.add_argument('input', help='File name of fits file... | <commit_before><commit_msg>Read the header of a fits file and/or look up a
single key (case insensitive).<commit_after> | #!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
from astropy.io import fits
from pydoc import pager
import argparse
def _parser():
parser = argparse.ArgumentParser(description='View the header of a fits file')
parser.add_argument('input', help='File name of fits file... | Read the header of a fits file and/or look up a
single key (case insensitive).#!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
from astropy.io import fits
from pydoc import pager
import argparse
def _parser():
parser = argparse.ArgumentParser(description='View the header ... | <commit_before><commit_msg>Read the header of a fits file and/or look up a
single key (case insensitive).<commit_after>#!/usr/bin/env python
# -*- coding: utf8 -*-
# My imports
from __future__ import division
from astropy.io import fits
from pydoc import pager
import argparse
def _parser():
parser = argparse.Arg... | |
b674f921a8e5cffb2d3e320f564c61ca01455a9f | wafer/management/commands/wafer_talk_video_reviewers.py | wafer/management/commands/wafer_talk_video_reviewers.py | import sys
import csv
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
from wafer.talks.models import Talk, ACCEPTED, PROVISIONAL
class Command(BaseCommand):
help = ("List talks and the associated video_reviewer emails."
" Only reviewers for accepted... | Add command to generate a csv of talk titles and video reviewers | Add command to generate a csv of talk titles and video reviewers
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CTPUG/wafer | Add command to generate a csv of talk titles and video reviewers | import sys
import csv
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
from wafer.talks.models import Talk, ACCEPTED, PROVISIONAL
class Command(BaseCommand):
help = ("List talks and the associated video_reviewer emails."
" Only reviewers for accepted... | <commit_before><commit_msg>Add command to generate a csv of talk titles and video reviewers<commit_after> | import sys
import csv
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
from wafer.talks.models import Talk, ACCEPTED, PROVISIONAL
class Command(BaseCommand):
help = ("List talks and the associated video_reviewer emails."
" Only reviewers for accepted... | Add command to generate a csv of talk titles and video reviewersimport sys
import csv
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
from wafer.talks.models import Talk, ACCEPTED, PROVISIONAL
class Command(BaseCommand):
help = ("List talks and the associated v... | <commit_before><commit_msg>Add command to generate a csv of talk titles and video reviewers<commit_after>import sys
import csv
from django.core.management.base import BaseCommand
from django.contrib.auth import get_user_model
from wafer.talks.models import Talk, ACCEPTED, PROVISIONAL
class Command(BaseCommand):
... | |
3db3c22d83071550d8bbd70062f957cf43c5e54a | cart/_compatibility.py | cart/_compatibility.py | import sys
is_py3 = sys.version_info[0] >= 3
def utf8(string):
"""Cast to unicode DAMMIT!
Written because Python2 repr always implicitly casts to a string, so we
have to cast back to a unicode (and we now that we always deal with valid
unicode, because we check that in the beginning).
"""
if ... | Add a compatibility module, because of Python 2/3 compatibility issues. | Add a compatibility module, because of Python 2/3 compatibility issues.
| Python | mit | davidhalter-archive/shopping_cart_example | Add a compatibility module, because of Python 2/3 compatibility issues. | import sys
is_py3 = sys.version_info[0] >= 3
def utf8(string):
"""Cast to unicode DAMMIT!
Written because Python2 repr always implicitly casts to a string, so we
have to cast back to a unicode (and we now that we always deal with valid
unicode, because we check that in the beginning).
"""
if ... | <commit_before><commit_msg>Add a compatibility module, because of Python 2/3 compatibility issues.<commit_after> | import sys
is_py3 = sys.version_info[0] >= 3
def utf8(string):
"""Cast to unicode DAMMIT!
Written because Python2 repr always implicitly casts to a string, so we
have to cast back to a unicode (and we now that we always deal with valid
unicode, because we check that in the beginning).
"""
if ... | Add a compatibility module, because of Python 2/3 compatibility issues.import sys
is_py3 = sys.version_info[0] >= 3
def utf8(string):
"""Cast to unicode DAMMIT!
Written because Python2 repr always implicitly casts to a string, so we
have to cast back to a unicode (and we now that we always deal with vali... | <commit_before><commit_msg>Add a compatibility module, because of Python 2/3 compatibility issues.<commit_after>import sys
is_py3 = sys.version_info[0] >= 3
def utf8(string):
"""Cast to unicode DAMMIT!
Written because Python2 repr always implicitly casts to a string, so we
have to cast back to a unicode ... | |
156b7dfc11f24a7d77d2280e8ddade3cb7a474b7 | misc/list_all_es_indexes.py | misc/list_all_es_indexes.py | #!/usr/bin/env python
# -*- encoding: utf-8
import boto3
import hcl
import requests
def get_terraform_vars():
s3_client = boto3.client("s3")
tfvars_body = s3_client.get_object(
Bucket="wellcomecollection-platform-infra",
Key="terraform.tfvars"
)["Body"]
return hcl.load(tfvars_body)
... | Add a script for listing all Elasticsearch indexes | Add a script for listing all Elasticsearch indexes
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | Add a script for listing all Elasticsearch indexes | #!/usr/bin/env python
# -*- encoding: utf-8
import boto3
import hcl
import requests
def get_terraform_vars():
s3_client = boto3.client("s3")
tfvars_body = s3_client.get_object(
Bucket="wellcomecollection-platform-infra",
Key="terraform.tfvars"
)["Body"]
return hcl.load(tfvars_body)
... | <commit_before><commit_msg>Add a script for listing all Elasticsearch indexes<commit_after> | #!/usr/bin/env python
# -*- encoding: utf-8
import boto3
import hcl
import requests
def get_terraform_vars():
s3_client = boto3.client("s3")
tfvars_body = s3_client.get_object(
Bucket="wellcomecollection-platform-infra",
Key="terraform.tfvars"
)["Body"]
return hcl.load(tfvars_body)
... | Add a script for listing all Elasticsearch indexes#!/usr/bin/env python
# -*- encoding: utf-8
import boto3
import hcl
import requests
def get_terraform_vars():
s3_client = boto3.client("s3")
tfvars_body = s3_client.get_object(
Bucket="wellcomecollection-platform-infra",
Key="terraform.tfvars"... | <commit_before><commit_msg>Add a script for listing all Elasticsearch indexes<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8
import boto3
import hcl
import requests
def get_terraform_vars():
s3_client = boto3.client("s3")
tfvars_body = s3_client.get_object(
Bucket="wellcomecollection-platfo... | |
006a921f19f6c4f64d694c86346ad85ada2c8bb8 | tests/subclass_test.py | tests/subclass_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
CLASSES = (pycurl.Curl, pycurl.CurlMulti, pycurl.CurlShare)
class SubclassTest(unittest.TestCase):
def test_baseclass_init(self):
# base classes do not a... | Add tests for subclass support | Add tests for subclass support
| Python | lgpl-2.1 | pycurl/pycurl,pycurl/pycurl,pycurl/pycurl | Add tests for subclass support | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
CLASSES = (pycurl.Curl, pycurl.CurlMulti, pycurl.CurlShare)
class SubclassTest(unittest.TestCase):
def test_baseclass_init(self):
# base classes do not a... | <commit_before><commit_msg>Add tests for subclass support<commit_after> | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
CLASSES = (pycurl.Curl, pycurl.CurlMulti, pycurl.CurlShare)
class SubclassTest(unittest.TestCase):
def test_baseclass_init(self):
# base classes do not a... | Add tests for subclass support#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
CLASSES = (pycurl.Curl, pycurl.CurlMulti, pycurl.CurlShare)
class SubclassTest(unittest.TestCase):
def test_baseclass_init(self):
... | <commit_before><commit_msg>Add tests for subclass support<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
try:
import unittest2 as unittest
except ImportError:
import unittest
import pycurl
CLASSES = (pycurl.Curl, pycurl.CurlMulti, pycurl.CurlShare)
class SubclassTest(unittest.TestCa... | |
d764a483497afc5d029a82db14cc5cc88f45f4c0 | nova/api/openstack/contrib/multinic.py | nova/api/openstack/contrib/multinic.py | # Copyright 2011 OpenStack LLC.
# 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 b... | Add an extension to allow for an addFixedIp action on instances | Add an extension to allow for an addFixedIp action on instances | Python | apache-2.0 | saleemjaveds/https-github.com-openstack-nova,bigswitch/nova,virtualopensystems/nova,leilihh/nova,cyx1231st/nova,rajalokan/nova,whitepages/nova,eneabio/nova,devendermishrajio/nova,virtualopensystems/nova,luogangyi/bcec-nova,tanglei528/nova,cloudbau/nova,sileht/deb-openstack-nova,tianweizhang/nova,mandeepdhami/nova,salv-... | Add an extension to allow for an addFixedIp action on instances | # Copyright 2011 OpenStack LLC.
# 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 b... | <commit_before><commit_msg>Add an extension to allow for an addFixedIp action on instances<commit_after> | # Copyright 2011 OpenStack LLC.
# 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 b... | Add an extension to allow for an addFixedIp action on instances# Copyright 2011 OpenStack LLC.
# 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... | <commit_before><commit_msg>Add an extension to allow for an addFixedIp action on instances<commit_after># Copyright 2011 OpenStack LLC.
# 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
# ... | |
fe479bf2a8ec547922c6643bbdf0ba768eb79c9d | ludo/simulator.py | ludo/simulator.py | #!/usr/bin/env python3
from game import Game
print("Welcome to a game of ludo!")
average_throw_counter = 0
min_throws_per_game = 10000000
max_throws_per_game = 0
NUM_GAMES = 100
for i in range(0, NUM_GAMES):
game = Game()
throw_counter = 0
while game.next_move():
throw_counter += 1
average... | Add script to simulate multiple games | Add script to simulate multiple games
| Python | mit | risteon/ludo_python | Add script to simulate multiple games | #!/usr/bin/env python3
from game import Game
print("Welcome to a game of ludo!")
average_throw_counter = 0
min_throws_per_game = 10000000
max_throws_per_game = 0
NUM_GAMES = 100
for i in range(0, NUM_GAMES):
game = Game()
throw_counter = 0
while game.next_move():
throw_counter += 1
average... | <commit_before><commit_msg>Add script to simulate multiple games<commit_after> | #!/usr/bin/env python3
from game import Game
print("Welcome to a game of ludo!")
average_throw_counter = 0
min_throws_per_game = 10000000
max_throws_per_game = 0
NUM_GAMES = 100
for i in range(0, NUM_GAMES):
game = Game()
throw_counter = 0
while game.next_move():
throw_counter += 1
average... | Add script to simulate multiple games#!/usr/bin/env python3
from game import Game
print("Welcome to a game of ludo!")
average_throw_counter = 0
min_throws_per_game = 10000000
max_throws_per_game = 0
NUM_GAMES = 100
for i in range(0, NUM_GAMES):
game = Game()
throw_counter = 0
while game.next_move():
... | <commit_before><commit_msg>Add script to simulate multiple games<commit_after>#!/usr/bin/env python3
from game import Game
print("Welcome to a game of ludo!")
average_throw_counter = 0
min_throws_per_game = 10000000
max_throws_per_game = 0
NUM_GAMES = 100
for i in range(0, NUM_GAMES):
game = Game()
throw_co... | |
c89cce1a47c1e379958d7cced624ec0317cd3407 | examples/demo3.py | examples/demo3.py | import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import logging
import threading
import xmpp2
import time
import select
from xmpp2 import XML
# non-blocking, poll example.
USERNAME = 'yourusername'
PASSWORD = 'yourpassword'
SERVER = 'example.com'
logging.basicConfig(level=logging... | Add demo for non-blocking with poll(). | Add demo for non-blocking with poll().
| Python | mit | easies/xmpp2 | Add demo for non-blocking with poll(). | import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import logging
import threading
import xmpp2
import time
import select
from xmpp2 import XML
# non-blocking, poll example.
USERNAME = 'yourusername'
PASSWORD = 'yourpassword'
SERVER = 'example.com'
logging.basicConfig(level=logging... | <commit_before><commit_msg>Add demo for non-blocking with poll().<commit_after> | import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import logging
import threading
import xmpp2
import time
import select
from xmpp2 import XML
# non-blocking, poll example.
USERNAME = 'yourusername'
PASSWORD = 'yourpassword'
SERVER = 'example.com'
logging.basicConfig(level=logging... | Add demo for non-blocking with poll().import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import logging
import threading
import xmpp2
import time
import select
from xmpp2 import XML
# non-blocking, poll example.
USERNAME = 'yourusername'
PASSWORD = 'yourpassword'
SERVER = 'example.c... | <commit_before><commit_msg>Add demo for non-blocking with poll().<commit_after>import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
import logging
import threading
import xmpp2
import time
import select
from xmpp2 import XML
# non-blocking, poll example.
USERNAME = 'yourusername'
PASS... | |
1e65555a08ff3ee1a06e92d9dd054abf3cfaf711 | media_tree/migrations/0003_alter_tree_fields.py | media_tree/migrations/0003_alter_tree_fields.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('media_tree', '0002_mptt_to_treebeard'),
]
operations = [
migrations.AlterField(
model_name='filenode',
... | Add a migration to update to final tree fields | Add a migration to update to final tree fields
| Python | bsd-3-clause | samluescher/django-media-tree,samluescher/django-media-tree,samluescher/django-media-tree | Add a migration to update to final tree fields | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('media_tree', '0002_mptt_to_treebeard'),
]
operations = [
migrations.AlterField(
model_name='filenode',
... | <commit_before><commit_msg>Add a migration to update to final tree fields<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('media_tree', '0002_mptt_to_treebeard'),
]
operations = [
migrations.AlterField(
model_name='filenode',
... | Add a migration to update to final tree fields# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('media_tree', '0002_mptt_to_treebeard'),
]
operations = [
migrations.AlterField... | <commit_before><commit_msg>Add a migration to update to final tree fields<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('media_tree', '0002_mptt_to_treebeard'),
]
ope... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.