commit stringlengths 40 40 | subject stringlengths 1 3.25k | old_file stringlengths 4 311 | new_file stringlengths 4 311 | old_contents stringlengths 0 26.3k | lang stringclasses 3
values | proba float64 0 1 | diff stringlengths 0 7.82k |
|---|---|---|---|---|---|---|---|
b6a55999cd0f6ff6a7d69b7eb59e859d415b275f | Add test.py with old-formatting test | test.py | test.py | Python | 0.000003 | @@ -0,0 +1,213 @@
+#! /usr/bin/env python%0A# -*- coding: utf-8 -*-%0A# vim:fenc=utf-8%0A#%0A# Copyright %C2%A9 2014 Martine Lenders %3Cmail@martine-lenders.eu%3E%0A#%0A# Distributed under terms of the MIT license.%0A%0A%22%25s%22 %25 %22test%22%0A%22%25d%22 %25 2%0A%22%25.4f%22 %25 2.0%0A%0A
| |
f4d26567afc9185e0f9370eda43d30084437ade5 | Solve Code Fights make array consecutive 2 problem | CodeFights/makeArrayConsecutive2.py | CodeFights/makeArrayConsecutive2.py | Python | 0.998889 | @@ -0,0 +1,708 @@
+#!/usr/local/bin/python%0A# Code Fights Make Array Consecutive 2 Problem%0A%0A%0Adef makeArrayConsecutive2(statues):%0A return (len(range(min(statues), max(statues) + 1)) - len(statues))%0A%0A%0Adef main():%0A tests = %5B%0A %5B%5B6, 2, 3, 8%5D, 3%5D,%0A %5B%5B0, 3%5D, 2%5D,%0A ... | |
06d8f4290cf433a538cef4851acefd6e42c8341d | Add simple example | examples/client.py | examples/client.py | Python | 0.000375 | @@ -0,0 +1,404 @@
+#!/usr/bin/env python%0A%0Aimport os%0Aimport sys%0A%0Asys.path.insert(0, os.path.join(os.path.dirname(__file__), '..'))%0A%0Afrom accepton import Client%0A%0AAPI_KEY = 'skey_be064297e7b2db4b6ce5928e8dcad582'%0A%0Aaccepton = Client(api_key=API_KEY, environment='development')%0Atoken = accepton.create... | |
96dd9b2968039be3fa87a30e8a16ed1c77be10bb | solve 94 | 94_BinaryTreeInorderTraversal.py | 94_BinaryTreeInorderTraversal.py | Python | 0.999999 | @@ -0,0 +1,746 @@
+# Definition for a binary tree node.%0A# class TreeNode:%0A# def __init__(self, x):%0A# self.val = x%0A# self.left = None%0A# self.right = None%0A%0Aclass Solution:%0A # @param %7BTreeNode%7D root%0A # @return %7Binteger%5B%5D%7D%0A def inorderTraversal(self, root... | |
e8c0b17bb28f1212b302959144086d72c205bf4c | store toc list in optional file to make merging easier | publisher/conf.py | publisher/conf.py | import glob
import os
work_dir = os.path.dirname(__file__)
papers_dir = os.path.join(work_dir,'../papers')
output_dir = os.path.join(work_dir,'../output')
template_dir = os.path.join(work_dir,'_templates')
static_dir = os.path.join(work_dir,'_static')
css_file = os.path.join(static_dir,'scipy-proc.... | Python | 0 | @@ -319,16 +319,67 @@
c.css')%0A
+toc_list = os.path.join(static_dir,'toc.txt')%0A
build_di
@@ -676,16 +676,119 @@
n')%0A
+if os.path.isfile(toc_list):%0A with open(toc_list) as f:%0A dirs = f.read().splitlines()%0Aelse:%0A
dirs
-
|
f046bd8982f08a31448bb5e4e10ded2a14ea95b0 | Create __init__.py | iotqatools/__init__.py | iotqatools/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
e4a33badd98c4c927c4128e22fd839f54711cfd6 | Create PedidoCadastrar.py | backend/Models/Predio/PedidoCadastrar.py | backend/Models/Predio/PedidoCadastrar.py | Python | 0 | @@ -0,0 +1,448 @@
+from Framework.Pedido import Pedido%0Afrom Framework.ErroNoHTTP import ErroNoHTTP%0A%0Aclass PedidoCadastrar(Pedido):%0A%0A%09def __init__(self,variaveis_do_ambiente):%0A%09%09super(PedidoCadastrar, self).__init__(variaveis_do_ambiente)%0A%09%09try:%0A%09%09%09self.id = self.corpo%5B'id'%5D%0A%09%09%... | |
8a911b877c5ae196ce6e4cc7e6c284b742645bc8 | Update headers strategy to mimic internal bytes representation. | test/test_invalid_headers.py | test/test_invalid_headers.py | # -*- coding: utf-8 -*-
"""
test_invalid_headers.py
~~~~~~~~~~~~~~~~~~~~~~~
This module contains tests that use invalid header blocks, and validates that
they fail appropriately.
"""
import pytest
import h2.connection
import h2.errors
import h2.events
import h2.exceptions
import h2.utilities
from hypothesis import g... | Python | 0 | @@ -352,20 +352,22 @@
import
-text
+binary
, lists,
@@ -411,20 +411,24 @@
les(
-text(), text
+binary(), binary
()))
|
82152af00c54ea94a4e8cd90d3cd5f45ef28ee86 | add missing unit test file | test/test_utils.py | test/test_utils.py | Python | 0 | @@ -0,0 +1,1042 @@
+# coding=utf-8%0Afrom __future__ import unicode_literals%0A%0Aimport os%0Aimport codecs%0A%0A%0Afrom nose.tools import eq_%0Afrom pyecharts.utils import (%0A freeze_js,%0A write_utf8_html_file,%0A get_resource_dir%0A)%0A%0A%0Adef test_get_resource_dir():%0A path = get_resource_dir('templ... | |
9c52dae7f5de64865fff51a24680c43e041376ea | Add random_subtree script | random_subtree.py | random_subtree.py | Python | 0.000001 | @@ -0,0 +1,671 @@
+#!/usr/bin/env python2%0A%0A# Use either ete2 or ete3%0Atry:%0A import ete3 as ete%0Aexcept ImportError:%0A import ete2 as ete%0A%0Aimport numpy as np%0A%0ACLI = %22%22%22%0AUSAGE:%0A random_subtree %3Ctree%3E %3Cn%3E%0A%0ASubsamples %3Cn%3E taxa from the Newick tree in %3Ctree%3E, preservin... | |
3c1e61b4b47ec244e4cadd4bf34e0a21cf1ff7e1 | Create w3_1.py | w3_1.py | w3_1.py | Python | 0.000482 | @@ -0,0 +1,13 @@
+print(%22%E7%AC%AC%E4%B8%89%E9%80%B1%22)%0A
| |
8bb9d6cbe161654126bb3aa3adecdb99ee0d9987 | Create sct4.py | sct4.py | sct4.py | Python | 0.000003 | @@ -0,0 +1,137 @@
+from mpi4py import MPI%0Acomm = MPI.COMM_WORLD%0Arank=comm.rank%0Asize=comm.size%0Aprint 'Rank:',rank%0Aprint 'Node Count:',size%0Aprint 9**(rank+3)%0A
| |
aafd823069176075b4810496ee98cea3203b5652 | Make a command to make subsets. Subsets are useful for testing during development. | build_time/src/make_subset.py | build_time/src/make_subset.py | Python | 0 | @@ -0,0 +1,2617 @@
+%22%22%22%0A Copyright 2014 Google Inc. All rights reserved.%0A%0A Licensed under the Apache License, Version 2.0 (the %22License%22);%0A you may not use this file except in compliance with the License.%0A You may obtain a copy of the License at%0A%0A http://www.apache.org/licenses/LICENSE-... | |
01f4aedac1df6f2e55c76d60c52d1e0c5ccfd9f2 | Revert "Delete test file" | tests/mock_vws/test_query.py | tests/mock_vws/test_query.py | Python | 0 | @@ -0,0 +1,2170 @@
+%22%22%22%0ATests for the mock of the query endpoint.%0A%0Ahttps://library.vuforia.com/articles/Solution/How-To-Perform-an-Image-Recognition-Query.%0A%22%22%22%0A%0Aimport io%0Afrom typing import Any, Dict%0Afrom urllib.parse import urljoin%0A%0Aimport pytest%0Aimport requests%0Afrom requests import... | |
2e330d5cd2ad033c675d5888a2f43e0f846a4df1 | Add CodeDeploy | troposphere/codedeploy.py | troposphere/codedeploy.py | Python | 0.000001 | @@ -0,0 +1,2293 @@
+# Copyright (c) 2015, Mark Peek %3Cmark@peek.org%3E%0A# All rights reserved.%0A#%0A# See LICENSE file for full license.%0A%0Afrom . import AWSObject, AWSProperty%0Afrom .validators import positive_integer%0A%0A%0AKEY_ONLY = %22KEY_ONLY%22%0AVALUE_ONLY = %22VALUE_ONLY%22%0AKEY_AND_VALUE = %22KEY_AND_... | |
0091af78bd191e34ecb621b20e79d6dd3d32ebb6 | Add unit tests for VocabularySet | tests/test_core.py | tests/test_core.py | Python | 0 | @@ -0,0 +1,2146 @@
+#!/usr/bin/env python%0Afrom __future__ import division%0A%0Afrom unittest import TestCase, main%0Afrom metasane.core import VocabularySet%0A%0Aclass VocabularySetTests(TestCase):%0A def setUp(self):%0A %22%22%22Initialize data used in the tests.%22%22%22%0A self.single_vocab = %7B'... | |
1f9240f0b954afa9f587f468872c3e1e215f2eaa | Implement channel mode +s (or what's left of it) | txircd/modules/cmode_s.py | txircd/modules/cmode_s.py | Python | 0 | @@ -0,0 +1,678 @@
+from txircd.modbase import Mode%0A%0Aclass SecretMode(Mode):%0A%09def listOutput(self, command, data):%0A%09%09if command != %22LIST%22:%0A%09%09%09return data%0A%09%09cdata = data%5B%22cdata%22%5D%0A%09%09if %22s%22 in cdata%5B%22modes%22%5D and cdata%5B%22name%22%5D not in data%5B%22user%22%5D.chan... | |
9f59cf074c4f64616bf3a31fd5c6fc649e99e4ae | Checks whether all the case-based letters of the strings are uppercase | techgig_isupper.py | techgig_isupper.py | Python | 0.999999 | @@ -0,0 +1,117 @@
+def main():%0A s=raw_input()%0A if s.isupper():%0A print %22True%22%0A else:%0A print %22False%22%0A %0A%0Amain()%0A%0A
| |
2a26fc7f0ac6223ebcb20eb1de550e899e5728db | add beginnings of script for ball identification | scripts/hist.py | scripts/hist.py | Python | 0 | @@ -0,0 +1,2214 @@
+import cv2%0Aimport numpy as np%0A%0Aframe = cv2.imread('/mnt/c/Users/T-HUNTEL/Desktop/hackathon/table3.jpg')%0Ah,w,c = frame.shape%0Aprint frame.shape%0A%0A%0A# Convert BGR to HSV%0Ahsv = cv2.cvtColor(frame, cv2.COLOR_BGR2HSV)%0A%0ABORDER_COLOR = 0%0Adef flood_fill(image, x, y, value):%0A count ... | |
6a686a800a3579970a15fa9552b2eb4e1b6b3ed9 | add some tools for ml scoring | corgi/ml.py | corgi/ml.py | Python | 0 | @@ -0,0 +1,1620 @@
+import numpy as np%0A%0Aimport pandas as pd%0Afrom scipy.stats import kendalltau, spearmanr%0Afrom sklearn.metrics import (accuracy_score, f1_score, log_loss,%0A mean_squared_error, precision_score, recall_score)%0Afrom sklearn.model_selection import StratifiedKFold%0Afro... | |
2d7d4987eb06372496ce4a5b7b961a12deba9574 | add windows-specific tests for shell_{quote,split} | tests/util_test.py | tests/util_test.py | Python | 0 | @@ -0,0 +1,1888 @@
+# Copyright 2022 Google LLC%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/licenses/LICENSE-2.0%0A#%0A# Unless required by ... | |
a6ff8a5838f82be3d5b0b4196c03fbf7c15aff7a | Test dat.info | test.py | test.py | Python | 0 | @@ -0,0 +1,346 @@
+import unittest%0Aimport requests%0A%0Aport = 'http://localhost:6461'%0A%0Adef info():%0A call = port + '/api'%0A req = requests.get(call, stream=True)%0A print(req.content)%0A return req.status_code%0A%0Aclass DatTest(unittest.TestCase):%0A%0A def test_info(self):%0A %09self.assert... | |
18df3284fd6dc176b71c41599d02a24dc021f8db | add file that is useful for testing; but will be much more useful when I figure out how to turn of debugging output in Flask. | test.py | test.py | Python | 0 | @@ -0,0 +1,390 @@
+#!/usr/bin/env python%0A%0Aimport os%0Afrom doctest import testmod, NORMALIZE_WHITESPACE, ELLIPSIS%0A%0Aimport backend, client, frontend, misc, model, session%0A%0Adef tm(module):%0A testmod(module, optionflags=NORMALIZE_WHITESPACE %7C ELLIPSIS)%0A%0Adef run_doctests():%0A tm(backend)%0A tm(... | |
ae6184a023f9a14c54663270d4a4294b8c3832f4 | Create test.py | test.py | test.py | Python | 0.000002 | @@ -0,0 +1,32 @@
+import os%0A%0Aprint(%22hello there%22)%0A
| |
9309f7190314abdd8b56368147862453d17d97b5 | Create test.py | test.py | test.py | Python | 0.000005 | @@ -0,0 +1 @@
+%0A
| |
d527bc83d44b91bb827c02907faf8cd7e7d49544 | Add dateutil gist | dateutil.py | dateutil.py | Python | 0 | @@ -0,0 +1,542 @@
+#!/usr/bin/env python%0A# -*- coding: utf-8 -*-%0A# vim:fenc=utf-8:et%0A%22%22%22Date and Time util%0A%22%22%22%0A__author__ = %5B%22Jianlong Chen %3Cjianlong99@gmail.com%3E%22%5D%0A__date__ = %222013-07-17%22%0A%0A import datetime%0A%0Adef year():%0A return datetime.datetime.strftime(datetime.dat... | |
75a61dfe788102d04e1cc3b151e839fa9add724f | Fix review requests | tools/export/cdt/__init__.py | tools/export/cdt/__init__.py | import re
from os.path import join, exists, realpath, relpath, basename
from os import makedirs
from tools.export.makefile import Makefile, GccArm, Armc5, IAR
class Eclipse(Makefile):
"""Generic Eclipse project. Intended to be subclassed by classes that
specify a type of Makefile.
"""
def generate(se... | Python | 0 | @@ -520,32 +520,21 @@
-include_paths_replace_re
+starting_dot
= re
@@ -867,46 +867,21 @@
s':
-map(lambda s: include_paths_replace_re
+%5Bstarting_dot
.sub
@@ -908,19 +908,31 @@
t_name,
-s),
+inc) for inc in
self.re
@@ -947,17 +947,17 @@
inc_dirs
-)
+%5D
,%0A
|
39fa13cf9b12f3828d4776d10532405c0ea43603 | Add an example | examples/example.py | examples/example.py | Python | 0 | @@ -0,0 +1,748 @@
+%22%22%22%0AFlow as follows:%0ACreate Service -%3E Create User -%3E Initiate Authentication -%3E Verify Pin%0A%22%22%22%0A%0Afrom messente.verigator.api import Api%0A%0Aapi = Api(%22username%22, %22password%22)%0Aservice = api.services.create(%22http://example.com%22, %22service_name%22)%0A%0Auser = ... | |
265f8c48f4b257287dd004ba783a8aa6f94bb870 | Add Latin params file | cltk/tokenize/latin/params.py | cltk/tokenize/latin/params.py | Python | 0.000001 | @@ -0,0 +1,820 @@
+%22%22%22 Params: Latin%0A%22%22%22%0A%0A__author__ = %5B'Patrick J. Burns %3Cpatrick@diyclassics.org%3E'%5D%0A__license__ = 'MIT License.'%0A%0APRAENOMINA = %5B'a', 'agr', 'ap', 'c', 'cn', 'd', 'f', 'k', 'l', %22m'%22, 'm', 'mam', 'n', 'oct', 'opet', 'p', 'post', 'pro', 'q', 's', 'ser', 'sert', 'sex... | |
0a9efede94c64d114cf536533b94a47210a90604 | Add viper.common.constants.py | viper/common/constants.py | viper/common/constants.py | Python | 0 | @@ -0,0 +1,256 @@
+# This file is part of Viper - https://github.com/botherder/viper%0A# See the file 'LICENSE' for copying permission.%0A%0Aimport os%0A%0A_current_dir = os.path.abspath(os.path.dirname(__file__))%0AVIPER_ROOT = os.path.normpath(os.path.join(_current_dir, %22..%22, %22..%22))%0A%0A
| |
2d7ea21c2d9171a79298866bf02abf64b849be0e | add a simple info cog | dog/ext/info.py | dog/ext/info.py | Python | 0 | @@ -0,0 +1,1657 @@
+from textwrap import dedent%0A%0Aimport discord%0Afrom discord.ext.commands import guild_only%0Afrom lifesaver.bot import Cog, group, Context%0Afrom lifesaver.utils import human_delta%0A%0A%0Aclass Info(Cog):%0A %22%22%22A cog that provides information about various entities like guilds or member... | |
eff85f039674ca9fe69294ca2e81644dc4ff4cb6 | add celery for all notification mail | gnowsys-ndf/gnowsys_ndf/ndf/views/tasks.py | gnowsys-ndf/gnowsys_ndf/ndf/views/tasks.py | Python | 0 | @@ -0,0 +1,1493 @@
+from celery import task%0Afrom django.contrib.auth.models import User%0Afrom django.template.loader import render_to_string%0Afrom django.contrib.sites.models import Site%0A%0Afrom gnowsys_ndf.notification import models as notification%0Afrom gnowsys_ndf.ndf.models import Node%0Afrom gnowsys_ndf.ndf... | |
f956af85b27d104e84754b4d93a761b82ae39831 | add external_iterate.py | external_iterate.py | external_iterate.py | Python | 0 | @@ -0,0 +1,2654 @@
+#!/usr/bin/env python%0A%0A%22%22%22Compile a Myrial program into logical relational algebra.%22%22%22%0A%0Aimport raco.myrial.interpreter as interpreter%0Aimport raco.myrial.parser as parser%0Aimport raco.scheme%0Afrom raco import algebra%0Afrom raco import myrialang%0Afrom raco.compile import opti... | |
9f3d384cfcab3cbfd89d231f2a59c270e743dd33 | Add Raises in the docstring of tf.histogram_fixed_width_bins | tensorflow/python/ops/histogram_ops.py | tensorflow/python/ops/histogram_ops.py | # Copyright 2015 The TensorFlow Authors. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applica... | Python | 0 | @@ -2256,16 +2256,189 @@
lues%60.%0A%0A
+ Raises:%0A TypeError: If any unsupported dtype is provided.%0A tf.errors.InvalidArgumentError: If value_range does not%0A satisfy value_range%5B0%5D %3C value_range%5B1%5D.%0A%0A
Exampl
|
9184d4cebf95ee31836970bedffaddc3bfaa2c2d | Prepare v2.20.8.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000004 | @@ -442,7 +442,11 @@
.20.
-7
+8.dev
'%0A
|
1bf65c4b18b1d803b9515f80056c4be5790e3bde | Prepare v1.2.276.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000002 | @@ -443,7 +443,11 @@
2.27
-5
+6.dev
'%0A
|
f4a4b733445abba45a0a168dde9b7c10248688a6 | Prepare v1.2.318.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000002 | @@ -443,7 +443,11 @@
2.31
-7
+8.dev
'%0A
|
860cf7b9743744c9d21796b227cf21d684fb5519 | Add test_modulepickling_change_cache_dir | test/test_cache.py | test/test_cache.py | Python | 0.000003 | @@ -0,0 +1,990 @@
+from jedi import settings%0Afrom jedi.cache import ParserCacheItem, _ModulePickling%0A%0A%0AModulePickling = _ModulePickling()%0A%0A%0Adef test_modulepickling_change_cache_dir(monkeypatch, tmpdir):%0A %22%22%22%0A ModulePickling should not save old cache when cache_directory is changed.%0A%0A ... | |
8a511662948bff2f878d5af31fd45d02eee6dd4b | MigrationHistory.applied should be NOT NULL | south/models.py | south/models.py | from django.db import models
class MigrationHistory(models.Model):
app_name = models.CharField(max_length=255)
migration = models.CharField(max_length=255)
applied = models.DateTimeField(blank=True, null=True)
class Meta:
unique_together = (('app_name', 'migration'),)
@classmethod
def... | Python | 1 | @@ -207,19 +207,8 @@
True
-, null=True
)%0A%0A
|
d082eb41c2ccef7178d228896a7658fe52bcbdec | Create directory for useless symbols remove | tests/UselessSymbolsRemove/__init__.py | tests/UselessSymbolsRemove/__init__.py | Python | 0 | @@ -0,0 +1,122 @@
+#!/usr/bin/env python%0A%22%22%22%0A:Author Patrik Valkovic%0A:Created 17.08.2017 14:38%0A:Licence GNUv3%0APart of grammpy-transforms%0A%0A%22%22%22
| |
3c82f0228095b2616b35a2881f51c93999fdd79b | Test models/FieldMapper | tests/test_models/test_field_mapper.py | tests/test_models/test_field_mapper.py | Python | 0 | @@ -0,0 +1,1859 @@
+import json%0Aimport jsonschema%0Afrom django.test import TestCase%0Afrom core.models import FieldMapper%0Afrom tests.utils import json_string%0A%0Aclass FieldMapperTestCase(TestCase):%0A @classmethod%0A def setUpTestData(cls):%0A cls.attributes = %7B%0A 'name': 'Test Field M... | |
ebe10d39064410fc49ac90e38339a54d0ed47c80 | update hooks for sqlalchemy | setup/hooks/hook-sqlalchemy.py | setup/hooks/hook-sqlalchemy.py | Python | 0 | @@ -0,0 +1,2096 @@
+__author__ = 'stephanie'%0A# Copyright (C) 2009, Giovanni Bajo%0A# Based on previous work under copyright (c) 2001, 2002 McMillan Enterprises, Inc.%0A#%0A# This program is free software; you can redistribute it and/or%0A# modify it under the terms of the GNU General Public License%0A# as published b... | |
7f8f5e14f88304b272423ab12728d5329a2ba808 | use raw strings for urls | shop/urls/cart.py | shop/urls/cart.py | from django.conf.urls.defaults import url, patterns
from shop.views.cart import CartDetails, CartItemDetail
urlpatterns = patterns('',
url(r'^delete/$', CartDetails.as_view(action='delete'), # DELETE
name='cart_delete'),
url('^item/$', CartDetails.as_view(action='post'), # POST
name='cart_i... | Python | 0.000009 | @@ -234,24 +234,25 @@
'),%0A url(
+r
'%5Eitem/$', C
@@ -487,32 +487,33 @@
rtItems%0A url(
+r
'%5Eitem/(?P%3Cid%3E%5B0
@@ -582,16 +582,17 @@
url(
+r
'%5Eitem/(
|
bb38258e4d23d5b2c39eed4e0be5b00580bada34 | Remove useless imports resulting from the merge of different branches | memopol2/main/views.py | memopol2/main/views.py | import time
from datetime import datetime
from django.http import HttpResponse, HttpResponseServerError
from django.template import RequestContext
from django.shortcuts import render_to_response, get_object_or_404
from django.utils import simplejson
from django.core import serializers
from django.conf import settings
... | Python | 0 | @@ -436,203 +436,45 @@
ol2.
-util import get_couch_doc_or_404%0Afrom memopol2.main.models import Position, Database%0Afrom memopol2 import settings # TODO check this if neccessary and not obsoleted by django.conf import settings
+main.models import Position, Database
%0A%0Ade
|
45869cdf6087cd625db385ef52475d98c9842efa | add migen_local_install script | migen_local_install.py | migen_local_install.py | Python | 0.000001 | @@ -0,0 +1,163 @@
+import os%0Aos.system(%22git clone http://github.com/m-labs/migen%22)%0Aos.system(%22mv migen migen_tmp%22)%0Aos.system(%22mv migen_tmp/migen migen%22)%0Aos.system(%22rm -rf migen_tmp%22)
| |
5f31e729ce6752c2f0a6b7f19f76c2a7e95636b9 | Create friends-of-appropriate-ages.py | Python/friends-of-appropriate-ages.py | Python/friends-of-appropriate-ages.py | Python | 0.000029 | @@ -0,0 +1,1479 @@
+# Time: O(a%5E2 + n), a is the number of ages,%0A# n is the number of people%0A# Space: O(a)%0A%0A# Some people will make friend requests.%0A# The list of their ages is given and ages%5Bi%5D is the age of the ith person.%0A#%0A# Person A will NOT friend request person B (B != A)%... | |
9caf9d3bfaaff9d7721f611d9c351dd14f67daa6 | add log progress | log_progress.py | log_progress.py | Python | 0.000001 | @@ -0,0 +1,1459 @@
+def log_progress(sequence, every=None, size=None):%0A from ipywidgets import IntProgress, HTML, VBox%0A from IPython.display import display%0A%0A is_iterator = False%0A if size is None:%0A try:%0A size = len(sequence)%0A except TypeError:%0A is_iterato... | |
d9c7ce7f2b47bee3b2e657157fe4df8f9a00973a | Create smiles_preview.py | smiles_preview.py | smiles_preview.py | Python | 0.000658 | @@ -0,0 +1,1393 @@
+import sublime%0Aimport sublime_plugin%0Aimport base64%0Aimport os%0Aimport re%0A%0Aclass SmilesPreview(sublime_plugin.EventListener):%0A def on_hover(self, view, point, hover_zone):%0A if (hover_zone == sublime.HOVER_TEXT):%0A # locate smiles in the string. smiles string should... | |
fbeb3d04b16afa0b2daf49597a07c32b0d72630c | Add missing mica.report __init__ to project | mica/report/__init__.py | mica/report/__init__.py | Python | 0.000019 | @@ -0,0 +1,33 @@
+from .report import main, update%0A
| |
dca9931e894c1e5cae9f5229b04cc72c31eef5f5 | Create a.py | a.py | a.py | Python | 0.000489 | @@ -0,0 +1,47 @@
+# this code is wrote on python%0A%0Aa = 3%0A%0Aprint a%0A
| |
2c0a06a8e460de06dd9a929baa02e2d369fbe0a6 | Prepare v2.17.4.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000003 | @@ -442,7 +442,11 @@
.17.
-3
+4.dev
'%0A
|
b815b2e94814e86ba2e4713d15aa2143594344bc | Prepare v2.13.13.dev | flexget/_version.py | flexget/_version.py | """
Current FlexGet version.
This is contained in a separate file so that it can be easily read by setup.py, and easily edited and committed by
release scripts in continuous integration. Should (almost) never be set manually.
The version should always be set to the <next release version>.dev
The jenkins release job wi... | Python | 0.000004 | @@ -439,11 +439,15 @@
'2.13.1
-2
+3.dev
'%0A
|
a30a6104554fb39d068fd8aadbb128dff1d482fb | Create dl.py | dl.py | dl.py | Python | 0 | @@ -0,0 +1,2161 @@
+#!/usr/bin/env python%0Aimport requests, urllib2, os, shutil, sys, futures%0Afrom time import sleep%0A%0Adownload_board = sys.argv%5B1%5D%0A%0Adef download(**kwargs):%0A with open('./'+download_board+'/'+kwargs%5B'filename'%5D, 'wb') as handle:%0A request = requests.get(kwargs%5B'url'%5D, ... | |
fe0d5bb1533723bc83ce37b0f10e283ef37168c4 | make sure cplot function args are mpc | mpmath/visualization.py | mpmath/visualization.py | """
Plotting (requires matplotlib)
"""
from mptypes import inf, isnan, arange, complex_types
from functions import sqrt, arg
from colorsys import hsv_to_rgb, hls_to_rgb
plot_ignore = (ValueError, ArithmeticError, ZeroDivisionError)
def plot(f, xlim=[-5,5], ylim=None, points=200, file=None):
"""
... | Python | 0.000806 | @@ -56,16 +56,21 @@
s import
+ mpc,
inf, is
@@ -4594,22 +4594,23 @@
z =
+mpc(
x%5Bm%5D
- +
+,
y%5Bn%5D
-*1j
+)
%0D%0A
|
0b90446471805276ed141800337e6044ce130b93 | Test for the bugfix of Project.last_update | akvo/rsr/tests/models/test_project.py | akvo/rsr/tests/models/test_project.py | Python | 0 | @@ -0,0 +1,1965 @@
+# -*- coding: utf-8 -*-%0A%0A# Akvo Reporting is covered by the GNU Affero General Public License.%0A# See more details in the license.txt file located at the root folder of the Akvo RSR module.%0A# For additional details on the GNU license please see %3C http://www.gnu.org/licenses/agpl.html %3E.%0... | |
30381ced0d7535428398b3df5f1caffd684b20d5 | Implement K means network. | KMeansnet.py | KMeansnet.py | Python | 0 | @@ -0,0 +1,1041 @@
+import numpy as np%0A%0Aclass Kmeansnet(object):%0A%09def __init__(self, data, clusters, eta):%0A%09%09self.data = data%0A%09%09self.n_dim = data.shape%5B1%5D%0A%09%09self.num_clusters = clusters%0A%09%09self.weights = np.random.rand(self.num_clusters, self.n_dim)%0A%09%09self.eta = eta%0A%0A%09def ... | |
e514c4e4dc295b8e7e101fc7b5ed7dfc4ad0014a | Fix layer sort key generation | nose2/plugins/layers.py | nose2/plugins/layers.py | import logging
import re
import six
from nose2 import events
from nose2.suite import LayerSuite
from nose2.compat import unittest, OrderedDict
BRIGHT = r'\033[1m'
RESET = r'\033[0m'
__unittest = True
log = logging.getLogger(__name__)
class Layers(events.Plugin):
alwaysOn = True
def startTestRun(self, ev... | Python | 0.000001 | @@ -3275,16 +3275,28 @@
if pos
+ is not None
:%0A
@@ -3317,17 +3317,17 @@
x.u(%22%2504
-f
+d
%22) %25 pos
|
b876332debd21edb3e3b84f01bb8aec5196bd8d8 | add enumerating partition | resource-4/combinatorics/integer-partitions/enumerating/partition.py | resource-4/combinatorics/integer-partitions/enumerating/partition.py | Python | 0.000044 | @@ -0,0 +1,157 @@
+#zero%0Aif n == 0:%0A%09yield %5B%5D%0A%09return%0A%0A#modify%0Afor ig in partitions(n-1):%0A%09yield %5B1%5D + ig%0Aif ig and (len(ig) %3C 2 or ig%5B1%5D %3E ig%5B0%5D):%0A%09yield %5Big%5B0%5D + 1%5D + ig%5B1:%5D%0A
| |
d9c95fcf89f0e72c3504a4988e6d4fb6ef2ae6cd | Add the timeseries neural network | src/backend/timeseries_nnet.py | src/backend/timeseries_nnet.py | Python | 0.999953 | @@ -0,0 +1,3141 @@
+# Modified code from https://github.com/hawk31/nnet-ts%0Aimport logging%0Aimport numpy as np%0Afrom keras.optimizers import SGD%0Afrom keras.models import Sequential%0Afrom keras.layers.core import Dense, Activation%0Afrom sklearn.preprocessing import StandardScaler%0A%0Alogging.basicConfig(format='... | |
fefb9a9fa5a7c6080bc52896e2d1517828b01a3d | Add all PLs to db | migrations/versions/299e1d15a55f_populate_provincial_legislatures.py | migrations/versions/299e1d15a55f_populate_provincial_legislatures.py | Python | 0 | @@ -0,0 +1,1803 @@
+%22%22%22populate-provincial-legislatures%0A%0ARevision ID: 299e1d15a55f%0ARevises: 1f97f799a477%0ACreate Date: 2018-08-20 16:17:28.919476%0A%0A%22%22%22%0A%0A# revision identifiers, used by Alembic.%0Arevision = '299e1d15a55f'%0Adown_revision = '1f97f799a477'%0A%0Afrom alembic import op%0Aimport sq... | |
253ff8bc8f848effea6ad7602b6424cf997c926c | rename celeba_multitask_acc to celeba_multilabel_acc | caffe/result/celeba_multilabel_acc.py | caffe/result/celeba_multilabel_acc.py | Python | 0.999996 | @@ -0,0 +1,856 @@
+import os%0Aimport numpy as np%0Aimport sys%0A%0Alabel_file = open('/home/hypan/data/celebA/test.txt', 'r')%0Alines = label_file.readlines()%0Alabel_file.close()%0A%0Aacc = np.zeros(40)%0Acou = 0%0A%0Afor line in lines:%0A info = line.strip('%5Cr%5Cn').split()%0A name = info%5B0%5D.split('.')%5... | |
d2e165ace4fc26b51e18494c4878f95ebcefa20a | add api | web/routers/api.py | web/routers/api.py | Python | 0 | @@ -0,0 +1,2313 @@
+# coding: utf-8%0Aimport os%0Aimport json%0Aimport time%0Aimport datetime%0A%0Aimport humanize%0Aimport flask%0Afrom flask import request, flash, redirect, url_for, render_template%0A%0Aimport models%0Aimport gcfg%0A%0Abp = flask.Blueprint('api', __name__)%0A%0A@bp.route('/')%0Adef home():%0A ret... | |
6c9760b328716d6b2e099698293c93cba9361932 | Add script for testing error reporting. | checkserver/testchecks/check_error.py | checkserver/testchecks/check_error.py | Python | 0 | @@ -0,0 +1,1008 @@
+#!/usr/bin/env python%0A# Copyright 2012 The greplin-nagios-utils Authors.%0A#%0A# Licensed under the Apache License, Version 2.0 (the %22License%22);%0A# you may not use this file except in compliance with the License.%0A# You may obtain a copy of the License at%0A#%0A# http://www.apache.org/li... | |
bc651b5ca15cf41eece321b77142c2973bd41ede | Add a sqlite config | zinnia/tests/implementations/sqlite.py | zinnia/tests/implementations/sqlite.py | Python | 0.000002 | @@ -0,0 +1,220 @@
+%22%22%22Settings for testing zinnia on SQLite%22%22%22%0Afrom zinnia.tests.implementations.settings import * # noqa%0A%0ADATABASES = %7B%0A 'default': %7B%0A 'NAME': 'zinnia.db',%0A 'ENGINE': 'django.db.backends.sqlite3'%0A %7D%0A%7D%0A
| |
b546ac87cd3e3821619a5ac7ed7806c1f569a3cd | Create PySMS.py | PySMS.py | PySMS.py | Python | 0.000001 | @@ -0,0 +1,518 @@
+# -*- coding: utf-8 -*-%0Aimport smtplib%0Afrom time import strftime%0A%0A%0A%0A# User account credentials -- (gmail username and password)%0AUSERNAME = ''%0APASSWORD = ''%0A%0A# Routing -- (FROMADDR can be null iirc)%0AFROMADDR = ''%0ATOADDRS = ''%0A%0A# Message Body%0AMESSAGE = ''%0A%0A%0Adef SendM... | |
36a8a2f52f1b85d70cda0bf399a371a4c04d0ccd | add utility script to easily launch the bottle development server | util/dev_runner.py | util/dev_runner.py | Python | 0 | @@ -0,0 +1,139 @@
+import os, dmon, bottle%0A%0Aos.chdir(os.path.abspath(os.path.join(os.path.dirname( __file__ ), '..')))%0Abottle.run(host='localhost', port=8001)
| |
2fdace2e358ede8da1a6f569b063548f8969d825 | Add supervisor config generator | util/supervisor.py | util/supervisor.py | Python | 0 | @@ -0,0 +1,2329 @@
+from util.config import Configuration%0Afrom configparser import ConfigParser%0Aimport platform%0Aimport os%0A%0A%0Aclass Supervisor:%0A __config = Configuration()%0A%0A def __init__(self):%0A self.__config_file = self.__config.get_config_dir() + '/supervisor.conf'%0A%0A def generate... | |
9c731cd17ccc853207b715b778622274b28e9efd | Create clientsocket.py | clientsocket.py | clientsocket.py | Python | 0.000002 | @@ -0,0 +1,349 @@
+%0A#!/usr/bin/env python%0A%0Aimport socket%0A%0AclientSocket = socket.socket(socket.AF_INET, socket.SOCK_STREAM) %0AclientSocket.connect((%22www.google.com%22, 80)) %0Arequest = %22GET / HTTP/1.0%5Cn%5Cn%22 %0AclientSocket.sendall(request)%0A%0Aresponse = bytearray()%0Awhile True:%0A%09part = client... | |
885ff9c8886abd30518d2cd149f37f0ba507bb71 | add 6 | 006.py | 006.py | Python | 0.999998 | @@ -0,0 +1,250 @@
+def sum_squares(l):%0A return reduce(lambda x, y: x + y**2, l)%0A%0A%0Adef square_sums(l):%0A return reduce(lambda x, y: x + y, l) ** 2%0A%0Ar = range(1, 101)%0A%0Assum = sum_squares(r)%0Assquare = square_sums(r)%0Adelta = ssquare - ssum%0A%0Aprint ssum, ssquare, delta%0A
| |
7ce57e27265d4ea7639aaf6f806b9312d17c5c5a | Create HR_pythonSwapCase.py | HR_pythonSwapCase.py | HR_pythonSwapCase.py | Python | 0.000165 | @@ -0,0 +1,61 @@
+#pythonSwapCase.py%0Adef swap_case(s):%0A return s.swapcase()%0A
| |
104ce4eb41a8d1d8307618f619dbf5336af1056d | Add CVE plugin. | plumeria/plugins/cve.py | plumeria/plugins/cve.py | Python | 0 | @@ -0,0 +1,1873 @@
+import re%0Aimport urllib.parse%0A%0Afrom plumeria.command import commands, CommandError%0Afrom plumeria.util import http%0Afrom plumeria.util.ratelimit import rate_limit%0A%0ACVE_PATTERN = re.compile(%22%5E(CVE-%5C%5Cd%7B4,5%7D-%5Cd+)$%22, re.IGNORECASE)%0A%0A%0A@commands.register(%22cve%22, catego... | |
ac7c5f51e270e48d3be9363a7c65b4b2f019c90c | Add tests for xkcd bot. | contrib_bots/bots/xkcd/test_xkcd.py | contrib_bots/bots/xkcd/test_xkcd.py | Python | 0 | @@ -0,0 +1,1855 @@
+#!/usr/bin/env python%0A%0Afrom __future__ import absolute_import%0Afrom __future__ import print_function%0A%0Aimport mock%0Aimport os%0Aimport sys%0A%0Aour_dir = os.path.dirname(os.path.abspath(__file__))%0A# For dev setups, we can find the API in the repo itself.%0Aif os.path.exists(os.path.join(o... | |
552e2381b25c9d3591e7b4bf4a4c5796744b15ba | Add demo configuration | .salt/files/demo.py | .salt/files/demo.py | Python | 0 | @@ -0,0 +1,417 @@
+from .prod import *%0A%0A%0ALEAFLET_CONFIG%5B'TILES'%5D = %5B%0A (gettext_noop('Scan'), 'http://%7Bs%7D.livembtiles.makina-corpus.net/makina/OSMTopo/%7Bz%7D/%7Bx%7D/%7By%7D.png', 'OSM Topo'),%0A (gettext_noop('Ortho'), 'https://%7Bs%7D.tiles.mapbox.com/v3/makina-corpus.i3p1001l/%7Bz%7D/%7Bx%7D/... | |
4b4bfd8d1bfb5e6db7ac5d24be526f188ceb6e68 | add payout exceptions | bluebottle/payouts_dorado/exceptions.py | bluebottle/payouts_dorado/exceptions.py | Python | 0 | @@ -0,0 +1,275 @@
+class PayoutException(Exception):%0A%0A def __init__(self, message, error_list=None):%0A self.message = message%0A self.error_list = error_list%0A%0A def __str__(self):%0A return str(self.message)%0A%0A def __unicode__(self):%0A return unicode(self.message)%0A
| |
5908d941fc113ee02b7d5962f0209a528ab9ecb1 | Add cross-site css module | core/modules/uses_stylesheet_naver.py | core/modules/uses_stylesheet_naver.py | Python | 0.000001 | @@ -0,0 +1,471 @@
+from bs4 import BeautifulSoup%0A%0A%22%22%22%0ASites that are in the Naver domain are already checked by is_masquerading. So no need to check url again%0A%22%22%22%0Adef uses_stylesheet_naver(resp):%0A print('uses_stylesheet_naver')%0A answer = %22U%22%0A%0A current_page = BeautifulSoup(resp... | |
d217ee9c830a6cccb70155ceff44746b4e5215d6 | Add missing csv migration | saleor/csv/migrations/0004_auto_20200604_0633.py | saleor/csv/migrations/0004_auto_20200604_0633.py | Python | 0.000011 | @@ -0,0 +1,1104 @@
+# Generated by Django 3.0.6 on 2020-06-04 11:33%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A (%22csv%22, %220003_auto_20200520_0247%22),%0A %5D%0A%0A operations = %5B%0A migrations.AlterField(%0A ... | |
2b86b727cd701464969de5679d30f9bea38a08f3 | Create TheDescent.py | Easy/TheDescent/TheDescent.py | Easy/TheDescent/TheDescent.py | Python | 0.000001 | @@ -0,0 +1,455 @@
+import sys%0Aimport math%0A%0Awhile True:%0A tallest_index = -1%0A tallest_height = -1%0A %0A for i in range(8):%0A mountain_h = int(input()) # represents the height of one mountain.%0A%0A if(tallest_height != -1):%0A if(mountain_h %3E tallest_height):%0A ... | |
280aa4c8db7b5580b73ab6980f10d21a6ef2d761 | Add an audio output using the pygame mixer. This abuses pygame to a fair extent, but works reasonably with large-ish buffer sizes. | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/PyGameOutput.py | Sketches/JT/Jam/library/trunk/Kamaelia/Apps/Jam/Audio/PyGameOutput.py | Python | 0 | @@ -0,0 +1,1160 @@
+import numpy%0Aimport Numeric%0Aimport pygame%0Aimport Axon%0Aimport time%0A%0Aclass PyGameOutput(Axon.ThreadedComponent.threadedcomponent):%0A bufferSize = 1024%0A sampleRate = 44100%0A def __init__(self, **argd):%0A super(PyGameOutput, self).__init__(**argd)%0A pygame.mixer.... | |
4433cadaa39dd84b922329c84a7e791d81cac7c6 | Add a very simple test that *must* always pass. * Useful for testing the newstyle API | nettests/simpletest.py | nettests/simpletest.py | Python | 0.000001 | @@ -0,0 +1,792 @@
+from ooni import nettest%0Aclass SimpleTest(nettest.TestCase):%0A inputs = range(1,100)%0A optParameters = %5B%5B'asset', 'a', None, 'Asset file'%5D,%0A %5B'controlserver', 'c', 'google.com', 'Specify the control server'%5D,%0A %5B'resume', 'r', 0, 'Resum... | |
124c4f30455d0892608622ddd09a0e7d83c3e8da | Create xmltodict_implementation.py | Useful-Libs/xmltodict_implementation.py | Useful-Libs/xmltodict_implementation.py | Python | 0.000006 | @@ -0,0 +1,334 @@
+import xmltodict%0A%0Awith open('path/to/file.xml') as fd:%0A doc = xmltodict.parse(fd.read())%0A%0A%0A doc%5B'mydocument'%5D%5B'@has'%5D # == u'an attribute'%0A doc%5B'mydocument'%5D%5B'and'%5D%5B'many'%5D # == %5Bu'elements', u'more elements'%5D%0A doc%5B'mydocument'%5D%5B'plus'%5D%5B'@... | |
bf1b53ea1b4aa93805a35ad51dd63c55c4cc31a8 | Update deprecated cgi package to urlparse and handle key=value bodies | endpoints/api_request.py | endpoints/api_request.py | # Copyright 2016 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or a... | Python | 0 | @@ -725,19 +725,8 @@
ame%0A
-import cgi%0A
impo
@@ -774,16 +774,32 @@
urllib%0A
+import urlparse%0A
import z
@@ -2469,11 +2469,16 @@
s =
-cgi
+urlparse
.par
@@ -2581,18 +2581,30 @@
n =
-json.loads
+self._process_req_body
(sel
@@ -3528,16 +3528,408 @@
False%0A%0A
+ def _process_req_body(self, body):%0A ... |
1e6956fb793e12b720b521feb4c0eeabaf490cea | add cache.py to cleanup cache | cache.py | cache.py | Python | 0.000001 | @@ -0,0 +1,891 @@
+#!/usr/bin/python%0A%0Aimport os%0Aimport time%0Afrom workflow import Workflow%0A%0A%0AAGE = 3600 * 24%0ALOG = None%0A%0Aclass Cache(object):%0A%0A def __init__(self):%0A global LOG%0A self.wf = Workflow()%0A LOG = self.wf.logger%0A self.cachedir = self.wf.cachedir%0A ... | |
25e09e4dbbc6dbc87c3b1cc2833021a9ae022a0e | Create compact/struct.py for python2/3 compatibility | pyvisa/compat/struct.py | pyvisa/compat/struct.py | Python | 0 | @@ -0,0 +1,1101 @@
+# -*- coding: utf-8 -*-%0A%22%22%22%0A pyvisa.compat.struct%0A ~~~~~~~~~~~~~~~~~~~~~~~~~%0A%0A Python 2/3 compatibility for struct module%0A%0A :copyright: 2015, PSF%0A :license: PSF License%0A%22%22%22%0A%0Afrom __future__ import division, unicode_literals, print_function, absolute_i... | |
ef8bc0ddffa142e8580606377bff1d2737365711 | add various utilities in dog.util | dog/util.py | dog/util.py | Python | 0.000251 | @@ -0,0 +1,1064 @@
+import discord%0A%0A%0Adef make_profile_embed(member):%0A embed = discord.Embed()%0A embed.set_author(name=f'%7Bmember.name%7D#%7Bmember.discriminator%7D',%0A icon_url=member.avatar_url)%0A return embed%0A%0A%0Adef american_datetime(datetime):%0A return datetime.strft... | |
595356b13c68dbd3ecd50fe4eede1b479e918056 | This is junk | django-hq/apps/transformers/junk.py | django-hq/apps/transformers/junk.py | Python | 0.999993 | @@ -0,0 +1,33 @@
+# This is a test%0D%0A# for linefeeds
| |
a7f97bbb5019b073d211c999d05b0500434d3c75 | Use six.moves.http_client instead of httplib. | oscar/test/testcases.py | oscar/test/testcases.py | from six.moves import http_client
from django.core.urlresolvers import reverse
from django.contrib.auth.models import Permission
from django_webtest import WebTest
from purl import URL
from oscar.core.compat import get_user_model
User = get_user_model()
def add_permissions(user, permissions):
"""
:param p... | Python | 0 | @@ -2498,19 +2498,23 @@
in (http
-lib
+_client
.NOT_FOU
@@ -2570,19 +2570,23 @@
http
-lib
+_client
.FORBIDD
@@ -2905,11 +2905,15 @@
http
-lib
+_client
.OK,
|
d9c197840282c6bdedf5e001a1092aa707ae139c | update email field length | corehq/apps/data_analytics/migrations/0008_auto_20161114_1903.py | corehq/apps/data_analytics/migrations/0008_auto_20161114_1903.py | Python | 0.000001 | @@ -0,0 +1,460 @@
+# -*- coding: utf-8 -*-%0A# Generated by Django 1.9.11 on 2016-11-14 19:03%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import migrations, models%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('data_analytics', '0007_auto_20160819_1423'),%0A ... | |
8ccf3d937d25ec93d1ce22d60735ffbcaf776fe3 | Add a script for plotting distance to target. | analysis/plot-target-distance.py | analysis/plot-target-distance.py | Python | 0 | @@ -0,0 +1,985 @@
+import climate%0Aimport itertools%0Aimport lmj.plot%0Aimport numpy as np%0A%0Aimport source as experiment%0Aimport plots%0A%0A%0A@climate.annotate(%0A root='plot data from this experiment subjects',%0A pattern=('plot data from files matching this pattern', 'option'),%0A markers=('plot data f... | |
d8c18d9244ca09e942af57d74a407498c25d05ce | Add Linear Discriminant Analaysis. | LDA.py | LDA.py | Python | 0.000016 | @@ -0,0 +1,1184 @@
+import numpy as np%0Afrom scipy import linalg as LA%0A%0Aclass LDA(object):%0A%09def __init__(self, data_inputs, data_labels):%0A%09%09self.data_inputs = np.array(data_inputs)%0A%09%09self.data_labels = data_labels%0A%09%09self.test_cases = self.data_inputs.shape%5B0%5D%0A%09%09self.labels = np.uniq... | |
3cc1bceaca2fe74d3d9f9fa846f976ba99cc7dee | Create RDF.py | RDF.py | RDF.py | Python | 0.000004 | @@ -0,0 +1,1991 @@
+from sys import argv%0Aimport pandas as pd%0Aimport numpy as np%0Afrom functions import crdf%0Aimport time%0Aimport accelerate as acc%0Aimport matplotlib%0Afrom matplotlib import pyplot as plt%0Afn = argv%5B1%5D%0Aprint('Box origin must be at the center!')%0Apos = pd.read_csv(fn, delim_whitespace=Tr... | |
bce02c436479adf3bf3deae22704be5cf1cace89 | set addr_list and contact_list attr #5635 | erpnext/utilities/address_and_contact.py | erpnext/utilities/address_and_contact.py | # Copyright (c) 2015, Frappe Technologies Pvt. Ltd. and Contributors
# License: GNU General Public License v3. See license.txt
from __future__ import unicode_literals
import frappe
def load_address_and_contact(doc, key):
"""Loads address list and contact list in `__onload`"""
from erpnext.utilities.doctype.address.... | Python | 0 | @@ -369,17 +369,18 @@
onload%22)
-.
+%5B%22
addr_lis
@@ -380,16 +380,18 @@
ddr_list
+%22%5D
= %5Ba.up
@@ -615,17 +615,18 @@
onload%22)
-.
+%5B%22
contact_
@@ -629,16 +629,18 @@
act_list
+%22%5D
= frapp
|
10dbbe5b10abf954ab912fc3a2cdfe1532bf71cf | test file added | cortex-py/test/test_cortex.py | cortex-py/test/test_cortex.py | Python | 0 | @@ -0,0 +1,2704 @@
+import time%0Aimport cortex%0A%0A%0Aclass MyDataHandler:%0A def __init__(self):%0A self.alldata = %5B%5D%0A %0A def MyErrorHandler(self, iLevel, msg):%0A print(%22ERROR: %22)%0A print(iLevel, msg.contents)%0A return 0%0A %0A def MyDataHandler(self, ... | |
8b257c2a4b8f949f81965b7ffaa80d18c48974a4 | add app framework | app.py | app.py | Python | 0.000003 | @@ -0,0 +1,314 @@
+import tornado.ioloop%0Aimport tornado.web%0A%0Aclass MainHandler(tornado.web.RequestHandler):%0A def get(self):%0A self.write(%22Hello, world%22)%0A%0Aapplication = tornado.web.Application(%5B%0A (r%22/%22, MainHandler),%0A%5D)%0A%0Aif __name__ == %22__main__%22:%0A application.liste... | |
e258b608c40b2abca30fbc85601e05c48558fff9 | add weird migration | webapp/calendars/migrations/0023_auto_20160109_1307.py | webapp/calendars/migrations/0023_auto_20160109_1307.py | Python | 0.000002 | @@ -0,0 +1,696 @@
+# -*- coding: utf-8 -*-%0Afrom __future__ import unicode_literals%0A%0Afrom django.db import models, migrations%0A%0A%0Aclass Migration(migrations.Migration):%0A%0A dependencies = %5B%0A ('calendars', '0022_auto_20151121_1628'),%0A %5D%0A%0A operations = %5B%0A migrations.Alter... | |
7b15ad790631926030f8b0b6c32f214f2c8001b1 | Create __init__.py | cno/boolean/__init__.py | cno/boolean/__init__.py | Python | 0.000429 | @@ -0,0 +1 @@
+%0A
| |
edf6e9ceacab9aa2d8795340089182ead07c30b3 | Add ipopt v3.12.4 package. | var/spack/repos/builtin/packages/ipopt/package.py | var/spack/repos/builtin/packages/ipopt/package.py | Python | 0 | @@ -0,0 +1,1983 @@
+from spack import *%0A%0Aclass Ipopt(Package):%0A %22%22%22Ipopt (Interior Point OPTimizer, pronounced eye-pea-Opt) is a%0A software package for large-scale nonlinear optimization.%22%22%22%0A homepage = %22https://projects.coin-or.org/Ipopt%22%0A url = %22http://www.coin-or.org/... | |
fe32ab94bbf36621fa926d565a7720b52f1d5f11 | 268. Missing Number. In-place | p268_inplace.py | p268_inplace.py | Python | 0.999999 | @@ -0,0 +1,803 @@
+import unittest%0A%0A%0Aclass Solution(object):%0A def missingNumber(self, nums):%0A %22%22%22%0A :type nums: List%5Bint%5D%0A :rtype: int%0A %22%22%22%0A n = len(nums)%0A%0A for num in nums:%0A if num == -1:%0A continue%0A%0A ... | |
533aeb6cdc045f7d4cbfc4bc20dd89da4179ab35 | Add application class to hold all the resources pertaining to an end-user application including RPC servers, HTTP servers etc. | app/core/services/application.py | app/core/services/application.py | Python | 0 | @@ -0,0 +1,1309 @@
+from threading import RLock%0Afrom uuid import uuid4%0A%0Afrom app.core.messaging import Sender%0A%0A%0Aclass Application(object):%0A APPLICATION_INFO_QUEUE = %22/_system/applications%22%0A%0A def __init__(self):%0A self.unique_id = str(uuid4())%0A self.rpc_servers = %7B%7D%0A ... | |
1df5619347b8f3e2a9fd49c95455e8b3aba07cf9 | Add example of desired new quick server usage | examples/quick_server.py | examples/quick_server.py | Python | 0 | @@ -0,0 +1,108 @@
+import hug%0A%0A%0A@hug.get()%0Adef quick():%0A return %22Serving!%22%0A%0A%0Aif __name__ == '__main__':%0A __hug__.serve()%0A
| |
ce1a080c01a5f792d128278fbb035f50e106e959 | set up general logging and twitter stream log | geotweet/log.py | geotweet/log.py | Python | 0 | @@ -0,0 +1,818 @@
+import logging%0Afrom logging.handlers import TimedRotatingFileHandler%0Aimport os%0A%0A%0ALOG_NAME = 'geotweet'%0ALOG_FILE = os.getenv('GEOTWEET_LOG', '/tmp/geotweet.log')%0ALOG_LEVEL = logging.DEBUG%0ATWITTER_LOG_NAME = 'twitter-stream'%0A%0A%0Adef get_logger():%0A logger = logging.getLogger(LOG... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.