text stringlengths 4 1.02M | meta dict |
|---|---|
from django import template
from django.conf import settings
from django.templatetags.static import static
from django.utils.safestring import mark_safe
register = template.Library()
@register.filter(is_safe=True)
def dep(value="polymer/polymer.html"):
# should you really be able to do this over reverse_lazy???
... | {
"content_hash": "0241225e217aa607c7c3096aca0503cf",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 102,
"avg_line_length": 34.5,
"alnum_prop": 0.7391304347826086,
"repo_name": "Colorless-Green-Ideas/MaterialDjango",
"id": "a1bba7ff62a6a58df905f60f5e60afc4ecbbb3ba",
"size... |
"""
Models class holds the different models used during Extraction
"""
__author__ = """\n""".join(['Jeffrey Schmidt (jschmid1@binghamton.edu',
'Benjamin Bush (benjaminjamesbush@gmail.com)',
'Hiroki Sayama (sayama@binghamton.edu)'])
__all__ = ['addModel','getMode... | {
"content_hash": "fd231a95f6ce08ba56d89c3eac102a51",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 135,
"avg_line_length": 37.87096774193548,
"alnum_prop": 0.5248722316865417,
"repo_name": "schmidtj/PyGNA",
"id": "c5fcb1753219d4245d511e18ff6367cc0ad65b37",
"size": "5870... |
import numpy as np
import progtimer
from scipy.io import wavfile
def timelapse(input_signal, ratio, window_size, overlap=4):
hop_in = window_size/overlap
hop_out = hop_in/ratio
#print "Ratio: ", float(Hin)/float(Hout), " Hout:", Hout
# pre- and postpad
padding = window_size - hop_in
signal_i... | {
"content_hash": "76618f9cec03843ec44e8033ee79c88f",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 106,
"avg_line_length": 29.314285714285713,
"alnum_prop": 0.6296296296296297,
"repo_name": "ollierik/audio-timelapse",
"id": "3d847fde66ecc8b2ad10c2613b9af7352fe58690",
"si... |
from urllib.request import urlopen
import re
import json
import sys
from collections import OrderedDict
import logging
from bs4 import BeautifulSoup
def with_command(tag):
tokens = ["submenu", "sub-menu", "command"]
txt = tag.get_text().lower()
return any(token in txt for token in tokens)
def with_read... | {
"content_hash": "c6644f63206b59844d6f017dcf12f6e6",
"timestamp": "",
"source": "github",
"line_count": 168,
"max_line_length": 90,
"avg_line_length": 36.05357142857143,
"alnum_prop": 0.5061911837543338,
"repo_name": "Kentzo/MikrotikWikiParser",
"id": "c4c521da9aae5fa2d13674057b31a68ddb96b9e7",
"si... |
import os, subprocess
from posixpath import join, basename, splitext, exists
from django.core import urlresolvers
from django.utils.translation import ugettext_lazy as _
from django.db import models
from django.conf import settings
from cms.models import CMSPlugin
from filer.fields.file import FilerFileField
from f... | {
"content_hash": "6092113a96a01868274c86bd2e8d0ba8",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 210,
"avg_line_length": 36.705882352941174,
"alnum_prop": 0.5564458689458689,
"repo_name": "bubenkoff/Arkestra",
"id": "e6c3586e6e9854f7773907cae2860a5dd54fae8e",
"size": ... |
from __future__ import unicode_literals
from prompt_toolkit.enums import DEFAULT_BUFFER
from prompt_toolkit.filters import HasSelection, Condition, EmacsInsertMode, ViInsertMode
from prompt_toolkit.keys import Keys
from prompt_toolkit.layout.screen import Point
from prompt_toolkit.mouse_events import MouseEventType, M... | {
"content_hash": "adb335af040b113087e5f7bddf3a9539",
"timestamp": "",
"source": "github",
"line_count": 406,
"max_line_length": 100,
"avg_line_length": 32.74384236453202,
"alnum_prop": 0.6188506092974274,
"repo_name": "ammarkhann/FinalSeniorCode",
"id": "401135dec06e600795db4381691d3c757f5c0d2d",
"... |
from __future__ import absolute_import
import six
from datetime import datetime
from django.utils import timezone
from sentry.api.serializers import Serializer, register
from sentry.models import Event, EventError
@register(Event)
class EventSerializer(Serializer):
_reserved_keys = frozenset(
['sentry.... | {
"content_hash": "7799fc40702f5ef3ec9281280956ee0a",
"timestamp": "",
"source": "github",
"line_count": 152,
"max_line_length": 105,
"avg_line_length": 34.14473684210526,
"alnum_prop": 0.5240847784200385,
"repo_name": "looker/sentry",
"id": "6f4d90e23e0eb157601655586352f03cdce9fb23",
"size": "5190"... |
import sys
import json
import logging
from graphkit.util import read_uri, dump_fileobj
from graphkit.util import GraphKitException
log = logging.getLogger(__name__)
def _fileobj(dump_file):
if dump_file is None:
return sys.stdout
return dump_fileobj(dump_file)
def save_dump(graph, dump_file):
... | {
"content_hash": "145c2493a570214dd92d2f779ff401a7",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 73,
"avg_line_length": 27.6734693877551,
"alnum_prop": 0.6290560471976401,
"repo_name": "pudo/graphkit",
"id": "8df975e4ed7bbd04a9c18031a15748b72197dbbc",
"size": "1356",
... |
import binascii
import mock
from oslo_concurrency import processutils
from nova import test
from nova.virt.libvirt.storage import dmcrypt
class LibvirtDmcryptTestCase(test.NoDBTestCase):
def setUp(self):
super(LibvirtDmcryptTestCase, self).setUp()
self.CIPHER = 'cipher'
self.KEY_SIZE = 2... | {
"content_hash": "c9d562209a70dafb4ae8740f06d41656",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 77,
"avg_line_length": 38.353658536585364,
"alnum_prop": 0.6391096979332274,
"repo_name": "jianghuaw/nova",
"id": "a09ee3931953af8ea85d54ba2a6637cd53f772a9",
"size": "3819"... |
import codecs
from datetime import datetime
from optparse import OptionParser
import random
import re
import time
import cookielib
import urllib
import urllib2
import logging
from BeautifulSoup import BeautifulSoup, NavigableString
class Message:
def __init__(self, thread_url, sender, recipient, timestamp, subje... | {
"content_hash": "0593c3471eae131109d744229a75614a",
"timestamp": "",
"source": "github",
"line_count": 313,
"max_line_length": 159,
"avg_line_length": 42.82747603833866,
"alnum_prop": 0.5490488623647892,
"repo_name": "hickford/OkCupid-Message-Downloader",
"id": "31cfb9aad0913b9d58a4d294d0e13c0e2efe1... |
from nipype.testing import assert_equal
from nipype.interfaces.fsl.maths import MeanImage
def test_MeanImage_inputs():
input_map = dict(args=dict(argstr='%s',
),
dimension=dict(argstr='-%smean',
position=4,
usedefault=True,
),
environ=dict(nohash=True,
usedefault=True,
),
ignore... | {
"content_hash": "e4ec5f2adcf9b8dd4334b4c759194325",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 78,
"avg_line_length": 24.641509433962263,
"alnum_prop": 0.6179173047473201,
"repo_name": "Leoniela/nipype",
"id": "252fd711c18aee3201c6941099e92efc1aec7a18",
"size": "1360... |
import string
intab = "abcdefghijklmnopqrstuwxyz0123456789"
outtab = "cdefghijklmnopqrstuwxyzab2345678901"
s = "g fmnc wms bgblr rpylqjyrc gr zw fylb. rfyrq ufyr amknsrcpq ypc dmp. bmgle gr gl zw fylb gq glcddgagclr ylb rfyr'q ufw rfgq rcvr gq qm jmle. sqgle qrpgle.kyicrpylq() gq pcamkkclbcb. lmu ynnjw ml rfc spj."
p... | {
"content_hash": "bc0a5bd488159de2ba016f53d2b82e62",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 209,
"avg_line_length": 67.14285714285714,
"alnum_prop": 0.7872340425531915,
"repo_name": "exu/poligon",
"id": "0b33edc93a53a8806bc902fbb6a745daca114afe",
"size": "470",
"... |
import os
from ..layers.wrappers import Wrapper
from ..models import Sequential
try:
# pydot-ng is a fork of pydot that is better maintained
import pydot_ng as pydot
except ImportError:
# fall back on pydot if necessary
import pydot
if not pydot.find_graphviz():
raise RuntimeError('Failed to impor... | {
"content_hash": "f8a4c8f90189aabc35db768350aee176",
"timestamp": "",
"source": "github",
"line_count": 85,
"max_line_length": 92,
"avg_line_length": 34.44705882352941,
"alnum_prop": 0.5744535519125683,
"repo_name": "marcsans/cnn-physics-perception",
"id": "e66a52d872f5efbf4a175570175c958cc8558cec",
... |
import os
import rospy
import subprocess
from std_msgs.msg import Byte
from lg_common.helpers import run_with_influx_exception_handler
DEVNULL = open(os.devnull, 'w')
CLEAR_BUTTON = 2
RELAUNCH_COMMAND = "pkill -f chrome"
NODE_NAME = 'rfreceiver_relaunch'
class RfreceiverAction:
def __init__(self):
rospy... | {
"content_hash": "89c0379b01efc73fbd133e24de91fb2f",
"timestamp": "",
"source": "github",
"line_count": 38,
"max_line_length": 79,
"avg_line_length": 24.605263157894736,
"alnum_prop": 0.6064171122994653,
"repo_name": "EndPointCorp/lg_ros_nodes",
"id": "9da8bd6239b4178dd55e61603e7addd55598ec9c",
"si... |
from updateImat import updateIMAT
from getf2fhttp import getf2fhttpEvents
from getAgendaEvents import getAgendaEvents
import settings
from updateGoogleCalendar import updateGoogleCalendar
import time
from sendEmail import sendEmail
from getf2fExcel import getf2fExcelEvents
from utils import sortEvents
... | {
"content_hash": "4a2ac9d9d4b7a455852d004fefbdfcf4",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 67,
"avg_line_length": 26.345238095238095,
"alnum_prop": 0.5684591052869408,
"repo_name": "adrian-stephens/schedule",
"id": "7381acea10561a43ad04fde468e8ca88aeed9f55",
"siz... |
import subprocess
from tempest.tests.lib import base
class TestTempestListPlugins(base.TestCase):
def test_run_list_plugins(self):
return_code = subprocess.call(
['tempest', 'list-plugins'], stdout=subprocess.PIPE)
self.assertEqual(return_code, 0)
| {
"content_hash": "2d9620f2b911905d1216f0a70ff193b6",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 64,
"avg_line_length": 28.3,
"alnum_prop": 0.696113074204947,
"repo_name": "HybridF5/tempest_debug",
"id": "782dde74169cd8ca8da5a4cc20774cb40d02b8ae",
"size": "890",
"bin... |
""" Named entity recognition fine-tuning: utilities to work with CoNLL-2003 task. """
import logging
import os
from dataclasses import dataclass
from enum import Enum
from typing import List, Optional, Union
from filelock import FileLock
from transformers import PreTrainedTokenizer, is_tf_available, is_torch_availab... | {
"content_hash": "af3dfaaca70793db875dddf2edebbd05",
"timestamp": "",
"source": "github",
"line_count": 357,
"max_line_length": 160,
"avg_line_length": 41.83473389355742,
"alnum_prop": 0.540140609306997,
"repo_name": "huggingface/transformers",
"id": "35fcb5ef5b7d22317a8db2c92b6eea9035b61d80",
"siz... |
import time
import uuid
from unittest import skipIf
from django.contrib.auth.models import User
from django.core.management import call_command
from django.test import TestCase, override_settings
try:
from django.urls import reverse
except ImportError:
from django.core.urlresolvers import reverse
from django... | {
"content_hash": "cdffc87df0dc1bbd2acb3da8e800cc28",
"timestamp": "",
"source": "github",
"line_count": 874,
"max_line_length": 102,
"avg_line_length": 35.779176201373,
"alnum_prop": 0.6095743660260305,
"repo_name": "1024inc/django-rq",
"id": "58188cc6087df554f86907b2a7c7a801dd873be4",
"size": "312... |
"""Tests for the learner goals."""
from __future__ import annotations
from core import feconf
from core.constants import constants
from core.domain import learner_goals_services
from core.domain import learner_progress_services
from core.domain import topic_domain
from core.domain import topic_services
from core.test... | {
"content_hash": "e1f3dedfcded59fa15a57ee9fea62986",
"timestamp": "",
"source": "github",
"line_count": 215,
"max_line_length": 80,
"avg_line_length": 40.311627906976746,
"alnum_prop": 0.5835929387331257,
"repo_name": "kevinlee12/oppia",
"id": "a5186dcb64e676d63977b4695509881d580ff241",
"size": "92... |
if __name__ == '__main__':
x = int(input())
y = int(input())
z = int(input())
n = int(input())
"""
pythonListComprehensions.py
You are given three integers and representing the dimensions of a cuboid along with an integer . You have to print a list of all possible coordinate... | {
"content_hash": "9d3843296609c4198a64603901f9b420",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 228,
"avg_line_length": 42.083333333333336,
"alnum_prop": 0.5762376237623762,
"repo_name": "bluewitch/Code-Blue-Python",
"id": "4c77c37553042741d9b9e7370196c3c3d478b50a",
"... |
import requests
import logging
from deployd.types.ping_response import PingResponse
from deployd.common.decorators import singleton
from deployd.common.exceptions import AgentException
log = logging.getLogger(__name__)
@singleton
class RestfulClient(object):
def __init__(self, config):
self.config = con... | {
"content_hash": "1d5d353e0ccf8026f063665037630ff9",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 120,
"avg_line_length": 36.46938775510204,
"alnum_prop": 0.608282036933408,
"repo_name": "mingzhaodotname/teletraan",
"id": "7726f3f6d709085c78ea12a3164c645acc13f46d",
"siz... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('article', '0007_auto_20151028_1813'),
]
operations = [
migrations.AlterField(
model_name='article',
name='category',
... | {
"content_hash": "4c62a114717e4879a5d5379edea7b0d3",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 136,
"avg_line_length": 29.071428571428573,
"alnum_prop": 0.5552825552825553,
"repo_name": "mactanxin/leetcodeblog",
"id": "d396222beb56da9831f2ecbd7033278c5f324848",
"size... |
from unittest import TestCase
from todone.parser.factory import (
ParserFactory,
PresetArgument,
)
from todone.parser.match import AlwaysMatch
from todone.parser.textparser import TextParser
class TestParserFactory(TestCase):
def test_class_can_be_instantiated(self):
ParserFactory()
def test... | {
"content_hash": "45ed31778e95eb965fb84c87a1c72ecd",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 65,
"avg_line_length": 34.68852459016394,
"alnum_prop": 0.6257088846880907,
"repo_name": "safnuk/todone",
"id": "514be117f5abcc2cd06a6764e4944eb8a01b0cb4",
"size": "2116",
... |
import urllib2
import cookielib
import re
cookie = cookielib.CookieJar()
handler=urllib2.HTTPCookieProcessor(cookie)
opener = urllib2.build_opener(handler)
response = opener.open('http://weibo.com/u/5038161234/home?wvr=5&lf=reg')
for item in cookie:
print 'Name = '+item.name
print 'Value = '+item... | {
"content_hash": "e46d70ec2e17409c70449bc09bd6dcd6",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 73,
"avg_line_length": 24.263157894736842,
"alnum_prop": 0.702819956616052,
"repo_name": "YChrisZhang/PythonCrawler",
"id": "fe999276628625fca5553ca8cdb6db3124cf6a53",
"siz... |
"""Lite version of scipy.linalg.
Notes
-----
This module is a lite version of the linalg.py module in SciPy which
contains high-level Python interface to the LAPACK library. The lite
version only accesses the following LAPACK functions: dgesv, zgesv,
dgeev, zgeev, dgesdd, zgesdd, dgelsd, zgelsd, dsyevd, zheevd, dgetr... | {
"content_hash": "b9dfe44b9a8cf13f50c9b6aaec1c25c7",
"timestamp": "",
"source": "github",
"line_count": 2376,
"max_line_length": 85,
"avg_line_length": 31.553030303030305,
"alnum_prop": 0.5668534080298786,
"repo_name": "yiakwy/numpy",
"id": "30180f24ab239b9362f1f9f1b1f7e5aa89666e5c",
"size": "74970... |
"""Web Crawler/Spider
This module implements a web crawler. This is very _basic_ only
and needs to be extended to do anything usefull with the
traversed pages.
"""
import re
import sys
import time
import math
import urllib2
import urlparse
import optparse
from cgi import escape
from traceback import format_exc
from Q... | {
"content_hash": "f4045d8b07cea5025c96543ec4b5c903",
"timestamp": "",
"source": "github",
"line_count": 188,
"max_line_length": 79,
"avg_line_length": 27.48936170212766,
"alnum_prop": 0.5089009287925697,
"repo_name": "cwoebker/relo",
"id": "82702414e631b075deaf1c34a6599a63e936542f",
"size": "5191",... |
import urllib
from bs4 import BeautifulSoup
url = "http://192.168.16.128/WackoPicko/"
page = urllib.request.urlopen(url)
s_p = page.read()
s = BeautifulSoup(s_p,"html.parser")
a=[]
for form in s.findAll("title"):
a = form
print (a)
| {
"content_hash": "61a25cdbd3c004879f2179b2db060b0f",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 41,
"avg_line_length": 17,
"alnum_prop": 0.6848739495798319,
"repo_name": "nwiizo/workspace_2017",
"id": "553f99091995404ac0b7caf3c2a4a2e39643543d",
"size": "286",
"binar... |
import sys
import os
from os import listdir
from os.path import isfile, join, isdir
from os import walk
from collections import defaultdict
import operator
import re
from math import log
import random
import pickle
# This list contains attributes which have already been used in the decision tree and cannot be used aga... | {
"content_hash": "6e405af4c948712a0b19d90f0426504b",
"timestamp": "",
"source": "github",
"line_count": 306,
"max_line_length": 257,
"avg_line_length": 49.51960784313726,
"alnum_prop": 0.6209991420840758,
"repo_name": "yashketkar/B551-Elements-Of-Artificial-Intelligence",
"id": "ecb1cebd512e8cf797d59... |
from tkinter import *
"""class yang berkaitan dengan proses penulisan file riwayat permainan"""
class GameHistory:
def __init__(self):
self.window = Tk()
self.window.title("Riwayat Permainan")
self.historyText = Text(self.window)
historyFile = open("gamehistory.txt", "r+")
... | {
"content_hash": "4cdc21c1669e6a3f9c3c1fb440aec0cd",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 73,
"avg_line_length": 28.9375,
"alnum_prop": 0.6393088552915767,
"repo_name": "argaghulamahmad/MNK-Game",
"id": "ff25bc8f37b91a479b8a9f669f2a6ba1f33f2d72",
"size": "463",
... |
import re
from webtest import response
class TestResponse(response.TestResponse):
'''Same as WebTest's TestResponse but adds basic HTTP authentication to
``click`` and ``clickbutton``.
'''
def click(self, description=None, linkid=None, href=None,
index=None, verbose=False,
... | {
"content_hash": "768cdc40a42613428d7b35672aae6626",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 81,
"avg_line_length": 41.142857142857146,
"alnum_prop": 0.6022727272727273,
"repo_name": "sloria/webtest-plus",
"id": "bd69d56d98bd4f35ac405247d9cf4bf8f1b2970f",
"size": "... |
"""
A driver for XenServer or Xen Cloud Platform.
**Related Flags**
:xenapi_connection_url: URL for connection to XenServer/Xen Cloud Platform.
:xenapi_connection_username: Username for connection to XenServer/Xen Cloud
Platform (default: root).
:xenapi_connection_password: Password f... | {
"content_hash": "739a2b239bbc55f2a938da166c3b8d7f",
"timestamp": "",
"source": "github",
"line_count": 775,
"max_line_length": 79,
"avg_line_length": 41.87741935483871,
"alnum_prop": 0.597134493914651,
"repo_name": "paulmathews/nova",
"id": "79ac2d44aa81a6bf334ac803329d1e6e62ee1133",
"size": "3314... |
from __future__ import with_statement
from cms.test_utils.compat import skipIf
from cms.test_utils.util.context_managers import SettingsOverride, StdoutOverride, TemporaryDirectory
import django
from django.core import management
from django.test import TestCase
from distutils.version import LooseVersion
class Static... | {
"content_hash": "8d4c4cb419b21089b9c01ea31461f0f5",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 101,
"avg_line_length": 44.68181818181818,
"alnum_prop": 0.7324516785350966,
"repo_name": "adaptivelogic/django-cms",
"id": "524ff4dd6fbfce9310ef63affaaf0a2048935fed",
"siz... |
"""This file contains code for interacting with terminals.
All the terminal interaction code is consolidated so the complexity can be in
one place, away from code that is commonly looked at.
"""
from __future__ import print_function, unicode_literals
import logging
import sys
class LoggingHandler(logging.Handler):... | {
"content_hash": "b095059458627038cb0c3ea6dda6de56",
"timestamp": "",
"source": "github",
"line_count": 71,
"max_line_length": 77,
"avg_line_length": 25.971830985915492,
"alnum_prop": 0.6203904555314533,
"repo_name": "wilebeast/FireFox-OS",
"id": "cdc3966575e62d7540600ef5743dc1c03d2baba7",
"size": ... |
from django.template import Template
from django.test.utils import override_settings
from cms.api import create_page
from cms.models import Page
from cms.templatetags.cms_admin import preview_link
from cms.test_utils.testcases import CMSTestCase
from cms.utils.i18n import force_language
from menus.base import Navigati... | {
"content_hash": "f49ac6c90b219b5f8e57b96c67b03bfe",
"timestamp": "",
"source": "github",
"line_count": 84,
"max_line_length": 104,
"avg_line_length": 39.54761904761905,
"alnum_prop": 0.614990969295605,
"repo_name": "rsalmaso/django-cms",
"id": "06e926f3757970f72cddddbbfb61288b10a86b23",
"size": "3... |
from federatedml.feature.feature_selection.filter_base import BaseFilterMethod
from federatedml.param.feature_selection_param import UniqueValueParam
from federatedml.protobuf.generated import feature_selection_meta_pb2
from federatedml.statistic.statics import MultivariateStatisticalSummary
import math
class UniqueV... | {
"content_hash": "f75fb1bf53108c3a371276702d20d5b7",
"timestamp": "",
"source": "github",
"line_count": 41,
"max_line_length": 81,
"avg_line_length": 36.65853658536585,
"alnum_prop": 0.6879574184963406,
"repo_name": "FederatedAI/FATE",
"id": "380f16f03756f518932b2887dd308cd57bc509c0",
"size": "2165... |
# -*- coding: utf-8 -*-
# ProjectEuler/src/python/problem055.py
#
# Lychrel numbers
# ===============
# Published on Friday, 24th October 2003, 06:00 pm
#
# If we take 47, reverse and add, 47 + 74 = 121, which is palindromic. Not all
# numbers produce palindromes so quickly. For example, 349 + 943 = 1292, 1292
# + 29... | {
"content_hash": "43adcd09e2d01c96eabab8ecde5ac929",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 79,
"avg_line_length": 47.63636363636363,
"alnum_prop": 0.7391857506361323,
"repo_name": "olduvaihand/ProjectEuler",
"id": "7c659382c6c8e491d36dba2cab8c27d170724531",
"size... |
from __future__ import unicode_literals # no division here
import unittest
from pyoxy import ObjectProxy as OP
try: # pragma: no cover
unicode
_PY3 = False
except NameError: # pragma: no cover
_PY3 = True
class ObjectProxyNoFutureDivisionTest(unittest.TestCase):
def check_result(self, expected... | {
"content_hash": "a1f2162fad33c0239b71e5ff2f5632cc",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 75,
"avg_line_length": 34.333333333333336,
"alnum_prop": 0.6148867313915858,
"repo_name": "jacekmitrega/pyoxy",
"id": "3637432df182cdafe5961924d8c678fe869c066d",
"size": "2... |
from __future__ import print_function
# SFTP storage backend for Django.
# Author: Brent Tubbs <brent.tubbs@gmail.com>
# License: MIT
#
# Modeled on the FTP storage by Rafal Jonca <jonca.rafal@gmail.com>
import getpass
import os
import paramiko
import posixpath
import stat
from datetime import datetime
from django.co... | {
"content_hash": "9636404bb3ce30562541adfc3c3e15c5",
"timestamp": "",
"source": "github",
"line_count": 230,
"max_line_length": 98,
"avg_line_length": 34.47391304347826,
"alnum_prop": 0.5974271660991298,
"repo_name": "faxioman/django-storages",
"id": "6efdf1234adcd1bf08d241572ac4bc92be7e3846",
"siz... |
import argparse
import os
import json
import collections
from subprocess import call
parser = argparse.ArgumentParser(description='CUE!')
options = parser.add_argument_group('Options')
options.add_argument('-p', '--project',
help='Specify the target project for the task',
requ... | {
"content_hash": "7ada7fa2d45b92e7ff10620ad1db9a77",
"timestamp": "",
"source": "github",
"line_count": 287,
"max_line_length": 88,
"avg_line_length": 31.261324041811847,
"alnum_prop": 0.5646455639768168,
"repo_name": "josephdwyer/cue",
"id": "66f13738d4a2b8cebf6783db4e982b35307e77af",
"size": "897... |
"""
@author Stephan Reith
@date 14.09.2016
This is a simple example to demonstrate how the ROS Spinnaker Interface can be used to send only.
You will also need a ROS Talker to send and data.
Make sure they communicate over the same ROS topics and std_msgs.Int64 ROS Messages used in here.
"""
import spynnaker.pyNN a... | {
"content_hash": "009c71c27e643cffc789948c75fd2172",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 109,
"avg_line_length": 26.948275862068964,
"alnum_prop": 0.7415227127319258,
"repo_name": "reiths/ros_spinnaker_interface",
"id": "db96bebb3bedf364e08caeaa6449b42c35f2dce8",... |
from __future__ import unicode_literals
import os
import shutil
import subprocess
from tempfile import NamedTemporaryFile
from django.contrib.staticfiles import finders
from django.contrib.staticfiles.storage import staticfiles_storage
from django.core.files.base import ContentFile
from django.utils.encoding import s... | {
"content_hash": "b7ec44107dbbb925ee10e0cc2b5adfca",
"timestamp": "",
"source": "github",
"line_count": 153,
"max_line_length": 100,
"avg_line_length": 40.588235294117645,
"alnum_prop": 0.6061191626409018,
"repo_name": "kronion/django-pipeline",
"id": "eb43157e560d24f7ff88dbfa21d2edf222764b21",
"si... |
from google.cloud import datacatalog_v1
def sample_create_entry_group():
# Create a client
client = datacatalog_v1.DataCatalogClient()
# Initialize request argument(s)
request = datacatalog_v1.CreateEntryGroupRequest(
parent="parent_value",
entry_group_id="entry_group_id_value",
)... | {
"content_hash": "9fdb35b21ce883614e3acb715b837d89",
"timestamp": "",
"source": "github",
"line_count": 20,
"max_line_length": 66,
"avg_line_length": 25.9,
"alnum_prop": 0.7084942084942085,
"repo_name": "googleapis/python-datacatalog",
"id": "1d3631b779be80b851c7b20fb76724e3802dd65d",
"size": "1915... |
from distutils.core import setup
setup(name = 'filltex',
version = '1.5.1',
description = 'Automatic queries to ADS and InSPIRE databases to fill LATEX bibliography',
long_description="See: `github.com/dgerosa/filltex <https://github.com/dgerosa/filltex>`_." ,
author = 'Davide Gerosa and Michel... | {
"content_hash": "07a9e72e58f46eae349b13bcad4bc08c",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 99,
"avg_line_length": 39.86666666666667,
"alnum_prop": 0.6438127090301003,
"repo_name": "dgerosa/filltex",
"id": "16f3e996fe552fa920bc8a7067132c91c86235ac",
"size": "621",... |
"""
This class encapsulates the interactions with
the student advisers.
"""
from restclients_core.exceptions import DataFailureException
from uw_sws.adviser import get_advisers_by_regid
from myuw.dao.pws import get_regid_of_current_user
from myuw.dao import is_using_file_dao, get_netid_of_current_user
def get_academi... | {
"content_hash": "8b7d3833e228db9ff161466224d985a8",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 68,
"avg_line_length": 34.333333333333336,
"alnum_prop": 0.6976421636615812,
"repo_name": "uw-it-aca/myuw",
"id": "f96d3aa125f21dbbad70dc08f613c97765caf943",
"size": "809",... |
from django.contrib import admin
from quick_reports_demo.blog.models import Article
class ArticleAdmin(admin.ModelAdmin):
def __init__(self, *args, **kwargs):
super(ArticleAdmin, self).__init__(*args, **kwargs)
list_display = ('pk', 'title', 'created_at', 'status')
list_filter = ('status', )
ad... | {
"content_hash": "eb930a722351a6e3c707880f0348e6f1",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 59,
"avg_line_length": 27.76923076923077,
"alnum_prop": 0.6759002770083102,
"repo_name": "brsbilgic/django-quick-reports",
"id": "6e02eb52a634454ff8b56f7be0850a39f13d713c",
... |
"""
Support for playing AudioSegments. Pyaudio will be used if it's installed,
otherwise will fallback to ffplay. Pyaudio is a *much* nicer solution, but
is tricky to install. See my notes on installing pyaudio in a virtualenv (on
OSX 10.10): https://gist.github.com/jiaaro/9767512210a1d80a8a0d
"""
import subprocess
fr... | {
"content_hash": "d44edddfb37ba7db0a901cad0c45bd6e",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 81,
"avg_line_length": 27.82608695652174,
"alnum_prop": 0.66484375,
"repo_name": "achang97/YouTunes",
"id": "a162152aaadc18382ea7561052b9664aa06997d8",
"size": "1280",
"b... |
"""
En una empresa hay 15 trabajadores. Se quiere hacer un torneo de ajedrez. Hay que escribir una función a la que
se le pasa una lista de todos los empleados de la empresa y la función devuelve otra lista
con todas las partidas posibles entre empleados. Nota: Un empleado no juega contra sí mismo.
a. S... | {
"content_hash": "86d4f7c0f8dd18c8edbc31c2bd99196d",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 155,
"avg_line_length": 37.35897435897436,
"alnum_prop": 0.6877144818119424,
"repo_name": "IhToN/DAW1-PRG",
"id": "f96d685074f6ceaae285bb83b8b6ba2be8a740d9",
"size": "1463"... |
from enigma import eConsoleAppContainer, iServiceInformation, fbClass, eRCInput, eDBoxLCD, getDesktop
from Screens.Screen import Screen
from Plugins.Plugin import PluginDescriptor
from os import symlink, mkdir, remove, rmdir, path
class ShellStarter(Screen):
skin = """
<screen position="1,1" size="1,1" title="TuxTX... | {
"content_hash": "fd9ff9eca1e4c86996e811b95f8eb0e4",
"timestamp": "",
"source": "github",
"line_count": 60,
"max_line_length": 115,
"avg_line_length": 29.133333333333333,
"alnum_prop": 0.6979405034324943,
"repo_name": "JrCs/opendreambox",
"id": "dad428bd375e8689ed6829040256f808f6a6919b",
"size": "1... |
import json
import unittest
import mock
from dashboard.pinpoint.models.quest import read_value
@mock.patch('dashboard.services.isolate_service.Retrieve')
class ReadValueTest(unittest.TestCase):
def testReadValue(self, retrieve):
retrieve.side_effect = (
{'files': {'chartjson-output.json': {'h': 'char... | {
"content_hash": "8b24d8dcb1a96c691baa058128b1f9d1",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 77,
"avg_line_length": 32.30612244897959,
"alnum_prop": 0.5808591282375237,
"repo_name": "benschmaus/catapult",
"id": "e2a69d6db231f2abaebeaf32c8c4d4494f27778d",
"size": "3... |
"""
A family of high-level user commands acting on the entire simulation.
Any new commands added to this directory will automatically become
available for any program.
Commands here should be 'bullet-proof' and work 'from scratch'.
That is, they should print warnings if required but should not raise
errors that would... | {
"content_hash": "64af2c33719294eb37e6c209c2199de1",
"timestamp": "",
"source": "github",
"line_count": 978,
"max_line_length": 126,
"avg_line_length": 38.97648261758691,
"alnum_prop": 0.6501482200477452,
"repo_name": "mjabri/topographica",
"id": "fbc9ef0bc8736706a9e5e879f20bbd577b6c8d68",
"size": ... |
from __future__ import unicode_literals
try:
from docutils.core import publish_parts
def render_rest(markup, **docutils_settings):
docutils_settings.update({
'raw_enabled': False,
'file_insertion_enabled': False,
})
parts = publish_parts(
source=mar... | {
"content_hash": "d4d4b027f24c079b21191f7d63bfe4ca",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 49,
"avg_line_length": 25.526315789473685,
"alnum_prop": 0.5896907216494846,
"repo_name": "zsiciarz/django-markitup",
"id": "76cf86b27369e71f193d367cea30b4a959a8a72a",
"siz... |
"""Statistics helper for sensor."""
from __future__ import annotations
from collections import defaultdict
from collections.abc import Callable, Iterable
import datetime
import itertools
import logging
import math
from typing import Any
from sqlalchemy.orm.session import Session
from homeassistant.components.recorde... | {
"content_hash": "63a4bf4c6ef57f77dfbd46a2d5b34bc3",
"timestamp": "",
"source": "github",
"line_count": 754,
"max_line_length": 98,
"avg_line_length": 37.97214854111406,
"alnum_prop": 0.5747266948412559,
"repo_name": "lukas-hetzenecker/home-assistant",
"id": "9422e51f5a6adfcc0b245b053f926b203ecca38b"... |
from oslo_policy import policy
from nova.policies import base
BASE_POLICY_NAME = 'os_compute_api:os-attach-interfaces'
POLICY_ROOT = 'os_compute_api:os-attach-interfaces:%s'
attach_interfaces_policies = [
policy.DocumentedRuleDefault(
BASE_POLICY_NAME,
base.RULE_ADMIN_OR_OWNER,
"List po... | {
"content_hash": "f2e659b457d4ab7c00d2e7d12abad921",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 76,
"avg_line_length": 26.52,
"alnum_prop": 0.5128205128205128,
"repo_name": "phenoxim/nova",
"id": "c9b6677d09877a3cab7ca7da8eb80f71acd1d497",
"size": "1965",
"binary": ... |
import RPi.GPIO as gpio
import time
def distance(measure='cm'):
try:
gpio.setmode(gpio.BOARD)
gpio.setup(12, gpio.OUT)
gpio.setup(16, gpio.IN)
gpio.output(12, False)
while gpio.input(16) == 0:
nosig = time.time()
while gpio.input(16) == 1:
... | {
"content_hash": "cfc676abe0826f39eddd7524984edc25",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 61,
"avg_line_length": 22.62857142857143,
"alnum_prop": 0.5,
"repo_name": "PythonProgramming/Robotics-with-Raspberry-Pi",
"id": "fd8880b5cb181ec73a70f67b6f0ddb9bda2a0212",
... |
import os
import sys
from distutils.core import setup
from distutils.sysconfig import get_python_lib
# Warn if we are installing over top of an existing installation. This can
# cause issues where files that were deleted from a more recent Django are
# still present in site-packages. See #18115.
overlay_warning = Fal... | {
"content_hash": "0950489c286bc2d7564505146b8e4dcc",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 87,
"avg_line_length": 34.150375939849624,
"alnum_prop": 0.6424482606781153,
"repo_name": "bliti/django-nonrel-1.5",
"id": "4682031af9e86c8b863cdf84fa69875e7c3a6ba5",
"siz... |
from django.test import TestCase
from django.core.urlresolvers import reverse
from django.utils.text import truncate_words
from umessages.models import Message, MessageRecipient, MessageContact
from umessages.utils import get_user_model
User = get_user_model()
class MessageContactTests(TestCase):
fixtures = ['us... | {
"content_hash": "795a76262eff95ff8cd09445564f9b30",
"timestamp": "",
"source": "github",
"line_count": 61,
"max_line_length": 70,
"avg_line_length": 34.52459016393443,
"alnum_prop": 0.6291547958214625,
"repo_name": "euanlau/django-umessages",
"id": "70ec26d4e8b46f742449080bf4fae0d0ba3dd2c0",
"size... |
import json
import logging
import os
import sys
from types import FrameType
from typing import Any, Dict, List, Optional, TYPE_CHECKING, Text
import rasa.shared.utils.cli
import rasa.shared.utils.io
if TYPE_CHECKING:
from questionary import Question
logger = logging.getLogger(__name__)
FREE_TEXT_INPUT_PROMPT = ... | {
"content_hash": "79c288f73a8ed49592c4522ec8561b21",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 88,
"avg_line_length": 31.263157894736842,
"alnum_prop": 0.6227085671530116,
"repo_name": "RasaHQ/rasa_nlu",
"id": "fc9a1d5e9595183eb956bf13471e7f1aaad6c707",
"size": "534... |
from setuptools import setup
def get_version():
with open("dotjs.py", "r") as fp:
for line in fp:
if line.startswith("__version__"):
return eval(line.split("=")[-1])
def read(filename):
with open(filename, "r") as fp:
return fp.read()
setup(
name="dotjs",
... | {
"content_hash": "0f6a08ad4ed166c74a262acbf075f6e2",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 67,
"avg_line_length": 26.302325581395348,
"alnum_prop": 0.5587975243147657,
"repo_name": "tommytwoeyes/python-dotjs",
"id": "80b6942482c33afb4fdb4871107922edf33041a1",
"si... |
import sqlalchemy as sql
def upgrade(migrate_engine):
# Upgrade operations go here. Don't create your own engine; bind
# migrate_engine to your metadata
meta = sql.MetaData()
meta.bind = migrate_engine
endpoint_group_table = sql.Table(
'endpoint_group',
meta,
sql.Column('i... | {
"content_hash": "4a76005a4aa0afd2a5614e9fde557120",
"timestamp": "",
"source": "github",
"line_count": 37,
"max_line_length": 72,
"avg_line_length": 37.432432432432435,
"alnum_prop": 0.631768953068592,
"repo_name": "rushiagr/keystone",
"id": "5f80160a70f929f334d270b9092741f99f9deb1b",
"size": "197... |
from __future__ import unicode_literals
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [
('assets', '0004_auto_20171202_0517'),
]
operations = [
migrations.AddField(
model_name='asset',
... | {
"content_hash": "98a3dc9401b7647ee5697ad7b8b2a6e8",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 111,
"avg_line_length": 24.842105263157894,
"alnum_prop": 0.6334745762711864,
"repo_name": "AlmostBetterNetwork/podmaster-host",
"id": "833037da84f2bab8586f44d58d02d1d515b2c3... |
import os
import imaplib
import re
import email
import time
try:
MODULE = os.path.dirname(__file__)
except:
MODULE = ""
# Import the Cache class from pattern.web so e-mails can be cached locally (faster):
try: from ..cache import cache
except:
try:
import os, sys; sys.path.append(os.path.join(MO... | {
"content_hash": "b08e28cdc344881098240d0378050f5a",
"timestamp": "",
"source": "github",
"line_count": 305,
"max_line_length": 119,
"avg_line_length": 33.13770491803279,
"alnum_prop": 0.523498565350747,
"repo_name": "decebel/dataAtom_alpha",
"id": "ae2ee31a089216b15f4da8db491828d0d3a0a732",
"size"... |
"""
Autocompletion example.
Press [Tab] to complete the current word.
- The first Tab press fills in the common part of all completions.
- The second Tab press shows all the completions. (In the menu)
- Any following tab press cycles through all the possible completions.
"""
from __future__ import unicode_literals
fr... | {
"content_hash": "6228a126890a51c0bd55f632853d3c66",
"timestamp": "",
"source": "github",
"line_count": 57,
"max_line_length": 70,
"avg_line_length": 18.54385964912281,
"alnum_prop": 0.5941343424787133,
"repo_name": "niklasf/python-prompt-toolkit",
"id": "1b20a90f4bf6c4a2415979b1392982aa22f3fb7a",
... |
"""Utility functions for NSynth."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import importlib
# internal imports
import librosa
import numpy as np
import scipy.io.wavfile
import tensorflow as tf
slim = tf.contrib.slim
#===========================... | {
"content_hash": "75b3374bb59662171e6b383421e9a7fb",
"timestamp": "",
"source": "github",
"line_count": 720,
"max_line_length": 80,
"avg_line_length": 33.475,
"alnum_prop": 0.5999502116006971,
"repo_name": "bda2017-shallowermind/MusTGAN",
"id": "30cc0df266157a4765c5f71d5d8e9b0af5a9fa09",
"size": "2... |
"""Tests for learned_optimizers.adafac_mlp_lopt."""
from absl.testing import absltest
import jax
from learned_optimization.learned_optimizers import adafac_mlp_lopt
from learned_optimization.learned_optimizers import test_utils
import numpy as onp
class AdafacMLPLOptTest(absltest.TestCase):
def test_adafac_mlp_lop... | {
"content_hash": "d3268bc4c491514298a353e25c8eef27",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 75,
"avg_line_length": 30.58974358974359,
"alnum_prop": 0.6873428331936295,
"repo_name": "google/learned_optimization",
"id": "f371ae1f36ce1c7bdd7029c26f0d704a3c258ae8",
"s... |
from rest_framework import status
from rest_framework.test import APITestCase
from cla_common.constants import REASONS_FOR_CONTACTING
from checker.models import ReasonForContacting
from core.tests.mommy_utils import make_recipe
from core.tests.test_base import SimpleResourceAPIMixin
from legalaid.tests.views.test_base... | {
"content_hash": "d68cda4131c0a591b451a7987a03a950",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 108,
"avg_line_length": 43.86440677966102,
"alnum_prop": 0.6943585780525502,
"repo_name": "ministryofjustice/cla_backend",
"id": "2c8baee1969f257b58d123ad57295b09361962a2",
... |
import pretend
import pytest
from pyramid.httpexceptions import HTTPMovedPermanently, HTTPSeeOther
from warehouse.accounts import views
from warehouse.accounts.interfaces import IUserService
from ...common.db.accounts import UserFactory
class TestUserProfile:
def test_user_redirects_username(self, db_request)... | {
"content_hash": "c9b28d5c7dfa2d8c0df5541fc35bab89",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 79,
"avg_line_length": 35.87659574468085,
"alnum_prop": 0.598149685683786,
"repo_name": "ismail-s/warehouse",
"id": "f0add757b64e3667c7d0c6867358df49a2785659",
"size": "89... |
import json
import logging
import sys
from redash.query_runner import *
from redash.utils import JSONEncoder
logger = logging.getLogger(__name__)
try:
import pymssql
enabled = True
except ImportError:
enabled = False
# from _mssql.pyx ## DB-API type definitions & http://www.freetds.org/tds.html#types ##... | {
"content_hash": "8044ce5c6ad241bacfa21dbe1ab998fb",
"timestamp": "",
"source": "github",
"line_count": 150,
"max_line_length": 109,
"avg_line_length": 29.753333333333334,
"alnum_prop": 0.4920457091642393,
"repo_name": "olivetree123/redash-x",
"id": "0ec05bdf07a245c4eb5d76c292e51c56d4a97feb",
"size... |
"""Commonly used utility functions."""
import re
import copy
import warnings
from collections.abc import Iterable
from copy import deepcopy
import numpy as np
from scipy.spatial.distance import cdist
from astropy.time import Time
from astropy.coordinates import Angle
from astropy.utils import iers
from astropy.coordin... | {
"content_hash": "ae9c36d4fd32155258be796d4b976b57",
"timestamp": "",
"source": "github",
"line_count": 5017,
"max_line_length": 88,
"avg_line_length": 38.117600159457844,
"alnum_prop": 0.5972777092179297,
"repo_name": "HERA-Team/pyuvdata",
"id": "ae5059aa3bc85a041bf546e62f0d572798562433",
"size": ... |
from .recovery_services_backup_client import RecoveryServicesBackupClient
from .version import VERSION
__all__ = ['RecoveryServicesBackupClient']
__version__ = VERSION
| {
"content_hash": "faecb662679f16192d385dcf54533948",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 73,
"avg_line_length": 24.428571428571427,
"alnum_prop": 0.7894736842105263,
"repo_name": "v-iam/azure-sdk-for-python",
"id": "dc0eafa315788627630e484ed7bc02cb7da77b02",
"si... |
"""module_builder
Use configuration files to generate verilog modules
"""
"""
Changes:
9/16/2013:
-Initial Commit
"""
__author__ = 'dave.mccoy@cospandesign.com (Dave McCoy)'
import os
import sys
import string
import json
import copy
#Project Modules
import utils
import verilog_utils as vutils
from verilog_uti... | {
"content_hash": "75032c29011629d7ebc681e58a9d9b9f",
"timestamp": "",
"source": "github",
"line_count": 474,
"max_line_length": 93,
"avg_line_length": 33.426160337552744,
"alnum_prop": 0.41788689724816963,
"repo_name": "CospanDesign/nysa",
"id": "e174e64acbaf4d870ba672064513127bc699ca8c",
"size": "... |
"""
"""
__docformat__ = 'restructuredtext'
__version__ = '$Id: $'
import sys
from . import lib_pulseaudio as pa
import pyglet
_debug = pyglet.options['debug_media']
import mt_media
def check(result):
if result < 0:
error = pa.pa_context_errno(context._context)
raise MediaException(pa.pa_stre... | {
"content_hash": "7ddd7383f72b1368fd7bc10d294b0943",
"timestamp": "",
"source": "github",
"line_count": 516,
"max_line_length": 81,
"avg_line_length": 32.05232558139535,
"alnum_prop": 0.5340105205877018,
"repo_name": "bitcraft/pyglet",
"id": "e7480d57abb383b2a83e1aac8ca9552ab8f1de5b",
"size": "1656... |
import argparse
import sys
import os
from PIL import Image
focalLength = 525.0
centerX = 319.5
centerY = 239.5
scalingFactor = 5000.0
def generate_pointcloud(rgb_file,depth_file,ply_file):
rgb = Image.open(rgb_file)
depth = Image.open(depth_file)
if rgb.size != depth.size:
raise Exception("Co... | {
"content_hash": "99b394205b402faba886c2c898a9fbb3",
"timestamp": "",
"source": "github",
"line_count": 59,
"max_line_length": 111,
"avg_line_length": 30.305084745762713,
"alnum_prop": 0.6375838926174496,
"repo_name": "georgebrindeiro/hybridslam",
"id": "d224f6c1943936de2bd85086993eba973671f6d7",
"... |
from django.core.management.base import BaseCommand
from django_datawatch.datawatch import datawatch
class Command(BaseCommand):
def handle(self, *args, **options):
for slug in datawatch.get_all_registered_check_slugs():
print(slug)
| {
"content_hash": "d160f251e7564496526f231d8296810a",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 63,
"avg_line_length": 28.88888888888889,
"alnum_prop": 0.7230769230769231,
"repo_name": "RegioHelden/django-datawatch",
"id": "e425102ed5e1739575deb5636eaa1f8a660611bb",
"s... |
import tests.model_control.test_ozone_custom_models_enabled as testmod
testmod.build_model( ['Integration'] , ['Lag1Trend'] , ['BestCycle'] , ['NoAR'] ); | {
"content_hash": "03927e3d2b1266f06ba1e4a520d4fe0b",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 82,
"avg_line_length": 38.75,
"alnum_prop": 0.7096774193548387,
"repo_name": "antoinecarme/pyaf",
"id": "75fbb759a74cf70cd55a28f8f79b3f587c79caad",
"size": "155",
"binary"... |
from __future__ import absolute_import, unicode_literals
import babel
from babel import dates
def _get_locale():
return 'en_US'
def _get_tz():
"""
Factory that returns forms's timezone
:return:
"""
return 'UTC'
def locale_factory(factory):
"""
Decorator which defines a factory fun... | {
"content_hash": "551b9ff74b599a13c3b13f41e43f31ca",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 59,
"avg_line_length": 19.43103448275862,
"alnum_prop": 0.6317657497781721,
"repo_name": "renzon/gaeforms",
"id": "b2f864e90827089d7da0ae7fbadf6da4b611b66e",
"size": "1151"... |
"""
This module provides an interface to the Elastic Compute Cloud (EC2)
Auto Scaling service.
"""
import boto
from boto.connection import AWSQueryConnection
from boto.ec2.regioninfo import RegionInfo
from boto.ec2.autoscale.request import Request
from boto.ec2.autoscale.trigger import Trigger
from boto.ec2.autoscale.... | {
"content_hash": "632b2d8ed2e20d860e70f11ad90b71b3",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 87,
"avg_line_length": 43.34375,
"alnum_prop": 0.5471040615236722,
"repo_name": "charlescearl/VirtualMesos",
"id": "58b1bb06ec768d2196b33575f83d48bc911c5ba8",
"size": "942... |
from django import template
register = template.Library()
@register.simple_tag(takes_context = True)
def getLoggedUser(context):
request = context['request']
if 'user' in request.session:
return request.session['user']
else:
return ''
| {
"content_hash": "012424cafb486063da3c9c8810e4d9a9",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 42,
"avg_line_length": 22.181818181818183,
"alnum_prop": 0.7377049180327869,
"repo_name": "luiscarlosgph/nas",
"id": "104267355465012e7a6397b481a192a4edb55393",
"size": "24... |
from __future__ import unicode_literals
import json
from mock import Mock
import pytest
from boxsdk.network.default_network import DefaultNetworkResponse
@pytest.fixture(scope='session')
def generic_successful_response():
mock_network_response = Mock(DefaultNetworkResponse)
mock_network_response.content = b'{... | {
"content_hash": "e0ea7a261cdf86b2f4b4e2881610e910",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 90,
"avg_line_length": 27.73611111111111,
"alnum_prop": 0.7243365047571357,
"repo_name": "jwkozel/demobx",
"id": "72ca5a8d2310fb760c8ed12eb88b578c92fc391a",
"size": "4011"... |
"""
Support for Blink system camera control.
For more details about this platform, please refer to the documentation at
https://home-assistant.io/components/binary_sensor.blink/
"""
from homeassistant.components.blink import DOMAIN
from homeassistant.components.binary_sensor import BinarySensorDevice
DEPENDENCIES = [... | {
"content_hash": "d2c1f5a87be6e454d071f45a1d58c235",
"timestamp": "",
"source": "github",
"line_count": 74,
"max_line_length": 74,
"avg_line_length": 27.87837837837838,
"alnum_prop": 0.6325739214735822,
"repo_name": "miniconfig/home-assistant",
"id": "8d84ffb9c90ee903d99859231da4c34450d02147",
"siz... |
from nova import test
from nova.tests import fixtures as nova_fixtures
from nova.tests.functional import fixtures as func_fixtures
from nova.tests.functional import integrated_helpers
import nova.tests.unit.image.fake
from nova.tests.unit import policy_fixture
from nova.virt import fake
class TestResizeWithNoAllocati... | {
"content_hash": "dae0fb29b03054c6de528ee2125c3fda",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 78,
"avg_line_length": 43.125,
"alnum_prop": 0.6797101449275362,
"repo_name": "mikalstill/nova",
"id": "c8824f23178e4d93779bc7cdd7ed93d111aedb0f",
"size": "4684",
"binary... |
import ldap
import copy
import constants # Local module
# Helper function
def mergeDicts(toDict, fromDict):
#Copy items from 'fromDict' to 'toDict'
if not (isinstance(fromDict, dict) and isinstance(toDict,dict)):
return None
for key in fromDict:
keyCopy = copy.copy(key)
valueCopy = copy.copy(fromDic... | {
"content_hash": "ea3b591d31b9786d5af187f1d9084c7f",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 90,
"avg_line_length": 34.61290322580645,
"alnum_prop": 0.7039453246349798,
"repo_name": "odeke-em/ldappy",
"id": "0af6765a852ab40a5a722e8b3593a796bdd28c3b",
"size": "3374"... |
import copy
from direct.directnotify import DirectNotifyGlobal
from direct.interval.IntervalGlobal import *
from direct.showbase import AppRunnerGlobal
from direct.showbase import DirectObject
from direct.showbase import PythonUtil
import os
from pandac.PandaModules import *
import re
import sys
import token
import tok... | {
"content_hash": "7d6872a4bf11481c32c6b280681e76b4",
"timestamp": "",
"source": "github",
"line_count": 1095,
"max_line_length": 290,
"avg_line_length": 39.4027397260274,
"alnum_prop": 0.5848050804246049,
"repo_name": "Spiderlover/Toontown",
"id": "480435fc346f74c03dfb7b74152e39bf05b1d94b",
"size":... |
import random
import sys
import time
from oslo_log import log
from oslo_config import cfg
import oslo_messaging as messaging
opts = [
cfg.StrOpt('server_id',
help='A string uniquely identifying current instance. Used'
'by server to distinguish instances.'),
]
CONF = cfg.CONF
CO... | {
"content_hash": "00fecda1f31f44b05f454f587ca75e9a",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 74,
"avg_line_length": 22.365079365079364,
"alnum_prop": 0.6139105748757985,
"repo_name": "dmitrymex/example-oslo-messaging",
"id": "f4ce44e2a5adae307909b7f41857f09f3b0dc827"... |
import argparse
import pygame
from pygame.locals import *
from localizations import initLocalization
import engine
import global_vars as g
from constants import *
parser = argparse.ArgumentParser(prog='PyORPG')
parser.add_argument('-ip', help='connect to server on ip')
parser.add_argument('-p', help='connect to serve... | {
"content_hash": "29f00785d9bcb0b83b7ee26e8f2512e6",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 78,
"avg_line_length": 27.178571428571427,
"alnum_prop": 0.7201051248357424,
"repo_name": "marcusmoller/pyorpg-client",
"id": "191a3a8c0a901cc0f8ba130bd895d459680f41b4",
"s... |
"""gsutil exceptions.
The exceptions in this module are for use across multiple different classes.
"""
from __future__ import absolute_import
from __future__ import print_function
from __future__ import division
from __future__ import unicode_literals
import six
NO_URLS_MATCHED_PREFIX = 'No URLs matched'
NO_URLS_MA... | {
"content_hash": "89bbdb22d217d7160ef427a3c263a83b",
"timestamp": "",
"source": "github",
"line_count": 134,
"max_line_length": 80,
"avg_line_length": 31.223880597014926,
"alnum_prop": 0.7148661567877629,
"repo_name": "GoogleCloudPlatform/gsutil",
"id": "0590fd108fe978b8ef1263c7d0664db6b891d46d",
"... |
import matplotlib.pyplot as plt
from sklearn_evaluation.plot.util import requires_properties
from sklearn_evaluation.report.serialize import EvaluatorHTMLSerializer
from sklearn_evaluation.report.report import Report
from .util import estimator_type, class_name
from . import plot
class ClassifierEvaluator(object):
... | {
"content_hash": "501597e71eb784dd4283dd8b27991b27",
"timestamp": "",
"source": "github",
"line_count": 186,
"max_line_length": 79,
"avg_line_length": 32.38172043010753,
"alnum_prop": 0.6055122032209862,
"repo_name": "edublancas/sklearn-model-evaluation",
"id": "345aa6a2cee38b389d03283274573f4b518457... |
import sys
from typing import Any, AsyncIterable, Callable, Dict, IO, Optional, TypeVar, Union, cast, overload
from azure.core.async_paging import AsyncItemPaged, AsyncList
from azure.core.exceptions import (
ClientAuthenticationError,
HttpResponseError,
ResourceExistsError,
ResourceNotFoundError,
... | {
"content_hash": "a6e8ffdf884c72424b55514a938db6d1",
"timestamp": "",
"source": "github",
"line_count": 913,
"max_line_length": 206,
"avg_line_length": 46.68346111719606,
"alnum_prop": 0.6443386044765614,
"repo_name": "Azure/azure-sdk-for-python",
"id": "52df56456794250102436bfeae5f6ab1e46e313c",
"... |
import urlparse
from google.appengine.ext import ndb
from consts.district_type import DistrictType
from models.district import District
from models.district_team import DistrictTeam
from models.team import Team
from models.robot import Robot
class FMSAPITeamDetailsParser(object):
def __init__(self, year):
... | {
"content_hash": "7b6a3356f288e787a46f798620e4e69e",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 120,
"avg_line_length": 39.701298701298704,
"alnum_prop": 0.5682041216879293,
"repo_name": "nwalters512/the-blue-alliance",
"id": "72c49a08f6ce8d07a7f5f97a9c46e96c4d6dc4ca",
... |
"""Razor2 check plugin."""
import threading
import subprocess
import oa.plugins.base
def kill_process(process, log):
log.debug("Razor timed out")
process.kill()
class Razor2Plugin(oa.plugins.base.BasePlugin):
eval_rules = ("check_razor2",
"check_razor2_range")
options = {"use_ra... | {
"content_hash": "a21b5ac5ca6020f576d16bf6db408511",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 71,
"avg_line_length": 31.387931034482758,
"alnum_prop": 0.5292502059873662,
"repo_name": "SpamExperts/OrangeAssassin",
"id": "4c8827a8402be0939fb678e378c318c0130f84bf",
"... |
"""
Command-line utility for administrative tasks.
"""
import os
import sys
if __name__ == "__main__":
os.environ.setdefault(
"DJANGO_SETTINGS_MODULE",
"DjangoUnityTutorial.settings"
)
from django.core.management import execute_from_command_line
execute_from_command_line(sys.argv)
| {
"content_hash": "1c33331554dda945c3492658079ba656",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 64,
"avg_line_length": 19.875,
"alnum_prop": 0.6729559748427673,
"repo_name": "eamonwoortman/django-unity3d-example",
"id": "e9bcdf0c8805076e389c4d25d9044939e0521bfd",
"siz... |
from ..PulsePrimitives import *
from ..Compiler import compile_to_hardware
from ..PulseSequencePlotter import plot_pulse_files
from .helpers import create_cal_seqs
from itertools import product
import operator
from ..ControlFlow import *
from ..TdmInstructions import *
from functools import reduce
from typing import It... | {
"content_hash": "341bedf557dfea5b83718ce7aefc5651",
"timestamp": "",
"source": "github",
"line_count": 337,
"max_line_length": 144,
"avg_line_length": 36.311572700296736,
"alnum_prop": 0.5885429435319114,
"repo_name": "BBN-Q/QGL",
"id": "a70820df7762780e80889a5e3a31d2fd1a43d80d",
"size": "12237",
... |
"""Solve an arbitrary system"""
__docformat__ = "restructuredtext en"
import numpy as np
import scipy as sp
from scipy.sparse import isspmatrix_csr, isspmatrix_bsr, csr_matrix
from pyamg import smoothed_aggregation_solver
from pyamg.util.linalg import ishermitian, norm
__all__ = ['solve', 'solver', 'solver_configura... | {
"content_hash": "763b00bf4d4b8b86e215f6dec8e6753f",
"timestamp": "",
"source": "github",
"line_count": 331,
"max_line_length": 79,
"avg_line_length": 34.05740181268882,
"alnum_prop": 0.564978266654839,
"repo_name": "pombreda/pyamg",
"id": "477d9513e33e13ec49dbdecf1e956e95b6c8bfe2",
"size": "11273"... |
from django.db import models
from django.db.models import Avg
from django.contrib.auth.models import User
from django.core.validators import MaxValueValidator, MinValueValidator, RegexValidator
import json
from rest_framework.authtoken.models import Token
class Cuisine(models.Model):
name = models.CharField(max_le... | {
"content_hash": "89fb435d5ef5944c974b3b8655091e45",
"timestamp": "",
"source": "github",
"line_count": 78,
"max_line_length": 201,
"avg_line_length": 32.243589743589745,
"alnum_prop": 0.6783300198807157,
"repo_name": "FMI-B20/Yarr",
"id": "3d862e544d2109a92b78402c33158dd9169143e2",
"size": "2515",... |
from scapy import *
import __builtin__
try:
from cert import *
CERT=1
except:
CERT=0
#############################################################################
# Helpers ##
###########################################################... | {
"content_hash": "e9640fcfc9b386455f03f4e6df631fed",
"timestamp": "",
"source": "github",
"line_count": 6811,
"max_line_length": 156,
"avg_line_length": 37.35060930847159,
"alnum_prop": 0.5372236089545785,
"repo_name": "daveti/NDprotector",
"id": "1f274017b721ea481118ee96ba70b4b88e9dfd09",
"size": ... |
"""Base constants and handlers."""
import base64
import Cookie
import datetime
import hmac
import json
import logging
import os
import sys
import time
import traceback
import urlparse
import jinja2
import webapp2
from google.appengine.api import users
from core import counters
from core.domain import config_domain
f... | {
"content_hash": "5a593befa0d1d0a644ac779ab7274263",
"timestamp": "",
"source": "github",
"line_count": 522,
"max_line_length": 83,
"avg_line_length": 38.333333333333336,
"alnum_prop": 0.6165917041479261,
"repo_name": "bjvoth/oppia",
"id": "b13951e2f57e336463486741e7c24d88ab668c25",
"size": "20615"... |
from django.conf import settings
from django.urls import re_path
from django.utils.translation import ugettext_lazy as _
from horizon.browsers.views import AngularIndexView
from senlin_dashboard.api import rest # noqa: F401
from senlin_dashboard.cluster.receivers import views as legacyViews
if settings.ANGULAR_FEA... | {
"content_hash": "7d43dd8ca73b451cb56810d02f054938",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 76,
"avg_line_length": 34.65217391304348,
"alnum_prop": 0.6599749058971142,
"repo_name": "stackforge/senlin-dashboard",
"id": "fe73b0e47cb73e08752f2cf2e6bd551583955199",
"s... |
import typing as t
from datetime import datetime
from .._internal import _to_str
from ..datastructures import Accept
from ..datastructures import Authorization
from ..datastructures import CharsetAccept
from ..datastructures import ETags
from ..datastructures import Headers
from ..datastructures import HeaderSet
from ... | {
"content_hash": "a94a0a07dce50f87fa6457afbf84c86c",
"timestamp": "",
"source": "github",
"line_count": 547,
"max_line_length": 87,
"avg_line_length": 36.88299817184644,
"alnum_prop": 0.6304337050805452,
"repo_name": "pallets/werkzeug",
"id": "8832baafeeea4e74146fa9d24ea328542d98413a",
"size": "201... |
"""smarttub constants."""
DOMAIN = "smarttub"
EVENT_SMARTTUB = "smarttub"
SMARTTUB_CONTROLLER = "smarttub_controller"
SCAN_INTERVAL = 60
POLLING_TIMEOUT = 10
API_TIMEOUT = 5
DEFAULT_MIN_TEMP = 18.5
DEFAULT_MAX_TEMP = 40
# the device doesn't remember any state for the light, so we have to choose a
# mode (smarttu... | {
"content_hash": "476146507f1fb2536fa112a8b2b8db3e",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 77,
"avg_line_length": 21.333333333333332,
"alnum_prop": 0.7309027777777778,
"repo_name": "adrienbrault/home-assistant",
"id": "23bd8bd8ec0da3b1d8e91d4bff5f8154c027ae67",
"... |
import logging
from five import grok
from zope import schema
from plone.directives import dexterity, form
from plone.dexterity.content import Container
from vfu.events import MessageFactory as _
class IVFUMemberEvent(form.Schema):
"""
Event info
"""
available = schema.Bool(title=_(u'Available'),... | {
"content_hash": "ed2e9d9fe4a0bf812ba7ae3de39dbbc5",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 80,
"avg_line_length": 22.263157894736842,
"alnum_prop": 0.75177304964539,
"repo_name": "a25kk/vfu",
"id": "d1843edab3e4881c45cd8f7f1307259d9727b04a",
"size": "423",
"bin... |
from django.conf import settings # import the settings file
def display_name(request):
# return the value you want as a dictionary. you may add multiple values in there.
return {'DISPLAY_NAME': settings.DISPLAY_NAME}
def config_installed(request):
if 'config' in settings.INSTALLED_APPS:
return {'C... | {
"content_hash": "8fa4df9e6a1aa61ceecbf09a2cd7142a",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 86,
"avg_line_length": 33.083333333333336,
"alnum_prop": 0.707808564231738,
"repo_name": "chasetb/sal",
"id": "2b75b25b00110670d7fc09df612cfd43e05c503a",
"size": "397",
"... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.