text
stringlengths
4
1.02M
meta
dict
from MafiaBot.MafiaItem import MafiaItem from MafiaBot.MafiaAction import MafiaAction class FakeBackgroundCheck(MafiaItem): def __init__(self, name, receiveday=0): super(FakeBackgroundCheck, self).__init__(name, receiveday) self.type = MafiaItem.CHECK self.fake = True def ReceiveItem...
{ "content_hash": "6ecea4dfd96a67c8bd3c977402837f80", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 205, "avg_line_length": 44.6, "alnum_prop": 0.6266816143497758, "repo_name": "LLCoolDave/MafiaBot", "id": "8c4a793601b5af35ee9bdc170a7cdae4c730c0c4", "size": "1784", "bin...
"""Code for creating a dataset out of a NumPy array.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.data.ops import dataset_ops from tensorflow.python.eager import context from tensorflow.python.framework impor...
{ "content_hash": "b08ddaca5a41f713bb310ccf8259119b", "timestamp": "", "source": "github", "line_count": 83, "max_line_length": 80, "avg_line_length": 38.433734939759034, "alnum_prop": 0.6905956112852665, "repo_name": "ageron/tensorflow", "id": "5881e4cd59e75ac5184e400bd0ac90443084635e", "size": "38...
from . import core from . import data from .data import get # from .core import year_frac, PerformanceStats, GroupStats, merge from .core import * core.extend_pandas() __version__ = (0, 3, 6)
{ "content_hash": "dfe1cb0f7fe202ed9bc69a16abbacaad", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 66, "avg_line_length": 17.818181818181817, "alnum_prop": 0.7040816326530612, "repo_name": "pmorissette/ffn", "id": "bf6760b46fb2c3f03e19eeb8969ba6fb54a308d6", "size": "196"...
""" gargoyle.nexus_modules ~~~~~~~~~~~~~~~~~~~~~~ :copyright: (c) 2010 DISQUS. :license: Apache License 2.0, see LICENSE for more details. """ import logging import nexus import os.path from functools import wraps from django.conf import settings from django.http import HttpResponse, HttpResponseNotFound from garg...
{ "content_hash": "52cf21639f12253766f250c21d861281", "timestamp": "", "source": "github", "line_count": 314, "max_line_length": 122, "avg_line_length": 31.29936305732484, "alnum_prop": 0.5534188034188035, "repo_name": "miing/mci_migo_packages_gargoyle", "id": "bf0c0792b23b19cbec72c7ddc4516649460ba01c...
import os import logging from project_generator_definitions.definitions import ProGenTargets from ..tools_supported import ToolsSupported from ..generate import Generator from ..settings import ProjectSettings from . import argparse_filestring_type help = 'List general progen data as projects, tools or targets' def...
{ "content_hash": "f494bd6809a2ed8e1dfce0bd242b20ef", "timestamp": "", "source": "github", "line_count": 40, "max_line_length": 112, "avg_line_length": 42.55, "alnum_prop": 0.6257344300822562, "repo_name": "ohagendorf/project_generator", "id": "aa1ab6caef8965f101fb81598b04dbbebc59fff7", "size": "227...
from __future__ import unicode_literals, division """ This module implements error handlers for Nwchem runs. Currently tested only for B3LYP DFT jobs. """ __author__ = "Shyue Ping Ong" __version__ = "0.1" __maintainer__ = "Shyue Ping Ong" __email__ = "ongsp@ucsd.edu" __status__ = "Beta" __date__ = "5/20/13" from c...
{ "content_hash": "81336492dba4ef2ff2ad5a5e3e7a02d7", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 79, "avg_line_length": 34.60606060606061, "alnum_prop": 0.5344424985405721, "repo_name": "specter119/custodian", "id": "920ea19d8d07211bb975abfa43bfa335dd9b0cc6", "size": "...
import datetime from south.db import db from south.v2 import DataMigration from django.db import models from socialbeer.posts.models import Post from socialregistration.models import TwitterProfile class Migration(DataMigration): def forwards(self, orm): "Write your forwards methods here." for p...
{ "content_hash": "236fa478650985e69a5043072d6a98ab", "timestamp": "", "source": "github", "line_count": 99, "max_line_length": 182, "avg_line_length": 64.33333333333333, "alnum_prop": 0.5435704192180876, "repo_name": "fxdgear/beersocial", "id": "2d139b9cfe8b78b02bfabac5ccb0d237dbc0f5f7", "size": "6...
from bs4 import BeautifulSoup from bs4.element import NavigableString from bs4.element import Tag SOURCE = "/Users/lindsayrgwatt/apps/kindle2text/recent_highlights.html" entries = open(SOURCE, 'r') soup = BeautifulSoup(entries) highlights = {} # {'book title':[highlight1, highlight2]} current_book = {} # Each book ...
{ "content_hash": "35ecdbec42dae9d94114cc5216d34194", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 105, "avg_line_length": 30.766666666666666, "alnum_prop": 0.609967497291441, "repo_name": "lindsayrgwatt/kindle2text", "id": "f4d7a8dea994e077c86a5c9c98a8393859653719", "si...
from pip.backwardcompat import any import textwrap from tests.test_pip import reset_env, run_pip, write_file from tests.path import Path def test_download_if_requested(): """ It should download (in the scratch path) and not install if requested. """ env = reset_env() result = run_pip('install', ...
{ "content_hash": "7cdfff21df3f23cdcfa437405f24b11c", "timestamp": "", "source": "github", "line_count": 43, "max_line_length": 101, "avg_line_length": 36.18604651162791, "alnum_prop": 0.6696658097686375, "repo_name": "integricho/heroku-buildpack-python-ffmpeg2-lame", "id": "5d4923ccdedbd8da96e7043e96...
from __future__ import (absolute_import, division, print_function) __metaclass__ = type DOCUMENTATION = """ lookup: hashi_vault author: Jonathan Davila <jdavila(at)ansible.com> version_added: "2.0" short_description: retrieve secrets from HasihCorp's vault requirements: - hvac (python library) descript...
{ "content_hash": "695b691a6f75796cf8ddbaa6a4d5b4c8", "timestamp": "", "source": "github", "line_count": 200, "max_line_length": 159, "avg_line_length": 35.4, "alnum_prop": 0.6244350282485875, "repo_name": "e-gob/plataforma-kioscos-autoatencion", "id": "6b11f5f1bd17c6f3b86e0129819ab99ad00e9bbf", "si...
import mock from oslo_messaging.rpc import dispatcher from heat.common import exception from heat.engine import service from heat.engine import service_stack_watch from heat.engine import stack from heat.engine import watchrule from heat.objects import stack as stack_object from heat.objects import watch_data as watch...
{ "content_hash": "c0643b46e7b17fe636f984b26edd8b69", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 78, "avg_line_length": 45.22529644268775, "alnum_prop": 0.5297150847753889, "repo_name": "dims/heat", "id": "c47963ca342ee886dd872a31906655bb1758a0e4", "size": "12017", ...
from __future__ import unicode_literals from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('cart', '0007_cartitem_begin_date'), ] operations = [ migrations.AddField( model_name='cartitem', name='auto_renew', ...
{ "content_hash": "24ebabe0c9708c838885b1a69d5e62b3", "timestamp": "", "source": "github", "line_count": 18, "max_line_length": 52, "avg_line_length": 21.22222222222222, "alnum_prop": 0.5942408376963351, "repo_name": "davogler/POSTv3", "id": "83d35b621f9ce224fba5e46b59a5a137caec7d3e", "size": "406",...
""" Tests for flask-geckoboard. """ from test_decorators import *
{ "content_hash": "68072aa96364095a1de383c95c769eac", "timestamp": "", "source": "github", "line_count": 5, "max_line_length": 29, "avg_line_length": 13.4, "alnum_prop": 0.7014925373134329, "repo_name": "rossdeane/flask-geckoboard", "id": "ad579f135437fa93c6d533eeb60a40c98b6289b2", "size": "67", "...
"""Provides a sensor for Home Connect.""" from datetime import timedelta import logging from homeassistant.components.sensor import SensorDeviceClass, SensorEntity from homeassistant.config_entries import ConfigEntry from homeassistant.const import CONF_ENTITIES from homeassistant.core import HomeAssistant from homeas...
{ "content_hash": "0e5a421e881fd8b6ace0424cf936602f", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 84, "avg_line_length": 35, "alnum_prop": 0.5910364145658263, "repo_name": "mezz64/home-assistant", "id": "38a45ccf7095e15e93ef93dc76f7bc1adf624d61", "size": "3570", "bin...
''' Copyleft May 04, 2017 Arya Iranmehr, PhD Student, Bafna Lab, UC San Diego, Email: airanmehr@gmail.com ''' import numpy as np; np.set_printoptions(linewidth=200, precision=5, suppress=True) import pandas as pd; pd.options.display.max_rows = 20; pd.options.display.expand_frame_repr = False import seaborn as sns im...
{ "content_hash": "636dffccd749ff7a8c1118136ef43f0d", "timestamp": "", "source": "github", "line_count": 19, "max_line_length": 102, "avg_line_length": 26.68421052631579, "alnum_prop": 0.7593688362919132, "repo_name": "airanmehr/bio", "id": "1183ed4b89785a16bae2ec38800fee372192f647", "size": "507", ...
import sys import os import os.path as op import glob import warnings import shutil from nose.tools import assert_true, assert_equal, assert_raises from nose.plugins.skip import SkipTest from mne import Epochs, read_events, pick_types, read_evokeds from mne.io import Raw from mne.datasets import testing from mne.repo...
{ "content_hash": "a08a4b7bd1029285eb7a6f815212ad94", "timestamp": "", "source": "github", "line_count": 266, "max_line_length": 79, "avg_line_length": 38.6578947368421, "alnum_prop": 0.6388213556355149, "repo_name": "cmoutard/mne-python", "id": "f10167bdd6bf1d854ba06dcaf6e29c7605fc261e", "size": "1...
''' Copyright (C) 2016 Dato, Inc. All rights reserved. This software may be modified and distributed under the terms of the BSD license. See the LICENSE file for details. ''' from __future__ import print_function from ..sys_util import get_config_file from ..sys_util import setup_environment_from_config_file from ..s...
{ "content_hash": "91fb23cb3b2a94df26d02a33737ab08a", "timestamp": "", "source": "github", "line_count": 82, "max_line_length": 98, "avg_line_length": 28.024390243902438, "alnum_prop": 0.6575282854656223, "repo_name": "haijieg/SFrame", "id": "1d109ab0edc7bc8c64166deb0b38e7d0afa48d54", "size": "2322"...
import re import collections from JumpScale import j STATUS_LINE = re.compile('^Status:\s*(.+)') RULE_LINE = re.compile('^\[\s*(\d+)\] (.+?)\s{2,}(.+?)\s{2,}(.+)$') ParsedDestination = collections.namedtuple('ParsedDestination', 'ip proto port dev') class UFWError(Exce...
{ "content_hash": "091a47a6a52546f9361c13ce411afcbc", "timestamp": "", "source": "github", "line_count": 292, "max_line_length": 80, "avg_line_length": 24.715753424657535, "alnum_prop": 0.5169738118331717, "repo_name": "Jumpscale/jumpscale_core8", "id": "6b4c38540b9d4d836975c2c6270480b800a802bb", "s...
from json import dumps from qiita_db.sql_connection import TRN with TRN: sql = """SELECT * FROM qiita.artifact JOIN qiita.artifact_output_processing_job USING (artifact_id) WHERE command_id IS NOT NULL""" TRN.add(sql) sql_update_...
{ "content_hash": "5dae2ad6d4e4b2fe99ef11967a36e5e4", "timestamp": "", "source": "github", "line_count": 24, "max_line_length": 72, "avg_line_length": 38.958333333333336, "alnum_prop": 0.5358288770053476, "repo_name": "biocore/qiita", "id": "8ebbab746d235c7c7255b3ff7a63f9857a1659cf", "size": "1107",...
from subprocess import check_call, CalledProcessError # This file contains the class Task, meant to encapsulate a given task as configured. __author__ = 'Sander Krause <sanderkrause@gmail.com>' __author__ = 'Roel van Nuland <roel@kompjoefriek.nl>' class Task: # Encapsulate a task as configured in the configurat...
{ "content_hash": "85d3570ef63ee86ee18d13c06e54cc62", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 99, "avg_line_length": 30.69090909090909, "alnum_prop": 0.6048578199052133, "repo_name": "kompjoefriek/Simr", "id": "874d1386d971da3fecd475787708ccca4b2a1e67", "size": "168...
"""API routes for tokens.""" from flask import jsonify from ceraon.auth.basic_auth import BasicAuth from ceraon.user.models import User from ceraon.utils import RESTBlueprint from .schema import TokenSchema blueprint = RESTBlueprint('token', __name__, version='v1') TOKEN_SCHEMA = TokenSchema() @blueprint.list() ...
{ "content_hash": "e3b6ae5a0686e05c37f4ee7849573a82", "timestamp": "", "source": "github", "line_count": 26, "max_line_length": 72, "avg_line_length": 26, "alnum_prop": 0.7026627218934911, "repo_name": "Rdbaker/Mealbound", "id": "e6375dbcf345712b2ace79e1575caa96ad2a46d4", "size": "676", "binary": ...
from rdkit.Chem.FeatMaps.FeatMapPoint import FeatMapPoint import math class FeatMapScoreMode(object): All = 0 """ score each feature in the probe against every matching feature in the FeatMap. """ Closest = 1 """ score each feature in the probe against the closest matching feature in the FeatMa...
{ "content_hash": "c25cf11939d9b42e90b26f42b73d6823", "timestamp": "", "source": "github", "line_count": 234, "max_line_length": 101, "avg_line_length": 30.846153846153847, "alnum_prop": 0.6388196176226102, "repo_name": "rdkit/rdkit", "id": "c2f6f28a0f0c504e8b14b81117e6a79cc6234dae", "size": "7483",...
""" This bot is used for checking external links found at the wiki. It checks several pages at once, with a limit set by the config variable max_external_links, which defaults to 50. The bot won't change any wiki pages, it will only report dead links such that people can fix or remove the links themselves. The bot w...
{ "content_hash": "f01cae2b61ca12816131b8282a1ff7ee", "timestamp": "", "source": "github", "line_count": 944, "max_line_length": 124, "avg_line_length": 39.293432203389834, "alnum_prop": 0.5472191518615372, "repo_name": "hperala/kontuwikibot", "id": "1e048a8d59cd50fdf20ab893cfe20e7ce28d0d2c", "size"...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import numpy as np import tensorflow as tf from planet.tools import nested from planet.tools import shape def overshooting( cell, target, embedded, prev_action, length, amount, posterio...
{ "content_hash": "fe1fca076f956c5263feff6d0d070325", "timestamp": "", "source": "github", "line_count": 162, "max_line_length": 79, "avg_line_length": 33.75308641975309, "alnum_prop": 0.6391733723482077, "repo_name": "google-research/planet", "id": "527120e40b036d31e16fac97f1a4ba844cee1183", "size"...
from distutils.core import setup setup( name='xes', version='1.2', packages=['xes'], url='http://pypi.python.org/pypi/xes/', license='Apache License 2.0', author='Jonathan Sumrall', author_email='j.m.sumrall@student.tue.nl', description='A simple tool for generating XES files for Proces...
{ "content_hash": "63ed64214e72014fd897a05f725a2124", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 76, "avg_line_length": 29.153846153846153, "alnum_prop": 0.6675461741424802, "repo_name": "msurkovsky/xes", "id": "b8ce2dd0d9aacd80484fb964fb0c89b927513b63", "size": "379",...
from __future__ import absolute_import from django.core.urlresolvers import reverse from six import BytesIO from sentry.models import File, OrganizationAvatar from sentry.testutils import TestCase from sentry.web.frontend.generic import FOREVER_CACHE class OrganizationAvatarTest(TestCase): def test_headers(self...
{ "content_hash": "f15f4b9c76cc1c793d0a180bb0bd7627", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 91, "avg_line_length": 40.22727272727273, "alnum_prop": 0.7141242937853107, "repo_name": "ifduyue/sentry", "id": "b22be2884b9f1567ff04fa41ba82b604e8c630d7", "size": "885", ...
import os import subprocess from process import process from main.models import Client, Show, Location, Episode, Raw_File import rax_uploader import gslevels class SyncRax(process): def cdn_exists(self, show, dst): dst = os.path.join("veyepar",show.client.slug,show.slug,dst) return dst in self.n...
{ "content_hash": "d528929a19a601122182e85c00a2ea0d", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 105, "avg_line_length": 29.9247311827957, "alnum_prop": 0.5544376572044556, "repo_name": "EricSchles/veyepar", "id": "75041a6f3a945aaf45e9d2b39eece1d0921494de", "size": "5...
from __future__ import absolute_import import pkgutil __path__ = pkgutil.extend_path(__path__, __name__)
{ "content_hash": "bc556f027f236592fc0ccb6f75f217d7", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 50, "avg_line_length": 35, "alnum_prop": 0.6857142857142857, "repo_name": "DarkEnergyScienceCollaboration/Monitor", "id": "4e7800b098e9599d58400ba5f8303fc73b8981a5", "size":...
import argparse import sys import os import numpy as np import urllib, urllib2 import cStringIO from contextlib import closing from PIL import Image import zlib sys.path += [os.path.abspath('../django')] import OCP.settings os.environ['DJANGO_SETTINGS_MODULE'] = 'OCP.settings' from django.conf import settings import ...
{ "content_hash": "5b261fd149a86f2d5c0f8c2217f199ed", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 124, "avg_line_length": 32.75268817204301, "alnum_prop": 0.6457649376231123, "repo_name": "openconnectome/open-connectome", "id": "f808493fa87c5953d2ad15cd2efaaf9116e72dff", ...
from datetime import datetime from django.conf import settings from purl import URL import requests from ..models import FMAArtist from .utils import rate_limited FIELDS = ['created', 'modified', 'artist_id', 'artist_handle', 'artist_url', 'artist_name', 'artist_bio', 'artist_members', 'artist_website', ...
{ "content_hash": "d3f56f1a873ce7cc26d317f45a87ac0f", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 80, "avg_line_length": 35.666666666666664, "alnum_prop": 0.5956928078017066, "repo_name": "FreeMusicNinja/api.freemusic.ninja", "id": "bc6e57c9b762b00511326adc1443fc4281eddd7...
from xml.dom import minidom import webob from cinder.api.contrib import qos_specs_manage from cinder import exception from cinder import test from cinder.tests.api import fakes from cinder.tests import fake_notifier from cinder.volume import qos_specs def stub_qos_specs(id): res = dict(name='qos_specs_' + str(i...
{ "content_hash": "15a53ce83e5585b10df9502d2932862e", "timestamp": "", "source": "github", "line_count": 584, "max_line_length": 75, "avg_line_length": 39.00684931506849, "alnum_prop": 0.5835381913959614, "repo_name": "Thingee/cinder", "id": "8abf1d070d2166b2339dd552ffc8f270ddad7930", "size": "23443...
class ListNode: def __init__(self, x): self.val = x self.next = None def __repr__(self): if self: return "{} -> {}".format(self.val, repr(self.next)) # http://bookshadow.com/weblog/2015/05/05/leetcode-reverse-linked-list/ class Solution(object): def reverseList(self, he...
{ "content_hash": "172d935e412e02e86108fae32d219171", "timestamp": "", "source": "github", "line_count": 75, "max_line_length": 71, "avg_line_length": 27.333333333333332, "alnum_prop": 0.5424390243902439, "repo_name": "gengwg/leetcode", "id": "40588f9f41c6a4a52c8ea39182ecf1a2c24bffe3", "size": "2389...
""" Model Plot Data Handler""" from .simple import SimpleDataSource def get_field_values(row, fields): data = [] for field in fields: data.append(getattr(row, field)) return data class ModelDataSource(SimpleDataSource): def __init__(self, queryset, fields=None): self.queryset = query...
{ "content_hash": "9b141cd9f1de6b7eb746a5141d80281a", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 78, "avg_line_length": 27.16, "alnum_prop": 0.6126656848306333, "repo_name": "aorzh/django-graphos", "id": "e535ef8e6121e76d8fe8b65182807ca7d2bb4e8f", "size": "679", "bin...
import os import tempfile import tensorflow as tf import zipfile import cloudpickle import numpy as np import baselines.common.tf_util as U from baselines.common.tf_util import load_variables, save_variables from baselines import logger from baselines.common.schedules import LinearSchedule from baselines.common impor...
{ "content_hash": "e4499db539d90513b7bd66881ad169ef", "timestamp": "", "source": "github", "line_count": 333, "max_line_length": 145, "avg_line_length": 39.54054054054054, "alnum_prop": 0.6062884483937115, "repo_name": "dsbrown1331/CoRL2019-DREX", "id": "b7b9d1a04672e41787ac5172a1338619b5b1734b", "s...
from ....testing import assert_equal from ..developer import JistBrainMp2rageSkullStripping def test_JistBrainMp2rageSkullStripping_inputs(): input_map = dict(args=dict(argstr='%s', ), environ=dict(nohash=True, usedefault=True, ), ignore_exception=dict(nohash=True, usedefault=True, ), ...
{ "content_hash": "1382244744044806fecae5085c64c0ae", "timestamp": "", "source": "github", "line_count": 65, "max_line_length": 78, "avg_line_length": 27.307692307692307, "alnum_prop": 0.632112676056338, "repo_name": "iglpdc/nipype", "id": "12b3232fa7d8e85337ec9b114de1d55b812f6576", "size": "1829", ...
from kokki import * def tester(): print "FEWFEWFEW"
{ "content_hash": "4558d50973824a22c3f1f7b903925288", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 21, "avg_line_length": 14.25, "alnum_prop": 0.6666666666666666, "repo_name": "samuel/kokki", "id": "e06955f3c5d1c7969e9851f649358df6eb3e4f44", "size": "58", "binary": fals...
from distutils.core import setup setup( name = 'quickconfig', py_modules=['quickconfig'], version = '2.2', description = 'Python configuration tool.', author = 'KJ', author_email = '<see github for support>', url = 'https://github.com/jdotpy/quickconfig', download_url = 'https://github....
{ "content_hash": "e345d4741c5ce3e518d13c189e1adbb8", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 71, "avg_line_length": 31.857142857142858, "alnum_prop": 0.6390134529147982, "repo_name": "jdotpy/quickconfig", "id": "6355be185b8c3e46f4cbed7987f2f5bb885995a7", "size": "4...
from __future__ import unicode_literals from django.conf import settings from django.db import migrations, models import django.db.models.deletion class Migration(migrations.Migration): initial = True dependencies = [ ('auth', '0007_alter_validators_add_error_messages'), ] operations = [ ...
{ "content_hash": "e1530fb22e9ddd0e6f4714806ab49c7f", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 229, "avg_line_length": 44.733333333333334, "alnum_prop": 0.6162444113263785, "repo_name": "nadiabahrami/django-imager", "id": "230ba4c7e8e40918c411c9581d92fc9ada6243bd", "...
DATA_FILENAME = 'MC2-training.tar.gz' DOC_FILENAME = 'MC2-training-documents.tar.gz' from .mobileclick_download_data import download_and_deploy, SUBSET_FILENAME def main(istest=False): docfilename = SUBSET_FILENAME if istest else DOC_FILENAME download_and_deploy([DATA_FILENAME, docfilename]) if __name__ == '_...
{ "content_hash": "0657ae06f0bed59178bfdc58511c0289", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 75, "avg_line_length": 34.1, "alnum_prop": 0.7272727272727273, "repo_name": "mpkato/mobileclick", "id": "4829f58f430769f7803aa075d7457eec4dac8cd5", "size": "364", "binary...
from south.utils import datetime_utils as datetime from south.db import db from south.v2 import SchemaMigration from django.db import models class Migration(SchemaMigration): def forwards(self, orm): # Adding field 'TimeFrame.cleanup_time' db.add_column(u'thermometer_timeframe', 'cleanup_time', ...
{ "content_hash": "4faa6b4bc5b3eec8a41fecfb092b887d", "timestamp": "", "source": "github", "line_count": 71, "max_line_length": 169, "avg_line_length": 64.50704225352112, "alnum_prop": 0.5681222707423581, "repo_name": "michaelbrooks/twitter-feels", "id": "ecd1c4ecf09181c90a80e3d7d6ef26b2d9fd2289", "...
"""This file contains a parser for extracting metadata.""" # TODO: Add a unit test for this parser. import datetime import hachoir_core.config # This is necessary to do PRIOR to loading up other parts of hachoir # framework, otherwise console does not work and other "weird" behavior # is observed. hachoir_core.confi...
{ "content_hash": "4f06d44d6dbaac11c29896bb780bf371", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 77, "avg_line_length": 31.90728476821192, "alnum_prop": 0.6552511415525114, "repo_name": "jorik041/plaso", "id": "683d68278c148d94f4658a2caf1a469a03b5cbfe", "size": "4842"...
""" This module is for the miscellaneous routines which do not fit somewhere else. """ import glob import os from PyInstaller import log as logging from PyInstaller.compat import is_win logger = logging.getLogger(__name__) def dlls_in_subdirs(directory): """Returns *.dll, *.so, *.dylib in given directories and...
{ "content_hash": "a98cf1bfc5a44ab3cd6db142ce4e2f02", "timestamp": "", "source": "github", "line_count": 96, "max_line_length": 79, "avg_line_length": 28.427083333333332, "alnum_prop": 0.6137779406375962, "repo_name": "kholia/exetractor-clone", "id": "23a5ff5860286c43c36ae29cb78f9ec705179106", "size...
""" This is an example of working with very large data. There are about 700,000 unduplicated donors in this database of Illinois political campaign contributions. With such a large set of input data, we cannot store all the comparisons we need to make in memory. Instead, we will read the pairs on demand from the Postg...
{ "content_hash": "766b5c4094fe440c0bc56693e4f29528", "timestamp": "", "source": "github", "line_count": 368, "max_line_length": 89, "avg_line_length": 36.130434782608695, "alnum_prop": 0.5672382671480144, "repo_name": "dedupeio/dedupe-examples", "id": "e2c629573db4ef980dc864033c5ba577f44d585d", "si...
import os import sys from roblib import read_fasta import argparse __author__ = 'Rob Edwards'
{ "content_hash": "9b6c1f920674968b55f06f993c89eb7a", "timestamp": "", "source": "github", "line_count": 8, "max_line_length": 29, "avg_line_length": 12.125, "alnum_prop": 0.7422680412371134, "repo_name": "linsalrob/EdwardsLab", "id": "8fdf0deb0d26eda6f314654fbadc8466f6d61d84", "size": "97", "bina...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('blocklist', '0015_auto_20200520_1725'), ] operations = [ migrations.AlterModelOptions( name='legacyimport', options={}, ), migrations.AlterField( ...
{ "content_hash": "786335f049bcb52ae47f127b43c2a085", "timestamp": "", "source": "github", "line_count": 25, "max_line_length": 98, "avg_line_length": 26, "alnum_prop": 0.5461538461538461, "repo_name": "mozilla/addons-server", "id": "f2f2d98266ab5aa70442bd77226d0a424e9dae2c", "size": "700", "binar...
from gen_function import * import string header = '''// (C) Copyright David Abrahams 2001,2002. Permission to copy, use, modify, sell // and distribute this software is granted provided this copyright notice appears // in all copies. This software is provided "as is" without express or implied // warranty, and wit...
{ "content_hash": "36bccfe462a6bac59fa6f427ac877652", "timestamp": "", "source": "github", "line_count": 194, "max_line_length": 119, "avg_line_length": 30.603092783505154, "alnum_prop": 0.5420245915445511, "repo_name": "Ezeer/VegaStrike_win32FR", "id": "8f7c866c6ebb79f4dcc97b87255fa16f1279afd6", "s...
"""Maintain moving averages of parameters.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from tensorflow.python.distribute import distribution_strategy_context from tensorflow.python.distribute import reduce_util as ds_reduce_util from tensorflow.python...
{ "content_hash": "b3431d0a72943780ef34064cfcec5f4c", "timestamp": "", "source": "github", "line_count": 547, "max_line_length": 80, "avg_line_length": 40.654478976234, "alnum_prop": 0.6768144617321702, "repo_name": "arborh/tensorflow", "id": "afd7a040db9934672e2e90e31eea62f7f3726745", "size": "2292...
from __future__ import unicode_literals import binascii import datetime import os import struct from uuid import UUID import lz4.block import plugins.helpers.UnifiedLog.dsc_file as dsc_file import plugins.helpers.UnifiedLog.logger as logger import plugins.helpers.UnifiedLog.resources as resources # FORMAT # Times...
{ "content_hash": "76e0da4229b0e75480da31c06eee8ddb", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 163, "avg_line_length": 49.57560975609756, "alnum_prop": 0.5706976286529568, "repo_name": "ydkhatri/mac_apt", "id": "0e2cd9076084979b83af2fb7f4ecadc51aeb1530", "size": "11...
""" Unit tests for PySpark; additional tests are implemented as doctests in individual modules. """ from array import array from glob import glob import os import re import shutil import subprocess import sys import tempfile import time import zipfile import random import threading import hashlib from py4j.protocol i...
{ "content_hash": "1352d809ced66192973f0203e23e4692", "timestamp": "", "source": "github", "line_count": 2260, "max_line_length": 100, "avg_line_length": 41.20442477876106, "alnum_prop": 0.5878095401731063, "repo_name": "nilsgrabbert/spark", "id": "73ab442dfd791f2ae7f3de78adba48b2a3cb7393", "size": ...
""" 糗事百科爬虫 根据PC网页端的热门栏目爬取段子 以供后续数据分析 """ __author__ = 'William Yang <505741310@qq.com>' import time import scrapy from scrapy import Request from ..items import ArticleItem from ..item_loaders import ArticleLoader class ArticleSpider(scrapy.Spider): name = 'article' allowed_domains = ['qiushibaike.com'] ...
{ "content_hash": "c301d846a5e129b7f76ca6cf4c7db796", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 117, "avg_line_length": 40.47435897435897, "alnum_prop": 0.5707950585999366, "repo_name": "WilliamYang1992/qiushibaike-spider", "id": "4f72ba48f8d879373c780bb937a82dd90e9bd18...
"""Utilities for baseline tasks.""" from collections.abc import Callable import attr import tensorflow as tf from tensorflow_federated.python.learning import model from tensorflow_federated.python.simulation.baselines import task_data @attr.s(frozen=True, init=True) class BaselineTask: """Specification for a bas...
{ "content_hash": "b7a0e8157b8ac8b78d1bc36659236b9a", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 78, "avg_line_length": 38.888888888888886, "alnum_prop": 0.7108571428571429, "repo_name": "tensorflow/federated", "id": "9f9c4f25ee7c6e1e419784bdce47a1dbe2d2a556", "size": ...
""" The MIT License (MIT) Copyright (c) 2015 brokensbone 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...
{ "content_hash": "972720701edc573bfacdd6f535bf77c0", "timestamp": "", "source": "github", "line_count": 147, "max_line_length": 128, "avg_line_length": 34.666666666666664, "alnum_prop": 0.6613029827315542, "repo_name": "brokensbone/slimline", "id": "42b5028f69ac6f2765ae6ed9ca76c945c9a22ec6", "size"...
import pymel.core as pm faceSel = pm.ls(sl=True,fl=True) pm.mel.eval('ConvertSelectionToEdges') allEd = pm.ls(sl=True,fl=True) pm.select(faceSel,r=True) pm.mel.eval('ConvertSelectionToContainedEdges') insideEd = pm.ls(sl=True,fl=True) pm.select(cl=True) selBorderEd = [] for ed in allEd: if ed not in insideEd: ...
{ "content_hash": "0e7642b91b5d0cd684b0aab0ebfba1ec", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 47, "avg_line_length": 26.928571428571427, "alnum_prop": 0.7347480106100795, "repo_name": "aaronfang/personal_scripts", "id": "02055812a1855295882b4092eeb76f347c364cf4", "s...
from abc import ABCMeta, abstractmethod class OCRModel(object): """This is the base model for other OCRModels""" __metaclass__ = ABCMeta @abstractmethod def train(self, tests, ans): pass @abstractmethod def run(self, test): pass
{ "content_hash": "a289ac00dfd75faaf8c3e56438dc2fae", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 52, "avg_line_length": 19.846153846153847, "alnum_prop": 0.6744186046511628, "repo_name": "USCSoftwareEngineeringClub/pyceratOpsRecs", "id": "d5cce90bf0e2f0bec68d2e9984b09bea...
CIPHERNAMES = set(('aes-128-ctr',)) import warnings import os import sys if sys.platform not in ('darwin',): import pyelliptic else: # FIX PATH ON OS X () # https://github.com/yann2192/pyelliptic/issues/11 _openssl_lib_paths = ['/usr/local/Cellar/openssl/'] for p in _openssl_lib_paths: if os...
{ "content_hash": "f3c6bbc5dfb1754e10118985a8e8bf39", "timestamp": "", "source": "github", "line_count": 303, "max_line_length": 98, "avg_line_length": 33.31353135313531, "alnum_prop": 0.6028333663562513, "repo_name": "ethereum/pydevp2p", "id": "9e5b268b4bdc08a28683eada0f301a117d29ded7", "size": "10...
import requests import datetime import re import json import smtplib from auto_nag.bugzilla.utils import get_config_path REPLY_TO_EMAIL = 'release-mgmt@mozilla.com' SMTP = 'smtp.mozilla.org' subject = None toaddrs = ['dev-planning@lists.mozilla.org', 'release-drivers@mozilla.com'] def sendMail(toaddr, options): ...
{ "content_hash": "47be30304d5052465db8379033f140bc", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 156, "avg_line_length": 39.60674157303371, "alnum_prop": 0.6504964539007092, "repo_name": "anoopvalluthadam/bztools", "id": "0ca1d67801de53cffcde7aaf8623ae613129dec6", "siz...
DEBUG = True TEMPLATE_DEBUG = DEBUG ADMINS = ( # ('Your Name', 'your_email@domain.com'), ) MANAGERS = ADMINS DATABASE_ENGINE = 'sqlite3' # 'postgresql_psycopg2', 'postgresql', 'mysql', 'sqlite3' or 'oracle'. DATABASE_NAME = 'test.db' # Or path to database file if using sqlite3. DATABASE_USE...
{ "content_hash": "6db5f384862c9c6ba2e21fb05663dc26", "timestamp": "", "source": "github", "line_count": 78, "max_line_length": 108, "avg_line_length": 35.82051282051282, "alnum_prop": 0.7100930565497494, "repo_name": "schmidsi/firepy", "id": "909b107398725c56929fde1406e79e6551cb5fea", "size": "2834...
import subprocess import sys import setup_util from os.path import expanduser import os import getpass home = expanduser("~") def start(args, logfile, errfile): setup_util.replace_text("kelp/app.pl", "localhost", ""+ args.database_host +"") setup_util.replace_text("kelp/nginx.conf", "USR", getpass.getuser()) se...
{ "content_hash": "9e150cf299664920b5e06deaf7db763b", "timestamp": "", "source": "github", "line_count": 32, "max_line_length": 231, "avg_line_length": 42.03125, "alnum_prop": 0.6973977695167286, "repo_name": "Ocramius/FrameworkBenchmarks", "id": "1bd7756afd08d55bda4ad4f666fca5b78c9b3e92", "size": "...
"""Control Flow Operations. See the @{$python/control_flow_ops} guide. """ # pylint: disable=g-bad-name from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import collections import functools import six from tensorflow.core.framework import attr_va...
{ "content_hash": "c48a5120b93984f407f9d1934d19ff20", "timestamp": "", "source": "github", "line_count": 3719, "max_line_length": 113, "avg_line_length": 38.93143318096262, "alnum_prop": 0.6640766372439324, "repo_name": "nburn42/tensorflow", "id": "ee024ce64a79de3aa326ce710b3f9daba25fb260", "size": ...
""" Compile YOLO-V2 and YOLO-V3 in DarkNet Models ============================================= **Author**: `Siju Samuel <https://siju-samuel.github.io/>`_ This article is an introductory tutorial to deploy darknet models with TVM. All the required models and libraries will be downloaded from the internet by the scrip...
{ "content_hash": "bcd0b9598016c8b25146908714bb3bd0", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 97, "avg_line_length": 36.494623655913976, "alnum_prop": 0.6218326458456099, "repo_name": "Laurawly/tvm-1", "id": "232058641ab008d2c9a2f666ff8a3efa28f9cba5", "size": "7573...
""" This file was automatically generated. """ import six class ajaxSpider(object): def __init__(self, zap): self.zap = zap @property def status(self): """ This component is optional and therefore the API will only work if it is installed """ return six.next(six....
{ "content_hash": "8c21e670d31de28e6df4e120057166a5", "timestamp": "", "source": "github", "line_count": 205, "max_line_length": 163, "avg_line_length": 43.951219512195124, "alnum_prop": 0.6478357380688125, "repo_name": "Woolworths/zap-api-python", "id": "3a6885cc3c0c558519f1e28dd43923fdbbe4ad7f", "...
"""This example removes the user from all its teams. To determine which users exist, run get_all_users.py. Tags: UserTeamAssociationService.performUserTeamAssociationAction """ __author__ = 'api.shamjeff@gmail.com (Jeff Sham)' # Locate the client library. If module was installed via "setup.py" script, then # the f...
{ "content_hash": "8c5182322149bcb30dd09db1727350e6", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 80, "avg_line_length": 32.81967213114754, "alnum_prop": 0.6918081918081919, "repo_name": "donspaulding/adspygoogle", "id": "aa5520e01cb922d308c92fa60ce4813a23845297", "size...
from random import randint def binary_search(array, element): """ Perform Binary Search by Iterative Method. :param array: Iterable of elements :param element: element to search :return: returns value of index of element (if found) else return None """ left = 0 right = len(array) - 1 ...
{ "content_hash": "ef09f8ee576a90a8f979795a237f6b3a", "timestamp": "", "source": "github", "line_count": 68, "max_line_length": 78, "avg_line_length": 30.014705882352942, "alnum_prop": 0.6065654091131798, "repo_name": "iiitv/algos", "id": "71be43524ef0a87c0021d79e1a69104abe2fdcff", "size": "2041", ...
""" Support for Wink binary sensors. For more details about this platform, please refer to the documentation at at https://home-assistant.io/components/binary_sensor.wink/ """ from homeassistant.components.binary_sensor import BinarySensorDevice from homeassistant.components.sensor.wink import WinkDevice from homeass...
{ "content_hash": "55cefc0cfdc8ef7b29af1a369f97a785", "timestamp": "", "source": "github", "line_count": 150, "max_line_length": 74, "avg_line_length": 29.613333333333333, "alnum_prop": 0.6307969383160739, "repo_name": "eagleamon/home-assistant", "id": "19ecb853536586f0b7fb24bd866f017b2f119608", "si...
from authentication.nodes import UserNode from django.shortcuts import render from authentication.models import UserProfile from django.http import HttpResponse,HttpResponseRedirect from .forms import UserProfileForm # Create your views here. def home(request): user = UserNode.nodes.get(uid=UserProfile.objects.get(...
{ "content_hash": "c503fb3f1abdabf697f4af357d09340a", "timestamp": "", "source": "github", "line_count": 15, "max_line_length": 84, "avg_line_length": 44.6, "alnum_prop": 0.7832585949177877, "repo_name": "programmernoob1/MeeT", "id": "18081e1772bbe6d8cd99f1d9179a5e5b8fb1520d", "size": "669", "bina...
'''Handles all the data preparation including: feature engineering, dimensionality reduction, and clustering Inspiration for the feature engineering had several sources: http://trevorstephens.com/post/73461351896/titanic-getting-started-with-r-part-4-feature http://triangleinequality.wordpress.com/2013/09/08/bas...
{ "content_hash": "4889559ef573b75490d54095d579b3a5", "timestamp": "", "source": "github", "line_count": 567, "max_line_length": 115, "avg_line_length": 39.22398589065256, "alnum_prop": 0.6066546762589928, "repo_name": "davenovelli/SDPAKaggle", "id": "f1cc20dd7ee68c4b1b7edd79bca9a0073701ffcf", "size...
import time from inspect import isclass from flask import Blueprint, current_app, request from flask_login import current_user, login_required from flask_restful import Resource, abort from redash import settings from redash.authentication import current_org from redash.models import db from redash.tasks import recor...
{ "content_hash": "c061a6ded08b7fcc1ab3fc915493f908", "timestamp": "", "source": "github", "line_count": 144, "max_line_length": 88, "avg_line_length": 30.006944444444443, "alnum_prop": 0.666512381393196, "repo_name": "denisov-vlad/redash", "id": "26db7130035e205fbe3e813db5bccd1c18d69d61", "size": "...
__author__ = "Cedric Bonhomme" __version__ = "$Revision: 0.1 $" __date__ = "$Date: 2016/06/01$" __revision__ = "$Date: 2016/06/10 $" __copyright__ = "Copyright (c) Luxembourg Institute of Science and Technology" __license__ = "" import sys import subprocess try: from weasyprint import HTML except Exception as e: ...
{ "content_hash": "7d7991b30a41ef507aeaa27ca2af2705", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 78, "avg_line_length": 25.147058823529413, "alnum_prop": 0.6549707602339181, "repo_name": "cedricbonhomme/shelter-database", "id": "1b31f940dc73fb84c486b1c81768a72a9e86af04",...
import numpy as np from numpy import linalg class Quaternion (object): """ Quaternion class : ------------------ A quaternion has a scalar part and a vector part. In this class the quaternion is represented as an array of 4 elements : - the first element is the scalar part - the next 3...
{ "content_hash": "083447cca4772c7a708891d17c42f30d", "timestamp": "", "source": "github", "line_count": 361, "max_line_length": 251, "avg_line_length": 39, "alnum_prop": 0.5167980680446055, "repo_name": "Mathieu-Geisert/SceneViewer-corba", "id": "1c71e49b2f2e9fc428165be1094d742afd96f1c1", "size": "...
from __future__ import unicode_literals, division, absolute_import from builtins import * # noqa pylint: disable=unused-import, redefined-builtin from past.builtins import basestring import collections import logging from jsonschema.compat import str_types from flexget import plugin from flexget.config_schema impor...
{ "content_hash": "4c06f80e7fe6d0a980c73027199fac2d", "timestamp": "", "source": "github", "line_count": 360, "max_line_length": 114, "avg_line_length": 35.28055555555556, "alnum_prop": 0.54263443823321, "repo_name": "tobinjt/Flexget", "id": "ad44ecaea3f114f8b4805f1e38995e5e5f6bab08", "size": "12701...
from __future__ import unicode_literals from django.db import migrations def create_project_locale_permission(apps, schema_editor): """Create permissions for project/locale translators.""" Permission = apps.get_model('auth', 'Permission') ContentType = apps.get_model('contenttypes', 'ContentType') p...
{ "content_hash": "8ddb910c31b3d3448d543e74139e8321", "timestamp": "", "source": "github", "line_count": 29, "max_line_length": 111, "avg_line_length": 31.06896551724138, "alnum_prop": 0.6936736958934517, "repo_name": "mastizada/pontoon", "id": "bbbabff2e749e225d6d1b1be382b0f725422aabc", "size": "97...
"""Tests for letsenecrypt.plugins.selection""" import sys import unittest import mock import zope.component from certbot.display import util as display_util from certbot import interfaces class ConveniencePickPluginTest(unittest.TestCase): """Tests for certbot.plugins.selection.pick_*.""" def _test(self, f...
{ "content_hash": "d5768eb7939a3318eebe1d77dc1c5a69", "timestamp": "", "source": "github", "line_count": 149, "max_line_length": 82, "avg_line_length": 34.87248322147651, "alnum_prop": 0.6212471131639723, "repo_name": "bsmr-misc-forks/letsencrypt", "id": "001ca5cff734097d8f7b651cf0e05ed619ece7c9", "...
from test_framework.test_framework import DankcoinTestFramework from test_framework.util import str_to_b64str, assert_equal import os import http.client import urllib.parse class HTTPBasicsTest (DankcoinTestFramework): def __init__(self): super().__init__() self.setup_clean_chain = False ...
{ "content_hash": "9feeda52a5c665f69883bcb52bac7603", "timestamp": "", "source": "github", "line_count": 111, "max_line_length": 129, "avg_line_length": 38.693693693693696, "alnum_prop": 0.6265424912689174, "repo_name": "dankcoin/dankcoin", "id": "f5162519fb2849e9e2045a4641673232c3a0eec0", "size": "...
__author__ = 'Tom Schaul, tom@idsia.ch' class Experiment(object): """ An experiment matches up a task with an agent and handles their interactions. """ def __init__(self, task, agent): self.task = task self.agent = agent self.stepid = 0 def doInteractions(self, number = 1): ...
{ "content_hash": "1ab63c184863fbd4f0e0f1c3e9d92c2d", "timestamp": "", "source": "github", "line_count": 27, "max_line_length": 91, "avg_line_length": 31.77777777777778, "alnum_prop": 0.6223776223776224, "repo_name": "daanwierstra/pybrain", "id": "6a9edefc2cf8081e5e317c22bef73b109e15690e", "size": "...
import time import xbahn.path from xbahn.mixins import EventMixin, LogMixin from xbahn.connection import receiver, sender from xbahn.message import Message LINK_NAME_COUNTER = 0 def get_link_name(): global LINK_NAME_COUNTER LINK_NAME_COUNTER += 1 return "lnk-%d" % LINK_NAME_COUNTER class Wire(LogMixin, ...
{ "content_hash": "53bfa4bee592713e6ceb256249f54b67", "timestamp": "", "source": "github", "line_count": 285, "max_line_length": 97, "avg_line_length": 29.943859649122807, "alnum_prop": 0.5699554722287321, "repo_name": "20c/xbahn", "id": "108212786cdf3dee486e1c87feb16f5b5169a332", "size": "8534", ...
import random def stoke_fire(player_values): wood = player_values['wood'] warmth = player_values['warmth'] hunger = player_values['hunger'] friends = player_values['friends'] anxiety = player_values['anxiety'] pet = player_values['pet'] if int(wood) < 1: status = "No wood!" else...
{ "content_hash": "f3996805af82f2e2ca16549ab273ade1", "timestamp": "", "source": "github", "line_count": 189, "max_line_length": 132, "avg_line_length": 43.407407407407405, "alnum_prop": 0.5748415407118479, "repo_name": "shakna-israel/AColdWalk", "id": "9a1988a8c4b46e79783b8a007748d61f50ff85c7", "si...
import cStringIO import logging import os import sys import textwrap import unittest ROOT_DIR = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) sys.path.insert(0, ROOT_DIR) try: from collections import OrderedDict # pylint: disable=E0611 except ImportError: SIMPLEJSON_PATH = os.path.join(ROOT_DIR, os...
{ "content_hash": "5a0654541e37edb534a1648e21223197", "timestamp": "", "source": "github", "line_count": 202, "max_line_length": 79, "avg_line_length": 32.2029702970297, "alnum_prop": 0.6267486548808608, "repo_name": "codenote/chromium-test", "id": "7229c3bb473c98e6d1b4bdd41511eb0c49e41020", "size":...
from __future__ import annotations import random from concurrent.futures import ( FIRST_COMPLETED, FIRST_EXCEPTION, Future, TimeoutError, as_completed, wait, ) from time import sleep import pytest from tlz import take from distributed.event import Event from distributed.metrics import time fr...
{ "content_hash": "736b18972511b0a63359508c7375ada1", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 87, "avg_line_length": 29.217557251908396, "alnum_prop": 0.5811887655127368, "repo_name": "dask/distributed", "id": "1019c2d59f8e1e3c202f24ae3668f22a4772c7c4", "size": "76...
from juriscraper.opinions.united_states.state import kan class Site(kan.Site): def __init__(self): super(Site, self).__init__() self.court_id = self.__module__ self.court_index = 2
{ "content_hash": "a607307bd99dd9cd7601ebabf0aca3eb", "timestamp": "", "source": "github", "line_count": 10, "max_line_length": 56, "avg_line_length": 22.3, "alnum_prop": 0.57847533632287, "repo_name": "brianwc/juriscraper", "id": "50bd2b47b33d95db9df7befb6ddfa126f63d9071", "size": "384", "binary"...
from zoo.pipeline.api.onnx.mapper.operator_mapper import OperatorMapper from zoo.pipeline.api.onnx.onnx_helper import OnnxHelper import zoo.pipeline.api.keras.layers as zlayers class EluMapper(OperatorMapper): def __init__(self, node, _params, _all_tensors): super(EluMapper, self).__init__(node, _params, ...
{ "content_hash": "91f696ddcc6ab11b30ca075281fc2bf7", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 71, "avg_line_length": 35.9375, "alnum_prop": 0.6591304347826087, "repo_name": "intel-analytics/analytics-zoo", "id": "cadac61ff8a6ff402712c13fa44da7c38b51d8d5", "size": "1...
####################################################################################### # Python implementation of LinkedIn OAuth Authorization, Profile and Connection APIs. # # # # Author: Ozgur Vatansever ...
{ "content_hash": "587065afb7d0f836724fd90847d8a065", "timestamp": "", "source": "github", "line_count": 838, "max_line_length": 403, "avg_line_length": 41.99403341288783, "alnum_prop": 0.5617061180415447, "repo_name": "venkatesh22/python-linkedin", "id": "e2174bc83e5276a2a304132fce8c52b74ca471c8", ...
import numpy as np from math import log from sklearn.naive_bayes import MultinomialNB from sklearn.utils.extmath import safe_sparse_dot class FeatMultinomialNB(MultinomialNB): """A MultinomialNB classifier that can be trained using labeled features. """ def fit(self, X, Y, sample_weight=None, features=No...
{ "content_hash": "59856f4d987649b1df3013fa4301d913", "timestamp": "", "source": "github", "line_count": 80, "max_line_length": 78, "avg_line_length": 38.4375, "alnum_prop": 0.5778861788617886, "repo_name": "mit0110/activepipe", "id": "5e3629e48370dd88ddf89813cf404e8447523a86", "size": "3075", "bi...
'''EditorPage - one page in a CustomNotebook''' import Tkinter as tk import ttk from dte_margin import DteMargin from robotdte import RobotDTE import codecs import re import os import sys import tkFont import platform from rwb import FONT_SCHEME, COLOR_SCHEME import urllib2 # I hate to hard-code these, but I don't th...
{ "content_hash": "a1ae823201cbce156c847799412f4bd5", "timestamp": "", "source": "github", "line_count": 514, "max_line_length": 108, "avg_line_length": 44.233463035019454, "alnum_prop": 0.5476776917663617, "repo_name": "boakley/robotframework-workbench", "id": "088f6827f0e3404e646545bccd285cf36dbd31a...
from __future__ import absolute_import, unicode_literals from gaebusiness.business import Command from gaebusiness.gaeutil import ModelSearchCommand from gaecookie import facade as cookie_facade from gaegraph.business_base import NodeSearch from gaepermission import inspector from gaepermission.base_commands import Upd...
{ "content_hash": "e61eca31d3e32641125ff1df4f45c4b1", "timestamp": "", "source": "github", "line_count": 186, "max_line_length": 119, "avg_line_length": 35.854838709677416, "alnum_prop": 0.7192982456140351, "repo_name": "renzon/gaepermission", "id": "ab1b83002bbd832eacd2c5dbaa788e639867068f", "size"...
from django.conf.urls import include, url from django.contrib import admin admin.autodiscover() urlpatterns = [ url(r"^admin/", admin.site.urls), url(r"^edge/", include("edge.urls")), ]
{ "content_hash": "99f5f22f069a4f9c4c61b349f3e30635", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 41, "avg_line_length": 21.77777777777778, "alnum_prop": 0.6887755102040817, "repo_name": "ginkgobioworks/edge", "id": "a770d850e9420c4e0f6a3b988f49eee9573b31ef", "size": "19...
"""A script which generates DHCP configuration for hosts matching a regex. Usage: find_vms_by_regex.py <regex> <compute_resource> e.g. find_vms_by_regex.py 'ssi2+' 'Online Engineering' """ import re import sys from psphere.client import Client from psphere.managedobjects import ComputeResource client = Clien...
{ "content_hash": "f8cbaa05a2843ce18bb286ef347a4e6a", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 74, "avg_line_length": 22.75, "alnum_prop": 0.7237048665620094, "repo_name": "intr1nsic/omoto", "id": "123194624d5f5b5b5151afaeb4c52cdc252168f8", "size": "655", "binary":...
"""Tests for tensorflow.ops.argmax_op.""" from __future__ import absolute_import from __future__ import division from __future__ import print_function import functools import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import test_util from tensorflow.python.ops import...
{ "content_hash": "0c272fdbba71ea82737f5603c5021626", "timestamp": "", "source": "github", "line_count": 124, "max_line_length": 77, "avg_line_length": 32.49193548387097, "alnum_prop": 0.6383718044179697, "repo_name": "renyi533/tensorflow", "id": "86d2941b8d3fb00186190b34c180401bdaca7d07", "size": "...
from sqlalchemy.ext.declarative import declared_attr from ggrc import db from ggrc.models.associationproxy import association_proxy from ggrc.models import mixins from ggrc.models.object_document import Documentable from ggrc.models.object_owner import Ownable from ggrc.models.reflection import PublishOnly from ggrc.m...
{ "content_hash": "ca79cbbe55879b7f5752e64c9094f2a6", "timestamp": "", "source": "github", "line_count": 48, "max_line_length": 76, "avg_line_length": 28.604166666666668, "alnum_prop": 0.6904588492352512, "repo_name": "hasanalom/ggrc-core", "id": "687b18b0f0ef286fd3f8f1e15f27585ea9bf60ce", "size": "...
import argparse import json import os import re import urllib.request _REPO_URL = 'https://repo.maven.apache.org/maven2' _GROUP_NAME = 'net/sf/kxml' _MODULE_NAME = 'kxml2' _FILE_EXT = 'jar' _OVERRIDE_LATEST = None _PATCH_VERSION = 'cr1' def do_latest(): if _OVERRIDE_LATEST is not None: print(_OVERRIDE_LA...
{ "content_hash": "401207509789c0e6b67fcc4939a8968f", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 79, "avg_line_length": 31.285714285714285, "alnum_prop": 0.5917808219178082, "repo_name": "chromium/chromium", "id": "13a251b38a8f9bc9b976d8a29352784b286d2ed8", "size": "24...
import optparse import os import re import shutil import subprocess import sys import common import pngdiffer import suppressor # Nomenclature: # x_root - "x" # x_filename - "x.ext" # x_path - "path/to/a/b/c/x.ext" # c_dir - "path/to/a/b/c" def test_one_file(input_filename, source_dir, working_dir, ...
{ "content_hash": "3e13053ffd1cc3f65ed9a18582e215c7", "timestamp": "", "source": "github", "line_count": 76, "max_line_length": 74, "avg_line_length": 32.1578947368421, "alnum_prop": 0.662847790507365, "repo_name": "pwaller/pdfium", "id": "1876581e4069e4332a4564eff9fe29f3658de1b6", "size": "2627", ...
import maya.cmds as mc import maya.mel as mel samplerInfo = mc.shadingNode("samplerInfo", asUtility=True) extraTex = mel.eval("vrayAddRenderElement ExtraTexElement;") mc.connectAttr("%s.pointWorld" %samplerInfo, "%s.vray_texture_extratex" %extraTex, force = True) mc.setAttr("%s.vray_considerforaa_extratex" %extraTex,...
{ "content_hash": "7df21f1ccd2414f3b23642b703daddb3", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 96, "avg_line_length": 41, "alnum_prop": 0.7526132404181185, "repo_name": "hibernationTheory/maya_python_misc_scripts", "id": "ff2bfe38837f5c2bff285a0e01e01e027643d050", "s...
from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import create_engine, Column, Integer, ForeignKey, String from sqlalchemy.orm import sessionmaker import os # Database connection _DATABASE = 'sqlite:///db.sqlite3' _DEBUG = False # ORM base _Base = declarative_base() class Users(_Base): __...
{ "content_hash": "4c0908f5db436c6746305b2b9c610ca1", "timestamp": "", "source": "github", "line_count": 46, "max_line_length": 73, "avg_line_length": 28.58695652173913, "alnum_prop": 0.7019011406844107, "repo_name": "Atilla106/facemash", "id": "dd457bcb9524153abfe5c33f05069b5ecb9ca821", "size": "13...
''' Created on 25 Mar 2016 @author: bogdan python3 required for operation -- due to Unicode issues ''' import sys, re, os import copy # from p010graphems.levenshtein import levenshtein from collections import defaultdict from collections import Counter class clGraphonolev(object): ''' class computes Levenshtei...
{ "content_hash": "74786f511ec41e99596630b2e8a15171", "timestamp": "", "source": "github", "line_count": 245, "max_line_length": 122, "avg_line_length": 31.17142857142857, "alnum_prop": 0.6460652088516433, "repo_name": "bogdanbabych/morphosyntax", "id": "46511244cc2d58022c8d0b95e64ffbda576f3def", "s...
__author__ = 'Asus' import sys import getopt from QuestionsHandling.QuestionBase import QuestionBase from Classifiers.GloveCenteredESLExtendedClassifier import GloveClassifier from Utils.utilities import load_stf from Utils.retrofitNew_gloveInstance import retrofit_new from Utils.retrofitNew_gloveInstance im...
{ "content_hash": "7b9b4c46449dbbb8123878d7ed666fc5", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 158, "avg_line_length": 38.57303370786517, "alnum_prop": 0.6154966501602097, "repo_name": "dudenzz/word_embedding", "id": "09fb93edfe3ef5370efc4a1c9d67b7936edacc50", "size"...
import contextlib import logging from unittest import mock from neutron.api import extensions as api_ext from neutron.common import config import neutron.extensions as nextensions from oslo_config import cfg from oslo_utils import importutils from oslo_utils import uuidutils import webob.exc from networking_sfc.db im...
{ "content_hash": "4af680fa91eab965e941e390c650048a", "timestamp": "", "source": "github", "line_count": 3249, "max_line_length": 79, "avg_line_length": 40.1320406278855, "alnum_prop": 0.4383345220839181, "repo_name": "openstack/networking-sfc", "id": "a6e0a94951b08b1f98ea932bdc2a91a8ed0bdced", "siz...
import tensorflow as tf from .inputs import inputs def iterator(dataset, eval_data, batch_size=1, scale_inputs=1, distort_inputs=False, zero_mean_inputs=False, num_epochs=1, shuffle=False): """Returns a function which iterates over a dataset in batches. Args: dataset: The ...
{ "content_hash": "ad2d2a46a12541a2e7b8d999c87da340", "timestamp": "", "source": "github", "line_count": 112, "max_line_length": 79, "avg_line_length": 40.767857142857146, "alnum_prop": 0.5424879544459045, "repo_name": "rusty1s/graph-based-image-classification", "id": "db1a075bddad5e7f62554eca2aa94da6...
import os import unittest import IECore import IECoreRI class TestSHWDeepImageWriter( unittest.TestCase ) : __shw = "test/IECoreRI/data/shw/translucentBoxes.shw" __shwOrtho = "test/IECoreRI/data/shw/constantPlaneOrtho.shw" __exr = "test/IECoreRI/data/dtex/groundPlane.exr" __output = "test/IECoreRI/data/shw/writ...
{ "content_hash": "d190eaea2215f63891d9ae18edbc3c85", "timestamp": "", "source": "github", "line_count": 400, "max_line_length": 130, "avg_line_length": 42.27, "alnum_prop": 0.6795599716110717, "repo_name": "goddardl/cortex", "id": "1d685b9c0b1205f8b4dc619cb1b867ef5e86b9cd", "size": "18692", "bina...
""" ========================================================================= 2 samples permutation test on source data with spatio-temporal clustering ========================================================================= Tests if the source space data are significantly different between 2 groups of subjects (simu...
{ "content_hash": "1698e014a93f750f4b7538b5368a79e2", "timestamp": "", "source": "github", "line_count": 114, "max_line_length": 79, "avg_line_length": 40.81578947368421, "alnum_prop": 0.6079948420373952, "repo_name": "mne-tools/mne-tools.github.io", "id": "bc7ba59ace60b9c71f9d1469a01e7ab796928321", ...
import unittest import time from iso8601 import parse_date from datetime import timedelta from openprocurement.api.utils import get_now from openprocurement.api.constants import SANDBOX_MODE from openprocurement.tender.belowthreshold.tests.base import test_organization # TenderContractResourceTest def create_tende...
{ "content_hash": "780df0cbf867d0ce584dfd3fe056d2a1", "timestamp": "", "source": "github", "line_count": 689, "max_line_length": 234, "avg_line_length": 52.43541364296081, "alnum_prop": 0.629041186891054, "repo_name": "openprocurement/openprocurement.tender.limited", "id": "0855edb9ed293e1bf8918ba18a9...
from pbr import version version_info = version.VersionInfo('mistral') version_string = version_info.version_string()
{ "content_hash": "f5200992a1b2cfbecb81998cadfc90d1", "timestamp": "", "source": "github", "line_count": 4, "max_line_length": 46, "avg_line_length": 29.5, "alnum_prop": 0.788135593220339, "repo_name": "openstack/mistral", "id": "40ba471c7b828dadd2853437aaf32766b4c5667a", "size": "726", "binary": ...