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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
e6afac74a504515e0f4151fc96fdc4752cb9b890 | CodeFights/electionsWinners.py | CodeFights/electionsWinners.py | #!/usr/local/bin/python
# Code Fights Election Winners Problem
def electionsWinners(votes, k):
max_v = max(votes)
count_max = votes.count(max_v)
if k == 0:
if count_max == 1:
return 1
else:
return 0
return sum([1 for v in votes if v + k > max_v])
# Alternat... | Solve Code Fights elections winners problem | Solve Code Fights elections winners problem
| Python | mit | HKuz/Test_Code | Solve Code Fights elections winners problem | #!/usr/local/bin/python
# Code Fights Election Winners Problem
def electionsWinners(votes, k):
max_v = max(votes)
count_max = votes.count(max_v)
if k == 0:
if count_max == 1:
return 1
else:
return 0
return sum([1 for v in votes if v + k > max_v])
# Alternat... | <commit_before><commit_msg>Solve Code Fights elections winners problem<commit_after> | #!/usr/local/bin/python
# Code Fights Election Winners Problem
def electionsWinners(votes, k):
max_v = max(votes)
count_max = votes.count(max_v)
if k == 0:
if count_max == 1:
return 1
else:
return 0
return sum([1 for v in votes if v + k > max_v])
# Alternat... | Solve Code Fights elections winners problem#!/usr/local/bin/python
# Code Fights Election Winners Problem
def electionsWinners(votes, k):
max_v = max(votes)
count_max = votes.count(max_v)
if k == 0:
if count_max == 1:
return 1
else:
return 0
return sum([1 for v ... | <commit_before><commit_msg>Solve Code Fights elections winners problem<commit_after>#!/usr/local/bin/python
# Code Fights Election Winners Problem
def electionsWinners(votes, k):
max_v = max(votes)
count_max = votes.count(max_v)
if k == 0:
if count_max == 1:
return 1
else:
... | |
92f074c50fdf98ad89723e13e7f0de1f5e7f30b7 | yunity/migrations/0003_auto_20151117_1506.py | yunity/migrations/0003_auto_20151117_1506.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9b1 on 2015-11-17 15:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import yunity.utils.models.field
class Migration(migrations.Migration... | Add group and creation date field migration | Add group and creation date field migration
| Python | agpl-3.0 | yunity/foodsaving-backend,yunity/foodsaving-backend,yunity/yunity-core,yunity/yunity-core,yunity/foodsaving-backend | Add group and creation date field migration | # -*- coding: utf-8 -*-
# Generated by Django 1.9b1 on 2015-11-17 15:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import yunity.utils.models.field
class Migration(migrations.Migration... | <commit_before><commit_msg>Add group and creation date field migration<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9b1 on 2015-11-17 15:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import yunity.utils.models.field
class Migration(migrations.Migration... | Add group and creation date field migration# -*- coding: utf-8 -*-
# Generated by Django 1.9b1 on 2015-11-17 15:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.utils.timezone
import yunity.utils.models.f... | <commit_before><commit_msg>Add group and creation date field migration<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9b1 on 2015-11-17 15:06
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
import django.ut... | |
1e6ac739fc7a6ec153d0a4d96d80fb1957c413ae | pypeline/common/system.py | pypeline/common/system.py | #!/usr/bin/python
#
# Copyright (c) 2013 Mikkel Schubert <MSchubert@snm.ku.dk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... | Add module/function to set proc name. | Add module/function to set proc name.
| Python | mit | MikkelSchubert/paleomix,MikkelSchubert/paleomix,MikkelSchubert/paleomix | Add module/function to set proc name. | #!/usr/bin/python
#
# Copyright (c) 2013 Mikkel Schubert <MSchubert@snm.ku.dk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... | <commit_before><commit_msg>Add module/function to set proc name.<commit_after> | #!/usr/bin/python
#
# Copyright (c) 2013 Mikkel Schubert <MSchubert@snm.ku.dk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
#... | Add module/function to set proc name.#!/usr/bin/python
#
# Copyright (c) 2013 Mikkel Schubert <MSchubert@snm.ku.dk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, incl... | <commit_before><commit_msg>Add module/function to set proc name.<commit_after>#!/usr/bin/python
#
# Copyright (c) 2013 Mikkel Schubert <MSchubert@snm.ku.dk>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# ... | |
e0c88839c4646e2d619f27399a0e30845e98735d | examples/validation_example.py | examples/validation_example.py | """Usage: prog.py --count=N OUTDIR FILE
Arguments:
FILE input file
OUTDIR out directory
Options:
--count NUM number of operations [default: 1]
"""
import docopt
try:
import voluptuous as v
except ImportError:
exit('This example assumes that `voluptuous` data-validation library\n'
'is i... | Add example that uses voluptuous. | Add example that uses voluptuous.
| Python | mit | docopt/docopt,crcsmnky/docopt,snowsnail/docopt,wkentaro/docopt,devonjones/docopt,kenwilcox/docopt,benthomasson/docopt,Zearin/docopt,jagguli/docopt | Add example that uses voluptuous. | """Usage: prog.py --count=N OUTDIR FILE
Arguments:
FILE input file
OUTDIR out directory
Options:
--count NUM number of operations [default: 1]
"""
import docopt
try:
import voluptuous as v
except ImportError:
exit('This example assumes that `voluptuous` data-validation library\n'
'is i... | <commit_before><commit_msg>Add example that uses voluptuous.<commit_after> | """Usage: prog.py --count=N OUTDIR FILE
Arguments:
FILE input file
OUTDIR out directory
Options:
--count NUM number of operations [default: 1]
"""
import docopt
try:
import voluptuous as v
except ImportError:
exit('This example assumes that `voluptuous` data-validation library\n'
'is i... | Add example that uses voluptuous."""Usage: prog.py --count=N OUTDIR FILE
Arguments:
FILE input file
OUTDIR out directory
Options:
--count NUM number of operations [default: 1]
"""
import docopt
try:
import voluptuous as v
except ImportError:
exit('This example assumes that `voluptuous` data-val... | <commit_before><commit_msg>Add example that uses voluptuous.<commit_after>"""Usage: prog.py --count=N OUTDIR FILE
Arguments:
FILE input file
OUTDIR out directory
Options:
--count NUM number of operations [default: 1]
"""
import docopt
try:
import voluptuous as v
except ImportError:
exit('This e... | |
ac70be9e200b34a4509b47d0db5ed65f3a8f072a | tests/integration/run_all_tests.py | tests/integration/run_all_tests.py | import nose
import os
from tests.integration import SUBSCRIPTION, ONDEMAND
testfiles = [file for file in os.listdir('.') if file.startswith("test") and file.endswith(".py")]
try:
for service in (SUBSCRIPTION, ONDEMAND):
for test in testfiles:
result = nose.run(argv=['-x', '-v', '-s', '--tc=... | Add script for executing all tests in both services. | Add script for executing all tests in both services.
| Python | apache-2.0 | kemiz/tosca-vcloud-plugin,nmishkin/tosca-vcloud-plugin,denismakogon/tosca-vcloud-plugin,cloudify-cosmo/tosca-vcloud-plugin,vmware/tosca-vcloud-plugin | Add script for executing all tests in both services. | import nose
import os
from tests.integration import SUBSCRIPTION, ONDEMAND
testfiles = [file for file in os.listdir('.') if file.startswith("test") and file.endswith(".py")]
try:
for service in (SUBSCRIPTION, ONDEMAND):
for test in testfiles:
result = nose.run(argv=['-x', '-v', '-s', '--tc=... | <commit_before><commit_msg>Add script for executing all tests in both services.<commit_after> | import nose
import os
from tests.integration import SUBSCRIPTION, ONDEMAND
testfiles = [file for file in os.listdir('.') if file.startswith("test") and file.endswith(".py")]
try:
for service in (SUBSCRIPTION, ONDEMAND):
for test in testfiles:
result = nose.run(argv=['-x', '-v', '-s', '--tc=... | Add script for executing all tests in both services.import nose
import os
from tests.integration import SUBSCRIPTION, ONDEMAND
testfiles = [file for file in os.listdir('.') if file.startswith("test") and file.endswith(".py")]
try:
for service in (SUBSCRIPTION, ONDEMAND):
for test in testfiles:
... | <commit_before><commit_msg>Add script for executing all tests in both services.<commit_after>import nose
import os
from tests.integration import SUBSCRIPTION, ONDEMAND
testfiles = [file for file in os.listdir('.') if file.startswith("test") and file.endswith(".py")]
try:
for service in (SUBSCRIPTION, ONDEMAND):
... | |
06df8e5729e95f74b974a8b38f6b16044fe2aa8a | py/find-the-difference.py | py/find-the-difference.py | from collections import Counter
class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
sc, tc = Counter(s), Counter(t)
for c, v in tc.iteritems():
if v != sc[c]:
return c
| Add py solution for 389. Find the Difference | Add py solution for 389. Find the Difference
389. Find the Difference: https://leetcode.com/problems/find-the-difference/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 389. Find the Difference
389. Find the Difference: https://leetcode.com/problems/find-the-difference/ | from collections import Counter
class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
sc, tc = Counter(s), Counter(t)
for c, v in tc.iteritems():
if v != sc[c]:
return c
| <commit_before><commit_msg>Add py solution for 389. Find the Difference
389. Find the Difference: https://leetcode.com/problems/find-the-difference/<commit_after> | from collections import Counter
class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
sc, tc = Counter(s), Counter(t)
for c, v in tc.iteritems():
if v != sc[c]:
return c
| Add py solution for 389. Find the Difference
389. Find the Difference: https://leetcode.com/problems/find-the-difference/from collections import Counter
class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
:rtype: str
"""
sc, tc = ... | <commit_before><commit_msg>Add py solution for 389. Find the Difference
389. Find the Difference: https://leetcode.com/problems/find-the-difference/<commit_after>from collections import Counter
class Solution(object):
def findTheDifference(self, s, t):
"""
:type s: str
:type t: str
... | |
4574fe87c6efa5b1b9431546f787fcf30ad0d6b6 | examples/training/train_parser.py | examples/training/train_parser.py | from __future__ import unicode_literals, print_function
import json
import pathlib
import random
import spacy
from spacy.pipeline import DependencyParser
from spacy.gold import GoldParse
from spacy.tokens import Doc
def train_parser(nlp, train_data, left_labels, right_labels):
parser = DependencyParser.blank(
... | Add example for training parser | Add example for training parser
| Python | mit | raphael0202/spaCy,oroszgy/spaCy.hu,aikramer2/spaCy,banglakit/spaCy,spacy-io/spaCy,oroszgy/spaCy.hu,explosion/spaCy,raphael0202/spaCy,recognai/spaCy,aikramer2/spaCy,recognai/spaCy,oroszgy/spaCy.hu,honnibal/spaCy,honnibal/spaCy,Gregory-Howard/spaCy,recognai/spaCy,banglakit/spaCy,recognai/spaCy,spacy-io/spaCy,explosion/sp... | Add example for training parser | from __future__ import unicode_literals, print_function
import json
import pathlib
import random
import spacy
from spacy.pipeline import DependencyParser
from spacy.gold import GoldParse
from spacy.tokens import Doc
def train_parser(nlp, train_data, left_labels, right_labels):
parser = DependencyParser.blank(
... | <commit_before><commit_msg>Add example for training parser<commit_after> | from __future__ import unicode_literals, print_function
import json
import pathlib
import random
import spacy
from spacy.pipeline import DependencyParser
from spacy.gold import GoldParse
from spacy.tokens import Doc
def train_parser(nlp, train_data, left_labels, right_labels):
parser = DependencyParser.blank(
... | Add example for training parserfrom __future__ import unicode_literals, print_function
import json
import pathlib
import random
import spacy
from spacy.pipeline import DependencyParser
from spacy.gold import GoldParse
from spacy.tokens import Doc
def train_parser(nlp, train_data, left_labels, right_labels):
pars... | <commit_before><commit_msg>Add example for training parser<commit_after>from __future__ import unicode_literals, print_function
import json
import pathlib
import random
import spacy
from spacy.pipeline import DependencyParser
from spacy.gold import GoldParse
from spacy.tokens import Doc
def train_parser(nlp, train_d... | |
39940ba7b5cfd2a62f5168a58efbd03eab1b8728 | Examples/Infovis/Python/create_tree.py | Examples/Infovis/Python/create_tree.py | from vtk import *
graph = vtkMutableDirectedGraph()
a = graph.AddVertex()
b = graph.AddChild(a)
c = graph.AddChild(a)
d = graph.AddChild(b)
e = graph.AddChild(c)
f = graph.AddChild(c)
tree = vtkTree()
tree.CheckedShallowCopy(graph)
view = vtkGraphLayoutView()
view.AddRepresentationFromInput(tree)
window = vtkRender... | Add a Python example of creating a tree. | ENH: Add a Python example of creating a tree.
| Python | bsd-3-clause | jeffbaumes/jeffbaumes-vtk,candy7393/VTK,candy7393/VTK,naucoin/VTKSlicerWidgets,biddisco/VTK,gram526/VTK,naucoin/VTKSlicerWidgets,sumedhasingla/VTK,sankhesh/VTK,msmolens/VTK,jeffbaumes/jeffbaumes-vtk,biddisco/VTK,johnkit/vtk-dev,SimVascular/VTK,keithroe/vtkoptix,sumedhasingla/VTK,mspark93/VTK,cjh1/VTK,spthaolt/VTK,sptha... | ENH: Add a Python example of creating a tree. | from vtk import *
graph = vtkMutableDirectedGraph()
a = graph.AddVertex()
b = graph.AddChild(a)
c = graph.AddChild(a)
d = graph.AddChild(b)
e = graph.AddChild(c)
f = graph.AddChild(c)
tree = vtkTree()
tree.CheckedShallowCopy(graph)
view = vtkGraphLayoutView()
view.AddRepresentationFromInput(tree)
window = vtkRender... | <commit_before><commit_msg>ENH: Add a Python example of creating a tree.<commit_after> | from vtk import *
graph = vtkMutableDirectedGraph()
a = graph.AddVertex()
b = graph.AddChild(a)
c = graph.AddChild(a)
d = graph.AddChild(b)
e = graph.AddChild(c)
f = graph.AddChild(c)
tree = vtkTree()
tree.CheckedShallowCopy(graph)
view = vtkGraphLayoutView()
view.AddRepresentationFromInput(tree)
window = vtkRender... | ENH: Add a Python example of creating a tree.from vtk import *
graph = vtkMutableDirectedGraph()
a = graph.AddVertex()
b = graph.AddChild(a)
c = graph.AddChild(a)
d = graph.AddChild(b)
e = graph.AddChild(c)
f = graph.AddChild(c)
tree = vtkTree()
tree.CheckedShallowCopy(graph)
view = vtkGraphLayoutView()
view.AddRepr... | <commit_before><commit_msg>ENH: Add a Python example of creating a tree.<commit_after>from vtk import *
graph = vtkMutableDirectedGraph()
a = graph.AddVertex()
b = graph.AddChild(a)
c = graph.AddChild(a)
d = graph.AddChild(b)
e = graph.AddChild(c)
f = graph.AddChild(c)
tree = vtkTree()
tree.CheckedShallowCopy(graph)
... | |
61f1c3c8492bbed80dc5e217708f4ebfb2201413 | scripts/verify_schema.py | scripts/verify_schema.py | #!/usr/bin/env python
#
# verify_schema.py: simple LXML wrapper for checking XML against
# a RelaxNG schema.
#
# Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Less... | Add a simple schema validation script based on LXML. | Add a simple schema validation script based on LXML.
Some systems don't have rnv or any other ready to use
validators in repos/ports/whatever.
| Python | lgpl-2.1 | vyos-legacy/vyconfd,vyos-legacy/vyconfd | Add a simple schema validation script based on LXML.
Some systems don't have rnv or any other ready to use
validators in repos/ports/whatever. | #!/usr/bin/env python
#
# verify_schema.py: simple LXML wrapper for checking XML against
# a RelaxNG schema.
#
# Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Less... | <commit_before><commit_msg>Add a simple schema validation script based on LXML.
Some systems don't have rnv or any other ready to use
validators in repos/ports/whatever.<commit_after> | #!/usr/bin/env python
#
# verify_schema.py: simple LXML wrapper for checking XML against
# a RelaxNG schema.
#
# Copyright (C) 2014 VyOS Development Group <maintainers@vyos.net>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Less... | Add a simple schema validation script based on LXML.
Some systems don't have rnv or any other ready to use
validators in repos/ports/whatever.#!/usr/bin/env python
#
# verify_schema.py: simple LXML wrapper for checking XML against
# a RelaxNG schema.
#
# Copyright (C) 2014 VyOS Development G... | <commit_before><commit_msg>Add a simple schema validation script based on LXML.
Some systems don't have rnv or any other ready to use
validators in repos/ports/whatever.<commit_after>#!/usr/bin/env python
#
# verify_schema.py: simple LXML wrapper for checking XML against
# a RelaxNG schema.
#
#... | |
46fa53acba8b00c5f7e78d1502aab72838cbccb6 | example-get-data-bulb.py | example-get-data-bulb.py | """
Copyright (c) 2017-2018 Fabian Affolter <fabian@affolter-engineering.ch>
Licensed under MIT. All rights reserved.
"""
import pymystrom
bulb = pymystrom.MyStromBulb('192.168.0.51', '5CCF7FA0AFB0')
# Get the details of the bulb
print("Current color:", bulb.get_color())
print("Brightness:", bulb.get_brightness())
p... | Add simple bulb example (getting the details of a bulb) | Add simple bulb example (getting the details of a bulb)
| Python | mit | fabaff/python-mystrom | Add simple bulb example (getting the details of a bulb) | """
Copyright (c) 2017-2018 Fabian Affolter <fabian@affolter-engineering.ch>
Licensed under MIT. All rights reserved.
"""
import pymystrom
bulb = pymystrom.MyStromBulb('192.168.0.51', '5CCF7FA0AFB0')
# Get the details of the bulb
print("Current color:", bulb.get_color())
print("Brightness:", bulb.get_brightness())
p... | <commit_before><commit_msg>Add simple bulb example (getting the details of a bulb)<commit_after> | """
Copyright (c) 2017-2018 Fabian Affolter <fabian@affolter-engineering.ch>
Licensed under MIT. All rights reserved.
"""
import pymystrom
bulb = pymystrom.MyStromBulb('192.168.0.51', '5CCF7FA0AFB0')
# Get the details of the bulb
print("Current color:", bulb.get_color())
print("Brightness:", bulb.get_brightness())
p... | Add simple bulb example (getting the details of a bulb)"""
Copyright (c) 2017-2018 Fabian Affolter <fabian@affolter-engineering.ch>
Licensed under MIT. All rights reserved.
"""
import pymystrom
bulb = pymystrom.MyStromBulb('192.168.0.51', '5CCF7FA0AFB0')
# Get the details of the bulb
print("Current color:", bulb.get... | <commit_before><commit_msg>Add simple bulb example (getting the details of a bulb)<commit_after>"""
Copyright (c) 2017-2018 Fabian Affolter <fabian@affolter-engineering.ch>
Licensed under MIT. All rights reserved.
"""
import pymystrom
bulb = pymystrom.MyStromBulb('192.168.0.51', '5CCF7FA0AFB0')
# Get the details of ... | |
32a02c58a67813417eaa49c80edbdd77f8b2569f | py/minimum-time-difference.py | py/minimum-time-difference.py | class Solution(object):
def findMinDifference(self, timePoints):
"""
:type timePoints: List[str]
:rtype: int
"""
timePoints = map(lambda x:int(x.split(':')[0]) * 60 + int(x.split(':')[1]), timePoints)
MINUTES_IN_A_DAY = 24 * 60
timePoints.sort()
m = ti... | Add py solution for 539. Minimum Time Difference | Add py solution for 539. Minimum Time Difference
539. Minimum Time Difference: https://leetcode.com/problems/minimum-time-difference/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 539. Minimum Time Difference
539. Minimum Time Difference: https://leetcode.com/problems/minimum-time-difference/ | class Solution(object):
def findMinDifference(self, timePoints):
"""
:type timePoints: List[str]
:rtype: int
"""
timePoints = map(lambda x:int(x.split(':')[0]) * 60 + int(x.split(':')[1]), timePoints)
MINUTES_IN_A_DAY = 24 * 60
timePoints.sort()
m = ti... | <commit_before><commit_msg>Add py solution for 539. Minimum Time Difference
539. Minimum Time Difference: https://leetcode.com/problems/minimum-time-difference/<commit_after> | class Solution(object):
def findMinDifference(self, timePoints):
"""
:type timePoints: List[str]
:rtype: int
"""
timePoints = map(lambda x:int(x.split(':')[0]) * 60 + int(x.split(':')[1]), timePoints)
MINUTES_IN_A_DAY = 24 * 60
timePoints.sort()
m = ti... | Add py solution for 539. Minimum Time Difference
539. Minimum Time Difference: https://leetcode.com/problems/minimum-time-difference/class Solution(object):
def findMinDifference(self, timePoints):
"""
:type timePoints: List[str]
:rtype: int
"""
timePoints = map(lambda x:int... | <commit_before><commit_msg>Add py solution for 539. Minimum Time Difference
539. Minimum Time Difference: https://leetcode.com/problems/minimum-time-difference/<commit_after>class Solution(object):
def findMinDifference(self, timePoints):
"""
:type timePoints: List[str]
:rtype: int
... | |
efc89a6858782da6e27f1f5abf32b4acc390e2ac | scraper.py | scraper.py | from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup()
INSPECTION_DOMAIN = 'http://info.kingcounty.gov'
INSPECTION_PATH = '/health/ehs/foodsafety/inspections/Results.aspx'
INSPECTION_PARAMS = {
'Output': 'W',
'Business_Name': '',
'Business_Address': '',
'Longitude': '',
'Latitude': '... | Add get_inspection_page method to scrape entire listing. | Add get_inspection_page method to scrape entire listing.
| Python | mit | bm5w/souptests,bm5w/souptests | Add get_inspection_page method to scrape entire listing. | from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup()
INSPECTION_DOMAIN = 'http://info.kingcounty.gov'
INSPECTION_PATH = '/health/ehs/foodsafety/inspections/Results.aspx'
INSPECTION_PARAMS = {
'Output': 'W',
'Business_Name': '',
'Business_Address': '',
'Longitude': '',
'Latitude': '... | <commit_before><commit_msg>Add get_inspection_page method to scrape entire listing.<commit_after> | from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup()
INSPECTION_DOMAIN = 'http://info.kingcounty.gov'
INSPECTION_PATH = '/health/ehs/foodsafety/inspections/Results.aspx'
INSPECTION_PARAMS = {
'Output': 'W',
'Business_Name': '',
'Business_Address': '',
'Longitude': '',
'Latitude': '... | Add get_inspection_page method to scrape entire listing.from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup()
INSPECTION_DOMAIN = 'http://info.kingcounty.gov'
INSPECTION_PATH = '/health/ehs/foodsafety/inspections/Results.aspx'
INSPECTION_PARAMS = {
'Output': 'W',
'Business_Name': '',
'Busin... | <commit_before><commit_msg>Add get_inspection_page method to scrape entire listing.<commit_after>from bs4 import BeautifulSoup
import requests
soup = BeautifulSoup()
INSPECTION_DOMAIN = 'http://info.kingcounty.gov'
INSPECTION_PATH = '/health/ehs/foodsafety/inspections/Results.aspx'
INSPECTION_PARAMS = {
'Output':... | |
d4114f47b36d1ecbcf06f7bda2c0dd6c9a6a1b01 | holidays/countries/malaysia.py | holidays/countries/malaysia.py | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | Add Malaysian states and ISO Codes | Add Malaysian states and ISO Codes
| Python | mit | ryanss/holidays.py,dr-prodigy/python-holidays | Add Malaysian states and ISO Codes | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | <commit_before><commit_msg>Add Malaysian states and ISO Codes<commit_after> | # -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#
# Author: ryanss <ryanssdev@icl... | Add Malaysian states and ISO Codes# -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a holiday as fast and flexible as possible.
#... | <commit_before><commit_msg>Add Malaysian states and ISO Codes<commit_after># -*- coding: utf-8 -*-
# python-holidays
# ---------------
# A fast, efficient Python library for generating country, province and state
# specific sets of holidays on the fly. It aims to make determining whether a
# specific date is a ho... | |
145532e77d2bf10860df3dfb13ce0ef1a4e57772 | spark/pca_preparation.py | spark/pca_preparation.py | import cPickle as pkl
import base64
import numpy as np
from lopq.model import eigenvalue_allocation
def main(args):
params = pkl.load(open(args.pca_params))
P = params['P']
E = params['E']
mu = params['mu']
# Reduce dimension
E = E[-args.D:]
P = P[:,-args.D:]
# Balance variance acro... | Add script demonstrating preparing PCA parameters computed by train_pca.py | Add script demonstrating preparing PCA parameters computed by train_pca.py
| Python | apache-2.0 | yahoo/lopq,yahoo/lopq | Add script demonstrating preparing PCA parameters computed by train_pca.py | import cPickle as pkl
import base64
import numpy as np
from lopq.model import eigenvalue_allocation
def main(args):
params = pkl.load(open(args.pca_params))
P = params['P']
E = params['E']
mu = params['mu']
# Reduce dimension
E = E[-args.D:]
P = P[:,-args.D:]
# Balance variance acro... | <commit_before><commit_msg>Add script demonstrating preparing PCA parameters computed by train_pca.py<commit_after> | import cPickle as pkl
import base64
import numpy as np
from lopq.model import eigenvalue_allocation
def main(args):
params = pkl.load(open(args.pca_params))
P = params['P']
E = params['E']
mu = params['mu']
# Reduce dimension
E = E[-args.D:]
P = P[:,-args.D:]
# Balance variance acro... | Add script demonstrating preparing PCA parameters computed by train_pca.pyimport cPickle as pkl
import base64
import numpy as np
from lopq.model import eigenvalue_allocation
def main(args):
params = pkl.load(open(args.pca_params))
P = params['P']
E = params['E']
mu = params['mu']
# Reduce dimens... | <commit_before><commit_msg>Add script demonstrating preparing PCA parameters computed by train_pca.py<commit_after>import cPickle as pkl
import base64
import numpy as np
from lopq.model import eigenvalue_allocation
def main(args):
params = pkl.load(open(args.pca_params))
P = params['P']
E = params['E']
... | |
da547f5533f338cc0c65877b44ca40adf31754f7 | support/appveyor-build.py | support/appveyor-build.py | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
build_comman... | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
build_comman... | Fix mingw build, take 2 | Fix mingw build, take 2 | Python | bsd-2-clause | cppformat/cppformat,mojoBrendan/fmt,mojoBrendan/fmt,alabuzhev/fmt,nelson4722/cppformat,seungrye/cppformat,lightslife/cppformat,blaquee/cppformat,mojoBrendan/fmt,Jopie64/cppformat,lightslife/cppformat,Jopie64/cppformat,alabuzhev/fmt,wangshijin/cppformat,dean0x7d/cppformat,seungrye/cppformat,cppformat/cppformat,nelson472... | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
build_comman... | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
build_comman... | <commit_before>#!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')... | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
build_comman... | #!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')
build_comman... | <commit_before>#!/usr/bin/env python
# Build the project on AppVeyor.
import os
from subprocess import check_call
build = os.environ['BUILD']
config = os.environ['CONFIG']
cmake_command = ['cmake', '-DFMT_EXTRA_TESTS=ON', '-DCMAKE_BUILD_TYPE=' + config]
if build == 'mingw':
cmake_command.append('-GMinGW Makefiles')... |
0c6f90ded8b7d5a209f648417510aadc0a017425 | kovot/stream/mastodon.py | kovot/stream/mastodon.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from queue import Queue
from kovot.response import Response
from logging import Logger
from typing import Iterator, Optional
__all__ = ['MastodonResponse', 'Mastodon']
_TOOT... | Add a kovot stream for Mastodon | Add a kovot stream for Mastodon
| Python | mit | kenkov/kovot,kenkov/kovot | Add a kovot stream for Mastodon | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from queue import Queue
from kovot.response import Response
from logging import Logger
from typing import Iterator, Optional
__all__ = ['MastodonResponse', 'Mastodon']
_TOOT... | <commit_before><commit_msg>Add a kovot stream for Mastodon<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from queue import Queue
from kovot.response import Response
from logging import Logger
from typing import Iterator, Optional
__all__ = ['MastodonResponse', 'Mastodon']
_TOOT... | Add a kovot stream for Mastodon#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from queue import Queue
from kovot.response import Response
from logging import Logger
from typing import Iterator, Optional
__all__ = ['Mastod... | <commit_before><commit_msg>Add a kovot stream for Mastodon<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
import collections.abc
from mastodon import StreamListener, MastodonError, Mastodon as MastodonAPI
from queue import Queue
from kovot.response import Response
from logging import Logger
from typing imp... | |
bc693c94fcc7ccd06e283c08012937c5732c0da3 | sympy/__init__.py | sympy/__init__.py |
__version__ = "0.4.2"
from sympy.core import *
from sympy.modules import *
|
__version__ = "0.5.0"
from sympy.core import *
from sympy.modules import *
| Use the version 0.5.0 when we merge it. | Use the version 0.5.0 when we merge it.
| Python | bsd-3-clause | yukoba/sympy,jamesblunt/sympy,garvitr/sympy,abhiii5459/sympy,shikil/sympy,madan96/sympy,amitjamadagni/sympy,VaibhavAgarwalVA/sympy,kaushik94/sympy,hrashk/sympy,asm666/sympy,AkademieOlympia/sympy,Designist/sympy,jaimahajan1997/sympy,sampadsaha5/sympy,jbaayen/sympy,sunny94/temp,garvitr/sympy,AkademieOlympia/sympy,Shaswat... |
__version__ = "0.4.2"
from sympy.core import *
from sympy.modules import *
Use the version 0.5.0 when we merge it. |
__version__ = "0.5.0"
from sympy.core import *
from sympy.modules import *
| <commit_before>
__version__ = "0.4.2"
from sympy.core import *
from sympy.modules import *
<commit_msg>Use the version 0.5.0 when we merge it.<commit_after> |
__version__ = "0.5.0"
from sympy.core import *
from sympy.modules import *
|
__version__ = "0.4.2"
from sympy.core import *
from sympy.modules import *
Use the version 0.5.0 when we merge it.
__version__ = "0.5.0"
from sympy.core import *
from sympy.modules import *
| <commit_before>
__version__ = "0.4.2"
from sympy.core import *
from sympy.modules import *
<commit_msg>Use the version 0.5.0 when we merge it.<commit_after>
__version__ = "0.5.0"
from sympy.core import *
from sympy.modules import *
|
063d662561264888a53195a677c36e524a5b465b | test/test_gref.py | test/test_gref.py | import store_fixture
import groundstation.store
from groundstation.gref import Gref
class TestGitGref(store_fixture.StoreTestCase):
storeClass = groundstation.store.git_store.GitStore
def test_write_tip(self):
gref = Gref(self.repo, "testchannel", "test_write_tip")
gref.write_tip("foobarbaz"... | Add test for gref writing | Add test for gref writing
| Python | mit | richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation,richo/groundstation | Add test for gref writing | import store_fixture
import groundstation.store
from groundstation.gref import Gref
class TestGitGref(store_fixture.StoreTestCase):
storeClass = groundstation.store.git_store.GitStore
def test_write_tip(self):
gref = Gref(self.repo, "testchannel", "test_write_tip")
gref.write_tip("foobarbaz"... | <commit_before><commit_msg>Add test for gref writing<commit_after> | import store_fixture
import groundstation.store
from groundstation.gref import Gref
class TestGitGref(store_fixture.StoreTestCase):
storeClass = groundstation.store.git_store.GitStore
def test_write_tip(self):
gref = Gref(self.repo, "testchannel", "test_write_tip")
gref.write_tip("foobarbaz"... | Add test for gref writingimport store_fixture
import groundstation.store
from groundstation.gref import Gref
class TestGitGref(store_fixture.StoreTestCase):
storeClass = groundstation.store.git_store.GitStore
def test_write_tip(self):
gref = Gref(self.repo, "testchannel", "test_write_tip")
g... | <commit_before><commit_msg>Add test for gref writing<commit_after>import store_fixture
import groundstation.store
from groundstation.gref import Gref
class TestGitGref(store_fixture.StoreTestCase):
storeClass = groundstation.store.git_store.GitStore
def test_write_tip(self):
gref = Gref(self.repo, "... | |
ff975c1bea7d0ea1e88e2b0667bc6e31676f66a7 | osf/management/commands/vacuum.py | osf/management/commands/vacuum.py | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import connection
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""Runs VACUUM [ANALYZE] on tables.
Examples:
python manage.py va... | Add management command for running VACUUM | Add management command for running VACUUM [ANALYZE]
[skip ci]
| Python | apache-2.0 | saradbowman/osf.io,caseyrollins/osf.io,Johnetordoff/osf.io,baylee-d/osf.io,aaxelb/osf.io,brianjgeiger/osf.io,pattisdr/osf.io,felliott/osf.io,pattisdr/osf.io,brianjgeiger/osf.io,Johnetordoff/osf.io,caseyrollins/osf.io,mfraezz/osf.io,Johnetordoff/osf.io,adlius/osf.io,sloria/osf.io,mattclark/osf.io,adlius/osf.io,cslzchen/... | Add management command for running VACUUM [ANALYZE]
[skip ci] | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import connection
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""Runs VACUUM [ANALYZE] on tables.
Examples:
python manage.py va... | <commit_before><commit_msg>Add management command for running VACUUM [ANALYZE]
[skip ci]<commit_after> | from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import connection
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""Runs VACUUM [ANALYZE] on tables.
Examples:
python manage.py va... | Add management command for running VACUUM [ANALYZE]
[skip ci]from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import connection
logger = logging.getLogger(__name__)
class Command(BaseCommand):
"""Runs VACUUM [A... | <commit_before><commit_msg>Add management command for running VACUUM [ANALYZE]
[skip ci]<commit_after>from __future__ import unicode_literals
import logging
from django.core.management.base import BaseCommand
from django.apps import apps
from django.db import connection
logger = logging.getLogger(__name__)
class Co... | |
07cdfe31046c717bade6f61b025792478238982c | code/tax2rank.py | code/tax2rank.py | """
Convert all the taxonomy IDs to rank so that we are always talking
about the same thing
"""
import sys
import taxon
try:
rank = sys.argv[1]
except:
sys.exit(sys.argv[0] + " rank to use ... eg. species or genus")
taxa = taxon.readNodes()
with open("all_host_taxid.txt", 'r') as rin:
for l in rin:
... | Convert all the taxonomy IDs to rank so that we are always talking about the same thing | Convert all the taxonomy IDs to rank so that we are always talking about the same thing
| Python | mit | linsalrob/PhageHosts,linsalrob/PhageHosts,linsalrob/PhageHosts | Convert all the taxonomy IDs to rank so that we are always talking about the same thing | """
Convert all the taxonomy IDs to rank so that we are always talking
about the same thing
"""
import sys
import taxon
try:
rank = sys.argv[1]
except:
sys.exit(sys.argv[0] + " rank to use ... eg. species or genus")
taxa = taxon.readNodes()
with open("all_host_taxid.txt", 'r') as rin:
for l in rin:
... | <commit_before><commit_msg>Convert all the taxonomy IDs to rank so that we are always talking about the same thing<commit_after> | """
Convert all the taxonomy IDs to rank so that we are always talking
about the same thing
"""
import sys
import taxon
try:
rank = sys.argv[1]
except:
sys.exit(sys.argv[0] + " rank to use ... eg. species or genus")
taxa = taxon.readNodes()
with open("all_host_taxid.txt", 'r') as rin:
for l in rin:
... | Convert all the taxonomy IDs to rank so that we are always talking about the same thing"""
Convert all the taxonomy IDs to rank so that we are always talking
about the same thing
"""
import sys
import taxon
try:
rank = sys.argv[1]
except:
sys.exit(sys.argv[0] + " rank to use ... eg. species or genus")
taxa =... | <commit_before><commit_msg>Convert all the taxonomy IDs to rank so that we are always talking about the same thing<commit_after>"""
Convert all the taxonomy IDs to rank so that we are always talking
about the same thing
"""
import sys
import taxon
try:
rank = sys.argv[1]
except:
sys.exit(sys.argv[0] + " rank ... | |
17857a746484dd49bf5805f596e6efcd23035afb | my_own_exercises/web_server/flaskapp.py | my_own_exercises/web_server/flaskapp.py | from flask import Flask
from flask import Response
flask_app = Flask('flaskapp')
@flask_app.route('/hello')
def hello_world():
return Response(
'Hello world from Flask!\n',
mimetype='text/plain'
)
app = flask_app.wsgi_app
| Add configuration for Flask 'hello world' app | Add configuration for Flask 'hello world' app
| Python | apache-2.0 | RagBillySandstone/google-python-exercises | Add configuration for Flask 'hello world' app | from flask import Flask
from flask import Response
flask_app = Flask('flaskapp')
@flask_app.route('/hello')
def hello_world():
return Response(
'Hello world from Flask!\n',
mimetype='text/plain'
)
app = flask_app.wsgi_app
| <commit_before><commit_msg>Add configuration for Flask 'hello world' app<commit_after> | from flask import Flask
from flask import Response
flask_app = Flask('flaskapp')
@flask_app.route('/hello')
def hello_world():
return Response(
'Hello world from Flask!\n',
mimetype='text/plain'
)
app = flask_app.wsgi_app
| Add configuration for Flask 'hello world' appfrom flask import Flask
from flask import Response
flask_app = Flask('flaskapp')
@flask_app.route('/hello')
def hello_world():
return Response(
'Hello world from Flask!\n',
mimetype='text/plain'
)
app = flask_app.wsgi_app
| <commit_before><commit_msg>Add configuration for Flask 'hello world' app<commit_after>from flask import Flask
from flask import Response
flask_app = Flask('flaskapp')
@flask_app.route('/hello')
def hello_world():
return Response(
'Hello world from Flask!\n',
mimetype='text/plain'
)
app = flas... | |
4a33e88cfa33ce74a870986d6514fce49c58552a | create_sample.py | create_sample.py | # importing modules/ libraries
import pandas as pd
import random
# create sample of order products train data
n = 1384617
s = round(0.1 * n)
skip = sorted(random.sample(range(1,n), n-s))
order_products__train_sample_df = pd.read_csv('Data/order_products__train.csv',
skiprows = s... | Add code for creating samples | feat: Add code for creating samples
| Python | mit | rjegankumar/instacart_prediction_model | feat: Add code for creating samples | # importing modules/ libraries
import pandas as pd
import random
# create sample of order products train data
n = 1384617
s = round(0.1 * n)
skip = sorted(random.sample(range(1,n), n-s))
order_products__train_sample_df = pd.read_csv('Data/order_products__train.csv',
skiprows = s... | <commit_before><commit_msg>feat: Add code for creating samples<commit_after> | # importing modules/ libraries
import pandas as pd
import random
# create sample of order products train data
n = 1384617
s = round(0.1 * n)
skip = sorted(random.sample(range(1,n), n-s))
order_products__train_sample_df = pd.read_csv('Data/order_products__train.csv',
skiprows = s... | feat: Add code for creating samples# importing modules/ libraries
import pandas as pd
import random
# create sample of order products train data
n = 1384617
s = round(0.1 * n)
skip = sorted(random.sample(range(1,n), n-s))
order_products__train_sample_df = pd.read_csv('Data/order_products__train.csv',
... | <commit_before><commit_msg>feat: Add code for creating samples<commit_after># importing modules/ libraries
import pandas as pd
import random
# create sample of order products train data
n = 1384617
s = round(0.1 * n)
skip = sorted(random.sample(range(1,n), n-s))
order_products__train_sample_df = pd.read_csv('Data/orde... | |
222830648ff174700a5e40d23afa0c721086f594 | templates/kapsi-convert-csv.py | templates/kapsi-convert-csv.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script is used to convert email address and home directory location of
pyfiscan result files to Kapsi's format.
"""
try:
import sys
import csv
import time
from admsikteeri import *
except ImportError, e:
sys.exit(e)
home_location = '/mnt/use... | Add Kapsi result file converter. | Add Kapsi result file converter.
| Python | bsd-3-clause | cyberintruder/pyfiscan | Add Kapsi result file converter. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script is used to convert email address and home directory location of
pyfiscan result files to Kapsi's format.
"""
try:
import sys
import csv
import time
from admsikteeri import *
except ImportError, e:
sys.exit(e)
home_location = '/mnt/use... | <commit_before><commit_msg>Add Kapsi result file converter.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script is used to convert email address and home directory location of
pyfiscan result files to Kapsi's format.
"""
try:
import sys
import csv
import time
from admsikteeri import *
except ImportError, e:
sys.exit(e)
home_location = '/mnt/use... | Add Kapsi result file converter.#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script is used to convert email address and home directory location of
pyfiscan result files to Kapsi's format.
"""
try:
import sys
import csv
import time
from admsikteeri import *
except ImportError, e:
sys.exi... | <commit_before><commit_msg>Add Kapsi result file converter.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
"""
This script is used to convert email address and home directory location of
pyfiscan result files to Kapsi's format.
"""
try:
import sys
import csv
import time
from admsikteeri im... | |
7ed869d5713e936ff1b71dab62ee3599ca23c884 | egopowerflow/tools/pypsa_io.py | egopowerflow/tools/pypsa_io.py | import pypsa
import pandas as pd
from sqlalchemy.orm import sessionmaker, load_only
from sqlalchemy import create_engine
from pypsa import io
from oemof import db
from egoio.db_tables.calc_ego_mv_powerflow import Bus, Line, Generator, Load, \
Transformer, TempResolution, BusVMagSet, GeneratorPqSet, LoadPqSet
def... | Add pypsa-db-io file with first functions | Add pypsa-db-io file with first functions
| Python | agpl-3.0 | openego/ego.powerflow | Add pypsa-db-io file with first functions | import pypsa
import pandas as pd
from sqlalchemy.orm import sessionmaker, load_only
from sqlalchemy import create_engine
from pypsa import io
from oemof import db
from egoio.db_tables.calc_ego_mv_powerflow import Bus, Line, Generator, Load, \
Transformer, TempResolution, BusVMagSet, GeneratorPqSet, LoadPqSet
def... | <commit_before><commit_msg>Add pypsa-db-io file with first functions<commit_after> | import pypsa
import pandas as pd
from sqlalchemy.orm import sessionmaker, load_only
from sqlalchemy import create_engine
from pypsa import io
from oemof import db
from egoio.db_tables.calc_ego_mv_powerflow import Bus, Line, Generator, Load, \
Transformer, TempResolution, BusVMagSet, GeneratorPqSet, LoadPqSet
def... | Add pypsa-db-io file with first functionsimport pypsa
import pandas as pd
from sqlalchemy.orm import sessionmaker, load_only
from sqlalchemy import create_engine
from pypsa import io
from oemof import db
from egoio.db_tables.calc_ego_mv_powerflow import Bus, Line, Generator, Load, \
Transformer, TempResolution, B... | <commit_before><commit_msg>Add pypsa-db-io file with first functions<commit_after>import pypsa
import pandas as pd
from sqlalchemy.orm import sessionmaker, load_only
from sqlalchemy import create_engine
from pypsa import io
from oemof import db
from egoio.db_tables.calc_ego_mv_powerflow import Bus, Line, Generator, L... | |
40149ad648fa84f4597fcb3f3182b83ee62de035 | tests/test_fuzzy_completion.py | tests/test_fuzzy_completion.py | from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return pgcompleter.PGCompleter()
def test_ranking_ignores_identifier_quotes(completer):... | Add tests for fuzzy ranking adjustments. | Add tests for fuzzy ranking adjustments.
| Python | bsd-3-clause | n-someya/pgcli,TamasNo1/pgcli,janusnic/pgcli,w4ngyi/pgcli,j-bennet/pgcli,n-someya/pgcli,lk1ngaa7/pgcli,darikg/pgcli,thedrow/pgcli,dbcli/pgcli,d33tah/pgcli,darikg/pgcli,bitemyapp/pgcli,koljonen/pgcli,MattOates/pgcli,d33tah/pgcli,MattOates/pgcli,zhiyuanshi/pgcli,bitmonk/pgcli,johshoff/pgcli,bitmonk/pgcli,zhiyuanshi/pgcli... | Add tests for fuzzy ranking adjustments. | from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return pgcompleter.PGCompleter()
def test_ranking_ignores_identifier_quotes(completer):... | <commit_before><commit_msg>Add tests for fuzzy ranking adjustments.<commit_after> | from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return pgcompleter.PGCompleter()
def test_ranking_ignores_identifier_quotes(completer):... | Add tests for fuzzy ranking adjustments.from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return pgcompleter.PGCompleter()
def test_ranki... | <commit_before><commit_msg>Add tests for fuzzy ranking adjustments.<commit_after>from __future__ import unicode_literals
import pytest
from prompt_toolkit.completion import Completion
from prompt_toolkit.document import Document
@pytest.fixture
def completer():
import pgcli.pgcompleter as pgcompleter
return p... | |
e0695ca25c4f9f51233ee006c2a3e00bee473203 | all-domains/algorithms/sorting/insertion-sort-part-1/solution.py | all-domains/algorithms/sorting/insertion-sort-part-1/solution.py | # https://www.hackerrank.com/challenges/insertionsort1
# Python 3
def formatted_print(items):
formatted = ' '.join([str(item) for item in items])
print(formatted)
def insertionSort(items):
# The value to insert is the right most element
length = len(items)-1
value_to_insert = items[length]
s... | Implement the beginning of insertion sort | Implement the beginning of insertion sort
https://www.hackerrank.com/challenges/insertionsort1
| Python | mit | arvinsim/hackerrank-solutions | Implement the beginning of insertion sort
https://www.hackerrank.com/challenges/insertionsort1 | # https://www.hackerrank.com/challenges/insertionsort1
# Python 3
def formatted_print(items):
formatted = ' '.join([str(item) for item in items])
print(formatted)
def insertionSort(items):
# The value to insert is the right most element
length = len(items)-1
value_to_insert = items[length]
s... | <commit_before><commit_msg>Implement the beginning of insertion sort
https://www.hackerrank.com/challenges/insertionsort1<commit_after> | # https://www.hackerrank.com/challenges/insertionsort1
# Python 3
def formatted_print(items):
formatted = ' '.join([str(item) for item in items])
print(formatted)
def insertionSort(items):
# The value to insert is the right most element
length = len(items)-1
value_to_insert = items[length]
s... | Implement the beginning of insertion sort
https://www.hackerrank.com/challenges/insertionsort1# https://www.hackerrank.com/challenges/insertionsort1
# Python 3
def formatted_print(items):
formatted = ' '.join([str(item) for item in items])
print(formatted)
def insertionSort(items):
# The value to inser... | <commit_before><commit_msg>Implement the beginning of insertion sort
https://www.hackerrank.com/challenges/insertionsort1<commit_after># https://www.hackerrank.com/challenges/insertionsort1
# Python 3
def formatted_print(items):
formatted = ' '.join([str(item) for item in items])
print(formatted)
def inser... | |
0c669b20b021b07fde251b7b005f2877da1b7202 | test/integration/ggrc/models/test_cad.py | test/integration/ggrc/models/test_cad.py | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for custom attribute definitions model."""
from sqlalchemy.exc import IntegrityError
from ggrc import db
from ggrc import models
from integration.ggrc import TestCase
class TestCAD(T... | Add unique cad name tests | Add unique cad name tests
| Python | apache-2.0 | AleksNeStu/ggrc-core,josthkko/ggrc-core,selahssea/ggrc-core,kr41/ggrc-core,VinnieJohns/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,j0gurt/ggrc-core,j0gurt/ggrc-core,edofic/ggrc-core,plamut/ggrc-core,josthkko/ggrc-core,VinnieJohns/ggrc-core,AleksNeStu/ggrc-core,andrei-karalionak/ggrc-core,selahssea/ggrc-core,AleksNeStu/... | Add unique cad name tests | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for custom attribute definitions model."""
from sqlalchemy.exc import IntegrityError
from ggrc import db
from ggrc import models
from integration.ggrc import TestCase
class TestCAD(T... | <commit_before><commit_msg>Add unique cad name tests<commit_after> | # Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for custom attribute definitions model."""
from sqlalchemy.exc import IntegrityError
from ggrc import db
from ggrc import models
from integration.ggrc import TestCase
class TestCAD(T... | Add unique cad name tests# Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for custom attribute definitions model."""
from sqlalchemy.exc import IntegrityError
from ggrc import db
from ggrc import models
from integration.ggrc import T... | <commit_before><commit_msg>Add unique cad name tests<commit_after># Copyright (C) 2016 Google Inc.
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
"""Integration tests for custom attribute definitions model."""
from sqlalchemy.exc import IntegrityError
from ggrc import db
from ggrc imp... | |
09c42c54816659a19b33c4e0a746f586749b2f93 | sweettooth/extensions/management/commands/searchextensions.py | sweettooth/extensions/management/commands/searchextensions.py |
from django.core.management.base import BaseCommand, make_option
from extensions.models import Extension
from extensions.search import enquire
def append_version(option, opt_str, value, parser):
values = parser.values
if getattr(values, "versions", None) is None:
values.versions = []
values.versio... | Add a simple command to test search | search: Add a simple command to test search
| Python | agpl-3.0 | GNOME/extensions-web,GNOME/extensions-web,GNOME/extensions-web,magcius/sweettooth,magcius/sweettooth,GNOME/extensions-web | search: Add a simple command to test search |
from django.core.management.base import BaseCommand, make_option
from extensions.models import Extension
from extensions.search import enquire
def append_version(option, opt_str, value, parser):
values = parser.values
if getattr(values, "versions", None) is None:
values.versions = []
values.versio... | <commit_before><commit_msg>search: Add a simple command to test search<commit_after> |
from django.core.management.base import BaseCommand, make_option
from extensions.models import Extension
from extensions.search import enquire
def append_version(option, opt_str, value, parser):
values = parser.values
if getattr(values, "versions", None) is None:
values.versions = []
values.versio... | search: Add a simple command to test search
from django.core.management.base import BaseCommand, make_option
from extensions.models import Extension
from extensions.search import enquire
def append_version(option, opt_str, value, parser):
values = parser.values
if getattr(values, "versions", None) is None:
... | <commit_before><commit_msg>search: Add a simple command to test search<commit_after>
from django.core.management.base import BaseCommand, make_option
from extensions.models import Extension
from extensions.search import enquire
def append_version(option, opt_str, value, parser):
values = parser.values
if getat... | |
7531ed0c9ae25f04884250c84b39a630ae7ef34b | raiden/storage/migrations/v20_to_v21.py | raiden/storage/migrations/v20_to_v21.py | import json
from raiden.storage.sqlite import SQLiteStorage
SOURCE_VERSION = 20
TARGET_VERSION = 21
def _transform_snapshot(raw_snapshot: str) -> str:
snapshot = json.loads(raw_snapshot)
for task in snapshot['payment_mapping']['secrethashes_to_task'].values():
if 'raiden.transfer.state.InitiatorTas... | Move migration 21 to it's proper file | Move migration 21 to it's proper file
| Python | mit | hackaugusto/raiden,hackaugusto/raiden | Move migration 21 to it's proper file | import json
from raiden.storage.sqlite import SQLiteStorage
SOURCE_VERSION = 20
TARGET_VERSION = 21
def _transform_snapshot(raw_snapshot: str) -> str:
snapshot = json.loads(raw_snapshot)
for task in snapshot['payment_mapping']['secrethashes_to_task'].values():
if 'raiden.transfer.state.InitiatorTas... | <commit_before><commit_msg>Move migration 21 to it's proper file<commit_after> | import json
from raiden.storage.sqlite import SQLiteStorage
SOURCE_VERSION = 20
TARGET_VERSION = 21
def _transform_snapshot(raw_snapshot: str) -> str:
snapshot = json.loads(raw_snapshot)
for task in snapshot['payment_mapping']['secrethashes_to_task'].values():
if 'raiden.transfer.state.InitiatorTas... | Move migration 21 to it's proper fileimport json
from raiden.storage.sqlite import SQLiteStorage
SOURCE_VERSION = 20
TARGET_VERSION = 21
def _transform_snapshot(raw_snapshot: str) -> str:
snapshot = json.loads(raw_snapshot)
for task in snapshot['payment_mapping']['secrethashes_to_task'].values():
i... | <commit_before><commit_msg>Move migration 21 to it's proper file<commit_after>import json
from raiden.storage.sqlite import SQLiteStorage
SOURCE_VERSION = 20
TARGET_VERSION = 21
def _transform_snapshot(raw_snapshot: str) -> str:
snapshot = json.loads(raw_snapshot)
for task in snapshot['payment_mapping']['s... | |
d3fdefb173b0fc3ab6a6479883a77049a4b8af16 | trypython/stdlib/sys_/sys03.py | trypython/stdlib/sys_/sys03.py | """
sys モジュールについてのサンプルです.
venv 環境での
- sys.prefix
- sys.exec_prefix
- sys.base_prefix
- sys.base_exec_prefix
の値について.
REFERENCES:: http://bit.ly/2Vun6U9
http://bit.ly/2Vuvqn6
"""
import sys
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr, hr
class Sam... | Add venv利用時のsys.prefix, sys.base_prefix, sys.exec_prefix, sys.base_exec_prefix の値の違いについてのサンプル追加 | Add venv利用時のsys.prefix, sys.base_prefix, sys.exec_prefix, sys.base_exec_prefix の値の違いについてのサンプル追加
| Python | mit | devlights/try-python | Add venv利用時のsys.prefix, sys.base_prefix, sys.exec_prefix, sys.base_exec_prefix の値の違いについてのサンプル追加 | """
sys モジュールについてのサンプルです.
venv 環境での
- sys.prefix
- sys.exec_prefix
- sys.base_prefix
- sys.base_exec_prefix
の値について.
REFERENCES:: http://bit.ly/2Vun6U9
http://bit.ly/2Vuvqn6
"""
import sys
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr, hr
class Sam... | <commit_before><commit_msg>Add venv利用時のsys.prefix, sys.base_prefix, sys.exec_prefix, sys.base_exec_prefix の値の違いについてのサンプル追加<commit_after> | """
sys モジュールについてのサンプルです.
venv 環境での
- sys.prefix
- sys.exec_prefix
- sys.base_prefix
- sys.base_exec_prefix
の値について.
REFERENCES:: http://bit.ly/2Vun6U9
http://bit.ly/2Vuvqn6
"""
import sys
from trypython.common.commoncls import SampleBase
from trypython.common.commonfunc import pr, hr
class Sam... | Add venv利用時のsys.prefix, sys.base_prefix, sys.exec_prefix, sys.base_exec_prefix の値の違いについてのサンプル追加"""
sys モジュールについてのサンプルです.
venv 環境での
- sys.prefix
- sys.exec_prefix
- sys.base_prefix
- sys.base_exec_prefix
の値について.
REFERENCES:: http://bit.ly/2Vun6U9
http://bit.ly/2Vuvqn6
"""
import sys
from trypytho... | <commit_before><commit_msg>Add venv利用時のsys.prefix, sys.base_prefix, sys.exec_prefix, sys.base_exec_prefix の値の違いについてのサンプル追加<commit_after>"""
sys モジュールについてのサンプルです.
venv 環境での
- sys.prefix
- sys.exec_prefix
- sys.base_prefix
- sys.base_exec_prefix
の値について.
REFERENCES:: http://bit.ly/2Vun6U9
http://bit... | |
2fc3767b42b556afcd5d0f34b6cb86d71a79aa51 | sandbox/to-casava-1.8-fastq.py | sandbox/to-casava-1.8-fastq.py | #!/usr/bin/env python
import functools
import re
import argparse
from khmer import ReadParser
resub_read_1 = functools.partial( re.sub, r"^(.*)/1$", r"\1 1:N:0:NNNNN" )
resub_read_2 = functools.partial( re.sub, r"^(.*)/2$", r"\1 2:N:0:NNNNN" )
def setup_cl_parser( ):
parser = \
argparse.ArgumentParser... | Create script to convert from old FAST{A,Q} name format to new one (as of Casava 1.8). | Create script to convert from old FAST{A,Q} name format to new one (as of Casava 1.8).
| Python | bsd-3-clause | kdmurray91/khmer,jas14/khmer,F1000Research/khmer,souravsingh/khmer,F1000Research/khmer,souravsingh/khmer,souravsingh/khmer,jas14/khmer,Winterflower/khmer,ged-lab/khmer,ged-lab/khmer,jas14/khmer,Winterflower/khmer,F1000Research/khmer,Winterflower/khmer,kdmurray91/khmer,ged-lab/khmer,kdmurray91/khmer | Create script to convert from old FAST{A,Q} name format to new one (as of Casava 1.8). | #!/usr/bin/env python
import functools
import re
import argparse
from khmer import ReadParser
resub_read_1 = functools.partial( re.sub, r"^(.*)/1$", r"\1 1:N:0:NNNNN" )
resub_read_2 = functools.partial( re.sub, r"^(.*)/2$", r"\1 2:N:0:NNNNN" )
def setup_cl_parser( ):
parser = \
argparse.ArgumentParser... | <commit_before><commit_msg>Create script to convert from old FAST{A,Q} name format to new one (as of Casava 1.8).<commit_after> | #!/usr/bin/env python
import functools
import re
import argparse
from khmer import ReadParser
resub_read_1 = functools.partial( re.sub, r"^(.*)/1$", r"\1 1:N:0:NNNNN" )
resub_read_2 = functools.partial( re.sub, r"^(.*)/2$", r"\1 2:N:0:NNNNN" )
def setup_cl_parser( ):
parser = \
argparse.ArgumentParser... | Create script to convert from old FAST{A,Q} name format to new one (as of Casava 1.8).#!/usr/bin/env python
import functools
import re
import argparse
from khmer import ReadParser
resub_read_1 = functools.partial( re.sub, r"^(.*)/1$", r"\1 1:N:0:NNNNN" )
resub_read_2 = functools.partial( re.sub, r"^(.*)/2$", r"\1... | <commit_before><commit_msg>Create script to convert from old FAST{A,Q} name format to new one (as of Casava 1.8).<commit_after>#!/usr/bin/env python
import functools
import re
import argparse
from khmer import ReadParser
resub_read_1 = functools.partial( re.sub, r"^(.*)/1$", r"\1 1:N:0:NNNNN" )
resub_read_2 = fun... | |
15db0f300b23693160872754a57cb3afc1944a07 | setup.py | setup.py | #!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomba',
version=version.VERSION,
description='Robot Framework mini... | #!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("docs/README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomb... | Use readme as the long description in pypi | Use readme as the long description in pypi
| Python | apache-2.0 | Accruent/zoomba,Accruent/zoomba | #!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomba',
version=version.VERSION,
description='Robot Framework mini... | #!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("docs/README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomb... | <commit_before>#!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomba',
version=version.VERSION,
description='Robot... | #!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open("docs/README.md", "r") as fh:
long_description = fh.read()
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomb... | #!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomba',
version=version.VERSION,
description='Robot Framework mini... | <commit_before>#!/usr/bin/env python3
import version
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
with open('requirements.txt') as f:
requirements = f.read().splitlines()
setup(name='robotframework-zoomba',
version=version.VERSION,
description='Robot... |
30ceb2772b3f6084a613a625160b8fc0da4890b0 | tests/test_writelatex.py | tests/test_writelatex.py | """
unit tests of the latex writer
"""
import unittest
import subprocess
import tempfile
import os
import sys
import BeautifulSoup
from pyth.plugins.latex.writer import LatexWriter
from pyth.plugins.python.reader import *
class TestWriteLatex(unittest.TestCase):
def test_basic(self):
"""
Try to... | Add unit tests for latex output | Add unit tests for latex output
| Python | mit | kippr/pyth,pombredanne/pyth,kippr/pyth,prechelt/pyth,brendonh/pyth,prechelt/pyth,eriol/pyth,sheepeatingtaz/pyth | Add unit tests for latex output | """
unit tests of the latex writer
"""
import unittest
import subprocess
import tempfile
import os
import sys
import BeautifulSoup
from pyth.plugins.latex.writer import LatexWriter
from pyth.plugins.python.reader import *
class TestWriteLatex(unittest.TestCase):
def test_basic(self):
"""
Try to... | <commit_before><commit_msg>Add unit tests for latex output<commit_after> | """
unit tests of the latex writer
"""
import unittest
import subprocess
import tempfile
import os
import sys
import BeautifulSoup
from pyth.plugins.latex.writer import LatexWriter
from pyth.plugins.python.reader import *
class TestWriteLatex(unittest.TestCase):
def test_basic(self):
"""
Try to... | Add unit tests for latex output"""
unit tests of the latex writer
"""
import unittest
import subprocess
import tempfile
import os
import sys
import BeautifulSoup
from pyth.plugins.latex.writer import LatexWriter
from pyth.plugins.python.reader import *
class TestWriteLatex(unittest.TestCase):
def test_basic(se... | <commit_before><commit_msg>Add unit tests for latex output<commit_after>"""
unit tests of the latex writer
"""
import unittest
import subprocess
import tempfile
import os
import sys
import BeautifulSoup
from pyth.plugins.latex.writer import LatexWriter
from pyth.plugins.python.reader import *
class TestWriteLatex(u... | |
0cf6a1ecf280132f8051c48468eddf2886dfc581 | tests/test_table.py | tests/test_table.py | from cycli.table import isnumeric, col_widths
import pytest
@pytest.mark.parametrize(("number", "answer"), [
("12", True),
("12.3", True),
("0", True),
("1.1.0", False),
("Hell0", False),
("Hello", False)
])
def test_isnumeric(number, answer):
assert isnumeric(number) == answer
@pytest.mar... | Add tests for functions in table.py :construction: | Add tests for functions in table.py :construction:
| Python | mit | nicolewhite/cycli,nicolewhite/cycli | Add tests for functions in table.py :construction: | from cycli.table import isnumeric, col_widths
import pytest
@pytest.mark.parametrize(("number", "answer"), [
("12", True),
("12.3", True),
("0", True),
("1.1.0", False),
("Hell0", False),
("Hello", False)
])
def test_isnumeric(number, answer):
assert isnumeric(number) == answer
@pytest.mar... | <commit_before><commit_msg>Add tests for functions in table.py :construction:<commit_after> | from cycli.table import isnumeric, col_widths
import pytest
@pytest.mark.parametrize(("number", "answer"), [
("12", True),
("12.3", True),
("0", True),
("1.1.0", False),
("Hell0", False),
("Hello", False)
])
def test_isnumeric(number, answer):
assert isnumeric(number) == answer
@pytest.mar... | Add tests for functions in table.py :construction:from cycli.table import isnumeric, col_widths
import pytest
@pytest.mark.parametrize(("number", "answer"), [
("12", True),
("12.3", True),
("0", True),
("1.1.0", False),
("Hell0", False),
("Hello", False)
])
def test_isnumeric(number, answer):
... | <commit_before><commit_msg>Add tests for functions in table.py :construction:<commit_after>from cycli.table import isnumeric, col_widths
import pytest
@pytest.mark.parametrize(("number", "answer"), [
("12", True),
("12.3", True),
("0", True),
("1.1.0", False),
("Hell0", False),
("Hello", False)... | |
bf621217d9ccb605ec16afb20852485b1708ce79 | tests/test_utils.py | tests/test_utils.py | from bugsnag.utils import sanitize_object
def test_sanitize_object():
filters = ["password", "credit_card"]
crazy_dict = {
"password": "123456",
"metadata": {
"another_password": "123456",
"regular": "text"
},
"bad_utf8": "a test of \xe9 char"
}
... | Add a couple of basic tests for sanitize_object | Add a couple of basic tests for sanitize_object
| Python | mit | overplumbum/bugsnag-python,overplumbum/bugsnag-python,bugsnag/bugsnag-python,bugsnag/bugsnag-python | Add a couple of basic tests for sanitize_object | from bugsnag.utils import sanitize_object
def test_sanitize_object():
filters = ["password", "credit_card"]
crazy_dict = {
"password": "123456",
"metadata": {
"another_password": "123456",
"regular": "text"
},
"bad_utf8": "a test of \xe9 char"
}
... | <commit_before><commit_msg>Add a couple of basic tests for sanitize_object<commit_after> | from bugsnag.utils import sanitize_object
def test_sanitize_object():
filters = ["password", "credit_card"]
crazy_dict = {
"password": "123456",
"metadata": {
"another_password": "123456",
"regular": "text"
},
"bad_utf8": "a test of \xe9 char"
}
... | Add a couple of basic tests for sanitize_objectfrom bugsnag.utils import sanitize_object
def test_sanitize_object():
filters = ["password", "credit_card"]
crazy_dict = {
"password": "123456",
"metadata": {
"another_password": "123456",
"regular": "text"
},
... | <commit_before><commit_msg>Add a couple of basic tests for sanitize_object<commit_after>from bugsnag.utils import sanitize_object
def test_sanitize_object():
filters = ["password", "credit_card"]
crazy_dict = {
"password": "123456",
"metadata": {
"another_password": "123456",
... | |
fef896afa8a763fdd93bc52e6d47a69f7dda5f9b | tests/test_format.py | tests/test_format.py | from unittest.mock import MagicMock, patch
import pytest
from hypothesis_auto import auto_pytest_magic
import isort.format
auto_pytest_magic(isort.format.show_unified_diff)
def test_ask_whether_to_apply_changes_to_file():
with patch("isort.format.input", MagicMock(return_value="y")):
assert isort.forma... | Add test cases for format module | Add test cases for format module
| Python | mit | PyCQA/isort,PyCQA/isort | Add test cases for format module | from unittest.mock import MagicMock, patch
import pytest
from hypothesis_auto import auto_pytest_magic
import isort.format
auto_pytest_magic(isort.format.show_unified_diff)
def test_ask_whether_to_apply_changes_to_file():
with patch("isort.format.input", MagicMock(return_value="y")):
assert isort.forma... | <commit_before><commit_msg>Add test cases for format module<commit_after> | from unittest.mock import MagicMock, patch
import pytest
from hypothesis_auto import auto_pytest_magic
import isort.format
auto_pytest_magic(isort.format.show_unified_diff)
def test_ask_whether_to_apply_changes_to_file():
with patch("isort.format.input", MagicMock(return_value="y")):
assert isort.forma... | Add test cases for format modulefrom unittest.mock import MagicMock, patch
import pytest
from hypothesis_auto import auto_pytest_magic
import isort.format
auto_pytest_magic(isort.format.show_unified_diff)
def test_ask_whether_to_apply_changes_to_file():
with patch("isort.format.input", MagicMock(return_value="... | <commit_before><commit_msg>Add test cases for format module<commit_after>from unittest.mock import MagicMock, patch
import pytest
from hypothesis_auto import auto_pytest_magic
import isort.format
auto_pytest_magic(isort.format.show_unified_diff)
def test_ask_whether_to_apply_changes_to_file():
with patch("isor... | |
4f793a31f238adce95fd8e2830a7d5b85724bdd2 | elections/st_paul_municipal_2015/settings.py | elections/st_paul_municipal_2015/settings.py | # -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'Burkina Open Data Initiative (B... | # -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'DataMade'
COPYRIGHT_HOLDER = 'D... | Make the SITE_OWNER and COPYRIGHT_HOLDER for St Paul (more) correct | Make the SITE_OWNER and COPYRIGHT_HOLDER for St Paul (more) correct
| Python | agpl-3.0 | mysociety/yournextrepresentative,DemocracyClub/yournextrepresentative,datamade/yournextmp-popit,mysociety/yournextrepresentative,datamade/yournextmp-popit,mysociety/yournextrepresentative,mysociety/yournextmp-popit,mysociety/yournextmp-popit,datamade/yournextmp-popit,mysociety/yournextmp-popit,datamade/yournextmp-popit... | # -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'Burkina Open Data Initiative (B... | # -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'DataMade'
COPYRIGHT_HOLDER = 'D... | <commit_before># -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'Burkina Open Dat... | # -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'DataMade'
COPYRIGHT_HOLDER = 'D... | # -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'Burkina Open Data Initiative (B... | <commit_before># -*- coding: utf-8 -*-
from datetime import date
MAPIT_BASE_URL = 'http://international.mapit.mysociety.org/'
ELECTION_RE = '(?P<election>council-member-2015|school-board-2015)'
# OCD_BOUNDARIES_URL = 'http://127.0.0.1:8001'
OCD_BOUNDARIES_URL = 'http://ocd.datamade.us'
SITE_OWNER = 'Burkina Open Dat... |
c84bd98971aa5839cb6aa999889a92071890f579 | test/requests/test_login_local.py | test/requests/test_login_local.py | import requests
from wqflask import user_manager
from parametrized_test import ParametrizedTest
class TestLoginLocal(ParametrizedTest):
def setUp(self):
super(TestLoginLocal, self).setUp()
self.login_url = self.gn2_url +"/n/login"
data = {
"es_connection": self.es,
... | Add test for local login | Add test for local login
* Add an integration test to test that the login process for users
registered locally to genenetwork2 works as expected.
| Python | agpl-3.0 | DannyArends/genenetwork2,pjotrp/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,zsloan/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2,Danny... | Add test for local login
* Add an integration test to test that the login process for users
registered locally to genenetwork2 works as expected. | import requests
from wqflask import user_manager
from parametrized_test import ParametrizedTest
class TestLoginLocal(ParametrizedTest):
def setUp(self):
super(TestLoginLocal, self).setUp()
self.login_url = self.gn2_url +"/n/login"
data = {
"es_connection": self.es,
... | <commit_before><commit_msg>Add test for local login
* Add an integration test to test that the login process for users
registered locally to genenetwork2 works as expected.<commit_after> | import requests
from wqflask import user_manager
from parametrized_test import ParametrizedTest
class TestLoginLocal(ParametrizedTest):
def setUp(self):
super(TestLoginLocal, self).setUp()
self.login_url = self.gn2_url +"/n/login"
data = {
"es_connection": self.es,
... | Add test for local login
* Add an integration test to test that the login process for users
registered locally to genenetwork2 works as expected.import requests
from wqflask import user_manager
from parametrized_test import ParametrizedTest
class TestLoginLocal(ParametrizedTest):
def setUp(self):
super... | <commit_before><commit_msg>Add test for local login
* Add an integration test to test that the login process for users
registered locally to genenetwork2 works as expected.<commit_after>import requests
from wqflask import user_manager
from parametrized_test import ParametrizedTest
class TestLoginLocal(ParametrizedT... | |
52a483fd26fee44e387067f7efa270ad1c8df571 | toolset/mogreltk.py | toolset/mogreltk.py | """ This module offers a number tools for processing modern Greek text. """
def normalize(text):
""" Remove intonation from Greek text.
Args:
text (str): The text that will be normalized.
Returns:
text (str): The original text in lowercase without intonation.
"""
vo... | Add modern Greek language toolkit module. | Add modern Greek language toolkit module.
| Python | mit | theovasi/browsewiki,theovasi/browsewiki,theovasi/browsewiki | Add modern Greek language toolkit module. | """ This module offers a number tools for processing modern Greek text. """
def normalize(text):
""" Remove intonation from Greek text.
Args:
text (str): The text that will be normalized.
Returns:
text (str): The original text in lowercase without intonation.
"""
vo... | <commit_before><commit_msg>Add modern Greek language toolkit module.<commit_after> | """ This module offers a number tools for processing modern Greek text. """
def normalize(text):
""" Remove intonation from Greek text.
Args:
text (str): The text that will be normalized.
Returns:
text (str): The original text in lowercase without intonation.
"""
vo... | Add modern Greek language toolkit module.""" This module offers a number tools for processing modern Greek text. """
def normalize(text):
""" Remove intonation from Greek text.
Args:
text (str): The text that will be normalized.
Returns:
text (str): The original text in low... | <commit_before><commit_msg>Add modern Greek language toolkit module.<commit_after>""" This module offers a number tools for processing modern Greek text. """
def normalize(text):
""" Remove intonation from Greek text.
Args:
text (str): The text that will be normalized.
Returns:
... | |
cc283447dc2c7d70387a8d11f1cc7fdc06bf9dbe | chapter02/evenNumbersBetweenTwoNumbers.py | chapter02/evenNumbersBetweenTwoNumbers.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
first = input("Write a number: ")
second = input("Write another number: ")
for x in range(first, second):
if (x % 2 == 0):
print x
| Add even numbers between two numbers exercise | Add even numbers between two numbers exercise
| Python | apache-2.0 | MindCookin/python-exercises | Add even numbers between two numbers exercise | #!/usr/bin/env python
# -*- coding: utf-8 -*-
first = input("Write a number: ")
second = input("Write another number: ")
for x in range(first, second):
if (x % 2 == 0):
print x
| <commit_before><commit_msg>Add even numbers between two numbers exercise<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
first = input("Write a number: ")
second = input("Write another number: ")
for x in range(first, second):
if (x % 2 == 0):
print x
| Add even numbers between two numbers exercise#!/usr/bin/env python
# -*- coding: utf-8 -*-
first = input("Write a number: ")
second = input("Write another number: ")
for x in range(first, second):
if (x % 2 == 0):
print x
| <commit_before><commit_msg>Add even numbers between two numbers exercise<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
first = input("Write a number: ")
second = input("Write another number: ")
for x in range(first, second):
if (x % 2 == 0):
print x
| |
3a64972a6220764582b31a6ad3f354e9b1259264 | numpy/core/tests/test_scalarinherit.py | numpy/core/tests/test_scalarinherit.py | # -*- coding: utf-8 -*-
""" Test printing of scalar types.
"""
import numpy as np
from numpy.testing import TestCase, run_module_suite
class A(object): pass
class B(A, np.float64): pass
class C(B): pass
class D(C, B): pass
class B0(np.float64, A): pass
class C0(B0): pass
class TestInherit(TestCase):
def test... | Add test-case for multiple-inheritance on an array-scalar. | Add test-case for multiple-inheritance on an array-scalar.
| Python | bsd-3-clause | leifdenby/numpy,gmcastil/numpy,BabeNovelty/numpy,kiwifb/numpy,groutr/numpy,tynn/numpy,njase/numpy,mhvk/numpy,Dapid/numpy,rgommers/numpy,sinhrks/numpy,WarrenWeckesser/numpy,rudimeier/numpy,larsmans/numpy,mhvk/numpy,GrimDerp/numpy,gfyoung/numpy,SiccarPoint/numpy,AustereCuriosity/numpy,Eric89GXL/numpy,WarrenWeckesser/nump... | Add test-case for multiple-inheritance on an array-scalar. | # -*- coding: utf-8 -*-
""" Test printing of scalar types.
"""
import numpy as np
from numpy.testing import TestCase, run_module_suite
class A(object): pass
class B(A, np.float64): pass
class C(B): pass
class D(C, B): pass
class B0(np.float64, A): pass
class C0(B0): pass
class TestInherit(TestCase):
def test... | <commit_before><commit_msg>Add test-case for multiple-inheritance on an array-scalar.<commit_after> | # -*- coding: utf-8 -*-
""" Test printing of scalar types.
"""
import numpy as np
from numpy.testing import TestCase, run_module_suite
class A(object): pass
class B(A, np.float64): pass
class C(B): pass
class D(C, B): pass
class B0(np.float64, A): pass
class C0(B0): pass
class TestInherit(TestCase):
def test... | Add test-case for multiple-inheritance on an array-scalar.# -*- coding: utf-8 -*-
""" Test printing of scalar types.
"""
import numpy as np
from numpy.testing import TestCase, run_module_suite
class A(object): pass
class B(A, np.float64): pass
class C(B): pass
class D(C, B): pass
class B0(np.float64, A): pass
cla... | <commit_before><commit_msg>Add test-case for multiple-inheritance on an array-scalar.<commit_after># -*- coding: utf-8 -*-
""" Test printing of scalar types.
"""
import numpy as np
from numpy.testing import TestCase, run_module_suite
class A(object): pass
class B(A, np.float64): pass
class C(B): pass
class D(C, B)... | |
821911ae6e46bf8e180c9f582b5112dc1942777f | test/unit/test_id_iterators.py | test/unit/test_id_iterators.py | from unittest import TestCase, main
import re
from uuid import UUID
from jsonrpcclient.id_iterators import hex_iterator, uuid_iterator, \
random_iterator
class TestHexIterator(TestCase):
def test(self):
i = hex_iterator()
self.assertEqual('1', next(i))
i = hex_iterator(9)
self... | Move iterator tests into separate file | Move iterator tests into separate file
| Python | mit | bcb/jsonrpcclient | Move iterator tests into separate file | from unittest import TestCase, main
import re
from uuid import UUID
from jsonrpcclient.id_iterators import hex_iterator, uuid_iterator, \
random_iterator
class TestHexIterator(TestCase):
def test(self):
i = hex_iterator()
self.assertEqual('1', next(i))
i = hex_iterator(9)
self... | <commit_before><commit_msg>Move iterator tests into separate file<commit_after> | from unittest import TestCase, main
import re
from uuid import UUID
from jsonrpcclient.id_iterators import hex_iterator, uuid_iterator, \
random_iterator
class TestHexIterator(TestCase):
def test(self):
i = hex_iterator()
self.assertEqual('1', next(i))
i = hex_iterator(9)
self... | Move iterator tests into separate filefrom unittest import TestCase, main
import re
from uuid import UUID
from jsonrpcclient.id_iterators import hex_iterator, uuid_iterator, \
random_iterator
class TestHexIterator(TestCase):
def test(self):
i = hex_iterator()
self.assertEqual('1', next(i))
... | <commit_before><commit_msg>Move iterator tests into separate file<commit_after>from unittest import TestCase, main
import re
from uuid import UUID
from jsonrpcclient.id_iterators import hex_iterator, uuid_iterator, \
random_iterator
class TestHexIterator(TestCase):
def test(self):
i = hex_iterator()
... | |
74e08aa31375c0d368d9cb4719e8c3766ea20b78 | repomgmt/management/commands/add-key-to-user.py | repomgmt/management/commands/add-key-to-user.py | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Fix User object attribute reference | Fix User object attribute reference
| Python | apache-2.0 | sorenh/python-django-repomgmt,sorenh/python-django-repomgmt | Fix User object attribute reference | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | <commit_before><commit_msg>Fix User object attribute reference<commit_after> | #
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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... | Fix User object attribute reference#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# 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
#
# htt... | <commit_before><commit_msg>Fix User object attribute reference<commit_after>#
# Copyright 2012 Cisco Systems, Inc.
#
# Author: Soren Hansen <sorhanse@cisco.com>
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obta... | |
7eaef25771840ceb9974814a1e68916017016082 | CodeFights/swapAdjacentBits.py | CodeFights/swapAdjacentBits.py | #!/usr/local/bin/python
# Code Fights Swap Adjacent Bits (Core) Problem
def swapAdjacentBits(n):
# even = n & 0xaaaaaaaa # mask to keep only even bits with 10 16x
# odd = n & 0x55555555 # mask to keep only odd bits with 01 16x
# even = even >> 1 # left shift even bits
# odd = odd << 1 # right shif... | Solve Code Fights swap adjacent bits problem | Solve Code Fights swap adjacent bits problem
| Python | mit | HKuz/Test_Code | Solve Code Fights swap adjacent bits problem | #!/usr/local/bin/python
# Code Fights Swap Adjacent Bits (Core) Problem
def swapAdjacentBits(n):
# even = n & 0xaaaaaaaa # mask to keep only even bits with 10 16x
# odd = n & 0x55555555 # mask to keep only odd bits with 01 16x
# even = even >> 1 # left shift even bits
# odd = odd << 1 # right shif... | <commit_before><commit_msg>Solve Code Fights swap adjacent bits problem<commit_after> | #!/usr/local/bin/python
# Code Fights Swap Adjacent Bits (Core) Problem
def swapAdjacentBits(n):
# even = n & 0xaaaaaaaa # mask to keep only even bits with 10 16x
# odd = n & 0x55555555 # mask to keep only odd bits with 01 16x
# even = even >> 1 # left shift even bits
# odd = odd << 1 # right shif... | Solve Code Fights swap adjacent bits problem#!/usr/local/bin/python
# Code Fights Swap Adjacent Bits (Core) Problem
def swapAdjacentBits(n):
# even = n & 0xaaaaaaaa # mask to keep only even bits with 10 16x
# odd = n & 0x55555555 # mask to keep only odd bits with 01 16x
# even = even >> 1 # left shift ... | <commit_before><commit_msg>Solve Code Fights swap adjacent bits problem<commit_after>#!/usr/local/bin/python
# Code Fights Swap Adjacent Bits (Core) Problem
def swapAdjacentBits(n):
# even = n & 0xaaaaaaaa # mask to keep only even bits with 10 16x
# odd = n & 0x55555555 # mask to keep only odd bits with 01 ... | |
d324d9dd8d738c59cc27e4b429107a0218310d6c | bitket/wsgi.py | bitket/wsgi.py | """
WSGI config for Bitket project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | Revert "Removed unneeded WSGI file" | Revert "Removed unneeded WSGI file"
This reverts commit 078f9ecdba5eedd957fa88af8bc45ed1ad8a3e6e.
| Python | mit | ovidner/bitket,ovidner/bitket,ovidner/bitket,ovidner/bitket | Revert "Removed unneeded WSGI file"
This reverts commit 078f9ecdba5eedd957fa88af8bc45ed1ad8a3e6e. | """
WSGI config for Bitket project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | <commit_before><commit_msg>Revert "Removed unneeded WSGI file"
This reverts commit 078f9ecdba5eedd957fa88af8bc45ed1ad8a3e6e.<commit_after> | """
WSGI config for Bitket project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover
this application via the ``WSGI_APPLICATION`` s... | Revert "Removed unneeded WSGI file"
This reverts commit 078f9ecdba5eedd957fa88af8bc45ed1ad8a3e6e."""
WSGI config for Bitket project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-level variable
named ``application``. Django... | <commit_before><commit_msg>Revert "Removed unneeded WSGI file"
This reverts commit 078f9ecdba5eedd957fa88af8bc45ed1ad8a3e6e.<commit_after>"""
WSGI config for Bitket project.
This module contains the WSGI application used by Django's development server
and any production WSGI deployments. It should expose a module-lev... | |
e36e1fb1358123d70d1d580fdd9c00a0a6712f59 | bcbio/project-summary-to-csv.py | bcbio/project-summary-to-csv.py | from __future__ import print_function
from argparse import ArgumentParser
import yaml
if __name__ == "__main__":
parser = ArgumentParser(description="Convert metrics from a bcbio run to CSV.")
parser.add_argument("yamlfile",
help="project-summary.yaml from a bcbio project")
args = p... | Add bcbio project summary metrics -> CSV converter. | Add bcbio project summary metrics -> CSV converter.
| Python | mit | roryk/junkdrawer,roryk/junkdrawer | Add bcbio project summary metrics -> CSV converter. | from __future__ import print_function
from argparse import ArgumentParser
import yaml
if __name__ == "__main__":
parser = ArgumentParser(description="Convert metrics from a bcbio run to CSV.")
parser.add_argument("yamlfile",
help="project-summary.yaml from a bcbio project")
args = p... | <commit_before><commit_msg>Add bcbio project summary metrics -> CSV converter.<commit_after> | from __future__ import print_function
from argparse import ArgumentParser
import yaml
if __name__ == "__main__":
parser = ArgumentParser(description="Convert metrics from a bcbio run to CSV.")
parser.add_argument("yamlfile",
help="project-summary.yaml from a bcbio project")
args = p... | Add bcbio project summary metrics -> CSV converter.from __future__ import print_function
from argparse import ArgumentParser
import yaml
if __name__ == "__main__":
parser = ArgumentParser(description="Convert metrics from a bcbio run to CSV.")
parser.add_argument("yamlfile",
help="proje... | <commit_before><commit_msg>Add bcbio project summary metrics -> CSV converter.<commit_after>from __future__ import print_function
from argparse import ArgumentParser
import yaml
if __name__ == "__main__":
parser = ArgumentParser(description="Convert metrics from a bcbio run to CSV.")
parser.add_argument("yamlf... | |
b1ed5c94d3ba4f47202c4f4e23ff0d2837894c85 | vumi_http_retry/tests/utils.py | vumi_http_retry/tests/utils.py | from twisted.web.server import Site
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from klein import Klein
class ToyServer(object):
@inlineCallbacks
def setup(self):
self.app = Klein()
self.server = yield reactor.listenTCP(0, Site(self.app... | Add a toy server to use in tests | Add a toy server to use in tests
| Python | bsd-3-clause | praekelt/vumi-http-retry-api,praekelt/vumi-http-retry-api | Add a toy server to use in tests | from twisted.web.server import Site
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from klein import Klein
class ToyServer(object):
@inlineCallbacks
def setup(self):
self.app = Klein()
self.server = yield reactor.listenTCP(0, Site(self.app... | <commit_before><commit_msg>Add a toy server to use in tests<commit_after> | from twisted.web.server import Site
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from klein import Klein
class ToyServer(object):
@inlineCallbacks
def setup(self):
self.app = Klein()
self.server = yield reactor.listenTCP(0, Site(self.app... | Add a toy server to use in testsfrom twisted.web.server import Site
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from klein import Klein
class ToyServer(object):
@inlineCallbacks
def setup(self):
self.app = Klein()
self.server = yield re... | <commit_before><commit_msg>Add a toy server to use in tests<commit_after>from twisted.web.server import Site
from twisted.internet import reactor
from twisted.internet.defer import inlineCallbacks, returnValue
from klein import Klein
class ToyServer(object):
@inlineCallbacks
def setup(self):
self.app... | |
403c6ac844685bc3d3a16207d71d01384260e0e0 | tests/unit/test_dr.py | tests/unit/test_dr.py | from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
prefix = '.'
for i in range(0, 3):
if os.path.isdir(os.path.join(prefix, 'pycdlib')):
sys.path.insert(0, prefix)
... | Add in unit tests for DirectoryRecord. | Add in unit tests for DirectoryRecord.
Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@gmail.com>
| Python | lgpl-2.1 | clalancette/pycdlib,clalancette/pyiso | Add in unit tests for DirectoryRecord.
Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@gmail.com> | from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
prefix = '.'
for i in range(0, 3):
if os.path.isdir(os.path.join(prefix, 'pycdlib')):
sys.path.insert(0, prefix)
... | <commit_before><commit_msg>Add in unit tests for DirectoryRecord.
Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@gmail.com><commit_after> | from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
prefix = '.'
for i in range(0, 3):
if os.path.isdir(os.path.join(prefix, 'pycdlib')):
sys.path.insert(0, prefix)
... | Add in unit tests for DirectoryRecord.
Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@gmail.com>from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from io import BytesIO
import struct
prefix =... | <commit_before><commit_msg>Add in unit tests for DirectoryRecord.
Signed-off-by: Chris Lalancette <281cd07d7578d97c83271fbbf2faddb83ab3791c@gmail.com><commit_after>from __future__ import absolute_import
import pytest
import os
import sys
try:
from cStringIO import StringIO as BytesIO
except ImportError:
from ... | |
cd2d14a1b405709c7cc06108e499fcae711e9115 | src/nyc_trees/apps/survey/migrations/0013_auto_20150309_1712.py | src/nyc_trees/apps/survey/migrations/0013_auto_20150309_1712.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('survey', '0012_merge'),
]
operations = [
migrations.AlterField(
model_name='tree',
name='curb_locati... | Add migrations for changed choice labels | Add migrations for changed choice labels
| Python | agpl-3.0 | kdeloach/nyc-trees,RickMohr/nyc-trees,azavea/nyc-trees,RickMohr/nyc-trees,RickMohr/nyc-trees,kdeloach/nyc-trees,kdeloach/nyc-trees,kdeloach/nyc-trees,azavea/nyc-trees,maurizi/nyc-trees,azavea/nyc-trees,RickMohr/nyc-trees,maurizi/nyc-trees,azavea/nyc-trees,azavea/nyc-trees,kdeloach/nyc-trees,maurizi/nyc-trees,maurizi/ny... | Add migrations for changed choice labels | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('survey', '0012_merge'),
]
operations = [
migrations.AlterField(
model_name='tree',
name='curb_locati... | <commit_before><commit_msg>Add migrations for changed choice labels<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('survey', '0012_merge'),
]
operations = [
migrations.AlterField(
model_name='tree',
name='curb_locati... | Add migrations for changed choice labels# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('survey', '0012_merge'),
]
operations = [
migrations.AlterField(
model_na... | <commit_before><commit_msg>Add migrations for changed choice labels<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('survey', '0012_merge'),
]
operations = [
mi... | |
ee0745bee8a73b5ee579d7e34f2975295b72e51b | py/find-all-anagrams-in-a-string.py | py/find-all-anagrams-in-a-string.py | class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
"""
ls, lp = len(s), len(p)
P = 100000007
inv = dict()
for o in xrange(ord('a'), ord('z') + 1):
inv[o] = pow(o, P - 2, P)
... | Add py solution for 438. Find All Anagrams in a String | Add py solution for 438. Find All Anagrams in a String
438. Find All Anagrams in a String: https://leetcode.com/problems/find-all-anagrams-in-a-string/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 438. Find All Anagrams in a String
438. Find All Anagrams in a String: https://leetcode.com/problems/find-all-anagrams-in-a-string/ | class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
"""
ls, lp = len(s), len(p)
P = 100000007
inv = dict()
for o in xrange(ord('a'), ord('z') + 1):
inv[o] = pow(o, P - 2, P)
... | <commit_before><commit_msg>Add py solution for 438. Find All Anagrams in a String
438. Find All Anagrams in a String: https://leetcode.com/problems/find-all-anagrams-in-a-string/<commit_after> | class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
"""
ls, lp = len(s), len(p)
P = 100000007
inv = dict()
for o in xrange(ord('a'), ord('z') + 1):
inv[o] = pow(o, P - 2, P)
... | Add py solution for 438. Find All Anagrams in a String
438. Find All Anagrams in a String: https://leetcode.com/problems/find-all-anagrams-in-a-string/class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype: List[int]
"""
ls, lp = l... | <commit_before><commit_msg>Add py solution for 438. Find All Anagrams in a String
438. Find All Anagrams in a String: https://leetcode.com/problems/find-all-anagrams-in-a-string/<commit_after>class Solution(object):
def findAnagrams(self, s, p):
"""
:type s: str
:type p: str
:rtype:... | |
c2116148b8e1d7cfbf6c260c878d199bc6d39ac5 | blaze/tests/test_disk_dimension.py | blaze/tests/test_disk_dimension.py | import os.path
import shutil
import numpy as np
import blaze as blz
def test_perserve():
shape = (3,4)
arr = np.ones(shape)
dshape = "%s,%s, float64" % (shape[0], shape[1])
path = "p.blz"
if os.path.exists(path):
shutil.rmtree(path)
bparams = blz.params(storage=path)
barray = blz.A... | Test dimension perserving for persistence. | Test dimension perserving for persistence.
| Python | bsd-2-clause | seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core,seibert/blaze-core | Test dimension perserving for persistence. | import os.path
import shutil
import numpy as np
import blaze as blz
def test_perserve():
shape = (3,4)
arr = np.ones(shape)
dshape = "%s,%s, float64" % (shape[0], shape[1])
path = "p.blz"
if os.path.exists(path):
shutil.rmtree(path)
bparams = blz.params(storage=path)
barray = blz.A... | <commit_before><commit_msg>Test dimension perserving for persistence.<commit_after> | import os.path
import shutil
import numpy as np
import blaze as blz
def test_perserve():
shape = (3,4)
arr = np.ones(shape)
dshape = "%s,%s, float64" % (shape[0], shape[1])
path = "p.blz"
if os.path.exists(path):
shutil.rmtree(path)
bparams = blz.params(storage=path)
barray = blz.A... | Test dimension perserving for persistence.import os.path
import shutil
import numpy as np
import blaze as blz
def test_perserve():
shape = (3,4)
arr = np.ones(shape)
dshape = "%s,%s, float64" % (shape[0], shape[1])
path = "p.blz"
if os.path.exists(path):
shutil.rmtree(path)
bparams = b... | <commit_before><commit_msg>Test dimension perserving for persistence.<commit_after>import os.path
import shutil
import numpy as np
import blaze as blz
def test_perserve():
shape = (3,4)
arr = np.ones(shape)
dshape = "%s,%s, float64" % (shape[0], shape[1])
path = "p.blz"
if os.path.exists(path):
... | |
96223421604171d2c98deab03de2256c20ad1c38 | paas_manager/hadoop_modules.py | paas_manager/hadoop_modules.py | import threading, subprocess
hostname = "star@192.168.122.10"
def start_hadoop(path, args, callback):
command = ["ssh", hostname, "hadoop", "jar", path]
command.extend(args)
t = threading.Thread(target=exec_hadoop,args=(command, callback))
t.setDaemon(True)
t.start()
return t
def exec_hadoop... | Add module for hadoop execution | Add module for hadoop execution
| Python | mit | pbl-cloud/paas-manager,pbl-cloud/paas-manager,pbl-cloud/paas-manager | Add module for hadoop execution | import threading, subprocess
hostname = "star@192.168.122.10"
def start_hadoop(path, args, callback):
command = ["ssh", hostname, "hadoop", "jar", path]
command.extend(args)
t = threading.Thread(target=exec_hadoop,args=(command, callback))
t.setDaemon(True)
t.start()
return t
def exec_hadoop... | <commit_before><commit_msg>Add module for hadoop execution<commit_after> | import threading, subprocess
hostname = "star@192.168.122.10"
def start_hadoop(path, args, callback):
command = ["ssh", hostname, "hadoop", "jar", path]
command.extend(args)
t = threading.Thread(target=exec_hadoop,args=(command, callback))
t.setDaemon(True)
t.start()
return t
def exec_hadoop... | Add module for hadoop executionimport threading, subprocess
hostname = "star@192.168.122.10"
def start_hadoop(path, args, callback):
command = ["ssh", hostname, "hadoop", "jar", path]
command.extend(args)
t = threading.Thread(target=exec_hadoop,args=(command, callback))
t.setDaemon(True)
t.start(... | <commit_before><commit_msg>Add module for hadoop execution<commit_after>import threading, subprocess
hostname = "star@192.168.122.10"
def start_hadoop(path, args, callback):
command = ["ssh", hostname, "hadoop", "jar", path]
command.extend(args)
t = threading.Thread(target=exec_hadoop,args=(command, call... | |
d628837000db5cc50ff114ab376a0dc0f112ab44 | locale-to-csv.py | locale-to-csv.py | #!/usr/bin/env python
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
class OrderedDictYAMLLo... | Add script for outputting translations as CSV | Add script for outputting translations as CSV
| Python | agpl-3.0 | vaaralav/servicemap,City-of-Helsinki/servicemap,Zeukkari/servicemap,vaaralav/servicemap,City-of-Helsinki/servicemap,City-of-Helsinki/servicemap,vaaralav/servicemap,Zeukkari/servicemap | Add script for outputting translations as CSV | #!/usr/bin/env python
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
class OrderedDictYAMLLo... | <commit_before><commit_msg>Add script for outputting translations as CSV<commit_after> | #!/usr/bin/env python
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddict import OrderedDict
class OrderedDictYAMLLo... | Add script for outputting translations as CSV#!/usr/bin/env python
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# it's available on PyPI
from ordereddic... | <commit_before><commit_msg>Add script for outputting translations as CSV<commit_after>#!/usr/bin/env python
import yaml
import yaml.constructor
try:
# included in standard lib from Python 2.7
from collections import OrderedDict
except ImportError:
# try importing the backported drop-in replacement
# i... | |
90e6dd52a202c2503c1c4881f70b1c13b68147dc | pitchfork/setup_application.py | pitchfork/setup_application.py | from flask import Flask, g
from inspect import getmembers, isfunction
from happymongo import HapPyMongo
from config import config
from adminbp import bp as admin_bp
from manage_globals import bp as manage_bp
from engine import bp as engine_bp
import context_functions
import views
import template_filters
def create_... | Add in setup application file to handle the app setup so that it can be used with browser testing as well | Add in setup application file to handle the app setup so that it can be used with browser testing as well
| Python | apache-2.0 | rackerlabs/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork,oldarmyc/pitchfork,rackerlabs/pitchfork,oldarmyc/pitchfork | Add in setup application file to handle the app setup so that it can be used with browser testing as well | from flask import Flask, g
from inspect import getmembers, isfunction
from happymongo import HapPyMongo
from config import config
from adminbp import bp as admin_bp
from manage_globals import bp as manage_bp
from engine import bp as engine_bp
import context_functions
import views
import template_filters
def create_... | <commit_before><commit_msg>Add in setup application file to handle the app setup so that it can be used with browser testing as well<commit_after> | from flask import Flask, g
from inspect import getmembers, isfunction
from happymongo import HapPyMongo
from config import config
from adminbp import bp as admin_bp
from manage_globals import bp as manage_bp
from engine import bp as engine_bp
import context_functions
import views
import template_filters
def create_... | Add in setup application file to handle the app setup so that it can be used with browser testing as wellfrom flask import Flask, g
from inspect import getmembers, isfunction
from happymongo import HapPyMongo
from config import config
from adminbp import bp as admin_bp
from manage_globals import bp as manage_bp
from en... | <commit_before><commit_msg>Add in setup application file to handle the app setup so that it can be used with browser testing as well<commit_after>from flask import Flask, g
from inspect import getmembers, isfunction
from happymongo import HapPyMongo
from config import config
from adminbp import bp as admin_bp
from mana... | |
aedde845b3af828053e56337719579b7808d13aa | onetime/views.py | onetime/views.py | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | Remove redirect_invalid_to option and use settings.LOGIN_URL instead. When redirect the user, also forward the next parameter. | Remove redirect_invalid_to option and use settings.LOGIN_URL instead.
When redirect the user, also forward the next parameter.
| Python | agpl-3.0 | ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,fajran/django-loginurl,vanschelven/cmsplugin-journal,ISIFoundation/influenzanet-website,uploadcare/django-loginurl,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-website,ISIFoundation/influenzanet-web... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | <commit_before>from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', c... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', content_type='te... | <commit_before>from datetime import datetime
from django.http import HttpResponse, HttpResponseRedirect, HttpResponseGone
from django.contrib import auth
from django.conf import settings
from onetime import utils
from onetime.models import Key
def cleanup(request):
utils.cleanup()
return HttpResponse('ok', c... |
8f34d5a5dd0b7f774d452c75065b64d4c28d4082 | ObjectTracking/testThreading.py | ObjectTracking/testThreading.py | import threading
def affiche(nb, nom = ''):
for i in range(nb): print nom, i
a = threading.Thread(None, affiche, None, (200,), {'nom':'thread a'})
b = threading.Thread(None, affiche, None, (200,), {'nom':'thread b'})
a.start()
b.start()
| Add a test for the threading mechanism | Add a test for the threading mechanism
| Python | mit | baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite,baptistelabat/robokite | Add a test for the threading mechanism | import threading
def affiche(nb, nom = ''):
for i in range(nb): print nom, i
a = threading.Thread(None, affiche, None, (200,), {'nom':'thread a'})
b = threading.Thread(None, affiche, None, (200,), {'nom':'thread b'})
a.start()
b.start()
| <commit_before><commit_msg>Add a test for the threading mechanism<commit_after> | import threading
def affiche(nb, nom = ''):
for i in range(nb): print nom, i
a = threading.Thread(None, affiche, None, (200,), {'nom':'thread a'})
b = threading.Thread(None, affiche, None, (200,), {'nom':'thread b'})
a.start()
b.start()
| Add a test for the threading mechanismimport threading
def affiche(nb, nom = ''):
for i in range(nb): print nom, i
a = threading.Thread(None, affiche, None, (200,), {'nom':'thread a'})
b = threading.Thread(None, affiche, None, (200,), {'nom':'thread b'})
a.start()
b.start()
| <commit_before><commit_msg>Add a test for the threading mechanism<commit_after>import threading
def affiche(nb, nom = ''):
for i in range(nb): print nom, i
a = threading.Thread(None, affiche, None, (200,), {'nom':'thread a'})
b = threading.Thread(None, affiche, None, (200,), {'nom':'thread b'})
a.start()
b.start(... | |
ae3150cb5c7d39da1a3b4cd70fdfb92d36b9ce57 | tests/float/cmath_fun.py | tests/float/cmath_fun.py | # test the functions imported from cmath
try:
from cmath import *
except ImportError:
print("SKIP")
import sys
sys.exit()
# make sure these constants exist in cmath
print("%.5g" % e)
print("%.5g" % pi)
test_values_non_zero = []
base_values = (0.0, 0.5, 1.23456, 10.)
for r in base_values:
for i in... | Add test for cmath module. | tests: Add test for cmath module.
| Python | mit | slzatz/micropython,hiway/micropython,kostyll/micropython,pozetroninc/micropython,jimkmc/micropython,dmazzella/micropython,tobbad/micropython,orionrobots/micropython,puuu/micropython,AriZuu/micropython,turbinenreiter/micropython,paul-xxx/micropython,warner83/micropython,matthewelse/micropython,puuu/micropython,trezor/mi... | tests: Add test for cmath module. | # test the functions imported from cmath
try:
from cmath import *
except ImportError:
print("SKIP")
import sys
sys.exit()
# make sure these constants exist in cmath
print("%.5g" % e)
print("%.5g" % pi)
test_values_non_zero = []
base_values = (0.0, 0.5, 1.23456, 10.)
for r in base_values:
for i in... | <commit_before><commit_msg>tests: Add test for cmath module.<commit_after> | # test the functions imported from cmath
try:
from cmath import *
except ImportError:
print("SKIP")
import sys
sys.exit()
# make sure these constants exist in cmath
print("%.5g" % e)
print("%.5g" % pi)
test_values_non_zero = []
base_values = (0.0, 0.5, 1.23456, 10.)
for r in base_values:
for i in... | tests: Add test for cmath module.# test the functions imported from cmath
try:
from cmath import *
except ImportError:
print("SKIP")
import sys
sys.exit()
# make sure these constants exist in cmath
print("%.5g" % e)
print("%.5g" % pi)
test_values_non_zero = []
base_values = (0.0, 0.5, 1.23456, 10.)
f... | <commit_before><commit_msg>tests: Add test for cmath module.<commit_after># test the functions imported from cmath
try:
from cmath import *
except ImportError:
print("SKIP")
import sys
sys.exit()
# make sure these constants exist in cmath
print("%.5g" % e)
print("%.5g" % pi)
test_values_non_zero = []... | |
db4d3a226dbebcb0a2cd89d02362293e2f80082e | bin/reset_analysis_database.py | bin/reset_analysis_database.py | from pymongo import MongoClient
import json
import sys
import emission.core.get_database as edb
from emission.tests import common
def purgeAnalysisData():
edb.get_analysis_timeseries_db().remove()
edb.get_common_place_db().remove()
edb.get_common_trip_db().remove()
edb.get_pipeline_state_db().remove()
if __na... | Reset the emisson state as well | Reset the emisson state as well
Similar to 96eff63790e28741f45f0875fe888687b803eb6e but for emission users.
Ideally this should only include the analysis_db, but we need the pipeline
info, and Josh created two extra collections for the common trips and common
places.
| Python | bsd-3-clause | sunil07t/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,sunil07t/e-mission-server,sunil07t/e-mission-server,e-mission/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,shankari/e-mission-server,e-mission/e-mission-server | Reset the emisson state as well
Similar to 96eff63790e28741f45f0875fe888687b803eb6e but for emission users.
Ideally this should only include the analysis_db, but we need the pipeline
info, and Josh created two extra collections for the common trips and common
places. | from pymongo import MongoClient
import json
import sys
import emission.core.get_database as edb
from emission.tests import common
def purgeAnalysisData():
edb.get_analysis_timeseries_db().remove()
edb.get_common_place_db().remove()
edb.get_common_trip_db().remove()
edb.get_pipeline_state_db().remove()
if __na... | <commit_before><commit_msg>Reset the emisson state as well
Similar to 96eff63790e28741f45f0875fe888687b803eb6e but for emission users.
Ideally this should only include the analysis_db, but we need the pipeline
info, and Josh created two extra collections for the common trips and common
places.<commit_after> | from pymongo import MongoClient
import json
import sys
import emission.core.get_database as edb
from emission.tests import common
def purgeAnalysisData():
edb.get_analysis_timeseries_db().remove()
edb.get_common_place_db().remove()
edb.get_common_trip_db().remove()
edb.get_pipeline_state_db().remove()
if __na... | Reset the emisson state as well
Similar to 96eff63790e28741f45f0875fe888687b803eb6e but for emission users.
Ideally this should only include the analysis_db, but we need the pipeline
info, and Josh created two extra collections for the common trips and common
places.from pymongo import MongoClient
import json
import s... | <commit_before><commit_msg>Reset the emisson state as well
Similar to 96eff63790e28741f45f0875fe888687b803eb6e but for emission users.
Ideally this should only include the analysis_db, but we need the pipeline
info, and Josh created two extra collections for the common trips and common
places.<commit_after>from pymong... | |
cc8fd9051e086fdf51d5ca5a20c85544a789fa22 | test/unit/qiprofile/test_imaging.py | test/unit/qiprofile/test_imaging.py | from datetime import datetime
from mongoengine import connect
from nose.tools import assert_equal
from qiprofile_rest_client.model.subject import Subject
from qipipe.qiprofile import imaging
from ...helpers.logging import logger
from ... import PROJECT
COLLECTION = 'Breast'
"""The test collection."""
SUBJECT = 1
"""T... | Add qiprofile imaging sync test case. | Add qiprofile imaging sync test case.
| Python | bsd-2-clause | ohsu-qin/qipipe | Add qiprofile imaging sync test case. | from datetime import datetime
from mongoengine import connect
from nose.tools import assert_equal
from qiprofile_rest_client.model.subject import Subject
from qipipe.qiprofile import imaging
from ...helpers.logging import logger
from ... import PROJECT
COLLECTION = 'Breast'
"""The test collection."""
SUBJECT = 1
"""T... | <commit_before><commit_msg>Add qiprofile imaging sync test case.<commit_after> | from datetime import datetime
from mongoengine import connect
from nose.tools import assert_equal
from qiprofile_rest_client.model.subject import Subject
from qipipe.qiprofile import imaging
from ...helpers.logging import logger
from ... import PROJECT
COLLECTION = 'Breast'
"""The test collection."""
SUBJECT = 1
"""T... | Add qiprofile imaging sync test case.from datetime import datetime
from mongoengine import connect
from nose.tools import assert_equal
from qiprofile_rest_client.model.subject import Subject
from qipipe.qiprofile import imaging
from ...helpers.logging import logger
from ... import PROJECT
COLLECTION = 'Breast'
"""The ... | <commit_before><commit_msg>Add qiprofile imaging sync test case.<commit_after>from datetime import datetime
from mongoengine import connect
from nose.tools import assert_equal
from qiprofile_rest_client.model.subject import Subject
from qipipe.qiprofile import imaging
from ...helpers.logging import logger
from ... impo... | |
0c124f11e9c22cc739b82e8b089f0b85af90de4c | src/python/tests/generators/test_purchasing_profile_generator.py | src/python/tests/generators/test_purchasing_profile_generator.py | import unittest
from algorithms.markovmodel import MarkovModel
from algorithms.markovmodel import MarkovModelBuilder
from generators.purchasing_profile_generator import PurchasingProfileBuilder
from datamodels.simulation_models import PurchasingProfile
class TestPurchasingProfileBuilder(unittest.TestCase):
def ... | Add first tests for PurchasingProfileBuilder and stubs for PurchasingProfileGenerator and ProductCategoryMarkovModelGenerator | Add first tests for PurchasingProfileBuilder and stubs for PurchasingProfileGenerator and ProductCategoryMarkovModelGenerator
| Python | apache-2.0 | rnowling/bigpetstore-data-generator,rnowling/bigpetstore-data-generator,rnowling/bigpetstore-data-generator | Add first tests for PurchasingProfileBuilder and stubs for PurchasingProfileGenerator and ProductCategoryMarkovModelGenerator | import unittest
from algorithms.markovmodel import MarkovModel
from algorithms.markovmodel import MarkovModelBuilder
from generators.purchasing_profile_generator import PurchasingProfileBuilder
from datamodels.simulation_models import PurchasingProfile
class TestPurchasingProfileBuilder(unittest.TestCase):
def ... | <commit_before><commit_msg>Add first tests for PurchasingProfileBuilder and stubs for PurchasingProfileGenerator and ProductCategoryMarkovModelGenerator<commit_after> | import unittest
from algorithms.markovmodel import MarkovModel
from algorithms.markovmodel import MarkovModelBuilder
from generators.purchasing_profile_generator import PurchasingProfileBuilder
from datamodels.simulation_models import PurchasingProfile
class TestPurchasingProfileBuilder(unittest.TestCase):
def ... | Add first tests for PurchasingProfileBuilder and stubs for PurchasingProfileGenerator and ProductCategoryMarkovModelGeneratorimport unittest
from algorithms.markovmodel import MarkovModel
from algorithms.markovmodel import MarkovModelBuilder
from generators.purchasing_profile_generator import PurchasingProfileBuilder... | <commit_before><commit_msg>Add first tests for PurchasingProfileBuilder and stubs for PurchasingProfileGenerator and ProductCategoryMarkovModelGenerator<commit_after>import unittest
from algorithms.markovmodel import MarkovModel
from algorithms.markovmodel import MarkovModelBuilder
from generators.purchasing_profile_... | |
f2b61a1ce6f73618e66709868fe41dc8f6e99bdb | calc_renpass_gis/scenario_reader/csv_parser.py | calc_renpass_gis/scenario_reader/csv_parser.py | from db import LinearTransformer, Source, Sink, Scenario, Storage, session
import pandas as pd
def asfloat(x):
try:
# do not convert boolean
return float(x) if not isinstance(x, bool) else x
except ValueError:
return x
# path to scenario
path = '~/oemof/examples/solph/nodes_from_csv/s... | Add script file reading csv sc files writing to db | Add script file reading csv sc files writing to db
| Python | agpl-3.0 | openego/data_processing | Add script file reading csv sc files writing to db | from db import LinearTransformer, Source, Sink, Scenario, Storage, session
import pandas as pd
def asfloat(x):
try:
# do not convert boolean
return float(x) if not isinstance(x, bool) else x
except ValueError:
return x
# path to scenario
path = '~/oemof/examples/solph/nodes_from_csv/s... | <commit_before><commit_msg>Add script file reading csv sc files writing to db<commit_after> | from db import LinearTransformer, Source, Sink, Scenario, Storage, session
import pandas as pd
def asfloat(x):
try:
# do not convert boolean
return float(x) if not isinstance(x, bool) else x
except ValueError:
return x
# path to scenario
path = '~/oemof/examples/solph/nodes_from_csv/s... | Add script file reading csv sc files writing to dbfrom db import LinearTransformer, Source, Sink, Scenario, Storage, session
import pandas as pd
def asfloat(x):
try:
# do not convert boolean
return float(x) if not isinstance(x, bool) else x
except ValueError:
return x
# path to scenar... | <commit_before><commit_msg>Add script file reading csv sc files writing to db<commit_after>from db import LinearTransformer, Source, Sink, Scenario, Storage, session
import pandas as pd
def asfloat(x):
try:
# do not convert boolean
return float(x) if not isinstance(x, bool) else x
except Value... | |
ce131fc380d8717ade6058e5dd8e65b3ce4e0a7d | bin/gftools-drop-hints.py | bin/gftools-drop-hints.py | #!/usr/bin/env python3
#
# Copyright 2014 Google Inc. All rights reserved.
# Copyright 2021 The Google Font Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | Add drop hints script from Noto | Add drop hints script from Noto
| Python | apache-2.0 | googlefonts/gftools,googlefonts/gftools | Add drop hints script from Noto | #!/usr/bin/env python3
#
# Copyright 2014 Google Inc. All rights reserved.
# Copyright 2021 The Google Font Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | <commit_before><commit_msg>Add drop hints script from Noto<commit_after> | #!/usr/bin/env python3
#
# Copyright 2014 Google Inc. All rights reserved.
# Copyright 2021 The Google Font Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apa... | Add drop hints script from Noto#!/usr/bin/env python3
#
# Copyright 2014 Google Inc. All rights reserved.
# Copyright 2021 The Google Font Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the L... | <commit_before><commit_msg>Add drop hints script from Noto<commit_after>#!/usr/bin/env python3
#
# Copyright 2014 Google Inc. All rights reserved.
# Copyright 2021 The Google Font Tools Authors
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the ... | |
c6739998b3ffe9cc76eee1788fe1d5219daf2b5f | superdesk/macros/take_key_validator.py | superdesk/macros/take_key_validator.py | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
def validat... | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
def validat... | Remove take key validator macro | [SD-4784] Remove take key validator macro
| Python | agpl-3.0 | nistormihai/superdesk-core,superdesk/superdesk-core,ancafarcas/superdesk-core,superdesk/superdesk-core,mugurrus/superdesk-core,hlmnrmr/superdesk-core,hlmnrmr/superdesk-core,mugurrus/superdesk-core,petrjasek/superdesk-core,petrjasek/superdesk-core,marwoodandrew/superdesk-core,nistormihai/superdesk-core,ancafarcas/superd... | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
def validat... | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
def validat... | <commit_before># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/licens... | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
def validat... | # -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/license
def validat... | <commit_before># -*- coding: utf-8; -*-
#
# This file is part of Superdesk.
#
# Copyright 2013, 2014 Sourcefabric z.u. and contributors.
#
# For the full copyright and license information, please see the
# AUTHORS and LICENSE files distributed with this source code, or
# at https://www.sourcefabric.org/superdesk/licens... |
25692e7b89c6c3e79f608f5bfca98d6b58825874 | TWLight/users/migrations/0062_delete_hanging_userless_bundle_auths.py | TWLight/users/migrations/0062_delete_hanging_userless_bundle_auths.py | from django.db import migrations
def delete_hanging_bundle_auths(apps, schema_editor):
Authorization = apps.get_model("users", "Authorization")
Authorization.objects.filter(
user=None,
partners__authorization_method=3, # using the actual number of Partner.BUNDLE
).distinct() # distinct()... | Add migration to delete hanging bundle auths | Add migration to delete hanging bundle auths
| Python | mit | WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight,WikipediaLibrary/TWLight | Add migration to delete hanging bundle auths | from django.db import migrations
def delete_hanging_bundle_auths(apps, schema_editor):
Authorization = apps.get_model("users", "Authorization")
Authorization.objects.filter(
user=None,
partners__authorization_method=3, # using the actual number of Partner.BUNDLE
).distinct() # distinct()... | <commit_before><commit_msg>Add migration to delete hanging bundle auths<commit_after> | from django.db import migrations
def delete_hanging_bundle_auths(apps, schema_editor):
Authorization = apps.get_model("users", "Authorization")
Authorization.objects.filter(
user=None,
partners__authorization_method=3, # using the actual number of Partner.BUNDLE
).distinct() # distinct()... | Add migration to delete hanging bundle authsfrom django.db import migrations
def delete_hanging_bundle_auths(apps, schema_editor):
Authorization = apps.get_model("users", "Authorization")
Authorization.objects.filter(
user=None,
partners__authorization_method=3, # using the actual number of P... | <commit_before><commit_msg>Add migration to delete hanging bundle auths<commit_after>from django.db import migrations
def delete_hanging_bundle_auths(apps, schema_editor):
Authorization = apps.get_model("users", "Authorization")
Authorization.objects.filter(
user=None,
partners__authorization_... | |
cb5ec479fbe4bc70b2501d1ab885c9d0a7d26567 | betty/cropper/management/commands/make_disk_storage_paths_absolute.py | betty/cropper/management/commands/make_disk_storage_paths_absolute.py | from optparse import make_option
import os.path
from betty.conf.app import settings
from django.core.management.base import BaseCommand
from betty.cropper.models import Image
class Command(BaseCommand):
help = 'Convert disk storage relative paths to absolute'
# This needs to run on Django 1.7
option_li... | Add script to migrate relative disk paths to absolute | Add script to migrate relative disk paths to absolute
Previously disk paths were relative to BETTY_IMAGE_ROOT/MEDIA_ROOT, now they absolute.
| Python | mit | theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper,theonion/betty-cropper | Add script to migrate relative disk paths to absolute
Previously disk paths were relative to BETTY_IMAGE_ROOT/MEDIA_ROOT, now they absolute. | from optparse import make_option
import os.path
from betty.conf.app import settings
from django.core.management.base import BaseCommand
from betty.cropper.models import Image
class Command(BaseCommand):
help = 'Convert disk storage relative paths to absolute'
# This needs to run on Django 1.7
option_li... | <commit_before><commit_msg>Add script to migrate relative disk paths to absolute
Previously disk paths were relative to BETTY_IMAGE_ROOT/MEDIA_ROOT, now they absolute.<commit_after> | from optparse import make_option
import os.path
from betty.conf.app import settings
from django.core.management.base import BaseCommand
from betty.cropper.models import Image
class Command(BaseCommand):
help = 'Convert disk storage relative paths to absolute'
# This needs to run on Django 1.7
option_li... | Add script to migrate relative disk paths to absolute
Previously disk paths were relative to BETTY_IMAGE_ROOT/MEDIA_ROOT, now they absolute.from optparse import make_option
import os.path
from betty.conf.app import settings
from django.core.management.base import BaseCommand
from betty.cropper.models import Image
... | <commit_before><commit_msg>Add script to migrate relative disk paths to absolute
Previously disk paths were relative to BETTY_IMAGE_ROOT/MEDIA_ROOT, now they absolute.<commit_after>from optparse import make_option
import os.path
from betty.conf.app import settings
from django.core.management.base import BaseCommand
... | |
0eb0fbb222d4e03257ffeab7c24a5fe9fcee14f1 | week4/tweepy_rest_api_models.py | week4/tweepy_rest_api_models.py | #!/usr/bin/env python
# encoding: utf-8
"""
Created by Robert Dempsey on 02/02/2016.
Example script showing how to use the Tweepy Python library to interact
with the Twitter REST API, using available models
Tweepy docs: http://tweepy.readthedocs.org/en/v3.5.0/
Twitter API docs: https://dev.twitter.com/rest/public
"... | Add an example script for using the REST API to get the 20 of a users' friends and their latest status. | Add an example script for using the REST API to get the 20 of a users' friends and their latest status.
Signed-off-by: Robert Dempsey <715b5a941e732be1613fdd9d94dfd8e50c02b187@gmail.com>
| Python | mit | rdempsey/web-scraping-data-mining-course,rdempsey/web-scraping-data-mining-course,rdempsey/web-scraping-data-mining-course | Add an example script for using the REST API to get the 20 of a users' friends and their latest status.
Signed-off-by: Robert Dempsey <715b5a941e732be1613fdd9d94dfd8e50c02b187@gmail.com> | #!/usr/bin/env python
# encoding: utf-8
"""
Created by Robert Dempsey on 02/02/2016.
Example script showing how to use the Tweepy Python library to interact
with the Twitter REST API, using available models
Tweepy docs: http://tweepy.readthedocs.org/en/v3.5.0/
Twitter API docs: https://dev.twitter.com/rest/public
"... | <commit_before><commit_msg>Add an example script for using the REST API to get the 20 of a users' friends and their latest status.
Signed-off-by: Robert Dempsey <715b5a941e732be1613fdd9d94dfd8e50c02b187@gmail.com><commit_after> | #!/usr/bin/env python
# encoding: utf-8
"""
Created by Robert Dempsey on 02/02/2016.
Example script showing how to use the Tweepy Python library to interact
with the Twitter REST API, using available models
Tweepy docs: http://tweepy.readthedocs.org/en/v3.5.0/
Twitter API docs: https://dev.twitter.com/rest/public
"... | Add an example script for using the REST API to get the 20 of a users' friends and their latest status.
Signed-off-by: Robert Dempsey <715b5a941e732be1613fdd9d94dfd8e50c02b187@gmail.com>#!/usr/bin/env python
# encoding: utf-8
"""
Created by Robert Dempsey on 02/02/2016.
Example script showing how to use the Tweepy P... | <commit_before><commit_msg>Add an example script for using the REST API to get the 20 of a users' friends and their latest status.
Signed-off-by: Robert Dempsey <715b5a941e732be1613fdd9d94dfd8e50c02b187@gmail.com><commit_after>#!/usr/bin/env python
# encoding: utf-8
"""
Created by Robert Dempsey on 02/02/2016.
Examp... | |
84e646f9bf94e50e0fcb344fa18beaaaafe4c1a2 | scripts/de-lit.py | scripts/de-lit.py | #!/usr/bin/env python -w
import itertools, re
def print_docs(docs_, outfp):
'''print out docs, skipping the hashes for leading/trailing blanks'''
blank = re.compile('^\s*$')
def blanks(lst):
return itertools.takewhile(lambda x: blank.match(x), lst)
def drop_blanks(lst):
return itertool... | Convert literate coffeescript in to regular coffeescript | Convert literate coffeescript in to regular coffeescript
| Python | unlicense | cporter/Random | Convert literate coffeescript in to regular coffeescript | #!/usr/bin/env python -w
import itertools, re
def print_docs(docs_, outfp):
'''print out docs, skipping the hashes for leading/trailing blanks'''
blank = re.compile('^\s*$')
def blanks(lst):
return itertools.takewhile(lambda x: blank.match(x), lst)
def drop_blanks(lst):
return itertool... | <commit_before><commit_msg>Convert literate coffeescript in to regular coffeescript<commit_after> | #!/usr/bin/env python -w
import itertools, re
def print_docs(docs_, outfp):
'''print out docs, skipping the hashes for leading/trailing blanks'''
blank = re.compile('^\s*$')
def blanks(lst):
return itertools.takewhile(lambda x: blank.match(x), lst)
def drop_blanks(lst):
return itertool... | Convert literate coffeescript in to regular coffeescript#!/usr/bin/env python -w
import itertools, re
def print_docs(docs_, outfp):
'''print out docs, skipping the hashes for leading/trailing blanks'''
blank = re.compile('^\s*$')
def blanks(lst):
return itertools.takewhile(lambda x: blank.match(x)... | <commit_before><commit_msg>Convert literate coffeescript in to regular coffeescript<commit_after>#!/usr/bin/env python -w
import itertools, re
def print_docs(docs_, outfp):
'''print out docs, skipping the hashes for leading/trailing blanks'''
blank = re.compile('^\s*$')
def blanks(lst):
return ite... | |
7b08257332d227f039849553402483a7b0c97a41 | test/packetdrop.py | test/packetdrop.py | import mpipe
import time
def echo(value):
time.sleep(0.125)
print(value)
return True
pipe2 = mpipe.Pipeline(mpipe.OrderedStage(echo))
class Filter(mpipe.OrderedWorker):
def __init__(self):
self.count = 0
def doTask(self, value):
if self.count == 0:
pipe2.put(value)
... | Add timeout test (packet drop scenario.) | Add timeout test (packet drop scenario.)
| Python | mit | vmlaker/mpipe | Add timeout test (packet drop scenario.) | import mpipe
import time
def echo(value):
time.sleep(0.125)
print(value)
return True
pipe2 = mpipe.Pipeline(mpipe.OrderedStage(echo))
class Filter(mpipe.OrderedWorker):
def __init__(self):
self.count = 0
def doTask(self, value):
if self.count == 0:
pipe2.put(value)
... | <commit_before><commit_msg>Add timeout test (packet drop scenario.)<commit_after> | import mpipe
import time
def echo(value):
time.sleep(0.125)
print(value)
return True
pipe2 = mpipe.Pipeline(mpipe.OrderedStage(echo))
class Filter(mpipe.OrderedWorker):
def __init__(self):
self.count = 0
def doTask(self, value):
if self.count == 0:
pipe2.put(value)
... | Add timeout test (packet drop scenario.)import mpipe
import time
def echo(value):
time.sleep(0.125)
print(value)
return True
pipe2 = mpipe.Pipeline(mpipe.OrderedStage(echo))
class Filter(mpipe.OrderedWorker):
def __init__(self):
self.count = 0
def doTask(self, value):
if self.co... | <commit_before><commit_msg>Add timeout test (packet drop scenario.)<commit_after>import mpipe
import time
def echo(value):
time.sleep(0.125)
print(value)
return True
pipe2 = mpipe.Pipeline(mpipe.OrderedStage(echo))
class Filter(mpipe.OrderedWorker):
def __init__(self):
self.count = 0
de... | |
2163fd238f01681dc101b5f3e06556ff21473597 | spacy/tests/gold/test_biluo.py | spacy/tests/gold/test_biluo.py | from __future__ import unicode_literals
from ...gold import biluo_tags_from_offsets
from ...vocab import Vocab
from ...tokens.doc import Doc
import pytest
@pytest.fixture
def vocab():
return Vocab()
def test_U(vocab):
orths_and_spaces = [('I', True), ('flew', True), ('to', True), ('London', False),
... | Add tests for entity->biluo transformation | Add tests for entity->biluo transformation
| Python | mit | recognai/spaCy,spacy-io/spaCy,raphael0202/spaCy,Gregory-Howard/spaCy,oroszgy/spaCy.hu,spacy-io/spaCy,raphael0202/spaCy,banglakit/spaCy,aikramer2/spaCy,banglakit/spaCy,aikramer2/spaCy,honnibal/spaCy,oroszgy/spaCy.hu,banglakit/spaCy,explosion/spaCy,recognai/spaCy,Gregory-Howard/spaCy,banglakit/spaCy,explosion/spaCy,rapha... | Add tests for entity->biluo transformation | from __future__ import unicode_literals
from ...gold import biluo_tags_from_offsets
from ...vocab import Vocab
from ...tokens.doc import Doc
import pytest
@pytest.fixture
def vocab():
return Vocab()
def test_U(vocab):
orths_and_spaces = [('I', True), ('flew', True), ('to', True), ('London', False),
... | <commit_before><commit_msg>Add tests for entity->biluo transformation<commit_after> | from __future__ import unicode_literals
from ...gold import biluo_tags_from_offsets
from ...vocab import Vocab
from ...tokens.doc import Doc
import pytest
@pytest.fixture
def vocab():
return Vocab()
def test_U(vocab):
orths_and_spaces = [('I', True), ('flew', True), ('to', True), ('London', False),
... | Add tests for entity->biluo transformationfrom __future__ import unicode_literals
from ...gold import biluo_tags_from_offsets
from ...vocab import Vocab
from ...tokens.doc import Doc
import pytest
@pytest.fixture
def vocab():
return Vocab()
def test_U(vocab):
orths_and_spaces = [('I', True), ('flew', True... | <commit_before><commit_msg>Add tests for entity->biluo transformation<commit_after>from __future__ import unicode_literals
from ...gold import biluo_tags_from_offsets
from ...vocab import Vocab
from ...tokens.doc import Doc
import pytest
@pytest.fixture
def vocab():
return Vocab()
def test_U(vocab):
orths... | |
a292fff44aff6eb4f971aff3ccf3d3871ec68836 | DataWrangling/CaseStudy/audit.py | DataWrangling/CaseStudy/audit.py | """
Your task in this exercise has two steps:
- audit the OSMFILE and change the variable 'mapping' to reflect the changes needed to fix
the unexpected street types to the appropriate ones in the expected list.
You have to add mappings only for the actual problems you find in this OSMFILE,
not a generalize... | Add a script which contains a function that takes a string with street name as an argument and should return the fixed name | feat: Add a script which contains a function that takes a string with street name as an argument and should return the fixed name
| Python | mit | aguijarro/DataSciencePython | feat: Add a script which contains a function that takes a string with street name as an argument and should return the fixed name | """
Your task in this exercise has two steps:
- audit the OSMFILE and change the variable 'mapping' to reflect the changes needed to fix
the unexpected street types to the appropriate ones in the expected list.
You have to add mappings only for the actual problems you find in this OSMFILE,
not a generalize... | <commit_before><commit_msg>feat: Add a script which contains a function that takes a string with street name as an argument and should return the fixed name<commit_after> | """
Your task in this exercise has two steps:
- audit the OSMFILE and change the variable 'mapping' to reflect the changes needed to fix
the unexpected street types to the appropriate ones in the expected list.
You have to add mappings only for the actual problems you find in this OSMFILE,
not a generalize... | feat: Add a script which contains a function that takes a string with street name as an argument and should return the fixed name"""
Your task in this exercise has two steps:
- audit the OSMFILE and change the variable 'mapping' to reflect the changes needed to fix
the unexpected street types to the appropriate on... | <commit_before><commit_msg>feat: Add a script which contains a function that takes a string with street name as an argument and should return the fixed name<commit_after>"""
Your task in this exercise has two steps:
- audit the OSMFILE and change the variable 'mapping' to reflect the changes needed to fix
the unex... | |
f28e4ac920454b34d6290959eba650702d08fd85 | examples/one_to_ninety_nine.py | examples/one_to_ninety_nine.py | #
# one_to_ninety_nine.py
#
# Copyright 2021, Paul McGuire
#
# Parser/evaluator for expressions of numbers as written out in words:
# - one
# - seven
# - twelve
# - twenty six
# - forty-two
#
# BNF:
# units ::= one | two | three | ... | nine
# teens ::= ten | eleven | twelve | ... | nineteen
# tens ::... | Add simplified 1-99 example, extracted from number_words.py | Add simplified 1-99 example, extracted from number_words.py
| Python | mit | pyparsing/pyparsing,pyparsing/pyparsing | Add simplified 1-99 example, extracted from number_words.py | #
# one_to_ninety_nine.py
#
# Copyright 2021, Paul McGuire
#
# Parser/evaluator for expressions of numbers as written out in words:
# - one
# - seven
# - twelve
# - twenty six
# - forty-two
#
# BNF:
# units ::= one | two | three | ... | nine
# teens ::= ten | eleven | twelve | ... | nineteen
# tens ::... | <commit_before><commit_msg>Add simplified 1-99 example, extracted from number_words.py<commit_after> | #
# one_to_ninety_nine.py
#
# Copyright 2021, Paul McGuire
#
# Parser/evaluator for expressions of numbers as written out in words:
# - one
# - seven
# - twelve
# - twenty six
# - forty-two
#
# BNF:
# units ::= one | two | three | ... | nine
# teens ::= ten | eleven | twelve | ... | nineteen
# tens ::... | Add simplified 1-99 example, extracted from number_words.py#
# one_to_ninety_nine.py
#
# Copyright 2021, Paul McGuire
#
# Parser/evaluator for expressions of numbers as written out in words:
# - one
# - seven
# - twelve
# - twenty six
# - forty-two
#
# BNF:
# units ::= one | two | three | ... | nine
# tee... | <commit_before><commit_msg>Add simplified 1-99 example, extracted from number_words.py<commit_after>#
# one_to_ninety_nine.py
#
# Copyright 2021, Paul McGuire
#
# Parser/evaluator for expressions of numbers as written out in words:
# - one
# - seven
# - twelve
# - twenty six
# - forty-two
#
# BNF:
# units ::=... | |
45bdbad2aac5aaf78ef12cb0ea87d7e5212939d3 | lab/disruptors/n9k_ip_block.py | lab/disruptors/n9k_ip_block.py | def start(context, log, args):
import time
duration = args['duration']
period = 20
n9k1_ip, n9k2_ip, _, _ = context.n9k_creds()
log.info('Blocking N9K IPs ({0},{1}) on controllers ...'.format(n9k1_ip, n9k2_ip))
start_time = time.time()
for controller in context.controllers():
cont... | Add n9k IP iptables block | Add n9k IP iptables block
Change-Id: Ife7168aebd5de6d017c48d3d7b6b1a0227c25f7c
| Python | apache-2.0 | CiscoSystems/os-sqe,CiscoSystems/os-sqe,CiscoSystems/os-sqe | Add n9k IP iptables block
Change-Id: Ife7168aebd5de6d017c48d3d7b6b1a0227c25f7c | def start(context, log, args):
import time
duration = args['duration']
period = 20
n9k1_ip, n9k2_ip, _, _ = context.n9k_creds()
log.info('Blocking N9K IPs ({0},{1}) on controllers ...'.format(n9k1_ip, n9k2_ip))
start_time = time.time()
for controller in context.controllers():
cont... | <commit_before><commit_msg>Add n9k IP iptables block
Change-Id: Ife7168aebd5de6d017c48d3d7b6b1a0227c25f7c<commit_after> | def start(context, log, args):
import time
duration = args['duration']
period = 20
n9k1_ip, n9k2_ip, _, _ = context.n9k_creds()
log.info('Blocking N9K IPs ({0},{1}) on controllers ...'.format(n9k1_ip, n9k2_ip))
start_time = time.time()
for controller in context.controllers():
cont... | Add n9k IP iptables block
Change-Id: Ife7168aebd5de6d017c48d3d7b6b1a0227c25f7cdef start(context, log, args):
import time
duration = args['duration']
period = 20
n9k1_ip, n9k2_ip, _, _ = context.n9k_creds()
log.info('Blocking N9K IPs ({0},{1}) on controllers ...'.format(n9k1_ip, n9k2_ip))
sta... | <commit_before><commit_msg>Add n9k IP iptables block
Change-Id: Ife7168aebd5de6d017c48d3d7b6b1a0227c25f7c<commit_after>def start(context, log, args):
import time
duration = args['duration']
period = 20
n9k1_ip, n9k2_ip, _, _ = context.n9k_creds()
log.info('Blocking N9K IPs ({0},{1}) on controller... | |
cc558a1dc03bb8dec058c80e74e5cbdca7641011 | features/tests/test_api.py | features/tests/test_api.py | from rest_framework.test import APITestCase
def has(d, key):
if d.get(key) is not None:
return True
else:
return False
class TestApi(APITestCase):
def test_root(self):
"""Test api root URL is accessible"""
request = self.client.get('/api/', format='json')
self.as... | Add tests for rest api | Add tests for rest api
| Python | mit | wkevina/feature-requests-app,wkevina/feature-requests-app,wkevina/feature-requests-app | Add tests for rest api | from rest_framework.test import APITestCase
def has(d, key):
if d.get(key) is not None:
return True
else:
return False
class TestApi(APITestCase):
def test_root(self):
"""Test api root URL is accessible"""
request = self.client.get('/api/', format='json')
self.as... | <commit_before><commit_msg>Add tests for rest api<commit_after> | from rest_framework.test import APITestCase
def has(d, key):
if d.get(key) is not None:
return True
else:
return False
class TestApi(APITestCase):
def test_root(self):
"""Test api root URL is accessible"""
request = self.client.get('/api/', format='json')
self.as... | Add tests for rest apifrom rest_framework.test import APITestCase
def has(d, key):
if d.get(key) is not None:
return True
else:
return False
class TestApi(APITestCase):
def test_root(self):
"""Test api root URL is accessible"""
request = self.client.get('/api/', format='j... | <commit_before><commit_msg>Add tests for rest api<commit_after>from rest_framework.test import APITestCase
def has(d, key):
if d.get(key) is not None:
return True
else:
return False
class TestApi(APITestCase):
def test_root(self):
"""Test api root URL is accessible"""
req... | |
1c91f8112988b81af7440fc6e15e03dafc9ff680 | share/management/commands/build_views.py | share/management/commands/build_views.py | from django.apps import apps
from django.core.management.base import BaseCommand
from django.db.migrations import Migration
from django.db.migrations import operations
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.st... | Add management command to generate SQL constraints for SHARE versioning | Add management command to generate SQL constraints for SHARE versioning
| Python | apache-2.0 | laurenbarker/SHARE,zamattiac/SHARE,laurenbarker/SHARE,zamattiac/SHARE,aaxelb/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE,laurenbarker/SHARE,CenterForOpenScience/SHARE,aaxelb/SHARE,CenterForOpenScience/SHARE,zamattiac/SHARE | Add management command to generate SQL constraints for SHARE versioning | from django.apps import apps
from django.core.management.base import BaseCommand
from django.db.migrations import Migration
from django.db.migrations import operations
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.st... | <commit_before><commit_msg>Add management command to generate SQL constraints for SHARE versioning<commit_after> | from django.apps import apps
from django.core.management.base import BaseCommand
from django.db.migrations import Migration
from django.db.migrations import operations
from django.db.migrations.autodetector import MigrationAutodetector
from django.db.migrations.loader import MigrationLoader
from django.db.migrations.st... | Add management command to generate SQL constraints for SHARE versioningfrom django.apps import apps
from django.core.management.base import BaseCommand
from django.db.migrations import Migration
from django.db.migrations import operations
from django.db.migrations.autodetector import MigrationAutodetector
from django.d... | <commit_before><commit_msg>Add management command to generate SQL constraints for SHARE versioning<commit_after>from django.apps import apps
from django.core.management.base import BaseCommand
from django.db.migrations import Migration
from django.db.migrations import operations
from django.db.migrations.autodetector i... | |
15e3c99f478596b93e022d8f917c8bc1774ddba1 | k8s/models/third_party_resource.py | k8s/models/third_party_resource.py | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class Version(Model):
name = Field(six.text_type)
value = Field(six.text_type)
class ThirdPartyResource(Model):
clas... | Create TPR when watching it and not present in cluster yet | Create TPR when watching it and not present in cluster yet
| Python | apache-2.0 | fiaas/k8s | Create TPR when watching it and not present in cluster yet | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class Version(Model):
name = Field(six.text_type)
value = Field(six.text_type)
class ThirdPartyResource(Model):
clas... | <commit_before><commit_msg>Create TPR when watching it and not present in cluster yet<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class Version(Model):
name = Field(six.text_type)
value = Field(six.text_type)
class ThirdPartyResource(Model):
clas... | Create TPR when watching it and not present in cluster yet#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class Version(Model):
name = Field(six.text_type)
value = Field(... | <commit_before><commit_msg>Create TPR when watching it and not present in cluster yet<commit_after>#!/usr/bin/env python
# -*- coding: utf-8
from __future__ import absolute_import
import six
from .common import ObjectMeta
from ..base import Model
from ..fields import Field, ListField
class Version(Model):
name ... | |
26bcb00d983a08e1dbc38d78934d7b363d394544 | src/viewer/youtubedl_util.py | src/viewer/youtubedl_util.py | # vim: fileencoding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
import sys
import re
import subprocess as sp
from collections import namedtuple
import logging
logging.basicConfig(level=logging.DEBUG)
FORMAT_LINE_REGEX = re.compile(
r'(?P<id>\d+)' # unique id ... | Add wrapper functions for youtube-dl | Add wrapper functions for youtube-dl
| Python | mit | east825/youtube-dl-gui | Add wrapper functions for youtube-dl | # vim: fileencoding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
import sys
import re
import subprocess as sp
from collections import namedtuple
import logging
logging.basicConfig(level=logging.DEBUG)
FORMAT_LINE_REGEX = re.compile(
r'(?P<id>\d+)' # unique id ... | <commit_before><commit_msg>Add wrapper functions for youtube-dl<commit_after> | # vim: fileencoding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
import sys
import re
import subprocess as sp
from collections import namedtuple
import logging
logging.basicConfig(level=logging.DEBUG)
FORMAT_LINE_REGEX = re.compile(
r'(?P<id>\d+)' # unique id ... | Add wrapper functions for youtube-dl# vim: fileencoding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
import sys
import re
import subprocess as sp
from collections import namedtuple
import logging
logging.basicConfig(level=logging.DEBUG)
FORMAT_LINE_REGEX = re.compile(
r'(?... | <commit_before><commit_msg>Add wrapper functions for youtube-dl<commit_after># vim: fileencoding=utf-8
from __future__ import print_function
from __future__ import unicode_literals
import sys
import re
import subprocess as sp
from collections import namedtuple
import logging
logging.basicConfig(level=logging.DEBUG)
... | |
a03581a1f64596717a8e4656e285f543cf6b3b77 | scripts/test-param-activated.py | scripts/test-param-activated.py | #!/usr/bin/python3
from pathlib import Path
import re
import shlex
import json
tests_root_path = Path("./tests/regression")
# copied from options
activated_default = set([
"expRelation", "base", "threadid", "threadflag", "threadreturn",
"escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp",
... | Add script for finding tests with explicit ana.activated | Add script for finding tests with explicit ana.activated
| Python | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer | Add script for finding tests with explicit ana.activated | #!/usr/bin/python3
from pathlib import Path
import re
import shlex
import json
tests_root_path = Path("./tests/regression")
# copied from options
activated_default = set([
"expRelation", "base", "threadid", "threadflag", "threadreturn",
"escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp",
... | <commit_before><commit_msg>Add script for finding tests with explicit ana.activated<commit_after> | #!/usr/bin/python3
from pathlib import Path
import re
import shlex
import json
tests_root_path = Path("./tests/regression")
# copied from options
activated_default = set([
"expRelation", "base", "threadid", "threadflag", "threadreturn",
"escape", "mutexEvents", "mutex", "access", "mallocWrapper", "mhp",
... | Add script for finding tests with explicit ana.activated#!/usr/bin/python3
from pathlib import Path
import re
import shlex
import json
tests_root_path = Path("./tests/regression")
# copied from options
activated_default = set([
"expRelation", "base", "threadid", "threadflag", "threadreturn",
"escape", "mute... | <commit_before><commit_msg>Add script for finding tests with explicit ana.activated<commit_after>#!/usr/bin/python3
from pathlib import Path
import re
import shlex
import json
tests_root_path = Path("./tests/regression")
# copied from options
activated_default = set([
"expRelation", "base", "threadid", "threadf... | |
dc1e018a19c4bd55b10a65ab79ac4e2e1fdc95dc | makedist.py | makedist.py | """This tool sets up a distribution of the software by automating
several tasks that need to be done.
The directory should be in pristine condition when this is run (i.e.,
devoid of files that need to be removed before packaging begins). It
is best to run this on a fresh check out of the repository."""
import os
impo... | Add script to assist in packaging. | Add script to assist in packaging.
| Python | mit | davidalber/Geneagrapher,davidalber/Geneagrapher | Add script to assist in packaging. | """This tool sets up a distribution of the software by automating
several tasks that need to be done.
The directory should be in pristine condition when this is run (i.e.,
devoid of files that need to be removed before packaging begins). It
is best to run this on a fresh check out of the repository."""
import os
impo... | <commit_before><commit_msg>Add script to assist in packaging.<commit_after> | """This tool sets up a distribution of the software by automating
several tasks that need to be done.
The directory should be in pristine condition when this is run (i.e.,
devoid of files that need to be removed before packaging begins). It
is best to run this on a fresh check out of the repository."""
import os
impo... | Add script to assist in packaging."""This tool sets up a distribution of the software by automating
several tasks that need to be done.
The directory should be in pristine condition when this is run (i.e.,
devoid of files that need to be removed before packaging begins). It
is best to run this on a fresh check out of ... | <commit_before><commit_msg>Add script to assist in packaging.<commit_after>"""This tool sets up a distribution of the software by automating
several tasks that need to be done.
The directory should be in pristine condition when this is run (i.e.,
devoid of files that need to be removed before packaging begins). It
is ... | |
8582fd56109440e372215ed06617ae8e7e89f780 | flicks/base/middleware.py | flicks/base/middleware.py | class ExceptionLoggingMiddleware(object):
"""
Small middleware that logs exceptions to the console. Useful in local
development.
"""
def process_exception(self, request, exception):
import traceback
print traceback.format_exc()
| Add ExceptionLoggingMiddleware: Useful for debugging. | Add ExceptionLoggingMiddleware: Useful for debugging.
| Python | bsd-3-clause | mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks,mozilla/firefox-flicks | Add ExceptionLoggingMiddleware: Useful for debugging. | class ExceptionLoggingMiddleware(object):
"""
Small middleware that logs exceptions to the console. Useful in local
development.
"""
def process_exception(self, request, exception):
import traceback
print traceback.format_exc()
| <commit_before><commit_msg>Add ExceptionLoggingMiddleware: Useful for debugging.<commit_after> | class ExceptionLoggingMiddleware(object):
"""
Small middleware that logs exceptions to the console. Useful in local
development.
"""
def process_exception(self, request, exception):
import traceback
print traceback.format_exc()
| Add ExceptionLoggingMiddleware: Useful for debugging.class ExceptionLoggingMiddleware(object):
"""
Small middleware that logs exceptions to the console. Useful in local
development.
"""
def process_exception(self, request, exception):
import traceback
print traceback.format_exc()
| <commit_before><commit_msg>Add ExceptionLoggingMiddleware: Useful for debugging.<commit_after>class ExceptionLoggingMiddleware(object):
"""
Small middleware that logs exceptions to the console. Useful in local
development.
"""
def process_exception(self, request, exception):
import traceback... | |
26e39ca1cdf894bfcecff16344987b6ae7cf638a | scripts/call_pods.py | scripts/call_pods.py | #!/bin/env python
## Utils script to call a list of pods
import subprocess
pods = open('/tmp/pods.txt', 'r')
for pod in pods:
print pod.strip('\n\r')
subprocess.call('wget http://pods.jasonrobinson.me/register/'+pod.strip('\n\r')+' -O /dev/null', shell=True)
| Add a little script to register a list of pods | Add a little script to register a list of pods
| Python | agpl-3.0 | jaywink/the-federation.info,jaywink/the-federation.info,Flaburgan/diaspora-hub,jaywink/diaspora-hub,jaywink/the-federation.info,jaywink/diaspora-hub,Flaburgan/the-federation.info,Flaburgan/diaspora-hub,jaywink/diaspora-hub,Flaburgan/the-federation.info,Flaburgan/the-federation.info,Flaburgan/diaspora-hub,Flaburgan/the-... | Add a little script to register a list of pods | #!/bin/env python
## Utils script to call a list of pods
import subprocess
pods = open('/tmp/pods.txt', 'r')
for pod in pods:
print pod.strip('\n\r')
subprocess.call('wget http://pods.jasonrobinson.me/register/'+pod.strip('\n\r')+' -O /dev/null', shell=True)
| <commit_before><commit_msg>Add a little script to register a list of pods<commit_after> | #!/bin/env python
## Utils script to call a list of pods
import subprocess
pods = open('/tmp/pods.txt', 'r')
for pod in pods:
print pod.strip('\n\r')
subprocess.call('wget http://pods.jasonrobinson.me/register/'+pod.strip('\n\r')+' -O /dev/null', shell=True)
| Add a little script to register a list of pods#!/bin/env python
## Utils script to call a list of pods
import subprocess
pods = open('/tmp/pods.txt', 'r')
for pod in pods:
print pod.strip('\n\r')
subprocess.call('wget http://pods.jasonrobinson.me/register/'+pod.strip('\n\r')+' -O /dev/null', shell=True)
... | <commit_before><commit_msg>Add a little script to register a list of pods<commit_after>#!/bin/env python
## Utils script to call a list of pods
import subprocess
pods = open('/tmp/pods.txt', 'r')
for pod in pods:
print pod.strip('\n\r')
subprocess.call('wget http://pods.jasonrobinson.me/register/'+pod.strip('... | |
dd07e43e9bf326ec12b34796d6b1c2b2c802f53b | stores/fields.py | stores/fields.py | class Point(object):
def __init__(self, x, y=None):
"""
The Point object may be initialized with either a tuple, or individual
parameters.
For Example:
>>> p = Point((5, 23)) # 2D point, passed in as a tuple
"""
if isinstance(x, (tuple, list)):
#... | Add Point class based on GEOS package | Add Point class based on GEOS package
| Python | bsd-3-clause | django-oscar/django-oscar-stores,django-oscar/django-oscar-stores,django-oscar/django-oscar-stores | Add Point class based on GEOS package | class Point(object):
def __init__(self, x, y=None):
"""
The Point object may be initialized with either a tuple, or individual
parameters.
For Example:
>>> p = Point((5, 23)) # 2D point, passed in as a tuple
"""
if isinstance(x, (tuple, list)):
#... | <commit_before><commit_msg>Add Point class based on GEOS package<commit_after> | class Point(object):
def __init__(self, x, y=None):
"""
The Point object may be initialized with either a tuple, or individual
parameters.
For Example:
>>> p = Point((5, 23)) # 2D point, passed in as a tuple
"""
if isinstance(x, (tuple, list)):
#... | Add Point class based on GEOS packageclass Point(object):
def __init__(self, x, y=None):
"""
The Point object may be initialized with either a tuple, or individual
parameters.
For Example:
>>> p = Point((5, 23)) # 2D point, passed in as a tuple
"""
if isinst... | <commit_before><commit_msg>Add Point class based on GEOS package<commit_after>class Point(object):
def __init__(self, x, y=None):
"""
The Point object may be initialized with either a tuple, or individual
parameters.
For Example:
>>> p = Point((5, 23)) # 2D point, passed in... | |
cbe1889e2c575e91488d29e757eb8c2cad155ce4 | testGPIO.py | testGPIO.py | import RPi.GPIO as GPIO
class Test:
# Mapping
PINS = {2,3,4,14,15,17,18,27,22,23,24,10,9,25,11,8,7,5,6,12,13,19,16,26,20,21}
def __init__(self):
## Attach a callback to each INPUT pin
for pin in self.PINS.items():
print("Attaching pin GPIO%s ..." % pin )
GPIO.setup(pin, GPIO.IN, pull_up_d... | Add a test script for GPIOs | Add a test script for GPIOs
| Python | mit | tchapi/pianette,tchapi/pianette,tchapi/pianette,tchapi/pianette | Add a test script for GPIOs | import RPi.GPIO as GPIO
class Test:
# Mapping
PINS = {2,3,4,14,15,17,18,27,22,23,24,10,9,25,11,8,7,5,6,12,13,19,16,26,20,21}
def __init__(self):
## Attach a callback to each INPUT pin
for pin in self.PINS.items():
print("Attaching pin GPIO%s ..." % pin )
GPIO.setup(pin, GPIO.IN, pull_up_d... | <commit_before><commit_msg>Add a test script for GPIOs<commit_after> | import RPi.GPIO as GPIO
class Test:
# Mapping
PINS = {2,3,4,14,15,17,18,27,22,23,24,10,9,25,11,8,7,5,6,12,13,19,16,26,20,21}
def __init__(self):
## Attach a callback to each INPUT pin
for pin in self.PINS.items():
print("Attaching pin GPIO%s ..." % pin )
GPIO.setup(pin, GPIO.IN, pull_up_d... | Add a test script for GPIOsimport RPi.GPIO as GPIO
class Test:
# Mapping
PINS = {2,3,4,14,15,17,18,27,22,23,24,10,9,25,11,8,7,5,6,12,13,19,16,26,20,21}
def __init__(self):
## Attach a callback to each INPUT pin
for pin in self.PINS.items():
print("Attaching pin GPIO%s ..." % pin )
GPIO.se... | <commit_before><commit_msg>Add a test script for GPIOs<commit_after>import RPi.GPIO as GPIO
class Test:
# Mapping
PINS = {2,3,4,14,15,17,18,27,22,23,24,10,9,25,11,8,7,5,6,12,13,19,16,26,20,21}
def __init__(self):
## Attach a callback to each INPUT pin
for pin in self.PINS.items():
print("Attach... | |
9fc0733d5a38b7e72855784e9b6819a692dfee2a | run2015.py | run2015.py | #!/usr/bin/python
from __future__ import print_function, unicode_literals
from os import chdir, getcwd, getenv
from subprocess import call
PYTHON = getenv('PYTHON', 'python')
FC = getenv('FC', 'gfortran')
DIR = getenv('DIR', './advent2015')
puzzles = ['01', '02']
print('----------------------------------------------... | Add a script to run all of the programs | Add a script to run all of the programs
| Python | mit | rnelson/adventofcode,rnelson/adventofcode,rnelson/adventofcode,rnelson/adventofcode | Add a script to run all of the programs | #!/usr/bin/python
from __future__ import print_function, unicode_literals
from os import chdir, getcwd, getenv
from subprocess import call
PYTHON = getenv('PYTHON', 'python')
FC = getenv('FC', 'gfortran')
DIR = getenv('DIR', './advent2015')
puzzles = ['01', '02']
print('----------------------------------------------... | <commit_before><commit_msg>Add a script to run all of the programs<commit_after> | #!/usr/bin/python
from __future__ import print_function, unicode_literals
from os import chdir, getcwd, getenv
from subprocess import call
PYTHON = getenv('PYTHON', 'python')
FC = getenv('FC', 'gfortran')
DIR = getenv('DIR', './advent2015')
puzzles = ['01', '02']
print('----------------------------------------------... | Add a script to run all of the programs#!/usr/bin/python
from __future__ import print_function, unicode_literals
from os import chdir, getcwd, getenv
from subprocess import call
PYTHON = getenv('PYTHON', 'python')
FC = getenv('FC', 'gfortran')
DIR = getenv('DIR', './advent2015')
puzzles = ['01', '02']
print('-------... | <commit_before><commit_msg>Add a script to run all of the programs<commit_after>#!/usr/bin/python
from __future__ import print_function, unicode_literals
from os import chdir, getcwd, getenv
from subprocess import call
PYTHON = getenv('PYTHON', 'python')
FC = getenv('FC', 'gfortran')
DIR = getenv('DIR', './advent2015'... | |
854cebe95c74afaba88ce32026e33fef8072f73f | cuse-maru/mix/gui/cuse-mixgui.py | cuse-maru/mix/gui/cuse-mixgui.py | #!/usr/bin/env python
from gi.repository import Gtk, GObject
import socket, os, sys
class Connection:
def __init__(self, sock):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.connect(sock)
def set_volume(self, stream, vol):
command = "SETPLAYVOL {} {}".format(stream, ... | Add simple Python GUI to control volume. | Add simple Python GUI to control volume.
| Python | lgpl-2.1 | Themaister/libmaru,Themaister/libmaru | Add simple Python GUI to control volume. | #!/usr/bin/env python
from gi.repository import Gtk, GObject
import socket, os, sys
class Connection:
def __init__(self, sock):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.connect(sock)
def set_volume(self, stream, vol):
command = "SETPLAYVOL {} {}".format(stream, ... | <commit_before><commit_msg>Add simple Python GUI to control volume.<commit_after> | #!/usr/bin/env python
from gi.repository import Gtk, GObject
import socket, os, sys
class Connection:
def __init__(self, sock):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.connect(sock)
def set_volume(self, stream, vol):
command = "SETPLAYVOL {} {}".format(stream, ... | Add simple Python GUI to control volume.#!/usr/bin/env python
from gi.repository import Gtk, GObject
import socket, os, sys
class Connection:
def __init__(self, sock):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.connect(sock)
def set_volume(self, stream, vol):
comm... | <commit_before><commit_msg>Add simple Python GUI to control volume.<commit_after>#!/usr/bin/env python
from gi.repository import Gtk, GObject
import socket, os, sys
class Connection:
def __init__(self, sock):
self.sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
self.sock.connect(sock)
def ... | |
95b71b9b832b3ccf9315f430f753cf133d6621a2 | tests/conftest.py | tests/conftest.py | """Configuration module for pytests"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from pytest import yield_fixture
from requests_mock import M... | Add a fixture that yields a requests Mocker() object. | Add a fixture that yields a requests Mocker() object.
| Python | mit | openspending/gobble | Add a fixture that yields a requests Mocker() object. | """Configuration module for pytests"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from pytest import yield_fixture
from requests_mock import M... | <commit_before><commit_msg>Add a fixture that yields a requests Mocker() object.<commit_after> | """Configuration module for pytests"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from pytest import yield_fixture
from requests_mock import M... | Add a fixture that yields a requests Mocker() object."""Configuration module for pytests"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
standard_library.install_aliases()
from py... | <commit_before><commit_msg>Add a fixture that yields a requests Mocker() object.<commit_after>"""Configuration module for pytests"""
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
from __future__ import absolute_import
from future import standard_library
st... | |
071157e5a752252a7864d5b0ad85fe4c364c1aec | solutions/uri/1022/1022.py | solutions/uri/1022/1022.py | import sys
n = int(sys.stdin.readline())
for _ in range(n):
a, _, b, o, c, _, d = sys.stdin.readline().split()
a, b, c, d = map(int, [a, b, c, d])
if o == "+":
num = (b * d) * a // b + (b * d) * c // d
den = b * d
elif o == "-":
num = (b * d) * a // b - (b * d) * c // d
... | Solve TDA Rational in python | Solve TDA Rational in python
| Python | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | Solve TDA Rational in python | import sys
n = int(sys.stdin.readline())
for _ in range(n):
a, _, b, o, c, _, d = sys.stdin.readline().split()
a, b, c, d = map(int, [a, b, c, d])
if o == "+":
num = (b * d) * a // b + (b * d) * c // d
den = b * d
elif o == "-":
num = (b * d) * a // b - (b * d) * c // d
... | <commit_before><commit_msg>Solve TDA Rational in python<commit_after> | import sys
n = int(sys.stdin.readline())
for _ in range(n):
a, _, b, o, c, _, d = sys.stdin.readline().split()
a, b, c, d = map(int, [a, b, c, d])
if o == "+":
num = (b * d) * a // b + (b * d) * c // d
den = b * d
elif o == "-":
num = (b * d) * a // b - (b * d) * c // d
... | Solve TDA Rational in pythonimport sys
n = int(sys.stdin.readline())
for _ in range(n):
a, _, b, o, c, _, d = sys.stdin.readline().split()
a, b, c, d = map(int, [a, b, c, d])
if o == "+":
num = (b * d) * a // b + (b * d) * c // d
den = b * d
elif o == "-":
num = (b * d) * a //... | <commit_before><commit_msg>Solve TDA Rational in python<commit_after>import sys
n = int(sys.stdin.readline())
for _ in range(n):
a, _, b, o, c, _, d = sys.stdin.readline().split()
a, b, c, d = map(int, [a, b, c, d])
if o == "+":
num = (b * d) * a // b + (b * d) * c // d
den = b * d
el... | |
4938e7e66d187a375db24832c0bfdba79687756e | accelerator/migrations/0003_auto_20180410_1618.py | accelerator/migrations/0003_auto_20180410_1618.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-10 20:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0002_add_mc_permissions'),
]
operations = [
migrations.Alter... | Add Migration For Office Hours Locations | Add Migration For Office Hours Locations
| Python | mit | masschallenge/django-accelerator,masschallenge/django-accelerator | Add Migration For Office Hours Locations | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-10 20:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0002_add_mc_permissions'),
]
operations = [
migrations.Alter... | <commit_before><commit_msg>Add Migration For Office Hours Locations<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-10 20:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0002_add_mc_permissions'),
]
operations = [
migrations.Alter... | Add Migration For Office Hours Locations# -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-10 20:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0002_add_mc_permissions'),
]
... | <commit_before><commit_msg>Add Migration For Office Hours Locations<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.10.8 on 2018-04-10 20:18
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('accelerator... | |
5c65c8f371b253df3e861e1d998d0a174eed3f97 | tests/test_tag.py | tests/test_tag.py |
from io import BytesIO
import pytest
from nbtlib.tag import *
tag_parsing_inputs = [
# Byte tag
(b'\x00', Byte(0)),
(b'\xFF', Byte(-1)),
(b'\x7F', Byte(127)),
(b'\x80', Byte(-128)),
# Short tag
(b'\x00\x00', Short(0)),
(b'\xFF\xFF', Short(-1)),
(b'\x7F\xFF',... | Create tests for tag parsing | Create tests for tag parsing
| Python | mit | vberlier/nbtlib | Create tests for tag parsing |
from io import BytesIO
import pytest
from nbtlib.tag import *
tag_parsing_inputs = [
# Byte tag
(b'\x00', Byte(0)),
(b'\xFF', Byte(-1)),
(b'\x7F', Byte(127)),
(b'\x80', Byte(-128)),
# Short tag
(b'\x00\x00', Short(0)),
(b'\xFF\xFF', Short(-1)),
(b'\x7F\xFF',... | <commit_before><commit_msg>Create tests for tag parsing<commit_after> |
from io import BytesIO
import pytest
from nbtlib.tag import *
tag_parsing_inputs = [
# Byte tag
(b'\x00', Byte(0)),
(b'\xFF', Byte(-1)),
(b'\x7F', Byte(127)),
(b'\x80', Byte(-128)),
# Short tag
(b'\x00\x00', Short(0)),
(b'\xFF\xFF', Short(-1)),
(b'\x7F\xFF',... | Create tests for tag parsing
from io import BytesIO
import pytest
from nbtlib.tag import *
tag_parsing_inputs = [
# Byte tag
(b'\x00', Byte(0)),
(b'\xFF', Byte(-1)),
(b'\x7F', Byte(127)),
(b'\x80', Byte(-128)),
# Short tag
(b'\x00\x00', Short(0)),
(b'\xFF\xFF', Sh... | <commit_before><commit_msg>Create tests for tag parsing<commit_after>
from io import BytesIO
import pytest
from nbtlib.tag import *
tag_parsing_inputs = [
# Byte tag
(b'\x00', Byte(0)),
(b'\xFF', Byte(-1)),
(b'\x7F', Byte(127)),
(b'\x80', Byte(-128)),
# Short tag
(b'\x... | |
52ab8b2f492b3c7d36b240f577f51e3120fd1302 | src/ec2.py | src/ec2.py | import sys
import json
from subprocess import check_output
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, tostring
from xml.dom import minidom
def create_item(attrs, contents):
item = Element('item')
for k in attrs: item.set(k, attrs[k])
for k in contents:
content = E... | Add a script to search EC2 instances by instance ID | Add a script to search EC2 instances by instance ID
| Python | mit | saidie/alfred-aws | Add a script to search EC2 instances by instance ID | import sys
import json
from subprocess import check_output
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, tostring
from xml.dom import minidom
def create_item(attrs, contents):
item = Element('item')
for k in attrs: item.set(k, attrs[k])
for k in contents:
content = E... | <commit_before><commit_msg>Add a script to search EC2 instances by instance ID<commit_after> | import sys
import json
from subprocess import check_output
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, tostring
from xml.dom import minidom
def create_item(attrs, contents):
item = Element('item')
for k in attrs: item.set(k, attrs[k])
for k in contents:
content = E... | Add a script to search EC2 instances by instance IDimport sys
import json
from subprocess import check_output
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, tostring
from xml.dom import minidom
def create_item(attrs, contents):
item = Element('item')
for k in attrs: item.set(k, a... | <commit_before><commit_msg>Add a script to search EC2 instances by instance ID<commit_after>import sys
import json
from subprocess import check_output
from xml.etree import ElementTree
from xml.etree.ElementTree import Element, tostring
from xml.dom import minidom
def create_item(attrs, contents):
item = Element(... | |
086fb81110aeaf2cf16e32e8c9468e7ec06042c4 | future/builtins/backports/newopen.py | future/builtins/backports/newopen.py | class open(object):
"""Wrapper providing key part of Python 3 open() interface.
From IPython's py3compat.py module. License: BSD.
"""
def __init__(self, fname, mode="r", encoding="utf-8"):
self.f = orig_open(fname, mode)
self.enc = encoding
def write(self, s):
return self.f... | Add partial backport of Python 3's open() interface | Add partial backport of Python 3's open() interface
| Python | mit | krischer/python-future,QuLogic/python-future,krischer/python-future,PythonCharmers/python-future,QuLogic/python-future,PythonCharmers/python-future,michaelpacer/python-future,michaelpacer/python-future | Add partial backport of Python 3's open() interface | class open(object):
"""Wrapper providing key part of Python 3 open() interface.
From IPython's py3compat.py module. License: BSD.
"""
def __init__(self, fname, mode="r", encoding="utf-8"):
self.f = orig_open(fname, mode)
self.enc = encoding
def write(self, s):
return self.f... | <commit_before><commit_msg>Add partial backport of Python 3's open() interface<commit_after> | class open(object):
"""Wrapper providing key part of Python 3 open() interface.
From IPython's py3compat.py module. License: BSD.
"""
def __init__(self, fname, mode="r", encoding="utf-8"):
self.f = orig_open(fname, mode)
self.enc = encoding
def write(self, s):
return self.f... | Add partial backport of Python 3's open() interfaceclass open(object):
"""Wrapper providing key part of Python 3 open() interface.
From IPython's py3compat.py module. License: BSD.
"""
def __init__(self, fname, mode="r", encoding="utf-8"):
self.f = orig_open(fname, mode)
self.enc = enco... | <commit_before><commit_msg>Add partial backport of Python 3's open() interface<commit_after>class open(object):
"""Wrapper providing key part of Python 3 open() interface.
From IPython's py3compat.py module. License: BSD.
"""
def __init__(self, fname, mode="r", encoding="utf-8"):
self.f = orig_... | |
f419dce0164d00a56a90fb34f19e2a8adecda584 | examples/raw_parameter_script.py | examples/raw_parameter_script.py | """ The main purpose of this file is to demonstrate running SeleniumBase
scripts without the use of Pytest by calling the script directly
with Python or from a Python interactive interpreter. Based on
whether relative imports work or don't work, it will autodetect
how this file was run. With pure Python... | Add an example script to demonstrate a run with pure Python | Add an example script to demonstrate a run with pure Python
| Python | mit | mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/seleniumspot,mdmintz/seleniumspot,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,seleniumbase/SeleniumBase | Add an example script to demonstrate a run with pure Python | """ The main purpose of this file is to demonstrate running SeleniumBase
scripts without the use of Pytest by calling the script directly
with Python or from a Python interactive interpreter. Based on
whether relative imports work or don't work, it will autodetect
how this file was run. With pure Python... | <commit_before><commit_msg>Add an example script to demonstrate a run with pure Python<commit_after> | """ The main purpose of this file is to demonstrate running SeleniumBase
scripts without the use of Pytest by calling the script directly
with Python or from a Python interactive interpreter. Based on
whether relative imports work or don't work, it will autodetect
how this file was run. With pure Python... | Add an example script to demonstrate a run with pure Python""" The main purpose of this file is to demonstrate running SeleniumBase
scripts without the use of Pytest by calling the script directly
with Python or from a Python interactive interpreter. Based on
whether relative imports work or don't work, it ... | <commit_before><commit_msg>Add an example script to demonstrate a run with pure Python<commit_after>""" The main purpose of this file is to demonstrate running SeleniumBase
scripts without the use of Pytest by calling the script directly
with Python or from a Python interactive interpreter. Based on
whether... | |
c39d60870e89e66df46f147a4917f00218b4ad01 | src/shared/game_state_change.py | src/shared/game_state_change.py | from abc import ABCMeta, abstractmethod
class GameStateChange(object):
__metaclass__ = ABCMeta
@abstractmethod
def apply(self, gameState):
pass
class ResourceChange(GameStateChange):
def __init__(self, playerId, delta):
super(ResourceChange, self).__init__()
self.playerId = p... | Add a class for representing changes to GameState. | Add a class for representing changes to GameState.
| Python | mit | CheeseLord/warts,CheeseLord/warts | Add a class for representing changes to GameState. | from abc import ABCMeta, abstractmethod
class GameStateChange(object):
__metaclass__ = ABCMeta
@abstractmethod
def apply(self, gameState):
pass
class ResourceChange(GameStateChange):
def __init__(self, playerId, delta):
super(ResourceChange, self).__init__()
self.playerId = p... | <commit_before><commit_msg>Add a class for representing changes to GameState.<commit_after> | from abc import ABCMeta, abstractmethod
class GameStateChange(object):
__metaclass__ = ABCMeta
@abstractmethod
def apply(self, gameState):
pass
class ResourceChange(GameStateChange):
def __init__(self, playerId, delta):
super(ResourceChange, self).__init__()
self.playerId = p... | Add a class for representing changes to GameState.from abc import ABCMeta, abstractmethod
class GameStateChange(object):
__metaclass__ = ABCMeta
@abstractmethod
def apply(self, gameState):
pass
class ResourceChange(GameStateChange):
def __init__(self, playerId, delta):
super(Resource... | <commit_before><commit_msg>Add a class for representing changes to GameState.<commit_after>from abc import ABCMeta, abstractmethod
class GameStateChange(object):
__metaclass__ = ABCMeta
@abstractmethod
def apply(self, gameState):
pass
class ResourceChange(GameStateChange):
def __init__(self,... | |
1260f2dfd29b007a3fd1954b869a19e631c3c66c | senlin/tests/tempest/api/profiles/test_profile_validate_negative.py | senlin/tests/tempest/api/profiles/test_profile_validate_negative.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add negative API tests for profile validation | Add negative API tests for profile validation
Add negative API tests for profile validation
Change-Id: I3ad3c9d891c857d9c6cfc08dcee2e3762d566115
| Python | apache-2.0 | stackforge/senlin,openstack/senlin,openstack/senlin,stackforge/senlin,openstack/senlin | Add negative API tests for profile validation
Add negative API tests for profile validation
Change-Id: I3ad3c9d891c857d9c6cfc08dcee2e3762d566115 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before><commit_msg>Add negative API tests for profile validation
Add negative API tests for profile validation
Change-Id: I3ad3c9d891c857d9c6cfc08dcee2e3762d566115<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add negative API tests for profile validation
Add negative API tests for profile validation
Change-Id: I3ad3c9d891c857d9c6cfc08dcee2e3762d566115# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at... | <commit_before><commit_msg>Add negative API tests for profile validation
Add negative API tests for profile validation
Change-Id: I3ad3c9d891c857d9c6cfc08dcee2e3762d566115<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. ... | |
bc00b0732ef1e8e89f37ff7a9a9d089eff5b85b7 | problem2.py | problem2.py | """
An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'.
Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing
all occurrences of 'T' in t with 'U' in u.
Given: A DNA string t having length at most 1000 nt.
Return: The transcribed ... | Add solution to transcribing DNA into RNA | Add solution to transcribing DNA into RNA
| Python | mit | MichaelAquilina/rosalind-solutions | Add solution to transcribing DNA into RNA | """
An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'.
Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing
all occurrences of 'T' in t with 'U' in u.
Given: A DNA string t having length at most 1000 nt.
Return: The transcribed ... | <commit_before><commit_msg>Add solution to transcribing DNA into RNA<commit_after> | """
An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'.
Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing
all occurrences of 'T' in t with 'U' in u.
Given: A DNA string t having length at most 1000 nt.
Return: The transcribed ... | Add solution to transcribing DNA into RNA"""
An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'.
Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing
all occurrences of 'T' in t with 'U' in u.
Given: A DNA string t having length a... | <commit_before><commit_msg>Add solution to transcribing DNA into RNA<commit_after>"""
An RNA string is a string formed from the alphabet containing 'A', 'C', 'G', and 'U'.
Given a DNA string t corresponding to a coding strand, its transcribed RNA string u is formed by replacing
all occurrences of 'T' in t with 'U' in ... | |
d7bc8c5f7d04c72c49f88d9c6c0a962ba5bc539f | py/1st_k.py | py/1st_k.py | """
== Given a sorted list, find the first occurance of k ==
"""
def find_first(l, k):
""" Assumes that 'l' is a list of integars and is sorted """
# Input checks
if len(l) is 0:
return -1
# Initialize binary search params
result = -1
upper = len(l) - 1
lower = 0
# Search loo... | Add python program for find first occurance of k | Add python program for find first occurance of k
| Python | mit | tdeh/quickies,tdeh/quickies | Add python program for find first occurance of k | """
== Given a sorted list, find the first occurance of k ==
"""
def find_first(l, k):
""" Assumes that 'l' is a list of integars and is sorted """
# Input checks
if len(l) is 0:
return -1
# Initialize binary search params
result = -1
upper = len(l) - 1
lower = 0
# Search loo... | <commit_before><commit_msg>Add python program for find first occurance of k<commit_after> | """
== Given a sorted list, find the first occurance of k ==
"""
def find_first(l, k):
""" Assumes that 'l' is a list of integars and is sorted """
# Input checks
if len(l) is 0:
return -1
# Initialize binary search params
result = -1
upper = len(l) - 1
lower = 0
# Search loo... | Add python program for find first occurance of k"""
== Given a sorted list, find the first occurance of k ==
"""
def find_first(l, k):
""" Assumes that 'l' is a list of integars and is sorted """
# Input checks
if len(l) is 0:
return -1
# Initialize binary search params
result = -1
up... | <commit_before><commit_msg>Add python program for find first occurance of k<commit_after>"""
== Given a sorted list, find the first occurance of k ==
"""
def find_first(l, k):
""" Assumes that 'l' is a list of integars and is sorted """
# Input checks
if len(l) is 0:
return -1
# Initialize bi... | |
04d2405b560e508a43fcd7b9be8036ea6d9335be | museum_site/migrations/0026_auto_20190307_0205.py | museum_site/migrations/0026_auto_20190307_0205.py | # Generated by Django 2.1.7 on 2019-03-07 02:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0025_auto_20181209_0608'),
]
operations = [
migrations.RemoveField(
model_name='... | Remove unused page/parent fields from Articles | Remove unused page/parent fields from Articles
| Python | mit | DrDos0016/z2,DrDos0016/z2,DrDos0016/z2 | Remove unused page/parent fields from Articles | # Generated by Django 2.1.7 on 2019-03-07 02:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0025_auto_20181209_0608'),
]
operations = [
migrations.RemoveField(
model_name='... | <commit_before><commit_msg>Remove unused page/parent fields from Articles<commit_after> | # Generated by Django 2.1.7 on 2019-03-07 02:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0025_auto_20181209_0608'),
]
operations = [
migrations.RemoveField(
model_name='... | Remove unused page/parent fields from Articles# Generated by Django 2.1.7 on 2019-03-07 02:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0025_auto_20181209_0608'),
]
operations = [
mi... | <commit_before><commit_msg>Remove unused page/parent fields from Articles<commit_after># Generated by Django 2.1.7 on 2019-03-07 02:05
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('museum_site', '0025_auto_20181209_060... | |
63fdc6417888b672bed8d50d8cad9e2506d6b0f2 | libpebble2/protocol/appglance.py | libpebble2/protocol/appglance.py | from __future__ import absolute_import
__author__ = 'katharine'
"""
This file is special in that it actually contains definitions of
blobdb blob formats rather than pebble protocol messages.
"""
from copy import deepcopy
from enum import IntEnum
from .base import PebblePacket
from .base.types import *
from .timeline... | Add BlobDB format definitions for AppGlanceSlice and AppGlance | Add BlobDB format definitions for AppGlanceSlice and AppGlance
| Python | mit | pebble/libpebble2 | Add BlobDB format definitions for AppGlanceSlice and AppGlance | from __future__ import absolute_import
__author__ = 'katharine'
"""
This file is special in that it actually contains definitions of
blobdb blob formats rather than pebble protocol messages.
"""
from copy import deepcopy
from enum import IntEnum
from .base import PebblePacket
from .base.types import *
from .timeline... | <commit_before><commit_msg>Add BlobDB format definitions for AppGlanceSlice and AppGlance<commit_after> | from __future__ import absolute_import
__author__ = 'katharine'
"""
This file is special in that it actually contains definitions of
blobdb blob formats rather than pebble protocol messages.
"""
from copy import deepcopy
from enum import IntEnum
from .base import PebblePacket
from .base.types import *
from .timeline... | Add BlobDB format definitions for AppGlanceSlice and AppGlancefrom __future__ import absolute_import
__author__ = 'katharine'
"""
This file is special in that it actually contains definitions of
blobdb blob formats rather than pebble protocol messages.
"""
from copy import deepcopy
from enum import IntEnum
from .bas... | <commit_before><commit_msg>Add BlobDB format definitions for AppGlanceSlice and AppGlance<commit_after>from __future__ import absolute_import
__author__ = 'katharine'
"""
This file is special in that it actually contains definitions of
blobdb blob formats rather than pebble protocol messages.
"""
from copy import dee... | |
0902e23ba850b4d3a8ba22a93bc90005e37b13b8 | maxwellbloch/tests/test_field.py | maxwellbloch/tests/test_field.py | """
Unit tests for the field module.
Thomas Ogden <t@ogden.eu>
"""
import unittest
from maxwellbloch import field
class TestInit(unittest.TestCase):
def test_init_default(self):
""" Test Default Initialise """
field_00 = field.Field()
self.assertEqual(field_00.label, '')
s... | Add Field default init test | Add Field default init test
| Python | mit | tommyogden/maxwellbloch,tommyogden/maxwellbloch | Add Field default init test | """
Unit tests for the field module.
Thomas Ogden <t@ogden.eu>
"""
import unittest
from maxwellbloch import field
class TestInit(unittest.TestCase):
def test_init_default(self):
""" Test Default Initialise """
field_00 = field.Field()
self.assertEqual(field_00.label, '')
s... | <commit_before><commit_msg>Add Field default init test<commit_after> | """
Unit tests for the field module.
Thomas Ogden <t@ogden.eu>
"""
import unittest
from maxwellbloch import field
class TestInit(unittest.TestCase):
def test_init_default(self):
""" Test Default Initialise """
field_00 = field.Field()
self.assertEqual(field_00.label, '')
s... | Add Field default init test"""
Unit tests for the field module.
Thomas Ogden <t@ogden.eu>
"""
import unittest
from maxwellbloch import field
class TestInit(unittest.TestCase):
def test_init_default(self):
""" Test Default Initialise """
field_00 = field.Field()
self.assertEqual(fi... | <commit_before><commit_msg>Add Field default init test<commit_after>"""
Unit tests for the field module.
Thomas Ogden <t@ogden.eu>
"""
import unittest
from maxwellbloch import field
class TestInit(unittest.TestCase):
def test_init_default(self):
""" Test Default Initialise """
field_00 = f... | |
cd57ebb8471094982c4f489b12b397ad3cde0091 | osf/migrations/0105_merge_20180525_1529.py | osf/migrations/0105_merge_20180525_1529.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-25 20:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0104_merge_20180523_1240'),
('osf', '0104_merge_20180524_1621'),
]
operatio... | Add merge migration for GDPR | Add merge migration for GDPR
| Python | apache-2.0 | brianjgeiger/osf.io,cslzchen/osf.io,felliott/osf.io,HalcyonChimera/osf.io,cslzchen/osf.io,mfraezz/osf.io,aaxelb/osf.io,sloria/osf.io,felliott/osf.io,mfraezz/osf.io,pattisdr/osf.io,baylee-d/osf.io,icereval/osf.io,HalcyonChimera/osf.io,aaxelb/osf.io,saradbowman/osf.io,CenterForOpenScience/osf.io,Johnetordoff/osf.io,Cente... | Add merge migration for GDPR | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-25 20:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0104_merge_20180523_1240'),
('osf', '0104_merge_20180524_1621'),
]
operatio... | <commit_before><commit_msg>Add merge migration for GDPR<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-25 20:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0104_merge_20180523_1240'),
('osf', '0104_merge_20180524_1621'),
]
operatio... | Add merge migration for GDPR# -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-25 20:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0104_merge_20180523_1240'),
('osf', '0104_merge_20180524... | <commit_before><commit_msg>Add merge migration for GDPR<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.13 on 2018-05-25 20:29
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0104_merge_20180523_124... | |
91e4c491dadc4806fa1ca113d8681ee199856243 | misc/convertAll.py | misc/convertAll.py | #!/usr/bin/env python3
import os
from subprocess import call;
for d in os.listdir('relannis/'):
print("Checking " + d)
if(os.path.isdir('relannis/' + d)):
print("Converting " + d)
call(["build/annis_runner", "import", 'relannis/' + d, 'data/' + d])
| Add helper script to convert all corpora from the relannis/ folder to the data/ folder | Add helper script to convert all corpora from the relannis/ folder to the data/ folder
| Python | apache-2.0 | thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS,thomaskrause/graphANNIS | Add helper script to convert all corpora from the relannis/ folder to the data/ folder | #!/usr/bin/env python3
import os
from subprocess import call;
for d in os.listdir('relannis/'):
print("Checking " + d)
if(os.path.isdir('relannis/' + d)):
print("Converting " + d)
call(["build/annis_runner", "import", 'relannis/' + d, 'data/' + d])
| <commit_before><commit_msg>Add helper script to convert all corpora from the relannis/ folder to the data/ folder<commit_after> | #!/usr/bin/env python3
import os
from subprocess import call;
for d in os.listdir('relannis/'):
print("Checking " + d)
if(os.path.isdir('relannis/' + d)):
print("Converting " + d)
call(["build/annis_runner", "import", 'relannis/' + d, 'data/' + d])
| Add helper script to convert all corpora from the relannis/ folder to the data/ folder#!/usr/bin/env python3
import os
from subprocess import call;
for d in os.listdir('relannis/'):
print("Checking " + d)
if(os.path.isdir('relannis/' + d)):
print("Converting " + d)
call(["build/annis_runner", ... | <commit_before><commit_msg>Add helper script to convert all corpora from the relannis/ folder to the data/ folder<commit_after>#!/usr/bin/env python3
import os
from subprocess import call;
for d in os.listdir('relannis/'):
print("Checking " + d)
if(os.path.isdir('relannis/' + d)):
print("Converting " ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.