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 |
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
bdea8195a3f06c3e69c655419b63dbcf925a6382 | test_install.py | test_install.py | # -*- coding: utf-8 -*-
import requests
import sys
from insight_reloaded.insight_settings import CROP_SIZE
def main():
args = {}
args['crop'] = CROP_SIZE
args['url'] = 'http://www.novapost.fr/emploi/ruby.pdf'
if len(sys.argv) > 1:
args['url'] = sys.argv[1]
if len(sys.argv) > 2:
a... | Add a functional test for insight. | Add a functional test for insight.
| Python | bsd-3-clause | novapost/insight-reloaded | Add a functional test for insight. | # -*- coding: utf-8 -*-
import requests
import sys
from insight_reloaded.insight_settings import CROP_SIZE
def main():
args = {}
args['crop'] = CROP_SIZE
args['url'] = 'http://www.novapost.fr/emploi/ruby.pdf'
if len(sys.argv) > 1:
args['url'] = sys.argv[1]
if len(sys.argv) > 2:
a... | <commit_before><commit_msg>Add a functional test for insight.<commit_after> | # -*- coding: utf-8 -*-
import requests
import sys
from insight_reloaded.insight_settings import CROP_SIZE
def main():
args = {}
args['crop'] = CROP_SIZE
args['url'] = 'http://www.novapost.fr/emploi/ruby.pdf'
if len(sys.argv) > 1:
args['url'] = sys.argv[1]
if len(sys.argv) > 2:
a... | Add a functional test for insight.# -*- coding: utf-8 -*-
import requests
import sys
from insight_reloaded.insight_settings import CROP_SIZE
def main():
args = {}
args['crop'] = CROP_SIZE
args['url'] = 'http://www.novapost.fr/emploi/ruby.pdf'
if len(sys.argv) > 1:
args['url'] = sys.argv[1]
... | <commit_before><commit_msg>Add a functional test for insight.<commit_after># -*- coding: utf-8 -*-
import requests
import sys
from insight_reloaded.insight_settings import CROP_SIZE
def main():
args = {}
args['crop'] = CROP_SIZE
args['url'] = 'http://www.novapost.fr/emploi/ruby.pdf'
if len(sys.argv)... | |
fef1191dc42a5710f14635182f59b4bc643b549e | senlinclient/tests/unit/test_sdk.py | senlinclient/tests/unit/test_sdk.py | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add unit test cases for sdk module | Add unit test cases for sdk module
Add unit test cases for sdk module for class ProfileAction
Still need unit tests for class Resource
Change-Id: I6328e6346bbc2e615d1824aeb223e76cb5c8adf0
Partial-Bug: #1484496
| Python | apache-2.0 | stackforge/python-senlinclient,stackforge/python-senlinclient,openstack/python-senlinclient,openstack/python-senlinclient | Add unit test cases for sdk module
Add unit test cases for sdk module for class ProfileAction
Still need unit tests for class Resource
Change-Id: I6328e6346bbc2e615d1824aeb223e76cb5c8adf0
Partial-Bug: #1484496 | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | <commit_before><commit_msg>Add unit test cases for sdk module
Add unit test cases for sdk module for class ProfileAction
Still need unit tests for class Resource
Change-Id: I6328e6346bbc2e615d1824aeb223e76cb5c8adf0
Partial-Bug: #1484496<commit_after> | # Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compliance with the License. You may obtain
# a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under t... | Add unit test cases for sdk module
Add unit test cases for sdk module for class ProfileAction
Still need unit tests for class Resource
Change-Id: I6328e6346bbc2e615d1824aeb223e76cb5c8adf0
Partial-Bug: #1484496# Licensed under the Apache License, Version 2.0 (the "License"); you may
# not use this file except in compl... | <commit_before><commit_msg>Add unit test cases for sdk module
Add unit test cases for sdk module for class ProfileAction
Still need unit tests for class Resource
Change-Id: I6328e6346bbc2e615d1824aeb223e76cb5c8adf0
Partial-Bug: #1484496<commit_after># Licensed under the Apache License, Version 2.0 (the "License"); yo... | |
2c7b64ea22ebe7e35945550f5726a72a721213b4 | minitests/litex/src.yosys/missing_bit_report.py | minitests/litex/src.yosys/missing_bit_report.py | """ Generates a missing feature/bit report for LiteX design.
This script is fairly fragile, because it depends on the specific observation
that all of the remaining bits appear to either belong to HCLK_IOI or IOI3
tiles. A more general version of this script could be created, but that was
not the point of this scrip... | Create script for generating remaining bit report. | Create script for generating remaining bit report.
This report is fairly fragile, but works well enough for the remaining
LiteX bits.
Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>
| Python | isc | SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray,SymbiFlow/prjxray | Create script for generating remaining bit report.
This report is fairly fragile, but works well enough for the remaining
LiteX bits.
Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com> | """ Generates a missing feature/bit report for LiteX design.
This script is fairly fragile, because it depends on the specific observation
that all of the remaining bits appear to either belong to HCLK_IOI or IOI3
tiles. A more general version of this script could be created, but that was
not the point of this scrip... | <commit_before><commit_msg>Create script for generating remaining bit report.
This report is fairly fragile, but works well enough for the remaining
LiteX bits.
Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com><commit_after> | """ Generates a missing feature/bit report for LiteX design.
This script is fairly fragile, because it depends on the specific observation
that all of the remaining bits appear to either belong to HCLK_IOI or IOI3
tiles. A more general version of this script could be created, but that was
not the point of this scrip... | Create script for generating remaining bit report.
This report is fairly fragile, but works well enough for the remaining
LiteX bits.
Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com>""" Generates a missing feature/bit report for LiteX design.
This script is fairly frag... | <commit_before><commit_msg>Create script for generating remaining bit report.
This report is fairly fragile, but works well enough for the remaining
LiteX bits.
Signed-off-by: Keith Rothman <1bc19627a439baf17510dc2d0b2d250c96d445a5@users.noreply.github.com><commit_after>""" Generates a missing feature/bit report for ... | |
e84abb1b67586d3a3620ce6a21e3314527083218 | doc/examples/plot_threshold_adaptive.py | doc/examples/plot_threshold_adaptive.py | """
=====================
Adaptive Thresholding
=====================
Thresholding is the simplest way to segment objects from a background. If that
background is relatively uniform, then you can use a global threshold value to
binarize the image by pixel-intensity. If there's large variation in the
background intensi... | Add example of adaptive thresholding. | DOC: Add example of adaptive thresholding.
| Python | bsd-3-clause | Hiyorimi/scikit-image,ofgulban/scikit-image,rjeli/scikit-image,newville/scikit-image,almarklein/scikit-image,youprofit/scikit-image,chintak/scikit-image,dpshelio/scikit-image,emon10005/scikit-image,vighneshbirodkar/scikit-image,ClinicalGraphics/scikit-image,juliusbierk/scikit-image,robintw/scikit-image,keflavich/scikit... | DOC: Add example of adaptive thresholding. | """
=====================
Adaptive Thresholding
=====================
Thresholding is the simplest way to segment objects from a background. If that
background is relatively uniform, then you can use a global threshold value to
binarize the image by pixel-intensity. If there's large variation in the
background intensi... | <commit_before><commit_msg>DOC: Add example of adaptive thresholding.<commit_after> | """
=====================
Adaptive Thresholding
=====================
Thresholding is the simplest way to segment objects from a background. If that
background is relatively uniform, then you can use a global threshold value to
binarize the image by pixel-intensity. If there's large variation in the
background intensi... | DOC: Add example of adaptive thresholding."""
=====================
Adaptive Thresholding
=====================
Thresholding is the simplest way to segment objects from a background. If that
background is relatively uniform, then you can use a global threshold value to
binarize the image by pixel-intensity. If there's... | <commit_before><commit_msg>DOC: Add example of adaptive thresholding.<commit_after>"""
=====================
Adaptive Thresholding
=====================
Thresholding is the simplest way to segment objects from a background. If that
background is relatively uniform, then you can use a global threshold value to
binarize... | |
2f37f0ae1fc024b97de4c783c8f162c02c2c3a2d | hemresadapter.py | hemresadapter.py | # coding=utf-8
# description: functions to interact with the newsletter subscriptions in jdwebsite (Hemres),
# via Hemres management commands
import os
import subprocess
import configparser
class HemresAdapter(object):
def __init__(self):
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
co... | Create hemres (jdwebsite newsletter) interface adapter | Create hemres (jdwebsite newsletter) interface adapter
| Python | mit | jonge-democraten/jdleden,jonge-democraten/jdleden | Create hemres (jdwebsite newsletter) interface adapter | # coding=utf-8
# description: functions to interact with the newsletter subscriptions in jdwebsite (Hemres),
# via Hemres management commands
import os
import subprocess
import configparser
class HemresAdapter(object):
def __init__(self):
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
co... | <commit_before><commit_msg>Create hemres (jdwebsite newsletter) interface adapter<commit_after> | # coding=utf-8
# description: functions to interact with the newsletter subscriptions in jdwebsite (Hemres),
# via Hemres management commands
import os
import subprocess
import configparser
class HemresAdapter(object):
def __init__(self):
SCRIPTDIR = os.path.dirname(os.path.realpath(__file__))
co... | Create hemres (jdwebsite newsletter) interface adapter# coding=utf-8
# description: functions to interact with the newsletter subscriptions in jdwebsite (Hemres),
# via Hemres management commands
import os
import subprocess
import configparser
class HemresAdapter(object):
def __init__(self):
SCRIPTDIR = ... | <commit_before><commit_msg>Create hemres (jdwebsite newsletter) interface adapter<commit_after># coding=utf-8
# description: functions to interact with the newsletter subscriptions in jdwebsite (Hemres),
# via Hemres management commands
import os
import subprocess
import configparser
class HemresAdapter(object):
... | |
38db1be31407ecab2237c3cd75160f5ffeb59cb2 | Split_Multipoint_CZI.py | Split_Multipoint_CZI.py | # @File(label="Input file") input
# @File(label="Output folder") output
# Splits multi-point CZI files into multiple TIFFs using Bio-Formats.
#
# Stefan Helfrich (University of Konstaz), 05/09/2016
from ij import IJ
from loci.plugins import BF
from loci.plugins.in import ImporterOptions
import os
srcPath = input.get... | Add script to split multi-point CZIs | Add script to split multi-point CZIs
| Python | bsd-2-clause | bic-kn/imagej-scripts | Add script to split multi-point CZIs | # @File(label="Input file") input
# @File(label="Output folder") output
# Splits multi-point CZI files into multiple TIFFs using Bio-Formats.
#
# Stefan Helfrich (University of Konstaz), 05/09/2016
from ij import IJ
from loci.plugins import BF
from loci.plugins.in import ImporterOptions
import os
srcPath = input.get... | <commit_before><commit_msg>Add script to split multi-point CZIs<commit_after> | # @File(label="Input file") input
# @File(label="Output folder") output
# Splits multi-point CZI files into multiple TIFFs using Bio-Formats.
#
# Stefan Helfrich (University of Konstaz), 05/09/2016
from ij import IJ
from loci.plugins import BF
from loci.plugins.in import ImporterOptions
import os
srcPath = input.get... | Add script to split multi-point CZIs# @File(label="Input file") input
# @File(label="Output folder") output
# Splits multi-point CZI files into multiple TIFFs using Bio-Formats.
#
# Stefan Helfrich (University of Konstaz), 05/09/2016
from ij import IJ
from loci.plugins import BF
from loci.plugins.in import ImporterOp... | <commit_before><commit_msg>Add script to split multi-point CZIs<commit_after># @File(label="Input file") input
# @File(label="Output folder") output
# Splits multi-point CZI files into multiple TIFFs using Bio-Formats.
#
# Stefan Helfrich (University of Konstaz), 05/09/2016
from ij import IJ
from loci.plugins import ... | |
d8168c182efb9ca6e05c9f8fdf253cb25ff6599d | Python/Soma2Numeros.py | Python/Soma2Numeros.py |
# Problem
# Given an array/list A of n numbers and another number x, determines
# if exists two elements in A whose sum is exactly x
# Works only for different values
def solution1(values, expected):
dic = {}
for index, value in enumerate(values):
dic[value] = index
diff = expected - value
... | Add problema da soma de 2 numeros | Add problema da soma de 2 numeros | Python | mit | kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-de-Dados,kelvins/Algoritmos-e-Estruturas-d... | Add problema da soma de 2 numeros |
# Problem
# Given an array/list A of n numbers and another number x, determines
# if exists two elements in A whose sum is exactly x
# Works only for different values
def solution1(values, expected):
dic = {}
for index, value in enumerate(values):
dic[value] = index
diff = expected - value
... | <commit_before><commit_msg>Add problema da soma de 2 numeros<commit_after> |
# Problem
# Given an array/list A of n numbers and another number x, determines
# if exists two elements in A whose sum is exactly x
# Works only for different values
def solution1(values, expected):
dic = {}
for index, value in enumerate(values):
dic[value] = index
diff = expected - value
... | Add problema da soma de 2 numeros
# Problem
# Given an array/list A of n numbers and another number x, determines
# if exists two elements in A whose sum is exactly x
# Works only for different values
def solution1(values, expected):
dic = {}
for index, value in enumerate(values):
dic[value] = index
... | <commit_before><commit_msg>Add problema da soma de 2 numeros<commit_after>
# Problem
# Given an array/list A of n numbers and another number x, determines
# if exists two elements in A whose sum is exactly x
# Works only for different values
def solution1(values, expected):
dic = {}
for index, value in enumera... | |
5f0788be20bad0cef4a31a88b7513da58822a157 | buildbucket.py | buildbucket.py | #!/usr/bin/env python
# Copyright (c) 2015 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.
"""Tool for interacting with Buildbucket.
Usage:
$ depot-tools-auth login https://cr-buildbucket.appspot.com
$ buildbucket.py ... | Add script for triggering Buildbucket builds | Add script for triggering Buildbucket builds
BUG=493885
TESTED=See https://paste.googleplex.com/5622248052359168
Review URL: https://codereview.chromium.org/1164363003
git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@295569 0039d316-1c4b-4281-b951-d872f2087c98
| Python | bsd-3-clause | duongbaoduy/gtools,mlufei/depot_tools,aleonliao/depot_tools,azunite/chrome_build,azunite/chrome_build,disigma/depot_tools,hsharsha/depot_tools,chinmaygarde/depot_tools,kaiix/depot_tools,fracting/depot_tools,disigma/depot_tools,fracting/depot_tools,mlufei/depot_tools,aleonliao/depot_tools,ajohnson23/depot_tools,mlufei/d... | Add script for triggering Buildbucket builds
BUG=493885
TESTED=See https://paste.googleplex.com/5622248052359168
Review URL: https://codereview.chromium.org/1164363003
git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@295569 0039d316-1c4b-4281-b951-d872f2087c98 | #!/usr/bin/env python
# Copyright (c) 2015 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.
"""Tool for interacting with Buildbucket.
Usage:
$ depot-tools-auth login https://cr-buildbucket.appspot.com
$ buildbucket.py ... | <commit_before><commit_msg>Add script for triggering Buildbucket builds
BUG=493885
TESTED=See https://paste.googleplex.com/5622248052359168
Review URL: https://codereview.chromium.org/1164363003
git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@295569 0039d316-1c4b-4281-b951-d872f2087c98<commit_after> | #!/usr/bin/env python
# Copyright (c) 2015 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.
"""Tool for interacting with Buildbucket.
Usage:
$ depot-tools-auth login https://cr-buildbucket.appspot.com
$ buildbucket.py ... | Add script for triggering Buildbucket builds
BUG=493885
TESTED=See https://paste.googleplex.com/5622248052359168
Review URL: https://codereview.chromium.org/1164363003
git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@295569 0039d316-1c4b-4281-b951-d872f2087c98#!/usr/bin/env python
# Copyright (c) 2015 The Chromi... | <commit_before><commit_msg>Add script for triggering Buildbucket builds
BUG=493885
TESTED=See https://paste.googleplex.com/5622248052359168
Review URL: https://codereview.chromium.org/1164363003
git-svn-id: fd409f4bdeea2bb50a5d34bb4d4bfc2046a5a3dd@295569 0039d316-1c4b-4281-b951-d872f2087c98<commit_after>#!/usr/bin/e... | |
d49b23365a972931502329f47a3aa65b9170477e | openstack/common/middleware/catch_errors.py | openstack/common/middleware/catch_errors.py | # Copyright (c) 2013 NEC Corporation
# 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 requi... | # Copyright (c) 2013 NEC Corporation
# 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 requi... | Update oslo log messages with translation domains | Update oslo log messages with translation domains
Update the incubator code to use different domains for log
messages at different levels.
Update the import exceptions setting for hacking to allow
multiple functions to be imported from gettextutils on one
line.
bp log-messages-translation-domain
Change-Id: I6ce0f4a... | Python | apache-2.0 | varunarya10/oslo.middleware,openstack/oslo.middleware,chungg/oslo.middleware,JioCloud/oslo.middleware | # Copyright (c) 2013 NEC Corporation
# 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 requi... | # Copyright (c) 2013 NEC Corporation
# 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 requi... | <commit_before># Copyright (c) 2013 NEC Corporation
# 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
#
# ... | # Copyright (c) 2013 NEC Corporation
# 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 requi... | # Copyright (c) 2013 NEC Corporation
# 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 requi... | <commit_before># Copyright (c) 2013 NEC Corporation
# 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
#
# ... |
0cbce0ddc139dde1367155398d0c6a186408fab3 | hug/test.py | hug/test.py | from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
response = StartResp... | from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
response = StartResp... | Update call method to return entire response object, and work with non json data | Update call method to return entire response object, and work with non json data
| Python | mit | shaunstanislaus/hug,janusnic/hug,origingod/hug,shaunstanislaus/hug,giserh/hug,yasoob/hug,timothycrosley/hug,timothycrosley/hug,philiptzou/hug,alisaifee/hug,yasoob/hug,jean/hug,MuhammadAlkarouri/hug,gbn972/hug,giserh/hug,gbn972/hug,alisaifee/hug,MuhammadAlkarouri/hug,STANAPO/hug,janusnic/hug,jean/hug,origingod/hug,STANA... | from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
response = StartResp... | from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
response = StartResp... | <commit_before>from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
respo... | from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
response = StartResp... | from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
response = StartResp... | <commit_before>from falcon.testing import StartResponseMock, create_environ
from falcon import HTTP_METHODS
from urllib.parse import urlencode
import json
from hug.run import server
from functools import partial
def call(method, api_module, url, body='', headers=None, **params):
api = server(api_module)
respo... |
e388f4c982d629da12f59626440d0d88e940db8d | hug/this.py | hug/this.py | """hug/this.py.
The Zen of Hug
Copyright (C) 2019 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy... | Add initial Zen of Hug to satisfy HOPE-20 | Add initial Zen of Hug to satisfy HOPE-20
| Python | mit | timothycrosley/hug,timothycrosley/hug,timothycrosley/hug | Add initial Zen of Hug to satisfy HOPE-20 | """hug/this.py.
The Zen of Hug
Copyright (C) 2019 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy... | <commit_before><commit_msg>Add initial Zen of Hug to satisfy HOPE-20<commit_after> | """hug/this.py.
The Zen of Hug
Copyright (C) 2019 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without limitation
the rights to use, copy... | Add initial Zen of Hug to satisfy HOPE-20"""hug/this.py.
The Zen of Hug
Copyright (C) 2019 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including w... | <commit_before><commit_msg>Add initial Zen of Hug to satisfy HOPE-20<commit_after>"""hug/this.py.
The Zen of Hug
Copyright (C) 2019 Timothy Edmund Crosley
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the ... | |
11f16de1876e76b3c52494397d5613aa80530736 | sidewinder/streaming/map_and_reduce.py | sidewinder/streaming/map_and_reduce.py | #!/usr/bin/env python2.7
# coding=utf-8
LST = [4, 2, 3, 2, 1, 1, 5]
def map_reduce(lst):
"""
Map values and reduce based on key.
:param lst: list of values.
:return: map of values.
"""
dct = {}
for num in lst:
if num in dct:
print '{} key exists. updating value'.form... | Add map and recude example. | Add map and recude example.
| Python | mit | vsamov/sidewinder,vsamov/sidewinder,vsamov/sidewinder | Add map and recude example. | #!/usr/bin/env python2.7
# coding=utf-8
LST = [4, 2, 3, 2, 1, 1, 5]
def map_reduce(lst):
"""
Map values and reduce based on key.
:param lst: list of values.
:return: map of values.
"""
dct = {}
for num in lst:
if num in dct:
print '{} key exists. updating value'.form... | <commit_before><commit_msg>Add map and recude example.<commit_after> | #!/usr/bin/env python2.7
# coding=utf-8
LST = [4, 2, 3, 2, 1, 1, 5]
def map_reduce(lst):
"""
Map values and reduce based on key.
:param lst: list of values.
:return: map of values.
"""
dct = {}
for num in lst:
if num in dct:
print '{} key exists. updating value'.form... | Add map and recude example.#!/usr/bin/env python2.7
# coding=utf-8
LST = [4, 2, 3, 2, 1, 1, 5]
def map_reduce(lst):
"""
Map values and reduce based on key.
:param lst: list of values.
:return: map of values.
"""
dct = {}
for num in lst:
if num in dct:
print '{} key e... | <commit_before><commit_msg>Add map and recude example.<commit_after>#!/usr/bin/env python2.7
# coding=utf-8
LST = [4, 2, 3, 2, 1, 1, 5]
def map_reduce(lst):
"""
Map values and reduce based on key.
:param lst: list of values.
:return: map of values.
"""
dct = {}
for num in lst:
i... | |
f8d86e2339102232fe31aa4828f22a4338f803a0 | src/poliastro/tests/test_frames.py | src/poliastro/tests/test_frames.py | import pytest
from astropy import units as u
from astropy.coordinates import (
CartesianRepresentation,
get_body_barycentric, solar_system_ephemeris
)
from astropy.tests.helper import assert_quantity_allclose
from poliastro.constants import J2000
from poliastro.bodies import (
Sun, Mercury, Venus, Earth, ... | Add tests for ICRS frames | Add tests for ICRS frames
| Python | mit | Juanlu001/poliastro,poliastro/poliastro,newlawrence/poliastro,Juanlu001/poliastro,Juanlu001/poliastro,newlawrence/poliastro,newlawrence/poliastro | Add tests for ICRS frames | import pytest
from astropy import units as u
from astropy.coordinates import (
CartesianRepresentation,
get_body_barycentric, solar_system_ephemeris
)
from astropy.tests.helper import assert_quantity_allclose
from poliastro.constants import J2000
from poliastro.bodies import (
Sun, Mercury, Venus, Earth, ... | <commit_before><commit_msg>Add tests for ICRS frames<commit_after> | import pytest
from astropy import units as u
from astropy.coordinates import (
CartesianRepresentation,
get_body_barycentric, solar_system_ephemeris
)
from astropy.tests.helper import assert_quantity_allclose
from poliastro.constants import J2000
from poliastro.bodies import (
Sun, Mercury, Venus, Earth, ... | Add tests for ICRS framesimport pytest
from astropy import units as u
from astropy.coordinates import (
CartesianRepresentation,
get_body_barycentric, solar_system_ephemeris
)
from astropy.tests.helper import assert_quantity_allclose
from poliastro.constants import J2000
from poliastro.bodies import (
Sun... | <commit_before><commit_msg>Add tests for ICRS frames<commit_after>import pytest
from astropy import units as u
from astropy.coordinates import (
CartesianRepresentation,
get_body_barycentric, solar_system_ephemeris
)
from astropy.tests.helper import assert_quantity_allclose
from poliastro.constants import J20... | |
2648944859e4b727855eb31eb337f0d27258b472 | iatidq/dqpublishercondition.py | iatidq/dqpublishercondition.py |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | Move database functions out to iatidq | Move database functions out to iatidq
| Python | agpl-3.0 | pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality,pwyf/IATI-Data-Quality | Move database functions out to iatidq |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | <commit_before><commit_msg>Move database functions out to iatidq<commit_after> |
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the GNU Affero General Public License v3... | Move database functions out to iatidq
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute and/or modify
# it under the terms of the... | <commit_before><commit_msg>Move database functions out to iatidq<commit_after>
# IATI Data Quality, tools for Data QA on IATI-formatted publications
# by Mark Brough, Martin Keegan, Ben Webb and Jennifer Smith
#
# Copyright (C) 2013 Publish What You Fund
#
# This programme is free software; you may redistribute a... | |
18dfdce4307e0f678f9a46fa4bccb51e31c4ff69 | red.py | red.py | from logipy import logi_led
import time
import ctypes
logi_led.logi_led_init()
time.sleep(1) # Give the SDK a second to initialize
logi_led.logi_led_set_lighting(100, 0, 0)
logi_led.logi_led_shutdown()
| Add simple script from the logipy page | Add simple script from the logipy page
| Python | mit | louismerlin/keyboard-games,louismerlin/keyboard-games | Add simple script from the logipy page | from logipy import logi_led
import time
import ctypes
logi_led.logi_led_init()
time.sleep(1) # Give the SDK a second to initialize
logi_led.logi_led_set_lighting(100, 0, 0)
logi_led.logi_led_shutdown()
| <commit_before><commit_msg>Add simple script from the logipy page<commit_after> | from logipy import logi_led
import time
import ctypes
logi_led.logi_led_init()
time.sleep(1) # Give the SDK a second to initialize
logi_led.logi_led_set_lighting(100, 0, 0)
logi_led.logi_led_shutdown()
| Add simple script from the logipy pagefrom logipy import logi_led
import time
import ctypes
logi_led.logi_led_init()
time.sleep(1) # Give the SDK a second to initialize
logi_led.logi_led_set_lighting(100, 0, 0)
logi_led.logi_led_shutdown()
| <commit_before><commit_msg>Add simple script from the logipy page<commit_after>from logipy import logi_led
import time
import ctypes
logi_led.logi_led_init()
time.sleep(1) # Give the SDK a second to initialize
logi_led.logi_led_set_lighting(100, 0, 0)
logi_led.logi_led_shutdown()
| |
190dae03cc027e397c387294075e1a38ad8647da | migrations/versions/2017-07-14_11:37:46__df33f3613823.py | migrations/versions/2017-07-14_11:37:46__df33f3613823.py | """empty message
Revision ID: df33f3613823
Revises: 15741cc426db
Create Date: 2017-07-14 11:37:46.347709
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'df33f3613823'
down_revision = '15741cc426db'
branch_labels = None
depends_on = None
def upgrade():
# ... | Add migration for patient model | :rocket: Add migration for patient model
| Python | mit | gems-uff/labsys,gems-uff/labsys,gems-uff/labsys | :rocket: Add migration for patient model | """empty message
Revision ID: df33f3613823
Revises: 15741cc426db
Create Date: 2017-07-14 11:37:46.347709
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'df33f3613823'
down_revision = '15741cc426db'
branch_labels = None
depends_on = None
def upgrade():
# ... | <commit_before><commit_msg>:rocket: Add migration for patient model<commit_after> | """empty message
Revision ID: df33f3613823
Revises: 15741cc426db
Create Date: 2017-07-14 11:37:46.347709
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'df33f3613823'
down_revision = '15741cc426db'
branch_labels = None
depends_on = None
def upgrade():
# ... | :rocket: Add migration for patient model"""empty message
Revision ID: df33f3613823
Revises: 15741cc426db
Create Date: 2017-07-14 11:37:46.347709
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'df33f3613823'
down_revision = '15741cc426db'
branch_labels = None
d... | <commit_before><commit_msg>:rocket: Add migration for patient model<commit_after>"""empty message
Revision ID: df33f3613823
Revises: 15741cc426db
Create Date: 2017-07-14 11:37:46.347709
"""
from alembic import op
import sqlalchemy as sa
# revision identifiers, used by Alembic.
revision = 'df33f3613823'
down_revisio... | |
3aa10577f292a2962f66926fb021ed4a1b6fc493 | lib/header/colors.py | lib/header/colors.py | """ANSI escape sequence objects.
This is designed to place ANSI escape sequences in format strings.
Colors and attributes are selected by using object attributes in
format strings.
For example,
'{0.red}Hello, {0.green}World!{0.reset}'.format(colors())
This prints "Hello, " in red, and "World" in green, and rese... | Add ANSI escape sequence library | Add ANSI escape sequence library
| Python | bsd-2-clause | depp/headerfix,depp/headerfix,depp/headerfix,depp/headerfix | Add ANSI escape sequence library | """ANSI escape sequence objects.
This is designed to place ANSI escape sequences in format strings.
Colors and attributes are selected by using object attributes in
format strings.
For example,
'{0.red}Hello, {0.green}World!{0.reset}'.format(colors())
This prints "Hello, " in red, and "World" in green, and rese... | <commit_before><commit_msg>Add ANSI escape sequence library<commit_after> | """ANSI escape sequence objects.
This is designed to place ANSI escape sequences in format strings.
Colors and attributes are selected by using object attributes in
format strings.
For example,
'{0.red}Hello, {0.green}World!{0.reset}'.format(colors())
This prints "Hello, " in red, and "World" in green, and rese... | Add ANSI escape sequence library"""ANSI escape sequence objects.
This is designed to place ANSI escape sequences in format strings.
Colors and attributes are selected by using object attributes in
format strings.
For example,
'{0.red}Hello, {0.green}World!{0.reset}'.format(colors())
This prints "Hello, " in red... | <commit_before><commit_msg>Add ANSI escape sequence library<commit_after>"""ANSI escape sequence objects.
This is designed to place ANSI escape sequences in format strings.
Colors and attributes are selected by using object attributes in
format strings.
For example,
'{0.red}Hello, {0.green}World!{0.reset}'.forma... | |
6ac16fc33a6f887535a143cc7155c7ff910ca835 | control/utils.py | control/utils.py | import csv
from datetime import datetime
import itertools
from django.http import StreamingHttpResponse
from django_object_actions import DjangoObjectActions
class Echo(object):
'''An object that implements just the write method of the file-like
interface.'''
def write(self, value):
'''Write the ... | Add django admin mixin for exporting csvs | Add django admin mixin for exporting csvs
| Python | bsd-3-clause | praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control,praekelt/ndoh-control | Add django admin mixin for exporting csvs | import csv
from datetime import datetime
import itertools
from django.http import StreamingHttpResponse
from django_object_actions import DjangoObjectActions
class Echo(object):
'''An object that implements just the write method of the file-like
interface.'''
def write(self, value):
'''Write the ... | <commit_before><commit_msg>Add django admin mixin for exporting csvs<commit_after> | import csv
from datetime import datetime
import itertools
from django.http import StreamingHttpResponse
from django_object_actions import DjangoObjectActions
class Echo(object):
'''An object that implements just the write method of the file-like
interface.'''
def write(self, value):
'''Write the ... | Add django admin mixin for exporting csvsimport csv
from datetime import datetime
import itertools
from django.http import StreamingHttpResponse
from django_object_actions import DjangoObjectActions
class Echo(object):
'''An object that implements just the write method of the file-like
interface.'''
def ... | <commit_before><commit_msg>Add django admin mixin for exporting csvs<commit_after>import csv
from datetime import datetime
import itertools
from django.http import StreamingHttpResponse
from django_object_actions import DjangoObjectActions
class Echo(object):
'''An object that implements just the write method of... | |
e107e3b47f015523861bafaab5cacce7deff6366 | Lib/test/crashers/multithreaded_close.py | Lib/test/crashers/multithreaded_close.py | # f.close() is not thread-safe: calling it at the same time as another
# operation (or another close) on the same file, but done from another
# thread, causes crashes. The issue is more complicated than it seems,
# witness the discussions in:
#
# http://bugs.python.org/issue595601
# http://bugs.python.org/issue815646
... | Add a crasher for the long-standing issue with closing a file while another thread uses it. | Add a crasher for the long-standing issue with closing a file
while another thread uses it.
| Python | mit | sk-/python2.7-type-annotator,sk-/python2.7-type-annotator,sk-/python2.7-type-annotator | Add a crasher for the long-standing issue with closing a file
while another thread uses it. | # f.close() is not thread-safe: calling it at the same time as another
# operation (or another close) on the same file, but done from another
# thread, causes crashes. The issue is more complicated than it seems,
# witness the discussions in:
#
# http://bugs.python.org/issue595601
# http://bugs.python.org/issue815646
... | <commit_before><commit_msg>Add a crasher for the long-standing issue with closing a file
while another thread uses it.<commit_after> | # f.close() is not thread-safe: calling it at the same time as another
# operation (or another close) on the same file, but done from another
# thread, causes crashes. The issue is more complicated than it seems,
# witness the discussions in:
#
# http://bugs.python.org/issue595601
# http://bugs.python.org/issue815646
... | Add a crasher for the long-standing issue with closing a file
while another thread uses it.# f.close() is not thread-safe: calling it at the same time as another
# operation (or another close) on the same file, but done from another
# thread, causes crashes. The issue is more complicated than it seems,
# witness the d... | <commit_before><commit_msg>Add a crasher for the long-standing issue with closing a file
while another thread uses it.<commit_after># f.close() is not thread-safe: calling it at the same time as another
# operation (or another close) on the same file, but done from another
# thread, causes crashes. The issue is more c... | |
c7a4ffbbb2023ebfb470ad79dd8b0d8217af0ff7 | pyecore/utils.py | pyecore/utils.py | """
This module gathers utility classes and functions that can ease metamodel and
model manipulation.
"""
from .ecore import EPackage, BadValueError
from .notification import EObserver, Kind
class DynamicEPackage(EObserver):
"""A DynamicEPackage gives the ability to directly handle metaclasses
from a metamode... | Add new class to ease dynamic metamodel handling | Add new class to ease dynamic metamodel handling
The dynamic metamodel manipulation is a little bit cumbersome when it
comes to extract all the existing EClass from a loaded
EPackage. Currently, a solution is to gather all the elements by hand
in dedicated variables:
>>> A = dynamic_epackage.getEClassifier('A')
>>> B... | Python | bsd-3-clause | aranega/pyecore,pyecore/pyecore | Add new class to ease dynamic metamodel handling
The dynamic metamodel manipulation is a little bit cumbersome when it
comes to extract all the existing EClass from a loaded
EPackage. Currently, a solution is to gather all the elements by hand
in dedicated variables:
>>> A = dynamic_epackage.getEClassifier('A')
>>> B... | """
This module gathers utility classes and functions that can ease metamodel and
model manipulation.
"""
from .ecore import EPackage, BadValueError
from .notification import EObserver, Kind
class DynamicEPackage(EObserver):
"""A DynamicEPackage gives the ability to directly handle metaclasses
from a metamode... | <commit_before><commit_msg>Add new class to ease dynamic metamodel handling
The dynamic metamodel manipulation is a little bit cumbersome when it
comes to extract all the existing EClass from a loaded
EPackage. Currently, a solution is to gather all the elements by hand
in dedicated variables:
>>> A = dynamic_epackag... | """
This module gathers utility classes and functions that can ease metamodel and
model manipulation.
"""
from .ecore import EPackage, BadValueError
from .notification import EObserver, Kind
class DynamicEPackage(EObserver):
"""A DynamicEPackage gives the ability to directly handle metaclasses
from a metamode... | Add new class to ease dynamic metamodel handling
The dynamic metamodel manipulation is a little bit cumbersome when it
comes to extract all the existing EClass from a loaded
EPackage. Currently, a solution is to gather all the elements by hand
in dedicated variables:
>>> A = dynamic_epackage.getEClassifier('A')
>>> B... | <commit_before><commit_msg>Add new class to ease dynamic metamodel handling
The dynamic metamodel manipulation is a little bit cumbersome when it
comes to extract all the existing EClass from a loaded
EPackage. Currently, a solution is to gather all the elements by hand
in dedicated variables:
>>> A = dynamic_epackag... | |
68b17dc4fa6cdf1c04922d9d4fae77252b6712cd | theanets/__init__.py | theanets/__init__.py | '''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.6.0pre'
| '''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.7.0pre'
| Fix package version for git master. | Fix package version for git master. [ci skip]
| Python | mit | chrinide/theanets,lmjohns3/theanets,devdoer/theanets | '''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.6.0pre'
Fix package version for git master... | '''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.7.0pre'
| <commit_before>'''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.6.0pre'
<commit_msg>Fix pac... | '''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.7.0pre'
| '''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.6.0pre'
Fix package version for git master... | <commit_before>'''This package groups together a bunch of theano code for neural nets.'''
from .feedforward import Autoencoder, Regressor, Classifier
from .graph import Network
from .main import Experiment
from . import layers
from . import recurrent
from . import trainer
__version__ = '0.6.0pre'
<commit_msg>Fix pac... |
22cfab045c15685f18baa8fc5d8b1b9036888f41 | scrapi/harvesters/cambridge.py | scrapi/harvesters/cambridge.py | '''
Harvester for the DSpace at Cambridge (production) for the SHARE project
Example API call: https://www.repository.cam.ac.uk/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class CambridgeHarvester(OAIHarvester):
short_name =... | Add harvester for the University of Cambridge | Add harvester for the University of Cambridge
Closes [#SHARE-103]
| Python | apache-2.0 | fabianvf/scrapi,fabianvf/scrapi,felliott/scrapi,erinspace/scrapi,felliott/scrapi,CenterForOpenScience/scrapi,CenterForOpenScience/scrapi,erinspace/scrapi | Add harvester for the University of Cambridge
Closes [#SHARE-103] | '''
Harvester for the DSpace at Cambridge (production) for the SHARE project
Example API call: https://www.repository.cam.ac.uk/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class CambridgeHarvester(OAIHarvester):
short_name =... | <commit_before><commit_msg>Add harvester for the University of Cambridge
Closes [#SHARE-103]<commit_after> | '''
Harvester for the DSpace at Cambridge (production) for the SHARE project
Example API call: https://www.repository.cam.ac.uk/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHarvester
class CambridgeHarvester(OAIHarvester):
short_name =... | Add harvester for the University of Cambridge
Closes [#SHARE-103]'''
Harvester for the DSpace at Cambridge (production) for the SHARE project
Example API call: https://www.repository.cam.ac.uk/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicode_literals
from scrapi.base import OAIHa... | <commit_before><commit_msg>Add harvester for the University of Cambridge
Closes [#SHARE-103]<commit_after>'''
Harvester for the DSpace at Cambridge (production) for the SHARE project
Example API call: https://www.repository.cam.ac.uk/oai/request?verb=ListRecords&metadataPrefix=oai_dc
'''
from __future__ import unicod... | |
911edb36fa6810dba3264dc3ba40648aeb9d436f | sv-comp-run.py | sv-comp-run.py | #!/usr/bin/python3
import sys
import glob
import subprocess
import re
import collections
import os.path
def str2bool(s):
return {
"true": True,
"false": False
}[s]
def extract_bool(p, s):
m = re.search(p, s)
return str2bool(m.group(1)) if m else None
set_filename = sys.argv[1]
with ... | Add own SV-COMP unreach-call set runner script | Add own SV-COMP unreach-call set runner script
| Python | mit | goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer,goblint/analyzer | Add own SV-COMP unreach-call set runner script | #!/usr/bin/python3
import sys
import glob
import subprocess
import re
import collections
import os.path
def str2bool(s):
return {
"true": True,
"false": False
}[s]
def extract_bool(p, s):
m = re.search(p, s)
return str2bool(m.group(1)) if m else None
set_filename = sys.argv[1]
with ... | <commit_before><commit_msg>Add own SV-COMP unreach-call set runner script<commit_after> | #!/usr/bin/python3
import sys
import glob
import subprocess
import re
import collections
import os.path
def str2bool(s):
return {
"true": True,
"false": False
}[s]
def extract_bool(p, s):
m = re.search(p, s)
return str2bool(m.group(1)) if m else None
set_filename = sys.argv[1]
with ... | Add own SV-COMP unreach-call set runner script#!/usr/bin/python3
import sys
import glob
import subprocess
import re
import collections
import os.path
def str2bool(s):
return {
"true": True,
"false": False
}[s]
def extract_bool(p, s):
m = re.search(p, s)
return str2bool(m.group(1)) if... | <commit_before><commit_msg>Add own SV-COMP unreach-call set runner script<commit_after>#!/usr/bin/python3
import sys
import glob
import subprocess
import re
import collections
import os.path
def str2bool(s):
return {
"true": True,
"false": False
}[s]
def extract_bool(p, s):
m = re.search... | |
473ad12b2d77b00073c3712e8d7593d290976248 | technician_tests/test_timeout.py | technician_tests/test_timeout.py | # vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:
from __future__ import (absolute_import, print_function, unicode_literals)
try:
import unittest2 as unittest
except ImportError:
import unittest
import makerbot_driver
class TimeoutTest(unittest.TestCase):
def test_timeout(self):
'''Test that the... | Add technicial test for serial port timeouts. | Add technicial test for serial port timeouts.
| Python | agpl-3.0 | makerbot/s3g,Jnesselr/s3g,makerbot/s3g,makerbot/s3g,Jnesselr/s3g,makerbot/s3g | Add technicial test for serial port timeouts. | # vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:
from __future__ import (absolute_import, print_function, unicode_literals)
try:
import unittest2 as unittest
except ImportError:
import unittest
import makerbot_driver
class TimeoutTest(unittest.TestCase):
def test_timeout(self):
'''Test that the... | <commit_before><commit_msg>Add technicial test for serial port timeouts.<commit_after> | # vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:
from __future__ import (absolute_import, print_function, unicode_literals)
try:
import unittest2 as unittest
except ImportError:
import unittest
import makerbot_driver
class TimeoutTest(unittest.TestCase):
def test_timeout(self):
'''Test that the... | Add technicial test for serial port timeouts.# vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:
from __future__ import (absolute_import, print_function, unicode_literals)
try:
import unittest2 as unittest
except ImportError:
import unittest
import makerbot_driver
class TimeoutTest(unittest.TestCase):
def... | <commit_before><commit_msg>Add technicial test for serial port timeouts.<commit_after># vim:ai:et:ff=unix:fileencoding=utf-8:sw=4:ts=4:
from __future__ import (absolute_import, print_function, unicode_literals)
try:
import unittest2 as unittest
except ImportError:
import unittest
import makerbot_driver
clas... | |
413295160d16c99f72ed37794cc823eccdb5676f | test/test_panels/test_checker.py | test/test_panels/test_checker.py | from pyqode.core import modes
from pyqode.core import panels
from pyqode.core.api import TextHelper
from pyqode.core.qt import QtCore
from pyqode.core.qt.QtTest import QTest
from test.helpers import editor_open
def get_panel(editor):
return editor.panels.get(panels.CheckerPanel)
def get_mode(editor):
try:
... | Add basic tests for checker panel (improve coverage) | Add basic tests for checker panel (improve coverage)
| Python | mit | zwadar/pyqode.core,pyQode/pyqode.core,pyQode/pyqode.core | Add basic tests for checker panel (improve coverage) | from pyqode.core import modes
from pyqode.core import panels
from pyqode.core.api import TextHelper
from pyqode.core.qt import QtCore
from pyqode.core.qt.QtTest import QTest
from test.helpers import editor_open
def get_panel(editor):
return editor.panels.get(panels.CheckerPanel)
def get_mode(editor):
try:
... | <commit_before><commit_msg>Add basic tests for checker panel (improve coverage)<commit_after> | from pyqode.core import modes
from pyqode.core import panels
from pyqode.core.api import TextHelper
from pyqode.core.qt import QtCore
from pyqode.core.qt.QtTest import QTest
from test.helpers import editor_open
def get_panel(editor):
return editor.panels.get(panels.CheckerPanel)
def get_mode(editor):
try:
... | Add basic tests for checker panel (improve coverage)from pyqode.core import modes
from pyqode.core import panels
from pyqode.core.api import TextHelper
from pyqode.core.qt import QtCore
from pyqode.core.qt.QtTest import QTest
from test.helpers import editor_open
def get_panel(editor):
return editor.panels.get(pan... | <commit_before><commit_msg>Add basic tests for checker panel (improve coverage)<commit_after>from pyqode.core import modes
from pyqode.core import panels
from pyqode.core.api import TextHelper
from pyqode.core.qt import QtCore
from pyqode.core.qt.QtTest import QTest
from test.helpers import editor_open
def get_panel(... | |
d0008f639a12c384d6d9faa58e6370d834bef2de | cms/migrations_django/0002_auto_20140807_2306.py | cms/migrations_django/0002_auto_20140807_2306.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='placeholder',
name='slot'... | Add django 1.7 migration for modified slot length | Add django 1.7 migration for modified slot length
| Python | bsd-3-clause | cyberintruder/django-cms,nostalgiaz/django-cms,keimlink/django-cms,jeffreylu9/django-cms,wuzhihui1123/django-cms,frnhr/django-cms,SachaMPS/django-cms,kk9599/django-cms,sznekol/django-cms,vstoykov/django-cms,donce/django-cms,bittner/django-cms,stefanw/django-cms,takeshineshiro/django-cms,Vegasvikk/django-cms,benzkji/dja... | Add django 1.7 migration for modified slot length | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='placeholder',
name='slot'... | <commit_before><commit_msg>Add django 1.7 migration for modified slot length<commit_after> | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
migrations.AlterField(
model_name='placeholder',
name='slot'... | Add django 1.7 migration for modified slot length# -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
migrations.AlterField(
... | <commit_before><commit_msg>Add django 1.7 migration for modified slot length<commit_after># -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import models, migrations
class Migration(migrations.Migration):
dependencies = [
('cms', '0001_initial'),
]
operations = [
... | |
c4cad482f38fb4dca00d00d8374833268dbc4545 | testing/test_change_directory.py | testing/test_change_directory.py | import sys
import os
sys.path.insert(0, os.path.realpath('.'))
import pytest
from create_movie import change_directory
def test_change_directory_existing_directory(tmpdir):
newdir = tmpdir.mkdir('subdir')
with change_directory(str(newdir)):
assert os.getcwd() == os.path.realpath(str(newdir))
asse... | Add tests for change directory | Add tests for change directory
| Python | mit | NGTS/frame-movies,NGTS/frame-movies | Add tests for change directory | import sys
import os
sys.path.insert(0, os.path.realpath('.'))
import pytest
from create_movie import change_directory
def test_change_directory_existing_directory(tmpdir):
newdir = tmpdir.mkdir('subdir')
with change_directory(str(newdir)):
assert os.getcwd() == os.path.realpath(str(newdir))
asse... | <commit_before><commit_msg>Add tests for change directory<commit_after> | import sys
import os
sys.path.insert(0, os.path.realpath('.'))
import pytest
from create_movie import change_directory
def test_change_directory_existing_directory(tmpdir):
newdir = tmpdir.mkdir('subdir')
with change_directory(str(newdir)):
assert os.getcwd() == os.path.realpath(str(newdir))
asse... | Add tests for change directoryimport sys
import os
sys.path.insert(0, os.path.realpath('.'))
import pytest
from create_movie import change_directory
def test_change_directory_existing_directory(tmpdir):
newdir = tmpdir.mkdir('subdir')
with change_directory(str(newdir)):
assert os.getcwd() == os.path.... | <commit_before><commit_msg>Add tests for change directory<commit_after>import sys
import os
sys.path.insert(0, os.path.realpath('.'))
import pytest
from create_movie import change_directory
def test_change_directory_existing_directory(tmpdir):
newdir = tmpdir.mkdir('subdir')
with change_directory(str(newdir)... | |
304c6cf5314ae3050ca5f47d341323c03e75aea6 | actions/cloudbolt_plugins/multi_user_approval/multi_group_approval.py | actions/cloudbolt_plugins/multi_user_approval/multi_group_approval.py | """
Multiple Group Approval
~~~~~~~~~~~~~~~~~~~~~~~
Overrides CloudBolt's standard Order Approval workflow. This Orchestration
Action requires users from two separate Groups approve an Order before it
becomes Active.
Configuration
~~~~~~~~~~~~~
If the user that submitted this Order belongs to Group_A, this plugin req... | Add Multiple Group Approval Orch Action | Add Multiple Group Approval Orch Action
[DEV-12140]
| Python | apache-2.0 | CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge,CloudBoltSoftware/cloudbolt-forge | Add Multiple Group Approval Orch Action
[DEV-12140] | """
Multiple Group Approval
~~~~~~~~~~~~~~~~~~~~~~~
Overrides CloudBolt's standard Order Approval workflow. This Orchestration
Action requires users from two separate Groups approve an Order before it
becomes Active.
Configuration
~~~~~~~~~~~~~
If the user that submitted this Order belongs to Group_A, this plugin req... | <commit_before><commit_msg>Add Multiple Group Approval Orch Action
[DEV-12140]<commit_after> | """
Multiple Group Approval
~~~~~~~~~~~~~~~~~~~~~~~
Overrides CloudBolt's standard Order Approval workflow. This Orchestration
Action requires users from two separate Groups approve an Order before it
becomes Active.
Configuration
~~~~~~~~~~~~~
If the user that submitted this Order belongs to Group_A, this plugin req... | Add Multiple Group Approval Orch Action
[DEV-12140]"""
Multiple Group Approval
~~~~~~~~~~~~~~~~~~~~~~~
Overrides CloudBolt's standard Order Approval workflow. This Orchestration
Action requires users from two separate Groups approve an Order before it
becomes Active.
Configuration
~~~~~~~~~~~~~
If the user that subm... | <commit_before><commit_msg>Add Multiple Group Approval Orch Action
[DEV-12140]<commit_after>"""
Multiple Group Approval
~~~~~~~~~~~~~~~~~~~~~~~
Overrides CloudBolt's standard Order Approval workflow. This Orchestration
Action requires users from two separate Groups approve an Order before it
becomes Active.
Configur... | |
09f077b5bc78d5fe382fdb1b3317ee68b0f619b5 | streamz/dataframe/tests/test_dataframe_utils.py | streamz/dataframe/tests/test_dataframe_utils.py | import pytest
from streamz.dataframe.utils import is_dataframe_like, is_series_like, is_index_like, get_base_frame_type
import pandas as pd
import numpy as np
def test_utils_is_dataframe_like():
test_utils_dataframe = pytest.importorskip('dask.dataframe.tests.test_utils_dataframe')
test_utils_dataframe.test_... | Add tests for dataframe utils | Add tests for dataframe utils
| Python | bsd-3-clause | mrocklin/streams | Add tests for dataframe utils | import pytest
from streamz.dataframe.utils import is_dataframe_like, is_series_like, is_index_like, get_base_frame_type
import pandas as pd
import numpy as np
def test_utils_is_dataframe_like():
test_utils_dataframe = pytest.importorskip('dask.dataframe.tests.test_utils_dataframe')
test_utils_dataframe.test_... | <commit_before><commit_msg>Add tests for dataframe utils<commit_after> | import pytest
from streamz.dataframe.utils import is_dataframe_like, is_series_like, is_index_like, get_base_frame_type
import pandas as pd
import numpy as np
def test_utils_is_dataframe_like():
test_utils_dataframe = pytest.importorskip('dask.dataframe.tests.test_utils_dataframe')
test_utils_dataframe.test_... | Add tests for dataframe utilsimport pytest
from streamz.dataframe.utils import is_dataframe_like, is_series_like, is_index_like, get_base_frame_type
import pandas as pd
import numpy as np
def test_utils_is_dataframe_like():
test_utils_dataframe = pytest.importorskip('dask.dataframe.tests.test_utils_dataframe')
... | <commit_before><commit_msg>Add tests for dataframe utils<commit_after>import pytest
from streamz.dataframe.utils import is_dataframe_like, is_series_like, is_index_like, get_base_frame_type
import pandas as pd
import numpy as np
def test_utils_is_dataframe_like():
test_utils_dataframe = pytest.importorskip('dask... | |
b212d7391c07457ed23a499d6fd113e08f173999 | Algebra_Geometry/2d_homework.py | Algebra_Geometry/2d_homework.py | #!/usr/bin/python
import os
import numpy as np
import math
print "This script solves the excercises propossed in the Linear Algebra & 2D Geometry Lectures"
# --------------------------------------------------------------------------------------------------
# Length and Normalized Vector
v = np.array([4, 8, -4])
len_... | Add resolution for the 2dGeometry Homework | Add resolution for the 2dGeometry Homework
| Python | mit | nachovizzo/AUTONAVx,nachovizzo/AUTONAVx,nachovizzo/AUTONAVx | Add resolution for the 2dGeometry Homework | #!/usr/bin/python
import os
import numpy as np
import math
print "This script solves the excercises propossed in the Linear Algebra & 2D Geometry Lectures"
# --------------------------------------------------------------------------------------------------
# Length and Normalized Vector
v = np.array([4, 8, -4])
len_... | <commit_before><commit_msg>Add resolution for the 2dGeometry Homework<commit_after> | #!/usr/bin/python
import os
import numpy as np
import math
print "This script solves the excercises propossed in the Linear Algebra & 2D Geometry Lectures"
# --------------------------------------------------------------------------------------------------
# Length and Normalized Vector
v = np.array([4, 8, -4])
len_... | Add resolution for the 2dGeometry Homework#!/usr/bin/python
import os
import numpy as np
import math
print "This script solves the excercises propossed in the Linear Algebra & 2D Geometry Lectures"
# --------------------------------------------------------------------------------------------------
# Length and Norma... | <commit_before><commit_msg>Add resolution for the 2dGeometry Homework<commit_after>#!/usr/bin/python
import os
import numpy as np
import math
print "This script solves the excercises propossed in the Linear Algebra & 2D Geometry Lectures"
# ----------------------------------------------------------------------------... | |
8a797d3abd43a96df1d4dab8ae52cc21da3930a4 | compatibility_server/loadtest/locustfile.py | compatibility_server/loadtest/locustfile.py | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Create a simple load test skeleton | Create a simple load test skeleton
| Python | apache-2.0 | GoogleCloudPlatform/cloud-opensource-python,GoogleCloudPlatform/cloud-opensource-python,GoogleCloudPlatform/cloud-opensource-python,GoogleCloudPlatform/cloud-opensource-python | Create a simple load test skeleton | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | <commit_before><commit_msg>Create a simple load test skeleton<commit_after> | # Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, s... | Create a simple load test skeleton# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before><commit_msg>Create a simple load test skeleton<commit_after># Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/L... | |
55a0797aa70ef91ce1ad9d29f313fa58a1db761d | read_forms.py | read_forms.py | import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-ip','--inputpoints',required=True)
parser.add_argument('-ie','--inputeqns',required=True)
parser.add_argument('-v','--version',requi... | Create file to read in parameter vectors from user forms | Create file to read in parameter vectors from user forms
| Python | mit | ndebuhr/thermo-state-solver,ndebuhr/thermo-state-solver | Create file to read in parameter vectors from user forms | import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-ip','--inputpoints',required=True)
parser.add_argument('-ie','--inputeqns',required=True)
parser.add_argument('-v','--version',requi... | <commit_before><commit_msg>Create file to read in parameter vectors from user forms<commit_after> | import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-ip','--inputpoints',required=True)
parser.add_argument('-ie','--inputeqns',required=True)
parser.add_argument('-v','--version',requi... | Create file to read in parameter vectors from user formsimport csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-ip','--inputpoints',required=True)
parser.add_argument('-ie','--inputeqns',r... | <commit_before><commit_msg>Create file to read in parameter vectors from user forms<commit_after>import csv
import argparse
import itertools
from thermo_utils import csv_row_writer, read_csv_rows
# Read input/output arguments
parser = argparse.ArgumentParser()
parser.add_argument('-ip','--inputpoints',required=True)
... | |
1a5806d2a69553d9116836cbc8819ac60756e462 | test_files_by_user.py | test_files_by_user.py | import random
from dmp import dmp
users = ["adam", "ben", "chris", "denis", "eric"]
da = dmp()
for u in users:
results = da.get_files_by_user(u)
print u, len(results)
| Test script for requesting by user | Test script for requesting by user
| Python | apache-2.0 | Multiscale-Genomics/mg-dm-api,Multiscale-Genomics/mg-dm-api | Test script for requesting by user | import random
from dmp import dmp
users = ["adam", "ben", "chris", "denis", "eric"]
da = dmp()
for u in users:
results = da.get_files_by_user(u)
print u, len(results)
| <commit_before><commit_msg>Test script for requesting by user<commit_after> | import random
from dmp import dmp
users = ["adam", "ben", "chris", "denis", "eric"]
da = dmp()
for u in users:
results = da.get_files_by_user(u)
print u, len(results)
| Test script for requesting by userimport random
from dmp import dmp
users = ["adam", "ben", "chris", "denis", "eric"]
da = dmp()
for u in users:
results = da.get_files_by_user(u)
print u, len(results)
| <commit_before><commit_msg>Test script for requesting by user<commit_after>import random
from dmp import dmp
users = ["adam", "ben", "chris", "denis", "eric"]
da = dmp()
for u in users:
results = da.get_files_by_user(u)
print u, len(results)
| |
99b7ff50e77483f7a2ec0d3ca99b9cc74d426edf | tests/handler_test.py | tests/handler_test.py | import requests
from fixtures import test_server
def test(test_server):
response = requests.get(test_server('/'))
assert response.status_code == 200
json = response.json()
assert 'status' in json
assert json['status'] == 'ok'
| Add test for the Handler | Add test for the Handler
| Python | mit | piotrekw/tornado-pytest | Add test for the Handler | import requests
from fixtures import test_server
def test(test_server):
response = requests.get(test_server('/'))
assert response.status_code == 200
json = response.json()
assert 'status' in json
assert json['status'] == 'ok'
| <commit_before><commit_msg>Add test for the Handler<commit_after> | import requests
from fixtures import test_server
def test(test_server):
response = requests.get(test_server('/'))
assert response.status_code == 200
json = response.json()
assert 'status' in json
assert json['status'] == 'ok'
| Add test for the Handlerimport requests
from fixtures import test_server
def test(test_server):
response = requests.get(test_server('/'))
assert response.status_code == 200
json = response.json()
assert 'status' in json
assert json['status'] == 'ok'
| <commit_before><commit_msg>Add test for the Handler<commit_after>import requests
from fixtures import test_server
def test(test_server):
response = requests.get(test_server('/'))
assert response.status_code == 200
json = response.json()
assert 'status' in json
assert json['status'] == 'ok'
| |
4473354da6d029964258996067adbd97eb06baa8 | py/degree-of-an-array.py | py/degree-of-an-array.py | from collections import Counter
class Solution(object):
def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
first = dict()
last = dict()
c = Counter()
m = 0
possible_values = []
for i, v in enumerate(nums):
... | Add py solution for 697. Degree of an Array | Add py solution for 697. Degree of an Array
697. Degree of an Array: https://leetcode.com/problems/degree-of-an-array/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 697. Degree of an Array
697. Degree of an Array: https://leetcode.com/problems/degree-of-an-array/ | from collections import Counter
class Solution(object):
def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
first = dict()
last = dict()
c = Counter()
m = 0
possible_values = []
for i, v in enumerate(nums):
... | <commit_before><commit_msg>Add py solution for 697. Degree of an Array
697. Degree of an Array: https://leetcode.com/problems/degree-of-an-array/<commit_after> | from collections import Counter
class Solution(object):
def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
first = dict()
last = dict()
c = Counter()
m = 0
possible_values = []
for i, v in enumerate(nums):
... | Add py solution for 697. Degree of an Array
697. Degree of an Array: https://leetcode.com/problems/degree-of-an-array/from collections import Counter
class Solution(object):
def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
"""
first = dict()
... | <commit_before><commit_msg>Add py solution for 697. Degree of an Array
697. Degree of an Array: https://leetcode.com/problems/degree-of-an-array/<commit_after>from collections import Counter
class Solution(object):
def findShortestSubArray(self, nums):
"""
:type nums: List[int]
:rtype: int
... | |
35aafe82f73c32e2d3db76d2fb3b988a3c4ade01 | tests/test_project.py | tests/test_project.py | # Copyright 2015 0xc0170
#
# 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, soft... | Test project - basic template for project to be tested | Test project - basic template for project to be tested
| Python | apache-2.0 | sarahmarshy/project_generator,molejar/project_generator,hwfwgrp/project_generator,0xc0170/project_generator,project-generator/project_generator,ohagendorf/project_generator | Test project - basic template for project to be tested | # Copyright 2015 0xc0170
#
# 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, soft... | <commit_before><commit_msg>Test project - basic template for project to be tested<commit_after> | # Copyright 2015 0xc0170
#
# 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, soft... | Test project - basic template for project to be tested# Copyright 2015 0xc0170
#
# 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 re... | <commit_before><commit_msg>Test project - basic template for project to be tested<commit_after># Copyright 2015 0xc0170
#
# 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.apac... | |
49539431d0e4172c5ce83c20f436b58e41d0fa02 | heavy-ion-luminosity.py | heavy-ion-luminosity.py | __author__ = 'jacob'
import ROOT
import numpy as np
import os
from root_numpy import root2array, root2rec, tree2rec
# Look at r284484 data
filename = os.path.join("data", "r284484.root")
# Convert a TTree in a ROOT file into a NumPy structured array
arr = root2array(filename)
for element in arr:
print(element)
... | Add getting data from .root file into Numpy | Add getting data from .root file into Numpy
| Python | mit | jacobbieker/ATLAS-Luminosity | Add getting data from .root file into Numpy | __author__ = 'jacob'
import ROOT
import numpy as np
import os
from root_numpy import root2array, root2rec, tree2rec
# Look at r284484 data
filename = os.path.join("data", "r284484.root")
# Convert a TTree in a ROOT file into a NumPy structured array
arr = root2array(filename)
for element in arr:
print(element)
... | <commit_before><commit_msg>Add getting data from .root file into Numpy<commit_after> | __author__ = 'jacob'
import ROOT
import numpy as np
import os
from root_numpy import root2array, root2rec, tree2rec
# Look at r284484 data
filename = os.path.join("data", "r284484.root")
# Convert a TTree in a ROOT file into a NumPy structured array
arr = root2array(filename)
for element in arr:
print(element)
... | Add getting data from .root file into Numpy__author__ = 'jacob'
import ROOT
import numpy as np
import os
from root_numpy import root2array, root2rec, tree2rec
# Look at r284484 data
filename = os.path.join("data", "r284484.root")
# Convert a TTree in a ROOT file into a NumPy structured array
arr = root2array(filenam... | <commit_before><commit_msg>Add getting data from .root file into Numpy<commit_after>__author__ = 'jacob'
import ROOT
import numpy as np
import os
from root_numpy import root2array, root2rec, tree2rec
# Look at r284484 data
filename = os.path.join("data", "r284484.root")
# Convert a TTree in a ROOT file into a NumPy ... | |
504930ad343c074d34d4e4ac1774d909d11a5a63 | tests/functional/test_admin.py | tests/functional/test_admin.py | from django.contrib.auth.models import User
from django.conf import settings
from website.models import Db
from .testcases import TestCase
def make_default_db():
db = settings.DATABASES['default']
return Db.objects.create(
name_short="default",
name_long="default",
type="MySQL",
... | Add admin test for adding a query | Add admin test for adding a query
| Python | mit | sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz,sqlviz/sqlviz | Add admin test for adding a query | from django.contrib.auth.models import User
from django.conf import settings
from website.models import Db
from .testcases import TestCase
def make_default_db():
db = settings.DATABASES['default']
return Db.objects.create(
name_short="default",
name_long="default",
type="MySQL",
... | <commit_before><commit_msg>Add admin test for adding a query<commit_after> | from django.contrib.auth.models import User
from django.conf import settings
from website.models import Db
from .testcases import TestCase
def make_default_db():
db = settings.DATABASES['default']
return Db.objects.create(
name_short="default",
name_long="default",
type="MySQL",
... | Add admin test for adding a queryfrom django.contrib.auth.models import User
from django.conf import settings
from website.models import Db
from .testcases import TestCase
def make_default_db():
db = settings.DATABASES['default']
return Db.objects.create(
name_short="default",
name_long="def... | <commit_before><commit_msg>Add admin test for adding a query<commit_after>from django.contrib.auth.models import User
from django.conf import settings
from website.models import Db
from .testcases import TestCase
def make_default_db():
db = settings.DATABASES['default']
return Db.objects.create(
nam... | |
d9b3d312543268d4305b102d5f28bd7446e00da8 | tests/test_emit_movie_queue.py | tests/test_emit_movie_queue.py | from __future__ import unicode_literals, division, absolute_import
from datetime import timedelta, datetime
from flexget.manager import Session
from flexget.plugins.filter.movie_queue import queue_add, QueuedMovie
from tests import FlexGetBase
def age_last_emit(**kwargs):
session = Session()
for item in sess... | Add some unit tests for emit_movie_queue | Add some unit tests for emit_movie_queue
| Python | mit | antivirtel/Flexget,crawln45/Flexget,sean797/Flexget,LynxyssCZ/Flexget,tsnoam/Flexget,drwyrm/Flexget,tsnoam/Flexget,sean797/Flexget,offbyone/Flexget,qvazzler/Flexget,crawln45/Flexget,ianstalk/Flexget,Danfocus/Flexget,grrr2/Flexget,jacobmetrick/Flexget,vfrc2/Flexget,JorisDeRieck/Flexget,malkavi/Flexget,qk4l/Flexget,vfrc2... | Add some unit tests for emit_movie_queue | from __future__ import unicode_literals, division, absolute_import
from datetime import timedelta, datetime
from flexget.manager import Session
from flexget.plugins.filter.movie_queue import queue_add, QueuedMovie
from tests import FlexGetBase
def age_last_emit(**kwargs):
session = Session()
for item in sess... | <commit_before><commit_msg>Add some unit tests for emit_movie_queue<commit_after> | from __future__ import unicode_literals, division, absolute_import
from datetime import timedelta, datetime
from flexget.manager import Session
from flexget.plugins.filter.movie_queue import queue_add, QueuedMovie
from tests import FlexGetBase
def age_last_emit(**kwargs):
session = Session()
for item in sess... | Add some unit tests for emit_movie_queuefrom __future__ import unicode_literals, division, absolute_import
from datetime import timedelta, datetime
from flexget.manager import Session
from flexget.plugins.filter.movie_queue import queue_add, QueuedMovie
from tests import FlexGetBase
def age_last_emit(**kwargs):
... | <commit_before><commit_msg>Add some unit tests for emit_movie_queue<commit_after>from __future__ import unicode_literals, division, absolute_import
from datetime import timedelta, datetime
from flexget.manager import Session
from flexget.plugins.filter.movie_queue import queue_add, QueuedMovie
from tests import FlexGe... | |
b064392b2e357bb5725c61f6a07389290954e411 | user_test.py | user_test.py | #!/usr/bin/env python
try:
import sympy
except ImportError:
print("sympy is required")
else:
if sympy.__version__ < '0.7.5':
print("SymPy version 0.7.5 or newer is required. You have", sympy.__version__)
if sympy.__version__ != '0.7.5':
print("The stable SymPy version 0.7.5 is recomme... | Add a user test script | Add a user test script
| Python | bsd-3-clause | asmeurer/scipy-2014-tutorial,Sumith1896/scipy-2014-tutorial,leosartaj/scipy-2016-tutorial,aktech/scipy-2016-tutorial,Shekharrajak/scipy-2014-tutorial | Add a user test script | #!/usr/bin/env python
try:
import sympy
except ImportError:
print("sympy is required")
else:
if sympy.__version__ < '0.7.5':
print("SymPy version 0.7.5 or newer is required. You have", sympy.__version__)
if sympy.__version__ != '0.7.5':
print("The stable SymPy version 0.7.5 is recomme... | <commit_before><commit_msg>Add a user test script<commit_after> | #!/usr/bin/env python
try:
import sympy
except ImportError:
print("sympy is required")
else:
if sympy.__version__ < '0.7.5':
print("SymPy version 0.7.5 or newer is required. You have", sympy.__version__)
if sympy.__version__ != '0.7.5':
print("The stable SymPy version 0.7.5 is recomme... | Add a user test script#!/usr/bin/env python
try:
import sympy
except ImportError:
print("sympy is required")
else:
if sympy.__version__ < '0.7.5':
print("SymPy version 0.7.5 or newer is required. You have", sympy.__version__)
if sympy.__version__ != '0.7.5':
print("The stable SymPy ve... | <commit_before><commit_msg>Add a user test script<commit_after>#!/usr/bin/env python
try:
import sympy
except ImportError:
print("sympy is required")
else:
if sympy.__version__ < '0.7.5':
print("SymPy version 0.7.5 or newer is required. You have", sympy.__version__)
if sympy.__version__ != '0... | |
ab5c755f0e8aec37e284a0a2c4eacbb2892f5b11 | jupyter_notebook_config.partial.py | jupyter_notebook_config.partial.py | # Configuration file for Jupyter-notebook.
# https://github.com/jupyter/docker-demo-images/blob/master/resources/jupyter_notebook_config.partial.py
#c = get_config()
#c.NotebookApp.ip = '*'
#c.NotebookApp.open_browser = False
#c.NotebookApp.port = 8888 #9999
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-... | Add extra notebook config to append to base-notebook config | Add extra notebook config to append to base-notebook config
| Python | bsd-3-clause | ProjectPyRhO/Prometheus,ProjectPyRhO/Prometheus,ProjectPyRhO/Prometheus,ProjectPyRhO/Prometheus | Add extra notebook config to append to base-notebook config | # Configuration file for Jupyter-notebook.
# https://github.com/jupyter/docker-demo-images/blob/master/resources/jupyter_notebook_config.partial.py
#c = get_config()
#c.NotebookApp.ip = '*'
#c.NotebookApp.open_browser = False
#c.NotebookApp.port = 8888 #9999
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-... | <commit_before><commit_msg>Add extra notebook config to append to base-notebook config<commit_after> | # Configuration file for Jupyter-notebook.
# https://github.com/jupyter/docker-demo-images/blob/master/resources/jupyter_notebook_config.partial.py
#c = get_config()
#c.NotebookApp.ip = '*'
#c.NotebookApp.open_browser = False
#c.NotebookApp.port = 8888 #9999
# Whether to trust or not X-Scheme/X-Forwarded-Proto and X-... | Add extra notebook config to append to base-notebook config# Configuration file for Jupyter-notebook.
# https://github.com/jupyter/docker-demo-images/blob/master/resources/jupyter_notebook_config.partial.py
#c = get_config()
#c.NotebookApp.ip = '*'
#c.NotebookApp.open_browser = False
#c.NotebookApp.port = 8888 #9999
... | <commit_before><commit_msg>Add extra notebook config to append to base-notebook config<commit_after># Configuration file for Jupyter-notebook.
# https://github.com/jupyter/docker-demo-images/blob/master/resources/jupyter_notebook_config.partial.py
#c = get_config()
#c.NotebookApp.ip = '*'
#c.NotebookApp.open_browser =... | |
488c0bc477920b7be419f1bfa85be1cbda661db2 | examples/SteinerTripleSystems.py | examples/SteinerTripleSystems.py | # Steiner Triple Systems
# The ternary Steiner problem of order n consists of finding a set of n(n-1)/6
# triples of distinct integer elements in {1,...,n} such that any two triples
# have at most one common element. It is a hypergraph problem coming from
# combinatorial mathematics where n modulo 6 has to be equ... | Add example model of Steiner Triple Systems | Add example model of Steiner Triple Systems
| Python | lgpl-2.1 | eomahony/Numberjack,eomahony/Numberjack,eomahony/Numberjack,eomahony/Numberjack,eomahony/Numberjack | Add example model of Steiner Triple Systems | # Steiner Triple Systems
# The ternary Steiner problem of order n consists of finding a set of n(n-1)/6
# triples of distinct integer elements in {1,...,n} such that any two triples
# have at most one common element. It is a hypergraph problem coming from
# combinatorial mathematics where n modulo 6 has to be equ... | <commit_before><commit_msg>Add example model of Steiner Triple Systems<commit_after> | # Steiner Triple Systems
# The ternary Steiner problem of order n consists of finding a set of n(n-1)/6
# triples of distinct integer elements in {1,...,n} such that any two triples
# have at most one common element. It is a hypergraph problem coming from
# combinatorial mathematics where n modulo 6 has to be equ... | Add example model of Steiner Triple Systems# Steiner Triple Systems
# The ternary Steiner problem of order n consists of finding a set of n(n-1)/6
# triples of distinct integer elements in {1,...,n} such that any two triples
# have at most one common element. It is a hypergraph problem coming from
# combinatorial... | <commit_before><commit_msg>Add example model of Steiner Triple Systems<commit_after># Steiner Triple Systems
# The ternary Steiner problem of order n consists of finding a set of n(n-1)/6
# triples of distinct integer elements in {1,...,n} such that any two triples
# have at most one common element. It is a hyperg... | |
00f0ec1740109cc12815b9aaed88023cc91881fe | velruse/store/mongodb_store.py | velruse/store/mongodb_store.py | """MongoDB UserStore implementation"""
try:
import cPickle as pickle
except ImportError:
import pickle
import pymongo
from pymongo import Connection
from pymongo.errors import ConnectionFailure
from pymongo.binary import Binary
from pymongo.errors import OperationFailure
from velruse.store.interface import U... | Add in support for mongodb store. Add dependencies for pymongo/redis. | Add in support for mongodb store. Add dependencies for pymongo/redis.
| Python | mit | miedzinski/velruse,bbangert/velruse,bbangert/velruse,ImaginationForPeople/velruse,miedzinski/velruse,ImaginationForPeople/velruse | Add in support for mongodb store. Add dependencies for pymongo/redis. | """MongoDB UserStore implementation"""
try:
import cPickle as pickle
except ImportError:
import pickle
import pymongo
from pymongo import Connection
from pymongo.errors import ConnectionFailure
from pymongo.binary import Binary
from pymongo.errors import OperationFailure
from velruse.store.interface import U... | <commit_before><commit_msg>Add in support for mongodb store. Add dependencies for pymongo/redis.<commit_after> | """MongoDB UserStore implementation"""
try:
import cPickle as pickle
except ImportError:
import pickle
import pymongo
from pymongo import Connection
from pymongo.errors import ConnectionFailure
from pymongo.binary import Binary
from pymongo.errors import OperationFailure
from velruse.store.interface import U... | Add in support for mongodb store. Add dependencies for pymongo/redis."""MongoDB UserStore implementation"""
try:
import cPickle as pickle
except ImportError:
import pickle
import pymongo
from pymongo import Connection
from pymongo.errors import ConnectionFailure
from pymongo.binary import Binary
from pymongo.... | <commit_before><commit_msg>Add in support for mongodb store. Add dependencies for pymongo/redis.<commit_after>"""MongoDB UserStore implementation"""
try:
import cPickle as pickle
except ImportError:
import pickle
import pymongo
from pymongo import Connection
from pymongo.errors import ConnectionFailure
from p... | |
70e4843ccb2dde8a1fa2b50dcfb10ae10c3c3d9a | utils/Layers.py | utils/Layers.py | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add 1D Transpose Convolution Implementation Official implementation of transpose 1d convolution is only available in nightly build at the moment | Add 1D Transpose Convolution Implementation
Official implementation of transpose 1d convolution is only
available in nightly build at the moment
| Python | apache-2.0 | googleinterns/audio_synthesis | Add 1D Transpose Convolution Implementation
Official implementation of transpose 1d convolution is only
available in nightly build at the moment | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | <commit_before><commit_msg>Add 1D Transpose Convolution Implementation
Official implementation of transpose 1d convolution is only
available in nightly build at the moment<commit_after> | # Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# https://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, ... | Add 1D Transpose Convolution Implementation
Official implementation of transpose 1d convolution is only
available in nightly build at the moment# Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may ob... | <commit_before><commit_msg>Add 1D Transpose Convolution Implementation
Official implementation of transpose 1d convolution is only
available in nightly build at the moment<commit_after># Copyright 2020 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in ... | |
ae2e437b5bdf5202d0fc38d8f0d2dbe41bd68b11 | sleep_wake_heatmap.py | sleep_wake_heatmap.py | import plotly as py
import plotly.graph_objs as go
import datetime
from sys import argv
import names
from csvparser import parse
data_file = argv[1]
raw_data = parse(data_file)
h = 12
w = len(raw_data)
start_time = 3
grid = [[0] * w for i in range(0, h)]
#def datetime_to_coords(dt):
# x = 0 # temp
# y = round((dt.h... | Add heatmap with working ish pseudocode | Add heatmap with working ish pseudocode
| Python | mit | f-jiang/sleep-pattern-grapher | Add heatmap with working ish pseudocode | import plotly as py
import plotly.graph_objs as go
import datetime
from sys import argv
import names
from csvparser import parse
data_file = argv[1]
raw_data = parse(data_file)
h = 12
w = len(raw_data)
start_time = 3
grid = [[0] * w for i in range(0, h)]
#def datetime_to_coords(dt):
# x = 0 # temp
# y = round((dt.h... | <commit_before><commit_msg>Add heatmap with working ish pseudocode<commit_after> | import plotly as py
import plotly.graph_objs as go
import datetime
from sys import argv
import names
from csvparser import parse
data_file = argv[1]
raw_data = parse(data_file)
h = 12
w = len(raw_data)
start_time = 3
grid = [[0] * w for i in range(0, h)]
#def datetime_to_coords(dt):
# x = 0 # temp
# y = round((dt.h... | Add heatmap with working ish pseudocodeimport plotly as py
import plotly.graph_objs as go
import datetime
from sys import argv
import names
from csvparser import parse
data_file = argv[1]
raw_data = parse(data_file)
h = 12
w = len(raw_data)
start_time = 3
grid = [[0] * w for i in range(0, h)]
#def datetime_to_coord... | <commit_before><commit_msg>Add heatmap with working ish pseudocode<commit_after>import plotly as py
import plotly.graph_objs as go
import datetime
from sys import argv
import names
from csvparser import parse
data_file = argv[1]
raw_data = parse(data_file)
h = 12
w = len(raw_data)
start_time = 3
grid = [[0] * w for ... | |
da372725ea236b971829e4a07e4c18d7d094152c | api_tests/logs/views/test_log_embeds.py | api_tests/logs/views/test_log_embeds.py | from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
AuthUserFactory,
RegistrationFactory
)
class TestLogEmbeds(ApiTestCase):
def setUp(self):
super(TestLogEmbeds, self).setU... | Add tests for testing log embeds. | Add tests for testing log embeds.
| Python | apache-2.0 | alexschiller/osf.io,samchrisinger/osf.io,mattclark/osf.io,felliott/osf.io,saradbowman/osf.io,kwierman/osf.io,emetsger/osf.io,cslzchen/osf.io,leb2dg/osf.io,caneruguz/osf.io,caneruguz/osf.io,rdhyee/osf.io,zachjanicki/osf.io,saradbowman/osf.io,adlius/osf.io,doublebits/osf.io,SSJohns/osf.io,cwisecarver/osf.io,DanielSBrown/... | Add tests for testing log embeds. | from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
AuthUserFactory,
RegistrationFactory
)
class TestLogEmbeds(ApiTestCase):
def setUp(self):
super(TestLogEmbeds, self).setU... | <commit_before><commit_msg>Add tests for testing log embeds.<commit_after> | from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
AuthUserFactory,
RegistrationFactory
)
class TestLogEmbeds(ApiTestCase):
def setUp(self):
super(TestLogEmbeds, self).setU... | Add tests for testing log embeds.from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
AuthUserFactory,
RegistrationFactory
)
class TestLogEmbeds(ApiTestCase):
def setUp(self):
... | <commit_before><commit_msg>Add tests for testing log embeds.<commit_after>from nose.tools import * # flake8: noqa
from api.base.settings.defaults import API_BASE
from tests.base import ApiTestCase
from tests.factories import (
ProjectFactory,
AuthUserFactory,
RegistrationFactory
)
class TestLogEmbeds(Ap... | |
3ec610d7f24aec622e13284088622c7f98b454b1 | euler025.py | euler025.py | #!/usr/bin/python
from math import ceil, log10
PHI = 1.6180339887
x = 0
i = 0
while x < 1000:
i += 1
x = ceil(i * log10(PHI) - log10(5) / 2)
print(i, x)
print(i)
| Add solution for problem 25 | Add solution for problem 25
| Python | mit | cifvts/PyEuler | Add solution for problem 25 | #!/usr/bin/python
from math import ceil, log10
PHI = 1.6180339887
x = 0
i = 0
while x < 1000:
i += 1
x = ceil(i * log10(PHI) - log10(5) / 2)
print(i, x)
print(i)
| <commit_before><commit_msg>Add solution for problem 25<commit_after> | #!/usr/bin/python
from math import ceil, log10
PHI = 1.6180339887
x = 0
i = 0
while x < 1000:
i += 1
x = ceil(i * log10(PHI) - log10(5) / 2)
print(i, x)
print(i)
| Add solution for problem 25#!/usr/bin/python
from math import ceil, log10
PHI = 1.6180339887
x = 0
i = 0
while x < 1000:
i += 1
x = ceil(i * log10(PHI) - log10(5) / 2)
print(i, x)
print(i)
| <commit_before><commit_msg>Add solution for problem 25<commit_after>#!/usr/bin/python
from math import ceil, log10
PHI = 1.6180339887
x = 0
i = 0
while x < 1000:
i += 1
x = ceil(i * log10(PHI) - log10(5) / 2)
print(i, x)
print(i)
| |
7ee1168509ecdef6ba6cc81faeb3b6c9674ddc67 | tests/test_S3.py | tests/test_S3.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from keyring.tests.test_backend import BackendBasicTests
from keyring.tests.py30compat import unittest
from s3keyring import S3
@unittest.skipUnless(S3.supported(),
"You need to configure the AWS credentials")
class S3PlaintextKeychainTestCase(Backen... | Add tests for the backend | Add tests for the backend
| Python | mit | InnovativeTravel/s3-keyring | Add tests for the backend | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from keyring.tests.test_backend import BackendBasicTests
from keyring.tests.py30compat import unittest
from s3keyring import S3
@unittest.skipUnless(S3.supported(),
"You need to configure the AWS credentials")
class S3PlaintextKeychainTestCase(Backen... | <commit_before><commit_msg>Add tests for the backend<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from keyring.tests.test_backend import BackendBasicTests
from keyring.tests.py30compat import unittest
from s3keyring import S3
@unittest.skipUnless(S3.supported(),
"You need to configure the AWS credentials")
class S3PlaintextKeychainTestCase(Backen... | Add tests for the backend#!/usr/bin/env python
# -*- coding: utf-8 -*-
from keyring.tests.test_backend import BackendBasicTests
from keyring.tests.py30compat import unittest
from s3keyring import S3
@unittest.skipUnless(S3.supported(),
"You need to configure the AWS credentials")
class S3Plainte... | <commit_before><commit_msg>Add tests for the backend<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from keyring.tests.test_backend import BackendBasicTests
from keyring.tests.py30compat import unittest
from s3keyring import S3
@unittest.skipUnless(S3.supported(),
"You need to config... | |
7027680e509055503c86544193d9ff46530be3d3 | indra/databases/relevance_client.py | indra/databases/relevance_client.py | import logging
from indra.databases import ndex_client
logging = logging.getLogger('relevance')
ndex_relevance = 'http://general.bigmech.ndexbio.org:8080'
def get_heat_kernel(network_id):
"""Return the identifier of a heat kernel calculated for a given network.
Parameters
----------
network_id : str... | Add relevance client based on NDEx service | Add relevance client based on NDEx service
| Python | bsd-2-clause | jmuhlich/indra,pvtodorov/indra,bgyori/indra,pvtodorov/indra,bgyori/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/belpy,johnbachman/indra,jmuhlich/indra,sorgerlab/belpy,pvtodorov/indra,jmuhlich/indra,johnbachman/indra,sorgerlab/belpy,sorgerlab/indra,johnbachman/indra,sorgerlab/indra,johnbachman/belpy,pvtodorov/indra... | Add relevance client based on NDEx service | import logging
from indra.databases import ndex_client
logging = logging.getLogger('relevance')
ndex_relevance = 'http://general.bigmech.ndexbio.org:8080'
def get_heat_kernel(network_id):
"""Return the identifier of a heat kernel calculated for a given network.
Parameters
----------
network_id : str... | <commit_before><commit_msg>Add relevance client based on NDEx service<commit_after> | import logging
from indra.databases import ndex_client
logging = logging.getLogger('relevance')
ndex_relevance = 'http://general.bigmech.ndexbio.org:8080'
def get_heat_kernel(network_id):
"""Return the identifier of a heat kernel calculated for a given network.
Parameters
----------
network_id : str... | Add relevance client based on NDEx serviceimport logging
from indra.databases import ndex_client
logging = logging.getLogger('relevance')
ndex_relevance = 'http://general.bigmech.ndexbio.org:8080'
def get_heat_kernel(network_id):
"""Return the identifier of a heat kernel calculated for a given network.
Para... | <commit_before><commit_msg>Add relevance client based on NDEx service<commit_after>import logging
from indra.databases import ndex_client
logging = logging.getLogger('relevance')
ndex_relevance = 'http://general.bigmech.ndexbio.org:8080'
def get_heat_kernel(network_id):
"""Return the identifier of a heat kernel ... | |
a0fc417f9d5abbf19ff516590b6c5cdff849cb1e | get_pose.py | get_pose.py | import csv
def get_backup_pose(filename):
p = []
r = csv.DictReader(open(filename,'r'),delimiter = ';')
for row in r:
p.append(row)
a = {}
a['CSVPath'] = p[0]["CSVPath"]
a['cursor'] = int(p[0]["cursor"])
return a
def set_backup_pose(filename,dict):
f = open(filename,'w... | Test file for backup pose | Test file for backup pose
| Python | mit | ThotAlion/FIRE,ThotAlion/FIRE,ThotAlion/FIRE | Test file for backup pose | import csv
def get_backup_pose(filename):
p = []
r = csv.DictReader(open(filename,'r'),delimiter = ';')
for row in r:
p.append(row)
a = {}
a['CSVPath'] = p[0]["CSVPath"]
a['cursor'] = int(p[0]["cursor"])
return a
def set_backup_pose(filename,dict):
f = open(filename,'w... | <commit_before><commit_msg>Test file for backup pose<commit_after> | import csv
def get_backup_pose(filename):
p = []
r = csv.DictReader(open(filename,'r'),delimiter = ';')
for row in r:
p.append(row)
a = {}
a['CSVPath'] = p[0]["CSVPath"]
a['cursor'] = int(p[0]["cursor"])
return a
def set_backup_pose(filename,dict):
f = open(filename,'w... | Test file for backup poseimport csv
def get_backup_pose(filename):
p = []
r = csv.DictReader(open(filename,'r'),delimiter = ';')
for row in r:
p.append(row)
a = {}
a['CSVPath'] = p[0]["CSVPath"]
a['cursor'] = int(p[0]["cursor"])
return a
def set_backup_pose(filename,dict):... | <commit_before><commit_msg>Test file for backup pose<commit_after>import csv
def get_backup_pose(filename):
p = []
r = csv.DictReader(open(filename,'r'),delimiter = ';')
for row in r:
p.append(row)
a = {}
a['CSVPath'] = p[0]["CSVPath"]
a['cursor'] = int(p[0]["cursor"])
return a... | |
e7e4aaa2788edcb01f3e681bc557d4c7f5ae26e1 | calm-ingest/validate_data.py | calm-ingest/validate_data.py | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Checks for the validity of Calm data.
This script runs a series of checks over the Calm data, looking for problems
that should be corrected in the source data.
"""
import json
from utils import read_records
WARNINGS = {}
def check_record(records):
try:
... | Add a rough script for checking validity of Calm data | Add a rough script for checking validity of Calm data
| Python | mit | wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api,wellcometrust/platform-api | Add a rough script for checking validity of Calm data | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Checks for the validity of Calm data.
This script runs a series of checks over the Calm data, looking for problems
that should be corrected in the source data.
"""
import json
from utils import read_records
WARNINGS = {}
def check_record(records):
try:
... | <commit_before><commit_msg>Add a rough script for checking validity of Calm data<commit_after> | #!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Checks for the validity of Calm data.
This script runs a series of checks over the Calm data, looking for problems
that should be corrected in the source data.
"""
import json
from utils import read_records
WARNINGS = {}
def check_record(records):
try:
... | Add a rough script for checking validity of Calm data#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Checks for the validity of Calm data.
This script runs a series of checks over the Calm data, looking for problems
that should be corrected in the source data.
"""
import json
from utils import read_records
WAR... | <commit_before><commit_msg>Add a rough script for checking validity of Calm data<commit_after>#!/usr/bin/env python
# -*- encoding: utf-8 -*-
"""Checks for the validity of Calm data.
This script runs a series of checks over the Calm data, looking for problems
that should be corrected in the source data.
"""
import j... | |
4886f21febbc6385e6aafb990163e69e31a5b99e | scripts/generate-guidebook-sponsor-logs.py | scripts/generate-guidebook-sponsor-logs.py | #!/usr/bin/env python3
import shlex
import subprocess
import sys
import zipfile
from os import makedirs
import frontmatter
import pandas as pd
# read in the custom list template
df_sponsors = pd.read_csv('Guidebook_CL_Template.csv')
rows = []
# create the directory that will store the resized sponsor logs
outdir ... | Add script to generate sponsor info for guidebook. | Add script to generate sponsor info for guidebook.
| Python | mit | acl2017/acl2017.github.io,acl2017/acl2017.github.io,acl2017/acl2017.github.io,acl2017/acl2017.github.io | Add script to generate sponsor info for guidebook. | #!/usr/bin/env python3
import shlex
import subprocess
import sys
import zipfile
from os import makedirs
import frontmatter
import pandas as pd
# read in the custom list template
df_sponsors = pd.read_csv('Guidebook_CL_Template.csv')
rows = []
# create the directory that will store the resized sponsor logs
outdir ... | <commit_before><commit_msg>Add script to generate sponsor info for guidebook.<commit_after> | #!/usr/bin/env python3
import shlex
import subprocess
import sys
import zipfile
from os import makedirs
import frontmatter
import pandas as pd
# read in the custom list template
df_sponsors = pd.read_csv('Guidebook_CL_Template.csv')
rows = []
# create the directory that will store the resized sponsor logs
outdir ... | Add script to generate sponsor info for guidebook.#!/usr/bin/env python3
import shlex
import subprocess
import sys
import zipfile
from os import makedirs
import frontmatter
import pandas as pd
# read in the custom list template
df_sponsors = pd.read_csv('Guidebook_CL_Template.csv')
rows = []
# create the director... | <commit_before><commit_msg>Add script to generate sponsor info for guidebook.<commit_after>#!/usr/bin/env python3
import shlex
import subprocess
import sys
import zipfile
from os import makedirs
import frontmatter
import pandas as pd
# read in the custom list template
df_sponsors = pd.read_csv('Guidebook_CL_Templa... | |
167e7095c0a19d8139564280b3dc3e74791bf878 | cabarchive/cli.py | cabarchive/cli.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
#
# pylint: disable=wrong-import-position
import sys
import os
import argparse
sys.path.append(os.path.realpath("."))
from cabarchive import CabArchive
def main():
p... | Add a CLI test program | trivial: Add a CLI test program
| Python | lgpl-2.1 | hughsie/python-cabarchive | trivial: Add a CLI test program | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
#
# pylint: disable=wrong-import-position
import sys
import os
import argparse
sys.path.append(os.path.realpath("."))
from cabarchive import CabArchive
def main():
p... | <commit_before><commit_msg>trivial: Add a CLI test program<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
#
# pylint: disable=wrong-import-position
import sys
import os
import argparse
sys.path.append(os.path.realpath("."))
from cabarchive import CabArchive
def main():
p... | trivial: Add a CLI test program#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
#
# pylint: disable=wrong-import-position
import sys
import os
import argparse
sys.path.append(os.path.realpath("."))
from cabarchive import ... | <commit_before><commit_msg>trivial: Add a CLI test program<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Copyright (C) 2020 Richard Hughes <richard@hughsie.com>
#
# SPDX-License-Identifier: LGPL-2.1+
#
# pylint: disable=wrong-import-position
import sys
import os
import argparse
sys.path.append(os.pat... | |
5d0c7b7d209b0487c0a12e995a11efa9d695a50e | pq/management/commands/pqcreate.py | pq/management/commands/pqcreate.py | from django.core.management.base import BaseCommand
from optparse import make_option
from django.conf import settings
from pq.queue import PQ_DEFAULT_JOB_TIMEOUT
class Command(BaseCommand):
help = "Create a queue"
args = "<queue queue ...>"
option_list = BaseCommand.option_list + (
make_option... | Add a command to pre-create queues. | Add a command to pre-create queues.
| Python | bsd-2-clause | bretth/django-pq | Add a command to pre-create queues. | from django.core.management.base import BaseCommand
from optparse import make_option
from django.conf import settings
from pq.queue import PQ_DEFAULT_JOB_TIMEOUT
class Command(BaseCommand):
help = "Create a queue"
args = "<queue queue ...>"
option_list = BaseCommand.option_list + (
make_option... | <commit_before><commit_msg>Add a command to pre-create queues.<commit_after> | from django.core.management.base import BaseCommand
from optparse import make_option
from django.conf import settings
from pq.queue import PQ_DEFAULT_JOB_TIMEOUT
class Command(BaseCommand):
help = "Create a queue"
args = "<queue queue ...>"
option_list = BaseCommand.option_list + (
make_option... | Add a command to pre-create queues.from django.core.management.base import BaseCommand
from optparse import make_option
from django.conf import settings
from pq.queue import PQ_DEFAULT_JOB_TIMEOUT
class Command(BaseCommand):
help = "Create a queue"
args = "<queue queue ...>"
option_list = BaseCommand.... | <commit_before><commit_msg>Add a command to pre-create queues.<commit_after>from django.core.management.base import BaseCommand
from optparse import make_option
from django.conf import settings
from pq.queue import PQ_DEFAULT_JOB_TIMEOUT
class Command(BaseCommand):
help = "Create a queue"
args = "<queue que... | |
8a0ee09eec5f24152babfff3882a38ca749b3cc9 | solutions/uri/1029/1029.py | solutions/uri/1029/1029.py | from functools import lru_cache
fibs = [0] * 40
calls = [0] * 40
def fibonacci(n):
global fibs, calls
if n <= 1:
fibs[n] = n
calls[n] = 0
else:
if fibs[n] != 0:
return fibs[n]
fibs[n] = fibonacci(n - 1) + fibonacci(n - 2)
calls[n] = calls[n - 1] + call... | Solve Fibonacci, How Many Calls? in python | Solve Fibonacci, How Many Calls? in python
| Python | mit | deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playground,deniscostadsc/playgr... | Solve Fibonacci, How Many Calls? in python | from functools import lru_cache
fibs = [0] * 40
calls = [0] * 40
def fibonacci(n):
global fibs, calls
if n <= 1:
fibs[n] = n
calls[n] = 0
else:
if fibs[n] != 0:
return fibs[n]
fibs[n] = fibonacci(n - 1) + fibonacci(n - 2)
calls[n] = calls[n - 1] + call... | <commit_before><commit_msg>Solve Fibonacci, How Many Calls? in python<commit_after> | from functools import lru_cache
fibs = [0] * 40
calls = [0] * 40
def fibonacci(n):
global fibs, calls
if n <= 1:
fibs[n] = n
calls[n] = 0
else:
if fibs[n] != 0:
return fibs[n]
fibs[n] = fibonacci(n - 1) + fibonacci(n - 2)
calls[n] = calls[n - 1] + call... | Solve Fibonacci, How Many Calls? in pythonfrom functools import lru_cache
fibs = [0] * 40
calls = [0] * 40
def fibonacci(n):
global fibs, calls
if n <= 1:
fibs[n] = n
calls[n] = 0
else:
if fibs[n] != 0:
return fibs[n]
fibs[n] = fibonacci(n - 1) + fibonacci(n -... | <commit_before><commit_msg>Solve Fibonacci, How Many Calls? in python<commit_after>from functools import lru_cache
fibs = [0] * 40
calls = [0] * 40
def fibonacci(n):
global fibs, calls
if n <= 1:
fibs[n] = n
calls[n] = 0
else:
if fibs[n] != 0:
return fibs[n]
f... | |
03afe1cc090bd48e07fd71616774dc4f05247bed | migrations/usernames.py | migrations/usernames.py | import re
import pymongo
from bhs_api import create_app
if __name__ == "__main__":
app, conf = create_app(testing=True)
app.testing = True
mongo = pymongo.MongoClient(app.config['MONGODB_HOST'])
user_db = mongo[conf.user_db_name]
is_english = re.compile('^[a-zA-Z]')
for i in user_db['user'].f... | Add migration script for users with names | Add migration script for users with names
If existing users have a name we need to change the name in the user db so it
becomes a dict like: {'en': 'Yossi Levy'} if the user name was `Yossi Levy`.
If the user name is in hebrew it will add ti with the 'he' key.
| Python | agpl-3.0 | Beit-Hatfutsot/dbs-back,Beit-Hatfutsot/dbs-back,Beit-Hatfutsot/dbs-back,Beit-Hatfutsot/dbs-back | Add migration script for users with names
If existing users have a name we need to change the name in the user db so it
becomes a dict like: {'en': 'Yossi Levy'} if the user name was `Yossi Levy`.
If the user name is in hebrew it will add ti with the 'he' key. | import re
import pymongo
from bhs_api import create_app
if __name__ == "__main__":
app, conf = create_app(testing=True)
app.testing = True
mongo = pymongo.MongoClient(app.config['MONGODB_HOST'])
user_db = mongo[conf.user_db_name]
is_english = re.compile('^[a-zA-Z]')
for i in user_db['user'].f... | <commit_before><commit_msg>Add migration script for users with names
If existing users have a name we need to change the name in the user db so it
becomes a dict like: {'en': 'Yossi Levy'} if the user name was `Yossi Levy`.
If the user name is in hebrew it will add ti with the 'he' key.<commit_after> | import re
import pymongo
from bhs_api import create_app
if __name__ == "__main__":
app, conf = create_app(testing=True)
app.testing = True
mongo = pymongo.MongoClient(app.config['MONGODB_HOST'])
user_db = mongo[conf.user_db_name]
is_english = re.compile('^[a-zA-Z]')
for i in user_db['user'].f... | Add migration script for users with names
If existing users have a name we need to change the name in the user db so it
becomes a dict like: {'en': 'Yossi Levy'} if the user name was `Yossi Levy`.
If the user name is in hebrew it will add ti with the 'he' key.import re
import pymongo
from bhs_api import create_app
if... | <commit_before><commit_msg>Add migration script for users with names
If existing users have a name we need to change the name in the user db so it
becomes a dict like: {'en': 'Yossi Levy'} if the user name was `Yossi Levy`.
If the user name is in hebrew it will add ti with the 'he' key.<commit_after>import re
import p... | |
4754771eb50cb29722b3c7b5f9bca6dc30ef3157 | noodles/sources/eiti.py | noodles/sources/eiti.py | import logging
import urllib2
import csv
import os
import traceback
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfinterp import PDFPageInterpreter
from noodles.util import stage_path
from noodles.sources.common import Source
class EITISource(Source):
LABEL = 'EITI Country Reports'
URL = 'https://ei... | Add EITI country reports as sources | Add EITI country reports as sources
NB: you need to have pdftotext installed to run this
| Python | mit | uf6/noodles,uf6/noodles | Add EITI country reports as sources
NB: you need to have pdftotext installed to run this | import logging
import urllib2
import csv
import os
import traceback
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfinterp import PDFPageInterpreter
from noodles.util import stage_path
from noodles.sources.common import Source
class EITISource(Source):
LABEL = 'EITI Country Reports'
URL = 'https://ei... | <commit_before><commit_msg>Add EITI country reports as sources
NB: you need to have pdftotext installed to run this<commit_after> | import logging
import urllib2
import csv
import os
import traceback
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfinterp import PDFPageInterpreter
from noodles.util import stage_path
from noodles.sources.common import Source
class EITISource(Source):
LABEL = 'EITI Country Reports'
URL = 'https://ei... | Add EITI country reports as sources
NB: you need to have pdftotext installed to run thisimport logging
import urllib2
import csv
import os
import traceback
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfinterp import PDFPageInterpreter
from noodles.util import stage_path
from noodles.sources.common import So... | <commit_before><commit_msg>Add EITI country reports as sources
NB: you need to have pdftotext installed to run this<commit_after>import logging
import urllib2
import csv
import os
import traceback
from pdfminer.pdfpage import PDFPage
from pdfminer.pdfinterp import PDFPageInterpreter
from noodles.util import stage_pa... | |
f7fb296395c4193dc2f2607d3be50cca280e86dc | tests/test_player.py | tests/test_player.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from db.player import Player
def test_find_by_id():
plr = Player.find_by_id(8459469)
assert plr.name == "Rory Fitzpatrick"
def test_name_property():
plr = Player.find_by_id(8459457)
assert plr.name == " ".join((plr.first_name, plr.last_name))
| Add initial test script for player objects | Add initial test script for player objects
| Python | mit | leaffan/pynhldb | Add initial test script for player objects | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from db.player import Player
def test_find_by_id():
plr = Player.find_by_id(8459469)
assert plr.name == "Rory Fitzpatrick"
def test_name_property():
plr = Player.find_by_id(8459457)
assert plr.name == " ".join((plr.first_name, plr.last_name))
| <commit_before><commit_msg>Add initial test script for player objects<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from db.player import Player
def test_find_by_id():
plr = Player.find_by_id(8459469)
assert plr.name == "Rory Fitzpatrick"
def test_name_property():
plr = Player.find_by_id(8459457)
assert plr.name == " ".join((plr.first_name, plr.last_name))
| Add initial test script for player objects#!/usr/bin/env python
# -*- coding: utf-8 -*-
from db.player import Player
def test_find_by_id():
plr = Player.find_by_id(8459469)
assert plr.name == "Rory Fitzpatrick"
def test_name_property():
plr = Player.find_by_id(8459457)
assert plr.name == " ".join((... | <commit_before><commit_msg>Add initial test script for player objects<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
from db.player import Player
def test_find_by_id():
plr = Player.find_by_id(8459469)
assert plr.name == "Rory Fitzpatrick"
def test_name_property():
plr = Player.find_by_id(8... | |
2afdec4acc893628cba7179e52ca0bbb0207c49a | jsontest.py | jsontest.py | import json
from collections import OrderedDict
import netCDF4
import readNetCDF as rnc
import numpy as np
import util
from netCDF4 import Dataset
json_path = 'json_output_test.json'
nc_file = 'foam_2011-01-01.nc'
domain_type = "Grid" # Default
dset = rnc.load_netcdf(nc_file)
print(rnc.get_var_names(dset))
######... | Test nc -> covJSON v0.1 | Test nc -> covJSON v0.1
| Python | bsd-3-clause | Reading-eScience-Centre/pycovjson | Test nc -> covJSON v0.1 | import json
from collections import OrderedDict
import netCDF4
import readNetCDF as rnc
import numpy as np
import util
from netCDF4 import Dataset
json_path = 'json_output_test.json'
nc_file = 'foam_2011-01-01.nc'
domain_type = "Grid" # Default
dset = rnc.load_netcdf(nc_file)
print(rnc.get_var_names(dset))
######... | <commit_before><commit_msg>Test nc -> covJSON v0.1<commit_after> | import json
from collections import OrderedDict
import netCDF4
import readNetCDF as rnc
import numpy as np
import util
from netCDF4 import Dataset
json_path = 'json_output_test.json'
nc_file = 'foam_2011-01-01.nc'
domain_type = "Grid" # Default
dset = rnc.load_netcdf(nc_file)
print(rnc.get_var_names(dset))
######... | Test nc -> covJSON v0.1import json
from collections import OrderedDict
import netCDF4
import readNetCDF as rnc
import numpy as np
import util
from netCDF4 import Dataset
json_path = 'json_output_test.json'
nc_file = 'foam_2011-01-01.nc'
domain_type = "Grid" # Default
dset = rnc.load_netcdf(nc_file)
print(rnc.get_... | <commit_before><commit_msg>Test nc -> covJSON v0.1<commit_after>import json
from collections import OrderedDict
import netCDF4
import readNetCDF as rnc
import numpy as np
import util
from netCDF4 import Dataset
json_path = 'json_output_test.json'
nc_file = 'foam_2011-01-01.nc'
domain_type = "Grid" # Default
dset =... | |
22ae8b04443c13a1c5e9a25a93c2c52faa996b95 | CodeFights/lateRide.py | CodeFights/lateRide.py | #!/usr/local/bin/python
# Code Fights Late Ride Problem
def lateRide(n):
h, m = divmod(n, 60)
return sum(map(int, str(h) + str(m)))
def main():
tests = [
[240, 4],
[808, 14],
[1439, 19],
[0, 0],
[23, 5],
[8, 8]
]
for t in tests:
res = late... | Solve Code Fights late ride problem | Solve Code Fights late ride problem
| Python | mit | HKuz/Test_Code | Solve Code Fights late ride problem | #!/usr/local/bin/python
# Code Fights Late Ride Problem
def lateRide(n):
h, m = divmod(n, 60)
return sum(map(int, str(h) + str(m)))
def main():
tests = [
[240, 4],
[808, 14],
[1439, 19],
[0, 0],
[23, 5],
[8, 8]
]
for t in tests:
res = late... | <commit_before><commit_msg>Solve Code Fights late ride problem<commit_after> | #!/usr/local/bin/python
# Code Fights Late Ride Problem
def lateRide(n):
h, m = divmod(n, 60)
return sum(map(int, str(h) + str(m)))
def main():
tests = [
[240, 4],
[808, 14],
[1439, 19],
[0, 0],
[23, 5],
[8, 8]
]
for t in tests:
res = late... | Solve Code Fights late ride problem#!/usr/local/bin/python
# Code Fights Late Ride Problem
def lateRide(n):
h, m = divmod(n, 60)
return sum(map(int, str(h) + str(m)))
def main():
tests = [
[240, 4],
[808, 14],
[1439, 19],
[0, 0],
[23, 5],
[8, 8]
]
... | <commit_before><commit_msg>Solve Code Fights late ride problem<commit_after>#!/usr/local/bin/python
# Code Fights Late Ride Problem
def lateRide(n):
h, m = divmod(n, 60)
return sum(map(int, str(h) + str(m)))
def main():
tests = [
[240, 4],
[808, 14],
[1439, 19],
[0, 0],
... | |
3fabbc491a106175d61ffb6a2694501972c47141 | tools/pip-extract.py | tools/pip-extract.py | #!/usr/bin/env python
from distutils.version import LooseVersion
import os
import re
import sys
import yaml
if __name__ == '__main__':
fn = sys.argv[1]
with open(sys.argv[1], 'r') as fh:
lines = fh.readlines()
entries = set()
for line in lines:
line = line.strip()
if not li... | Add little tool to help extract yaml names+versions from pip-require files | Add little tool to help extract yaml names+versions from pip-require files
| Python | apache-2.0 | stackforge/anvil,mc2014/anvil,mc2014/anvil,stackforge/anvil | Add little tool to help extract yaml names+versions from pip-require files | #!/usr/bin/env python
from distutils.version import LooseVersion
import os
import re
import sys
import yaml
if __name__ == '__main__':
fn = sys.argv[1]
with open(sys.argv[1], 'r') as fh:
lines = fh.readlines()
entries = set()
for line in lines:
line = line.strip()
if not li... | <commit_before><commit_msg>Add little tool to help extract yaml names+versions from pip-require files<commit_after> | #!/usr/bin/env python
from distutils.version import LooseVersion
import os
import re
import sys
import yaml
if __name__ == '__main__':
fn = sys.argv[1]
with open(sys.argv[1], 'r') as fh:
lines = fh.readlines()
entries = set()
for line in lines:
line = line.strip()
if not li... | Add little tool to help extract yaml names+versions from pip-require files#!/usr/bin/env python
from distutils.version import LooseVersion
import os
import re
import sys
import yaml
if __name__ == '__main__':
fn = sys.argv[1]
with open(sys.argv[1], 'r') as fh:
lines = fh.readlines()
entries = ... | <commit_before><commit_msg>Add little tool to help extract yaml names+versions from pip-require files<commit_after>#!/usr/bin/env python
from distutils.version import LooseVersion
import os
import re
import sys
import yaml
if __name__ == '__main__':
fn = sys.argv[1]
with open(sys.argv[1], 'r') as fh:
... | |
797ebb71721e067140a2437810cd4923b03af3fa | homework3/game.py | homework3/game.py | from collections import OrderedDict
from random import shuffle
MAX_CONFLICTS = [-1, {
'row': -1,
'column': -1,
'conflicts': [],
}]
def print_board(board):
"""Print board."""
b = ['_'] * len(board)
for queen, position in board.items():
b[position['row']] = ['_'] * len(board)
b... | Create board and find conflicts of the whole board | Create board and find conflicts of the whole board
| Python | mit | mileto94/Data-Mining | Create board and find conflicts of the whole board | from collections import OrderedDict
from random import shuffle
MAX_CONFLICTS = [-1, {
'row': -1,
'column': -1,
'conflicts': [],
}]
def print_board(board):
"""Print board."""
b = ['_'] * len(board)
for queen, position in board.items():
b[position['row']] = ['_'] * len(board)
b... | <commit_before><commit_msg>Create board and find conflicts of the whole board<commit_after> | from collections import OrderedDict
from random import shuffle
MAX_CONFLICTS = [-1, {
'row': -1,
'column': -1,
'conflicts': [],
}]
def print_board(board):
"""Print board."""
b = ['_'] * len(board)
for queen, position in board.items():
b[position['row']] = ['_'] * len(board)
b... | Create board and find conflicts of the whole boardfrom collections import OrderedDict
from random import shuffle
MAX_CONFLICTS = [-1, {
'row': -1,
'column': -1,
'conflicts': [],
}]
def print_board(board):
"""Print board."""
b = ['_'] * len(board)
for queen, position in board.items():
... | <commit_before><commit_msg>Create board and find conflicts of the whole board<commit_after>from collections import OrderedDict
from random import shuffle
MAX_CONFLICTS = [-1, {
'row': -1,
'column': -1,
'conflicts': [],
}]
def print_board(board):
"""Print board."""
b = ['_'] * len(board)
for ... | |
c1fcf18feaafab22f32bb755cae7920d0f09cbb9 | tests/grid_2d_canvas_test.py | tests/grid_2d_canvas_test.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for 2D grid canvas.
"""
import unittest
from matplotlib.collections import PathCollection
from catplot.grid_components.grid_canvas import Grid2DCanvas
class Grid2DCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def t... | Add 2d grid canvas construction test. | Add 2d grid canvas construction test.
| Python | mit | PytLab/catplot | Add 2d grid canvas construction test. | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for 2D grid canvas.
"""
import unittest
from matplotlib.collections import PathCollection
from catplot.grid_components.grid_canvas import Grid2DCanvas
class Grid2DCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def t... | <commit_before><commit_msg>Add 2d grid canvas construction test.<commit_after> | #!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for 2D grid canvas.
"""
import unittest
from matplotlib.collections import PathCollection
from catplot.grid_components.grid_canvas import Grid2DCanvas
class Grid2DCanvasTest(unittest.TestCase):
def setUp(self):
self.maxDiff = True
def t... | Add 2d grid canvas construction test.#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for 2D grid canvas.
"""
import unittest
from matplotlib.collections import PathCollection
from catplot.grid_components.grid_canvas import Grid2DCanvas
class Grid2DCanvasTest(unittest.TestCase):
def setUp(self):
... | <commit_before><commit_msg>Add 2d grid canvas construction test.<commit_after>#!/usr/bin/env python
# -*- coding: utf-8 -*-
""" Test case for 2D grid canvas.
"""
import unittest
from matplotlib.collections import PathCollection
from catplot.grid_components.grid_canvas import Grid2DCanvas
class Grid2DCanvasTest(un... | |
76817a379aff0dd6968df6a6163c635f7e7b53e3 | dynd/tests/test_ndobject_basics.py | dynd/tests/test_ndobject_basics.py | import sys
import unittest
from dynd import nd, ndt
class TestBasics(unittest.TestCase):
def test_index(self):
# Test that the __index__ method/nb_index slot
# in ndobject is working
a = [1, 2, 3, 4, 5, 6]
self.assertEqual(a[nd.ndobject(0)], 1)
self.assertEqual(a[nd.ndobject... | Add some tests for the __index__/nb_index slot in ndobject | Add some tests for the __index__/nb_index slot in ndobject
| Python | bsd-2-clause | izaid/dynd-python,ContinuumIO/dynd-python,cpcloud/dynd-python,mwiebe/dynd-python,mwiebe/dynd-python,insertinterestingnamehere/dynd-python,aterrel/dynd-python,michaelpacer/dynd-python,pombredanne/dynd-python,insertinterestingnamehere/dynd-python,pombredanne/dynd-python,pombredanne/dynd-python,insertinterestingnamehere/d... | Add some tests for the __index__/nb_index slot in ndobject | import sys
import unittest
from dynd import nd, ndt
class TestBasics(unittest.TestCase):
def test_index(self):
# Test that the __index__ method/nb_index slot
# in ndobject is working
a = [1, 2, 3, 4, 5, 6]
self.assertEqual(a[nd.ndobject(0)], 1)
self.assertEqual(a[nd.ndobject... | <commit_before><commit_msg>Add some tests for the __index__/nb_index slot in ndobject<commit_after> | import sys
import unittest
from dynd import nd, ndt
class TestBasics(unittest.TestCase):
def test_index(self):
# Test that the __index__ method/nb_index slot
# in ndobject is working
a = [1, 2, 3, 4, 5, 6]
self.assertEqual(a[nd.ndobject(0)], 1)
self.assertEqual(a[nd.ndobject... | Add some tests for the __index__/nb_index slot in ndobjectimport sys
import unittest
from dynd import nd, ndt
class TestBasics(unittest.TestCase):
def test_index(self):
# Test that the __index__ method/nb_index slot
# in ndobject is working
a = [1, 2, 3, 4, 5, 6]
self.assertEqual(a[... | <commit_before><commit_msg>Add some tests for the __index__/nb_index slot in ndobject<commit_after>import sys
import unittest
from dynd import nd, ndt
class TestBasics(unittest.TestCase):
def test_index(self):
# Test that the __index__ method/nb_index slot
# in ndobject is working
a = [1, 2... | |
e1ffb7b75ff4c1b4124b9af5bdd1b00230589129 | tests/test_connect.py | tests/test_connect.py | import asyncpg
from asyncpg import _testbase as tb
class TestConnect(tb.ConnectedTestCase):
async def test_connect_1(self):
with self.assertRaisesRegex(
Exception, 'role "__does_not_exist__" does not exist'):
await asyncpg.connect(user="__does_not_exist__", loop=self.loop)
| Add user, password, dbname to connect(); suport UNIX sockets | Add user, password, dbname to connect(); suport UNIX sockets
| Python | apache-2.0 | MagicStack/asyncpg,MagicStack/asyncpg | Add user, password, dbname to connect(); suport UNIX sockets | import asyncpg
from asyncpg import _testbase as tb
class TestConnect(tb.ConnectedTestCase):
async def test_connect_1(self):
with self.assertRaisesRegex(
Exception, 'role "__does_not_exist__" does not exist'):
await asyncpg.connect(user="__does_not_exist__", loop=self.loop)
| <commit_before><commit_msg>Add user, password, dbname to connect(); suport UNIX sockets<commit_after> | import asyncpg
from asyncpg import _testbase as tb
class TestConnect(tb.ConnectedTestCase):
async def test_connect_1(self):
with self.assertRaisesRegex(
Exception, 'role "__does_not_exist__" does not exist'):
await asyncpg.connect(user="__does_not_exist__", loop=self.loop)
| Add user, password, dbname to connect(); suport UNIX socketsimport asyncpg
from asyncpg import _testbase as tb
class TestConnect(tb.ConnectedTestCase):
async def test_connect_1(self):
with self.assertRaisesRegex(
Exception, 'role "__does_not_exist__" does not exist'):
await a... | <commit_before><commit_msg>Add user, password, dbname to connect(); suport UNIX sockets<commit_after>import asyncpg
from asyncpg import _testbase as tb
class TestConnect(tb.ConnectedTestCase):
async def test_connect_1(self):
with self.assertRaisesRegex(
Exception, 'role "__does_not_exist... | |
75b3357617ebd8152ebf25abcb776a252ea7389d | tests/test_leonard.py | tests/test_leonard.py | """Test garner.dates."""
from __future__ import absolute_import
from __future__ import print_function
from .check import Check
from proselint.checks.typography import exclamation
class TestCheck(Check):
"""Test class for leonard.exclamation."""
__test__ = True
def test_capitalization_and_no_exclamation... | Add new test for exclamation.leonard | Add new test for exclamation.leonard
| Python | bsd-3-clause | amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint,amperser/proselint | Add new test for exclamation.leonard | """Test garner.dates."""
from __future__ import absolute_import
from __future__ import print_function
from .check import Check
from proselint.checks.typography import exclamation
class TestCheck(Check):
"""Test class for leonard.exclamation."""
__test__ = True
def test_capitalization_and_no_exclamation... | <commit_before><commit_msg>Add new test for exclamation.leonard<commit_after> | """Test garner.dates."""
from __future__ import absolute_import
from __future__ import print_function
from .check import Check
from proselint.checks.typography import exclamation
class TestCheck(Check):
"""Test class for leonard.exclamation."""
__test__ = True
def test_capitalization_and_no_exclamation... | Add new test for exclamation.leonard"""Test garner.dates."""
from __future__ import absolute_import
from __future__ import print_function
from .check import Check
from proselint.checks.typography import exclamation
class TestCheck(Check):
"""Test class for leonard.exclamation."""
__test__ = True
def te... | <commit_before><commit_msg>Add new test for exclamation.leonard<commit_after>"""Test garner.dates."""
from __future__ import absolute_import
from __future__ import print_function
from .check import Check
from proselint.checks.typography import exclamation
class TestCheck(Check):
"""Test class for leonard.exclama... | |
9fb10d8d30fbdb08e46bea3996e75098dce904e5 | fabfile/testbeds/testbed_nodec3.py | fabfile/testbeds/testbed_nodec3.py | from fabric.api import env
host1 = 'root@10.204.216.60'
ext_routers = [('mx1', '10.204.216.253')]
router_asn = 64510
public_vn_rtgt = 10003
public_vn_subnet = "10.204.219.24/29"
host_build = 'vjoshi@10.204.216.56'
env.roledefs = {
'all': [host1],
'cfgm': [host1],
'openstack': [host1],
'control': [ho... | Add testbed file for tempest node | Add testbed file for tempest node
Change-Id: Idabe51a777aa73ff7a3fa94fc0f219ebd80686fc
| Python | apache-2.0 | Juniper/contrail-fabric-utils,Juniper/contrail-fabric-utils | Add testbed file for tempest node
Change-Id: Idabe51a777aa73ff7a3fa94fc0f219ebd80686fc | from fabric.api import env
host1 = 'root@10.204.216.60'
ext_routers = [('mx1', '10.204.216.253')]
router_asn = 64510
public_vn_rtgt = 10003
public_vn_subnet = "10.204.219.24/29"
host_build = 'vjoshi@10.204.216.56'
env.roledefs = {
'all': [host1],
'cfgm': [host1],
'openstack': [host1],
'control': [ho... | <commit_before><commit_msg>Add testbed file for tempest node
Change-Id: Idabe51a777aa73ff7a3fa94fc0f219ebd80686fc<commit_after> | from fabric.api import env
host1 = 'root@10.204.216.60'
ext_routers = [('mx1', '10.204.216.253')]
router_asn = 64510
public_vn_rtgt = 10003
public_vn_subnet = "10.204.219.24/29"
host_build = 'vjoshi@10.204.216.56'
env.roledefs = {
'all': [host1],
'cfgm': [host1],
'openstack': [host1],
'control': [ho... | Add testbed file for tempest node
Change-Id: Idabe51a777aa73ff7a3fa94fc0f219ebd80686fcfrom fabric.api import env
host1 = 'root@10.204.216.60'
ext_routers = [('mx1', '10.204.216.253')]
router_asn = 64510
public_vn_rtgt = 10003
public_vn_subnet = "10.204.219.24/29"
host_build = 'vjoshi@10.204.216.56'
env.roledefs = ... | <commit_before><commit_msg>Add testbed file for tempest node
Change-Id: Idabe51a777aa73ff7a3fa94fc0f219ebd80686fc<commit_after>from fabric.api import env
host1 = 'root@10.204.216.60'
ext_routers = [('mx1', '10.204.216.253')]
router_asn = 64510
public_vn_rtgt = 10003
public_vn_subnet = "10.204.219.24/29"
host_build ... | |
ec28288b924a6378b70de3192f962bf26cf5362b | fil_finder/tests/_testing_data.py | fil_finder/tests/_testing_data.py |
'''
Load in the testing data
'''
import os
from astropy.io import fits
from astropy.table import Table
dir_path = os.path.dirname(__file__)
path1 = os.path.join(dir_path, "testing_data/test1")
path2 = os.path.join(dir_path, "testing_data/test2")
img_path = os.path.join(dir_path, "testing_data")
# Load in the fits... | Load in the saved testing data | Load in the saved testing data
| Python | mit | dcolombo/FilFinder,e-koch/FilFinder,keflavich/fil_finder | Load in the saved testing data |
'''
Load in the testing data
'''
import os
from astropy.io import fits
from astropy.table import Table
dir_path = os.path.dirname(__file__)
path1 = os.path.join(dir_path, "testing_data/test1")
path2 = os.path.join(dir_path, "testing_data/test2")
img_path = os.path.join(dir_path, "testing_data")
# Load in the fits... | <commit_before><commit_msg>Load in the saved testing data<commit_after> |
'''
Load in the testing data
'''
import os
from astropy.io import fits
from astropy.table import Table
dir_path = os.path.dirname(__file__)
path1 = os.path.join(dir_path, "testing_data/test1")
path2 = os.path.join(dir_path, "testing_data/test2")
img_path = os.path.join(dir_path, "testing_data")
# Load in the fits... | Load in the saved testing data
'''
Load in the testing data
'''
import os
from astropy.io import fits
from astropy.table import Table
dir_path = os.path.dirname(__file__)
path1 = os.path.join(dir_path, "testing_data/test1")
path2 = os.path.join(dir_path, "testing_data/test2")
img_path = os.path.join(dir_path, "test... | <commit_before><commit_msg>Load in the saved testing data<commit_after>
'''
Load in the testing data
'''
import os
from astropy.io import fits
from astropy.table import Table
dir_path = os.path.dirname(__file__)
path1 = os.path.join(dir_path, "testing_data/test1")
path2 = os.path.join(dir_path, "testing_data/test2")... | |
845b4fe3bf708d0434cb64d37a212bc0fd6b5ac6 | ci/testsettings.py | ci/testsettings.py | # minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
# SECRET_KEY = ''
| # minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django_cas_ng',
'pucas',
)
# SECRET_KEY = ''
| Add installed apps configuration to test settings | Add installed apps configuration to test settings
| Python | apache-2.0 | Princeton-CDH/django-pucas,Princeton-CDH/django-pucas | # minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
# SECRET_KEY = ''
Add installed apps configuration to test settings | # minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django_cas_ng',
'pucas',
)
# SECRET_KEY = ''
| <commit_before># minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
# SECRET_KEY = ''
<commit_msg>Add installed apps configuration to test settings<commit_after> | # minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
INSTALLED_APPS = (
'django.contrib.auth',
'django.contrib.contenttypes',
'django_cas_ng',
'pucas',
)
# SECRET_KEY = ''
| # minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
# SECRET_KEY = ''
Add installed apps configuration to test settings# minimal django settings required to run tests
DATABASES = {
"default": {
"EN... | <commit_before># minimal django settings required to run tests
DATABASES = {
"default": {
"ENGINE": "django.db.backends.sqlite3",
"NAME": "test.db",
}
}
# SECRET_KEY = ''
<commit_msg>Add installed apps configuration to test settings<commit_after># minimal django settings required to run tests
D... |
0dd70c2e6e991163852e8889e0a4802e702ae68d | mea_module.py | mea_module.py | import sys
from jnius import autoclass, cast
from TripsModule import trips_module
KQMLPerformative = autoclass('TRIPS.KQML.KQMLPerformative')
KQMLList = autoclass('TRIPS.KQML.KQMLList')
KQMLObject = autoclass('TRIPS.KQML.KQMLObject')
from bioagents.mea import MEA
class MEA_Module(trips_module.TripsModule):
def _... | Add TRIPS module for MEA | Add TRIPS module for MEA
| Python | bsd-2-clause | bgyori/bioagents,sorgerlab/bioagents | Add TRIPS module for MEA | import sys
from jnius import autoclass, cast
from TripsModule import trips_module
KQMLPerformative = autoclass('TRIPS.KQML.KQMLPerformative')
KQMLList = autoclass('TRIPS.KQML.KQMLList')
KQMLObject = autoclass('TRIPS.KQML.KQMLObject')
from bioagents.mea import MEA
class MEA_Module(trips_module.TripsModule):
def _... | <commit_before><commit_msg>Add TRIPS module for MEA<commit_after> | import sys
from jnius import autoclass, cast
from TripsModule import trips_module
KQMLPerformative = autoclass('TRIPS.KQML.KQMLPerformative')
KQMLList = autoclass('TRIPS.KQML.KQMLList')
KQMLObject = autoclass('TRIPS.KQML.KQMLObject')
from bioagents.mea import MEA
class MEA_Module(trips_module.TripsModule):
def _... | Add TRIPS module for MEAimport sys
from jnius import autoclass, cast
from TripsModule import trips_module
KQMLPerformative = autoclass('TRIPS.KQML.KQMLPerformative')
KQMLList = autoclass('TRIPS.KQML.KQMLList')
KQMLObject = autoclass('TRIPS.KQML.KQMLObject')
from bioagents.mea import MEA
class MEA_Module(trips_module... | <commit_before><commit_msg>Add TRIPS module for MEA<commit_after>import sys
from jnius import autoclass, cast
from TripsModule import trips_module
KQMLPerformative = autoclass('TRIPS.KQML.KQMLPerformative')
KQMLList = autoclass('TRIPS.KQML.KQMLList')
KQMLObject = autoclass('TRIPS.KQML.KQMLObject')
from bioagents.mea ... | |
dfa6d3b3fe148895599360d01195200b06e7583d | receiver-dump.py | receiver-dump.py | #******************************************************************************
#
# receiver-dump.py
#
#******************************************************************************
#
# Author: Werner Lane
# E-mail: laneboysrc@gmail.com
#
#*********************************************************... | Add receiver dump program, output of firmware | Add receiver dump program, output of firmware
| Python | unlicense | laneboysrc/hk310-expansion,laneboysrc/hk310-expansion,laneboysrc/hk310-expansion | Add receiver dump program, output of firmware | #******************************************************************************
#
# receiver-dump.py
#
#******************************************************************************
#
# Author: Werner Lane
# E-mail: laneboysrc@gmail.com
#
#*********************************************************... | <commit_before><commit_msg>Add receiver dump program, output of firmware<commit_after> | #******************************************************************************
#
# receiver-dump.py
#
#******************************************************************************
#
# Author: Werner Lane
# E-mail: laneboysrc@gmail.com
#
#*********************************************************... | Add receiver dump program, output of firmware#******************************************************************************
#
# receiver-dump.py
#
#******************************************************************************
#
# Author: Werner Lane
# E-mail: laneboysrc@gmail.com
#
#************... | <commit_before><commit_msg>Add receiver dump program, output of firmware<commit_after>#******************************************************************************
#
# receiver-dump.py
#
#******************************************************************************
#
# Author: Werner Lane
# E-mail: ... | |
678ba5e332b7c54cdb39d117dc443bf88da7d111 | jsontosql.py | jsontosql.py | import os
import os.path
from json import loads
import click
from vendcrawler.scripts.vendcrawlerdb import VendCrawlerDB
class JSONToSQL(object):
def __init__(self, json, user, password, database):
self.data = loads(json.read())
self.db = VendCrawlerDB(user, password, database)
... | Add json to sql conversion script. | Add json to sql conversion script.
| Python | mit | josetaas/vendcrawler,josetaas/vendcrawler,josetaas/vendcrawler | Add json to sql conversion script. | import os
import os.path
from json import loads
import click
from vendcrawler.scripts.vendcrawlerdb import VendCrawlerDB
class JSONToSQL(object):
def __init__(self, json, user, password, database):
self.data = loads(json.read())
self.db = VendCrawlerDB(user, password, database)
... | <commit_before><commit_msg>Add json to sql conversion script.<commit_after> | import os
import os.path
from json import loads
import click
from vendcrawler.scripts.vendcrawlerdb import VendCrawlerDB
class JSONToSQL(object):
def __init__(self, json, user, password, database):
self.data = loads(json.read())
self.db = VendCrawlerDB(user, password, database)
... | Add json to sql conversion script.import os
import os.path
from json import loads
import click
from vendcrawler.scripts.vendcrawlerdb import VendCrawlerDB
class JSONToSQL(object):
def __init__(self, json, user, password, database):
self.data = loads(json.read())
self.db = VendCrawlerDB(user, pas... | <commit_before><commit_msg>Add json to sql conversion script.<commit_after>import os
import os.path
from json import loads
import click
from vendcrawler.scripts.vendcrawlerdb import VendCrawlerDB
class JSONToSQL(object):
def __init__(self, json, user, password, database):
self.data = loads(json.read())
... | |
b0db73209cbe29bf070581fd81afc6fbf86af718 | skan/draw.py | skan/draw.py | import numpy as np
import matplotlib.pyplot as plt
from skimage import img_as_float
from skimage.color import gray2rgb
from .csr import summarise
def _normalise_image(image, *, image_cmap=None):
image = img_as_float(image)
if image.ndim == 2:
if image_cmap is None:
image = gray2rgb(image)
... | Add first draft of plotting functions | Add first draft of plotting functions
| Python | bsd-3-clause | jni/skan | Add first draft of plotting functions | import numpy as np
import matplotlib.pyplot as plt
from skimage import img_as_float
from skimage.color import gray2rgb
from .csr import summarise
def _normalise_image(image, *, image_cmap=None):
image = img_as_float(image)
if image.ndim == 2:
if image_cmap is None:
image = gray2rgb(image)
... | <commit_before><commit_msg>Add first draft of plotting functions<commit_after> | import numpy as np
import matplotlib.pyplot as plt
from skimage import img_as_float
from skimage.color import gray2rgb
from .csr import summarise
def _normalise_image(image, *, image_cmap=None):
image = img_as_float(image)
if image.ndim == 2:
if image_cmap is None:
image = gray2rgb(image)
... | Add first draft of plotting functionsimport numpy as np
import matplotlib.pyplot as plt
from skimage import img_as_float
from skimage.color import gray2rgb
from .csr import summarise
def _normalise_image(image, *, image_cmap=None):
image = img_as_float(image)
if image.ndim == 2:
if image_cmap is None:... | <commit_before><commit_msg>Add first draft of plotting functions<commit_after>import numpy as np
import matplotlib.pyplot as plt
from skimage import img_as_float
from skimage.color import gray2rgb
from .csr import summarise
def _normalise_image(image, *, image_cmap=None):
image = img_as_float(image)
if image.... | |
7174061ac5ae2453c3369c7bb7dd01e45ee36092 | scripts/pseudo_users_and_groups_operations.py | scripts/pseudo_users_and_groups_operations.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
def main(argv=None):
"""
То, с чего начинается программа
"""
if argv == None:
argv=sys.argv
parser = argparse.ArgumentParser(
description=\
"""
Данный скрипт создаёт пользоват... | Create pseudo_users and pseudo_groups. In future it will remove pseudo users and pseudo groups too. | Create pseudo_users and pseudo_groups.
In future it will remove pseudo users and pseudo groups too.
| Python | lgpl-2.1 | pseudo-cluster/pseudo-cluster,pseudo-cluster/pseudo-cluster | Create pseudo_users and pseudo_groups.
In future it will remove pseudo users and pseudo groups too. | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
def main(argv=None):
"""
То, с чего начинается программа
"""
if argv == None:
argv=sys.argv
parser = argparse.ArgumentParser(
description=\
"""
Данный скрипт создаёт пользоват... | <commit_before><commit_msg>Create pseudo_users and pseudo_groups.
In future it will remove pseudo users and pseudo groups too.<commit_after> | #!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
def main(argv=None):
"""
То, с чего начинается программа
"""
if argv == None:
argv=sys.argv
parser = argparse.ArgumentParser(
description=\
"""
Данный скрипт создаёт пользоват... | Create pseudo_users and pseudo_groups.
In future it will remove pseudo users and pseudo groups too.#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
def main(argv=None):
"""
То, с чего начинается программа
"""
if argv == None:
argv=sys.argv
parser = argparse.Argument... | <commit_before><commit_msg>Create pseudo_users and pseudo_groups.
In future it will remove pseudo users and pseudo groups too.<commit_after>#!/usr/bin/python
# -*- coding: utf-8 -*-
import argparse
import os
def main(argv=None):
"""
То, с чего начинается программа
"""
if argv == None:
argv... | |
54c1fe598d4a8d76ae7ec0ce867f45af056c12e6 | Lab/10/Template_10_A.py | Lab/10/Template_10_A.py | palindrom (kata) :
#TODO : implementasi fungsi palindrom untuk menyelesaikan soal palindrom
checkActiveAmoeba (hariKe, amoebaAktif) :
#TODO : implementasi fungsi ini untuk menyelesaikan soal Amoeba
kataPalindrom = input("Masukkan kata : ")
#TODO : cetak keluaran sesuai permintaan soal
hari = int(input("Cek... | Add template for lab 10 class A | Add template for lab 10 class A
| Python | mit | laymonage/TarungLab,giovanism/TarungLab | Add template for lab 10 class A | palindrom (kata) :
#TODO : implementasi fungsi palindrom untuk menyelesaikan soal palindrom
checkActiveAmoeba (hariKe, amoebaAktif) :
#TODO : implementasi fungsi ini untuk menyelesaikan soal Amoeba
kataPalindrom = input("Masukkan kata : ")
#TODO : cetak keluaran sesuai permintaan soal
hari = int(input("Cek... | <commit_before><commit_msg>Add template for lab 10 class A<commit_after> | palindrom (kata) :
#TODO : implementasi fungsi palindrom untuk menyelesaikan soal palindrom
checkActiveAmoeba (hariKe, amoebaAktif) :
#TODO : implementasi fungsi ini untuk menyelesaikan soal Amoeba
kataPalindrom = input("Masukkan kata : ")
#TODO : cetak keluaran sesuai permintaan soal
hari = int(input("Cek... | Add template for lab 10 class Apalindrom (kata) :
#TODO : implementasi fungsi palindrom untuk menyelesaikan soal palindrom
checkActiveAmoeba (hariKe, amoebaAktif) :
#TODO : implementasi fungsi ini untuk menyelesaikan soal Amoeba
kataPalindrom = input("Masukkan kata : ")
#TODO : cetak keluaran sesuai permint... | <commit_before><commit_msg>Add template for lab 10 class A<commit_after>palindrom (kata) :
#TODO : implementasi fungsi palindrom untuk menyelesaikan soal palindrom
checkActiveAmoeba (hariKe, amoebaAktif) :
#TODO : implementasi fungsi ini untuk menyelesaikan soal Amoeba
kataPalindrom = input("Masukkan kata :... | |
254930d317ab61bc85169d8c64e2c6eab2d48f5f | tests/unit/cloudant_t/design_doc_test.py | tests/unit/cloudant_t/design_doc_test.py | #!/usr/bin/env python
"""
_design_doc_test_
"""
import mock
import unittest
from cloudant.design_document import DesignDocument
from cloudant.document import Document
class DesignDocTests(unittest.TestCase):
"""
tests for design doc object
"""
@mock.patch.object(Document, 'fetch')
def test_desi... | Copy DesignDocument tests to their own module | Copy DesignDocument tests to their own module
| Python | apache-2.0 | cloudant/python-cloudant | Copy DesignDocument tests to their own module | #!/usr/bin/env python
"""
_design_doc_test_
"""
import mock
import unittest
from cloudant.design_document import DesignDocument
from cloudant.document import Document
class DesignDocTests(unittest.TestCase):
"""
tests for design doc object
"""
@mock.patch.object(Document, 'fetch')
def test_desi... | <commit_before><commit_msg>Copy DesignDocument tests to their own module<commit_after> | #!/usr/bin/env python
"""
_design_doc_test_
"""
import mock
import unittest
from cloudant.design_document import DesignDocument
from cloudant.document import Document
class DesignDocTests(unittest.TestCase):
"""
tests for design doc object
"""
@mock.patch.object(Document, 'fetch')
def test_desi... | Copy DesignDocument tests to their own module#!/usr/bin/env python
"""
_design_doc_test_
"""
import mock
import unittest
from cloudant.design_document import DesignDocument
from cloudant.document import Document
class DesignDocTests(unittest.TestCase):
"""
tests for design doc object
"""
@mock.patc... | <commit_before><commit_msg>Copy DesignDocument tests to their own module<commit_after>#!/usr/bin/env python
"""
_design_doc_test_
"""
import mock
import unittest
from cloudant.design_document import DesignDocument
from cloudant.document import Document
class DesignDocTests(unittest.TestCase):
"""
tests for ... | |
37dd523cfb5a26cb33493ba29f99d8a97a8401e4 | inst/py/phyloxml_from_msa.py | inst/py/phyloxml_from_msa.py | """Generate a phylo.xml from a MUSCLE MSA.fasta"""
import argparse
##### PARSE ARGUMENTS #####
argparser = argparse.ArgumentParser()
argparser.add_argument("msa", help="path to the MUSCLE MSA.fasta")
argparser.add_argument("phyloxml", help="path to an output phylo.xml")
args = argparser.parse_args()
args = vars(arg... | Add Python function to build phylo.xml from MSA with Biopython | Add Python function to build phylo.xml from MSA with Biopython
| Python | bsd-2-clause | daniel0128/receptormarker,nsh87/receptormarker,nsh87/receptormarker,daniel0128/receptormarker,daniel0128/receptormarker,nsh87/receptormarker,nsh87/receptormarker,catterbu/receptormarker,daniel0128/receptormarker,daniel0128/receptormarker,catterbu/receptormarker,daniel0128/receptormarker,catterbu/receptormarker,catterbu... | Add Python function to build phylo.xml from MSA with Biopython | """Generate a phylo.xml from a MUSCLE MSA.fasta"""
import argparse
##### PARSE ARGUMENTS #####
argparser = argparse.ArgumentParser()
argparser.add_argument("msa", help="path to the MUSCLE MSA.fasta")
argparser.add_argument("phyloxml", help="path to an output phylo.xml")
args = argparser.parse_args()
args = vars(arg... | <commit_before><commit_msg>Add Python function to build phylo.xml from MSA with Biopython<commit_after> | """Generate a phylo.xml from a MUSCLE MSA.fasta"""
import argparse
##### PARSE ARGUMENTS #####
argparser = argparse.ArgumentParser()
argparser.add_argument("msa", help="path to the MUSCLE MSA.fasta")
argparser.add_argument("phyloxml", help="path to an output phylo.xml")
args = argparser.parse_args()
args = vars(arg... | Add Python function to build phylo.xml from MSA with Biopython"""Generate a phylo.xml from a MUSCLE MSA.fasta"""
import argparse
##### PARSE ARGUMENTS #####
argparser = argparse.ArgumentParser()
argparser.add_argument("msa", help="path to the MUSCLE MSA.fasta")
argparser.add_argument("phyloxml", help="path to an ou... | <commit_before><commit_msg>Add Python function to build phylo.xml from MSA with Biopython<commit_after>"""Generate a phylo.xml from a MUSCLE MSA.fasta"""
import argparse
##### PARSE ARGUMENTS #####
argparser = argparse.ArgumentParser()
argparser.add_argument("msa", help="path to the MUSCLE MSA.fasta")
argparser.add... | |
d83be93d707ead0563f2eefc71b1f3d90e20df4a | 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 the bright pixels of other lines, making them look physical; should be additive | Add crude script to draw glowing lines; currently the dark part hides the bright pixels of 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 the bright pixels of 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 the bright pixels of 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 the bright pixels of 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), ... | <commit_before><commit_msg>Add crude script to draw glowing lines; currently the dark part hides the bright pixels of 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_po... | |
d1de958daac3991bf673c4e5b10a0564a9a610d8 | var/spack/packages/libmonitor/package.py | var/spack/packages/libmonitor/package.py | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | Add libmonitor to spack. Still needs svn support for checkout | Add libmonitor to spack. Still needs svn support for checkout
| Python | lgpl-2.1 | matthiasdiener/spack,mfherbst/spack,TheTimmy/spack,EmreAtes/spack,TheTimmy/spack,mfherbst/spack,EmreAtes/spack,tmerrick1/spack,skosukhin/spack,lgarren/spack,lgarren/spack,TheTimmy/spack,LLNL/spack,mfherbst/spack,skosukhin/spack,mfherbst/spack,TheTimmy/spack,tmerrick1/spack,mfherbst/spack,krafczyk/spack,LLNL/spack,tmerr... | Add libmonitor to spack. Still needs svn support for checkout | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | <commit_before><commit_msg>Add libmonitor to spack. Still needs svn support for checkout<commit_after> | ##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-647188
... | Add libmonitor to spack. Still needs svn support for checkout##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Written by Todd Gambli... | <commit_before><commit_msg>Add libmonitor to spack. Still needs svn support for checkout<commit_after>##############################################################################
# Copyright (c) 2013, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file i... | |
329438288f9bf031e806020b37e3b9260e9dc07b | scripts/create_nom_prenom_unifier.py | scripts/create_nom_prenom_unifier.py | # -*- coding: utf-8 -*-
import pandas as pd
from unidecode import unidecode
df = pd.DataFrame()
from utils import Fingerprinter
def nomprenomtwice(nom):
if not pd.isnull(nom):
anom = nom.split(' ')
if anom[len(anom)/2] != anom[0]:
return nom.upper()
return ' '.join(anom[0:le... | Add script to generate a nom prenom unifier | Add script to generate a nom prenom unifier
| Python | agpl-3.0 | regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data,regardscitoyens/sunshine-data | Add script to generate a nom prenom unifier | # -*- coding: utf-8 -*-
import pandas as pd
from unidecode import unidecode
df = pd.DataFrame()
from utils import Fingerprinter
def nomprenomtwice(nom):
if not pd.isnull(nom):
anom = nom.split(' ')
if anom[len(anom)/2] != anom[0]:
return nom.upper()
return ' '.join(anom[0:le... | <commit_before><commit_msg>Add script to generate a nom prenom unifier<commit_after> | # -*- coding: utf-8 -*-
import pandas as pd
from unidecode import unidecode
df = pd.DataFrame()
from utils import Fingerprinter
def nomprenomtwice(nom):
if not pd.isnull(nom):
anom = nom.split(' ')
if anom[len(anom)/2] != anom[0]:
return nom.upper()
return ' '.join(anom[0:le... | Add script to generate a nom prenom unifier# -*- coding: utf-8 -*-
import pandas as pd
from unidecode import unidecode
df = pd.DataFrame()
from utils import Fingerprinter
def nomprenomtwice(nom):
if not pd.isnull(nom):
anom = nom.split(' ')
if anom[len(anom)/2] != anom[0]:
return no... | <commit_before><commit_msg>Add script to generate a nom prenom unifier<commit_after># -*- coding: utf-8 -*-
import pandas as pd
from unidecode import unidecode
df = pd.DataFrame()
from utils import Fingerprinter
def nomprenomtwice(nom):
if not pd.isnull(nom):
anom = nom.split(' ')
if anom[len(a... | |
9f30d2dd142116f46dd0257bcf093e8e8dc2c11a | wagtail/admin/tests/test_dismissibles.py | wagtail/admin/tests/test_dismissibles.py | from django.test import TestCase
from django.urls import reverse
from wagtail.test.utils import WagtailTestUtils
from wagtail.users.models import UserProfile
class TestDismissiblesView(TestCase, WagtailTestUtils):
def setUp(self):
self.user = self.login()
self.profile = UserProfile.get_for_user(s... | Add tests for Dismissibles view | Add tests for Dismissibles view
| Python | bsd-3-clause | rsalmaso/wagtail,thenewguy/wagtail,rsalmaso/wagtail,thenewguy/wagtail,rsalmaso/wagtail,wagtail/wagtail,wagtail/wagtail,rsalmaso/wagtail,zerolab/wagtail,wagtail/wagtail,zerolab/wagtail,zerolab/wagtail,thenewguy/wagtail,zerolab/wagtail,wagtail/wagtail,rsalmaso/wagtail,wagtail/wagtail,thenewguy/wagtail,zerolab/wagtail,the... | Add tests for Dismissibles view | from django.test import TestCase
from django.urls import reverse
from wagtail.test.utils import WagtailTestUtils
from wagtail.users.models import UserProfile
class TestDismissiblesView(TestCase, WagtailTestUtils):
def setUp(self):
self.user = self.login()
self.profile = UserProfile.get_for_user(s... | <commit_before><commit_msg>Add tests for Dismissibles view<commit_after> | from django.test import TestCase
from django.urls import reverse
from wagtail.test.utils import WagtailTestUtils
from wagtail.users.models import UserProfile
class TestDismissiblesView(TestCase, WagtailTestUtils):
def setUp(self):
self.user = self.login()
self.profile = UserProfile.get_for_user(s... | Add tests for Dismissibles viewfrom django.test import TestCase
from django.urls import reverse
from wagtail.test.utils import WagtailTestUtils
from wagtail.users.models import UserProfile
class TestDismissiblesView(TestCase, WagtailTestUtils):
def setUp(self):
self.user = self.login()
self.profi... | <commit_before><commit_msg>Add tests for Dismissibles view<commit_after>from django.test import TestCase
from django.urls import reverse
from wagtail.test.utils import WagtailTestUtils
from wagtail.users.models import UserProfile
class TestDismissiblesView(TestCase, WagtailTestUtils):
def setUp(self):
se... | |
6e2b09d478d61c2ae66959b87cb58689b57436b0 | rf_train.py | rf_train.py | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
print "Grabbing data..."
training_text_collection_f = open("training_text_collection.pkl", "rb")
training_text_collection = joblib.load(training_text_collection_f)
train... | Create Random Forest vectorizer and classifier pickles | Create Random Forest vectorizer and classifier pickles
| Python | mit | npentella/CuriousCorpus,npentella/CuriousCorpus,npentella/CuriousCorpus | Create Random Forest vectorizer and classifier pickles | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
print "Grabbing data..."
training_text_collection_f = open("training_text_collection.pkl", "rb")
training_text_collection = joblib.load(training_text_collection_f)
train... | <commit_before><commit_msg>Create Random Forest vectorizer and classifier pickles<commit_after> | from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
print "Grabbing data..."
training_text_collection_f = open("training_text_collection.pkl", "rb")
training_text_collection = joblib.load(training_text_collection_f)
train... | Create Random Forest vectorizer and classifier picklesfrom sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
print "Grabbing data..."
training_text_collection_f = open("training_text_collection.pkl", "rb")
training_text_coll... | <commit_before><commit_msg>Create Random Forest vectorizer and classifier pickles<commit_after>from sklearn.feature_extraction.text import TfidfVectorizer
from sklearn.ensemble import RandomForestClassifier
from sklearn.externals import joblib
print "Grabbing data..."
training_text_collection_f = open("training_text_... | |
7cd00a28a0cbb152cd61c3ebbd4b72d3ab31baca | locators/tests/functional/test_latest.py | locators/tests/functional/test_latest.py | from locators import SimpleLocator
def test_latest_source():
loc = SimpleLocator()
proj = 'pip'
latest = max(loc.versions(proj))
# We want the first item in the following list
assert len(loc.get(proj, latest)['sdist']) != 0
def test_has_wheels():
loc = SimpleLocator()
proj = 'pip'
late... | Add the basis for some functional tests | Add the basis for some functional tests
| Python | mit | pfmoore/sandbox | Add the basis for some functional tests | from locators import SimpleLocator
def test_latest_source():
loc = SimpleLocator()
proj = 'pip'
latest = max(loc.versions(proj))
# We want the first item in the following list
assert len(loc.get(proj, latest)['sdist']) != 0
def test_has_wheels():
loc = SimpleLocator()
proj = 'pip'
late... | <commit_before><commit_msg>Add the basis for some functional tests<commit_after> | from locators import SimpleLocator
def test_latest_source():
loc = SimpleLocator()
proj = 'pip'
latest = max(loc.versions(proj))
# We want the first item in the following list
assert len(loc.get(proj, latest)['sdist']) != 0
def test_has_wheels():
loc = SimpleLocator()
proj = 'pip'
late... | Add the basis for some functional testsfrom locators import SimpleLocator
def test_latest_source():
loc = SimpleLocator()
proj = 'pip'
latest = max(loc.versions(proj))
# We want the first item in the following list
assert len(loc.get(proj, latest)['sdist']) != 0
def test_has_wheels():
loc = Si... | <commit_before><commit_msg>Add the basis for some functional tests<commit_after>from locators import SimpleLocator
def test_latest_source():
loc = SimpleLocator()
proj = 'pip'
latest = max(loc.versions(proj))
# We want the first item in the following list
assert len(loc.get(proj, latest)['sdist']) ... | |
921d95a432316b2b76aadabcc3fc90fbf90376aa | simphony/testing/abc_container_check.py | simphony/testing/abc_container_check.py | import abc
from functools import partial
from simphony.testing.utils import (
create_data_container, compare_data_containers)
from simphony.core.data_container import DataContainer
from simphony.core.cuba import CUBA
class ContainerCheck(object):
__metaclass__ = abc.ABCMeta
def setUp(self):
sel... | Add a basic test template for high level CUDS containers | Add a basic test template for high level CUDS containers
| Python | bsd-2-clause | simphony/simphony-common | Add a basic test template for high level CUDS containers | import abc
from functools import partial
from simphony.testing.utils import (
create_data_container, compare_data_containers)
from simphony.core.data_container import DataContainer
from simphony.core.cuba import CUBA
class ContainerCheck(object):
__metaclass__ = abc.ABCMeta
def setUp(self):
sel... | <commit_before><commit_msg>Add a basic test template for high level CUDS containers<commit_after> | import abc
from functools import partial
from simphony.testing.utils import (
create_data_container, compare_data_containers)
from simphony.core.data_container import DataContainer
from simphony.core.cuba import CUBA
class ContainerCheck(object):
__metaclass__ = abc.ABCMeta
def setUp(self):
sel... | Add a basic test template for high level CUDS containersimport abc
from functools import partial
from simphony.testing.utils import (
create_data_container, compare_data_containers)
from simphony.core.data_container import DataContainer
from simphony.core.cuba import CUBA
class ContainerCheck(object):
__met... | <commit_before><commit_msg>Add a basic test template for high level CUDS containers<commit_after>import abc
from functools import partial
from simphony.testing.utils import (
create_data_container, compare_data_containers)
from simphony.core.data_container import DataContainer
from simphony.core.cuba import CUBA
... | |
62ece88485b335086f76335095ccf348a123ee69 | tests/simplemeshtest.py | tests/simplemeshtest.py | #!/usr/bin/env python
from twisted.internet import reactor
from mesh import Mesh
import sys
NUMNODES = 5
NUMPACKETS = 10
nodes = []
# We're optimists
success = True
class TestMesh(Mesh):
expected = {}
done = 0
def gotOutput(self, node, data):
if self.expected.get(node) == None:
self.expected[node]... | Add a very basis test (just test if messages are output in the right order by all nodes | Add a very basis test (just test if messages are output in the right order by all nodes
20070605063752-93b9a-171c986a65ac8fcdb791ea4ab34f870f087478dc.gz
| Python | lgpl-2.1 | freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut | Add a very basis test (just test if messages are output in the right order by all nodes
20070605063752-93b9a-171c986a65ac8fcdb791ea4ab34f870f087478dc.gz | #!/usr/bin/env python
from twisted.internet import reactor
from mesh import Mesh
import sys
NUMNODES = 5
NUMPACKETS = 10
nodes = []
# We're optimists
success = True
class TestMesh(Mesh):
expected = {}
done = 0
def gotOutput(self, node, data):
if self.expected.get(node) == None:
self.expected[node]... | <commit_before><commit_msg>Add a very basis test (just test if messages are output in the right order by all nodes
20070605063752-93b9a-171c986a65ac8fcdb791ea4ab34f870f087478dc.gz<commit_after> | #!/usr/bin/env python
from twisted.internet import reactor
from mesh import Mesh
import sys
NUMNODES = 5
NUMPACKETS = 10
nodes = []
# We're optimists
success = True
class TestMesh(Mesh):
expected = {}
done = 0
def gotOutput(self, node, data):
if self.expected.get(node) == None:
self.expected[node]... | Add a very basis test (just test if messages are output in the right order by all nodes
20070605063752-93b9a-171c986a65ac8fcdb791ea4ab34f870f087478dc.gz#!/usr/bin/env python
from twisted.internet import reactor
from mesh import Mesh
import sys
NUMNODES = 5
NUMPACKETS = 10
nodes = []
# We're optimists
success = Tr... | <commit_before><commit_msg>Add a very basis test (just test if messages are output in the right order by all nodes
20070605063752-93b9a-171c986a65ac8fcdb791ea4ab34f870f087478dc.gz<commit_after>#!/usr/bin/env python
from twisted.internet import reactor
from mesh import Mesh
import sys
NUMNODES = 5
NUMPACKETS = 10
... | |
dfa257f02d14ba7757ee65d1910bf581c280607e | tests/unit/test_repr.py | tests/unit/test_repr.py | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
o = Obj... | Test the repr() of object | Test the repr() of object
| Python | bsd-3-clause | arkaitzj/python-butter | Test the repr() of object | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
o = Obj... | <commit_before><commit_msg>Test the repr() of object<commit_after> | from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = request.param
o = Obj... | Test the repr() of objectfrom butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalfd, Timerfd])
def obj(request):
Obj = ... | <commit_before><commit_msg>Test the repr() of object<commit_after>from butter.eventfd import Eventfd
from butter.fanotify import Fanotify
from butter.inotify import Inotify
from butter.signalfd import Signalfd
from butter.timerfd import Timerfd
import pytest
@pytest.fixture(params=[Eventfd, Fanotify, Inotify, Signalf... | |
6ee4d6a13a3fb6564e12ef8c8645a96015d39fed | seq_spot.py | seq_spot.py | from matplotlib import pyplot as plt
s=["AATTCGCGCTTACGCTAGGCTAGCTAGGCTCGATTCGAGGCTCGGGATCGATCGGTACGAGGTACGTACTGACTGACT",
"ACTGGGCTATGCGGGATATATATATCGCGACTGACATGCATGCTAGGCGCGCTATAATCGGCGCATATAGCTAGCTAG",
"ACTGACGTACGTAGCTAGCTAGGCTATATAGCGCGCATATCGCGAGTATACGTAGCTAGCTGACTGGCGATATATCGA",
"ACGTGAGCTGATGTGTGAGTACTATA... | Create dodgy vis of reads sequenced | Create dodgy vis of reads sequenced | Python | mit | Psy-Fer/seq_spot | Create dodgy vis of reads sequenced | from matplotlib import pyplot as plt
s=["AATTCGCGCTTACGCTAGGCTAGCTAGGCTCGATTCGAGGCTCGGGATCGATCGGTACGAGGTACGTACTGACTGACT",
"ACTGGGCTATGCGGGATATATATATCGCGACTGACATGCATGCTAGGCGCGCTATAATCGGCGCATATAGCTAGCTAG",
"ACTGACGTACGTAGCTAGCTAGGCTATATAGCGCGCATATCGCGAGTATACGTAGCTAGCTGACTGGCGATATATCGA",
"ACGTGAGCTGATGTGTGAGTACTATA... | <commit_before><commit_msg>Create dodgy vis of reads sequenced<commit_after> | from matplotlib import pyplot as plt
s=["AATTCGCGCTTACGCTAGGCTAGCTAGGCTCGATTCGAGGCTCGGGATCGATCGGTACGAGGTACGTACTGACTGACT",
"ACTGGGCTATGCGGGATATATATATCGCGACTGACATGCATGCTAGGCGCGCTATAATCGGCGCATATAGCTAGCTAG",
"ACTGACGTACGTAGCTAGCTAGGCTATATAGCGCGCATATCGCGAGTATACGTAGCTAGCTGACTGGCGATATATCGA",
"ACGTGAGCTGATGTGTGAGTACTATA... | Create dodgy vis of reads sequencedfrom matplotlib import pyplot as plt
s=["AATTCGCGCTTACGCTAGGCTAGCTAGGCTCGATTCGAGGCTCGGGATCGATCGGTACGAGGTACGTACTGACTGACT",
"ACTGGGCTATGCGGGATATATATATCGCGACTGACATGCATGCTAGGCGCGCTATAATCGGCGCATATAGCTAGCTAG",
"ACTGACGTACGTAGCTAGCTAGGCTATATAGCGCGCATATCGCGAGTATACGTAGCTAGCTGACTGGCGATATAT... | <commit_before><commit_msg>Create dodgy vis of reads sequenced<commit_after>from matplotlib import pyplot as plt
s=["AATTCGCGCTTACGCTAGGCTAGCTAGGCTCGATTCGAGGCTCGGGATCGATCGGTACGAGGTACGTACTGACTGACT",
"ACTGGGCTATGCGGGATATATATATCGCGACTGACATGCATGCTAGGCGCGCTATAATCGGCGCATATAGCTAGCTAG",
"ACTGACGTACGTAGCTAGCTAGGCTATATAGCGC... | |
caaabeb103879baf3179955b36e845aa878f15f6 | tools/build_tfmd_docs.py | tools/build_tfmd_docs.py | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add api-reference generation script for TFMD. | Add api-reference generation script for TFMD.
Output listing: https://paste.googleplex.com/4777420088410112
PiperOrigin-RevId: 431509556
| Python | apache-2.0 | tensorflow/metadata,tensorflow/metadata | Add api-reference generation script for TFMD.
Output listing: https://paste.googleplex.com/4777420088410112
PiperOrigin-RevId: 431509556 | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | <commit_before><commit_msg>Add api-reference generation script for TFMD.
Output listing: https://paste.googleplex.com/4777420088410112
PiperOrigin-RevId: 431509556<commit_after> | # Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Add api-reference generation script for TFMD.
Output listing: https://paste.googleplex.com/4777420088410112
PiperOrigin-RevId: 431509556# Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance wit... | <commit_before><commit_msg>Add api-reference generation script for TFMD.
Output listing: https://paste.googleplex.com/4777420088410112
PiperOrigin-RevId: 431509556<commit_after># Copyright 2022 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may n... | |
c123c8ce1094885e3a4d96573f70ebc1130627f6 | set2/2-2.py | set2/2-2.py | # This is a hack to make sure Python 2.x and 3.x behave the same
# You can ignore this bit
try:
input = raw_input
except NameError:
pass
# Real program starts here
def hash(string):
char_sum = 0
for c in string:
char_sum += ord(c)
return char_sum % 23
password_hash = 17
print("Please ent... | Add hasing on string input game | Set2: Add hasing on string input game
| Python | mit | SingingTree/WarGames | Set2: Add hasing on string input game | # This is a hack to make sure Python 2.x and 3.x behave the same
# You can ignore this bit
try:
input = raw_input
except NameError:
pass
# Real program starts here
def hash(string):
char_sum = 0
for c in string:
char_sum += ord(c)
return char_sum % 23
password_hash = 17
print("Please ent... | <commit_before><commit_msg>Set2: Add hasing on string input game<commit_after> | # This is a hack to make sure Python 2.x and 3.x behave the same
# You can ignore this bit
try:
input = raw_input
except NameError:
pass
# Real program starts here
def hash(string):
char_sum = 0
for c in string:
char_sum += ord(c)
return char_sum % 23
password_hash = 17
print("Please ent... | Set2: Add hasing on string input game# This is a hack to make sure Python 2.x and 3.x behave the same
# You can ignore this bit
try:
input = raw_input
except NameError:
pass
# Real program starts here
def hash(string):
char_sum = 0
for c in string:
char_sum += ord(c)
return char_sum % 23
... | <commit_before><commit_msg>Set2: Add hasing on string input game<commit_after># This is a hack to make sure Python 2.x and 3.x behave the same
# You can ignore this bit
try:
input = raw_input
except NameError:
pass
# Real program starts here
def hash(string):
char_sum = 0
for c in string:
char_... | |
ef4e5cd5c45735a5a82b849b7191fdb8a2a27a59 | qa/patch_profile.py | qa/patch_profile.py | import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class PatchProfileTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
def run_test(self):
al... | Add test for Profile PATCH method | Add test for Profile PATCH method
| Python | mit | cpacia/openbazaar-go,jackkleeman/openbazaar-go,gubatron/openbazaar-go,yurizhykin/openbazaar-go,OpenBazaar/openbazaar-go,JustinDrake/openbazaar-go,jackkleeman/openbazaar-go,cpacia/openbazaar-go,gubatron/openbazaar-go,gubatron/openbazaar-go,duomarket/openbazaar-test-nodes,yurizhykin/openbazaar-go,hoffmabc/openbazaar-go,O... | Add test for Profile PATCH method | import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class PatchProfileTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
def run_test(self):
al... | <commit_before><commit_msg>Add test for Profile PATCH method<commit_after> | import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class PatchProfileTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
def run_test(self):
al... | Add test for Profile PATCH methodimport requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class PatchProfileTest(OpenBazaarTestFramework):
def __init__(self):
super().__init__()
self.num_nodes = 1
... | <commit_before><commit_msg>Add test for Profile PATCH method<commit_after>import requests
import json
import time
from collections import OrderedDict
from test_framework.test_framework import OpenBazaarTestFramework, TestFailure
class PatchProfileTest(OpenBazaarTestFramework):
def __init__(self):
super()... | |
1af0151c960e084aa3d970e32af396c855e2f90a | mccurse/cli.py | mccurse/cli.py | """Command line interface to the package."""
import curses
from logging import ERROR, INFO
import click
from . import _, log
from .curse import Game
from .util import default_data_dir
@click.group()
@click.version_option()
@click.option('--refresh', is_flag=True, default=False,
help=_('Force refresh ... | Implement common group setup for CLI | Implement common group setup for CLI
| Python | agpl-3.0 | khardix/mccurse | Implement common group setup for CLI | """Command line interface to the package."""
import curses
from logging import ERROR, INFO
import click
from . import _, log
from .curse import Game
from .util import default_data_dir
@click.group()
@click.version_option()
@click.option('--refresh', is_flag=True, default=False,
help=_('Force refresh ... | <commit_before><commit_msg>Implement common group setup for CLI<commit_after> | """Command line interface to the package."""
import curses
from logging import ERROR, INFO
import click
from . import _, log
from .curse import Game
from .util import default_data_dir
@click.group()
@click.version_option()
@click.option('--refresh', is_flag=True, default=False,
help=_('Force refresh ... | Implement common group setup for CLI"""Command line interface to the package."""
import curses
from logging import ERROR, INFO
import click
from . import _, log
from .curse import Game
from .util import default_data_dir
@click.group()
@click.version_option()
@click.option('--refresh', is_flag=True, default=False,
... | <commit_before><commit_msg>Implement common group setup for CLI<commit_after>"""Command line interface to the package."""
import curses
from logging import ERROR, INFO
import click
from . import _, log
from .curse import Game
from .util import default_data_dir
@click.group()
@click.version_option()
@click.option('... | |
ae0ee6834feaefb77d8f6776b62c0d1b4621c84b | byceps/util/sentry.py | byceps/util/sentry.py | """
byceps.util.sentry
~~~~~~~~~~~~~~~~~~
Sentry_ integration
.. _Sentry: https://sentry.io/
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import Flask
def configure_sentry_for_webapp(dsn: str, environment: str, app: Flask) -> None:
"""Initialize an... | Add utilities to integrate with Sentry | Add utilities to integrate with Sentry
| Python | bsd-3-clause | homeworkprod/byceps,homeworkprod/byceps,homeworkprod/byceps | Add utilities to integrate with Sentry | """
byceps.util.sentry
~~~~~~~~~~~~~~~~~~
Sentry_ integration
.. _Sentry: https://sentry.io/
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import Flask
def configure_sentry_for_webapp(dsn: str, environment: str, app: Flask) -> None:
"""Initialize an... | <commit_before><commit_msg>Add utilities to integrate with Sentry<commit_after> | """
byceps.util.sentry
~~~~~~~~~~~~~~~~~~
Sentry_ integration
.. _Sentry: https://sentry.io/
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import Flask
def configure_sentry_for_webapp(dsn: str, environment: str, app: Flask) -> None:
"""Initialize an... | Add utilities to integrate with Sentry"""
byceps.util.sentry
~~~~~~~~~~~~~~~~~~
Sentry_ integration
.. _Sentry: https://sentry.io/
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import Flask
def configure_sentry_for_webapp(dsn: str, environment: str, app... | <commit_before><commit_msg>Add utilities to integrate with Sentry<commit_after>"""
byceps.util.sentry
~~~~~~~~~~~~~~~~~~
Sentry_ integration
.. _Sentry: https://sentry.io/
:Copyright: 2006-2020 Jochen Kupperschmidt
:License: Modified BSD, see LICENSE for details.
"""
from flask import Flask
def configure_sentry_f... | |
43d5c85a1b91719cabbc4a92bfd65feceb6cedfc | py/random-pick-index.py | py/random-pick-index.py | from random import random
class Solution(object):
def __init__(self, nums):
"""
:type nums: List[int]
:type numsSize: int
"""
self.nums = nums
def pick(self, target):
"""
:type target: int
:rtype: int
"""
meet = 0
choice =... | Add py solution for 398. Random Pick Index | Add py solution for 398. Random Pick Index
398. Random Pick Index: https://leetcode.com/problems/random-pick-index/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 398. Random Pick Index
398. Random Pick Index: https://leetcode.com/problems/random-pick-index/ | from random import random
class Solution(object):
def __init__(self, nums):
"""
:type nums: List[int]
:type numsSize: int
"""
self.nums = nums
def pick(self, target):
"""
:type target: int
:rtype: int
"""
meet = 0
choice =... | <commit_before><commit_msg>Add py solution for 398. Random Pick Index
398. Random Pick Index: https://leetcode.com/problems/random-pick-index/<commit_after> | from random import random
class Solution(object):
def __init__(self, nums):
"""
:type nums: List[int]
:type numsSize: int
"""
self.nums = nums
def pick(self, target):
"""
:type target: int
:rtype: int
"""
meet = 0
choice =... | Add py solution for 398. Random Pick Index
398. Random Pick Index: https://leetcode.com/problems/random-pick-index/from random import random
class Solution(object):
def __init__(self, nums):
"""
:type nums: List[int]
:type numsSize: int
"""
self.nums = nums
def pick(se... | <commit_before><commit_msg>Add py solution for 398. Random Pick Index
398. Random Pick Index: https://leetcode.com/problems/random-pick-index/<commit_after>from random import random
class Solution(object):
def __init__(self, nums):
"""
:type nums: List[int]
:type numsSize: int
"""
... | |
fbc96cdd95a007bf0c1f6c7439113e8f41cef876 | py/range-addition-ii.py | py/range-addition-ii.py | from operator import itemgetter
class Solution(object):
def maxCount(self, m, n, ops):
"""
:type m: int
:type n: int
:type ops: List[List[int]]
:rtype: int
"""
if not ops:
return m * n
return min(map(itemgetter(0), ops)) * min(map(itemgette... | Add py solution for 598. Range Addition II | Add py solution for 598. Range Addition II
598. Range Addition II: https://leetcode.com/problems/range-addition-ii/
| Python | apache-2.0 | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | Add py solution for 598. Range Addition II
598. Range Addition II: https://leetcode.com/problems/range-addition-ii/ | from operator import itemgetter
class Solution(object):
def maxCount(self, m, n, ops):
"""
:type m: int
:type n: int
:type ops: List[List[int]]
:rtype: int
"""
if not ops:
return m * n
return min(map(itemgetter(0), ops)) * min(map(itemgette... | <commit_before><commit_msg>Add py solution for 598. Range Addition II
598. Range Addition II: https://leetcode.com/problems/range-addition-ii/<commit_after> | from operator import itemgetter
class Solution(object):
def maxCount(self, m, n, ops):
"""
:type m: int
:type n: int
:type ops: List[List[int]]
:rtype: int
"""
if not ops:
return m * n
return min(map(itemgetter(0), ops)) * min(map(itemgette... | Add py solution for 598. Range Addition II
598. Range Addition II: https://leetcode.com/problems/range-addition-ii/from operator import itemgetter
class Solution(object):
def maxCount(self, m, n, ops):
"""
:type m: int
:type n: int
:type ops: List[List[int]]
:rtype: int
... | <commit_before><commit_msg>Add py solution for 598. Range Addition II
598. Range Addition II: https://leetcode.com/problems/range-addition-ii/<commit_after>from operator import itemgetter
class Solution(object):
def maxCount(self, m, n, ops):
"""
:type m: int
:type n: int
:type ops:... | |
a4ae7acabf37de8ef6142c7c402cd663629c4aa9 | bo5.py | bo5.py | from collections import namedtuple
import random
W = 800
H = 600
RED = 200, 0, 0
BLUE = 0, 0, 200
GREEN = 0, 200, 0
ball = Rect((W/2, H/2), (30, 30))
Direction = namedtuple('Direction', 'x y')
ball_dir = Direction(5, 5)
bat = Rect((W/2, 0.96 * H), (150, 15))
N_BLOCKS = 8
BLOCK_W = W / N_BLOCKS
BLOCK_H = BLOCK_W / 4
... | Add start of top blocks | Add start of top blocks
| Python | mit | tomviner/breakout | Add start of top blocks | from collections import namedtuple
import random
W = 800
H = 600
RED = 200, 0, 0
BLUE = 0, 0, 200
GREEN = 0, 200, 0
ball = Rect((W/2, H/2), (30, 30))
Direction = namedtuple('Direction', 'x y')
ball_dir = Direction(5, 5)
bat = Rect((W/2, 0.96 * H), (150, 15))
N_BLOCKS = 8
BLOCK_W = W / N_BLOCKS
BLOCK_H = BLOCK_W / 4
... | <commit_before><commit_msg>Add start of top blocks<commit_after> | from collections import namedtuple
import random
W = 800
H = 600
RED = 200, 0, 0
BLUE = 0, 0, 200
GREEN = 0, 200, 0
ball = Rect((W/2, H/2), (30, 30))
Direction = namedtuple('Direction', 'x y')
ball_dir = Direction(5, 5)
bat = Rect((W/2, 0.96 * H), (150, 15))
N_BLOCKS = 8
BLOCK_W = W / N_BLOCKS
BLOCK_H = BLOCK_W / 4
... | Add start of top blocksfrom collections import namedtuple
import random
W = 800
H = 600
RED = 200, 0, 0
BLUE = 0, 0, 200
GREEN = 0, 200, 0
ball = Rect((W/2, H/2), (30, 30))
Direction = namedtuple('Direction', 'x y')
ball_dir = Direction(5, 5)
bat = Rect((W/2, 0.96 * H), (150, 15))
N_BLOCKS = 8
BLOCK_W = W / N_BLOCKS... | <commit_before><commit_msg>Add start of top blocks<commit_after>from collections import namedtuple
import random
W = 800
H = 600
RED = 200, 0, 0
BLUE = 0, 0, 200
GREEN = 0, 200, 0
ball = Rect((W/2, H/2), (30, 30))
Direction = namedtuple('Direction', 'x y')
ball_dir = Direction(5, 5)
bat = Rect((W/2, 0.96 * H), (150,... | |
bab5a974c78a2b7042de449c6d3b01f9297809f1 | src/python/utexas/tools/generate_ddl.py | src/python/utexas/tools/generate_ddl.py | """
utexas/tools/generate_ddl.py
Print or apply the research data schema.
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from utexas.tools.generate_ddl import main
raise SystemExit(main())
from cargo.flags import (
Flag,
Flags,
)
module_flags = \
Flags(
... | Add a standalone DDL print/reflection tool. | Add a standalone DDL print/reflection tool.
| Python | mit | borg-project/borg | Add a standalone DDL print/reflection tool. | """
utexas/tools/generate_ddl.py
Print or apply the research data schema.
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from utexas.tools.generate_ddl import main
raise SystemExit(main())
from cargo.flags import (
Flag,
Flags,
)
module_flags = \
Flags(
... | <commit_before><commit_msg>Add a standalone DDL print/reflection tool.<commit_after> | """
utexas/tools/generate_ddl.py
Print or apply the research data schema.
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from utexas.tools.generate_ddl import main
raise SystemExit(main())
from cargo.flags import (
Flag,
Flags,
)
module_flags = \
Flags(
... | Add a standalone DDL print/reflection tool."""
utexas/tools/generate_ddl.py
Print or apply the research data schema.
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from utexas.tools.generate_ddl import main
raise SystemExit(main())
from cargo.flags import (
Flag,
Fla... | <commit_before><commit_msg>Add a standalone DDL print/reflection tool.<commit_after>"""
utexas/tools/generate_ddl.py
Print or apply the research data schema.
@author: Bryan Silverthorn <bcs@cargo-cult.org>
"""
if __name__ == "__main__":
from utexas.tools.generate_ddl import main
raise SystemExit(main())
fr... | |
f7be1ee85cc3a65c5884773995a20e12037dba4d | enqueue-repo.py | enqueue-repo.py | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
enqueues respos from stdin or from command line arguments
"""
import argparse
import re
import sys
from typing import Iterator
from sensibility.miner.connection import redis_client
from sensibility.miner.names import DOWNLOAD_QUEUE
from sensibility.miner.rqueue impo... | Make an easy thing to enqueue repos. | Make an easy thing to enqueue repos.
| Python | apache-2.0 | eddieantonio/ad-hoc-miner,eddieantonio/ad-hoc-miner,naturalness/sensibility,naturalness/sensibility,naturalness/sensibility,eddieantonio/ad-hoc-miner,naturalness/sensibility,eddieantonio/ad-hoc-miner | Make an easy thing to enqueue repos. | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
enqueues respos from stdin or from command line arguments
"""
import argparse
import re
import sys
from typing import Iterator
from sensibility.miner.connection import redis_client
from sensibility.miner.names import DOWNLOAD_QUEUE
from sensibility.miner.rqueue impo... | <commit_before><commit_msg>Make an easy thing to enqueue repos.<commit_after> | #!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
enqueues respos from stdin or from command line arguments
"""
import argparse
import re
import sys
from typing import Iterator
from sensibility.miner.connection import redis_client
from sensibility.miner.names import DOWNLOAD_QUEUE
from sensibility.miner.rqueue impo... | Make an easy thing to enqueue repos.#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
enqueues respos from stdin or from command line arguments
"""
import argparse
import re
import sys
from typing import Iterator
from sensibility.miner.connection import redis_client
from sensibility.miner.names import DOWNLOAD_QUEU... | <commit_before><commit_msg>Make an easy thing to enqueue repos.<commit_after>#!/usr/bin/env python3
# -*- coding: UTF-8 -*-
"""
enqueues respos from stdin or from command line arguments
"""
import argparse
import re
import sys
from typing import Iterator
from sensibility.miner.connection import redis_client
from sen... | |
7f0c6c94b9cfddd28f2ab124fffdb1850e966930 | setup.py | setup.py | from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),
author='Co... | from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),
author='Co... | Include package files when installing from PyPI | Include package files when installing from PyPI
| Python | bsd-3-clause | treyhunner/django-simple-history,emergence/django-simple-history,pombredanne/django-simple-history,pombredanne/django-simple-history,treyhunner/django-simple-history,luzfcb/django-simple-history,luzfcb/django-simple-history,emergence/django-simple-history | from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),
author='Co... | from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),
author='Co... | <commit_before>from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),... | from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),
author='Co... | from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),
author='Co... | <commit_before>from setuptools import setup, find_packages
setup(
name='django-simple-history',
version='1.2.2.post1',
description='Store model history and view/revert changes from admin site.',
long_description='\n'.join((
open('README.rst').read(),
open('CHANGES.rst').read(),
)),... |
b423a34696d8e3ef7587bed3eb61876abc923bbe | python/hardway/function_testing.py | python/hardway/function_testing.py | #!/usr/bin/python3
# some experiments with functions
def my_values(value1):
print ("Value of value1 in function my_values: %s" % value1)
print ("Value of value2 in function my_values: %s" % value2)
print ("==========================================================")
def my_values2(newvalue):
print ("Value of newv... | Test script with Python Functions | Test script with Python Functions
| Python | apache-2.0 | petervdb/eLearning,petervdb/eLearning,petervdb/eLearning,petervdb/eLearning,petervdb/eLearning | Test script with Python Functions | #!/usr/bin/python3
# some experiments with functions
def my_values(value1):
print ("Value of value1 in function my_values: %s" % value1)
print ("Value of value2 in function my_values: %s" % value2)
print ("==========================================================")
def my_values2(newvalue):
print ("Value of newv... | <commit_before><commit_msg>Test script with Python Functions<commit_after> | #!/usr/bin/python3
# some experiments with functions
def my_values(value1):
print ("Value of value1 in function my_values: %s" % value1)
print ("Value of value2 in function my_values: %s" % value2)
print ("==========================================================")
def my_values2(newvalue):
print ("Value of newv... | Test script with Python Functions#!/usr/bin/python3
# some experiments with functions
def my_values(value1):
print ("Value of value1 in function my_values: %s" % value1)
print ("Value of value2 in function my_values: %s" % value2)
print ("==========================================================")
def my_values2(... | <commit_before><commit_msg>Test script with Python Functions<commit_after>#!/usr/bin/python3
# some experiments with functions
def my_values(value1):
print ("Value of value1 in function my_values: %s" % value1)
print ("Value of value2 in function my_values: %s" % value2)
print ("====================================... | |
0f6913f09b61acef4e464f81558f19982f98697e | getPortfolio.py | getPortfolio.py | #!/usr/bin/env python
"""
Retrieves current list of ticker symbols that are in portfolio.
All symbols are in lower-case.
"""
#TODO: Get portfolio list from a text file.
#TODO: Handle command line parms.
import sys
def get_portfolio():
"""Return a list of ticker symbols for entire portfolio"""
# Currently t... | Make ticker symbols lower case | Make ticker symbols lower case
| Python | mit | SimonJester/portfolio | Make ticker symbols lower case | #!/usr/bin/env python
"""
Retrieves current list of ticker symbols that are in portfolio.
All symbols are in lower-case.
"""
#TODO: Get portfolio list from a text file.
#TODO: Handle command line parms.
import sys
def get_portfolio():
"""Return a list of ticker symbols for entire portfolio"""
# Currently t... | <commit_before><commit_msg>Make ticker symbols lower case<commit_after> | #!/usr/bin/env python
"""
Retrieves current list of ticker symbols that are in portfolio.
All symbols are in lower-case.
"""
#TODO: Get portfolio list from a text file.
#TODO: Handle command line parms.
import sys
def get_portfolio():
"""Return a list of ticker symbols for entire portfolio"""
# Currently t... | Make ticker symbols lower case#!/usr/bin/env python
"""
Retrieves current list of ticker symbols that are in portfolio.
All symbols are in lower-case.
"""
#TODO: Get portfolio list from a text file.
#TODO: Handle command line parms.
import sys
def get_portfolio():
"""Return a list of ticker symbols for entire ... | <commit_before><commit_msg>Make ticker symbols lower case<commit_after>#!/usr/bin/env python
"""
Retrieves current list of ticker symbols that are in portfolio.
All symbols are in lower-case.
"""
#TODO: Get portfolio list from a text file.
#TODO: Handle command line parms.
import sys
def get_portfolio():
"""Re... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.