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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
aee32ebbd0aa13a03d6c69eef8505f922c274af1 | tools/cvs2svn/profile-cvs2svn.py | tools/cvs2svn/profile-cvs2svn.py | #!/usr/bin/env python
#
# Use this script to profile cvs2svn.py using Python's hotshot profiler.
#
# The profile data is stored in cvs2svn.hotshot. To view the data using
# hotshot, run the following in python:
#
# import hotshot.stats
# stats = hotshot.stats.load('cvs2svn.hotshot')
# stats.strip_dirs()... | Add a new script to simplify profiling of cvs2svn.py. Document in the script how to use kcachegrind to view the results. | Add a new script to simplify profiling of cvs2svn.py. Document in the
script how to use kcachegrind to view the results.
* tools/cvs2svn/profile-cvs2svn.py: New script.
| Python | apache-2.0 | jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion,jmckaskill/subversion | Add a new script to simplify profiling of cvs2svn.py. Document in the
script how to use kcachegrind to view the results.
* tools/cvs2svn/profile-cvs2svn.py: New script. | #!/usr/bin/env python
#
# Use this script to profile cvs2svn.py using Python's hotshot profiler.
#
# The profile data is stored in cvs2svn.hotshot. To view the data using
# hotshot, run the following in python:
#
# import hotshot.stats
# stats = hotshot.stats.load('cvs2svn.hotshot')
# stats.strip_dirs()... | <commit_before><commit_msg>Add a new script to simplify profiling of cvs2svn.py. Document in the
script how to use kcachegrind to view the results.
* tools/cvs2svn/profile-cvs2svn.py: New script.<commit_after> | #!/usr/bin/env python
#
# Use this script to profile cvs2svn.py using Python's hotshot profiler.
#
# The profile data is stored in cvs2svn.hotshot. To view the data using
# hotshot, run the following in python:
#
# import hotshot.stats
# stats = hotshot.stats.load('cvs2svn.hotshot')
# stats.strip_dirs()... | Add a new script to simplify profiling of cvs2svn.py. Document in the
script how to use kcachegrind to view the results.
* tools/cvs2svn/profile-cvs2svn.py: New script.#!/usr/bin/env python
#
# Use this script to profile cvs2svn.py using Python's hotshot profiler.
#
# The profile data is stored in cvs2svn.hotshot. T... | <commit_before><commit_msg>Add a new script to simplify profiling of cvs2svn.py. Document in the
script how to use kcachegrind to view the results.
* tools/cvs2svn/profile-cvs2svn.py: New script.<commit_after>#!/usr/bin/env python
#
# Use this script to profile cvs2svn.py using Python's hotshot profiler.
#
# The prof... | |
410b447f54838e4a28b28aa1a027bd058520d9b0 | Python/HARPS-e2ds-to-order.py | Python/HARPS-e2ds-to-order.py | #!/usr/bin/env python
# encoding: utf-8
"""
HARPS-e2ds-to-order.py
Created by Jonathan Whitmore on 2011-10-14.
Copyright (c) 2011. All rights reserved.
"""
import sys
import os
import argparse
import pyfits as pf
import numpy as np
help_message = '''
Takes reduced HARPS***e2ds_A.fits data and reads the header to out... | Order by order of HARPS data | Order by order of HARPS data
| Python | mit | jbwhit/CaliCompari | Order by order of HARPS data | #!/usr/bin/env python
# encoding: utf-8
"""
HARPS-e2ds-to-order.py
Created by Jonathan Whitmore on 2011-10-14.
Copyright (c) 2011. All rights reserved.
"""
import sys
import os
import argparse
import pyfits as pf
import numpy as np
help_message = '''
Takes reduced HARPS***e2ds_A.fits data and reads the header to out... | <commit_before><commit_msg>Order by order of HARPS data<commit_after> | #!/usr/bin/env python
# encoding: utf-8
"""
HARPS-e2ds-to-order.py
Created by Jonathan Whitmore on 2011-10-14.
Copyright (c) 2011. All rights reserved.
"""
import sys
import os
import argparse
import pyfits as pf
import numpy as np
help_message = '''
Takes reduced HARPS***e2ds_A.fits data and reads the header to out... | Order by order of HARPS data#!/usr/bin/env python
# encoding: utf-8
"""
HARPS-e2ds-to-order.py
Created by Jonathan Whitmore on 2011-10-14.
Copyright (c) 2011. All rights reserved.
"""
import sys
import os
import argparse
import pyfits as pf
import numpy as np
help_message = '''
Takes reduced HARPS***e2ds_A.fits data... | <commit_before><commit_msg>Order by order of HARPS data<commit_after>#!/usr/bin/env python
# encoding: utf-8
"""
HARPS-e2ds-to-order.py
Created by Jonathan Whitmore on 2011-10-14.
Copyright (c) 2011. All rights reserved.
"""
import sys
import os
import argparse
import pyfits as pf
import numpy as np
help_message = '... | |
7881a0561dd74cfb792c06f824fde22e9764ea4c | CodeFights/arrayMaxConsecutiveSum.py | CodeFights/arrayMaxConsecutiveSum.py | #!/usr/local/bin/python
# Code Fights Array Max Consecutive Sum Problem
def arrayMaxConsecutiveSum(inputArray, k):
rolling_sum = sum(inputArray[:k])
max_sum = rolling_sum
i = 0
for j in range(k, len(inputArray)):
rolling_sum = rolling_sum + inputArray[j] - inputArray[i]
max_sum = max(r... | Solve Code Fights array max consecutive sum problem | Solve Code Fights array max consecutive sum problem
| Python | mit | HKuz/Test_Code | Solve Code Fights array max consecutive sum problem | #!/usr/local/bin/python
# Code Fights Array Max Consecutive Sum Problem
def arrayMaxConsecutiveSum(inputArray, k):
rolling_sum = sum(inputArray[:k])
max_sum = rolling_sum
i = 0
for j in range(k, len(inputArray)):
rolling_sum = rolling_sum + inputArray[j] - inputArray[i]
max_sum = max(r... | <commit_before><commit_msg>Solve Code Fights array max consecutive sum problem<commit_after> | #!/usr/local/bin/python
# Code Fights Array Max Consecutive Sum Problem
def arrayMaxConsecutiveSum(inputArray, k):
rolling_sum = sum(inputArray[:k])
max_sum = rolling_sum
i = 0
for j in range(k, len(inputArray)):
rolling_sum = rolling_sum + inputArray[j] - inputArray[i]
max_sum = max(r... | Solve Code Fights array max consecutive sum problem#!/usr/local/bin/python
# Code Fights Array Max Consecutive Sum Problem
def arrayMaxConsecutiveSum(inputArray, k):
rolling_sum = sum(inputArray[:k])
max_sum = rolling_sum
i = 0
for j in range(k, len(inputArray)):
rolling_sum = rolling_sum + in... | <commit_before><commit_msg>Solve Code Fights array max consecutive sum problem<commit_after>#!/usr/local/bin/python
# Code Fights Array Max Consecutive Sum Problem
def arrayMaxConsecutiveSum(inputArray, k):
rolling_sum = sum(inputArray[:k])
max_sum = rolling_sum
i = 0
for j in range(k, len(inputArray)... | |
a18151a4675ef014680a4e74daba3b19670ab4f1 | src/files_set_utime.py | src/files_set_utime.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Find name patterns in a tree"""
import KmdCmd
import KmdFiles
import os, sys, re, time
import logging
class KmdFindPatterns(KmdCmd.KmdCommand):
def extendParser(self):
super(KmdFindPatterns, self).extendParser()
#Extend parser
self.parser.a... | Set time according to date in filename | Set time according to date in filename
| Python | mit | pzia/keepmydatas | Set time according to date in filename | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Find name patterns in a tree"""
import KmdCmd
import KmdFiles
import os, sys, re, time
import logging
class KmdFindPatterns(KmdCmd.KmdCommand):
def extendParser(self):
super(KmdFindPatterns, self).extendParser()
#Extend parser
self.parser.a... | <commit_before><commit_msg>Set time according to date in filename<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Find name patterns in a tree"""
import KmdCmd
import KmdFiles
import os, sys, re, time
import logging
class KmdFindPatterns(KmdCmd.KmdCommand):
def extendParser(self):
super(KmdFindPatterns, self).extendParser()
#Extend parser
self.parser.a... | Set time according to date in filename#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Find name patterns in a tree"""
import KmdCmd
import KmdFiles
import os, sys, re, time
import logging
class KmdFindPatterns(KmdCmd.KmdCommand):
def extendParser(self):
super(KmdFindPatterns, self).extendParser()
... | <commit_before><commit_msg>Set time according to date in filename<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Find name patterns in a tree"""
import KmdCmd
import KmdFiles
import os, sys, re, time
import logging
class KmdFindPatterns(KmdCmd.KmdCommand):
def extendParser(self):
super(Kmd... | |
b6cafc70f43dbe98991d00f9413c389f908cbb38 | science/physics_python/standalone_modules/pointmass_spring.py | science/physics_python/standalone_modules/pointmass_spring.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
import numpy as np
class State:
def __init__(self, ndim):
self.ndim = ndim
self.position = np.zeros(self.ndim)
self.velocity = np.zeros(self.ndim)
class Model:
def __init__(sel... | Add a snippet (Python physics). | Add a snippet (Python physics).
| 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 physics). | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
import numpy as np
class State:
def __init__(self, ndim):
self.ndim = ndim
self.position = np.zeros(self.ndim)
self.velocity = np.zeros(self.ndim)
class Model:
def __init__(sel... | <commit_before><commit_msg>Add a snippet (Python physics).<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
import numpy as np
class State:
def __init__(self, ndim):
self.ndim = ndim
self.position = np.zeros(self.ndim)
self.velocity = np.zeros(self.ndim)
class Model:
def __init__(sel... | Add a snippet (Python physics).#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
import numpy as np
class State:
def __init__(self, ndim):
self.ndim = ndim
self.position = np.zeros(self.ndim)
self.velocity = np.zeros(self.ndim)
cla... | <commit_before><commit_msg>Add a snippet (Python physics).<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2015 Jérémie DECOCK (http://www.jdhp.org)
import numpy as np
class State:
def __init__(self, ndim):
self.ndim = ndim
self.position = np.zeros(self.ndim)
... | |
abd97f71e54515c057e94f7d21aa953faba3f5fc | taskflow/examples/delayed_return.py | taskflow/examples/delayed_return.py | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | Add a example that activates a future when a result is ready | Add a example that activates a future when a result is ready
To allow for an engine to continue to run while at the same time
returning from a function when a component of that engine finishes
a pattern can be used that ties and engines listeners to the function
return, allowing for both to be used simulatenously.
Ch... | Python | apache-2.0 | openstack/taskflow,junneyang/taskflow,openstack/taskflow,jimbobhickville/taskflow,pombredanne/taskflow-1,junneyang/taskflow,pombredanne/taskflow-1,jimbobhickville/taskflow | Add a example that activates a future when a result is ready
To allow for an engine to continue to run while at the same time
returning from a function when a component of that engine finishes
a pattern can be used that ties and engines listeners to the function
return, allowing for both to be used simulatenously.
Ch... | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | <commit_before><commit_msg>Add a example that activates a future when a result is ready
To allow for an engine to continue to run while at the same time
returning from a function when a component of that engine finishes
a pattern can be used that ties and engines listeners to the function
return, allowing for both to ... | # -*- coding: utf-8 -*-
# Copyright (C) 2014 Yahoo! 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... | Add a example that activates a future when a result is ready
To allow for an engine to continue to run while at the same time
returning from a function when a component of that engine finishes
a pattern can be used that ties and engines listeners to the function
return, allowing for both to be used simulatenously.
Ch... | <commit_before><commit_msg>Add a example that activates a future when a result is ready
To allow for an engine to continue to run while at the same time
returning from a function when a component of that engine finishes
a pattern can be used that ties and engines listeners to the function
return, allowing for both to ... | |
8cf2a16ff98cc831734c82116c4a91ddb1094865 | tests/integration/modules/cmdmod.py | tests/integration/modules/cmdmod.py | # Import python libs
import os
# Import salt libs
import integration
class CMDModuleTest(integration.ModuleCase):
'''
Validate the cmd module
'''
def test_run(self):
'''
cmd.run
'''
self.assertTrue(self.run_function('cmd.run', ['echo $SHELL']))
self.assertEqual(... | Add tests for the cmd module | Add tests for the cmd module
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add tests for the cmd module | # Import python libs
import os
# Import salt libs
import integration
class CMDModuleTest(integration.ModuleCase):
'''
Validate the cmd module
'''
def test_run(self):
'''
cmd.run
'''
self.assertTrue(self.run_function('cmd.run', ['echo $SHELL']))
self.assertEqual(... | <commit_before><commit_msg>Add tests for the cmd module<commit_after> | # Import python libs
import os
# Import salt libs
import integration
class CMDModuleTest(integration.ModuleCase):
'''
Validate the cmd module
'''
def test_run(self):
'''
cmd.run
'''
self.assertTrue(self.run_function('cmd.run', ['echo $SHELL']))
self.assertEqual(... | Add tests for the cmd module# Import python libs
import os
# Import salt libs
import integration
class CMDModuleTest(integration.ModuleCase):
'''
Validate the cmd module
'''
def test_run(self):
'''
cmd.run
'''
self.assertTrue(self.run_function('cmd.run', ['echo $SHELL']... | <commit_before><commit_msg>Add tests for the cmd module<commit_after># Import python libs
import os
# Import salt libs
import integration
class CMDModuleTest(integration.ModuleCase):
'''
Validate the cmd module
'''
def test_run(self):
'''
cmd.run
'''
self.assertTrue(sel... | |
04e6770c489734b72d6f14dee7f3e7ac30517456 | graph/graph_search.py | graph/graph_search.py | # -*- coding:utf-8 -*-
from collections import deque
from graph import Undigraph
def bfs(graph, s, t):
if s == t:
return
queue = deque()
pre = [ -1 ] * len(graph)
visited = [False] * len(graph)
visited[s] = True
queue.append(s)
while len(queue) > 0:
vertex = queue.poplef... | Implement the broad first search of the undirected graph | Implement the broad first search of the undirected graph
| Python | apache-2.0 | free-free/algorithm,free-free/algorithm | Implement the broad first search of the undirected graph | # -*- coding:utf-8 -*-
from collections import deque
from graph import Undigraph
def bfs(graph, s, t):
if s == t:
return
queue = deque()
pre = [ -1 ] * len(graph)
visited = [False] * len(graph)
visited[s] = True
queue.append(s)
while len(queue) > 0:
vertex = queue.poplef... | <commit_before><commit_msg>Implement the broad first search of the undirected graph<commit_after> | # -*- coding:utf-8 -*-
from collections import deque
from graph import Undigraph
def bfs(graph, s, t):
if s == t:
return
queue = deque()
pre = [ -1 ] * len(graph)
visited = [False] * len(graph)
visited[s] = True
queue.append(s)
while len(queue) > 0:
vertex = queue.poplef... | Implement the broad first search of the undirected graph# -*- coding:utf-8 -*-
from collections import deque
from graph import Undigraph
def bfs(graph, s, t):
if s == t:
return
queue = deque()
pre = [ -1 ] * len(graph)
visited = [False] * len(graph)
visited[s] = True
queue.append(s)... | <commit_before><commit_msg>Implement the broad first search of the undirected graph<commit_after># -*- coding:utf-8 -*-
from collections import deque
from graph import Undigraph
def bfs(graph, s, t):
if s == t:
return
queue = deque()
pre = [ -1 ] * len(graph)
visited = [False] * len(graph)
... | |
f86cdb5391aef61d9aa81e28a7777d394b37410a | Regression/PolynomialRegression/regularPolynomialRegression.py | Regression/PolynomialRegression/regularPolynomialRegression.py | # -*- coding: utf-8 -*-
"""Polynomial regression for machine learning.
polynomial regression is a form of regression analysis in which the
relationship between the independent variable x and the dependent variable y is
modelled as an nth degree polynomial in x. Polynomial regression fits a
nonlinear relationship betwe... | Add Polynomial regression Python file | Add Polynomial regression Python file
| Python | mit | a-holm/MachinelearningAlgorithms,a-holm/MachinelearningAlgorithms | Add Polynomial regression Python file | # -*- coding: utf-8 -*-
"""Polynomial regression for machine learning.
polynomial regression is a form of regression analysis in which the
relationship between the independent variable x and the dependent variable y is
modelled as an nth degree polynomial in x. Polynomial regression fits a
nonlinear relationship betwe... | <commit_before><commit_msg>Add Polynomial regression Python file<commit_after> | # -*- coding: utf-8 -*-
"""Polynomial regression for machine learning.
polynomial regression is a form of regression analysis in which the
relationship between the independent variable x and the dependent variable y is
modelled as an nth degree polynomial in x. Polynomial regression fits a
nonlinear relationship betwe... | Add Polynomial regression Python file# -*- coding: utf-8 -*-
"""Polynomial regression for machine learning.
polynomial regression is a form of regression analysis in which the
relationship between the independent variable x and the dependent variable y is
modelled as an nth degree polynomial in x. Polynomial regressio... | <commit_before><commit_msg>Add Polynomial regression Python file<commit_after># -*- coding: utf-8 -*-
"""Polynomial regression for machine learning.
polynomial regression is a form of regression analysis in which the
relationship between the independent variable x and the dependent variable y is
modelled as an nth deg... | |
3638aa4949d7f0f2b79fed0e829e56777c0eb9c0 | gooey/tests/test_language_parity.py | gooey/tests/test_language_parity.py | import os
import unittest
import json
from collections import OrderedDict
from gooey import languages
from gooey.gui.processor import ProcessController
class TestLanguageParity(unittest.TestCase):
"""
Checks that all language files have the same set of keys so that non-english
languages don't... | Add regression test for language files | Add regression test for language files
| Python | mit | partrita/Gooey,chriskiehl/Gooey,codingsnippets/Gooey | Add regression test for language files | import os
import unittest
import json
from collections import OrderedDict
from gooey import languages
from gooey.gui.processor import ProcessController
class TestLanguageParity(unittest.TestCase):
"""
Checks that all language files have the same set of keys so that non-english
languages don't... | <commit_before><commit_msg>Add regression test for language files<commit_after> | import os
import unittest
import json
from collections import OrderedDict
from gooey import languages
from gooey.gui.processor import ProcessController
class TestLanguageParity(unittest.TestCase):
"""
Checks that all language files have the same set of keys so that non-english
languages don't... | Add regression test for language filesimport os
import unittest
import json
from collections import OrderedDict
from gooey import languages
from gooey.gui.processor import ProcessController
class TestLanguageParity(unittest.TestCase):
"""
Checks that all language files have the same set of keys so... | <commit_before><commit_msg>Add regression test for language files<commit_after>import os
import unittest
import json
from collections import OrderedDict
from gooey import languages
from gooey.gui.processor import ProcessController
class TestLanguageParity(unittest.TestCase):
"""
Checks that all la... | |
f4715ec87f03cda417a33a5fba901229f6687ce2 | gdb/vectorwrapper.py | gdb/vectorwrapper.py | #
# Copyright 2015-2017 Michele "King_DuckZ" Santullo
#
# 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 appli... | Add a sample gdb pretty printer for Vec<std::array> types | Add a sample gdb pretty printer for Vec<std::array> types
| Python | apache-2.0 | KingDuckZ/vectorwrapper,KingDuckZ/vectorwrapper,KingDuckZ/vectorwrapper,KingDuckZ/vectorwrapper | Add a sample gdb pretty printer for Vec<std::array> types | #
# Copyright 2015-2017 Michele "King_DuckZ" Santullo
#
# 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 appli... | <commit_before><commit_msg>Add a sample gdb pretty printer for Vec<std::array> types<commit_after> | #
# Copyright 2015-2017 Michele "King_DuckZ" Santullo
#
# 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 appli... | Add a sample gdb pretty printer for Vec<std::array> types #
# Copyright 2015-2017 Michele "King_DuckZ" Santullo
#
# 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.apach... | <commit_before><commit_msg>Add a sample gdb pretty printer for Vec<std::array> types<commit_after> #
# Copyright 2015-2017 Michele "King_DuckZ" Santullo
#
# 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 ... | |
e407b99d0d1f89bab3d90fa519631b0088735f4e | InvenTree/part/test_migrations.py | InvenTree/part/test_migrations.py | """
Unit tests for the part model database migrations
"""
from django_test_migrations.contrib.unittest_case import MigratorTestCase
from InvenTree import helpers
class TestForwardMigrations(MigratorTestCase):
"""
Test entire schema migration sequence for the part app
"""
migrate_from = ('part', hel... | Add initial migration unit test for the 'part' app | Add initial migration unit test for the 'part' app
| Python | mit | inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,inventree/InvenTree,inventree/InvenTree,SchrodingersGat/InvenTree,SchrodingersGat/InvenTree | Add initial migration unit test for the 'part' app | """
Unit tests for the part model database migrations
"""
from django_test_migrations.contrib.unittest_case import MigratorTestCase
from InvenTree import helpers
class TestForwardMigrations(MigratorTestCase):
"""
Test entire schema migration sequence for the part app
"""
migrate_from = ('part', hel... | <commit_before><commit_msg>Add initial migration unit test for the 'part' app<commit_after> | """
Unit tests for the part model database migrations
"""
from django_test_migrations.contrib.unittest_case import MigratorTestCase
from InvenTree import helpers
class TestForwardMigrations(MigratorTestCase):
"""
Test entire schema migration sequence for the part app
"""
migrate_from = ('part', hel... | Add initial migration unit test for the 'part' app"""
Unit tests for the part model database migrations
"""
from django_test_migrations.contrib.unittest_case import MigratorTestCase
from InvenTree import helpers
class TestForwardMigrations(MigratorTestCase):
"""
Test entire schema migration sequence for the... | <commit_before><commit_msg>Add initial migration unit test for the 'part' app<commit_after>"""
Unit tests for the part model database migrations
"""
from django_test_migrations.contrib.unittest_case import MigratorTestCase
from InvenTree import helpers
class TestForwardMigrations(MigratorTestCase):
"""
Test... | |
9638f0e932f6efb65b8a1dd8dc965cdffd99cc39 | kdvadmin/migrations/0001_initial.py | kdvadmin/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-18 21:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Cre... | Add missing migration for kdvadmin | Add missing migration for kdvadmin
| Python | agpl-3.0 | d120/kifplan,d120/kifplan,d120/kifplan | Add missing migration for kdvadmin | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-18 21:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Cre... | <commit_before><commit_msg>Add missing migration for kdvadmin<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-18 21:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.Cre... | Add missing migration for kdvadmin# -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-18 21:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = True
dependencies = [
]
ope... | <commit_before><commit_msg>Add missing migration for kdvadmin<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.16 on 2018-10-18 21:24
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
initial = ... | |
70fb8e9055e106e66f330e3c70b85c977dce53d8 | salt/utils/dicttrim.py | salt/utils/dicttrim.py | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import sys
import salt.payload
def trim_dict(
data,
max_dict_bytes,
percent=50.0,
stepper_size=10,
replace_with='VALUE_TRIMMED',
is_msgpacked=False):
'''
Takes... | Add the needed file :] | Add the needed file :]
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add the needed file :] | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import sys
import salt.payload
def trim_dict(
data,
max_dict_bytes,
percent=50.0,
stepper_size=10,
replace_with='VALUE_TRIMMED',
is_msgpacked=False):
'''
Takes... | <commit_before><commit_msg>Add the needed file :]<commit_after> | # -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import sys
import salt.payload
def trim_dict(
data,
max_dict_bytes,
percent=50.0,
stepper_size=10,
replace_with='VALUE_TRIMMED',
is_msgpacked=False):
'''
Takes... | Add the needed file :]# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import sys
import salt.payload
def trim_dict(
data,
max_dict_bytes,
percent=50.0,
stepper_size=10,
replace_with='VALUE_TRIMMED',
is_msgpacked=Fal... | <commit_before><commit_msg>Add the needed file :]<commit_after># -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import print_function
import sys
import salt.payload
def trim_dict(
data,
max_dict_bytes,
percent=50.0,
stepper_size=10,
replace_with=... | |
b371f277de0f4df99663b8b9e49f187f54012c79 | development/build_log_simplifier.py | development/build_log_simplifier.py | #!/usr/bin/python3
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Add a script for simplifying build.log files | Add a script for simplifying build.log files
Change-Id: Icfc409816b7f7cd028c3022e7073741f60ff30b6
Test: run the script
Bug: b/155305020
| Python | apache-2.0 | androidx/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,androidx/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,AndroidX/androidx,androidx/androidx,AndroidX/androidx,AndroidX/androidx,AndroidX/andro... | Add a script for simplifying build.log files
Change-Id: Icfc409816b7f7cd028c3022e7073741f60ff30b6
Test: run the script
Bug: b/155305020 | #!/usr/bin/python3
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | <commit_before><commit_msg>Add a script for simplifying build.log files
Change-Id: Icfc409816b7f7cd028c3022e7073741f60ff30b6
Test: run the script
Bug: b/155305020<commit_after> | #!/usr/bin/python3
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless requir... | Add a script for simplifying build.log files
Change-Id: Icfc409816b7f7cd028c3022e7073741f60ff30b6
Test: run the script
Bug: b/155305020#!/usr/bin/python3
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in comp... | <commit_before><commit_msg>Add a script for simplifying build.log files
Change-Id: Icfc409816b7f7cd028c3022e7073741f60ff30b6
Test: run the script
Bug: b/155305020<commit_after>#!/usr/bin/python3
#
# Copyright (C) 2016 The Android Open Source Project
#
# Licensed under the Apache License, Version 2.0 (the "License");
#... | |
0e3cecfb94417b7a29765880732684c325ae2406 | test/test_synthesis.py | test/test_synthesis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, [email protected]
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | Add Unit Tests for Synthesis | Add Unit Tests for Synthesis
Ref #127 synthesis.py
| Python | agpl-3.0 | Alignak-monitoring-contrib/alignak-app,Alignak-monitoring-contrib/alignak-app | Add Unit Tests for Synthesis
Ref #127 synthesis.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, [email protected]
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | <commit_before><commit_msg>Add Unit Tests for Synthesis
Ref #127 synthesis.py<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, [email protected]
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Sof... | Add Unit Tests for Synthesis
Ref #127 synthesis.py#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, [email protected]
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero Ge... | <commit_before><commit_msg>Add Unit Tests for Synthesis
Ref #127 synthesis.py<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2015-2016:
# Matthieu Estrada, [email protected]
#
# This file is part of (AlignakApp).
#
# (AlignakApp) is free software: you can redistribute it and/or modify
... | |
ff61b83fa07a944eb5f82d560643d6e8aed4c172 | saulify/sitespec.py | saulify/sitespec.py | """ Reading and representation of Instapaper spec files. """
import sys
from saulify.clean import clean_content
class TestCase(object):
"""
Test case for the article scraper.
Attributes:
url (str): URL of the page being tested
fragments (list of str): Fragments of text that should be presen... | Add module handling Instapaper config files | Add module handling Instapaper config files
| Python | agpl-3.0 | asm-products/saulify-web,asm-products/saulify-web,asm-products/saulify-web | Add module handling Instapaper config files | """ Reading and representation of Instapaper spec files. """
import sys
from saulify.clean import clean_content
class TestCase(object):
"""
Test case for the article scraper.
Attributes:
url (str): URL of the page being tested
fragments (list of str): Fragments of text that should be presen... | <commit_before><commit_msg>Add module handling Instapaper config files<commit_after> | """ Reading and representation of Instapaper spec files. """
import sys
from saulify.clean import clean_content
class TestCase(object):
"""
Test case for the article scraper.
Attributes:
url (str): URL of the page being tested
fragments (list of str): Fragments of text that should be presen... | Add module handling Instapaper config files""" Reading and representation of Instapaper spec files. """
import sys
from saulify.clean import clean_content
class TestCase(object):
"""
Test case for the article scraper.
Attributes:
url (str): URL of the page being tested
fragments (list of st... | <commit_before><commit_msg>Add module handling Instapaper config files<commit_after>""" Reading and representation of Instapaper spec files. """
import sys
from saulify.clean import clean_content
class TestCase(object):
"""
Test case for the article scraper.
Attributes:
url (str): URL of the page... | |
8046d67046a0be334b87e0ad54d78b6cfce83aad | main/test_race.py | main/test_race.py | import multiprocessing
import pprint
from ppm import Trie
trie = None
def test(a):
x, trie = a
trie.add('b')
trie.add('b')
print(x, trie.bit_encoding)
return trie.bit_encoding
if __name__ == '__main__':
trie = Trie(5)
trie.add('a')
alist = [ (x, trie) for x in range(0, multiprocessing... | Add a race condition tester | Add a race condition tester
| Python | mit | worldwise001/stylometry | Add a race condition tester | import multiprocessing
import pprint
from ppm import Trie
trie = None
def test(a):
x, trie = a
trie.add('b')
trie.add('b')
print(x, trie.bit_encoding)
return trie.bit_encoding
if __name__ == '__main__':
trie = Trie(5)
trie.add('a')
alist = [ (x, trie) for x in range(0, multiprocessing... | <commit_before><commit_msg>Add a race condition tester<commit_after> | import multiprocessing
import pprint
from ppm import Trie
trie = None
def test(a):
x, trie = a
trie.add('b')
trie.add('b')
print(x, trie.bit_encoding)
return trie.bit_encoding
if __name__ == '__main__':
trie = Trie(5)
trie.add('a')
alist = [ (x, trie) for x in range(0, multiprocessing... | Add a race condition testerimport multiprocessing
import pprint
from ppm import Trie
trie = None
def test(a):
x, trie = a
trie.add('b')
trie.add('b')
print(x, trie.bit_encoding)
return trie.bit_encoding
if __name__ == '__main__':
trie = Trie(5)
trie.add('a')
alist = [ (x, trie) for x ... | <commit_before><commit_msg>Add a race condition tester<commit_after>import multiprocessing
import pprint
from ppm import Trie
trie = None
def test(a):
x, trie = a
trie.add('b')
trie.add('b')
print(x, trie.bit_encoding)
return trie.bit_encoding
if __name__ == '__main__':
trie = Trie(5)
tri... | |
ad14c2da6b7fdaf8744b48c6e714acc18c8c073c | render_random_particle.py | render_random_particle.py | import pygame
import random
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.radius = radius
self.color = (255, 0, 0)
... | Add module that renders particles on screen with random position | Add module that renders particles on screen with random position
| Python | mit | withtwoemms/pygame-explorations | Add module that renders particles on screen with random position | import pygame
import random
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.radius = radius
self.color = (255, 0, 0)
... | <commit_before><commit_msg>Add module that renders particles on screen with random position<commit_after> | import pygame
import random
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = y
self.radius = radius
self.color = (255, 0, 0)
... | Add module that renders particles on screen with random positionimport pygame
import random
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radius):
self.x = x
self.y = ... | <commit_before><commit_msg>Add module that renders particles on screen with random position<commit_after>import pygame
import random
pygame.init()
#-- SCREEN CHARACTERISTICS ------------------------->>>
background_color = (255,255,255)
(width, height) = (300, 200)
class Particle:
def __init__(self, (x, y), radi... | |
ba49f8608bfe0130ea3b971e2844d6ad43b6e2ba | trypython/stdlib/sys_/sys_getsizeof_vs_dunder_sizeof_diff.py | trypython/stdlib/sys_/sys_getsizeof_vs_dunder_sizeof_diff.py | """
sys.getsizeof() と __sizeof__() で 返される値が異なる時があるのを確認するサンプル
REFERENCES:: http://bit.ly/2GTVkbs
"""
import sys
from trypython.common.commoncls import SampleBase
class Sample(SampleBase):
def exec(self):
# sys.getsizeof() は GC フィールドの分を加算するので
# __sizeof__() が返す値と異なるときがある
list_data = [10, 2... | Add sys.getsizeof() vs ```__sizeof__()``` difference example | Add sys.getsizeof() vs ```__sizeof__()``` difference example
| Python | mit | devlights/try-python | Add sys.getsizeof() vs ```__sizeof__()``` difference example | """
sys.getsizeof() と __sizeof__() で 返される値が異なる時があるのを確認するサンプル
REFERENCES:: http://bit.ly/2GTVkbs
"""
import sys
from trypython.common.commoncls import SampleBase
class Sample(SampleBase):
def exec(self):
# sys.getsizeof() は GC フィールドの分を加算するので
# __sizeof__() が返す値と異なるときがある
list_data = [10, 2... | <commit_before><commit_msg>Add sys.getsizeof() vs ```__sizeof__()``` difference example<commit_after> | """
sys.getsizeof() と __sizeof__() で 返される値が異なる時があるのを確認するサンプル
REFERENCES:: http://bit.ly/2GTVkbs
"""
import sys
from trypython.common.commoncls import SampleBase
class Sample(SampleBase):
def exec(self):
# sys.getsizeof() は GC フィールドの分を加算するので
# __sizeof__() が返す値と異なるときがある
list_data = [10, 2... | Add sys.getsizeof() vs ```__sizeof__()``` difference example"""
sys.getsizeof() と __sizeof__() で 返される値が異なる時があるのを確認するサンプル
REFERENCES:: http://bit.ly/2GTVkbs
"""
import sys
from trypython.common.commoncls import SampleBase
class Sample(SampleBase):
def exec(self):
# sys.getsizeof() は GC フィールドの分を加算するので
... | <commit_before><commit_msg>Add sys.getsizeof() vs ```__sizeof__()``` difference example<commit_after>"""
sys.getsizeof() と __sizeof__() で 返される値が異なる時があるのを確認するサンプル
REFERENCES:: http://bit.ly/2GTVkbs
"""
import sys
from trypython.common.commoncls import SampleBase
class Sample(SampleBase):
def exec(self):
... | |
43f4c62d45d41b9dae5582e2d7f10b187731f2b7 | utils/test/__init__.py | utils/test/__init__.py | import os
import unittest
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
import settings
HRD_CONSISTENCY = 1
class DatastoreTestCase(unittest.TestCase):
"""Test case with stubbed high-replication datastore API. The datastore
stub uses an optimistic, alw... | Add datastore and memcache stub test cases | Add datastore and memcache stub test cases
| Python | apache-2.0 | tylertreat/gaeutils | Add datastore and memcache stub test cases | import os
import unittest
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
import settings
HRD_CONSISTENCY = 1
class DatastoreTestCase(unittest.TestCase):
"""Test case with stubbed high-replication datastore API. The datastore
stub uses an optimistic, alw... | <commit_before><commit_msg>Add datastore and memcache stub test cases<commit_after> | import os
import unittest
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
import settings
HRD_CONSISTENCY = 1
class DatastoreTestCase(unittest.TestCase):
"""Test case with stubbed high-replication datastore API. The datastore
stub uses an optimistic, alw... | Add datastore and memcache stub test casesimport os
import unittest
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
import settings
HRD_CONSISTENCY = 1
class DatastoreTestCase(unittest.TestCase):
"""Test case with stubbed high-replication datastore API. The ... | <commit_before><commit_msg>Add datastore and memcache stub test cases<commit_after>import os
import unittest
from google.appengine.ext import testbed
from google.appengine.datastore import datastore_stub_util
import settings
HRD_CONSISTENCY = 1
class DatastoreTestCase(unittest.TestCase):
"""Test case with stu... | |
3fb964bd49ab5855b60ecbf8981fe0bceffb108b | slr1/wsgi_websocket.py | slr1/wsgi_websocket.py | import os
import gevent.socket
import redis.connection
redis.connection.socket = gevent.socket
os.environ.update(DJANGO_SETTINGS_MODULE='settings.base')
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()
| Introduce wsgi app for websockets | Introduce wsgi app for websockets
| Python | bsd-3-clause | stefantsov/blackbox3,stefantsov/blackbox3,stefantsov/blackbox3 | Introduce wsgi app for websockets | import os
import gevent.socket
import redis.connection
redis.connection.socket = gevent.socket
os.environ.update(DJANGO_SETTINGS_MODULE='settings.base')
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()
| <commit_before><commit_msg>Introduce wsgi app for websockets<commit_after> | import os
import gevent.socket
import redis.connection
redis.connection.socket = gevent.socket
os.environ.update(DJANGO_SETTINGS_MODULE='settings.base')
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()
| Introduce wsgi app for websocketsimport os
import gevent.socket
import redis.connection
redis.connection.socket = gevent.socket
os.environ.update(DJANGO_SETTINGS_MODULE='settings.base')
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer()
| <commit_before><commit_msg>Introduce wsgi app for websockets<commit_after>import os
import gevent.socket
import redis.connection
redis.connection.socket = gevent.socket
os.environ.update(DJANGO_SETTINGS_MODULE='settings.base')
from ws4redis.uwsgi_runserver import uWSGIWebsocketServer
application = uWSGIWebsocketServer(... | |
4cbe57c803de833d912cf2f325e9e710eb17aa10 | contrib/os_export/archive_sources.py | contrib/os_export/archive_sources.py | import requests
import json
import sys
import os
def grab_source(url, output):
"""
Grab a source from a url and store it in an output file
This creates uses requests as a dependency because I'm lazy.
It probably would have taken me less time to just write it with
urllib than writing this docstrin... | Add source archiving to OpenSpending export (separate script) | Add source archiving to OpenSpending export (separate script)
This is a separate script because the export scripts is run on a
production server (or a server with access to the database) and we
don't want the production server to also do the archiving, we can
do that on some poor local machine.
| Python | agpl-3.0 | pudo/spendb,johnjohndoe/spendb,openspending/spendb,pudo/spendb,spendb/spendb,CivicVision/datahub,spendb/spendb,CivicVision/datahub,pudo/spendb,openspending/spendb,johnjohndoe/spendb,spendb/spendb,openspending/spendb,johnjohndoe/spendb,CivicVision/datahub | Add source archiving to OpenSpending export (separate script)
This is a separate script because the export scripts is run on a
production server (or a server with access to the database) and we
don't want the production server to also do the archiving, we can
do that on some poor local machine. | import requests
import json
import sys
import os
def grab_source(url, output):
"""
Grab a source from a url and store it in an output file
This creates uses requests as a dependency because I'm lazy.
It probably would have taken me less time to just write it with
urllib than writing this docstrin... | <commit_before><commit_msg>Add source archiving to OpenSpending export (separate script)
This is a separate script because the export scripts is run on a
production server (or a server with access to the database) and we
don't want the production server to also do the archiving, we can
do that on some poor local machi... | import requests
import json
import sys
import os
def grab_source(url, output):
"""
Grab a source from a url and store it in an output file
This creates uses requests as a dependency because I'm lazy.
It probably would have taken me less time to just write it with
urllib than writing this docstrin... | Add source archiving to OpenSpending export (separate script)
This is a separate script because the export scripts is run on a
production server (or a server with access to the database) and we
don't want the production server to also do the archiving, we can
do that on some poor local machine.import requests
import j... | <commit_before><commit_msg>Add source archiving to OpenSpending export (separate script)
This is a separate script because the export scripts is run on a
production server (or a server with access to the database) and we
don't want the production server to also do the archiving, we can
do that on some poor local machi... | |
5594a131574e410d750fbc20d40c0b13c67671e9 | pinax/app_name/apps.py | pinax/app_name/apps.py | import importlib
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
class AppConfig(BaseAppConfig):
name = "pinax.{{ app_name }}"
label = "pinax_{{ app_name }}"
verbose_name = _("Pinax {{ app_name|title }}")
| Add AppConfig to namespace tables with label | Add AppConfig to namespace tables with label | Python | mit | pinax/pinax-starter-app | Add AppConfig to namespace tables with label | import importlib
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
class AppConfig(BaseAppConfig):
name = "pinax.{{ app_name }}"
label = "pinax_{{ app_name }}"
verbose_name = _("Pinax {{ app_name|title }}")
| <commit_before><commit_msg>Add AppConfig to namespace tables with label<commit_after> | import importlib
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
class AppConfig(BaseAppConfig):
name = "pinax.{{ app_name }}"
label = "pinax_{{ app_name }}"
verbose_name = _("Pinax {{ app_name|title }}")
| Add AppConfig to namespace tables with labelimport importlib
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
class AppConfig(BaseAppConfig):
name = "pinax.{{ app_name }}"
label = "pinax_{{ app_name }}"
verbose_name = _("Pinax {{ app_name|title }... | <commit_before><commit_msg>Add AppConfig to namespace tables with label<commit_after>import importlib
from django.apps import AppConfig as BaseAppConfig
from django.utils.translation import ugettext_lazy as _
class AppConfig(BaseAppConfig):
name = "pinax.{{ app_name }}"
label = "pinax_{{ app_name }}"
ve... | |
57d207ff7facac0d3970f96f5ac91bbb6e7ec7f8 | indra/tools/hypothesis_annotator.py | indra/tools/hypothesis_annotator.py | import logging
from indra.sources import indra_db_rest
from indra.pipeline import AssemblyPipeline
from indra.sources.hypothesis import upload_statement_annotation
ref_priority = ['TRID', 'PMCID', 'PMID']
logger = logging.getLogger(__name__)
def annotate_paper(text_refs, pipeline=None):
"""Upload INDRA Statemen... | Add tool for annotating a given paper | Add tool for annotating a given paper
| Python | bsd-2-clause | bgyori/indra,bgyori/indra,bgyori/indra,johnbachman/indra,johnbachman/indra,sorgerlab/indra,sorgerlab/belpy,sorgerlab/indra,sorgerlab/belpy,sorgerlab/belpy,sorgerlab/indra,johnbachman/indra | Add tool for annotating a given paper | import logging
from indra.sources import indra_db_rest
from indra.pipeline import AssemblyPipeline
from indra.sources.hypothesis import upload_statement_annotation
ref_priority = ['TRID', 'PMCID', 'PMID']
logger = logging.getLogger(__name__)
def annotate_paper(text_refs, pipeline=None):
"""Upload INDRA Statemen... | <commit_before><commit_msg>Add tool for annotating a given paper<commit_after> | import logging
from indra.sources import indra_db_rest
from indra.pipeline import AssemblyPipeline
from indra.sources.hypothesis import upload_statement_annotation
ref_priority = ['TRID', 'PMCID', 'PMID']
logger = logging.getLogger(__name__)
def annotate_paper(text_refs, pipeline=None):
"""Upload INDRA Statemen... | Add tool for annotating a given paperimport logging
from indra.sources import indra_db_rest
from indra.pipeline import AssemblyPipeline
from indra.sources.hypothesis import upload_statement_annotation
ref_priority = ['TRID', 'PMCID', 'PMID']
logger = logging.getLogger(__name__)
def annotate_paper(text_refs, pipelin... | <commit_before><commit_msg>Add tool for annotating a given paper<commit_after>import logging
from indra.sources import indra_db_rest
from indra.pipeline import AssemblyPipeline
from indra.sources.hypothesis import upload_statement_annotation
ref_priority = ['TRID', 'PMCID', 'PMID']
logger = logging.getLogger(__name__... | |
aec2ff67b3dbf2fa7770fc62b08659b51e6ed41e | tests/test_membrane.py | tests/test_membrane.py | from membrane import Membrane, Proxy
from rt import Wait
def test_membrane():
m1 = Membrane.create()
m1.transport = {'protocol': 'null',
'membrane': m1}
m2 = Membrane.create()
m2.transport = {'protocol': 'null',
'membrane': m1}
m1 << 'start'
m2 << 'start'... | Add test for membrane behavior | Add test for membrane behavior | Python | mit | waltermoreira/tartpy | Add test for membrane behavior | from membrane import Membrane, Proxy
from rt import Wait
def test_membrane():
m1 = Membrane.create()
m1.transport = {'protocol': 'null',
'membrane': m1}
m2 = Membrane.create()
m2.transport = {'protocol': 'null',
'membrane': m1}
m1 << 'start'
m2 << 'start'... | <commit_before><commit_msg>Add test for membrane behavior<commit_after> | from membrane import Membrane, Proxy
from rt import Wait
def test_membrane():
m1 = Membrane.create()
m1.transport = {'protocol': 'null',
'membrane': m1}
m2 = Membrane.create()
m2.transport = {'protocol': 'null',
'membrane': m1}
m1 << 'start'
m2 << 'start'... | Add test for membrane behaviorfrom membrane import Membrane, Proxy
from rt import Wait
def test_membrane():
m1 = Membrane.create()
m1.transport = {'protocol': 'null',
'membrane': m1}
m2 = Membrane.create()
m2.transport = {'protocol': 'null',
'membrane': m1}
m... | <commit_before><commit_msg>Add test for membrane behavior<commit_after>from membrane import Membrane, Proxy
from rt import Wait
def test_membrane():
m1 = Membrane.create()
m1.transport = {'protocol': 'null',
'membrane': m1}
m2 = Membrane.create()
m2.transport = {'protocol': 'null',
... | |
af27946ce53405afa044de872d931c0b92a2af9b | providers/popularity/thepiratebay.py | providers/popularity/thepiratebay.py | from providers.popularity.provider import PopularityProvider
from utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches
from urllib import quote
IDENTIFIER = "thepiratebay"
class Provider(PopularityProvider):
PAGES_TO_FETCH = 3
def get_popular(self):
names = []
query = quote(... | Add support for The Pirate Bay as popularity provider. | Add support for The Pirate Bay as popularity provider.
| Python | mit | EmilStenstrom/nephele | Add support for The Pirate Bay as popularity provider. | from providers.popularity.provider import PopularityProvider
from utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches
from urllib import quote
IDENTIFIER = "thepiratebay"
class Provider(PopularityProvider):
PAGES_TO_FETCH = 3
def get_popular(self):
names = []
query = quote(... | <commit_before><commit_msg>Add support for The Pirate Bay as popularity provider.<commit_after> | from providers.popularity.provider import PopularityProvider
from utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches
from urllib import quote
IDENTIFIER = "thepiratebay"
class Provider(PopularityProvider):
PAGES_TO_FETCH = 3
def get_popular(self):
names = []
query = quote(... | Add support for The Pirate Bay as popularity provider.from providers.popularity.provider import PopularityProvider
from utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches
from urllib import quote
IDENTIFIER = "thepiratebay"
class Provider(PopularityProvider):
PAGES_TO_FETCH = 3
def get_po... | <commit_before><commit_msg>Add support for The Pirate Bay as popularity provider.<commit_after>from providers.popularity.provider import PopularityProvider
from utils.torrent_util import torrent_to_movie, remove_bad_torrent_matches
from urllib import quote
IDENTIFIER = "thepiratebay"
class Provider(PopularityProvider... | |
88fc811658b002d0ef6f0cce070df9e8ef85e739 | tweetyr.py | tweetyr.py | #!/usr/bin/env python
# -*- coding: UTF-8
'''
A simple twitter client that posts current weather to twitter
'''
import tweepy
import json
from urllib2 import urlopen
import os
root =os.path.dirname(os.path.abspath(__file__))
conf = json.loads(file(root+'/twitterconfig.json').read())
auth = tweepy.OAuthHandler(conf['... | Add a simple tweeting weather bot | Add a simple tweeting weather bot
| Python | bsd-3-clause | torhve/Amatyr,torhve/Amatyr,torhve/Amatyr | Add a simple tweeting weather bot | #!/usr/bin/env python
# -*- coding: UTF-8
'''
A simple twitter client that posts current weather to twitter
'''
import tweepy
import json
from urllib2 import urlopen
import os
root =os.path.dirname(os.path.abspath(__file__))
conf = json.loads(file(root+'/twitterconfig.json').read())
auth = tweepy.OAuthHandler(conf['... | <commit_before><commit_msg>Add a simple tweeting weather bot<commit_after> | #!/usr/bin/env python
# -*- coding: UTF-8
'''
A simple twitter client that posts current weather to twitter
'''
import tweepy
import json
from urllib2 import urlopen
import os
root =os.path.dirname(os.path.abspath(__file__))
conf = json.loads(file(root+'/twitterconfig.json').read())
auth = tweepy.OAuthHandler(conf['... | Add a simple tweeting weather bot#!/usr/bin/env python
# -*- coding: UTF-8
'''
A simple twitter client that posts current weather to twitter
'''
import tweepy
import json
from urllib2 import urlopen
import os
root =os.path.dirname(os.path.abspath(__file__))
conf = json.loads(file(root+'/twitterconfig.json').read())
... | <commit_before><commit_msg>Add a simple tweeting weather bot<commit_after>#!/usr/bin/env python
# -*- coding: UTF-8
'''
A simple twitter client that posts current weather to twitter
'''
import tweepy
import json
from urllib2 import urlopen
import os
root =os.path.dirname(os.path.abspath(__file__))
conf = json.loads(f... | |
b08e60e57484810fc2fb695e5a8fc6aef7b8ea77 | sst/create_filelist.py | sst/create_filelist.py | #!/usr/bin/env python
"""Create filelists to use for training and testing."""
import os
import json
from sklearn.cross_validation import train_test_split
path_data = os.path.join(os.environ['DATA_PATH'],
'data_road/roadC621/',
"image_2/")
files_data = [os.path.join(... | Add utility function to create file list | Add utility function to create file list
| Python | mit | MartinThoma/sst,MartinThoma/sst | Add utility function to create file list | #!/usr/bin/env python
"""Create filelists to use for training and testing."""
import os
import json
from sklearn.cross_validation import train_test_split
path_data = os.path.join(os.environ['DATA_PATH'],
'data_road/roadC621/',
"image_2/")
files_data = [os.path.join(... | <commit_before><commit_msg>Add utility function to create file list<commit_after> | #!/usr/bin/env python
"""Create filelists to use for training and testing."""
import os
import json
from sklearn.cross_validation import train_test_split
path_data = os.path.join(os.environ['DATA_PATH'],
'data_road/roadC621/',
"image_2/")
files_data = [os.path.join(... | Add utility function to create file list#!/usr/bin/env python
"""Create filelists to use for training and testing."""
import os
import json
from sklearn.cross_validation import train_test_split
path_data = os.path.join(os.environ['DATA_PATH'],
'data_road/roadC621/',
... | <commit_before><commit_msg>Add utility function to create file list<commit_after>#!/usr/bin/env python
"""Create filelists to use for training and testing."""
import os
import json
from sklearn.cross_validation import train_test_split
path_data = os.path.join(os.environ['DATA_PATH'],
'data_... | |
f2ce38fd51706848814dc9a2f420776bcf8ebd3f | pwnedcheck/__init__.py | pwnedcheck/__init__.py | __author__ = 'Casey Dunham'
__version__ = "0.1.0"
import urllib
import urllib2
import json
PWNED_API_URL = "https://haveibeenpwned.com/api/breachedaccount/%s"
class InvalidEmail(Exception):
pass
def check(email):
req = urllib.Request(PWNED_API_URL % urllib.quote(email))
try:
resp = urllib.ur... | Check single email against api | Check single email against api
| Python | mit | caseydunham/PwnedCheck | Check single email against api | __author__ = 'Casey Dunham'
__version__ = "0.1.0"
import urllib
import urllib2
import json
PWNED_API_URL = "https://haveibeenpwned.com/api/breachedaccount/%s"
class InvalidEmail(Exception):
pass
def check(email):
req = urllib.Request(PWNED_API_URL % urllib.quote(email))
try:
resp = urllib.ur... | <commit_before><commit_msg>Check single email against api<commit_after> | __author__ = 'Casey Dunham'
__version__ = "0.1.0"
import urllib
import urllib2
import json
PWNED_API_URL = "https://haveibeenpwned.com/api/breachedaccount/%s"
class InvalidEmail(Exception):
pass
def check(email):
req = urllib.Request(PWNED_API_URL % urllib.quote(email))
try:
resp = urllib.ur... | Check single email against api__author__ = 'Casey Dunham'
__version__ = "0.1.0"
import urllib
import urllib2
import json
PWNED_API_URL = "https://haveibeenpwned.com/api/breachedaccount/%s"
class InvalidEmail(Exception):
pass
def check(email):
req = urllib.Request(PWNED_API_URL % urllib.quote(email))
... | <commit_before><commit_msg>Check single email against api<commit_after>__author__ = 'Casey Dunham'
__version__ = "0.1.0"
import urllib
import urllib2
import json
PWNED_API_URL = "https://haveibeenpwned.com/api/breachedaccount/%s"
class InvalidEmail(Exception):
pass
def check(email):
req = urllib.Request... | |
33a0e85ef52bd13a407f17aaacb37d4081343c0e | data/3_2_make_json_for_each_pheno.py | data/3_2_make_json_for_each_pheno.py | #!/usr/bin/env python2
from __future__ import print_function, division, absolute_import
import gzip
import glob
import heapq
import re
import os.path
import json
def parse_marker_id(marker_id):
chr1, pos1, ref, alt, chr2, pos2 = re.match(r'([^:]+):([0-9]+)_([-ATCG]+)/([-ATCG]+)_([^:]+):([0-9]+)', marker_id).grou... | Make GWAS json for each pheno | Make GWAS json for each pheno
| Python | agpl-3.0 | statgen/pheweb,statgen/pheweb,statgen/pheweb,statgen/pheweb,statgen/pheweb | Make GWAS json for each pheno | #!/usr/bin/env python2
from __future__ import print_function, division, absolute_import
import gzip
import glob
import heapq
import re
import os.path
import json
def parse_marker_id(marker_id):
chr1, pos1, ref, alt, chr2, pos2 = re.match(r'([^:]+):([0-9]+)_([-ATCG]+)/([-ATCG]+)_([^:]+):([0-9]+)', marker_id).grou... | <commit_before><commit_msg>Make GWAS json for each pheno<commit_after> | #!/usr/bin/env python2
from __future__ import print_function, division, absolute_import
import gzip
import glob
import heapq
import re
import os.path
import json
def parse_marker_id(marker_id):
chr1, pos1, ref, alt, chr2, pos2 = re.match(r'([^:]+):([0-9]+)_([-ATCG]+)/([-ATCG]+)_([^:]+):([0-9]+)', marker_id).grou... | Make GWAS json for each pheno#!/usr/bin/env python2
from __future__ import print_function, division, absolute_import
import gzip
import glob
import heapq
import re
import os.path
import json
def parse_marker_id(marker_id):
chr1, pos1, ref, alt, chr2, pos2 = re.match(r'([^:]+):([0-9]+)_([-ATCG]+)/([-ATCG]+)_([^:]... | <commit_before><commit_msg>Make GWAS json for each pheno<commit_after>#!/usr/bin/env python2
from __future__ import print_function, division, absolute_import
import gzip
import glob
import heapq
import re
import os.path
import json
def parse_marker_id(marker_id):
chr1, pos1, ref, alt, chr2, pos2 = re.match(r'([^... | |
5f2e986a9dbc8cf82e55fd711dbe9931b4b3edc4 | link_in_global_module.py | link_in_global_module.py | # Link in a module in the global Python site-packages the virtualenv that we are currently in
# Author: Luke Macken <[email protected]>
import os
import sys
from glob import glob
from distutils.sysconfig import get_python_lib
def symlink_global_module_into_virtualenv(modulename, env):
for path in (get_python_li... | Add a tool for linking in global python modules into our virtualenv | Add a tool for linking in global python modules into our virtualenv
| Python | agpl-3.0 | Fale/fedora-packages,fedora-infra/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages,fedora-infra/fedora-packages,Fale/fedora-packages,fedora-infra/fedora-packages | Add a tool for linking in global python modules into our virtualenv | # Link in a module in the global Python site-packages the virtualenv that we are currently in
# Author: Luke Macken <[email protected]>
import os
import sys
from glob import glob
from distutils.sysconfig import get_python_lib
def symlink_global_module_into_virtualenv(modulename, env):
for path in (get_python_li... | <commit_before><commit_msg>Add a tool for linking in global python modules into our virtualenv<commit_after> | # Link in a module in the global Python site-packages the virtualenv that we are currently in
# Author: Luke Macken <[email protected]>
import os
import sys
from glob import glob
from distutils.sysconfig import get_python_lib
def symlink_global_module_into_virtualenv(modulename, env):
for path in (get_python_li... | Add a tool for linking in global python modules into our virtualenv# Link in a module in the global Python site-packages the virtualenv that we are currently in
# Author: Luke Macken <[email protected]>
import os
import sys
from glob import glob
from distutils.sysconfig import get_python_lib
def symlink_global_modu... | <commit_before><commit_msg>Add a tool for linking in global python modules into our virtualenv<commit_after># Link in a module in the global Python site-packages the virtualenv that we are currently in
# Author: Luke Macken <[email protected]>
import os
import sys
from glob import glob
from distutils.sysconfig impor... | |
9daceaf8cad088a1507af7ce1503f15bc619695d | panoptes/panoptes.py | panoptes/panoptes.py | #!/usr/bin/env python
import ephem
import panoptes.utils.logger as logger
import panoptes.observatory as observatory
class Panoptes:
"""
Sets up logger, reads config file and starts up application.
"""
def __init__(self):
# Setup utils
self.logger = logger.Logger()
self.logge... | Simplify Panoptes class so that site belongs to observatory. We need to read in a config here. | Simplify Panoptes class so that site belongs to observatory. We need to read in a config here.
| Python | mit | Guokr1991/POCS,panoptes/POCS,joshwalawender/POCS,panoptes/POCS,joshwalawender/POCS,fmin2958/POCS,Guokr1991/POCS,fmin2958/POCS,joshwalawender/POCS,AstroHuntsman/POCS,Guokr1991/POCS,AstroHuntsman/POCS,panoptes/POCS,panoptes/POCS,fmin2958/POCS,Guokr1991/POCS,AstroHuntsman/POCS,AstroHuntsman/POCS | Simplify Panoptes class so that site belongs to observatory. We need to read in a config here. | #!/usr/bin/env python
import ephem
import panoptes.utils.logger as logger
import panoptes.observatory as observatory
class Panoptes:
"""
Sets up logger, reads config file and starts up application.
"""
def __init__(self):
# Setup utils
self.logger = logger.Logger()
self.logge... | <commit_before><commit_msg>Simplify Panoptes class so that site belongs to observatory. We need to read in a config here.<commit_after> | #!/usr/bin/env python
import ephem
import panoptes.utils.logger as logger
import panoptes.observatory as observatory
class Panoptes:
"""
Sets up logger, reads config file and starts up application.
"""
def __init__(self):
# Setup utils
self.logger = logger.Logger()
self.logge... | Simplify Panoptes class so that site belongs to observatory. We need to read in a config here.#!/usr/bin/env python
import ephem
import panoptes.utils.logger as logger
import panoptes.observatory as observatory
class Panoptes:
"""
Sets up logger, reads config file and starts up application.
"""
def _... | <commit_before><commit_msg>Simplify Panoptes class so that site belongs to observatory. We need to read in a config here.<commit_after>#!/usr/bin/env python
import ephem
import panoptes.utils.logger as logger
import panoptes.observatory as observatory
class Panoptes:
"""
Sets up logger, reads config file and... | |
1f7bb3ae05ef00a78a579553ac2f1954ae32b991 | payment_ogone_compassion/migrations/11.0.1.0.0/post-migration.py | payment_ogone_compassion/migrations/11.0.1.0.0/post-migration.py | from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
if not version:
return
# Update payment_acquirers
env.cr.execute("""
select id from ir_ui_view where name = 'ogone_acquirer_button'
""")
old_view_id = env.cr.fetchone()[0]
new_view_id = en... | Add migrations for payment acquirers | Add migrations for payment acquirers
| Python | agpl-3.0 | CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland,eicher31/compassion-switzerland,eicher31/compassion-switzerland,CompassionCH/compassion-switzerland | Add migrations for payment acquirers | from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
if not version:
return
# Update payment_acquirers
env.cr.execute("""
select id from ir_ui_view where name = 'ogone_acquirer_button'
""")
old_view_id = env.cr.fetchone()[0]
new_view_id = en... | <commit_before><commit_msg>Add migrations for payment acquirers<commit_after> | from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
if not version:
return
# Update payment_acquirers
env.cr.execute("""
select id from ir_ui_view where name = 'ogone_acquirer_button'
""")
old_view_id = env.cr.fetchone()[0]
new_view_id = en... | Add migrations for payment acquirersfrom openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
if not version:
return
# Update payment_acquirers
env.cr.execute("""
select id from ir_ui_view where name = 'ogone_acquirer_button'
""")
old_view_id = env.c... | <commit_before><commit_msg>Add migrations for payment acquirers<commit_after>from openupgradelib import openupgrade
@openupgrade.migrate()
def migrate(env, version):
if not version:
return
# Update payment_acquirers
env.cr.execute("""
select id from ir_ui_view where name = 'ogone_acquirer... | |
7e4dd4bc4cfdea5f1e2872b3348b760473a3b2ab | Problems/uniqueChars.py | Problems/uniqueChars.py | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
strings = [None, '', 'Young Frankenstein', 'Yodeling cat']
results = [False, True, False, True]
for i, s in enumerate(strings):
if has_unique_chars(s) == results[i]:
print('PASSED test case: {} returned {}'.format(s... | Add unique characters algorithm and tests | Add unique characters algorithm and tests
| Python | mit | HKuz/Test_Code | Add unique characters algorithm and tests | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
strings = [None, '', 'Young Frankenstein', 'Yodeling cat']
results = [False, True, False, True]
for i, s in enumerate(strings):
if has_unique_chars(s) == results[i]:
print('PASSED test case: {} returned {}'.format(s... | <commit_before><commit_msg>Add unique characters algorithm and tests<commit_after> | #!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
strings = [None, '', 'Young Frankenstein', 'Yodeling cat']
results = [False, True, False, True]
for i, s in enumerate(strings):
if has_unique_chars(s) == results[i]:
print('PASSED test case: {} returned {}'.format(s... | Add unique characters algorithm and tests#!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
strings = [None, '', 'Young Frankenstein', 'Yodeling cat']
results = [False, True, False, True]
for i, s in enumerate(strings):
if has_unique_chars(s) == results[i]:
print('P... | <commit_before><commit_msg>Add unique characters algorithm and tests<commit_after>#!/Applications/anaconda/envs/Python3/bin
def main():
# Test suite
strings = [None, '', 'Young Frankenstein', 'Yodeling cat']
results = [False, True, False, True]
for i, s in enumerate(strings):
if has_unique_cha... | |
0994f60728a19a14628ca2e4544693d1ea918126 | examples/li_to_hdf5.py | examples/li_to_hdf5.py | #!/usr/bin/env python
import sys
from datetime import datetime
import pymoku.dataparser
import h5py
if len(sys.argv) != 3:
print "Usage: li_to_csv.py infile.li outfile.hd5"
exit(1)
reader = pymoku.dataparser.LIDataFileReader(sys.argv[1])
writer = h5py.File(sys.argv[2], 'w')
ncols = reader.nch
set_name = 'moku:da... | Add HDF5 data file writer to examples | HD5: Add HDF5 data file writer to examples
| Python | mit | benizl/pymoku,liquidinstruments/pymoku | HD5: Add HDF5 data file writer to examples | #!/usr/bin/env python
import sys
from datetime import datetime
import pymoku.dataparser
import h5py
if len(sys.argv) != 3:
print "Usage: li_to_csv.py infile.li outfile.hd5"
exit(1)
reader = pymoku.dataparser.LIDataFileReader(sys.argv[1])
writer = h5py.File(sys.argv[2], 'w')
ncols = reader.nch
set_name = 'moku:da... | <commit_before><commit_msg>HD5: Add HDF5 data file writer to examples<commit_after> | #!/usr/bin/env python
import sys
from datetime import datetime
import pymoku.dataparser
import h5py
if len(sys.argv) != 3:
print "Usage: li_to_csv.py infile.li outfile.hd5"
exit(1)
reader = pymoku.dataparser.LIDataFileReader(sys.argv[1])
writer = h5py.File(sys.argv[2], 'w')
ncols = reader.nch
set_name = 'moku:da... | HD5: Add HDF5 data file writer to examples#!/usr/bin/env python
import sys
from datetime import datetime
import pymoku.dataparser
import h5py
if len(sys.argv) != 3:
print "Usage: li_to_csv.py infile.li outfile.hd5"
exit(1)
reader = pymoku.dataparser.LIDataFileReader(sys.argv[1])
writer = h5py.File(sys.argv[2], 'w... | <commit_before><commit_msg>HD5: Add HDF5 data file writer to examples<commit_after>#!/usr/bin/env python
import sys
from datetime import datetime
import pymoku.dataparser
import h5py
if len(sys.argv) != 3:
print "Usage: li_to_csv.py infile.li outfile.hd5"
exit(1)
reader = pymoku.dataparser.LIDataFileReader(sys.ar... | |
9858c56188f4d6c81daf6535e7cd58ff23e20712 | application/senic/nuimo_hub/tests/test_setup_wifi.py | application/senic/nuimo_hub/tests/test_setup_wifi.py | import pytest
from mock import patch
@pytest.fixture
def url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, url):
assert browser.get_json(url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/no/such/file'
... | import pytest
from mock import patch
@pytest.fixture
def setup_url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, setup_url):
assert browser.get_json(setup_url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] =... | Make `url` fixture less generic | Make `url` fixture less generic
in preparation for additional endpoints
| Python | mit | grunskis/nuimo-hub-backend,grunskis/nuimo-hub-backend,getsenic/senic-hub,grunskis/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/senic-hub,getsenic/senic-hub,grunskis/senic-hub,grunskis/nuimo-hub-backend,grunskis/senic-hub,grunskis/nuimo-hub-backend | import pytest
from mock import patch
@pytest.fixture
def url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, url):
assert browser.get_json(url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/no/such/file'
... | import pytest
from mock import patch
@pytest.fixture
def setup_url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, setup_url):
assert browser.get_json(setup_url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] =... | <commit_before>import pytest
from mock import patch
@pytest.fixture
def url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, url):
assert browser.get_json(url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/... | import pytest
from mock import patch
@pytest.fixture
def setup_url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, setup_url):
assert browser.get_json(setup_url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] =... | import pytest
from mock import patch
@pytest.fixture
def url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, url):
assert browser.get_json(url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/no/such/file'
... | <commit_before>import pytest
from mock import patch
@pytest.fixture
def url(route_url):
return route_url('wifi_setup')
def test_get_scanned_wifi(browser, url):
assert browser.get_json(url).json == ['grandpausethisnetwork']
@pytest.fixture
def no_such_wifi(settings):
settings['wifi_networks_path'] = '/... |
ca53296d4f7af651905657d533ac18517531ca32 | pybloom/slidingwindow.py | pybloom/slidingwindow.py | import time
from collections import deque
from pybloom import ScalableBloomFilter
class DecayScalableBloomFilter(ScalableBloomFilter):
'''
Stepwise decaying Bloom Filter
'''
def __init__(self, initial_capacity=1000, error_rate=0.01, window_period = 60):
super(DecayScalableBloomFilter, self)._... | Add simple SlidingWindowScalableBloomFilter for combating overengineer habit | Add simple SlidingWindowScalableBloomFilter for combating overengineer habit
| Python | mit | Parsely/python-bloomfilter | Add simple SlidingWindowScalableBloomFilter for combating overengineer habit | import time
from collections import deque
from pybloom import ScalableBloomFilter
class DecayScalableBloomFilter(ScalableBloomFilter):
'''
Stepwise decaying Bloom Filter
'''
def __init__(self, initial_capacity=1000, error_rate=0.01, window_period = 60):
super(DecayScalableBloomFilter, self)._... | <commit_before><commit_msg>Add simple SlidingWindowScalableBloomFilter for combating overengineer habit<commit_after> | import time
from collections import deque
from pybloom import ScalableBloomFilter
class DecayScalableBloomFilter(ScalableBloomFilter):
'''
Stepwise decaying Bloom Filter
'''
def __init__(self, initial_capacity=1000, error_rate=0.01, window_period = 60):
super(DecayScalableBloomFilter, self)._... | Add simple SlidingWindowScalableBloomFilter for combating overengineer habitimport time
from collections import deque
from pybloom import ScalableBloomFilter
class DecayScalableBloomFilter(ScalableBloomFilter):
'''
Stepwise decaying Bloom Filter
'''
def __init__(self, initial_capacity=1000, error_rat... | <commit_before><commit_msg>Add simple SlidingWindowScalableBloomFilter for combating overengineer habit<commit_after>import time
from collections import deque
from pybloom import ScalableBloomFilter
class DecayScalableBloomFilter(ScalableBloomFilter):
'''
Stepwise decaying Bloom Filter
'''
def __init... | |
e7e30eaebf3075df3c965d700352506f52be10ef | test.py | test.py | import usb.core
import usb.util
import binascii,time
reset=[binascii.unhexlify('06cb150010000000')]
rainb=[binascii.unhexlify('06cd080800000000')]
color=[binascii.unhexlify('06cd080100000000'), #red
binascii.unhexlify('06cd080200000000'),#yellow
binascii.unhexlify('06cd080300000000'),#green
... | Test file that "programs" the mouse.It switches between colors and can reset the programming | Test file that "programs" the mouse.It switches between colors and can reset the programming
| Python | mit | BlackLotus/mx1200py | Test file that "programs" the mouse.It switches between colors and can reset the programming | import usb.core
import usb.util
import binascii,time
reset=[binascii.unhexlify('06cb150010000000')]
rainb=[binascii.unhexlify('06cd080800000000')]
color=[binascii.unhexlify('06cd080100000000'), #red
binascii.unhexlify('06cd080200000000'),#yellow
binascii.unhexlify('06cd080300000000'),#green
... | <commit_before><commit_msg>Test file that "programs" the mouse.It switches between colors and can reset the programming<commit_after> | import usb.core
import usb.util
import binascii,time
reset=[binascii.unhexlify('06cb150010000000')]
rainb=[binascii.unhexlify('06cd080800000000')]
color=[binascii.unhexlify('06cd080100000000'), #red
binascii.unhexlify('06cd080200000000'),#yellow
binascii.unhexlify('06cd080300000000'),#green
... | Test file that "programs" the mouse.It switches between colors and can reset the programmingimport usb.core
import usb.util
import binascii,time
reset=[binascii.unhexlify('06cb150010000000')]
rainb=[binascii.unhexlify('06cd080800000000')]
color=[binascii.unhexlify('06cd080100000000'), #red
binascii.unhexli... | <commit_before><commit_msg>Test file that "programs" the mouse.It switches between colors and can reset the programming<commit_after>import usb.core
import usb.util
import binascii,time
reset=[binascii.unhexlify('06cb150010000000')]
rainb=[binascii.unhexlify('06cd080800000000')]
color=[binascii.unhexlify('06cd08010000... | |
8d0443e7423a480c7001d0f9b59af4dc903166b3 | nodeconductor/cost_tracking/migrations/0023_consumptiondetails.py | nodeconductor/cost_tracking/migrations/0023_consumptiondetails.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import jsonfield.fields
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [
('cost_tracking', '0022_priceestimate_le... | Add DB migration for ConsumptionDetails | Add DB migration for ConsumptionDetails
- nc-1521
| Python | mit | opennode/nodeconductor,opennode/nodeconductor,opennode/nodeconductor | Add DB migration for ConsumptionDetails
- nc-1521 | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import jsonfield.fields
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [
('cost_tracking', '0022_priceestimate_le... | <commit_before><commit_msg>Add DB migration for ConsumptionDetails
- nc-1521<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import jsonfield.fields
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies = [
('cost_tracking', '0022_priceestimate_le... | Add DB migration for ConsumptionDetails
- nc-1521# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import jsonfield.fields
import model_utils.fields
import uuidfield.fields
class Migration(migrations.Migration):
dependencies =... | <commit_before><commit_msg>Add DB migration for ConsumptionDetails
- nc-1521<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import django.utils.timezone
import jsonfield.fields
import model_utils.fields
import uuidfield.fields
class Migration(m... | |
75a9315ac2bffdc4b9f22d1ea6184a369e4ddec3 | project/scripts/get_context_data.py | project/scripts/get_context_data.py | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add script for fetching context data on a new investment | Add script for fetching context data on a new investment
| Python | apache-2.0 | googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks,googleinterns/sgonks | Add script for fetching context data on a new investment | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before><commit_msg>Add script for fetching context data on a new investment<commit_after> | # Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add script for fetching context data on a new investment# Copyright 2021 Google LLC
#
# 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
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unl... | <commit_before><commit_msg>Add script for fetching context data on a new investment<commit_after># Copyright 2021 Google LLC
#
# 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
#
# https://ww... | |
66c5285cc0b5d9e29dcd511114060ffc9f17fdb1 | volunteering/migrations/0005_volunteeradded.py | volunteering/migrations/0005_volunteeradded.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('volunteering', '0004_auto_20150415_2058'),
]
operations = [
migrations.CreateModel(
name='VolunteerAdded',
... | Migrate for proxy model (should be noop) | Migrate for proxy model (should be noop)
| Python | agpl-3.0 | jesseh/dothis,jesseh/dothis,jesseh/dothis,jesseh/dothis | Migrate for proxy model (should be noop) | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('volunteering', '0004_auto_20150415_2058'),
]
operations = [
migrations.CreateModel(
name='VolunteerAdded',
... | <commit_before><commit_msg>Migrate for proxy model (should be noop)<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('volunteering', '0004_auto_20150415_2058'),
]
operations = [
migrations.CreateModel(
name='VolunteerAdded',
... | Migrate for proxy model (should be noop)# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('volunteering', '0004_auto_20150415_2058'),
]
operations = [
migrations.CreateModel(
... | <commit_before><commit_msg>Migrate for proxy model (should be noop)<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('volunteering', '0004_auto_20150415_2058'),
]
operat... | |
eeb84ac27b924903c10f6a9a1169e57b481256be | tests/Settings/TestExtruderStack.py | tests/Settings/TestExtruderStack.py | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import pytest #This module contains automated tests.
import unittest.mock #For the mocking and monkeypatching functionality.
import cura.Settings.ExtruderStack #The module we're testing.
from cura.Settings.Exceptions impor... | Add tests for prohibited operations on extruder stacks | Add tests for prohibited operations on extruder stacks
These operations are explicitly prohibited, so they should raise an exception.
Contributes to issue CURA-3497.
| Python | agpl-3.0 | hmflash/Cura,ynotstartups/Wanhao,hmflash/Cura,fieldOfView/Cura,ynotstartups/Wanhao,fieldOfView/Cura,Curahelper/Cura,Curahelper/Cura | Add tests for prohibited operations on extruder stacks
These operations are explicitly prohibited, so they should raise an exception.
Contributes to issue CURA-3497. | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import pytest #This module contains automated tests.
import unittest.mock #For the mocking and monkeypatching functionality.
import cura.Settings.ExtruderStack #The module we're testing.
from cura.Settings.Exceptions impor... | <commit_before><commit_msg>Add tests for prohibited operations on extruder stacks
These operations are explicitly prohibited, so they should raise an exception.
Contributes to issue CURA-3497.<commit_after> | # Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import pytest #This module contains automated tests.
import unittest.mock #For the mocking and monkeypatching functionality.
import cura.Settings.ExtruderStack #The module we're testing.
from cura.Settings.Exceptions impor... | Add tests for prohibited operations on extruder stacks
These operations are explicitly prohibited, so they should raise an exception.
Contributes to issue CURA-3497.# Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import pytest #This module contains automated tests.
imp... | <commit_before><commit_msg>Add tests for prohibited operations on extruder stacks
These operations are explicitly prohibited, so they should raise an exception.
Contributes to issue CURA-3497.<commit_after># Copyright (c) 2017 Ultimaker B.V.
# Cura is released under the terms of the AGPLv3 or higher.
import pytest #... | |
67cee2591ab0aa41ff51a327a55fa3dff136652e | will/tests/test_acl.py | will/tests/test_acl.py | import unittest
from will.mixins.roster import RosterMixin
from will import settings
from mock import patch
class TestIsAdmin(unittest.TestCase):
def setUp(self):
self.message = {'nick': 'WoOh'}
@patch('will.mixins.roster.RosterMixin.get_user_from_message')
def test_message_is_from_admin_true_if... | Cover current ACL with tests | Cover current ACL with tests
| Python | mit | fredsmith/will,wontonst/will,brandonsturgeon/will,ammartins/will,ammartins/will,woohgit/will,ammartins/will,jacobbridges/will,Ironykins/will,woohgit/will,jacobbridges/will,shadow7412/will,mvanbaak/will,mvanbaak/will,mike-love/will,chillipeper/will,mvanbaak/will,dmuntean/will,fredsmith/will,grahamhayes/will,wontonst/wil... | Cover current ACL with tests | import unittest
from will.mixins.roster import RosterMixin
from will import settings
from mock import patch
class TestIsAdmin(unittest.TestCase):
def setUp(self):
self.message = {'nick': 'WoOh'}
@patch('will.mixins.roster.RosterMixin.get_user_from_message')
def test_message_is_from_admin_true_if... | <commit_before><commit_msg>Cover current ACL with tests<commit_after> | import unittest
from will.mixins.roster import RosterMixin
from will import settings
from mock import patch
class TestIsAdmin(unittest.TestCase):
def setUp(self):
self.message = {'nick': 'WoOh'}
@patch('will.mixins.roster.RosterMixin.get_user_from_message')
def test_message_is_from_admin_true_if... | Cover current ACL with testsimport unittest
from will.mixins.roster import RosterMixin
from will import settings
from mock import patch
class TestIsAdmin(unittest.TestCase):
def setUp(self):
self.message = {'nick': 'WoOh'}
@patch('will.mixins.roster.RosterMixin.get_user_from_message')
def test_m... | <commit_before><commit_msg>Cover current ACL with tests<commit_after>import unittest
from will.mixins.roster import RosterMixin
from will import settings
from mock import patch
class TestIsAdmin(unittest.TestCase):
def setUp(self):
self.message = {'nick': 'WoOh'}
@patch('will.mixins.roster.RosterMix... | |
5207550b9d19ff6823fb641e86e4851106ebd7f1 | bench/run-paper-nums.py | bench/run-paper-nums.py | #!/usr/bin/env python
devices = [
("hdd", "/dev/sdc1"),
("ssd-sam", "/dev/sdb1"),
("sdd-intel", "/dev/sdd2"),
("ram", "/dev/loop0"),
]
benches = [
("smallfile", "./smallfile /tmp/ft"),
("smallsync", "./smallsync /tmp/ft"),
("largefile", "./largefile /tmp/ft"),
... | Add script to run benchmarks for paper | Add script to run benchmarks for paper
| Python | mit | mit-pdos/fscq-impl,mit-pdos/fscq-impl,mit-pdos/fscq-impl,mit-pdos/fscq-impl,mit-pdos/fscq-impl | Add script to run benchmarks for paper | #!/usr/bin/env python
devices = [
("hdd", "/dev/sdc1"),
("ssd-sam", "/dev/sdb1"),
("sdd-intel", "/dev/sdd2"),
("ram", "/dev/loop0"),
]
benches = [
("smallfile", "./smallfile /tmp/ft"),
("smallsync", "./smallsync /tmp/ft"),
("largefile", "./largefile /tmp/ft"),
... | <commit_before><commit_msg>Add script to run benchmarks for paper<commit_after> | #!/usr/bin/env python
devices = [
("hdd", "/dev/sdc1"),
("ssd-sam", "/dev/sdb1"),
("sdd-intel", "/dev/sdd2"),
("ram", "/dev/loop0"),
]
benches = [
("smallfile", "./smallfile /tmp/ft"),
("smallsync", "./smallsync /tmp/ft"),
("largefile", "./largefile /tmp/ft"),
... | Add script to run benchmarks for paper#!/usr/bin/env python
devices = [
("hdd", "/dev/sdc1"),
("ssd-sam", "/dev/sdb1"),
("sdd-intel", "/dev/sdd2"),
("ram", "/dev/loop0"),
]
benches = [
("smallfile", "./smallfile /tmp/ft"),
("smallsync", "./smallsync /tmp/ft"),
("la... | <commit_before><commit_msg>Add script to run benchmarks for paper<commit_after>#!/usr/bin/env python
devices = [
("hdd", "/dev/sdc1"),
("ssd-sam", "/dev/sdb1"),
("sdd-intel", "/dev/sdd2"),
("ram", "/dev/loop0"),
]
benches = [
("smallfile", "./smallfile /tmp/ft"),
("sma... | |
4ecad80ff60f9964e4027a02d9382b7505d8386a | pullpush/GitPython-Daemon-Example.py | pullpush/GitPython-Daemon-Example.py | #!/usr/bin/env python3
import git
import tempfile
import time
tmpdir = tempfile.TemporaryDirectory(suffix='.git')
repo = git.Repo.init(tmpdir.name, shared=True, bare=True)
repo.daemon_export = True
gd = git.Git().daemon(tmpdir.name,
enable='receive-pack',
listen='127.0.0... | Add Example for Git Deamon. | Add Example for Git Deamon.
This can now be used in the unittests
| Python | mit | martialblog/git-pullpush | Add Example for Git Deamon.
This can now be used in the unittests | #!/usr/bin/env python3
import git
import tempfile
import time
tmpdir = tempfile.TemporaryDirectory(suffix='.git')
repo = git.Repo.init(tmpdir.name, shared=True, bare=True)
repo.daemon_export = True
gd = git.Git().daemon(tmpdir.name,
enable='receive-pack',
listen='127.0.0... | <commit_before><commit_msg>Add Example for Git Deamon.
This can now be used in the unittests<commit_after> | #!/usr/bin/env python3
import git
import tempfile
import time
tmpdir = tempfile.TemporaryDirectory(suffix='.git')
repo = git.Repo.init(tmpdir.name, shared=True, bare=True)
repo.daemon_export = True
gd = git.Git().daemon(tmpdir.name,
enable='receive-pack',
listen='127.0.0... | Add Example for Git Deamon.
This can now be used in the unittests#!/usr/bin/env python3
import git
import tempfile
import time
tmpdir = tempfile.TemporaryDirectory(suffix='.git')
repo = git.Repo.init(tmpdir.name, shared=True, bare=True)
repo.daemon_export = True
gd = git.Git().daemon(tmpdir.name,
... | <commit_before><commit_msg>Add Example for Git Deamon.
This can now be used in the unittests<commit_after>#!/usr/bin/env python3
import git
import tempfile
import time
tmpdir = tempfile.TemporaryDirectory(suffix='.git')
repo = git.Repo.init(tmpdir.name, shared=True, bare=True)
repo.daemon_export = True
gd = git.G... | |
9c88eb5994ac33e72fad750b46de84c7de38328e | ChannelWorm/adapters.py | ChannelWorm/adapters.py | # configure django to use default settings
# note that this can also be done using an environment variable
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if hasattr(settings, 'DEBUG'):
# settings are configured already
pass
else:
# load default settings if they're ... | Fix configuration imports. Adapter now works. | Fix configuration imports. Adapter now works.
| Python | mit | joebowen/ChannelWorm,VahidGh/ChannelWorm,cheelee/ChannelWorm,openworm/ChannelWorm,cheelee/ChannelWorm,cheelee/ChannelWorm,gsarma/ChannelWorm,gsarma/ChannelWorm,gsarma/ChannelWorm,joebowen/ChannelWorm,joebowen/ChannelWorm,openworm/ChannelWorm,joebowen/ChannelWorm,VahidGh/ChannelWorm,gsarma/ChannelWorm,openworm/ChannelWo... | Fix configuration imports. Adapter now works. | # configure django to use default settings
# note that this can also be done using an environment variable
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if hasattr(settings, 'DEBUG'):
# settings are configured already
pass
else:
# load default settings if they're ... | <commit_before><commit_msg>Fix configuration imports. Adapter now works.<commit_after> | # configure django to use default settings
# note that this can also be done using an environment variable
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if hasattr(settings, 'DEBUG'):
# settings are configured already
pass
else:
# load default settings if they're ... | Fix configuration imports. Adapter now works.# configure django to use default settings
# note that this can also be done using an environment variable
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if hasattr(settings, 'DEBUG'):
# settings are configured already
pass
... | <commit_before><commit_msg>Fix configuration imports. Adapter now works.<commit_after># configure django to use default settings
# note that this can also be done using an environment variable
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
if hasattr(settings, 'DEBUG'):
# ... | |
1418112d0ba752d3ebac6cdf2d727fdd71a2cf6f | test/unit/interfaces/test_map_ctp.py | test/unit/interfaces/test_map_ctp.py | import sys, os, re, shutil
from nose.tools import *
import logging
logger = logging.getLogger(__name__)
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from qipipe.interfaces import MapCTP
ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
"""The test parent director... | Test the Map CTP interface. | Test the Map CTP interface.
| Python | bsd-2-clause | ohsu-qin/qipipe | Test the Map CTP interface. | import sys, os, re, shutil
from nose.tools import *
import logging
logger = logging.getLogger(__name__)
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from qipipe.interfaces import MapCTP
ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
"""The test parent director... | <commit_before><commit_msg>Test the Map CTP interface.<commit_after> | import sys, os, re, shutil
from nose.tools import *
import logging
logger = logging.getLogger(__name__)
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from qipipe.interfaces import MapCTP
ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
"""The test parent director... | Test the Map CTP interface.import sys, os, re, shutil
from nose.tools import *
import logging
logger = logging.getLogger(__name__)
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from qipipe.interfaces import MapCTP
ROOT = os.path.normpath(os.path.join(os.path.dirname(__file__), '..', '..'))
... | <commit_before><commit_msg>Test the Map CTP interface.<commit_after>import sys, os, re, shutil
from nose.tools import *
import logging
logger = logging.getLogger(__name__)
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', '..'))
from qipipe.interfaces import MapCTP
ROOT = os.path.normpath(os.path.join... | |
5096f4432978ef1e5d1f3d449fd3f54050f3c287 | test/widgets/test_wlan.py | test/widgets/test_wlan.py | # Copyright (c) 2021 elParaguayo
#
# 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, merge, publish, distrib... | Add test for wlan widget | Add test for wlan widget
| Python | mit | ramnes/qtile,qtile/qtile,ramnes/qtile,qtile/qtile | Add test for wlan widget | # Copyright (c) 2021 elParaguayo
#
# 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, merge, publish, distrib... | <commit_before><commit_msg>Add test for wlan widget<commit_after> | # Copyright (c) 2021 elParaguayo
#
# 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, merge, publish, distrib... | Add test for wlan widget# Copyright (c) 2021 elParaguayo
#
# 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 test for wlan widget<commit_after># Copyright (c) 2021 elParaguayo
#
# 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 limi... | |
e08257d4012b6df624c88b45ba28e8f9829ce2ad | spacy/cli/_git_sparse_checkout_example.py | spacy/cli/_git_sparse_checkout_example.py | import tempfile
import typer
from pathlib import Path
import subprocess
import shlex
import shutil
from contextlib import contextmanager
@contextmanager
def make_tempdir():
d = Path(tempfile.mkdtemp())
yield d
shutil.rmtree(str(d))
def clone_repo(repo, temp_dir):
subprocess.check_call([
"gi... | Add example of how to do sparse-checkout | Add example of how to do sparse-checkout
| Python | mit | spacy-io/spaCy,spacy-io/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,honnibal/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,honnibal/spaCy,spacy-io/spaCy,explosion/spaCy,explosion/spaCy | Add example of how to do sparse-checkout | import tempfile
import typer
from pathlib import Path
import subprocess
import shlex
import shutil
from contextlib import contextmanager
@contextmanager
def make_tempdir():
d = Path(tempfile.mkdtemp())
yield d
shutil.rmtree(str(d))
def clone_repo(repo, temp_dir):
subprocess.check_call([
"gi... | <commit_before><commit_msg>Add example of how to do sparse-checkout<commit_after> | import tempfile
import typer
from pathlib import Path
import subprocess
import shlex
import shutil
from contextlib import contextmanager
@contextmanager
def make_tempdir():
d = Path(tempfile.mkdtemp())
yield d
shutil.rmtree(str(d))
def clone_repo(repo, temp_dir):
subprocess.check_call([
"gi... | Add example of how to do sparse-checkoutimport tempfile
import typer
from pathlib import Path
import subprocess
import shlex
import shutil
from contextlib import contextmanager
@contextmanager
def make_tempdir():
d = Path(tempfile.mkdtemp())
yield d
shutil.rmtree(str(d))
def clone_repo(repo, temp_dir):... | <commit_before><commit_msg>Add example of how to do sparse-checkout<commit_after>import tempfile
import typer
from pathlib import Path
import subprocess
import shlex
import shutil
from contextlib import contextmanager
@contextmanager
def make_tempdir():
d = Path(tempfile.mkdtemp())
yield d
shutil.rmtree(s... | |
f3c047a39f3d8438487ab31764d82afb7a86524e | apps/api/permissions.py | apps/api/permissions.py | from oauth2_provider.ext.rest_framework import TokenHasScope
from rest_framework.permissions import DjangoObjectPermissions
class TokenHasScopeOrUserHasObjectPermissionsOrWriteOnly(DjangoObjectPermissions, TokenHasScope):
"""
Allow anyone to write to this endpoint, but only the ones with the required scope to... | Add API permission class for HasScopeOrWriteOnly | Add API permission class for HasScopeOrWriteOnly
| Python | mit | dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4,dotKom/onlineweb4 | Add API permission class for HasScopeOrWriteOnly | from oauth2_provider.ext.rest_framework import TokenHasScope
from rest_framework.permissions import DjangoObjectPermissions
class TokenHasScopeOrUserHasObjectPermissionsOrWriteOnly(DjangoObjectPermissions, TokenHasScope):
"""
Allow anyone to write to this endpoint, but only the ones with the required scope to... | <commit_before><commit_msg>Add API permission class for HasScopeOrWriteOnly<commit_after> | from oauth2_provider.ext.rest_framework import TokenHasScope
from rest_framework.permissions import DjangoObjectPermissions
class TokenHasScopeOrUserHasObjectPermissionsOrWriteOnly(DjangoObjectPermissions, TokenHasScope):
"""
Allow anyone to write to this endpoint, but only the ones with the required scope to... | Add API permission class for HasScopeOrWriteOnlyfrom oauth2_provider.ext.rest_framework import TokenHasScope
from rest_framework.permissions import DjangoObjectPermissions
class TokenHasScopeOrUserHasObjectPermissionsOrWriteOnly(DjangoObjectPermissions, TokenHasScope):
"""
Allow anyone to write to this endpoi... | <commit_before><commit_msg>Add API permission class for HasScopeOrWriteOnly<commit_after>from oauth2_provider.ext.rest_framework import TokenHasScope
from rest_framework.permissions import DjangoObjectPermissions
class TokenHasScopeOrUserHasObjectPermissionsOrWriteOnly(DjangoObjectPermissions, TokenHasScope):
"""... | |
5ac528eff7c5cb49e329de720cbabc2ac89fc50c | ideascube/conf/kb_bdi_tv5monde.py | ideascube/conf/kb_bdi_tv5monde.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'TV5 Monde Burundi'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutemberg',
},
{
'id': 'khanacademy',
}... | Add conf file for TV5 Monde Burundi | Add conf file for TV5 Monde Burundi
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | Add conf file for TV5 Monde Burundi | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'TV5 Monde Burundi'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutemberg',
},
{
'id': 'khanacademy',
}... | <commit_before><commit_msg>Add conf file for TV5 Monde Burundi<commit_after> | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'TV5 Monde Burundi'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutemberg',
},
{
'id': 'khanacademy',
}... | Add conf file for TV5 Monde Burundi# -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'TV5 Monde Burundi'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
{
'id': 'gutemberg',
},
{... | <commit_before><commit_msg>Add conf file for TV5 Monde Burundi<commit_after># -*- coding: utf-8 -*-
"""KoomBook conf"""
from .kb import * # noqa
LANGUAGE_CODE = 'fr'
IDEASCUBE_NAME = 'TV5 Monde Burundi'
HOME_CARDS = STAFF_HOME_CARDS + [
{
'id': 'blog',
},
{
'id': 'mediacenter',
},
... | |
c3dd34a6fa80be8a90d178e3e0d28716583f9a9a | src/data_collection/FaceCollector_Main.py | src/data_collection/FaceCollector_Main.py | import cv2, sys, os, time, logging
video = cv2.VideoCapture(0)
while True:
ret, cameraFrame = video.read()
if not ret:
exit()
cv2.imshow("Live Video", cameraFrame)
continue
| Test the webcam with cv2 | Test the webcam with cv2
| Python | apache-2.0 | xphongvn/smart-attendance-system-ta,xphongvn/smart-attendance-system-ta,xphongvn/smart-attendance-system-ta | Test the webcam with cv2 | import cv2, sys, os, time, logging
video = cv2.VideoCapture(0)
while True:
ret, cameraFrame = video.read()
if not ret:
exit()
cv2.imshow("Live Video", cameraFrame)
continue
| <commit_before><commit_msg>Test the webcam with cv2<commit_after> | import cv2, sys, os, time, logging
video = cv2.VideoCapture(0)
while True:
ret, cameraFrame = video.read()
if not ret:
exit()
cv2.imshow("Live Video", cameraFrame)
continue
| Test the webcam with cv2import cv2, sys, os, time, logging
video = cv2.VideoCapture(0)
while True:
ret, cameraFrame = video.read()
if not ret:
exit()
cv2.imshow("Live Video", cameraFrame)
continue
| <commit_before><commit_msg>Test the webcam with cv2<commit_after>import cv2, sys, os, time, logging
video = cv2.VideoCapture(0)
while True:
ret, cameraFrame = video.read()
if not ret:
exit()
cv2.imshow("Live Video", cameraFrame)
continue
| |
c3b286db4dd39cbe81b81e374819cba1fab2df13 | ideascube/conf/kb_mooc_cog.py | ideascube/conf/kb_mooc_cog.py | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .base import * # noqa
from django.utils.translation import ugettext_lazy as _
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(os.environ.get('DEBUG', True))
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.koombook.lan.', 'localhost', '127.0... | Add conf file for MOOC RDC | Add conf file for MOOC RDC
| Python | agpl-3.0 | ideascube/ideascube,ideascube/ideascube,ideascube/ideascube,ideascube/ideascube | Add conf file for MOOC RDC | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .base import * # noqa
from django.utils.translation import ugettext_lazy as _
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(os.environ.get('DEBUG', True))
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.koombook.lan.', 'localhost', '127.0... | <commit_before><commit_msg>Add conf file for MOOC RDC<commit_after> | # -*- coding: utf-8 -*-
"""KoomBook conf"""
from .base import * # noqa
from django.utils.translation import ugettext_lazy as _
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(os.environ.get('DEBUG', True))
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.koombook.lan.', 'localhost', '127.0... | Add conf file for MOOC RDC# -*- coding: utf-8 -*-
"""KoomBook conf"""
from .base import * # noqa
from django.utils.translation import ugettext_lazy as _
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(os.environ.get('DEBUG', True))
TEMPLATE_DEBUG = False
ALLOWED_HOSTS = ['.koombook.... | <commit_before><commit_msg>Add conf file for MOOC RDC<commit_after># -*- coding: utf-8 -*-
"""KoomBook conf"""
from .base import * # noqa
from django.utils.translation import ugettext_lazy as _
# SECURITY WARNING: don't run with debug turned on in production!
DEBUG = bool(os.environ.get('DEBUG', True))
TEMPLATE_DE... | |
e082c56ef5629924e3d760fb86eff182cc3579a5 | misc/make-msi-package.py | misc/make-msi-package.py | # Copyright 2016, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | Add script to only create the MSI package. | Release: Add script to only create the MSI package.
* This is for external CI to produce MSI packages instead of my
internal one.
| Python | apache-2.0 | kayhayen/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka,kayhayen/Nuitka | Release: Add script to only create the MSI package.
* This is for external CI to produce MSI packages instead of my
internal one. | # Copyright 2016, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | <commit_before><commit_msg>Release: Add script to only create the MSI package.
* This is for external CI to produce MSI packages instead of my
internal one.<commit_after> | # Copyright 2016, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on its own.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in complianc... | Release: Add script to only create the MSI package.
* This is for external CI to produce MSI packages instead of my
internal one.# Copyright 2016, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# integrates with CPython, but also works on ... | <commit_before><commit_msg>Release: Add script to only create the MSI package.
* This is for external CI to produce MSI packages instead of my
internal one.<commit_after># Copyright 2016, Kay Hayen, mailto:[email protected]
#
# Part of "Nuitka", an optimizing Python compiler that is compatible and
# in... | |
2c14466740a53619acc34a8599dfcd2ff3244db6 | src/proposals/tests/test_management.py | src/proposals/tests/test_management.py | from datetime import timedelta
import re
import pytest
from django.utils.timezone import now
from django.core.management import call_command
from proposals.models import TalkProposal
@pytest.fixture()
def weekago_talk_proposal(user):
dt_weekago = now() - timedelta(weeks=1)
proposal = TalkProposal.objects.cr... | Add unittest for command recent_proposals | Add unittest for command recent_proposals
| Python | mit | pycontw/pycontw2016,uranusjr/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,pycontw/pycontw2016,uranusjr/pycontw2016,uranusjr/pycontw2016,uranusjr/pycontw2016 | Add unittest for command recent_proposals | from datetime import timedelta
import re
import pytest
from django.utils.timezone import now
from django.core.management import call_command
from proposals.models import TalkProposal
@pytest.fixture()
def weekago_talk_proposal(user):
dt_weekago = now() - timedelta(weeks=1)
proposal = TalkProposal.objects.cr... | <commit_before><commit_msg>Add unittest for command recent_proposals<commit_after> | from datetime import timedelta
import re
import pytest
from django.utils.timezone import now
from django.core.management import call_command
from proposals.models import TalkProposal
@pytest.fixture()
def weekago_talk_proposal(user):
dt_weekago = now() - timedelta(weeks=1)
proposal = TalkProposal.objects.cr... | Add unittest for command recent_proposalsfrom datetime import timedelta
import re
import pytest
from django.utils.timezone import now
from django.core.management import call_command
from proposals.models import TalkProposal
@pytest.fixture()
def weekago_talk_proposal(user):
dt_weekago = now() - timedelta(weeks=... | <commit_before><commit_msg>Add unittest for command recent_proposals<commit_after>from datetime import timedelta
import re
import pytest
from django.utils.timezone import now
from django.core.management import call_command
from proposals.models import TalkProposal
@pytest.fixture()
def weekago_talk_proposal(user):
... | |
0e00742cf60285fc6d45ec5762e00d439ba61ddd | IVoiSysAuthorisation.py | IVoiSysAuthorisation.py | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | Add class specific for IVoiSys to do DB auth. | Add class specific for IVoiSys to do DB auth.
| Python | bsd-2-clause | jevonearth/rtpproxy,jevonearth/rtpproxy,dsanders11/rtpproxy,sippy/rtpproxy,dsanders11/rtpproxy,synety-jdebp/rtpproxy,jevonearth/rtpproxy,sippy/rtp_cluster,synety-jdebp/rtpproxy,jevonearth/rtpproxy,dsanders11/rtpproxy,sippy/rtpproxy,sippy/rtpproxy,synety-jdebp/rtpproxy,synety-jdebp/rtpproxy,sippy/rtp_cluster | Add class specific for IVoiSys to do DB auth. | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | <commit_before><commit_msg>Add class specific for IVoiSys to do DB auth.<commit_after> | # Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License a... | Add class specific for IVoiSys to do DB auth.# Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can redistribute it and/or modify
# it under ... | <commit_before><commit_msg>Add class specific for IVoiSys to do DB auth.<commit_after># Copyright (c) 2003-2005 Maxim Sobolev. All rights reserved.
# Copyright (c) 2006-2007 Sippy Software, Inc. All rights reserved.
#
# This file is part of SIPPY, a free RFC3261 SIP stack and B2BUA.
#
# SIPPY is free software; you can ... | |
f51623142dfc089aeb46e986b1d0382f3fab3025 | test/test_producer.py | test/test_producer.py | import pytest
from kafka import KafkaConsumer, KafkaProducer
from test.conftest import version
from test.testutil import random_string
@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
def test_end_to_end(kafka_broker):
connect_str = 'localhost:' + str(kafka_broker.port)
producer = KafkaProdu... | Add simple KafkaProducer -> KafkaConsumer integration test | Add simple KafkaProducer -> KafkaConsumer integration test
| Python | apache-2.0 | wikimedia/operations-debs-python-kafka,zackdever/kafka-python,ohmu/kafka-python,mumrah/kafka-python,scrapinghub/kafka-python,dpkp/kafka-python,Yelp/kafka-python,mumrah/kafka-python,DataDog/kafka-python,scrapinghub/kafka-python,zackdever/kafka-python,wikimedia/operations-debs-python-kafka,Yelp/kafka-python,ohmu/kafka-py... | Add simple KafkaProducer -> KafkaConsumer integration test | import pytest
from kafka import KafkaConsumer, KafkaProducer
from test.conftest import version
from test.testutil import random_string
@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
def test_end_to_end(kafka_broker):
connect_str = 'localhost:' + str(kafka_broker.port)
producer = KafkaProdu... | <commit_before><commit_msg>Add simple KafkaProducer -> KafkaConsumer integration test<commit_after> | import pytest
from kafka import KafkaConsumer, KafkaProducer
from test.conftest import version
from test.testutil import random_string
@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
def test_end_to_end(kafka_broker):
connect_str = 'localhost:' + str(kafka_broker.port)
producer = KafkaProdu... | Add simple KafkaProducer -> KafkaConsumer integration testimport pytest
from kafka import KafkaConsumer, KafkaProducer
from test.conftest import version
from test.testutil import random_string
@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
def test_end_to_end(kafka_broker):
connect_str = 'loca... | <commit_before><commit_msg>Add simple KafkaProducer -> KafkaConsumer integration test<commit_after>import pytest
from kafka import KafkaConsumer, KafkaProducer
from test.conftest import version
from test.testutil import random_string
@pytest.mark.skipif(not version(), reason="No KAFKA_VERSION set")
def test_end_to_e... | |
30c927a6a35f3a6f8d4f11ff4e4a8f12431e80b5 | shuup_tests/xtheme/test_admin.py | shuup_tests/xtheme/test_admin.py | from shuup.apps.provides import override_provides
from shuup.testing.utils import apply_request_middleware
from shuup.xtheme.admin_module.views import ThemeConfigView, ThemeConfigDetailView, ThemeGuideTemplateView
from shuup_tests.xtheme.utils import FauxTheme
def test_config_view(rf, admin_user):
request = apply... | Add some xtheme admin tests | Add some xtheme admin tests
| Python | agpl-3.0 | shoopio/shoop,shoopio/shoop,shoopio/shoop | Add some xtheme admin tests | from shuup.apps.provides import override_provides
from shuup.testing.utils import apply_request_middleware
from shuup.xtheme.admin_module.views import ThemeConfigView, ThemeConfigDetailView, ThemeGuideTemplateView
from shuup_tests.xtheme.utils import FauxTheme
def test_config_view(rf, admin_user):
request = apply... | <commit_before><commit_msg>Add some xtheme admin tests<commit_after> | from shuup.apps.provides import override_provides
from shuup.testing.utils import apply_request_middleware
from shuup.xtheme.admin_module.views import ThemeConfigView, ThemeConfigDetailView, ThemeGuideTemplateView
from shuup_tests.xtheme.utils import FauxTheme
def test_config_view(rf, admin_user):
request = apply... | Add some xtheme admin testsfrom shuup.apps.provides import override_provides
from shuup.testing.utils import apply_request_middleware
from shuup.xtheme.admin_module.views import ThemeConfigView, ThemeConfigDetailView, ThemeGuideTemplateView
from shuup_tests.xtheme.utils import FauxTheme
def test_config_view(rf, admin... | <commit_before><commit_msg>Add some xtheme admin tests<commit_after>from shuup.apps.provides import override_provides
from shuup.testing.utils import apply_request_middleware
from shuup.xtheme.admin_module.views import ThemeConfigView, ThemeConfigDetailView, ThemeGuideTemplateView
from shuup_tests.xtheme.utils import F... | |
d93abe8554db7deaf318939d42214e4cf1fc0807 | tests/test_catalog.py | tests/test_catalog.py | """Objects catalog unittests."""
import unittest2 as unittest
from objects.catalog import AbstractCatalog
from objects.providers import Object
from objects.providers import Value
from objects.errors import Error
class CatalogTests(unittest.TestCase):
"""Catalog test cases."""
class Catalog(AbstractCatal... | Add some tests for catalog | Add some tests for catalog
| Python | bsd-3-clause | ets-labs/dependency_injector,ets-labs/python-dependency-injector,rmk135/objects,rmk135/dependency_injector | Add some tests for catalog | """Objects catalog unittests."""
import unittest2 as unittest
from objects.catalog import AbstractCatalog
from objects.providers import Object
from objects.providers import Value
from objects.errors import Error
class CatalogTests(unittest.TestCase):
"""Catalog test cases."""
class Catalog(AbstractCatal... | <commit_before><commit_msg>Add some tests for catalog<commit_after> | """Objects catalog unittests."""
import unittest2 as unittest
from objects.catalog import AbstractCatalog
from objects.providers import Object
from objects.providers import Value
from objects.errors import Error
class CatalogTests(unittest.TestCase):
"""Catalog test cases."""
class Catalog(AbstractCatal... | Add some tests for catalog"""Objects catalog unittests."""
import unittest2 as unittest
from objects.catalog import AbstractCatalog
from objects.providers import Object
from objects.providers import Value
from objects.errors import Error
class CatalogTests(unittest.TestCase):
"""Catalog test cases."""
c... | <commit_before><commit_msg>Add some tests for catalog<commit_after>"""Objects catalog unittests."""
import unittest2 as unittest
from objects.catalog import AbstractCatalog
from objects.providers import Object
from objects.providers import Value
from objects.errors import Error
class CatalogTests(unittest.TestCas... | |
63c20427f573d95bfc5326d0614455640123e6ed | modules/tools/extractor/extractor.py | modules/tools/extractor/extractor.py | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | Add tool to extract routing from planning debug | Add tool to extract routing from planning debug
| Python | apache-2.0 | startcode/apollo,startcode/apollo,fy2462/apollo,startcode/apollo,startcode/apollo,startcode/apollo,fy2462/apollo,fy2462/apollo,fy2462/apollo,startcode/apollo,fy2462/apollo,fy2462/apollo | Add tool to extract routing from planning debug | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | <commit_before><commit_msg>Add tool to extract routing from planning debug<commit_after> | #!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy ... | Add tool to extract routing from planning debug#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compli... | <commit_before><commit_msg>Add tool to extract routing from planning debug<commit_after>#!/usr/bin/env python
###############################################################################
# Copyright 2017 The Apollo Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# y... | |
9185f1e51c5884ac63839ba8c17ad31a44c88647 | virtool/tests/cls.py | virtool/tests/cls.py | class AuthorizedTest:
async def test_not_authorized(self, do_get):
resp = await do_get("/api/users")
assert resp.status == 403
assert await resp.json() == {
"message": "Not authorized"
}
class ProtectedTest(AuthorizedTest):
async def test_not_authorized(self, do... | Add test superclasses for authorization and permissions | Add test superclasses for authorization and permissions
| Python | mit | virtool/virtool,virtool/virtool,igboyes/virtool,igboyes/virtool | Add test superclasses for authorization and permissions | class AuthorizedTest:
async def test_not_authorized(self, do_get):
resp = await do_get("/api/users")
assert resp.status == 403
assert await resp.json() == {
"message": "Not authorized"
}
class ProtectedTest(AuthorizedTest):
async def test_not_authorized(self, do... | <commit_before><commit_msg>Add test superclasses for authorization and permissions<commit_after> | class AuthorizedTest:
async def test_not_authorized(self, do_get):
resp = await do_get("/api/users")
assert resp.status == 403
assert await resp.json() == {
"message": "Not authorized"
}
class ProtectedTest(AuthorizedTest):
async def test_not_authorized(self, do... | Add test superclasses for authorization and permissionsclass AuthorizedTest:
async def test_not_authorized(self, do_get):
resp = await do_get("/api/users")
assert resp.status == 403
assert await resp.json() == {
"message": "Not authorized"
}
class ProtectedTest(Autho... | <commit_before><commit_msg>Add test superclasses for authorization and permissions<commit_after>class AuthorizedTest:
async def test_not_authorized(self, do_get):
resp = await do_get("/api/users")
assert resp.status == 403
assert await resp.json() == {
"message": "Not authoriz... | |
f53628d7adc6a74fccbc28e2483e4360ae561438 | korail_split_ticket_checker_test.py | korail_split_ticket_checker_test.py | # -*- coding: utf-8 -*-
import unittest
import korail_split_ticket_checker
import datetime
class TestKorailSplitTickerChecker(unittest.TestCase):
def setUp(self):
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
self.date = tomorrow.strftime('%Y%m%d')
def test_get_train_routes_ktx(self):
# ... | Add a unit test for get_train_routes func. | Add a unit test for get_train_routes func.
| Python | mit | kimtree/korail-split-ticket-checker | Add a unit test for get_train_routes func. | # -*- coding: utf-8 -*-
import unittest
import korail_split_ticket_checker
import datetime
class TestKorailSplitTickerChecker(unittest.TestCase):
def setUp(self):
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
self.date = tomorrow.strftime('%Y%m%d')
def test_get_train_routes_ktx(self):
# ... | <commit_before><commit_msg>Add a unit test for get_train_routes func.<commit_after> | # -*- coding: utf-8 -*-
import unittest
import korail_split_ticket_checker
import datetime
class TestKorailSplitTickerChecker(unittest.TestCase):
def setUp(self):
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
self.date = tomorrow.strftime('%Y%m%d')
def test_get_train_routes_ktx(self):
# ... | Add a unit test for get_train_routes func.# -*- coding: utf-8 -*-
import unittest
import korail_split_ticket_checker
import datetime
class TestKorailSplitTickerChecker(unittest.TestCase):
def setUp(self):
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
self.date = tomorrow.strftime('%Y%m%d')
... | <commit_before><commit_msg>Add a unit test for get_train_routes func.<commit_after># -*- coding: utf-8 -*-
import unittest
import korail_split_ticket_checker
import datetime
class TestKorailSplitTickerChecker(unittest.TestCase):
def setUp(self):
tomorrow = datetime.datetime.now() + datetime.timedelta(days=1)
... | |
a90c15e409451bbca366c7c3994f90e61e5f726b | tests/test_start.py | tests/test_start.py | import unittest
from coilmq.server.socket_server import ThreadedStompServer
from coilmq.start import server_from_config
class GetServerTestCase(unittest.TestCase):
def test_server_from_config_default(self):
self.assertIsInstance(server_from_config(), ThreadedStompServer) | Add test for the start module | Add test for the start module
| Python | apache-2.0 | hozn/coilmq | Add test for the start module | import unittest
from coilmq.server.socket_server import ThreadedStompServer
from coilmq.start import server_from_config
class GetServerTestCase(unittest.TestCase):
def test_server_from_config_default(self):
self.assertIsInstance(server_from_config(), ThreadedStompServer) | <commit_before><commit_msg>Add test for the start module<commit_after> | import unittest
from coilmq.server.socket_server import ThreadedStompServer
from coilmq.start import server_from_config
class GetServerTestCase(unittest.TestCase):
def test_server_from_config_default(self):
self.assertIsInstance(server_from_config(), ThreadedStompServer) | Add test for the start moduleimport unittest
from coilmq.server.socket_server import ThreadedStompServer
from coilmq.start import server_from_config
class GetServerTestCase(unittest.TestCase):
def test_server_from_config_default(self):
self.assertIsInstance(server_from_config(), ThreadedStompServer) | <commit_before><commit_msg>Add test for the start module<commit_after>import unittest
from coilmq.server.socket_server import ThreadedStompServer
from coilmq.start import server_from_config
class GetServerTestCase(unittest.TestCase):
def test_server_from_config_default(self):
self.assertIsInstance(serve... | |
2f37d4f81513d6d8a783883ffa18bffc5eb3e559 | examples/various_nameservers.py | examples/various_nameservers.py | """
This example is relatively complex.
We will be creating a system in which agents will connect to different
name servers. Each name server will therefore represent a 'group' of agents.
That way, we can easily shut down all agents belonging to a group, without
interfering with the others.
"""
import time
from osbra... | Add example of various name servers from one script | Add example of various name servers from one script
| Python | apache-2.0 | opensistemas-hub/osbrain | Add example of various name servers from one script | """
This example is relatively complex.
We will be creating a system in which agents will connect to different
name servers. Each name server will therefore represent a 'group' of agents.
That way, we can easily shut down all agents belonging to a group, without
interfering with the others.
"""
import time
from osbra... | <commit_before><commit_msg>Add example of various name servers from one script<commit_after> | """
This example is relatively complex.
We will be creating a system in which agents will connect to different
name servers. Each name server will therefore represent a 'group' of agents.
That way, we can easily shut down all agents belonging to a group, without
interfering with the others.
"""
import time
from osbra... | Add example of various name servers from one script"""
This example is relatively complex.
We will be creating a system in which agents will connect to different
name servers. Each name server will therefore represent a 'group' of agents.
That way, we can easily shut down all agents belonging to a group, without
inter... | <commit_before><commit_msg>Add example of various name servers from one script<commit_after>"""
This example is relatively complex.
We will be creating a system in which agents will connect to different
name servers. Each name server will therefore represent a 'group' of agents.
That way, we can easily shut down all a... | |
9dba843bdeede54eab30e7f3b537c75965748110 | functional/tests/network/v2/test_floating_ip.py | functional/tests/network/v2/test_floating_ip.py | # 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 law or agreed to in writing, software
# d... | Add functional tests for commands of floating ip | Add functional tests for commands of floating ip
This patch add functinal tests for commands of floating ip
Change-Id: I7f29578d0e14884f21183bfb82228d2fe7b7a029
| Python | apache-2.0 | openstack/python-openstackclient,dtroyer/python-openstackclient,dtroyer/python-openstackclient,redhat-openstack/python-openstackclient,openstack/python-openstackclient,redhat-openstack/python-openstackclient | Add functional tests for commands of floating ip
This patch add functinal tests for commands of floating ip
Change-Id: I7f29578d0e14884f21183bfb82228d2fe7b7a029 | # 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 law or agreed to in writing, software
# d... | <commit_before><commit_msg>Add functional tests for commands of floating ip
This patch add functinal tests for commands of floating ip
Change-Id: I7f29578d0e14884f21183bfb82228d2fe7b7a029<commit_after> | # 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 law or agreed to in writing, software
# d... | Add functional tests for commands of floating ip
This patch add functinal tests for commands of floating ip
Change-Id: I7f29578d0e14884f21183bfb82228d2fe7b7a029# 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
# ... | <commit_before><commit_msg>Add functional tests for commands of floating ip
This patch add functinal tests for commands of floating ip
Change-Id: I7f29578d0e14884f21183bfb82228d2fe7b7a029<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in complia... | |
0e54e8ac75acbd289c2fde2d7fae486cc31ab3ab | tests/test_block_aio.py | tests/test_block_aio.py | # -*- coding: utf-8 -*-
import aiounittest
from graphenecommon.utils import parse_time
from .fixtures_aio import fixture_data, Block, BlockHeader
class Testcases(aiounittest.AsyncTestCase):
def setUp(self):
fixture_data()
async def test_block(self):
block = await Block(1)
self.assertE... | Add test for async Block | Add test for async Block
| Python | mit | xeroc/python-graphenelib | Add test for async Block | # -*- coding: utf-8 -*-
import aiounittest
from graphenecommon.utils import parse_time
from .fixtures_aio import fixture_data, Block, BlockHeader
class Testcases(aiounittest.AsyncTestCase):
def setUp(self):
fixture_data()
async def test_block(self):
block = await Block(1)
self.assertE... | <commit_before><commit_msg>Add test for async Block<commit_after> | # -*- coding: utf-8 -*-
import aiounittest
from graphenecommon.utils import parse_time
from .fixtures_aio import fixture_data, Block, BlockHeader
class Testcases(aiounittest.AsyncTestCase):
def setUp(self):
fixture_data()
async def test_block(self):
block = await Block(1)
self.assertE... | Add test for async Block# -*- coding: utf-8 -*-
import aiounittest
from graphenecommon.utils import parse_time
from .fixtures_aio import fixture_data, Block, BlockHeader
class Testcases(aiounittest.AsyncTestCase):
def setUp(self):
fixture_data()
async def test_block(self):
block = await Block... | <commit_before><commit_msg>Add test for async Block<commit_after># -*- coding: utf-8 -*-
import aiounittest
from graphenecommon.utils import parse_time
from .fixtures_aio import fixture_data, Block, BlockHeader
class Testcases(aiounittest.AsyncTestCase):
def setUp(self):
fixture_data()
async def test... | |
f6b851e14d108ae016278351cec71e76bf96ba5e | h2o-py/tests/testdir_algos/gbm/pyunit_gbm_quantiles_no_num.py | h2o-py/tests/testdir_algos/gbm/pyunit_gbm_quantiles_no_num.py | import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def gbm_quantiles_global_with_only_categorical_colums():
prostate_train = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate_train.cs... | Add test showing QuantilesGlobal works with categorical-only dataset | PUBDEV-8722: Add test showing QuantilesGlobal works with categorical-only dataset
| Python | apache-2.0 | h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3,h2oai/h2o-3 | PUBDEV-8722: Add test showing QuantilesGlobal works with categorical-only dataset | import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def gbm_quantiles_global_with_only_categorical_colums():
prostate_train = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate_train.cs... | <commit_before><commit_msg>PUBDEV-8722: Add test showing QuantilesGlobal works with categorical-only dataset<commit_after> | import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def gbm_quantiles_global_with_only_categorical_colums():
prostate_train = h2o.import_file(path=pyunit_utils.locate("smalldata/logreg/prostate_train.cs... | PUBDEV-8722: Add test showing QuantilesGlobal works with categorical-only datasetimport sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def gbm_quantiles_global_with_only_categorical_colums():
prostate_tra... | <commit_before><commit_msg>PUBDEV-8722: Add test showing QuantilesGlobal works with categorical-only dataset<commit_after>import sys, os
sys.path.insert(1, os.path.join("..","..",".."))
import h2o
from tests import pyunit_utils
from h2o.estimators.gbm import H2OGradientBoostingEstimator
def gbm_quantiles_global_with_... | |
e6dea0455e9d0d9158843b40045f3753dbdb17c2 | Orange/widgets/evaluate/tests/test_owrocanalysis.py | Orange/widgets/evaluate/tests/test_owrocanalysis.py | import unittest
import numpy
import Orange.data
import Orange.evaluation
import Orange.classification
from Orange.widgets.evaluate import owrocanalysis
class TestROC(unittest.TestCase):
def test_ROCData_from_results(self):
data = Orange.data.Table("iris")
learners = [
Orange.classifi... | Add basic tests for roc analysis utilities | owrocanalysis: Add basic tests for roc analysis utilities
| Python | bsd-2-clause | cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3,cheral/orange3 | owrocanalysis: Add basic tests for roc analysis utilities | import unittest
import numpy
import Orange.data
import Orange.evaluation
import Orange.classification
from Orange.widgets.evaluate import owrocanalysis
class TestROC(unittest.TestCase):
def test_ROCData_from_results(self):
data = Orange.data.Table("iris")
learners = [
Orange.classifi... | <commit_before><commit_msg>owrocanalysis: Add basic tests for roc analysis utilities<commit_after> | import unittest
import numpy
import Orange.data
import Orange.evaluation
import Orange.classification
from Orange.widgets.evaluate import owrocanalysis
class TestROC(unittest.TestCase):
def test_ROCData_from_results(self):
data = Orange.data.Table("iris")
learners = [
Orange.classifi... | owrocanalysis: Add basic tests for roc analysis utilitiesimport unittest
import numpy
import Orange.data
import Orange.evaluation
import Orange.classification
from Orange.widgets.evaluate import owrocanalysis
class TestROC(unittest.TestCase):
def test_ROCData_from_results(self):
data = Orange.data.Table... | <commit_before><commit_msg>owrocanalysis: Add basic tests for roc analysis utilities<commit_after>import unittest
import numpy
import Orange.data
import Orange.evaluation
import Orange.classification
from Orange.widgets.evaluate import owrocanalysis
class TestROC(unittest.TestCase):
def test_ROCData_from_result... | |
d5ef19d5e024fb68d4781fb78ec6136e28904ae5 | tools/valouev2kmers.py | tools/valouev2kmers.py | # Takes a file in the format used by Valouev and extracts k-mers as new maps
import sys
import numpy as np
k = 12 # window size ... | Add script for doing OPTIMA-overlap queries | Add script for doing OPTIMA-overlap queries | Python | mit | mmuggli/doppelganger,mmuggli/KOHDISTA,mmuggli/KOHDISTA,mmuggli/KOHDISTA,mmuggli/doppelganger,mmuggli/KOHDISTA,mmuggli/doppelganger,mmuggli/doppelganger | Add script for doing OPTIMA-overlap queries | # Takes a file in the format used by Valouev and extracts k-mers as new maps
import sys
import numpy as np
k = 12 # window size ... | <commit_before><commit_msg>Add script for doing OPTIMA-overlap queries<commit_after> | # Takes a file in the format used by Valouev and extracts k-mers as new maps
import sys
import numpy as np
k = 12 # window size ... | Add script for doing OPTIMA-overlap queries# Takes a file in the format used by Valouev and extracts k-mers as new maps
import sys
import numpy as np
k = 12 # window size ... | <commit_before><commit_msg>Add script for doing OPTIMA-overlap queries<commit_after># Takes a file in the format used by Valouev and extracts k-mers as new maps
import sys
import numpy as np
k = 12 # window size ... | |
288305839dab0f5a54bf3bed5a3a55849afadfff | migrations/versions/470_remove_old_imported_buyer_accounts.py | migrations/versions/470_remove_old_imported_buyer_accounts.py | """Remove old imported buyer accounts
Revision ID: 470
Revises: 460
Create Date: 2016-01-22 16:20:29.793439
"""
# revision identifiers, used by Alembic.
revision = '470'
down_revision = '460'
from alembic import op
def upgrade():
op.execute("""
DELETE FROM users
WHERE users.role = 'buyer';
... | Add a migration to remove old imported buyer accounts | Add a migration to remove old imported buyer accounts
Users with a "buyer" role were imported from the Grails app and are
a mix of buyer and supplier users. We used to convert them to supplier
accounts during registration, but now that we're planning to open buyer
registration for valid buyers we're going to delete al... | Python | mit | alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api,alphagov/digitalmarketplace-api | Add a migration to remove old imported buyer accounts
Users with a "buyer" role were imported from the Grails app and are
a mix of buyer and supplier users. We used to convert them to supplier
accounts during registration, but now that we're planning to open buyer
registration for valid buyers we're going to delete al... | """Remove old imported buyer accounts
Revision ID: 470
Revises: 460
Create Date: 2016-01-22 16:20:29.793439
"""
# revision identifiers, used by Alembic.
revision = '470'
down_revision = '460'
from alembic import op
def upgrade():
op.execute("""
DELETE FROM users
WHERE users.role = 'buyer';
... | <commit_before><commit_msg>Add a migration to remove old imported buyer accounts
Users with a "buyer" role were imported from the Grails app and are
a mix of buyer and supplier users. We used to convert them to supplier
accounts during registration, but now that we're planning to open buyer
registration for valid buye... | """Remove old imported buyer accounts
Revision ID: 470
Revises: 460
Create Date: 2016-01-22 16:20:29.793439
"""
# revision identifiers, used by Alembic.
revision = '470'
down_revision = '460'
from alembic import op
def upgrade():
op.execute("""
DELETE FROM users
WHERE users.role = 'buyer';
... | Add a migration to remove old imported buyer accounts
Users with a "buyer" role were imported from the Grails app and are
a mix of buyer and supplier users. We used to convert them to supplier
accounts during registration, but now that we're planning to open buyer
registration for valid buyers we're going to delete al... | <commit_before><commit_msg>Add a migration to remove old imported buyer accounts
Users with a "buyer" role were imported from the Grails app and are
a mix of buyer and supplier users. We used to convert them to supplier
accounts during registration, but now that we're planning to open buyer
registration for valid buye... | |
b1c8d27d2fdb44a98b33176bf7b14ef6d2d889d2 | scripts/add-extension.py | scripts/add-extension.py | #!/usr/bin/env python
# Note, you need to pip install python-magic to use this.
import magic
import os
import sys
def fix_with_magic(filename):
base, ext = os.path.splitext(filename)
if ext:
print "skipping {}".format(filename)
return
result = magic.from_file(filename, mime=True)
if ... | Add script to add extension based on mimetype | Add script to add extension based on mimetype
| Python | bsd-3-clause | shaleh/useful-things,shaleh/useful-things | Add script to add extension based on mimetype | #!/usr/bin/env python
# Note, you need to pip install python-magic to use this.
import magic
import os
import sys
def fix_with_magic(filename):
base, ext = os.path.splitext(filename)
if ext:
print "skipping {}".format(filename)
return
result = magic.from_file(filename, mime=True)
if ... | <commit_before><commit_msg>Add script to add extension based on mimetype<commit_after> | #!/usr/bin/env python
# Note, you need to pip install python-magic to use this.
import magic
import os
import sys
def fix_with_magic(filename):
base, ext = os.path.splitext(filename)
if ext:
print "skipping {}".format(filename)
return
result = magic.from_file(filename, mime=True)
if ... | Add script to add extension based on mimetype#!/usr/bin/env python
# Note, you need to pip install python-magic to use this.
import magic
import os
import sys
def fix_with_magic(filename):
base, ext = os.path.splitext(filename)
if ext:
print "skipping {}".format(filename)
return
result =... | <commit_before><commit_msg>Add script to add extension based on mimetype<commit_after>#!/usr/bin/env python
# Note, you need to pip install python-magic to use this.
import magic
import os
import sys
def fix_with_magic(filename):
base, ext = os.path.splitext(filename)
if ext:
print "skipping {}".form... | |
3da85702dc841c53d73ef890cec040dcb6a51812 | utils/event_matcher.py | utils/event_matcher.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
def is_matching_event(play, event):
"""
Checks whether specified play (retrieved from json data) and database event
match.
"""
if play['play_type'] == 'PENL':
return is_matching_penalty_even... | Add utility functions to distinguish events with same type/time | Add utility functions to distinguish events with same type/time
| Python | mit | leaffan/pynhldb | Add utility functions to distinguish events with same type/time | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
def is_matching_event(play, event):
"""
Checks whether specified play (retrieved from json data) and database event
match.
"""
if play['play_type'] == 'PENL':
return is_matching_penalty_even... | <commit_before><commit_msg>Add utility functions to distinguish events with same type/time<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
def is_matching_event(play, event):
"""
Checks whether specified play (retrieved from json data) and database event
match.
"""
if play['play_type'] == 'PENL':
return is_matching_penalty_even... | Add utility functions to distinguish events with same type/time#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
def is_matching_event(play, event):
"""
Checks whether specified play (retrieved from json data) and database event
match.
"""
if play[... | <commit_before><commit_msg>Add utility functions to distinguish events with same type/time<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import logging
logger = logging.getLogger(__name__)
def is_matching_event(play, event):
"""
Checks whether specified play (retrieved from json data) and datab... | |
e46dfbd615f0d0fa8ac8d213cd053d71d7b42024 | migrations/versions/201609141652_55d523872c43_add_abstract_fks.py | migrations/versions/201609141652_55d523872c43_add_abstract_fks.py | """Add abstract FKs
Revision ID: 55d523872c43
Revises: 2ce1756a2f12
Create Date: 2016-09-14 16:52:29.196932
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '55d523872c43'
down_revision = '2ce1756a2f12'
def upgrade():
op.create_foreign_key(None,
'abstrac... | Add alembic revision to create FKs | Add alembic revision to create FKs
To be run AFTER running the zodbimporter
| Python | mit | DirkHoffmann/indico,DirkHoffmann/indico,ThiefMaster/indico,mvidalgarcia/indico,mic4ael/indico,mic4ael/indico,pferreir/indico,indico/indico,DirkHoffmann/indico,OmeGak/indico,indico/indico,indico/indico,pferreir/indico,mvidalgarcia/indico,mic4ael/indico,DirkHoffmann/indico,ThiefMaster/indico,mic4ael/indico,pferreir/indic... | Add alembic revision to create FKs
To be run AFTER running the zodbimporter | """Add abstract FKs
Revision ID: 55d523872c43
Revises: 2ce1756a2f12
Create Date: 2016-09-14 16:52:29.196932
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '55d523872c43'
down_revision = '2ce1756a2f12'
def upgrade():
op.create_foreign_key(None,
'abstrac... | <commit_before><commit_msg>Add alembic revision to create FKs
To be run AFTER running the zodbimporter<commit_after> | """Add abstract FKs
Revision ID: 55d523872c43
Revises: 2ce1756a2f12
Create Date: 2016-09-14 16:52:29.196932
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '55d523872c43'
down_revision = '2ce1756a2f12'
def upgrade():
op.create_foreign_key(None,
'abstrac... | Add alembic revision to create FKs
To be run AFTER running the zodbimporter"""Add abstract FKs
Revision ID: 55d523872c43
Revises: 2ce1756a2f12
Create Date: 2016-09-14 16:52:29.196932
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '55d523872c43'
down_revision = '2ce1756a2f12'
def u... | <commit_before><commit_msg>Add alembic revision to create FKs
To be run AFTER running the zodbimporter<commit_after>"""Add abstract FKs
Revision ID: 55d523872c43
Revises: 2ce1756a2f12
Create Date: 2016-09-14 16:52:29.196932
"""
from alembic import op
# revision identifiers, used by Alembic.
revision = '55d523872c4... | |
3b48c8a14937547f7e6cc9baa9ea37b744855739 | judge/migrations/0116_contest_curator_and_tester.py | judge/migrations/0116_contest_curator_and_tester.py | # Generated by Django 2.2.13 on 2021-04-26 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('judge', '0115_contest_scoreboard_visibility'),
]
operations = [
migrations.AlterField(
model_name='contest',
name='... | Add migration for contest curator and tester | Add migration for contest curator and tester
| Python | agpl-3.0 | DMOJ/site,DMOJ/site,DMOJ/site,DMOJ/site | Add migration for contest curator and tester | # Generated by Django 2.2.13 on 2021-04-26 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('judge', '0115_contest_scoreboard_visibility'),
]
operations = [
migrations.AlterField(
model_name='contest',
name='... | <commit_before><commit_msg>Add migration for contest curator and tester<commit_after> | # Generated by Django 2.2.13 on 2021-04-26 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('judge', '0115_contest_scoreboard_visibility'),
]
operations = [
migrations.AlterField(
model_name='contest',
name='... | Add migration for contest curator and tester# Generated by Django 2.2.13 on 2021-04-26 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('judge', '0115_contest_scoreboard_visibility'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add migration for contest curator and tester<commit_after># Generated by Django 2.2.13 on 2021-04-26 02:57
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('judge', '0115_contest_scoreboard_visibility'),
]
operations = ... | |
08293b3c679e7079e80fcb1afc1f8b26570a6f2c | mrp_subcontracting/models/mrp_routing_workcenter.py | mrp_subcontracting/models/mrp_routing_workcenter.py | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | Allow to select any type of subcontracting product | [FIX] mrp_subcontracting: Allow to select any type of subcontracting product
| Python | agpl-3.0 | diagramsoftware/odoomrp-wip,agaldona/odoomrp-wip-1,raycarnes/odoomrp-wip,alhashash/odoomrp-wip,esthermm/odoomrp-wip,odoocn/odoomrp-wip,esthermm/odoomrp-wip,oihane/odoomrp-wip,factorlibre/odoomrp-wip,xpansa/odoomrp-wip,maljac/odoomrp-wip,diagramsoftware/odoomrp-wip,dvitme/odoomrp-wip,windedge/odoomrp-wip,odoomrp/odoomrp... | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either v... | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | # -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either version 3 of the... | <commit_before># -*- encoding: utf-8 -*-
##############################################################################
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as
# published by the Free Software Foundation, either v... |
8f18bc32e84de1ce25bfcb972c6b9f1b24e0f6af | runners/test/python/sparse_codegen_test_util.py | runners/test/python/sparse_codegen_test_util.py | """Testing error handling in the common test utilities.
The module tests the error handling in the utilities we use for writing
exhaustive tests for the sparse codegen.
"""
import inspect
import sys
# Import MLIR related modules.
from mlir.dialects import sparse_tensor as st
from mlir.dialects.linalg.opdsl import la... | Add tests for the exhaustive test utilities. | [mlir][python[[sparse] Add tests for the exhaustive test utilities.
Add tests for the common utilities that we use for writing exhaustive tests for
the MLIR sparse codegen.
Simplify the relevant build rules by adding a new filegroup and moving a shared
library to an existing filegroup.
PiperOrigin-RevId: 385571670
| Python | apache-2.0 | iree-org/iree-llvm-sandbox,iree-org/iree-llvm-sandbox,iree-org/iree-llvm-sandbox,iree-org/iree-llvm-sandbox | [mlir][python[[sparse] Add tests for the exhaustive test utilities.
Add tests for the common utilities that we use for writing exhaustive tests for
the MLIR sparse codegen.
Simplify the relevant build rules by adding a new filegroup and moving a shared
library to an existing filegroup.
PiperOrigin-RevId: 385571670 | """Testing error handling in the common test utilities.
The module tests the error handling in the utilities we use for writing
exhaustive tests for the sparse codegen.
"""
import inspect
import sys
# Import MLIR related modules.
from mlir.dialects import sparse_tensor as st
from mlir.dialects.linalg.opdsl import la... | <commit_before><commit_msg>[mlir][python[[sparse] Add tests for the exhaustive test utilities.
Add tests for the common utilities that we use for writing exhaustive tests for
the MLIR sparse codegen.
Simplify the relevant build rules by adding a new filegroup and moving a shared
library to an existing filegroup.
Pip... | """Testing error handling in the common test utilities.
The module tests the error handling in the utilities we use for writing
exhaustive tests for the sparse codegen.
"""
import inspect
import sys
# Import MLIR related modules.
from mlir.dialects import sparse_tensor as st
from mlir.dialects.linalg.opdsl import la... | [mlir][python[[sparse] Add tests for the exhaustive test utilities.
Add tests for the common utilities that we use for writing exhaustive tests for
the MLIR sparse codegen.
Simplify the relevant build rules by adding a new filegroup and moving a shared
library to an existing filegroup.
PiperOrigin-RevId: 385571670""... | <commit_before><commit_msg>[mlir][python[[sparse] Add tests for the exhaustive test utilities.
Add tests for the common utilities that we use for writing exhaustive tests for
the MLIR sparse codegen.
Simplify the relevant build rules by adding a new filegroup and moving a shared
library to an existing filegroup.
Pip... | |
dca6f5450c449aeedca792326964ddb91992ec95 | test/unit/sorting/test_bucket_sort.py | test/unit/sorting/test_bucket_sort.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.bucket_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending or... | Add unit test for bucket sort implementation. | Add unit test for bucket sort implementation.
| Python | mit | weichen2046/algorithm-study,weichen2046/algorithm-study | Add unit test for bucket sort implementation. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.bucket_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending or... | <commit_before><commit_msg>Add unit test for bucket sort implementation.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.bucket_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test sort in default order, i.e., in ascending or... | Add unit test for bucket sort implementation.#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.bucket_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionSortTester(unittest.TestCase):
# Test... | <commit_before><commit_msg>Add unit test for bucket sort implementation.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import unittest
from helper.read_data_file import read_int_array
from sorting.bucket_sort import sort
BASE_DIR = os.path.dirname(os.path.abspath(__file__))
class InsertionS... | |
ce09da7df6668692133786bfdd5e25c6ac5d2c17 | conpaas-director/cpsdirector/get_external_idps.py | conpaas-director/cpsdirector/get_external_idps.py | #!/usr/bin/python
import ConfigParser
import pprint
def get_external_idps(director_configfile):
"""
get_external_idps(director_configfile)
Checks in the conpaas section if the support_external_idp option is present and set.
If so, checks if external_idps option is present, and for all
named idps collects all ... | Add code to support OpenID | Add code to support OpenID
| Python | bsd-3-clause | ConPaaS-team/conpaas,ConPaaS-team/conpaas,ConPaaS-team/conpaas,ConPaaS-team/conpaas,ConPaaS-team/conpaas,ConPaaS-team/conpaas,ConPaaS-team/conpaas | Add code to support OpenID | #!/usr/bin/python
import ConfigParser
import pprint
def get_external_idps(director_configfile):
"""
get_external_idps(director_configfile)
Checks in the conpaas section if the support_external_idp option is present and set.
If so, checks if external_idps option is present, and for all
named idps collects all ... | <commit_before><commit_msg>Add code to support OpenID<commit_after> | #!/usr/bin/python
import ConfigParser
import pprint
def get_external_idps(director_configfile):
"""
get_external_idps(director_configfile)
Checks in the conpaas section if the support_external_idp option is present and set.
If so, checks if external_idps option is present, and for all
named idps collects all ... | Add code to support OpenID#!/usr/bin/python
import ConfigParser
import pprint
def get_external_idps(director_configfile):
"""
get_external_idps(director_configfile)
Checks in the conpaas section if the support_external_idp option is present and set.
If so, checks if external_idps option is present, and for all ... | <commit_before><commit_msg>Add code to support OpenID<commit_after>#!/usr/bin/python
import ConfigParser
import pprint
def get_external_idps(director_configfile):
"""
get_external_idps(director_configfile)
Checks in the conpaas section if the support_external_idp option is present and set.
If so, checks if exte... | |
a47860e73c68ffbba97f1a70355223a2052a5f3c | tests/modules/test_pulseaudio.py | tests/modules/test_pulseaudio.py | # pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE, RIGHT_MOUSE, WHEEL_UP, WHEEL_DOWN
from bumblebee.modules.pulseaudio import Module
class TestPulseAudioModule(unittest.TestCase):
def setUp(self):
mocks.setup_test(self, Module)
... | Add unit tests for pulseaudio module | [tests] Add unit tests for pulseaudio module
| Python | mit | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | [tests] Add unit tests for pulseaudio module | # pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE, RIGHT_MOUSE, WHEEL_UP, WHEEL_DOWN
from bumblebee.modules.pulseaudio import Module
class TestPulseAudioModule(unittest.TestCase):
def setUp(self):
mocks.setup_test(self, Module)
... | <commit_before><commit_msg>[tests] Add unit tests for pulseaudio module<commit_after> | # pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE, RIGHT_MOUSE, WHEEL_UP, WHEEL_DOWN
from bumblebee.modules.pulseaudio import Module
class TestPulseAudioModule(unittest.TestCase):
def setUp(self):
mocks.setup_test(self, Module)
... | [tests] Add unit tests for pulseaudio module# pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE, RIGHT_MOUSE, WHEEL_UP, WHEEL_DOWN
from bumblebee.modules.pulseaudio import Module
class TestPulseAudioModule(unittest.TestCase):
def setUp(sel... | <commit_before><commit_msg>[tests] Add unit tests for pulseaudio module<commit_after># pylint: disable=C0103,C0111
import mock
import unittest
import tests.mocks as mocks
from bumblebee.input import LEFT_MOUSE, RIGHT_MOUSE, WHEEL_UP, WHEEL_DOWN
from bumblebee.modules.pulseaudio import Module
class TestPulseAudioMod... | |
c88947ad3dd5ad0c2e113e8fb8a37aff642b3381 | timm/data/parsers/parser_hfds.py | timm/data/parsers/parser_hfds.py | """ Dataset parser interface that wraps Hugging Face datasets
Hacked together by / Copyright 2022 Ross Wightman
"""
import io
import math
import torch
import torch.distributed as dist
from PIL import Image
try:
import datasets
except ImportError as e:
print("Please install Hugging Face datasets package `pip in... | Add initial Hugging Face Datasets parser impl. | Add initial Hugging Face Datasets parser impl.
| Python | apache-2.0 | rwightman/pytorch-image-models,rwightman/pytorch-image-models | Add initial Hugging Face Datasets parser impl. | """ Dataset parser interface that wraps Hugging Face datasets
Hacked together by / Copyright 2022 Ross Wightman
"""
import io
import math
import torch
import torch.distributed as dist
from PIL import Image
try:
import datasets
except ImportError as e:
print("Please install Hugging Face datasets package `pip in... | <commit_before><commit_msg>Add initial Hugging Face Datasets parser impl.<commit_after> | """ Dataset parser interface that wraps Hugging Face datasets
Hacked together by / Copyright 2022 Ross Wightman
"""
import io
import math
import torch
import torch.distributed as dist
from PIL import Image
try:
import datasets
except ImportError as e:
print("Please install Hugging Face datasets package `pip in... | Add initial Hugging Face Datasets parser impl.""" Dataset parser interface that wraps Hugging Face datasets
Hacked together by / Copyright 2022 Ross Wightman
"""
import io
import math
import torch
import torch.distributed as dist
from PIL import Image
try:
import datasets
except ImportError as e:
print("Please... | <commit_before><commit_msg>Add initial Hugging Face Datasets parser impl.<commit_after>""" Dataset parser interface that wraps Hugging Face datasets
Hacked together by / Copyright 2022 Ross Wightman
"""
import io
import math
import torch
import torch.distributed as dist
from PIL import Image
try:
import datasets
e... | |
626832a2e65635a0e47d0b01fbc8d49c9fcf9952 | rpc_flush_datastack.py | rpc_flush_datastack.py | #==============================================================================
# rpc_flush_datastack.py
# Python script that flushes a dataport for a device
#
# IMPORTANT NOTE!!: This will remove all data in a dataport (data source)
# USE AT YOUR OWN RISK
#
#
#==========================================================... | Add flush data stack example utility file | Add flush data stack example utility file
| Python | bsd-3-clause | exosite-garage/utility_scripts | Add flush data stack example utility file | #==============================================================================
# rpc_flush_datastack.py
# Python script that flushes a dataport for a device
#
# IMPORTANT NOTE!!: This will remove all data in a dataport (data source)
# USE AT YOUR OWN RISK
#
#
#==========================================================... | <commit_before><commit_msg>Add flush data stack example utility file<commit_after> | #==============================================================================
# rpc_flush_datastack.py
# Python script that flushes a dataport for a device
#
# IMPORTANT NOTE!!: This will remove all data in a dataport (data source)
# USE AT YOUR OWN RISK
#
#
#==========================================================... | Add flush data stack example utility file#==============================================================================
# rpc_flush_datastack.py
# Python script that flushes a dataport for a device
#
# IMPORTANT NOTE!!: This will remove all data in a dataport (data source)
# USE AT YOUR OWN RISK
#
#
#=================... | <commit_before><commit_msg>Add flush data stack example utility file<commit_after>#==============================================================================
# rpc_flush_datastack.py
# Python script that flushes a dataport for a device
#
# IMPORTANT NOTE!!: This will remove all data in a dataport (data source)
# US... | |
bc7c8e879e6643f240f98503415a28493c19d181 | scripts/get_services_to_deploy.py | scripts/get_services_to_deploy.py | #!/usr/bin/env python
import requests
import json
import sys
import argparse
parser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of Pull requests will be deployed')
parser.add_argument('--url', help='URL where Monorail is located')
parser.add_argument('--pr', help='List... | Add script that gets the services and deployNotes where a list of Pull requests will be deployed | Add script that gets the services and deployNotes where a list of Pull requests will be deployed
| Python | mit | AudienseCo/monorail,AudienseCo/monorail | Add script that gets the services and deployNotes where a list of Pull requests will be deployed | #!/usr/bin/env python
import requests
import json
import sys
import argparse
parser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of Pull requests will be deployed')
parser.add_argument('--url', help='URL where Monorail is located')
parser.add_argument('--pr', help='List... | <commit_before><commit_msg>Add script that gets the services and deployNotes where a list of Pull requests will be deployed<commit_after> | #!/usr/bin/env python
import requests
import json
import sys
import argparse
parser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of Pull requests will be deployed')
parser.add_argument('--url', help='URL where Monorail is located')
parser.add_argument('--pr', help='List... | Add script that gets the services and deployNotes where a list of Pull requests will be deployed#!/usr/bin/env python
import requests
import json
import sys
import argparse
parser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of Pull requests will be deployed')
parser.ad... | <commit_before><commit_msg>Add script that gets the services and deployNotes where a list of Pull requests will be deployed<commit_after>#!/usr/bin/env python
import requests
import json
import sys
import argparse
parser = argparse.ArgumentParser('Queries Monorail to get the services and deployNotes where a list of P... | |
4a07f1c9c36ecd47e3fce1738c87d42615d53f8c | odl/operator/utility.py | odl/operator/utility.py | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL 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.
... | Add a function for matrix representation. | DEV: Add a function for matrix representation.
See issue #49.
| Python | mpl-2.0 | aringh/odl,odlgroup/odl,odlgroup/odl,kohr-h/odl,kohr-h/odl,aringh/odl | DEV: Add a function for matrix representation.
See issue #49. | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL 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.
... | <commit_before><commit_msg>DEV: Add a function for matrix representation.
See issue #49.<commit_after> | # Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL 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.
... | DEV: Add a function for matrix representation.
See issue #49.# Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL 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 versi... | <commit_before><commit_msg>DEV: Add a function for matrix representation.
See issue #49.<commit_after># Copyright 2014, 2015 The ODL development group
#
# This file is part of ODL.
#
# ODL is free software: you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# t... | |
2b51cbe6204abf12d1eca023a0784a1c903c244d | data/scripts/load_chuls.py | data/scripts/load_chuls.py | import os
import csv
import json
from django.conf import settings
chul_file = os.path.join(
settings.BASE_DIR, 'data/csvs/chul.csv')
table_columns = [
"CommUnitId", "Cu_code", "CommUnitName", "Date_CU_Established",
"Date_CU_Operational", "CuLocation", "Link_Facility_Code",
"CU_OfficialMobile", "CU_Of... | Add script to read and load chus and chews | Add script to read and load chus and chews
| Python | mit | MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api,urandu/mfl_api,MasterFacilityList/mfl_api,urandu/mfl_api | Add script to read and load chus and chews | import os
import csv
import json
from django.conf import settings
chul_file = os.path.join(
settings.BASE_DIR, 'data/csvs/chul.csv')
table_columns = [
"CommUnitId", "Cu_code", "CommUnitName", "Date_CU_Established",
"Date_CU_Operational", "CuLocation", "Link_Facility_Code",
"CU_OfficialMobile", "CU_Of... | <commit_before><commit_msg>Add script to read and load chus and chews<commit_after> | import os
import csv
import json
from django.conf import settings
chul_file = os.path.join(
settings.BASE_DIR, 'data/csvs/chul.csv')
table_columns = [
"CommUnitId", "Cu_code", "CommUnitName", "Date_CU_Established",
"Date_CU_Operational", "CuLocation", "Link_Facility_Code",
"CU_OfficialMobile", "CU_Of... | Add script to read and load chus and chewsimport os
import csv
import json
from django.conf import settings
chul_file = os.path.join(
settings.BASE_DIR, 'data/csvs/chul.csv')
table_columns = [
"CommUnitId", "Cu_code", "CommUnitName", "Date_CU_Established",
"Date_CU_Operational", "CuLocation", "Link_Facil... | <commit_before><commit_msg>Add script to read and load chus and chews<commit_after>import os
import csv
import json
from django.conf import settings
chul_file = os.path.join(
settings.BASE_DIR, 'data/csvs/chul.csv')
table_columns = [
"CommUnitId", "Cu_code", "CommUnitName", "Date_CU_Established",
"Date_C... | |
6b01cfd5b580354de811fa7266811bfb04e31086 | migrations/versions/0092_data_gov_uk.py | migrations/versions/0092_data_gov_uk.py | """empty message
Revision ID: 0092_data_gov_uk
Revises: 0091_letter_billing
Create Date: 2017-06-05 16:15:17.744908
"""
# revision identifiers, used by Alembic.
revision = '0092_data_gov_uk'
down_revision = '0091_letter_billing'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgres... | Add data.gov.uk to the list of organisations | Add data.gov.uk to the list of organisations
We need to send an email with data.gov.uk branding.
The image for the logo doesn’t exist yet, but doing this migration so
we’re ready when it the logo does exist.
| Python | mit | alphagov/notifications-api,alphagov/notifications-api | Add data.gov.uk to the list of organisations
We need to send an email with data.gov.uk branding.
The image for the logo doesn’t exist yet, but doing this migration so
we’re ready when it the logo does exist. | """empty message
Revision ID: 0092_data_gov_uk
Revises: 0091_letter_billing
Create Date: 2017-06-05 16:15:17.744908
"""
# revision identifiers, used by Alembic.
revision = '0092_data_gov_uk'
down_revision = '0091_letter_billing'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgres... | <commit_before><commit_msg>Add data.gov.uk to the list of organisations
We need to send an email with data.gov.uk branding.
The image for the logo doesn’t exist yet, but doing this migration so
we’re ready when it the logo does exist.<commit_after> | """empty message
Revision ID: 0092_data_gov_uk
Revises: 0091_letter_billing
Create Date: 2017-06-05 16:15:17.744908
"""
# revision identifiers, used by Alembic.
revision = '0092_data_gov_uk'
down_revision = '0091_letter_billing'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgres... | Add data.gov.uk to the list of organisations
We need to send an email with data.gov.uk branding.
The image for the logo doesn’t exist yet, but doing this migration so
we’re ready when it the logo does exist."""empty message
Revision ID: 0092_data_gov_uk
Revises: 0091_letter_billing
Create Date: 2017-06-05 16:15:17.7... | <commit_before><commit_msg>Add data.gov.uk to the list of organisations
We need to send an email with data.gov.uk branding.
The image for the logo doesn’t exist yet, but doing this migration so
we’re ready when it the logo does exist.<commit_after>"""empty message
Revision ID: 0092_data_gov_uk
Revises: 0091_letter_b... | |
8414ff6fa396117cc02dfea08098a9213889baad | proselint/checks/inprogress/capitalizationErrors.py | proselint/checks/inprogress/capitalizationErrors.py | # -*- coding: utf-8 -*-
"""MSC: Password in plain text.
---
layout: post
error_code: MSC
source: ???
source_url: ???
title: Capitalization of abbreviations
date: 2014-06-10 12:31:19
categories: writing
---
In Hybrid Zones, p 255 in a citation Hughes & Huges Systems Experts and Computers: The System... | Add a capitalization check for world wars inspired by error in a bibliography | Add a capitalization check for world wars inspired by error in a bibliography
| Python | bsd-3-clause | amperser/proselint,amperser/proselint,jstewmon/proselint,amperser/proselint,jstewmon/proselint,jstewmon/proselint,amperser/proselint,amperser/proselint | Add a capitalization check for world wars inspired by error in a bibliography | # -*- coding: utf-8 -*-
"""MSC: Password in plain text.
---
layout: post
error_code: MSC
source: ???
source_url: ???
title: Capitalization of abbreviations
date: 2014-06-10 12:31:19
categories: writing
---
In Hybrid Zones, p 255 in a citation Hughes & Huges Systems Experts and Computers: The System... | <commit_before><commit_msg>Add a capitalization check for world wars inspired by error in a bibliography<commit_after> | # -*- coding: utf-8 -*-
"""MSC: Password in plain text.
---
layout: post
error_code: MSC
source: ???
source_url: ???
title: Capitalization of abbreviations
date: 2014-06-10 12:31:19
categories: writing
---
In Hybrid Zones, p 255 in a citation Hughes & Huges Systems Experts and Computers: The System... | Add a capitalization check for world wars inspired by error in a bibliography# -*- coding: utf-8 -*-
"""MSC: Password in plain text.
---
layout: post
error_code: MSC
source: ???
source_url: ???
title: Capitalization of abbreviations
date: 2014-06-10 12:31:19
categories: writing
---
In Hybrid Zones,... | <commit_before><commit_msg>Add a capitalization check for world wars inspired by error in a bibliography<commit_after># -*- coding: utf-8 -*-
"""MSC: Password in plain text.
---
layout: post
error_code: MSC
source: ???
source_url: ???
title: Capitalization of abbreviations
date: 2014-06-10 12:31:19
... | |
9d3557234419fac0376e07d732f0f6788bf13a55 | demos/hybrid-mixed/mixed-helmholtz.py | demos/hybrid-mixed/mixed-helmholtz.py | """This demonstration generates the relevant code from the Slate
expressions. Note that this is for code only; it's not solving any
particular PDE with given data.
See the main hybrid-mixed folder for an actual solution to a
mixed system using hybridization and static condensation.
"""
from firedrake import *
mesh = ... | Add simple code generation script | Add simple code generation script
| Python | mit | thomasgibson/tabula-rasa | Add simple code generation script | """This demonstration generates the relevant code from the Slate
expressions. Note that this is for code only; it's not solving any
particular PDE with given data.
See the main hybrid-mixed folder for an actual solution to a
mixed system using hybridization and static condensation.
"""
from firedrake import *
mesh = ... | <commit_before><commit_msg>Add simple code generation script<commit_after> | """This demonstration generates the relevant code from the Slate
expressions. Note that this is for code only; it's not solving any
particular PDE with given data.
See the main hybrid-mixed folder for an actual solution to a
mixed system using hybridization and static condensation.
"""
from firedrake import *
mesh = ... | Add simple code generation script"""This demonstration generates the relevant code from the Slate
expressions. Note that this is for code only; it's not solving any
particular PDE with given data.
See the main hybrid-mixed folder for an actual solution to a
mixed system using hybridization and static condensation.
"""... | <commit_before><commit_msg>Add simple code generation script<commit_after>"""This demonstration generates the relevant code from the Slate
expressions. Note that this is for code only; it's not solving any
particular PDE with given data.
See the main hybrid-mixed folder for an actual solution to a
mixed system using h... | |
dc15f8eb74592e0bc26aad2a2850e6a04de1492c | scripts/newActivity.py | scripts/newActivity.py | #!/usr/bin/env python
from datetime import datetime
from pymongo import MongoClient
import re
from subprocess import call
import sys
# minutes
window = 30
if len(sys.argv) != 2:
print 'Usage: %s <logfile>' % sys.argv[0]
sys.exit(1)
now = datetime.now()
logformat = re.compile('(\d{4}-\d\d-\d\d \d\d:\d\d:\d\... | Add in script to track new account activity | Add in script to track new account activity
| Python | apache-2.0 | drostron/quasar,slamdata/slamengine,djspiewak/quasar,slamdata/slamengine,drostron/quasar,slamdata/slamengine,drostron/quasar,quasar-analytics/quasar,quasar-analytics/quasar,slamdata/quasar,jedesah/Quasar,jedesah/Quasar,quasar-analytics/quasar,jedesah/Quasar,jedesah/Quasar,quasar-analytics/quasar,drostron/quasar | Add in script to track new account activity | #!/usr/bin/env python
from datetime import datetime
from pymongo import MongoClient
import re
from subprocess import call
import sys
# minutes
window = 30
if len(sys.argv) != 2:
print 'Usage: %s <logfile>' % sys.argv[0]
sys.exit(1)
now = datetime.now()
logformat = re.compile('(\d{4}-\d\d-\d\d \d\d:\d\d:\d\... | <commit_before><commit_msg>Add in script to track new account activity<commit_after> | #!/usr/bin/env python
from datetime import datetime
from pymongo import MongoClient
import re
from subprocess import call
import sys
# minutes
window = 30
if len(sys.argv) != 2:
print 'Usage: %s <logfile>' % sys.argv[0]
sys.exit(1)
now = datetime.now()
logformat = re.compile('(\d{4}-\d\d-\d\d \d\d:\d\d:\d\... | Add in script to track new account activity#!/usr/bin/env python
from datetime import datetime
from pymongo import MongoClient
import re
from subprocess import call
import sys
# minutes
window = 30
if len(sys.argv) != 2:
print 'Usage: %s <logfile>' % sys.argv[0]
sys.exit(1)
now = datetime.now()
logformat =... | <commit_before><commit_msg>Add in script to track new account activity<commit_after>#!/usr/bin/env python
from datetime import datetime
from pymongo import MongoClient
import re
from subprocess import call
import sys
# minutes
window = 30
if len(sys.argv) != 2:
print 'Usage: %s <logfile>' % sys.argv[0]
sys.e... | |
ee54f0ca3317b6f2119f15d42a7dd8d42d4f8059 | standup/test_settings.py | standup/test_settings.py | from standup.settings import *
DATABASE_URL = 'sqlite://'
| from standup.settings import *
# This looks wrong, but actually, it's an in-memory db uri
# and it causes our tests to run super fast!
DATABASE_URL = 'sqlite://'
| Add comment of vital importance | Add comment of vital importance
This bumps me up another shade of green! Yay!
| Python | bsd-3-clause | safwanrahman/standup,rehandalal/standup,willkg/standup,rlr/standup,rehandalal/standup,rlr/standup,mozilla/standup,rlr/standup,safwanrahman/standup,mozilla/standup,willkg/standup,willkg/standup,safwanrahman/standup,willkg/standup,safwanrahman/standup,mozilla/standup,rehandalal/standup,mozilla/standup | from standup.settings import *
DATABASE_URL = 'sqlite://'
Add comment of vital importance
This bumps me up another shade of green! Yay! | from standup.settings import *
# This looks wrong, but actually, it's an in-memory db uri
# and it causes our tests to run super fast!
DATABASE_URL = 'sqlite://'
| <commit_before>from standup.settings import *
DATABASE_URL = 'sqlite://'
<commit_msg>Add comment of vital importance
This bumps me up another shade of green! Yay!<commit_after> | from standup.settings import *
# This looks wrong, but actually, it's an in-memory db uri
# and it causes our tests to run super fast!
DATABASE_URL = 'sqlite://'
| from standup.settings import *
DATABASE_URL = 'sqlite://'
Add comment of vital importance
This bumps me up another shade of green! Yay!from standup.settings import *
# This looks wrong, but actually, it's an in-memory db uri
# and it causes our tests to run super fast!
DATABASE_URL = 'sqlite://'
| <commit_before>from standup.settings import *
DATABASE_URL = 'sqlite://'
<commit_msg>Add comment of vital importance
This bumps me up another shade of green! Yay!<commit_after>from standup.settings import *
# This looks wrong, but actually, it's an in-memory db uri
# and it causes our tests to run super fast!
DATABA... |
23289be44808baf78c01acb93761f661c0908022 | scripts/retranslate_models.py | scripts/retranslate_models.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-04 09:55
from __future__ import unicode_literals
from django.db import connection
from django.utils.translation import activate, _trans, ugettext as _
from tenant_extras.middleware import tenant_translation
from bluebottle.clients.utils import LocalTenan... | Add script that re-translates models | Add script that re-translates models
| Python | bsd-3-clause | onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle,onepercentclub/bluebottle | Add script that re-translates models | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-04 09:55
from __future__ import unicode_literals
from django.db import connection
from django.utils.translation import activate, _trans, ugettext as _
from tenant_extras.middleware import tenant_translation
from bluebottle.clients.utils import LocalTenan... | <commit_before><commit_msg>Add script that re-translates models<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-04 09:55
from __future__ import unicode_literals
from django.db import connection
from django.utils.translation import activate, _trans, ugettext as _
from tenant_extras.middleware import tenant_translation
from bluebottle.clients.utils import LocalTenan... | Add script that re-translates models# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-04 09:55
from __future__ import unicode_literals
from django.db import connection
from django.utils.translation import activate, _trans, ugettext as _
from tenant_extras.middleware import tenant_translation
from bluebo... | <commit_before><commit_msg>Add script that re-translates models<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-06-04 09:55
from __future__ import unicode_literals
from django.db import connection
from django.utils.translation import activate, _trans, ugettext as _
from tenant_extras.middlew... | |
1734198f0471c55dd872e14b31ce59b98baf576f | violations/tests/test_py_unittest.py | violations/tests/test_py_unittest.py | from django.test import TestCase
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from ..py_unittest import py_unittest_violation
from .base import get_content
class PyUnittestViolationCase(TestCase):
"""Python unittest violation case"""
def test_success(self):
"""Test success result"""
... | Add py unittest violation case | Add py unittest violation case
| Python | mit | nvbn/coviolations_web,nvbn/coviolations_web | Add py unittest violation case | from django.test import TestCase
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from ..py_unittest import py_unittest_violation
from .base import get_content
class PyUnittestViolationCase(TestCase):
"""Python unittest violation case"""
def test_success(self):
"""Test success result"""
... | <commit_before><commit_msg>Add py unittest violation case<commit_after> | from django.test import TestCase
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from ..py_unittest import py_unittest_violation
from .base import get_content
class PyUnittestViolationCase(TestCase):
"""Python unittest violation case"""
def test_success(self):
"""Test success result"""
... | Add py unittest violation casefrom django.test import TestCase
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from ..py_unittest import py_unittest_violation
from .base import get_content
class PyUnittestViolationCase(TestCase):
"""Python unittest violation case"""
def test_success(self):
"""T... | <commit_before><commit_msg>Add py unittest violation case<commit_after>from django.test import TestCase
from tasks.const import STATUS_SUCCESS, STATUS_FAILED
from ..py_unittest import py_unittest_violation
from .base import get_content
class PyUnittestViolationCase(TestCase):
"""Python unittest violation case"""
... | |
758e2777310935083760dfb50e97062a93214720 | tests/changes/api/test_auth_index.py | tests/changes/api/test_auth_index.py | from changes.testutils import APITestCase
class AuthIndexTest(APITestCase):
path = '/api/0/auth/'
def test_anonymous(self):
resp = self.client.get(self.path)
assert resp.status_code == 200
data = self.unserialize(resp)
assert data['authenticated'] is False
def test_authen... | Add tests for auth index | Add tests for auth index
| Python | apache-2.0 | dropbox/changes,bowlofstew/changes,bowlofstew/changes,dropbox/changes,dropbox/changes,dropbox/changes,wfxiang08/changes,wfxiang08/changes,wfxiang08/changes,bowlofstew/changes,bowlofstew/changes,wfxiang08/changes | Add tests for auth index | from changes.testutils import APITestCase
class AuthIndexTest(APITestCase):
path = '/api/0/auth/'
def test_anonymous(self):
resp = self.client.get(self.path)
assert resp.status_code == 200
data = self.unserialize(resp)
assert data['authenticated'] is False
def test_authen... | <commit_before><commit_msg>Add tests for auth index<commit_after> | from changes.testutils import APITestCase
class AuthIndexTest(APITestCase):
path = '/api/0/auth/'
def test_anonymous(self):
resp = self.client.get(self.path)
assert resp.status_code == 200
data = self.unserialize(resp)
assert data['authenticated'] is False
def test_authen... | Add tests for auth indexfrom changes.testutils import APITestCase
class AuthIndexTest(APITestCase):
path = '/api/0/auth/'
def test_anonymous(self):
resp = self.client.get(self.path)
assert resp.status_code == 200
data = self.unserialize(resp)
assert data['authenticated'] is Fa... | <commit_before><commit_msg>Add tests for auth index<commit_after>from changes.testutils import APITestCase
class AuthIndexTest(APITestCase):
path = '/api/0/auth/'
def test_anonymous(self):
resp = self.client.get(self.path)
assert resp.status_code == 200
data = self.unserialize(resp)
... | |
1f2cee72bfec767e0dcdc37b86c8ab745d2b4544 | project/api/migrations/0017_auto_20180331_1322.py | project/api/migrations/0017_auto_20180331_1322.py | # Generated by Django 2.0.3 on 2018-03-31 20:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0016_auto_20180328_0601'),
]
operations = [
migrations.AlterField(
model_name='office',
name='code',
... | Add candidate status to DB field | Add candidate status to DB field
| Python | bsd-2-clause | dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore,dbinetti/barberscore-django,barberscore/barberscore-api,barberscore/barberscore-api,dbinetti/barberscore | Add candidate status to DB field | # Generated by Django 2.0.3 on 2018-03-31 20:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0016_auto_20180328_0601'),
]
operations = [
migrations.AlterField(
model_name='office',
name='code',
... | <commit_before><commit_msg>Add candidate status to DB field<commit_after> | # Generated by Django 2.0.3 on 2018-03-31 20:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0016_auto_20180328_0601'),
]
operations = [
migrations.AlterField(
model_name='office',
name='code',
... | Add candidate status to DB field# Generated by Django 2.0.3 on 2018-03-31 20:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0016_auto_20180328_0601'),
]
operations = [
migrations.AlterField(
model_name='office',
... | <commit_before><commit_msg>Add candidate status to DB field<commit_after># Generated by Django 2.0.3 on 2018-03-31 20:22
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('api', '0016_auto_20180328_0601'),
]
operations = [
migrations.Alter... | |
ad3dbee189ac900baf3a84f3b0e843d202f369f8 | tests/unit/test_test_module_names.py | tests/unit/test_test_module_names.py | # -*- coding: utf-8 -*-
'''
tests.unit.doc_test
~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from salttesting import TestCase
# Import Salt libs
import integration
EXCLUDED_DIRS = [
'tests/pkg',
'tests/perf',
'tests/un... | Add test case to make sure we always proper test module names from now on | Add test case to make sure we always proper test module names from now on
| Python | apache-2.0 | saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt,saltstack/salt | Add test case to make sure we always proper test module names from now on | # -*- coding: utf-8 -*-
'''
tests.unit.doc_test
~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from salttesting import TestCase
# Import Salt libs
import integration
EXCLUDED_DIRS = [
'tests/pkg',
'tests/perf',
'tests/un... | <commit_before><commit_msg>Add test case to make sure we always proper test module names from now on<commit_after> | # -*- coding: utf-8 -*-
'''
tests.unit.doc_test
~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from salttesting import TestCase
# Import Salt libs
import integration
EXCLUDED_DIRS = [
'tests/pkg',
'tests/perf',
'tests/un... | Add test case to make sure we always proper test module names from now on# -*- coding: utf-8 -*-
'''
tests.unit.doc_test
~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from salttesting import TestCase
# Import Salt libs
import integr... | <commit_before><commit_msg>Add test case to make sure we always proper test module names from now on<commit_after># -*- coding: utf-8 -*-
'''
tests.unit.doc_test
~~~~~~~~~~~~~~~~~~~~
'''
# Import Python libs
from __future__ import absolute_import
import os
# Import Salt Testing libs
from salttesting import Te... | |
75942935696a7aee2ee16013fc7341728fb8f18d | __init__.py | __init__.py | """
This file is part of library PyRandLib.
It is provided under MIT License.
Please see files README.md and LICENSE.
Copyright (c) 2017 Philippe Schmouker
"""
from .baselcg import BaseLCG
from .baselfib64 import BaseLFib64
from .basemrg import BaseMRG
from .baserandom import BaseRandom
from .fa... | Package init module now added. | Package init module now added.
| Python | mit | schmouk/PyRandLib | Package init module now added. | """
This file is part of library PyRandLib.
It is provided under MIT License.
Please see files README.md and LICENSE.
Copyright (c) 2017 Philippe Schmouker
"""
from .baselcg import BaseLCG
from .baselfib64 import BaseLFib64
from .basemrg import BaseMRG
from .baserandom import BaseRandom
from .fa... | <commit_before><commit_msg>Package init module now added.<commit_after> | """
This file is part of library PyRandLib.
It is provided under MIT License.
Please see files README.md and LICENSE.
Copyright (c) 2017 Philippe Schmouker
"""
from .baselcg import BaseLCG
from .baselfib64 import BaseLFib64
from .basemrg import BaseMRG
from .baserandom import BaseRandom
from .fa... | Package init module now added."""
This file is part of library PyRandLib.
It is provided under MIT License.
Please see files README.md and LICENSE.
Copyright (c) 2017 Philippe Schmouker
"""
from .baselcg import BaseLCG
from .baselfib64 import BaseLFib64
from .basemrg import BaseMRG
from .baserandom ... | <commit_before><commit_msg>Package init module now added.<commit_after>"""
This file is part of library PyRandLib.
It is provided under MIT License.
Please see files README.md and LICENSE.
Copyright (c) 2017 Philippe Schmouker
"""
from .baselcg import BaseLCG
from .baselfib64 import BaseLFib64
from .basemr... | |
5ddbb8dd77c4be14cc459640324d449850984d3b | zou/app/utils/api.py | zou/app/utils/api.py | from flask_restful import Api, output_json
def configure_api_from_blueprint(blueprint, route_tuples):
api = Api(blueprint, catch_all_404s=True)
api.representations = {
'application/json; charset=utf-8': output_json,
'application/json': output_json,
}
for route_tuple in route_tuples:
... | Add utils to manage blueprints | Add utils to manage blueprints
| Python | agpl-3.0 | cgwire/zou | Add utils to manage blueprints | from flask_restful import Api, output_json
def configure_api_from_blueprint(blueprint, route_tuples):
api = Api(blueprint, catch_all_404s=True)
api.representations = {
'application/json; charset=utf-8': output_json,
'application/json': output_json,
}
for route_tuple in route_tuples:
... | <commit_before><commit_msg>Add utils to manage blueprints<commit_after> | from flask_restful import Api, output_json
def configure_api_from_blueprint(blueprint, route_tuples):
api = Api(blueprint, catch_all_404s=True)
api.representations = {
'application/json; charset=utf-8': output_json,
'application/json': output_json,
}
for route_tuple in route_tuples:
... | Add utils to manage blueprintsfrom flask_restful import Api, output_json
def configure_api_from_blueprint(blueprint, route_tuples):
api = Api(blueprint, catch_all_404s=True)
api.representations = {
'application/json; charset=utf-8': output_json,
'application/json': output_json,
}
for... | <commit_before><commit_msg>Add utils to manage blueprints<commit_after>from flask_restful import Api, output_json
def configure_api_from_blueprint(blueprint, route_tuples):
api = Api(blueprint, catch_all_404s=True)
api.representations = {
'application/json; charset=utf-8': output_json,
'appli... | |
cb1fe63325ec06d2c0ec94ac605e32d48ea8c8db | scripts/estad_semana.py | scripts/estad_semana.py | # -*- coding:utf-8 -*-
import valoratweets
import mongoengine
from tweemanager.tweetdocument import TweetDocument
import pprint
import re
import datetime as dt
from bson import json_util as json
mongoengine.connect(host="mongodb://192.168.80.221:27017/tweets")
cosas = TweetDocument._get_collection().aggregate(
[
{... | Add script for counting valorated tweets per week | Add script for counting valorated tweets per week
| Python | agpl-3.0 | nfqsolutions/tweemanager | Add script for counting valorated tweets per week | # -*- coding:utf-8 -*-
import valoratweets
import mongoengine
from tweemanager.tweetdocument import TweetDocument
import pprint
import re
import datetime as dt
from bson import json_util as json
mongoengine.connect(host="mongodb://192.168.80.221:27017/tweets")
cosas = TweetDocument._get_collection().aggregate(
[
{... | <commit_before><commit_msg>Add script for counting valorated tweets per week<commit_after> | # -*- coding:utf-8 -*-
import valoratweets
import mongoengine
from tweemanager.tweetdocument import TweetDocument
import pprint
import re
import datetime as dt
from bson import json_util as json
mongoengine.connect(host="mongodb://192.168.80.221:27017/tweets")
cosas = TweetDocument._get_collection().aggregate(
[
{... | Add script for counting valorated tweets per week# -*- coding:utf-8 -*-
import valoratweets
import mongoengine
from tweemanager.tweetdocument import TweetDocument
import pprint
import re
import datetime as dt
from bson import json_util as json
mongoengine.connect(host="mongodb://192.168.80.221:27017/tweets")
cosas ... | <commit_before><commit_msg>Add script for counting valorated tweets per week<commit_after># -*- coding:utf-8 -*-
import valoratweets
import mongoengine
from tweemanager.tweetdocument import TweetDocument
import pprint
import re
import datetime as dt
from bson import json_util as json
mongoengine.connect(host="mongod... | |
99e52824426195d1f23a72c04b900d2aed2946c9 | home/migrations/0019_auto_20190319_1438.py | home/migrations/0019_auto_20190319_1438.py | # Generated by Django 2.0.13 on 2019-03-19 14:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0018_auto_20171005_0247'),
]
operations = [
migrations.AlterField(
model_name='formfield',
name='field_type... | Make migrations for Wagtail 2.3 | Make migrations for Wagtail 2.3
This commit is the result of running
```
docker-compose exec django /bin/bash -c "./manage.py makemigrations"
```
| Python | agpl-3.0 | freedomofpress/securethenews,freedomofpress/securethenews,freedomofpress/securethenews,freedomofpress/securethenews | Make migrations for Wagtail 2.3
This commit is the result of running
```
docker-compose exec django /bin/bash -c "./manage.py makemigrations"
``` | # Generated by Django 2.0.13 on 2019-03-19 14:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0018_auto_20171005_0247'),
]
operations = [
migrations.AlterField(
model_name='formfield',
name='field_type... | <commit_before><commit_msg>Make migrations for Wagtail 2.3
This commit is the result of running
```
docker-compose exec django /bin/bash -c "./manage.py makemigrations"
```<commit_after> | # Generated by Django 2.0.13 on 2019-03-19 14:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0018_auto_20171005_0247'),
]
operations = [
migrations.AlterField(
model_name='formfield',
name='field_type... | Make migrations for Wagtail 2.3
This commit is the result of running
```
docker-compose exec django /bin/bash -c "./manage.py makemigrations"
```# Generated by Django 2.0.13 on 2019-03-19 14:38
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('home', '0... | <commit_before><commit_msg>Make migrations for Wagtail 2.3
This commit is the result of running
```
docker-compose exec django /bin/bash -c "./manage.py makemigrations"
```<commit_after># Generated by Django 2.0.13 on 2019-03-19 14:38
from django.db import migrations, models
class Migration(migrations.Migration):
... | |
e0651992608e08204b3812b3e8a30f235157c780 | gnome_terminal_tabs.py | gnome_terminal_tabs.py | #!/usr/bin/env python
"""
Run a command on multiple servers via SSH, each in a GNOME Terminal tab.
See http://exyr.org/2011/gnome-terminal-tabs/
"""
import subprocess
command = 'sudo aptitude update && sudo aptitude safe-upgrade'
terminal = ['gnome-terminal']
for host in ('cartonbox', 'hako'):
termina... | Add GNOME Terminal tabs script. | Add GNOME Terminal tabs script.
| Python | bsd-3-clause | SimonSapin/snippets,SimonSapin/snippets | Add GNOME Terminal tabs script. | #!/usr/bin/env python
"""
Run a command on multiple servers via SSH, each in a GNOME Terminal tab.
See http://exyr.org/2011/gnome-terminal-tabs/
"""
import subprocess
command = 'sudo aptitude update && sudo aptitude safe-upgrade'
terminal = ['gnome-terminal']
for host in ('cartonbox', 'hako'):
termina... | <commit_before><commit_msg>Add GNOME Terminal tabs script.<commit_after> | #!/usr/bin/env python
"""
Run a command on multiple servers via SSH, each in a GNOME Terminal tab.
See http://exyr.org/2011/gnome-terminal-tabs/
"""
import subprocess
command = 'sudo aptitude update && sudo aptitude safe-upgrade'
terminal = ['gnome-terminal']
for host in ('cartonbox', 'hako'):
termina... | Add GNOME Terminal tabs script.#!/usr/bin/env python
"""
Run a command on multiple servers via SSH, each in a GNOME Terminal tab.
See http://exyr.org/2011/gnome-terminal-tabs/
"""
import subprocess
command = 'sudo aptitude update && sudo aptitude safe-upgrade'
terminal = ['gnome-terminal']
for host in ('c... | <commit_before><commit_msg>Add GNOME Terminal tabs script.<commit_after>#!/usr/bin/env python
"""
Run a command on multiple servers via SSH, each in a GNOME Terminal tab.
See http://exyr.org/2011/gnome-terminal-tabs/
"""
import subprocess
command = 'sudo aptitude update && sudo aptitude safe-upgrade'
term... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.