text
stringlengths
4
1.02M
meta
dict
import sqlite3 from checktheplug.models.User import User class UserDao: def __init__(self, settings): self.conn = sqlite3.connect(settings.database) def login(self, username, password): with self.conn: cur = self.conn.cursor() cur.execute("SELECT id, username, gravata...
{ "content_hash": "8f3c03097342bd0053584a3fc1adba40", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 128, "avg_line_length": 35.06666666666667, "alnum_prop": 0.6311787072243346, "repo_name": "maximx1/checktheplug", "id": "4c411634a6bad4dcda08391926ab4a1f75245db0", "size": ...
from __future__ import absolute_import import six from sentry.api.serializers import Serializer, register, serialize from sentry.models import Activity @register(Activity) class ActivitySerializer(Serializer): def get_attrs(self, item_list, user): # TODO(dcramer); assert on relations users = { ...
{ "content_hash": "ad7f55f087e6470396b098bbe64f91c5", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 98, "avg_line_length": 30.403225806451612, "alnum_prop": 0.5676392572944297, "repo_name": "zenefits/sentry", "id": "2d62b5ddda8e23910a9a43cad530f0108948a744", "size": "1885...
from django import forms from django.contrib.auth import authenticate # crispy forms from crispy_forms.helper import FormHelper from crispy_forms.layout import Layout, Fieldset, Submit, Div, HTML class LoginForm(forms.Form): username = forms.CharField(label='Username', widget=forms.TextInput()) password = for...
{ "content_hash": "9dcedb0682ffe667cbf6707080367045", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 84, "avg_line_length": 31.5625, "alnum_prop": 0.5702970297029702, "repo_name": "pawel-wlk/ecommerce-site", "id": "3f392ed379ba2556bcc0350e102617008b5a65d9", "size": "1516",...
import uuid as uuid_lib from oslo_config import cfg from nova.cloudpipe import pipelib from nova.network import api as network_api from nova.tests.functional.api_sample_tests import api_sample_base from nova.tests.unit.image import fake CONF = cfg.CONF CONF.import_opt('vpn_image_id', 'nova.cloudpipe.pipelib') CONF....
{ "content_hash": "f59f73478f05b58b95fae78cee696eca", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 76, "avg_line_length": 38.666666666666664, "alnum_prop": 0.610079575596817, "repo_name": "isyippee/nova", "id": "797938e2201d9a36560ab5481259aeacb5f69ecc", "size": "3618", ...
import getopt import logging import signal import sys logger = logging.getLogger('aep-parser') # pylint: disable=attribute-defined-outside-init class AepParser(object): prepared = False @staticmethod def topology_from_data(array, topo): # Extract topology information for the data file # The heade...
{ "content_hash": "74943d8df8ee6829c9a01579dd68806e", "timestamp": "", "source": "github", "line_count": 513, "max_line_length": 102, "avg_line_length": 30.269005847953217, "alnum_prop": 0.5243431221020093, "repo_name": "credp/lisa", "id": "111aa0240e4c51d29bb8a0ea7863eb8c7b49e40b", "size": "16713",...
""" Helper methods for operations related to the management of volumes, and storage repositories for Windows 2012 """ import time from nova.openstack.common import cfg from nova.openstack.common import log as logging from nova.virt.hyperv import basevolumeutils LOG = logging.getLogger(__name__) CONF = cfg.CONF clas...
{ "content_hash": "c7df1b4107d8e3bff4150bffa37409c8", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 77, "avg_line_length": 40.528301886792455, "alnum_prop": 0.61731843575419, "repo_name": "maoy/zknova", "id": "6f5bcdac9d11772dfad160059253ba3e6f616ea3", "size": "2829", "...
from optparse import OptionParser import time, socket from struct import pack, unpack import signal def commandline(): parser = OptionParser(usage="%prog [OPTIONS] device src_ip_addr src_hw_addr broadcast_ip_addr netmask") parser.add_option("-i", "--interval", dest="interval", default="1000", ...
{ "content_hash": "6b4d67ac0f7ac6beee9a40a7fbc2a88d", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 107, "avg_line_length": 29.205128205128204, "alnum_prop": 0.5484342990927714, "repo_name": "chasemp/sup", "id": "01bf20367304c82dcea0211bf88aa73d30105d65", "size": "4051",...
import unittest from pywin32_testutil import str2bytes import win32api, win32con, win32event, winerror import sys, os import tempfile import datetime class CurrentUserTestCase(unittest.TestCase): def testGetCurrentUser(self): name = "%s\\%s" % (win32api.GetDomainName(), win32api.GetUserName()) sel...
{ "content_hash": "40a3c3d8ce74ba0c4690d05a25620152", "timestamp": "", "source": "github", "line_count": 201, "max_line_length": 115, "avg_line_length": 43.482587064676615, "alnum_prop": 0.6043478260869565, "repo_name": "sserrot/champion_relationships", "id": "26de71b0bf6ca9f7097b7d5e229db6483e01c4b7"...
from django import forms from django.forms.util import ErrorList from shout.models import Shout from shout.utils import is_private, user2link, url2link class ShoutForm(forms.ModelForm): class Meta: model = Shout fields = ('message',) def save(self, user, *args, **kwargs): instance = se...
{ "content_hash": "5318e35eda449f23315b44f4f3a267f7", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 76, "avg_line_length": 35.526315789473685, "alnum_prop": 0.6844444444444444, "repo_name": "django-stars/dash2011", "id": "c9ea15ec50361a899622ad014d72f68b0c1e4794", "size":...
"""Contains convenience wrappers for typical Neural Network TensorFlow layers. Additionally it maintains a collection with update_ops that need to be updated after the ops have been computed, for exmaple to update moving means and moving variances of batch_norm. Ops that have different behavior during tra...
{ "content_hash": "4f0a1c2e232e6a3000cbc6860a33aeeb", "timestamp": "", "source": "github", "line_count": 459, "max_line_length": 80, "avg_line_length": 39.34204793028322, "alnum_prop": 0.633514231919371, "repo_name": "trigeorgis/mdm", "id": "d6e8020a0f81cb944ef0925971edcf5f59d99568", "size": "18731"...
from builtins import range import json import random import time import itertools from ethereum.utils import ( parse_as_bin, big_endian_to_int, to_string, ) from ethereum.hybrid_casper import casper_utils from ethereum.meta import apply_block from ethereum.common import update_block_env_variables from ether...
{ "content_hash": "5c7ba2f7bf06e10747f189af89c68123", "timestamp": "", "source": "github", "line_count": 506, "max_line_length": 157, "avg_line_length": 43.47430830039526, "alnum_prop": 0.5793253932175653, "repo_name": "karlfloersch/pyethereum", "id": "8ee185d0369ac380662fa1c9e33dc0edfd322625", "siz...
"""Django Bouncy App"""
{ "content_hash": "b0a0a9bc771d0482bd211d6a7912df37", "timestamp": "", "source": "github", "line_count": 1, "max_line_length": 23, "avg_line_length": 24, "alnum_prop": 0.625, "repo_name": "ofa/django-bouncy", "id": "9cb20576a86765a79c2547158a4c960a3be5b7cf", "size": "24", "binary": false, "copie...
import json, sys, argparse import numpy as np import matplotlib matplotlib.use("Agg") import matplotlib.pyplot as plt from lsh_benchmark_plot import get_precision_recall, fscore, average_fscore if __name__ == "__main__": parser = argparse.ArgumentParser() parser.add_argument("benchmark_output") args = pars...
{ "content_hash": "ab5996a8c6d61c636ebb64ff2ecee1fa", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 89, "avg_line_length": 39.075, "alnum_prop": 0.6609085092770314, "repo_name": "arbazkhan002/datasketch", "id": "077d635851dd31e01546b2d9087af1cdafb80f3a", "size": "1563", ...
"""Unittests for the project.py module.""" import contextlib import os import shutil import subprocess import tempfile import unittest import error import git_command import git_config import platform_utils import project @contextlib.contextmanager def TempGitTree(): """Create a new empty git checkout for testing...
{ "content_hash": "cbfcef6e21faec3a23b6cd1104bcf350", "timestamp": "", "source": "github", "line_count": 323, "max_line_length": 79, "avg_line_length": 32.88235294117647, "alnum_prop": 0.6398644195461821, "repo_name": "lipro-yocto/git-repo", "id": "7dfbabb309aa507b8496b1979b23746581a80915", "size": ...
from django.conf import settings URL_EXCEPTIONS = getattr(settings, 'LOCKDOWN_URL_EXCEPTIONS', ()) PASSWORDS = getattr(settings, 'LOCKDOWN_PASSWORDS', ()) FORM = getattr(settings, 'LOCKDOWN_FORM', 'lockdown.forms.LockdownForm') SESSION_KEY = getattr(settings, 'LOCKDOWN_SESSION_KEY', 'lockdown-allow') LOGOUT_KEY = geta...
{ "content_hash": "0044c8cfe29d1f1d915ae5b97fe9ce76", "timestamp": "", "source": "github", "line_count": 12, "max_line_length": 73, "avg_line_length": 48.333333333333336, "alnum_prop": 0.743103448275862, "repo_name": "RanadeepPolavarapu/django-lockdown", "id": "f03ae3f93bf5cef245ad32f669d879c5740e0647...
class HTTPException(Exception): def __init__(self, value): self.value = value def __str__(self): return repr(self.value)
{ "content_hash": "00e03b7c7a2fae7daa6ae48338ab99fe", "timestamp": "", "source": "github", "line_count": 6, "max_line_length": 31, "avg_line_length": 24.333333333333332, "alnum_prop": 0.589041095890411, "repo_name": "tuvistavie/python2-http-wrapper", "id": "3dd611dd68e138bdb8da03703773d5df7bcde823", ...
import functools as ft from inspect import getdoc import re import h2o from h2o.automl._base import H2OAutoMLBaseMixin from h2o.automl._h2o_automl_output import H2OAutoMLOutput from h2o.base import Keyed from h2o.estimators import H2OEstimator from h2o.exceptions import H2OResponseError, H2OValueError from h2o.frame i...
{ "content_hash": "b2ba9b312a7365e8d6558aeaabf1fb6e", "timestamp": "", "source": "github", "line_count": 725, "max_line_length": 184, "avg_line_length": 53.69241379310345, "alnum_prop": 0.6022298147815142, "repo_name": "michalkurka/h2o-3", "id": "74ba5e025bbe07c9e5ccd64f951c36dec9dc38f8", "size": "3...
""" Copyright (c) 2011 Barry Schwartz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute,...
{ "content_hash": "ce891efba145e7c8c1813d665e9a2ad6", "timestamp": "", "source": "github", "line_count": 363, "max_line_length": 119, "avg_line_length": 44.17906336088154, "alnum_prop": 0.5297125397518239, "repo_name": "chemoelectric/sortsmill", "id": "8232bc556b51d325b107df41100d836b49c417a8", "siz...
from __future__ import print_function from PIL import VERSION, PILLOW_VERSION, _plugins import logging import warnings logger = logging.getLogger(__name__) class DecompressionBombWarning(RuntimeWarning): pass class _imaging_not_installed(object): # module placeholder def __getattr__(self, id): ...
{ "content_hash": "dd8676a3521347fb498e2c32378f1d26", "timestamp": "", "source": "github", "line_count": 2465, "max_line_length": 79, "avg_line_length": 32.640973630831645, "alnum_prop": 0.5632985334327616, "repo_name": "kronicz/ecommerce-2", "id": "06bf7ce945978f20ff0359876226d070041c92bf", "size":...
import time import abc import logging import xml.etree.ElementTree as ET from collections import OrderedDict import re import csv import tempfile import luigi from luigi import Task logger = logging.getLogger('luigi-interface') try: import requests except ImportError: logger.warning("This module requires the...
{ "content_hash": "5487cbbd36fb1f7a48302d714b21785c", "timestamp": "", "source": "github", "line_count": 650, "max_line_length": 122, "avg_line_length": 38.793846153846154, "alnum_prop": 0.5866116751269036, "repo_name": "Wattpad/luigi", "id": "dadbd86a65b7a5462fc0a2a906abdf574980e12e", "size": "2581...
import urllib.request import os import tarfile import tempfile import pypandoc import pymongo # setup database mongodb_url = os.environ.get('MONGODB_URL', 'mongodb://db:27017/db') mongo_client = pymongo.MongoClient(mongodb_url) db = mongo_client.get_default_database() def fetch_and_convert_tex(id): try: ...
{ "content_hash": "8ec51bf38838628aeacb85f5804fcb64", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 78, "avg_line_length": 30.34285714285714, "alnum_prop": 0.5362523540489642, "repo_name": "uetchy/readable-paper", "id": "fcd1ada8ac4d39f1b7461d447549af1fdb058b14", "size": ...
"""Handle file URL""" import mimetypes import os try: url2pathname = __import__('urllib.request').url2pathname except ImportError: url2pathname = __import__('urllib').url2pathname import multipla content_encodings = multipla.power_up('scriba.content_encodings') content_types = multipla.power_up('scriba.cont...
{ "content_hash": "c6fbd3535789138feb51d47b2ba86568", "timestamp": "", "source": "github", "line_count": 72, "max_line_length": 74, "avg_line_length": 30.291666666666668, "alnum_prop": 0.6405318661164603, "repo_name": "monkeython/scriba", "id": "14174037ec74dbe2e050250f799bbe177b380c0c", "size": "21...
"""Provide common Z-Wave JS fixtures.""" import asyncio import copy import io import json from unittest.mock import AsyncMock, patch import pytest from zwave_js_server.event import Event from zwave_js_server.model.driver import Driver from zwave_js_server.model.node import Node from zwave_js_server.version import Vers...
{ "content_hash": "9d618faafad8cde273da78550a880f49", "timestamp": "", "source": "github", "line_count": 738, "max_line_length": 105, "avg_line_length": 35.33739837398374, "alnum_prop": 0.7095747536331914, "repo_name": "kennedyshead/home-assistant", "id": "12db8bafb77c99ea42c7b83d4061c69150854733", ...
"""``PTransforms`` for manipulating files in Apache Beam. Provides reading ``PTransform``\\s, ``MatchFiles``, ``MatchAll``, that produces a ``PCollection`` of records representing a file and its metadata; and ``ReadMatches``, which takes in a ``PCollection`` of file metadata records, and produces a ``PCollection`` of ...
{ "content_hash": "6c5c5a373685a7049d7d44e696ed8696", "timestamp": "", "source": "github", "line_count": 743, "max_line_length": 95, "avg_line_length": 34.46433378196501, "alnum_prop": 0.6309993361190299, "repo_name": "RyanSkraba/beam", "id": "76b125fb60b50876665495394f4981c3495b32c8", "size": "2639...
import pytest from pages.desktop.categories import Categories from pages.desktop.home import Home @pytest.mark.nondestructive def test_there_are_6_extension_categories(base_url, selenium): page = Home(selenium, base_url).open() assert len(page.extension_category.list) == 6 @pytest.mark.nondestructive def t...
{ "content_hash": "11e58572d72ea308e0db00edadb138ac", "timestamp": "", "source": "github", "line_count": 131, "max_line_length": 76, "avg_line_length": 28.717557251908396, "alnum_prop": 0.694843168527379, "repo_name": "kumar303/addons-server", "id": "195c6c8ec9def8d1677787681294f29b60ff7c7a", "size"...
from ... import settings from ...compat import re_path from ...views.contacts import ContactListView, ContactDetailView urlpatterns = [ # These three URLs must be protected. re_path(r'^(?P<user>%s)/' % settings.USERNAME_PAT, ContactDetailView.as_view(), name='contact'), re_path(r'^', ContactListVie...
{ "content_hash": "6696d08eb251d77ffd2f812f009a9c4c", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 64, "avg_line_length": 35.3, "alnum_prop": 0.6827195467422096, "repo_name": "djaodjin/djaodjin-signup", "id": "26adacae36291ba0ab11cdf33d8515198716c3fa", "size": "1697", ...
__author__ = 'Yves Bonjour' from Mock import Mock class ArticleProxyMock(Mock): def set_id(self, identifier): self.identifier = identifier def add_article(self, title, text, updated_on, feed): self._handle_method_call("add_article", (title, text, updated_on, feed)) return self.identif...
{ "content_hash": "47e658d18bd4e66b9e0301cd863ec04e", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 80, "avg_line_length": 29.363636363636363, "alnum_prop": 0.6718266253869969, "repo_name": "ybonjour/nuus", "id": "515324ca5da7a34554df45dcadeb3b0b5fb055fe", "size": "323", ...
from __future__ import annotations from typing import Sequence, TYPE_CHECKING, Iterable from ezdxf.lldxf.tagger import internal_tag_compiler if TYPE_CHECKING: from ezdxf.lldxf.types import DXFTag from ezdxf.lldxf.extendedtags import ExtendedTags def compile_tags_without_handles(text: str) -> Iterable[DXFTag]...
{ "content_hash": "d8803d2f860d825d78e8c7a45445b3da", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 78, "avg_line_length": 28.145833333333332, "alnum_prop": 0.6550703182827535, "repo_name": "mozman/ezdxf", "id": "9e7aebfe9ed9b12069c2be6e4a46aeecee9b9b96", "size": "1416", ...
import logging import os import sys logging.basicConfig(level=logging.ERROR) top_dir = os.path.abspath(os.path.join(os.path.dirname(__file__), os.pardir, os.pardir)) sys.path.insert(0, top_dir) import taskflow.engines from taskflow.patte...
{ "content_hash": "01f0de6d6f61d799ac6dc04f8ad0bde1", "timestamp": "", "source": "github", "line_count": 168, "max_line_length": 79, "avg_line_length": 32.904761904761905, "alnum_prop": 0.6653400868306801, "repo_name": "citrix-openstack-build/taskflow", "id": "7367c348c44590902e6c91decd37249d5bfda60e"...
import datetime import json import random import re from collections import Counter from collections import defaultdict from dateutil.relativedelta import relativedelta from threading import Thread from time import time import requests from enum import Enum from lxml import etree from sqlalchemy import orm, sql from s...
{ "content_hash": "ce98f6d88ce51fa8e964cc33275f7230", "timestamp": "", "source": "github", "line_count": 1928, "max_line_length": 166, "avg_line_length": 37.51348547717842, "alnum_prop": 0.5870364737438819, "repo_name": "Impactstory/oadoi", "id": "dbd4540efb8b388d66512492ac49a566e622887a", "size": "...
def merge_sort(array): """ An implementation of the merge sort algorithm. Recursively sorts arrays by calling merge sort on halves of the array, then merging by comparing the first element of each array, then adding the smaller of the two to a the sorted array. """ # Base Cases ...
{ "content_hash": "c4b05446c779191be12ba9d7e00e11a0", "timestamp": "", "source": "github", "line_count": 41, "max_line_length": 76, "avg_line_length": 33, "alnum_prop": 0.5461936437546193, "repo_name": "doug-wade/AlgorithmsGreatestHits", "id": "7a9af552ba8b8b19dc208d6fc838d37bdd062715", "size": "135...
"""API for the glance service.""" from django import forms from django.views.decorators.csrf import csrf_exempt from django.views import generic from six.moves import zip as izip from openstack_dashboard import api from openstack_dashboard.api.rest import urls from openstack_dashboard.api.rest import utils as rest_ut...
{ "content_hash": "817eefd61fdd64d1f38c9ca8b56721b4", "timestamp": "", "source": "github", "line_count": 361, "max_line_length": 164, "avg_line_length": 37.77562326869806, "alnum_prop": 0.6227909364229669, "repo_name": "yeming233/horizon", "id": "cca4fd8d3865085cd5770d3181188051a64f8190", "size": "1...
import logging import traceback from pyscreenshot.childproc import childprocess_grab from pyscreenshot.err import FailedBackendError from pyscreenshot.plugins.gdk3pixbuf import Gdk3PixbufWrapper from pyscreenshot.plugins.freedesktop_dbus import FreedesktopDBusWrapper from pyscreenshot.plugins.gnome_dbus import GnomeDB...
{ "content_hash": "6ecec4fce667fb5c86d378e021ce5bb7", "timestamp": "", "source": "github", "line_count": 172, "max_line_length": 72, "avg_line_length": 30.348837209302324, "alnum_prop": 0.7017241379310345, "repo_name": "ponty/pyscreenshot", "id": "7e216def76d40e49b39852eb3eac1237fa3396af", "size": "...
"""Training the network.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections import datetime import functools import glob import itertools import json import os import random import sys import time import numpy as np import tensorflow as ...
{ "content_hash": "abef0af39465a192f8709ca31d6afc4b", "timestamp": "", "source": "github", "line_count": 364, "max_line_length": 92, "avg_line_length": 35.65934065934066, "alnum_prop": 0.6178736517719569, "repo_name": "google/cog", "id": "8642fbcc8699e6e95cb1741636719f3c00f34009", "size": "13637", ...
from django.template.defaultfilters import capfirst # noqa from django.template.defaultfilters import floatformat # noqa from django.utils.translation import ugettext as _ # noqa from django.views.generic import TemplateView # noqa from openstack_dashboard import usage from openstack_dashboard.usage import base ...
{ "content_hash": "e0c3788f284e4693848d32f2e6a050c8", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 62, "avg_line_length": 32.75, "alnum_prop": 0.6244274809160305, "repo_name": "deepakselvaraj/federated-horizon", "id": "28cd535f6e70ac2f0370522266684d600ae2b1e6", "size": "...
from .view import * from .register import * from .recover import * from .login import * from .logout import * from .edit_password import * from .edit_login import * from .password_form import * from .profile import * from .nabar_autocomplete import *
{ "content_hash": "de5f44fcdf417303be3e430723ad0f2a", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 33, "avg_line_length": 16, "alnum_prop": 0.73046875, "repo_name": "vinoth3v/In", "id": "073d90971fbc77d90ad06f40a93895af38351072", "size": "257", "binary": false, "copi...
from __future__ import absolute_import from datetime import timedelta from django.conf import settings from django.db import models from django.utils import timezone from django.utils.crypto import get_random_string from django.utils.translation import ugettext_lazy as _ from sentry.db.models import FlexibleForeign...
{ "content_hash": "71ea10b841468e94c9aadff15fa5a3ab", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 99, "avg_line_length": 31.73076923076923, "alnum_prop": 0.6733333333333333, "repo_name": "JackDanger/sentry", "id": "be43f7c9f642613cf86ac08a57e5e5e10ee27b69", "size": "165...
from django.contrib import messages from django.contrib.auth import views from django.contrib.auth.decorators import login_required from django.shortcuts import render, redirect from django.utils.http import urlsafe_base64_decode from admin.common_auth.models import MyUser @login_required def home(request): conte...
{ "content_hash": "31c55ef6469cfb1ae2baadf7afe56452", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 118, "avg_line_length": 36.3, "alnum_prop": 0.7061524334251607, "repo_name": "GageGaskins/osf.io", "id": "736dfee18487fc54f544008d41399c6f7d9ccc9d", "size": "1089", "bina...
""" Test LinearTimeInterpolator object """ from thetis.interpolation import * import numpy as np from scipy.interpolate import interp1d def do_interpolation(plot=False): np.random.seed(2) # construct data set x_scale = 100. ndata = 35 xx = np.linspace(0, x_scale, ndata) yy = np.random.rand(*...
{ "content_hash": "2587de3bbb84287f1f11cc1fcf5b4f8b", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 66, "avg_line_length": 25.264705882352942, "alnum_prop": 0.5960419091967404, "repo_name": "tkarna/cofs", "id": "b8ef21e9897dc93497ab3ea199e89750463eb74c", "size": "1718", ...
from PySide import QtCore, QtGui from androguard.core import androconf from androguard.gui.xrefwindow import XrefDialog from androguard.gui.sourcewindow import SourceWindow from androguard.gui.helpers import class2dotclass, classdot2class class TreeWindow(QtGui.QTreeWidget): '''TODO ''' def __init__(self...
{ "content_hash": "f3c3f1da84c5b2ecc99d455403c1289d", "timestamp": "", "source": "github", "line_count": 123, "max_line_length": 110, "avg_line_length": 38.34146341463415, "alnum_prop": 0.5945716709075488, "repo_name": "0x0mar/androguard", "id": "5bfaf25687433cc954a1b2bbf8fb45dcebe505f9", "size": "4...
from .standard import * from .periodic import *
{ "content_hash": "86554d3cc580b0f9384cbaf7aa9de597", "timestamp": "", "source": "github", "line_count": 2, "max_line_length": 23, "avg_line_length": 23.5, "alnum_prop": 0.7659574468085106, "repo_name": "pombredanne/unuk", "id": "60ca5bfb81cad9e540e1c964102138465caf4c5d", "size": "47", "binary": f...
'''TODO: - Finish battle system - Finish stat system - Finish writing tutorial - Add romance system - Finish save system''' #imports import stats import settings import save import items import battle import story import lists #what words count as "yes" or "no" name = "Debug" difficulty = "Normal" debu...
{ "content_hash": "e00450115df8d3c9089d7602b7b5f16b", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 155, "avg_line_length": 34.654545454545456, "alnum_prop": 0.5944386149003148, "repo_name": "Pleiadesu/drunkenknight", "id": "c0d85a135c50c282340a29e8e85f219cd33984b5", "siz...
from __future__ import absolute_import import six class AssistantManager(object): def __init__(self): self._guides = {} def add(self, guides): for k, v in six.iteritems(guides): self._guides[k] = v def get_valid_ids(self): return list(v["id"] for k, v in six.iteritems...
{ "content_hash": "9095cf41700701ec7880b95d3e15b38c", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 68, "avg_line_length": 23.318181818181817, "alnum_prop": 0.5730994152046783, "repo_name": "beeftornado/sentry", "id": "3e04fe94e3bd1d663c4419467e5bf2f05f33d3f8", "size": "5...
import numpy as np from .... import survey from ....utils import Zero, validate_ndarray_with_shape class BaseSrc(survey.BaseSrc): """Base DC/IP source Parameters ---------- receiver_list : list of SimPEG.electromagnetics.static.resistivity.receivers.BaseRx A list of DC/IP receivers locati...
{ "content_hash": "9ab93d1de957213a4374dc79b38ef2b2", "timestamp": "", "source": "github", "line_count": 260, "max_line_length": 109, "avg_line_length": 28.876923076923077, "alnum_prop": 0.5554075652637187, "repo_name": "simpeg/simpeg", "id": "e0c9368a1c8f7e4a3d6a737c8923755d76422b45", "size": "7508...
import os import sys # Without this environment variable set to 'no' importing 'gst' # causes 100% CPU load. (Tested on OSX.) os.environ['GST_REGISTRY_FORK'] = 'no' # Tested on OSX only. os.environ['GST_PLUGIN_PATH'] = os.path.join(sys._MEIPASS, 'gst_plugins')
{ "content_hash": "cf10135797c50789ebe0b2c94572bdd5", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 73, "avg_line_length": 24.09090909090909, "alnum_prop": 0.7018867924528301, "repo_name": "bl4ckdu5t/registron", "id": "6b3bc01f1271bdbe7498919de84feaf79a6e58ff", "size": "6...
import pylab as pl import pandas as pd import math cycle_start = 0.58 cycle_end = 1.81 duration_of_gait_cycle = cycle_end - cycle_start half_gait_cycle = 0.5 * duration_of_gait_cycle muscles = ['glut_max', 'iliopsoas', 'rect_fem', 'hamstrings', 'bifemsh', 'vasti', 'gastroc', 'soleus', 'tib_ant'...
{ "content_hash": "222c7eb39440bc769f968f4cbd628b81", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 75, "avg_line_length": 30.948275862068964, "alnum_prop": 0.6094707520891365, "repo_name": "opensim-org/opensim-core", "id": "daf179e24070bf55a926bf82a513e84d35cb3a78", "siz...
""" ===================================================== Distance computations (:mod:`scipy.spatial.distance`) ===================================================== .. sectionauthor:: Damian Eads Function Reference ------------------ Distance matrix computation from a collection of raw observation vectors stored in...
{ "content_hash": "f65002545ce0aae5b5d4436da9c6ae84", "timestamp": "", "source": "github", "line_count": 2245, "max_line_length": 80, "avg_line_length": 33.069042316258354, "alnum_prop": 0.5299973060344828, "repo_name": "maciejkula/scipy", "id": "bf9e4fa304396613f31e190787ed3e020eb4c5af", "size": "7...
import web import site import urllib import re import simplejson import web_user_auth from web import session from feed import Feed from tapechat_tag import TapeChatTag VALID_TAGS = ['a'] render = web.template.render('templates/', base='layout') render_plain = web.template.render('templates/', base='plain') valid_emai...
{ "content_hash": "518872cfc71fffade2a18c29d17c2c46", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 103, "avg_line_length": 26.024193548387096, "alnum_prop": 0.6355748373101953, "repo_name": "ednapiranha/tapechat", "id": "d8ba5f7b71b27575a47e0a6b94940ec92076c242", "size"...
from __future__ import nested_scopes """ ################################################################################ # # SOAPpy - Cayce Ullman (cayce@actzero.com) # Brian Matthews (blm@actzero.com) # Gregory Warnes (Gregory.R.Warnes@Pfizer.com) # Christopher Blunck (blunck...
{ "content_hash": "be56f932de6566d2ac2e2c65079f456a", "timestamp": "", "source": "github", "line_count": 565, "max_line_length": 102, "avg_line_length": 35.08141592920354, "alnum_prop": 0.5180364260128147, "repo_name": "m42e/jirash", "id": "374987955d08eddfba1ab5de0f60b1b6072fd190", "size": "19821",...
import os.path from baka.core import Job from baka.core import Container class SnapcraftJob(Job): def __init__(self, *args, **kwargs): super().__init__(*args, **kwargs) self._snap_filename = 'snapcraft_{}.snap'.format(self.name) def setup(self, c: Container, run_script: bool=True): s...
{ "content_hash": "5f826de18dd2124ce20f6d40135f26fb", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 101, "avg_line_length": 36.3235294117647, "alnum_prop": 0.6016194331983805, "repo_name": "tim-sueberkrueb/grout", "id": "4de20c9c0ac9eb45651b08bddacd62f104d5eb6b", "size": ...
from copy import deepcopy import numpy as np from ..fixes import _import_fft from ..io.pick import _pick_data_channels, pick_info from ..utils import verbose, warn, fill_doc, _validate_type from ..parallel import parallel_func, check_n_jobs from .tfr import AverageTFR, _get_data def _check_input_st(x_in, n_fft): ...
{ "content_hash": "c21e8cebf69db03067ecc165567c7ab8", "timestamp": "", "source": "github", "line_count": 268, "max_line_length": 79, "avg_line_length": 35.61940298507463, "alnum_prop": 0.5858998533417138, "repo_name": "bloyl/mne-python", "id": "a8e99acd4bd6cfc100e8ca8b0901e774eaec610a", "size": "969...
from __future__ import unicode_literals from django.db import models, migrations from django.conf import settings class Migration(migrations.Migration): dependencies = [ migrations.swappable_dependency(settings.AUTH_USER_MODEL), ('volunteers', '0025_auto_20150125_1922'), ] operations = ...
{ "content_hash": "a2f60247c57926ae9ea71580aaff5c1b", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 76, "avg_line_length": 27.59259259259259, "alnum_prop": 0.6080536912751678, "repo_name": "codeforgood2015/bnb", "id": "a1a59b79c9fc30129a45f03f0b49be3b5bfb293c", "size": "7...
from __future__ import print_function import os import re import sys import json import types import inspect import requests import tempfile import datetime import itertools try: import mock except ImportError: from unittest import mock if sys.version_info[:2] <= (2, 6): import unittest2 as unittest else:...
{ "content_hash": "dd28240e0cafe1c994a7dd8a90b8e8c1", "timestamp": "", "source": "github", "line_count": 434, "max_line_length": 78, "avg_line_length": 30.320276497695854, "alnum_prop": 0.5502697773387035, "repo_name": "dvrasp/TheTroz", "id": "33d0c14ee5d81f412cd8140481786df395ff1034", "size": "1315...
""" Copyright (c) 2016, Jose Dolz .All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the f...
{ "content_hash": "37f45bfa6d7fc539f726bc5a357655f7", "timestamp": "", "source": "github", "line_count": 288, "max_line_length": 143, "avg_line_length": 43.78472222222222, "alnum_prop": 0.5390959555908009, "repo_name": "josedolz/LiviaNET", "id": "5bad562b4188259356f937db54eecfb20dc34aac", "size": "1...
from .text import slugify from .validators import slug_re def patch_django_urls(): import django.utils.text as django_text import django.core.validators as django_validators django_text.slugify = slugify django_validators.slug_re = slug_re
{ "content_hash": "a7f865d31c1c69224fea12bd7916735b", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 54, "avg_line_length": 25.9, "alnum_prop": 0.749034749034749, "repo_name": "Alexx-G/django-unicode-urls", "id": "7e551144a2176f2b345fb1e10d7bd0bee3e82465", "size": "259", ...
from setuptools import find_packages, setup if __name__ == "__main__": setup( name="benchmarks", packages=find_packages(), )
{ "content_hash": "60f01bc49364629f0e22a333ecec302f", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 43, "avg_line_length": 21.428571428571427, "alnum_prop": 0.5733333333333334, "repo_name": "dedupeio/dedupe", "id": "73f83b12a26f64506c18c6d1e9517a729a09c17d", "size": "190",...
""" Checks for the Attribute Conventions for Dataset Discovery (ACDD) This module contains classes defined as checks part of the compliance checker project for the verification and scoring of attributes for datasets. """ from datetime import timedelta from functools import partial import numpy as np import pendulum ...
{ "content_hash": "38e513ec1ee0c95f3a5fb7430286dc33", "timestamp": "", "source": "github", "line_count": 843, "max_line_length": 149, "avg_line_length": 35.27876631079478, "alnum_prop": 0.5357767316745125, "repo_name": "ocefpaf/compliance-checker", "id": "f19903d5a94a782f1dec51fee600cc16526e4875", "...
from cpgReport import * from CGATReport.Tracker import * from CGATReport.odict import OrderedDict as odict ########################################################################## ########################################################################## class genesCoveredByNMI(cpgTracker): '''''' ANNOTAT...
{ "content_hash": "c4f3128469b9bcadd3e6587566c101e2", "timestamp": "", "source": "github", "line_count": 173, "max_line_length": 152, "avg_line_length": 37.6878612716763, "alnum_prop": 0.5315950920245399, "repo_name": "CGATOxford/CGATPipelines", "id": "cdc43caed54d83f75da2a79910d39453c611ff5d", "siz...
from typing import Optional, Callable from datetime import datetime, timedelta import inspect import logging import os.path import re import subprocess import time from .. import BaseSystem class Windows(BaseSystem): def __init__(self): super(Windows, self).__init__() self.__ntp = None ...
{ "content_hash": "48e369cbb1597fecf2a6e40edaf75b21", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 128, "avg_line_length": 37.883495145631066, "alnum_prop": 0.4917990773962071, "repo_name": "ralphwetzel/theonionbox", "id": "f18bff3774db91acbbba8ef63e38250c48c33cce", "si...
from django.conf.urls import url from . import views urlpatterns = [ url(r"^$", views.index), url(r"^data$", views.data), ]
{ "content_hash": "4fb3fa218668920b51d71da7e0d4a232", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 32, "avg_line_length": 15, "alnum_prop": 0.6222222222222222, "repo_name": "noahbkim/finances", "id": "468e3bf442da2ac0f36fe03377b37afb47197f14", "size": "135", "binary": f...
from ....testing import assert_equal from ..minc import Dump def test_Dump_inputs(): input_map = dict(annotations_brief=dict(argstr='-b %s', xor=(u'annotations_brief', u'annotations_full'), ), annotations_full=dict(argstr='-f %s', xor=(u'annotations_brief', u'annotations_full'), ), args=di...
{ "content_hash": "f058a6dfc584d0cf29b1ce7ff6c8581b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 78, "avg_line_length": 25.597014925373134, "alnum_prop": 0.5982507288629738, "repo_name": "carolFrohlich/nipype", "id": "c1de6510cfe3dfbcf13e463d1a23cc8ce1751b0a", "size": ...
"""Streamable BEL as JSON.""" import gzip import json from typing import Any, Iterable, List, TextIO, Union from networkx.utils import open_file from .nodelink import _augment_node, _prepare_graph_dict, _recover_graph_dict from ..constants import CITATION, SOURCE_MODIFIER, TARGET_MODIFIER from ..language import Cita...
{ "content_hash": "cef834dfc2f8148079fcad75fc118b34", "timestamp": "", "source": "github", "line_count": 126, "max_line_length": 111, "avg_line_length": 30.761904761904763, "alnum_prop": 0.6341589267285862, "repo_name": "pybel/pybel", "id": "c2168d7723a47a9187be564c4515c93bc283efd6", "size": "3901",...
from ctypes import ( byref, c_long, c_longlong, CDLL, Structure, ) from platform import uname from . import ( Clock, ClockTime, ) from ._arithmetic import nano_divmod __all__ = [ "SafeClock", "PEP564Clock", "LibCClock", ] class SafeClock(Clock): """ Clock implementation ...
{ "content_hash": "af728e2e7510928b5bc30157f5b3efe3", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 78, "avg_line_length": 22.059405940594058, "alnum_prop": 0.5870736086175943, "repo_name": "neo4j/neo4j-python-driver", "id": "60f82cc8bf10f647e3b1532d982465ba38554d5e", "s...
from setuptools import setup setup( name='FreeCAD-SEA', version='0.0', description="Statistical Energy Analysis module for FreeCAD.", long_description=open('README.txt').read(), author='Frederik Rietdijk', author_email='fridh@fridh.nl', license='LICENSE.txt', packages=['...
{ "content_hash": "0f36b047fff6ec88617af9a105bc443c", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 104, "avg_line_length": 30.875, "alnum_prop": 0.5951417004048583, "repo_name": "FRidh/Sea", "id": "52090d57ef636257f542683ccea71818a2735abf", "size": "494", "binary": fal...
""" ===================================== Blind source separation using FastICA ===================================== An example of estimating sources from noisy data. :ref:`ICA` is used to estimate sources given noisy measurements. Imagine 3 instruments playing simultaneously and 3 microphones recording the mixed si...
{ "content_hash": "bead22a9cec3e9d0663d891de4814b1e", "timestamp": "", "source": "github", "line_count": 73, "max_line_length": 79, "avg_line_length": 30.26027397260274, "alnum_prop": 0.6115889542779538, "repo_name": "treycausey/scikit-learn", "id": "4ac3b60b9e43db9b05bf90c512209aad095038ca", "size"...
import itertools import sys import mock from neutronclient.neutron.v2_0 import port from neutronclient import shell from neutronclient.tests.unit import test_cli20 class CLITestV20PortJSON(test_cli20.CLITestV20Base): def setUp(self): super(CLITestV20PortJSON, self).setUp(plurals={'tags': 'tag'}) de...
{ "content_hash": "bc4954724a902dce7f19c1e59821b2e9", "timestamp": "", "source": "github", "line_count": 758, "max_line_length": 79, "avg_line_length": 44.233509234828496, "alnum_prop": 0.5154344000715798, "repo_name": "noironetworks/python-neutronclient", "id": "f6fc6178312afda6bc1da0c3918b39e6bbfd8b...
from flask import Flask import twilio.twiml app = Flask(__name__) @app.route("/enqueue_call", methods=['GET', 'POST']) def enqueue_call(): resp = twilio.twiml.Response() with resp.enqueue(None, workflowSid="WW0123456789abcdef0123456789abcdef"): return str(resp)
{ "content_hash": "601095a01f4af00eaf99c33f68d75783", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 78, "avg_line_length": 25.545454545454547, "alnum_prop": 0.697508896797153, "repo_name": "teoreteetik/api-snippets", "id": "acea915456b8d809aecb5532d99d3f4f27734ee9", "size...
import contextlib import datetime import functools import logging import os import shutil import tempfile import threading from devil import base_error from devil.android import device_blacklist from devil.android import device_errors from devil.android import device_list from devil.android import device_utils from de...
{ "content_hash": "4b825994a2b41dca1c348d1094079afa", "timestamp": "", "source": "github", "line_count": 267, "max_line_length": 79, "avg_line_length": 32.57303370786517, "alnum_prop": 0.656203288490284, "repo_name": "google-ar/WebARonARCore", "id": "2aaf88b20a897228fa67d0086d7ce4d8135a27e6", "size"...
""" Support for Clementine Music Player as media player. For more details about this platform, please refer to the documentation at https://home-assistant.io/components/media_player.clementine/ """ from datetime import timedelta import logging import time import voluptuous as vol from homeassistant.components.media_...
{ "content_hash": "bf8155274f7abfc1332f7e7800220cef", "timestamp": "", "source": "github", "line_count": 220, "max_line_length": 79, "avg_line_length": 31.181818181818183, "alnum_prop": 0.6088921282798834, "repo_name": "tinloaf/home-assistant", "id": "2add2bd682a6044ff7dd086567377144e2c14837", "size...
import thread # If this fails, we can't test this module import asyncore, asynchat, socket, threading, time HOST = "127.0.0.1" PORT = 54321 class echo_server(threading.Thread): def run(self): sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) sock.setsockopt(socket.SOL_SOCKET, socket.SO_REU...
{ "content_hash": "54a1e9b4228a37da74a0ab69ea19f98b", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 66, "avg_line_length": 25.839285714285715, "alnum_prop": 0.572218382861092, "repo_name": "loongson-community/EFI-MIPS", "id": "e91c572162cb606b262d07c432543d3469789cab", "s...
""" The MIT License (MIT) Copyright (c) 2015-present Rapptz Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merg...
{ "content_hash": "8a5599f96c97b6fb887c09e6e6253341", "timestamp": "", "source": "github", "line_count": 117, "max_line_length": 109, "avg_line_length": 31.641025641025642, "alnum_prop": 0.6769313884386818, "repo_name": "Rapptz/discord.py", "id": "2243a040836d3f9e910452215b9830e005cc7c75", "size": "...
import os import sys sys.path.append('/home3/redwards/bioinformatics/Modules') import re import rob import gzip '''Combine .gbff and .fna files to get just the coding sequences. We need to get the data from RefSeq and they have split DNA sequences out of GenBank files so it is not clear that biopython etc will work. ...
{ "content_hash": "b7b4723800f47ae4262248492a90faa8", "timestamp": "", "source": "github", "line_count": 110, "max_line_length": 116, "avg_line_length": 27.463636363636365, "alnum_prop": 0.5306190003310162, "repo_name": "linsalrob/PhageHosts", "id": "e269aa6d274f9dfd7ae2f987dae444d0e8eb475b", "size"...
from basil.HL.arduino_base import ArduinoBase class I2CTransmissionError(ValueError): pass class SerialToI2C(ArduinoBase): CMDS = { 'write': 'W', 'read': 'R', 'address': 'A', 'check': 'T' } ERRORS = { 'error': "Serial transmission error" # Custom return cod...
{ "content_hash": "724d78d1bf62631c8d2d2e411150f85e", "timestamp": "", "source": "github", "line_count": 132, "max_line_length": 103, "avg_line_length": 26.454545454545453, "alnum_prop": 0.5438144329896907, "repo_name": "SiLab-Bonn/basil", "id": "d8c39c87034ede35740d736203a7ddd123799d17", "size": "3...
import datetime from decimal import Decimal DEFAULT_CHARSET = 'utf-8' class DjangoUnicodeDecodeError(UnicodeDecodeError): def __init__(self, obj, *args): self.obj = obj super().__init__(*args) def __str__(self): return '%s. You passed in %r (%s)' % ( super().__str__(), ...
{ "content_hash": "d754f2de4d0fb22cfb17d93a374b4c40", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 74, "avg_line_length": 24.71875, "alnum_prop": 0.6131479140328698, "repo_name": "ThiefMaster/indico", "id": "588b2fc2002c995750187b01d5606507bd0e1d85", "size": "2151", "b...
""" for debugging, profiling. May not work right now. """ import cProfile from pstats import Stats profFN = "RinexObsReader.pstats" cProfile.run("rinexobs(rinexfn)", profFN) Stats(profFN).sort_stats("time", "cumulative").print_stats(20)
{ "content_hash": "062eeee05d10bef8a82b0014d18d4811", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 62, "avg_line_length": 23.9, "alnum_prop": 0.7447698744769874, "repo_name": "geospace-code/georinex", "id": "77b7eb42db9efabb94fa396bececcd22eb89eaa7", "size": "261", "bi...
'''Cable Rigging Tool. Drag this script to shelf, or execute from editor to run''' import maya.cmds as cmds class RigCurveTool(object): '''Creates a rig from the given curve. Rig is a NURBS strip that is skinned to the controls. The strip in turn has a series of locators attached to it using a setup me...
{ "content_hash": "4d94a1aebb8c374f318ffe4797b70d27", "timestamp": "", "source": "github", "line_count": 489, "max_line_length": 124, "avg_line_length": 44.061349693251536, "alnum_prop": 0.5900863269284322, "repo_name": "BenBarker/CurveRigger", "id": "53b9688ab38c75c5e106ae9f63487a5bd839aa53", "size...
from django_blog.profiles.models import Profile from django.shortcuts import render_to_response, get_object_or_404 from django.template import RequestContext from django.contrib.auth.forms import UserCreationForm from django.contrib.auth.models import User from django.core.urlresolvers import reverse from django.http i...
{ "content_hash": "b3e9bc45c753ac2c92f1088eda106fd8", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 91, "avg_line_length": 32.65625, "alnum_prop": 0.7588516746411483, "repo_name": "jhjguxin/blogserver", "id": "77c992d1c20d87fac7cbba40d9234f366d847282", "size": "1045", "...
""" WSGI config for mServer 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.9/howto/deployment/wsgi/ """ ''' import os from django.core.wsgi import get_wsgi_application os.environ.setdefault("DJANGO_SE...
{ "content_hash": "d48e1d9bb7a75c8b6d0815c6ec5fb627", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 78, "avg_line_length": 24.17241379310345, "alnum_prop": 0.7674750356633381, "repo_name": "Jameeeees/Mag1C_baNd", "id": "85cc13cd1154a97f22f6fba942da76fe4e4cb443", "size": "...
"""A module for creating a saturated vapour pressure table""" import warnings import iris import numpy as np from iris.cube import Cube from numpy import ndarray from improver import BasePlugin from improver.constants import TRIPLE_PT_WATER class SaturatedVapourPressureTable(BasePlugin): """ Plugin to cre...
{ "content_hash": "0abfea480beb91c56ec8478d00b25a2e", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 86, "avg_line_length": 36, "alnum_prop": 0.5599705665930832, "repo_name": "metoppv/improver", "id": "20339385426f7fbc7d752f2f05e7a5b2dce518a5", "size": "7093", "binary":...
import os import pkg_resources import sqlite3 import sys import traceback import uuid from django.core.cache import cache from django.core.cache.backends.locmem import LocMemCache from django.db.backends.postgresql.base import DatabaseWrapper as BaseDatabaseWrapper from awx.main.utils import memoize __loc__ = LocMem...
{ "content_hash": "ffc236cb3a12c11f98b5c3b19c6e70c6", "timestamp": "", "source": "github", "line_count": 155, "max_line_length": 86, "avg_line_length": 36.70967741935484, "alnum_prop": 0.5706502636203866, "repo_name": "GoogleCloudPlatform/sap-deployment-automation", "id": "2a449437ce15da542ae323b1c666...
from functools import partial import zlib import json from io import BytesIO import sys import platform from electrum.plugins import BasePlugin, hook from electrum_gui.qt.util import WaitingDialog, EnterButton, WindowModalDialog from electrum.util import print_msg, print_error from electrum.i18n import _ from PyQt4.Q...
{ "content_hash": "4c98903ceb9e37c3ffdb7380651cb4ba", "timestamp": "", "source": "github", "line_count": 127, "max_line_length": 80, "avg_line_length": 32.173228346456696, "alnum_prop": 0.6120900636319139, "repo_name": "aasiutin/electrum", "id": "6e59f007ea04b497fc136672bd63e36dc6abddd5", "size": "4...
from setuptools import setup setup( name='sfdc-bulk', packages=['sfdc_bulk'], version='0.2', description='Python client library for SFDC bulk API', url='https://github.com/donaldrauscher/sfdc-bulk', author='Donald Rauscher', author_email='donald.rauscher@gmail.com', license='MIT', i...
{ "content_hash": "3caf9c5718730e1661a89f90be0bd403", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 58, "avg_line_length": 23.88888888888889, "alnum_prop": 0.6139534883720931, "repo_name": "donaldrauscher/sfdc-bulk", "id": "ed5c1f0097b76ad6988c4b6100ac48272123d53f", "size...
"""This example demonstrates how to handle partial failures. To get ad groups, run get_ad_groups.py. The LoadFromStorage method is pulling credentials and properties from a "googleads.yaml" file. By default, it looks for this file in your home directory. For more information, see the "Caching authentication informati...
{ "content_hash": "048a87f8321482e0bba7d73d497f629c", "timestamp": "", "source": "github", "line_count": 108, "max_line_length": 80, "avg_line_length": 30.48148148148148, "alnum_prop": 0.5692588092345079, "repo_name": "dietrichc/streamline-ppc-reports", "id": "c801d34ef2c87c7964c44b9054d8cac7030111e9"...
#/* author:@shivkrthakur */ # Enter your code here. Read input from STDIN. Print output to STDOUT input1 = int(raw_input().strip()) input2 = int(raw_input().strip()) print input1 + input2 print input1 - input2 print input1 * input2
{ "content_hash": "c078450ed4decbb209e0b93f85e1933f", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 69, "avg_line_length": 26, "alnum_prop": 0.7136752136752137, "repo_name": "shivkrthakur/HackerRankSolutions", "id": "41231fd5c65220a9113c3d0f6c9856b061b9d647", "size": "234"...
import sys import os # -- Aplus configuration -------------------------------------------------- course_open_date = '2021-01-01' course_close_date = '2021-12-31' aplusmeta_substitutions = { 'open01': '2016-01-02 12:00', 'close01': '2016-03-01 12:00' } questionnaire_default_submissions = 5 program_default_subm...
{ "content_hash": "5e3bdf07185a47f3c671098bef3b1b30", "timestamp": "", "source": "github", "line_count": 98, "max_line_length": 79, "avg_line_length": 32.93877551020408, "alnum_prop": 0.6970260223048327, "repo_name": "Aalto-LeTech/a-plus-rst-tools", "id": "7d256c6afb8ac6338d0f33f4dca8e80fd9cd1b76", ...
""" 1D Forward Simulation for a Single Sounding =========================================== Here we use the module *SimPEG.electromangetics.frequency_domain_1d* to predict frequency domain data for a single sounding over a 1D layered Earth. In this tutorial, we focus on the following: - Defining receivers, source...
{ "content_hash": "313de741afdad4dea879ab85ee8f7937", "timestamp": "", "source": "github", "line_count": 195, "max_line_length": 83, "avg_line_length": 30.984615384615385, "alnum_prop": 0.6519364448857994, "repo_name": "simpeg/simpeg", "id": "188c9d44681d350b7e77cbcc3295af1bab26910b", "size": "6042"...
from unittest import main, TestCase from simhash import Simhash, SimhashIndex class TestSimhash(TestCase): def test_value(self): self.assertEqual(Simhash(['aaa', 'bbb']).value, 8637903533912358349) def test_distance(self): sh = Simhash('How are you? I AM fine. Thanks. And you?') sh2 ...
{ "content_hash": "8ca55284fbbf1f975d058e930bb51e41", "timestamp": "", "source": "github", "line_count": 118, "max_line_length": 108, "avg_line_length": 36.144067796610166, "alnum_prop": 0.5896834701055099, "repo_name": "cjauvin/simhash", "id": "2bd8839f2aa7d4b6583524aa4731b1bfd99c4f7d", "size": "43...
from __future__ import absolute_import from __future__ import division, print_function, unicode_literals from collections import defaultdict from ..nlp.stemmers import null_stemmer from ._summarizer import AbstractSummarizer from .edmundson_cue import EdmundsonCueMethod from .edmundson_key import EdmundsonKeyMethod fr...
{ "content_hash": "1782d2bb9fcfaf8a07fcf6cd28436b9a", "timestamp": "", "source": "github", "line_count": 136, "max_line_length": 123, "avg_line_length": 37.93382352941177, "alnum_prop": 0.6673773987206824, "repo_name": "WangWenjun559/Weiss", "id": "dad164acf71663c1c485ca15a6ab745c369aa6e3", "size": ...
import os import logging import yaml from schema import Use, Schema, SchemaError, Optional class InvalidConfig(Exception): pass class MissingConfig(Exception): pass default_config = { 'debug': False } schema = Schema({ 'tracked_repositories': [Use(str)], 'unstable_tests': [Use(str)], 'api_...
{ "content_hash": "8319caf7fe722834be997626c3e9079c", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 71, "avg_line_length": 21.951219512195124, "alnum_prop": 0.5383333333333333, "repo_name": "fastmonkeys/vakautin", "id": "5aebb12e8ffab4d08321d16ddcba28d765d6e21c", "size": ...
from pyramid.renderers import get_renderer from pyramid.view import view_config from . import get_employee_info from . import get_report_info from . import list_employees def get_main_template(request): main_template = get_renderer('templates/main.pt') return main_template.implementation() @view_config(rout...
{ "content_hash": "648fecf64599c6cb594832e1a2831df2", "timestamp": "", "source": "github", "line_count": 50, "max_line_length": 74, "avg_line_length": 32.34, "alnum_prop": 0.647495361781076, "repo_name": "GoogleCloudPlatform/google-cloud-python-expenses-demo", "id": "71ad5239b29987b56722446bdf24f47ddf...
import sys import requests from xml.etree import cElementTree as ElementTree # for zillow API from .pyzillowerrors import ZillowError, ZillowFail, ZillowNoResults from . import __version__ class ZillowWrapper(object): """ """ def __init__(self, api_key=None): """ """ self.api_...
{ "content_hash": "2f2d5eed3f5471733ef1eb968199d135", "timestamp": "", "source": "github", "line_count": 226, "max_line_length": 78, "avg_line_length": 31.154867256637168, "alnum_prop": 0.5477915068882261, "repo_name": "kbussell/pyzillow", "id": "599b15f50c8c494a4ec7cf4f3075197ad76a4fa7", "size": "7...
from __future__ import print_function import numpy as np import codecs # Setup unicode encoding to work import sys reload(sys) sys.setdefaultencoding('utf8') sys.stdout = codecs.getwriter("utf-8")(sys.stdout) line_seps = [u'0x000A', u'0x000B', u'0x000C', u'0x000D', u'0x001C', u'0x001D', u'0x001E', u'0x0085', u'0x2028...
{ "content_hash": "631b504d18e7d3d1fbfc17d67129ec22", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 122, "avg_line_length": 33.525, "alnum_prop": 0.6562266964951529, "repo_name": "kahliloppenheimer/Web-page-classification", "id": "53f9afda02552ea575c8a04c6bc0541e63ec2a42", ...
import warnings from wtforms import fields, validators from sqlalchemy import Boolean, Column from flask_admin import form from flask_admin.model.form import (converts, ModelConverterBase, InlineModelConverterBase, FieldPlaceholder) from flask_admin.model.fields import AjaxSelectFi...
{ "content_hash": "37a8b19463484fce8a3f6437e635e76a", "timestamp": "", "source": "github", "line_count": 636, "max_line_length": 107, "avg_line_length": 35.605345911949684, "alnum_prop": 0.5672775447118569, "repo_name": "closeio/flask-admin", "id": "e3434ca324c88d97908ad564376764684e0e4e93", "size":...
""" Wyrd In: Time tracker and task manager CC-Share Alike 2012 © The Wyrd In team https://github.com/WyrdIn This module collects rather universal utility functions. """ from contextlib import contextmanager import os.path from shutil import copy2, move @contextmanager def open_backed_up(fname, mode='r', suffix='~'...
{ "content_hash": "593562045b8a9fbed30880c87b02785e", "timestamp": "", "source": "github", "line_count": 84, "max_line_length": 79, "avg_line_length": 30.988095238095237, "alnum_prop": 0.6319631194775259, "repo_name": "RichardLitt/wyrd-django-dev", "id": "4031c351832ffa8b95bb43646fa5f8c9fe880fe1", "...
from django.shortcuts import render from django.contrib.auth.decorators import permission_required from django.conf import settings from django.template import RequestContext from django.template.loader import render_to_string from wagtail.wagtailadmin.forms import SearchForm from wagtail.wagtailcore import hooks fro...
{ "content_hash": "5e7411f963885977fab5d155bffdef0d", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 137, "avg_line_length": 33.96629213483146, "alnum_prop": 0.6685411842540523, "repo_name": "benemery/wagtail", "id": "e68ed0cbf17ae2c4596c70ec3c04e4b45eafa792", "size": "302...
from __future__ import print_function import sys import cPickle as pickle import pandas as pd import numpy as np from keras.preprocessing import sequence from keras.models import Sequential from keras.layers.core import Dense, Dropout, Activation, Flatten from keras.layers.embeddings import Embedding from keras.layers...
{ "content_hash": "7bbb55fb4d8657b374b197d59ccca036", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 114, "avg_line_length": 37.75714285714286, "alnum_prop": 0.6632614453272796, "repo_name": "leocnj/dl_response_rater", "id": "2cc7f7db73805a0b401a9aaf4c8edf5148e39a92", "si...
import dbhelper Database = dbhelper.Database
{ "content_hash": "63332307efab71749f9aef7f8981515a", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 28, "avg_line_length": 15.333333333333334, "alnum_prop": 0.8260869565217391, "repo_name": "wangjun/BT-Share", "id": "1d280de54a135412b31535ad9d0327b1810ff082", "size": "87",...
import shutil from nose.tools import * from holland.lib.lvm import LogicalVolume from holland.lib.lvm.snapshot import * from tests.constants import * class TestSnapshot(object): def setup(self): self.tmpdir = tempfile.mkdtemp() def teardown(self): shutil.rmtree(self.tmpdir) def test_snap...
{ "content_hash": "67366718d0cab5624b39f33c2fcd1431", "timestamp": "", "source": "github", "line_count": 52, "max_line_length": 98, "avg_line_length": 35.07692307692308, "alnum_prop": 0.600328947368421, "repo_name": "m00dawg/holland", "id": "d5846b72013188d68b2e5949bd8de4747ea8754d", "size": "1824",...
import BoostBuild t = BoostBuild.Tester() t.write("Jamroot.jam", """\ import type : type ; ECHO [ type source.c ] ; ECHO [ type source.cc ] ; ECHO [ type source.cxx ] ; ECHO [ type source.cpp ] ; ECHO [ type source.o ] ; ECHO [ type source.obj ] ; ECHO [ type boost_system.lib ] ; ECHO [ type boost_system.so ] ; ECHO ...
{ "content_hash": "2093d1a7bbb9d5ac569dd79a8ddaa6a6", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 42, "avg_line_length": 16, "alnum_prop": 0.6484375, "repo_name": "davehorton/drachtio-server", "id": "9924e336a5d009031178cbb1418c94fbac08e529", "size": "829", "binary": ...
"""convert Comma-Separated Value (.csv) files to a TermBase eXchange (.tbx) glossary file""" from translate.misc import sparse from translate.storage import tbx from translate.storage import csvl10n class csv2tbx: """a class that takes translations from a .csv file and puts them in a .tbx file""" def __init__...
{ "content_hash": "da2ef56e6b74b36a71e7e41e728dd751", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 103, "avg_line_length": 43.357142857142854, "alnum_prop": 0.6482701812191104, "repo_name": "dbbhattacharya/kitsune", "id": "a1333de0a2e9f6bdc6b77cc11d535a84730932a0", "size...