text
stringlengths
4
1.02M
meta
dict
import subprocess from os import devnull from os.path import join # from os import mkdir import sys #from re import sub from sympy import Symbol, sympify, nsimplify, fraction, S from sympy.matrices import Matrix, diag, NonSquareMatrixError from .ccobjects import CCBase, CCoef from ...utils.misc import DotDict from ...u...
{ "content_hash": "dd219e01f409f9d9ee64a3b8ffa2ca52", "timestamp": "", "source": "github", "line_count": 684, "max_line_length": 101, "avg_line_length": 33.48684210526316, "alnum_prop": 0.5166120934293822, "repo_name": "exe0cdc/PyscesToolbox", "id": "fded7f642d3354efaf91401f2bb98357b2c2774b", "size"...
""" Associates products to each other for upselling purposes. """ from datetime import date from django.conf import settings from django.db import models from django.utils.translation import get_language, gettext_lazy as _ from django.utils.translation import ugettext, ugettext_lazy as _ from satchmo import caching fr...
{ "content_hash": "cc8434ebb5ccc43532b842e35e4e264e", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 97, "avg_line_length": 33.474074074074075, "alnum_prop": 0.6085417127683116, "repo_name": "sankroh/satchmo", "id": "8c21fffb111c927cf6dd913b70abf3d93551b951", "size": "451...
from __future__ import absolute_import import ujson from typing import Any, Mapping, List from six import string_types from zerver.lib.emoji import emoji_name_to_emoji_code from zerver.lib.request import JsonableError from zerver.lib.test_helpers import tornado_redirected_to_list, get_display_recipient, \ get_tes...
{ "content_hash": "71e091aeaaa4cd756278b9a66ddba1ff", "timestamp": "", "source": "github", "line_count": 345, "max_line_length": 101, "avg_line_length": 42.35072463768116, "alnum_prop": 0.5678598316337007, "repo_name": "verma-varsha/zulip", "id": "67a5dbfd6a7665edf59599af5b97d7c03eee6f8f", "size": "...
import datetime from tempest.api.compute import base from tempest.lib.common.utils import test_utils from tempest.lib import decorators from tempest.lib import exceptions as e # Time that waits for until returning valid response # TODO(takmatsu): Ideally this value would come from configuration. VALID_WAIT = 30 cla...
{ "content_hash": "062f5a74054fabbbb734346392067ae9", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 77, "avg_line_length": 39.21052631578947, "alnum_prop": 0.6473154362416107, "repo_name": "Juniper/tempest", "id": "d4c60b349ed62b3c6dd41c698bfc6a76c56c6fe8", "size": "3611"...
from __future__ import (absolute_import, division, print_function, unicode_literals) import six from collections import defaultdict from .util import mapping_mixin from .. import QtCore, QtGui import logging logger = logging.getLogger(__name__) _defaults = { "check_box_hover_text": "Enable...
{ "content_hash": "c085ca09f6c1f6c6d98937969cf29da3", "timestamp": "", "source": "github", "line_count": 674, "max_line_length": 83, "avg_line_length": 31.5459940652819, "alnum_prop": 0.5923243344934626, "repo_name": "giltis/xray-vision", "id": "551706122c1076edc7a5577decddd1e51d2f5cfb", "size": "23...
from django.contrib import admin # PROJECT IMPORTS from grappelli.tests.models import Category, Entry site = admin.AdminSite(name="Admin Site") class CategoryOptions(admin.ModelAdmin): list_display = ("id", "name",) list_display_links = ("name",) class EntryOptions(admin.ModelAdmin): list_display = ("...
{ "content_hash": "86728d3c36451ce273af288e47ffd604", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 60, "avg_line_length": 25.846153846153847, "alnum_prop": 0.6875, "repo_name": "lz1988/django-web2015", "id": "10716f1ae8aa37b1d9700a2adc05a48d692a3f81", "size": "706", "b...
import unittest from collections import namedtuple import mock from stacker import exceptions from stacker.actions import build from stacker.actions.build import resolve_parameters from stacker.context import Context from stacker.exceptions import StackDidNotChange from stacker.providers.base import BaseProvider from...
{ "content_hash": "c0aacff5d3a715358c1a3f316e9d7c4a", "timestamp": "", "source": "github", "line_count": 365, "max_line_length": 79, "avg_line_length": 38.50684931506849, "alnum_prop": 0.5657061543934543, "repo_name": "mhahn/stacker", "id": "6ca4d375ac6a5f7e6bbc8494801313d76497d698", "size": "14055"...
""" Internal implementation of request Body validating middleware. """ import base64 import re import jsonschema from jsonschema import exceptions as jsonschema_exc import netaddr from oslo_utils import timeutils from oslo_utils import uuidutils import rfc3986 import six from nova.api.validation import parameter_ty...
{ "content_hash": "8c0f3b19aa8753cdb54162425ded7733", "timestamp": "", "source": "github", "line_count": 284, "max_line_length": 79, "avg_line_length": 35.74295774647887, "alnum_prop": 0.6301842183036154, "repo_name": "BeyondTheClouds/nova", "id": "392689d114900df3d43ed81a06799e59fc9bb859", "size": ...
import sys import pyeapi import ssl import re def re_in_list(regex,list): for l in list: m = re.match('(%s*)' %regex, l) if m: return l return None def main(): opcodes = [ '--name', '--remove' ] opcode=sys.argv.pop(1) if not opcode in opcodes: ...
{ "content_hash": "2160e3d860a6c834621dfaf6c768e71d", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 70, "avg_line_length": 28.380281690140844, "alnum_prop": 0.5508684863523573, "repo_name": "patrebert/pynet_cert", "id": "9b58e39c2fa330c321486644745bd8ac9f6d379b", "size": ...
"""Utilities for probability distributions.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import hashlib import numpy as np from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensor...
{ "content_hash": "b059481f31791339be308f734090d746", "timestamp": "", "source": "github", "line_count": 1168, "max_line_length": 85, "avg_line_length": 38.87071917808219, "alnum_prop": 0.6316821215391731, "repo_name": "benoitsteiner/tensorflow-opencl", "id": "41b86f79409aef76dbd710606d09b21f34cab7ba"...
from temboo.core.choreography import Choreography from temboo.core.choreography import InputSet from temboo.core.choreography import ResultSet from temboo.core.choreography import ChoreographyExecution import json class GetRegion(Choreography): def __init__(self, temboo_session): """ Create a new...
{ "content_hash": "e94541290049f6e34faca71285df1d28", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 254, "avg_line_length": 45.582417582417584, "alnum_prop": 0.6887656702025072, "repo_name": "lupyuen/RaspberryPiImage", "id": "d3a0c7c25c5f306f2aa22f5aba236e05b005b70f", "si...
from django.db import models from shared_schema_tenants.settings import get_setting from shared_schema_tenants.managers import SingleTenantModelManager, MultipleTenantModelManager from shared_schema_tenants.helpers.tenants import get_current_tenant from shared_schema_tenants.exceptions import TenantNotFoundError def ...
{ "content_hash": "2c156007ca1e7abc9a6cd612148cdd12", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 95, "avg_line_length": 31.810344827586206, "alnum_prop": 0.6888888888888889, "repo_name": "hugobessa/django-shared-schema-tenants", "id": "e120536f08750128d327e579b5928842955...
""" :codeauthor: Jayesh Kariya <jayeshk@saltstack.com> """ import pytest import salt.states.schedule as schedule from tests.support.mock import MagicMock, patch @pytest.fixture def configure_loader_modules(): return {schedule: {}} def test_present(): """ Test to ensure a job is present in the sche...
{ "content_hash": "cea794ae807fefe66c1dad994a5244cb", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 83, "avg_line_length": 28.62686567164179, "alnum_prop": 0.5662148070907195, "repo_name": "saltstack/salt", "id": "f58a51a22a731b57ce187b0aa6f16495747bb6c8", "size": "1918",...
import mock import unittest from nsq.sockets.base import SocketWrapper class TestSocketWrapper(unittest.TestCase): '''Test the SocketWrapper class''' def setUp(self): self.socket = mock.Mock() self.wrapped = SocketWrapper.wrap_socket(self.socket) def test_wrap_socket(self): '''Pa...
{ "content_hash": "e6f172894f3b0a765465b7fb9220c195", "timestamp": "", "source": "github", "line_count": 51, "max_line_length": 80, "avg_line_length": 37.411764705882355, "alnum_prop": 0.6567085953878407, "repo_name": "dlecocq/nsq-py", "id": "9b2e8b3123973f4dfc540aaef290850dee9cd7c0", "size": "1908"...
from ..common.optim import SGD as optimizer from ..common.coco_schedule import lr_multiplier_1x as lr_multiplier from ..common.data.coco import dataloader from ..common.models.mask_rcnn_fpn import model from ..common.train import train from detectron2.config import LazyCall as L from detectron2.modeling.backbone impor...
{ "content_hash": "ff80355d55fd98f8bfde6f20ac62c790", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 162, "avg_line_length": 35.02857142857143, "alnum_prop": 0.7463295269168027, "repo_name": "facebookresearch/detectron2", "id": "72c6b7a5c8939970bd0e1e4a3c1155695943b19a", "...
from __future__ import unicode_literals from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): dependencies = [ ('company', '0008_auto_20170211_2001'), ] operations = [ migrations.AlterField( model_name='job', ...
{ "content_hash": "a0e405a234606537768d31c50cdf250e", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 156, "avg_line_length": 32.89655172413793, "alnum_prop": 0.6132075471698113, "repo_name": "aakashrana1995/svnit-tnp", "id": "d3d06a3ae48f05eb3ef64ccb6530e5bdea3c3b70", "siz...
""" See https://zulip.readthedocs.io/en/latest/translating/internationalization.html for background. The contents of this file are taken from https://github.com/niwinz/django-jinja/blob/master/django_jinja/management/commands/makemessages.py Jinja2's i18n functionality is not exactly the same as Django's. In particul...
{ "content_hash": "d5ce5dbcaafbbdcf5b1fb8740a27b2cc", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 113, "avg_line_length": 41.46153846153846, "alnum_prop": 0.5687384044526902, "repo_name": "showell/zulip", "id": "fb0aea8d2287f7c7f6215626c6802b5a01919be8", "size": "10780...
from __future__ import absolute_import, print_function, with_statement __author__ = "Microsoft Corporation <ptvshelp@microsoft.com>" __version__ = "3.0.0.0" import ctypes import datetime import os import re import struct import sys import traceback from xml.dom import minidom try: from cStringIO import StringIO ...
{ "content_hash": "9bc4ab34094161d638846b7d92653e57", "timestamp": "", "source": "github", "line_count": 874, "max_line_length": 132, "avg_line_length": 34.62929061784897, "alnum_prop": 0.5951562809753519, "repo_name": "DinoV/PTVS", "id": "ac537c99e4bc6699b094f195f717ed2b91f784b6", "size": "30973", ...
from spaceconfig import * from mesh import * from operator import * from oplib import * from generator import * #__all__=['mesh','spaceconfig','operator','oplib','generator']
{ "content_hash": "db2a1c6861e6de07ccdf6c7d2522d11b", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 62, "avg_line_length": 29.166666666666668, "alnum_prop": 0.7257142857142858, "repo_name": "Lynn-015/NJU_DMRG", "id": "f6c7b6e199a36511c6b1c255894ff0d38643adba", "size": "175...
import os import sys from pkg_resources import get_distribution sys.path.insert(0, os.path.abspath('../..')) # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # # needs_sphinx = '1.0' # Add any Sphinx extension module na...
{ "content_hash": "925a362e1a5dd0c60a21e5652b399983", "timestamp": "", "source": "github", "line_count": 165, "max_line_length": 78, "avg_line_length": 29.266666666666666, "alnum_prop": 0.6655622282045972, "repo_name": "cloudboss/friend", "id": "803e2788f54dae819dfae52e888beca9195ebb77", "size": "54...
""" AppShell provides a GUI application framework. This is a streamlined adaptation of GuiAppD.py, originally created by Doug Hellmann (doughellmann@mindspring.com). """ from Tkinter import * import Pmw import sys, string import ProgressBar class AppShell(Pmw.MegaWidget): appversion = '1.0' app...
{ "content_hash": "de26805a674ab7aca965a36447de7c01", "timestamp": "", "source": "github", "line_count": 319, "max_line_length": 77, "avg_line_length": 38.6833855799373, "alnum_prop": 0.5, "repo_name": "sniemi/SamPy", "id": "db2d937465706d294a8bac8013fa9623e452d6c1", "size": "12360", "binary": fal...
from swgpy.object import * def create(kernel): result = Static() result.template = "object/static/item/shared_item_substance_analyzer.iff" result.attribute_template_id = -1 result.stfName("obj_n","unknown_object") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "969060a7603a9411fe2da85e8447f06b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 74, "avg_line_length": 23.307692307692307, "alnum_prop": 0.693069306930693, "repo_name": "anhstudios/swganh", "id": "aa763ead94fa17dff91d3cd22e10acbd48f34c7b", "size": "448...
import re import sys from pathlib import Path from rich.console import Console if __name__ not in ("__main__", "__mp_main__"): raise SystemExit( "This file is intended to be executed as an executable program. You cannot use it as a module." f"To run this script, run the ./{__file__} command [FILE]...
{ "content_hash": "d47786c5dca8e27bf980792ae08f9072", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 103, "avg_line_length": 26.73170731707317, "alnum_prop": 0.6021897810218978, "repo_name": "bolkedebruin/airflow", "id": "38f7d4081c2d6178308c36cf14786fc273862dd2", "size": ...
""" tipfy.appengine.db ~~~~~~~~~~~~~~~~~~ Datastore utilities extension. :copyright: 2011 by tipfy.org. :license: BSD, see LICENSE.txt for more details. """ import logging import time from google.appengine.api import datastore_errors from google.appengine.api.namespace_manager import namespace_ma...
{ "content_hash": "ccca314f50d09afe00d45cf5af99eea5", "timestamp": "", "source": "github", "line_count": 586, "max_line_length": 105, "avg_line_length": 33.2542662116041, "alnum_prop": 0.6067121670857495, "repo_name": "pombreda/tipfy", "id": "1138810c8ed68dad92280e2d572c38da584689e0", "size": "19511...
import argparse import sys import os import time import traceback import sys import ctypes import subprocess from subprocess import Popen, PIPE import shutil from optparse import OptionParser from biokbase.workspace.client import Workspace import urllib import urllib2 import json from biokbase import log from biokbase....
{ "content_hash": "32817291b387073da45573c88019862e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 150, "avg_line_length": 36.166666666666664, "alnum_prop": 0.6672152732060567, "repo_name": "mlhenderson/transform", "id": "1c2a5813b94bb804470bc2c43b2196672d217e16", "size"...
import unittest import numpy as np import pandas as pd from nowtrade import criteria from testing_data import msft_data, msft_close_name from nowtrade.symbol_list import Symbol from nowtrade.action import Long, Short, LongExit, ShortExit from nowtrade.strategy import LONG, SHORT, LONG_EXIT, SHORT_EXIT, NO_ACTION class...
{ "content_hash": "bec4a1f1e64d2204758fc30750910951", "timestamp": "", "source": "github", "line_count": 309, "max_line_length": 159, "avg_line_length": 45.52750809061489, "alnum_prop": 0.621907876030708, "repo_name": "edouardpoitras/NowTrade", "id": "d44f4cd9f597c78d6a9248b4d5047525fdf2586b", "size...
import _plotly_utils.basevalidators class MetaValidator(_plotly_utils.basevalidators.AnyValidator): def __init__(self, plotly_name="meta", parent_name="scattergl", **kwargs): super(MetaValidator, self).__init__( plotly_name=plotly_name, parent_name=parent_name, array_ok...
{ "content_hash": "bf630b9897701f0d3628892313554baa", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 78, "avg_line_length": 37.07692307692308, "alnum_prop": 0.5912863070539419, "repo_name": "plotly/python-api", "id": "821ffd572d1102606f6cdc98f3a5b997ae4e5f47", "size": "482...
from google.appengine.ext import ndb class MobileUser(ndb.Model): ''' Used in workaround for null user id (helper/push_helper.py) We can restructure this once regular oauth logins happen (https://github.com/the-blue-alliance/the-blue-alliance/issues/1069) This is not a good long term solution, I don't...
{ "content_hash": "d3b6eb0624c304c87e3f98cbc2738f64", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 129, "avg_line_length": 30.642857142857142, "alnum_prop": 0.7062937062937062, "repo_name": "fangeugene/the-blue-alliance", "id": "efc080fa94278008a0d4ff2d58d822085c1d2ac1", ...
from django import forms from hacks.models import Hackathon, CodeMania class HackathonForm(forms.ModelForm): class Meta: model = Hackathon fields = '__all__' class CodeManiaForm(forms.ModelForm): class Meta: model = CodeMania fields = '__all__'
{ "content_hash": "70253bfae6c59a267f0bc9418ccdf430", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 45, "avg_line_length": 21.416666666666668, "alnum_prop": 0.7315175097276264, "repo_name": "hackjss/hackathon-2015", "id": "45d169e78cac207ae7aacab55c1a271ee896418b", "size"...
from __future__ import unicode_literals import django.contrib.postgres.fields from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('projects', '0005_remove_information_photos'), ] operations = [ migrations.AddField( model_name='in...
{ "content_hash": "b2206b19e21e1b6d9f31d4023553e1b4", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 126, "avg_line_length": 26.473684210526315, "alnum_prop": 0.6500994035785288, "repo_name": "ayushjain19/Technopedia-BPHC-website", "id": "4fa847a7e80159185ea78be7b22ed510671d...
import os,sys def main(): dir = os.getcwd() #print dir for root, dirs, files in os.walk(dir): for fname in files: #fullName = os.path.join(root,fname) if fname.endswith('.md') or fname.endswith('.py') or fname.endswith('.csv'): continue ...
{ "content_hash": "daf86b3f1a0a420555f878761fee9cc0", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 88, "avg_line_length": 26.666666666666668, "alnum_prop": 0.5208333333333334, "repo_name": "lorisdanto/automatark", "id": "abd173c566108e57f21f4c36fa2e508a987e6e9c", "size":...
import os import pytest from azure.keyvault.secrets import ApiVersion from azure.keyvault.secrets._shared.client_base import DEFAULT_VERSION from devtools_testutils import AzureRecordedTestCase, is_live def get_decorator(**kwargs): """returns a test decorator for test parameterization""" return [(api_version...
{ "content_hash": "7a07488624b1045d805ff9a26b83dc4c", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 117, "avg_line_length": 40.5, "alnum_prop": 0.6634460547504025, "repo_name": "Azure/azure-sdk-for-python", "id": "66220cefc8ce72e433d556843cfca7488b79c54b", "size": "2014",...
from zope.interface import implements from twisted.cred import portal, checkers, credentials, error from twisted.web import resource class HttpRpcRealm(object): implements(portal.IRealm) def __init__(self, resource): self._resource = resource def requestAvatar(self, user, mind, *interfaces): ...
{ "content_hash": "48a3e40f087c88c6de28e15bf750ff69", "timestamp": "", "source": "github", "line_count": 35, "max_line_length": 71, "avg_line_length": 30.914285714285715, "alnum_prop": 0.6802218114602587, "repo_name": "TouK/vumi", "id": "59f382c5031865188fea769bc0f5d85bda671c59", "size": "1173", "...
'''Trains a stacked what-where autoencoder built on residual blocks on the MNIST dataset. It exemplifies two influential methods that have been developed in the past few years. The first is the idea of properly 'unpooling.' During any max pool, the exact location (the 'where') of the maximal value in a pooled re...
{ "content_hash": "50d4f595e2f83def8ef7ebef917ab9d0", "timestamp": "", "source": "github", "line_count": 203, "max_line_length": 79, "avg_line_length": 38.23152709359606, "alnum_prop": 0.6755572735472233, "repo_name": "baojianzhou/DLReadingGroup", "id": "80b34e21658f72ce7c44a00a65733335066add7a", "s...
from buildbot.schedulers.basic import SingleBranchScheduler from master import master_config from master.factory import annotator_factory m_annotator = annotator_factory.AnnotatorFactory() defaults = {} helper = master_config.Helper(defaults) B = helper.Builder F = helper.Factory S = helper.Scheduler T = helper.Tri...
{ "content_hash": "81dae1f2565caad7058c3b109726ae3a", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 77, "avg_line_length": 27.293478260869566, "alnum_prop": 0.6583034647550776, "repo_name": "eunchong/build", "id": "fb44c4222aa4d645298b25838936900d0854ecb0", "size": "2678"...
from __future__ import (nested_scopes, generators, division, absolute_import, with_statement, print_function, unicode_literals) from abc import abstractmethod from twitter.common.lang import AbstractClass from pants.base.exceptions import TaskError class Engine(AbstractClass): """An engin...
{ "content_hash": "e8190858292bdd7ec109733fe243c40f", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 96, "avg_line_length": 33.278688524590166, "alnum_prop": 0.6669950738916256, "repo_name": "Ervii/garage-time", "id": "f33badbd6f8cf7ea19f0b27600edf66353d833a6", "size": "21...
__author__ = 'sdk' from time import strftime, gmtime, mktime import datetime from xml.dom import minidom import numpy as np import cx_Oracle from password import databaseSCO as database import pandas as pd pd.options.mode.chained_assignment = None tables = {"ASDM": "XML_ASDM_ENTITIES", "Main": "XML_MAINTABLE_ENTITIES"...
{ "content_hash": "4f0c25092b6b6e67182cd9a1e5f5935f", "timestamp": "", "source": "github", "line_count": 420, "max_line_length": 168, "avg_line_length": 34.34047619047619, "alnum_prop": 0.6104832559106982, "repo_name": "SDK/metadatachecker", "id": "5605832c9d234c003fb66981b57d8fb0acf3123e", "size": ...
import os from setuptools import find_packages, setup __version__ = None exec(open('opentaxii/_version.py').read()) def here(*path): return os.path.join(os.path.dirname(__file__), *path) def get_file_contents(filename): with open(here(filename), encoding='utf8') as fp: return fp.read() # This is...
{ "content_hash": "1b996196e0310f6c3272c5f1ff29b827", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 88, "avg_line_length": 35.25, "alnum_prop": 0.6391843971631206, "repo_name": "EclecticIQ/OpenTAXII", "id": "3dea2fde362cd726222c93af1badfb0be91b69ab", "size": "2256", "bi...
from __future__ import print_function n = int(raw_input()) setA = set(map(int, raw_input().split())) m = int(raw_input()) setB = set(map(int, raw_input().split())) # Print the symmetric difference of two sets. setC = setA ^ setB print(*sorted(setC), sep="\n")
{ "content_hash": "f6ecf3e210aad36c58613a4429f3aa91", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 45, "avg_line_length": 32.5, "alnum_prop": 0.6615384615384615, "repo_name": "zubie7a/CPP", "id": "2ec9a4861f9eaca74a5001dd64eec0825aad61d1", "size": "321", "binary": false...
from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from realback_api import models, forms @login_required def front_page(request): """ View lecturer front page """ # TODO forms course_form = forms.CourseForm() lecture_form = forms.LectureForm() ...
{ "content_hash": "406603c5ac91369570eaaf2fde6a7ac4", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 57, "avg_line_length": 31.176470588235293, "alnum_prop": 0.6886792452830188, "repo_name": "martinlunde/RealBack", "id": "cacb165cd5cc3f119e5854f720933faea97a59dc", "size": ...
"""Test segwit transactions and blocks on P2P network.""" from test_framework.mininode import * from test_framework.test_framework import BitcoinTestFramework from test_framework.util import * from test_framework.script import * from test_framework.blocktools import create_block, create_coinbase, add_witness_commitmen...
{ "content_hash": "07354f47f0b61d56c644bfe3c31c2d93", "timestamp": "", "source": "github", "line_count": 1945, "max_line_length": 150, "avg_line_length": 46.21182519280206, "alnum_prop": 0.6343650564072896, "repo_name": "21E14/bitcoin", "id": "943bc2c6d2111eb7bd52b2a643a83ebbcdf6ebbf", "size": "9009...
from __future__ import print_function import sys import os if sys.version_info > (2, 7, 0): import unittest else: import unittest2 as unittest from mock import Mock from tempfile import NamedTemporaryFile sys.path.append(os.path.join(os.path.dirname(__file__), '../bin')) import qds import qds_sdk from qds_sdk.c...
{ "content_hash": "3c3a0d40e5b53ce20f7e3cb81a07547c", "timestamp": "", "source": "github", "line_count": 1139, "max_line_length": 200, "avg_line_length": 42.12115891132572, "alnum_prop": 0.48165749541437386, "repo_name": "rohitpruthi95/qds-sdk-py", "id": "424001d8fb763a40ab06252ddebdbe829f1e63f7", "...
from functools import wraps from typing import Any, Callable from ngraph.impl import Node from ngraph.utils.types import NodeInput, as_node, as_nodes def _set_node_name(node: Node, **kwargs: Any) -> Node: if "name" in kwargs: node.name = kwargs["name"] return node def nameable_op(node_factory_funct...
{ "content_hash": "1d750108caa03d55645af8aa0d3437bf", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 94, "avg_line_length": 32.40816326530612, "alnum_prop": 0.6612090680100756, "repo_name": "NervanaSystems/ngraph", "id": "f1665a9c041d7b0d3c771730d7ce4923d49edb2c", "size": ...
response.logo = A(B('web',SPAN(2),'py'),XML('&trade;&nbsp;'), _class="navbar-brand",_href="http://www.web2py.com/", _id="web2py-logo") response.title = request.application.replace('_',' ').title() response.subtitle = '' ## read more at http://dev.w3.org/html5/markup/meta.name.html r...
{ "content_hash": "aa527be81797df00cfb47a1578ea6276", "timestamp": "", "source": "github", "line_count": 129, "max_line_length": 86, "avg_line_length": 44.46511627906977, "alnum_prop": 0.4769874476987448, "repo_name": "shashisp/blumix-webpy", "id": "bffc021c9297df1ff9b19e90b3c7c5557d0d644a", "size":...
""" Django settings for ohmycommand project. Generated by 'django-admin startproject' using Django 1.9.4. For more information on this file, see https://docs.djangoproject.com/en/1.9/topics/settings/ For the full list of settings and their values, see https://docs.djangoproject.com/en/1.9/ref/settings/ """ import o...
{ "content_hash": "18c806c88e39a3bfe4fd1f5454ebd27b", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 91, "avg_line_length": 26.04861111111111, "alnum_prop": 0.6883497733937617, "repo_name": "gopar/OhMyCommand", "id": "b15a3a3fa5fb001041ba601802c035be657cf684", "size": "37...
import csv from datetime import datetime as dt, timedelta as td import logging import sys import re from copy import deepcopy import sys from dateutil.parser import parse from volttron.platform.messaging import topics from volttron.platform.agent import utils from volttron.platform.agent.utils import jsonapi, setup_lo...
{ "content_hash": "f61e10913e69db46edd04a2d758d26b4", "timestamp": "", "source": "github", "line_count": 430, "max_line_length": 107, "avg_line_length": 45.3046511627907, "alnum_prop": 0.5243570658590422, "repo_name": "hlngo/volttron-applications", "id": "ba46d8619ae0da5adee6e34685bfaac7785d8de8", "...
from django.utils.translation import ugettext_lazy as _ import horizon class FreezerDR(horizon.PanelGroup): slug = "freezerdr" name = _("Backup and Restore") panels = ('jobs', 'actions', 'sessions', 'clients', 'backups') class Freezer(horizon.Dashboard): name = _("Disaster Recovery") slug = "di...
{ "content_hash": "933396d6836389709448fe0dcb328c04", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 66, "avg_line_length": 22, "alnum_prop": 0.6770334928229665, "repo_name": "openstack/freezer-web-ui", "id": "9ce559f48ff92e89694b727123da9085f459e76e", "size": "1032", "b...
__author__ = 'Bruno Clermont' __maintainer__ = 'Bruno Clermont' __email__ = 'bruno@robotinfra.com' import logging import os import re from UserList import UserList from UserDict import IterableUserDict, UserDict import yaml logger = logging.getLogger(__name__) MINE_DATA_FUNC_NAME = 'monitoring.data' MINE_DATA_KEY =...
{ "content_hash": "54ccefbcf6a903141894f0e019c1952c", "timestamp": "", "source": "github", "line_count": 496, "max_line_length": 79, "avg_line_length": 33.22782258064516, "alnum_prop": 0.5548207026272678, "repo_name": "rtx3/saltstack-deyunio", "id": "155efc1dd1263dec3894f14ba1482920850fcbfc", "size"...
import base64 from .fields import BaseField class BaseTask(object): def serialize(self, **result): return result class ProxyMixin(BaseTask): def __init__(self, *args, **kwargs): self.proxy = kwargs.pop('proxy') self.userAgent = kwargs.pop('user_agent') self.cookies = kwargs.p...
{ "content_hash": "12b76f8855d8c0ad5b22d51438caf3f6", "timestamp": "", "source": "github", "line_count": 128, "max_line_length": 110, "avg_line_length": 30.8125, "alnum_prop": 0.5826572008113591, "repo_name": "pannal/Subliminal.bundle", "id": "57462763f55843da005b046563702a6c6131148f", "size": "3944...
from __future__ import unicode_literals, division, absolute_import import logging from flexget import options, plugin from flexget.event import event from flexget.utils.tools import console log = logging.getLogger('dump') def dump(entries, debug=False, eval_lazy=False, trace=False): """ Dump *entries* to st...
{ "content_hash": "81066541332ca9bb69f640c6024c74fa", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 118, "avg_line_length": 38.86363636363637, "alnum_prop": 0.5483040935672515, "repo_name": "X-dark/Flexget", "id": "361094f56598334fc4174eb2320eab8e133bbdda", "size": "4275...
""" Unit test runner. To run: python3 -m twest.test_all (The twest, two, twcommon modules must be in your PYTHON_PATH. MongoDB must be running; these tests run in (and trash) the 'testdb' collection.) This is a simplified version of the runner in tornado.testing. """ import sys import unittest import tornado.optio...
{ "content_hash": "b5e087df25dac41b2371bc077c6d56a9", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 70, "avg_line_length": 22.90909090909091, "alnum_prop": 0.6693121693121693, "repo_name": "erkyrath/tworld", "id": "41e2f699107f76c3000b48a3141b64334890d741", "size": "756",...
""" log解析 """ from bs4 import BeautifulSoup import datetime import jieba.analyse from snownlp import SnowNLP from db.travellog import Tlog def parser_log(place_id, url, html): """ 解析html页面内容 """ if html is None: return tlog = Tlog(url, place_id) tlog.html = html # 使用bs解析 html_...
{ "content_hash": "f0128d0523506598e414c6ec56f0ad08", "timestamp": "", "source": "github", "line_count": 104, "max_line_length": 84, "avg_line_length": 29.951923076923077, "alnum_prop": 0.5823434991974318, "repo_name": "bobobo80/python-crawler-test", "id": "e69706c8e045acff4c400018aa9bf5fb99edd41c", ...
from __future__ import unicode_literals import re import json # This ensures that we use 'str' in Python 3, and 'unicode' in Python 2 PythonString = "".__class__ class JsonTraverseParser: def __init__(self, raw_data, custom_json_impl=None): if raw_data and not isinstance(raw_data, PythonString): ...
{ "content_hash": "8610433201c606326040543c827216d0", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 112, "avg_line_length": 31.636363636363637, "alnum_prop": 0.5463362068965517, "repo_name": "EmilStenstrom/json-traverse", "id": "3183d671638097377ea140fa1e46daeb384d1edb", ...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('taskzilla', '0005_auto_20151011_0100'), ] operations = [ migrations.AddField( model_name='task', name='description', ...
{ "content_hash": "e9623599eb868c82fc6971ba02cef70e", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 49, "avg_line_length": 21, "alnum_prop": 0.5873015873015873, "repo_name": "jailuthra/taskzilla", "id": "f9820b944e5bba7c5ed3a5784e95c3d4331b5991", "size": "402", "binary"...
"""Tests for bundle support.""" import os import tempfile from dulwich.tests import ( TestCase, ) from dulwich.bundle import ( Bundle, read_bundle, write_bundle, ) class BundleTests(TestCase): def test_roundtrip_bundle(self): origbundle = Bundle() origbundle.version = 3 ...
{ "content_hash": "5176997c74990424663ee83e6362c9c8", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 66, "avg_line_length": 25.838709677419356, "alnum_prop": 0.5967540574282147, "repo_name": "sonntagsgesicht/regtest", "id": "7a9f38af1ca37da13ea42a3496a3c23cc6106233", "size...
import numpy as np from scipy.stats import itemfreq from collections import defaultdict from sklearn.linear_model import LogisticRegression from sklearn.ensemble import RandomForestClassifier from sklearn.svm import LinearSVC as SVM def set_trace(): from IPython.core.debugger import Pdb import sys Pdb(col...
{ "content_hash": "577079ad4246e23eb17233434436da93", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 79, "avg_line_length": 37.214285714285715, "alnum_prop": 0.5419065898912349, "repo_name": "rafaelvalle/MDI", "id": "7780191e6aea30dc81ee559ec6673dfe7fc6cda9", "size": "625...
"""Tests for the PyBEL assembler.""" import json import networkx as nx import pybel.constants as pc from pybel.dsl import abundance, activity, bioprocess, \ complex_abundance, hgvs, pmod, protein, reaction from indra.assemblers.pybel import assembler as pa from indra.databases import hgnc_client from indra.state...
{ "content_hash": "1b063aff2356e797b210e3ff06c3632a", "timestamp": "", "source": "github", "line_count": 687, "max_line_length": 90, "avg_line_length": 37.71033478893741, "alnum_prop": 0.5971359092137261, "repo_name": "sorgerlab/indra", "id": "6fd8cbcd3efacd0426a304a793cffe93e635cfc9", "size": "2593...
from __future__ import unicode_literals import pytz from django.contrib.postgres.fields.jsonb import JSONField from django.core.exceptions import ObjectDoesNotExist from django.db import models from trello_reporter.charting.constants import INITIAL_COLUMNS, SPRINT_COMMITMENT_COLUMNS class TrelloUser(models.Model):...
{ "content_hash": "4ea9a629cc24a4bc67f4f298c66f0639", "timestamp": "", "source": "github", "line_count": 135, "max_line_length": 90, "avg_line_length": 30.607407407407408, "alnum_prop": 0.600919651500484, "repo_name": "TomasTomecek/trello-reporter", "id": "0ba10ab10614236f007014544e8a8443512020af", ...
""" Creating datasets and models associated to a cluster """ from .world import world, setup_module, teardown_module from . import create_source_steps as source_create from . import create_dataset_steps as dataset_create from . import create_model_steps as model_create from . import create_cluster_steps as cluster_cre...
{ "content_hash": "2fa0a76215e0bd48639f2ae618f3bf05", "timestamp": "", "source": "github", "line_count": 163, "max_line_length": 115, "avg_line_length": 49.80368098159509, "alnum_prop": 0.5546932742054693, "repo_name": "mmerce/python", "id": "3f6480662d16fa7227d40d0fbef1aff38d8c7b3f", "size": "8720"...
import pytest from sockeye_contrib import rouge test_cases = [( ["this is a test", "another test case"], ["this is a test case", "another test case"], 0.9444444394753087, 0.928571423622449, 0.9338624338620563), (["this is a single test case"], ["this is a single test case"], ...
{ "content_hash": "5ecdc03f4df59c06cb8b0f5c645b0f3c", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 120, "avg_line_length": 52, "alnum_prop": 0.6820913461538461, "repo_name": "awslabs/sockeye", "id": "104d73c632f4e007933871847a13a63ee31674c5", "size": "2236", "binary": ...
"""This example displays country type names, codes, and whether the country supports a secure server. Tags: spotlight.getCountriesByCriteria """ __author__ = 'api.jdilallo@gmail.com (Joseph DiLallo)' import os import sys sys.path.insert(0, os.path.join('..', '..', '..', '..')) # Import appropriate classes from the ...
{ "content_hash": "d02f7b41271772171faf505daa339095", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 80, "avg_line_length": 28.511627906976745, "alnum_prop": 0.6655791190864601, "repo_name": "donspaulding/adspygoogle", "id": "988fb810f365da987170e835b005221befba9541", "siz...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/dungeon/corellian_corvette/shared_corvette_search_neutral_destroy_03.iff" result.attribute_template_id = -1 result.stfName("frn_n","frn_dented_drum") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS ...
{ "content_hash": "b28dff1a75dcd2ee3e800295d5321609", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 109, "avg_line_length": 26.23076923076923, "alnum_prop": 0.7126099706744868, "repo_name": "anhstudios/swganh", "id": "5eeb9d673f6769bec352db6288ed6fc3aea8ec51", "size": "48...
""" Kubernetes No description provided (generated by Swagger Codegen https://github.com/swagger-api/swagger-codegen) OpenAPI spec version: v1.6.1 Generated by: https://github.com/swagger-api/swagger-codegen.git """ from pprint import pformat from six import iteritems import re class V1beta1Cl...
{ "content_hash": "88cd68bbe3ae800fbbd08cece98844fa", "timestamp": "", "source": "github", "line_count": 192, "max_line_length": 272, "avg_line_length": 31.838541666666668, "alnum_prop": 0.5918534271225258, "repo_name": "skuda/client-python", "id": "82150a5ee76e254aedc9e5ab815bef904c5b0bac", "size":...
from google.cloud import aiplatform_v1 def sample_update_model_deployment_monitoring_job(): # Create a client client = aiplatform_v1.JobServiceClient() # Initialize request argument(s) model_deployment_monitoring_job = aiplatform_v1.ModelDeploymentMonitoringJob() model_deployment_monitoring_job.d...
{ "content_hash": "89108d6394a07ac582ff74572b3d22c0", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 82, "avg_line_length": 32.96296296296296, "alnum_prop": 0.7561797752808989, "repo_name": "googleapis/python-aiplatform", "id": "321b8f8b2ceab62f3ab47e69d5fb78ee0efab80a", "...
""" XML token classes representing mark up and text. The property idiom used in this module is discussed here: http://docs.python.org/release/3.2/library/functions.html#property """ import re import sys from collections import OrderedDict from .rex import XML_SPE_, ElemTagRE_, AttRE_ __all__ = [ 'Cdata', ...
{ "content_hash": "bd86d27ce83abb802ebf80ea390e9e80", "timestamp": "", "source": "github", "line_count": 833, "max_line_length": 99, "avg_line_length": 28.4921968787515, "alnum_prop": 0.5606303193730513, "repo_name": "jdnier/rexlib", "id": "10b6d90d4d3aa21e220ee41e14722f86002414ea", "size": "23734",...
from pifpaf import drivers class S3rverDriver(drivers.Driver): DEFAULT_PORT = 4568 def __init__(self, port=DEFAULT_PORT, **kwargs): """Create a new s3rver instance.""" super(S3rverDriver, self).__init__(**kwargs) self.port = port @classmethod def get_options(cls): re...
{ "content_hash": "8c9c709ddc36358ca93977c4c4536c58", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 72, "avg_line_length": 28.606060606060606, "alnum_prop": 0.5307203389830508, "repo_name": "jd/pifpaf", "id": "1d855bfa983bd4d41a749417ab769b27a60f1f7c", "size": "1490", "...
import numpy as np from numpy import fromfile as np_ff class head: """object version of 'header' function. Holds info about # of particles, mass of each particle type, time and redshift, and any flags in the header contents: self.npart self.mass self.time self.flags self.npart...
{ "content_hash": "66586c789894f37de39bd64ef1c99d4c", "timestamp": "", "source": "github", "line_count": 394, "max_line_length": 95, "avg_line_length": 36.870558375634516, "alnum_prop": 0.5378949542231707, "repo_name": "brunetto/MasterThesisCode", "id": "1af4901a5388064694298a24dd075f05716e327b", "s...
from plugin import Plugin import re class React(Plugin): """ Adds Slack emoji reactions to messages based on certain keywords """ def on_event(self, bot, event, response): text = event['text'] response.update(timestamp=event['ts']) # Add a cloud emoji if anyone mentions Overc...
{ "content_hash": "2056185dc84e19a259084947f7b9dd00", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 68, "avg_line_length": 27.772727272727273, "alnum_prop": 0.6202945990180033, "repo_name": "Electroid/nimbus", "id": "9b8ce0a5a9b508338303a8b560e2716ac795c313", "size": "611...
from docutils import core, nodes from docutils.parsers.rst import directives, Directive from pygments import highlight from pygments.formatters import HtmlFormatter from pygments.lexers import get_lexer_by_name, TextLexer class Pygments(Directive): """ Source code syntax hightlighting for ReST syntax.""" req...
{ "content_hash": "afc5116c7980de34656d9a0455c988b8", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 77, "avg_line_length": 37.45918367346939, "alnum_prop": 0.6676654862435304, "repo_name": "exciteresearch/landslide", "id": "1bcdcdfefbfd35d766ad71b97e6c49ba563e1668", "size...
import datetime import traceback from sqlalchemy.exc import IntegrityError, ConcurrentModificationError from voodoo.typechecker import typecheck from weblab.core.coordinator.sql.model import PostReservationRetrievedData import weblab.core.coordinator.status as WSS class PostReservationDataManager(object): def __...
{ "content_hash": "6222c5cae3b954ee875dd41a4e8513be", "timestamp": "", "source": "github", "line_count": 91, "max_line_length": 196, "avg_line_length": 37.30769230769231, "alnum_prop": 0.617378497790869, "repo_name": "ganeshgore/myremolab", "id": "99120953666e1dc1685b47a1842a10a604e163b4", "size": "...
from flask import Flask, request, render_template, redirect, url_for, jsonify import requests import json import os import xmltodict app = Flask(__name__) @app.route("/") def form(): logs = sorted(os.listdir("/home/ubuntu/log"),reverse=True) eventTime = [] alarmCategory = [] acquisitionMethod = [] emissionType =...
{ "content_hash": "56663476c7e6024e8b02ebafb228b5f9", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 111, "avg_line_length": 37.9264705882353, "alnum_prop": 0.7099651027530051, "repo_name": "kimjinyong/i2nsf-framework", "id": "d5239176d675b3f26b8b510737cb80dbc0617e3b", "si...
__author__ = 'max' import theano.tensor as T from lasagne import init from lasagne.layers import MergeLayer __all__ = [ "ChainCRFLayer", "TreeAffineCRFLayer", "TreeBiAffineCRFLayer", ] class ChainCRFLayer(MergeLayer): """ ChainCRFLayer(incoming, num_labels, mask_input=None, W=init.GlorotUniform...
{ "content_hash": "6c8613685db700f3d82b83b1215f1ac9", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 117, "avg_line_length": 43.12328767123287, "alnum_prop": 0.5901365946632783, "repo_name": "XuezheMax/NeuroNLP", "id": "9446861a16ea1714680912a4007512128b7a871b", "size": "...
import expresso.pycas as pc import rule_symbols as s ordered_types = (pc.Types.Boolean,pc.Types.Natural,pc.Types.Integer,pc.Types.Rational,pc.Types.Real,pc.Types.Complex) evaluator = pc.RewriteEvaluator(recursive=True, split_binary=True) from .logic_evaluator import is_explicit_natural,is_function_type evaluator.ad...
{ "content_hash": "735d9b38e8c4d8bc9581da5918e1bf2f", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 156, "avg_line_length": 39.30555555555556, "alnum_prop": 0.7351590106007068, "repo_name": "TheLartians/Expresso", "id": "84046f4692347c626318861d027039d651bc432a", "size":...
""" WSGI config for invigorate project. It exposes the WSGI callable as a module-level variable named ``application``. For more information on this file, see https://docs.djangoproject.com/en/1.11/howto/deployment/wsgi/ """ import os from django.core.wsgi import get_wsgi_application from whitenoise.django import Dj...
{ "content_hash": "d7c42e110481475d7cf5f02af2e68c8f", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 78, "avg_line_length": 27.166666666666668, "alnum_prop": 0.7934560327198364, "repo_name": "asheahan/invigorate", "id": "3646adde37c0e3aa71ed936581200cbb5b6f4eb6", "size": "...
""" Support import export formats.""" from __future__ import absolute_import as _abs from .... import symbol from .... import ndarray as nd from ....base import string_types from ._import_helper import _convert_map as convert_map class GraphProto(object): # pylint: disable=too-few-public-methods """A helper class ...
{ "content_hash": "267b994235bca111abd6b66b046cc3e8", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 94, "avg_line_length": 40.229268292682924, "alnum_prop": 0.5549896932217776, "repo_name": "precedenceguo/mxnet", "id": "3af196f8b091c6b2925ba16980a23e44181c6bcd", "size": ...
""" ==================================================================== pipeline_chiptools - homer and deeptools implimentation ==================================================================== Overview ======== The aim of this pipeline is to create peaklists in :term:`bed` files from aligned reads in :term:`bam...
{ "content_hash": "b7e6c218b00282f7504a08f84af7fbc4", "timestamp": "", "source": "github", "line_count": 971, "max_line_length": 129, "avg_line_length": 32.38002059732235, "alnum_prop": 0.6114627397347413, "repo_name": "CGATOxford/CGATPipelines", "id": "b21555efb7c99a43ae270cbc0c661bf538947ce8", "si...
def truncate(self, size=None): self.db.put(self.key, '', txn=self.txn, dlen=self.len - size, doff=size)
{ "content_hash": "801bf034ed212afa25f21abe540b9c38", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 76, "avg_line_length": 54, "alnum_prop": 0.6666666666666666, "repo_name": "moagstar/python-uncompyle6", "id": "189fe19da8f9fd4cf86114b4ee6f69de029d02a5", "size": "180", "b...
""" This is revision from 3058ab9d9d4875589638cc45e84b59e7e1d7c9c3 of https://github.com/ojii/django-load. ANY changes to this file, be it upstream fixes or changes for the cms *must* be documented clearly within this file with comments. For documentation on how to use the functions described in this file, please ref...
{ "content_hash": "964ec1940b7ef2d81aadb8fbb74c06bb", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 94, "avg_line_length": 32.111111111111114, "alnum_prop": 0.6656907106734097, "repo_name": "vxsx/django-cms", "id": "0d97c46a4b9d013b5d411cf9d79581933e9a0e30", "size": "378...
import itertools class Solution(object): def maxIncreaseKeepingSkyline(self, grid): """ :type grid: List[List[int]] :rtype: int """ row_maxes = [max(row) for row in grid] col_maxes = [max(col) for col in itertools.izip(*grid)] return sum(min(row_maxes[r], c...
{ "content_hash": "f894e831fe52955c332cb19bc47c8964", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 63, "avg_line_length": 29.266666666666666, "alnum_prop": 0.5421412300683371, "repo_name": "kamyu104/LeetCode", "id": "902b5482545902d262245d41895f24761941e118", "size": "19...
"""This code example creates a new creative wrapper. Creative wrappers must be associated with a LabelType.CREATIVE_WRAPPER label and applied to ad units by AdUnit.appliedLabels. To determine which creative wrappers exist, run get_all_creative_wrappers.py The LoadFromStorage method is pulling credentials and properti...
{ "content_hash": "9fa95743dbabef8a5c9a82b75122a06b", "timestamp": "", "source": "github", "line_count": 47, "max_line_length": 80, "avg_line_length": 35.12765957446808, "alnum_prop": 0.7129012719563901, "repo_name": "googleads/googleads-python-lib", "id": "dca07888baf2b8fecc1d7862bda93778d51bd173", ...
import logging import os import sys import time import numpy as np import pytest import ray import ray.cluster_utils from ray._private.test_utils import RayTestTimeoutException, wait_for_condition logger = logging.getLogger(__name__) def test_gpu_ids(shutdown_only): num_gpus = 3 ray.init(num_cpus=num_gpus,...
{ "content_hash": "2deae8967a6f6662b93e06ed7aefaade", "timestamp": "", "source": "github", "line_count": 526, "max_line_length": 88, "avg_line_length": 32.90114068441065, "alnum_prop": 0.6050502715821102, "repo_name": "ray-project/ray", "id": "e1086c6e83f853ce9181685ad3e6cedd4df00e64", "size": "1732...
''' @author: Michael Vorotyntsev @email: linkofwise@gmail.com @github: unaxfromsibiria ''' import codecs import logging import json from enum import Enum class ClientGroupEnum(Enum): Service = 1 Server = 2 Manager = 3 class Configuration(dict): _logger = None def __init__(self, **source): ...
{ "content_hash": "fd82c372ca9531c5185256ee33cb4448", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 60, "avg_line_length": 19.919354838709676, "alnum_prop": 0.6089068825910932, "repo_name": "unaxfromsibiria/roombnode", "id": "2c4f89caf329535077a66df324416839c7e726b0", "si...
from __future__ import unicode_literals from datetime import datetime, timedelta import gettext from importlib import import_module import os from unittest import TestCase, skipIf try: import pytz except ImportError: pytz = None from django import forms from django.conf import settings from django.contrib im...
{ "content_hash": "1ffa6acb61f67853170e25dcdbb1a2ee", "timestamp": "", "source": "github", "line_count": 1193, "max_line_length": 406, "avg_line_length": 45.923721709974856, "alnum_prop": 0.6248562615218939, "repo_name": "Sonicbids/django", "id": "c5795c87fb4124a2254cdf74c7d7f93bed074ae8", "size": "...
from __future__ import division, unicode_literals import re import numpy as np from monty.io import zopen from pymatgen.electronic_structure.core import Spin, Orbital """ Module for reading Lobster output files. For more information on LOBSTER see www.cohp.de. """ __author__ = "Marco Esters" __copyright__ = "Copyri...
{ "content_hash": "4e896eee104fcba04c5fa70acf5a1dea", "timestamp": "", "source": "github", "line_count": 229, "max_line_length": 78, "avg_line_length": 38.275109170305676, "alnum_prop": 0.5220764403879065, "repo_name": "czhengsci/pymatgen", "id": "1b9a5bd80c17b67e6dd12962b2d1530308b580cd", "size": "...
""" <DefineSource> @Date : Fri Nov 14 13:20:38 2014 \n @Author : Erwan Ledoux \n\n </DefineSource> Connecter instances catch grasped variables and makes an attention also on it. """ #<DefineAugmentation> import ShareYourSystem as SYS BaseModuleStr="ShareYourSystem.Standards.Teamers.Parenter" DecorationModuleStr="S...
{ "content_hash": "7838ab199e54b7855ecdf816559aeeec", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 78, "avg_line_length": 23.941860465116278, "alnum_prop": 0.725594949004371, "repo_name": "Ledoux/ShareYourSystem", "id": "2e80858ef355693892cd0f3099285dff20004594", "size":...
import shutil import json from zipfile import ZipFile import pandas from django.contrib.gis.geos import Polygon import os import sh from osgeo import osr, ogr from . import Driver from pandas import DataFrame from shapely import wkb from django.template.defaultfilters import slugify import re def ogrfield(elt): ...
{ "content_hash": "c2ec078371f728d3c13fa99fa3412578", "timestamp": "", "source": "github", "line_count": 307, "max_line_length": 134, "avg_line_length": 35.9185667752443, "alnum_prop": 0.5420331912578217, "repo_name": "JeffHeard/terrapyn", "id": "e8bffe95711703e4eaccb008adb7bfad5cd89c88", "size": "1...
"""Calculate the l-core of a multiplex network. """ import networkx as nx def l_core(mg, l): """Return the l-core of mg. """ import copy core = copy.deepcopy(mg) for u,v in mg.edges(): if len(mg[u][v][mg.cid]) < l: core.remove_edge(u,v) core.remove_nodes_from(nx.isolates...
{ "content_hash": "8ef8d2a8f69679e4e5ab745376529736", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 47, "avg_line_length": 18.8, "alnum_prop": 0.5851063829787234, "repo_name": "wuhaochen/multinet", "id": "d9d547bc610ec8aa689f0b31511f671a8538082a", "size": "376", "binary...
import base64 from selenium.webdriver.remote.command import Command from selenium.webdriver.remote.webdriver import WebDriver as RemoteWebDriver from selenium.common.exceptions import WebDriverException from .service import Service from .options import Options class WebDriver(RemoteWebDriver): """ Controls the...
{ "content_hash": "9783969dd2dc6bb8386ed7596db5805b", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 117, "avg_line_length": 38.53030303030303, "alnum_prop": 0.6366496264254817, "repo_name": "isaksky/selenium", "id": "556f78ebdb694981094027e26835a70d9e97dc96", "size": "316...
from pyscf import lib from pyscf.tdscf import rhf class TDA(rhf.TDA): def gen_vind(self, mf): vind, hdiag = rhf.TDA.gen_vind(self, mf) def vindp(x): with lib.temporary_env(mf, exxdiv=None): return vind(x) return vindp, hdiag def nuc_grad_method(self): ...
{ "content_hash": "964d163a0d57c244b9134e312e31d2f4", "timestamp": "", "source": "github", "line_count": 38, "max_line_length": 52, "avg_line_length": 22.31578947368421, "alnum_prop": 0.6132075471698113, "repo_name": "gkc1000/pyscf", "id": "ac67a2b47df9c437a37b4da396d658c9444de096", "size": "1601", ...
""" Count how many letters in a word and print them sorted """ print "Please type in a word" word = raw_input() freq = {} for letter in word: count = freq.setdefault(letter, 0) freq[letter] = count + 1 print freq for k in sorted(freq, key=freq.get, reverse=True): print "%s => %d" % (k, freq[k])
{ "content_hash": "7bfd178ba0985ad7b2ef56197e5828a5", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 50, "avg_line_length": 15.75, "alnum_prop": 0.6285714285714286, "repo_name": "ynonp/python-examples", "id": "dc3c3f9dec6aee334487324a684ecfc5d142988e", "size": "315", "bi...
class Typed: def __init__(self, name, expected_type): self.name = name self.expected_type = expected_type def __get__(self, instance, cls): if instance is None: return self else: return instance.__dict__[self.name] def __set__(self, instance, value):...
{ "content_hash": "af768a3fa5da343c573607ce508a1ad8", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 66, "avg_line_length": 28.90909090909091, "alnum_prop": 0.5864779874213837, "repo_name": "tuanavu/python-cookbook-3rd", "id": "94603707a2346e4148767635f6cd9c7cca6ffd1e", "s...
''' [109] on segments of the TIGER corpus +1, +2 and +1 or +2 & 5 relations mentioned in Hinrich's email # parameter with number of considered segments ''' import collections import os import GlobalVariables_Katharina_SVD as gl from scipy.sparse import csr_matrix, issparse from scipy.sparse.linalg import eigsh from n...
{ "content_hash": "1a49ff3959bc97b7ecd1cde0c4885dd2", "timestamp": "", "source": "github", "line_count": 513, "max_line_length": 176, "avg_line_length": 37.08771929824562, "alnum_prop": 0.5779985283296541, "repo_name": "Kelina/TensorEmbeddings", "id": "49905a8b753dbce86259da0f7146c889cdc2a9a9", "siz...
import os import socket from flask import Flask, url_for from .config import BaseConfig from .views import register_views from .extensions import rq, redis app = Flask(__name__) ############################## # Load Config app.config['UPLOAD_FOLDER'] = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'uplo...
{ "content_hash": "e60cd49dd96bb84e2aed6eb899a3417f", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 97, "avg_line_length": 25.38095238095238, "alnum_prop": 0.6278924327704816, "repo_name": "jmhobbs/dun-dun-duh", "id": "0fd19436451b5ef9fb68911342dab0e34f934602", "size": "1...
from swgpy.object import * def create(kernel): result = Building() result.template = "object/building/tatooine/shared_guild_university_tatooine_style_01.iff" result.attribute_template_id = -1 result.stfName("building_name","guild_university") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### r...
{ "content_hash": "57282b474f9d17955522411f5b89183b", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 91, "avg_line_length": 25.53846153846154, "alnum_prop": 0.713855421686747, "repo_name": "obi-two/Rebelion", "id": "ed14dadf52b949ce926637896749314fc837b78a", "size": "477",...
from django import forms from multiemailfield import utils class MultiEmailWidget(forms.Textarea): def render(self, name, value, attrs=None): value = utils.dump(value) or '' return super(MultiEmailWidget, self).render(name, value, attrs)
{ "content_hash": "4225093a88aedcb8baccab6661811a15", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 71, "avg_line_length": 29, "alnum_prop": 0.7203065134099617, "repo_name": "sophilabs/django-multiemail-field", "id": "2e590875122434f5dc223e500c660b4435334cb5", "size": "261...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('costs', '0012_auto_20171129_2247'), ] operations = [ migrations.AlterField( model_name='recurringcost', name='type', ...
{ "content_hash": "13164bbea09000f37875a28650abccf6", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 562, "avg_line_length": 49.611111111111114, "alnum_prop": 0.6842105263157895, "repo_name": "waldocollective/swiftwind", "id": "aac7e8cb7c3f9c5eff1db7cbb723300a5291191c", "s...
import django import django.core.validators from django.db import migrations, models import poradnia.users.models class Migration(migrations.Migration): dependencies = [("users", "0009_user_codename")] if django.VERSION[:2] >= (1, 8): operations = [ migrations.AlterModelManagers( ...
{ "content_hash": "6c331b93b88296b49e9fb760eb6b01f3", "timestamp": "", "source": "github", "line_count": 66, "max_line_length": 126, "avg_line_length": 33.22727272727273, "alnum_prop": 0.49247606019151846, "repo_name": "watchdogpolska/poradnia.siecobywatelska.pl", "id": "7673a936dbdbf2553ce3c1ff25c820...
''' Swift utility class =================== Author: Anthony Stanton <anthony.stanton@gmail.com> ''' from __future__ import absolute_import # Import python libs import logging from sys import stdout from os import makedirs from os.path import dirname, isdir from errno import EEXIST # Import Salt libs import salt.utils...
{ "content_hash": "5c876b3facec45d9bb23087d29a3ea38", "timestamp": "", "source": "github", "line_count": 236, "max_line_length": 111, "avg_line_length": 29.110169491525422, "alnum_prop": 0.5228529839883551, "repo_name": "smallyear/linuxLearn", "id": "8b28172acd5ace2021889012e7ee28158f4c8551", "size"...
""" WSGI config for sutrofm project. This module contains the WSGI application used by Django's development server and any production WSGI deployments. It should expose a module-level variable named ``application``. Django's ``runserver`` and ``runfcgi`` commands discover this application via the ``WSGI_APPLICATION`` ...
{ "content_hash": "f06fdbc326eac7be0d6d979e04871d51", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 79, "avg_line_length": 39.61764705882353, "alnum_prop": 0.7906458797327395, "repo_name": "superemily/sutrofm", "id": "b24d1cbc5b6539874257d5281222c3cb17453b8c", "size": "13...
"""(preliminary) Model of a Factory Callable object""" from basicproperty import propertied, basic, common from basictypes import list_types, callable class Factory( callable.Callable ): """An object intended to create instances of a type The factory allows you to create instances of a type through the GUI. Most ...
{ "content_hash": "0f64983de46a1192aba3dc0fbbff2006", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 54, "avg_line_length": 30.1, "alnum_prop": 0.760797342192691, "repo_name": "corvust/Transmission-XBMC", "id": "77051befe70e0deef9887470f54984d8d9a9e966", "size": "602", "...