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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
91bb95fa8e481ffd4b1e083cc607f2fb8ce9a1f2 | scripts/remove_after_use/update_datacite_dois.py | scripts/remove_after_use/update_datacite_dois.py | """
Script to send updates to Datacite for projects that were updated
while the DISABLE_DATACITE_DOIS switch was active.
Start date:
Dec 14, 2018 @ 10:09 PM EST = Dec 15, 2018 @ 03:09 UTC
End date:
Dec 15, 2018 @ 12:34 PM EST = Dec 15, 2018 @ 17:34 UTC
"""
import datetime
import logging
import pytz
import waff... | Add script to send updated projects to Datacite. | Add script to send updated projects to Datacite.
[PLAT-1273]
| Python | apache-2.0 | adlius/osf.io,felliott/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,cslzchen/osf.io,felliott/osf.io,baylee-d/osf.io,mattclark/osf.io,baylee-d/osf.io,brianjgeiger/osf.io,cslzchen/osf.io,mfraezz/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,baylee-d/osf.io,cslzchen/osf.io,saradbowman/osf.io,mattclark/osf.... | Add script to send updated projects to Datacite.
[PLAT-1273] | """
Script to send updates to Datacite for projects that were updated
while the DISABLE_DATACITE_DOIS switch was active.
Start date:
Dec 14, 2018 @ 10:09 PM EST = Dec 15, 2018 @ 03:09 UTC
End date:
Dec 15, 2018 @ 12:34 PM EST = Dec 15, 2018 @ 17:34 UTC
"""
import datetime
import logging
import pytz
import waff... | <commit_before><commit_msg>Add script to send updated projects to Datacite.
[PLAT-1273]<commit_after> | """
Script to send updates to Datacite for projects that were updated
while the DISABLE_DATACITE_DOIS switch was active.
Start date:
Dec 14, 2018 @ 10:09 PM EST = Dec 15, 2018 @ 03:09 UTC
End date:
Dec 15, 2018 @ 12:34 PM EST = Dec 15, 2018 @ 17:34 UTC
"""
import datetime
import logging
import pytz
import waff... | Add script to send updated projects to Datacite.
[PLAT-1273]"""
Script to send updates to Datacite for projects that were updated
while the DISABLE_DATACITE_DOIS switch was active.
Start date:
Dec 14, 2018 @ 10:09 PM EST = Dec 15, 2018 @ 03:09 UTC
End date:
Dec 15, 2018 @ 12:34 PM EST = Dec 15, 2018 @ 17:34 U... | <commit_before><commit_msg>Add script to send updated projects to Datacite.
[PLAT-1273]<commit_after>"""
Script to send updates to Datacite for projects that were updated
while the DISABLE_DATACITE_DOIS switch was active.
Start date:
Dec 14, 2018 @ 10:09 PM EST = Dec 15, 2018 @ 03:09 UTC
End date:
Dec 15, 201... | |
1eb40936310828fe353ea4c4dd902fabea235f77 | Python/112_PathSum.py | Python/112_PathSum.py | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def hasPathSum(self, root, sum):
"""
:type root: TreeNode
:type sum: int
:rtype: bool
... | Add solution for 112 Path Sum. | Add solution for 112 Path Sum.
| Python | mit | comicxmz001/LeetCode,comicxmz001/LeetCode | Add solution for 112 Path Sum. | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def hasPathSum(self, root, sum):
"""
:type root: TreeNode
:type sum: int
:rtype: bool
... | <commit_before><commit_msg>Add solution for 112 Path Sum.<commit_after> | # Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def hasPathSum(self, root, sum):
"""
:type root: TreeNode
:type sum: int
:rtype: bool
... | Add solution for 112 Path Sum.# Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def hasPathSum(self, root, sum):
"""
:type root: TreeNode
:type sum... | <commit_before><commit_msg>Add solution for 112 Path Sum.<commit_after># Definition for a binary tree node.
# class TreeNode(object):
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution(object):
def hasPathSum(self, root, sum):
"""
... | |
115c62e6a9a9167633eff93ef0f1a355505a0e5d | tests/test_python33_bdist_egg.py | tests/test_python33_bdist_egg.py | import sys
import os
import tempfile
import unittest
import shutil
import copy
CURDIR = os.path.abspath(os.path.dirname(__file__))
TOPDIR = os.path.split(CURDIR)[0]
sys.path.insert(0, TOPDIR)
from distribute_setup import (use_setuptools, _build_egg, _python_cmd,
_do_download, _install, D... | Add a test for Python 3.3 bdist_egg issue | Add a test for Python 3.3 bdist_egg issue
--HG--
branch : distribute
extra : rebase_source : e83ee69c3b15e4a75780811a7bb3612b8f7f54d1
| Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | Add a test for Python 3.3 bdist_egg issue
--HG--
branch : distribute
extra : rebase_source : e83ee69c3b15e4a75780811a7bb3612b8f7f54d1 | import sys
import os
import tempfile
import unittest
import shutil
import copy
CURDIR = os.path.abspath(os.path.dirname(__file__))
TOPDIR = os.path.split(CURDIR)[0]
sys.path.insert(0, TOPDIR)
from distribute_setup import (use_setuptools, _build_egg, _python_cmd,
_do_download, _install, D... | <commit_before><commit_msg>Add a test for Python 3.3 bdist_egg issue
--HG--
branch : distribute
extra : rebase_source : e83ee69c3b15e4a75780811a7bb3612b8f7f54d1<commit_after> | import sys
import os
import tempfile
import unittest
import shutil
import copy
CURDIR = os.path.abspath(os.path.dirname(__file__))
TOPDIR = os.path.split(CURDIR)[0]
sys.path.insert(0, TOPDIR)
from distribute_setup import (use_setuptools, _build_egg, _python_cmd,
_do_download, _install, D... | Add a test for Python 3.3 bdist_egg issue
--HG--
branch : distribute
extra : rebase_source : e83ee69c3b15e4a75780811a7bb3612b8f7f54d1import sys
import os
import tempfile
import unittest
import shutil
import copy
CURDIR = os.path.abspath(os.path.dirname(__file__))
TOPDIR = os.path.split(CURDIR)[0]
sys.path.insert(0, T... | <commit_before><commit_msg>Add a test for Python 3.3 bdist_egg issue
--HG--
branch : distribute
extra : rebase_source : e83ee69c3b15e4a75780811a7bb3612b8f7f54d1<commit_after>import sys
import os
import tempfile
import unittest
import shutil
import copy
CURDIR = os.path.abspath(os.path.dirname(__file__))
TOPDIR = os.p... | |
962472ab094ec6a5d9bc70628ceb98c48cf803ac | add_liwc_entities.py | add_liwc_entities.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Add LIWC words as entities in FoLiA XML file.
Usage: python add_liwc_entities.py <file in>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools import bs4_helpers
import argparse
import json
def add_entity(soup, sentence, cls, word_ids):
# bevat s... | Add script for adding LIWC entities to FoLiA XML file | Add script for adding LIWC entities to FoLiA XML file
Added a script that checks whether a word in the FoLiA file also occurs
in the historic LIWC dictionary. If it does, and the word has certain
categories (at this time the script checks for posemo and negemo
words), an entity is added to the FoLiA XML file.
What nee... | Python | apache-2.0 | NLeSC/embodied-emotions-scripts,NLeSC/embodied-emotions-scripts | Add script for adding LIWC entities to FoLiA XML file
Added a script that checks whether a word in the FoLiA file also occurs
in the historic LIWC dictionary. If it does, and the word has certain
categories (at this time the script checks for posemo and negemo
words), an entity is added to the FoLiA XML file.
What nee... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Add LIWC words as entities in FoLiA XML file.
Usage: python add_liwc_entities.py <file in>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools import bs4_helpers
import argparse
import json
def add_entity(soup, sentence, cls, word_ids):
# bevat s... | <commit_before><commit_msg>Add script for adding LIWC entities to FoLiA XML file
Added a script that checks whether a word in the FoLiA file also occurs
in the historic LIWC dictionary. If it does, and the word has certain
categories (at this time the script checks for posemo and negemo
words), an entity is added to t... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""Add LIWC words as entities in FoLiA XML file.
Usage: python add_liwc_entities.py <file in>
"""
from lxml import etree
from bs4 import BeautifulSoup
from emotools import bs4_helpers
import argparse
import json
def add_entity(soup, sentence, cls, word_ids):
# bevat s... | Add script for adding LIWC entities to FoLiA XML file
Added a script that checks whether a word in the FoLiA file also occurs
in the historic LIWC dictionary. If it does, and the word has certain
categories (at this time the script checks for posemo and negemo
words), an entity is added to the FoLiA XML file.
What nee... | <commit_before><commit_msg>Add script for adding LIWC entities to FoLiA XML file
Added a script that checks whether a word in the FoLiA file also occurs
in the historic LIWC dictionary. If it does, and the word has certain
categories (at this time the script checks for posemo and negemo
words), an entity is added to t... | |
e15d982ec3ef0dba52af67ce5b7b448eb8914767 | benchmark_pencode.py | benchmark_pencode.py | #!/usr/bin/env python
import perf
from chopsticks.pencode import pencode, pdecode
def setup():
return [[
1000+i,
str(1000+i),
42,
42.0,
10121071034790721094712093712037123,
None,
True,
b'qwertyuiop',
u'qwertyuiop',
['q', 'w', 'e', '... | Add benchmark script for pencode.pencode() | Add benchmark script for pencode.pencode()
Baseline on a MBP A1389, i7-4750HQ CPU @ 2.00GHz, Ubuntu 17.10 x64,
Python 2.7.14, kernel 4.13.0-36-generic
pencode: Mean +- std dev: 95.8 ms +- 1.2 ms
| Python | apache-2.0 | lordmauve/chopsticks,lordmauve/chopsticks | Add benchmark script for pencode.pencode()
Baseline on a MBP A1389, i7-4750HQ CPU @ 2.00GHz, Ubuntu 17.10 x64,
Python 2.7.14, kernel 4.13.0-36-generic
pencode: Mean +- std dev: 95.8 ms +- 1.2 ms | #!/usr/bin/env python
import perf
from chopsticks.pencode import pencode, pdecode
def setup():
return [[
1000+i,
str(1000+i),
42,
42.0,
10121071034790721094712093712037123,
None,
True,
b'qwertyuiop',
u'qwertyuiop',
['q', 'w', 'e', '... | <commit_before><commit_msg>Add benchmark script for pencode.pencode()
Baseline on a MBP A1389, i7-4750HQ CPU @ 2.00GHz, Ubuntu 17.10 x64,
Python 2.7.14, kernel 4.13.0-36-generic
pencode: Mean +- std dev: 95.8 ms +- 1.2 ms<commit_after> | #!/usr/bin/env python
import perf
from chopsticks.pencode import pencode, pdecode
def setup():
return [[
1000+i,
str(1000+i),
42,
42.0,
10121071034790721094712093712037123,
None,
True,
b'qwertyuiop',
u'qwertyuiop',
['q', 'w', 'e', '... | Add benchmark script for pencode.pencode()
Baseline on a MBP A1389, i7-4750HQ CPU @ 2.00GHz, Ubuntu 17.10 x64,
Python 2.7.14, kernel 4.13.0-36-generic
pencode: Mean +- std dev: 95.8 ms +- 1.2 ms#!/usr/bin/env python
import perf
from chopsticks.pencode import pencode, pdecode
def setup():
return [[
100... | <commit_before><commit_msg>Add benchmark script for pencode.pencode()
Baseline on a MBP A1389, i7-4750HQ CPU @ 2.00GHz, Ubuntu 17.10 x64,
Python 2.7.14, kernel 4.13.0-36-generic
pencode: Mean +- std dev: 95.8 ms +- 1.2 ms<commit_after>#!/usr/bin/env python
import perf
from chopsticks.pencode import pencode, pdecode... | |
f93c9592de5dfcc8968f06cbc692cbee455ebf47 | lintcode/Medium/004_Ugly_Number_II.py | lintcode/Medium/004_Ugly_Number_II.py | class Solution:
"""
@param {int} n an integer.
@return {int} the nth prime number as description.
"""
def nthUglyNumber(self, n):
# write your code here
uglies = [1]
index0, index1, index2 = 0, 0, 0
while(len(uglies) < n):
nextNum = min(uglies[index0] * 2,... | Add solution to lintcode question 004 | Add solution to lintcode question 004
| Python | mit | Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode,Rhadow/leetcode | Add solution to lintcode question 004 | class Solution:
"""
@param {int} n an integer.
@return {int} the nth prime number as description.
"""
def nthUglyNumber(self, n):
# write your code here
uglies = [1]
index0, index1, index2 = 0, 0, 0
while(len(uglies) < n):
nextNum = min(uglies[index0] * 2,... | <commit_before><commit_msg>Add solution to lintcode question 004<commit_after> | class Solution:
"""
@param {int} n an integer.
@return {int} the nth prime number as description.
"""
def nthUglyNumber(self, n):
# write your code here
uglies = [1]
index0, index1, index2 = 0, 0, 0
while(len(uglies) < n):
nextNum = min(uglies[index0] * 2,... | Add solution to lintcode question 004class Solution:
"""
@param {int} n an integer.
@return {int} the nth prime number as description.
"""
def nthUglyNumber(self, n):
# write your code here
uglies = [1]
index0, index1, index2 = 0, 0, 0
while(len(uglies) < n):
... | <commit_before><commit_msg>Add solution to lintcode question 004<commit_after>class Solution:
"""
@param {int} n an integer.
@return {int} the nth prime number as description.
"""
def nthUglyNumber(self, n):
# write your code here
uglies = [1]
index0, index1, index2 = 0, 0, 0... | |
b9ed7e58e54536d761fe5658e50dcbbd3d1b4d3f | py/arithmetic-slices.py | py/arithmetic-slices.py | class Solution(object):
def numberOfArithmeticSlices(self, A):
"""
:type A: List[int]
:rtype: int
"""
lA = len(A)
if lA < 3:
return 0
p, q = 0, 0
ans = 0
while p < lA - 2:
if A[p + 1] * 2 != A[p] + A[p + 2]:
... | Add py solution for 413. Arithmetic Slices | Add py solution for 413. Arithmetic Slices
413. Arithmetic Slices: https://leetcode.com/problems/arithmetic-slices/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 413. Arithmetic Slices
413. Arithmetic Slices: https://leetcode.com/problems/arithmetic-slices/ | class Solution(object):
def numberOfArithmeticSlices(self, A):
"""
:type A: List[int]
:rtype: int
"""
lA = len(A)
if lA < 3:
return 0
p, q = 0, 0
ans = 0
while p < lA - 2:
if A[p + 1] * 2 != A[p] + A[p + 2]:
... | <commit_before><commit_msg>Add py solution for 413. Arithmetic Slices
413. Arithmetic Slices: https://leetcode.com/problems/arithmetic-slices/<commit_after> | class Solution(object):
def numberOfArithmeticSlices(self, A):
"""
:type A: List[int]
:rtype: int
"""
lA = len(A)
if lA < 3:
return 0
p, q = 0, 0
ans = 0
while p < lA - 2:
if A[p + 1] * 2 != A[p] + A[p + 2]:
... | Add py solution for 413. Arithmetic Slices
413. Arithmetic Slices: https://leetcode.com/problems/arithmetic-slices/class Solution(object):
def numberOfArithmeticSlices(self, A):
"""
:type A: List[int]
:rtype: int
"""
lA = len(A)
if lA < 3:
return 0
... | <commit_before><commit_msg>Add py solution for 413. Arithmetic Slices
413. Arithmetic Slices: https://leetcode.com/problems/arithmetic-slices/<commit_after>class Solution(object):
def numberOfArithmeticSlices(self, A):
"""
:type A: List[int]
:rtype: int
"""
lA = len(A)
... | |
bfcccf63d0ce17bc91efec6aa66196f1353a1eb7 | scripts/lowercase_log_nids.py | scripts/lowercase_log_nids.py | import sys
from framework.mongo import database as db
from framework.transactions.context import TokuTransaction
from website.app import init_app
def lowercase_nids():
for log in db.nodelog.find({'$or': [
{'params.node': {'$regex': '[A-Z]'}},
{'params.project': {'$regex': '[A-Z]'}},
{'pa... | Add a script to fix mixcased backrefs and params | Add a script to fix mixcased backrefs and params
| Python | apache-2.0 | SSJohns/osf.io,SSJohns/osf.io,icereval/osf.io,acshi/osf.io,leb2dg/osf.io,sloria/osf.io,samchrisinger/osf.io,caneruguz/osf.io,rdhyee/osf.io,laurenrevere/osf.io,RomanZWang/osf.io,emetsger/osf.io,RomanZWang/osf.io,pattisdr/osf.io,acshi/osf.io,amyshi188/osf.io,laurenrevere/osf.io,mfraezz/osf.io,mluo613/osf.io,mluke93/osf.i... | Add a script to fix mixcased backrefs and params | import sys
from framework.mongo import database as db
from framework.transactions.context import TokuTransaction
from website.app import init_app
def lowercase_nids():
for log in db.nodelog.find({'$or': [
{'params.node': {'$regex': '[A-Z]'}},
{'params.project': {'$regex': '[A-Z]'}},
{'pa... | <commit_before><commit_msg>Add a script to fix mixcased backrefs and params<commit_after> | import sys
from framework.mongo import database as db
from framework.transactions.context import TokuTransaction
from website.app import init_app
def lowercase_nids():
for log in db.nodelog.find({'$or': [
{'params.node': {'$regex': '[A-Z]'}},
{'params.project': {'$regex': '[A-Z]'}},
{'pa... | Add a script to fix mixcased backrefs and paramsimport sys
from framework.mongo import database as db
from framework.transactions.context import TokuTransaction
from website.app import init_app
def lowercase_nids():
for log in db.nodelog.find({'$or': [
{'params.node': {'$regex': '[A-Z]'}},
{'par... | <commit_before><commit_msg>Add a script to fix mixcased backrefs and params<commit_after>import sys
from framework.mongo import database as db
from framework.transactions.context import TokuTransaction
from website.app import init_app
def lowercase_nids():
for log in db.nodelog.find({'$or': [
{'params.n... | |
84b984fc96dbea18cb3272d4ac9f8185c7df1d3b | froide/document/migrations/0006_auto_20180522_0114.py | froide/document/migrations/0006_auto_20180522_0114.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-21 23:14
from __future__ import unicode_literals
from django.db import migrations, models
import froide.document.models
import froide.helper.storage
import functools
class Migration(migrations.Migration):
dependencies = [
('document', '000... | Add storage to document image fields | Add storage to document image fields | Python | mit | fin/froide,fin/froide,stefanw/froide,stefanw/froide,stefanw/froide,stefanw/froide,fin/froide,fin/froide,stefanw/froide | Add storage to document image fields | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-21 23:14
from __future__ import unicode_literals
from django.db import migrations, models
import froide.document.models
import froide.helper.storage
import functools
class Migration(migrations.Migration):
dependencies = [
('document', '000... | <commit_before><commit_msg>Add storage to document image fields<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-21 23:14
from __future__ import unicode_literals
from django.db import migrations, models
import froide.document.models
import froide.helper.storage
import functools
class Migration(migrations.Migration):
dependencies = [
('document', '000... | Add storage to document image fields# -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-21 23:14
from __future__ import unicode_literals
from django.db import migrations, models
import froide.document.models
import froide.helper.storage
import functools
class Migration(migrations.Migration):
depend... | <commit_before><commit_msg>Add storage to document image fields<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.12 on 2018-05-21 23:14
from __future__ import unicode_literals
from django.db import migrations, models
import froide.document.models
import froide.helper.storage
import functools
class Mig... | |
3e7a99967c68d8d5f516889f62cec6a9e2de66aa | category_test.py | category_test.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright 2015 Pascual Martinez-Gomez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | Add test for category class | Add test for category class
| Python | apache-2.0 | mynlp/ccg2lambda,mynlp/ccg2lambda,mynlp/ccg2lambda | Add test for category class | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright 2015 Pascual Martinez-Gomez
#
# 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
#
... | <commit_before><commit_msg>Add test for category class<commit_after> | #!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright 2015 Pascual Martinez-Gomez
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
... | Add test for category class#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright 2015 Pascual Martinez-Gomez
#
# 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.... | <commit_before><commit_msg>Add test for category class<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-
#
# Copyright 2015 Pascual Martinez-Gomez
#
# 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 t... | |
362d339d39c9e5303cd8f5a99c475c7a68fe1324 | app/process_tweets.py | app/process_tweets.py | # -*- coding: utf-8 -*-
from string import punctuation
from test import _writeJSON, _readJSON
tweetData = _readJSON('var/tweet_test.json')
# Punctuation to be removed.
mySymbols = punctuation.replace(u'#', u'').replace(u'@', u'')
wordsDict = {}
for t in tweetData:
# case?
# apostrophes in words? ' vs ’?
... | Extend test for processing words of tweets. | Extend test for processing words of tweets.
| Python | mit | MichaelCurrin/twitterverse,MichaelCurrin/twitterverse | Extend test for processing words of tweets. | # -*- coding: utf-8 -*-
from string import punctuation
from test import _writeJSON, _readJSON
tweetData = _readJSON('var/tweet_test.json')
# Punctuation to be removed.
mySymbols = punctuation.replace(u'#', u'').replace(u'@', u'')
wordsDict = {}
for t in tweetData:
# case?
# apostrophes in words? ' vs ’?
... | <commit_before><commit_msg>Extend test for processing words of tweets.<commit_after> | # -*- coding: utf-8 -*-
from string import punctuation
from test import _writeJSON, _readJSON
tweetData = _readJSON('var/tweet_test.json')
# Punctuation to be removed.
mySymbols = punctuation.replace(u'#', u'').replace(u'@', u'')
wordsDict = {}
for t in tweetData:
# case?
# apostrophes in words? ' vs ’?
... | Extend test for processing words of tweets.# -*- coding: utf-8 -*-
from string import punctuation
from test import _writeJSON, _readJSON
tweetData = _readJSON('var/tweet_test.json')
# Punctuation to be removed.
mySymbols = punctuation.replace(u'#', u'').replace(u'@', u'')
wordsDict = {}
for t in tweetData:
# c... | <commit_before><commit_msg>Extend test for processing words of tweets.<commit_after># -*- coding: utf-8 -*-
from string import punctuation
from test import _writeJSON, _readJSON
tweetData = _readJSON('var/tweet_test.json')
# Punctuation to be removed.
mySymbols = punctuation.replace(u'#', u'').replace(u'@', u'')
wo... | |
45e9e53bfb857e9658e2c42dc9fd8542da6fbf8e | scripts/sync_local_file_with_swift.py | scripts/sync_local_file_with_swift.py | #!/usr/bin/env python
import os
import io
import tqdm
from dci import dci_config
from dci.db import models
from sqlalchemy import sql
conf = dci_config.generate_conf()
swift = dci_config.get_store()
engine = dci_config.get_engine(conf).connect()
_TABLE = models.FILES
# Calculate the total files to sync
file_list =... | Add a script to sync FS files to Swift | Add a script to sync FS files to Swift
Change-Id: I7a475177dd008040582943f7924a3f26df1df638
| Python | apache-2.0 | redhat-cip/dci-control-server,enovance/dci-control-server,redhat-cip/dci-control-server,enovance/dci-control-server | Add a script to sync FS files to Swift
Change-Id: I7a475177dd008040582943f7924a3f26df1df638 | #!/usr/bin/env python
import os
import io
import tqdm
from dci import dci_config
from dci.db import models
from sqlalchemy import sql
conf = dci_config.generate_conf()
swift = dci_config.get_store()
engine = dci_config.get_engine(conf).connect()
_TABLE = models.FILES
# Calculate the total files to sync
file_list =... | <commit_before><commit_msg>Add a script to sync FS files to Swift
Change-Id: I7a475177dd008040582943f7924a3f26df1df638<commit_after> | #!/usr/bin/env python
import os
import io
import tqdm
from dci import dci_config
from dci.db import models
from sqlalchemy import sql
conf = dci_config.generate_conf()
swift = dci_config.get_store()
engine = dci_config.get_engine(conf).connect()
_TABLE = models.FILES
# Calculate the total files to sync
file_list =... | Add a script to sync FS files to Swift
Change-Id: I7a475177dd008040582943f7924a3f26df1df638#!/usr/bin/env python
import os
import io
import tqdm
from dci import dci_config
from dci.db import models
from sqlalchemy import sql
conf = dci_config.generate_conf()
swift = dci_config.get_store()
engine = dci_config.get_en... | <commit_before><commit_msg>Add a script to sync FS files to Swift
Change-Id: I7a475177dd008040582943f7924a3f26df1df638<commit_after>#!/usr/bin/env python
import os
import io
import tqdm
from dci import dci_config
from dci.db import models
from sqlalchemy import sql
conf = dci_config.generate_conf()
swift = dci_conf... | |
7cee0a3ac98ecde609cb6077a4b1490b1751838b | cardbox/card_forms.py | cardbox/card_forms.py | from django.forms import Textarea, ModelForm
from card_model import Card
class CardForm(ModelForm):
"""The basic form for updating or editing cards"""
class Meta:
model = Card
fields = ('front', 'back')
widgets = {
'front': Textarea(attrs={'class': "form-control"}),
... | Add custom card model form for edit and create | Add custom card model form for edit and create
| Python | mit | DummyDivision/Tsune,DummyDivision/Tsune,DummyDivision/Tsune | Add custom card model form for edit and create | from django.forms import Textarea, ModelForm
from card_model import Card
class CardForm(ModelForm):
"""The basic form for updating or editing cards"""
class Meta:
model = Card
fields = ('front', 'back')
widgets = {
'front': Textarea(attrs={'class': "form-control"}),
... | <commit_before><commit_msg>Add custom card model form for edit and create<commit_after> | from django.forms import Textarea, ModelForm
from card_model import Card
class CardForm(ModelForm):
"""The basic form for updating or editing cards"""
class Meta:
model = Card
fields = ('front', 'back')
widgets = {
'front': Textarea(attrs={'class': "form-control"}),
... | Add custom card model form for edit and createfrom django.forms import Textarea, ModelForm
from card_model import Card
class CardForm(ModelForm):
"""The basic form for updating or editing cards"""
class Meta:
model = Card
fields = ('front', 'back')
widgets = {
'front': Tex... | <commit_before><commit_msg>Add custom card model form for edit and create<commit_after>from django.forms import Textarea, ModelForm
from card_model import Card
class CardForm(ModelForm):
"""The basic form for updating or editing cards"""
class Meta:
model = Card
fields = ('front', 'back')
... | |
b2b62818345f8062e42b4cfdc19e389cbc430efb | regscrape/sec_cftc/commands/sec_cftc_name_dockets.py | regscrape/sec_cftc/commands/sec_cftc_name_dockets.py | GEVENT = False
from regs_models import *
import datetime
def run():
for docket in Docket.objects(source="sec_cftc", scraped="no"):
now = datetime.datetime.now()
if not docket.title:
candidates = list(Doc.objects(docket_id=docket.id, type__in=("rule", "proposed_rule", "notice")))
... | Add docket namer for SEC/CFTC. | Add docket namer for SEC/CFTC.
| Python | bsd-3-clause | sunlightlabs/regulations-scraper,sunlightlabs/regulations-scraper,sunlightlabs/regulations-scraper | Add docket namer for SEC/CFTC. | GEVENT = False
from regs_models import *
import datetime
def run():
for docket in Docket.objects(source="sec_cftc", scraped="no"):
now = datetime.datetime.now()
if not docket.title:
candidates = list(Doc.objects(docket_id=docket.id, type__in=("rule", "proposed_rule", "notice")))
... | <commit_before><commit_msg>Add docket namer for SEC/CFTC.<commit_after> | GEVENT = False
from regs_models import *
import datetime
def run():
for docket in Docket.objects(source="sec_cftc", scraped="no"):
now = datetime.datetime.now()
if not docket.title:
candidates = list(Doc.objects(docket_id=docket.id, type__in=("rule", "proposed_rule", "notice")))
... | Add docket namer for SEC/CFTC.GEVENT = False
from regs_models import *
import datetime
def run():
for docket in Docket.objects(source="sec_cftc", scraped="no"):
now = datetime.datetime.now()
if not docket.title:
candidates = list(Doc.objects(docket_id=docket.id, type__in=("rule", "prop... | <commit_before><commit_msg>Add docket namer for SEC/CFTC.<commit_after>GEVENT = False
from regs_models import *
import datetime
def run():
for docket in Docket.objects(source="sec_cftc", scraped="no"):
now = datetime.datetime.now()
if not docket.title:
candidates = list(Doc.objects(doc... | |
eb804fbf08822053c8d891ece3ebf206cad8a8b8 | es_synonyms/utils.py | es_synonyms/utils.py | import requests
from codecs import open
from requests.exceptions import MissingSchema, InvalidSchema, InvalidURL
from .parser import SynParser
def load_synonyms(path):
try:
r = requests.get(path)
content = r.text
except (MissingSchema, InvalidSchema, InvalidURL):
try:
with open(path, encoding='... | Add utility for quickly loading the synonym file | Add utility for quickly loading the synonym file
| Python | mit | prashnts/elasticsearch-synonyms,prashnts/elasticsearch-synonyms | Add utility for quickly loading the synonym file | import requests
from codecs import open
from requests.exceptions import MissingSchema, InvalidSchema, InvalidURL
from .parser import SynParser
def load_synonyms(path):
try:
r = requests.get(path)
content = r.text
except (MissingSchema, InvalidSchema, InvalidURL):
try:
with open(path, encoding='... | <commit_before><commit_msg>Add utility for quickly loading the synonym file<commit_after> | import requests
from codecs import open
from requests.exceptions import MissingSchema, InvalidSchema, InvalidURL
from .parser import SynParser
def load_synonyms(path):
try:
r = requests.get(path)
content = r.text
except (MissingSchema, InvalidSchema, InvalidURL):
try:
with open(path, encoding='... | Add utility for quickly loading the synonym fileimport requests
from codecs import open
from requests.exceptions import MissingSchema, InvalidSchema, InvalidURL
from .parser import SynParser
def load_synonyms(path):
try:
r = requests.get(path)
content = r.text
except (MissingSchema, InvalidSchema, Invali... | <commit_before><commit_msg>Add utility for quickly loading the synonym file<commit_after>import requests
from codecs import open
from requests.exceptions import MissingSchema, InvalidSchema, InvalidURL
from .parser import SynParser
def load_synonyms(path):
try:
r = requests.get(path)
content = r.text
exc... | |
575580d005802d1920402b385bfe963bb4390fac | data/Crumb_data/Crumb_data_loading.py | data/Crumb_data/Crumb_data_loading.py |
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#import sys #(just for version number)
#import matplotlib #(just for version number)
#print('Python version ' + sys.version)
#print('Pandas version ' + pd.__version__)
#print('Matplotlib version ' + matplotlib.__ve... | Add an example python code for loading the resulting data | Add an example python code for loading the resulting data
| Python | bsd-3-clause | mirams/PyHillFit,mirams/PyHillFit,mirams/PyHillFit | Add an example python code for loading the resulting data |
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#import sys #(just for version number)
#import matplotlib #(just for version number)
#print('Python version ' + sys.version)
#print('Pandas version ' + pd.__version__)
#print('Matplotlib version ' + matplotlib.__ve... | <commit_before><commit_msg>Add an example python code for loading the resulting data<commit_after> |
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#import sys #(just for version number)
#import matplotlib #(just for version number)
#print('Python version ' + sys.version)
#print('Pandas version ' + pd.__version__)
#print('Matplotlib version ' + matplotlib.__ve... | Add an example python code for loading the resulting data
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#import sys #(just for version number)
#import matplotlib #(just for version number)
#print('Python version ' + sys.version)
#print('Pandas version ' + pd.__... | <commit_before><commit_msg>Add an example python code for loading the resulting data<commit_after>
# coding: utf-8
# In[ ]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
#import sys #(just for version number)
#import matplotlib #(just for version number)
#print('Python version ' + sys.... | |
4665b59415138e900f46b176cd44f20f23eddf2a | django-mserve/settings-prestoprime.py | django-mserve/settings-prestoprime.py | # Do PrestoPRIME setup
PRESTOPRIME = True
DEFAULT_DELIVERY_SUCCESS_CONSTANT_MIN = 15.0
DEFAULT_DELIVERY_SUCCESS_MULTIPLIER_GB = 1.0
DELIVERY_SUCCESS_METRIC = "http://mserve/deliverySuccess"
if PRESTOPRIME:
CELERY_IMPORTS += ("prestoprime.tasks",)
INSTALLED_APPS += ('prestoprime',)
| Add prestoprime specific settings file. | Add prestoprime specific settings file.
| Python | lgpl-2.1 | it-innovation/MServe-PrestoPRIME | Add prestoprime specific settings file. | # Do PrestoPRIME setup
PRESTOPRIME = True
DEFAULT_DELIVERY_SUCCESS_CONSTANT_MIN = 15.0
DEFAULT_DELIVERY_SUCCESS_MULTIPLIER_GB = 1.0
DELIVERY_SUCCESS_METRIC = "http://mserve/deliverySuccess"
if PRESTOPRIME:
CELERY_IMPORTS += ("prestoprime.tasks",)
INSTALLED_APPS += ('prestoprime',)
| <commit_before><commit_msg>Add prestoprime specific settings file.<commit_after> | # Do PrestoPRIME setup
PRESTOPRIME = True
DEFAULT_DELIVERY_SUCCESS_CONSTANT_MIN = 15.0
DEFAULT_DELIVERY_SUCCESS_MULTIPLIER_GB = 1.0
DELIVERY_SUCCESS_METRIC = "http://mserve/deliverySuccess"
if PRESTOPRIME:
CELERY_IMPORTS += ("prestoprime.tasks",)
INSTALLED_APPS += ('prestoprime',)
| Add prestoprime specific settings file.# Do PrestoPRIME setup
PRESTOPRIME = True
DEFAULT_DELIVERY_SUCCESS_CONSTANT_MIN = 15.0
DEFAULT_DELIVERY_SUCCESS_MULTIPLIER_GB = 1.0
DELIVERY_SUCCESS_METRIC = "http://mserve/deliverySuccess"
if PRESTOPRIME:
CELERY_IMPORTS += ("prestoprime.tasks",)
INSTALLED_APPS += ('presto... | <commit_before><commit_msg>Add prestoprime specific settings file.<commit_after># Do PrestoPRIME setup
PRESTOPRIME = True
DEFAULT_DELIVERY_SUCCESS_CONSTANT_MIN = 15.0
DEFAULT_DELIVERY_SUCCESS_MULTIPLIER_GB = 1.0
DELIVERY_SUCCESS_METRIC = "http://mserve/deliverySuccess"
if PRESTOPRIME:
CELERY_IMPORTS += ("prestoprim... | |
a47c591b77720d342721e3ff3672145d574c65b6 | tests/test_cli.py | tests/test_cli.py | # coding: utf-8
""" Tests for pypel.cli.
THIS SOFTWARE IS UNDER BSD LICENSE.
Copyright (c) 2012-2015 Daniele Tricoli <[email protected]>
Read LICENSE for more informations.
"""
import unittest
from pypel.cli import Row
class RowTestCase(unittest.TestCase):
def test_empty(self):
row = Row()
se... | Add tests for Row class | Add tests for Row class
| Python | bsd-3-clause | eriol/pypel | Add tests for Row class | # coding: utf-8
""" Tests for pypel.cli.
THIS SOFTWARE IS UNDER BSD LICENSE.
Copyright (c) 2012-2015 Daniele Tricoli <[email protected]>
Read LICENSE for more informations.
"""
import unittest
from pypel.cli import Row
class RowTestCase(unittest.TestCase):
def test_empty(self):
row = Row()
se... | <commit_before><commit_msg>Add tests for Row class<commit_after> | # coding: utf-8
""" Tests for pypel.cli.
THIS SOFTWARE IS UNDER BSD LICENSE.
Copyright (c) 2012-2015 Daniele Tricoli <[email protected]>
Read LICENSE for more informations.
"""
import unittest
from pypel.cli import Row
class RowTestCase(unittest.TestCase):
def test_empty(self):
row = Row()
se... | Add tests for Row class# coding: utf-8
""" Tests for pypel.cli.
THIS SOFTWARE IS UNDER BSD LICENSE.
Copyright (c) 2012-2015 Daniele Tricoli <[email protected]>
Read LICENSE for more informations.
"""
import unittest
from pypel.cli import Row
class RowTestCase(unittest.TestCase):
def test_empty(self):
... | <commit_before><commit_msg>Add tests for Row class<commit_after># coding: utf-8
""" Tests for pypel.cli.
THIS SOFTWARE IS UNDER BSD LICENSE.
Copyright (c) 2012-2015 Daniele Tricoli <[email protected]>
Read LICENSE for more informations.
"""
import unittest
from pypel.cli import Row
class RowTestCase(unittest.TestC... | |
39df7991e3e305fb54b79012a9d4ec9719deed6c | tests/test_set.py | tests/test_set.py | from thingstance import Thing
def test_tags_are_a_set():
thing = Thing(fields={'latitude', 'longitude'})
assert thing.fields == {'latitude', 'longitude'}
thing = Thing(fields={'latitude', 'longitude', 'altitude'})
assert thing.fields == {'altitude', 'latitude', 'longitude'}
thing = Thing(fields=... | Test fields property is a set | Test fields property is a set
| Python | mit | openregister/openregister-python,openregister/entry,byrondover/entry | Test fields property is a set | from thingstance import Thing
def test_tags_are_a_set():
thing = Thing(fields={'latitude', 'longitude'})
assert thing.fields == {'latitude', 'longitude'}
thing = Thing(fields={'latitude', 'longitude', 'altitude'})
assert thing.fields == {'altitude', 'latitude', 'longitude'}
thing = Thing(fields=... | <commit_before><commit_msg>Test fields property is a set<commit_after> | from thingstance import Thing
def test_tags_are_a_set():
thing = Thing(fields={'latitude', 'longitude'})
assert thing.fields == {'latitude', 'longitude'}
thing = Thing(fields={'latitude', 'longitude', 'altitude'})
assert thing.fields == {'altitude', 'latitude', 'longitude'}
thing = Thing(fields=... | Test fields property is a setfrom thingstance import Thing
def test_tags_are_a_set():
thing = Thing(fields={'latitude', 'longitude'})
assert thing.fields == {'latitude', 'longitude'}
thing = Thing(fields={'latitude', 'longitude', 'altitude'})
assert thing.fields == {'altitude', 'latitude', 'longitude... | <commit_before><commit_msg>Test fields property is a set<commit_after>from thingstance import Thing
def test_tags_are_a_set():
thing = Thing(fields={'latitude', 'longitude'})
assert thing.fields == {'latitude', 'longitude'}
thing = Thing(fields={'latitude', 'longitude', 'altitude'})
assert thing.fiel... | |
89cb0388c513f01f3dc00829bf21d50feed7ba27 | rest/utils.py | rest/utils.py | from django.http import HttpResponse
from rest_framework.views import exception_handler
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into J... | Add custom exception handler for API. | Add custom exception handler for API.
| Python | apache-2.0 | CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project,CMPUT404W17T06/CMPUT404-project | Add custom exception handler for API. | from django.http import HttpResponse
from rest_framework.views import exception_handler
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into J... | <commit_before><commit_msg>Add custom exception handler for API.<commit_after> | from django.http import HttpResponse
from rest_framework.views import exception_handler
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpResponse that renders its content into J... | Add custom exception handler for API.from django.http import HttpResponse
from rest_framework.views import exception_handler
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONResponse(HttpResponse):
"""
An HttpRes... | <commit_before><commit_msg>Add custom exception handler for API.<commit_after>from django.http import HttpResponse
from rest_framework.views import exception_handler
from rest_framework.renderers import JSONRenderer
# Initially taken from
# http://www.django-rest-framework.org/tutorial/1-serialization/
class JSONRespo... | |
b1354f4b5f59706bbf8a0f6e39457564c5949a9c | samples/_create_webmap.py | samples/_create_webmap.py | """
create a webmap from code,
add a dynamic layer, with dynamiclayer option for changing the symbols
"""
import arcrest
import arcrest.webmap
import arcrest.agol
import json
USER = "XXXXX"
PASSWORD = "xxxxxx"
ORGANISATION = "xxxxxx"
wm = arcrest.webmap.layers.AGSMapServiceLayer("http://sa... | Add a sample on WebMap Serialization | Add a sample on WebMap Serialization
| Python | apache-2.0 | Esri/ArcREST,pLeBlanc93/ArcREST,jgravois/ArcREST,BrunoCaimar/ArcREST,DShokes/ArcREST,adegwerth/ArcREST,achapkowski/ArcREST | Add a sample on WebMap Serialization | """
create a webmap from code,
add a dynamic layer, with dynamiclayer option for changing the symbols
"""
import arcrest
import arcrest.webmap
import arcrest.agol
import json
USER = "XXXXX"
PASSWORD = "xxxxxx"
ORGANISATION = "xxxxxx"
wm = arcrest.webmap.layers.AGSMapServiceLayer("http://sa... | <commit_before><commit_msg>Add a sample on WebMap Serialization<commit_after> | """
create a webmap from code,
add a dynamic layer, with dynamiclayer option for changing the symbols
"""
import arcrest
import arcrest.webmap
import arcrest.agol
import json
USER = "XXXXX"
PASSWORD = "xxxxxx"
ORGANISATION = "xxxxxx"
wm = arcrest.webmap.layers.AGSMapServiceLayer("http://sa... | Add a sample on WebMap Serialization"""
create a webmap from code,
add a dynamic layer, with dynamiclayer option for changing the symbols
"""
import arcrest
import arcrest.webmap
import arcrest.agol
import json
USER = "XXXXX"
PASSWORD = "xxxxxx"
ORGANISATION = "xxxxxx"
wm = arcrest.webmap.... | <commit_before><commit_msg>Add a sample on WebMap Serialization<commit_after>"""
create a webmap from code,
add a dynamic layer, with dynamiclayer option for changing the symbols
"""
import arcrest
import arcrest.webmap
import arcrest.agol
import json
USER = "XXXXX"
PASSWORD = "xxxxxx"
ORGANI... | |
12d922665ad1bba8a696ea35a1c0ced45fccd907 | pylibofp/__main__.py | pylibofp/__main__.py | from .ofp_app import ofp_run
import importlib
import argparse
import sys
def main():
args = parse_args()
for module in args.modules:
import_module(module)
ofp_run()
def parse_args():
parser = argparse.ArgumentParser(
prog='ofp_app',
description='ofp_app runner',
epilog... | Add support for python -m. | Add support for python -m.
| Python | mit | byllyfish/pylibofp,byllyfish/pylibofp | Add support for python -m. | from .ofp_app import ofp_run
import importlib
import argparse
import sys
def main():
args = parse_args()
for module in args.modules:
import_module(module)
ofp_run()
def parse_args():
parser = argparse.ArgumentParser(
prog='ofp_app',
description='ofp_app runner',
epilog... | <commit_before><commit_msg>Add support for python -m.<commit_after> | from .ofp_app import ofp_run
import importlib
import argparse
import sys
def main():
args = parse_args()
for module in args.modules:
import_module(module)
ofp_run()
def parse_args():
parser = argparse.ArgumentParser(
prog='ofp_app',
description='ofp_app runner',
epilog... | Add support for python -m.from .ofp_app import ofp_run
import importlib
import argparse
import sys
def main():
args = parse_args()
for module in args.modules:
import_module(module)
ofp_run()
def parse_args():
parser = argparse.ArgumentParser(
prog='ofp_app',
description='ofp_a... | <commit_before><commit_msg>Add support for python -m.<commit_after>from .ofp_app import ofp_run
import importlib
import argparse
import sys
def main():
args = parse_args()
for module in args.modules:
import_module(module)
ofp_run()
def parse_args():
parser = argparse.ArgumentParser(
p... | |
71b80cbf4b519823ecc72f1f38196c738ccf7c11 | registration/urls.py | registration/urls.py | # created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... | # created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... | Change the default no of users from 9 | Change the default no of users from 9 | Python | mit | akshaya9/fosswebsite,Sparker0i/fosswebsite,akshayharidas/fosswebsite,csriharsha/fosswebsite,akshaya9/fosswebsite,csriharsha/fosswebsite,amfoss/fosswebsite,rahulk98/fosswebsite,akshayharidas/fosswebsite,navisk13/fosswebsite,akshayharidas/fosswebsite,amfoss/fosswebsite,Sparker0i/fosswebsite,manikishan/fosswebsite,csrihar... | # created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... | # created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... | <commit_before># created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
... | # created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... | # created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
url(r'^login... | <commit_before># created by Chirath R, [email protected]
from django.conf.urls import url
from django.contrib.auth.decorators import login_required
from django.views.generic import TemplateView
from registration.views import UserSignUpView, login, UserUpdateView, ProfileDetailView, ProfileListView
urlpatterns = [
... |
f4160538b9e55fa2f886a5b6e2a93a26ceb3d5da | tests/GIR/test_940_content_manager.py | tests/GIR/test_940_content_manager.py | # coding=utf-8
import sys
import struct
import unittest
import time
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestContentManagerJobCreate(unittest.TestCase):
mgd = None
bookstore = None
referen... | Test sql content manager. Refs gh-168 | Test sql content manager. Refs gh-168
| Python | lgpl-2.1 | midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core,midgardproject/midgard-core | Test sql content manager. Refs gh-168 | # coding=utf-8
import sys
import struct
import unittest
import time
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestContentManagerJobCreate(unittest.TestCase):
mgd = None
bookstore = None
referen... | <commit_before><commit_msg>Test sql content manager. Refs gh-168<commit_after> | # coding=utf-8
import sys
import struct
import unittest
import time
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestContentManagerJobCreate(unittest.TestCase):
mgd = None
bookstore = None
referen... | Test sql content manager. Refs gh-168# coding=utf-8
import sys
import struct
import unittest
import time
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestContentManagerJobCreate(unittest.TestCase):
mg... | <commit_before><commit_msg>Test sql content manager. Refs gh-168<commit_after># coding=utf-8
import sys
import struct
import unittest
import time
from test_000_config import TestConfig
from test_020_connection import TestConnection
from gi.repository import Midgard
from gi.repository import GObject
class TestContent... | |
35c264819bac12fcb3baf8a2a33d63dd916f5f86 | mezzanine_fluent_pages/mezzanine_layout_page/widgets.py | mezzanine_fluent_pages/mezzanine_layout_page/widgets.py | from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None, choices=()):
... | from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None, *args, **kwar... | Remove keyword argument and allow generic argument passing. | Remove keyword argument and allow generic argument passing.
| Python | bsd-2-clause | sjdines/mezzanine-fluent-pages,sjdines/mezzanine-fluent-pages,sjdines/mezzanine-fluent-pages | from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None, choices=()):
... | from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None, *args, **kwar... | <commit_before>from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None... | from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None, *args, **kwar... | from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None, choices=()):
... | <commit_before>from django.forms.widgets import Select
class LayoutSelector(Select):
"""
Modified `Select` class to select the original value.
This was adapted from `fluent_pages/pagetypes/fluent_pages/widgets
.py` in the `django-fluent-pages` app.
"""
def render(self, name, value, attrs=None... |
62bace1f2a326ab6ab660a23bc1776a1895f5f3d | piper/abc.py | piper/abc.py | import abc
import logbook
import jsonschema
from piper.utils import DotDict
class DynamicItem(object):
"""
Dynamic base class that defines things all Piper classes need.
Many parts of the piper infrastructure is about being able to dynamically
choose which classes should execute actions. This class ... | Add abstract base class for dynamic items | Add abstract base class for dynamic items
| Python | mit | thiderman/piper | Add abstract base class for dynamic items | import abc
import logbook
import jsonschema
from piper.utils import DotDict
class DynamicItem(object):
"""
Dynamic base class that defines things all Piper classes need.
Many parts of the piper infrastructure is about being able to dynamically
choose which classes should execute actions. This class ... | <commit_before><commit_msg>Add abstract base class for dynamic items<commit_after> | import abc
import logbook
import jsonschema
from piper.utils import DotDict
class DynamicItem(object):
"""
Dynamic base class that defines things all Piper classes need.
Many parts of the piper infrastructure is about being able to dynamically
choose which classes should execute actions. This class ... | Add abstract base class for dynamic itemsimport abc
import logbook
import jsonschema
from piper.utils import DotDict
class DynamicItem(object):
"""
Dynamic base class that defines things all Piper classes need.
Many parts of the piper infrastructure is about being able to dynamically
choose which cl... | <commit_before><commit_msg>Add abstract base class for dynamic items<commit_after>import abc
import logbook
import jsonschema
from piper.utils import DotDict
class DynamicItem(object):
"""
Dynamic base class that defines things all Piper classes need.
Many parts of the piper infrastructure is about bein... | |
5616a5a3987106654ca0c15d73d1db6c1b8c7f3d | distribution/create_linux_shortcuts.py | distribution/create_linux_shortcuts.py | #!/usr/bin/env python3
import sys
import os
import os.path as op
try:
import picasso
except ImportError:
print("This script must be run within an environment "
"in which picasso is installed!", file=sys.stderr)
raise
SUBCMD = ("average", "design", "filter", "localize", "render", "simulate")
SCRIPT_PAT... | Add script for creating shortcuts in linux | Add script for creating shortcuts in linux
| Python | mit | jungmannlab/picasso,jungmannlab/picasso,jungmannlab/picasso | Add script for creating shortcuts in linux | #!/usr/bin/env python3
import sys
import os
import os.path as op
try:
import picasso
except ImportError:
print("This script must be run within an environment "
"in which picasso is installed!", file=sys.stderr)
raise
SUBCMD = ("average", "design", "filter", "localize", "render", "simulate")
SCRIPT_PAT... | <commit_before><commit_msg>Add script for creating shortcuts in linux<commit_after> | #!/usr/bin/env python3
import sys
import os
import os.path as op
try:
import picasso
except ImportError:
print("This script must be run within an environment "
"in which picasso is installed!", file=sys.stderr)
raise
SUBCMD = ("average", "design", "filter", "localize", "render", "simulate")
SCRIPT_PAT... | Add script for creating shortcuts in linux#!/usr/bin/env python3
import sys
import os
import os.path as op
try:
import picasso
except ImportError:
print("This script must be run within an environment "
"in which picasso is installed!", file=sys.stderr)
raise
SUBCMD = ("average", "design", "filter", "l... | <commit_before><commit_msg>Add script for creating shortcuts in linux<commit_after>#!/usr/bin/env python3
import sys
import os
import os.path as op
try:
import picasso
except ImportError:
print("This script must be run within an environment "
"in which picasso is installed!", file=sys.stderr)
raise
SU... | |
b8cd62385b904ba536642c68eedd9316344bf822 | authenticate_imgur.py | authenticate_imgur.py | #!/usr/bin/env python3
from imgurpython import ImgurClient
import config
CONFIG_FILE = "config.yaml"
def authenticate():
conf = config.read_file(CONFIG_FILE)
# Get client ID and secret from auth.ini
client = ImgurClient(conf.imgur.client_id, conf.imgur.client_secret)
# Authorization flow, pin exa... | Add script to generate refresh_token | Add script to generate refresh_token
https://github.com/Imgur/imgurpython/blob/master/examples/auth.py
| Python | mit | FichteFoll/CodetalkIRCBot,FichteFoll/TelegramIRCImageProxy,codetalkio/TelegramIRCImageProxy | Add script to generate refresh_token
https://github.com/Imgur/imgurpython/blob/master/examples/auth.py | #!/usr/bin/env python3
from imgurpython import ImgurClient
import config
CONFIG_FILE = "config.yaml"
def authenticate():
conf = config.read_file(CONFIG_FILE)
# Get client ID and secret from auth.ini
client = ImgurClient(conf.imgur.client_id, conf.imgur.client_secret)
# Authorization flow, pin exa... | <commit_before><commit_msg>Add script to generate refresh_token
https://github.com/Imgur/imgurpython/blob/master/examples/auth.py<commit_after> | #!/usr/bin/env python3
from imgurpython import ImgurClient
import config
CONFIG_FILE = "config.yaml"
def authenticate():
conf = config.read_file(CONFIG_FILE)
# Get client ID and secret from auth.ini
client = ImgurClient(conf.imgur.client_id, conf.imgur.client_secret)
# Authorization flow, pin exa... | Add script to generate refresh_token
https://github.com/Imgur/imgurpython/blob/master/examples/auth.py#!/usr/bin/env python3
from imgurpython import ImgurClient
import config
CONFIG_FILE = "config.yaml"
def authenticate():
conf = config.read_file(CONFIG_FILE)
# Get client ID and secret from auth.ini
... | <commit_before><commit_msg>Add script to generate refresh_token
https://github.com/Imgur/imgurpython/blob/master/examples/auth.py<commit_after>#!/usr/bin/env python3
from imgurpython import ImgurClient
import config
CONFIG_FILE = "config.yaml"
def authenticate():
conf = config.read_file(CONFIG_FILE)
# Get... | |
9831af65019e245acd65ebd181d6936392d1d2ce | examples/dump_category.py | examples/dump_category.py | """dump_category.py - utility script for mps_edits."""
import sys
import json
import getopt
import urllib
import urllib2
class ArticleFetchError(Exception):
pass
def get_articles(base, category):
regular_params = [
('cmtitle', "Category:%s" % (category)),
('action', 'query'),
('list',... | Add example script that dumps a wikipedia category | Add example script that dumps a wikipedia category
| Python | mit | flexo/wikitweets | Add example script that dumps a wikipedia category | """dump_category.py - utility script for mps_edits."""
import sys
import json
import getopt
import urllib
import urllib2
class ArticleFetchError(Exception):
pass
def get_articles(base, category):
regular_params = [
('cmtitle', "Category:%s" % (category)),
('action', 'query'),
('list',... | <commit_before><commit_msg>Add example script that dumps a wikipedia category<commit_after> | """dump_category.py - utility script for mps_edits."""
import sys
import json
import getopt
import urllib
import urllib2
class ArticleFetchError(Exception):
pass
def get_articles(base, category):
regular_params = [
('cmtitle', "Category:%s" % (category)),
('action', 'query'),
('list',... | Add example script that dumps a wikipedia category"""dump_category.py - utility script for mps_edits."""
import sys
import json
import getopt
import urllib
import urllib2
class ArticleFetchError(Exception):
pass
def get_articles(base, category):
regular_params = [
('cmtitle', "Category:%s" % (categor... | <commit_before><commit_msg>Add example script that dumps a wikipedia category<commit_after>"""dump_category.py - utility script for mps_edits."""
import sys
import json
import getopt
import urllib
import urllib2
class ArticleFetchError(Exception):
pass
def get_articles(base, category):
regular_params = [
... | |
76c8a5ca367e2a22953cde9541f61d564de5f6ff | temba/channels/migrations/0007_auto_20150402_2103.py | temba/channels/migrations/0007_auto_20150402_2103.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('channels', '0006_channel_bod'),
]
operations = [
migrations.AlterField(
model_name='channel',
name='... | Add migration for HX channel type | Add migration for HX channel type
| Python | agpl-3.0 | reyrodrigues/EU-SMS,ewheeler/rapidpro,pulilab/rapidpro,ewheeler/rapidpro,Thapelo-Tsotetsi/rapidpro,tsotetsi/textily-web,harrissoerja/rapidpro,reyrodrigues/EU-SMS,harrissoerja/rapidpro,pulilab/rapidpro,praekelt/rapidpro,pulilab/rapidpro,ewheeler/rapidpro,tsotetsi/textily-web,praekelt/rapidpro,pulilab/rapidpro,harrissoer... | Add migration for HX channel type | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('channels', '0006_channel_bod'),
]
operations = [
migrations.AlterField(
model_name='channel',
name='... | <commit_before><commit_msg>Add migration for HX channel type<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('channels', '0006_channel_bod'),
]
operations = [
migrations.AlterField(
model_name='channel',
name='... | Add migration for HX channel type# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('channels', '0006_channel_bod'),
]
operations = [
migrations.AlterField(
model_n... | <commit_before><commit_msg>Add migration for HX channel type<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('channels', '0006_channel_bod'),
]
operations = [
m... | |
09bb45941583a126429e3cc27b2fb4bb6b01d56c | Car2know/analysis/QueryData.py | Car2know/analysis/QueryData.py | from urllib2 import Request, urlopen, URLError
from datetime import time
from datetime import date
import datetime
import time
import sys
import os
# Using request and urlopen to get data from car2go's API
# We need the city name and consumer_key
def querydata():
request = Request("http://www.car2go... | Move the file to correct path | Move the file to correct path
| Python | mit | gengho/Car2know,gengho/Car2know | Move the file to correct path | from urllib2 import Request, urlopen, URLError
from datetime import time
from datetime import date
import datetime
import time
import sys
import os
# Using request and urlopen to get data from car2go's API
# We need the city name and consumer_key
def querydata():
request = Request("http://www.car2go... | <commit_before><commit_msg>Move the file to correct path<commit_after> | from urllib2 import Request, urlopen, URLError
from datetime import time
from datetime import date
import datetime
import time
import sys
import os
# Using request and urlopen to get data from car2go's API
# We need the city name and consumer_key
def querydata():
request = Request("http://www.car2go... | Move the file to correct pathfrom urllib2 import Request, urlopen, URLError
from datetime import time
from datetime import date
import datetime
import time
import sys
import os
# Using request and urlopen to get data from car2go's API
# We need the city name and consumer_key
def querydata():
request... | <commit_before><commit_msg>Move the file to correct path<commit_after>from urllib2 import Request, urlopen, URLError
from datetime import time
from datetime import date
import datetime
import time
import sys
import os
# Using request and urlopen to get data from car2go's API
# We need the city name and co... | |
ed7bbd2ed53a2b3009acace7b8399a35842a4532 | nameless/visitors.py | nameless/visitors.py | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
visitors.py
@author ejnp
"""
import ast
import lambda_calculus_ast
class FreeVariables(ast.NodeVisitor):
"""Visits each node of a lambda calculus abstract syntax tree and
determines which variables (if any) are unbound. Ultimately provides a set
of string v... | Add a visitor for determining free variables | Add a visitor for determining free variables
| Python | mit | ElliotPenson/nameless | Add a visitor for determining free variables | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
visitors.py
@author ejnp
"""
import ast
import lambda_calculus_ast
class FreeVariables(ast.NodeVisitor):
"""Visits each node of a lambda calculus abstract syntax tree and
determines which variables (if any) are unbound. Ultimately provides a set
of string v... | <commit_before><commit_msg>Add a visitor for determining free variables<commit_after> | #!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
visitors.py
@author ejnp
"""
import ast
import lambda_calculus_ast
class FreeVariables(ast.NodeVisitor):
"""Visits each node of a lambda calculus abstract syntax tree and
determines which variables (if any) are unbound. Ultimately provides a set
of string v... | Add a visitor for determining free variables#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
visitors.py
@author ejnp
"""
import ast
import lambda_calculus_ast
class FreeVariables(ast.NodeVisitor):
"""Visits each node of a lambda calculus abstract syntax tree and
determines which variables (if any) are unboun... | <commit_before><commit_msg>Add a visitor for determining free variables<commit_after>#!/usr/bin/python
# -*- coding: UTF-8 -*-
"""
visitors.py
@author ejnp
"""
import ast
import lambda_calculus_ast
class FreeVariables(ast.NodeVisitor):
"""Visits each node of a lambda calculus abstract syntax tree and
deter... | |
f5fb2f955843d802fb2a7225ee3aac98eac640e5 | output/pprint_json.py | output/pprint_json.py | #!/bin/env python3
import json
import pprint
import sys
json_string = ""
for line in sys.stdin.readlines():
json_string = "{}{}".format(json_string, line.strip())
item = json.loads(json_string)
pprint.pprint(item)
| Add pretty print json output | Add pretty print json output
| Python | mit | dgengtek/scripts,dgengtek/scripts | Add pretty print json output | #!/bin/env python3
import json
import pprint
import sys
json_string = ""
for line in sys.stdin.readlines():
json_string = "{}{}".format(json_string, line.strip())
item = json.loads(json_string)
pprint.pprint(item)
| <commit_before><commit_msg>Add pretty print json output<commit_after> | #!/bin/env python3
import json
import pprint
import sys
json_string = ""
for line in sys.stdin.readlines():
json_string = "{}{}".format(json_string, line.strip())
item = json.loads(json_string)
pprint.pprint(item)
| Add pretty print json output#!/bin/env python3
import json
import pprint
import sys
json_string = ""
for line in sys.stdin.readlines():
json_string = "{}{}".format(json_string, line.strip())
item = json.loads(json_string)
pprint.pprint(item)
| <commit_before><commit_msg>Add pretty print json output<commit_after>#!/bin/env python3
import json
import pprint
import sys
json_string = ""
for line in sys.stdin.readlines():
json_string = "{}{}".format(json_string, line.strip())
item = json.loads(json_string)
pprint.pprint(item)
| |
f96d8119814488061c2bb6ef71bd8f054c69f082 | app/api_preferences.py | app/api_preferences.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import configuration
RPX_REALM = 'mils-alumni-secure'
rpxnow = {
'api_auth_url': 'https://rpxnow.com/api/v2/auth_info',
'api_key': 'b771106aa4e3ef377c359495f52f2c99120f36ac',
'auth_token_url': configuration.ROOT_URL + 'auth_token'
'realm': RPX_REALM,
'... | Add api preferences for rpxnow | Add api preferences for rpxnow
| Python | mit | yesudeep/old-milsalumni,yesudeep/old-milsalumni,yesudeep/old-milsalumni | Add api preferences for rpxnow | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import configuration
RPX_REALM = 'mils-alumni-secure'
rpxnow = {
'api_auth_url': 'https://rpxnow.com/api/v2/auth_info',
'api_key': 'b771106aa4e3ef377c359495f52f2c99120f36ac',
'auth_token_url': configuration.ROOT_URL + 'auth_token'
'realm': RPX_REALM,
'... | <commit_before><commit_msg>Add api preferences for rpxnow<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import configuration
RPX_REALM = 'mils-alumni-secure'
rpxnow = {
'api_auth_url': 'https://rpxnow.com/api/v2/auth_info',
'api_key': 'b771106aa4e3ef377c359495f52f2c99120f36ac',
'auth_token_url': configuration.ROOT_URL + 'auth_token'
'realm': RPX_REALM,
'... | Add api preferences for rpxnow#!/usr/bin/env python
# -*- coding: utf-8 -*-
import configuration
RPX_REALM = 'mils-alumni-secure'
rpxnow = {
'api_auth_url': 'https://rpxnow.com/api/v2/auth_info',
'api_key': 'b771106aa4e3ef377c359495f52f2c99120f36ac',
'auth_token_url': configuration.ROOT_URL + 'auth_token'... | <commit_before><commit_msg>Add api preferences for rpxnow<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
import configuration
RPX_REALM = 'mils-alumni-secure'
rpxnow = {
'api_auth_url': 'https://rpxnow.com/api/v2/auth_info',
'api_key': 'b771106aa4e3ef377c359495f52f2c99120f36ac',
'auth_token_ur... | |
6072022e2debeb4dcd75e4969bd2beb16bac8827 | source/sqlserver_ado/fields.py | source/sqlserver_ado/fields.py | """This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
def to_python(self, value):
if ... | """This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
from django.forms import ValidationError
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
... | Fix import error for custom Field validation | Fix import error for custom Field validation
| Python | mit | theoriginalgri/django-mssql,theoriginalgri/django-mssql | """This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
def to_python(self, value):
if ... | """This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
from django.forms import ValidationError
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
... | <commit_before>"""This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
def to_python(self, value... | """This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
from django.forms import ValidationError
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
... | """This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
def to_python(self, value):
if ... | <commit_before>"""This module provides SQL Server specific fields for Django models."""
from django.db.models import AutoField, ForeignKey, IntegerField
class BigAutoField(AutoField):
"""A bigint IDENTITY field"""
def get_internal_type(self):
return "BigAutoField"
def to_python(self, value... |
1a0fe91b6ab9a90573b0f35d6ff81e7f0523acb4 | praw/util/__init__.py | praw/util/__init__.py | """Package imports for utilities."""
__all__ = ("cache",)
| """Package imports for utilities."""
import re
__all__ = ("cache", "camel_to_snake", "snake_case_keys")
_re_camel_to_snake = re.compile(r"([a-z0-9](?=[A-Z])|[A-Z](?=[A-Z][a-z]))")
def camel_to_snake(name):
"""Convert `name` from camelCase to snake_case."""
return _re_camel_to_snake.sub(r"\1_", name).lower(... | Add `camel_to_snake()` and `snake_case_keys()` to praw.util | Add `camel_to_snake()` and `snake_case_keys()` to praw.util
| Python | bsd-2-clause | praw-dev/praw,gschizas/praw,leviroth/praw,praw-dev/praw,gschizas/praw,leviroth/praw | """Package imports for utilities."""
__all__ = ("cache",)
Add `camel_to_snake()` and `snake_case_keys()` to praw.util | """Package imports for utilities."""
import re
__all__ = ("cache", "camel_to_snake", "snake_case_keys")
_re_camel_to_snake = re.compile(r"([a-z0-9](?=[A-Z])|[A-Z](?=[A-Z][a-z]))")
def camel_to_snake(name):
"""Convert `name` from camelCase to snake_case."""
return _re_camel_to_snake.sub(r"\1_", name).lower(... | <commit_before>"""Package imports for utilities."""
__all__ = ("cache",)
<commit_msg>Add `camel_to_snake()` and `snake_case_keys()` to praw.util<commit_after> | """Package imports for utilities."""
import re
__all__ = ("cache", "camel_to_snake", "snake_case_keys")
_re_camel_to_snake = re.compile(r"([a-z0-9](?=[A-Z])|[A-Z](?=[A-Z][a-z]))")
def camel_to_snake(name):
"""Convert `name` from camelCase to snake_case."""
return _re_camel_to_snake.sub(r"\1_", name).lower(... | """Package imports for utilities."""
__all__ = ("cache",)
Add `camel_to_snake()` and `snake_case_keys()` to praw.util"""Package imports for utilities."""
import re
__all__ = ("cache", "camel_to_snake", "snake_case_keys")
_re_camel_to_snake = re.compile(r"([a-z0-9](?=[A-Z])|[A-Z](?=[A-Z][a-z]))")
def camel_to_snak... | <commit_before>"""Package imports for utilities."""
__all__ = ("cache",)
<commit_msg>Add `camel_to_snake()` and `snake_case_keys()` to praw.util<commit_after>"""Package imports for utilities."""
import re
__all__ = ("cache", "camel_to_snake", "snake_case_keys")
_re_camel_to_snake = re.compile(r"([a-z0-9](?=[A-Z])|[... |
4b3eb563a50a601bcb24a358f6ea63690cffeb27 | raiden/network/nat.py | raiden/network/nat.py | import miniupnpc
from ethereum import slogging
MAX_PORT = 65535
RAIDEN_IDENTIFICATOR = "raiden-network udp service"
log = slogging.getLogger(__name__)
def connect():
"""Try to connect to the router.
Returns:
u (miniupnc.UPnP): the connected upnp-instance
router (string): the connection infor... | Add minimalistic UPnP NAT punching | Add minimalistic UPnP NAT punching
This is not in use yet.
| Python | mit | charles-cooper/raiden,hackaugusto/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,tomashaber/raiden,hackaugusto/raiden,tomaaron/raiden,tomaaron/raiden,tomaaron/raiden,tomashaber/raiden,tomaaron/raiden,charles-cooper/raiden | Add minimalistic UPnP NAT punching
This is not in use yet. | import miniupnpc
from ethereum import slogging
MAX_PORT = 65535
RAIDEN_IDENTIFICATOR = "raiden-network udp service"
log = slogging.getLogger(__name__)
def connect():
"""Try to connect to the router.
Returns:
u (miniupnc.UPnP): the connected upnp-instance
router (string): the connection infor... | <commit_before><commit_msg>Add minimalistic UPnP NAT punching
This is not in use yet.<commit_after> | import miniupnpc
from ethereum import slogging
MAX_PORT = 65535
RAIDEN_IDENTIFICATOR = "raiden-network udp service"
log = slogging.getLogger(__name__)
def connect():
"""Try to connect to the router.
Returns:
u (miniupnc.UPnP): the connected upnp-instance
router (string): the connection infor... | Add minimalistic UPnP NAT punching
This is not in use yet.import miniupnpc
from ethereum import slogging
MAX_PORT = 65535
RAIDEN_IDENTIFICATOR = "raiden-network udp service"
log = slogging.getLogger(__name__)
def connect():
"""Try to connect to the router.
Returns:
u (miniupnc.UPnP): the connected ... | <commit_before><commit_msg>Add minimalistic UPnP NAT punching
This is not in use yet.<commit_after>import miniupnpc
from ethereum import slogging
MAX_PORT = 65535
RAIDEN_IDENTIFICATOR = "raiden-network udp service"
log = slogging.getLogger(__name__)
def connect():
"""Try to connect to the router.
Returns:
... | |
4ad58714dc0fd8dfd464f804ca356328beed1ff2 | Cloud.py | Cloud.py | from abc import ABCMeta, abstractmethod
class Cloud(object):
__metaclass__ = ABCMeta
def __init__(self):
self.driver = None
self.activeNode = None
@abstractmethod
def create(self):
raise Exception('Not implemented')
@abstractmethod
def destroy(self):
raise Ex... | Add a base class for OpenStack and Amazon. | Add a base class for OpenStack and Amazon.
| Python | mit | minidfx/Cloud-Python- | Add a base class for OpenStack and Amazon. | from abc import ABCMeta, abstractmethod
class Cloud(object):
__metaclass__ = ABCMeta
def __init__(self):
self.driver = None
self.activeNode = None
@abstractmethod
def create(self):
raise Exception('Not implemented')
@abstractmethod
def destroy(self):
raise Ex... | <commit_before><commit_msg>Add a base class for OpenStack and Amazon.<commit_after> | from abc import ABCMeta, abstractmethod
class Cloud(object):
__metaclass__ = ABCMeta
def __init__(self):
self.driver = None
self.activeNode = None
@abstractmethod
def create(self):
raise Exception('Not implemented')
@abstractmethod
def destroy(self):
raise Ex... | Add a base class for OpenStack and Amazon.from abc import ABCMeta, abstractmethod
class Cloud(object):
__metaclass__ = ABCMeta
def __init__(self):
self.driver = None
self.activeNode = None
@abstractmethod
def create(self):
raise Exception('Not implemented')
@abstractmeth... | <commit_before><commit_msg>Add a base class for OpenStack and Amazon.<commit_after>from abc import ABCMeta, abstractmethod
class Cloud(object):
__metaclass__ = ABCMeta
def __init__(self):
self.driver = None
self.activeNode = None
@abstractmethod
def create(self):
raise Except... | |
91417abaeb2cdc3cfafdc96a5b30f31d0ce8be80 | php4dvd/test_login.py | php4dvd/test_login.py | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import unittest
class Login(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox(capabilities={'native_events':True})
self.driver.implicitly_wait(10)
self.ba... | Move login test to a file by itself. | Move login test to a file by itself.
| Python | bsd-2-clause | bsamorodov/selenium-py-training-samorodov | Move login test to a file by itself. | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import unittest
class Login(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox(capabilities={'native_events':True})
self.driver.implicitly_wait(10)
self.ba... | <commit_before><commit_msg>Move login test to a file by itself.<commit_after> | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import unittest
class Login(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox(capabilities={'native_events':True})
self.driver.implicitly_wait(10)
self.ba... | Move login test to a file by itself.# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import unittest
class Login(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox(capabilities={'native_events':True})
self.driver... | <commit_before><commit_msg>Move login test to a file by itself.<commit_after># -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
import unittest
class Login(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox(capabilities={'... | |
e835c8e1dd368d98eeb3d706983e803f1bb91a3a | 2018/CodingInterview/3주차/code_sc.py | 2018/CodingInterview/3주차/code_sc.py |
# input_data = """
# 10101111
# 01111101
# 11001110
# 00000010
# 2
# 3 -1
# 1 1
# """
# matrix_data = input_data.strip().split("\n")[:4]
#
# n_direction_data = input_data.strip().split("\n")[5:]
#
# matrix = [deque(list(line)) for line in matrix_data]
# step = int(input_data.strip().split("\n")[4])
# n, direction = zi... | Add 3rd week assignment of SC | Add 3rd week assignment of SC
| Python | mit | TeamLab/lab_study_group,kjihee/lab_study_group | Add 3rd week assignment of SC |
# input_data = """
# 10101111
# 01111101
# 11001110
# 00000010
# 2
# 3 -1
# 1 1
# """
# matrix_data = input_data.strip().split("\n")[:4]
#
# n_direction_data = input_data.strip().split("\n")[5:]
#
# matrix = [deque(list(line)) for line in matrix_data]
# step = int(input_data.strip().split("\n")[4])
# n, direction = zi... | <commit_before><commit_msg>Add 3rd week assignment of SC<commit_after> |
# input_data = """
# 10101111
# 01111101
# 11001110
# 00000010
# 2
# 3 -1
# 1 1
# """
# matrix_data = input_data.strip().split("\n")[:4]
#
# n_direction_data = input_data.strip().split("\n")[5:]
#
# matrix = [deque(list(line)) for line in matrix_data]
# step = int(input_data.strip().split("\n")[4])
# n, direction = zi... | Add 3rd week assignment of SC
# input_data = """
# 10101111
# 01111101
# 11001110
# 00000010
# 2
# 3 -1
# 1 1
# """
# matrix_data = input_data.strip().split("\n")[:4]
#
# n_direction_data = input_data.strip().split("\n")[5:]
#
# matrix = [deque(list(line)) for line in matrix_data]
# step = int(input_data.strip().split(... | <commit_before><commit_msg>Add 3rd week assignment of SC<commit_after>
# input_data = """
# 10101111
# 01111101
# 11001110
# 00000010
# 2
# 3 -1
# 1 1
# """
# matrix_data = input_data.strip().split("\n")[:4]
#
# n_direction_data = input_data.strip().split("\n")[5:]
#
# matrix = [deque(list(line)) for line in matrix_dat... | |
a165962921ccdfbd6ba4eb4a6c7cbd38b57fdf47 | hackerrank_datatype.py | hackerrank_datatype.py | i=10
d=2.5
s="HackerRank"
# Declare second integer, double, and String variables.
ii=int(raw_input())
dd=float(raw_input())
ss=raw_input()
# Read and save an integer, double, and String to your variables.
# Print the sum of both integer variables on a new line.
print i+ii
# Print the sum of the double variables on a n... | Print sum of same data types on a different line | Print sum of same data types on a different line
| Python | mit | kumarisneha/practice_repo | Print sum of same data types on a different line | i=10
d=2.5
s="HackerRank"
# Declare second integer, double, and String variables.
ii=int(raw_input())
dd=float(raw_input())
ss=raw_input()
# Read and save an integer, double, and String to your variables.
# Print the sum of both integer variables on a new line.
print i+ii
# Print the sum of the double variables on a n... | <commit_before><commit_msg>Print sum of same data types on a different line<commit_after> | i=10
d=2.5
s="HackerRank"
# Declare second integer, double, and String variables.
ii=int(raw_input())
dd=float(raw_input())
ss=raw_input()
# Read and save an integer, double, and String to your variables.
# Print the sum of both integer variables on a new line.
print i+ii
# Print the sum of the double variables on a n... | Print sum of same data types on a different linei=10
d=2.5
s="HackerRank"
# Declare second integer, double, and String variables.
ii=int(raw_input())
dd=float(raw_input())
ss=raw_input()
# Read and save an integer, double, and String to your variables.
# Print the sum of both integer variables on a new line.
print i+i... | <commit_before><commit_msg>Print sum of same data types on a different line<commit_after>i=10
d=2.5
s="HackerRank"
# Declare second integer, double, and String variables.
ii=int(raw_input())
dd=float(raw_input())
ss=raw_input()
# Read and save an integer, double, and String to your variables.
# Print the sum of both i... | |
00f9a05f651c4c51c8c2a3c359f6eecc3faca699 | py/ones-and-zeroes.py | py/ones-and-zeroes.py | from collections import Counter
class Solution(object):
def findMaxForm(self, strs, m, n):
"""
:type strs: List[str]
:type m: int
:type n: int
:rtype: int
"""
str_counter = []
for s in strs:
c0 = s.count('0')
str_counter.append(... | Add py solution for 474. Ones and Zeroes | Add py solution for 474. Ones and Zeroes
474. Ones and Zeroes: https://leetcode.com/problems/ones-and-zeroes/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 474. Ones and Zeroes
474. Ones and Zeroes: https://leetcode.com/problems/ones-and-zeroes/ | from collections import Counter
class Solution(object):
def findMaxForm(self, strs, m, n):
"""
:type strs: List[str]
:type m: int
:type n: int
:rtype: int
"""
str_counter = []
for s in strs:
c0 = s.count('0')
str_counter.append(... | <commit_before><commit_msg>Add py solution for 474. Ones and Zeroes
474. Ones and Zeroes: https://leetcode.com/problems/ones-and-zeroes/<commit_after> | from collections import Counter
class Solution(object):
def findMaxForm(self, strs, m, n):
"""
:type strs: List[str]
:type m: int
:type n: int
:rtype: int
"""
str_counter = []
for s in strs:
c0 = s.count('0')
str_counter.append(... | Add py solution for 474. Ones and Zeroes
474. Ones and Zeroes: https://leetcode.com/problems/ones-and-zeroes/from collections import Counter
class Solution(object):
def findMaxForm(self, strs, m, n):
"""
:type strs: List[str]
:type m: int
:type n: int
:rtype: int
"""... | <commit_before><commit_msg>Add py solution for 474. Ones and Zeroes
474. Ones and Zeroes: https://leetcode.com/problems/ones-and-zeroes/<commit_after>from collections import Counter
class Solution(object):
def findMaxForm(self, strs, m, n):
"""
:type strs: List[str]
:type m: int
:ty... | |
1874783a4626c0aaecaf1527b111ec3cd4e34c42 | examples/test_save_screenshots.py | examples/test_save_screenshots.py | import os
from seleniumbase import BaseCase
class ScreenshotTests(BaseCase):
def test_save_screenshot(self):
self.open("https://seleniumbase.io/demo_page")
# "./downloaded_files" is a special SeleniumBase folder for downloads
self.save_screenshot("demo_page.png", folder="./downlo... | Add a test for testing methods that save screenshots | Add a test for testing methods that save screenshots
| Python | mit | mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase | Add a test for testing methods that save screenshots | import os
from seleniumbase import BaseCase
class ScreenshotTests(BaseCase):
def test_save_screenshot(self):
self.open("https://seleniumbase.io/demo_page")
# "./downloaded_files" is a special SeleniumBase folder for downloads
self.save_screenshot("demo_page.png", folder="./downlo... | <commit_before><commit_msg>Add a test for testing methods that save screenshots<commit_after> | import os
from seleniumbase import BaseCase
class ScreenshotTests(BaseCase):
def test_save_screenshot(self):
self.open("https://seleniumbase.io/demo_page")
# "./downloaded_files" is a special SeleniumBase folder for downloads
self.save_screenshot("demo_page.png", folder="./downlo... | Add a test for testing methods that save screenshotsimport os
from seleniumbase import BaseCase
class ScreenshotTests(BaseCase):
def test_save_screenshot(self):
self.open("https://seleniumbase.io/demo_page")
# "./downloaded_files" is a special SeleniumBase folder for downloads
se... | <commit_before><commit_msg>Add a test for testing methods that save screenshots<commit_after>import os
from seleniumbase import BaseCase
class ScreenshotTests(BaseCase):
def test_save_screenshot(self):
self.open("https://seleniumbase.io/demo_page")
# "./downloaded_files" is a special Sele... | |
7088faefe52ecb69666fcc5c08398131dccf39df | rtorrent-interface.py | rtorrent-interface.py | #!./bin/python3
from functools import wraps
from rpc import RTorrentXMLRPCClient
import os
from flask import Flask, g, json, request
app = Flask(__name__)
RTORRENT_XMLRPC_CONFIG_PATH = './cfg/rtorrent-interface.cfg'
app.config.from_object(__name__)
@app.route('/')
def index():
return app.send_static_file('index.h... | Add small web backend serving static index.html and being api for getting torrent download info | Add small web backend serving static index.html and being api for getting torrent download info
| Python | mit | lfxgroove/rtorrent-interface,lfxgroove/rtorrent-interface | Add small web backend serving static index.html and being api for getting torrent download info | #!./bin/python3
from functools import wraps
from rpc import RTorrentXMLRPCClient
import os
from flask import Flask, g, json, request
app = Flask(__name__)
RTORRENT_XMLRPC_CONFIG_PATH = './cfg/rtorrent-interface.cfg'
app.config.from_object(__name__)
@app.route('/')
def index():
return app.send_static_file('index.h... | <commit_before><commit_msg>Add small web backend serving static index.html and being api for getting torrent download info<commit_after> | #!./bin/python3
from functools import wraps
from rpc import RTorrentXMLRPCClient
import os
from flask import Flask, g, json, request
app = Flask(__name__)
RTORRENT_XMLRPC_CONFIG_PATH = './cfg/rtorrent-interface.cfg'
app.config.from_object(__name__)
@app.route('/')
def index():
return app.send_static_file('index.h... | Add small web backend serving static index.html and being api for getting torrent download info#!./bin/python3
from functools import wraps
from rpc import RTorrentXMLRPCClient
import os
from flask import Flask, g, json, request
app = Flask(__name__)
RTORRENT_XMLRPC_CONFIG_PATH = './cfg/rtorrent-interface.cfg'
app.conf... | <commit_before><commit_msg>Add small web backend serving static index.html and being api for getting torrent download info<commit_after>#!./bin/python3
from functools import wraps
from rpc import RTorrentXMLRPCClient
import os
from flask import Flask, g, json, request
app = Flask(__name__)
RTORRENT_XMLRPC_CONFIG_PATH ... | |
5b8f125ca7a3c1b833105380316e325ce61b2c9d | test/test_priority.py | test/test_priority.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Simple test to send each priority level
import unittest
import logging
logging.basicConfig(level=logging.WARNING)
from gntp.notifier import GrowlNotifier
class TestHash(unittest.TestCase):
def setUp(self):
self.growl = GrowlNotifier('GNTP unittest', ['Testin... | Add a test for priority levels | Add a test for priority levels
| Python | mit | kfdm/gntp | Add a test for priority levels | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Simple test to send each priority level
import unittest
import logging
logging.basicConfig(level=logging.WARNING)
from gntp.notifier import GrowlNotifier
class TestHash(unittest.TestCase):
def setUp(self):
self.growl = GrowlNotifier('GNTP unittest', ['Testin... | <commit_before><commit_msg>Add a test for priority levels<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# Simple test to send each priority level
import unittest
import logging
logging.basicConfig(level=logging.WARNING)
from gntp.notifier import GrowlNotifier
class TestHash(unittest.TestCase):
def setUp(self):
self.growl = GrowlNotifier('GNTP unittest', ['Testin... | Add a test for priority levels#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Simple test to send each priority level
import unittest
import logging
logging.basicConfig(level=logging.WARNING)
from gntp.notifier import GrowlNotifier
class TestHash(unittest.TestCase):
def setUp(self):
self.growl = GrowlNoti... | <commit_before><commit_msg>Add a test for priority levels<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Simple test to send each priority level
import unittest
import logging
logging.basicConfig(level=logging.WARNING)
from gntp.notifier import GrowlNotifier
class TestHash(unittest.TestCase):
def se... | |
7300912727233500360a9e51f37161e04b04258b | util/hubget.py | util/hubget.py | #!/usr/bin/env python3
from cozify import hub, hub_api
import pprint, sys
def main(path):
hub.ping()
kwargs = {}
hub._fill_kwargs(kwargs)
response = hub_api.get(path, **kwargs)
pprint.pprint(response)
if __name__ == "__main__":
if len(sys.argv) > 1:
main(sys.argv[1])
else:
... | Add a new utility for easily making arbitrary hub GET calls | Add a new utility for easily making arbitrary hub GET calls
Useful for exploring for undocumented endpoints without having to deal
with authentication, hub ip and so on.
| Python | mit | Artanicus/python-cozify,Artanicus/python-cozify | Add a new utility for easily making arbitrary hub GET calls
Useful for exploring for undocumented endpoints without having to deal
with authentication, hub ip and so on. | #!/usr/bin/env python3
from cozify import hub, hub_api
import pprint, sys
def main(path):
hub.ping()
kwargs = {}
hub._fill_kwargs(kwargs)
response = hub_api.get(path, **kwargs)
pprint.pprint(response)
if __name__ == "__main__":
if len(sys.argv) > 1:
main(sys.argv[1])
else:
... | <commit_before><commit_msg>Add a new utility for easily making arbitrary hub GET calls
Useful for exploring for undocumented endpoints without having to deal
with authentication, hub ip and so on.<commit_after> | #!/usr/bin/env python3
from cozify import hub, hub_api
import pprint, sys
def main(path):
hub.ping()
kwargs = {}
hub._fill_kwargs(kwargs)
response = hub_api.get(path, **kwargs)
pprint.pprint(response)
if __name__ == "__main__":
if len(sys.argv) > 1:
main(sys.argv[1])
else:
... | Add a new utility for easily making arbitrary hub GET calls
Useful for exploring for undocumented endpoints without having to deal
with authentication, hub ip and so on.#!/usr/bin/env python3
from cozify import hub, hub_api
import pprint, sys
def main(path):
hub.ping()
kwargs = {}
hub._fill_kwargs(kwargs... | <commit_before><commit_msg>Add a new utility for easily making arbitrary hub GET calls
Useful for exploring for undocumented endpoints without having to deal
with authentication, hub ip and so on.<commit_after>#!/usr/bin/env python3
from cozify import hub, hub_api
import pprint, sys
def main(path):
hub.ping()
... | |
c58370b3e38f663ac361d82ea984ed5aa5e03318 | mecab_parsing.py | mecab_parsing.py | import operator
class WordInfo(object):
def __init__(self):
dictionary_form = ""
word_class = ""
spelling = ""
value = ""
features = []
def __str__(self):
return "{0},{1},{2},{3}".format(self.value, self.spelling, self.dictionary_form, self.word_cl... | Add mecab related utility function | Add mecab related utility function
| Python | mit | Deathhush/HushUtility,Deathhush/Hush | Add mecab related utility function | import operator
class WordInfo(object):
def __init__(self):
dictionary_form = ""
word_class = ""
spelling = ""
value = ""
features = []
def __str__(self):
return "{0},{1},{2},{3}".format(self.value, self.spelling, self.dictionary_form, self.word_cl... | <commit_before><commit_msg>Add mecab related utility function<commit_after> | import operator
class WordInfo(object):
def __init__(self):
dictionary_form = ""
word_class = ""
spelling = ""
value = ""
features = []
def __str__(self):
return "{0},{1},{2},{3}".format(self.value, self.spelling, self.dictionary_form, self.word_cl... | Add mecab related utility functionimport operator
class WordInfo(object):
def __init__(self):
dictionary_form = ""
word_class = ""
spelling = ""
value = ""
features = []
def __str__(self):
return "{0},{1},{2},{3}".format(self.value, self.spelling, ... | <commit_before><commit_msg>Add mecab related utility function<commit_after>import operator
class WordInfo(object):
def __init__(self):
dictionary_form = ""
word_class = ""
spelling = ""
value = ""
features = []
def __str__(self):
return "{0},{1},{2... | |
c92d19ec8b689d63a95d3dc5f914c2e36d28daf6 | ipywidgets/widgets/tests/test_widget.py | ipywidgets/widgets/tests/test_widget.py | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Test Widget."""
from IPython.utils.capture import capture_output
from IPython.display import display
from ..widget import Widget
def test_no_widget_view():
with capture_output() as cap:
w = Widget()
... | Test that Widget does not produce any view output | Test that Widget does not produce any view output
| Python | bsd-3-clause | jupyter-widgets/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,ipython/ipywidgets,jupyter-widgets/ipywidgets,SylvainCorlay/ipywidgets,ipython/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,SylvainCorlay/ipywidgets,jupyter-widgets/ipywidgets | Test that Widget does not produce any view output | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Test Widget."""
from IPython.utils.capture import capture_output
from IPython.display import display
from ..widget import Widget
def test_no_widget_view():
with capture_output() as cap:
w = Widget()
... | <commit_before><commit_msg>Test that Widget does not produce any view output<commit_after> | # Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Test Widget."""
from IPython.utils.capture import capture_output
from IPython.display import display
from ..widget import Widget
def test_no_widget_view():
with capture_output() as cap:
w = Widget()
... | Test that Widget does not produce any view output# Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Test Widget."""
from IPython.utils.capture import capture_output
from IPython.display import display
from ..widget import Widget
def test_no_widget_view():
wi... | <commit_before><commit_msg>Test that Widget does not produce any view output<commit_after># Copyright (c) Jupyter Development Team.
# Distributed under the terms of the Modified BSD License.
"""Test Widget."""
from IPython.utils.capture import capture_output
from IPython.display import display
from ..widget import W... | |
3172aff3c1cc90a5e88d60d362cb73336b0dc646 | nettests/simpletest.py | nettests/simpletest.py | from ooni import nettest
class SimpleTest(nettest.TestCase):
inputs = range(1,100)
optParameters = [['asset', 'a', None, 'Asset file'],
['controlserver', 'c', 'google.com', 'Specify the control server'],
['resume', 'r', 0, 'Resume at this index'],
[... | Add a very simple test that *must* always pass. * Useful for testing the newstyle API | Add a very simple test that *must* always pass.
* Useful for testing the newstyle API
| Python | bsd-2-clause | 0xPoly/ooni-probe,juga0/ooni-probe,lordappsec/ooni-probe,0xPoly/ooni-probe,hackerberry/ooni-probe,0xPoly/ooni-probe,hackerberry/ooni-probe,0xPoly/ooni-probe,juga0/ooni-probe,kdmurray91/ooni-probe,Karthikeyan-kkk/ooni-probe,juga0/ooni-probe,Karthikeyan-kkk/ooni-probe,lordappsec/ooni-probe,juga0/ooni-probe,lordappsec/oon... | Add a very simple test that *must* always pass.
* Useful for testing the newstyle API | from ooni import nettest
class SimpleTest(nettest.TestCase):
inputs = range(1,100)
optParameters = [['asset', 'a', None, 'Asset file'],
['controlserver', 'c', 'google.com', 'Specify the control server'],
['resume', 'r', 0, 'Resume at this index'],
[... | <commit_before><commit_msg>Add a very simple test that *must* always pass.
* Useful for testing the newstyle API<commit_after> | from ooni import nettest
class SimpleTest(nettest.TestCase):
inputs = range(1,100)
optParameters = [['asset', 'a', None, 'Asset file'],
['controlserver', 'c', 'google.com', 'Specify the control server'],
['resume', 'r', 0, 'Resume at this index'],
[... | Add a very simple test that *must* always pass.
* Useful for testing the newstyle APIfrom ooni import nettest
class SimpleTest(nettest.TestCase):
inputs = range(1,100)
optParameters = [['asset', 'a', None, 'Asset file'],
['controlserver', 'c', 'google.com', 'Specify the control server'],
... | <commit_before><commit_msg>Add a very simple test that *must* always pass.
* Useful for testing the newstyle API<commit_after>from ooni import nettest
class SimpleTest(nettest.TestCase):
inputs = range(1,100)
optParameters = [['asset', 'a', None, 'Asset file'],
['controlserver', 'c', 'googl... | |
a91f69e2c7618f1a0bcfd6b82004186ec949fbff | oneflow/settings/snippets/djdt.py | oneflow/settings/snippets/djdt.py | # Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# leto.licorn.org
'82.236.133.193',
)
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
'debug... | # Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# gurney.licorn.org
'109.190.93.141',
# my LAN
'192.168.111.23',
'192.168.111.111',
)
DEBUG_TOOLBAR_PANELS = (
'debug_to... | Fix the django debug toolbar not appearing and the user echo thing slowing my loadings in development. | Fix the django debug toolbar not appearing and the user echo thing slowing my loadings in development.
| Python | agpl-3.0 | 1flow/1flow,WillianPaiva/1flow,1flow/1flow,1flow/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow,1flow/1flow,WillianPaiva/1flow,WillianPaiva/1flow | # Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# leto.licorn.org
'82.236.133.193',
)
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
'debug... | # Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# gurney.licorn.org
'109.190.93.141',
# my LAN
'192.168.111.23',
'192.168.111.111',
)
DEBUG_TOOLBAR_PANELS = (
'debug_to... | <commit_before># Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# leto.licorn.org
'82.236.133.193',
)
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.request_vars.RequestVarsDebugPan... | # Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# gurney.licorn.org
'109.190.93.141',
# my LAN
'192.168.111.23',
'192.168.111.111',
)
DEBUG_TOOLBAR_PANELS = (
'debug_to... | # Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# leto.licorn.org
'82.236.133.193',
)
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.request_vars.RequestVarsDebugPanel',
'debug... | <commit_before># Debug-toolbar related
INSTALLED_APPS += ('debug_toolbar', )
MIDDLEWARE_CLASSES += ('debug_toolbar.middleware.DebugToolbarMiddleware', )
INTERNAL_IPS = (
'127.0.0.1',
# leto.licorn.org
'82.236.133.193',
)
DEBUG_TOOLBAR_PANELS = (
'debug_toolbar.panels.request_vars.RequestVarsDebugPan... |
bda6a897511ab3312da30ab71b60797f53f7a73a | indico/modules/events/sessions/views.py | indico/modules/events/sessions/views.py | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | Add view class for the sessions module | Add view class for the sessions module
| Python | mit | OmeGak/indico,mvidalgarcia/indico,DirkHoffmann/indico,pferreir/indico,pferreir/indico,mvidalgarcia/indico,ThiefMaster/indico,ThiefMaster/indico,OmeGak/indico,OmeGak/indico,mvidalgarcia/indico,mic4ael/indico,indico/indico,indico/indico,pferreir/indico,pferreir/indico,OmeGak/indico,ThiefMaster/indico,DirkHoffmann/indico,... | Add view class for the sessions module | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | <commit_before><commit_msg>Add view class for the sessions module<commit_after> | # This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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 (a... | Add view class for the sessions module# This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico 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; ei... | <commit_before><commit_msg>Add view class for the sessions module<commit_after># This file is part of Indico.
# Copyright (C) 2002 - 2015 European Organization for Nuclear Research (CERN).
#
# Indico is free software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License as
# publ... | |
1aacd7d5e7403d3c3732a54e5f6111349436e00d | code/windingvstime.py | code/windingvstime.py | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import sys
import numpy.ma as ma
fuz = 1/4.;
if (len(sys.argv) < 2) :
print("Usage: \n dataplot.py path_to_binfile [clamp value]")
sys.exit()
elif (len(sys.argv) > 2) :
fuz = float(sys.argv[2])
binfile = sy... | Make a plot as function of time for some datasets. | Make a plot as function of time for some datasets.
| Python | mit | TAdeJong/plasma-analysis,TAdeJong/plasma-analysis | Make a plot as function of time for some datasets. | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import sys
import numpy.ma as ma
fuz = 1/4.;
if (len(sys.argv) < 2) :
print("Usage: \n dataplot.py path_to_binfile [clamp value]")
sys.exit()
elif (len(sys.argv) > 2) :
fuz = float(sys.argv[2])
binfile = sy... | <commit_before><commit_msg>Make a plot as function of time for some datasets.<commit_after> | import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import sys
import numpy.ma as ma
fuz = 1/4.;
if (len(sys.argv) < 2) :
print("Usage: \n dataplot.py path_to_binfile [clamp value]")
sys.exit()
elif (len(sys.argv) > 2) :
fuz = float(sys.argv[2])
binfile = sy... | Make a plot as function of time for some datasets.import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import sys
import numpy.ma as ma
fuz = 1/4.;
if (len(sys.argv) < 2) :
print("Usage: \n dataplot.py path_to_binfile [clamp value]")
sys.exit()
elif (len(sys.a... | <commit_before><commit_msg>Make a plot as function of time for some datasets.<commit_after>import numpy as np
import matplotlib.pyplot as plt
import matplotlib
from mpl_toolkits.mplot3d import Axes3D
import sys
import numpy.ma as ma
fuz = 1/4.;
if (len(sys.argv) < 2) :
print("Usage: \n dataplot.py path_to_binfile [c... | |
cf73f1c3ac17ca163cb7c930e3024ffd1994cef1 | odm/catalogs/CatalogReader.py | odm/catalogs/CatalogReader.py | class CatalogReader(object):
"""
Basic "interface" to the ODM catalog readers.
Resembles the structure of CKAN harvesters, for later CKAN imports.
"""
def info(self):
pass
def gather(self):
pass
def fetch(self, data_dict):
pass
def import_data(self, data_dict)... | Add outline for catalog readers | Add outline for catalog readers
| Python | mit | SebastianBerchtold/odm-catalogreaders,mattfullerton/odm-catalogreaders | Add outline for catalog readers | class CatalogReader(object):
"""
Basic "interface" to the ODM catalog readers.
Resembles the structure of CKAN harvesters, for later CKAN imports.
"""
def info(self):
pass
def gather(self):
pass
def fetch(self, data_dict):
pass
def import_data(self, data_dict)... | <commit_before><commit_msg>Add outline for catalog readers<commit_after> | class CatalogReader(object):
"""
Basic "interface" to the ODM catalog readers.
Resembles the structure of CKAN harvesters, for later CKAN imports.
"""
def info(self):
pass
def gather(self):
pass
def fetch(self, data_dict):
pass
def import_data(self, data_dict)... | Add outline for catalog readersclass CatalogReader(object):
"""
Basic "interface" to the ODM catalog readers.
Resembles the structure of CKAN harvesters, for later CKAN imports.
"""
def info(self):
pass
def gather(self):
pass
def fetch(self, data_dict):
pass
d... | <commit_before><commit_msg>Add outline for catalog readers<commit_after>class CatalogReader(object):
"""
Basic "interface" to the ODM catalog readers.
Resembles the structure of CKAN harvesters, for later CKAN imports.
"""
def info(self):
pass
def gather(self):
pass
def fe... | |
1b13a69b888d3cc925eae357f1959a6f420e5df5 | remap_authors.py | remap_authors.py | #!/usr/bin/python3
import sys
import json
if len(sys.argv) < 4:
print("Usage: ./remap_authors.py <input_journal> <old_authors.json> <new_authors.json>")
print("The input journal will have its author id's updated to the ids of the same authors in <new_authors.json>")
sys.exit(1)
# Build a map of author na... | Add author remapping script to merge different datasets | Add author remapping script to merge different datasets
| Python | mit | Twinklebear/dataviscourse-pr-collaboration-networks,Twinklebear/dataviscourse-pr-collaboration-networks,Twinklebear/dataviscourse-pr-collaboration-networks | Add author remapping script to merge different datasets | #!/usr/bin/python3
import sys
import json
if len(sys.argv) < 4:
print("Usage: ./remap_authors.py <input_journal> <old_authors.json> <new_authors.json>")
print("The input journal will have its author id's updated to the ids of the same authors in <new_authors.json>")
sys.exit(1)
# Build a map of author na... | <commit_before><commit_msg>Add author remapping script to merge different datasets<commit_after> | #!/usr/bin/python3
import sys
import json
if len(sys.argv) < 4:
print("Usage: ./remap_authors.py <input_journal> <old_authors.json> <new_authors.json>")
print("The input journal will have its author id's updated to the ids of the same authors in <new_authors.json>")
sys.exit(1)
# Build a map of author na... | Add author remapping script to merge different datasets#!/usr/bin/python3
import sys
import json
if len(sys.argv) < 4:
print("Usage: ./remap_authors.py <input_journal> <old_authors.json> <new_authors.json>")
print("The input journal will have its author id's updated to the ids of the same authors in <new_auth... | <commit_before><commit_msg>Add author remapping script to merge different datasets<commit_after>#!/usr/bin/python3
import sys
import json
if len(sys.argv) < 4:
print("Usage: ./remap_authors.py <input_journal> <old_authors.json> <new_authors.json>")
print("The input journal will have its author id's updated to... | |
9bbdd657cddd9d56437d05ab9701aea305af3010 | embryo-interpolation.py | embryo-interpolation.py | # IPython log file
image = np.zeros((2048, 2048), dtype=float)
image[0, 0] = 1
np.percentile(image, [0.1, 99.9])
get_ipython().run_line_magic('pinfo', 'np.percentile')
np.stack([np.zeros((3, 2)), np.zeros(3)], axis=1)
from skimage import data
image = data.horse().astype(bool)
plt.imshow(image)
get_ipython().run_line_... | Add raw embryo interpolation code | Add raw embryo interpolation code
| Python | bsd-3-clause | jni/useful-histories | Add raw embryo interpolation code | # IPython log file
image = np.zeros((2048, 2048), dtype=float)
image[0, 0] = 1
np.percentile(image, [0.1, 99.9])
get_ipython().run_line_magic('pinfo', 'np.percentile')
np.stack([np.zeros((3, 2)), np.zeros(3)], axis=1)
from skimage import data
image = data.horse().astype(bool)
plt.imshow(image)
get_ipython().run_line_... | <commit_before><commit_msg>Add raw embryo interpolation code<commit_after> | # IPython log file
image = np.zeros((2048, 2048), dtype=float)
image[0, 0] = 1
np.percentile(image, [0.1, 99.9])
get_ipython().run_line_magic('pinfo', 'np.percentile')
np.stack([np.zeros((3, 2)), np.zeros(3)], axis=1)
from skimage import data
image = data.horse().astype(bool)
plt.imshow(image)
get_ipython().run_line_... | Add raw embryo interpolation code# IPython log file
image = np.zeros((2048, 2048), dtype=float)
image[0, 0] = 1
np.percentile(image, [0.1, 99.9])
get_ipython().run_line_magic('pinfo', 'np.percentile')
np.stack([np.zeros((3, 2)), np.zeros(3)], axis=1)
from skimage import data
image = data.horse().astype(bool)
plt.imsh... | <commit_before><commit_msg>Add raw embryo interpolation code<commit_after># IPython log file
image = np.zeros((2048, 2048), dtype=float)
image[0, 0] = 1
np.percentile(image, [0.1, 99.9])
get_ipython().run_line_magic('pinfo', 'np.percentile')
np.stack([np.zeros((3, 2)), np.zeros(3)], axis=1)
from skimage import data
i... | |
a42109b6992023dc31a3f77a173c19065e4c00d5 | jsonrpcclient/clients/socket_client.py | jsonrpcclient/clients/socket_client.py | """
Low-level socket client.
"""
import socket
from typing import Any
from ..client import Client
from ..response import Response
class SocketClient(Client):
"""
Args:
socket: Connected socket.
*args: Passed through to Client class.
**kwargs: Passed through to Client class.
"""
... | Add a low-level socket client | Add a low-level socket client
| Python | mit | bcb/jsonrpcclient | Add a low-level socket client | """
Low-level socket client.
"""
import socket
from typing import Any
from ..client import Client
from ..response import Response
class SocketClient(Client):
"""
Args:
socket: Connected socket.
*args: Passed through to Client class.
**kwargs: Passed through to Client class.
"""
... | <commit_before><commit_msg>Add a low-level socket client<commit_after> | """
Low-level socket client.
"""
import socket
from typing import Any
from ..client import Client
from ..response import Response
class SocketClient(Client):
"""
Args:
socket: Connected socket.
*args: Passed through to Client class.
**kwargs: Passed through to Client class.
"""
... | Add a low-level socket client"""
Low-level socket client.
"""
import socket
from typing import Any
from ..client import Client
from ..response import Response
class SocketClient(Client):
"""
Args:
socket: Connected socket.
*args: Passed through to Client class.
**kwargs: Passed throug... | <commit_before><commit_msg>Add a low-level socket client<commit_after>"""
Low-level socket client.
"""
import socket
from typing import Any
from ..client import Client
from ..response import Response
class SocketClient(Client):
"""
Args:
socket: Connected socket.
*args: Passed through to Clie... | |
25743b9e5bc406d3f8f7713e5dca560d5bb4f82f | tests/xmi/test_xmi_serialization.py | tests/xmi/test_xmi_serialization.py | import pytest
import os
import pyecore.ecore as Ecore
from pyecore.resources import *
from pyecore.resources.xmi import XMIResource
def test_resource_createset(tmpdir):
f = tmpdir.mkdir('pyecore-tmp').join('test.xmi')
resource = XMIResource(URI(str(f)))
# we create a simple metamodel by script
package... | Add simple integration test for model serialization | Add simple integration test for model serialization
This test creates a new metamodel in memory (by code), create an
instance of the metamodel, serialize the instance model as XMI, then
re-read it again from another resource.
| Python | bsd-3-clause | aranega/pyecore,pyecore/pyecore | Add simple integration test for model serialization
This test creates a new metamodel in memory (by code), create an
instance of the metamodel, serialize the instance model as XMI, then
re-read it again from another resource. | import pytest
import os
import pyecore.ecore as Ecore
from pyecore.resources import *
from pyecore.resources.xmi import XMIResource
def test_resource_createset(tmpdir):
f = tmpdir.mkdir('pyecore-tmp').join('test.xmi')
resource = XMIResource(URI(str(f)))
# we create a simple metamodel by script
package... | <commit_before><commit_msg>Add simple integration test for model serialization
This test creates a new metamodel in memory (by code), create an
instance of the metamodel, serialize the instance model as XMI, then
re-read it again from another resource.<commit_after> | import pytest
import os
import pyecore.ecore as Ecore
from pyecore.resources import *
from pyecore.resources.xmi import XMIResource
def test_resource_createset(tmpdir):
f = tmpdir.mkdir('pyecore-tmp').join('test.xmi')
resource = XMIResource(URI(str(f)))
# we create a simple metamodel by script
package... | Add simple integration test for model serialization
This test creates a new metamodel in memory (by code), create an
instance of the metamodel, serialize the instance model as XMI, then
re-read it again from another resource.import pytest
import os
import pyecore.ecore as Ecore
from pyecore.resources import *
from pye... | <commit_before><commit_msg>Add simple integration test for model serialization
This test creates a new metamodel in memory (by code), create an
instance of the metamodel, serialize the instance model as XMI, then
re-read it again from another resource.<commit_after>import pytest
import os
import pyecore.ecore as Ecore... | |
f6dd64353c864f965bed0091dc1ab447ff29a2fd | src/ggrc_workflows/migrations/versions/20151107014837_18bdb0671010_update_invalid_task_dates.py | src/ggrc_workflows/migrations/versions/20151107014837_18bdb0671010_update_invalid_task_dates.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
"""Update invalid task dates
Revision ID: 18bdb0671010
Revises: e81da7a55e7
Cre... | Add a migration for fixing bad dates | Add a migration for fixing bad dates
This migration is for the case that some bad dates were imported before
the propper date validation was added.
| Python | apache-2.0 | AleksNeStu/ggrc-core,prasannav7/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,NejcZupec/ggrc-core,j0gurt/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,kr41/ggrc-core,plamut/ggrc-core,VinnieJohns/ggrc-core,plamut/ggrc-core,selahssea/ggrc-core,plamut/ggrc-core,andrei-karalionak/ggrc-core,josthkko/ggrc-cor... | Add a migration for fixing bad dates
This migration is for the case that some bad dates were imported before
the propper date validation was added. | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
"""Update invalid task dates
Revision ID: 18bdb0671010
Revises: e81da7a55e7
Cre... | <commit_before><commit_msg>Add a migration for fixing bad dates
This migration is for the case that some bad dates were imported before
the propper date validation was added.<commit_after> | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: [email protected]
# Maintained By: [email protected]
"""Update invalid task dates
Revision ID: 18bdb0671010
Revises: e81da7a55e7
Cre... | Add a migration for fixing bad dates
This migration is for the case that some bad dates were imported before
the propper date validation was added.# Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: ... | <commit_before><commit_msg>Add a migration for fixing bad dates
This migration is for the case that some bad dates were imported before
the propper date validation was added.<commit_after># Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICE... | |
eaa125e7195f065c4ca74088d8f9a5eb6464e056 | basics/masking_utils.py | basics/masking_utils.py |
import skimage.morphology as mo
import scipy.ndimage as nd
import warnings
try:
import cv2
CV2_FLAG = True
except ImportError:
warnings.warn("Cannot import cv2. Computing with scipy.ndimage")
CV2_FLAG = False
from utils import eight_conn
def smooth_edges(mask, filter_size, min_pixels):
no_smal... | Split off masking utility functions | Split off masking utility functions
| Python | mit | e-koch/BaSiCs | Split off masking utility functions |
import skimage.morphology as mo
import scipy.ndimage as nd
import warnings
try:
import cv2
CV2_FLAG = True
except ImportError:
warnings.warn("Cannot import cv2. Computing with scipy.ndimage")
CV2_FLAG = False
from utils import eight_conn
def smooth_edges(mask, filter_size, min_pixels):
no_smal... | <commit_before><commit_msg>Split off masking utility functions<commit_after> |
import skimage.morphology as mo
import scipy.ndimage as nd
import warnings
try:
import cv2
CV2_FLAG = True
except ImportError:
warnings.warn("Cannot import cv2. Computing with scipy.ndimage")
CV2_FLAG = False
from utils import eight_conn
def smooth_edges(mask, filter_size, min_pixels):
no_smal... | Split off masking utility functions
import skimage.morphology as mo
import scipy.ndimage as nd
import warnings
try:
import cv2
CV2_FLAG = True
except ImportError:
warnings.warn("Cannot import cv2. Computing with scipy.ndimage")
CV2_FLAG = False
from utils import eight_conn
def smooth_edges(mask, fil... | <commit_before><commit_msg>Split off masking utility functions<commit_after>
import skimage.morphology as mo
import scipy.ndimage as nd
import warnings
try:
import cv2
CV2_FLAG = True
except ImportError:
warnings.warn("Cannot import cv2. Computing with scipy.ndimage")
CV2_FLAG = False
from utils impor... | |
88fb0e30f50184641615bf70aa82ded6646854f3 | watcher.py | watcher.py | from threading import Thread
from werkzeug._reloader import ReloaderLoop
class Watcher(Thread, ReloaderLoop):
def __init__(self, dirname, interval=1, static, tasks, *args, **kwargs):
self.dirname = dirname
self.static = static
self.tasks = tasks
super(Watcher, self).__init__(*args,... | Add thread implementation to watch files | Add thread implementation to watch files
| Python | mit | rolurq/flask-gulp | Add thread implementation to watch files | from threading import Thread
from werkzeug._reloader import ReloaderLoop
class Watcher(Thread, ReloaderLoop):
def __init__(self, dirname, interval=1, static, tasks, *args, **kwargs):
self.dirname = dirname
self.static = static
self.tasks = tasks
super(Watcher, self).__init__(*args,... | <commit_before><commit_msg>Add thread implementation to watch files<commit_after> | from threading import Thread
from werkzeug._reloader import ReloaderLoop
class Watcher(Thread, ReloaderLoop):
def __init__(self, dirname, interval=1, static, tasks, *args, **kwargs):
self.dirname = dirname
self.static = static
self.tasks = tasks
super(Watcher, self).__init__(*args,... | Add thread implementation to watch filesfrom threading import Thread
from werkzeug._reloader import ReloaderLoop
class Watcher(Thread, ReloaderLoop):
def __init__(self, dirname, interval=1, static, tasks, *args, **kwargs):
self.dirname = dirname
self.static = static
self.tasks = tasks
... | <commit_before><commit_msg>Add thread implementation to watch files<commit_after>from threading import Thread
from werkzeug._reloader import ReloaderLoop
class Watcher(Thread, ReloaderLoop):
def __init__(self, dirname, interval=1, static, tasks, *args, **kwargs):
self.dirname = dirname
self.static... | |
769541b58b1b163197717ea4b84c5ce0cde293e0 | app/messaging_app.py | app/messaging_app.py | import os
import json
from .core.logger import configure_logging
from .core.messaging import MessageServer
def get_password():
if "REDIS_PASSWD" in os.environ:
return os.environ["REDIS_PASSWD"]
with open("/home/rpi/.variables") as f:
line = next(x.strip() for x in f if x.startswith("REDIS_PAS... | Add main for messaging server. | Add main for messaging server.
| Python | mit | supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer,supersaiyanmode/HomePiServer | Add main for messaging server. | import os
import json
from .core.logger import configure_logging
from .core.messaging import MessageServer
def get_password():
if "REDIS_PASSWD" in os.environ:
return os.environ["REDIS_PASSWD"]
with open("/home/rpi/.variables") as f:
line = next(x.strip() for x in f if x.startswith("REDIS_PAS... | <commit_before><commit_msg>Add main for messaging server.<commit_after> | import os
import json
from .core.logger import configure_logging
from .core.messaging import MessageServer
def get_password():
if "REDIS_PASSWD" in os.environ:
return os.environ["REDIS_PASSWD"]
with open("/home/rpi/.variables") as f:
line = next(x.strip() for x in f if x.startswith("REDIS_PAS... | Add main for messaging server.import os
import json
from .core.logger import configure_logging
from .core.messaging import MessageServer
def get_password():
if "REDIS_PASSWD" in os.environ:
return os.environ["REDIS_PASSWD"]
with open("/home/rpi/.variables") as f:
line = next(x.strip() for x i... | <commit_before><commit_msg>Add main for messaging server.<commit_after>import os
import json
from .core.logger import configure_logging
from .core.messaging import MessageServer
def get_password():
if "REDIS_PASSWD" in os.environ:
return os.environ["REDIS_PASSWD"]
with open("/home/rpi/.variables") as... | |
53bbb9bfa6fdc1e946365e746b1acf4b03a0635e | regulations/templatetags/in_context.py | regulations/templatetags/in_context.py | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | Fix custom template tag to work with django 1.8 | Fix custom template tag to work with django 1.8
| Python | cc0-1.0 | willbarton/regulations-site,grapesmoker/regulations-site,willbarton/regulations-site,willbarton/regulations-site,grapesmoker/regulations-site,willbarton/regulations-site,ascott1/regulations-site,ascott1/regulations-site,grapesmoker/regulations-site,ascott1/regulations-site,grapesmoker/regulations-site,ascott1/regulatio... | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | <commit_before>from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field... | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field in self.subcon... | <commit_before>from django import template
register = template.Library()
class InContextNode(template.Node):
def __init__(self, nodelist, subcontext_names):
self.nodelist = nodelist
self.subcontext_names = subcontext_names
def render(self, context):
new_context = {}
for field... |
f6c21d21964d5211ab9d157ca2eedbcc064cd3bd | scripts/generate_hamilton_input_UPL.py | scripts/generate_hamilton_input_UPL.py | #!/usr/bin/env python
from EPPs.common import StepEPP, step_argparser
class GenerateHamiltonInputUPL(StepEPP):
""""Generate a CSV containing the necessary information to batch up ot 9 User Prepared Library receipt
into one DCT plate. Requires input and output plate containers and well positions from LIMS. Volu... | Test updated for change to assign_to_workflow_receive_sample.py in last commit. | Test updated for change to assign_to_workflow_receive_sample.py in last commit.
| Python | mit | EdinburghGenomics/clarity_scripts,EdinburghGenomics/clarity_scripts | Test updated for change to assign_to_workflow_receive_sample.py in last commit. | #!/usr/bin/env python
from EPPs.common import StepEPP, step_argparser
class GenerateHamiltonInputUPL(StepEPP):
""""Generate a CSV containing the necessary information to batch up ot 9 User Prepared Library receipt
into one DCT plate. Requires input and output plate containers and well positions from LIMS. Volu... | <commit_before><commit_msg>Test updated for change to assign_to_workflow_receive_sample.py in last commit.<commit_after> | #!/usr/bin/env python
from EPPs.common import StepEPP, step_argparser
class GenerateHamiltonInputUPL(StepEPP):
""""Generate a CSV containing the necessary information to batch up ot 9 User Prepared Library receipt
into one DCT plate. Requires input and output plate containers and well positions from LIMS. Volu... | Test updated for change to assign_to_workflow_receive_sample.py in last commit.#!/usr/bin/env python
from EPPs.common import StepEPP, step_argparser
class GenerateHamiltonInputUPL(StepEPP):
""""Generate a CSV containing the necessary information to batch up ot 9 User Prepared Library receipt
into one DCT plate... | <commit_before><commit_msg>Test updated for change to assign_to_workflow_receive_sample.py in last commit.<commit_after>#!/usr/bin/env python
from EPPs.common import StepEPP, step_argparser
class GenerateHamiltonInputUPL(StepEPP):
""""Generate a CSV containing the necessary information to batch up ot 9 User Prepar... | |
9fe720e01de94a59f090c909b4659d2369cfea25 | stack/skyline.py | stack/skyline.py | from collections import deque
def solution(H):
levels = deque()
blocks = 0
for i in xrange(len(H)):
print H[i]
while len(levels) > 0 and levels[-1] > H[i]:
levels.pop()
print 'Going down, H: %s, levels: %s' % (H[i], levels)
blocks += 1
if len(leve... | Add min block wall algorithm. | Add min block wall algorithm.
| Python | apache-2.0 | isendel/algorithms | Add min block wall algorithm. | from collections import deque
def solution(H):
levels = deque()
blocks = 0
for i in xrange(len(H)):
print H[i]
while len(levels) > 0 and levels[-1] > H[i]:
levels.pop()
print 'Going down, H: %s, levels: %s' % (H[i], levels)
blocks += 1
if len(leve... | <commit_before><commit_msg>Add min block wall algorithm.<commit_after> | from collections import deque
def solution(H):
levels = deque()
blocks = 0
for i in xrange(len(H)):
print H[i]
while len(levels) > 0 and levels[-1] > H[i]:
levels.pop()
print 'Going down, H: %s, levels: %s' % (H[i], levels)
blocks += 1
if len(leve... | Add min block wall algorithm.from collections import deque
def solution(H):
levels = deque()
blocks = 0
for i in xrange(len(H)):
print H[i]
while len(levels) > 0 and levels[-1] > H[i]:
levels.pop()
print 'Going down, H: %s, levels: %s' % (H[i], levels)
bl... | <commit_before><commit_msg>Add min block wall algorithm.<commit_after>from collections import deque
def solution(H):
levels = deque()
blocks = 0
for i in xrange(len(H)):
print H[i]
while len(levels) > 0 and levels[-1] > H[i]:
levels.pop()
print 'Going down, H: %s, le... | |
ea17b8c990842290f4553374a51ebc223cf363bd | mnist_8by8_classifier.py | mnist_8by8_classifier.py | from __future__ import print_function
import time
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.datasets import load_digits
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.preprocessing import LabelBinarizer
from ann import ANN
# import the simpl... | Add mnist 8by8 classifier with scikit dataset | Add mnist 8by8 classifier with scikit dataset
| Python | mit | Razvy000/ANN-Intro | Add mnist 8by8 classifier with scikit dataset | from __future__ import print_function
import time
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.datasets import load_digits
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.preprocessing import LabelBinarizer
from ann import ANN
# import the simpl... | <commit_before><commit_msg>Add mnist 8by8 classifier with scikit dataset<commit_after> | from __future__ import print_function
import time
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.datasets import load_digits
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.preprocessing import LabelBinarizer
from ann import ANN
# import the simpl... | Add mnist 8by8 classifier with scikit datasetfrom __future__ import print_function
import time
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.datasets import load_digits
from sklearn.metrics import confusion_matrix, classification_report
from sklearn.preprocessing import LabelBina... | <commit_before><commit_msg>Add mnist 8by8 classifier with scikit dataset<commit_after>from __future__ import print_function
import time
import numpy as np
from sklearn.cross_validation import train_test_split
from sklearn.datasets import load_digits
from sklearn.metrics import confusion_matrix, classification_report
fr... | |
bb79f86e4eeadaf8a93ccceaee2936e248fea99e | server/removed_expired_data.py | server/removed_expired_data.py | #!/usr/bin/env python
# Standard Library
import os
import sqlite3
import ConfigParser as configparser
from datetime import datetime
# Third party
from dateutil.relativedelta import relativedelta
config = configparser.RawConfigParser()
if not config.read([os.path.expanduser('~/.ppupload.conf') or 'ppupload.conf', '/e... | Remove expired files from database and storage. | Remove expired files from database and storage. | Python | bsd-3-clause | jhaals/filebutler-upload,jhaals/python-filebutler | Remove expired files from database and storage. | #!/usr/bin/env python
# Standard Library
import os
import sqlite3
import ConfigParser as configparser
from datetime import datetime
# Third party
from dateutil.relativedelta import relativedelta
config = configparser.RawConfigParser()
if not config.read([os.path.expanduser('~/.ppupload.conf') or 'ppupload.conf', '/e... | <commit_before><commit_msg>Remove expired files from database and storage.<commit_after> | #!/usr/bin/env python
# Standard Library
import os
import sqlite3
import ConfigParser as configparser
from datetime import datetime
# Third party
from dateutil.relativedelta import relativedelta
config = configparser.RawConfigParser()
if not config.read([os.path.expanduser('~/.ppupload.conf') or 'ppupload.conf', '/e... | Remove expired files from database and storage.#!/usr/bin/env python
# Standard Library
import os
import sqlite3
import ConfigParser as configparser
from datetime import datetime
# Third party
from dateutil.relativedelta import relativedelta
config = configparser.RawConfigParser()
if not config.read([os.path.expandu... | <commit_before><commit_msg>Remove expired files from database and storage.<commit_after>#!/usr/bin/env python
# Standard Library
import os
import sqlite3
import ConfigParser as configparser
from datetime import datetime
# Third party
from dateutil.relativedelta import relativedelta
config = configparser.RawConfigPar... | |
9600746e27e8cd10cdb9ede05d1b341be903597f | gevent_tasks/utils.py | gevent_tasks/utils.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# gevent-tasks, 2017
# <<
import random
import string
ch_choices = string.ascii_letters + string.digits
def gen_uuid(length=4):
# type: (int) -> str
""" Generate a random ID of a given length. """
return ''.join(map(lambda c: random.choice(ch_choic... | Add simple uuid generator based on length and ASCII chars | Add simple uuid generator based on length and ASCII chars
| Python | mit | blakev/gevent-tasks | Add simple uuid generator based on length and ASCII chars | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# gevent-tasks, 2017
# <<
import random
import string
ch_choices = string.ascii_letters + string.digits
def gen_uuid(length=4):
# type: (int) -> str
""" Generate a random ID of a given length. """
return ''.join(map(lambda c: random.choice(ch_choic... | <commit_before><commit_msg>Add simple uuid generator based on length and ASCII chars<commit_after> | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# gevent-tasks, 2017
# <<
import random
import string
ch_choices = string.ascii_letters + string.digits
def gen_uuid(length=4):
# type: (int) -> str
""" Generate a random ID of a given length. """
return ''.join(map(lambda c: random.choice(ch_choic... | Add simple uuid generator based on length and ASCII chars#! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# gevent-tasks, 2017
# <<
import random
import string
ch_choices = string.ascii_letters + string.digits
def gen_uuid(length=4):
# type: (int) -> str
""" Generate a random ID of a given length. ""... | <commit_before><commit_msg>Add simple uuid generator based on length and ASCII chars<commit_after>#! /usr/bin/env python
# -*- coding: utf-8 -*-
# >>
# gevent-tasks, 2017
# <<
import random
import string
ch_choices = string.ascii_letters + string.digits
def gen_uuid(length=4):
# type: (int) -> str
""" G... | |
7c2548f7f4cf01d0a5cf389c290a47cdf029a7ac | apps/explorer/tests/views/test_mixins.py | apps/explorer/tests/views/test_mixins.py | import pytest
from django.test import TestCase
from apps.explorer.views.mixins import DataTableMixin, SubsetSelectionMixin
class DataTableMixinTestCase(TestCase):
def test_get_omics_units_must_be_implemented(self):
class DataTableWithNoGetOmicsUnits(DataTableMixin):
pass
with pyte... | Add tests for explorer views mixins | Add tests for explorer views mixins
| Python | bsd-3-clause | Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel,Candihub/pixel | Add tests for explorer views mixins | import pytest
from django.test import TestCase
from apps.explorer.views.mixins import DataTableMixin, SubsetSelectionMixin
class DataTableMixinTestCase(TestCase):
def test_get_omics_units_must_be_implemented(self):
class DataTableWithNoGetOmicsUnits(DataTableMixin):
pass
with pyte... | <commit_before><commit_msg>Add tests for explorer views mixins<commit_after> | import pytest
from django.test import TestCase
from apps.explorer.views.mixins import DataTableMixin, SubsetSelectionMixin
class DataTableMixinTestCase(TestCase):
def test_get_omics_units_must_be_implemented(self):
class DataTableWithNoGetOmicsUnits(DataTableMixin):
pass
with pyte... | Add tests for explorer views mixinsimport pytest
from django.test import TestCase
from apps.explorer.views.mixins import DataTableMixin, SubsetSelectionMixin
class DataTableMixinTestCase(TestCase):
def test_get_omics_units_must_be_implemented(self):
class DataTableWithNoGetOmicsUnits(DataTableMixin):
... | <commit_before><commit_msg>Add tests for explorer views mixins<commit_after>import pytest
from django.test import TestCase
from apps.explorer.views.mixins import DataTableMixin, SubsetSelectionMixin
class DataTableMixinTestCase(TestCase):
def test_get_omics_units_must_be_implemented(self):
class DataT... | |
988481094bd34842e3ec186ec5c7daaff9663591 | examples/dots.py | examples/dots.py | from threading import Thread
from time import sleep
from nuimo import Controller, ControllerManager, ControllerListener, LedMatrix
MAC_ADDRESS = "c4:d7:54:71:e2:ce"
class NuimoListener(ControllerListener):
def __init__(self, controller):
self.controller = controller
self.stopping = False
... | Add an example how to write to the LED matrix from another thread | Add an example how to write to the LED matrix from another thread
| Python | mit | getsenic/nuimo-linux-python | Add an example how to write to the LED matrix from another thread | from threading import Thread
from time import sleep
from nuimo import Controller, ControllerManager, ControllerListener, LedMatrix
MAC_ADDRESS = "c4:d7:54:71:e2:ce"
class NuimoListener(ControllerListener):
def __init__(self, controller):
self.controller = controller
self.stopping = False
... | <commit_before><commit_msg>Add an example how to write to the LED matrix from another thread<commit_after> | from threading import Thread
from time import sleep
from nuimo import Controller, ControllerManager, ControllerListener, LedMatrix
MAC_ADDRESS = "c4:d7:54:71:e2:ce"
class NuimoListener(ControllerListener):
def __init__(self, controller):
self.controller = controller
self.stopping = False
... | Add an example how to write to the LED matrix from another threadfrom threading import Thread
from time import sleep
from nuimo import Controller, ControllerManager, ControllerListener, LedMatrix
MAC_ADDRESS = "c4:d7:54:71:e2:ce"
class NuimoListener(ControllerListener):
def __init__(self, controller):
... | <commit_before><commit_msg>Add an example how to write to the LED matrix from another thread<commit_after>from threading import Thread
from time import sleep
from nuimo import Controller, ControllerManager, ControllerListener, LedMatrix
MAC_ADDRESS = "c4:d7:54:71:e2:ce"
class NuimoListener(ControllerListener):
... | |
5c167d35ea341e8ea33596f4174e16b9aafa041a | py/perfect-number.py | py/perfect-number.py | class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
MersennePrime = [3, 7, 31, 127, 8191, 131071, 524287]
MPp = [2, 3, 5, 7, 13, 17, 19]
perfectnumbers = set(map(lambda a, b:a * (1 << (b - 1)), MersennePrime, MPp))
... | Add py solution for 507. Perfect Number | Add py solution for 507. Perfect Number
507. Perfect Number: https://leetcode.com/problems/perfect-number/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 507. Perfect Number
507. Perfect Number: https://leetcode.com/problems/perfect-number/ | class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
MersennePrime = [3, 7, 31, 127, 8191, 131071, 524287]
MPp = [2, 3, 5, 7, 13, 17, 19]
perfectnumbers = set(map(lambda a, b:a * (1 << (b - 1)), MersennePrime, MPp))
... | <commit_before><commit_msg>Add py solution for 507. Perfect Number
507. Perfect Number: https://leetcode.com/problems/perfect-number/<commit_after> | class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
MersennePrime = [3, 7, 31, 127, 8191, 131071, 524287]
MPp = [2, 3, 5, 7, 13, 17, 19]
perfectnumbers = set(map(lambda a, b:a * (1 << (b - 1)), MersennePrime, MPp))
... | Add py solution for 507. Perfect Number
507. Perfect Number: https://leetcode.com/problems/perfect-number/class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
MersennePrime = [3, 7, 31, 127, 8191, 131071, 524287]
MPp = [2, 3,... | <commit_before><commit_msg>Add py solution for 507. Perfect Number
507. Perfect Number: https://leetcode.com/problems/perfect-number/<commit_after>class Solution(object):
def checkPerfectNumber(self, num):
"""
:type num: int
:rtype: bool
"""
MersennePrime = [3, 7, 31, 127, 8... | |
70b245f321bf542111929a1f1ba5460c46c067fc | python/gameOfLife.py | python/gameOfLife.py | # https://leetcode.com/problems/game-of-life/
class Solution(object):
def gameOfLife(self, board):
"""
:type board: List[List[int]]
:rtype: void Do not return anything, modify board in-place instead.
"""
dx = (-1, -1, -1, 0, 1, 1, 1, 0)
dy = (-1, 0, 1, 1, 1, 0, -1, -... | Add problem Game Of Life | Add problem Game Of Life
| Python | mit | guozengxin/myleetcode,guozengxin/myleetcode | Add problem Game Of Life | # https://leetcode.com/problems/game-of-life/
class Solution(object):
def gameOfLife(self, board):
"""
:type board: List[List[int]]
:rtype: void Do not return anything, modify board in-place instead.
"""
dx = (-1, -1, -1, 0, 1, 1, 1, 0)
dy = (-1, 0, 1, 1, 1, 0, -1, -... | <commit_before><commit_msg>Add problem Game Of Life<commit_after> | # https://leetcode.com/problems/game-of-life/
class Solution(object):
def gameOfLife(self, board):
"""
:type board: List[List[int]]
:rtype: void Do not return anything, modify board in-place instead.
"""
dx = (-1, -1, -1, 0, 1, 1, 1, 0)
dy = (-1, 0, 1, 1, 1, 0, -1, -... | Add problem Game Of Life# https://leetcode.com/problems/game-of-life/
class Solution(object):
def gameOfLife(self, board):
"""
:type board: List[List[int]]
:rtype: void Do not return anything, modify board in-place instead.
"""
dx = (-1, -1, -1, 0, 1, 1, 1, 0)
dy = (... | <commit_before><commit_msg>Add problem Game Of Life<commit_after># https://leetcode.com/problems/game-of-life/
class Solution(object):
def gameOfLife(self, board):
"""
:type board: List[List[int]]
:rtype: void Do not return anything, modify board in-place instead.
"""
dx = (... | |
0ab30d3f9b836db48b5e05614c5e1807d9189977 | sheldon/basic_classes.py | sheldon/basic_classes.py | # -*- coding: utf-8 -*-
"""
Declaration of classes needed for bot working:
Adapter class, Plugin class
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from time import sleep
class Adapter:
"""
Adapter class contains information about adapter:
name, ... | Add realization of adapter class | Add realization of adapter class
| Python | mit | lises/sheldon | Add realization of adapter class | # -*- coding: utf-8 -*-
"""
Declaration of classes needed for bot working:
Adapter class, Plugin class
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from time import sleep
class Adapter:
"""
Adapter class contains information about adapter:
name, ... | <commit_before><commit_msg>Add realization of adapter class<commit_after> | # -*- coding: utf-8 -*-
"""
Declaration of classes needed for bot working:
Adapter class, Plugin class
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from time import sleep
class Adapter:
"""
Adapter class contains information about adapter:
name, ... | Add realization of adapter class# -*- coding: utf-8 -*-
"""
Declaration of classes needed for bot working:
Adapter class, Plugin class
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from time import sleep
class Adapter:
"""
Adapter class contains infor... | <commit_before><commit_msg>Add realization of adapter class<commit_after># -*- coding: utf-8 -*-
"""
Declaration of classes needed for bot working:
Adapter class, Plugin class
@author: Lises team
@contact: [email protected]
@license: The MIT license
Copyright (C) 2015
"""
from time import sleep
class Adapter:... | |
12a2113453eb5ec6171d52a49948ea663609afbd | gutenbrowse/util.py | gutenbrowse/util.py | import urllib as _urllib
class HTTPError(IOError):
def __init__(self, code, msg, headers):
IOError.__init__(self, 'HTTP error', code, msg, headers)
def __str__(self):
return "HTTP: %d %s" % (self.args[1], self.args[2])
class MyURLOpener(_urllib.FancyURLopener):
def http_error_default(self,... | Add an exception-raising-on-http-error urlopen function | Add an exception-raising-on-http-error urlopen function
| Python | bsd-3-clause | pv/mgutenberg,pv/mgutenberg | Add an exception-raising-on-http-error urlopen function | import urllib as _urllib
class HTTPError(IOError):
def __init__(self, code, msg, headers):
IOError.__init__(self, 'HTTP error', code, msg, headers)
def __str__(self):
return "HTTP: %d %s" % (self.args[1], self.args[2])
class MyURLOpener(_urllib.FancyURLopener):
def http_error_default(self,... | <commit_before><commit_msg>Add an exception-raising-on-http-error urlopen function<commit_after> | import urllib as _urllib
class HTTPError(IOError):
def __init__(self, code, msg, headers):
IOError.__init__(self, 'HTTP error', code, msg, headers)
def __str__(self):
return "HTTP: %d %s" % (self.args[1], self.args[2])
class MyURLOpener(_urllib.FancyURLopener):
def http_error_default(self,... | Add an exception-raising-on-http-error urlopen functionimport urllib as _urllib
class HTTPError(IOError):
def __init__(self, code, msg, headers):
IOError.__init__(self, 'HTTP error', code, msg, headers)
def __str__(self):
return "HTTP: %d %s" % (self.args[1], self.args[2])
class MyURLOpener(_u... | <commit_before><commit_msg>Add an exception-raising-on-http-error urlopen function<commit_after>import urllib as _urllib
class HTTPError(IOError):
def __init__(self, code, msg, headers):
IOError.__init__(self, 'HTTP error', code, msg, headers)
def __str__(self):
return "HTTP: %d %s" % (self.arg... | |
c6480cad80a9c8eb93afdb3bd31a8c8c21eea8d9 | scripts/pubmedextract.py | scripts/pubmedextract.py | """
Extract a set of doc ids from the pubmed xml files.
"""
import argparse
import glob
import gzip
import multiprocessing
import os
from functools import partial
from multiprocessing import Pool
import sys
from lxml import etree
def parse_pubmeds(pmids: list, file: str) -> str:
"""
:param pmids:
:param... | Add script for extracting pmids out of pubmed data. | Add script for extracting pmids out of pubmed data.
| Python | apache-2.0 | leifos/lucene4ir,leifos/lucene4ir,leifos/lucene4ir,lucene4ir/lucene4ir,lucene4ir/lucene4ir,lucene4ir/lucene4ir | Add script for extracting pmids out of pubmed data. | """
Extract a set of doc ids from the pubmed xml files.
"""
import argparse
import glob
import gzip
import multiprocessing
import os
from functools import partial
from multiprocessing import Pool
import sys
from lxml import etree
def parse_pubmeds(pmids: list, file: str) -> str:
"""
:param pmids:
:param... | <commit_before><commit_msg>Add script for extracting pmids out of pubmed data.<commit_after> | """
Extract a set of doc ids from the pubmed xml files.
"""
import argparse
import glob
import gzip
import multiprocessing
import os
from functools import partial
from multiprocessing import Pool
import sys
from lxml import etree
def parse_pubmeds(pmids: list, file: str) -> str:
"""
:param pmids:
:param... | Add script for extracting pmids out of pubmed data."""
Extract a set of doc ids from the pubmed xml files.
"""
import argparse
import glob
import gzip
import multiprocessing
import os
from functools import partial
from multiprocessing import Pool
import sys
from lxml import etree
def parse_pubmeds(pmids: list, file:... | <commit_before><commit_msg>Add script for extracting pmids out of pubmed data.<commit_after>"""
Extract a set of doc ids from the pubmed xml files.
"""
import argparse
import glob
import gzip
import multiprocessing
import os
from functools import partial
from multiprocessing import Pool
import sys
from lxml import etr... | |
27b43cd5dd8c27afd8b7dbacd3024c222af909d0 | tests/test_int_vs_long.py | tests/test_int_vs_long.py | from __future__ import absolute_import, unicode_literals
import unittest
from jnius import autoclass, cast, PythonJavaClass, java_method
class TestImplemIterator(PythonJavaClass):
__javainterfaces__ = ['java/util/ListIterator']
class TestImplem(PythonJavaClass):
__javainterfaces__ = ['java/util/List']
... | Add test for INT vs LONG conversion on Py2 | Add test for INT vs LONG conversion on Py2
int and long are the same on py3, but we do care about the conversion from Python too which in case INT is >=2**31 then Java might have problem with that and it could cause issues for the users
| Python | mit | kivy/pyjnius,kivy/pyjnius,kivy/pyjnius | Add test for INT vs LONG conversion on Py2
int and long are the same on py3, but we do care about the conversion from Python too which in case INT is >=2**31 then Java might have problem with that and it could cause issues for the users | from __future__ import absolute_import, unicode_literals
import unittest
from jnius import autoclass, cast, PythonJavaClass, java_method
class TestImplemIterator(PythonJavaClass):
__javainterfaces__ = ['java/util/ListIterator']
class TestImplem(PythonJavaClass):
__javainterfaces__ = ['java/util/List']
... | <commit_before><commit_msg>Add test for INT vs LONG conversion on Py2
int and long are the same on py3, but we do care about the conversion from Python too which in case INT is >=2**31 then Java might have problem with that and it could cause issues for the users<commit_after> | from __future__ import absolute_import, unicode_literals
import unittest
from jnius import autoclass, cast, PythonJavaClass, java_method
class TestImplemIterator(PythonJavaClass):
__javainterfaces__ = ['java/util/ListIterator']
class TestImplem(PythonJavaClass):
__javainterfaces__ = ['java/util/List']
... | Add test for INT vs LONG conversion on Py2
int and long are the same on py3, but we do care about the conversion from Python too which in case INT is >=2**31 then Java might have problem with that and it could cause issues for the usersfrom __future__ import absolute_import, unicode_literals
import unittest
from jnius... | <commit_before><commit_msg>Add test for INT vs LONG conversion on Py2
int and long are the same on py3, but we do care about the conversion from Python too which in case INT is >=2**31 then Java might have problem with that and it could cause issues for the users<commit_after>from __future__ import absolute_import, un... | |
266eae5880b352783ca3cb31af8eae3fc40e5ea5 | snoboy/tests/test_cpu.py | snoboy/tests/test_cpu.py | from nose.tools import eq_, ok_
from snoboy import cpu
def test_BC():
cpu.registers.DE = 0xB060
cpu.registers.BC = 0xC005
eq_(cpu.registers.BC, 0xC005)
eq_(cpu.registers.DE, 0xB060)
| Add simple test case for cpu compound registers | Add simple test case for cpu compound registers
| Python | mit | Osmose/snoboy | Add simple test case for cpu compound registers | from nose.tools import eq_, ok_
from snoboy import cpu
def test_BC():
cpu.registers.DE = 0xB060
cpu.registers.BC = 0xC005
eq_(cpu.registers.BC, 0xC005)
eq_(cpu.registers.DE, 0xB060)
| <commit_before><commit_msg>Add simple test case for cpu compound registers<commit_after> | from nose.tools import eq_, ok_
from snoboy import cpu
def test_BC():
cpu.registers.DE = 0xB060
cpu.registers.BC = 0xC005
eq_(cpu.registers.BC, 0xC005)
eq_(cpu.registers.DE, 0xB060)
| Add simple test case for cpu compound registersfrom nose.tools import eq_, ok_
from snoboy import cpu
def test_BC():
cpu.registers.DE = 0xB060
cpu.registers.BC = 0xC005
eq_(cpu.registers.BC, 0xC005)
eq_(cpu.registers.DE, 0xB060)
| <commit_before><commit_msg>Add simple test case for cpu compound registers<commit_after>from nose.tools import eq_, ok_
from snoboy import cpu
def test_BC():
cpu.registers.DE = 0xB060
cpu.registers.BC = 0xC005
eq_(cpu.registers.BC, 0xC005)
eq_(cpu.registers.DE, 0xB060)
| |
6bbde2294d1f5eeb4dde2ee76f6a874c6ed52ead | src/products/baseball.py | src/products/baseball.py | import numpy as np
import tensorflow.contrib.keras as keras
PWD = 'products'
MODEL = "{}/model.h5".format(PWD)
THRESHOLD = 0.75
# Load model.
model = keras.models.load_model(MODEL)
# Stream test photos.
test_datagen = keras.preprocessing.image.ImageDataGenerator(
rescale=1. / 255)
test_generator = tes... | Add script to only predict if above confidence threshold. | Add script to only predict if above confidence threshold.
| Python | mit | isaacanthony/tensorflow-playground,isaacanthony/tensorflow-playground | Add script to only predict if above confidence threshold. | import numpy as np
import tensorflow.contrib.keras as keras
PWD = 'products'
MODEL = "{}/model.h5".format(PWD)
THRESHOLD = 0.75
# Load model.
model = keras.models.load_model(MODEL)
# Stream test photos.
test_datagen = keras.preprocessing.image.ImageDataGenerator(
rescale=1. / 255)
test_generator = tes... | <commit_before><commit_msg>Add script to only predict if above confidence threshold.<commit_after> | import numpy as np
import tensorflow.contrib.keras as keras
PWD = 'products'
MODEL = "{}/model.h5".format(PWD)
THRESHOLD = 0.75
# Load model.
model = keras.models.load_model(MODEL)
# Stream test photos.
test_datagen = keras.preprocessing.image.ImageDataGenerator(
rescale=1. / 255)
test_generator = tes... | Add script to only predict if above confidence threshold.import numpy as np
import tensorflow.contrib.keras as keras
PWD = 'products'
MODEL = "{}/model.h5".format(PWD)
THRESHOLD = 0.75
# Load model.
model = keras.models.load_model(MODEL)
# Stream test photos.
test_datagen = keras.preprocessing.image.ImageD... | <commit_before><commit_msg>Add script to only predict if above confidence threshold.<commit_after>import numpy as np
import tensorflow.contrib.keras as keras
PWD = 'products'
MODEL = "{}/model.h5".format(PWD)
THRESHOLD = 0.75
# Load model.
model = keras.models.load_model(MODEL)
# Stream test photos.
test_d... | |
9b6f703d65cfbf57cf5b4aee224b89c215f931eb | packaging/__init__.py | packaging/__init__.py | # Copyright 2014 Donald Stufft
#
# 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, so... | # Copyright 2014 Donald Stufft
#
# 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, so... | Use relative import to allow vendoring | Use relative import to allow vendoring
| Python | apache-2.0 | xavfernandez/packaging,nvie/packaging | # Copyright 2014 Donald Stufft
#
# 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, so... | # Copyright 2014 Donald Stufft
#
# 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, so... | <commit_before># Copyright 2014 Donald Stufft
#
# 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... | # Copyright 2014 Donald Stufft
#
# 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, so... | # Copyright 2014 Donald Stufft
#
# 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, so... | <commit_before># Copyright 2014 Donald Stufft
#
# 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... |
0c60ce6b4c816c080c56b44a0568c0b9520c3581 | lms/djangoapps/student_account/careersandenterprise.py | lms/djangoapps/student_account/careersandenterprise.py | from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
import re
log = logging.getLogger(__name__)
class CareersAndEnterpriseOAuth2(BaseOAuth2):
"""Careers and Enterprise Company OAuth2 authentication backend."""
settings_dict = settings.CUSTOM_BACKENDS.get('careers... | Add initial version Careers and Enterprise Oauth2 backend. | Add initial version Careers and Enterprise Oauth2 backend.
| Python | agpl-3.0 | proversity-org/edx-platform,proversity-org/edx-platform,proversity-org/edx-platform,proversity-org/edx-platform | Add initial version Careers and Enterprise Oauth2 backend. | from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
import re
log = logging.getLogger(__name__)
class CareersAndEnterpriseOAuth2(BaseOAuth2):
"""Careers and Enterprise Company OAuth2 authentication backend."""
settings_dict = settings.CUSTOM_BACKENDS.get('careers... | <commit_before><commit_msg>Add initial version Careers and Enterprise Oauth2 backend.<commit_after> | from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
import re
log = logging.getLogger(__name__)
class CareersAndEnterpriseOAuth2(BaseOAuth2):
"""Careers and Enterprise Company OAuth2 authentication backend."""
settings_dict = settings.CUSTOM_BACKENDS.get('careers... | Add initial version Careers and Enterprise Oauth2 backend.from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
import re
log = logging.getLogger(__name__)
class CareersAndEnterpriseOAuth2(BaseOAuth2):
"""Careers and Enterprise Company OAuth2 authentication backend."""... | <commit_before><commit_msg>Add initial version Careers and Enterprise Oauth2 backend.<commit_after>from django.conf import settings
from social_core.backends.oauth import BaseOAuth2
import logging
import re
log = logging.getLogger(__name__)
class CareersAndEnterpriseOAuth2(BaseOAuth2):
"""Careers and Enterprise ... | |
42a43d6594efc21ab29ea079f758df5bd2ec3c41 | Homeworks/HW1/Problem1.py | Homeworks/HW1/Problem1.py | """Problem 1: Break math
Break math using a computer. To be a bit more specific, demonstrate a
numerical calculation using the computer language of your choice where
the answer is demonstrably wrong. I'll want to see the code you used,
preferably something brief and punchy, and then the result. For full credit,
fix mat... | Add hw 1 problem 1 solution | Add hw 1 problem 1 solution
| Python | mit | dankolbman/NumericalAnalysis | Add hw 1 problem 1 solution | """Problem 1: Break math
Break math using a computer. To be a bit more specific, demonstrate a
numerical calculation using the computer language of your choice where
the answer is demonstrably wrong. I'll want to see the code you used,
preferably something brief and punchy, and then the result. For full credit,
fix mat... | <commit_before><commit_msg>Add hw 1 problem 1 solution<commit_after> | """Problem 1: Break math
Break math using a computer. To be a bit more specific, demonstrate a
numerical calculation using the computer language of your choice where
the answer is demonstrably wrong. I'll want to see the code you used,
preferably something brief and punchy, and then the result. For full credit,
fix mat... | Add hw 1 problem 1 solution"""Problem 1: Break math
Break math using a computer. To be a bit more specific, demonstrate a
numerical calculation using the computer language of your choice where
the answer is demonstrably wrong. I'll want to see the code you used,
preferably something brief and punchy, and then the resul... | <commit_before><commit_msg>Add hw 1 problem 1 solution<commit_after>"""Problem 1: Break math
Break math using a computer. To be a bit more specific, demonstrate a
numerical calculation using the computer language of your choice where
the answer is demonstrably wrong. I'll want to see the code you used,
preferably somet... | |
d997f0aa51b20be8038e96bd6a79783b507aea08 | constantDraw.py | constantDraw.py | def draw_constant(res=10):
"""Re-draws a Read node using Constant nodes as pixels."""
# Checks that the user has selected a Read node.
try:
if nuke.selectedNode().Class() != "Read":
# Pushes pop up message to the user
nuke.message("No Read node selected to re-draw!")
... | Add .py file to repo. | Add .py file to repo.
| Python | mit | SurpriseTRex/node-draw | Add .py file to repo. | def draw_constant(res=10):
"""Re-draws a Read node using Constant nodes as pixels."""
# Checks that the user has selected a Read node.
try:
if nuke.selectedNode().Class() != "Read":
# Pushes pop up message to the user
nuke.message("No Read node selected to re-draw!")
... | <commit_before><commit_msg>Add .py file to repo.<commit_after> | def draw_constant(res=10):
"""Re-draws a Read node using Constant nodes as pixels."""
# Checks that the user has selected a Read node.
try:
if nuke.selectedNode().Class() != "Read":
# Pushes pop up message to the user
nuke.message("No Read node selected to re-draw!")
... | Add .py file to repo.def draw_constant(res=10):
"""Re-draws a Read node using Constant nodes as pixels."""
# Checks that the user has selected a Read node.
try:
if nuke.selectedNode().Class() != "Read":
# Pushes pop up message to the user
nuke.message("No Read node selected ... | <commit_before><commit_msg>Add .py file to repo.<commit_after>def draw_constant(res=10):
"""Re-draws a Read node using Constant nodes as pixels."""
# Checks that the user has selected a Read node.
try:
if nuke.selectedNode().Class() != "Read":
# Pushes pop up message to the user
... | |
0e899fabae552a33b7dfabe9908a0ad0279055b6 | tests/header_passthrough_tests.py | tests/header_passthrough_tests.py | from django.test.client import RequestFactory
from mock import Mock
from unittest2 import TestCase
from helpers import RequestPatchMixin
from test_views import TestProxy
class HttpProxyHeaderPassThrough(TestCase, RequestPatchMixin):
"""HttpProxy header pass through"""
def setUp(self):
self.proxy = Te... | Add header pass through tests | Add header pass through tests
| Python | mit | thomasw/djproxy | Add header pass through tests | from django.test.client import RequestFactory
from mock import Mock
from unittest2 import TestCase
from helpers import RequestPatchMixin
from test_views import TestProxy
class HttpProxyHeaderPassThrough(TestCase, RequestPatchMixin):
"""HttpProxy header pass through"""
def setUp(self):
self.proxy = Te... | <commit_before><commit_msg>Add header pass through tests<commit_after> | from django.test.client import RequestFactory
from mock import Mock
from unittest2 import TestCase
from helpers import RequestPatchMixin
from test_views import TestProxy
class HttpProxyHeaderPassThrough(TestCase, RequestPatchMixin):
"""HttpProxy header pass through"""
def setUp(self):
self.proxy = Te... | Add header pass through testsfrom django.test.client import RequestFactory
from mock import Mock
from unittest2 import TestCase
from helpers import RequestPatchMixin
from test_views import TestProxy
class HttpProxyHeaderPassThrough(TestCase, RequestPatchMixin):
"""HttpProxy header pass through"""
def setUp(s... | <commit_before><commit_msg>Add header pass through tests<commit_after>from django.test.client import RequestFactory
from mock import Mock
from unittest2 import TestCase
from helpers import RequestPatchMixin
from test_views import TestProxy
class HttpProxyHeaderPassThrough(TestCase, RequestPatchMixin):
"""HttpPro... | |
198fe89f055d2bdd1d8b0ea2a8df46f75a9ee21d | guessenc.py | guessenc.py | #!/usr/bin/env python
import sys
# common characters in GB
gb_cc = frozenset([
b"\xce\xd2", # 我
b"\xb5\xc4", # 的
b"\xc4\xe3", # 你
b"\xca\xc7", # 是
b"\xb2\xbb", # 不
b"\xc1\xcb", # 了
b"\xd2\xbb", # 一
b"\xc3\xc7", # 们
b"\xd5\xe2", # 这
b"\xd3\xd0" # 有
])
big5_cc = frozenset([
b"\xa7\xda", # 我
b"\xaa\xba", # 的
b"\xa7\x... | Add script to guess text encoding | Add script to guess text encoding
| Python | agpl-3.0 | erjiang/hanzidefs | Add script to guess text encoding | #!/usr/bin/env python
import sys
# common characters in GB
gb_cc = frozenset([
b"\xce\xd2", # 我
b"\xb5\xc4", # 的
b"\xc4\xe3", # 你
b"\xca\xc7", # 是
b"\xb2\xbb", # 不
b"\xc1\xcb", # 了
b"\xd2\xbb", # 一
b"\xc3\xc7", # 们
b"\xd5\xe2", # 这
b"\xd3\xd0" # 有
])
big5_cc = frozenset([
b"\xa7\xda", # 我
b"\xaa\xba", # 的
b"\xa7\x... | <commit_before><commit_msg>Add script to guess text encoding<commit_after> | #!/usr/bin/env python
import sys
# common characters in GB
gb_cc = frozenset([
b"\xce\xd2", # 我
b"\xb5\xc4", # 的
b"\xc4\xe3", # 你
b"\xca\xc7", # 是
b"\xb2\xbb", # 不
b"\xc1\xcb", # 了
b"\xd2\xbb", # 一
b"\xc3\xc7", # 们
b"\xd5\xe2", # 这
b"\xd3\xd0" # 有
])
big5_cc = frozenset([
b"\xa7\xda", # 我
b"\xaa\xba", # 的
b"\xa7\x... | Add script to guess text encoding#!/usr/bin/env python
import sys
# common characters in GB
gb_cc = frozenset([
b"\xce\xd2", # 我
b"\xb5\xc4", # 的
b"\xc4\xe3", # 你
b"\xca\xc7", # 是
b"\xb2\xbb", # 不
b"\xc1\xcb", # 了
b"\xd2\xbb", # 一
b"\xc3\xc7", # 们
b"\xd5\xe2", # 这
b"\xd3\xd0" # 有
])
big5_cc = frozenset([
b"\xa7\xd... | <commit_before><commit_msg>Add script to guess text encoding<commit_after>#!/usr/bin/env python
import sys
# common characters in GB
gb_cc = frozenset([
b"\xce\xd2", # 我
b"\xb5\xc4", # 的
b"\xc4\xe3", # 你
b"\xca\xc7", # 是
b"\xb2\xbb", # 不
b"\xc1\xcb", # 了
b"\xd2\xbb", # 一
b"\xc3\xc7", # 们
b"\xd5\xe2", # 这
b"\xd3\xd0... | |
4b91050ddb5357970462d5a15fe0d1ed97d51178 | tests/variable_fields.py | tests/variable_fields.py | """Test cases for variable fields
"""
import unittest
from lighty.templates import Template
class VariableFieldTestCase(unittest.TestCase):
"""Test case for block template tag
"""
def setUp(self):
self.value = 'value'
self.variable_template = Template(name='base.html')
self.varia... | Add test for fields variables lookup | Add test for fields variables lookup
| Python | bsd-3-clause | GrAndSE/lighty,GrAndSE/lighty-template | Add test for fields variables lookup | """Test cases for variable fields
"""
import unittest
from lighty.templates import Template
class VariableFieldTestCase(unittest.TestCase):
"""Test case for block template tag
"""
def setUp(self):
self.value = 'value'
self.variable_template = Template(name='base.html')
self.varia... | <commit_before><commit_msg>Add test for fields variables lookup<commit_after> | """Test cases for variable fields
"""
import unittest
from lighty.templates import Template
class VariableFieldTestCase(unittest.TestCase):
"""Test case for block template tag
"""
def setUp(self):
self.value = 'value'
self.variable_template = Template(name='base.html')
self.varia... | Add test for fields variables lookup"""Test cases for variable fields
"""
import unittest
from lighty.templates import Template
class VariableFieldTestCase(unittest.TestCase):
"""Test case for block template tag
"""
def setUp(self):
self.value = 'value'
self.variable_template = Template(... | <commit_before><commit_msg>Add test for fields variables lookup<commit_after>"""Test cases for variable fields
"""
import unittest
from lighty.templates import Template
class VariableFieldTestCase(unittest.TestCase):
"""Test case for block template tag
"""
def setUp(self):
self.value = 'value'
... | |
7d8164982754c86cc3fb90662795373845813c47 | myuw/management/commands/check_preference.py | myuw/management/commands/check_preference.py | #!/usr/bin/python
"""
Test all the links in the CSV for non-200 status codes (after redirects).
"""
import sys
from django.core.management.base import BaseCommand, CommandError
from myuw.models import UserMigrationPreference
class Command(BaseCommand):
args = "<user netid>"
help = "Find the Migration Prefere... | Add a management command to check legacy preference | Add a management command to check legacy preference
| Python | apache-2.0 | uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw,uw-it-aca/myuw | Add a management command to check legacy preference | #!/usr/bin/python
"""
Test all the links in the CSV for non-200 status codes (after redirects).
"""
import sys
from django.core.management.base import BaseCommand, CommandError
from myuw.models import UserMigrationPreference
class Command(BaseCommand):
args = "<user netid>"
help = "Find the Migration Prefere... | <commit_before><commit_msg>Add a management command to check legacy preference<commit_after> | #!/usr/bin/python
"""
Test all the links in the CSV for non-200 status codes (after redirects).
"""
import sys
from django.core.management.base import BaseCommand, CommandError
from myuw.models import UserMigrationPreference
class Command(BaseCommand):
args = "<user netid>"
help = "Find the Migration Prefere... | Add a management command to check legacy preference#!/usr/bin/python
"""
Test all the links in the CSV for non-200 status codes (after redirects).
"""
import sys
from django.core.management.base import BaseCommand, CommandError
from myuw.models import UserMigrationPreference
class Command(BaseCommand):
args = "<... | <commit_before><commit_msg>Add a management command to check legacy preference<commit_after>#!/usr/bin/python
"""
Test all the links in the CSV for non-200 status codes (after redirects).
"""
import sys
from django.core.management.base import BaseCommand, CommandError
from myuw.models import UserMigrationPreference
... | |
5caf415a1517017271cbdce8e5bd3de3e552420e | test/unittests/skills/test_context.py | test/unittests/skills/test_context.py | from unittest import TestCase, mock
from mycroft.skills.context import adds_context, removes_context
"""
Tests for the adapt context decorators.
"""
class ContextSkillMock(mock.Mock):
"""Mock class to apply decorators on."""
@adds_context('DestroyContext')
def handler_adding_context(self):
pass
... | Add tests for context decorators | Add tests for context decorators
| Python | apache-2.0 | forslund/mycroft-core,MycroftAI/mycroft-core,MycroftAI/mycroft-core,forslund/mycroft-core | Add tests for context decorators | from unittest import TestCase, mock
from mycroft.skills.context import adds_context, removes_context
"""
Tests for the adapt context decorators.
"""
class ContextSkillMock(mock.Mock):
"""Mock class to apply decorators on."""
@adds_context('DestroyContext')
def handler_adding_context(self):
pass
... | <commit_before><commit_msg>Add tests for context decorators<commit_after> | from unittest import TestCase, mock
from mycroft.skills.context import adds_context, removes_context
"""
Tests for the adapt context decorators.
"""
class ContextSkillMock(mock.Mock):
"""Mock class to apply decorators on."""
@adds_context('DestroyContext')
def handler_adding_context(self):
pass
... | Add tests for context decoratorsfrom unittest import TestCase, mock
from mycroft.skills.context import adds_context, removes_context
"""
Tests for the adapt context decorators.
"""
class ContextSkillMock(mock.Mock):
"""Mock class to apply decorators on."""
@adds_context('DestroyContext')
def handler_addi... | <commit_before><commit_msg>Add tests for context decorators<commit_after>from unittest import TestCase, mock
from mycroft.skills.context import adds_context, removes_context
"""
Tests for the adapt context decorators.
"""
class ContextSkillMock(mock.Mock):
"""Mock class to apply decorators on."""
@adds_conte... | |
b0f3c0f8db69b7c4a141bd32680ed937b40d34c6 | util/item_name_gen.py | util/item_name_gen.py | '''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % base
num = num // base
a... | Add util script to generate item names. | Add util script to generate item names.
| Python | unlicense | ArchiveTeam/twitpic-discovery,ArchiveTeam/twitpic-discovery | Add util script to generate item names. | '''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % base
num = num // base
a... | <commit_before><commit_msg>Add util script to generate item names.<commit_after> | '''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % base
num = num // base
a... | Add util script to generate item names.'''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alphabet)
while num:
rem = num % b... | <commit_before><commit_msg>Add util script to generate item names.<commit_after>'''Script to help generate item names.'''
def int_to_str(num, alphabet):
'''Convert integer to string.'''
# http://stackoverflow.com/a/1119769/1524507
if (num == 0):
return alphabet[0]
arr = []
base = len(alpha... | |
a4d312411cb125685291e81b8bb2204324fea34d | sandbox/order/migrations/0005_auto_20170502_1533.py | sandbox/order/migrations/0005_auto_20170502_1533.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-02 15:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0004_auto_20160111_1108'),
]
operations = [
migrations.AlterField(... | Add missing migration in sandbox | Add missing migration in sandbox
| Python | isc | thelabnyc/django-oscar-api-checkout | Add missing migration in sandbox | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-02 15:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0004_auto_20160111_1108'),
]
operations = [
migrations.AlterField(... | <commit_before><commit_msg>Add missing migration in sandbox<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-02 15:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0004_auto_20160111_1108'),
]
operations = [
migrations.AlterField(... | Add missing migration in sandbox# -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-02 15:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0004_auto_20160111_1108'),
]
operations = ... | <commit_before><commit_msg>Add missing migration in sandbox<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-02 15:33
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('order', '0004_auto_... | |
6bde05ad9c16be2677ab6c91444e793529a9fdd3 | comrade/core/models.py | comrade/core/models.py | from django.db import models
class ComradeBaseModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
def __str__(self):
return self.__unicode__()
def __repr__(self):
return self.__unicode__()
class Meta:
abstr... | Add a base Django model to share common functionality. | Add a base Django model to share common functionality.
| Python | mit | bueda/django-comrade | Add a base Django model to share common functionality. | from django.db import models
class ComradeBaseModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
def __str__(self):
return self.__unicode__()
def __repr__(self):
return self.__unicode__()
class Meta:
abstr... | <commit_before><commit_msg>Add a base Django model to share common functionality.<commit_after> | from django.db import models
class ComradeBaseModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
def __str__(self):
return self.__unicode__()
def __repr__(self):
return self.__unicode__()
class Meta:
abstr... | Add a base Django model to share common functionality.from django.db import models
class ComradeBaseModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
def __str__(self):
return self.__unicode__()
def __repr__(self):
re... | <commit_before><commit_msg>Add a base Django model to share common functionality.<commit_after>from django.db import models
class ComradeBaseModel(models.Model):
created = models.DateTimeField(auto_now_add=True)
modified = models.DateTimeField(auto_now=True)
def __str__(self):
return self.__unicod... | |
b154468b085dad53de8fdef09ec42c8518475556 | tests/basics/string_format_modulo_int.py | tests/basics/string_format_modulo_int.py | # test string modulo formatting with int values
# test + option with various amount of padding
for pad in ('', ' ', '0'):
for n in (1, 2, 3):
for val in (-1, 0, 1):
print(('%+' + pad + str(n) + 'd') % val)
| Add test for string module formatting with int argument. | tests/basics: Add test for string module formatting with int argument.
| Python | mit | infinnovation/micropython,lowRISC/micropython,infinnovation/micropython,micropython/micropython-esp32,toolmacher/micropython,PappaPeppar/micropython,pfalcon/micropython,SHA2017-badge/micropython-esp32,AriZuu/micropython,lowRISC/micropython,tobbad/micropython,puuu/micropython,dmazzella/micropython,SHA2017-badge/micropyt... | tests/basics: Add test for string module formatting with int argument. | # test string modulo formatting with int values
# test + option with various amount of padding
for pad in ('', ' ', '0'):
for n in (1, 2, 3):
for val in (-1, 0, 1):
print(('%+' + pad + str(n) + 'd') % val)
| <commit_before><commit_msg>tests/basics: Add test for string module formatting with int argument.<commit_after> | # test string modulo formatting with int values
# test + option with various amount of padding
for pad in ('', ' ', '0'):
for n in (1, 2, 3):
for val in (-1, 0, 1):
print(('%+' + pad + str(n) + 'd') % val)
| tests/basics: Add test for string module formatting with int argument.# test string modulo formatting with int values
# test + option with various amount of padding
for pad in ('', ' ', '0'):
for n in (1, 2, 3):
for val in (-1, 0, 1):
print(('%+' + pad + str(n) + 'd') % val)
| <commit_before><commit_msg>tests/basics: Add test for string module formatting with int argument.<commit_after># test string modulo formatting with int values
# test + option with various amount of padding
for pad in ('', ' ', '0'):
for n in (1, 2, 3):
for val in (-1, 0, 1):
print(('%+' + pad +... | |
b4f9b8d6c056224fc3728c6eecf511fecf6ac6d7 | tests/test_configuration/test_gateway.py | tests/test_configuration/test_gateway.py | '''
Test gateway creation
'''
import unittest
from wirecurly.configuration import gateway
from nose import tools
class testGatewayCreation(unittest.TestCase):
'''
Test gateway creation
'''
def setUp(self):
'''
gateway fixtures for tests
'''
self.gw = gateway.Gateway('name')
def test_gw_dict_ok(... | Add Tests for gateway creation | Add Tests for gateway creation
| Python | mpl-2.0 | IndiciumSRL/wirecurly | Add Tests for gateway creation | '''
Test gateway creation
'''
import unittest
from wirecurly.configuration import gateway
from nose import tools
class testGatewayCreation(unittest.TestCase):
'''
Test gateway creation
'''
def setUp(self):
'''
gateway fixtures for tests
'''
self.gw = gateway.Gateway('name')
def test_gw_dict_ok(... | <commit_before><commit_msg>Add Tests for gateway creation<commit_after> | '''
Test gateway creation
'''
import unittest
from wirecurly.configuration import gateway
from nose import tools
class testGatewayCreation(unittest.TestCase):
'''
Test gateway creation
'''
def setUp(self):
'''
gateway fixtures for tests
'''
self.gw = gateway.Gateway('name')
def test_gw_dict_ok(... | Add Tests for gateway creation'''
Test gateway creation
'''
import unittest
from wirecurly.configuration import gateway
from nose import tools
class testGatewayCreation(unittest.TestCase):
'''
Test gateway creation
'''
def setUp(self):
'''
gateway fixtures for tests
'''
self.gw = gateway.Gateway('na... | <commit_before><commit_msg>Add Tests for gateway creation<commit_after>'''
Test gateway creation
'''
import unittest
from wirecurly.configuration import gateway
from nose import tools
class testGatewayCreation(unittest.TestCase):
'''
Test gateway creation
'''
def setUp(self):
'''
gateway fixtures for tes... | |
6ba84140e5d7ddca2ee88e8ca6562a32a66a1d6b | tests/app/main/forms/test_govuk_text_input_field.py | tests/app/main/forms/test_govuk_text_input_field.py | from flask_wtf import FlaskForm as Form
from app.main.forms import GovukTextInputField
def test_GovukTextInputField_renders_zero(client_request):
class FakeForm(Form):
field = GovukTextInputField()
form = FakeForm(field=0)
html = form.field()
assert 'value="0"' in html
| Add test for rendering integer 0 in form input | Add test for rendering integer 0 in form input
| Python | mit | alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin,alphagov/notifications-admin | Add test for rendering integer 0 in form input | from flask_wtf import FlaskForm as Form
from app.main.forms import GovukTextInputField
def test_GovukTextInputField_renders_zero(client_request):
class FakeForm(Form):
field = GovukTextInputField()
form = FakeForm(field=0)
html = form.field()
assert 'value="0"' in html
| <commit_before><commit_msg>Add test for rendering integer 0 in form input<commit_after> | from flask_wtf import FlaskForm as Form
from app.main.forms import GovukTextInputField
def test_GovukTextInputField_renders_zero(client_request):
class FakeForm(Form):
field = GovukTextInputField()
form = FakeForm(field=0)
html = form.field()
assert 'value="0"' in html
| Add test for rendering integer 0 in form inputfrom flask_wtf import FlaskForm as Form
from app.main.forms import GovukTextInputField
def test_GovukTextInputField_renders_zero(client_request):
class FakeForm(Form):
field = GovukTextInputField()
form = FakeForm(field=0)
html = form.field()
ass... | <commit_before><commit_msg>Add test for rendering integer 0 in form input<commit_after>from flask_wtf import FlaskForm as Form
from app.main.forms import GovukTextInputField
def test_GovukTextInputField_renders_zero(client_request):
class FakeForm(Form):
field = GovukTextInputField()
form = FakeForm... | |
d9dd7214865130d2ccc31670bcbc1c1f6cc7596a | 02_task/sample_test.py | 02_task/sample_test.py | import unittest
import solution
class SampleTest(unittest.TestCase):
def test_five_plus_three(self):
plus = solution.create_operator('+', lambda lhs, rhs: lhs + rhs)
x = solution.create_variable('x')
y = solution.create_variable('y')
added_expression = solution.create_expression((... | Add 02-task sample test file. | Add 02-task sample test file.
| Python | mit | pepincho/Python-Course-FMI | Add 02-task sample test file. | import unittest
import solution
class SampleTest(unittest.TestCase):
def test_five_plus_three(self):
plus = solution.create_operator('+', lambda lhs, rhs: lhs + rhs)
x = solution.create_variable('x')
y = solution.create_variable('y')
added_expression = solution.create_expression((... | <commit_before><commit_msg>Add 02-task sample test file.<commit_after> | import unittest
import solution
class SampleTest(unittest.TestCase):
def test_five_plus_three(self):
plus = solution.create_operator('+', lambda lhs, rhs: lhs + rhs)
x = solution.create_variable('x')
y = solution.create_variable('y')
added_expression = solution.create_expression((... | Add 02-task sample test file.import unittest
import solution
class SampleTest(unittest.TestCase):
def test_five_plus_three(self):
plus = solution.create_operator('+', lambda lhs, rhs: lhs + rhs)
x = solution.create_variable('x')
y = solution.create_variable('y')
added_expression =... | <commit_before><commit_msg>Add 02-task sample test file.<commit_after>import unittest
import solution
class SampleTest(unittest.TestCase):
def test_five_plus_three(self):
plus = solution.create_operator('+', lambda lhs, rhs: lhs + rhs)
x = solution.create_variable('x')
y = solution.create... | |
bac583e9b3849884aa9865a3d8d19796b0eedd70 | tap_dhcp.py | tap_dhcp.py | import re
import subprocess
def get_namespace_list():
"""Retrieve the list of DHCP namespaces."""
return subprocess(['ip', 'netns', 'list']).split()
def get_interfaces_for(namespace):
"""Retrieve the list of interfaces inside a namespace."""
return subprocess(['ip', 'netns', 'exec', namespace, 'ip',... | Add first pass at checking dhcp namespaces for taps | Add first pass at checking dhcp namespaces for taps
| Python | apache-2.0 | sigmavirus24/rpc-openstack,stevelle/rpc-openstack,git-harry/rpc-openstack,miguelgrinberg/rpc-openstack,git-harry/rpc-openstack,jacobwagner/rpc-openstack,mancdaz/rpc-openstack,mattt416/rpc-openstack,darrenchan/rpc-openstack,hughsaunders/rpc-openstack,galstrom21/rpc-openstack,darrenchan/rpc-openstack,rcbops/rpc-openstack... | Add first pass at checking dhcp namespaces for taps | import re
import subprocess
def get_namespace_list():
"""Retrieve the list of DHCP namespaces."""
return subprocess(['ip', 'netns', 'list']).split()
def get_interfaces_for(namespace):
"""Retrieve the list of interfaces inside a namespace."""
return subprocess(['ip', 'netns', 'exec', namespace, 'ip',... | <commit_before><commit_msg>Add first pass at checking dhcp namespaces for taps<commit_after> | import re
import subprocess
def get_namespace_list():
"""Retrieve the list of DHCP namespaces."""
return subprocess(['ip', 'netns', 'list']).split()
def get_interfaces_for(namespace):
"""Retrieve the list of interfaces inside a namespace."""
return subprocess(['ip', 'netns', 'exec', namespace, 'ip',... | Add first pass at checking dhcp namespaces for tapsimport re
import subprocess
def get_namespace_list():
"""Retrieve the list of DHCP namespaces."""
return subprocess(['ip', 'netns', 'list']).split()
def get_interfaces_for(namespace):
"""Retrieve the list of interfaces inside a namespace."""
return ... | <commit_before><commit_msg>Add first pass at checking dhcp namespaces for taps<commit_after>import re
import subprocess
def get_namespace_list():
"""Retrieve the list of DHCP namespaces."""
return subprocess(['ip', 'netns', 'list']).split()
def get_interfaces_for(namespace):
"""Retrieve the list of inte... | |
5d06524c8465064248cc3605c69dd32687ea7565 | wqflask/tests/wqflask/test_user_login.py | wqflask/tests/wqflask/test_user_login.py | """Test cases for some methods in login.py"""
import unittest
from wqflask.user_login import encode_password
class TestUserLogin(unittest.TestCase):
def test_encode_password(self):
"""
Test encode password
"""
pass_gen_fields = {
"salt": "salt",
"hashfunc":... | Add tests for encoding password | Add tests for encoding password
* wqflask/tests/wqflask/test_user_login.py: New tests.
| Python | agpl-3.0 | pjotrp/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2 | Add tests for encoding password
* wqflask/tests/wqflask/test_user_login.py: New tests. | """Test cases for some methods in login.py"""
import unittest
from wqflask.user_login import encode_password
class TestUserLogin(unittest.TestCase):
def test_encode_password(self):
"""
Test encode password
"""
pass_gen_fields = {
"salt": "salt",
"hashfunc":... | <commit_before><commit_msg>Add tests for encoding password
* wqflask/tests/wqflask/test_user_login.py: New tests.<commit_after> | """Test cases for some methods in login.py"""
import unittest
from wqflask.user_login import encode_password
class TestUserLogin(unittest.TestCase):
def test_encode_password(self):
"""
Test encode password
"""
pass_gen_fields = {
"salt": "salt",
"hashfunc":... | Add tests for encoding password
* wqflask/tests/wqflask/test_user_login.py: New tests."""Test cases for some methods in login.py"""
import unittest
from wqflask.user_login import encode_password
class TestUserLogin(unittest.TestCase):
def test_encode_password(self):
"""
Test encode password
... | <commit_before><commit_msg>Add tests for encoding password
* wqflask/tests/wqflask/test_user_login.py: New tests.<commit_after>"""Test cases for some methods in login.py"""
import unittest
from wqflask.user_login import encode_password
class TestUserLogin(unittest.TestCase):
def test_encode_password(self):
... | |
e1914156c0d4085d35c88634c98c294e38faada5 | cryptchat/test/test_aes.py | cryptchat/test/test_aes.py | #/usr/bin/python
# -*- coding: utf-8 -*-
# Run from Cryptchat
# python -m unittest discover
import unittest
from ..crypto.aes import AESCipher
class testAESCipher(unittest.TestCase):
def test_encrypt_decrypt(self):
key = "TTTcPolAhIqZZJY0IOH7Orecb/EEaUx8/u/pQlCgma8="
cipher = AESCipher(key)
... | Add some tests for crypto/aes | Add some tests for crypto/aes
| Python | mit | djohsson/Cryptchat | Add some tests for crypto/aes | #/usr/bin/python
# -*- coding: utf-8 -*-
# Run from Cryptchat
# python -m unittest discover
import unittest
from ..crypto.aes import AESCipher
class testAESCipher(unittest.TestCase):
def test_encrypt_decrypt(self):
key = "TTTcPolAhIqZZJY0IOH7Orecb/EEaUx8/u/pQlCgma8="
cipher = AESCipher(key)
... | <commit_before><commit_msg>Add some tests for crypto/aes<commit_after> | #/usr/bin/python
# -*- coding: utf-8 -*-
# Run from Cryptchat
# python -m unittest discover
import unittest
from ..crypto.aes import AESCipher
class testAESCipher(unittest.TestCase):
def test_encrypt_decrypt(self):
key = "TTTcPolAhIqZZJY0IOH7Orecb/EEaUx8/u/pQlCgma8="
cipher = AESCipher(key)
... | Add some tests for crypto/aes#/usr/bin/python
# -*- coding: utf-8 -*-
# Run from Cryptchat
# python -m unittest discover
import unittest
from ..crypto.aes import AESCipher
class testAESCipher(unittest.TestCase):
def test_encrypt_decrypt(self):
key = "TTTcPolAhIqZZJY0IOH7Orecb/EEaUx8/u/pQlCgma8="
... | <commit_before><commit_msg>Add some tests for crypto/aes<commit_after>#/usr/bin/python
# -*- coding: utf-8 -*-
# Run from Cryptchat
# python -m unittest discover
import unittest
from ..crypto.aes import AESCipher
class testAESCipher(unittest.TestCase):
def test_encrypt_decrypt(self):
key = "TTTcPolAhIqZ... | |
e9942aea9a2c11575d5abcfa33f2aef1d8d53c6a | modify-color.py | modify-color.py | #!/bin/python
"""modify-color
------------
"""
import sys
import colorsys
class Color(object):
def __init__(self, color_str, color_format="hex"):
pass
if __name__ == "__main__":
if len(sys.argv) == 1 or sys.argv[1] in ['help', '--help']:
print(__doc__)
sys.exit()
| Print doc on help or no args | Print doc on help or no args
| Python | bsd-3-clause | seenaburns/color-util,seenaburns/color-util | Print doc on help or no args | #!/bin/python
"""modify-color
------------
"""
import sys
import colorsys
class Color(object):
def __init__(self, color_str, color_format="hex"):
pass
if __name__ == "__main__":
if len(sys.argv) == 1 or sys.argv[1] in ['help', '--help']:
print(__doc__)
sys.exit()
| <commit_before><commit_msg>Print doc on help or no args<commit_after> | #!/bin/python
"""modify-color
------------
"""
import sys
import colorsys
class Color(object):
def __init__(self, color_str, color_format="hex"):
pass
if __name__ == "__main__":
if len(sys.argv) == 1 or sys.argv[1] in ['help', '--help']:
print(__doc__)
sys.exit()
| Print doc on help or no args#!/bin/python
"""modify-color
------------
"""
import sys
import colorsys
class Color(object):
def __init__(self, color_str, color_format="hex"):
pass
if __name__ == "__main__":
if len(sys.argv) == 1 or sys.argv[1] in ['help', '--help']:
print(__doc__)
sys.... | <commit_before><commit_msg>Print doc on help or no args<commit_after>#!/bin/python
"""modify-color
------------
"""
import sys
import colorsys
class Color(object):
def __init__(self, color_str, color_format="hex"):
pass
if __name__ == "__main__":
if len(sys.argv) == 1 or sys.argv[1] in ['help', '--he... | |
f2bb3b0ab09da5fc1c186765052aea8fd87a9b2b | setuptools/tests/test_find_packages.py | setuptools/tests/test_find_packages.py | """Tests for setuptools.find_packages()."""
import os
import shutil
import tempfile
import unittest
from setuptools import find_packages
class TestFindPackages(unittest.TestCase):
def setUp(self):
self.dist_dir = tempfile.mkdtemp()
self._make_pkg_structure()
def tearDown(self):
shut... | Add unit tests for find_packages | Add unit tests for find_packages
--HG--
extra : rebase_source : 75f5ce4d2fb9d0ccd7168739c23d9ea1eeeb9112
| Python | mit | pypa/setuptools,pypa/setuptools,pypa/setuptools | Add unit tests for find_packages
--HG--
extra : rebase_source : 75f5ce4d2fb9d0ccd7168739c23d9ea1eeeb9112 | """Tests for setuptools.find_packages()."""
import os
import shutil
import tempfile
import unittest
from setuptools import find_packages
class TestFindPackages(unittest.TestCase):
def setUp(self):
self.dist_dir = tempfile.mkdtemp()
self._make_pkg_structure()
def tearDown(self):
shut... | <commit_before><commit_msg>Add unit tests for find_packages
--HG--
extra : rebase_source : 75f5ce4d2fb9d0ccd7168739c23d9ea1eeeb9112<commit_after> | """Tests for setuptools.find_packages()."""
import os
import shutil
import tempfile
import unittest
from setuptools import find_packages
class TestFindPackages(unittest.TestCase):
def setUp(self):
self.dist_dir = tempfile.mkdtemp()
self._make_pkg_structure()
def tearDown(self):
shut... | Add unit tests for find_packages
--HG--
extra : rebase_source : 75f5ce4d2fb9d0ccd7168739c23d9ea1eeeb9112"""Tests for setuptools.find_packages()."""
import os
import shutil
import tempfile
import unittest
from setuptools import find_packages
class TestFindPackages(unittest.TestCase):
def setUp(self):
se... | <commit_before><commit_msg>Add unit tests for find_packages
--HG--
extra : rebase_source : 75f5ce4d2fb9d0ccd7168739c23d9ea1eeeb9112<commit_after>"""Tests for setuptools.find_packages()."""
import os
import shutil
import tempfile
import unittest
from setuptools import find_packages
class TestFindPackages(unittest.Te... | |
3e1a40ae2455dc6b1588451e9633efac0fd1ffaf | addons/account/report/account_journal_common_default.py | addons/account/report/account_journal_common_default.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | Add common report header default file (Tested with central journal only) => Need to improve it and work of all journals reports (Under development) | [ADD] Add common report header default file (Tested with central journal only) => Need to improve it and work of all journals reports (Under development)
bzr revid: mra@mra-laptop-20100710071957-ddp1dmz5ve9f5qdt | Python | agpl-3.0 | dgzurita/odoo,osvalr/odoo,massot/odoo,sadleader/odoo,pplatek/odoo,slevenhagen/odoo,Drooids/odoo,dgzurita/odoo,waytai/odoo,feroda/odoo,zchking/odoo,markeTIC/OCB,steedos/odoo,ClearCorp-dev/odoo,oliverhr/odoo,hifly/OpenUpgrade,odootr/odoo,mszewczy/odoo,patmcb/odoo,Danisan/odoo-1,hmen89/odoo,Daniel-CA/odoo,sv-dev1/odoo,Cat... | [ADD] Add common report header default file (Tested with central journal only) => Need to improve it and work of all journals reports (Under development)
bzr revid: mra@mra-laptop-20100710071957-ddp1dmz5ve9f5qdt | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | <commit_before><commit_msg>[ADD] Add common report header default file (Tested with central journal only) => Need to improve it and work of all journals reports (Under development)
bzr revid: mra@mra-laptop-20100710071957-ddp1dmz5ve9f5qdt<commit_after> | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | [ADD] Add common report header default file (Tested with central journal only) => Need to improve it and work of all journals reports (Under development)
bzr revid: mra@mra-laptop-20100710071957-ddp1dmz5ve9f5qdt# -*- coding: utf-8 -*-
##############################################################################
#
# ... | <commit_before><commit_msg>[ADD] Add common report header default file (Tested with central journal only) => Need to improve it and work of all journals reports (Under development)
bzr revid: mra@mra-laptop-20100710071957-ddp1dmz5ve9f5qdt<commit_after># -*- coding: utf-8 -*-
###########################################... | |
4b7171ae794cc2ba5a4e668708c7cf424419e081 | tests/test_compare.py | tests/test_compare.py | import unittest
import pandas.util.testing as pdt
import recordlinkage
import numpy as np
import pandas as pd
class TestCompare(unittest.TestCase):
def test_exact_two_series(self):
comp = recordlinkage.Compare()
s1 = pd.Series(['mary ann', 'bob1', 'angel1', 'bob', 'mary ann', 'john', np.nan])
... | Add tests for compare module | Add tests for compare module
| Python | bsd-3-clause | J535D165/recordlinkage,J535D165/recordlinkage | Add tests for compare module | import unittest
import pandas.util.testing as pdt
import recordlinkage
import numpy as np
import pandas as pd
class TestCompare(unittest.TestCase):
def test_exact_two_series(self):
comp = recordlinkage.Compare()
s1 = pd.Series(['mary ann', 'bob1', 'angel1', 'bob', 'mary ann', 'john', np.nan])
... | <commit_before><commit_msg>Add tests for compare module<commit_after> | import unittest
import pandas.util.testing as pdt
import recordlinkage
import numpy as np
import pandas as pd
class TestCompare(unittest.TestCase):
def test_exact_two_series(self):
comp = recordlinkage.Compare()
s1 = pd.Series(['mary ann', 'bob1', 'angel1', 'bob', 'mary ann', 'john', np.nan])
... | Add tests for compare moduleimport unittest
import pandas.util.testing as pdt
import recordlinkage
import numpy as np
import pandas as pd
class TestCompare(unittest.TestCase):
def test_exact_two_series(self):
comp = recordlinkage.Compare()
s1 = pd.Series(['mary ann', 'bob1', 'angel1', 'bob', 'm... | <commit_before><commit_msg>Add tests for compare module<commit_after>import unittest
import pandas.util.testing as pdt
import recordlinkage
import numpy as np
import pandas as pd
class TestCompare(unittest.TestCase):
def test_exact_two_series(self):
comp = recordlinkage.Compare()
s1 = pd.Series... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.