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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
3fcea684179da92e304e8eb2caafae80311e8507 | app/__version__.py | app/__version__.py | #!/usr/bin/env python
"""
Change Log
1.3.0 Update all packages to current releases.
Refactor to support Python 3.7
1.1.7 Update application logging to separate application events from
those logged by the uwsgi servivce
1.1.6 Add email address detail for various authenticati... | Move the application version number to a separate file per PEP 396. | Move the application version number to a separate file per PEP 396.
| Python | mit | parallaxinc/Cloud-Session,parallaxinc/Cloud-Session | Move the application version number to a separate file per PEP 396. | #!/usr/bin/env python
"""
Change Log
1.3.0 Update all packages to current releases.
Refactor to support Python 3.7
1.1.7 Update application logging to separate application events from
those logged by the uwsgi servivce
1.1.6 Add email address detail for various authenticati... | <commit_before><commit_msg>Move the application version number to a separate file per PEP 396.<commit_after> | #!/usr/bin/env python
"""
Change Log
1.3.0 Update all packages to current releases.
Refactor to support Python 3.7
1.1.7 Update application logging to separate application events from
those logged by the uwsgi servivce
1.1.6 Add email address detail for various authenticati... | Move the application version number to a separate file per PEP 396.#!/usr/bin/env python
"""
Change Log
1.3.0 Update all packages to current releases.
Refactor to support Python 3.7
1.1.7 Update application logging to separate application events from
those logged by the uwsgi serv... | <commit_before><commit_msg>Move the application version number to a separate file per PEP 396.<commit_after>#!/usr/bin/env python
"""
Change Log
1.3.0 Update all packages to current releases.
Refactor to support Python 3.7
1.1.7 Update application logging to separate application events from
... | |
88a673c402b60e3212e2a60477a854b756ae5e9a | db/specific_event.py | db/specific_event.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# import uuid
from db.common import Base
from db.common import session_scope
class SpecificEvent():
@classmethod
def find_by_event_id(self, event_id):
# retrieving table name for specific event
table_name = self.__tablename__
# finding ... | Add initial definition of specific event item | Add initial definition of specific event item
| Python | mit | leaffan/pynhldb | Add initial definition of specific event item | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# import uuid
from db.common import Base
from db.common import session_scope
class SpecificEvent():
@classmethod
def find_by_event_id(self, event_id):
# retrieving table name for specific event
table_name = self.__tablename__
# finding ... | <commit_before><commit_msg>Add initial definition of specific event item<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# import uuid
from db.common import Base
from db.common import session_scope
class SpecificEvent():
@classmethod
def find_by_event_id(self, event_id):
# retrieving table name for specific event
table_name = self.__tablename__
# finding ... | Add initial definition of specific event item#!/usr/bin/env python
# -*- coding: utf-8 -*-
# import uuid
from db.common import Base
from db.common import session_scope
class SpecificEvent():
@classmethod
def find_by_event_id(self, event_id):
# retrieving table name for specific event
table_... | <commit_before><commit_msg>Add initial definition of specific event item<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
# import uuid
from db.common import Base
from db.common import session_scope
class SpecificEvent():
@classmethod
def find_by_event_id(self, event_id):
# retrieving tab... | |
9aeebde15b5ad2d6526c9b62ab37cf0d890d167d | pbs/gen.py | pbs/gen.py | #!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 19-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 2018
# license :
#===========================================... | Add script to run PBS jobs to create fragment database | Add script to run PBS jobs to create fragment database
| Python | bsd-3-clause | DrrDom/crem,DrrDom/crem | Add script to run PBS jobs to create fragment database | #!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 19-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 2018
# license :
#===========================================... | <commit_before><commit_msg>Add script to run PBS jobs to create fragment database<commit_after> | #!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 19-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 2018
# license :
#===========================================... | Add script to run PBS jobs to create fragment database#!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 19-08-2018
# version :
# python_version :
# copyright : Pavel Polishchuk 2018
# license ... | <commit_before><commit_msg>Add script to run PBS jobs to create fragment database<commit_after>#!/usr/bin/env python3
#==============================================================================
# author : Pavel Polishchuk
# date : 19-08-2018
# version :
# python_version :
# copyright ... | |
1208f86c8c5ba677bd6001442129d49f28c22764 | test/dict_parameter_test.py | test/dict_parameter_test.py | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | Add test cases for DictParameter | Add test cases for DictParameter
| Python | apache-2.0 | jamesmcm/luigi,samepage-labs/luigi,jw0201/luigi,h3biomed/luigi,humanlongevity/luigi,riga/luigi,Wattpad/luigi,dlstadther/luigi,javrasya/luigi,edx/luigi,Magnetic/luigi,adaitche/luigi,foursquare/luigi,dlstadther/luigi,linsomniac/luigi,samuell/luigi,Houzz/luigi,Houzz/luigi,PeteW/luigi,ContextLogic/luigi,PeteW/luigi,ehdr/lu... | Add test cases for DictParameter | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | <commit_before><commit_msg>Add test cases for DictParameter<commit_after> | # -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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... | Add test cases for DictParameter# -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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
#
# U... | <commit_before><commit_msg>Add test cases for DictParameter<commit_after># -*- coding: utf-8 -*-
#
# Copyright 2012-2015 Spotify AB
#
# 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://... | |
ce929da100303a56ca5d1e4c5ca3982c314d8696 | CodeFights/simpleComposition.py | CodeFights/simpleComposition.py | #!/usr/local/bin/python
# Code Fights Simple Composition Problem
from functools import reduce
import math
def compose(f, g):
return lambda x: f(g(x))
def simpleComposition(f, g, x):
return compose(eval(f), eval(g))(x)
# Generic composition of n functions:
def compose_n(*functions):
return reduce(lamb... | Solve Code Fights simple composition problem | Solve Code Fights simple composition problem
| Python | mit | HKuz/Test_Code | Solve Code Fights simple composition problem | #!/usr/local/bin/python
# Code Fights Simple Composition Problem
from functools import reduce
import math
def compose(f, g):
return lambda x: f(g(x))
def simpleComposition(f, g, x):
return compose(eval(f), eval(g))(x)
# Generic composition of n functions:
def compose_n(*functions):
return reduce(lamb... | <commit_before><commit_msg>Solve Code Fights simple composition problem<commit_after> | #!/usr/local/bin/python
# Code Fights Simple Composition Problem
from functools import reduce
import math
def compose(f, g):
return lambda x: f(g(x))
def simpleComposition(f, g, x):
return compose(eval(f), eval(g))(x)
# Generic composition of n functions:
def compose_n(*functions):
return reduce(lamb... | Solve Code Fights simple composition problem#!/usr/local/bin/python
# Code Fights Simple Composition Problem
from functools import reduce
import math
def compose(f, g):
return lambda x: f(g(x))
def simpleComposition(f, g, x):
return compose(eval(f), eval(g))(x)
# Generic composition of n functions:
def c... | <commit_before><commit_msg>Solve Code Fights simple composition problem<commit_after>#!/usr/local/bin/python
# Code Fights Simple Composition Problem
from functools import reduce
import math
def compose(f, g):
return lambda x: f(g(x))
def simpleComposition(f, g, x):
return compose(eval(f), eval(g))(x)
# ... | |
b58fc31236e0c2226d31f7c846cc6a6392c98d52 | parsers/python/tests/test_single_reference.py | parsers/python/tests/test_single_reference.py | import unittest
from jsonasobj import as_json
from pyshexc.parser_impl.generate_shexj import parse
shex = """<http://a.example/S0> @<http://a.example/S1>
<http://a.example/S1> { <http://a.example/p1> . }"""
shexj = """{
"type": "Schema",
"shapes": [
"http://a.example/S1",
{
"type": "Shap... | Add an experimental test for a single referencew | Add an experimental test for a single referencew
| Python | mit | shexSpec/grammar,shexSpec/grammar,shexSpec/grammar | Add an experimental test for a single referencew | import unittest
from jsonasobj import as_json
from pyshexc.parser_impl.generate_shexj import parse
shex = """<http://a.example/S0> @<http://a.example/S1>
<http://a.example/S1> { <http://a.example/p1> . }"""
shexj = """{
"type": "Schema",
"shapes": [
"http://a.example/S1",
{
"type": "Shap... | <commit_before><commit_msg>Add an experimental test for a single referencew<commit_after> | import unittest
from jsonasobj import as_json
from pyshexc.parser_impl.generate_shexj import parse
shex = """<http://a.example/S0> @<http://a.example/S1>
<http://a.example/S1> { <http://a.example/p1> . }"""
shexj = """{
"type": "Schema",
"shapes": [
"http://a.example/S1",
{
"type": "Shap... | Add an experimental test for a single referencewimport unittest
from jsonasobj import as_json
from pyshexc.parser_impl.generate_shexj import parse
shex = """<http://a.example/S0> @<http://a.example/S1>
<http://a.example/S1> { <http://a.example/p1> . }"""
shexj = """{
"type": "Schema",
"shapes": [
"http... | <commit_before><commit_msg>Add an experimental test for a single referencew<commit_after>import unittest
from jsonasobj import as_json
from pyshexc.parser_impl.generate_shexj import parse
shex = """<http://a.example/S0> @<http://a.example/S1>
<http://a.example/S1> { <http://a.example/p1> . }"""
shexj = """{
"ty... | |
46f8389f79ad7aae6c038a2eef853eb0652349c7 | examples/auto_update_example.py | examples/auto_update_example.py | from guizero import *
import random
def read_sensor():
return random.randrange(3200, 5310, 10) / 100
def update_label():
text.set(read_sensor())
# recursive call
text.after(1000, update_label)
if __name__ == '__main__':
app = App(title='Sensor Display!',
height=100,
... | Add example for auto update of a widget using .after() | Add example for auto update of a widget using .after()
Thanks to @ukBaz and @jezdean an example of the already implemented .after() function being used to update a widget automatically. | Python | bsd-3-clause | lawsie/guizero,lawsie/guizero,lawsie/guizero | Add example for auto update of a widget using .after()
Thanks to @ukBaz and @jezdean an example of the already implemented .after() function being used to update a widget automatically. | from guizero import *
import random
def read_sensor():
return random.randrange(3200, 5310, 10) / 100
def update_label():
text.set(read_sensor())
# recursive call
text.after(1000, update_label)
if __name__ == '__main__':
app = App(title='Sensor Display!',
height=100,
... | <commit_before><commit_msg>Add example for auto update of a widget using .after()
Thanks to @ukBaz and @jezdean an example of the already implemented .after() function being used to update a widget automatically.<commit_after> | from guizero import *
import random
def read_sensor():
return random.randrange(3200, 5310, 10) / 100
def update_label():
text.set(read_sensor())
# recursive call
text.after(1000, update_label)
if __name__ == '__main__':
app = App(title='Sensor Display!',
height=100,
... | Add example for auto update of a widget using .after()
Thanks to @ukBaz and @jezdean an example of the already implemented .after() function being used to update a widget automatically.from guizero import *
import random
def read_sensor():
return random.randrange(3200, 5310, 10) / 100
def update_label():
t... | <commit_before><commit_msg>Add example for auto update of a widget using .after()
Thanks to @ukBaz and @jezdean an example of the already implemented .after() function being used to update a widget automatically.<commit_after>from guizero import *
import random
def read_sensor():
return random.randrange(3200, 53... | |
8dbce56b1b595a761fdc29c8730ad5e11e40a203 | php4dvd/test_searchfilm.py | php4dvd/test_searchfilm.py | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import unittest
class searchFilm(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(1... | Add a test for search saces. | Add a test for search saces.
| Python | bsd-2-clause | bsamorodov/selenium-py-training-samorodov | Add a test for search saces. | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import unittest
class searchFilm(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(1... | <commit_before><commit_msg>Add a test for search saces.<commit_after> | # -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import unittest
class searchFilm(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
self.driver.implicitly_wait(1... | Add a test for search saces.# -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import unittest
class searchFilm(unittest.TestCase):
def setUp(self):
self.driver = webdriver.Firefox()
s... | <commit_before><commit_msg>Add a test for search saces.<commit_after># -*- coding: utf-8 -*-
from selenium import webdriver
from selenium.common.exceptions import NoSuchElementException
from selenium.webdriver.common.keys import Keys
import unittest
class searchFilm(unittest.TestCase):
def setUp(self):
se... | |
7a51f5a4e4effee4891cddbb867f873ec15c5fab | Python/strings/sort_anagrams.py | Python/strings/sort_anagrams.py | '''
Sort an array of strings so that the anagrams
are next to one another
Ex.
'abba', 'foo', 'bar', 'aabb'
becomes:
'abba', 'aabb', 'foo', 'bar'
'''
from __future__ import print_function
from collections import OrderedDict
def collect_anagrams(str_arr):
d = OrderedDict()
for i, s in enumerate(str_arr):
... | Sort an array of strings so that the anagrams are grouped | Sort an array of strings so that the anagrams are grouped
| Python | unlicense | amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning,amitsaha/learning | Sort an array of strings so that the anagrams are grouped | '''
Sort an array of strings so that the anagrams
are next to one another
Ex.
'abba', 'foo', 'bar', 'aabb'
becomes:
'abba', 'aabb', 'foo', 'bar'
'''
from __future__ import print_function
from collections import OrderedDict
def collect_anagrams(str_arr):
d = OrderedDict()
for i, s in enumerate(str_arr):
... | <commit_before><commit_msg>Sort an array of strings so that the anagrams are grouped<commit_after> | '''
Sort an array of strings so that the anagrams
are next to one another
Ex.
'abba', 'foo', 'bar', 'aabb'
becomes:
'abba', 'aabb', 'foo', 'bar'
'''
from __future__ import print_function
from collections import OrderedDict
def collect_anagrams(str_arr):
d = OrderedDict()
for i, s in enumerate(str_arr):
... | Sort an array of strings so that the anagrams are grouped'''
Sort an array of strings so that the anagrams
are next to one another
Ex.
'abba', 'foo', 'bar', 'aabb'
becomes:
'abba', 'aabb', 'foo', 'bar'
'''
from __future__ import print_function
from collections import OrderedDict
def collect_anagrams(str_arr):
... | <commit_before><commit_msg>Sort an array of strings so that the anagrams are grouped<commit_after>'''
Sort an array of strings so that the anagrams
are next to one another
Ex.
'abba', 'foo', 'bar', 'aabb'
becomes:
'abba', 'aabb', 'foo', 'bar'
'''
from __future__ import print_function
from collections import Order... | |
cb159032856c4409187154cc0ec3d6ffae1fc4db | py/top-k-frequent-words.py | py/top-k-frequent-words.py | from collections import Counter
import heapq
class Neg():
def __init__(self, x):
self.x = x
def __cmp__(self, other):
return -cmp(self.x, other.x)
class Solution(object):
def topKFrequent_nlogk(self, words, k):
"""
:type words: List[str]
:type k: int
:rtype:... | Add py solution for 692. Top K Frequent Words | Add py solution for 692. Top K Frequent Words
692. Top K Frequent Words: https://leetcode.com/problems/top-k-frequent-words/
O(nlgk) and O(klgn) approaches
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 692. Top K Frequent Words
692. Top K Frequent Words: https://leetcode.com/problems/top-k-frequent-words/
O(nlgk) and O(klgn) approaches | from collections import Counter
import heapq
class Neg():
def __init__(self, x):
self.x = x
def __cmp__(self, other):
return -cmp(self.x, other.x)
class Solution(object):
def topKFrequent_nlogk(self, words, k):
"""
:type words: List[str]
:type k: int
:rtype:... | <commit_before><commit_msg>Add py solution for 692. Top K Frequent Words
692. Top K Frequent Words: https://leetcode.com/problems/top-k-frequent-words/
O(nlgk) and O(klgn) approaches<commit_after> | from collections import Counter
import heapq
class Neg():
def __init__(self, x):
self.x = x
def __cmp__(self, other):
return -cmp(self.x, other.x)
class Solution(object):
def topKFrequent_nlogk(self, words, k):
"""
:type words: List[str]
:type k: int
:rtype:... | Add py solution for 692. Top K Frequent Words
692. Top K Frequent Words: https://leetcode.com/problems/top-k-frequent-words/
O(nlgk) and O(klgn) approachesfrom collections import Counter
import heapq
class Neg():
def __init__(self, x):
self.x = x
def __cmp__(self, other):
return -cmp(self.x, ... | <commit_before><commit_msg>Add py solution for 692. Top K Frequent Words
692. Top K Frequent Words: https://leetcode.com/problems/top-k-frequent-words/
O(nlgk) and O(klgn) approaches<commit_after>from collections import Counter
import heapq
class Neg():
def __init__(self, x):
self.x = x
def __cmp__(s... | |
1a75c38f43f0857fcc1c0dfe594f719870ad3553 | issue_id.py | issue_id.py | #!/bin/python
from __future__ import print_function, division
import argparse
import os
import os.path
import random
import string
import shutil
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""
Merge new content into existing dataset, assigining safe unique keys.
File extensions... | Add an utility to assign unique ids to files. | Add an utility to assign unique ids to files.
| Python | mit | xanxys/shogi_recognizer,xanxys/shogi_recognizer | Add an utility to assign unique ids to files. | #!/bin/python
from __future__ import print_function, division
import argparse
import os
import os.path
import random
import string
import shutil
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""
Merge new content into existing dataset, assigining safe unique keys.
File extensions... | <commit_before><commit_msg>Add an utility to assign unique ids to files.<commit_after> | #!/bin/python
from __future__ import print_function, division
import argparse
import os
import os.path
import random
import string
import shutil
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""
Merge new content into existing dataset, assigining safe unique keys.
File extensions... | Add an utility to assign unique ids to files.#!/bin/python
from __future__ import print_function, division
import argparse
import os
import os.path
import random
import string
import shutil
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""
Merge new content into existing dataset,... | <commit_before><commit_msg>Add an utility to assign unique ids to files.<commit_after>#!/bin/python
from __future__ import print_function, division
import argparse
import os
import os.path
import random
import string
import shutil
if __name__ == '__main__':
parser = argparse.ArgumentParser(
description="""... | |
4fae632c55f2b74cc29dd443bc6c017b666b46f5 | demo/amqp_clock.py | demo/amqp_clock.py | #!/usr/bin/env python
"""
AMQP Clock
Fires off simple messages at one-minute intervals to a topic
exchange named 'clock', with the topic of the message being
the local time as 'year.month.date.dow.hour.minute',
for example: '2007.11.26.1.12.33', where the dow (day of week)
is 0 for Sunday, 1 for Monday, and so on (sim... | Add another demo program, one that spits out messages at regular intervals. | Add another demo program, one that spits out messages
at regular intervals.
| Python | lgpl-2.1 | jonahbull/py-amqp,newvem/py-amqplib,yetone/py-amqp,smurfix/aio-py-amqp,smurfix/aio-py-amqp,dallasmarlow/py-amqp,dims/py-amqp,jonahbull/py-amqp,dallasmarlow/py-amqp,yetone/py-amqp,dims/py-amqp | Add another demo program, one that spits out messages
at regular intervals. | #!/usr/bin/env python
"""
AMQP Clock
Fires off simple messages at one-minute intervals to a topic
exchange named 'clock', with the topic of the message being
the local time as 'year.month.date.dow.hour.minute',
for example: '2007.11.26.1.12.33', where the dow (day of week)
is 0 for Sunday, 1 for Monday, and so on (sim... | <commit_before><commit_msg>Add another demo program, one that spits out messages
at regular intervals.<commit_after> | #!/usr/bin/env python
"""
AMQP Clock
Fires off simple messages at one-minute intervals to a topic
exchange named 'clock', with the topic of the message being
the local time as 'year.month.date.dow.hour.minute',
for example: '2007.11.26.1.12.33', where the dow (day of week)
is 0 for Sunday, 1 for Monday, and so on (sim... | Add another demo program, one that spits out messages
at regular intervals.#!/usr/bin/env python
"""
AMQP Clock
Fires off simple messages at one-minute intervals to a topic
exchange named 'clock', with the topic of the message being
the local time as 'year.month.date.dow.hour.minute',
for example: '2007.11.26.1.12.33'... | <commit_before><commit_msg>Add another demo program, one that spits out messages
at regular intervals.<commit_after>#!/usr/bin/env python
"""
AMQP Clock
Fires off simple messages at one-minute intervals to a topic
exchange named 'clock', with the topic of the message being
the local time as 'year.month.date.dow.hour.m... | |
0996f1c59dfca9c22d0e3d78598bd3edbce62696 | dailyFileCopy.py | dailyFileCopy.py | import os
import time
import shutil
import glob
def reviewAndCopy(copy_from_directory, copy_to_directory):
review_window_in_hours = 24
_review_window_in_sec = review_window_in_hours*3600
os.chdir(copy_from_directory)
text_files = getAllTxtFilesFromCurrentDirectory()
files_with_age = createFileAgeD... | Add file copy utility script | Add file copy utility script
| Python | mit | danielharada/fileCopyUtility | Add file copy utility script | import os
import time
import shutil
import glob
def reviewAndCopy(copy_from_directory, copy_to_directory):
review_window_in_hours = 24
_review_window_in_sec = review_window_in_hours*3600
os.chdir(copy_from_directory)
text_files = getAllTxtFilesFromCurrentDirectory()
files_with_age = createFileAgeD... | <commit_before><commit_msg>Add file copy utility script<commit_after> | import os
import time
import shutil
import glob
def reviewAndCopy(copy_from_directory, copy_to_directory):
review_window_in_hours = 24
_review_window_in_sec = review_window_in_hours*3600
os.chdir(copy_from_directory)
text_files = getAllTxtFilesFromCurrentDirectory()
files_with_age = createFileAgeD... | Add file copy utility scriptimport os
import time
import shutil
import glob
def reviewAndCopy(copy_from_directory, copy_to_directory):
review_window_in_hours = 24
_review_window_in_sec = review_window_in_hours*3600
os.chdir(copy_from_directory)
text_files = getAllTxtFilesFromCurrentDirectory()
fil... | <commit_before><commit_msg>Add file copy utility script<commit_after>import os
import time
import shutil
import glob
def reviewAndCopy(copy_from_directory, copy_to_directory):
review_window_in_hours = 24
_review_window_in_sec = review_window_in_hours*3600
os.chdir(copy_from_directory)
text_files = get... | |
1d4960adcc307504ecd62e45cac21c69c3ac85a1 | django_afip/migrations/0026_vat_conditions.py | django_afip/migrations/0026_vat_conditions.py | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0025_receipt__default_currency'),
]
operations = [
migrations.AlterField(
model_name='receiptpdf',
name='vat_condition',
field=models.CharField(c... | Add updated migration with vat_conditions | Add updated migration with vat_conditions
| Python | isc | hobarrera/django-afip,hobarrera/django-afip | Add updated migration with vat_conditions | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0025_receipt__default_currency'),
]
operations = [
migrations.AlterField(
model_name='receiptpdf',
name='vat_condition',
field=models.CharField(c... | <commit_before><commit_msg>Add updated migration with vat_conditions<commit_after> | from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0025_receipt__default_currency'),
]
operations = [
migrations.AlterField(
model_name='receiptpdf',
name='vat_condition',
field=models.CharField(c... | Add updated migration with vat_conditionsfrom django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0025_receipt__default_currency'),
]
operations = [
migrations.AlterField(
model_name='receiptpdf',
name='vat_conditi... | <commit_before><commit_msg>Add updated migration with vat_conditions<commit_after>from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('afip', '0025_receipt__default_currency'),
]
operations = [
migrations.AlterField(
model_name='r... | |
da514b74cce0e605e7fb6f98ff2280a1ba87323f | scripts/sqa_module_init.py | scripts/sqa_module_init.py | #!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import argparse
parser = argparse.ArgumentParser(description='Setup SQA documentation for a MOOSE module.')
parser.add_argument('module', type=str, help='The module folder name')
args = parser.parse_args()
folder = args.module
title ... | Add script for creating SQA docs in a module | Add script for creating SQA docs in a module
(refs #13661)
| Python | lgpl-2.1 | permcody/moose,jessecarterMOOSE/moose,jessecarterMOOSE/moose,jessecarterMOOSE/moose,lindsayad/moose,dschwen/moose,jessecarterMOOSE/moose,sapitts/moose,harterj/moose,laagesen/moose,andrsd/moose,idaholab/moose,bwspenc/moose,lindsayad/moose,harterj/moose,permcody/moose,lindsayad/moose,SudiptaBiswas/moose,harterj/moose,dsc... | Add script for creating SQA docs in a module
(refs #13661) | #!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import argparse
parser = argparse.ArgumentParser(description='Setup SQA documentation for a MOOSE module.')
parser.add_argument('module', type=str, help='The module folder name')
args = parser.parse_args()
folder = args.module
title ... | <commit_before><commit_msg>Add script for creating SQA docs in a module
(refs #13661)<commit_after> | #!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import argparse
parser = argparse.ArgumentParser(description='Setup SQA documentation for a MOOSE module.')
parser.add_argument('module', type=str, help='The module folder name')
args = parser.parse_args()
folder = args.module
title ... | Add script for creating SQA docs in a module
(refs #13661)#!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import argparse
parser = argparse.ArgumentParser(description='Setup SQA documentation for a MOOSE module.')
parser.add_argument('module', type=str, help='The module folder nam... | <commit_before><commit_msg>Add script for creating SQA docs in a module
(refs #13661)<commit_after>#!/usr/bin/env python
from __future__ import print_function
import os
import shutil
import argparse
parser = argparse.ArgumentParser(description='Setup SQA documentation for a MOOSE module.')
parser.add_argument('modul... | |
adf7234437c75d1a7c0b121f4b14676356df20e5 | 100_Same_Tree.py | 100_Same_Tree.py | /*
* https://leetcode.com/problems/same-tree/
*
* Given two binary trees, write a function to check if they are equal or not.
* Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
*
*/
# Definition for a binary tree node.
# class TreeNode(object):
# def... | Add solution 100. Same Tree. | Add solution 100. Same Tree. | Python | mit | wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode,wangyangkobe/leetcode | Add solution 100. Same Tree. | /*
* https://leetcode.com/problems/same-tree/
*
* Given two binary trees, write a function to check if they are equal or not.
* Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
*
*/
# Definition for a binary tree node.
# class TreeNode(object):
# def... | <commit_before><commit_msg>Add solution 100. Same Tree.<commit_after> | /*
* https://leetcode.com/problems/same-tree/
*
* Given two binary trees, write a function to check if they are equal or not.
* Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
*
*/
# Definition for a binary tree node.
# class TreeNode(object):
# def... | Add solution 100. Same Tree./*
* https://leetcode.com/problems/same-tree/
*
* Given two binary trees, write a function to check if they are equal or not.
* Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
*
*/
# Definition for a binary tree node.
# class... | <commit_before><commit_msg>Add solution 100. Same Tree.<commit_after>/*
* https://leetcode.com/problems/same-tree/
*
* Given two binary trees, write a function to check if they are equal or not.
* Two binary trees are considered equal if they are structurally identical and the nodes have the same value.
*
*/
# D... | |
4424959dd8bef2dfe709319bdf55b860ccc4971e | accounts/tests/tests_vbuserlist_page.py | accounts/tests/tests_vbuserlist_page.py | #! /usr/bin/env python
__author__ = 'Henri Buyse'
import pytest
import datetime
from django.contrib.auth.handlers.modwsgi import check_password
from django.contrib.auth.models import User
from django.test import Client
from accounts.models import VBUserProfile
key_expires = datetime.datetime.strftime(datetime.da... | Add a client test on the users list view | Add a client test on the users list view
| Python | mit | hbuyse/VBTournaments,hbuyse/VBTournaments,hbuyse/VBTournaments | Add a client test on the users list view | #! /usr/bin/env python
__author__ = 'Henri Buyse'
import pytest
import datetime
from django.contrib.auth.handlers.modwsgi import check_password
from django.contrib.auth.models import User
from django.test import Client
from accounts.models import VBUserProfile
key_expires = datetime.datetime.strftime(datetime.da... | <commit_before><commit_msg>Add a client test on the users list view<commit_after> | #! /usr/bin/env python
__author__ = 'Henri Buyse'
import pytest
import datetime
from django.contrib.auth.handlers.modwsgi import check_password
from django.contrib.auth.models import User
from django.test import Client
from accounts.models import VBUserProfile
key_expires = datetime.datetime.strftime(datetime.da... | Add a client test on the users list view#! /usr/bin/env python
__author__ = 'Henri Buyse'
import pytest
import datetime
from django.contrib.auth.handlers.modwsgi import check_password
from django.contrib.auth.models import User
from django.test import Client
from accounts.models import VBUserProfile
key_expires ... | <commit_before><commit_msg>Add a client test on the users list view<commit_after>#! /usr/bin/env python
__author__ = 'Henri Buyse'
import pytest
import datetime
from django.contrib.auth.handlers.modwsgi import check_password
from django.contrib.auth.models import User
from django.test import Client
from accounts.m... | |
72ca20f34b9ef70cee930271fa698de187f97857 | examples/simple_app.py | examples/simple_app.py | from flask_table import Table, Col, LinkCol
from flask import Flask
"""A example for creating a simple table within a working Flask app.
Our table has just two columns, one of which shows the name and is a
link to the item's page. The other shows the description.
"""
app = Flask(__name__)
class ItemTable(Table):
... | Add example for simple table within a flask app | Add example for simple table within a flask app
| Python | bsd-3-clause | plumdog/flask_table,plumdog/flask_table,plumdog/flask_table | Add example for simple table within a flask app | from flask_table import Table, Col, LinkCol
from flask import Flask
"""A example for creating a simple table within a working Flask app.
Our table has just two columns, one of which shows the name and is a
link to the item's page. The other shows the description.
"""
app = Flask(__name__)
class ItemTable(Table):
... | <commit_before><commit_msg>Add example for simple table within a flask app<commit_after> | from flask_table import Table, Col, LinkCol
from flask import Flask
"""A example for creating a simple table within a working Flask app.
Our table has just two columns, one of which shows the name and is a
link to the item's page. The other shows the description.
"""
app = Flask(__name__)
class ItemTable(Table):
... | Add example for simple table within a flask appfrom flask_table import Table, Col, LinkCol
from flask import Flask
"""A example for creating a simple table within a working Flask app.
Our table has just two columns, one of which shows the name and is a
link to the item's page. The other shows the description.
"""
a... | <commit_before><commit_msg>Add example for simple table within a flask app<commit_after>from flask_table import Table, Col, LinkCol
from flask import Flask
"""A example for creating a simple table within a working Flask app.
Our table has just two columns, one of which shows the name and is a
link to the item's page.... | |
b77b284c1ecbd599fec218d10068e419e0070994 | src/roman_to_integer.py | src/roman_to_integer.py | class Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
return 0
amount = 0
for i, c in enumerate(s):
cur = self.romanTable(c)
if i < len(s)-1:
nex = self.romanTable(s[i+1]... | Add Roman To Integer solution | Add Roman To Integer solution
| Python | mit | chancyWu/leetcode | Add Roman To Integer solution | class Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
return 0
amount = 0
for i, c in enumerate(s):
cur = self.romanTable(c)
if i < len(s)-1:
nex = self.romanTable(s[i+1]... | <commit_before><commit_msg>Add Roman To Integer solution<commit_after> | class Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
return 0
amount = 0
for i, c in enumerate(s):
cur = self.romanTable(c)
if i < len(s)-1:
nex = self.romanTable(s[i+1]... | Add Roman To Integer solutionclass Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
return 0
amount = 0
for i, c in enumerate(s):
cur = self.romanTable(c)
if i < len(s)-1:
... | <commit_before><commit_msg>Add Roman To Integer solution<commit_after>class Solution(object):
def romanToInt(self, s):
"""
:type s: str
:rtype: int
"""
if not s:
return 0
amount = 0
for i, c in enumerate(s):
cur = self.romanTable(c)
... | |
3bb9be0dd508a33d9063c8919d471ec39255aefb | load_and_plot.py | load_and_plot.py | import SixChannelReader as SCR
import matplotlib.pyplot as plt
import numpy as np
def main():
""" open previously saved data and plot it. Convert raw 12-bit ADC data to voltage """
filename = "TestData-2015-05-15-1306.pkl"
SR = SCR.SerialDataLogger()
t, C1, C2, C3, C4, C5, C6 = SR.load_data(filename)
fig = p... | Load and plot python script | Load and plot python script
| Python | mit | jameskeaveney/ArduinoDUE-Data-Logger,jameskeaveney/ArduinoDUE-Data-Logger | Load and plot python script | import SixChannelReader as SCR
import matplotlib.pyplot as plt
import numpy as np
def main():
""" open previously saved data and plot it. Convert raw 12-bit ADC data to voltage """
filename = "TestData-2015-05-15-1306.pkl"
SR = SCR.SerialDataLogger()
t, C1, C2, C3, C4, C5, C6 = SR.load_data(filename)
fig = p... | <commit_before><commit_msg>Load and plot python script<commit_after> | import SixChannelReader as SCR
import matplotlib.pyplot as plt
import numpy as np
def main():
""" open previously saved data and plot it. Convert raw 12-bit ADC data to voltage """
filename = "TestData-2015-05-15-1306.pkl"
SR = SCR.SerialDataLogger()
t, C1, C2, C3, C4, C5, C6 = SR.load_data(filename)
fig = p... | Load and plot python scriptimport SixChannelReader as SCR
import matplotlib.pyplot as plt
import numpy as np
def main():
""" open previously saved data and plot it. Convert raw 12-bit ADC data to voltage """
filename = "TestData-2015-05-15-1306.pkl"
SR = SCR.SerialDataLogger()
t, C1, C2, C3, C4, C5, C6 = SR.loa... | <commit_before><commit_msg>Load and plot python script<commit_after>import SixChannelReader as SCR
import matplotlib.pyplot as plt
import numpy as np
def main():
""" open previously saved data and plot it. Convert raw 12-bit ADC data to voltage """
filename = "TestData-2015-05-15-1306.pkl"
SR = SCR.SerialDataLogg... | |
8ee65cbf390d5caae04498397f74cd8a64e7903e | email_auth/migrations/0003_auto_20151209_0746.py | email_auth/migrations/0003_auto_20151209_0746.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import email_auth.models
class Migration(migrations.Migration):
dependencies = [
('email_auth', '0002_auto_20151011_1652'),
]
operations = [
migrations.AlterModelManagers(
... | Add a necessary migration for email_auth | Add a necessary migration for email_auth
| Python | bsd-3-clause | divio/django-shop,rfleschenberg/django-shop,jrief/django-shop,khchine5/django-shop,awesto/django-shop,rfleschenberg/django-shop,jrief/django-shop,awesto/django-shop,jrief/django-shop,divio/django-shop,divio/django-shop,nimbis/django-shop,khchine5/django-shop,rfleschenberg/django-shop,khchine5/django-shop,jrief/django-s... | Add a necessary migration for email_auth | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import email_auth.models
class Migration(migrations.Migration):
dependencies = [
('email_auth', '0002_auto_20151011_1652'),
]
operations = [
migrations.AlterModelManagers(
... | <commit_before><commit_msg>Add a necessary migration for email_auth<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import email_auth.models
class Migration(migrations.Migration):
dependencies = [
('email_auth', '0002_auto_20151011_1652'),
]
operations = [
migrations.AlterModelManagers(
... | Add a necessary migration for email_auth# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import email_auth.models
class Migration(migrations.Migration):
dependencies = [
('email_auth', '0002_auto_20151011_1652'),
]
operations = [
m... | <commit_before><commit_msg>Add a necessary migration for email_auth<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
import email_auth.models
class Migration(migrations.Migration):
dependencies = [
('email_auth', '0002_auto_20151011_16... | |
2da04cccf32e5280e36966b2d9c93a643e7458e7 | osf/migrations/0083_add_ember_waffle_flags.py | osf/migrations/0083_add_ember_waffle_flags.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-02 17:45
from __future__ import unicode_literals
from waffle.models import Flag
from django.db import migrations, IntegrityError, transaction
EMBER_WAFFLE_PAGES = [
'completed_registration_form_detail',
'dashboard',
'draft_registration_form',
... | Add migration to add some ember waffle flags to the db for waffle pages with a default value of False. Can be changed in django app when ready. | Add migration to add some ember waffle flags to the db for waffle pages with a default value of False. Can be changed in django app when ready.
| Python | apache-2.0 | adlius/osf.io,mfraezz/osf.io,mattclark/osf.io,chennan47/osf.io,CenterForOpenScience/osf.io,felliott/osf.io,caseyrollins/osf.io,sloria/osf.io,HalcyonChimera/osf.io,mattclark/osf.io,adlius/osf.io,brianjgeiger/osf.io,binoculars/osf.io,cslzchen/osf.io,saradbowman/osf.io,Johnetordoff/osf.io,felliott/osf.io,chennan47/osf.io,... | Add migration to add some ember waffle flags to the db for waffle pages with a default value of False. Can be changed in django app when ready. | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-02 17:45
from __future__ import unicode_literals
from waffle.models import Flag
from django.db import migrations, IntegrityError, transaction
EMBER_WAFFLE_PAGES = [
'completed_registration_form_detail',
'dashboard',
'draft_registration_form',
... | <commit_before><commit_msg>Add migration to add some ember waffle flags to the db for waffle pages with a default value of False. Can be changed in django app when ready.<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-02 17:45
from __future__ import unicode_literals
from waffle.models import Flag
from django.db import migrations, IntegrityError, transaction
EMBER_WAFFLE_PAGES = [
'completed_registration_form_detail',
'dashboard',
'draft_registration_form',
... | Add migration to add some ember waffle flags to the db for waffle pages with a default value of False. Can be changed in django app when ready.# -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-02 17:45
from __future__ import unicode_literals
from waffle.models import Flag
from django.db import migrations,... | <commit_before><commit_msg>Add migration to add some ember waffle flags to the db for waffle pages with a default value of False. Can be changed in django app when ready.<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.9 on 2018-03-02 17:45
from __future__ import unicode_literals
from waffle.models impo... | |
b5d5f377cf3d3b2b4459c36ba47e2e0f4a3125f4 | mothermayi/colors.py | mothermayi/colors.py | BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def green(text):
return GREEN + text + ENDC
def red(text):
return RED + text + ENDC
| Add module for putting color in our text output | Add module for putting color in our text output
| Python | mit | EliRibble/mothermayi | Add module for putting color in our text output | BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def green(text):
return GREEN + text + ENDC
def red(text):
return RED + text + ENDC
| <commit_before><commit_msg>Add module for putting color in our text output<commit_after> | BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def green(text):
return GREEN + text + ENDC
def red(text):
return RED + text + ENDC
| Add module for putting color in our text outputBLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def green(text):
return GREEN + text + ENDC
def red(text):
return RED + text + ENDC
| <commit_before><commit_msg>Add module for putting color in our text output<commit_after>BLUE = '\033[94m'
GREEN = '\033[92m'
YELLOW = '\033[93m'
RED = '\033[91m'
ENDC = '\033[0m'
BOLD = '\033[1m'
UNDERLINE = '\033[4m'
def green(text):
return GREEN + text + ENDC
def red(text):
return RED + text + ENDC
| |
ee5b38c649b1a5b46ce5b53c179bde57b3a6e6f2 | examples/customserverexample.py | examples/customserverexample.py | #!/usr/bin/env python3
from pythinclient.server import ThinServer
class CustomThinServer(BasicThinServer):
def __init__(self, port=65000, is_daemon=False):
super(BasicThinServer, self).__init__(port, is_daemon=is_daemon)
# add custom server hooks
self.add_hook('help', self.__server_help)
self.add_ho... | Add a custom server example implementation. This is fully compatible with the client example. | Add a custom server example implementation. This is fully compatible with the client example.
| Python | bsd-3-clause | alekratz/pythinclient | Add a custom server example implementation. This is fully compatible with the client example. | #!/usr/bin/env python3
from pythinclient.server import ThinServer
class CustomThinServer(BasicThinServer):
def __init__(self, port=65000, is_daemon=False):
super(BasicThinServer, self).__init__(port, is_daemon=is_daemon)
# add custom server hooks
self.add_hook('help', self.__server_help)
self.add_ho... | <commit_before><commit_msg>Add a custom server example implementation. This is fully compatible with the client example.<commit_after> | #!/usr/bin/env python3
from pythinclient.server import ThinServer
class CustomThinServer(BasicThinServer):
def __init__(self, port=65000, is_daemon=False):
super(BasicThinServer, self).__init__(port, is_daemon=is_daemon)
# add custom server hooks
self.add_hook('help', self.__server_help)
self.add_ho... | Add a custom server example implementation. This is fully compatible with the client example.#!/usr/bin/env python3
from pythinclient.server import ThinServer
class CustomThinServer(BasicThinServer):
def __init__(self, port=65000, is_daemon=False):
super(BasicThinServer, self).__init__(port, is_daemon=is_daemon... | <commit_before><commit_msg>Add a custom server example implementation. This is fully compatible with the client example.<commit_after>#!/usr/bin/env python3
from pythinclient.server import ThinServer
class CustomThinServer(BasicThinServer):
def __init__(self, port=65000, is_daemon=False):
super(BasicThinServer,... | |
fe6d7b11ab87d9ea3a2b99aee17b9a371c55f162 | examples/mhs_atmosphere_plot.py | examples/mhs_atmosphere_plot.py | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 9 12:52:31 2015
@author: stuart
"""
import os
import glob
import yt
model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')
files = glob.glob(datadir+'/*')
files.sort()
print(files)
ds = yt.load(files[0])
slc = yt.SlicePlot(ds, fields='density... | Add a very basic yt plotting example | Add a very basic yt plotting example
| Python | bsd-2-clause | SWAT-Sheffield/pysac,Cadair/pysac | Add a very basic yt plotting example | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 9 12:52:31 2015
@author: stuart
"""
import os
import glob
import yt
model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')
files = glob.glob(datadir+'/*')
files.sort()
print(files)
ds = yt.load(files[0])
slc = yt.SlicePlot(ds, fields='density... | <commit_before><commit_msg>Add a very basic yt plotting example<commit_after> | # -*- coding: utf-8 -*-
"""
Created on Fri Jan 9 12:52:31 2015
@author: stuart
"""
import os
import glob
import yt
model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')
files = glob.glob(datadir+'/*')
files.sort()
print(files)
ds = yt.load(files[0])
slc = yt.SlicePlot(ds, fields='density... | Add a very basic yt plotting example# -*- coding: utf-8 -*-
"""
Created on Fri Jan 9 12:52:31 2015
@author: stuart
"""
import os
import glob
import yt
model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')
files = glob.glob(datadir+'/*')
files.sort()
print(files)
ds = yt.load(files[0])
sl... | <commit_before><commit_msg>Add a very basic yt plotting example<commit_after># -*- coding: utf-8 -*-
"""
Created on Fri Jan 9 12:52:31 2015
@author: stuart
"""
import os
import glob
import yt
model = 'spruit'
datadir = os.path.expanduser('~/mhs_atmosphere/'+model+'/')
files = glob.glob(datadir+'/*')
files.sort()
... | |
d6d321fa99b9def1d85ff849fc13bbe17fa58510 | featurex/tests/test_datasets.py | featurex/tests/test_datasets.py | from featurex.datasets.text import _load_datasets, fetch_dictionary
from unittest import TestCase
from pandas import DataFrame
import urllib2
class TestDatasets(TestCase):
def test_dicts(self):
"""
Check that all text dictionaries download successfully.
"""
datasets = _load_da... | Add test for text dictionaries. | Add test for text dictionaries.
| Python | bsd-3-clause | tyarkoni/featureX,tyarkoni/pliers | Add test for text dictionaries. | from featurex.datasets.text import _load_datasets, fetch_dictionary
from unittest import TestCase
from pandas import DataFrame
import urllib2
class TestDatasets(TestCase):
def test_dicts(self):
"""
Check that all text dictionaries download successfully.
"""
datasets = _load_da... | <commit_before><commit_msg>Add test for text dictionaries.<commit_after> | from featurex.datasets.text import _load_datasets, fetch_dictionary
from unittest import TestCase
from pandas import DataFrame
import urllib2
class TestDatasets(TestCase):
def test_dicts(self):
"""
Check that all text dictionaries download successfully.
"""
datasets = _load_da... | Add test for text dictionaries.from featurex.datasets.text import _load_datasets, fetch_dictionary
from unittest import TestCase
from pandas import DataFrame
import urllib2
class TestDatasets(TestCase):
def test_dicts(self):
"""
Check that all text dictionaries download successfully.
... | <commit_before><commit_msg>Add test for text dictionaries.<commit_after>from featurex.datasets.text import _load_datasets, fetch_dictionary
from unittest import TestCase
from pandas import DataFrame
import urllib2
class TestDatasets(TestCase):
def test_dicts(self):
"""
Check that all text dic... | |
18c40bdc02c5cd27c69edb394e040a3db3d75e05 | bin/filter_pycapsule.py | bin/filter_pycapsule.py | #!/usr/bin/python3
"""Filters Pycapsule error"""
import fileinput
import sys
STRING = "RuntimeError: Object of type <class 'NamedArray'>"
NUM_AFTER = 5 # How many lines after to delete
NUM_BEFORE = 4 # How far before to delete
output_lines = []
delete_count = 0
for line in fileinput.input():
if delete_count > ... | Add filtering for bogus output | Add filtering for bogus output
| Python | apache-2.0 | ScienceStacks/BaseStack,ScienceStacks/BaseStack,ScienceStacks/BaseStack | Add filtering for bogus output | #!/usr/bin/python3
"""Filters Pycapsule error"""
import fileinput
import sys
STRING = "RuntimeError: Object of type <class 'NamedArray'>"
NUM_AFTER = 5 # How many lines after to delete
NUM_BEFORE = 4 # How far before to delete
output_lines = []
delete_count = 0
for line in fileinput.input():
if delete_count > ... | <commit_before><commit_msg>Add filtering for bogus output<commit_after> | #!/usr/bin/python3
"""Filters Pycapsule error"""
import fileinput
import sys
STRING = "RuntimeError: Object of type <class 'NamedArray'>"
NUM_AFTER = 5 # How many lines after to delete
NUM_BEFORE = 4 # How far before to delete
output_lines = []
delete_count = 0
for line in fileinput.input():
if delete_count > ... | Add filtering for bogus output#!/usr/bin/python3
"""Filters Pycapsule error"""
import fileinput
import sys
STRING = "RuntimeError: Object of type <class 'NamedArray'>"
NUM_AFTER = 5 # How many lines after to delete
NUM_BEFORE = 4 # How far before to delete
output_lines = []
delete_count = 0
for line in fileinput.i... | <commit_before><commit_msg>Add filtering for bogus output<commit_after>#!/usr/bin/python3
"""Filters Pycapsule error"""
import fileinput
import sys
STRING = "RuntimeError: Object of type <class 'NamedArray'>"
NUM_AFTER = 5 # How many lines after to delete
NUM_BEFORE = 4 # How far before to delete
output_lines = []... | |
d0aa398a0df17540c7d9160dadd48d3ab60e230e | core/tests/tests_client_home_page.py | core/tests/tests_client_home_page.py | #! /usr/bin/env python
__author__ = "Henri Buyse"
import pytest
from django.test import Client
def test_client_get_home_page():
c = Client()
response = c.get('/')
assert response.status_code == 200
@pytest.mark.django_db
def test_logged_client_get_home_page():
c = Client()
c.login(username='te... | Test home page as anonymous and logged user | Test home page as anonymous and logged user
| Python | mit | hbuyse/VBTournaments,hbuyse/VBTournaments,hbuyse/VBTournaments | Test home page as anonymous and logged user | #! /usr/bin/env python
__author__ = "Henri Buyse"
import pytest
from django.test import Client
def test_client_get_home_page():
c = Client()
response = c.get('/')
assert response.status_code == 200
@pytest.mark.django_db
def test_logged_client_get_home_page():
c = Client()
c.login(username='te... | <commit_before><commit_msg>Test home page as anonymous and logged user<commit_after> | #! /usr/bin/env python
__author__ = "Henri Buyse"
import pytest
from django.test import Client
def test_client_get_home_page():
c = Client()
response = c.get('/')
assert response.status_code == 200
@pytest.mark.django_db
def test_logged_client_get_home_page():
c = Client()
c.login(username='te... | Test home page as anonymous and logged user#! /usr/bin/env python
__author__ = "Henri Buyse"
import pytest
from django.test import Client
def test_client_get_home_page():
c = Client()
response = c.get('/')
assert response.status_code == 200
@pytest.mark.django_db
def test_logged_client_get_home_page()... | <commit_before><commit_msg>Test home page as anonymous and logged user<commit_after>#! /usr/bin/env python
__author__ = "Henri Buyse"
import pytest
from django.test import Client
def test_client_get_home_page():
c = Client()
response = c.get('/')
assert response.status_code == 200
@pytest.mark.django_... | |
b49371bbcb756371296bfe309071f2b9579e5b99 | examples/test_markers.py | examples/test_markers.py | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | Add test suite for demoing pytest markers | Add test suite for demoing pytest markers
| Python | mit | mdmintz/seleniumspot,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,seleniumbase/SeleniumBase,mdmintz/SeleniumBase,mdmintz/seleniumspot,seleniumbase/SeleniumBase,mdmintz/SeleniumBase | Add test suite for demoing pytest markers | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | <commit_before><commit_msg>Add test suite for demoing pytest markers<commit_after> | """ These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 # Runs B, C
... | Add test suite for demoing pytest markers""" These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 # Runs A
pytest -v -m marker2 ... | <commit_before><commit_msg>Add test suite for demoing pytest markers<commit_after>""" These tests demonstrate pytest marker use for finding and running tests.
Usage examples from this file:
pytest -v -m marker_test_suite # Runs A, B, C, D
pytest -v -m marker1 ... | |
e06a766e082f168e0b89776355b622b980a0a735 | locations/spiders/learning_experience.py | locations/spiders/learning_experience.py | # -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
class TheLearningExperienceSpider(scrapy.Spider):
name = "learning_experience"
allowed_domains = ["thelearningexperience.com"]
start_urls = (
'https://thelearningexperience.com/our-centers/directory',
... | Add The Learning Experience spider | Add The Learning Experience spider
| Python | mit | iandees/all-the-places,iandees/all-the-places,iandees/all-the-places | Add The Learning Experience spider | # -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
class TheLearningExperienceSpider(scrapy.Spider):
name = "learning_experience"
allowed_domains = ["thelearningexperience.com"]
start_urls = (
'https://thelearningexperience.com/our-centers/directory',
... | <commit_before><commit_msg>Add The Learning Experience spider<commit_after> | # -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
class TheLearningExperienceSpider(scrapy.Spider):
name = "learning_experience"
allowed_domains = ["thelearningexperience.com"]
start_urls = (
'https://thelearningexperience.com/our-centers/directory',
... | Add The Learning Experience spider# -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
class TheLearningExperienceSpider(scrapy.Spider):
name = "learning_experience"
allowed_domains = ["thelearningexperience.com"]
start_urls = (
'https://thelearningexperien... | <commit_before><commit_msg>Add The Learning Experience spider<commit_after># -*- coding: utf-8 -*-
import scrapy
import re
from locations.items import GeojsonPointItem
class TheLearningExperienceSpider(scrapy.Spider):
name = "learning_experience"
allowed_domains = ["thelearningexperience.com"]
start_urls... | |
c44448e6e2fa846d4eea8b6d7d907168becdd1ad | runtests.py | runtests.py | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | Remove coverage options from default test run | Remove coverage options from default test run
These were getting annoying for normal runs.
| Python | bsd-3-clause | faratro/django-oscar,WadeYuChen/django-oscar,django-oscar/django-oscar,jmt4/django-oscar,okfish/django-oscar,manevant/django-oscar,john-parton/django-oscar,jinnykoo/wuyisj,rocopartners/django-oscar,itbabu/django-oscar,makielab/django-oscar,saadatqadri/django-oscar,solarissmoke/django-oscar,sonofatailor/django-oscar,pdo... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | <commit_before>#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | #!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_args = ['tests'... | <commit_before>#!/usr/bin/env python
import sys
import logging
from optparse import OptionParser
from tests.config import configure
logging.disable(logging.CRITICAL)
def run_tests(*test_args):
from django_nose import NoseTestSuiteRunner
test_runner = NoseTestSuiteRunner()
if not test_args:
test_... |
97b19e6f3705fc0b320f33b44476f7139833de9e | glowing-lines.py | glowing-lines.py | from PIL import Image, ImageDraw
import random
W = 500
im = Image.new('RGB', (W, W))
NCOLORS = 19
COLORS = []
def get_origin_point():
return [random.randint(0, W-1), random.randint(0, W-1)]
def get_vector():
return [random.randint(0.3*W, 0.6*W), random.randint(0.3*W, 0.6*W)]
def draw_one_line(draw):
op = g... | Add crude script to draw glowing lines; currently the dark part hides other lines, making them look physical; should be additive | Add crude script to draw glowing lines; currently the dark part hides other lines, making them look physical; should be additive
| Python | mit | redpig2/pilhacks | Add crude script to draw glowing lines; currently the dark part hides other lines, making them look physical; should be additive | from PIL import Image, ImageDraw
import random
W = 500
im = Image.new('RGB', (W, W))
NCOLORS = 19
COLORS = []
def get_origin_point():
return [random.randint(0, W-1), random.randint(0, W-1)]
def get_vector():
return [random.randint(0.3*W, 0.6*W), random.randint(0.3*W, 0.6*W)]
def draw_one_line(draw):
op = g... | <commit_before><commit_msg>Add crude script to draw glowing lines; currently the dark part hides other lines, making them look physical; should be additive<commit_after> | from PIL import Image, ImageDraw
import random
W = 500
im = Image.new('RGB', (W, W))
NCOLORS = 19
COLORS = []
def get_origin_point():
return [random.randint(0, W-1), random.randint(0, W-1)]
def get_vector():
return [random.randint(0.3*W, 0.6*W), random.randint(0.3*W, 0.6*W)]
def draw_one_line(draw):
op = g... | Add crude script to draw glowing lines; currently the dark part hides other lines, making them look physical; should be additivefrom PIL import Image, ImageDraw
import random
W = 500
im = Image.new('RGB', (W, W))
NCOLORS = 19
COLORS = []
def get_origin_point():
return [random.randint(0, W-1), random.randint(0, W-1... | <commit_before><commit_msg>Add crude script to draw glowing lines; currently the dark part hides other lines, making them look physical; should be additive<commit_after>from PIL import Image, ImageDraw
import random
W = 500
im = Image.new('RGB', (W, W))
NCOLORS = 19
COLORS = []
def get_origin_point():
return [rand... | |
f0922bade498bcadf587c4b756060cf062fe68d4 | tests/unit/test_rand.py | tests/unit/test_rand.py | '''
Test sorbic.utils.rand
'''
# import sorbic libs
import sorbic.utils.rand
# Import python libs
import unittest
class TestRand(unittest.TestCase):
'''
Cover db funcs
'''
def test_rand_hex_strs(self):
'''
Test database creation
'''
rands = []
for _ in range(0,1... | Add initial tests for the rand module | Add initial tests for the rand module
| Python | apache-2.0 | thatch45/sorbic,s0undt3ch/sorbic | Add initial tests for the rand module | '''
Test sorbic.utils.rand
'''
# import sorbic libs
import sorbic.utils.rand
# Import python libs
import unittest
class TestRand(unittest.TestCase):
'''
Cover db funcs
'''
def test_rand_hex_strs(self):
'''
Test database creation
'''
rands = []
for _ in range(0,1... | <commit_before><commit_msg>Add initial tests for the rand module<commit_after> | '''
Test sorbic.utils.rand
'''
# import sorbic libs
import sorbic.utils.rand
# Import python libs
import unittest
class TestRand(unittest.TestCase):
'''
Cover db funcs
'''
def test_rand_hex_strs(self):
'''
Test database creation
'''
rands = []
for _ in range(0,1... | Add initial tests for the rand module'''
Test sorbic.utils.rand
'''
# import sorbic libs
import sorbic.utils.rand
# Import python libs
import unittest
class TestRand(unittest.TestCase):
'''
Cover db funcs
'''
def test_rand_hex_strs(self):
'''
Test database creation
'''
... | <commit_before><commit_msg>Add initial tests for the rand module<commit_after>'''
Test sorbic.utils.rand
'''
# import sorbic libs
import sorbic.utils.rand
# Import python libs
import unittest
class TestRand(unittest.TestCase):
'''
Cover db funcs
'''
def test_rand_hex_strs(self):
'''
Te... | |
f74b1615567d5cbf2cb00572cc14450ffd4b0c1c | test/requests/parametrized_test.py | test/requests/parametrized_test.py | import logging
import unittest
from elasticsearch import Elasticsearch, TransportError
class ParametrizedTest(unittest.TestCase):
def __init__(self, methodName='runTest', gn2_url="http://localhost:5003", es_url="localhost:9200"):
super(ParametrizedTest, self).__init__(methodName=methodName)
self.g... | Create parametrized superclass for tests | Create parametrized superclass for tests
* Since the tests require that some parameters be provided while running
the tests, create a class that helps abstract away the details of
retrieving and setting the expected parameters.
| Python | agpl-3.0 | DannyArends/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,DannyArends/genenetwork2,pjotrp/genenetwork2,pjotrp/genenetwork2,zsloan/genenetwork2,genenetwork/genenetwork2,genenetwork/genenetwork2,DannyArends/genenetwork2,genenetwork/genenetwork2,zsloan/genenetwork2,DannyArends/genenetwork2,... | Create parametrized superclass for tests
* Since the tests require that some parameters be provided while running
the tests, create a class that helps abstract away the details of
retrieving and setting the expected parameters. | import logging
import unittest
from elasticsearch import Elasticsearch, TransportError
class ParametrizedTest(unittest.TestCase):
def __init__(self, methodName='runTest', gn2_url="http://localhost:5003", es_url="localhost:9200"):
super(ParametrizedTest, self).__init__(methodName=methodName)
self.g... | <commit_before><commit_msg>Create parametrized superclass for tests
* Since the tests require that some parameters be provided while running
the tests, create a class that helps abstract away the details of
retrieving and setting the expected parameters.<commit_after> | import logging
import unittest
from elasticsearch import Elasticsearch, TransportError
class ParametrizedTest(unittest.TestCase):
def __init__(self, methodName='runTest', gn2_url="http://localhost:5003", es_url="localhost:9200"):
super(ParametrizedTest, self).__init__(methodName=methodName)
self.g... | Create parametrized superclass for tests
* Since the tests require that some parameters be provided while running
the tests, create a class that helps abstract away the details of
retrieving and setting the expected parameters.import logging
import unittest
from elasticsearch import Elasticsearch, TransportError
... | <commit_before><commit_msg>Create parametrized superclass for tests
* Since the tests require that some parameters be provided while running
the tests, create a class that helps abstract away the details of
retrieving and setting the expected parameters.<commit_after>import logging
import unittest
from elasticsear... | |
1475a095620d2c9ef47f8bd9ea4363907ff0067b | remove_duplicates_from_sorted_list_ii.py | remove_duplicates_from_sorted_list_ii.py | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @param head, a ListNode
# @return a ListNode
def deleteDuplicates(self, head):
if None == head:
return None
header = ListNode(-1)
... | Remove Duplicates from Sorted List II | Remove Duplicates from Sorted List II
| Python | apache-2.0 | don7hao/leetcode_oj,don7hao/leetcode_oj | Remove Duplicates from Sorted List II | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @param head, a ListNode
# @return a ListNode
def deleteDuplicates(self, head):
if None == head:
return None
header = ListNode(-1)
... | <commit_before><commit_msg>Remove Duplicates from Sorted List II<commit_after> | # Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @param head, a ListNode
# @return a ListNode
def deleteDuplicates(self, head):
if None == head:
return None
header = ListNode(-1)
... | Remove Duplicates from Sorted List II# Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @param head, a ListNode
# @return a ListNode
def deleteDuplicates(self, head):
if None == head:
return Non... | <commit_before><commit_msg>Remove Duplicates from Sorted List II<commit_after># Definition for singly-linked list.
class ListNode:
def __init__(self, x):
self.val = x
self.next = None
class Solution:
# @param head, a ListNode
# @return a ListNode
def deleteDuplicates(self, head):
... | |
8a9b4de36f35416874d10734ae1c08287ebd5c32 | mrequests/examples/get_json.py | mrequests/examples/get_json.py | import mrequests as requests
host = 'http://localhost/'
url = host + "get"
r = requests.get(url, headers={"Accept": "application/json"})
print(r)
print(r.content)
print(r.text)
print(r.json())
r.close()
| Add simple mrequests GET example | Add simple mrequests GET example
Signed-off-by: Christopher Arndt <[email protected]>
| Python | mit | SpotlightKid/micropython-stm-lib | Add simple mrequests GET example
Signed-off-by: Christopher Arndt <[email protected]> | import mrequests as requests
host = 'http://localhost/'
url = host + "get"
r = requests.get(url, headers={"Accept": "application/json"})
print(r)
print(r.content)
print(r.text)
print(r.json())
r.close()
| <commit_before><commit_msg>Add simple mrequests GET example
Signed-off-by: Christopher Arndt <[email protected]><commit_after> | import mrequests as requests
host = 'http://localhost/'
url = host + "get"
r = requests.get(url, headers={"Accept": "application/json"})
print(r)
print(r.content)
print(r.text)
print(r.json())
r.close()
| Add simple mrequests GET example
Signed-off-by: Christopher Arndt <[email protected]>import mrequests as requests
host = 'http://localhost/'
url = host + "get"
r = requests.get(url, headers={"Accept": "application/json"})
print(r)
print(r.content)
print(r.text)
print(r.json())
r.... | <commit_before><commit_msg>Add simple mrequests GET example
Signed-off-by: Christopher Arndt <[email protected]><commit_after>import mrequests as requests
host = 'http://localhost/'
url = host + "get"
r = requests.get(url, headers={"Accept": "application/json"})
print(r)
print(r.... | |
13b835d525f6576bfa047ce3001479d8b81f15b7 | mistral/db/sqlalchemy/migration/alembic_migrations/versions/014_fix_past_scripts_discrepancies.py | mistral/db/sqlalchemy/migration/alembic_migrations/versions/014_fix_past_scripts_discrepancies.py | # Copyright 2016 OpenStack Foundation.
#
# 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 ... | Fix past migration scripts discrepancies | Fix past migration scripts discrepancies
It is important that running all migration scripts from first to last
will give the expected model.
This fix is a first step. It fixes all discrepancies from previous
scripts.
There are still changes in the model that needs to have a migration
script written for them, but tha... | Python | apache-2.0 | StackStorm/mistral,openstack/mistral,StackStorm/mistral,openstack/mistral | Fix past migration scripts discrepancies
It is important that running all migration scripts from first to last
will give the expected model.
This fix is a first step. It fixes all discrepancies from previous
scripts.
There are still changes in the model that needs to have a migration
script written for them, but tha... | # Copyright 2016 OpenStack Foundation.
#
# 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 ... | <commit_before><commit_msg>Fix past migration scripts discrepancies
It is important that running all migration scripts from first to last
will give the expected model.
This fix is a first step. It fixes all discrepancies from previous
scripts.
There are still changes in the model that needs to have a migration
scrip... | # Copyright 2016 OpenStack Foundation.
#
# 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 ... | Fix past migration scripts discrepancies
It is important that running all migration scripts from first to last
will give the expected model.
This fix is a first step. It fixes all discrepancies from previous
scripts.
There are still changes in the model that needs to have a migration
script written for them, but tha... | <commit_before><commit_msg>Fix past migration scripts discrepancies
It is important that running all migration scripts from first to last
will give the expected model.
This fix is a first step. It fixes all discrepancies from previous
scripts.
There are still changes in the model that needs to have a migration
scrip... | |
ee05b846612aa5c978949ff90f38290915983385 | check-entropy.py | check-entropy.py | #!/usr/bin/env python
import sys
import os
import logging
import time
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
mainHandler = logging.StreamHandler()
mainHandler.setFormatter(logging.Formatter('%(levelname)s %(asctime)s - %(module)s - %(funcName)s: %(message)s'))
log.addHandler(mainHandler)
PROC_... | Test tool for checking entropy available in a loop | Test tool for checking entropy available in a loop
| Python | mit | infincia/TokenTools | Test tool for checking entropy available in a loop | #!/usr/bin/env python
import sys
import os
import logging
import time
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
mainHandler = logging.StreamHandler()
mainHandler.setFormatter(logging.Formatter('%(levelname)s %(asctime)s - %(module)s - %(funcName)s: %(message)s'))
log.addHandler(mainHandler)
PROC_... | <commit_before><commit_msg>Test tool for checking entropy available in a loop<commit_after> | #!/usr/bin/env python
import sys
import os
import logging
import time
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
mainHandler = logging.StreamHandler()
mainHandler.setFormatter(logging.Formatter('%(levelname)s %(asctime)s - %(module)s - %(funcName)s: %(message)s'))
log.addHandler(mainHandler)
PROC_... | Test tool for checking entropy available in a loop#!/usr/bin/env python
import sys
import os
import logging
import time
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
mainHandler = logging.StreamHandler()
mainHandler.setFormatter(logging.Formatter('%(levelname)s %(asctime)s - %(module)s - %(funcName)s: ... | <commit_before><commit_msg>Test tool for checking entropy available in a loop<commit_after>#!/usr/bin/env python
import sys
import os
import logging
import time
log = logging.getLogger(__name__)
log.setLevel(logging.INFO)
mainHandler = logging.StreamHandler()
mainHandler.setFormatter(logging.Formatter('%(levelname)s ... | |
8a029fb00892c8bf385dae76466ae1e211e27ca6 | cohydra/test_profile.py | cohydra/test_profile.py | import tempfile
import unittest
import unittest.mock
from . import profile
from . import test_helper
@unittest.mock.patch.object(
profile.Profile,
'generate',
autospec=True,
)
@unittest.mock.patch.object(
profile.Profile,
'__abstractmethods__',
new=set(),
)
class TestProfile(unittest.TestCase):
def... | Add basic test for profile.Profile. | Add basic test for profile.Profile.
Addresses #3.
| Python | apache-2.0 | dseomn/cohydra | Add basic test for profile.Profile.
Addresses #3. | import tempfile
import unittest
import unittest.mock
from . import profile
from . import test_helper
@unittest.mock.patch.object(
profile.Profile,
'generate',
autospec=True,
)
@unittest.mock.patch.object(
profile.Profile,
'__abstractmethods__',
new=set(),
)
class TestProfile(unittest.TestCase):
def... | <commit_before><commit_msg>Add basic test for profile.Profile.
Addresses #3.<commit_after> | import tempfile
import unittest
import unittest.mock
from . import profile
from . import test_helper
@unittest.mock.patch.object(
profile.Profile,
'generate',
autospec=True,
)
@unittest.mock.patch.object(
profile.Profile,
'__abstractmethods__',
new=set(),
)
class TestProfile(unittest.TestCase):
def... | Add basic test for profile.Profile.
Addresses #3.import tempfile
import unittest
import unittest.mock
from . import profile
from . import test_helper
@unittest.mock.patch.object(
profile.Profile,
'generate',
autospec=True,
)
@unittest.mock.patch.object(
profile.Profile,
'__abstractmethods__',
new=set(... | <commit_before><commit_msg>Add basic test for profile.Profile.
Addresses #3.<commit_after>import tempfile
import unittest
import unittest.mock
from . import profile
from . import test_helper
@unittest.mock.patch.object(
profile.Profile,
'generate',
autospec=True,
)
@unittest.mock.patch.object(
profile.Pro... | |
7bf60d5ef1e6052044ebfedf1e2bf2dddc0940b8 | python/getmonotime.py | python/getmonotime.py | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_path != None:
... | Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters to aid debugging. | Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters
to aid debugging.
| Python | bsd-2-clause | sippy/rtp_cluster,sippy/rtp_cluster | Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters
to aid debugging. | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_path != None:
... | <commit_before><commit_msg>Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters
to aid debugging.<commit_after> | import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
sippy_path = a.strip()
continue
if sippy_path != None:
... | Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters
to aid debugging.import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for o, a in opts:
if o == '-S':
... | <commit_before><commit_msg>Implement RTPP_LOG_TSTART and RTPP_LOG_TFORM="rel" env parameters
to aid debugging.<commit_after>import getopt, sys
if __name__ == '__main__':
sippy_path = None
try:
opts, args = getopt.getopt(sys.argv[1:], 's:S:i:o:b')
except getopt.GetoptError:
usage()
for... | |
5ee0f309521320f0cc91c61b112fd94c8415f37c | jinja2.py | jinja2.py | from __future__ import (division, absolute_import, print_function,
unicode_literals)
import jinja2
class PermissiveUndefined(jinja2.Undefined):
def __getattr__(self, name):
return PermissiveUndefined(name)
def __getitem__(self, name):
return PermissiveUndefined(name)
... | Add helpers to make Jinja2 more like Angular: PermissiveUndefined, JSDict, and JSList. | Add helpers to make Jinja2 more like Angular: PermissiveUndefined, JSDict, and JSList.
| Python | mit | emosenkis/angular2tmpl | Add helpers to make Jinja2 more like Angular: PermissiveUndefined, JSDict, and JSList. | from __future__ import (division, absolute_import, print_function,
unicode_literals)
import jinja2
class PermissiveUndefined(jinja2.Undefined):
def __getattr__(self, name):
return PermissiveUndefined(name)
def __getitem__(self, name):
return PermissiveUndefined(name)
... | <commit_before><commit_msg>Add helpers to make Jinja2 more like Angular: PermissiveUndefined, JSDict, and JSList.<commit_after> | from __future__ import (division, absolute_import, print_function,
unicode_literals)
import jinja2
class PermissiveUndefined(jinja2.Undefined):
def __getattr__(self, name):
return PermissiveUndefined(name)
def __getitem__(self, name):
return PermissiveUndefined(name)
... | Add helpers to make Jinja2 more like Angular: PermissiveUndefined, JSDict, and JSList.from __future__ import (division, absolute_import, print_function,
unicode_literals)
import jinja2
class PermissiveUndefined(jinja2.Undefined):
def __getattr__(self, name):
return PermissiveUndef... | <commit_before><commit_msg>Add helpers to make Jinja2 more like Angular: PermissiveUndefined, JSDict, and JSList.<commit_after>from __future__ import (division, absolute_import, print_function,
unicode_literals)
import jinja2
class PermissiveUndefined(jinja2.Undefined):
def __getattr__(se... | |
05b90dab50281e9b1cb35575d35db5f45d2ba15a | connected_components.py | connected_components.py | def get_connected_components():
# assume nodes labeled 1 to n
# connected_components = []
# for i in 1..n
# if i not yet explored
# connected_component = bfs (graph, node i)
# connected_components.append(connected_component)
# return connected_components
| Add pseudo for connected components | Add pseudo for connected components
| Python | mit | stephtzhang/algorithms | Add pseudo for connected components | def get_connected_components():
# assume nodes labeled 1 to n
# connected_components = []
# for i in 1..n
# if i not yet explored
# connected_component = bfs (graph, node i)
# connected_components.append(connected_component)
# return connected_components
| <commit_before><commit_msg>Add pseudo for connected components<commit_after> | def get_connected_components():
# assume nodes labeled 1 to n
# connected_components = []
# for i in 1..n
# if i not yet explored
# connected_component = bfs (graph, node i)
# connected_components.append(connected_component)
# return connected_components
| Add pseudo for connected componentsdef get_connected_components():
# assume nodes labeled 1 to n
# connected_components = []
# for i in 1..n
# if i not yet explored
# connected_component = bfs (graph, node i)
# connected_components.append(connected_component)
# return con... | <commit_before><commit_msg>Add pseudo for connected components<commit_after>def get_connected_components():
# assume nodes labeled 1 to n
# connected_components = []
# for i in 1..n
# if i not yet explored
# connected_component = bfs (graph, node i)
# connected_components.app... | |
c09446f758f42fbf00866360e0760f1a0fae0ab7 | tests/test_sso/test_azure_id_creation.py | tests/test_sso/test_azure_id_creation.py | from urllib.parse import urlparse
import pytest
from django.urls import reverse
from tests.utils import BaseViewTest
@pytest.mark.sso_mark
class AzureIdentityTest(BaseViewTest):
def test_wrong_provider_raises_404(self):
auth_path = reverse('oauth:create_identity', kwargs={'provider': 'undefined'})
... | Add azure id creation tests | Add azure id creation tests
| Python | apache-2.0 | polyaxon/polyaxon,polyaxon/polyaxon,polyaxon/polyaxon | Add azure id creation tests | from urllib.parse import urlparse
import pytest
from django.urls import reverse
from tests.utils import BaseViewTest
@pytest.mark.sso_mark
class AzureIdentityTest(BaseViewTest):
def test_wrong_provider_raises_404(self):
auth_path = reverse('oauth:create_identity', kwargs={'provider': 'undefined'})
... | <commit_before><commit_msg>Add azure id creation tests<commit_after> | from urllib.parse import urlparse
import pytest
from django.urls import reverse
from tests.utils import BaseViewTest
@pytest.mark.sso_mark
class AzureIdentityTest(BaseViewTest):
def test_wrong_provider_raises_404(self):
auth_path = reverse('oauth:create_identity', kwargs={'provider': 'undefined'})
... | Add azure id creation testsfrom urllib.parse import urlparse
import pytest
from django.urls import reverse
from tests.utils import BaseViewTest
@pytest.mark.sso_mark
class AzureIdentityTest(BaseViewTest):
def test_wrong_provider_raises_404(self):
auth_path = reverse('oauth:create_identity', kwargs={'pr... | <commit_before><commit_msg>Add azure id creation tests<commit_after>from urllib.parse import urlparse
import pytest
from django.urls import reverse
from tests.utils import BaseViewTest
@pytest.mark.sso_mark
class AzureIdentityTest(BaseViewTest):
def test_wrong_provider_raises_404(self):
auth_path = rev... | |
62906d37cca8cde2617372f71881dc802f23d6b9 | h2/frame_buffer.py | h2/frame_buffer.py | # -*- coding: utf-8 -*-
"""
h2/frame_buffer
~~~~~~~~~~~~~~~
A data structure that provides a way to iterate over a byte buffer in terms of
frames.
"""
from hyperframe.frame import Frame
class FrameBuffer(object):
"""
This is a data structure that expects to act as a buffer for HTTP/2 data
that allows ite... | Define an iterable frame buffer. | Define an iterable frame buffer.
| Python | mit | vladmunteanu/hyper-h2,vladmunteanu/hyper-h2,python-hyper/hyper-h2,bhavishyagopesh/hyper-h2,Kriechi/hyper-h2,python-hyper/hyper-h2,Kriechi/hyper-h2,mhils/hyper-h2 | Define an iterable frame buffer. | # -*- coding: utf-8 -*-
"""
h2/frame_buffer
~~~~~~~~~~~~~~~
A data structure that provides a way to iterate over a byte buffer in terms of
frames.
"""
from hyperframe.frame import Frame
class FrameBuffer(object):
"""
This is a data structure that expects to act as a buffer for HTTP/2 data
that allows ite... | <commit_before><commit_msg>Define an iterable frame buffer.<commit_after> | # -*- coding: utf-8 -*-
"""
h2/frame_buffer
~~~~~~~~~~~~~~~
A data structure that provides a way to iterate over a byte buffer in terms of
frames.
"""
from hyperframe.frame import Frame
class FrameBuffer(object):
"""
This is a data structure that expects to act as a buffer for HTTP/2 data
that allows ite... | Define an iterable frame buffer.# -*- coding: utf-8 -*-
"""
h2/frame_buffer
~~~~~~~~~~~~~~~
A data structure that provides a way to iterate over a byte buffer in terms of
frames.
"""
from hyperframe.frame import Frame
class FrameBuffer(object):
"""
This is a data structure that expects to act as a buffer for... | <commit_before><commit_msg>Define an iterable frame buffer.<commit_after># -*- coding: utf-8 -*-
"""
h2/frame_buffer
~~~~~~~~~~~~~~~
A data structure that provides a way to iterate over a byte buffer in terms of
frames.
"""
from hyperframe.frame import Frame
class FrameBuffer(object):
"""
This is a data stru... | |
595eaf19c1d3a89970b5ebe148f12a5df11807cc | run_helmholtz.py | run_helmholtz.py | from __future__ import absolute_import, print_function, division
from firedrake import *
from helmholtz import MixedHelmholtzProblem
from meshes import generate_2d_square_mesh
import matplotlib as plt
def run_helmholtz_resolution_test(degree, quadrilateral=False):
"""
"""
params = {'mat_type': 'matfree... | Add module for helmholtz results | Add module for helmholtz results
| Python | mit | thomasgibson/firedrake-hybridization | Add module for helmholtz results | from __future__ import absolute_import, print_function, division
from firedrake import *
from helmholtz import MixedHelmholtzProblem
from meshes import generate_2d_square_mesh
import matplotlib as plt
def run_helmholtz_resolution_test(degree, quadrilateral=False):
"""
"""
params = {'mat_type': 'matfree... | <commit_before><commit_msg>Add module for helmholtz results<commit_after> | from __future__ import absolute_import, print_function, division
from firedrake import *
from helmholtz import MixedHelmholtzProblem
from meshes import generate_2d_square_mesh
import matplotlib as plt
def run_helmholtz_resolution_test(degree, quadrilateral=False):
"""
"""
params = {'mat_type': 'matfree... | Add module for helmholtz resultsfrom __future__ import absolute_import, print_function, division
from firedrake import *
from helmholtz import MixedHelmholtzProblem
from meshes import generate_2d_square_mesh
import matplotlib as plt
def run_helmholtz_resolution_test(degree, quadrilateral=False):
"""
"""
... | <commit_before><commit_msg>Add module for helmholtz results<commit_after>from __future__ import absolute_import, print_function, division
from firedrake import *
from helmholtz import MixedHelmholtzProblem
from meshes import generate_2d_square_mesh
import matplotlib as plt
def run_helmholtz_resolution_test(degree, ... | |
3ef4e68ae64a46f09103001f391b3d6a3d098e33 | test/test_bezier_direct.py | test/test_bezier_direct.py | from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import Sprite
import pyglet
from cocos import path
def direct_bezier(p0, p1, p2, p3):
'''G... | Test using bezier going through 4 specific points | Test using bezier going through 4 specific points
git-svn-id: 5665c17dde288ce6190d85f4a2d6486351776710@869 f663ce52-ac46-0410-b8de-c1c220b0eb76
| Python | bsd-3-clause | eevee/cocos2d-mirror | Test using bezier going through 4 specific points
git-svn-id: 5665c17dde288ce6190d85f4a2d6486351776710@869 f663ce52-ac46-0410-b8de-c1c220b0eb76 | from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import Sprite
import pyglet
from cocos import path
def direct_bezier(p0, p1, p2, p3):
'''G... | <commit_before><commit_msg>Test using bezier going through 4 specific points
git-svn-id: 5665c17dde288ce6190d85f4a2d6486351776710@869 f663ce52-ac46-0410-b8de-c1c220b0eb76<commit_after> | from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
from cocos.actions import Bezier
from cocos.sprite import Sprite
import pyglet
from cocos import path
def direct_bezier(p0, p1, p2, p3):
'''G... | Test using bezier going through 4 specific points
git-svn-id: 5665c17dde288ce6190d85f4a2d6486351776710@869 f663ce52-ac46-0410-b8de-c1c220b0eb76from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import cocos
from cocos.director import director
f... | <commit_before><commit_msg>Test using bezier going through 4 specific points
git-svn-id: 5665c17dde288ce6190d85f4a2d6486351776710@869 f663ce52-ac46-0410-b8de-c1c220b0eb76<commit_after>from __future__ import division
import sys
import os
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))
#
import co... | |
b4a932eb8d99f9f4d29d3459c62e0cf81240fbdb | scripts/stats.py | scripts/stats.py | import os
import telegram
from leonard import Leonard
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
bot.collect_plugins()
def main():
count = 0
for key in bot.redis.scan_iter(match='user:*:registered'):
count += 1
print('Total users:', count)
if __name_... | Add script for counting all users count | Add script for counting all users count
| Python | mit | sevazhidkov/leonard | Add script for counting all users count | import os
import telegram
from leonard import Leonard
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
bot.collect_plugins()
def main():
count = 0
for key in bot.redis.scan_iter(match='user:*:registered'):
count += 1
print('Total users:', count)
if __name_... | <commit_before><commit_msg>Add script for counting all users count<commit_after> | import os
import telegram
from leonard import Leonard
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
bot.collect_plugins()
def main():
count = 0
for key in bot.redis.scan_iter(match='user:*:registered'):
count += 1
print('Total users:', count)
if __name_... | Add script for counting all users countimport os
import telegram
from leonard import Leonard
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
bot.collect_plugins()
def main():
count = 0
for key in bot.redis.scan_iter(match='user:*:registered'):
count += 1
pr... | <commit_before><commit_msg>Add script for counting all users count<commit_after>import os
import telegram
from leonard import Leonard
telegram_client = telegram.Bot(os.environ['BOT_TOKEN'])
bot = Leonard(telegram_client)
bot.collect_plugins()
def main():
count = 0
for key in bot.redis.scan_iter(match='user:*... | |
8f97a104bf988a277453bf70043829c45a394919 | libvirt/libvirt_attach_device_rbd.py | libvirt/libvirt_attach_device_rbd.py | #!/usr/bin/env python
__author__ = 'weezhard'
__license__ = 'GPL'
__version__ = '1.0.0'
import sys
import argparse
import libvirt
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('-d','--domain', help='Domain libvirt',required=True)
parser.add_argument('-p','--pool',help='Pool ceph', require... | Add script attach device rbd | Add script attach device rbd
| Python | apache-2.0 | skylost/heap,skylost/heap,skylost/heap | Add script attach device rbd | #!/usr/bin/env python
__author__ = 'weezhard'
__license__ = 'GPL'
__version__ = '1.0.0'
import sys
import argparse
import libvirt
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('-d','--domain', help='Domain libvirt',required=True)
parser.add_argument('-p','--pool',help='Pool ceph', require... | <commit_before><commit_msg>Add script attach device rbd<commit_after> | #!/usr/bin/env python
__author__ = 'weezhard'
__license__ = 'GPL'
__version__ = '1.0.0'
import sys
import argparse
import libvirt
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('-d','--domain', help='Domain libvirt',required=True)
parser.add_argument('-p','--pool',help='Pool ceph', require... | Add script attach device rbd#!/usr/bin/env python
__author__ = 'weezhard'
__license__ = 'GPL'
__version__ = '1.0.0'
import sys
import argparse
import libvirt
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('-d','--domain', help='Domain libvirt',required=True)
parser.add_argument('-p','--poo... | <commit_before><commit_msg>Add script attach device rbd<commit_after>#!/usr/bin/env python
__author__ = 'weezhard'
__license__ = 'GPL'
__version__ = '1.0.0'
import sys
import argparse
import libvirt
import subprocess
parser = argparse.ArgumentParser()
parser.add_argument('-d','--domain', help='Domain libvirt',requi... | |
a20a1cc4ff34185fa1badf812f292c007f9f3d05 | flexx/ui/examples/using_python_in_js.py | flexx/ui/examples/using_python_in_js.py | # doc-export: UsingPython
"""
This example demonstrates what things from Python land can be used in JS.
Flexx detects what names are used in the transpiled JS of a Model (or
Widget class, and tries to look these up in the module, converting the
used objects if possible.
Check out the source of the generated page to s... | Add example for using Python in JS | Add example for using Python in JS
| Python | bsd-2-clause | zoofIO/flexx,JohnLunzer/flexx,JohnLunzer/flexx,zoofIO/flexx,jrversteegh/flexx,JohnLunzer/flexx,jrversteegh/flexx | Add example for using Python in JS | # doc-export: UsingPython
"""
This example demonstrates what things from Python land can be used in JS.
Flexx detects what names are used in the transpiled JS of a Model (or
Widget class, and tries to look these up in the module, converting the
used objects if possible.
Check out the source of the generated page to s... | <commit_before><commit_msg>Add example for using Python in JS<commit_after> | # doc-export: UsingPython
"""
This example demonstrates what things from Python land can be used in JS.
Flexx detects what names are used in the transpiled JS of a Model (or
Widget class, and tries to look these up in the module, converting the
used objects if possible.
Check out the source of the generated page to s... | Add example for using Python in JS# doc-export: UsingPython
"""
This example demonstrates what things from Python land can be used in JS.
Flexx detects what names are used in the transpiled JS of a Model (or
Widget class, and tries to look these up in the module, converting the
used objects if possible.
Check out the... | <commit_before><commit_msg>Add example for using Python in JS<commit_after># doc-export: UsingPython
"""
This example demonstrates what things from Python land can be used in JS.
Flexx detects what names are used in the transpiled JS of a Model (or
Widget class, and tries to look these up in the module, converting the... | |
2eceebdd1eb052b81b6563e7bd58c275c4f74592 | bin/check_rule_algs.py | bin/check_rule_algs.py | # Print list of rules with invalid algs
from api import config
from api.dao import APINotFoundException
from api.jobs.gears import get_gear_by_name
if __name__ == '__main__':
for rule in config.db.project_rules.find({}):
alg = rule.get('alg')
if not alg:
print 'Rule {} has no alg.'.f... | Add script to find malformed rules | Add script to find malformed rules
| Python | mit | scitran/core,scitran/api,scitran/core,scitran/core,scitran/api,scitran/core | Add script to find malformed rules | # Print list of rules with invalid algs
from api import config
from api.dao import APINotFoundException
from api.jobs.gears import get_gear_by_name
if __name__ == '__main__':
for rule in config.db.project_rules.find({}):
alg = rule.get('alg')
if not alg:
print 'Rule {} has no alg.'.f... | <commit_before><commit_msg>Add script to find malformed rules<commit_after> | # Print list of rules with invalid algs
from api import config
from api.dao import APINotFoundException
from api.jobs.gears import get_gear_by_name
if __name__ == '__main__':
for rule in config.db.project_rules.find({}):
alg = rule.get('alg')
if not alg:
print 'Rule {} has no alg.'.f... | Add script to find malformed rules# Print list of rules with invalid algs
from api import config
from api.dao import APINotFoundException
from api.jobs.gears import get_gear_by_name
if __name__ == '__main__':
for rule in config.db.project_rules.find({}):
alg = rule.get('alg')
if not alg:
... | <commit_before><commit_msg>Add script to find malformed rules<commit_after># Print list of rules with invalid algs
from api import config
from api.dao import APINotFoundException
from api.jobs.gears import get_gear_by_name
if __name__ == '__main__':
for rule in config.db.project_rules.find({}):
alg = rul... | |
a715d344b72d598d06d8aaba4f82687e0657bd60 | python/one-offs/list-to-json.py | python/one-offs/list-to-json.py | ''' One-off junk code to convert a list of programming languages with some extra information in the comments to JSON
'''
from collections import OrderedDict
languages = []
for line in t.split('\n'):
language = OrderedDict()
slashes = line.find('//')
if slashes != -1:
language_name, language_etc =... | Add one-off script to convert a list of programming languages to JSON | Add one-off script to convert a list of programming languages to JSON
| Python | mit | bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile,bmaupin/junkpile | Add one-off script to convert a list of programming languages to JSON | ''' One-off junk code to convert a list of programming languages with some extra information in the comments to JSON
'''
from collections import OrderedDict
languages = []
for line in t.split('\n'):
language = OrderedDict()
slashes = line.find('//')
if slashes != -1:
language_name, language_etc =... | <commit_before><commit_msg>Add one-off script to convert a list of programming languages to JSON<commit_after> | ''' One-off junk code to convert a list of programming languages with some extra information in the comments to JSON
'''
from collections import OrderedDict
languages = []
for line in t.split('\n'):
language = OrderedDict()
slashes = line.find('//')
if slashes != -1:
language_name, language_etc =... | Add one-off script to convert a list of programming languages to JSON''' One-off junk code to convert a list of programming languages with some extra information in the comments to JSON
'''
from collections import OrderedDict
languages = []
for line in t.split('\n'):
language = OrderedDict()
slashes = line.f... | <commit_before><commit_msg>Add one-off script to convert a list of programming languages to JSON<commit_after>''' One-off junk code to convert a list of programming languages with some extra information in the comments to JSON
'''
from collections import OrderedDict
languages = []
for line in t.split('\n'):
lang... | |
6b1f487f2ceb64b6b024b9d959a8ed5a0cd4d713 | tests/rules_tests/FromRuleComputeTest.py | tests/rules_tests/FromRuleComputeTest.py | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromRuleComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file for Rule.rule tests | Add file for Rule.rule tests
| Python | mit | PatrikValkovic/grammpy | Add file for Rule.rule tests | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromRuleComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add file for Rule.rule tests<commit_after> | #!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromRuleComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| Add file for Rule.rule tests#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromRuleComputeTest(TestCase):
pass
if __name__ == '__main__':
main()
| <commit_before><commit_msg>Add file for Rule.rule tests<commit_after>#!/usr/bin/env python
"""
:Author Patrik Valkovic
:Created 23.06.2017 16:39
:Licence GNUv3
Part of grammpy
"""
from unittest import main, TestCase
from grammpy import Rule
class FromRuleComputeTest(TestCase):
pass
if __name__ == '__main__':
... | |
76f868137d1ee98f148032269251116887db38d5 | loader.py | loader.py | from interface import Marcotti
from models.config.local import LocalConfig
from etl import get_local_handles, ingest_feeds
from etl.csv import CSV_ETL_CLASSES
if __name__ == "__main__":
settings = LocalConfig()
marcotti = Marcotti(settings)
with marcotti.create_session() as sess:
for group in ['Ov... | Create script to execute Marcotti ETL | Create script to execute Marcotti ETL
| Python | mit | soccermetrics/marcotti | Create script to execute Marcotti ETL | from interface import Marcotti
from models.config.local import LocalConfig
from etl import get_local_handles, ingest_feeds
from etl.csv import CSV_ETL_CLASSES
if __name__ == "__main__":
settings = LocalConfig()
marcotti = Marcotti(settings)
with marcotti.create_session() as sess:
for group in ['Ov... | <commit_before><commit_msg>Create script to execute Marcotti ETL<commit_after> | from interface import Marcotti
from models.config.local import LocalConfig
from etl import get_local_handles, ingest_feeds
from etl.csv import CSV_ETL_CLASSES
if __name__ == "__main__":
settings = LocalConfig()
marcotti = Marcotti(settings)
with marcotti.create_session() as sess:
for group in ['Ov... | Create script to execute Marcotti ETLfrom interface import Marcotti
from models.config.local import LocalConfig
from etl import get_local_handles, ingest_feeds
from etl.csv import CSV_ETL_CLASSES
if __name__ == "__main__":
settings = LocalConfig()
marcotti = Marcotti(settings)
with marcotti.create_session... | <commit_before><commit_msg>Create script to execute Marcotti ETL<commit_after>from interface import Marcotti
from models.config.local import LocalConfig
from etl import get_local_handles, ingest_feeds
from etl.csv import CSV_ETL_CLASSES
if __name__ == "__main__":
settings = LocalConfig()
marcotti = Marcotti(s... | |
bd717b8056a69ee7074a94b3234d840dd431dd1f | src/341_flatten_nested_list_iterator.py | src/341_flatten_nested_list_iterator.py | """
This is the interface that allows for creating nested lists.
You should not implement it, or speculate about its implementation
"""
class NestedInteger(object):
def isInteger(self):
"""
@return True if this NestedInteger holds a single integer, rather than a nested list.
:rtype bool
"... | Use stack to solve the problem | Use stack to solve the problem
| Python | apache-2.0 | zhuxiang/LeetCode-Python | Use stack to solve the problem | """
This is the interface that allows for creating nested lists.
You should not implement it, or speculate about its implementation
"""
class NestedInteger(object):
def isInteger(self):
"""
@return True if this NestedInteger holds a single integer, rather than a nested list.
:rtype bool
"... | <commit_before><commit_msg>Use stack to solve the problem<commit_after> | """
This is the interface that allows for creating nested lists.
You should not implement it, or speculate about its implementation
"""
class NestedInteger(object):
def isInteger(self):
"""
@return True if this NestedInteger holds a single integer, rather than a nested list.
:rtype bool
"... | Use stack to solve the problem"""
This is the interface that allows for creating nested lists.
You should not implement it, or speculate about its implementation
"""
class NestedInteger(object):
def isInteger(self):
"""
@return True if this NestedInteger holds a single integer, rather than a nested lis... | <commit_before><commit_msg>Use stack to solve the problem<commit_after>"""
This is the interface that allows for creating nested lists.
You should not implement it, or speculate about its implementation
"""
class NestedInteger(object):
def isInteger(self):
"""
@return True if this NestedInteger holds a... | |
466b8a8fb2bdf7ca8f74316fac3e483c3ba763b5 | net/data/websocket/protocol-test_wsh.py | net/data/websocket/protocol-test_wsh.py | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | Make Pepper WebSocket UtilityGetProtocol test less flaky by making the wsh wait for close | Make Pepper WebSocket UtilityGetProtocol test less flaky by making the wsh wait for close
Attempt to fix the flakiness by making sure the server handler doesn't exit
before the client closes.
BUG=389084
R=jgraettinger,yhirano
Review URL: https://codereview.chromium.org/410383003
git-svn-id: de016e52bd170d2d4f2344f9... | Python | bsd-3-clause | TheTypoMaster/chromium-crosswalk,dednal/chromium.src,Pluto-tv/chromium-crosswalk,M4sse/chromium.src,bright-sparks/chromium-spacewalk,ondra-novak/chromium.src,chuan9/chromium-crosswalk,Jonekee/chromium.src,axinging/chromium-crosswalk,krieger-od/nwjs_chromium.src,chuan9/chromium-crosswalk,PeterWangIntel/chromium-crosswal... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | <commit_before># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if ... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | # Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if len(r) == 1:
... | <commit_before># Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
import cgi
from mod_pywebsocket import msgutil
def web_socket_do_extra_handshake(request):
r = request.ws_resource.split('?', 1)
if ... |
de802c22865e4369cb938be7d7931b7e53374059 | scripts/fix_nodes_with_no_creator.py | scripts/fix_nodes_with_no_creator.py | import logging
import sys
from django.db import transaction
from website.app import setup_django
setup_django()
from osf.models import AbstractNode
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def main():
dry = '--dry' in sys.argv
if not dry:
# If we're not running ... | Add one-off script to fix nodes with no creator | Add one-off script to fix nodes with no creator
OSF-8571
| Python | apache-2.0 | brianjgeiger/osf.io,baylee-d/osf.io,cslzchen/osf.io,Johnetordoff/osf.io,icereval/osf.io,chennan47/osf.io,aaxelb/osf.io,HalcyonChimera/osf.io,pattisdr/osf.io,leb2dg/osf.io,laurenrevere/osf.io,felliott/osf.io,aaxelb/osf.io,aaxelb/osf.io,CenterForOpenScience/osf.io,adlius/osf.io,baylee-d/osf.io,leb2dg/osf.io,binoculars/os... | Add one-off script to fix nodes with no creator
OSF-8571 | import logging
import sys
from django.db import transaction
from website.app import setup_django
setup_django()
from osf.models import AbstractNode
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def main():
dry = '--dry' in sys.argv
if not dry:
# If we're not running ... | <commit_before><commit_msg>Add one-off script to fix nodes with no creator
OSF-8571<commit_after> | import logging
import sys
from django.db import transaction
from website.app import setup_django
setup_django()
from osf.models import AbstractNode
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def main():
dry = '--dry' in sys.argv
if not dry:
# If we're not running ... | Add one-off script to fix nodes with no creator
OSF-8571import logging
import sys
from django.db import transaction
from website.app import setup_django
setup_django()
from osf.models import AbstractNode
from scripts import utils as script_utils
logger = logging.getLogger(__name__)
def main():
dry = '--dry' in... | <commit_before><commit_msg>Add one-off script to fix nodes with no creator
OSF-8571<commit_after>import logging
import sys
from django.db import transaction
from website.app import setup_django
setup_django()
from osf.models import AbstractNode
from scripts import utils as script_utils
logger = logging.getLogger(__... | |
cd2c0f6111221990c3838a64961d24208c310a1d | snippets/python/matplotlib-colors.py | snippets/python/matplotlib-colors.py | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib
def create_color_list():
color_names = matplotlib.colors.cnames
color_list = []
for key,val... | Add printing of color codes in matplotlib | Add printing of color codes in matplotlib
| Python | apache-2.0 | nathanielng/code-templates,nathanielng/code-templates,nathanielng/code-templates | Add printing of color codes in matplotlib | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib
def create_color_list():
color_names = matplotlib.colors.cnames
color_list = []
for key,val... | <commit_before><commit_msg>Add printing of color codes in matplotlib<commit_after> | #!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib
def create_color_list():
color_names = matplotlib.colors.cnames
color_list = []
for key,val... | Add printing of color codes in matplotlib#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib
def create_color_list():
color_names = matplotlib.colors.cn... | <commit_before><commit_msg>Add printing of color codes in matplotlib<commit_after>#!/usr/bin/env python
# -*- coding: UTF-8 -*-
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import matplotlib
def create_color_list(... | |
23336c48a1dafcea47dab68b8915add1c7ff9f4f | src/sentry/api/serializers/rest_framework/origin.py | src/sentry/api/serializers/rest_framework/origin.py | from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(self, data):
... | from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(self, data):
... | Fix formatting of API error message | fix(api): Fix formatting of API error message
| Python | bsd-3-clause | mvaled/sentry,gencer/sentry,gencer/sentry,ifduyue/sentry,ifduyue/sentry,ifduyue/sentry,mvaled/sentry,looker/sentry,beeftornado/sentry,looker/sentry,looker/sentry,beeftornado/sentry,mvaled/sentry,mvaled/sentry,beeftornado/sentry,gencer/sentry,ifduyue/sentry,looker/sentry,mvaled/sentry,mvaled/sentry,gencer/sentry,gencer/... | from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(self, data):
... | from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(self, data):
... | <commit_before>from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(se... | from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(self, data):
... | from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(self, data):
... | <commit_before>from __future__ import absolute_import
from rest_framework import serializers
from sentry.utils.http import parse_uri_match
class OriginField(serializers.CharField):
# Special case origins that don't fit the normal regex pattern, but are valid
WHITELIST_ORIGINS = ('*')
def from_native(se... |
2a0544bf399dbfbdb8e6d4ef4faf91e19a3c0a15 | numba/cuda/tests/cudapy/test_warning.py | numba/cuda/tests/cudapy/test_warning.py | import numpy as np
from numba import cuda
from numba.cuda.testing import CUDATestCase, skip_on_cudasim
from numba.tests.support import override_config
from numba.core.errors import NumbaPerformanceWarning
import warnings
def numba_dist_cuda(a, b, dist):
len = a.shape[0]
for i in range(len):
dist[i] = ... | Add new file to test kernel efficiency warnings | Add new file to test kernel efficiency warnings
| Python | bsd-2-clause | cpcloud/numba,seibert/numba,seibert/numba,cpcloud/numba,cpcloud/numba,numba/numba,stuartarchibald/numba,seibert/numba,stuartarchibald/numba,cpcloud/numba,seibert/numba,IntelLabs/numba,IntelLabs/numba,seibert/numba,stonebig/numba,cpcloud/numba,stuartarchibald/numba,stonebig/numba,stuartarchibald/numba,stonebig/numba,num... | Add new file to test kernel efficiency warnings | import numpy as np
from numba import cuda
from numba.cuda.testing import CUDATestCase, skip_on_cudasim
from numba.tests.support import override_config
from numba.core.errors import NumbaPerformanceWarning
import warnings
def numba_dist_cuda(a, b, dist):
len = a.shape[0]
for i in range(len):
dist[i] = ... | <commit_before><commit_msg>Add new file to test kernel efficiency warnings<commit_after> | import numpy as np
from numba import cuda
from numba.cuda.testing import CUDATestCase, skip_on_cudasim
from numba.tests.support import override_config
from numba.core.errors import NumbaPerformanceWarning
import warnings
def numba_dist_cuda(a, b, dist):
len = a.shape[0]
for i in range(len):
dist[i] = ... | Add new file to test kernel efficiency warningsimport numpy as np
from numba import cuda
from numba.cuda.testing import CUDATestCase, skip_on_cudasim
from numba.tests.support import override_config
from numba.core.errors import NumbaPerformanceWarning
import warnings
def numba_dist_cuda(a, b, dist):
len = a.shape... | <commit_before><commit_msg>Add new file to test kernel efficiency warnings<commit_after>import numpy as np
from numba import cuda
from numba.cuda.testing import CUDATestCase, skip_on_cudasim
from numba.tests.support import override_config
from numba.core.errors import NumbaPerformanceWarning
import warnings
def numba... | |
512ab87b1786f8c3d003a62337eee75beff9d960 | scripts/postag2file.py | scripts/postag2file.py | # Copyright 2018 Tomas Machalek <[email protected]>
# Copyright 2018 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
#
# 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... | Add a helper script to dump tags to a file | Add a helper script to dump tags to a file
| Python | apache-2.0 | czcorpus/vert-tagextract,czcorpus/vert-tagextract | Add a helper script to dump tags to a file | # Copyright 2018 Tomas Machalek <[email protected]>
# Copyright 2018 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain... | <commit_before><commit_msg>Add a helper script to dump tags to a file<commit_after> | # Copyright 2018 Tomas Machalek <[email protected]>
# Copyright 2018 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
#
# 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... | Add a helper script to dump tags to a file# Copyright 2018 Tomas Machalek <[email protected]>
# Copyright 2018 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in com... | <commit_before><commit_msg>Add a helper script to dump tags to a file<commit_after># Copyright 2018 Tomas Machalek <[email protected]>
# Copyright 2018 Charles University, Faculty of Arts,
# Institute of the Czech National Corpus
#
# Licensed under the Apache License, Version 2.0 (the "License");
... | |
0721d6129da01c693d8a28c12d66e6b55d37f964 | scripts/extract_pivots_from_model.py | scripts/extract_pivots_from_model.py | #!/usr/bin/env python
import sys
import numpy as np
import torch
from learn_pivots_tm import PivotLearnerModel, StraightThroughLayer
def main(args):
if len(args) < 1:
sys.stderr.write("Required arguments: <model file> [num pivots (100)]\n")
sys.exit(-1)
num_pivots = 100
if len(args) > 1:... | Add code for extracting best pivot features from saved neural model. | Add code for extracting best pivot features from saved neural model.
| Python | apache-2.0 | tmills/uda,tmills/uda | Add code for extracting best pivot features from saved neural model. | #!/usr/bin/env python
import sys
import numpy as np
import torch
from learn_pivots_tm import PivotLearnerModel, StraightThroughLayer
def main(args):
if len(args) < 1:
sys.stderr.write("Required arguments: <model file> [num pivots (100)]\n")
sys.exit(-1)
num_pivots = 100
if len(args) > 1:... | <commit_before><commit_msg>Add code for extracting best pivot features from saved neural model.<commit_after> | #!/usr/bin/env python
import sys
import numpy as np
import torch
from learn_pivots_tm import PivotLearnerModel, StraightThroughLayer
def main(args):
if len(args) < 1:
sys.stderr.write("Required arguments: <model file> [num pivots (100)]\n")
sys.exit(-1)
num_pivots = 100
if len(args) > 1:... | Add code for extracting best pivot features from saved neural model.#!/usr/bin/env python
import sys
import numpy as np
import torch
from learn_pivots_tm import PivotLearnerModel, StraightThroughLayer
def main(args):
if len(args) < 1:
sys.stderr.write("Required arguments: <model file> [num pivots (100)]\... | <commit_before><commit_msg>Add code for extracting best pivot features from saved neural model.<commit_after>#!/usr/bin/env python
import sys
import numpy as np
import torch
from learn_pivots_tm import PivotLearnerModel, StraightThroughLayer
def main(args):
if len(args) < 1:
sys.stderr.write("Required ar... | |
4b25a7d34ea17c86c4b40a09f85898ea4769b22b | airflow/contrib/operators/file_to_gcs.py | airflow/contrib/operators/file_to_gcs.py | # -*- coding: utf-8 -*-
#
# 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
... | Add file to GCS operator | [AIRFLOW-125] Add file to GCS operator
Adds an operator to upload a file to Google Cloud Storage. Used as follows:
```py
from airflow.contrib.operators.file_to_gcs import FileToGoogleCloudStorageOperator
gcs = FileToGoogleCloudStorageOperator(
bucket='a-bucket-i-have-access-to-on-gcs',
dag=dag,
... | Python | apache-2.0 | dmitry-r/incubator-airflow,r39132/airflow,ledsusop/airflow,spektom/incubator-airflow,yk5/incubator-airflow,wndhydrnt/airflow,dmitry-r/incubator-airflow,subodhchhabra/airflow,juvoinc/airflow,zodiac/incubator-airflow,lyft/incubator-airflow,sdiazb/airflow,zoyahav/incubator-airflow,DEVELByte/incubator-airflow,adrpar/incuba... | [AIRFLOW-125] Add file to GCS operator
Adds an operator to upload a file to Google Cloud Storage. Used as follows:
```py
from airflow.contrib.operators.file_to_gcs import FileToGoogleCloudStorageOperator
gcs = FileToGoogleCloudStorageOperator(
bucket='a-bucket-i-have-access-to-on-gcs',
dag=dag,
... | # -*- coding: utf-8 -*-
#
# 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
... | <commit_before><commit_msg>[AIRFLOW-125] Add file to GCS operator
Adds an operator to upload a file to Google Cloud Storage. Used as follows:
```py
from airflow.contrib.operators.file_to_gcs import FileToGoogleCloudStorageOperator
gcs = FileToGoogleCloudStorageOperator(
bucket='a-bucket-i-have-access-to-on-gcs... | # -*- coding: utf-8 -*-
#
# 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
... | [AIRFLOW-125] Add file to GCS operator
Adds an operator to upload a file to Google Cloud Storage. Used as follows:
```py
from airflow.contrib.operators.file_to_gcs import FileToGoogleCloudStorageOperator
gcs = FileToGoogleCloudStorageOperator(
bucket='a-bucket-i-have-access-to-on-gcs',
dag=dag,
... | <commit_before><commit_msg>[AIRFLOW-125] Add file to GCS operator
Adds an operator to upload a file to Google Cloud Storage. Used as follows:
```py
from airflow.contrib.operators.file_to_gcs import FileToGoogleCloudStorageOperator
gcs = FileToGoogleCloudStorageOperator(
bucket='a-bucket-i-have-access-to-on-gcs... | |
655f2ac31df0055c06005311820848cceaea4122 | nonclass.py | nonclass.py | from os import system
from time import sleep
from msvcrt import getch
from threading import Thread
system('mode 50,30')
game_running = True
direction = 1
delay = 0.07
def clear():
system('cls')
def controller():
global game_running,direction,delay
while game_running:
key = ord(getch())
if key... | Test file added to estimate performance of program between systems. | Test file added to estimate performance of program between systems.
| Python | mit | thebongy/Snake | Test file added to estimate performance of program between systems. | from os import system
from time import sleep
from msvcrt import getch
from threading import Thread
system('mode 50,30')
game_running = True
direction = 1
delay = 0.07
def clear():
system('cls')
def controller():
global game_running,direction,delay
while game_running:
key = ord(getch())
if key... | <commit_before><commit_msg>Test file added to estimate performance of program between systems.<commit_after> | from os import system
from time import sleep
from msvcrt import getch
from threading import Thread
system('mode 50,30')
game_running = True
direction = 1
delay = 0.07
def clear():
system('cls')
def controller():
global game_running,direction,delay
while game_running:
key = ord(getch())
if key... | Test file added to estimate performance of program between systems.from os import system
from time import sleep
from msvcrt import getch
from threading import Thread
system('mode 50,30')
game_running = True
direction = 1
delay = 0.07
def clear():
system('cls')
def controller():
global game_running,di... | <commit_before><commit_msg>Test file added to estimate performance of program between systems.<commit_after>from os import system
from time import sleep
from msvcrt import getch
from threading import Thread
system('mode 50,30')
game_running = True
direction = 1
delay = 0.07
def clear():
system('cls')
d... | |
a8a85a4bf0185a43b492ab8e81b558128db392aa | scripts/slice_trace.py | scripts/slice_trace.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import collections
import json
import math
import os
def parse_args():
description = """Slice JSON .trace file into smaller pieces."""... | Add a script to slice traces bigger than 256MB | Add a script to slice traces bigger than 256MB
Summary:
The chrome://tracing viewer doesn't support files larger than 256MB,
to make it possible to look at traces from larger builds we add this
simple script that splits a bigger trace into smaller chunks.
Test Plan: manual
Reviewed By: k21
fbshipit-source-id: 8c35a... | Python | apache-2.0 | k21/buck,robbertvanginkel/buck,rmaz/buck,vschs007/buck,sdwilsh/buck,sdwilsh/buck,clonetwin26/buck,justinmuller/buck,justinmuller/buck,raviagarwal7/buck,SeleniumHQ/buck,robbertvanginkel/buck,k21/buck,k21/buck,SeleniumHQ/buck,kageiit/buck,darkforestzero/buck,robbertvanginkel/buck,SeleniumHQ/buck,LegNeato/buck,rmaz/buck,v... | Add a script to slice traces bigger than 256MB
Summary:
The chrome://tracing viewer doesn't support files larger than 256MB,
to make it possible to look at traces from larger builds we add this
simple script that splits a bigger trace into smaller chunks.
Test Plan: manual
Reviewed By: k21
fbshipit-source-id: 8c35a... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import collections
import json
import math
import os
def parse_args():
description = """Slice JSON .trace file into smaller pieces."""... | <commit_before><commit_msg>Add a script to slice traces bigger than 256MB
Summary:
The chrome://tracing viewer doesn't support files larger than 256MB,
to make it possible to look at traces from larger builds we add this
simple script that splits a bigger trace into smaller chunks.
Test Plan: manual
Reviewed By: k21... | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
import argparse
import codecs
import collections
import json
import math
import os
def parse_args():
description = """Slice JSON .trace file into smaller pieces."""... | Add a script to slice traces bigger than 256MB
Summary:
The chrome://tracing viewer doesn't support files larger than 256MB,
to make it possible to look at traces from larger builds we add this
simple script that splits a bigger trace into smaller chunks.
Test Plan: manual
Reviewed By: k21
fbshipit-source-id: 8c35a... | <commit_before><commit_msg>Add a script to slice traces bigger than 256MB
Summary:
The chrome://tracing viewer doesn't support files larger than 256MB,
to make it possible to look at traces from larger builds we add this
simple script that splits a bigger trace into smaller chunks.
Test Plan: manual
Reviewed By: k21... | |
2268cc13d4af71f1fbff4af26631013664fc1d93 | pycroft/_compat.py | pycroft/_compat.py | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import sys
import operator
PY2 = sys.version_info[0] == 2
if PY2:
chr = unichr
text_type = unicode
... | Add a Python 3 compatibility helper | Add a Python 3 compatibility helper
| Python | apache-2.0 | agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,lukasjuhrich/pycroft,agdsn/pycroft,agdsn/pycroft | Add a Python 3 compatibility helper | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import sys
import operator
PY2 = sys.version_info[0] == 2
if PY2:
chr = unichr
text_type = unicode
... | <commit_before><commit_msg>Add a Python 3 compatibility helper<commit_after> | # Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import sys
import operator
PY2 = sys.version_info[0] == 2
if PY2:
chr = unichr
text_type = unicode
... | Add a Python 3 compatibility helper# Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import sys
import operator
PY2 = sys.version_info[0] == 2
if PY2:
chr ... | <commit_before><commit_msg>Add a Python 3 compatibility helper<commit_after># Copyright (c) 2015 The Pycroft Authors. See the AUTHORS file.
# This file is part of the Pycroft project and licensed under the terms of
# the Apache License, Version 2.0. See the LICENSE file for details.
import sys
import operator
PY2 = s... | |
8921f9a5d991cd6962d3d16f6e72d53d06a1e86f | rgbLed.py | rgbLed.py | '''
Dr Who Box: RGB Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
RED = 23
GREEN = 24
BLUE = 26
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setup(RED, GPIO.OUT, GPIO.HIGH)
GPIO.setup(GREEN... | Add an RGB LED for initial experimentation. | Add an RGB LED for initial experimentation.
| Python | mit | davidb24v/drwho | Add an RGB LED for initial experimentation. | '''
Dr Who Box: RGB Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
RED = 23
GREEN = 24
BLUE = 26
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setup(RED, GPIO.OUT, GPIO.HIGH)
GPIO.setup(GREEN... | <commit_before><commit_msg>Add an RGB LED for initial experimentation.<commit_after> | '''
Dr Who Box: RGB Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
RED = 23
GREEN = 24
BLUE = 26
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setup(RED, GPIO.OUT, GPIO.HIGH)
GPIO.setup(GREEN... | Add an RGB LED for initial experimentation.'''
Dr Who Box: RGB Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
RED = 23
GREEN = 24
BLUE = 26
# Use numbering based on P1 header
GPIO.setmode(GPIO.BOARD)
GPIO.setup... | <commit_before><commit_msg>Add an RGB LED for initial experimentation.<commit_after>'''
Dr Who Box: RGB Effects LED
'''
from __future__ import print_function
import RPi.GPIO as GPIO
import time
from multiprocessing import Process
import math
# Define PINS
RED = 23
GREEN = 24
BLUE = 26
# Use numbering based on P1 h... | |
fe7e3ca713fa1351facd9821a29cae7838458baf | Python/handle_excel.py | Python/handle_excel.py | """
使用场景:
有三个巨大的 Excel 文件(合计约一百三十万行)存放在 src_new 下面,
这个脚本能读取这三个 Excel 文件,将所有数据按第 5 列的值分别存放到 dst_new 里的不同的文件里去,
dst 文件以数据第 5 列值命名
template_new.xlsx 是一个模板文件,只含表头
Python 3
"""
import openpyxl
import os
import shutil
base_path = '/Users/mazhuang/Downloads/excels/'
src_path = base_path + 'src_new/'
dst_path = base_path ... | Add handle excel script in python | Add handle excel script in python
| Python | mit | mzlogin/snippets,mzlogin/snippets,mzlogin/snippets,mzlogin/snippets,mzlogin/snippets,mzlogin/snippets,mzlogin/snippets,mzlogin/snippets | Add handle excel script in python | """
使用场景:
有三个巨大的 Excel 文件(合计约一百三十万行)存放在 src_new 下面,
这个脚本能读取这三个 Excel 文件,将所有数据按第 5 列的值分别存放到 dst_new 里的不同的文件里去,
dst 文件以数据第 5 列值命名
template_new.xlsx 是一个模板文件,只含表头
Python 3
"""
import openpyxl
import os
import shutil
base_path = '/Users/mazhuang/Downloads/excels/'
src_path = base_path + 'src_new/'
dst_path = base_path ... | <commit_before><commit_msg>Add handle excel script in python<commit_after> | """
使用场景:
有三个巨大的 Excel 文件(合计约一百三十万行)存放在 src_new 下面,
这个脚本能读取这三个 Excel 文件,将所有数据按第 5 列的值分别存放到 dst_new 里的不同的文件里去,
dst 文件以数据第 5 列值命名
template_new.xlsx 是一个模板文件,只含表头
Python 3
"""
import openpyxl
import os
import shutil
base_path = '/Users/mazhuang/Downloads/excels/'
src_path = base_path + 'src_new/'
dst_path = base_path ... | Add handle excel script in python"""
使用场景:
有三个巨大的 Excel 文件(合计约一百三十万行)存放在 src_new 下面,
这个脚本能读取这三个 Excel 文件,将所有数据按第 5 列的值分别存放到 dst_new 里的不同的文件里去,
dst 文件以数据第 5 列值命名
template_new.xlsx 是一个模板文件,只含表头
Python 3
"""
import openpyxl
import os
import shutil
base_path = '/Users/mazhuang/Downloads/excels/'
src_path = base_path + ... | <commit_before><commit_msg>Add handle excel script in python<commit_after>"""
使用场景:
有三个巨大的 Excel 文件(合计约一百三十万行)存放在 src_new 下面,
这个脚本能读取这三个 Excel 文件,将所有数据按第 5 列的值分别存放到 dst_new 里的不同的文件里去,
dst 文件以数据第 5 列值命名
template_new.xlsx 是一个模板文件,只含表头
Python 3
"""
import openpyxl
import os
import shutil
base_path = '/Users/mazhuang/Do... | |
70fa99f52436ac860de01eab311215ed1a7e24c4 | app.py | app.py | import os
from flask import Flask, abort, send_file
app = Flask(__name__)
@app.route("/<path:filename>/")
def get_image(filename):
if not os.path.isfile(filename):
abort(404)
return send_file(filename)
if __name__ == "__main__":
app.run()
| Add functionality: photo or 404 | Add functionality: photo or 404
| Python | mit | DictGet/ecce-homo,DictGet/ecce-homo | Add functionality: photo or 404 | import os
from flask import Flask, abort, send_file
app = Flask(__name__)
@app.route("/<path:filename>/")
def get_image(filename):
if not os.path.isfile(filename):
abort(404)
return send_file(filename)
if __name__ == "__main__":
app.run()
| <commit_before><commit_msg>Add functionality: photo or 404<commit_after> | import os
from flask import Flask, abort, send_file
app = Flask(__name__)
@app.route("/<path:filename>/")
def get_image(filename):
if not os.path.isfile(filename):
abort(404)
return send_file(filename)
if __name__ == "__main__":
app.run()
| Add functionality: photo or 404import os
from flask import Flask, abort, send_file
app = Flask(__name__)
@app.route("/<path:filename>/")
def get_image(filename):
if not os.path.isfile(filename):
abort(404)
return send_file(filename)
if __name__ == "__main__":
app.run()
| <commit_before><commit_msg>Add functionality: photo or 404<commit_after>import os
from flask import Flask, abort, send_file
app = Flask(__name__)
@app.route("/<path:filename>/")
def get_image(filename):
if not os.path.isfile(filename):
abort(404)
return send_file(filename)
if __name__ == "__main__... | |
45b3a5924047a841bb01ed079104533c8cc5c0ce | run.py | run.py | #!/usr/bin/env python3
from tas import make_schedule
from tabulate import tabulate
import os
import csv
if __name__ == '__main__':
table = make_schedule()
tabular = tabulate(list(table), tablefmt="plain")
print(tabular)
| Add a module that can be called from other scripts | Add a module that can be called from other scripts
* Let's assume using the program's output as another program's input (e.g. Conky).
| Python | mit | azbshiri/tas | Add a module that can be called from other scripts
* Let's assume using the program's output as another program's input (e.g. Conky). | #!/usr/bin/env python3
from tas import make_schedule
from tabulate import tabulate
import os
import csv
if __name__ == '__main__':
table = make_schedule()
tabular = tabulate(list(table), tablefmt="plain")
print(tabular)
| <commit_before><commit_msg>Add a module that can be called from other scripts
* Let's assume using the program's output as another program's input (e.g. Conky).<commit_after> | #!/usr/bin/env python3
from tas import make_schedule
from tabulate import tabulate
import os
import csv
if __name__ == '__main__':
table = make_schedule()
tabular = tabulate(list(table), tablefmt="plain")
print(tabular)
| Add a module that can be called from other scripts
* Let's assume using the program's output as another program's input (e.g. Conky).#!/usr/bin/env python3
from tas import make_schedule
from tabulate import tabulate
import os
import csv
if __name__ == '__main__':
table = make_schedule()
tabular = tabulate(li... | <commit_before><commit_msg>Add a module that can be called from other scripts
* Let's assume using the program's output as another program's input (e.g. Conky).<commit_after>#!/usr/bin/env python3
from tas import make_schedule
from tabulate import tabulate
import os
import csv
if __name__ == '__main__':
table = ... | |
f6b22c3c7ff33d074b18cb7344263db65bb0f40f | codingame/medium/stock_exchange_losses.py | codingame/medium/stock_exchange_losses.py | def maxLoss(lst):
up = lst[0]
down = lst[0]
mini = down - up
for i, val in enumerate(lst[:-1]):
# We are decreasing
if (lst[i+1] < val):
if val > up:
up = val
down = val
if lst[i+1] < down:
down = lst[i+1]
if (down - up) < mini:
mini = down - up
return mini
# Number of values
n = int(r... | Add exercise Stock Exchange Losses | Add exercise Stock Exchange Losses
| Python | mit | AntoineAugusti/katas,AntoineAugusti/katas,AntoineAugusti/katas | Add exercise Stock Exchange Losses | def maxLoss(lst):
up = lst[0]
down = lst[0]
mini = down - up
for i, val in enumerate(lst[:-1]):
# We are decreasing
if (lst[i+1] < val):
if val > up:
up = val
down = val
if lst[i+1] < down:
down = lst[i+1]
if (down - up) < mini:
mini = down - up
return mini
# Number of values
n = int(r... | <commit_before><commit_msg>Add exercise Stock Exchange Losses<commit_after> | def maxLoss(lst):
up = lst[0]
down = lst[0]
mini = down - up
for i, val in enumerate(lst[:-1]):
# We are decreasing
if (lst[i+1] < val):
if val > up:
up = val
down = val
if lst[i+1] < down:
down = lst[i+1]
if (down - up) < mini:
mini = down - up
return mini
# Number of values
n = int(r... | Add exercise Stock Exchange Lossesdef maxLoss(lst):
up = lst[0]
down = lst[0]
mini = down - up
for i, val in enumerate(lst[:-1]):
# We are decreasing
if (lst[i+1] < val):
if val > up:
up = val
down = val
if lst[i+1] < down:
down = lst[i+1]
if (down - up) < mini:
mini = down - up
return ... | <commit_before><commit_msg>Add exercise Stock Exchange Losses<commit_after>def maxLoss(lst):
up = lst[0]
down = lst[0]
mini = down - up
for i, val in enumerate(lst[:-1]):
# We are decreasing
if (lst[i+1] < val):
if val > up:
up = val
down = val
if lst[i+1] < down:
down = lst[i+1]
if (down - ... | |
cd4879f4793924563bc27f251bd6a7af15c8ba3a | tests/test_msgbox.py | tests/test_msgbox.py | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Test code for controlling QMessageBox format.
"""
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QApplication, QLabel, QWidget, QMessageBox,
QSpinBox, QLineEdit, QPushButton,
QHBoxLayout, ... | Test program for QMessageBox formatting | Test program for QMessageBox formatting
| Python | mit | rzzzwilson/morse_trainer,rzzzwilson/morse_trainer | Test program for QMessageBox formatting | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Test code for controlling QMessageBox format.
"""
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QApplication, QLabel, QWidget, QMessageBox,
QSpinBox, QLineEdit, QPushButton,
QHBoxLayout, ... | <commit_before><commit_msg>Test program for QMessageBox formatting<commit_after> | #!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Test code for controlling QMessageBox format.
"""
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QApplication, QLabel, QWidget, QMessageBox,
QSpinBox, QLineEdit, QPushButton,
QHBoxLayout, ... | Test program for QMessageBox formatting#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Test code for controlling QMessageBox format.
"""
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QApplication, QLabel, QWidget, QMessageBox,
QSpinBox, QLineEdit, QPushButton,
... | <commit_before><commit_msg>Test program for QMessageBox formatting<commit_after>#!/usr/bin/python3
# -*- coding: utf-8 -*-
"""
Test code for controlling QMessageBox format.
"""
import sys
from PyQt5.QtGui import QPixmap
from PyQt5.QtWidgets import (QApplication, QLabel, QWidget, QMessageBox,
... | |
0c9dfa7f71cee8fe41aa6cdeb234a4c8ab89ea07 | convert_ffos_sms_data_to_commhistory-tool_json.py | convert_ffos_sms_data_to_commhistory-tool_json.py | #!/usr/bin/python
from json import loads
from time import strftime, gmtime
from datetime import datetime, time
json_file = open('sms.txt')
commtool = open('import.json', 'w')
isfirst = True
commtool.write('[\n')
def escape(s):
s = repr(s)
s = s.replace('\\', '\\\\')
s = s.replace("\\\\x", "\\x")
s = s.replace('... | Add Python version of commhistory-tool converter | Add Python version of commhistory-tool converter
Doesn't really work due to non-ASCII character handling, but adding
nevertheless for the sake of preservation...
| Python | mpl-2.0 | laenion/Firefox-OS-Data-Exporter | Add Python version of commhistory-tool converter
Doesn't really work due to non-ASCII character handling, but adding
nevertheless for the sake of preservation... | #!/usr/bin/python
from json import loads
from time import strftime, gmtime
from datetime import datetime, time
json_file = open('sms.txt')
commtool = open('import.json', 'w')
isfirst = True
commtool.write('[\n')
def escape(s):
s = repr(s)
s = s.replace('\\', '\\\\')
s = s.replace("\\\\x", "\\x")
s = s.replace('... | <commit_before><commit_msg>Add Python version of commhistory-tool converter
Doesn't really work due to non-ASCII character handling, but adding
nevertheless for the sake of preservation...<commit_after> | #!/usr/bin/python
from json import loads
from time import strftime, gmtime
from datetime import datetime, time
json_file = open('sms.txt')
commtool = open('import.json', 'w')
isfirst = True
commtool.write('[\n')
def escape(s):
s = repr(s)
s = s.replace('\\', '\\\\')
s = s.replace("\\\\x", "\\x")
s = s.replace('... | Add Python version of commhistory-tool converter
Doesn't really work due to non-ASCII character handling, but adding
nevertheless for the sake of preservation...#!/usr/bin/python
from json import loads
from time import strftime, gmtime
from datetime import datetime, time
json_file = open('sms.txt')
commtool = open('... | <commit_before><commit_msg>Add Python version of commhistory-tool converter
Doesn't really work due to non-ASCII character handling, but adding
nevertheless for the sake of preservation...<commit_after>#!/usr/bin/python
from json import loads
from time import strftime, gmtime
from datetime import datetime, time
json... | |
b0bedcbd293d21e5a08ecd1acbc11b3fe8c5b7e9 | osf/migrations/0002_add_lower_index_to_tags.py | osf/migrations/0002_add_lower_index_to_tags.py | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-30 14:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
operations = [
migrations.RunSQL(
[
... | Add lower index to tags | Add lower index to tags
| Python | apache-2.0 | TomBaxter/osf.io,brianjgeiger/osf.io,adlius/osf.io,mfraezz/osf.io,HalcyonChimera/osf.io,sloria/osf.io,adlius/osf.io,baylee-d/osf.io,cwisecarver/osf.io,CenterForOpenScience/osf.io,chennan47/osf.io,caneruguz/osf.io,crcresearch/osf.io,chrisseto/osf.io,CenterForOpenScience/osf.io,chrisseto/osf.io,brianjgeiger/osf.io,icerev... | Add lower index to tags | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-30 14:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
operations = [
migrations.RunSQL(
[
... | <commit_before><commit_msg>Add lower index to tags<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-30 14:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
operations = [
migrations.RunSQL(
[
... | Add lower index to tags# -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-30 14:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
operations = [
migrations.RunSQL(
... | <commit_before><commit_msg>Add lower index to tags<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.9 on 2017-03-30 14:55
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('osf', '0001_initial'),
]
opera... | |
9f58e46b18775bfa0f4bf23bf6b25a1e2488c6ae | scripts/migrate.py | scripts/migrate.py | """Script for migrating ipythonblocks grid data from SQLite to Postgres"""
import json
import os
from pathlib import Path
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
# The module in the ipythonblocks.org application code that contains
# table definitions
from app import models
# SQLite DB related... | Revert "removing migration script now that it's done" | Revert "removing migration script now that it's done"
This reverts commit dd32cbb400fb667d05b215a60fe3682da2c1cf2b.
| Python | mit | jiffyclub/ipythonblocks.org,jiffyclub/ipythonblocks.org | Revert "removing migration script now that it's done"
This reverts commit dd32cbb400fb667d05b215a60fe3682da2c1cf2b. | """Script for migrating ipythonblocks grid data from SQLite to Postgres"""
import json
import os
from pathlib import Path
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
# The module in the ipythonblocks.org application code that contains
# table definitions
from app import models
# SQLite DB related... | <commit_before><commit_msg>Revert "removing migration script now that it's done"
This reverts commit dd32cbb400fb667d05b215a60fe3682da2c1cf2b.<commit_after> | """Script for migrating ipythonblocks grid data from SQLite to Postgres"""
import json
import os
from pathlib import Path
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
# The module in the ipythonblocks.org application code that contains
# table definitions
from app import models
# SQLite DB related... | Revert "removing migration script now that it's done"
This reverts commit dd32cbb400fb667d05b215a60fe3682da2c1cf2b."""Script for migrating ipythonblocks grid data from SQLite to Postgres"""
import json
import os
from pathlib import Path
import sqlalchemy as sa
from sqlalchemy.orm import sessionmaker
# The module in ... | <commit_before><commit_msg>Revert "removing migration script now that it's done"
This reverts commit dd32cbb400fb667d05b215a60fe3682da2c1cf2b.<commit_after>"""Script for migrating ipythonblocks grid data from SQLite to Postgres"""
import json
import os
from pathlib import Path
import sqlalchemy as sa
from sqlalchemy.... | |
ea8b0193845d794b9612b0e78dffa772c15fbca3 | tests/test_utils.py | tests/test_utils.py | from datetime import datetime
from flexget.utils import json
class TestJson(object):
def test_dt_encode(self):
date_str = '2016-03-11T17:12:17Z'
dt = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%SZ')
encoded_dt = json.dumps(dt, encode_datetime=True)
assert encoded_dt == '"%s"' % d... | Add test for flexget utils (json) | Add test for flexget utils (json)
| Python | mit | JorisDeRieck/Flexget,antivirtel/Flexget,poulpito/Flexget,antivirtel/Flexget,tobinjt/Flexget,crawln45/Flexget,oxc/Flexget,drwyrm/Flexget,Pretagonist/Flexget,jawilson/Flexget,Danfocus/Flexget,sean797/Flexget,LynxyssCZ/Flexget,tarzasai/Flexget,tarzasai/Flexget,dsemi/Flexget,ianstalk/Flexget,OmgOhnoes/Flexget,LynxyssCZ/Fle... | Add test for flexget utils (json) | from datetime import datetime
from flexget.utils import json
class TestJson(object):
def test_dt_encode(self):
date_str = '2016-03-11T17:12:17Z'
dt = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%SZ')
encoded_dt = json.dumps(dt, encode_datetime=True)
assert encoded_dt == '"%s"' % d... | <commit_before><commit_msg>Add test for flexget utils (json)<commit_after> | from datetime import datetime
from flexget.utils import json
class TestJson(object):
def test_dt_encode(self):
date_str = '2016-03-11T17:12:17Z'
dt = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%SZ')
encoded_dt = json.dumps(dt, encode_datetime=True)
assert encoded_dt == '"%s"' % d... | Add test for flexget utils (json)from datetime import datetime
from flexget.utils import json
class TestJson(object):
def test_dt_encode(self):
date_str = '2016-03-11T17:12:17Z'
dt = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%SZ')
encoded_dt = json.dumps(dt, encode_datetime=True)
... | <commit_before><commit_msg>Add test for flexget utils (json)<commit_after>from datetime import datetime
from flexget.utils import json
class TestJson(object):
def test_dt_encode(self):
date_str = '2016-03-11T17:12:17Z'
dt = datetime.strptime(date_str, '%Y-%m-%dT%H:%M:%SZ')
encoded_dt = js... | |
ae19d2e0bf1c7f808cd102a78bde25548bcb88b8 | warehouse/cli.py | warehouse/cli.py | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | Add a command to run the built in werkzeug server | Add a command to run the built in werkzeug server
| Python | apache-2.0 | robhudson/warehouse,mattrobenolt/warehouse,techtonik/warehouse,robhudson/warehouse,mattrobenolt/warehouse,mattrobenolt/warehouse,techtonik/warehouse | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | <commit_before># Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | # Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, so... | <commit_before># Copyright 2013 Donald Stufft
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to... |
73c676d3ab2c4c668209dc04537561c7a2e3cd49 | ideascale/migrations/0011_author_sync.py | ideascale/migrations/0011_author_sync.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ideascale', '0010_auto_20150513_1146'),
]
operations = [
migrations.AddField(
model_name='author',
n... | Add sync field to Author model | Add sync field to Author model
| Python | mit | rebearteta/social-ideation,joausaga/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,rebearteta/social-ideation,joausaga/social-ideation,joausaga/social-ideation,joausaga/social-ideation | Add sync field to Author model | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ideascale', '0010_auto_20150513_1146'),
]
operations = [
migrations.AddField(
model_name='author',
n... | <commit_before><commit_msg>Add sync field to Author model<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ideascale', '0010_auto_20150513_1146'),
]
operations = [
migrations.AddField(
model_name='author',
n... | Add sync field to Author model# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ideascale', '0010_auto_20150513_1146'),
]
operations = [
migrations.AddField(
mode... | <commit_before><commit_msg>Add sync field to Author model<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('ideascale', '0010_auto_20150513_1146'),
]
operations = [
... | |
c7fe8e2a186d094d49c7c9218ba63bd8a7cdd024 | ProjectEuler/prob15.py | ProjectEuler/prob15.py | # projecteuler.net/problem=15
def main():
answer = LatticePaths(20)
print(answer)
def LatticePaths(x):
x += 1 # each item represent not cell but line (for close lattice n+1)
arr = [[0 for i in range(0, x)] for i in range(0, x)]
arr[0][0] = 1
for i in range(0, x):
arr[0][i] = 1
... | Update script for problem 15 on pe | Update script for problem 15 on pe
| Python | apache-2.0 | yuriyshapovalov/Prototypes,yuriyshapovalov/Prototypes,yuriyshapovalov/Prototypes | Update script for problem 15 on pe | # projecteuler.net/problem=15
def main():
answer = LatticePaths(20)
print(answer)
def LatticePaths(x):
x += 1 # each item represent not cell but line (for close lattice n+1)
arr = [[0 for i in range(0, x)] for i in range(0, x)]
arr[0][0] = 1
for i in range(0, x):
arr[0][i] = 1
... | <commit_before><commit_msg>Update script for problem 15 on pe<commit_after> | # projecteuler.net/problem=15
def main():
answer = LatticePaths(20)
print(answer)
def LatticePaths(x):
x += 1 # each item represent not cell but line (for close lattice n+1)
arr = [[0 for i in range(0, x)] for i in range(0, x)]
arr[0][0] = 1
for i in range(0, x):
arr[0][i] = 1
... | Update script for problem 15 on pe# projecteuler.net/problem=15
def main():
answer = LatticePaths(20)
print(answer)
def LatticePaths(x):
x += 1 # each item represent not cell but line (for close lattice n+1)
arr = [[0 for i in range(0, x)] for i in range(0, x)]
arr[0][0] = 1
for i in range(0,... | <commit_before><commit_msg>Update script for problem 15 on pe<commit_after># projecteuler.net/problem=15
def main():
answer = LatticePaths(20)
print(answer)
def LatticePaths(x):
x += 1 # each item represent not cell but line (for close lattice n+1)
arr = [[0 for i in range(0, x)] for i in range(0, x)]... | |
b588d426ec500db82995fa830298757f7a1afd52 | scripts/test_uvfits_equal.py | scripts/test_uvfits_equal.py | #! /usr/bin/env python
import argparse
import os.path as op
from uvdata.uv import UVData
parser = argparse.ArgumentParser()
parser.add_argument('uvfits1',
help='name of first uvfits file.')
parser.add_argument('uvfits2',
help='name of second uvfits file to compare to first.')
... | Add little script to test 2 uvfits files for equality | Add little script to test 2 uvfits files for equality
| Python | bsd-2-clause | HERA-Team/pyuvdata,HERA-Team/pyuvdata,HERA-Team/pyuvdata,HERA-Team/pyuvdata | Add little script to test 2 uvfits files for equality | #! /usr/bin/env python
import argparse
import os.path as op
from uvdata.uv import UVData
parser = argparse.ArgumentParser()
parser.add_argument('uvfits1',
help='name of first uvfits file.')
parser.add_argument('uvfits2',
help='name of second uvfits file to compare to first.')
... | <commit_before><commit_msg>Add little script to test 2 uvfits files for equality<commit_after> | #! /usr/bin/env python
import argparse
import os.path as op
from uvdata.uv import UVData
parser = argparse.ArgumentParser()
parser.add_argument('uvfits1',
help='name of first uvfits file.')
parser.add_argument('uvfits2',
help='name of second uvfits file to compare to first.')
... | Add little script to test 2 uvfits files for equality#! /usr/bin/env python
import argparse
import os.path as op
from uvdata.uv import UVData
parser = argparse.ArgumentParser()
parser.add_argument('uvfits1',
help='name of first uvfits file.')
parser.add_argument('uvfits2',
help... | <commit_before><commit_msg>Add little script to test 2 uvfits files for equality<commit_after>#! /usr/bin/env python
import argparse
import os.path as op
from uvdata.uv import UVData
parser = argparse.ArgumentParser()
parser.add_argument('uvfits1',
help='name of first uvfits file.')
parser.add_arg... | |
3fcaa8d45c91b8aa03f7bdbdd94beace328a765c | tests/test_convert.py | tests/test_convert.py | import pytest # type: ignore
from ppb_vector import Vector2
from utils import *
@pytest.mark.parametrize('vector_like', UNIT_VECTOR_LIKES) # type: ignore
def test_convert_subclass(vector_like):
class V(Vector2): pass
# test_binop_vectorlike already checks the output value is correct
assert isinstance(V.... | Add a test for Vector2.convert | Add a test for Vector2.convert
See https://github.com/ppb/ppb-vector/pull/91#discussion_r241956449
| Python | artistic-2.0 | ppb/ppb-vector,ppb/ppb-vector | Add a test for Vector2.convert
See https://github.com/ppb/ppb-vector/pull/91#discussion_r241956449 | import pytest # type: ignore
from ppb_vector import Vector2
from utils import *
@pytest.mark.parametrize('vector_like', UNIT_VECTOR_LIKES) # type: ignore
def test_convert_subclass(vector_like):
class V(Vector2): pass
# test_binop_vectorlike already checks the output value is correct
assert isinstance(V.... | <commit_before><commit_msg>Add a test for Vector2.convert
See https://github.com/ppb/ppb-vector/pull/91#discussion_r241956449<commit_after> | import pytest # type: ignore
from ppb_vector import Vector2
from utils import *
@pytest.mark.parametrize('vector_like', UNIT_VECTOR_LIKES) # type: ignore
def test_convert_subclass(vector_like):
class V(Vector2): pass
# test_binop_vectorlike already checks the output value is correct
assert isinstance(V.... | Add a test for Vector2.convert
See https://github.com/ppb/ppb-vector/pull/91#discussion_r241956449import pytest # type: ignore
from ppb_vector import Vector2
from utils import *
@pytest.mark.parametrize('vector_like', UNIT_VECTOR_LIKES) # type: ignore
def test_convert_subclass(vector_like):
class V(Vector2): pa... | <commit_before><commit_msg>Add a test for Vector2.convert
See https://github.com/ppb/ppb-vector/pull/91#discussion_r241956449<commit_after>import pytest # type: ignore
from ppb_vector import Vector2
from utils import *
@pytest.mark.parametrize('vector_like', UNIT_VECTOR_LIKES) # type: ignore
def test_convert_subcla... | |
6b25614cbdec4595cedd772ca5d405cfafec741d | ipynb.py | ipynb.py | """ipynb.py -- helper functions for working with the IPython Notebook
This software is licensed under the terms of the MIT License as
follows:
Copyright (c) 2013 Jessica B. Hamrick
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"S... | Add file for ipython notebook snippets | Add file for ipython notebook snippets
| Python | mit | jhamrick/python-snippets | Add file for ipython notebook snippets | """ipynb.py -- helper functions for working with the IPython Notebook
This software is licensed under the terms of the MIT License as
follows:
Copyright (c) 2013 Jessica B. Hamrick
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"S... | <commit_before><commit_msg>Add file for ipython notebook snippets<commit_after> | """ipynb.py -- helper functions for working with the IPython Notebook
This software is licensed under the terms of the MIT License as
follows:
Copyright (c) 2013 Jessica B. Hamrick
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
"S... | Add file for ipython notebook snippets"""ipynb.py -- helper functions for working with the IPython Notebook
This software is licensed under the terms of the MIT License as
follows:
Copyright (c) 2013 Jessica B. Hamrick
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and ... | <commit_before><commit_msg>Add file for ipython notebook snippets<commit_after>"""ipynb.py -- helper functions for working with the IPython Notebook
This software is licensed under the terms of the MIT License as
follows:
Copyright (c) 2013 Jessica B. Hamrick
Permission is hereby granted, free of charge, to any pers... | |
dd9e80cb13d41a6faf0fb1340ea7edc949f0fab7 | dash/orgs/migrations/0012_auto_20150715_1816.py | dash/orgs/migrations/0012_auto_20150715_1816.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0011_auto_20150710_1612'),
]
operations = [
migrations.AlterField(
model_name='invitation',
... | Add missing migration for Invitation.email | Add missing migration for Invitation.email
| Python | bsd-3-clause | rapidpro/dash,peterayeni/dash,rapidpro/dash,caktus/dash,caktus/dash,peterayeni/dash | Add missing migration for Invitation.email | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0011_auto_20150710_1612'),
]
operations = [
migrations.AlterField(
model_name='invitation',
... | <commit_before><commit_msg>Add missing migration for Invitation.email<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0011_auto_20150710_1612'),
]
operations = [
migrations.AlterField(
model_name='invitation',
... | Add missing migration for Invitation.email# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0011_auto_20150710_1612'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add missing migration for Invitation.email<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0011_auto_20150710_1612'),
]
operations =... | |
4a67508786b9c28e930a4d6ce49001f6bb9be39d | dash/orgs/migrations/0025_auto_20180321_1520.py | dash/orgs/migrations/0025_auto_20180321_1520.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-21 15:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0024_populate_org_backend'),
]
operations = [
migrations.AlterUniqueTogeth... | Add constraints for unique together for org and slug in org backend, migrations | Add constraints for unique together for org and slug in org backend, migrations
| Python | bsd-3-clause | rapidpro/dash,rapidpro/dash | Add constraints for unique together for org and slug in org backend, migrations | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-21 15:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0024_populate_org_backend'),
]
operations = [
migrations.AlterUniqueTogeth... | <commit_before><commit_msg>Add constraints for unique together for org and slug in org backend, migrations<commit_after> | # -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-21 15:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0024_populate_org_backend'),
]
operations = [
migrations.AlterUniqueTogeth... | Add constraints for unique together for org and slug in org backend, migrations# -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-21 15:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('orgs', '0024_populat... | <commit_before><commit_msg>Add constraints for unique together for org and slug in org backend, migrations<commit_after># -*- coding: utf-8 -*-
# Generated by Django 1.11.11 on 2018-03-21 15:20
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
depend... | |
28841d9a7077293b0befab23fb3d1183006edc89 | lcapy/nettransform.py | lcapy/nettransform.py | """This module performs network transformations.
Copyright 2020 Michael Hayes, UCECE
"""
def Z_wye_to_delta(Z1, Z2, Z3):
"""Perform wye to delta transformation of three impedances.
This is equivalent to a tee-pi transform or a star-mesh transform."""
N = Z1 * Z2 + Z1 * Z3 + Z2 * Z3
Za = N / Z... | Add wye-delta and delta-wye transformations | Add wye-delta and delta-wye transformations
| Python | lgpl-2.1 | mph-/lcapy | Add wye-delta and delta-wye transformations | """This module performs network transformations.
Copyright 2020 Michael Hayes, UCECE
"""
def Z_wye_to_delta(Z1, Z2, Z3):
"""Perform wye to delta transformation of three impedances.
This is equivalent to a tee-pi transform or a star-mesh transform."""
N = Z1 * Z2 + Z1 * Z3 + Z2 * Z3
Za = N / Z... | <commit_before><commit_msg>Add wye-delta and delta-wye transformations<commit_after> | """This module performs network transformations.
Copyright 2020 Michael Hayes, UCECE
"""
def Z_wye_to_delta(Z1, Z2, Z3):
"""Perform wye to delta transformation of three impedances.
This is equivalent to a tee-pi transform or a star-mesh transform."""
N = Z1 * Z2 + Z1 * Z3 + Z2 * Z3
Za = N / Z... | Add wye-delta and delta-wye transformations"""This module performs network transformations.
Copyright 2020 Michael Hayes, UCECE
"""
def Z_wye_to_delta(Z1, Z2, Z3):
"""Perform wye to delta transformation of three impedances.
This is equivalent to a tee-pi transform or a star-mesh transform."""
N = Z1 *... | <commit_before><commit_msg>Add wye-delta and delta-wye transformations<commit_after>"""This module performs network transformations.
Copyright 2020 Michael Hayes, UCECE
"""
def Z_wye_to_delta(Z1, Z2, Z3):
"""Perform wye to delta transformation of three impedances.
This is equivalent to a tee-pi transform o... | |
0ef0f3528dfd21ff608ea5e59980856e7f673817 | longclaw/longclawshipping/fields.py | longclaw/longclawshipping/fields.py | from longclaw.longclawsettings.models import LongclawSettings
from longclaw.longclawshipping.models import ShippingRate
from django_countries import countries, fields
class CountryChoices(object):
'''
Helper class which returns a list of available countries based on
the selected shipping options.
If d... | Add a country field for available shipping countries | Add a country field for available shipping countries
| Python | mit | JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw,JamesRamm/longclaw | Add a country field for available shipping countries | from longclaw.longclawsettings.models import LongclawSettings
from longclaw.longclawshipping.models import ShippingRate
from django_countries import countries, fields
class CountryChoices(object):
'''
Helper class which returns a list of available countries based on
the selected shipping options.
If d... | <commit_before><commit_msg>Add a country field for available shipping countries<commit_after> | from longclaw.longclawsettings.models import LongclawSettings
from longclaw.longclawshipping.models import ShippingRate
from django_countries import countries, fields
class CountryChoices(object):
'''
Helper class which returns a list of available countries based on
the selected shipping options.
If d... | Add a country field for available shipping countriesfrom longclaw.longclawsettings.models import LongclawSettings
from longclaw.longclawshipping.models import ShippingRate
from django_countries import countries, fields
class CountryChoices(object):
'''
Helper class which returns a list of available countries b... | <commit_before><commit_msg>Add a country field for available shipping countries<commit_after>from longclaw.longclawsettings.models import LongclawSettings
from longclaw.longclawshipping.models import ShippingRate
from django_countries import countries, fields
class CountryChoices(object):
'''
Helper class whic... | |
02e907a97eb1cb79b5c427e6153caf8ca0009058 | tests/builder_tests.py | tests/builder_tests.py | import contextlib
import json
import os
from nose.tools import istest, assert_equal
from whack.tempdir import create_temporary_dir
from whack.files import sh_script_description, plain_file, read_file
from whack.sources import PackageSource
from whack.builder import build
@istest
def build_uses_params_as_environ... | Add basic test for build | Add basic test for build
| Python | bsd-2-clause | mwilliamson/whack | Add basic test for build | import contextlib
import json
import os
from nose.tools import istest, assert_equal
from whack.tempdir import create_temporary_dir
from whack.files import sh_script_description, plain_file, read_file
from whack.sources import PackageSource
from whack.builder import build
@istest
def build_uses_params_as_environ... | <commit_before><commit_msg>Add basic test for build<commit_after> | import contextlib
import json
import os
from nose.tools import istest, assert_equal
from whack.tempdir import create_temporary_dir
from whack.files import sh_script_description, plain_file, read_file
from whack.sources import PackageSource
from whack.builder import build
@istest
def build_uses_params_as_environ... | Add basic test for buildimport contextlib
import json
import os
from nose.tools import istest, assert_equal
from whack.tempdir import create_temporary_dir
from whack.files import sh_script_description, plain_file, read_file
from whack.sources import PackageSource
from whack.builder import build
@istest
def buil... | <commit_before><commit_msg>Add basic test for build<commit_after>import contextlib
import json
import os
from nose.tools import istest, assert_equal
from whack.tempdir import create_temporary_dir
from whack.files import sh_script_description, plain_file, read_file
from whack.sources import PackageSource
from whack.bu... | |
b6f2325c153b499c3b79fdb813d80e5423e4919d | flexget/plugins/services/torrent_cache.py | flexget/plugins/services/torrent_cache.py | import logging
import re
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
'http://torcache.net/torrent/',
'http://zoink.it/torrent/',
'http://torrage.ws/torrent/']
class TorrentCache(object):
... | import logging
import re
import random
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
# Now using a landing page instead of going directly to the torrent
# TODO: May be fixable by setting the referer
... | Disable torcache for now. Randomize order torrent cache mirrors are added to urls list. | Disable torcache for now.
Randomize order torrent cache mirrors are added to urls list.
git-svn-id: ad91b9aa7ba7638d69f912c9f5d012e3326e9f74@2874 3942dd89-8c5d-46d7-aeed-044bccf3e60c
| Python | mit | tobinjt/Flexget,tarzasai/Flexget,jacobmetrick/Flexget,offbyone/Flexget,Flexget/Flexget,tvcsantos/Flexget,qk4l/Flexget,jawilson/Flexget,sean797/Flexget,oxc/Flexget,oxc/Flexget,asm0dey/Flexget,Flexget/Flexget,thalamus/Flexget,Danfocus/Flexget,crawln45/Flexget,v17al/Flexget,JorisDeRieck/Flexget,dsemi/Flexget,vfrc2/Flexget... | import logging
import re
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
'http://torcache.net/torrent/',
'http://zoink.it/torrent/',
'http://torrage.ws/torrent/']
class TorrentCache(object):
... | import logging
import re
import random
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
# Now using a landing page instead of going directly to the torrent
# TODO: May be fixable by setting the referer
... | <commit_before>import logging
import re
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
'http://torcache.net/torrent/',
'http://zoink.it/torrent/',
'http://torrage.ws/torrent/']
class TorrentCach... | import logging
import re
import random
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
# Now using a landing page instead of going directly to the torrent
# TODO: May be fixable by setting the referer
... | import logging
import re
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
'http://torcache.net/torrent/',
'http://zoink.it/torrent/',
'http://torrage.ws/torrent/']
class TorrentCache(object):
... | <commit_before>import logging
import re
from flexget.plugin import register_plugin, priority
log = logging.getLogger('torrent_cache')
MIRRORS = ['http://torrage.com/torrent/',
'http://torcache.net/torrent/',
'http://zoink.it/torrent/',
'http://torrage.ws/torrent/']
class TorrentCach... |
2a8f064733892b86c2041f3294d5efebd4b565d9 | txircd/modules/extra/channelopaccess.py | txircd/modules/extra/channelopaccess.py | from twisted.plugin import IPlugin
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class ChannelOpAccess(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "ChannelOpAccess"
affectedActions = {
"check... | Allow channel ops to change the required level for specific permissions | Allow channel ops to change the required level for specific permissions
| Python | bsd-3-clause | Heufneutje/txircd,ElementalAlchemist/txircd | Allow channel ops to change the required level for specific permissions | from twisted.plugin import IPlugin
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class ChannelOpAccess(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "ChannelOpAccess"
affectedActions = {
"check... | <commit_before><commit_msg>Allow channel ops to change the required level for specific permissions<commit_after> | from twisted.plugin import IPlugin
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class ChannelOpAccess(ModuleData, Mode):
implements(IPlugin, IModuleData, IMode)
name = "ChannelOpAccess"
affectedActions = {
"check... | Allow channel ops to change the required level for specific permissionsfrom twisted.plugin import IPlugin
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class ChannelOpAccess(ModuleData, Mode):
implements(IPlugin, IModul... | <commit_before><commit_msg>Allow channel ops to change the required level for specific permissions<commit_after>from twisted.plugin import IPlugin
from txircd.module_interface import IMode, IModuleData, Mode, ModuleData
from txircd.utils import ModeType
from zope.interface import implements
class ChannelOpAccess(Modul... | |
a00822aeb17eabde80adf16c30498472d5775159 | nclxd/tests/test_container_image.py | nclxd/tests/test_container_image.py | # Copyright 2015 Canonical Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Add tests for existing image | Add tests for existing image
| Python | apache-2.0 | tpouyer/nova-lxd,Saviq/nova-compute-lxd,tpouyer/nova-lxd,Saviq/nova-compute-lxd | Add tests for existing image | # Copyright 2015 Canonical Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | <commit_before><commit_msg>Add tests for existing image<commit_after> | # Copyright 2015 Canonical Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by... | Add tests for existing image# Copyright 2015 Canonical Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2... | <commit_before><commit_msg>Add tests for existing image<commit_after># Copyright 2015 Canonical Ltd
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# ... | |
e2c52c768420357b43394df622a32629155c927e | tests/unit/test_cli.py | tests/unit/test_cli.py | from hamcrest import assert_that, is_
import pytest
from pyhttp.cli import parse_args
def describe_parse_args():
def it_returns_parsed_arguments():
args = parse_args(['-c', '100', 'http://example.com'])
assert_that(args.concurrency, is_(100))
assert_that(args.url, is_('http://example.com... | Add cli arguments parser tests | Add cli arguments parser tests
| Python | mit | tesonet/pyhttp | Add cli arguments parser tests | from hamcrest import assert_that, is_
import pytest
from pyhttp.cli import parse_args
def describe_parse_args():
def it_returns_parsed_arguments():
args = parse_args(['-c', '100', 'http://example.com'])
assert_that(args.concurrency, is_(100))
assert_that(args.url, is_('http://example.com... | <commit_before><commit_msg>Add cli arguments parser tests<commit_after> | from hamcrest import assert_that, is_
import pytest
from pyhttp.cli import parse_args
def describe_parse_args():
def it_returns_parsed_arguments():
args = parse_args(['-c', '100', 'http://example.com'])
assert_that(args.concurrency, is_(100))
assert_that(args.url, is_('http://example.com... | Add cli arguments parser testsfrom hamcrest import assert_that, is_
import pytest
from pyhttp.cli import parse_args
def describe_parse_args():
def it_returns_parsed_arguments():
args = parse_args(['-c', '100', 'http://example.com'])
assert_that(args.concurrency, is_(100))
assert_that(arg... | <commit_before><commit_msg>Add cli arguments parser tests<commit_after>from hamcrest import assert_that, is_
import pytest
from pyhttp.cli import parse_args
def describe_parse_args():
def it_returns_parsed_arguments():
args = parse_args(['-c', '100', 'http://example.com'])
assert_that(args.concu... | |
c699a331ed8976069731f6bc7f61871123810865 | wafer/talks/migrations/0002_auto_20150813_2327.py | wafer/talks/migrations/0002_auto_20150813_2327.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('talks', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='talk',
options={'permi... | Add migration for view_all_talks permission. | Add migration for view_all_talks permission.
| Python | isc | CTPUG/wafer,CTPUG/wafer,CTPUG/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer,CarlFK/wafer,CTPUG/wafer | Add migration for view_all_talks permission. | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('talks', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='talk',
options={'permi... | <commit_before><commit_msg>Add migration for view_all_talks permission.<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('talks', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
name='talk',
options={'permi... | Add migration for view_all_talks permission.# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('talks', '0001_initial'),
]
operations = [
migrations.AlterModelOptions(
... | <commit_before><commit_msg>Add migration for view_all_talks permission.<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('talks', '0001_initial'),
]
operations = [
... | |
9386120ee2d5e27374a53c10ca45bf7b6f0d2e6e | tests/test_listener.py | tests/test_listener.py | #!/usr/bin/env python
import pytest
import pg_bawler.core
@pytest.mark.asyncio
async def test_simple_listen():
class NotificationListener(
pg_bawler.core.BawlerBase,
pg_bawler.core.ListenerMixin
):
pass
class NotificationSender(
pg_bawler.core.BawlerBase,
pg_bawl... | Add initial test for listener module | Add initial test for listener module
| Python | bsd-3-clause | beezz/pg_bawler,beezz/pg_bawler | Add initial test for listener module | #!/usr/bin/env python
import pytest
import pg_bawler.core
@pytest.mark.asyncio
async def test_simple_listen():
class NotificationListener(
pg_bawler.core.BawlerBase,
pg_bawler.core.ListenerMixin
):
pass
class NotificationSender(
pg_bawler.core.BawlerBase,
pg_bawl... | <commit_before><commit_msg>Add initial test for listener module<commit_after> | #!/usr/bin/env python
import pytest
import pg_bawler.core
@pytest.mark.asyncio
async def test_simple_listen():
class NotificationListener(
pg_bawler.core.BawlerBase,
pg_bawler.core.ListenerMixin
):
pass
class NotificationSender(
pg_bawler.core.BawlerBase,
pg_bawl... | Add initial test for listener module#!/usr/bin/env python
import pytest
import pg_bawler.core
@pytest.mark.asyncio
async def test_simple_listen():
class NotificationListener(
pg_bawler.core.BawlerBase,
pg_bawler.core.ListenerMixin
):
pass
class NotificationSender(
pg_baw... | <commit_before><commit_msg>Add initial test for listener module<commit_after>#!/usr/bin/env python
import pytest
import pg_bawler.core
@pytest.mark.asyncio
async def test_simple_listen():
class NotificationListener(
pg_bawler.core.BawlerBase,
pg_bawler.core.ListenerMixin
):
pass
... | |
ad1121b941a694b7cb6a65e7e6bf4839147f7551 | utils/verify_alerts.py | utils/verify_alerts.py | #!/usr/bin/env python
import os
import sys
from os.path import dirname, join, realpath
from optparse import OptionParser
# Get the current working directory of this file.
# http://stackoverflow.com/a/4060259/120999
__location__ = realpath(join(os.getcwd(), dirname(__file__)))
# Add the shared settings file to namesp... | Add script to test/verify alert configuration | Add script to test/verify alert configuration
We're looking to build out another alerter or two, and wanted a way to test our current alert configurations as well as be able to trigger alerts as we developer new alerters. | Python | mit | aelialper/skyline,hcxiong/skyline,loggly/skyline,triplekill/skyline,PaytmLabs/skyline,100star/skyline,CDKGlobal/skyline,hcxiong/skyline,loggly/skyline,sdgdsffdsfff/skyline,klynch/skyline,aelialper/skyline,triplekill/skyline,100star/skyline,sdgdsffdsfff/skyline,hcxiong/skyline,loggly/skyline,sdgdsffdsfff/skyline,PaytmLa... | Add script to test/verify alert configuration
We're looking to build out another alerter or two, and wanted a way to test our current alert configurations as well as be able to trigger alerts as we developer new alerters. | #!/usr/bin/env python
import os
import sys
from os.path import dirname, join, realpath
from optparse import OptionParser
# Get the current working directory of this file.
# http://stackoverflow.com/a/4060259/120999
__location__ = realpath(join(os.getcwd(), dirname(__file__)))
# Add the shared settings file to namesp... | <commit_before><commit_msg>Add script to test/verify alert configuration
We're looking to build out another alerter or two, and wanted a way to test our current alert configurations as well as be able to trigger alerts as we developer new alerters.<commit_after> | #!/usr/bin/env python
import os
import sys
from os.path import dirname, join, realpath
from optparse import OptionParser
# Get the current working directory of this file.
# http://stackoverflow.com/a/4060259/120999
__location__ = realpath(join(os.getcwd(), dirname(__file__)))
# Add the shared settings file to namesp... | Add script to test/verify alert configuration
We're looking to build out another alerter or two, and wanted a way to test our current alert configurations as well as be able to trigger alerts as we developer new alerters.#!/usr/bin/env python
import os
import sys
from os.path import dirname, join, realpath
from optpa... | <commit_before><commit_msg>Add script to test/verify alert configuration
We're looking to build out another alerter or two, and wanted a way to test our current alert configurations as well as be able to trigger alerts as we developer new alerters.<commit_after>#!/usr/bin/env python
import os
import sys
from os.path ... | |
d195358bc5814301e91a97f5d2ae95ede4a72bbc | scripts/feature/warnings/simple_county.py | scripts/feature/warnings/simple_county.py | import matplotlib.colors as mpcolors
import matplotlib.cm as cm
import psycopg2
import numpy as np
from pyiem.plot import MapPlot
POSTGIS = psycopg2.connect(database='postgis', host='localhost', user='nobody',
port=5555)
pcursor = POSTGIS.cursor()
cmap = cm.get_cmap("jet")
cmap.set_under("#... | Make some twitter plots of SVR,TOR freq hour | Make some twitter plots of SVR,TOR freq hour
https://twitter.com/akrherz/status/703776738422050816
https://twitter.com/akrherz/status/703776599057895424
| Python | mit | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | Make some twitter plots of SVR,TOR freq hour
https://twitter.com/akrherz/status/703776738422050816
https://twitter.com/akrherz/status/703776599057895424 | import matplotlib.colors as mpcolors
import matplotlib.cm as cm
import psycopg2
import numpy as np
from pyiem.plot import MapPlot
POSTGIS = psycopg2.connect(database='postgis', host='localhost', user='nobody',
port=5555)
pcursor = POSTGIS.cursor()
cmap = cm.get_cmap("jet")
cmap.set_under("#... | <commit_before><commit_msg>Make some twitter plots of SVR,TOR freq hour
https://twitter.com/akrherz/status/703776738422050816
https://twitter.com/akrherz/status/703776599057895424<commit_after> | import matplotlib.colors as mpcolors
import matplotlib.cm as cm
import psycopg2
import numpy as np
from pyiem.plot import MapPlot
POSTGIS = psycopg2.connect(database='postgis', host='localhost', user='nobody',
port=5555)
pcursor = POSTGIS.cursor()
cmap = cm.get_cmap("jet")
cmap.set_under("#... | Make some twitter plots of SVR,TOR freq hour
https://twitter.com/akrherz/status/703776738422050816
https://twitter.com/akrherz/status/703776599057895424import matplotlib.colors as mpcolors
import matplotlib.cm as cm
import psycopg2
import numpy as np
from pyiem.plot import MapPlot
POSTGIS = psycopg2.connect(database=... | <commit_before><commit_msg>Make some twitter plots of SVR,TOR freq hour
https://twitter.com/akrherz/status/703776738422050816
https://twitter.com/akrherz/status/703776599057895424<commit_after>import matplotlib.colors as mpcolors
import matplotlib.cm as cm
import psycopg2
import numpy as np
from pyiem.plot import Map... | |
e3f97f30291a407a54a021d7e4a1805e75c1ec41 | midonet/neutron/api.py | midonet/neutron/api.py | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2014 Midokura SARL.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | Add Tunnel Zone and Tunnel Zone Host API handlers | Add Tunnel Zone and Tunnel Zone Host API handlers
This patch adds TunnelzoneHandlerMixin and
TunnelzonehostHandlerMixin to the core plugin using
generate_methods decorators.
This patch also adds symbols for 'list', 'show', 'create', 'update'
and 'delete'. It'd be too easy to have typos for them and I added
symbols fo... | Python | apache-2.0 | midonet/python-neutron-plugin-midonet,midonet/python-neutron-plugin-midonet,JoeMido/networking-midonet,yamt/networking-midonet,midokura/python-neutron-plugin-midonet,yamt/networking-midonet,JoeMido/networking-midonet,midokura/python-neutron-plugin-midonet | Add Tunnel Zone and Tunnel Zone Host API handlers
This patch adds TunnelzoneHandlerMixin and
TunnelzonehostHandlerMixin to the core plugin using
generate_methods decorators.
This patch also adds symbols for 'list', 'show', 'create', 'update'
and 'delete'. It'd be too easy to have typos for them and I added
symbols fo... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2014 Midokura SARL.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | <commit_before><commit_msg>Add Tunnel Zone and Tunnel Zone Host API handlers
This patch adds TunnelzoneHandlerMixin and
TunnelzonehostHandlerMixin to the core plugin using
generate_methods decorators.
This patch also adds symbols for 'list', 'show', 'create', 'update'
and 'delete'. It'd be too easy to have typos for ... | # vim: tabstop=4 shiftwidth=4 softtabstop=4
# Copyright (C) 2014 Midokura SARL.
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.o... | Add Tunnel Zone and Tunnel Zone Host API handlers
This patch adds TunnelzoneHandlerMixin and
TunnelzonehostHandlerMixin to the core plugin using
generate_methods decorators.
This patch also adds symbols for 'list', 'show', 'create', 'update'
and 'delete'. It'd be too easy to have typos for them and I added
symbols fo... | <commit_before><commit_msg>Add Tunnel Zone and Tunnel Zone Host API handlers
This patch adds TunnelzoneHandlerMixin and
TunnelzonehostHandlerMixin to the core plugin using
generate_methods decorators.
This patch also adds symbols for 'list', 'show', 'create', 'update'
and 'delete'. It'd be too easy to have typos for ... | |
b6bb33aae60239d882cd86640313ed9e9802a5cc | neutron/tests/unit/ml2/test_type_local.py | neutron/tests/unit/ml2/test_type_local.py | # Copyright (c) 2014 Thales Services SAS
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Add local type driver unittests | Add local type driver unittests
Partial-Bug: #1269127
Change-Id: I5b34dc09128bcb879ea46be64cc5104eeefd4ab4
| Python | apache-2.0 | gkotton/vmware-nsx,gkotton/vmware-nsx | Add local type driver unittests
Partial-Bug: #1269127
Change-Id: I5b34dc09128bcb879ea46be64cc5104eeefd4ab4 | # Copyright (c) 2014 Thales Services SAS
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | <commit_before><commit_msg>Add local type driver unittests
Partial-Bug: #1269127
Change-Id: I5b34dc09128bcb879ea46be64cc5104eeefd4ab4<commit_after> | # Copyright (c) 2014 Thales Services SAS
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless r... | Add local type driver unittests
Partial-Bug: #1269127
Change-Id: I5b34dc09128bcb879ea46be64cc5104eeefd4ab4# Copyright (c) 2014 Thales Services SAS
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may... | <commit_before><commit_msg>Add local type driver unittests
Partial-Bug: #1269127
Change-Id: I5b34dc09128bcb879ea46be64cc5104eeefd4ab4<commit_after># Copyright (c) 2014 Thales Services SAS
# All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file excep... | |
1edb86e0c92bb186fccd9e0179b0d8b6dcc27902 | pygments/styles/igor.py | pygments/styles/igor.py | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | Add custom style which imitates the offical coloring | Add custom style which imitates the offical coloring
--HG--
branch : igor-pro-changes-v2
| Python | bsd-2-clause | kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64/pygments-unofficial,kirbyfan64... | Add custom style which imitates the offical coloring
--HG--
branch : igor-pro-changes-v2 | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | <commit_before><commit_msg>Add custom style which imitates the offical coloring
--HG--
branch : igor-pro-changes-v2<commit_after> | from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'italic #FF0000',
Keyword: '#0000FF',
Name.Function: ... | Add custom style which imitates the offical coloring
--HG--
branch : igor-pro-changes-v2from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles = {
Comment: 'ita... | <commit_before><commit_msg>Add custom style which imitates the offical coloring
--HG--
branch : igor-pro-changes-v2<commit_after>from pygments.style import Style
from pygments.token import Keyword, Name, Comment, String, Error, \
Number, Operator, Generic
class IgorStyle(Style):
default_style = ""
styles... | |
a47b82f7feb18da55cf402e363508141764a180f | 2014/round-1/labelmaker-v2.py | 2014/round-1/labelmaker-v2.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def solve():
L, N = input().split(' ')
N = int(N)
result = ''
while N > 0:
N -= 1
result = L[N % len(L)] + result
N = int(N / len(L))
return result
def main():
T = int(input())
for i in range(T):
print('Case #... | Add solution v2 for Labelmaker. | Add solution v2 for Labelmaker.
| Python | mit | changyuheng/hacker-cup-solutions | Add solution v2 for Labelmaker. | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def solve():
L, N = input().split(' ')
N = int(N)
result = ''
while N > 0:
N -= 1
result = L[N % len(L)] + result
N = int(N / len(L))
return result
def main():
T = int(input())
for i in range(T):
print('Case #... | <commit_before><commit_msg>Add solution v2 for Labelmaker.<commit_after> | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
def solve():
L, N = input().split(' ')
N = int(N)
result = ''
while N > 0:
N -= 1
result = L[N % len(L)] + result
N = int(N / len(L))
return result
def main():
T = int(input())
for i in range(T):
print('Case #... | Add solution v2 for Labelmaker.#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def solve():
L, N = input().split(' ')
N = int(N)
result = ''
while N > 0:
N -= 1
result = L[N % len(L)] + result
N = int(N / len(L))
return result
def main():
T = int(input())
for i in ... | <commit_before><commit_msg>Add solution v2 for Labelmaker.<commit_after>#!/usr/bin/env python3
# -*- coding: utf-8 -*-
def solve():
L, N = input().split(' ')
N = int(N)
result = ''
while N > 0:
N -= 1
result = L[N % len(L)] + result
N = int(N / len(L))
return result
def m... | |
da5a3d5bf9d7a6130f05339f36798b3e5d93e7a2 | scripts/prism_4km_monthly_modern.py | scripts/prism_4km_monthly_modern.py | #retriever
"""Retriever script for direct download of PRISM climate data"""
from retriever.lib.templates import Script
import urlparse
class main(Script):
def __init__(self, **kwargs):
Script.__init__(self, **kwargs)
self.name = "PRISM Climate Data"
self.shortname = "PRISM"
self.r... | Add script for downloading the modern PRISM climate data | Add script for downloading the modern PRISM climate data
The modern PRISM data provides monthly raster precip and temperature measures
for the United States from 1981 to present.
| Python | mit | goelakash/retriever,davharris/retriever,goelakash/retriever,davharris/retriever,henrykironde/deletedret,embaldridge/retriever,embaldridge/retriever,embaldridge/retriever,henrykironde/deletedret,davharris/retriever | Add script for downloading the modern PRISM climate data
The modern PRISM data provides monthly raster precip and temperature measures
for the United States from 1981 to present. | #retriever
"""Retriever script for direct download of PRISM climate data"""
from retriever.lib.templates import Script
import urlparse
class main(Script):
def __init__(self, **kwargs):
Script.__init__(self, **kwargs)
self.name = "PRISM Climate Data"
self.shortname = "PRISM"
self.r... | <commit_before><commit_msg>Add script for downloading the modern PRISM climate data
The modern PRISM data provides monthly raster precip and temperature measures
for the United States from 1981 to present.<commit_after> | #retriever
"""Retriever script for direct download of PRISM climate data"""
from retriever.lib.templates import Script
import urlparse
class main(Script):
def __init__(self, **kwargs):
Script.__init__(self, **kwargs)
self.name = "PRISM Climate Data"
self.shortname = "PRISM"
self.r... | Add script for downloading the modern PRISM climate data
The modern PRISM data provides monthly raster precip and temperature measures
for the United States from 1981 to present.#retriever
"""Retriever script for direct download of PRISM climate data"""
from retriever.lib.templates import Script
import urlparse
cla... | <commit_before><commit_msg>Add script for downloading the modern PRISM climate data
The modern PRISM data provides monthly raster precip and temperature measures
for the United States from 1981 to present.<commit_after>#retriever
"""Retriever script for direct download of PRISM climate data"""
from retriever.lib.tem... | |
62513585437d2c86f8668eb26eebb6f8c5a1a656 | Testiranje/Serijski.py | Testiranje/Serijski.py | '''
Created on Nov 24, 2013
@author: gregor
'''
from serial import *
from threading import Thread
last_received = ''
def receiving(ser):
while True:
print ser.readline()
if __name__ == '__main__':
#ser = Serial(port=None, baudrate=9600, bytesize=EIGHTBITS, parity=PARITY_NONE, stopbits=STOPBITS_ONE,... | Test branja serijskega vmesnika na Ubuntu-ju. Branje z naprave Arduino UNO. | Test branja serijskega vmesnika na Ubuntu-ju.
Branje z naprave Arduino UNO. | Python | mit | blazdivjak/rzpproject | Test branja serijskega vmesnika na Ubuntu-ju.
Branje z naprave Arduino UNO. | '''
Created on Nov 24, 2013
@author: gregor
'''
from serial import *
from threading import Thread
last_received = ''
def receiving(ser):
while True:
print ser.readline()
if __name__ == '__main__':
#ser = Serial(port=None, baudrate=9600, bytesize=EIGHTBITS, parity=PARITY_NONE, stopbits=STOPBITS_ONE,... | <commit_before><commit_msg>Test branja serijskega vmesnika na Ubuntu-ju.
Branje z naprave Arduino UNO.<commit_after> | '''
Created on Nov 24, 2013
@author: gregor
'''
from serial import *
from threading import Thread
last_received = ''
def receiving(ser):
while True:
print ser.readline()
if __name__ == '__main__':
#ser = Serial(port=None, baudrate=9600, bytesize=EIGHTBITS, parity=PARITY_NONE, stopbits=STOPBITS_ONE,... | Test branja serijskega vmesnika na Ubuntu-ju.
Branje z naprave Arduino UNO.'''
Created on Nov 24, 2013
@author: gregor
'''
from serial import *
from threading import Thread
last_received = ''
def receiving(ser):
while True:
print ser.readline()
if __name__ == '__main__':
#ser = Serial(port=None, b... | <commit_before><commit_msg>Test branja serijskega vmesnika na Ubuntu-ju.
Branje z naprave Arduino UNO.<commit_after>'''
Created on Nov 24, 2013
@author: gregor
'''
from serial import *
from threading import Thread
last_received = ''
def receiving(ser):
while True:
print ser.readline()
if __name__ == '... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.