text
stringlengths
4
1.02M
meta
dict
import logging import posixpath import threading from desktop.conf import TIME_ZONE from desktop.conf import DEFAULT_USER from desktop.lib.rest.http_client import HttpClient from desktop.lib.rest.resource import Resource from liboozie.conf import SECURITY_ENABLED from liboozie.conf import OOZIE_URL from liboozie.typ...
{ "content_hash": "c2711e8d938e4604a9b4ef50cbda4cc0", "timestamp": "", "source": "github", "line_count": 294, "max_line_length": 112, "avg_line_length": 28.928571428571427, "alnum_prop": 0.6435038212815991, "repo_name": "yongshengwang/builthue", "id": "ab01ce604d381cf900a2c9951b11f77ce856868f", "siz...
from sqlalchemy import create_engine, engine import pandas as pd import sys #Specify CSV file with flickr photos from 100M photo Database csv_file = sys.argv[1] DB_NAME = '' #Name of your SQL Database TABLE_NAME = '' #Name of your SQL Table def db_conn(df, DB_NAME , table_name): # MySql connection in sqlAlche...
{ "content_hash": "8e74d7471ef90ad9ce2e91b713d832d4", "timestamp": "", "source": "github", "line_count": 45, "max_line_length": 107, "avg_line_length": 26.822222222222223, "alnum_prop": 0.6752278376139188, "repo_name": "tjtorres/Random-Walk", "id": "35c3bd4dc99dfdb94bae9c15fc4209a1697d8d79", "size":...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('adjudication', '0007_auto_20190921_1705'), ] operations = [ migrations.AddField( model_name='appearance', name='area', field=models.CharField(blank=True,...
{ "content_hash": "e7f9bf3d6013b0e28a8a476a34dee646", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 106, "avg_line_length": 24.875, "alnum_prop": 0.5979899497487438, "repo_name": "barberscore/barberscore-api", "id": "9ef789b6b4c39c9e70a98cd90035430d28a6dff5", "size": "447...
"""Implementations for various useful completers. These are all loaded by default by IPython. """ #----------------------------------------------------------------------------- # Copyright (C) 2010-2011 The IPython Development Team. # # Distributed under the terms of the BSD License. # # The full license is in the ...
{ "content_hash": "b068bc474d8f1b76abad13fbc5f02976", "timestamp": "", "source": "github", "line_count": 352, "max_line_length": 82, "avg_line_length": 33.32386363636363, "alnum_prop": 0.5475703324808184, "repo_name": "Lightmatter/django-inlineformfield", "id": "08bff1c7cded352fc6c269d19a07848bdcc102c...
import sys def get_file_text(path): """ Returns file text by path""" file_io = open(path, "r") text = file_io.read() file_io.close() return text def get_file_output(encoding="utf-8", path=sys.argv[-1], arg_string=""): """ Returns answer file output :param encoding: to decode output i...
{ "content_hash": "268e7bbb47193aaeaf7c2138571ab10f", "timestamp": "", "source": "github", "line_count": 224, "max_line_length": 119, "avg_line_length": 27.526785714285715, "alnum_prop": 0.5840090820629257, "repo_name": "RyanSkraba/beam", "id": "4959711adc23d12f1f7a961bcdb161445c113c59", "size": "69...
import pickle import redis from pod_manager.settings import REDIS_HOST, REDIS_PORT, REDIS_DB __all__ = [ 'get_client', 'cache_object', 'get_object' ] def get_client(): client = redis.Redis(host=REDIS_HOST, port=REDIS_PORT, db=REDIS_DB) return client def cache_object(client, key, obj, ttl=60): ...
{ "content_hash": "4e643402be9d60657f9f31259fdb577d", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 71, "avg_line_length": 18.272727272727273, "alnum_prop": 0.6285240464344942, "repo_name": "racker/pod-manager", "id": "f67acf1b57aafb3c80e2a2c082939bde8bf2fb93", "size": "6...
from __future__ import absolute_import # import apis into api package from .input_api import InputApi from .jobs_api import JobsApi from .output_api import OutputApi from .information_api import InformationApi from .conversion_api import ConversionApi
{ "content_hash": "26075d3bfab1a5a936719371cfbb4cfc", "timestamp": "", "source": "github", "line_count": 9, "max_line_length": 43, "avg_line_length": 28.22222222222222, "alnum_prop": 0.8110236220472441, "repo_name": "onlineconvert/onlineconvert-api-sdk-python", "id": "96d0613c65ca93d40e0b2d6af368b4e23...
"""The tests for the Tasmota binary sensor platform.""" import copy from datetime import timedelta import json from hatasmota.utils import ( get_topic_stat_status, get_topic_stat_switch, get_topic_tele_sensor, get_topic_tele_will, ) from homeassistant.components import binary_sensor from homeassistant...
{ "content_hash": "a68de7d38d177f2f88a94b505fb7a2d9", "timestamp": "", "source": "github", "line_count": 259, "max_line_length": 93, "avg_line_length": 33.335907335907336, "alnum_prop": 0.6724577252721797, "repo_name": "sdague/home-assistant", "id": "52ab88b0ecb5814584d7b24fa992dc46d727238e", "size"...
from pandac.PandaModules import * import ShtikerPage from direct.gui.DirectGui import * from pandac.PandaModules import * from toontown.quest import Quests from toontown.toon import NPCToons from toontown.hood import ZoneUtil from toontown.toonbase import ToontownGlobals from toontown.toonbase import TTLocalizer from t...
{ "content_hash": "08efb600004f286c64d1e4186373abe6", "timestamp": "", "source": "github", "line_count": 175, "max_line_length": 146, "avg_line_length": 32.57714285714286, "alnum_prop": 0.6134011576916331, "repo_name": "ToonTownInfiniteRepo/ToontownInfinite", "id": "afc32a3ec858643ec4ef6893d7e87bd4e67...
import argparse, os, csv, subprocess, shlex # this is a script for locating the DAM / DRMC integration metadata parser = argparse.ArgumentParser(description="this is a script for locating the DAM / DRMC integration metadata") parser.add_argument('-i', '--input', type=str, required=True, help='CSV of files missing met...
{ "content_hash": "6563dd352ca22cfa29f7bcb688ce03a1", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 113, "avg_line_length": 34.85964912280702, "alnum_prop": 0.6628082536487166, "repo_name": "finoradin/moma-utils", "id": "01bbb57f293e202c42081b5c7e2d0389c5da5fa0", "size": ...
import re from datetime import datetime from scrapy.contrib.spiders import CrawlSpider, Rule from scrapy.contrib.linkextractors.sgml import SgmlLinkExtractor from scrapy.http import Request from scrapy.selector import HtmlXPathSelector from scrapy.utils.response import get_base_url from scrapy.utils.url import urljoin...
{ "content_hash": "bb95264460bec11cd2b9cf89b4b6d951", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 115, "avg_line_length": 43.891304347826086, "alnum_prop": 0.5747894997523526, "repo_name": "saxicek/psp-cz-spider", "id": "b2c449d36e7cd0008746271a363d69578df0db95", "size"...
from __future__ import unicode_literals from datetime import datetime import sqlalchemy from sqlalchemy.orm import relationship, backref import uuid from test.functional.mock_box.db_model import DbModel class FileModel(DbModel): """DB Model for Box files.""" __tablename__ = 'box_file' id = sqlalchemy.Col...
{ "content_hash": "909980a3e8a3de1702da76fa4ef1f7f3", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 115, "avg_line_length": 47.25, "alnum_prop": 0.7266313932980599, "repo_name": "jwkozel/demobx", "id": "0455c03c207e75392cdbcc29db3884e879fd66af", "size": "1718", "binary"...
import sys import time import calendar def main(): if sys.argv[1:]: year = int(sys.argv[1]) else: year = int(raw_input('In which year were you born? ')) if 0 <= year < 100: print "I'll assume that by", year, year = year + 1900 print 'you mean', year, 'and not the ear...
{ "content_hash": "76e0c272ea1363f36b9d7a96c898f39f", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 73, "avg_line_length": 29.701030927835053, "alnum_prop": 0.5657757723012843, "repo_name": "nzavagli/UnrealPy", "id": "056ad44c463bea15f42eb909f0abdacde2777b23", "size": "31...
import base64 import os import shutil import string import tempfile import unittest from datetime import timedelta from django.conf import settings from django.contrib.sessions.backends.cache import SessionStore as CacheSession from django.contrib.sessions.backends.cached_db import \ SessionStore as CacheDBSession...
{ "content_hash": "51e92ae7ac3c9f523202d9c6e5edc7c7", "timestamp": "", "source": "github", "line_count": 634, "max_line_length": 106, "avg_line_length": 38.132492113564666, "alnum_prop": 0.6539129715420251, "repo_name": "willharris/django", "id": "112ac30d35b891a425e2da6060be82abfbb74749", "size": "...
import tornado.web class Header2(tornado.web.UIModule): def render(self, header): """ On this ui module example it is tested a second ui module package insertion to the application ui modules stack and, rendering a template from another component while rendering the ui module. :p...
{ "content_hash": "51640cf267534de3d703e1b5fcbeb54b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 79, "avg_line_length": 35.642857142857146, "alnum_prop": 0.687374749498998, "repo_name": "candango/firenado", "id": "f2b39e396b280fe3545a6e30c9e3cd0498c8ff54", "size": "116...
from heat.common import exception from heat.common.i18n import _ from heat.engine import attributes from heat.engine import properties from heat.engine import resource from heat.engine import support class Host(resource.Resource): """A resource to manage Blazar hosts. Host resource manages the physical hosts...
{ "content_hash": "4c9fb3eb13ab0f1a5a8305a6b75a329a", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 78, "avg_line_length": 33.95454545454545, "alnum_prop": 0.5842417288200421, "repo_name": "openstack/heat", "id": "272fe90ce9dd1b94b2f3cbf047873f1fea44abee", "size": "5804"...
from django.views.generic import TemplateView from django.views.decorators.cache import cache_page class HomeView(TemplateView): template_name = 'pages/home.html' home = cache_page(60 * 10)(HomeView.as_view())
{ "content_hash": "95662813a3b26f94dc93bd99612f0250", "timestamp": "", "source": "github", "line_count": 7, "max_line_length": 52, "avg_line_length": 30.857142857142858, "alnum_prop": 0.7685185185185185, "repo_name": "xiahuang119/easyus", "id": "bed0b72d889e18d15dca063a317cf4e8174cbe57", "size": "21...
from google.cloud.video import stitcher_v1 async def sample_delete_cdn_key(): # Create a client client = stitcher_v1.VideoStitcherServiceAsyncClient() # Initialize request argument(s) request = stitcher_v1.DeleteCdnKeyRequest( name="name_value", ) # Make the request await client....
{ "content_hash": "d217966e1690a7d1d0799fa9f930a85f", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 74, "avg_line_length": 25.235294117647058, "alnum_prop": 0.7272727272727273, "repo_name": "googleapis/python-video-stitcher", "id": "b7095fed0f0c97a7d15ce644ee8b0d28bcfc429d"...
from myhvac_service import cfg from myhvac_service import db from myhvac_service.db import models import logging from datetime import datetime, timedelta opts = [ cfg.IntOpt('max_measurement_age_threshold_min', default=12, help='The maximum age (in minutes) of the most recent temperature measuremen...
{ "content_hash": "c0f3c29da6b51a5fc750050a155a4624", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 116, "avg_line_length": 36.483870967741936, "alnum_prop": 0.5459770114942529, "repo_name": "alanquillin/myhvac_service", "id": "1f7ddcb3be07dd6593c9dc5d322303d8137390a9", "...
import ssl as ssl_module from eventlet import patcher from oslo_serialization import jsonutils from subscription import Subscription kombu = patcher.import_patched('kombu') class MqClient(object): def __init__(self, login, password, host, port, virtual_host, ssl=False, ca_certs=None): s...
{ "content_hash": "1215c346f9c2083f78e255a085fcf9c4", "timestamp": "", "source": "github", "line_count": 88, "max_line_length": 72, "avg_line_length": 30.977272727272727, "alnum_prop": 0.5630961115187088, "repo_name": "olivierlemasle/murano", "id": "2a4465844caea189b72913b0d1beab508bf2c419", "size":...
from glob import glob import numpy as np def split(filename): data = np.loadtxt(filename, skiprows=1) # Put on Angstrom scale. data[:,0] *= 10. output_filename_base = ".".join(filename.split(".")[:-1]) # Split at points: split_points = (5500, 6250, 7000) color = ("blue", "green", "r...
{ "content_hash": "f62a3cc72d4983b7e6be8aef7cf2bf47", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 103, "avg_line_length": 30.454545454545453, "alnum_prop": 0.6069651741293532, "repo_name": "andycasey/original-oracle", "id": "ebfd179e83000a7a023dcdc5a26f7508b4e83269", "s...
from module_kits.vtk_kit.mixins import SimpleVTKClassModuleBase import vtk class vtkLineSource(SimpleVTKClassModuleBase): def __init__(self, module_manager): SimpleVTKClassModuleBase.__init__( self, module_manager, vtk.vtkLineSource(), 'Processing.', (), ('vtkPolyData',)...
{ "content_hash": "b930b0d9ab00d32b25d727cd78f58096", "timestamp": "", "source": "github", "line_count": 11, "max_line_length": 63, "avg_line_length": 36.90909090909091, "alnum_prop": 0.6502463054187192, "repo_name": "zhangfangyan/devide", "id": "305fd811e1bbab6a90531bb722fa4420096532cf", "size": "4...
from spresso.controller.grant.settings import Setting from spresso.model.authentication.json_schema import WellKnownInfoDefinition, \ IdentityAssertionDefinition from spresso.model.settings import Container, Schema, Endpoint from spresso.utils.base import get_file_content class IdentityProvider(Setting): res...
{ "content_hash": "4c13ce5dbd98c94df9a57192798c5b97", "timestamp": "", "source": "github", "line_count": 39, "max_line_length": 79, "avg_line_length": 35.256410256410255, "alnum_prop": 0.6676363636363636, "repo_name": "lujung/python-spresso", "id": "80caeb7009a6a91c9f3e249d412da1a926a8e477", "size":...
import sys import json import ethtool import shlex import re def match_list(value, list): if len(list) == 0: return False for exp in list: if re.match(exp, value): return True return False def has_match(name, module_type, bus_type, name_list, module_type_list, bus_type_list):...
{ "content_hash": "f0d44b75b1cd9e8c3394c7da51d3d402", "timestamp": "", "source": "github", "line_count": 151, "max_line_length": 112, "avg_line_length": 34.966887417218544, "alnum_prop": 0.5611742424242424, "repo_name": "opencord/maas", "id": "78eabe00c315c6f500ffe6476392fef914c7ed5e", "size": "5898...
"""Streamlink extracts streams from various services. The main compontent of Streamlink is a command-line utility that launches the streams in a video player. An API is also provided that allows direct access to stream data. Full documentation is available at https://streamlink.github.io. """ import warnings from s...
{ "content_hash": "3828a10606b4e315920dfbb0448fdf30", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 76, "avg_line_length": 27.96629213483146, "alnum_prop": 0.6364001607071113, "repo_name": "javiercantero/streamlink", "id": "d401efa4a525a7102c7f276fc59ca38902727876", "size...
from typing import TYPE_CHECKING from azure.core.configuration import Configuration from azure.core.pipeline import policies from azure.mgmt.core.policies import ARMHttpLoggingPolicy from ._version import VERSION if TYPE_CHECKING: # pylint: disable=unused-import,ungrouped-imports from typing import Any ...
{ "content_hash": "46e303719cd0359386f4b0a034eabfa9", "timestamp": "", "source": "github", "line_count": 61, "max_line_length": 129, "avg_line_length": 45.39344262295082, "alnum_prop": 0.6980859516070783, "repo_name": "Azure/azure-sdk-for-python", "id": "58d4b497e3aa68de4e7de0ca1aa52c7741d69dc4", "s...
from __future__ import unicode_literals from django.db import models, migrations class Migration(migrations.Migration): dependencies = [ ('sprints', '0004_remove_sprint_active'), ('tasks', '0005_auto_20140907_0246'), ] operations = [ migrations.AddField( model_name='...
{ "content_hash": "b7a9721d1bd18977ef4ab60690b82028", "timestamp": "", "source": "github", "line_count": 20, "max_line_length": 108, "avg_line_length": 25.75, "alnum_prop": 0.6, "repo_name": "mc706/task-burndown", "id": "4083d4f474cadd6c15f35a2f091cc6bb4e56a1be", "size": "539", "binary": false, ...
import os from homely._test import contents from homely._test.system import HOMELY, TempRepo, checkrepolist, getsystemfn def test_homely_remove(tmpdir, HOME): system = getsystemfn(HOME) def _addfake(name, createfile): # create a fake repo and add it tr = TempRepo(tmpdir, name) tf = o...
{ "content_hash": "d1f792b8554e44e1ad9dfaf7beb40c48", "timestamp": "", "source": "github", "line_count": 57, "max_line_length": 78, "avg_line_length": 40.1578947368421, "alnum_prop": 0.6251638269986893, "repo_name": "toomuchphp/homely", "id": "4827220c54857d0734f8d138666dc5326889e3a8", "size": "2289...
import logging import os from argparse import ArgumentParser import six from grab.util.config import build_spider_config, build_root_config from grab.util.module import load_spider_class from weblib.logs import default_logging from weblib.files import clear_directory from weblib.encoding import make_str logger = logg...
{ "content_hash": "01fa92b1ed757bba8b0ab4df70cf2ca7", "timestamp": "", "source": "github", "line_count": 154, "max_line_length": 79, "avg_line_length": 34.55844155844156, "alnum_prop": 0.6018414130026306, "repo_name": "maurobaraldi/grab", "id": "fb03f5e05de715efa0e6ab2527c42f072d6ce8f0", "size": "53...
"""Add encrypted password field Revision ID: 289ce07647b Revises: 2929af7925ed Create Date: 2015-11-21 11:18:00.650587 """ import sqlalchemy as sa from alembic import op # revision identifiers, used by Alembic. revision = "289ce07647b" down_revision = "2929af7925ed" def upgrade(): op.add_column("dbs", sa.Colu...
{ "content_hash": "970bf5e9046435745c5dafcacefbe063", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 80, "avg_line_length": 19.363636363636363, "alnum_prop": 0.7253521126760564, "repo_name": "zhouyao1994/incubator-superset", "id": "73273a4da6b1b60c2246538cfb1901e01d763c51", ...
from netforce.model import Model, fields, get_model from netforce.utils import get_data_path import time class SaleStage(Model): _name = "sale.stage" _string = "Sales Stage" _key = ["name"] _fields = { "name": fields.Char("Name", required=True, search=True), "sequence": fields.Char("Se...
{ "content_hash": "470f516398ec476967437af753614c5a", "timestamp": "", "source": "github", "line_count": 17, "max_line_length": 73, "avg_line_length": 26.823529411764707, "alnum_prop": 0.6337719298245614, "repo_name": "nfco/netforce", "id": "89037400986a6e7f21f5159cdc22277ff809c74b", "size": "1561",...
import aiohttp.web test_routes = aiohttp.web.RouteTableDef() @test_routes.patch("/jobs/{job_id}") def public_test_route(request: aiohttp.web.Request): return aiohttp.web.Response(status=200) @test_routes.get("/not_public") def non_public_test_route(request: aiohttp.web.Request): return aiohttp.web.Response...
{ "content_hash": "b155fbe02dfbf09ed8533635ed8bf7e4", "timestamp": "", "source": "github", "line_count": 55, "max_line_length": 81, "avg_line_length": 27.472727272727273, "alnum_prop": 0.6949040370615487, "repo_name": "virtool/virtool", "id": "27a235fa9ed79eea8ca302f84166ad4f241d599c", "size": "1511...
import unittest import numpy import chainer from chainer import cuda import chainer.functions as F from chainer import gradient_check from chainer import testing from chainer.testing import attr from chainer.testing import condition class UnaryFunctionsTestBase(object): def make_data(self): raise NotIm...
{ "content_hash": "6e8d48b1c4b1c0499c58ebb2c230752a", "timestamp": "", "source": "github", "line_count": 103, "max_line_length": 74, "avg_line_length": 26.78640776699029, "alnum_prop": 0.6357375860819138, "repo_name": "AlpacaDB/chainer", "id": "814beefcd245b534950365fa681e087fc33a1ed5", "size": "275...
import sys import socket import argparse from parse_arguments import argParseFunction def createSocket(host, port): try: s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM) print "Socket created" except socket.error, msg: print "Failed to create socket. Error code: "+str(msg[0])+". Message "+msg[1] sys.exit...
{ "content_hash": "402bd3687f438f3dca8953c5ae31fd41", "timestamp": "", "source": "github", "line_count": 33, "max_line_length": 79, "avg_line_length": 22.393939393939394, "alnum_prop": 0.6725304465493911, "repo_name": "Digoss/funny_python", "id": "5df1c0f4cf86bce97f6270bfa4b416cd418b3b04", "size": "...
<<<<<<< HEAD __all__ = ['db_available','add_to_db'] ======= import math >>>>>>> a454f3d2717b10f207860099d8466b8333988a38 # Third party imports import pandas # Local imports <<<<<<< HEAD from mendeley.optional import MissingModule from mendeley.optional import db #Optional Imports #---------------------------------...
{ "content_hash": "3206fa006f67f20d0644d09a3690207e", "timestamp": "", "source": "github", "line_count": 313, "max_line_length": 120, "avg_line_length": 31.447284345047922, "alnum_prop": 0.6107893934775983, "repo_name": "ScholarTools/mendeley_python", "id": "ee8f828bfcac07c0014bcee9f9e572d231d4e04d", ...
from django.db import models # No related name is needed here, since symmetrical relations are not # explicitly reversible. class SelfRefer(models.Model): name = models.CharField(max_length=10) references = models.ManyToManyField('self') related = models.ManyToManyField('self') def __unicode__(self): ...
{ "content_hash": "395c336d4d6a7337a3995ef2c62efbbd", "timestamp": "", "source": "github", "line_count": 97, "max_line_length": 140, "avg_line_length": 30.1340206185567, "alnum_prop": 0.708518645227506, "repo_name": "grangier/django-11599", "id": "913e719902885f92400f15132fbb6c09c77b85be", "size": "...
import pytest from api.base.settings.defaults import API_BASE from osf_tests.factories import ( RegistrationProviderFactory, AuthUserFactory ) from django.contrib.auth.models import Group from osf.models import RegistrationSchema from waffle.models import Flag from osf.migrations import update_provider_auth...
{ "content_hash": "266b65ec24962e8ebd610d571f29d631", "timestamp": "", "source": "github", "line_count": 210, "max_line_length": 104, "avg_line_length": 31.34285714285714, "alnum_prop": 0.6110604679428745, "repo_name": "Johnetordoff/osf.io", "id": "fb2db1e0184d73e2c695ea0394f0ce43927151a9", "size": ...
from warnings import warn from .takin import TakinTimeOfFlight, TakinTripleAxis from .tas_instrument import TripleAxisInstrument from .tof_instrument import TimeOfFlightInstrument class Instrument(object): r"""An object that represents either a Triple Axis Spectrometer instrument or a Time of Flight Instrumen...
{ "content_hash": "1fddc7c91ad525a88168241f7700e9c6", "timestamp": "", "source": "github", "line_count": 60, "max_line_length": 90, "avg_line_length": 35.93333333333333, "alnum_prop": 0.5978664192949907, "repo_name": "pseudocubic/neutronpy", "id": "928601db96d954f32ff7ab5fb8ff08748847e800", "size": ...
""" Command that will configure the neo4j connection. """ from rhobot.components.commands.base_command import BaseCommand from neo_backend.components.enums import GRAPH_URL_KEY, LOGIN_KEY, PASSWORD_KEY class ConfigureNeo4j(BaseCommand): name = 'configure_neo4j' description = 'Configure NEO4J' dependencie...
{ "content_hash": "dac78e582c9e7cb18ba153e2cce2ca1b", "timestamp": "", "source": "github", "line_count": 67, "max_line_length": 94, "avg_line_length": 31.850746268656717, "alnum_prop": 0.633552014995314, "repo_name": "rerobins/rho_neo_backend", "id": "ab8c2038853ada790d869ead9a68560b43a7be6c", "size...
'''This file generates shell code for the setup.SHELL scripts to set environment variables''' from __future__ import print_function import argparse import copy import errno import os import platform import sys CATKIN_MARKER_FILE = '.catkin' system = platform.system() IS_DARWIN = (system == 'Darwin') IS_WINDOWS = (sy...
{ "content_hash": "d4c932f078c184c55300f27a98b9b5ca", "timestamp": "", "source": "github", "line_count": 253, "max_line_length": 213, "avg_line_length": 41.98814229249012, "alnum_prop": 0.6395556810693778, "repo_name": "YinYangOfDao/ComputerVision", "id": "dce614e238d84c6a9e9e853bf00d276732e7832e", ...
############################################################################## # # Kennedy Institute of Rheumatology # # $Id$ # # Copyright (C) 2015 Stephen Sansom # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published b...
{ "content_hash": "a452bb32c7f674d56bff582c40c070ac", "timestamp": "", "source": "github", "line_count": 427, "max_line_length": 79, "avg_line_length": 29.807962529274004, "alnum_prop": 0.5246700188560653, "repo_name": "snsansom/scseq", "id": "2cc4848b76a53a3bac0a574be981e9ba529e9e40", "size": "1272...
try: import google.appengine.ext.blobstore as blobstore from google.appengine.ext.blobstore.blobstore import BlobReferenceProperty import google.appengine.ext.db as db import google.appengine.ext.webapp as webapp import google.appengine.api.files as files import google.appengine.api.memcache as memcache i...
{ "content_hash": "753cdec5d862019d9defc53b7f5e7a7a", "timestamp": "", "source": "github", "line_count": 187, "max_line_length": 80, "avg_line_length": 26.77540106951872, "alnum_prop": 0.6395046934291991, "repo_name": "nacl-webkit/chrome_deps", "id": "34956b3ab3ea4fddfe6ae46f6b13ece160d9a8c6", "size...
"""Nullable types Revision ID: edec8846424d Revises: 57d748d33c22 Create Date: 2017-09-07 15:01:41.329026 """ from alembic import op import sqlalchemy as sa # revision identifiers, used by Alembic. revision = 'edec8846424d' down_revision = '57d748d33c22' branch_labels = None depends_on = None def upgrade(): #...
{ "content_hash": "4c548269b446b2e95640a72c4f0cf25a", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 67, "avg_line_length": 36.61904761904762, "alnum_prop": 0.6723016905071522, "repo_name": "csdt/Pawi", "id": "71d07d95d376410f9b3ca3fd676dafc6735fd844", "size": "1538", "b...
import os import sys import rest_framework_jwt from setuptools import setup name = 'djangorestframework-jwt' version = rest_framework_jwt.__version__ package = 'rest_framework_jwt' description = 'JSON Web Token based authentication for Django REST framework' url = 'https://github.com/GetBlimp/django-rest-framework-...
{ "content_hash": "f044c5612899d75f7e8f4fbec5f74be2", "timestamp": "", "source": "github", "line_count": 92, "max_line_length": 77, "avg_line_length": 29.141304347826086, "alnum_prop": 0.6247668780305856, "repo_name": "erichonkanen/django-rest-framework-jwt", "id": "cb8a1896c3993843f54009d9e27a6369473...
__revision__ = "test/scons-time/obj/objglob.py rel_2.5.1:3735:9dc6cee5c168 2016/11/03 14:02:02 bdbaddog" """ Verify that the obj subcommand globs for files. """ import TestSCons_time test = TestSCons_time.TestSCons_time() lines = [ ' pre-read post-read pre-build post-build\n' ] line_fmt = ' 6...
{ "content_hash": "fe375e23c0f11db61f5fe3948fb6fedb", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 104, "avg_line_length": 24.676470588235293, "alnum_prop": 0.6424314660309892, "repo_name": "EmanueleCannizzaro/scons", "id": "c43474701ff84289a96c95880392c7be6c271d08", "si...
""" wiki ~~~~~~~~~ writing module for markdown format similar wiki. :copyright: (c) 2014 by geeksaga. :license: MIT LICENSE 2.0, see license for more details. """ from flask import Flask, session, redirect, request, url_for from flask import render_template, abort from jinja2 import Te...
{ "content_hash": "94dac852394368c108540f74a23cf1f1", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 89, "avg_line_length": 33.88607594936709, "alnum_prop": 0.5980575270825551, "repo_name": "geekflow/archive", "id": "308671f2ce5d3a2c83936a75f1915c07d1b16ff0", "size": "2853...
import os import argparse import logging from genie import input_to_database from genie import write_invalid_reasons from genie import process_functions logging.basicConfig(level=logging.INFO) logger = logging.getLogger(__name__) def main(process, project_id, center=None, pemfile=None, ...
{ "content_hash": "0d342e9ed3434b2f19833b028c540c46", "timestamp": "", "source": "github", "line_count": 197, "max_line_length": 92, "avg_line_length": 35.50253807106599, "alnum_prop": 0.6259651129539605, "repo_name": "thomasyu888/Genie", "id": "78e23bdd089d8b568d53ece5587507cc2c75bb50", "size": "70...
""" Return dictionary of clausulae found in the prosody of Latin prose. The clausulae analysis function returns a dictionary in which the key is the type of clausula and the value is the number of times it occurs in the text. The list of clausulae used in the method is derived from the 'Prose Rhythm' section of John R...
{ "content_hash": "e375e0977fe24322aa84d5764642b36f", "timestamp": "", "source": "github", "line_count": 49, "max_line_length": 123, "avg_line_length": 45.775510204081634, "alnum_prop": 0.5951850200624164, "repo_name": "coderbhupendra/cltk", "id": "bc0051e19f88546f11a742404c21118a9c77f9e5", "size": ...
import os import sys import getpass import subprocess try: from fabricate import * except ImportError, e: print "Couldn't find the fabricate module." sys.exit(1) MAXOSDIR = os.environ['MAXELEROSDIR'] MAXCOMPILERDIR = os.environ['MAXCOMPILERDIR'] DFE_MODEL = 'ISCA' MAXFILE = 'EthFwd.max' DESIGN_NAME = MAXFILE.repl...
{ "content_hash": "e8ecf873984b069c5052ae34e910f989", "timestamp": "", "source": "github", "line_count": 102, "max_line_length": 120, "avg_line_length": 27.745098039215687, "alnum_prop": 0.6141342756183745, "repo_name": "kklt92/NetworkingCodeExamples", "id": "68fd929b4d75802a8535cd6910ba3167fe08b252",...
"""Defines the templating context for SQL Lab""" from __future__ import absolute_import from __future__ import division from __future__ import print_function from __future__ import unicode_literals import inspect import jinja2 from datetime import datetime, timedelta from dateutil.relativedelta import relativedelta i...
{ "content_hash": "6e6ac1b5272d8721817f53e32d0e45fa", "timestamp": "", "source": "github", "line_count": 206, "max_line_length": 78, "avg_line_length": 36.9126213592233, "alnum_prop": 0.6133613887427669, "repo_name": "jeromecn/caravel_viz_full", "id": "95212c9b28b006fd08d5fa02febec4b09ae25862", "siz...
__author__ = 'Bohdan Mushkevych' from synergy.scheduler.scheduler_constants import TYPE_FREERUN, STATE_MACHINE_FREERUN from synergy.db.model.daemon_process_entry import DaemonProcessEntry from odm.fields import StringField, ListField, ObjectIdField, BooleanField PROCESS_NAME = 'process_name' # name of the p...
{ "content_hash": "3e247408121c8ec685029b1de85bde18", "timestamp": "", "source": "github", "line_count": 101, "max_line_length": 102, "avg_line_length": 35.742574257425744, "alnum_prop": 0.603601108033241, "repo_name": "eggsandbeer/scheduler", "id": "f0a403f68e933b9b7fc551888dc7beb6af5aa019", "size"...
from eventlet import greenthread import mock import six from nova import exception from nova import test from nova.tests.unit.virt.xenapi import stubs from nova.virt.xenapi import volume_utils class SROps(stubs.XenAPITestBaseNoDB): def test_find_sr_valid_uuid(self): self.session = mock.Mock() sel...
{ "content_hash": "8ef86d069ae9c274c5ce128fad63fce5", "timestamp": "", "source": "github", "line_count": 401, "max_line_length": 78, "avg_line_length": 38.12967581047381, "alnum_prop": 0.5750163505559189, "repo_name": "vmturbo/nova", "id": "e7bc570e73ae72ce7ec05226a64038d16f53d4e1", "size": "15926",...
from django.http import HttpResponseRedirect from django.views.generic.list import ListView from django.utils.translation import ugettext as _ from django.contrib import messages from django.contrib.auth import REDIRECT_FIELD_NAME from django.contrib.auth.decorators import login_required from account.mixins import Lo...
{ "content_hash": "4b1ab38e2f6dddb939a54384f7ae4c5b", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 142, "avg_line_length": 37.45454545454545, "alnum_prop": 0.7475728155339806, "repo_name": "eldarion/pycon", "id": "01ace0057abea581426daee436c82138d66b99f1", "size": "1648"...
import logging import pymongo import sys import os sys.path.insert(0, os.path.join(os.path.dirname(__file__), "../")) from comm import singleton from global_const import MONGO_HOST, MONGO_PORT, MONGO_USR, MONGO_PWD, MONGO_DB # category options class category_dao(singleton): __category_collection = None; def ...
{ "content_hash": "4153a612ea7ff52b7033b80b20fd4808", "timestamp": "", "source": "github", "line_count": 53, "max_line_length": 79, "avg_line_length": 28.32075471698113, "alnum_prop": 0.5856095936042638, "repo_name": "ThomasZh/legend-club-wxpub", "id": "29c20cd965252958c68e23852a1e56292ca065d9", "si...
""" WSGI config for my_proj 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.7/howto/deployment/wsgi/ """ import os os.environ.setdefault("DJANGO_SETTINGS_MODULE", "my_proj.settings") from django.core.w...
{ "content_hash": "d6e42a945c383300d4719ac81563d168", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 78, "avg_line_length": 27.785714285714285, "alnum_prop": 0.7686375321336761, "repo_name": "noisebridge/PythonClass", "id": "f65bfae7a8e08b54c94678e27aa97d63e41fd3c4", "size...
from telex import auth from telex.utils.decorators import pm_only from telex import plugin class ConfigPlugin(plugin.TelexPlugin): """ Plugin to manage other plugin configuration. """ patterns = { "^{prefix}config ([\w-]+) show$": "show_options", "^{prefix}config ([\w-]+) set ([\w-]+) ...
{ "content_hash": "a00eda0cebc587026cebf67e57ab8ac2", "timestamp": "", "source": "github", "line_count": 56, "max_line_length": 108, "avg_line_length": 38.82142857142857, "alnum_prop": 0.6048758049678012, "repo_name": "datamachine/telex", "id": "c61146c61374bf8a8ab980422f517d9a8c74fcb8", "size": "21...
from swgpy.object import * def create(kernel): result = Tangible() result.template = "object/tangible/ship/attachment/wing/shared_xwing_wing_pos_s01.iff" result.attribute_template_id = 8 result.stfName("item_n","ship_attachment") #### BEGIN MODIFICATIONS #### #### END MODIFICATIONS #### return result
{ "content_hash": "262872a5c7115c64ce178fe4dea5db54", "timestamp": "", "source": "github", "line_count": 13, "max_line_length": 87, "avg_line_length": 24.53846153846154, "alnum_prop": 0.7021943573667712, "repo_name": "obi-two/Rebelion", "id": "be95d79f0cdfa9f5e1a89062ae8ed3705d709e9a", "size": "464"...
import os import sys import BaseHTTPServer import SocketServer import urlparse class MyHandler(BaseHTTPServer.BaseHTTPRequestHandler): homedir = '' known_content = { '.htm': 'text/html', '.html': 'text/html', '.css': 'text/css', '.js': 'text/javascript', ...
{ "content_hash": "9696f70a89a303ed9730fc7abab08c94", "timestamp": "", "source": "github", "line_count": 58, "max_line_length": 103, "avg_line_length": 26.93103448275862, "alnum_prop": 0.558258642765685, "repo_name": "Lirazs/Midi-Music-Teacher", "id": "12ab6ae5377e7a83aa3102ceb16a8541cbc7a1a6", "siz...
from __future__ import absolute_import from __future__ import division from __future__ import print_function import numpy as np from tensorflow.python.framework import dtypes from tensorflow.python.framework import random_seed from tensorflow.python.ops import array_ops from tensorflow.python.ops import math_ops from...
{ "content_hash": "ec71dba5c5748c7ee35a168c812cb8db", "timestamp": "", "source": "github", "line_count": 297, "max_line_length": 80, "avg_line_length": 36.93939393939394, "alnum_prop": 0.6842584996809771, "repo_name": "meteorcloudy/tensorflow", "id": "34b35a4ffb878c63f851f2b31491e7bfa4057417", "size...
import os # import distutils from distutils import dist cwd = os.getcwd() def lines(string): if not string: return [] _lines = string.splitlines() _lines = list(filter(lambda l: l.lstrip().rstrip(), _lines)) _lines = list(filter(lambda l: l, _lines)) return _lines def read(path): if o...
{ "content_hash": "5659ccce5adf5855ef528f6b31dacd6b", "timestamp": "", "source": "github", "line_count": 140, "max_line_length": 71, "avg_line_length": 31.22142857142857, "alnum_prop": 0.5703500343170899, "repo_name": "MarkWh1te/xueqiu_predict", "id": "8e2357218538aae55ac26a3d21b848cb65c286be", "siz...
import csv, random import SonicScrewdriver as utils idlist = list() with open('religion.csv', encoding = 'utf-8') as f: reader = csv.DictReader(f) for row in reader: docid = row['docid'] idlist.append(docid) with open('religionids.txt', mode = 'w', encoding = 'utf-8') as f: for anid in id...
{ "content_hash": "19dc8880c55c43881192c2d9401dd04b", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 66, "avg_line_length": 25.357142857142858, "alnum_prop": 0.6197183098591549, "repo_name": "tedunderwood/GenreProject", "id": "61a14eae534201d66dc09b84244d5924a2d528ed", "si...
class QueueArray: def __init__(self): self.items = [] def isEmpty(self): return self.items == [] def enqueue(self, item): # We always enqueue into last position self.items.append(item) def dequeue(self): if not self.isEmpty(): # We always dequeue fr...
{ "content_hash": "7ca38d536da986f32181065510fafb13", "timestamp": "", "source": "github", "line_count": 64, "max_line_length": 116, "avg_line_length": 29.359375, "alnum_prop": 0.4970729111229377, "repo_name": "CodersForLife/Data-Structures-Algorithms", "id": "dd38602d61d5e769b7891410380e1019ce41ee02"...
import os, sys import timeit import array import ROOT from alphatwirl.roottree import Events, BEvents # https://cp3.irmp.ucl.ac.be/projects/delphes/ticket/1039 ROOT.gInterpreter.Declare('#include "classes/DelphesClasses.h"') ROOT.gInterpreter.Declare('#include "external/ExRootAnalysis/ExRootTreeReader.h"') ROOT.gSyst...
{ "content_hash": "8852a786e3a0b494719616c80319a454", "timestamp": "", "source": "github", "line_count": 79, "max_line_length": 97, "avg_line_length": 34.936708860759495, "alnum_prop": 0.5467391304347826, "repo_name": "TaiSakuma/AlphaTwirl", "id": "77e504d4de255c67f485d51beecc108165e73795", "size": ...
""" This dag autoscales your cluster. This only works with docker-compose (local) and Infrakit (swarm). For Infrakit, the following environment variables must be set: - INFRAKIT_IMAGE - what docker image to use for infrakit i.e.infrakit/devbundle:latest - INFRAKIT_GROUPS_URL - the location of the groups js...
{ "content_hash": "8e0d517e10e394487fe555cc45e8f42a", "timestamp": "", "source": "github", "line_count": 153, "max_line_length": 93, "avg_line_length": 32.03921568627451, "alnum_prop": 0.6383108935128519, "repo_name": "wongwill86/air-tasks", "id": "ae11912c63b99794f785d4d529b22d180ac7c785", "size": ...
import sys import unittest from test import test_support import asyncore import socket import select import time import gc import os import errno import pprint import urllib, urlparse import traceback import weakref from BaseHTTPServer import HTTPServer from SimpleHTTPServer import SimpleHTTPRequestHandler # Optional...
{ "content_hash": "6bb9877ec60df99c7e4d0273e00c249c", "timestamp": "", "source": "github", "line_count": 1266, "max_line_length": 107, "avg_line_length": 42.17219589257504, "alnum_prop": 0.47688705750140475, "repo_name": "MalloyPower/parsing-python", "id": "813968ead6ff36758254638b4ac5250c91412eff", ...
import os import socket import uuid import eventlet import netaddr from oslo.config import cfg from quantum.agent.common import config from quantum.agent.linux import dhcp from quantum.agent.linux import external_process from quantum.agent.linux import interface from quantum.agent.linux import ip_lib from quantum.age...
{ "content_hash": "5f680ca83778ca2b193d6474e54a94d1", "timestamp": "", "source": "github", "line_count": 724, "max_line_length": 79, "avg_line_length": 38.994475138121544, "alnum_prop": 0.5669807310852932, "repo_name": "yamt/neutron", "id": "7c64d8d82549ffc7acc23546cdc4554ba49c510b", "size": "28913"...
import sys _b=sys.version_info[0]<3 and (lambda x:x) or (lambda x:x.encode('latin1')) from google.protobuf import descriptor as _descriptor from google.protobuf import message as _message from google.protobuf import reflection as _reflection from google.protobuf import symbol_database as _symbol_database # @@protoc_ins...
{ "content_hash": "54763e3e0e770d16dd60f0f8cd806e96", "timestamp": "", "source": "github", "line_count": 69, "max_line_length": 346, "avg_line_length": 42.72463768115942, "alnum_prop": 0.7883310719131614, "repo_name": "diplomacy/research", "id": "09933ef317880a88c22124b449188108ddb615cc", "size": "3...
from setuptools import setup def get_version(filename): """ Parse the value of the __version__ var from a Python source file without running/importing the file. """ import re version_pattern = r"^ *__version__ *= *['\"](\d+\.\d+\.\d+)['\"] *$" match = re.search(version_pattern, open(filena...
{ "content_hash": "55607629a70c762d14014a7157524ccf", "timestamp": "", "source": "github", "line_count": 31, "max_line_length": 75, "avg_line_length": 25.483870967741936, "alnum_prop": 0.5810126582278481, "repo_name": "h4l/sublcmd", "id": "2e51160cd3e345805e5c78d1228b5d9cc856f502", "size": "790", ...
""" Greeting service provider :author: Thomas Calmant :copyright: Copyright 2016, Thomas Calmant :license: Apache License 2.0 .. Copyright 2016 Thomas Calmant Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obta...
{ "content_hash": "364afb1810f39d74cda250e1fd6bab7b", "timestamp": "", "source": "github", "line_count": 93, "max_line_length": 80, "avg_line_length": 27.473118279569892, "alnum_prop": 0.5549902152641879, "repo_name": "ahmadshahwan/ipopo", "id": "bc5742f8073c1e21025bc84cbd8c7568348a9d6f", "size": "2...
import collections from constants import ServerType from models import Server from models import JumpHost from models import SystemOption from models import CustomCommandProfile from utils import concatenate_dirs from utils import is_empty from utils import make_url from constants import get_temp_dir...
{ "content_hash": "07d149597f7d92a07737e98b49e0eccb", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 127, "avg_line_length": 36.12, "alnum_prop": 0.5555839509327881, "repo_name": "csm-aut/csm", "id": "d0777dddf94e15211c3736d275a8c8de01b95bf7", "size": "13253", "binary":...
from django.contrib.auth.models import User from django.test import TestCase from social.app.models.author import Author from social.app.models.node import Node class NodeTestCase(TestCase): def setUp(self): Node.objects.create(name="Test", host="http://www.socdis.com/", service_url="http://api.socdis.co...
{ "content_hash": "68eeaf2f9251482183128a7fb8322b9b", "timestamp": "", "source": "github", "line_count": 42, "max_line_length": 109, "avg_line_length": 37.666666666666664, "alnum_prop": 0.6466498103666245, "repo_name": "TeamAADGT/CMPUT404-project-socialdistribution", "id": "5e3faedc2173bdc9f6f2a893412...
class SilentException(Exception): def __init__(self): Exception.__init__(self)
{ "content_hash": "6671d9332dce76a32a4031a8e881a235", "timestamp": "", "source": "github", "line_count": 3, "max_line_length": 33, "avg_line_length": 30.333333333333332, "alnum_prop": 0.6263736263736264, "repo_name": "earlye/nephele", "id": "09c87843e431cf54b3d5ff4fc8f14a40eaf2a8ab", "size": "91", ...
import requests_mock from tests.fixture_data import DATUM_ALIAS_DATA from valohai_cli.commands.alias.list import list def test_list(runner, logged_in_and_linked): with requests_mock.mock() as m: m.get( 'https://app.valohai.com/api/v0/datum-aliases/', json={ 'resul...
{ "content_hash": "419c38ebcc6654a32e721ccda94e6e4e", "timestamp": "", "source": "github", "line_count": 22, "max_line_length": 95, "avg_line_length": 29.545454545454547, "alnum_prop": 0.5507692307692308, "repo_name": "valohai/valohai-cli", "id": "0a6344c01fa61792cd1f675100b388ce4a09bb8f", "size": "...
"""The 1-Wire component.""" import logging from pyownet import protocol from homeassistant.config_entries import ConfigEntry from homeassistant.core import HomeAssistant from homeassistant.exceptions import ConfigEntryNotReady from homeassistant.helpers import device_registry as dr from .const import DOMAIN, PLATFOR...
{ "content_hash": "1d524f597958763c4eb91c953fa99dec", "timestamp": "", "source": "github", "line_count": 62, "max_line_length": 85, "avg_line_length": 33.38709677419355, "alnum_prop": 0.7246376811594203, "repo_name": "nkgilley/home-assistant", "id": "e3454a5eb5cb2a6ad67c2411ab22ed07819b5922", "size"...
"""Seq2seq layer operations for use in neural networks. """ from __future__ import absolute_import from __future__ import division from __future__ import print_function import abc import six from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.python.fra...
{ "content_hash": "56971784d16d0e127cc2dbfb7cf6d96c", "timestamp": "", "source": "github", "line_count": 247, "max_line_length": 85, "avg_line_length": 35.22267206477733, "alnum_prop": 0.6562068965517242, "repo_name": "abhitopia/tensorflow", "id": "6338eb152e96031365e4065dd21c7b28a9abbd5c", "size": ...
"""Compiled parallel-for loop.""" # pylint: disable=missing-docstring from __future__ import absolute_import from __future__ import division from __future__ import print_function import collections from tensorflow.python.framework import constant_op from tensorflow.python.framework import dtypes from tensorflow.pyth...
{ "content_hash": "ea2e2adedc4218ad4dfffc5619942f50", "timestamp": "", "source": "github", "line_count": 2622, "max_line_length": 80, "avg_line_length": 40.01792524790236, "alnum_prop": 0.672944046813499, "repo_name": "dancingdan/tensorflow", "id": "83cbe64ff21d6fa4380ddc9effb18b80feb5536b", "size":...
import pkgutil import inspect from viper.common.out import print_warning from viper.common.abstracts import Module def load_modules(): # Import modules package. import viper.modules as modules plugins = dict() # Walk recursively through all modules and packages. for loader, module_name, ispkg in...
{ "content_hash": "d524b19f67ab84b52fd37a304db6cb94", "timestamp": "", "source": "github", "line_count": 36, "max_line_length": 112, "avg_line_length": 36.97222222222222, "alnum_prop": 0.6408715251690458, "repo_name": "S2R2/viper", "id": "8388ef5796c6f6e2e02f9a972b885fb3843ddfaf", "size": "1453", ...
import xlwt from xlwt import Font from xlwt import XFStyle class XlsExporter(object): @staticmethod def export(match_list, file_path): wb = xlwt.Workbook() ws = wb.add_sheet('Ranking') # writing header header = ['Ranking', 'Name', 'Rating', ...
{ "content_hash": "bded8bb079666291e8e8dabae4f1bf8b", "timestamp": "", "source": "github", "line_count": 44, "max_line_length": 121, "avg_line_length": 39.09090909090909, "alnum_prop": 0.5354651162790698, "repo_name": "agustin-prats/edenred-ranking", "id": "98e69c648d876ac053f0da13b4a2d1dcf3c4846c", ...
import sys,traceback if sys.version_info[0] != 3: print("This script is only python3 compatible!") exit(1) import numpy as np import h5py from argparse import ArgumentParser import os.path import json import matplotlib as mpl mpl.use("agg") import matplotlib.cm as cm import matplotlib.ticker as ticker import ...
{ "content_hash": "35ddeb2b54a3e64159b1488cf6b44ab5", "timestamp": "", "source": "github", "line_count": 649, "max_line_length": 170, "avg_line_length": 38.55469953775039, "alnum_prop": 0.5995124290624251, "repo_name": "gabyx/acciv", "id": "61f747d03e79d9033929a85eea78cec1f8c7a394", "size": "25045",...
import six.moves from numbers import Integral from .iter_dispatch import range_iterator __all__ = ['xrange'] def _check_integral(value): if not isinstance(value, Integral): raise TypeError("'{}' object cannot be interpreted " "as an integer".format(type(value).__name__)) class x...
{ "content_hash": "ce2a688e1ada7be2c65da1a032abadbd", "timestamp": "", "source": "github", "line_count": 87, "max_line_length": 78, "avg_line_length": 31.689655172413794, "alnum_prop": 0.5208560029017048, "repo_name": "orhanf/picklable_itertools", "id": "e4d6c12203d7fcebeff80e728cf4da4437830b88", "s...
"""This file contains XChat scrollback log file parser in plaso. Information updated 06 September 2013. Besides the logging capability, the XChat IRC client has the option to record the text for opened tabs. So, when rejoining a particular channel and/or a particular conversation, XChat will display the last messages...
{ "content_hash": "2a5dfeb357467ac0dd27990d248a7572", "timestamp": "", "source": "github", "line_count": 208, "max_line_length": 80, "avg_line_length": 35.27884615384615, "alnum_prop": 0.7143635868083946, "repo_name": "dc3-plaso/plaso", "id": "efbca09d1bcfb8755119abb2137a1ce1f7616d85", "size": "7362...
from django.db import migrations, models class Migration(migrations.Migration): dependencies = [ ('tournament', '0181_auto_20180610_2123'), ] operations = [ migrations.AlterField( model_name='modrequest', name='type', field=models.CharField(choices=[('...
{ "content_hash": "616f02e7c61ae18035eff3d1cc1189d3", "timestamp": "", "source": "github", "line_count": 16, "max_line_length": 525, "avg_line_length": 51.0625, "alnum_prop": 0.6462668298653611, "repo_name": "cyanfish/heltour", "id": "440cd41dd7edeb177805774fe5728b8235f5028b", "size": "891", "bina...
from django.template.loader import get_template from django.http import HttpResponse, HttpResponseRedirect, HttpResponseBadRequest from django.template import Context from teaching_data_structure import TeachingHierarchy, SchoolYear, TeachingClass from utils import get_header_navbar import json from djangoSRV.teacher i...
{ "content_hash": "fced5aecf652ce6522b05e130921a355", "timestamp": "", "source": "github", "line_count": 63, "max_line_length": 185, "avg_line_length": 44.17460317460318, "alnum_prop": 0.6773266259432267, "repo_name": "varun-verma11/CodeDrill", "id": "8a90a2cec364a78e16b3ad73f5d42df95abba6ac", "size...
"""This module contains Google Campaign Manager sensor.""" from typing import Dict, Optional, Sequence, Union from airflow.providers.google.marketing_platform.hooks.campaign_manager import GoogleCampaignManagerHook from airflow.sensors.base import BaseSensorOperator class GoogleCampaignManagerReportSensor(BaseSensor...
{ "content_hash": "71b215579c1c8a037428e652e06376de", "timestamp": "", "source": "github", "line_count": 86, "max_line_length": 110, "avg_line_length": 40.372093023255815, "alnum_prop": 0.6575460829493087, "repo_name": "apache/incubator-airflow", "id": "686481787fe0367b21acc7e59e8136c7a56fa222", "si...
from distutils.core import setup setup( name='Cloud Images Query', version='0.1.1', packages=['cloud_images'], author='Chris R. Bennett', author_email='source@mruser.com', url='https://github.com/mruser/cloud_images/', description='Query tool for Ubuntu cloud-images', long_description=''...
{ "content_hash": "5f0c954d3227d3f8bcfa1769d737fcfe", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 61, "avg_line_length": 34.61904761904762, "alnum_prop": 0.6217331499312242, "repo_name": "mruser/cloud_images", "id": "424861b7ebed941dc64830e2c01c254e83b1d13f", "size": "7...
""" The :mod:`sklearn.model_selection._validation` module includes classes and functions to validate the model. """ # Author: Alexandre Gramfort <alexandre.gramfort@inria.fr>, # Gael Varoquaux <gael.varoquaux@normalesup.org>, # Olivier Grisel <olivier.grisel@ensta.org> # License: BSD 3 clause from __...
{ "content_hash": "c3a3309f1c4994624f821aae9d715f05", "timestamp": "", "source": "github", "line_count": 950, "max_line_length": 79, "avg_line_length": 38.369473684210526, "alnum_prop": 0.6336177333955173, "repo_name": "olologin/scikit-learn", "id": "11b2a218d33e4dcbf0cdb4868cc277bbdc536f1e", "size"...
import unittest from tests import testutils from common import environment from tests import testconstants from services.restaurants.services import countrysubdivisionslocalfavoritesservice from services.restaurants.domain.options import countrysubdivisionslocalfavoritesrequestoptions class CountrySubdivisionsLocalFa...
{ "content_hash": "0214e77f2f2814dbcdb0c94febf5497b", "timestamp": "", "source": "github", "line_count": 21, "max_line_length": 120, "avg_line_length": 59, "alnum_prop": 0.6924939467312349, "repo_name": "M4gn4tor/mastercard-api-python", "id": "997cc6858da3c7133379a4220b1f678baa196626", "size": "1239...
""" homeassistant.bootstrap ~~~~~~~~~~~~~~~~~~~~~~~ Provides methods to bootstrap a home assistant instance. Each method will return a tuple (bus, statemachine). After bootstrapping you can add your own components or start by calling homeassistant.start_home_assistant(bus) """ import os import logging from collectio...
{ "content_hash": "6c443375f210315c57fc01a7b1528c7b", "timestamp": "", "source": "github", "line_count": 325, "max_line_length": 79, "avg_line_length": 31.055384615384614, "alnum_prop": 0.6398494005746557, "repo_name": "CCOSTAN/home-assistant", "id": "e5f6d2b967259e06f1946d735b647be57f3b2408", "size...
import logging import json import time import urllib.request import urllib.parse import numpy logger = logging.getLogger(__name__) DATE_FORMATS = [ '%Y-%m-%d', '%Y/%m/%d', '%B %d, %Y', '%b %d, %Y', '%d %B %Y', '%d. %B %Y', ] # Used these to harvest as many birth dates as possible DATE_ANOMALIES = { 'T08:30'...
{ "content_hash": "4ac77a6884cf7d20d65f69772afbfa4e", "timestamp": "", "source": "github", "line_count": 94, "max_line_length": 110, "avg_line_length": 24.47872340425532, "alnum_prop": 0.6562364189482833, "repo_name": "Pancho/failiac", "id": "63d52711a61684a296004a40c8f3431f80208ca9", "size": "2301"...
""" Copyright 2013 LinkedIn Corp. All rights reserved. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to...
{ "content_hash": "fdaa9c555dfef606af69d39b038c6ac2", "timestamp": "", "source": "github", "line_count": 262, "max_line_length": 155, "avg_line_length": 38, "alnum_prop": 0.5758336681398152, "repo_name": "linkedin/naarad", "id": "0d838c6f9b362d745148aa0a49bc01dcee9b7710", "size": "9971", "binary":...
import pretend import pytest from wtforms.validators import StopValidation, ValidationError from warehouse.forms import ( Form, DBForm, URIValidator, PasswordStrengthValidator, ) class TestURIValidator: @pytest.mark.parametrize( "uri", [ "https://example.com/", "http...
{ "content_hash": "d81e5aadf8e7e5d53fbc77ae61976fc5", "timestamp": "", "source": "github", "line_count": 204, "max_line_length": 78, "avg_line_length": 29.720588235294116, "alnum_prop": 0.5362031997361042, "repo_name": "alex/warehouse", "id": "f2db87fb865f16a64d4a04fcc9c0a5c3b2b2803f", "size": "6604...
from direct.showbase import DirectObject from direct.directnotify import DirectNotifyGlobal from direct.distributed import DistributedObject from direct.task import Task from direct.distributed import DoInterestManager from otp.distributed.OtpDoGlobals import * _ToonTownDistrictStatInterest = None _ToonTownDistrictSta...
{ "content_hash": "070d6ad22d392e03c8351a73c007a580", "timestamp": "", "source": "github", "line_count": 89, "max_line_length": 134, "avg_line_length": 37.08988764044944, "alnum_prop": 0.7185701302635565, "repo_name": "linktlh/Toontown-journey", "id": "ee6bbaaec896e368d4445298159beb987990317e", "siz...
"""Provides the Document model""" from sqlalchemy.ext.declarative import declarative_base from sqlalchemy import Column, Integer, String, LargeBinary BASE = declarative_base() class Document(BASE): # pylint: disable=too-few-public-methods """Document model""" __tablename__ = 'documents' document_id = Co...
{ "content_hash": "93a65f5ace7d3e076d189d6bb064ddce", "timestamp": "", "source": "github", "line_count": 14, "max_line_length": 62, "avg_line_length": 30.714285714285715, "alnum_prop": 0.7325581395348837, "repo_name": "FreakJoe/cryptolockpy", "id": "26c5aaaf7de557024b994a484adc626144425d84", "size":...
"""Views used by custom social_auth pipeline""" from django.conf import settings from django.core.urlresolvers import reverse from django.views.generic.edit import FormView from storybase_user.social_auth.forms import TosForm, EmailTosForm class GetExtraAccountDetailsView(FormView): """Get additional user data ...
{ "content_hash": "f70d3f13b414d9bda8a2247b582143d3", "timestamp": "", "source": "github", "line_count": 34, "max_line_length": 88, "avg_line_length": 37.94117647058823, "alnum_prop": 0.6751937984496124, "repo_name": "denverfoundation/storybase", "id": "36e8998850653442ff96ef12d1a117b7924c6bf1", "si...
from django.core.paginator import Paginator, InvalidPage from django.utils.translation import ugettext_lazy as _ from haystack import connections from oscar.core.loading import get_class from . import facets FacetMunger = get_class('search.facets', 'FacetMunger') # Workaround for pysolr 3.1 not supporting and fail...
{ "content_hash": "7e0dcedf671431efe3827af1a752f42e", "timestamp": "", "source": "github", "line_count": 235, "max_line_length": 79, "avg_line_length": 36.774468085106385, "alnum_prop": 0.6320296227725064, "repo_name": "ahmetdaglarbas/e-commerce", "id": "d5fec37eb0f0f5332e2e69224530d676515e388a", "s...
"""Common configuration elements for networkzero """ ENCODING = "UTF-8" class _Forever(object): def __repr__(self): return "<Forever>" FOREVER = _Forever() SHORT_WAIT = 1 # 1 second EVERYTHING = "" COMMAND_ACK = "ack" # # Beacons will broadcast adverts at this frequency # BEACON_ADVERT_FREQUENCY_S = 2 # # Adverts w...
{ "content_hash": "19dacaf3676a5c9b8069f3d16e6c2d58", "timestamp": "", "source": "github", "line_count": 28, "max_line_length": 64, "avg_line_length": 31.428571428571427, "alnum_prop": 0.7465909090909091, "repo_name": "tjguk/networkzero", "id": "af8a47334e9fd5f37f840bbee80828b5f060824e", "size": "90...
from __future__ import unicode_literals import httplib import logging from django.core.exceptions import ValidationError from django.db import IntegrityError from django.db import connection from django.db import transaction from flask import request from framework.auth import Auth from framework.sessions import ge...
{ "content_hash": "87cd0351ec4676a4b5ee9e2b60a815f4", "timestamp": "", "source": "github", "line_count": 378, "max_line_length": 140, "avg_line_length": 36.74867724867725, "alnum_prop": 0.5985890144698006, "repo_name": "laurenrevere/osf.io", "id": "49afd63647bc6358e2f8dfd0e18707b3f4650baf", "size": ...
"""Search brewerydb.com for information about beers.""" import plumeria.util.http as http from plumeria import config from plumeria.command import commands, CommandError from plumeria.command.parse import Text from plumeria.message.mappings import build_mapping from plumeria.plugin import PluginSetupError from plumeri...
{ "content_hash": "0f18ee4af249b61b0ed81bf2cb9901e7", "timestamp": "", "source": "github", "line_count": 70, "max_line_length": 115, "avg_line_length": 28, "alnum_prop": 0.6408163265306123, "repo_name": "sk89q/Plumeria", "id": "06598712a3bd149d6a4254c8232800c63bd178e9", "size": "1962", "binary": f...
import numpy as np import pandas as pd from dask.distributed import Client from scipy import stats from sklearn.svm import SVC import dask_ml.model_selection as dms def test_search_basic(xy_classification): X, y = xy_classification param_grid = {"class_weight": [None, "balanced"]} a = dms.GridSearchCV(S...
{ "content_hash": "3c3c54cd920f429ee59e29d2bec24c67", "timestamp": "", "source": "github", "line_count": 30, "max_line_length": 72, "avg_line_length": 28.233333333333334, "alnum_prop": 0.6611570247933884, "repo_name": "dask/dask-ml", "id": "c78dcf036eabe63d6e5c8ae95a757e00d9d8d106", "size": "847", ...
""" Created on Sun Sep 11 19:29:11 2016 @author: DIP """ from normalization import normalize_corpus from utils import build_feature_matrix import numpy as np toy_corpus = ['The sky is blue', 'The sky is blue and beautiful', 'Look at the bright blue sky!', 'Python is a great Programming language', 'Python and Java a...
{ "content_hash": "d8e4194b0314d1b2dc8885ee186c8d28", "timestamp": "", "source": "github", "line_count": 180, "max_line_length": 89, "avg_line_length": 43.27777777777778, "alnum_prop": 0.524390243902439, "repo_name": "dipanjanS/text-analytics-with-python", "id": "2e7510e1514f3ce9861ec4793cbaf35ff64a70...