text stringlengths 4 1.02M | meta dict |
|---|---|
"""
These set of functions help the algorithms of MSAF to read and write files
of the Segmentation Dataset.
"""
import datetime
import glob
import json
import logging
import os
import re
from collections import defaultdict
import jams
import numpy as np
import six
# Local stuff
import msaf
from msaf import utils
from... | {
"content_hash": "a1445651590be529349bdb7f6db506fc",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 79,
"avg_line_length": 32.30168776371308,
"alnum_prop": 0.604793938998106,
"repo_name": "urinieto/msaf",
"id": "64dbb2f45028b5687348d12604d57d275eccc12a",
"size": "15311",... |
from json import JSONEncoder
# http://stackoverflow.com/questions/3768895/how-to-make-a-class-json-serializable
# http://stackoverflow.com/questions/18478287/making-object-json-serializable-with-regular-encoder
def _default(self, obj):
return getattr(obj.__class__, "__json__", _default.default)(obj)
_default.de... | {
"content_hash": "b2e4310a188f60ed646aadaff496d1d0",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 98,
"avg_line_length": 34.63636363636363,
"alnum_prop": 0.7637795275590551,
"repo_name": "silverfernsys/agentserver",
"id": "dccaa289bf274a6270c1e15dcefbc18663ff091b",
"siz... |
import unittest
import paddle
import paddle.static as static
from paddle.distributed import fleet
from paddle.distributed.auto_parallel.cluster import Cluster
from paddle.distributed.auto_parallel.dist_context import (
DistributedContext,
set_default_distributed_context,
)
from paddle.distributed.auto_paralle... | {
"content_hash": "c096a1c6560bbfc0f636e875bd13e055",
"timestamp": "",
"source": "github",
"line_count": 161,
"max_line_length": 80,
"avg_line_length": 28.658385093167702,
"alnum_prop": 0.5778066753359341,
"repo_name": "luotao1/Paddle",
"id": "30e7eabcc11565a908e2f0fef77a0457ff1414be",
"size": "5225... |
from swgpy.object import *
def create(kernel):
result = Tangible()
result.template = "object/tangible/deed/city_deed/shared_garden_naboo_med_04_deed.iff"
result.attribute_template_id = 2
result.stfName("deed","garden_naboo_med_04_deed")
#### BEGIN MODIFICATIONS ####
#### END MODIFICATIONS ####
return ... | {
"content_hash": "293dd5c2b5717c87ef1b945593209e2d",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 87,
"avg_line_length": 25.076923076923077,
"alnum_prop": 0.6993865030674846,
"repo_name": "obi-two/Rebelion",
"id": "214a1ea0aa2c3e263459335cc9f7589d8a7a4300",
"size": "471... |
import sys
import py4a
import setuptools
if __name__ == "__main__":
py4a.patch_distutils()
sys.argv = sys.argv[1:] # remove py4a
# twisted
_setup = {}
with open('src/twisted/python/_setup.py') as f:
exec(f.read(), _setup)
try:
setuptools.setup(**_setup["getSetupArgs"]())... | {
"content_hash": "1100bb5412315f9b72d9e6038e64d25d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 52,
"avg_line_length": 19.714285714285715,
"alnum_prop": 0.5893719806763285,
"repo_name": "kuri65536/python-for-android",
"id": "ef70cb2fb42d725eaed4047d7947ad62a8925cea",
... |
import re
from model.address import Address
class AddressHelper(object):
def __init__(self, app):
self.app = app
def new_address_page(self):
"""Open new address page"""
wd = self.app.wd
if not(wd.current_url.endswith("/edit.php")):
wd.find_element_by_link_text("add... | {
"content_hash": "31787b6a4efe78626a1a3deec7ef69ec",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 114,
"avg_line_length": 43.72222222222222,
"alnum_prop": 0.5826294939831078,
"repo_name": "vpalex999/python_training",
"id": "1577c3beda33f8e6a073403a77b2392c377a7407",
"s... |
'''Top-level coordinated RPC server.
.. This software is released under an MIT/X11 open source license.
Copyright 2012-2014 Diffeo, Inc.
'''
from __future__ import absolute_import
import inspect
import logging
from SocketServer import ThreadingTCPServer, StreamRequestHandler
import threading
import traceback
from... | {
"content_hash": "ed1e56f8cd599991961837816f75c512",
"timestamp": "",
"source": "github",
"line_count": 220,
"max_line_length": 103,
"avg_line_length": 35.15,
"alnum_prop": 0.5825682141471615,
"repo_name": "diffeo/coordinate",
"id": "018d70b128dcff8f33ac712f2fbdca1bf0c326bb",
"size": "7733",
"bin... |
import frappe
import json
from frappe.desk.doctype.bulk_update.bulk_update import show_progress
from frappe.model.document import Document
from frappe import _
class DeletedDocument(Document):
pass
@frappe.whitelist()
def restore(name, alert=True):
deleted = frappe.get_doc('Deleted Document', name)
if deleted.r... | {
"content_hash": "23b3a162558968f4a8dc924e8223583a",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 99,
"avg_line_length": 22.65625,
"alnum_prop": 0.716551724137931,
"repo_name": "mhbu50/frappe",
"id": "b398ec54102c548c2f3c4af1afbf8ef560fc5700",
"size": "1562",
"binary"... |
from .model import TextFileFormat, BinaryFileFormat, DirectoryFormat
from .plugin import Plugin
from qiime2.core.type import (SemanticType, Int, Str, Float, Color, Metadata,
MetadataCategory, Properties, Range, Choices,
Arguments, Bool, Set, List)
__all__ =... | {
"content_hash": "32dd9aa90dde310200cc92323904a80d",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 77,
"avg_line_length": 47.666666666666664,
"alnum_prop": 0.6083916083916084,
"repo_name": "ebolyen/qiime2",
"id": "b2bc3d039805784151270cce0dbbb636cf867680",
"size": "922",... |
"""Class for namecoind node under test"""
import contextlib
import decimal
import errno
from enum import Enum
import http.client
import json
import logging
import os
import re
import subprocess
import tempfile
import time
import urllib.parse
import collections
import shlex
import sys
from pathlib import Path
from .au... | {
"content_hash": "8ca371349d477b1e98c6e656feb62e5f",
"timestamp": "",
"source": "github",
"line_count": 835,
"max_line_length": 242,
"avg_line_length": 44.49461077844311,
"alnum_prop": 0.6060075902349743,
"repo_name": "pataquets/namecoin-core",
"id": "6fb6d5bc3db9944b9ca44f63a248fc1e746b0868",
"siz... |
print __doc__
# Code source: Gael Varoqueux
# Andreas Mueller
# Modified for Documentation merge by Jaques Grobler
# Modified for Extreme Learning Machine Classifiers by David Lambert
# License: BSD
import numpy as np
# import pylab as pl
# from matplotlib.colors import ListedColormap
from sklearn.data... | {
"content_hash": "b97eddb22f5c3f95824ee540e2a1f3ab",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 97,
"avg_line_length": 32.84892086330935,
"alnum_prop": 0.629215943933421,
"repo_name": "cgq5/elm",
"id": "e63396b65864a74b9661b8dcd5a826a911a635c3",
"size": "4609",
"bi... |
from typing import Any, Dict, List, Tuple, Union
import torch
from nltk import Tree
from allennlp.common.testing import (
AllenNlpTestCase,
global_distributed_metric,
run_distributed_test,
)
from allennlp.training.metrics import EvalbBracketingScorer
class EvalbBracketingScorerTest(AllenNlpTestCase):
... | {
"content_hash": "6218c903400b28f5a2479e4962855a85",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 97,
"avg_line_length": 39.715384615384615,
"alnum_prop": 0.5847375556846794,
"repo_name": "allenai/allennlp",
"id": "179e32668d21de5784eeefc04c9492783dab5175",
"size": "51... |
import os
import sys
from io import StringIO
from django.apps import apps
from django.conf import settings
from django.core import serializers
from django.db import router
# The prefix to put on the default database name when creating
# the test database.
TEST_DATABASE_PREFIX = 'test_'
class BaseDatabaseCreation:
... | {
"content_hash": "a4fc8f30a694dab2eec3288fa0366b20",
"timestamp": "",
"source": "github",
"line_count": 297,
"max_line_length": 112,
"avg_line_length": 40.47138047138047,
"alnum_prop": 0.5908485856905158,
"repo_name": "simonw/django",
"id": "dd3407bac34a0e339a40d5190ec06cefb03c4247",
"size": "12020... |
import time
from tempest.lib import exceptions
from tempest import test
from monasca_tempest_tests import clients
from monasca_tempest_tests.tests.api import base
from monasca_tempest_tests.tests.api import helpers
class TestReadOnlyRole(base.BaseMonascaTest):
@classmethod
def resource_setup(cls):
... | {
"content_hash": "01420d5e8fd523200d1a8f937aba4d4e",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 97,
"avg_line_length": 40.56140350877193,
"alnum_prop": 0.6337946943483276,
"repo_name": "sapcc/monasca-api",
"id": "4e96d6e17c7ec527f874a376524f6ca5bc6bfd0b",
"size": "75... |
from imposm.parser import OSMParser
from math import radians, sin, cos
import time
import xy
LAT, LNG = (40.777274, -73.967161)
def laea(lat, lng, clat, clng, scale=1):
lng, lat = radians(lng), radians(lat)
clng, clat = radians(clng), radians(clat)
k = (2 / (1 + sin(clat) * sin(lat) + cos(clat) * cos(lat)... | {
"content_hash": "be52c350598d52f8c7646ee06fc4c130",
"timestamp": "",
"source": "github",
"line_count": 87,
"max_line_length": 88,
"avg_line_length": 33.58620689655172,
"alnum_prop": 0.5660506502395619,
"repo_name": "fogleman/xy",
"id": "436221922566b3dd180d9155c8809a2f52464674",
"size": "2922",
... |
from tests.base_case import ChatBotTestCase
from chatterbot.logic import MathematicalEvaluation
from chatterbot.conversation import Statement
class MathematicalEvaluationTests(ChatBotTestCase):
def setUp(self):
super().setUp()
self.adapter = MathematicalEvaluation(self.chatbot)
def test_can_... | {
"content_hash": "6cc9b0a748a3e5e7e49363f112cdb4b1",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 103,
"avg_line_length": 42.11864406779661,
"alnum_prop": 0.6668008048289739,
"repo_name": "vkosuri/ChatterBot",
"id": "c1f153bdbf73db92d9f81ef8a14a75fa2ca72a3a",
"size": "... |
'''
The admin module, containing Flask-Admin.
'''
from flask.ext.admin import Admin, BaseView, expose
from flask.ext.admin.contrib.sqla import ModelView
from flask.ext.login import current_user
from dci_notify.admin.forms import SendMessageForm
from dci_notify.extensions import db
from dci_notify.sms import send_sms
... | {
"content_hash": "0c6017a2f683700017ac63fea05d15c7",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 62,
"avg_line_length": 29.72,
"alnum_prop": 0.6850605652759085,
"repo_name": "kevana/corpscores",
"id": "f1916707c481659864cfa0ee42b49f38361ba568",
"size": "1510",
"binar... |
from __future__ import with_statement
import unittest
import os
from gzip import GzipFile
from shutil import rmtree
import cPickle as pickle
import logging
import fcntl
import time
import tempfile
from contextlib import contextmanager
from eventlet.green import subprocess
from eventlet import Timeout, tpool
from test.... | {
"content_hash": "ea37c8b89a81fcdb35244e92a99c9d7a",
"timestamp": "",
"source": "github",
"line_count": 501,
"max_line_length": 80,
"avg_line_length": 40.71656686626746,
"alnum_prop": 0.5366929751458405,
"repo_name": "parkys1/swift_sandbox",
"id": "823c3217489b52ea4ed9b2ed6937bb6f9a1e1b57",
"size":... |
import re
from django.utils.six.moves import html_parser
HTMLParser = html_parser.HTMLParser
HTMLParseError = html_parser.HTMLParseError
from postmarkup import render_bbcode
from json import JSONEncoder
try:
import markdown
except ImportError:
pass
from django.conf import settings
from django.shortcuts import ... | {
"content_hash": "eac79c309140feb879f744d01e59f8db",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 85,
"avg_line_length": 29.6294964028777,
"alnum_prop": 0.5919630933592327,
"repo_name": "saifrahmed/DjangoBB",
"id": "ef21165a1b208fe23140acdfa9cbf9dc9546e541",
"size": "8... |
from .sopttest_gateway import SopttestGateway
| {
"content_hash": "aff6ce3e623a16f950ad91008060ec88",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 45,
"avg_line_length": 46,
"alnum_prop": 0.8695652173913043,
"repo_name": "bigdig/vnpy",
"id": "de443ebf2a55c618bec50e3ba60555f6f898df91",
"size": "46",
"binary": false,
... |
def my_func():
print 'hello'
| {
"content_hash": "5f3f18ac838ca3ee1c3a2775e4ac733b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 17,
"avg_line_length": 16.5,
"alnum_prop": 0.5757575757575758,
"repo_name": "zettrider/py_ans_course",
"id": "e7b84157e68ada8e27a92ee571baafb3339f0131",
"size": "33",
"bin... |
import json
from unittest import mock
from oauthlib.common import Request
from oauthlib.oauth2.rfc6749 import errors
from oauthlib.oauth2.rfc6749.grant_types import (
AuthorizationCodeGrant, authorization_code,
)
from oauthlib.oauth2.rfc6749.tokens import BearerToken
from tests.unittest import TestCase
class Au... | {
"content_hash": "a3c7c11b87a98a3a0961de7f5c37e5ee",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 104,
"avg_line_length": 47.881889763779526,
"alnum_prop": 0.6733541632406951,
"repo_name": "oauthlib/oauthlib",
"id": "77e1a81b462a46ecea665fd8c5de6999d5707119",
"size": "... |
from __future__ import absolute_import, division, print_function, unicode_literals
from decimal import Decimal
import random
import unittest
from amaascore.assets.fx_option import ForeignExchangeOption
from amaascore.assets.interface import AssetsInterface
from amaascore.tools.generate_asset import generate_fx_option... | {
"content_hash": "67c97eaad3e0b799cedb69561a0d7fe2",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 114,
"avg_line_length": 35.810810810810814,
"alnum_prop": 0.7177358490566038,
"repo_name": "nedlowe/amaas-core-sdk-python",
"id": "421b8f6b568c1100cf2e0690442b767f8fc2378a",
... |
import logging
import pandas as pd
import datacache
# use genenames.org to make a table mapping between HUGO gene names and ensembl
# genen ID with columns
# 'Approved Symbol'
# 'Approved Name'
# 'Ensembl ID(supplied by Ensembl)'
_HUGO_URL = \
"http://www.genenames.org/cgi-bin/download?col=gd_app_sym&col=gd_app_na... | {
"content_hash": "847edba8eefaec012e28441a2f11ec24",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 186,
"avg_line_length": 37.471698113207545,
"alnum_prop": 0.7026686807653575,
"repo_name": "hammerlab/immuno",
"id": "3861c42e2b828bbb678f164df015110fa32d20b1",
"size": "3... |
import nipype.pipeline.engine as pe
import nipype.interfaces.utility as niu
from nipype.interfaces import fsl
from nipype.interfaces import dipy
def nlmeans_pipeline(name='Denoise',
params={'patch_radius': 1, 'block_radius': 5}):
"""
Workflow that performs nlmeans denoising
Example
... | {
"content_hash": "e4d84caf9e882b2c6e6dd03ba221c23e",
"timestamp": "",
"source": "github",
"line_count": 115,
"max_line_length": 77,
"avg_line_length": 33.52173913043478,
"alnum_prop": 0.5665369649805447,
"repo_name": "JohnGriffiths/nipype",
"id": "850f4b9cd96e1256a768e13bb3906fdc086d59c0",
"size": ... |
import argparse
from datetime import datetime, timedelta
from time import sleep
from threading import Thread, Event
from binascii import hexlify
from serial import Serial
from xbee import ZigBee
from pushbullet import Pushbullet
COOLDOWN_TIME = timedelta(seconds=60)
ALARM_NOTIFICATION_REPEAT_SECONDS = 30
ALARM_VALU... | {
"content_hash": "ce32e29ff108af27dda7f1a6106abfb3",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 79,
"avg_line_length": 29.97222222222222,
"alnum_prop": 0.620636391720729,
"repo_name": "flyte/xbee-smoke-alarm",
"id": "f612f08a9035e8db5e06e3c7d3f8e2877e9d1e45",
"size":... |
from django.shortcuts import get_object_or_404, render
from .models import UserProfile
def user_profile(request, username):
"""
Detailed information about an individual user.
"""
user = get_object_or_404(UserProfile, username=username)
is_self = False
if request.user.is_authenticated():
... | {
"content_hash": "449333608911ea25e4feb463f10db1da",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 77,
"avg_line_length": 30.658536585365855,
"alnum_prop": 0.609387430389817,
"repo_name": "lemonad/behorighet",
"id": "87d4cc582a83b7d5e9e5c12619e5dd69a8315c0f",
"size": "12... |
class Solution:
def insert(self, intervals: [[int]], newInterval: [int]) -> [[int]]:
result = []
for i, interval in enumerate(intervals):
start = intervals[i][0]
end = intervals[i][1]
if end < newInterval[0]:
result.append(interval)
e... | {
"content_hash": "15fd032272a2b6049495a51c8c95cd4f",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 72,
"avg_line_length": 34,
"alnum_prop": 0.5084033613445378,
"repo_name": "BigEgg/LeetCode",
"id": "d03064a291235973ab62b25162b7e8bf3a1e742e",
"size": "714",
"binary": fa... |
#!/usr/bin/env python
# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
"""PyAuto: Python Interface to Chromium's Automation Proxy.
PyAuto uses swig to expose Automation Proxy interfaces to Python.
For ... | {
"content_hash": "fb18414b98b7f4306dea906fdf4ca72e",
"timestamp": "",
"source": "github",
"line_count": 6232,
"max_line_length": 80,
"avg_line_length": 36.80584082156611,
"alnum_prop": 0.6385946096767724,
"repo_name": "keishi/chromium",
"id": "ffd0cca3519fa419a71945bc1b7666be967b0d9b",
"size": "229... |
import os
gettext = lambda s: s
"""
Django settings for segtest project.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.6/ref/settings/
"""
# Build paths inside the project like this... | {
"content_hash": "85fc70e246c87cddfcd18ddcf18aefcc",
"timestamp": "",
"source": "github",
"line_count": 189,
"max_line_length": 131,
"avg_line_length": 24.354497354497354,
"alnum_prop": 0.6600043449923962,
"repo_name": "aldryn/aldryn-segmentation",
"id": "50525a416a4eb24fe1157f32971af450eb9759d2",
... |
"""
Code to parse biobase data files.
"""
| {
"content_hash": "f2cc863e43b76f9509787d170a4c6d07",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 33,
"avg_line_length": 14,
"alnum_prop": 0.6428571428571429,
"repo_name": "JohnReid/biopsy",
"id": "020bbc70120281ed6b678b82be3c608460be43ce",
"size": "74",
"binary": fals... |
"""
This customization adds the following scalar parameters to the
cloudwatch put-metric-data operation:
* --metric-name
* --dimensions
* --timestamp
* --value
* --statistic-values
* --unit
"""
import decimal
from awscli.arguments import CustomArgument
from awscli.utils import split_on_commas
from awscli.customizati... | {
"content_hash": "5c542b43ca62001e21f251dee220cf44",
"timestamp": "",
"source": "github",
"line_count": 128,
"max_line_length": 80,
"avg_line_length": 43.0234375,
"alnum_prop": 0.6137642999818413,
"repo_name": "mnahm5/django-estore",
"id": "6fca057a064ba71690c340aacf1f812e0d8f9ff0",
"size": "6072",... |
"""
Tools for parsing chat messages and extracting relevant information.
`parse` and `parse_to_json` are the main functions you might want to import.
See their docstrings for more information.
"""
from HTMLParser import HTMLParser
import json
from urlparse import urlsplit
from urllib2 import urlopen
import re
def _... | {
"content_hash": "fc8502509bebeb7192fb70c792facf8c",
"timestamp": "",
"source": "github",
"line_count": 395,
"max_line_length": 81,
"avg_line_length": 34.24810126582278,
"alnum_prop": 0.6072590183323477,
"repo_name": "kentfrazier/hipchat-exercise",
"id": "5794255f0f84933c1a2963ebc288d0b5ef6b83bf",
... |
"""Classes for managing audio experts.
Copyright 2020 Google LLC
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
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law ... | {
"content_hash": "f2667d2fe0ef0eeb647153296f1092f2",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 72,
"avg_line_length": 26.16216216216216,
"alnum_prop": 0.71900826446281,
"repo_name": "googleinterns/via-content-understanding",
"id": "7d25850db61e771dc4e82f3cacf95f999feec... |
"""
Module loads in .pkl files for tracklets at different spatial positions:
###############################
# # # #
# # 0-1-0 # #
# # # #
# # # #
###############################
# # # #
# 1-0-0 # 1-1-0 ... | {
"content_hash": "85a158dd4bfa4dd29070bb77bc0c376d",
"timestamp": "",
"source": "github",
"line_count": 429,
"max_line_length": 146,
"avg_line_length": 33.56643356643357,
"alnum_prop": 0.57125,
"repo_name": "gautamMalu/vatic",
"id": "9277199bc79cdbef61b49a5e11589b42d4047e63",
"size": "14400",
"bi... |
import re
import requests
class NotAuthenticatedError(Exception):
pass
def library(url):
enterprise = ('<span class="sdCopyrightLink"><a shape="rect" '
'title="SirsiDynix" href="http://www.sirsidynix.com">'
'SirsiDynix</a></span>\n-\xa0Enterprise')
exlibrisprimo = 'Powe... | {
"content_hash": "5d7015a03abbf64358214be23f941815",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 72,
"avg_line_length": 32.61538461538461,
"alnum_prop": 0.6745283018867925,
"repo_name": "BenjaminEHowe/library-api",
"id": "5c759e74a3cd5d0cc42191262c6494e8b70ce405",
"siz... |
#!/usr/bin/env python
#
# Copyright (c) 2009 Google Inc. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are
# met:
#
# * Redistributions of source code must retain the above copyright
# notice, this list... | {
"content_hash": "af475dcc8a48b3ce78924c54cd427e9d",
"timestamp": "",
"source": "github",
"line_count": 4934,
"max_line_length": 97,
"avg_line_length": 40.02269963518444,
"alnum_prop": 0.6371434937611408,
"repo_name": "rkq/cplusplus",
"id": "52cb7d0cabed3c3122c320d879d2d9d01fab986b",
"size": "23600... |
from allauth.socialaccount.models import SocialToken
import facebook
import json
import requests
from action.models import UserLikes, UserData
# from mainapp.models import FacebookPost
def get_myfacebook_likes(myfacebook_graph, user):
myfacebook_likes = []
myfacebook_likes_info = myfacebook_graph.get_connecti... | {
"content_hash": "1403a34eddc2d0acf770c46d777e3f21",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 96,
"avg_line_length": 33.56666666666667,
"alnum_prop": 0.6683217477656405,
"repo_name": "bhanduroshan/fbstats-docker",
"id": "b516147e4fd767104e28d7a3aa25224f90221b2d",
"s... |
__formats__ = ['log', 'linejson', 'sojson']
import logdissect.output.log
import logdissect.output.linejson
import logdissect.output.sojson
| {
"content_hash": "ed182d5fc162b4e89d0e03a8f15d9df5",
"timestamp": "",
"source": "github",
"line_count": 5,
"max_line_length": 43,
"avg_line_length": 28,
"alnum_prop": 0.7642857142857142,
"repo_name": "dogoncouch/logdissect",
"id": "490c1fc29473ea06a3cbec60c480645aa5a0d8e7",
"size": "1275",
"binar... |
from NSStat_services_types import *
import urlparse, types
from ZSI.TCcompound import ComplexType, Struct
from ZSI import client
import ZSI
# Locator
class NSStatServiceLocator:
NSStatPort_address = "http://netscaler_ip/soap/"
def getNSStatPortAddress(self):
return NSStatServiceLocator.NSStatPort_addre... | {
"content_hash": "0a0cf45afc5de254d853985bc68f963f",
"timestamp": "",
"source": "github",
"line_count": 1224,
"max_line_length": 523,
"avg_line_length": 53.1078431372549,
"alnum_prop": 0.6994184973232417,
"repo_name": "rytis/Netscaler-SOAP-API-tool",
"id": "902576026a5d4e2f3349c898db3f5d94d96406f2",
... |
from pandac.PandaModules import *
from toontown.toonbase import ToontownGlobals
import Playground
from toontown.launcher import DownloadForceAcknowledge
from toontown.building import Elevator
from toontown.toontowngui import TTDialog
from toontown.toonbase import TTLocalizer
from toontown.racing import RaceGlobals
from... | {
"content_hash": "75a5900dc4fbff4ea7b0e5415e936b9e",
"timestamp": "",
"source": "github",
"line_count": 141,
"max_line_length": 148,
"avg_line_length": 41.43971631205674,
"alnum_prop": 0.6532603114838268,
"repo_name": "ToonTownInfiniteRepo/ToontownInfinite",
"id": "035c5f9d96ad1e43e06ce97f54ad3e62bd1... |
from django.core.management.base import BaseCommand, CommandError
from budgetelem.models import Region
class Command(BaseCommand):
def handle(self, *args, **options):
fin_list = []
r = open('/home/choojoy/i-graph/orders/vrnbudget/budgetelem/management/commands/regions.txt', 'rb')
r_line... | {
"content_hash": "c3940ebcdf9e3f280c90d6672e5ab55a",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 255,
"avg_line_length": 39.48571428571429,
"alnum_prop": 0.5441389290882779,
"repo_name": "ChooJoy/VisualBudget",
"id": "9bf31749ad74cfa95da65f50e08fdc7ac3b4613b",
"size": ... |
"""
sentry.api.paginator
~~~~~~~~~~~~~~~~~~~~
:copyright: (c) 2010-2014 by the Sentry Team, see AUTHORS for more details.
:license: BSD, see LICENSE for more details.
"""
from __future__ import absolute_import
import math
from datetime import datetime
from django.db import connections
from django.db.models.sql.datas... | {
"content_hash": "e591e7f59f23e3ff29333b5a5b39e3ee",
"timestamp": "",
"source": "github",
"line_count": 222,
"max_line_length": 87,
"avg_line_length": 34.486486486486484,
"alnum_prop": 0.5688349007314525,
"repo_name": "gencer/sentry",
"id": "1a02551d368420a2ca6afac951493e670f83a989",
"size": "7656"... |
from django.conf.urls import patterns, include, url
# Uncomment the next two lines to enable the admin:
from django.contrib import admin
admin.autodiscover()
# Wire up our API using automatic URL routing.
# Additionally, we include login URLs for the browseable API.
urlpatterns = patterns('',
url(r'^rest-api/', ... | {
"content_hash": "37db2a1efb8f4b877a5d36e0c0a36034",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 73,
"avg_line_length": 33,
"alnum_prop": 0.6666666666666666,
"repo_name": "DeltaEpsilon-HackFMI2/FMICalendar-REST",
"id": "93bbacddf3c00fcc8739a3e83e76f35b00bec46e",
"size"... |
import os
from SQLAlchemyLibrary.connection_manager import ConnectionManager
from SQLAlchemyLibrary.query import Query
from SQLAlchemyLibrary.assertion import Assertion
__version_file_path__ = os.path.join(os.path.dirname(__file__), 'VERSION')
__version__ = open(__version_file_path__, 'r').read().strip()
class SQLAl... | {
"content_hash": "29a37b21b5334f35060a6e2e72b7088a",
"timestamp": "",
"source": "github",
"line_count": 55,
"max_line_length": 162,
"avg_line_length": 39.38181818181818,
"alnum_prop": 0.6888273314866112,
"repo_name": "edbrannin/Robotframework-SQLAlchemy-Library",
"id": "b2d3a8e481162feea775e8df806008... |
from __future__ import division, absolute_import, print_function
import sys
import warnings
import functools
import operator
import pytest
import numpy as np
from numpy.core._multiarray_tests import array_indexing
from itertools import product
from numpy.testing import (
assert_, assert_equal, assert_raises, asse... | {
"content_hash": "d11e9d3ff7e2a54061d46438b816bb14",
"timestamp": "",
"source": "github",
"line_count": 1308,
"max_line_length": 79,
"avg_line_length": 38.07874617737003,
"alnum_prop": 0.5294436524986448,
"repo_name": "ryfeus/lambda-packs",
"id": "276cd9f9384bd90ddfc03c7b51cb0414f196bc9f",
"size": ... |
import vtk
class TestStyleBase(object):
def __init__(self, ren):
self.ren1 = ren
# Get random numbers
self.math = vtk.vtkMath()
self.math.RandomSeed(1)
def randint(self, min, max):
f = self.math.Random(min, max)
return int(f)
# Main... | {
"content_hash": "2b5eaea4310144f3a70b24db86b905a3",
"timestamp": "",
"source": "github",
"line_count": 117,
"max_line_length": 126,
"avg_line_length": 36.18803418803419,
"alnum_prop": 0.4586679263108172,
"repo_name": "timkrentz/SunTracker",
"id": "0b58bcfb303457509c94138cff6f69c4f9b7c0d8",
"size":... |
from __future__ import unicode_literals
from django.db import models, migrations
from django.conf import settings
import main.models
class Migration(migrations.Migration):
dependencies = [
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
('main', '0004_auto_20141003_0328'),
]
... | {
"content_hash": "91a6a5fdd6b05049e0a344d8bd0f584b",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 146,
"avg_line_length": 37.11764705882353,
"alnum_prop": 0.5853143159006867,
"repo_name": "TwoBitAlchemist/wysiweb",
"id": "60e23a0faa64c462862a65bb54aa511ff2aad167",
"size... |
import collections
from biicode.common.utils.bii_logging import logger
from biicode.common.model.cells import VirtualCell
from biicode.common.edition.parsing.factory import parser_factory
def resource_diff_function(base, other):
from biicode.common.model.content import content_diff
from biicode.common.model.c... | {
"content_hash": "3fa6500e82fc1b2a3f3be5387610a6b7",
"timestamp": "",
"source": "github",
"line_count": 65,
"max_line_length": 101,
"avg_line_length": 35.76923076923077,
"alnum_prop": 0.6455913978494624,
"repo_name": "drodri/common",
"id": "dc3fb25ae4b391bb66fa0bbe6dae6e40f0d9d89c",
"size": "2325",... |
from _pydevd_bundle.pydevd_constants import IS_PY3K
class Frame(object):
def __init__(
self,
f_back,
f_fileno,
f_code,
f_locals,
f_globals=None,
f_trace=None):
self.f_back = f_back
self.f_lineno = f_file... | {
"content_hash": "eb48d2391ffeff49cf07eb0437027fbf",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 87,
"avg_line_length": 27.044117647058822,
"alnum_prop": 0.5687873844480696,
"repo_name": "SlicerRt/SlicerDebuggingTools",
"id": "15914868f48ce0f5968b23dc1430b5c87594bfd2",
... |
'''
Unit tests for the gbdxtools.CatalogImage class
These will only run if pyplot is installed.
They are also skipped in headless CI environments
See tests/readme.md for more about tests
'''
import os
import unittest
import numpy as np
from gbdxtools.images.mixins.geo import PlotMixin
class PlotMock(np.ndarray, P... | {
"content_hash": "fd7bb5af01daf70b5c260c7eda1c04d6",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 65,
"avg_line_length": 22.359375,
"alnum_prop": 0.6226415094339622,
"repo_name": "DigitalGlobe/gbdxtools",
"id": "30a6b708c4fffc1ea1be8a3e3b9f32d03e67727f",
"size": "1431",... |
"""
Mock unit tests for the NetApp E-series iscsi driver
"""
import copy
import mock
import six
from cinder import exception
from cinder import test
from cinder.tests.unit.volume.drivers.netapp.eseries import fakes as \
eseries_fakes
from cinder.volume.drivers.netapp.eseries import client as es_client
from cinde... | {
"content_hash": "9fa9e6fed0dd20f8ed10cddc24f5fcaf",
"timestamp": "",
"source": "github",
"line_count": 408,
"max_line_length": 79,
"avg_line_length": 44.1985294117647,
"alnum_prop": 0.612654577718627,
"repo_name": "julianwang/cinder",
"id": "9911845c731ac1cce23d1fbcffff60482c9b00a6",
"size": "1879... |
models_client = client.models
# The input to this data view is a SMILES string
inputs = [
{"formula": "NaCl", "Property Crystallinity": "Amorphous"},
{"formula": "MgO2", "Property Crystallinity": "Polycrystalline"}
]
data_view_id = "4106"
# This prediction will return a list of two PredictionResult objects since... | {
"content_hash": "eedd4e01006bdc250d126637f3597913",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 81,
"avg_line_length": 37.421052631578945,
"alnum_prop": 0.7482419127988749,
"repo_name": "CitrineInformatics/python-citrination-client",
"id": "a6a3f814e54411d6873c460ec50a1... |
from Acquisition import aq_parent
from Products.PythonScripts.PythonScript import PythonScript
import linecache
import os
import sys
import RestrictedPython
ps_fncache = {}
def monkey_checkcache(filename=None):
"""Discard cache entries that are out of date...
...and aren't PythonScripts!"""
if filename ... | {
"content_hash": "f9ef3ada6960490de2d9f771ea76738e",
"timestamp": "",
"source": "github",
"line_count": 110,
"max_line_length": 74,
"avg_line_length": 30.272727272727273,
"alnum_prop": 0.6165165165165165,
"repo_name": "Simplistix/zdb",
"id": "835972bf263c23d50809aa76ad180337fec69c23",
"size": "3509... |
"""
doubanu.py
"""
import threading
import sys
import sqlite3
import argparse
import logging
import re
import os
import tempfile
import requests
import time
URL_BASE = 'https://www.douban.com/'
URL_LOGIN = 'https://www.douban.com/accounts/login'
URL_MINE = 'https://www.douban.com/mine/'
URL_MY_CON... | {
"content_hash": "005964b49f24ddebdc17dab835d6a7a1",
"timestamp": "",
"source": "github",
"line_count": 278,
"max_line_length": 164,
"avg_line_length": 39.75539568345324,
"alnum_prop": 0.5266015200868621,
"repo_name": "tabris17/doubanu",
"id": "dd7ddd42bc5e1c8a95c239ca0cb72231b6a46305",
"size": "11... |
import simplejson
from kindo.modules.run.command import Command
class RunCommand(Command):
def __init__(self, startfolder, configs, options, logger):
Command.__init__(self, startfolder, configs, options, logger)
def parse(self, value, kic_path=None):
command_str = value[4:].strip()
... | {
"content_hash": "f87ac4b2a9c0e5c19ed6cb7f0b26e8bb",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 88,
"avg_line_length": 34.21875,
"alnum_prop": 0.5278538812785388,
"repo_name": "shenghe/kindo",
"id": "ea62fdbeb1dcfa76780b53ed3c1516b5efe323bc",
"size": "1142",
"binary... |
from eve.tests import TestMinimal
import os
from flask_pymongo import MongoClient
url = 'mriqc_api'
MONGO_HOST = os.environ.get("MONGODB_HOST", 'mongodb'),
MONGO_PORT = int(os.environ.get("MONGODB_PORT", 27017))
MONGO_DBNAME = 'test_DB'
class settingsTestCase(TestMinimal):
def setUp(self):
return super()... | {
"content_hash": "5dd92e6c1066e0b819853e29f6f3a9f8",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 69,
"avg_line_length": 31.956521739130434,
"alnum_prop": 0.6680272108843538,
"repo_name": "poldracklab/mriqcwebapi",
"id": "75a00e563a42c55bcc419125b664750b9724c46f",
"size... |
import sys
import os
import collections
import glob
import json
import re
import math
import pandas as pd
from program_synthesis.common.tools import saver
from program_synthesis.karel import arguments
from program_synthesis.karel import dataset
from program_synthesis.karel import models
from program_synthesis.karel... | {
"content_hash": "03c46b1fa1b5708e680e7126cdf3595f",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 166,
"avg_line_length": 34.1,
"alnum_prop": 0.6168132942326491,
"repo_name": "nearai/program_synthesis",
"id": "d00e01de5bdf914796d6747d9058a0fa1069fcaf",
"size": "5115",
... |
import unittest
try:
from infra_libs.ts_mon.common import standard_metrics
except ImportError: # pragma: no cover
from common import standard_metrics
class StandardMetricsTest(unittest.TestCase):
def setUp(self):
standard_metrics.up.reset()
def test_up(self):
standard_metrics.init()
self.assertT... | {
"content_hash": "4d72cab430241a8cdb58adb117665257",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 55,
"avg_line_length": 23.4,
"alnum_prop": 0.7492877492877493,
"repo_name": "nicko96/Chrome-Infra",
"id": "e3a481e455c21cb44ff8bdcd54f2b1d570e7e32c",
"size": "514",
"bina... |
from django.contrib.auth.models import Group, User
from useradmin.models import HuePermission, GroupPermission
def grant_access(username, groupname, appname):
add_permission(username, groupname, 'access', appname)
def add_permission(username, groupname, permname, appname):
user = User.objects.get(username=u... | {
"content_hash": "56d06fa5a0630e198a8226dff552f149",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 85,
"avg_line_length": 37,
"alnum_prop": 0.7477477477477478,
"repo_name": "2013Commons/HUE-SHARK",
"id": "47e70fc7f0d5aeaefcd16850638dfdc85e761607",
"size": "1458",
"bina... |
"""SCons.Tool.cyglink
Customization of gnulink for Cygwin (http://www.cygwin.com/)
There normally shouldn't be any need to import this module directly.
It will usually be imported through the generic SCons.Tool.Tool()
selection method.
"""
from __future__ import absolute_import, print_function
import re
import os
... | {
"content_hash": "f459861b7918665b6fbdd31d108fa65f",
"timestamp": "",
"source": "github",
"line_count": 236,
"max_line_length": 137,
"avg_line_length": 35.99152542372882,
"alnum_prop": 0.6137273369437249,
"repo_name": "kayhayen/Nuitka",
"id": "c3d78de90b777950704cdabd2655cad323ae1732",
"size": "849... |
from django.contrib.auth.models import User
from django.db import models
from django.utils.translation import ugettext_lazy as _
from django_simptools.money.models import fields
from model_utils import Choices
from model_utils.models import TimeStampedModel
from django_simptools.managers import ChainableQuerySetManager... | {
"content_hash": "17f94ad9427f0bb7dacd1411c54904a4",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 99,
"avg_line_length": 40.71739130434783,
"alnum_prop": 0.6962092899092365,
"repo_name": "RANUX/django-payway",
"id": "7caf146c47df2e89ca7bcc61dc1edd3ae007ab3b",
"size": "1... |
from __future__ import unicode_literals
from django.db import migrations
class Migration(migrations.Migration):
dependencies = [
('contenttypes', '0001_initial'),
]
operations = [
migrations.CreateModel(
name='ContentType',
fields=[
],
opt... | {
"content_hash": "b0dab15c506c66d9edfa8ef72105b007",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 48,
"avg_line_length": 19.954545454545453,
"alnum_prop": 0.5079726651480638,
"repo_name": "wq/wq.db",
"id": "479fc688626b088926f1c49deb739b4eac6e7a17",
"size": "463",
"bi... |
from django.utils.translation import ugettext_lazy as _
import horizon
from openstack_dashboard.dashboards.router import dashboard
class Nexus1000v(horizon.Panel):
name = _("Cisco Nexus 1000v")
slug = 'nexus1000v'
permissions = ('openstack.services.network',)
dashboard.Router.register(Nexus1000v)
| {
"content_hash": "50e9267a7ffef2a285a0c82a6637f0d7",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 59,
"avg_line_length": 26.166666666666668,
"alnum_prop": 0.7643312101910829,
"repo_name": "394954369/horizon",
"id": "78a4701aa7d19614353aa1449af1323436585a92",
"size": "99... |
import contextlib
import os
import pathlib
import subprocess
import pytest
import requests
@pytest.fixture(scope="session")
def _divio_project(request, tmpdir_factory):
test_project_name = os.getenv("TEST_PROJECT_NAME", None)
if test_project_name is None:
pytest.skip(
"project name for t... | {
"content_hash": "c1067442e71ce567d6d560be9f1aaf7e",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 102,
"avg_line_length": 24.359375,
"alnum_prop": 0.6690186016677357,
"repo_name": "aldryn/aldryn-client",
"id": "83ff237f1c2be6796f71d2a4a6f91f837a42f293",
"size": "1559",
... |
"""
This program basically does face detection an blurs the face out.
"""
from __future__ import print_function
print(__doc__)
from SimpleCV import Camera, Display, HaarCascade
# Initialize the camera
cam = Camera()
# Create the display to show the image
display = Display()
# Haar Cascade face detection, only faces... | {
"content_hash": "ed407d1049f4009ab82a5df427157abc",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 71,
"avg_line_length": 27.551724137931036,
"alnum_prop": 0.688360450563204,
"repo_name": "tpltnt/SimpleCV",
"id": "dc2740c40f55f501458b5591c1db7d334762d166",
"size": "888",... |
"""Tests for the User model."""
from django.contrib.auth import get_user_model
import pytest
@pytest.fixture(scope='module')
def user():
"""Create a user to test with."""
return get_user_model().objects.create_user(username='Test', password='correcthorsebatterystaple')
@pytest.mark.django_db
def test_get_... | {
"content_hash": "3cf2b7be90c1f8dd3c87ece2f2a278a1",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 102,
"avg_line_length": 25.434782608695652,
"alnum_prop": 0.6871794871794872,
"repo_name": "knyghty/bord",
"id": "0ba079dccea66605f4de9cd4a0a555da55247e2d",
"size": "585",
... |
"""
The classes below are examples of user-defined CommitRules. Commit rules are gitlint rules that
act on the entire commit at once. Once the rules are discovered, gitlint will automatically take care of applying them
to the entire commit. This happens exactly once per commit.
A CommitRule contrasts with a LineRule (... | {
"content_hash": "542516562e2f64504d1dd2f8a03d2d1c",
"timestamp": "",
"source": "github",
"line_count": 130,
"max_line_length": 119,
"avg_line_length": 43.56923076923077,
"alnum_prop": 0.6581920903954802,
"repo_name": "galak/zephyr",
"id": "cfbfbdc5d4cea6317193d65c89bc99ac99a61380",
"size": "5703",... |
import struct
import math
import sys,getopt
import pexpect
import time
import struct
import random
import binascii
import json
import requests
from calendar import timegm
from time import gmtime, strftime
sensorHandleList = ['0x24', # IR Temperature Sensor
'0x2C', # Humidity Sensor
'0x44', # Light Sensor
... | {
"content_hash": "da6712e98bc186817ef45e57552315c4",
"timestamp": "",
"source": "github",
"line_count": 194,
"max_line_length": 107,
"avg_line_length": 30.711340206185568,
"alnum_prop": 0.7202081235313864,
"repo_name": "IoT-Expedition/Edge-Analytics",
"id": "94617ad8982bf18dc5a3d3f9a6e1cabd2cd4ee71",... |
import os
from pyndl import corpus
TEST_ROOT = os.path.dirname(__file__)
def test_read_clean_gzfile():
file_name = os.path.join(TEST_ROOT, 'resources/xml_gz_corpus/2017/0001/1.xml.gz')
lines = list(corpus.read_clean_gzfile(file_name, break_duration=5.0))
assert len(lines) == 3
def test_create_corpus_... | {
"content_hash": "d787b9402a2c899332018dec3143056d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 88,
"avg_line_length": 37.111111111111114,
"alnum_prop": 0.6936127744510978,
"repo_name": "quantling/pyndl",
"id": "cb0f9ffb602171ad204459400a1ba27b6d09c379",
"size": "1051... |
import datetime
from typing import Dict, List, Optional, Union
import msrest.serialization
from ._container_registry_management_client_enums import *
class Actor(msrest.serialization.Model):
"""The agent that initiated the event. For most situations, this could be from the authorization context of the request.
... | {
"content_hash": "c7d7477f28b08cf5b1777a8754c446f3",
"timestamp": "",
"source": "github",
"line_count": 3746,
"max_line_length": 152,
"avg_line_length": 41.268820074746394,
"alnum_prop": 0.6468727562050028,
"repo_name": "Azure/azure-sdk-for-python",
"id": "37d62cc3c820a9b668053ae1fc2ab6197d2200c6",
... |
from __future__ import unicode_literals
from rest_framework import routers
from . import views
class IPAMRootView(routers.APIRootView):
"""
IPAM API root view
"""
def get_view_name(self):
return 'IPAM'
router = routers.DefaultRouter()
router.APIRootView = IPAMRootView
# VRFs
router.regist... | {
"content_hash": "0153aaf629c53c14db2986a607813b8d",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 56,
"avg_line_length": 20.27906976744186,
"alnum_prop": 0.7522935779816514,
"repo_name": "snazy2000/netbox",
"id": "e6b1bb13dfda71d256c13100e0ce26dd2a459acb",
"size": "872"... |
import sys, os
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#sys.path.insert(0, os.path.abspath('.'))
# -- General configurat... | {
"content_hash": "927c301b1b6ac00ebcec5b33f7050795",
"timestamp": "",
"source": "github",
"line_count": 243,
"max_line_length": 80,
"avg_line_length": 32.46090534979424,
"alnum_prop": 0.703473630831643,
"repo_name": "sangheestyle/elasticsearch-dsl-py",
"id": "9729e464821b1480cb8a11de53abb3f6e5cae1a6"... |
"""Reads Summaries from and writes Summaries to event files."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os.path
import threading
import time
import six
from tensorflow.core.framework import graph_pb2
from tensorflow.core.framework import su... | {
"content_hash": "7f5200bc910dea863f6eecb7879dabe2",
"timestamp": "",
"source": "github",
"line_count": 330,
"max_line_length": 84,
"avg_line_length": 35.518181818181816,
"alnum_prop": 0.6742598754372494,
"repo_name": "EvenStrangest/tensorflow",
"id": "7cf682c9db6443a58965c6da6fe0dd4c8f06f4e7",
"si... |
from __future__ import print_function, division
from collections import namedtuple, OrderedDict
import pandas as pd
from .metergroup import MeterGroup
from .datastore.datastore import join_key
from .hashable import Hashable
BuildingID = namedtuple('BuildingID', ['instance', 'dataset'])
class Building(Hashable):
"... | {
"content_hash": "68c65335e2a25e3f3ca5f685ce1f88b1",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 89,
"avg_line_length": 35.214285714285715,
"alnum_prop": 0.6227180527383367,
"repo_name": "jaduimstra/nilmtk",
"id": "c6b4e50e0e6ec700f4fa739085fad2432b2f840d",
"size": "19... |
"""End-to-end tests for federated trainer tasks."""
import collections
import os.path
from absl.testing import parameterized
import pandas as pd
import tensorflow as tf
import tensorflow_federated as tff
from generalization.tasks import cifar100_image
from generalization.tasks import emnist_character
from generaliza... | {
"content_hash": "792522936ffebc34993fad5a7d222a3c",
"timestamp": "",
"source": "github",
"line_count": 124,
"max_line_length": 85,
"avg_line_length": 38.524193548387096,
"alnum_prop": 0.7056730165375759,
"repo_name": "google-research/federated",
"id": "62ab3f9408fd1dd4096ff4c3749c26b47cdec9e1",
"s... |
import testtools
from neutron.hacking import checks
from neutron.tests import base
class HackingTestCase(base.BaseTestCase):
def test_log_translations(self):
expected_marks = {
'error': '_LE',
'info': '_LI',
'warn': '_LW',
'warning': '_LW',
'cr... | {
"content_hash": "e49068abf4eb17063f21994df239f21c",
"timestamp": "",
"source": "github",
"line_count": 127,
"max_line_length": 78,
"avg_line_length": 39.68503937007874,
"alnum_prop": 0.47023809523809523,
"repo_name": "alexandrucoman/vbox-neutron-agent",
"id": "4ebb4d815250a83dece0d6766144e9850fc7005... |
"""Tests for SessionManager."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import os
import tensorflow as tf
from tensorflow.python.platform import gfile
class SessionManagerTest(tf.test.TestCase):
def testPrepareSessionSucceeds(self):
with t... | {
"content_hash": "8cc01480b56f4627f5dc8ef2118c8796",
"timestamp": "",
"source": "github",
"line_count": 104,
"max_line_length": 79,
"avg_line_length": 43.46153846153846,
"alnum_prop": 0.6106194690265486,
"repo_name": "awni/tensorflow",
"id": "952ddc44c507acfb600c4995b1159c46614f8a34",
"size": "5198... |
import time
from contextlib import contextmanager
import numpy as np
@contextmanager
def timer():
tick = time.perf_counter()
yield lambda: tock - tick
tock = time.perf_counter()
def loglik(fit):
"""Log-likelihood of fitted model"""
trials = fit["trials"]
params = fit["params"]
logrates ... | {
"content_hash": "c437e15dd6f605822eeaf6bfa7afa605",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 111,
"avg_line_length": 27.210526315789473,
"alnum_prop": 0.6518375241779497,
"repo_name": "catniplab/vLGP",
"id": "dd3ae6343d9c20248cf50fead3138261af089773",
"size": "517"... |
""" Starting point for DEM retrieval utilities.
"""
from sys import stderr
from math import floor, ceil, log
from os import unlink, close, write, makedirs, chmod
from os.path import basename, exists, isdir, join
from httplib import HTTPConnection
from urlparse import urlparse
from StringIO import StringIO
from gzip imp... | {
"content_hash": "c4f9d70a10aebf1dd0322bccbe524832",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 83,
"avg_line_length": 27.90566037735849,
"alnum_prop": 0.6267748478701826,
"repo_name": "migurski/DEM-Tools",
"id": "c28d9426d1010293bda65eb69afb18fd1e8486d6",
"size": "2... |
import unittest
from copy import copy
from unittest.mock import MagicMock, patch
import mycroft.api
import mycroft.configuration
from test.util import base_config
CONFIG = base_config()
CONFIG.merge(
{
'data_dir': '/opt/mycroft',
'server': {
'url': 'https://api-test.mycroft.ai',
... | {
"content_hash": "424d0a5e8e1f5900577b3c978e6ffd03",
"timestamp": "",
"source": "github",
"line_count": 412,
"max_line_length": 78,
"avg_line_length": 39.39563106796116,
"alnum_prop": 0.6230669706117923,
"repo_name": "Dark5ide/mycroft-core",
"id": "164428d840f1d58ecf081f0f05212a2c247947a6",
"size":... |
import sys, os
from PySide.QtCore import *
from PySide.QtGui import *
class Form(QDialog):
btnpressed = Signal(str, str, str)
dirselected = Signal(str)
def __init__(self, parent=None):
super(Form, self).__init__(parent)
# Create widgets
self.browseLabel = QLabel('Project Directo... | {
"content_hash": "9bee5d0761ec774c5d39bdb32115471b",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 95,
"avg_line_length": 32.15384615384615,
"alnum_prop": 0.6499202551834131,
"repo_name": "Hartman-/Basket",
"id": "5dcbdaafea9746a984fd8aa621a250bd18830d88",
"size": "2555"... |
"""Support for 1-Wire environment switches."""
from __future__ import annotations
from dataclasses import dataclass
import os
from typing import TYPE_CHECKING, Any
from homeassistant.components.switch import SwitchEntity, SwitchEntityDescription
from homeassistant.config_entries import ConfigEntry
from homeassistant.... | {
"content_hash": "887a70e384fb8f5c060e43e700a99105",
"timestamp": "",
"source": "github",
"line_count": 218,
"max_line_length": 88,
"avg_line_length": 30.853211009174313,
"alnum_prop": 0.5801367826345525,
"repo_name": "GenericStudent/home-assistant",
"id": "a05757936f9f36e895e0a28210f10b3bc99dd10c",
... |
class PyNode(object):
"""Representation of a python node"""
tag = "node"
ntype = None # Type for this node
def __init__(self, *args):
self.children = [] # Children are ordered
self.context = None # Default to no context initially
def add_context(self, context):
# Default is ... | {
"content_hash": "af5bb169389531f26850e9efd1f202cb",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 74,
"avg_line_length": 31.170731707317074,
"alnum_prop": 0.6142410015649452,
"repo_name": "sparkslabs/pyxie",
"id": "7b207bb530aedcb8fff158436e9b9e19af95b878",
"size": "186... |
import sys, time, logging
import PyIndi
from datetime import datetime
DEVICE_NAME = "QHY CCD QHY5LII-C-6127d"
if len(sys.argv) <> 3:
print "Usage: python singleFrame.py <<time exposure>> <<gain>>"
sys.exit()
class IndiClient(PyIndi.BaseClient):
device = None
exposure_time = sys.argv[1]
exposure... | {
"content_hash": "baf6ca52c047d44be351de443d2954a0",
"timestamp": "",
"source": "github",
"line_count": 108,
"max_line_length": 123,
"avg_line_length": 39.675925925925924,
"alnum_prop": 0.6513418903150525,
"repo_name": "broadcastyourseb/SADR",
"id": "846d749f12e3cecb609ac4e46279ca9650cb0a0c",
"size... |
"""
NodeCount counts the number of nodes in a node
"""
from pythran.passmanager import NodeAnalysis
class NodeCount(NodeAnalysis):
"""
Count the number of nodes included in a node
This has nothing to do with execution time or whatever,
its mainly use is to prevent the AST from growing too much when ... | {
"content_hash": "a99f0ab930fa266671e9bf5a4663f26e",
"timestamp": "",
"source": "github",
"line_count": 29,
"max_line_length": 77,
"avg_line_length": 25.689655172413794,
"alnum_prop": 0.6416107382550336,
"repo_name": "artas360/pythran",
"id": "e58ce18ba47c485bca67706f4a9a77adcad4b9ef",
"size": "745... |
import numpy as np
import unittest
import bnpy
from bnpy.learnalg import MergeMove
from scipy.special import digamma
import copy
######################################################### Make Data
#########################################################
def MakeData(K=4, D=2500, nWordsPerDoc=50):
''' Simple 4 comp... | {
"content_hash": "21deb95964e1bc99b1ae989cf1ce3e25",
"timestamp": "",
"source": "github",
"line_count": 139,
"max_line_length": 79,
"avg_line_length": 36.669064748201436,
"alnum_prop": 0.5842652540710221,
"repo_name": "daeilkim/refinery",
"id": "0395f135ae1c69cc5c2f99ea6d1aae54ee864650",
"size": "5... |
__author__ = 'Sean Yu'
__mail__ = 'try.dash.now@gmail.com'
'''
created 2015/9/29
'''
import unittest
import os
import sys
pardir =os.path.dirname(os.path.realpath(os.getcwd()))
#pardir= os.path.sep.join(pardir.split(os.path.sep)[:-1])
sys.path.append(os.path.sep.join([pardir,'lib']))
cmd = 'telnet 192.168.1.113'
#cm... | {
"content_hash": "ba42688c7def85b9fc43c785f2cc3a23",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 89,
"avg_line_length": 31.22875816993464,
"alnum_prop": 0.5876935956467141,
"repo_name": "try-dash-now/idash",
"id": "88f6466f1702ce29c9f6e145f4236336016100e5",
"size": "4... |
import mysql.connector
from model.group import Group
from model.contact import Contact
class DbFixture(object):
def __init__(self, host, name, user, password):
self.host = host
self.name = name
self.user = user
self.password = password
self.coonection = mysql.connector.conn... | {
"content_hash": "b6f757e907e79c58432cfab44f04956a",
"timestamp": "",
"source": "github",
"line_count": 44,
"max_line_length": 119,
"avg_line_length": 40.15909090909091,
"alnum_prop": 0.5636672325976231,
"repo_name": "ruslankl9/python_training",
"id": "f4031c71c7645c7f9d82878ade043a8f4acb7d5c",
"si... |
from __future__ import print_function
import hashlib
import itertools
import os
import random
import perf
from kafka.record.memory_records import MemoryRecordsBuilder
DEFAULT_BATCH_SIZE = 1600 * 1024
KEY_SIZE = 6
VALUE_SIZE = 60
TIMESTAMP_RANGE = [1505824130000, 1505824140000]
# With values above v1 record is 100 ... | {
"content_hash": "2dcf303e87ae868dba16d096d26913fd",
"timestamp": "",
"source": "github",
"line_count": 76,
"max_line_length": 76,
"avg_line_length": 26.092105263157894,
"alnum_prop": 0.6575895108421583,
"repo_name": "Yelp/kafka-python",
"id": "aca669dea9c1794955b941b3e1c32395986dc53c",
"size": "20... |
import sys
sys.path.insert(1, "../../../")
import h2o, tests
def binop_div():
iris = h2o.import_file(path=tests.locate("smalldata/iris/iris_wheader.csv"))
rows, cols = iris.dim
iris.show()
#frame/scaler
res = iris / 5
res_rows, res_cols = res.dim
assert res_rows == rows and res_... | {
"content_hash": "e4d39fa399d07697b1b34a2069f5812f",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 90,
"avg_line_length": 27.183098591549296,
"alnum_prop": 0.5906735751295337,
"repo_name": "kyoren/https-github.com-h2oai-h2o-3",
"id": "aafa3ba2ac38d7fe32ed77fe35510323040727... |
import argparse
import sys
from clan.auth import AuthCommand
from clan.diff import DiffCommand
from clan.report import ReportCommand
COMMANDS = [
AuthCommand,
ReportCommand,
DiffCommand
]
class Clan(object):
"""
Command-line interface to Google Analytics.
"""
def __init__(self):
... | {
"content_hash": "a95312291f043c8a36c671113139346d",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 101,
"avg_line_length": 25.40625,
"alnum_prop": 0.5916359163591636,
"repo_name": "onyxfish/clan",
"id": "b54dce6d0f759fc522f1f1b1ea7ff138b9bca490",
"size": "1649",
"binar... |
import maya.cmds
import maya.mel
import IECore
import IECoreMaya.ParameterUI
import IECoreMaya.StringUtil
class GenericParameterUI( IECoreMaya.ParameterUI ) :
def __init__( self, node, parameter, **kw ) :
IECoreMaya.ParameterUI.__init__(
self,
node,
parameter,
maya.cmds.rowLayout(
numberOfColumn... | {
"content_hash": "540cd7973479bb63a1736f399b4dc822",
"timestamp": "",
"source": "github",
"line_count": 201,
"max_line_length": 117,
"avg_line_length": 29.5273631840796,
"alnum_prop": 0.7049705139005897,
"repo_name": "appleseedhq/cortex",
"id": "9101cf81c2b54988f6d9347df7da954d73bb139a",
"size": "7... |
class BitforgeError(Exception):
def __init__(self, *args, **kwargs):
self.cause = kwargs.pop('cause', None)
self.prepare(*args, **kwargs)
self.message = self.__doc__.format(**self.__dict__)
def prepare(self, message=None):
if message is not None:
self.__doc__ = mess... | {
"content_hash": "67280eb8703a355fbfbf037cdf1e70fc",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 59,
"avg_line_length": 21.358974358974358,
"alnum_prop": 0.6086434573829532,
"repo_name": "ionux/bitforge",
"id": "9c7d6c7eec8bbc131febced1f26abf6a15618cae",
"size": "833",... |
"""Color class.
Represents an HTML Color .
"""
from .widget_description import DescriptionWidget
from .valuewidget import ValueWidget
from .widget import register
from .widget_core import CoreWidget
from .trait_types import Date, date_serialization
from traitlets import Unicode, Bool
@register
class DatePicker(Desc... | {
"content_hash": "d6fd0b2e16fa084bfbc78c54a610478d",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 81,
"avg_line_length": 30.476190476190474,
"alnum_prop": 0.7609375,
"repo_name": "nitin-cherian/LifeLongLearning",
"id": "d8abd3a0400597cc637dcde725416be75d652322",
"size":... |
default_app_config = 'admin.library.news.apps.LibraryNewsAppConfig' | {
"content_hash": "b2c34eac0b1caf31395e313845d25087",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 67,
"avg_line_length": 67,
"alnum_prop": 0.835820895522388,
"repo_name": "doraemonext/wechat-platform",
"id": "fa8c03e8023b962a4fe573e1520e87b333e1596f",
"size": "92",
"bi... |
"""
"""
# import the logging library
from __future__ import unicode_literals
import logging
#from django.contrib.auth.models import User
from django.template.defaultfilters import slugify
from django.db.models.signals import pre_save
from django.dispatch import receiver
from django.conf import settings
from django.db ... | {
"content_hash": "b0a5642e172479a8ca7d09ba37274b07",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 101,
"avg_line_length": 32.90196078431372,
"alnum_prop": 0.7199046483909416,
"repo_name": "rangertaha/salt-manager",
"id": "b69d873baad2fb6c395116baa0782f76978fac4a",
"size... |
import os
def xfile(afile, global_vars=None, local_vars=None):
with open(afile) as f:
code = compile(f.read(), "somefile.py", 'exec')
exec(code, global_vars, local_vars)
virtenv = os.environ['APPDIR'] + '/virtenv/'
os.environ['PYTHON_EGG_CACHE'] = os.path.join(virtenv, 'lib/python3.3/site-packages')
virtualenv =... | {
"content_hash": "fc57b527b13f726e2ca7cc4b6df6fd77",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 85,
"avg_line_length": 30.25,
"alnum_prop": 0.7086776859504132,
"repo_name": "alanplotko/CodeBoard",
"id": "3c1f939c87f451e9de888c8b28c23bb0bc91ba4b",
"size": "503",
"bin... |
from copy import deepcopy
from typing import Any, TYPE_CHECKING
from azure.core.rest import HttpRequest, HttpResponse
from azure.mgmt.core import ARMPipelineClient
from . import models
from ._configuration import PortalConfiguration
from ._serialization import Deserializer, Serializer
from .operations import (
Da... | {
"content_hash": "9512449d596da8abaa908ee9facd5ffa",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 110,
"avg_line_length": 44.29126213592233,
"alnum_prop": 0.7040771591407278,
"repo_name": "Azure/azure-sdk-for-python",
"id": "1c085a2caa1d52c88cc3d0ea790461b85d939f48",
"... |
from qpid.datatypes import Message, RangedSet
from qpid.testlib import TestBase010
from qpid.management import managementChannel, managementClient
from threading import Condition
from time import sleep
import qmf.console
import qpid.messaging
from qpidtoollibs import BrokerAgent
class ManagementTest (TestBase010):
... | {
"content_hash": "a52819d451b6da0bc86ef8791e3718d1",
"timestamp": "",
"source": "github",
"line_count": 707,
"max_line_length": 150,
"avg_line_length": 40.39179632248939,
"alnum_prop": 0.608642364394019,
"repo_name": "irinabov/debian-qpid-python",
"id": "751839291b84f760d73768055ff32735cb77f408",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.