text
stringlengths
4
1.02M
meta
dict
from __future__ import print_function import argparse import functools import os import pkg_resources import socket import ssl import sys from SocketServer import ThreadingMixIn from trac import __version__ as VERSION from trac.util import autoreload, daemon from trac.util.text import printerr from trac.web.auth impo...
{ "content_hash": "f58b191a9a60e2931e65a2cd2014b0de", "timestamp": "", "source": "github", "line_count": 369, "max_line_length": 82, "avg_line_length": 41.951219512195124, "alnum_prop": 0.524031007751938, "repo_name": "rbaumg/trac", "id": "4bf71abc08b4f7c2be931e3ff9fae84853e00765", "size": "16319", ...
""" test_keepass_dbcheck ---------------------------------- Tests for `keepass_dbcheck` module. """ import unittest from keepass_dbcheck import keepass_dbcheck class TestKeepass_dbcheck(unittest.TestCase): def setUp(self): pass def test_something(self): pass def tearDown(self): ...
{ "content_hash": "7a11c03d74f82c587986b5012ed6be1f", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 45, "avg_line_length": 15.04, "alnum_prop": 0.5797872340425532, "repo_name": "justif/keepass_dbcheck", "id": "f8c075ad5f0b1b1d522c49fc50371884c98587aa", "size": "423", "b...
''' Run things from the shell ''' import os import readline from pprint import pprint from flask import * from app import * os.environ['PYTHONINSPECT'] = 'True'
{ "content_hash": "34b107078a54ac827464c20e2bd0b587", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 36, "avg_line_length": 13.666666666666666, "alnum_prop": 0.725609756097561, "repo_name": "rfairburn/mwostatter", "id": "bac4608955ff8b8fb21e9c3fa572f368b13be32c", "size": "...
from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_resource from nssrc.com.citrix.netscaler.nitro.resource.base.base_resource import base_response from nssrc.com.citrix.netscaler.nitro.service.options import options from nssrc.com.citrix.netscaler.nitro.exception.nitro_exception import nitro_...
{ "content_hash": "26c184943817bec3f54faf3e57871c50", "timestamp": "", "source": "github", "line_count": 193, "max_line_length": 135, "avg_line_length": 24.76683937823834, "alnum_prop": 0.7035564853556485, "repo_name": "benfinke/ns_python", "id": "0224ed613be4aa6490686783bb86f179b988d8f9", "size": "...
import click import glob import sys import sh import os.path from datetime import datetime from collections import ChainMap from . import borg, util from .report import ActionSuccess, ActionFailure, report_success, report_failure, send_report def main_inner(config, source, remote, create): if create: comm...
{ "content_hash": "79adb2df2ad4d0111fa6a95f6d80f2e2", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 132, "avg_line_length": 42.1505376344086, "alnum_prop": 0.5903061224489796, "repo_name": "grensjo/borg-summon", "id": "9f2cd90839e729189aa33c025bed536ff6d7ee6c", "size": "3...
"""plistlib.py -- a tool to generate and parse MacOSX .plist files. The PropertList (.plist) file format is a simple XML pickle supporting basic object types, like dictionaries, lists, numbers and strings. Usually the top level object is a dictionary. To write out a plist file, use the writePlist(rootObject, pathOrFi...
{ "content_hash": "056b2f24ad934e7e9ca9a448652f1ff5", "timestamp": "", "source": "github", "line_count": 468, "max_line_length": 152, "avg_line_length": 32.22863247863248, "alnum_prop": 0.6139362195849632, "repo_name": "petrvanblokland/Xierpa3", "id": "0755458c0c937f472f7566f55d60917c8f2ffff6", "siz...
from setuptools import setup, find_packages setup( name='textinator', description='A command line image viewer', version='0.1.0', author='Daan Rijks', autor_email='daanrijks@gmail.com', license='MIT', packages=find_packages(), install_requires=[ 'click>=3.3, <4', 'Pil...
{ "content_hash": "247baf41105ab5b7eabe66a9c80274d7", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 46, "avg_line_length": 20.347826086956523, "alnum_prop": 0.5726495726495726, "repo_name": "ijks/textinator", "id": "34ddb2e65c7961d4c80fa3f297641eeebe3e377a", "size": "468"...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/component/droid/shared_struct_maint_module_1.iff" result.attribute_template_id = -1 result.stfName("craft_droid_ingredients_n","struct_maint_module_1") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS...
{ "content_hash": "e0bb5dc6001e64e0bc4589ac395272c0", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 85, "avg_line_length": 26.384615384615383, "alnum_prop": 0.7113702623906706, "repo_name": "obi-two/Rebelion", "id": "74d6161e0f8d5d228264c98bc6fc603c827216f2", "size": "488...
from django.conf.urls.defaults import * urlpatterns = patterns('', # Example: # (r'^mysite/', include('mysite.foo.urls')), # Uncomment this for admin: (r'^admin/', include('django.contrib.admin.urls')), )
{ "content_hash": "a209fa8dc8293cc1d892176e04fe7b41", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 56, "avg_line_length": 24.88888888888889, "alnum_prop": 0.6294642857142857, "repo_name": "bbc/kamaelia", "id": "cf6a7a1840d5519353121f6893e7974efd48f73a", "size": "1030", ...
""" Code to manage the creation and SQL rendering of 'where' constraints. """ import collections import datetime from itertools import repeat import warnings from django.conf import settings from django.db.models.fields import DateTimeField, Field from django.db.models.sql.datastructures import EmptyResultSet, Empty ...
{ "content_hash": "f31006f39fd63ceb54092c833d523321", "timestamp": "", "source": "github", "line_count": 432, "max_line_length": 107, "avg_line_length": 40.210648148148145, "alnum_prop": 0.5762477692706235, "repo_name": "errx/django", "id": "2b315be7c800b4544097404a6ee1dbdf2dc82034", "size": "17371"...
import sys import argparse import logbook from logbook import handlers from rq import Queue, Worker from redis.exceptions import ConnectionError from rq.scripts import add_standard_arguments from rq.scripts import setup_redis from rq.scripts import read_config_file from rq.scripts import setup_default_arguments from c...
{ "content_hash": "9138a8b93738e8272fbc052f4499ed13", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 132, "avg_line_length": 33.295918367346935, "alnum_prop": 0.6739197057922157, "repo_name": "wangjun/xiaohuangji", "id": "ac8b54b2e5dd88c5f91b2b978276757babcbce91", "size": ...
import os #import shutil import argparse import xml.dom.minidom import re import pprint import sys import datetime # TODO: get namespace prefixes from root element xs_prefix = 'xs:' aae_prefix = 'aae:' # ASSUMPTION: # 1) any elements from XMLSchema are using 'xs' as namespace prefix # 2) any definded types are refere...
{ "content_hash": "549cedfe4e50bbc0f237da8c95963663", "timestamp": "", "source": "github", "line_count": 361, "max_line_length": 214, "avg_line_length": 39.905817174515235, "alnum_prop": 0.5396362626683326, "repo_name": "arago/MARS-Schema", "id": "bbbf7fe1ce31d7c185021c4fd36014c94d51454b", "size": "...
r""" This paver file is intended to help with the release process as much as possible. It relies on virtualenv to generate 'bootstrap' environments as independent from the user system as possible (e.g. to make sure the sphinx doc is built against the built numpy, not an installed one). Building a fancy dmg from scratc...
{ "content_hash": "3fea761b8c9f01f929ca6c2b1fe729dc", "timestamp": "", "source": "github", "line_count": 648, "max_line_length": 101, "avg_line_length": 33.59567901234568, "alnum_prop": 0.6291226458429031, "repo_name": "tynn/numpy", "id": "0065c142b411ead82c32ed55d6f5f0f80fb3455b", "size": "21770", ...
"""This module is deprecated. Please use `airflow.providers.google.cloud.hooks.pubsub`.""" import warnings # pylint: disable=unused-import from airflow.providers.google.cloud.hooks.pubsub import PubSubException, PubSubHook # noqa warnings.warn( "This module is deprecated. Please use `airflow.providers.google.cl...
{ "content_hash": "3d065c014f81b9bf7bde1d9a211de512", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 91, "avg_line_length": 34.54545454545455, "alnum_prop": 0.7763157894736842, "repo_name": "wooga/airflow", "id": "e04f3cd6712e1c4aff807806cfc9eea52caf05c4", "size": "1167", ...
from abc import abstractmethod from aioworkers.core.base import AbstractNamedEntity class AbstractBaseStorage(AbstractNamedEntity): @abstractmethod async def raw_key(self, key): raise NotImplementedError() class AbstractStorageReadOnly(AbstractBaseStorage): @abstractmethod async def get(sel...
{ "content_hash": "06d01426f99479f07ce94a35eb72aef1", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 73, "avg_line_length": 26.626506024096386, "alnum_prop": 0.6330316742081448, "repo_name": "aioworkers/aioworkers", "id": "69a164060dea57c1688517cb44384ddb6326f452", "size":...
from flask import Flask from .config import configs from .extensions import db, api, login_manager, mail, bootstrap, debug_toolbar from . import auth, main, rest def configure_appliaction(app, config_name): """Configure the application""" if not config_name in configs.keys(): print(' * Invalid config ...
{ "content_hash": "b153c3963df6e226f4348ec6973d9e31", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 78, "avg_line_length": 28.94871794871795, "alnum_prop": 0.691762621789194, "repo_name": "hoxm/myFamily", "id": "b408681327f46ba5f398fefe7d03e6b1e2187430", "size": "1154", ...
''' pydevd - a debugging daemon This is the daemon you launch for python remote debugging. Protocol: each command has a format: id\tsequence-num\ttext id: protocol command number sequence-num: each request has a sequence number. Sequence numbers originating at the debugger are odd, sequence num...
{ "content_hash": "12ae408f9e00787d6e16ec52bfb243ab", "timestamp": "", "source": "github", "line_count": 1790, "max_line_length": 191, "avg_line_length": 42.84804469273743, "alnum_prop": 0.5118125635609794, "repo_name": "SlicerRt/SlicerDebuggingTools", "id": "0bb122b2d37a6eeb1177c15026b945b08aa1020c",...
""" Station Plot ============ Make a station plot, complete with sky cover and weather symbols. The station plot itself is pretty straightforward, but there is a bit of code to perform the data-wrangling (hopefully that situation will improve in the future). Certainly, if you have existing point data in a format you ...
{ "content_hash": "a8a402b23ce84fc3e57aa7af3dc3fae3", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 93, "avg_line_length": 43.390728476821195, "alnum_prop": 0.6292735042735043, "repo_name": "metpy/MetPy", "id": "ee839a853b33b39a636f2654c4f68624c630bf72", "size": "6695", ...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('venta', '0028_auto_20160408_1555'), ] operations = [ migrations.AddField( model_name='product', ...
{ "content_hash": "23808528a65e66263898644d7aa2d0e5", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 146, "avg_line_length": 26.526315789473685, "alnum_prop": 0.6388888888888888, "repo_name": "vpadillar/pventa", "id": "e7c6a078a683f3384b53414d5a82f335b5bf5468", "size": "57...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [("studies", "0006_study_comments")] operations = [ migrations.AlterField( model_name="study", name="comments", field=models.Tex...
{ "content_hash": "7830cc82ce09b1c514fb719f15b0d724", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 58, "avg_line_length": 22.9375, "alnum_prop": 0.6185286103542235, "repo_name": "CenterForOpenScience/lookit-api", "id": "0be17c4652d0c9b54e2c0e17d1c568a279a86258", "size": ...
import logging import os import click from platformio import fs from platformio.package.manager.library import LibraryPackageManager from platformio.package.manager.platform import PlatformPackageManager from platformio.package.manager.tool import ToolPackageManager from platformio.package.meta import PackageSpec fro...
{ "content_hash": "bfec1db5829c6c2458ad6f5473ad47b5", "timestamp": "", "source": "github", "line_count": 238, "max_line_length": 88, "avg_line_length": 34.10084033613445, "alnum_prop": 0.6232134056185313, "repo_name": "platformio/platformio", "id": "a520b7b3ffb4d6c40c3389db13c3acf6377890eb", "size":...
import os from binascii import hexlify from random import randint from unittest import TestCase from six import text_type, PY3 from six.moves import xrange from bson import dumps, loads def populate(parent, howmany, max_children): to_add = howmany if howmany > max_children: children = randint(2, max...
{ "content_hash": "222242314a388fcff45badc883062dbb", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 89, "avg_line_length": 32.391304347826086, "alnum_prop": 0.545413870246085, "repo_name": "hisery/bson", "id": "ea6acf98f6947b9290eb5503876f8e4928e86ad2", "size": "2235", ...
import sequences.sequence as seq from sequences.label_dictionary import * import pdb class _SequenceIterator(object): def __init__(self, seq): self.seq = seq self.pos = 0 def __iter__(self): return self def next(self): if self.pos >= len(self.seq): raise StopIt...
{ "content_hash": "956f1c7f9916aea20fc5ba9075b33cbd", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 102, "avg_line_length": 29.406976744186046, "alnum_prop": 0.534994068801898, "repo_name": "ronaldahmed/labor-market-demand-analysis", "id": "7e71b2035d3fe727123eadbcf72e230a2...
""" Testing suite for the Longformer tokenizer. """ import itertools import json import os import unittest from transformers import AddedToken, LongformerTokenizer, LongformerTokenizerFast from transformers.models.longformer.tokenization_longformer import VOCAB_FILES_NAMES from transformers.testing_utils import requ...
{ "content_hash": "453fbb36951f6e448bb53c694459da63", "timestamp": "", "source": "github", "line_count": 291, "max_line_length": 113, "avg_line_length": 48.491408934707906, "alnum_prop": 0.592870810006378, "repo_name": "huggingface/transformers", "id": "2397a40bafa6b1fffe695593d1716cec32670c31", "si...
""" Write a program that reads 2 numbers from sys.argv and prints their sum. Bonus: Print error messages for invalid inputs. To print error messages we'll have to use a concept not yet learned in the course, and which will only be presented later: Exceptions. We'll tap into python's error handling and change its defau...
{ "content_hash": "1c55bbafe4fe2a26e135055fb8167fcc", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 74, "avg_line_length": 37.2, "alnum_prop": 0.782258064516129, "repo_name": "ynonp/python-examples-verint-2016-07", "id": "95f24ba61b506a4b86404955d3332a4b96e6af8a", "size":...
""" Tests specific to the extended etree API Tests that apply to the general ElementTree API should go into test_elementtree """ import os.path import unittest import copy import sys import re import gc import operator import tempfile import gzip this_dir = os.path.dirname(__file__) if this_dir not in sys.path: ...
{ "content_hash": "f6427355545f9aa54001812314c5f4b1", "timestamp": "", "source": "github", "line_count": 3739, "max_line_length": 175, "avg_line_length": 35.35303557100829, "alnum_prop": 0.5249460982713621, "repo_name": "ioram7/keystone-federado-pgid2013", "id": "860aee2c0f39078ac49a5471664bf67cf57711...
from django.contrib import admin from api.models import Item admin.site.register(Item)
{ "content_hash": "a97f615f75065919b0cb2c0baaa9ffdd", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 32, "avg_line_length": 22, "alnum_prop": 0.8181818181818182, "repo_name": "ArbiterGames/instants", "id": "0988c5a1099ce8675c17ca819d7c1aec4fece732", "size": "88", "binary"...
from .base import * # noqa DEBUG_PROPAGATE_EXCEPTIONS = True SITE_ID = 1 SECRET_KEY = 'not very secret in tests' USE_I18N = True USE_L10N = True
{ "content_hash": "20b7d8bcdcb5b10c9b046f187f4f3f3b", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 39, "avg_line_length": 18.5, "alnum_prop": 0.7027027027027027, "repo_name": "toystori/v2", "id": "37976df454272aad76cb6c3db5182426e723bb4f", "size": "148", "binary": false...
import os from setuptools import setup, find_packages def read(fname): return open(os.path.join(os.path.dirname(__file__), fname)).read() setup( name = "django-macaddress", version = "1.0.0", url = 'http://github.com/tubaman/django-macaddress', license = 'BSD', description = "MAC address model...
{ "content_hash": "430d852adab2e636a368e8966b71b2fd", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 71, "avg_line_length": 30.896551724137932, "alnum_prop": 0.6116071428571429, "repo_name": "jimfunk/django-macaddress", "id": "08428ac28acff0c74b61e142947093bcef82d9f1", "si...
from django.db import models # Create your models here. class News(models.Model): title = models.CharField(max_length=255) author = models.TextField(null=True) content = models.TextField(null=True) mag = models.SmallIntegerField( db_index=True, null=True, ) date = models.DateT...
{ "content_hash": "e8e857658cf29e91a5f6767208b80b2f", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 50, "avg_line_length": 25.794117647058822, "alnum_prop": 0.6533637400228051, "repo_name": "Tooskich/python_core", "id": "5504facb7965275f2891096c5eea49ff92e77e32", "size": ...
from osc_lib.tests import utils as osc_utils from unittest import mock from saharaclient.api import cluster_templates as api_ct from saharaclient.api import clusters as api_cl from saharaclient.api import images as api_img from saharaclient.api import node_group_templates as api_ngt from saharaclient.osc.v2 import clu...
{ "content_hash": "7850eb013a4fd38a457b60c8d12310e7", "timestamp": "", "source": "github", "line_count": 534, "max_line_length": 79, "avg_line_length": 37.89325842696629, "alnum_prop": 0.5587842846553002, "repo_name": "openstack/python-saharaclient", "id": "99c07b6ed3ed4c6ad349446f626eaa3a4e25644b", ...
"""This plugin provides test results in the standard XUnit XML format. It's designed for the `Jenkins`_ (previously Hudson) continuous build system, but will probably work for anything else that understands an XUnit-formatted XML representation of test results. Add this shell command to your builder :: nosetests...
{ "content_hash": "71b5d653d510807608f8691db9d14272", "timestamp": "", "source": "github", "line_count": 329, "max_line_length": 80, "avg_line_length": 33.641337386018236, "alnum_prop": 0.56035417419588, "repo_name": "kisel/trex-core", "id": "e1ec0e1d1c3cd6c4f09703e2079c4de2d4482e9d", "size": "11068...
import gzip import math import os import re import tempfile from tempfile import TemporaryDirectory import mxnet as mx import numpy as np import pytest from sockeye import __version__ from sockeye import constants as C from sockeye import utils @pytest.mark.parametrize("some_list, expected", [ ([1, 2, 3, 4, 5, ...
{ "content_hash": "6754e6632c1fca5c32aa5a03f749b8e8", "timestamp": "", "source": "github", "line_count": 382, "max_line_length": 118, "avg_line_length": 38.69895287958115, "alnum_prop": 0.621254143272678, "repo_name": "artemsok/sockeye", "id": "caee1408f8df9d786b2ea2ca4166342bb3ec8396", "size": "153...
__author__ = 'Timo Boldt' __version__ = '1.0.0' import time import libraries.Zlib as Zlib class Server: def __init__(self, data, logger, config): # get global data self.__data = data # load configuration self.__config = config.get_config() self.__config_network = config....
{ "content_hash": "2efe033e5642952b20e3b45e7af641e5", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 72, "avg_line_length": 28.603448275862068, "alnum_prop": 0.5581675708257987, "repo_name": "vibe-x/robotic", "id": "e4ec506c633f17a7b89d4f2c795c6df1ec30c938", "size": "1659"...
import pylab from random import normalvariate, uniform def generate_data(n, generator_type): epsilon_values = [] for i in range(n): e = generator_type(0, 1) epsilon_values.append(e) return epsilon_values data = generate_data(100, uniform) pylab.plot(data, 'b-') pylab.show()
{ "content_hash": "842502ad57478bef0b7b65c18126c0fd", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 41, "avg_line_length": 22.071428571428573, "alnum_prop": 0.6634304207119741, "repo_name": "28ideas/quant-econ", "id": "f452650854e4008e035c258fb47bfa08d62ac999", "size": "3...
import re import sys import logging from pynsett.discourse import Discourse from pynsett.drt import Drs, DrsRule from pynsett.knowledge.drs_ner_cleaner import DrsNERCleaner from pynsett.metric import MetricFactory _logger = logging.getLogger(__name__) def _get_list_of_rules_from_text(text): lines =...
{ "content_hash": "ebe590c4dfeeb850fb9b0dea2e72cee6", "timestamp": "", "source": "github", "line_count": 152, "max_line_length": 115, "avg_line_length": 33.8421052631579, "alnum_prop": 0.5713452566096423, "repo_name": "fractalego/pynsett", "id": "92736d0978132d3f98d8adbf29f7be3edd18371f", "size": "5...
import unittest import asa_modules.ssh from asa_tests.mock_ssh import MockSsh asa_modules.ssh.Ssh = MockSsh from asa_lib import Asa Asa.Ssh = MockSsh class TestAsaBase(unittest.TestCase): def setUp(self): self.asa = Asa('192.168.0.1', 'john', 'uber_secure_pw', '') self.asa.login() self....
{ "content_hash": "297736bde99b3360026d2204c199412b", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 67, "avg_line_length": 25.509090909090908, "alnum_prop": 0.5880256593014968, "repo_name": "Flexin1981/AsaLib", "id": "dd4800e841c5c1652f88789f59f36d34b31061ef", "size": "14...
try: extra_coverage except NameError: print("SKIP") raise SystemExit import uerrno import uio data = extra_coverage() # test hashing of str/bytes that have an invalid hash print(data[0], data[1]) print(hash(data[0])) print(hash(data[1])) print(hash(bytes(data[0], 'utf8'))) print(hash(str(data[1], 'utf8')...
{ "content_hash": "7aa3d30a1b4e3be8b914ba82ff2f9383", "timestamp": "", "source": "github", "line_count": 74, "max_line_length": 89, "avg_line_length": 30.513513513513512, "alnum_prop": 0.7559787422497786, "repo_name": "tralamazza/micropython", "id": "13721f1f479c3f90e592253fb86d7b14b1cc0160", "size"...
""" Makes a Batch Processing Request to Document AI Creates request with full directory in Cloud Storage """ import re from typing import List from google.api_core.client_options import ClientOptions from google.cloud import documentai_v1 as documentai from google.cloud import storage PROJECT_ID = "YOUR_PROJECT_ID" ...
{ "content_hash": "06d9f8c1af8dd419ee4781caea9e3951", "timestamp": "", "source": "github", "line_count": 116, "max_line_length": 86, "avg_line_length": 34.31896551724138, "alnum_prop": 0.7548354684752575, "repo_name": "GoogleCloudPlatform/document-ai-samples", "id": "3be720563e5bae11c5471e556c53f0c946...
import json from sys import stdin print(json.dumps({ "notes": json.loads(stdin.read())["blocks"][0] }, indent = 4))
{ "content_hash": "d7c1b1c6f604770e86e6cffe7c87bd98", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 50, "avg_line_length": 20.166666666666668, "alnum_prop": 0.6528925619834711, "repo_name": "alexander-liao/hack-the-north-2017", "id": "f4cf399cae63207ab95c93c86cc0ac988edc2099...
import braintree from braintree.error_result import ErrorResult from braintree.successful_result import SuccessfulResult from braintree.exceptions.not_found_error import NotFoundError from braintree.oauth_credentials import OAuthCredentials import sys from urllib.parse import quote_plus from functools import reduce c...
{ "content_hash": "e226313f4d4aa24c1ea7d7258554ae8b", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 109, "avg_line_length": 37.732394366197184, "alnum_prop": 0.6252332960059723, "repo_name": "braintree/braintree_python", "id": "5b6b25c286ad49da95d2203ff786e34bdbc45aa7", "...
""" tests.unit.test_virtualname ~~~~~~~~~~~~~~~~~~~~ """ import importlib.util import logging import os from tests.support.runtests import RUNTIME_VARS from tests.support.unit import TestCase log = logging.getLogger(__name__) class FakeEntry: def __init__(self, name, path, is_file=True): self.n...
{ "content_hash": "dcbfa3704fd57df8113250fb4924aba3", "timestamp": "", "source": "github", "line_count": 81, "max_line_length": 90, "avg_line_length": 31.493827160493826, "alnum_prop": 0.5413563308506468, "repo_name": "saltstack/salt", "id": "031abd4e80b14976c7faf44cd4b5239db7c4910e", "size": "2551"...
from __future__ import unicode_literals import frappe, json import frappe.widgets.form.meta import frappe.widgets.form.load from frappe import _ @frappe.whitelist() def remove_attach(): """remove attachment""" import frappe.utils.file_manager fid = frappe.form_dict.get('fid') return frappe.utils.file_manager.remo...
{ "content_hash": "c17878be5934fb077b8611efced3b559", "timestamp": "", "source": "github", "line_count": 133, "max_line_length": 118, "avg_line_length": 29.270676691729324, "alnum_prop": 0.6609298741330594, "repo_name": "gangadhar-kadam/lgnlvefrape", "id": "1440671cc60c18d75cf7dac57d50d602405094dd", ...
from __future__ import unicode_literals from __future__ import absolute_import from builtins import object from unidecode import unidecode from .utils import get_html_from_dynamic_site from .utils import _get_search_url from bs4 import BeautifulSoup class CalculatorResult(object): """Represents a result returne...
{ "content_hash": "6e0fbda81c30bd58bf2c0e4e6776ae24", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 76, "avg_line_length": 25.285714285714285, "alnum_prop": 0.6366797044763146, "repo_name": "Kronosfear/BEANBot", "id": "2a10f1db7fcf9b49264aec9735fb177f5e824721", "size": "2...
import django_filters as filters from pdc.apps.common.filters import MultiValueFilter from . import models class RepoFilter(filters.FilterSet): arch = MultiValueFilter(name='variant_arch__arch__name') content_category = MultiValueFilter(name='content_category__name') content_format = MultiValueFilter(nam...
{ "content_hash": "e54f0a1a7a64e4d9e3cd9b997a774f52", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 85, "avg_line_length": 37.51724137931034, "alnum_prop": 0.6948529411764706, "repo_name": "puiterwijk/product-definition-center", "id": "820d66b2a63a1d2c0c4ff789bdaec7d71728f2...
import pandas as pd import pickle from sklearn.ensemble import RandomForestClassifier from techson_server.settings import BASE_DIR path = BASE_DIR + '/db/dataset/data.csv' train_data = pd.read_csv(path) y_train = train_data['label'] x_train = train_data.drop('label', axis=1) RFC = RandomForestClassifier(n_estimator...
{ "content_hash": "f17bf20cad9dab8c065cb0090e189e46", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 61, "avg_line_length": 24.05, "alnum_prop": 0.7318087318087318, "repo_name": "KirovVerst/techson_server", "id": "e80433109a94d8a3cc86e144a3919548faa0cbf6", "size": "481", ...
class SimpleStorlet(object): def __init__(self, logger): self.logger = logger def __call__(self, in_files, out_files, params): """ The function called for storlet invocation :param in_files: a list of StorletInputFile :param out_files: a list of StorletOutputFile ...
{ "content_hash": "6f7ffcf6c4aaf8946b93b81f01392585", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 65, "avg_line_length": 34.785714285714285, "alnum_prop": 0.5698151950718686, "repo_name": "openstack/storlets", "id": "b5b4c4c91a64ea03da809f23a255f9778bcc33d3", "size": "1...
# from winbase.h STDOUT = -11 STDERR = -12 try: import ctypes from ctypes import LibraryLoader windll = LibraryLoader(ctypes.WinDLL) from ctypes import wintypes except (AttributeError, ImportError): windll = None SetConsoleTextAttribute = lambda *_: None winapi_test = lambda *...
{ "content_hash": "2634cdb86e5e40c1704cf2c9b59f0f24", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 111, "avg_line_length": 35.52258064516129, "alnum_prop": 0.624772974936433, "repo_name": "neoscoin/neos-core", "id": "1485e69f4c7cd655017139e99cfc68f01abc2b3e", "size": "5...
""" Test using marathon on marathon (MoM). This test suite imports all common tests found in marathon_common.py which are to be tested on root marathon and MoM. In addition it contains tests which are specific to MoM environments only. """ import apps import common import pytest import retrying import scri...
{ "content_hash": "06bb7c86ca4c573bb875c57bcc756598", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 112, "avg_line_length": 33.545112781954884, "alnum_prop": 0.6600918973439426, "repo_name": "gsantovena/marathon", "id": "f2fb379fc9eb5440b2498ca093f5076e1c0b6142", "size":...
prime = 101 def pattern_matching(text, pattern): m = len(pattern) n = len(text) pattern_hash = create_hash(pattern, m - 1) text_hash = create_hash(text, m - 1) for i in range(1, n - m + 2): if pattern_hash == text_hash: if check_equal(text[i-1:i+m-1], pattern[0:]) is True: ...
{ "content_hash": "b75dc2be7d06efb0805ebeabdf93447d", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 73, "avg_line_length": 29.24, "alnum_prop": 0.5902872777017784, "repo_name": "mission-peace/interview", "id": "fa2daf37dd0ff1ec3977606b3362ae55811ce149", "size": "1598", ...
from projects.model.Tasklog import Tasklog from projects.model.Timelog import Timelog from projects.model.Date import Date from projects.model.Buglog import Buglog from projects.model.Generallog import Generallog class TimesheetsParser: """This class parses the json response for Time sheets.""" def get_task_lo...
{ "content_hash": "22f3a32d6aead19b08378b3e6ce5244f", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 86, "avg_line_length": 35.71923076923077, "alnum_prop": 0.5422633789167653, "repo_name": "zoho/projects-python-wrappers", "id": "ccbc79a526aefa1c38fea8af10aa633b547e3e2a", ...
from django.conf.urls import url from .views import welcome, prequestionnaire, preinstructions, pretask, precomparison,\ strategy, task, question, postcomparison, thanks urlpatterns = [ url(r'^$', welcome), url(r'^welcome/', welcome, name='welcome'), url(r'^prequestionnaire/', prequestionnaire, name=...
{ "content_hash": "a40963bf651bba55a262542ecbc7fa34", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 87, "avg_line_length": 45.68421052631579, "alnum_prop": 0.6728110599078341, "repo_name": "andrewhead/Search-Task-Logger", "id": "f0478aaba0556d27759e6e36a84a5c6935abdacc", ...
''' Service support for Solaris 10 and 11, should work with other systems that use SMF also. (e.g. SmartOS) .. important:: If you feel that Salt should be using this module to manage services on a minion, and it is using a different module (or gives an error similar to *'service.start' is not available*), ...
{ "content_hash": "44e197180e737d3941ca2ae966d14d2c", "timestamp": "", "source": "github", "line_count": 334, "max_line_length": 102, "avg_line_length": 24.0748502994012, "alnum_prop": 0.5942047009078473, "repo_name": "stephane-martin/salt-debian-packaging", "id": "0fb8e55f687666edc206f0cbae3965dc2ff3...
import datetime from dateutil import parser as date_parser import inspect import warnings from tinymodel.internals.field_def_validation import __substitute_class_refs from tinymodel.utils import ValidationError def __validate_field_value(tinymodel, this_field, original_value, allowed_types, value): """ A fiel...
{ "content_hash": "36ceef810d0be2edc97ddac44f26ace1", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 202, "avg_line_length": 50.51914893617021, "alnum_prop": 0.6116071428571429, "repo_name": "buzzfeed/tinymodel", "id": "70460e6a99afbd451bcb9d165410095daeb12587", "size": "...
""" Tests the `todo_export.to_html_dicts() function by generate a webpage containing their results. """ import os import unittest from datetime import datetime from pathlib import Path import prjct from prjct.todo_export import to_html_dicts class TestTodoExport(unittest.TestCase): # TODO: Add setup that remove...
{ "content_hash": "baa637801003e54592adb09aafadfb1f", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 113, "avg_line_length": 30.615384615384617, "alnum_prop": 0.5489949748743719, "repo_name": "MinchinWeb/prjct", "id": "7094df48e372b79a64dc858a15e3bcb288651d6c", "size": "16...
import cPickle from gzip import GzipFile import re import Bio.SeqIO import pandas as pd from progressbar import ProgressBar from common import ( int_or_seq, dataframe_from_counts, bad_amino_acids, fetch_file, fetch_and_transform ) BASE_URL = "ftp://ftp.ensembl.org" FTP_DIR = "/pub/release-75/fasta/homo_sapi...
{ "content_hash": "ae0e83a1cfb0eaf73864304c3683e1c7", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 79, "avg_line_length": 34.211920529801326, "alnum_prop": 0.5861401471157569, "repo_name": "cpcloud/pepdata", "id": "0b4be65f083d774f0e07f1919266e10e7657eb9a", "size": "576...
import pygame as pg from settings import * from tilemap import collide_hit_rect vec = pg.math.Vector2 class Player(pg.sprite.Sprite): def __init__(self, game, x, y): self.groups = game.all_sprites pg.sprite.Sprite.__init__(self, self.groups) self.game = game self.image = game.player...
{ "content_hash": "b2f1b36f36bbbaa14ecdd0c43704d9d2", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 90, "avg_line_length": 37.98913043478261, "alnum_prop": 0.5484978540772533, "repo_name": "kidscancode/gamedev", "id": "d830bc3d0bba189760a40cd8195d828334db1487", "size": "3...
"""Tests for random-number generation ops in the XLA JIT compiler.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import math import numpy as np from tensorflow.compiler.tests import xla_test from tensorflow.python.framework import dtypes from tensorf...
{ "content_hash": "f2a50f4ab71f6231941981c4c22c6ed6", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 79, "avg_line_length": 35.145695364238414, "alnum_prop": 0.6431128697946109, "repo_name": "jart/tensorflow", "id": "14c5e7a975e478ca6ceed37c28339b40612801c8", "size": "599...
if foo(): # <- keyword pass # <- keyword elif bar(): # <- keyword pass else: # <- keyword foo return # ^ keyword raise e # ^ keyword for i in foo(): # <- keyword # ^ variable # ^ operator # ^ function continue # <- keyword break # <- keyword a and b or c # ^ operator # ...
{ "content_hash": "1b9324a15c4ce3f1f54e6d322dffcd62", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 19, "avg_line_length": 11.733333333333333, "alnum_prop": 0.5113636363636364, "repo_name": "tree-sitter/tree-sitter-python", "id": "e80fac2241480f25db7ba1eb9c49fe580cdfdfe1", ...
import os import sys if __name__ == "__main__": os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'aps_purchasing.tests.south_settings') from django.core.management import execute_from_command_line execute_from_command_line(sys.argv)
{ "content_hash": "9c9c6d0b26bb10aaa679159dc992095f", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 64, "avg_line_length": 27.3, "alnum_prop": 0.652014652014652, "repo_name": "bitmazk/django-aps-purchasing", "id": "740633361800bbe76fcd9f0bfef764cf76619fbe", "size": "295",...
from rml2txt import parseString, parseNode """ This engine is the minimalistic renderer of RML documents into text files, using spaces and newlines to format. It was needed in some special applications, where legal reports need to be printed in special (dot-matrix) printers. """ # vim:expandtab:smartind...
{ "content_hash": "b8068ba5df4e220d2c72e46118868d83", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 78, "avg_line_length": 30.25, "alnum_prop": 0.7630853994490359, "repo_name": "diogocs1/comps", "id": "c80d8376272b56e212447fa612b6ff49086b5991", "size": "1351", "binary":...
import time import warnings import numpy as np from numpy import newaxis from keras.layers.core import Dense, Activation, Dropout from keras.layers.recurrent import LSTM from keras.models import Sequential import matplotlib.pyplot as plt warnings.filterwarnings("ignore") def plot_results_multiple(predicted_data, tru...
{ "content_hash": "17709e865fd867c0a49368458fbd7036", "timestamp": "", "source": "github", "line_count": 109, "max_line_length": 113, "avg_line_length": 33.38532110091743, "alnum_prop": 0.6507282220390217, "repo_name": "anandha2017/udacity", "id": "9e4c46328efff69ebcd897f3c8958fb766f5aa6f", "size": ...
"""Read the balance of your bank accounts via FinTS.""" from __future__ import annotations from collections import namedtuple from datetime import timedelta import logging from typing import Any from fints.client import FinTS3PinTanClient from fints.dialog import FinTSDialogError import voluptuous as vol from homeas...
{ "content_hash": "3ec23eec5ecdb2affbe4df314e60340b", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 85, "avg_line_length": 33.766949152542374, "alnum_prop": 0.6408583260133015, "repo_name": "rohitranjan1991/home-assistant", "id": "4b6cb336bdea23179b74c5123d027430035281df",...
from easyprocess import EasyProcess from image_debug import img_debug from nose.tools import eq_, with_setup from pyvirtualdisplay import Display from PIL import ImageChops import pyscreenshot from config import bbox_ls def display_size(): # http://www.cyberciti.biz/faq/how-do-i-find-out-screen-resolution-of-my-l...
{ "content_hash": "956a784009b4b166f4fb54a4e2298392", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 91, "avg_line_length": 28.666666666666668, "alnum_prop": 0.5953488372093023, "repo_name": "daodaoliang/pyscreenshot", "id": "aeb61503174add0ac6294d6a73634ab38d0ef7da", "siz...
""" Wrapper for the foodlog system This wrapper allows the foodlog cgi-bin programs to be run either by a user who is logged in (with BASIC-AUTH) or one who is not. Those programs can authorize appropriate operations (viewing and/or editing) the dieters data. This is used particularly to allow a dietit...
{ "content_hash": "ab1c5b3328221a23a0853d020759e15e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 78, "avg_line_length": 36.13636363636363, "alnum_prop": 0.7257861635220125, "repo_name": "MikeBirdsall/food-log", "id": "8510d827a5a4363c79584be60fb913868e957677", "size": ...
class DSet(object): """Disjoint set using union quick find implementation""" def __init__(self, data, getter=lambda p: p): self._map = {getter(item): i for i, item in enumerate(data)} self._index = list(range(len(data))) self._getter = getter def union(self, p, q): """Union...
{ "content_hash": "5acfcfab30f629298be06d65ff0c0b8d", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 77, "avg_line_length": 31.323529411764707, "alnum_prop": 0.5333333333333333, "repo_name": "prawn-cake/data_structures", "id": "28360032602e9e43309b9b3de21084f94551982a", "s...
import os import signal import subprocess import sys import psutil from jupyter_helpers import notebook def test_get_session(): sm = notebook.SessionManager() session = sm.get_session() session.thread.stop() process = psutil.Process(session.process.pid) for proc in process.children(recursive=True...
{ "content_hash": "ed6ef4d39cb2ed81da5b7f892b4bb47a", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 49, "avg_line_length": 21.166666666666668, "alnum_prop": 0.7139107611548556, "repo_name": "Lucaszw/jupyter-helpers", "id": "2dc0f7dce768f86f48ebb66ca51c6a5689765d5c", "size...
from __future__ import print_function import sys, os, re import contextlib @contextlib.contextmanager def cd(newpath): """ Change the current working directory to `newpath`, temporarily. If the old current working directory no longer exists, do not return back. """ oldpath = os.getcwd() os.ch...
{ "content_hash": "d865ce3b550cdbf6b3a300c24b782eec", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 88, "avg_line_length": 30.70909090909091, "alnum_prop": 0.6795441089402013, "repo_name": "NvanAdrichem/networkx", "id": "56fd48f78dd1e26d7ea5344304b0e377cf67e1f5", "size":...
class Solution: def findOcurrences(self, text: str, first: str, second: str) -> List[str]: words = text.split() result = [] for i in range(len(words) - 2): if words[i] == first and words[i + 1] == second: result.append(words[i + 2]) return result
{ "content_hash": "f60eb834a446874175e42018cd7df69e", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 78, "avg_line_length": 34.666666666666664, "alnum_prop": 0.5288461538461539, "repo_name": "jiadaizhao/LeetCode", "id": "836fbcd1c04622d217d524f966a6f83e598e2ca4", "size": "3...
"""Run the EasyInstall command""" if __name__ == '__main__': from setuptools.command.easy_install import main main()
{ "content_hash": "36551369ab8f3306ac2452f21fed89d7", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 52, "avg_line_length": 21.166666666666668, "alnum_prop": 0.6299212598425197, "repo_name": "ppyordanov/HCI_4_Future_Cities", "id": "080864cfb64911fb81fbd4a9acd06676d6e09515", ...
import sys; sys.path.insert(0, '.') import logging logging.basicConfig(level=logging.INFO) from sanic import Sanic, response from covador import item from covador.sanic import query_string, json_body, form, params, args app = Sanic() @app.route('/qs/') @query_string(boo=str) async def qs_view(request, boo): ret...
{ "content_hash": "89dc8c4743ae5abab0512cad8c20aea4", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 69, "avg_line_length": 21.566037735849058, "alnum_prop": 0.663167104111986, "repo_name": "baverman/covador", "id": "eadf6a9da7de8021276138a01e99df3b72bf67da", "size": "1143...
import sys from ged4py.parser import GedcomReader with GedcomReader(sys.argv[1]) as parser: # iterate over each FAM record in a file for i, fam in enumerate(parser.records0("FAM")): print(f"{i}:") # Get records for spouses, FAM record contains pointers to INDI # records but sub_tag kn...
{ "content_hash": "9be9a07b7bb3027fd226b35fabf73880", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 80, "avg_line_length": 38.225806451612904, "alnum_prop": 0.580590717299578, "repo_name": "andy-z/ged4py", "id": "68223ae43c5d1cc0ae971d1cb80d80bb2d43530a", "size": "1185", ...
import datetime from dateutil.parser import parse from sqlalchemy import Boolean, Integer, BigInteger, Float, Date, \ String from sqlalchemy.dialects.postgresql import TIMESTAMP, TIME NoneType = type(None) NULL_VALUES = ('na', 'n/a', 'none', 'null', '.', '', ' ') TRUE_VALUES = ('yes', 'y', 'true', 't',) FALSE_VA...
{ "content_hash": "b98d188189424ec2bda4b53189d7a044", "timestamp": "", "source": "github", "line_count": 145, "max_line_length": 94, "avg_line_length": 28.075862068965517, "alnum_prop": 0.5163350528125767, "repo_name": "tosseto/plenario", "id": "3ea2e0bcadf369927339796193fbe5ae2acff080", "size": "40...
import datetime import os from optparse import make_option from django.conf import settings from django.core.management.base import BaseCommand, CommandError from fccdata.load import importer from fccdata.models import en, am, hd from fccdata.parser import EN, AM, HD class Command(BaseCommand): option_list = Ba...
{ "content_hash": "aed631e482e5f560c703b9ad642494ac", "timestamp": "", "source": "github", "line_count": 37, "max_line_length": 125, "avg_line_length": 39.2972972972973, "alnum_prop": 0.6416781292984869, "repo_name": "adamfast/fccdata", "id": "a3e90b2a1832998ed9fc6c54323440b7a02debb5", "size": "1454...
""" Incidents template page. """ from attrs import mutable from ...page import Page __all__ = () title = "Incidents" @mutable(kw_only=True) class IncidentsTemplatePage(Page): """ Incidents template page. """ name: str = title
{ "content_hash": "0625dc741a239dc00fa65155c6eb8e3d", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 34, "avg_line_length": 11.409090909090908, "alnum_prop": 0.6294820717131474, "repo_name": "burningmantech/ranger-ims-server", "id": "dcc722cf576871f40df3ce1971c480ceeb1678ff"...
class DS18X20(object): def __init__(self, onewire): self.ow = onewire self.roms = [rom for rom in self.ow.scan() if rom[0] == 0x10 or rom[0] == 0x28] self.fp = True try: 1/1 except TypeError: self.fp = False # floatingpoint not supported def isbus...
{ "content_hash": "cec727386ff610b524965c90d3cd1f0e", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 112, "avg_line_length": 36.3, "alnum_prop": 0.512396694214876, "repo_name": "Hiverize/Sensorbeuten", "id": "e952f1fa0eb5cccf750db8d428abe5e3b58d6170", "size": "3118", "bi...
"""List and compare most used OpenStack cloud resources.""" import argparse import json import subprocess import sys from rally.cli import cliutils from rally.common import objects from rally.common.plugin import discover from rally import consts from rally import osclients class ResourceManager(object): REQU...
{ "content_hash": "275b5df513aeb027670935aab344d432", "timestamp": "", "source": "github", "line_count": 379, "max_line_length": 79, "avg_line_length": 30.522427440633244, "alnum_prop": 0.5854080221300139, "repo_name": "vganapath/rally", "id": "a0981758fe6e071243d294bfc00ba8baba85127e", "size": "121...
from wrfpy.config import config import csv import os import astral from netCDF4 import Dataset from netCDF4 import date2num import numpy as np import bisect from datetime import datetime import glob from pathos.multiprocessing import ProcessPool as Pool class readObsTemperature(config): def __init__(self, dtobj, ...
{ "content_hash": "64b0efcc3b1018ab7c6d28c3aaa4be58", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 86, "avg_line_length": 36.494623655913976, "alnum_prop": 0.5064820271066588, "repo_name": "rvanharen/wrfpy", "id": "8f5c8c6c1761f09d0148fa63efec7261b08da586", "size": "681...
from what_apps.people.factories import UserFactory from what_apps.people.models import UserProfile def setup(): rusty = UserFactory.create(password="password", first_name="rusty", last_name="spike", username="rspike") ...
{ "content_hash": "01370387bd151279c27003c96b6b9b91", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 58, "avg_line_length": 31.846153846153847, "alnum_prop": 0.5797101449275363, "repo_name": "SlashRoot/WHAT", "id": "4106b449cc8eed28c78479dd4893f0181cd60900", "size": "519",...
import json import os from flask import url_for def configure_manifest_files(app): """ Loads the manifest file and register the `url_for_asset_` template tag. :param app: :return: """ manifest = {} def parse_manifest_json(): try: manifest_file = os.path.join(os.path....
{ "content_hash": "2739e78a3cdbf39e4fa05f8439fbb3be", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 107, "avg_line_length": 32.23255813953488, "alnum_prop": 0.6219336219336219, "repo_name": "mrkm4ntr/incubator-airflow", "id": "0294fc394905d9e492854405853c5498eb62c1cd", "s...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('geokey_checklist', '0013_auto_20151101_0116'), ] operations = [ migrations.RemoveField( model_name='checklistsettings', name...
{ "content_hash": "dee169b070a0eccd1f09db4bfdb49ca2", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 202, "avg_line_length": 32.25925925925926, "alnum_prop": 0.6050516647531573, "repo_name": "ExCiteS/geokey-checklist", "id": "744d4576730237dc39db519d7b19e1916bd08893", "siz...
__author__ = "Rich Smith" __version__ = "0.1" import os import ConfigParser from vmware_guest_url_opener import RegisterHandler class Uninstall(object): """ Remove VMWareGuestURLOpener """ def __init__(self, config_file = "~/.vmware_guest_url_opener.cfg"): """ """ self.config ...
{ "content_hash": "cb4fd0c7b86cede936357951b5966a12", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 176, "avg_line_length": 34.74603174603175, "alnum_prop": 0.6030150753768844, "repo_name": "MyNameIsMeerkat/VMWareGuestURLOpener", "id": "703cd01b782f84eb561eb2adacf752f11b9bc...
import sys import click from indico.cli.core import cli_group from indico.core import signals from indico.core.db import db from indico.modules.events import Event from indico.modules.events.export import export_event, import_event from indico.modules.users.models.users import User @cli_group() def cli(): pass ...
{ "content_hash": "519c91696891c816db677635ff6dd850", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 116, "avg_line_length": 41.525, "alnum_prop": 0.6773028296207104, "repo_name": "pferreir/indico", "id": "35f7f2dec5cf231d76aab0b1f9faa3c93cbc7b12", "size": "3536", "binar...
""" This module provides functions for upgrading scripts from pymel 0.9 to 1.0. It fixes two types non-compatible code: - pymel.all is now the main entry-point for loading all pymel modules - import pymel --> import pymel.all as pymel - import pymel as pm --> import pymel.all as pm ...
{ "content_hash": "40f32042cd0fb8153128f2b3b52de197", "timestamp": "", "source": "github", "line_count": 470, "max_line_length": 188, "avg_line_length": 40.0531914893617, "alnum_prop": 0.5097476759628154, "repo_name": "CountZer0/PipelineConstructionSet", "id": "18aea4879c3161544c3005608e4cd57803aab936...
"""This module holds :class:`jukeboxcore.gui.treemodel.ItemData` subclasses that represent filesys data, e.g. a :class:`jukeboxcore.filesys.TaskFileInfo` """ from PySide import QtCore from jukeboxcore.gui.treemodel import ItemData from jukeboxcore.filesys import JB_File def taskfileinfo_element_data(tfi, role): ...
{ "content_hash": "f5358d27631b34b1e441fb05a3e9dff0", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 124, "avg_line_length": 31.335483870967742, "alnum_prop": 0.6627547869054973, "repo_name": "JukeboxPipeline/jukebox-core", "id": "2ac8e48bb75ca57adace93c7b62a1bda3290775e", ...
import pathlib from qiime2 import sdk from qiime2.plugin import model def identity_transformer(view): return view class ModelType: @staticmethod def from_view_type(view_type): if issubclass(view_type, model.base.FormatBase): if issubclass(view_type, model.S...
{ "content_hash": "52baf9bd8bffdb0a1862da0f5437ad06", "timestamp": "", "source": "github", "line_count": 213, "max_line_length": 79, "avg_line_length": 33.948356807511736, "alnum_prop": 0.5848430369243535, "repo_name": "ebolyen/qiime2", "id": "791516b085ddabe5f47195dd94e61f6936280fd4", "size": "7580...
import os import re import argparse as ap import pandas as pd from selenium import webdriver from selenium.webdriver.support.ui import WebDriverWait from retrying import retry profile_folder = '/home/yangh/.mozilla/firefox/webdriver-profile' url_morningstar = ('http://financials.morningstar.com/%s.html?' ...
{ "content_hash": "c484411b40c019fc0a8ee393ffb5dda7", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 80, "avg_line_length": 31.857142857142858, "alnum_prop": 0.6437015898899306, "repo_name": "sp500/stock", "id": "3918ab1cf9b4e9583d46140d5a0267b2b8012110", "size": "4929", ...
import re import sys import pytest from _pytest.config import get_plugin_manager from _jb_runner_tools import jb_start_tests, jb_patch_separator, jb_doc_args, JB_DISABLE_BUFFERING from teamcity import pytest_plugin if __name__ == '__main__': path, targets, additional_args = jb_start_tests() sys.argv += add...
{ "content_hash": "543a740f9e4b1ec548b1b5e48fa872dd", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 106, "avg_line_length": 36.766666666666666, "alnum_prop": 0.6736174070716229, "repo_name": "FHannes/intellij-community", "id": "61f657f356c71fcbd9d42a1d17d0d5ef7566b96e", "...
import sys import os import shutil import commands import time from glob import glob import msct_qc import sct_utils as sct from sct_utils import add_suffix from sct_image import set_orientation from sct_register_multimodal import Paramreg, ParamregMultiStep, register from msct_parser import Parser from msct_image impo...
{ "content_hash": "fd8bf94baef987221276a579a7743b57", "timestamp": "", "source": "github", "line_count": 612, "max_line_length": 454, "avg_line_length": 56.25816993464052, "alnum_prop": 0.6151321521928551, "repo_name": "3324fr/spinalcordtoolbox", "id": "f1a5a41fb01438d4fcbd4baf77fdb98dd9898ecc", "si...
"""Setup file for easy installation""" from os.path import join, dirname from setuptools import setup version = '1.0b' LONG_DESCRIPTION = """ Smarter declarative style generic views for Django. """ def long_description(): """Return long description from README.rst if it's present because it doesn't get insta...
{ "content_hash": "0e0ac63380088a3d1fa4ab88a9acfa95", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 72, "avg_line_length": 36.86842105263158, "alnum_prop": 0.6102783725910065, "repo_name": "pombredanne/django-smarter", "id": "3b05510f67c57a7a39642a5c630ca3fbb7324662", "si...
"""Experimental module defining classes used in Pikov animations.""" from .core import GuidNode from .properties import StringProperty from . import guids class SemanticGraphNode(GuidNode): """I want all nodes to have an (optional) name property, so define the node class after we've defined the property clas...
{ "content_hash": "be4cf8c8b8375bd96518bb62c983a335", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 74, "avg_line_length": 27.85185185185185, "alnum_prop": 0.6582446808510638, "repo_name": "google/pikov", "id": "a85d863d5bd9033fca1aee35465ebd647e0fabb5", "size": "1328", ...
from django.shortcuts import render_to_response from django.http import HttpResponseRedirect from django.template import RequestContext from django.contrib.auth import authenticate, logout, login from django.contrib.auth.models import User from django.contrib.auth.decorators import login_required from django.core.urlre...
{ "content_hash": "f35d5f3bfa1f0a16ac5e111333bfc98c", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 103, "avg_line_length": 39.578947368421055, "alnum_prop": 0.6246200607902735, "repo_name": "pocketone/django-shoppy", "id": "ef85764b76b0feb432fdbc64afad95fbfdee6015", "si...
from user_info import get_user_info def check_status(self): self.is_self_checking = True self.is_checked = False while self.is_checked != True: get_user_info(self, self.user_login) self.like_counter = 0 self.follow_counter = 0 self.unfollow_counter = 0
{ "content_hash": "4e0a10e36485f7d3568d7177faa9687f", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 44, "avg_line_length": 26.09090909090909, "alnum_prop": 0.6655052264808362, "repo_name": "Cartman2490/InstaBot", "id": "4ceb66f103bb2b135e072d947bb53843fa735b15", "size": "...
""" Defines the basic Container class """ from contextlib import contextmanager from enable.base import empty_rectangle, intersect_bounds from enable.events import MouseEvent from kiva import affine from traits.api import Instance, List, Property from .component import Component class Container(Component): """ ...
{ "content_hash": "a1861497bf496abfba7713ae69fa3159", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 79, "avg_line_length": 36.76300578034682, "alnum_prop": 0.5424528301886793, "repo_name": "tonysyu/deli", "id": "91e79d5ee415ee1bd2c1fc14b51e8125b1b95c40", "size": "6360", ...
from formencode.htmlrename import rename, add_prefix def test_rename(): assert (rename('<input type="text" name="a_name">', lambda name: name.upper()) == '<input type="text" name="A_NAME">') assert (add_prefix('<input type="text" name="a_name"><input type="text" name="">', 'test', dotted=True) ...
{ "content_hash": "2051e4132e08057c9c498280e1de6ff5", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 107, "avg_line_length": 61.92307692307692, "alnum_prop": 0.5987577639751552, "repo_name": "grepme/CMPUT410Lab01", "id": "86a6f92dc917186d5a84736ee7a93c92f8c80605", "size": ...
import pickle from os import error import numpy as np import numbers import warnings from scipy import signal import astropy.modeling.models from stingray import utils from stingray import Lightcurve from stingray import AveragedPowerspectrum __all__ = ['Simulator'] class Simulator(object): """ Methods to si...
{ "content_hash": "e95232bbbca7bd738f497d78a7f5b3b2", "timestamp": "", "source": "github", "line_count": 632, "max_line_length": 91, "avg_line_length": 30.72151898734177, "alnum_prop": 0.5488257107540173, "repo_name": "StingraySoftware/stingray", "id": "3f98719e04eedcff490877ccc148949374f30981", "si...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('d4s2_api', '0022_auto_20180417_1951'), ] operations = [ migrations.AddField( model_name='s3endpoint', name='name', ...
{ "content_hash": "1e2a6680677f12fb1db747b6232a50ef", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 126, "avg_line_length": 25.842105263157894, "alnum_prop": 0.6109979633401222, "repo_name": "Duke-GCB/DukeDSHandoverService", "id": "1440e946db123e29123af0579d617963c539f178",...
from django.contrib import admin from django.forms.widgets import TextInput from django_google_maps.widgets import GoogleMapsAddressWidget from django_google_maps.fields import AddressField, GeoLocationField from sample import models class SampleModelAdmin(admin.ModelAdmin): formfield_overrides = { Addr...
{ "content_hash": "710d8a9000b5e5e9d772388f2281b168", "timestamp": "", "source": "github", "line_count": 23, "max_line_length": 68, "avg_line_length": 25.565217391304348, "alnum_prop": 0.6802721088435374, "repo_name": "madisona/django-google-maps", "id": "d6278220faff3b8786952a3b86fc3282c5cd93b5", "...
from django.conf.urls.defaults import * from django.conf import settings # Uncomment the next two lines to enable the admin: # from django.contrib import admin # admin.autodiscover() urlpatterns = patterns('', (r'^$', 'upload.views.index'), (r'^convert', 'upload.views.convert'), (r'^upload', 'upload.views.upload'), (...
{ "content_hash": "7e855e0fc3163d476f16e1d68111dc27", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 121, "avg_line_length": 34.07692307692308, "alnum_prop": 0.7042889390519187, "repo_name": "jvanveen/ppt2os", "id": "b7398d06fd370c8a94594536cf556a08c34861ef", "size": "443"...
import collections class Solution(object): def replaceWords(self, dictionary, sentence): """ :type dictionary: List[str] :type sentence: str :rtype: str """ _trie = lambda: collections.defaultdict(_trie) trie = _trie() for word in dictionary: ...
{ "content_hash": "661952dadcc57f7a61188b79150c9152", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 67, "avg_line_length": 27.653846153846153, "alnum_prop": 0.48956884561891517, "repo_name": "tudennis/LeetCode---kamyu104-11-24-2015", "id": "662f8ec0fd7983947a60540a1e97ef3dc...