text stringlengths 4 1.02M | meta dict |
|---|---|
import unittest
from webkitpy.common.net.statusserver import StatusServer
from webkitpy.common.system.outputcapture import OutputCaptureTestCaseBase
from webkitpy.common.net.web_mock import MockBrowser
class StatusServerTest(OutputCaptureTestCaseBase):
def test_url_for_issue(self):
mock_browser = MockBro... | {
"content_hash": "680a2af6fe806f234ccfac688a8fd562",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 74,
"avg_line_length": 44.733333333333334,
"alnum_prop": 0.7406855439642325,
"repo_name": "leighpauls/k2cro4",
"id": "1f0afd05bb7c0009e8a34fdbdba171787bc2a661",
"size": "22... |
from crawlers import FDroidCrawler, PlayCrawler
class Crawler:
"""Crawler that combines Google Play and F-Droid crawlers
to fill in a given database"""
def __init__(self, db):
self.db = db
def crawl_gplay(self):
"""Crawls the Google Play website updating the database
wit... | {
"content_hash": "8c9386da8f8447f89a1e9c64b67291c6",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 73,
"avg_line_length": 32.525,
"alnum_prop": 0.5872405841660261,
"repo_name": "Open-App-Categorizer/PkgCat-Crawler",
"id": "a4d959d679af872710aef35cff9acbea4d922ba6",
"size... |
"""WebSocket client for asyncio."""
import asyncio
import json
import async_timeout
from .client_exceptions import ClientError
from .helpers import PY_352, call_later, create_future
from .http import (WS_CLOSED_MESSAGE, WS_CLOSING_MESSAGE, WebSocketError,
WSMessage, WSMsgType)
class ClientWebSoc... | {
"content_hash": "b398091fd3e3deb549e52ac7e5fb7e5a",
"timestamp": "",
"source": "github",
"line_count": 271,
"max_line_length": 79,
"avg_line_length": 33.18819188191882,
"alnum_prop": 0.5284634200578163,
"repo_name": "playpauseandstop/aiohttp",
"id": "0b8bed63a2584d88e9c610ca9fd008af097e9ecb",
"siz... |
from ydk.ext.path import Annotation
from ydk.ext.path import Capability
from ydk.ext.path import Codec
from ydk.ext.path import DataNode
from ydk.ext.path import Repository
from ydk.ext.path import RootSchemaNode
from ydk.ext.path import Rpc
from ydk.ext.path import SchemaNode
from ydk.ext.path import Statement
from .... | {
"content_hash": "1a6b3464cff17890529c313e4566160d",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 39,
"avg_line_length": 28.125,
"alnum_prop": 0.6444444444444445,
"repo_name": "CiscoDevNet/ydk-gen",
"id": "18bb5abdb6ff53cfd8db5e8344c847f9042e9bef",
"size": "1389",
"bi... |
""" MMBT configuration """
from ...utils import logging
logger = logging.get_logger(__name__)
class MMBTConfig(object):
"""
This is the configuration class to store the configuration of a :class:`~transformers.MMBTModel`. It is used to
instantiate a MMBT model according to the specified arguments, defi... | {
"content_hash": "0de72922d1e1304386411914c18c2b4d",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 115,
"avg_line_length": 37.148148148148145,
"alnum_prop": 0.6590229312063809,
"repo_name": "huggingface/pytorch-transformers",
"id": "bbb6c9d240e99e6e1267de72d12ee741109943a2... |
"""Script for updating the project settings for a chromium branch.
To initialize a new chromium branch, run the following from the root of
the repo (where MM is the milestone number and BBBB is the branch
number):
```
infra/config/scripts/branch.py initialize --milestone MM --branch BBBB
infra/config/main.star
infra/c... | {
"content_hash": "995aebf7105ff2e26ccbdbfdbc30ab96",
"timestamp": "",
"source": "github",
"line_count": 111,
"max_line_length": 78,
"avg_line_length": 27.405405405405407,
"alnum_prop": 0.6738987508218277,
"repo_name": "chromium/chromium",
"id": "fac6016317fa7aa3dce25b736eb42ed2d3adabda",
"size": "3... |
from django.views.generic.base import TemplateView
from users.mixins import AdminRequiredMixin
class FoodNewView(AdminRequiredMixin, TemplateView):
template_name = 'food/new.html'
| {
"content_hash": "8428d5b20341540c1a18ff649402e05f",
"timestamp": "",
"source": "github",
"line_count": 7,
"max_line_length": 52,
"avg_line_length": 26.857142857142858,
"alnum_prop": 0.8085106382978723,
"repo_name": "jupiny/MIDASChallenge2017",
"id": "a88994b62c3ff635621c669b0ce3e9382ee223c4",
"siz... |
"""
Given a binary tree, flatten it to a linked list in-place.
For example,
Given
1
/ \
2 5
/ \ \
3 4 6
The flattened tree should look like:
1
\
2
\
3
\
4
\
5
\
6
If you notice carefull... | {
"content_hash": "29939a9a07a6f65d30ea89e1281dd206",
"timestamp": "",
"source": "github",
"line_count": 64,
"max_line_length": 120,
"avg_line_length": 18.171875,
"alnum_prop": 0.5812553740326741,
"repo_name": "Ahmed--Mohsen/leetcode",
"id": "cb304e8db5f2f479f996dc2348b0995efbfe0386",
"size": "1163"... |
import logging
import sys
from collections import defaultdict
from datetime import datetime
from operator import attrgetter
from time import time
from typing import List, Optional, Tuple, Union
from urllib.parse import quote
# Using `from elasticsearch import *` would break elasticsearch mocking used in unit test.
imp... | {
"content_hash": "0cc133d695e514735c70f1c5e050e91c",
"timestamp": "",
"source": "github",
"line_count": 355,
"max_line_length": 128,
"avg_line_length": 38.7830985915493,
"alnum_prop": 0.6100377687391052,
"repo_name": "mistercrunch/airflow",
"id": "c2b041e03836383a272d0eaf5041bfb1d6f29887",
"size": ... |
from distutils.core import setup
setup(
name='django-qrauth',
version='0.1.2',
author='aruseni',
author_email='aruseni.magiku@gmail.com',
packages=['qrauth'],
url='https://github.com/aruseni/django-qrauth',
license='BSD licence, see LICENCE.md',
description=('Nice QR codes that allow th... | {
"content_hash": "ec7071f1e45105aa36a91268a7f67ad8",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 68,
"avg_line_length": 33.375,
"alnum_prop": 0.6441947565543071,
"repo_name": "aruseni/django-qrauth",
"id": "3af9fcb07ee7d0a810261fc9b615241a7575a69c",
"size": "557",
"b... |
import curses
import numpy as np
from npi.core import Program, IntegerArguments, NPIStep, StepOutput, StepInput, StepInOut
__author__ = 'k_morishita'
class Screen:
data = None
def __init__(self, height, width):
self.height = height
self.width = width
self.init_screen()
def init... | {
"content_hash": "4f794b7c00214d439eb2d6fe9774f9c2",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 113,
"avg_line_length": 34.23699421965318,
"alnum_prop": 0.5912544318757387,
"repo_name": "mokemokechicken/keras_npi",
"id": "670fdbf28f17bee1844ee4a7f31eaecdcda2832e",
"s... |
"""Support for Oncue sensors."""
from __future__ import annotations
from aiooncue import OncueDevice, OncueSensor
from homeassistant.helpers import device_registry as dr
from homeassistant.helpers.entity import DeviceInfo, Entity, EntityDescription
from homeassistant.helpers.update_coordinator import (
Coordinato... | {
"content_hash": "bc3a49f1dab4f9ed312ed744924585a9",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 78,
"avg_line_length": 35.6530612244898,
"alnum_prop": 0.6571265025758443,
"repo_name": "GenericStudent/home-assistant",
"id": "40ca21edf96aecb4e45fbaa7589fb3dd496c1c8d",
"... |
from __future__ import unicode_literals
from datetime import datetime
from dateutil import rrule
import pytz
import random
from django.core.urlresolvers import reverse_lazy
from django.shortcuts import redirect
from django.utils.translation import ugettext_lazy as _
from django.views.generic import View
from dash.or... | {
"content_hash": "e5449c221e611768e8b21f3a076f7eea",
"timestamp": "",
"source": "github",
"line_count": 192,
"max_line_length": 120,
"avg_line_length": 46.036458333333336,
"alnum_prop": 0.6169249915148772,
"repo_name": "xkmato/tracpro",
"id": "24d360f9591110f58f3bd7b00eeff087926052ec",
"size": "883... |
from setuptools import setup
import os
PROJECT_ROOT, _ = os.path.split(__file__)
REVISION = '0.2.28'
PROJECT_NAME = 'JenkinsAPI'
PROJECT_AUTHORS = "Salim Fadhley, Aleksey Maksimov"
# Please see readme.rst for a complete list of contributors
PROJECT_EMAILS = 'salimfadhley@gmail.com, ctpeko3a@gmail.com'
PROJECT_URL = "h... | {
"content_hash": "40eb29c4323eab0016d54c0bbb3919eb",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 102,
"avg_line_length": 33.698113207547166,
"alnum_prop": 0.6668533034714446,
"repo_name": "JohnLZeller/jenkinsapi",
"id": "20eda5ed76ec3c6a5f3b90fafd842f41c9e2b5f1",
"size... |
from django.conf.urls import include, url
from django.contrib import admin
from newsapp import views,auth #from local module import views
urlpatterns = [
url(r'^$', views.articles_list,name='articles_list'),
url(r'^feeds/new', views.new_feed, name='feed_new'),
url(r'^feeds/', views.feeds_list,name='feeds_li... | {
"content_hash": "d20ee071aeb928e32a61fc9ef5a60c6b",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 62,
"avg_line_length": 44.5,
"alnum_prop": 0.6647940074906367,
"repo_name": "khansrk/newsappsrk",
"id": "0a2a432c50130d04cb8b824261e1bfc333b6540d",
"size": "534",
"binary... |
"""An Application for launching a kernel"""
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
from __future__ import print_function
import atexit
import os
import sys
import signal
import zmq
from zmq.eventloop import ioloop
from zmq.eventloop.zmqstream import ZMQS... | {
"content_hash": "8dcfaf96de46999623529dfc678dd467",
"timestamp": "",
"source": "github",
"line_count": 403,
"max_line_length": 101,
"avg_line_length": 38.68982630272953,
"alnum_prop": 0.6142252437147255,
"repo_name": "bdh1011/wau",
"id": "719bb560244345f16df96324268a31f4e607c17b",
"size": "15592",... |
from __future__ import unicode_literals
import frappe
from frappe.translate import get_lang_dict
# migrate language from name to code
def execute():
return
| {
"content_hash": "9e9504a02b4dcddf1c5df191f87a8f86",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 42,
"avg_line_length": 19.875,
"alnum_prop": 0.779874213836478,
"repo_name": "adityahase/frappe",
"id": "d685fd7d0e9a0aef3aeab11c4859f7a90ec04ddb",
"size": "159",
"binary"... |
__author__ = 'nlivni'
import django
from django.conf.urls import patterns, url
from models import Story
from panews.views import StoryDetailView, StoryListView, StoryTemplateCreate, StoryDelete, StoryUpdate, CategoryListView, StoryCustom, StorySuccessView
django.setup()
urlpatterns = patterns('',
# url(r'^$', 'pan... | {
"content_hash": "2fecacf1484169c37294b9116ddaa346",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 151,
"avg_line_length": 34.48275862068966,
"alnum_prop": 0.5905,
"repo_name": "nlivni/passiveaggressivenews_project",
"id": "f63a4cc5603b10e881c137421844151171a401de",
"siz... |
"""Define tests for the Elexa Guardian config flow."""
from aioguardian.errors import GuardianError
from homeassistant import data_entry_flow
from homeassistant.components.guardian import CONF_UID, DOMAIN
from homeassistant.components.guardian.config_flow import (
async_get_pin_from_discovery_hostname,
async_g... | {
"content_hash": "1bea5bf4c37ef2d1bc2a8466d4a4893c",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 85,
"avg_line_length": 35.114285714285714,
"alnum_prop": 0.6517493897477624,
"repo_name": "titilambert/home-assistant",
"id": "91a1a3b83e0d2f4f4e6db5d423aa22c4a7b489aa",
"... |
"""Export and import material meshes."""
import bpy
import nose.tools
from pyffi.formats.nif import NifFormat
from test import SingleNif
from test.geometry.trishape import gen_geometry
from test.geometry.trishape.test_geometry import TestBaseGeometry
from test.property.material.gen_material import Material
class Te... | {
"content_hash": "b0522bb460bbcb0dfe4c9a7403a82d91",
"timestamp": "",
"source": "github",
"line_count": 144,
"max_line_length": 91,
"avg_line_length": 35.90972222222222,
"alnum_prop": 0.6265712628118353,
"repo_name": "amorilia/blender_nif_plugin",
"id": "2351975da697d6333b41051b8288ba23dd7919bf",
"... |
import inspect
from functools import wraps
from peeringdb.resource import RESOURCES_BY_TAG
def reftag_to_cls(fn):
"""
decorator that checks function arguments for `concrete` and `resource`
and will properly set them to class references if a string (reftag) is
passed as the value
"""
spec = in... | {
"content_hash": "3135762bb090070e6e96b43207802652",
"timestamp": "",
"source": "github",
"line_count": 493,
"max_line_length": 80,
"avg_line_length": 23.787018255578094,
"alnum_prop": 0.5736334953526051,
"repo_name": "peeringdb/peeringdb-py",
"id": "7983a6890d8c0c23630452707e6753c7ff5c442a",
"size... |
import unittest
import amulet
class TestDeploy(unittest.TestCase):
"""
Trivial deployment test for Apache Zeppelin.
This charm cannot do anything useful by itself, so integration testing
is done in the bundle.
"""
def test_deploy(self):
self.d = amulet.Deployment(series='trusty')
... | {
"content_hash": "2c4b77afb226fac4a28b20c340d416a7",
"timestamp": "",
"source": "github",
"line_count": 24,
"max_line_length": 74,
"avg_line_length": 26.666666666666668,
"alnum_prop": 0.634375,
"repo_name": "andrewdmcleod/layer-apache-spark-livy",
"id": "7eee23ba85099bdf07a53adac4f1fc3fad4dd9f8",
"... |
class Klass(object):
def just_meth(self):
print("just_meth", self)
@classmethod
def klas_meth(kls):
print("klas_meth", kls)
@staticmethod
def stat_meth():
print("stat_meth")
| {
"content_hash": "8dbd917a1cb8f6cef268f56aa0186876",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 32,
"avg_line_length": 18.416666666666668,
"alnum_prop": 0.5656108597285068,
"repo_name": "dhilipsiva/test",
"id": "020b79a573a8650094afc7082df8b1196c80e654",
"size": "221"... |
from typing import Any
from unittest.mock import patch
import ujson
from django.http import HttpResponse
from zerver.lib.test_classes import ZulipTestCase
from zerver.lib.users import get_api_key
from zerver.models import get_realm, get_user
class ZephyrTest(ZulipTestCase):
def test_webathena_kerberos_login(sel... | {
"content_hash": "c3dfe0377481c4f1e8290b6996923ac7",
"timestamp": "",
"source": "github",
"line_count": 98,
"max_line_length": 84,
"avg_line_length": 35.204081632653065,
"alnum_prop": 0.5753623188405798,
"repo_name": "shubhamdhama/zulip",
"id": "dae495d455759467aa11c1ec65ae20ab2548f126",
"size": "3... |
from __future__ import annotations
from abc import ABC, abstractmethod
from typing import List, Optional
import discord
from redbot.core import Config
from redbot.core.bot import Red
class MixinMeta(ABC):
"""
Metaclass for well behaved type hint detection with composite class.
"""
# https://github.... | {
"content_hash": "fc995db33e820a8ad184092360c98056",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 75,
"avg_line_length": 25.67241379310345,
"alnum_prop": 0.6574882471457354,
"repo_name": "mikeshardmind/SinbadCogs",
"id": "2ebfd8720abc5e01ec7c32a61be3b68a19f5e0e7",
"size... |
import os
import sys
#current_dir = 'D:/2013_a/WHI_UBCSP2/Binary'#
for root, dirs, files in os.walk(current_dir, topdown=False):
for name in files:
if name.endswith('.sp2b'):
print name
os.remove(os.path.join(root, name))
| {
"content_hash": "50d1a15313844df4c3a5da1ecd0fb7f0",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 61,
"avg_line_length": 20.75,
"alnum_prop": 0.6465863453815262,
"repo_name": "annahs/atmos_research",
"id": "b6b7709d0a53efb9020574a46390a09d5ff23691",
"size": "249",
"bi... |
'''This file generates shell code for the setup.SHELL scripts to set environment variables'''
from __future__ import print_function
import argparse
import copy
import errno
import os
import platform
import sys
CATKIN_MARKER_FILE = '.catkin'
system = platform.system()
IS_DARWIN = (system == 'Darwin')
IS_WINDOWS = (sy... | {
"content_hash": "03488a62715646b7a8473bcda3e8581d",
"timestamp": "",
"source": "github",
"line_count": 253,
"max_line_length": 213,
"avg_line_length": 42.1699604743083,
"alnum_prop": 0.6403599212672227,
"repo_name": "MRSDTeamI/bud-e",
"id": "74303d2730d7a27ff50db056939eeae499b3b3c0",
"size": "1229... |
import string
INDENT = ' '
KEYWORDS = ['auto',
'break',
'case',
'char',
'const',
'continue',
'default',
'do',
'double',
'else',
'enum',
'extern',
'float',
'for... | {
"content_hash": "d5b68321a8d252dbb523787278c50bc5",
"timestamp": "",
"source": "github",
"line_count": 252,
"max_line_length": 120,
"avg_line_length": 30.11111111111111,
"alnum_prop": 0.507380073800738,
"repo_name": "Samsung/ADBI",
"id": "9ff16cc272c0342455933789db0fd4451eb65b78",
"size": "7588",
... |
import os
from ingenico.connect.sdk.factory import Factory
class GetMandateExample(object):
def example(self):
with self.__get_client() as client:
response = client.merchant("merchantId").mandates().get("42268d8067df43e18a50a2ebf4bdb729")
def __get_client(self):
api_key_id = os.... | {
"content_hash": "bb567a3647e978b1933d8afc520c6884",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 103,
"avg_line_length": 45.833333333333336,
"alnum_prop": 0.6060606060606061,
"repo_name": "Ingenico-ePayments/connect-sdk-python2",
"id": "4cc1f7772a81dda2ef9e3b1bde62ace58f... |
from pyramid.config import Configurator
from pyramid.authorization import ACLAuthorizationPolicy as ACLPolicy
from pyramid.session import UnencryptedCookieSessionFactoryConfig
from pyramid.interfaces import IBeforeRender
from pyramid.events import NewRequest
from .security import groupfinder, RootFactory
from .config... | {
"content_hash": "65b633d40251fec9b656864861ae94e1",
"timestamp": "",
"source": "github",
"line_count": 45,
"max_line_length": 78,
"avg_line_length": 35.55555555555556,
"alnum_prop": 0.690625,
"repo_name": "doyousoft/pyvac",
"id": "bf78e11b9d7f26f9c23424e3c2ed539cb4d96c79",
"size": "1624",
"binar... |
"""
.. versionadded:: 0.1
.. versionchanged:: 1.2.0
The normalized least-mean-square (NLMS) adaptive filter
is an extension of the popular LMS adaptive filter (:ref:`filter-lms`).
The NLMS filter can be created as follows
>>> import padasip as pa
>>> pa.filters.FilterNLMS(n)
where `n` is the size (number of... | {
"content_hash": "e9564c520553ac0ef62c41d5b44d6318",
"timestamp": "",
"source": "github",
"line_count": 164,
"max_line_length": 75,
"avg_line_length": 27.926829268292682,
"alnum_prop": 0.5989082969432314,
"repo_name": "matousc89/padasip",
"id": "e2849af9e57bc32ac8e8e84cdf6954f6ded34964",
"size": "4... |
import mock
import os
from fuel_upgrade.tests.base import BaseTestCase
from fuel_upgrade.pre_upgrade_hooks.base import PreUpgradeHookBase
from fuel_upgrade.pre_upgrade_hooks.from_5_0_1_to_any_fix_host_system_repo \
import FixHostSystemRepoHook
from fuel_upgrade.pre_upgrade_hooks.from_5_0_to_any_add_credentials \
... | {
"content_hash": "cd4375b346c83e32d91537fcd10f8bd2",
"timestamp": "",
"source": "github",
"line_count": 381,
"max_line_length": 78,
"avg_line_length": 34.79265091863517,
"alnum_prop": 0.616852745926373,
"repo_name": "Axam/nsx-web",
"id": "da2f77a6592c0bb9f2faa62c0b293199ea0bcdb1",
"size": "13892",
... |
"""take out the volumne outliers in an image"""
import nibabel as nib
import matplotlib.pyplot as plt
import numpy as np
import numpy.linalg as npl
from itertools import product
import diagnostics
reload(diagnostics)
img=nib.load('ds005/sub001/BOLD/task001_run001/bold.nii')
data=img.get_data()
"""get std"""
volstd ... | {
"content_hash": "efc1d911c6e51c84c0b8463a1a8f80d2",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 57,
"avg_line_length": 16.56,
"alnum_prop": 0.7584541062801933,
"repo_name": "soazig/project-epsilon",
"id": "5f22f02d6b89cc604de96af1fd4dc06c36387f30",
"size": "414",
"b... |
"""Tests for GRU V2 layer."""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import copy
import os
import shutil
from absl.testing import parameterized
import numpy as np
from tensorflow.core.protobuf import config_pb2
from tensorflow.core.protobuf impor... | {
"content_hash": "b57ddf3ab753945fe8e31cef38d82cb7",
"timestamp": "",
"source": "github",
"line_count": 820,
"max_line_length": 80,
"avg_line_length": 36.201219512195124,
"alnum_prop": 0.6555162540003369,
"repo_name": "petewarden/tensorflow",
"id": "3b6e8459507a0cccc34c118bb67859a1744d2e59",
"size"... |
"""
Created on Thu Apr 27 12:16:26 2017
@author: Anand A Joshi, Divya Varadarajan
"""
import sys
from os import system
from os.path import isfile, split
from multiprocessing import Pool
from contextlib import closing
import configparser
import glob
#config_file = '/big_disk/ajoshi/coding_ground/\
#brainsuite-workflow... | {
"content_hash": "7cef839480cecb22a14ab863ee866886",
"timestamp": "",
"source": "github",
"line_count": 94,
"max_line_length": 79,
"avg_line_length": 28.03191489361702,
"alnum_prop": 0.6428842504743834,
"repo_name": "ajoshiusc/brainsuite-workflows",
"id": "9e7aafab8bf542ddd2ea7122f4ffc33a82570041",
... |
from unittest import TestCase
from src.couchdb import CouchDB
class TestDatabaseVersion(TestCase):
def test_simple_parse(self):
ver = CouchDB.DatabaseVersion("1.2.3")
self.assertTrue(ver.valid)
self.assertEqual("1.2.3", ver.version)
self.assertEqual(1, ver.major)
self.asse... | {
"content_hash": "2630a009f2c2358cc59272122dde002f",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 48,
"avg_line_length": 29.72093023255814,
"alnum_prop": 0.6471048513302035,
"repo_name": "RipcordSoftware/avancedb-replication-monitor",
"id": "7f1fcd5b941c9a004f6af93deba411... |
from django.contrib import admin
# Register your models here.
from django.contrib import admin
from .models import Link, Vote
class LinkAdmin(admin.ModelAdmin): pass
admin.site.register(Link, LinkAdmin)
class VoteAdmin(admin.ModelAdmin): pass
admin.site.register(Vote, VoteAdmin)
| {
"content_hash": "e826f01e29a5b54a3f3756fb3c7739f9",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 39,
"avg_line_length": 23.666666666666668,
"alnum_prop": 0.8028169014084507,
"repo_name": "project-musashi/GTR",
"id": "24f46be57712b018e90e190b4ea62741d218c7f9",
"size": "... |
"""
The Plaid API
The Plaid REST API. Please see https://plaid.com/docs/api for more details. # noqa: E501
Generated by: https://openapi-generator.tech
"""
import re # noqa: F401
import sys # noqa: F401
from plaid.model_utils import ( # noqa: F401
ApiTypeError,
ModelComposed,
ModelNormal... | {
"content_hash": "8d9465bc8560928aa9ab38045bb51a5a",
"timestamp": "",
"source": "github",
"line_count": 182,
"max_line_length": 110,
"avg_line_length": 41.08791208791209,
"alnum_prop": 0.5509494517250602,
"repo_name": "plaid/plaid-python",
"id": "b2d8396b3cacfa6137a6a46fec3bfd4bf6094aae",
"size": "... |
import specs.fmt as fmt
import specs.folly as folly
import specs.gmock as gmock
import specs.sodium as sodium
import specs.zstd as zstd
def fbcode_builder_spec(builder):
builder.add_option(
"fizz/fizz/build:cmake_defines",
{
# Fizz's build is kind of broken, in the sense that both `mvf... | {
"content_hash": "8632fa40dfc8bdbab5d51d29ccae26c9",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 76,
"avg_line_length": 30.04,
"alnum_prop": 0.5818908122503329,
"repo_name": "facebook/bistro",
"id": "7bde4e6efa03026fdaa7b0f457bed340b6f9f531",
"size": "825",
"binary":... |
"""Support for Minut Point."""
import asyncio
import logging
from pypoint import PointSession
import voluptuous as vol
from homeassistant import config_entries
from homeassistant.config_entries import ConfigEntry
from homeassistant.const import (
CONF_CLIENT_ID,
CONF_CLIENT_SECRET,
CONF_TOKEN,
CONF_WE... | {
"content_hash": "23aaddbf99a5916c6cc36feb13e83f13",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 84,
"avg_line_length": 31.674285714285713,
"alnum_prop": 0.6189788922965903,
"repo_name": "adrienbrault/home-assistant",
"id": "e5c209004de14a86afb6fa8eb3a092ef09a6e91a",
... |
import abc
import numpy as np
import tensorflow as tf
import tensorflow.keras.regularizers as regularizers
from rudders.relations import Relations
from rudders.math.euclid import apply_rotation, apply_reflection
class CFModel(tf.keras.Model, abc.ABC):
"""Abstract collaborative filtering embedding model class.
... | {
"content_hash": "6f62e0ad78530ffa4f02a81f189aa45f",
"timestamp": "",
"source": "github",
"line_count": 420,
"max_line_length": 114,
"avg_line_length": 47.707142857142856,
"alnum_prop": 0.6281878524729251,
"repo_name": "PAIR-code/recommendation-rudders",
"id": "fd98219c79a9d87fafd5dc6ddd68e302a0d65a9... |
"""
Django settings for running tests for Resolwe package.
"""
import os
import re
import sys
from distutils.util import strtobool # pylint: disable=import-error,no-name-in-module
PROJECT_ROOT = os.path.abspath(os.path.dirname(__file__))
SECRET_KEY = "secret"
# TODO: Remove this setting completely and only set it... | {
"content_hash": "6313f84add198679e495196eff6e880c",
"timestamp": "",
"source": "github",
"line_count": 295,
"max_line_length": 118,
"avg_line_length": 31.664406779661018,
"alnum_prop": 0.6527138422010491,
"repo_name": "genialis/resolwe-bio",
"id": "7284764d2cbaf9492f01357499cabae1528aebbc",
"size"... |
import arcpy
arcpy.env.workspace = r"PATH"
# function that converts numbers to 3 char strings
def fun(x):
if (x < 10):
return '00' + str(x)
elif (x < 100):
return '0' + str(x)
else:
return str(x)
count = 0
for s in arcpy.ListFiles('*.shp'):
print s
# add new fields
arcpy.AddField_management(s, "CMA_... | {
"content_hash": "344eaa950dbd36cf461c7d94a553b867",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 60,
"avg_line_length": 20.302325581395348,
"alnum_prop": 0.6002290950744559,
"repo_name": "jamaps/arcpy_scripts",
"id": "632fb75a475686868f00e723ca64743955d3a6b4",
"size": ... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('structure', '0017_structure_contact_representative_score'),
]
operations = [
migrations.AddField(
model_name='structure',
name='active_class_contacts_fraction',
... | {
"content_hash": "ccb2ba8655c1654fff21264e072253e1",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 81,
"avg_line_length": 29.80952380952381,
"alnum_prop": 0.6118210862619808,
"repo_name": "protwis/protwis",
"id": "e5b7725706ed8453e605b7d74291ac47159cebd0",
"size": "675",... |
import difflib
import re
import time
import token
from tokenize import generate_tokens, untokenize
from StringIO import StringIO
from robot.api import logger
from robot.errors import (ContinueForLoop, DataError, ExecutionFailed,
ExecutionFailures, ExecutionPassed, ExitForLoop,
... | {
"content_hash": "f374f0c691f5aae5afc5ef985c02f16d",
"timestamp": "",
"source": "github",
"line_count": 3146,
"max_line_length": 123,
"avg_line_length": 45.10584869675779,
"alnum_prop": 0.6018900234667344,
"repo_name": "rwarren14/robotframework",
"id": "01b2887fb101a8feda0d06ec2e9862b4f58cd184",
"s... |
"""This example gets the Marketplace comments for a programmatic proposal."""
# Import appropriate modules from the client library.
from datetime import datetime
from googleads import ad_manager
PROPOSAL_ID = 'INSERT_PROPOSAL_ID_HERE'
def main(client, proposal_id):
# Initialize appropriate service.
marketplac... | {
"content_hash": "ced29db8b18303fb11a26b8f71a3d04e",
"timestamp": "",
"source": "github",
"line_count": 40,
"max_line_length": 77,
"avg_line_length": 37.5,
"alnum_prop": 0.6586666666666666,
"repo_name": "Aloomaio/googleads-python-lib",
"id": "3dc4943fdf907f05a94568f55036a1defa2fdb43",
"size": "2122... |
import datetime
import json
from warnings import warn
from sdcclient._common import _SdcCommon
class PolicyEventsClientOld(_SdcCommon):
def __init__(self, token="", sdc_url='https://secure.sysdig.com', ssl_verify=True, custom_headers=None):
super(PolicyEventsClientOld, self).__init__(token, sdc_url, ssl_... | {
"content_hash": "c94450db441c916d728116c3c44a0774",
"timestamp": "",
"source": "github",
"line_count": 212,
"max_line_length": 432,
"avg_line_length": 70.69339622641509,
"alnum_prop": 0.6505638219790485,
"repo_name": "draios/python-sdc-client",
"id": "a5a316d19d5bad5413f60942002c3eaed1cb591d",
"si... |
import sqlite3, json, csv
pnr96path = '../pnr96/pnr96-streets.json'
municipalities_path = '../data/kommuner.csv'
p2k_path = '../postort2kommun.csv'
db = sqlite3.connect('pnr96.sqlite')
db.text_factory = str
c = db.cursor()
c.execute('''CREATE TABLE pnr96 (
streetName VARCHAR(255) NOT NULL,
postalCode INTEGER NOT NU... | {
"content_hash": "ed6edf539d0973bd5d614bb5684b2aa5",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 106,
"avg_line_length": 30.86764705882353,
"alnum_prop": 0.6874702239161505,
"repo_name": "samuellb/pnr96addrstats",
"id": "ca9097de5e66103d9bbd20d8e8edaae9a35a51cd",
"size... |
from .dist_math import *
__all__ = ['Binomial', 'BetaBin', 'Bernoulli', 'Poisson', 'NegativeBinomial',
'ConstantDist', 'ZeroInflatedPoisson', 'DiscreteUniform', 'Geometric',
'Categorical']
class Binomial(Discrete):
"""
Binomial log-likelihood. The discrete probability distribution
of the number of su... | {
"content_hash": "80610eb8d7d9fd7a8596cc2eaee20602",
"timestamp": "",
"source": "github",
"line_count": 326,
"max_line_length": 194,
"avg_line_length": 26.631901840490798,
"alnum_prop": 0.5187744759272057,
"repo_name": "nmmarquez/pymc",
"id": "fa78baa11fb4030b57548638e4c36eb92321b2a0",
"size": "868... |
import sys
import os
import json
import cStringIO
import tempfile
import logging
import traceback
import codecs
import math
import textprocessor
from collections import Counter
from lib.stemutil import stem
class WordCloud(textprocessor.TextProcessor):
"""
Generate word cloud
"""
def _basic_params(s... | {
"content_hash": "3cd96672a8ab0e761642386797f5f2dc",
"timestamp": "",
"source": "github",
"line_count": 140,
"max_line_length": 102,
"avg_line_length": 33.628571428571426,
"alnum_prop": 0.526338147833475,
"repo_name": "ChristianFrisson/papermachines",
"id": "388ff5374275f962306d59e2d938170d6625e87e",... |
import datetime
import glob
import json
import logging
import os
import re
import shutil
import socket
import subprocess
import sys
import work_queue as wq
from collections import defaultdict, Counter
from hashlib import sha1
from lobster import fs, util
from lobster.cmssw import dash
from lobster.core import unit
fr... | {
"content_hash": "e50de8464f97da6b8aef44b1138a985e",
"timestamp": "",
"source": "github",
"line_count": 582,
"max_line_length": 120,
"avg_line_length": 40.9106529209622,
"alnum_prop": 0.5524989500209996,
"repo_name": "matz-e/lobster",
"id": "11c51fcf7c5e2e59273d7a0cb6331fed23f31c9c",
"size": "23810... |
"""djangoTestAPI URL Configuration
The `urlpatterns` list routes URLs to views. For more information please see:
https://docs.djangoproject.com/en/1.11/topics/http/urls/
Examples:
Function views
1. Add an import: from my_app import views
2. Add a URL to urlpatterns: url(r'^$', views.home, name='home')
Cl... | {
"content_hash": "7adafc59c7210923fa14a427300252f1",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 79,
"avg_line_length": 29.23076923076923,
"alnum_prop": 0.6885964912280702,
"repo_name": "DigitalTensionExperiment/DjangoTestAPI",
"id": "9e0c60d26cd73c8080b3764efc908e0eedf3... |
from __future__ import print_function
# Author: Sarah Knepper <sarah.knepper@intel.com>
# Copyright (c) 2015 Intel Corporation.
#
# Permission is hereby granted, free of charge, to any person obtaining
# a copy of this software and associated documentation files (the
# "Software"), to deal in the Software without restr... | {
"content_hash": "e57e27d890778d8dfc2bba02ed56f4e2",
"timestamp": "",
"source": "github",
"line_count": 49,
"max_line_length": 72,
"avg_line_length": 38.69387755102041,
"alnum_prop": 0.7078059071729957,
"repo_name": "stefan-andritoiu/upm",
"id": "b51e308a00e8f2453ce6dc70f61206c01ecba4b4",
"size": "... |
import pytest
@pytest.fixture
def pipeline_1():
return {
'schema_version': '1',
'status': 'active',
'title': 'Test pipeline',
}
@pytest.fixture
def pipeline_2(award, lab):
return {
'schema_version': '2',
'status': 'active',
'title': 'Test pipeline',
... | {
"content_hash": "f254b752e21eb62cee8e80b287f1733f",
"timestamp": "",
"source": "github",
"line_count": 52,
"max_line_length": 93,
"avg_line_length": 27.442307692307693,
"alnum_prop": 0.6012613875262789,
"repo_name": "T2DREAM/t2dream-portal",
"id": "b12e54c49c2b8b3e01de61890a08b97508dcc0f2",
"size"... |
"""
Supports flushing metrics to graphite
"""
import sys
import socket
import logging
class GraphiteStore(object):
def __init__(self, host="localhost", port=2003, prefix="statsite", attempts=3):
"""
Implements an interface that allows metrics to be persisted to Graphite.
Raises a :class:`V... | {
"content_hash": "2c5effb7f42e217069700e09db0c41c3",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 103,
"avg_line_length": 31.99,
"alnum_prop": 0.5804939043451078,
"repo_name": "atdt/statsite-pkg",
"id": "e8525dccb2b2e555057fc9662ce5a8ef40b38023",
"size": "3199",
"bin... |
import sys, os
import types
import re
import unittest
from StringIO import StringIO
import shutil
import svnmerge
import stat
import atexit
import getopt
import locale
####
# IMPORTANT NOTE TO TEST AUTHORS
#
# Any quoted strings inside the arguments of the parameter "cmd" must
# be enclosed in double-, not single-quot... | {
"content_hash": "4125743f2e095e71ee63e15bb3f878b1",
"timestamp": "",
"source": "github",
"line_count": 1411,
"max_line_length": 133,
"avg_line_length": 39.30474840538625,
"alnum_prop": 0.5797075316900774,
"repo_name": "YueLinHo/Subversion",
"id": "69c4dbccf8c1b82a52409e75f3aaf83c3857ad30",
"size":... |
try:
from queue import Queue as queue
except ImportError:
from queue import queue as queue
from queue import Full
import traceback
from graypy import GELFHandler
from threading import Thread
class AsyncGELFHandler(GELFHandler, Thread):
def __init__(self, *args, **kwargs):
max_queue_size = kwargs... | {
"content_hash": "cbeaeca7b51bbdfc76c92f37eca962fd",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 86,
"avg_line_length": 29.72093023255814,
"alnum_prop": 0.6001564945226917,
"repo_name": "listingmirror/async-gelf-handler",
"id": "e66c28c7abeaa65060bbb60fa2be0719d71ca30d",... |
from msrest.serialization import Model
class LoadMetricReportInfo(Model):
"""Information about load reported by replica.
:param name: The name of the metric.
:type name: str
:param value: The value of the load for the metric..
:type value: int
:param last_reported_utc: The UTC time when the l... | {
"content_hash": "bf2fccc62c739e6f06ca1f72e0135add",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 76,
"avg_line_length": 32.64,
"alnum_prop": 0.6151960784313726,
"repo_name": "lmazuel/azure-sdk-for-python",
"id": "2bca2bbd8bf9918e701cf781db1cc21f4276414c",
"size": "1290... |
"""Function for interpolating formatted errors from the TensorFlow runtime.
Exposes the function `interpolate` to interpolate messages with tags of the form
{{type name}}.
"""
from __future__ import absolute_import
from __future__ import division
from __future__ import print_function
import collections
import iterto... | {
"content_hash": "89b689b316d4459e98a00de4cc32bee9",
"timestamp": "",
"source": "github",
"line_count": 513,
"max_line_length": 80,
"avg_line_length": 34.278752436647174,
"alnum_prop": 0.6718794427068524,
"repo_name": "chemelnucfin/tensorflow",
"id": "0c6feb64008a58000f55da729c33815f7d6b9a84",
"siz... |
from django.contrib.auth import get_user_model
from django.contrib.auth.decorators import login_required
from django.shortcuts import render
from connect.discover.forms import FilterMemberForm
User = get_user_model()
@login_required
def dashboard(request):
"""
Shows all members as a list - with the capacity... | {
"content_hash": "f4050ff41518af6d57e4269ac91e0b7f",
"timestamp": "",
"source": "github",
"line_count": 72,
"max_line_length": 69,
"avg_line_length": 25.09722222222222,
"alnum_prop": 0.5915882678472607,
"repo_name": "f3r3nc/connect",
"id": "91e5f02f7c5a9733ef701cbf55cb038b83c3edd3",
"size": "1807",... |
from __future__ import absolute_import, unicode_literals
from gaebusiness.gaeutil import SaveCommand, ModelSearchCommand
from gaeforms.ndb.form import ModelForm
from gaegraph.business_base import UpdateNode
from cartaz_app.model import Cartaz
class CartazPublicForm(ModelForm):
"""
Form used to show properties ... | {
"content_hash": "1fabddd388ed3b1c228cedc4b0d11542",
"timestamp": "",
"source": "github",
"line_count": 68,
"max_line_length": 81,
"avg_line_length": 26.352941176470587,
"alnum_prop": 0.5970982142857143,
"repo_name": "luuhfelix/ProjetoFilmes",
"id": "5639e58f5f32cdc6e0021516dad7965d26190559",
"size... |
from __future__ import unicode_literals
from future.builtins import str
from django.contrib.admin.views.decorators import staff_member_required
from django.core.exceptions import ImproperlyConfigured
from django.http import HttpResponse, Http404
from django.shortcuts import get_object_or_404
from django.contrib import... | {
"content_hash": "fcb1d77fdb6ebce8b88b46f8f847ce98",
"timestamp": "",
"source": "github",
"line_count": 100,
"max_line_length": 79,
"avg_line_length": 45.02,
"alnum_prop": 0.6850288760550867,
"repo_name": "wbtuomela/mezzanine",
"id": "86d166796915c0dbc1e9bf34763080888bfeed1e",
"size": "4502",
"bi... |
'''
Control a salt cloud system
'''
from __future__ import absolute_import
# Import python libs
import json
# Import salt libs
import salt.utils
HAS_CLOUD = False
try:
import saltcloud # pylint: disable=W0611
HAS_CLOUD = True
except ImportError:
pass
# Define the module's virtual name
__virtualname__ = ... | {
"content_hash": "a8fc4de11b0a5155c0d6811a11f81586",
"timestamp": "",
"source": "github",
"line_count": 47,
"max_line_length": 103,
"avg_line_length": 21.46808510638298,
"alnum_prop": 0.643211100099108,
"repo_name": "stephane-martin/salt-debian-packaging",
"id": "4f6ef9fa3da110a0f8690bd1a684363063a22... |
from __future__ import absolute_import, unicode_literals, print_function, division
class ValidationError(Exception):
pass
class ChangingImmutableAttributeError(Exception):
pass
class ResolvedObjectNotFound(Exception):
def __init__(self, message=''):
self.message = message.capitalize() or 'Coul... | {
"content_hash": "f78d2af062e68bcae5d695fc3a76cf99",
"timestamp": "",
"source": "github",
"line_count": 18,
"max_line_length": 84,
"avg_line_length": 22.22222222222222,
"alnum_prop": 0.7425,
"repo_name": "felixbr/nosql-rest-preprocessor",
"id": "d1936e59b7f7f0c420f8dffb90bfc116f18cf3c8",
"size": "4... |
from django import forms
from haystack.forms import SearchForm
class MySearchForm(SearchForm):
q = forms.CharField(required=False, label='Query', widget=forms.TextInput(attrs={
'type': 'search',
'autocorrect': 'off',
'class': 'form-control',
'placeholder': 'Search jobs or organiza... | {
"content_hash": "668172d2bd070e47774b754dc8e7fdcb",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 85,
"avg_line_length": 32.074074074074076,
"alnum_prop": 0.5762124711316398,
"repo_name": "richardcornish/timgorin",
"id": "9b7852b0599a1963ec6f0a9ac14e483695f3a9b8",
"size... |
import sys
import requests
import json
from docopt import docopt
import utils
import transactions
import rlp
from . import __version__
from . config import read_config
config = read_config()
api_path = config.get('api', 'api_path')
assert api_path.startswith('/') and not api_path.endswith('/')
DEFAULT_HOST = config.... | {
"content_hash": "27a2f7e96c4885611fbe5270a3975117",
"timestamp": "",
"source": "github",
"line_count": 225,
"max_line_length": 93,
"avg_line_length": 37.413333333333334,
"alnum_prop": 0.589807555238774,
"repo_name": "joelcan/tools-eth-contract-dev",
"id": "9814d49fad2ee427cb675931960f5f9642fea1a6",
... |
"""
Command helper.
Copyright (c) 2013 learn_more
See the file license.txt or http://opensource.org/licenses/MIT for copying permission.
Lists all commands available to you (permission based).
"""
from commands import add, admin, commands as cmdlist, aliases as aliaslist
import fnmatch
def commands(connection, value... | {
"content_hash": "a890d05015780325a9655b4d73ff7422",
"timestamp": "",
"source": "github",
"line_count": 35,
"max_line_length": 86,
"avg_line_length": 28.8,
"alnum_prop": 0.6984126984126984,
"repo_name": "learn-more/pysnip-utils",
"id": "d0ba624181bb1c149614c68aeba5daeb5275f51e",
"size": "1008",
"... |
from django.conf import settings
from django.contrib import messages
from django.contrib import auth
# from django.contrib.auth import get_user_model, login
from django.contrib.auth import views as auth_views
from django.contrib.auth.decorators import login_required
from django.urls import reverse
from django.http impo... | {
"content_hash": "a491ae74e72a06a024e30e0e69c727d7",
"timestamp": "",
"source": "github",
"line_count": 207,
"max_line_length": 102,
"avg_line_length": 31.555555555555557,
"alnum_prop": 0.6736068585425597,
"repo_name": "pycontw/pycontw2016",
"id": "1d4993d0dfc81eef7852b5f963264db598806ca7",
"size":... |
import subprocess
from unittest import mock
from stestr import test_processor
from stestr.tests import base
class TestTestProcessorFixture(base.TestCase):
def setUp(self):
super().setUp()
self._fixture = test_processor.TestProcessorFixture(
mock.sentinel.test_ids,
mock.sen... | {
"content_hash": "dd74a628937887b8139fab109ff2640c",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 71,
"avg_line_length": 28.813953488372093,
"alnum_prop": 0.6182405165456013,
"repo_name": "mtreinish/stestr",
"id": "302932c75e36e4f1877d47608acc3b8c68ac6de8",
"size": "178... |
import unittest
from mopidy_gmusic import actor as backend_lib
from tests.test_extension import ExtensionTest
class LibraryTest(unittest.TestCase):
def setUp(self):
config = ExtensionTest.get_config()
self.backend = backend_lib.GMusicBackend(config, None)
def test_browse_radio_deactivated(... | {
"content_hash": "2286d59a2545d667198c4bfe099ea161",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 78,
"avg_line_length": 35.20952380952381,
"alnum_prop": 0.6159047876656749,
"repo_name": "elrosti/mopidy-gmusic",
"id": "911c965329dd0884dbea2d645148988192efb8df",
"size":... |
"""
General utilities module
"""
import os, time
import numpy as np
import matplotlib.pylab as plt
import matplotlib.cm as cm
import matplotlib.animation as animation
from configuration import get_config
config = get_config()
def animate_evolution(states, pacemakers, fname='lattice.gif', truncate=True):
""" ... | {
"content_hash": "a745fa4e81c9f8bf0f0d5b5365d83859",
"timestamp": "",
"source": "github",
"line_count": 118,
"max_line_length": 82,
"avg_line_length": 27.85593220338983,
"alnum_prop": 0.5841192576817767,
"repo_name": "kpj/PyWave",
"id": "6de23ce67710c8025e32aba5f96e854c05132ed3",
"size": "3287",
... |
import json
from datetime import date, timedelta
from django.contrib import messages
from django.contrib.contenttypes.models import ContentType
from django.http import (
HttpResponse,
HttpResponseRedirect
)
from django.shortcuts import get_object_or_404, render
from django.views.decorators.http import require_... | {
"content_hash": "74f52b9730e54f3a2d84b633834270fd",
"timestamp": "",
"source": "github",
"line_count": 726,
"max_line_length": 78,
"avg_line_length": 33.268595041322314,
"alnum_prop": 0.584192439862543,
"repo_name": "DESHRAJ/fjord",
"id": "68753b2210aec6809b4ba49babd2515b7566d52d",
"size": "24275"... |
"""
=====================================================================
Decision boundary of label propagation versus SVM on the Iris dataset
=====================================================================
Comparison for decision boundary generated on iris dataset
between Label Propagation and SVM.
This demon... | {
"content_hash": "7cd8d82a7e35675f445ea3806c25cf5c",
"timestamp": "",
"source": "github",
"line_count": 82,
"max_line_length": 73,
"avg_line_length": 28.9390243902439,
"alnum_prop": 0.594605983986515,
"repo_name": "cdegroc/scikit-learn",
"id": "d0d2e14ed342929c79b6492368813e0dfd057a77",
"size": "23... |
from ampy import *
from async import *
| {
"content_hash": "27b34678ea12f2f7cd2c740322828d6b",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 19,
"avg_line_length": 19.5,
"alnum_prop": 0.7435897435897436,
"repo_name": "HuFlungDu/huflungdu-ampy",
"id": "b2dc92d1b6375c7c832f1b3e91979a368e3ef09b",
"size": "210",
"b... |
from .nominal_behavior import NominalBehavior
from .store_flight_data import StoreFlightData
| {
"content_hash": "5b7044c094531544d4935232fce8f1d7",
"timestamp": "",
"source": "github",
"line_count": 2,
"max_line_length": 46,
"avg_line_length": 46.5,
"alnum_prop": 0.8602150537634409,
"repo_name": "interuss/dss",
"id": "3cef39d35387bc281d6772fd1b0939dd54c0cb97",
"size": "93",
"binary": false... |
from datetime import timedelta
import logging
# DJANGO
from django.conf import settings
from django.utils.timezone import now
# CELERY
from celery import task
# UTILS
from utils.slices import get_index_slice
# FBDATA
from fbdata.participant import get_participants
from fbdata.utils import padded_date_range
# ADDAT... | {
"content_hash": "880efbacbc8ddd70e54acd2cba81543f",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 80,
"avg_line_length": 36.4031007751938,
"alnum_prop": 0.6213798977853492,
"repo_name": "valuesandvalue/valuesandvalue",
"id": "e3a75e7e03ab3f7cfed4e07d79bbce0e1b07ff68",
... |
from distutils.core import setup
setup(
name = 'csv2kmz',
packages = ['csv2kmz'],
version = '0.1',
description = 'Converts a parsed csv file to a kmz Google Earth overlay.',
author = 'aguinane',
author_email = 'alexguinane@gmail.com',
url = 'https://github.com/aguinane/csv2kmz',
... | {
"content_hash": "9adfe42937c70782cfb22d21d5e4033b",
"timestamp": "",
"source": "github",
"line_count": 13,
"max_line_length": 78,
"avg_line_length": 30.53846153846154,
"alnum_prop": 0.5944584382871536,
"repo_name": "aguinane/csvtokmz",
"id": "6f1ffff5eaee3b86f2b982d8ceb7b3d6e01d27cf",
"size": "397... |
"""
===========================================
Tractography Clustering - Available Metrics
===========================================
This page lists available metrics that can be used by the tractography
clustering framework. For every metric a brief description is provided
explaining: what it does, when it's usefu... | {
"content_hash": "62e987e4d3c5b954c735c4c94de559ff",
"timestamp": "",
"source": "github",
"line_count": 211,
"max_line_length": 80,
"avg_line_length": 32.44075829383886,
"alnum_prop": 0.7430241051862674,
"repo_name": "matthieudumont/dipy",
"id": "f4f01c45fa2235d8958939d9fc1a9d5806ce1bf8",
"size": "... |
""" Tests for services relating to emails."""
from __future__ import absolute_import # pylint: disable=import-only-modules
from __future__ import unicode_literals # pylint: disable=import-only-modules
from constants import constants
from core.domain import email_services
from core.platform import models
from core.t... | {
"content_hash": "22e34c3119963bfdb776d3cd5e81c1c4",
"timestamp": "",
"source": "github",
"line_count": 235,
"max_line_length": 80,
"avg_line_length": 44.782978723404256,
"alnum_prop": 0.612599771949829,
"repo_name": "prasanna08/oppia",
"id": "cbc7eb3e16108b5050061955b9187f16606be996",
"size": "111... |
"""
This module contains the :class:`Aggregation` class and its various subclasses.
Each of these classes processes a column's data and returns a single value. For
instance, :class:`Mean`, when applied to a :class:`.NumberColumn`, returns a
single :class:`decimal.Decimal` value which is the average of all values in tha... | {
"content_hash": "e95b8ca37aa947210939fcded320ef72",
"timestamp": "",
"source": "github",
"line_count": 384,
"max_line_length": 101,
"avg_line_length": 28.380208333333332,
"alnum_prop": 0.6165351440631308,
"repo_name": "captainsafia/agate",
"id": "0b5d0a9c7f739494693ecd03726c69d99d3db7f5",
"size": ... |
'''
Some functions to show tree graphs.
Preconditions
-------------
The folowing libraries should be installed
`matplotlib, networkx, graphviz, pygraphviz`
Please use conda or pip.
Usage
-----
```
from showtree import show_binary_tree, show_tree_graph
```
'''
import matplotlib.pyplot as plt
import matplotlib
impo... | {
"content_hash": "663c50d2b24d09617aa6c9b07482b575",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 102,
"avg_line_length": 24.982758620689655,
"alnum_prop": 0.5571658615136876,
"repo_name": "vadim-ivlev/STUDY",
"id": "30bbd955e539e155b7d9fc2abcd96dc576f4a1c2",
"size": "... |
'''
------------------------------------------------------------------------------
Copyright 2016 Esri
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.... | {
"content_hash": "9acc7fc3b5fc44996c87276328afae64",
"timestamp": "",
"source": "github",
"line_count": 393,
"max_line_length": 204,
"avg_line_length": 45.73791348600509,
"alnum_prop": 0.6119610570236439,
"repo_name": "Esri/military-tools-geoprocessing-toolbox",
"id": "fdbd9654a843f6eecfc6d3b8719f577... |
from models import BaseModel
class ApplicationModel(BaseModel):
table = "applications"
db = "console"
fields={
"project_url":True,
"project_name":True,
"storage_path":True,
"app_name":True,
"user_id":True,
"status":True,
"logs":True,
"upd... | {
"content_hash": "34b0ae30bf1a1d41bfbdd4769f7aa4f7",
"timestamp": "",
"source": "github",
"line_count": 17,
"max_line_length": 34,
"avg_line_length": 21.647058823529413,
"alnum_prop": 0.5380434782608695,
"repo_name": "SimonWang2014/DockerConsoleApp",
"id": "86eef429d4cd70c11340f6920fc0c467f34c3265",
... |
"""
This module provides access to LDAP servers, along with some basic functionality required for Hue and
User Admin to work seamlessly with LDAP.
"""
import ldap
import ldap.filter
import logging
import re
from django.contrib.auth.models import User
import desktop.conf
from desktop.lib.python_util import CaseInsensi... | {
"content_hash": "9a07400b27d9a5275e8155dff545be52",
"timestamp": "",
"source": "github",
"line_count": 350,
"max_line_length": 170,
"avg_line_length": 37.30285714285714,
"alnum_prop": 0.6546415441176471,
"repo_name": "vitan/hue",
"id": "1ec7a09aa39837ff82c4429f9b9a19f784ff62e3",
"size": "13847",
... |
print "Content-type: text/html"
print
print "<pre>"
import os, sys
from cgi import escape
print "<strong>Python %s</strong>" % sys.version
keys = os.environ.keys()
keys.sort()
for k in keys:
print "%s\t%s" % (escape(k), escape(os.environ[k]))
print "</pre>"
## end of http://code.activestate.com/recipes/52220/ }}}
| {
"content_hash": "6c5de949c89a7e1c86974ca7e799b543",
"timestamp": "",
"source": "github",
"line_count": 12,
"max_line_length": 56,
"avg_line_length": 26.583333333333332,
"alnum_prop": 0.670846394984326,
"repo_name": "bhavanaananda/DataStage",
"id": "c853b437a45d434bf4ecd5eca69de33bd2048534",
"size"... |
import logging
import sys
from django.conf import settings
from django.core.exceptions import ImproperlyConfigured
from django.db.models.loading import get_model
from haystack.backends import BaseSearchBackend, BaseSearchQuery, log_query, EmptyResults
from haystack.constants import ID, DJANGO_CT, DJANGO_ID
from haystac... | {
"content_hash": "d21861f20b5b3d34bbb1e8de62542a27",
"timestamp": "",
"source": "github",
"line_count": 489,
"max_line_length": 147,
"avg_line_length": 39.259713701431494,
"alnum_prop": 0.5218251901239712,
"repo_name": "nathangeffen/tbonline-old",
"id": "a93c5e0b73ec7fc31132bae044f0e8a33ca81be7",
"... |
ANSIBLE_METADATA = {'metadata_version': '1.1',
'status': ['preview'],
'supported_by': 'community'}
DOCUMENTATION = '''
---
module: lambda_info
short_description: Gathers AWS Lambda function details
description:
- Gathers various details related to Lambda functions, including ... | {
"content_hash": "c71cd00af290e202f2e2f4efd16be5a1",
"timestamp": "",
"source": "github",
"line_count": 382,
"max_line_length": 134,
"avg_line_length": 32.15706806282723,
"alnum_prop": 0.6396125040703354,
"repo_name": "thaim/ansible",
"id": "d0ce6dafae4eef83f61d1106f741cccac4c40395",
"size": "12955... |
import unittest
from flask_testing import is_twill_available
from .test_utils import TestSetup, TestSetupFailure, TestClientUtils, TestLiveServer, TestTeardownGraceful
from .test_twill import TestTwill, TestTwillDeprecated
def suite():
suite = unittest.TestSuite()
suite.addTest(unittest.makeSuite(TestSetup)... | {
"content_hash": "cf4a11269072251519093f7c4e6c2133",
"timestamp": "",
"source": "github",
"line_count": 21,
"max_line_length": 106,
"avg_line_length": 36.904761904761905,
"alnum_prop": 0.7690322580645161,
"repo_name": "jmagnusson/flask-testing",
"id": "38658485c6e4fb7caeee66f734ccd243a3806c25",
"si... |
from itertools import product
from random import choice, randint, sample
from string import printable
from typing import Dict, List
from roboragi.data_controller.enums import Medium, Site
__all__ = ['random_sites', 'random_mediums', 'random_str',
'random_dict', 'random_lookup_entries']
def __random_enum_... | {
"content_hash": "2c20eea8858903891e322744c2c81051",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 78,
"avg_line_length": 27.493827160493826,
"alnum_prop": 0.5855410866636731,
"repo_name": "MaT1g3R/Roboragi",
"id": "cb046ebf75d03edfc40cbd603c24d3f9fadf9e05",
"size": "222... |
import json
import logging
import os
import sys
import tempfile
import time
import urlparse
from telemetry import test
from telemetry.core import browser_options
from telemetry.core import discover
from telemetry.core import util
from telemetry.core import wpr_modes
from telemetry.page import page_measurement
from tel... | {
"content_hash": "9d6139625c5156d5133d8f5c9ae5e137",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 80,
"avg_line_length": 35.31428571428572,
"alnum_prop": 0.7003236245954693,
"repo_name": "ChromiumWebApps/chromium",
"id": "6aaec3578280176c4a80b7cb371ba426f0d590e9",
"siz... |
"""Test for the inverse strategy."""
import random
import axelrod
from .test_player import TestPlayer
C, D = axelrod.Actions.C, axelrod.Actions.D
class TestInverse(TestPlayer):
name = "Inverse"
player = axelrod.Inverse
expected_classifier = {
'memory_depth': float('inf'), # Long memory
... | {
"content_hash": "2d99aa03b4c1dae7618be3c264dfa4f3",
"timestamp": "",
"source": "github",
"line_count": 56,
"max_line_length": 85,
"avg_line_length": 29.339285714285715,
"alnum_prop": 0.5538648813146683,
"repo_name": "bootandy/Axelrod",
"id": "62da3e9eb6f0a4cf57659e37ba3aa7c4fff94ca2",
"size": "164... |
import xlsxwriter
import tempfile
import datetime
import io
import sys
from bottle import HTTPResponse
from os import path
import metrics_util
def generate_spreadsheet(config, timings, runs, url_results, all_urls, filterIDs, addTable, excludeTimeouts, fromTime, toTime):
try:
urls = dict( [ (x[0]... | {
"content_hash": "e56e4b640229fc4039d62289a399aa2b",
"timestamp": "",
"source": "github",
"line_count": 173,
"max_line_length": 131,
"avg_line_length": 49.60693641618497,
"alnum_prop": 0.46900489396411094,
"repo_name": "anibit/sswm",
"id": "b6716e4c38afb4716ff127726788958f086e116f",
"size": "8582",... |
from eventlet import patcher
from eventlet.green import httplib
from eventlet.green import urllib
patcher.inject('test.test_urllib',
globals(),
('httplib', httplib),
('urllib', urllib))
if __name__ == "__main__":
test_main() | {
"content_hash": "97bf6699a16fd71d391e026b6be26c81",
"timestamp": "",
"source": "github",
"line_count": 11,
"max_line_length": 34,
"avg_line_length": 22.363636363636363,
"alnum_prop": 0.6585365853658537,
"repo_name": "JeremyGrosser/python-eventlet",
"id": "41f9e6a40165615ac7af316859b8117b0bae79a7",
... |
def integrate(func, lower_limit, upper_limit, step):
integral = 0
half_step = step / 2
cur_val = lower_limit
while cur_val < upper_limit:
cur_val += half_step
integral += func(cur_val) * step
cur_val += half_step
return integral | {
"content_hash": "1e06e80f677328902631703a3ba89c9f",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 52,
"avg_line_length": 16.466666666666665,
"alnum_prop": 0.659919028340081,
"repo_name": "felipecustodio/data_structures_C",
"id": "15dc1c107391a065bfaf1f06c9ebdb44d7b12c3d",... |
import os
class ProgressBar:
def __init__(self, task_number, bar_opening="[", bar_ending="]", empty_char="-", filled_char="=",
update_rate=0, percent_precision=1, display_percent=True, display_absolute_progress=True, bar_length=0,
enable_front_char=False, front_char=">"):
... | {
"content_hash": "dd375f93ea357445c228e09fa4ac54cd",
"timestamp": "",
"source": "github",
"line_count": 93,
"max_line_length": 120,
"avg_line_length": 44.634408602150536,
"alnum_prop": 0.5776921223801493,
"repo_name": "Rabyss/HideIt",
"id": "60699243d4217c9498aeac2340dd4582a7337204",
"size": "4173"... |
"""
Core Identity models for atmosphere.
Note:
Multiple users can 'own' an identity (IdentityMembership - group.py)
"""
from datetime import timedelta
from django.db import models
from threepio import logger
from uuid import uuid5, uuid4
from core.query import only_active_memberships, contains_credential
from co... | {
"content_hash": "517c63510f6f7ce992dea9693a27d167",
"timestamp": "",
"source": "github",
"line_count": 413,
"max_line_length": 113,
"avg_line_length": 37.67554479418886,
"alnum_prop": 0.6040488431876607,
"repo_name": "CCI-MOC/GUI-Backend",
"id": "83903680d872514ac9cbbd8d835af89910bb4626",
"size": ... |
import sys
import antlr3
import antlr3.tree
from SimpleCLexer import SimpleCLexer
from SimpleCParser import SimpleCParser
from SimpleCWalker import SimpleCWalker
cStream = antlr3.StringStream(open(sys.argv[1]).read())
lexer = SimpleCLexer(cStream)
tStream = antlr3.CommonTokenStream(lexer)
parser = SimpleCParser(tStrea... | {
"content_hash": "6b2067759c928f0fbdee3049b0163daa",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 55,
"avg_line_length": 26.842105263157894,
"alnum_prop": 0.807843137254902,
"repo_name": "sshrdp/mclab",
"id": "bdfd46d8fea6dfe0821cdfe2ed89908d9c2276e3",
"size": "510",
... |
"""This component provides HA switch support for Ring Door Bell/Chimes."""
from datetime import timedelta
import logging
import requests
from homeassistant.components.light import ColorMode, LightEntity
from homeassistant.config_entries import ConfigEntry
from homeassistant.core import HomeAssistant, callback
from ho... | {
"content_hash": "05d7cfb080e141728552ff5f353dae8b",
"timestamp": "",
"source": "github",
"line_count": 102,
"max_line_length": 87,
"avg_line_length": 30.07843137254902,
"alnum_prop": 0.6531942633637549,
"repo_name": "toddeye/home-assistant",
"id": "5b2cd1c54db113d8d52a0348e0ece51ccdde3e0d",
"size"... |
import sys
import numpy as np
import matplotlib.pyplot as plt
from scipy.interpolate import interp1d
from delight.io import *
from delight.utils import *
if len(sys.argv) < 2:
raise Exception('Please provide a parameter file')
params = parseParamFile(sys.argv[1], verbose=False, catFilesNeeded=False)
dir_seds = par... | {
"content_hash": "e972bcd98949cdc7b6def4c7a3445b73",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 78,
"avg_line_length": 40.8,
"alnum_prop": 0.6698179271708683,
"repo_name": "ixkael/Delight",
"id": "5382de7f0840c27288a45974062eb3d700880b6b",
"size": "2856",
"binary": ... |
from __future__ import absolute_import, division, print_function, unicode_literals
import unittest
from ..expr import parse_expr
class ExprTest(unittest.TestCase):
def test_equal(self):
e = parse_expr("foo=bar")
self.assertTrue(e.eval({"foo": "bar"}))
self.assertFalse(e.eval({"foo": "not... | {
"content_hash": "476ebcc1868551c424a35d02c49243e2",
"timestamp": "",
"source": "github",
"line_count": 34,
"max_line_length": 82,
"avg_line_length": 35.26470588235294,
"alnum_prop": 0.5638031693077564,
"repo_name": "phoad/rsocket-cpp",
"id": "66b7a51b9471fa1d08c862dd7bd82dcbc1f2e2df",
"size": "151... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.