text stringlengths 4 1.02M | meta dict |
|---|---|
"""
A Geosoft View (:class:`geosoft.gxpy.view.View` or :class:`geosoft.gxpy.view.View_3d`) contains graphical elements as
`Group` instances. Groups are named and are available to a user in a Geosoft viewer, which allows groups to
be turned on or off, modify the transparency, or be deleted.
2D views can only accept 2D ... | {
"content_hash": "8c8b419ab988ae47f09c725a21451fca",
"timestamp": "",
"source": "github",
"line_count": 3109,
"max_line_length": 120,
"avg_line_length": 34.75361852685751,
"alnum_prop": 0.5325916945089728,
"repo_name": "GeosoftInc/gxpy",
"id": "c308e19c847ee60803b29447e8ffca2b1ea4c1f6",
"size": "10... |
"""
AUTO-GENERATED BY `scripts/generate_protocol.py` using `data/browser_protocol.json`
and `data/js_protocol.json` as inputs! Please do not modify this file.
"""
import logging
from typing import Any, Optional, Union
from chromewhip.helpers import PayloadMixin, BaseEvent, ChromeTypeBase
log = logging.getLogger(__na... | {
"content_hash": "fad45af1e85224c2c8d781341b1a3a63",
"timestamp": "",
"source": "github",
"line_count": 129,
"max_line_length": 95,
"avg_line_length": 27.472868217054263,
"alnum_prop": 0.5471218961625283,
"repo_name": "chuckus/chromewhip",
"id": "1bbf4e47e0efa0f6e714dca3d63944b579b47e66",
"size": "... |
from django import forms
from django.utils.translation import ugettext_lazy as _
#import settings
from cmsplugin_contact.nospam.forms import HoneyPotForm, RecaptchaForm, AkismetForm
class ContactForm(forms.Form):
email = forms.EmailField(label=_("Email"))
subject = forms.CharField(label=_("Subject"), require... | {
"content_hash": "ddf4427834c6dae9c7934a25f3aa1df5",
"timestamp": "",
"source": "github",
"line_count": 27,
"max_line_length": 83,
"avg_line_length": 30.40740740740741,
"alnum_prop": 0.7198538367844093,
"repo_name": "wlanslovenija/cmsplugin-contact",
"id": "d5be49c5406434fd4bc6be594586b88cb2b52aea",
... |
import pandas as pd
import numpy as np
import tarfile
import os
import logging
import C_Funct
from Parameters import *
def Loader(directory,sap,beam):
#------------------------------------------
# Creates a table for one .singlepulse file
#------------------------------------------
events = pd.DataFrame()
... | {
"content_hash": "7d470ea74b78971301a5fcc38a010f3a",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 128,
"avg_line_length": 28.557522123893804,
"alnum_prop": 0.5810350170436939,
"repo_name": "danielemichilli/LSPs",
"id": "a2b221cc3c938c450605eee088c9b0b43243a469",
"size"... |
"""
Stakeholder engagement API
This API enables Intelligent Engagement for your Business. iEngage is a platform that combines process, augmented intelligence and rewards to help you intelligently engage customers.
OpenAPI spec version: 1.0
Generated by: https://github.com/swagger-api/swagger-code... | {
"content_hash": "b06c2f8c39cbbd0b96010d1e650cb5c6",
"timestamp": "",
"source": "github",
"line_count": 206,
"max_line_length": 186,
"avg_line_length": 25.9126213592233,
"alnum_prop": 0.5419632821281378,
"repo_name": "iEngage/python-sdk",
"id": "9a11ae50076bf15e3c0417140449373eed9a2788",
"size": "5... |
from webmachine.auth.base import Auth, BasicAuth
| {
"content_hash": "93a1e5f28d10a7933cdc93417f30883f",
"timestamp": "",
"source": "github",
"line_count": 1,
"max_line_length": 48,
"avg_line_length": 49,
"alnum_prop": 0.8367346938775511,
"repo_name": "benoitc/dj-webmachine",
"id": "ae5e858eac6605409f48c1441bca6aa8a6744294",
"size": "183",
"binary... |
import six
import asyncio
import signal
from six.moves.urllib.parse import urlparse
from autobahn.wamp.types import ComponentConfig
from autobahn.asyncio.rawsocket import WampRawSocketClientFactory
import txaio
# TODO - unify with previous class
class ApplicationRunnerRawSocket(object):
"""
This class is a co... | {
"content_hash": "4992d1b05d6449354531882eae6a1cca",
"timestamp": "",
"source": "github",
"line_count": 112,
"max_line_length": 107,
"avg_line_length": 35.839285714285715,
"alnum_prop": 0.6228201295465869,
"repo_name": "Jenselme/AutobahnPython",
"id": "211d4e582544909ecb250bc2c659142c67d9c0bb",
"si... |
from django.conf import settings
from hashlib import sha1
from mediagenerator.base import Generator
from mediagenerator.utils import get_media_dirs, find_file, prepare_patterns
from mimetypes import guess_type
import os
COPY_MEDIA_FILETYPES = getattr(settings, 'COPY_MEDIA_FILETYPES',
('gif', 'jpg', 'jpeg',... | {
"content_hash": "d776fc6af494ee101be3159e588a4d81",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 38.02325581395349,
"alnum_prop": 0.5755351681957187,
"repo_name": "brunogamacatao/portalsaladeaula",
"id": "c07dc64592615200699761759dd877e83be73d66",
... |
import urlparse
from webob import Request
from restkit.contrib.wsgi_proxy import HostProxy
import restkit
from restkit.conn import Connection
from socketpool import ConnectionPool
restkit.set_logging("debug")
pool = ConnectionPool(factory=Connection, max_size=10, backend="thread")
proxy = HostProxy("http://127.0.0.... | {
"content_hash": "506409fdf1f01ade0622ea367ac14835",
"timestamp": "",
"source": "github",
"line_count": 28,
"max_line_length": 72,
"avg_line_length": 26.892857142857142,
"alnum_prop": 0.7078353253652059,
"repo_name": "benoitc/restkit",
"id": "ff1e062495c7634d750092d2e5c6bc5d4592fca1",
"size": "880"... |
from nose.tools import * # noqa
import mock
import responses
from tests.base import OsfTestCase
from tests.factories import AuthUserFactory, ProjectFactory
import urlparse
from framework.auth.core import Auth
from website.addons.mendeley.tests.factories import (
MendeleyAccountFactory,
MendeleyUserSetting... | {
"content_hash": "d34391da6191a5cec6e80cd22ee6bbba",
"timestamp": "",
"source": "github",
"line_count": 289,
"max_line_length": 102,
"avg_line_length": 34.30795847750865,
"alnum_prop": 0.5806354009077156,
"repo_name": "kushG/osf.io",
"id": "7f26274a7154f0215bcdeea3f2ac99c68e4494bf",
"size": "9940",... |
"""Base class for RPC testing."""
import configparser
from enum import Enum
import argparse
import logging
import os
import pdb
import random
import re
import shutil
import subprocess
import sys
import tempfile
import time
from typing import List
from .address import create_deterministic_address_bcrt1_p2tr_op_true
fr... | {
"content_hash": "e57c782c0b8142bb894e31a23c0e40bb",
"timestamp": "",
"source": "github",
"line_count": 911,
"max_line_length": 312,
"avg_line_length": 45.12843029637761,
"alnum_prop": 0.607511188947266,
"repo_name": "mm-s/bitcoin",
"id": "8f75255caffb5fdfbda8981c32236357f8b858cc",
"size": "41326",... |
from __future__ import unicode_literals
from cms.utils.page import _page_is_published
def get_article_from_slug(tree, slug, preview=False, draft=False):
"""
Resolves a slug to a single article object.
Returns None if article does not exist
"""
from ..models import Title
titles = Title.object... | {
"content_hash": "311c1f896a88ad4ec39bd88eb0f5ec32",
"timestamp": "",
"source": "github",
"line_count": 30,
"max_line_length": 79,
"avg_line_length": 30.633333333333333,
"alnum_prop": 0.675734494015234,
"repo_name": "misli/django-cms-articles",
"id": "96d64be16382a87baffb94d30a57d4deaf98cf2f",
"siz... |
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('indicators', '0078_auto_20191107_1339'),
]
operations = [
migrations.AlterField(
model_name='disaggregationtype',
name='disaggregation_type',
field=model... | {
"content_hash": "f73d22be33bcd39b4bb25d8c6dd7296a",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 82,
"avg_line_length": 24.8125,
"alnum_prop": 0.6171284634760705,
"repo_name": "mercycorps/TolaActivity",
"id": "24c9b7f59e7a5fa46717893eab2060474e91a35c",
"size": "446",
... |
from model import Magikarp
import numpy as np
import tensorflow as tf
config = {}
config['batch_size'] = 64
config['datafile'] = '../Data/training_data.hdf5'
config['p_datafile'] = '../Data/tal_data.hdf5'
config['full_boards_file'] = '../Data/full_boards.pkl'
config['num_epochs'] = 10
config['save_file'] = 'trained_mo... | {
"content_hash": "3ac9fdd11d86f57d3e79cd0527054ece",
"timestamp": "",
"source": "github",
"line_count": 15,
"max_line_length": 57,
"avg_line_length": 28.4,
"alnum_prop": 0.704225352112676,
"repo_name": "2014mchidamb/AdversarialChess",
"id": "039a6144065ebf391f0c1374bca339cb38d29546",
"size": "426",... |
class PdfObject(str):
''' A PdfObject is a textual representation of any PDF file object
other than an array, dict or string. It has an indirect attribute
which defaults to False.
'''
indirect = False
| {
"content_hash": "d9cda09bbccd73bab9bfbe19eb6e5d06",
"timestamp": "",
"source": "github",
"line_count": 6,
"max_line_length": 73,
"avg_line_length": 38.166666666666664,
"alnum_prop": 0.6724890829694323,
"repo_name": "tajtiattila/pdfrw",
"id": "8a0fc88d991b689aeadefd9569f8d6eabc7ffd18",
"size": "372... |
from django.contrib import admin
from activitystreams.models import Source, Action, Activity, ActivityObject, Interest, UserObject
class SourceAdmin(admin.ModelAdmin):
prepopulated_fields = {"slug": ("name",)}
list_display = ('name', 'slug',)
list_editable = ('slug',)
class ActionAdmin(admin.ModelAdmin):... | {
"content_hash": "4d00260ab8d42ccfeb4ce57434e9e434",
"timestamp": "",
"source": "github",
"line_count": 19,
"max_line_length": 97,
"avg_line_length": 31.63157894736842,
"alnum_prop": 0.7437603993344426,
"repo_name": "nowells/django-activitystreams",
"id": "215441e152dffaa2d5484a6b83e358e4564bd8d4",
... |
"""Support for THOMSON routers."""
import logging
import re
import telnetlib
import voluptuous as vol
from homeassistant.components.device_tracker import (
DOMAIN,
PLATFORM_SCHEMA,
DeviceScanner,
)
from homeassistant.const import CONF_HOST, CONF_PASSWORD, CONF_USERNAME
import homeassistant.helpers.config_... | {
"content_hash": "1fd6d039fa9bb267bb007f452acd818b",
"timestamp": "",
"source": "github",
"line_count": 121,
"max_line_length": 82,
"avg_line_length": 32.18181818181818,
"alnum_prop": 0.5724191063174114,
"repo_name": "Teagan42/home-assistant",
"id": "1f3fda6cc72c7555fc25acc6a79ac578983c2c1a",
"size... |
import utils # Funcions d'us comu
import praw # Wrapper API reddit
import pymysql # Per interactuar amb la BBDD
import time
import datetime
SUB_LIMIT = 2000000 # Subreddits capturats com a maxim amb getS... | {
"content_hash": "49e8b58b939b60af3a4304927d1ac300",
"timestamp": "",
"source": "github",
"line_count": 425,
"max_line_length": 149,
"avg_line_length": 50.023529411764706,
"alnum_prop": 0.5951552210724365,
"repo_name": "rroyo/redditWhoBot",
"id": "a68be053f5c32731ab14a98cc1aa6e5f127ee57d",
"size": ... |
import cgi
import json
import sqlite3 as lite
class GetAllPlaylistSongsFromDB():
def __init__(self):
amp_db_loc = "/usr/share/ampyche/db/ampyche.db"
self.amp_db_loc = amp_db_loc
pll_db_loc = "/usr/share/ampyche/db/ampychePlaylist.db"
self.pll_db_loc = pll_db_loc
def _make_a_list(self, genlist):
agen ... | {
"content_hash": "1b85889377d6f5c27455978ef00c490f",
"timestamp": "",
"source": "github",
"line_count": 53,
"max_line_length": 95,
"avg_line_length": 28.60377358490566,
"alnum_prop": 0.6569920844327177,
"repo_name": "ampyche/ampyche",
"id": "3839e2dbfbc62ea845fceebe129c12b151ff461e",
"size": "1536"... |
import sensor
sensor.set_contrast(1)
sensor.set_gainceiling(8)
sensor.set_framesize(sensor.QQVGA)
sensor.set_pixformat(sensor.RGB565)
image = sensor.snapshot()
image.save("/test.ppm")
| {
"content_hash": "7f1cc5cdd0d08c0d67e630eeaaae56e5",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 35,
"avg_line_length": 23.125,
"alnum_prop": 0.7837837837837838,
"repo_name": "dhylands/openmv",
"id": "d701c9d885ac688f56c793e9647048dacf5e3ccb",
"size": "185",
"binary":... |
"""
Unit test cases.
"""
from __future__ import unicode_literals
import unittest
import os
import io
import logging
import logging.config
from simpletal import simpleTAL, simpleTALES
if (os.path.exists("logging.ini")):
logging.config.fileConfig("logging.ini")
else:
logging.basicConfig()
def simpl... | {
"content_hash": "21a696bca7edc196cab85074ecb0bbf2",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 114,
"avg_line_length": 34.833333333333336,
"alnum_prop": 0.5845570037947534,
"repo_name": "janbrohl/SimpleTAL",
"id": "2ef69447cd2162ed9b9cddb2caea4e6095ab5491",
"size": ... |
from indico.core.db.sqlalchemy import db
from indico.core.db.sqlalchemy.descriptions import DescriptionMixin, RenderMode
from indico.core.db.sqlalchemy.protection import ProtectionManagersMixin
from indico.util.locators import locator_property
from indico.util.string import format_repr, text_to_repr
def get_next_posi... | {
"content_hash": "9443853732095f39550e68c05dd6cb93",
"timestamp": "",
"source": "github",
"line_count": 155,
"max_line_length": 104,
"avg_line_length": 31.93548387096774,
"alnum_prop": 0.6191919191919192,
"repo_name": "pferreir/indico",
"id": "49c5ae05d1aa59fc6801919269920b68c2aa929d",
"size": "516... |
"""
Flex compatibility tests.
@author: U{Nick Joyce<mailto:nick@boxdesign.co.uk>}
@since: 0.1.0
"""
import unittest
import pyamf
from pyamf import flex, util, amf3, amf0
class ArrayCollectionTestCase(unittest.TestCase):
def test_create(self):
ac = flex.ArrayCollection([1, 2, 3])
self.assertEqua... | {
"content_hash": "65f58cbeb62bcbb0d3ff55f1901abd92",
"timestamp": "",
"source": "github",
"line_count": 105,
"max_line_length": 78,
"avg_line_length": 27.885714285714286,
"alnum_prop": 0.608948087431694,
"repo_name": "jamesward-demo/air-quick-fix",
"id": "74e2a075429691705909eaafe2c9aa8ae2c7db56",
... |
import unittest
from fysom import Fysom
class FysomSameDstTransitionTests(unittest.TestCase):
def test_if_src_not_specified_then_is_wildcard(self):
fsm = Fysom({
'initial': 'hungry',
'events': [
{'name': 'eat', 'src': 'hungry', 'dst': 'satisfied'},
{... | {
"content_hash": "029b5a25b2e1225a5744932a525ea3d5",
"timestamp": "",
"source": "github",
"line_count": 48,
"max_line_length": 71,
"avg_line_length": 37.083333333333336,
"alnum_prop": 0.49382022471910114,
"repo_name": "mriehl/fysom",
"id": "d9a4e68405a90b708fd79158ec9f3af9cf0e92e8",
"size": "3180",... |
"""
Contains some base primitives that provide basic flow logic for the messages.
Based on a stripped down version of base.py in ActivityWatch.
"""
from abc import abstractmethod, ABCMeta
import threading
from queue import Queue, Empty
from . import Event
from typing import Optional
class Agent(threading.Thread):
... | {
"content_hash": "6ca1e34ef69de9bc601b0c0960c73468",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 116,
"avg_line_length": 31.841772151898734,
"alnum_prop": 0.6060425362750944,
"repo_name": "Homebrain/Homebrain",
"id": "527b5a34ff734738d5bdb6f2320c01727ced6cb5",
"size":... |
"""Bridges between the Twisted reactor and Tornado IOLoop.
This module lets you run applications and libraries written for
Twisted in a Tornado application. It can be used in two modes,
depending on which library's underlying event loop you want to use.
This module has been tested with Twisted versions 11.0.0 and ne... | {
"content_hash": "1fc4beae2efcada1607c1efd9985015b",
"timestamp": "",
"source": "github",
"line_count": 571,
"max_line_length": 80,
"avg_line_length": 36.770577933450085,
"alnum_prop": 0.6072108973137741,
"repo_name": "ColorFuzzy/tornado",
"id": "d3a4e75d1c95bd8e8df8fc2a08babfcb99759734",
"size": "... |
from sqlalchemy import create_engine
from sqlalchemy.orm import scoped_session, sessionmaker
from sqlalchemy.ext.declarative import declarative_base
from functools import wraps
import os
db_session = None
Model = declarative_base()
def entry_point(func):
@wraps(func)
def internal(*args, **kwargs):
r... | {
"content_hash": "fd32bce2763324f9443c5bc170d42460",
"timestamp": "",
"source": "github",
"line_count": 33,
"max_line_length": 68,
"avg_line_length": 31.303030303030305,
"alnum_prop": 0.5769603097773476,
"repo_name": "aspyatkin/assetoolz",
"id": "8dc6195911eeb891109c836ebeb5a3bf86c7ccee",
"size": "... |
"""Twitch.tv uses OAuth2 for authorization.
We use the Implicit Grant Workflow.
The user has to visit an authorization site, login, authorize
PyTwitcher. Once he allows PyTwitcher, twitch will redirect him to
:data:`pytwitcherapi.REDIRECT_URI`.
In the url fragment, there is the access token.
This module features a ser... | {
"content_hash": "e300572e47d224599d55c9ab284b9ae5",
"timestamp": "",
"source": "github",
"line_count": 170,
"max_line_length": 81,
"avg_line_length": 33.32941176470588,
"alnum_prop": 0.6343099188139781,
"repo_name": "Pytwitcher/pytwitcherapi",
"id": "cfd53d8f838531fa8a3ff25acb5973746c4469c2",
"siz... |
from . import axis
from nibabel import cifti2
import numpy as np
def get_axes(file):
"""
Extracts the axes form a CIFTI file header
Parameters
----------
file : str
filename or an already opened Cifti2Image
Returns
-------
tuple of N Axes describing the rows/columns along eac... | {
"content_hash": "5669d46cc5f84e238defc846e3cba62d",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 112,
"avg_line_length": 30,
"alnum_prop": 0.5887788778877888,
"repo_name": "MichielCottaar/cifti",
"id": "887fc9f1dfbedeeb210e7077b819efdd6bb331f6",
"size": "3030",
"bin... |
"""
This module implements classes (called Fitters) which combine optimization
algorithms (typically from `scipy.optimize`) with statistic functions to perform
fitting. Fitters are implemented as callable classes. In addition to the data
to fit, the ``__call__`` method takes an instance of
`~astropy.modeling.core.Fitta... | {
"content_hash": "2ed04d504a8c23cf538e599558d2c9c8",
"timestamp": "",
"source": "github",
"line_count": 2202,
"max_line_length": 122,
"avg_line_length": 37.426884650317895,
"alnum_prop": 0.5652923047055112,
"repo_name": "pllim/astropy",
"id": "484bd01bb9d33df0e540ab0beef9f167a98d6432",
"size": "824... |
import os, stat, time
import pygtk
pygtk.require('2.0')
import gtk
folderxpm = [
"17 16 7 1",
" c #000000",
". c #808000",
"X c yellow",
"o c #808080",
"O c #c0c0c0",
"+ c white",
"@ c None",
"@@@@@@@@@@@@@@@@@",
"@@@@@@@@@@@@@@@@@",
"@@+XXXX.@@@@@@@@@",
"@+OOOOOO.@@@@@... | {
"content_hash": "c2a47abdf5bf4878db7fa5cff0faaee9",
"timestamp": "",
"source": "github",
"line_count": 165,
"max_line_length": 77,
"avg_line_length": 30.666666666666668,
"alnum_prop": 0.5490118577075099,
"repo_name": "certik/pyjamas",
"id": "3f1cfe8468c336fe6baa1a9ca2739a9274ae070b",
"size": "5083... |
from models.game.bots.Bot import Bot
from models.game.Game import Game
from models.data.GameDataModel import GameDataModel
from models.data import DatabaseConnection as DB
class Experiment(object):
def __init__(self, player1, player2, iterations, record=True):
""" An Experiment is a sequence of several ga... | {
"content_hash": "093b1bbbff361ae44a6c0cfa7436168e",
"timestamp": "",
"source": "github",
"line_count": 77,
"max_line_length": 137,
"avg_line_length": 34.8051948051948,
"alnum_prop": 0.6037313432835821,
"repo_name": "zachdj/ultimate-tic-tac-toe",
"id": "745ebd4d144ee82b00c7f5dab11bf339e44e7e19",
"s... |
"""
WSGI config for RenderProgressTracker project.
It exposes the WSGI callable as a module-level variable named ``application``.
For more information on this file, see
https://docs.djangoproject.com/en/1.6/howto/deployment/wsgi/
"""
import os
os.environ.setdefault("DJANGO_SETTINGS_MODULE", "RenderProgressTracker.se... | {
"content_hash": "e4a7c20fdc29ef5e6f5fa871ab7da749",
"timestamp": "",
"source": "github",
"line_count": 14,
"max_line_length": 81,
"avg_line_length": 29.785714285714285,
"alnum_prop": 0.7889688249400479,
"repo_name": "trailbehind/RenderProgressTracker",
"id": "d091234c728bef0efb214537dfc95f9fbd2e66e4... |
from .array import DecimalArray, DecimalDtype, make_data, to_decimal
__all__ = ["DecimalArray", "DecimalDtype", "to_decimal", "make_data"]
| {
"content_hash": "6b5d9941a3d5a92a1a15c896f72b3bd1",
"timestamp": "",
"source": "github",
"line_count": 3,
"max_line_length": 69,
"avg_line_length": 46.666666666666664,
"alnum_prop": 0.7142857142857143,
"repo_name": "jreback/pandas",
"id": "8194327f8812ea85f248964e1e60d6797ef1b936",
"size": "140",
... |
from __future__ import annotations
import collections
import os
import shlex
import subprocess
import sys
import pytest
from setuptools.dist import Distribution
import setuptools_golang
@pytest.fixture(autouse=True, scope='session')
def enable_coverage_subprocesses():
here = os.path.dirname(os.path.dirname(os.... | {
"content_hash": "d6c6faad9754cfcd2831d5e702b6a3c2",
"timestamp": "",
"source": "github",
"line_count": 174,
"max_line_length": 79,
"avg_line_length": 30.270114942528735,
"alnum_prop": 0.6407822289728499,
"repo_name": "asottile/setuptools-golang",
"id": "c9c181910e5d6c0286951b8cfdeca8d8773d33d9",
"... |
from keystoneclient.auth.identity import v3
class OAuth2Method(v3.AuthMethod):
_method_parameters = ['access_token']
def __init__(self, **kwargs):
"""Construct an OAuth based authentication method.
:param string access_token: Access token id.
"""
super(OAuth2Method, self).__i... | {
"content_hash": "bc34e4cd6ce82b01a1efd886a07d4673",
"timestamp": "",
"source": "github",
"line_count": 26,
"max_line_length": 80,
"avg_line_length": 29.423076923076923,
"alnum_prop": 0.6352941176470588,
"repo_name": "ging/python-keystoneclient",
"id": "bccedfa0f14ca202c0631cc6a0c496513f868ee0",
"s... |
"""
Problem 89
18 February 2005
For a number written in Roman numerals to be considered valid there are basic rules which must be followed.
Even though the rules allow some numbers to be expressed in more than one way there is always a "best" way
of writing a particular number.
For example, it would appear ... | {
"content_hash": "754eb0c8f5b6d288aeda43730c46c00c",
"timestamp": "",
"source": "github",
"line_count": 216,
"max_line_length": 115,
"avg_line_length": 25.38425925925926,
"alnum_prop": 0.507021703447018,
"repo_name": "arturh85/projecteuler",
"id": "641cc23a9776c77e519d71ca64af5d95a4f79c1c",
"size":... |
"""Support for MyQ-Enabled Garage Doors."""
from typing import Any
from pymyq.const import DEVICE_TYPE_GATE as MYQ_DEVICE_TYPE_GATE
from pymyq.errors import MyQError
from homeassistant.components.cover import (
CoverDeviceClass,
CoverEntity,
CoverEntityFeature,
)
from homeassistant.config_entries import C... | {
"content_hash": "3dd185eed65b7e42d75da0fdf27cf060",
"timestamp": "",
"source": "github",
"line_count": 116,
"max_line_length": 86,
"avg_line_length": 33.35344827586207,
"alnum_prop": 0.6484879813905402,
"repo_name": "nkgilley/home-assistant",
"id": "51d0b3290a6acc029464f9437d196aef3614e233",
"size... |
"""Const for Plaato."""
from datetime import timedelta
DOMAIN = "plaato"
PLAATO_DEVICE_SENSORS = "sensors"
PLAATO_DEVICE_ATTRS = "attrs"
SENSOR_SIGNAL = f"{DOMAIN}_%s_%s"
CONF_USE_WEBHOOK = "use_webhook"
CONF_DEVICE_TYPE = "device_type"
CONF_DEVICE_NAME = "device_name"
CONF_CLOUDHOOK = "cloudhook"
PLACEHOLDER_WEBHOOK... | {
"content_hash": "55d19d58be074fa7e7111abee2035fc4",
"timestamp": "",
"source": "github",
"line_count": 36,
"max_line_length": 63,
"avg_line_length": 29.555555555555557,
"alnum_prop": 0.7058270676691729,
"repo_name": "Danielhiversen/home-assistant",
"id": "2d8cf40c91e1e6127eb63c4066d6b55d55f9f8b8",
... |
from django.template import RequestContext, loader
from models import Artist, Song
from django.shortcuts import render, redirect
from forms import SongForm
from django.http import HttpResponse
from justAnalyze import analyze
def index(request):
song_list = Song.objects.all()
context = {
'song_list': so... | {
"content_hash": "b9cd08f742e750903a501f22e30c6799",
"timestamp": "",
"source": "github",
"line_count": 32,
"max_line_length": 120,
"avg_line_length": 43.78125,
"alnum_prop": 0.6174161313347609,
"repo_name": "stuntman723/rap-analyzer",
"id": "4b2eb3f08275f1e793908918bea658662a303bff",
"size": "1428... |
"""
Manage manipulations such as swapping reaction cofactors, over-express or down-regulate genes and reactions.
"""
from cobra import Reaction
def increase_flux(reaction, ref_value, value):
"""
lb 0 ub
|--------------------------- ' ------------------... | {
"content_hash": "3d805e1c14c05027da6517fa2dc6e4fc",
"timestamp": "",
"source": "github",
"line_count": 143,
"max_line_length": 116,
"avg_line_length": 33.35664335664335,
"alnum_prop": 0.5526205450733752,
"repo_name": "biosustain/cameo",
"id": "b860dc63e4b4ffa5115caf42b0b69aa35a0f9f62",
"size": "53... |
from unittest import TestCase, main
from eventsource_parser import Event, parse
class EventSourceTests(TestCase):
def testParseData(self):
event, extra = parse("data:somedata\n\n")
self.assertEqual(event, Event(None, None, 'somedata'))
self.assertEqual(extra, '')
def testParseMultiLin... | {
"content_hash": "94b808319dbfefed8dddcda22a18d110",
"timestamp": "",
"source": "github",
"line_count": 63,
"max_line_length": 84,
"avg_line_length": 39,
"alnum_prop": 0.6357346357346357,
"repo_name": "tOkeshu/eventsource-parser",
"id": "eee84d9dadd60d76c2e45df3fe5d10ce1ca70969",
"size": "2481",
... |
from django.core.exceptions import ValidationError
from django.test import TestCase
from django_powerbank.core.validators import MsisdnValidator
class MsisdnValidatorTests(TestCase):
def test_no_plus(self):
with self.assertRaises(ValidationError):
MsisdnValidator()("48 601 123 123")
w... | {
"content_hash": "a7b2132afda570e82886d0c090c50c7f",
"timestamp": "",
"source": "github",
"line_count": 22,
"max_line_length": 60,
"avg_line_length": 32.86363636363637,
"alnum_prop": 0.6666666666666666,
"repo_name": "wooyek/django-powerbank",
"id": "d833b46e70451b48beec6f51a2ee5aee1c0d8fb6",
"size"... |
"""
This module contains helper functions for controlling caching. It does so by
managing the "Vary" header of responses. It includes functions to patch the
header of response objects directly and decorators that change functions to do
that header-patching themselves.
For information on the Vary header, see:
http... | {
"content_hash": "02530c30b899a49cf97b967c9423349c",
"timestamp": "",
"source": "github",
"line_count": 264,
"max_line_length": 96,
"avg_line_length": 41.996212121212125,
"alnum_prop": 0.6702444304139984,
"repo_name": "denisenkom/django",
"id": "7a77f911cedf93e744211e1ef7bf47a83893ab22",
"size": "1... |
import maya.cmds as cmds
cmds.window()
cmds.columnLayout()
cmds.rowColumnLayout( numberOfColumns=1)
cmds.intSliderGrp( field=True, label='Radius',
min=1, max=10, step=1,
columnWidth3=[50, 50, 100],
columnAlign3=['left', 'left', 'left'],
a... | {
"content_hash": "4e97a343bc27c9a25afb1a401b9bfe1e",
"timestamp": "",
"source": "github",
"line_count": 25,
"max_line_length": 58,
"avg_line_length": 31.52,
"alnum_prop": 0.5342639593908629,
"repo_name": "satishgoda/Maya",
"id": "e9930fcb14a39e4d74c48bb53413d24c89f37d12",
"size": "788",
"binary":... |
from __future__ import unicode_literals
from django.conf import settings
from django.db import migrations, models
import django.db.models.deletion
class Migration(migrations.Migration):
dependencies = [("pos", "0016_transaction_attended")]
operations = [
migrations.AlterField(
model_nam... | {
"content_hash": "ee3c8368a5d09d938416fc70e3342fcb",
"timestamp": "",
"source": "github",
"line_count": 42,
"max_line_length": 61,
"avg_line_length": 28.404761904761905,
"alnum_prop": 0.5205364626990779,
"repo_name": "ianastewart/cwltc-admin",
"id": "ebaa8c434ef63963eb4218463b840c026dcdbc1d",
"size... |
"""
WebPortfolio View
"""
from flask import redirect, request, url_for, session, abort
from webportfolio import (WebPortfolio, route, flash_error, flash_success,
flash_info, flash_data, get_flashed_data,
ModelError, ViewError)
from webportfolio.decorators import (rend... | {
"content_hash": "fdcf47844eed927690f01cf454b96fe6",
"timestamp": "",
"source": "github",
"line_count": 175,
"max_line_length": 96,
"avg_line_length": 34.502857142857145,
"alnum_prop": 0.49619079165286517,
"repo_name": "mardix/webportfolio",
"id": "a08b6649cde9df93aa2c7c67b41caf79c23be672",
"size":... |
from collections import deque
from .skip import skip
from .window import window
from .chain import chain
def split(pipe, splitter, skip_empty=False):
''' this function works a lot like groupby but splits on given patterns,
the same behavior as str.split provides. if skip_empty is True,
split only y... | {
"content_hash": "758228e402ebe00ad8a5da883e5c02ae",
"timestamp": "",
"source": "github",
"line_count": 43,
"max_line_length": 76,
"avg_line_length": 26.88372093023256,
"alnum_prop": 0.5631487889273357,
"repo_name": "CodyKochmann/generators",
"id": "d6add0ad2ceb7473d2925153c5606290018da7d8",
"size"... |
import datetime
import decimal
import random
from sqlalchemy import Column
from sqlalchemy import DDL
from sqlalchemy import event
from sqlalchemy import exc
from sqlalchemy import ForeignKey
from sqlalchemy import ForeignKeyConstraint
from sqlalchemy import Identity
from sqlalchemy import Index
from sqlalchemy import... | {
"content_hash": "6eab1f16b1dbe8dafe6d65da40c1d91d",
"timestamp": "",
"source": "github",
"line_count": 861,
"max_line_length": 79,
"avg_line_length": 33.88501742160279,
"alnum_prop": 0.5031362467866324,
"repo_name": "j5int/sqlalchemy",
"id": "4c5a5398164ae46357ff104499a4d0c2a53be437",
"size": "291... |
__author__ = "Tom Goldenberg <thomasagoldenberg@gmail.com>"
__date__ = "$February 3, 2016"
import sys
from collections import defaultdict
# iterate over file lines
def corpus_iterator(corpus_file):
l = corpus_file.readline() # pop off a line of the file
while l: # while there are lines left
line = l.s... | {
"content_hash": "6e54cf090b5a608b86564b0aa59351cc",
"timestamp": "",
"source": "github",
"line_count": 70,
"max_line_length": 94,
"avg_line_length": 43.5,
"alnum_prop": 0.6137931034482759,
"repo_name": "tgoldenberg/nlp",
"id": "a48a207d0b2f5aa0da65154e6f6a5db0c42d3055",
"size": "3045",
"binary":... |
import os
import re
import cx_Oracle
import collections
import datetime
kneeDiagnosisCode = [5164,5165,5163,5162,5161,5256,5258,5257,5313,5314,5315,5055,5261,5260,5259,5262,5263,5264]
#Primary query, Look for all decisions where a claim has been processed already. Much of the filtering is based on the engineering not... | {
"content_hash": "ebcea0259fdc01e14de909d0a434a745",
"timestamp": "",
"source": "github",
"line_count": 268,
"max_line_length": 628,
"avg_line_length": 46.951492537313435,
"alnum_prop": 0.7459270444250179,
"repo_name": "pgrazaitis/BCDS",
"id": "c29890e24485c6a2542ff92782ba4d7579d38724",
"size": "12... |
"""This code example gets all premium rates belonging to a specific rate card.
To create premium rates, run create_premium_rates.py.
Tags: PremiumRateService.getPremiumRatesByStatement
"""
__author__ = 'Nicholas Chen'
# Import appropriate modules from the client library.
from googleads import dfp
RATE_CARD_ID = 'I... | {
"content_hash": "96fb1d8efc95a0a636680ef4c5328107",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 78,
"avg_line_length": 31.14814814814815,
"alnum_prop": 0.6355529131985731,
"repo_name": "ya7lelkom/googleads-python-lib",
"id": "5fc8fcdffd9fd179e93fd6d9ae9abbb0cc06aa10",
... |
import os
from flask.ext.script import Manager, Server
from flask.ext.migrate import Migrate, MigrateCommand
from flask.ext.script.commands import ShowUrls, Clean
from web import create_app
from web.models import db, User
# default to dev config because no one should use this in
# production anyway
env = os.environ.g... | {
"content_hash": "0d3f8bfbbbb5f3d39765cc690d4801db",
"timestamp": "",
"source": "github",
"line_count": 39,
"max_line_length": 60,
"avg_line_length": 25.923076923076923,
"alnum_prop": 0.7062314540059347,
"repo_name": "emrahayanoglu/Flask-Skeleton",
"id": "45154721625c208048b9f06c42d3137b09c1e30d",
... |
from django.core.management.base import NoArgsCommand
class Command(NoArgsCommand):
def handle_noargs(self, **options):
from social_graph.api import Graph
graph = Graph()
graph.clear_cache() | {
"content_hash": "ad88d1554bd7c84365b3762aace734ab",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 53,
"avg_line_length": 27.5,
"alnum_prop": 0.6909090909090909,
"repo_name": "dgvicente/django-social-network",
"id": "8a7daf236487d4ce5ddb3599f356c41c82c62d47",
"size": "235... |
from pkgutil import extend_path
__path__ = extend_path(__path__, __name__)
from employ.exceptions import ExecutionError
class Manager(object):
"""
Base Manager class that all Manager plugins must inherit from.
"""
name = "manager"
@classmethod
def from_config(cls, config):
"""
... | {
"content_hash": "435b2f803819c60881d4a0379fa10b33",
"timestamp": "",
"source": "github",
"line_count": 113,
"max_line_length": 89,
"avg_line_length": 29.911504424778762,
"alnum_prop": 0.6032544378698225,
"repo_name": "brettlangdon/employ",
"id": "98c3194a1affb412718689265c3f10b4b7e72778",
"size": ... |
"""First-order predictor algorithm."""
import copy
from collections.abc import Iterable
from .cram import deplete
from ..results import Results
def predictor(operator, timesteps, power=None, power_density=None,
print_out=True):
r"""Deplete using a first-order predictor algorithm.
Implements t... | {
"content_hash": "7629e955de4ba02cfeb74fb1ff475b79",
"timestamp": "",
"source": "github",
"line_count": 103,
"max_line_length": 80,
"avg_line_length": 35.94174757281554,
"alnum_prop": 0.5869800108049703,
"repo_name": "wbinventor/openmc",
"id": "f670a125ee2c5e7be2e17dfc270fccd15230b08e",
"size": "37... |
import urlparse
from .harvestor import Harvestor, API_VERSION, TRELLO_API_NETLOC, TRELLO_API_SCHEME
def test_url_composing():
token = "123"
api_key = "456"
endpoint = "asdqwe"
h = Harvestor(token, api_key=api_key)
url = h.url(endpoint)
split = urlparse.urlsplit(url)
assert split[0] == TRE... | {
"content_hash": "40298420569c2ad900d71643db4e483f",
"timestamp": "",
"source": "github",
"line_count": 16,
"max_line_length": 83,
"avg_line_length": 32.0625,
"alnum_prop": 0.6393762183235867,
"repo_name": "TomasTomecek/trello-reporter",
"id": "5be51bfd560ff31d98f829c0cefdcac25931f801",
"size": "51... |
from telemetry.page import page as page_module
from telemetry.page import page_set as page_set_module
class SimplePage(page_module.Page):
def __init__(self, url, page_set, credentials='', name=''):
super(SimplePage, self).__init__(
url, page_set=page_set, name=name,
credentials_path='data/creden... | {
"content_hash": "a142db9ee20eabc463b4933d417f1334",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 78,
"avg_line_length": 31.204918032786885,
"alnum_prop": 0.6661413186235882,
"repo_name": "hefen1/chromium",
"id": "e198ded038e5e639964ee14bbb8ed13217ed7e13",
"size": "396... |
import threading
try:
from Queue import Queue
except ImportError:
from queue import Queue
from flexmock import flexmock
from .. import OratorTestCase
from .. import mock
from ..orm.models import User
from orator.query.builder import QueryBuilder
from orator.connections.connection import Connection
class C... | {
"content_hash": "0a30b5e2852db07c42f7962bc94d9490",
"timestamp": "",
"source": "github",
"line_count": 119,
"max_line_length": 87,
"avg_line_length": 32.73109243697479,
"alnum_prop": 0.637997432605905,
"repo_name": "sdispater/orator",
"id": "870ef8fe97bbe82104b6776b30d6154013d15938",
"size": "3920... |
"""
This is (almost) a direct C++ to Python transliteration of
<VTK-root>/Examples/DataManipulation/Cxx/Cube.cxx from the VTK
source distribution, which "shows how to manually create vtkPolyData"
A convenience function, mkVtkIdList(), has been added and one if/else
so the example also works in version 6 or later.
I... | {
"content_hash": "62d46078a9ecc5b358a53632b924b907",
"timestamp": "",
"source": "github",
"line_count": 96,
"max_line_length": 78,
"avg_line_length": 30.020833333333332,
"alnum_prop": 0.6495489243580846,
"repo_name": "lorensen/VTKExamples",
"id": "2b4310d168e4b9a610b89247fa9e9fc713889afc",
"size": ... |
"""
Agent Models
============
Models and interface classes related to the agent.
"""
import re
import sys
from textwrap import dedent
import netaddr
from sqlalchemy.schema import UniqueConstraint
from sqlalchemy.orm import validates
from netaddr import AddrFormatError, IPAddress
from pyfarm.core.enums import AgentS... | {
"content_hash": "c2848bd403bc839e8b8708a51979483f",
"timestamp": "",
"source": "github",
"line_count": 300,
"max_line_length": 80,
"avg_line_length": 41.903333333333336,
"alnum_prop": 0.5590645135629624,
"repo_name": "opalmer/deprecated-pyfarm-models",
"id": "6753ba3a64b54fa72aa5835ae187091962c8b92c... |
import os
import sys
import stat
import pwd
import shutil
import logging
from sandstone import settings
import grp
import subprocess
from sandstone.lib.filesystem.schemas import FilesystemObject
from sandstone.lib.filesystem.schemas import VolumeObject
from sandstone.lib.filesystem.schemas import FileObject
class Po... | {
"content_hash": "b3142172148219c2d70716b40ec99072",
"timestamp": "",
"source": "github",
"line_count": 274,
"max_line_length": 134,
"avg_line_length": 31.901459854014597,
"alnum_prop": 0.5367806887083858,
"repo_name": "SandstoneHPC/OIDE",
"id": "69c7959b482b4ad6858626333e36a599d8af34ff",
"size": "... |
def centroid(func, step=0.1):
"""
Determine the center of gravity (centroid) of a function's curve
:param func: Function object
:param step: Distance between domain's values
:return: Numeric value representing the domain's value which approximately corresponds to the centroid
"""
points = fu... | {
"content_hash": "c6b9d3cb92f5f981733e395bce6c838a",
"timestamp": "",
"source": "github",
"line_count": 54,
"max_line_length": 114,
"avg_line_length": 29.796296296296298,
"alnum_prop": 0.6239900559353636,
"repo_name": "ealmuina/fuzzy-logic-evaluator",
"id": "17e8de9a7035acd134013cb5bea5d54db38275c8",... |
import datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
# Adding field 'XForm.uuid'
db.add_column('odk_logger_xform', 'uuid', self.gf('django.db.models.fields.CharField')(default=u'', max_... | {
"content_hash": "4540fd576e51f3b6629db454759b868c",
"timestamp": "",
"source": "github",
"line_count": 101,
"max_line_length": 182,
"avg_line_length": 71.00990099009901,
"alnum_prop": 0.5493586168432795,
"repo_name": "ultimateprogramer/formhub",
"id": "7e6f4fd4ebb0680ad7dd23b7e511099efbe54064",
"s... |
"""
Params Module: Compute characteristic scales of a plume model
==============================================================
Use the ``TAMOC`` module `params` to compute the characteristic length and
velocity scales of a plume simulation. These empirical scales are taken
from Socolofsky and Adams (2002 and 2005... | {
"content_hash": "119fc51f806e4033a773a87b25436dc5",
"timestamp": "",
"source": "github",
"line_count": 97,
"max_line_length": 78,
"avg_line_length": 37.50515463917526,
"alnum_prop": 0.5909840571742716,
"repo_name": "socolofs/tamoc",
"id": "941fb416c0b965ac3ad15167351530d6b72e1070",
"size": "3638",... |
from django.shortcuts import render, get_object_or_404, redirect
from django.contrib.auth.decorators import login_required
from django.forms.util import ErrorList
from django.forms.formsets import formset_factory
from kitabu.search.available import ExclusivelyAvailableSubjects
from kitabu.exceptions import (
Reser... | {
"content_hash": "d82a57f370111efcf1fb29a932fc7211",
"timestamp": "",
"source": "github",
"line_count": 92,
"max_line_length": 111,
"avg_line_length": 33.77173913043478,
"alnum_prop": 0.6157064692629546,
"repo_name": "mbad/kitabu",
"id": "310911127c546d11a40a820b05c36e294181b584",
"size": "3130",
... |
from __future__ import (absolute_import, division, print_function)
from mpl_toolkits.basemap import Basemap
import numpy as np
import matplotlib.pyplot as plt
import sys
# examples of filled contour plots on map projections.
# read in data on lat/lon grid.
hgt = np.loadtxt('500hgtdata.gz')
lons = np.loadtxt('500hgtl... | {
"content_hash": "7eecad2c2bcead7b5e0cace6d395ca2f",
"timestamp": "",
"source": "github",
"line_count": 122,
"max_line_length": 84,
"avg_line_length": 34.18852459016394,
"alnum_prop": 0.742747542555742,
"repo_name": "matplotlib/basemap",
"id": "b2fbba4fb36a2bbf76bf743719b5b29f2e6b3a27",
"size": "41... |
import os
import re
def collect_files(seeds, extensions=None):
'''
Collect files from given seeds: files or folders to scan through recursively.
@param seeds list of root folders or files
@param extensions optional list of file extensions (lowercase) to filter files
'''
files = set()
# L... | {
"content_hash": "0acb814f42ec288c276e1430ab22f3aa",
"timestamp": "",
"source": "github",
"line_count": 51,
"max_line_length": 86,
"avg_line_length": 26.215686274509803,
"alnum_prop": 0.6110695587135377,
"repo_name": "soxofaan/CssDeadwood",
"id": "b991523732f5af3cb4d27190c5e5041a8f7c4251",
"size": ... |
''' Installer for the OpenLambda python bindings '''
from setuptools import setup
setup(
name='open_lambda',
version='0.1.0',
py_modules=['open_lambda'],
install_requires=["requests"]
)
| {
"content_hash": "acf4eda9ef7416cc324c79563a5e8057",
"timestamp": "",
"source": "github",
"line_count": 10,
"max_line_length": 52,
"avg_line_length": 20.4,
"alnum_prop": 0.6617647058823529,
"repo_name": "open-lambda/open-lambda",
"id": "caa307b06d93fa1748ce242a92bc6083890efb87",
"size": "204",
"b... |
from collections import OrderedDict
import os
import re
from typing import (
Dict,
Mapping,
MutableMapping,
MutableSequence,
Optional,
Sequence,
Tuple,
Type,
Union,
cast,
)
from google.api_core import client_options as client_options_lib
from google.api_core import exceptions as... | {
"content_hash": "ef05869344139cf5d915300303935411",
"timestamp": "",
"source": "github",
"line_count": 723,
"max_line_length": 120,
"avg_line_length": 40.15767634854772,
"alnum_prop": 0.6032926913274093,
"repo_name": "googleapis/python-compute",
"id": "58691eb5d85bb78a3abd1a7d746ac1c34fa9b9e8",
"s... |
"""
Tests for L{twisted.conch.checkers}.
"""
try:
import crypt
except ImportError:
cryptSkip = 'cannot run without crypt module'
else:
cryptSkip = None
import os, base64
from twisted.python import util
from twisted.python.failure import Failure
from twisted.trial.unittest import TestCase
from twisted.pyt... | {
"content_hash": "a6596d9d601b752977b9c785d2f34030",
"timestamp": "",
"source": "github",
"line_count": 600,
"max_line_length": 80,
"avg_line_length": 36.68666666666667,
"alnum_prop": 0.6388787933854261,
"repo_name": "candy7393/VTK",
"id": "98e4e6f876fb55098fa979d006a7a41aa9cd3df4",
"size": "22085"... |
import httpretty
import logging
import requests
import json
class _NullHandler(logging.Handler):
def emit(self, record):
pass
logger = logging.getLogger(__name__)
logger.addHandler(_NullHandler())
class ZabbixAPIException(Exception):
""" generic zabbix api exception
code list:
... | {
"content_hash": "6ec6b4d01abce7432fd20a67d5d6681f",
"timestamp": "",
"source": "github",
"line_count": 158,
"max_line_length": 216,
"avg_line_length": 34.21518987341772,
"alnum_prop": 0.5392156862745098,
"repo_name": "ThinkboxSoftware/Deadline",
"id": "45dcfa8a0b2260d53a1683dc4897de56f52159ff",
"s... |
import numpy as np
import pandas as pd
from tqdm import tqdm
usefull_columns = ['genres','keywords','vote_average']
Movies = pd.read_csv("../Datasets/Transformed.csv",usecols=usefull_columns)
#Constant definition
#Cost added if the first genre is similar between two films
first_genre = 5
#Cost added if the seconda... | {
"content_hash": "0be606ce9011df50d9190abd8759fac7",
"timestamp": "",
"source": "github",
"line_count": 75,
"max_line_length": 123,
"avg_line_length": 33.013333333333335,
"alnum_prop": 0.6118739903069467,
"repo_name": "mdeff/ntds_2017",
"id": "53e3df2a9da9e5a00b2d500a292b36c6cd1b90fa",
"size": "247... |
from __future__ import unicode_literals
from django.db import migrations, models
class Migration(migrations.Migration):
initial = True
dependencies = [
]
operations = [
migrations.CreateModel(
name='Credit',
fields=[
('id', models.AutoField(auto_crea... | {
"content_hash": "2ae1a15d530edf4ff9854a38753e8bfd",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 156,
"avg_line_length": 43.98765432098765,
"alnum_prop": 0.5335391523996632,
"repo_name": "Ashaba/rms",
"id": "9a04171d0d3f3ea509a91adfeed98848f18d8eb7",
"size": "3635",
... |
"""TFX Evaluator component definition."""
from typing import List, Optional, Union
from absl import logging
import tensorflow_model_analysis as tfma
from tfx import types
from tfx.components.evaluator import executor
from tfx.components.util import udf_utils
from tfx.dsl.components.base import base_beam_component
fro... | {
"content_hash": "70a800525d84dcd279d9d95c0dffd77c",
"timestamp": "",
"source": "github",
"line_count": 133,
"max_line_length": 115,
"avg_line_length": 47.37593984962406,
"alnum_prop": 0.6984605618155848,
"repo_name": "tensorflow/tfx",
"id": "191ce7ac27419840c71b7f457574d83de20ca248",
"size": "6897... |
from impacket import smbserver, smb
import ntpath
from threading import RLock
import json
from quickcrack import try_to_crack_hash
"""
This script acts as an SMB server and gathers credentials from connecting users.
Developed by Brian Wallace @botnet_hutner
"""
sessions = {}
output_file_lock = RLock()
def report_... | {
"content_hash": "136b3c3bc7d9179cf420113781852d51",
"timestamp": "",
"source": "github",
"line_count": 166,
"max_line_length": 241,
"avg_line_length": 48.55421686746988,
"alnum_prop": 0.6931761786600497,
"repo_name": "jorik041/SMBTrap",
"id": "ceabc910e288d09d3670b09e5fcaf39568e7c601",
"size": "80... |
"""CGI test 3 (persistent data)."""
import cgitb; cgitb.enable()
from wiki import main
if __name__ == "__main__":
main()
| {
"content_hash": "12bca6ad7a46e1602ab5582e95873b37",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 35,
"avg_line_length": 15.333333333333334,
"alnum_prop": 0.5507246376811594,
"repo_name": "MattDevo/edk2",
"id": "224fc83fefe790b3ca3a00dcaa28f475b664e239",
"size": "161",
... |
"""\
This modules provides all non-visualization tools for advanced gene ranking and exploration of genes
"""
from typing import Optional, Collection
import pandas as pd
from anndata import AnnData
from sklearn import metrics
from scipy.sparse import issparse
from .. import logging as logg
from .._utils import select... | {
"content_hash": "2f745d2b192d2029fd283b3fb36f49a2",
"timestamp": "",
"source": "github",
"line_count": 217,
"max_line_length": 114,
"avg_line_length": 37.903225806451616,
"alnum_prop": 0.6510638297872341,
"repo_name": "theislab/scanpy",
"id": "28a9390590bf0d30f15ecfc77bd57878dddd1821",
"size": "82... |
'''
extract_fastqc = [
"Conventional base calls",
"Encoding",
"Total Sequences",
"Filtered Sequences",
"Sequence length",
"%GC"]
extract_alignment = [
"Number of left reads",
"Number of right reads",
"Paired reads with only one aligned pair",
"Paired reads with unique ali... | {
"content_hash": "1bcd40d0b535866852af5061721cff82",
"timestamp": "",
"source": "github",
"line_count": 373,
"max_line_length": 79,
"avg_line_length": 30.64343163538874,
"alnum_prop": 0.5184601924759406,
"repo_name": "jessicachung/rna_seq_pipeline",
"id": "09ad3aaa5480ca6898395b7de78cc85fea3185dc",
... |
"""
Support for RFXtrx components.
For more details about this component, please refer to the documentation at
https://home-assistant.io/components/rfxtrx/
"""
import logging
from collections import OrderedDict
import voluptuous as vol
import homeassistant.helpers.config_validation as cv
from homeassistant.util impor... | {
"content_hash": "1c027dab73ead0f4efef61389c5b6690",
"timestamp": "",
"source": "github",
"line_count": 468,
"max_line_length": 79,
"avg_line_length": 31.662393162393162,
"alnum_prop": 0.5907004993926306,
"repo_name": "MungoRae/home-assistant",
"id": "e3ffc2f24a87d678125274f9eac61494848f5cf0",
"siz... |
import os.path
import urwid
import netlib.utils
from . import pathedit, signals, common
from .. import utils
class ActionBar(urwid.WidgetWrap):
def __init__(self):
urwid.WidgetWrap.__init__(self, None)
self.clear()
signals.status_message.connect(self.sig_message)
signals.status_p... | {
"content_hash": "d2adeba8eb896d6ea4fa79b676eb066e",
"timestamp": "",
"source": "github",
"line_count": 254,
"max_line_length": 78,
"avg_line_length": 33.610236220472444,
"alnum_prop": 0.5197376127445238,
"repo_name": "byt3bl33d3r/mitmproxy",
"id": "7eb2131bea13d4bfc992547c62514dccd47f326e",
"size"... |
"""Google Cloud Text-To-Speech API sample application .
Example usage:
python quickstart.py
"""
def run_quickstart():
# [START tts_quickstart]
"""Synthesizes speech from the input string of text or ssml.
Make sure to be working in a virtual environment.
Note: ssml must be well-formed according t... | {
"content_hash": "1a40a9e415cfba5eea62762afb8e440c",
"timestamp": "",
"source": "github",
"line_count": 50,
"max_line_length": 79,
"avg_line_length": 31.44,
"alnum_prop": 0.6857506361323156,
"repo_name": "googleapis/python-texttospeech",
"id": "2c2434df75ec314a74018ce03db74d3ab188d6ed",
"size": "21... |
extensions = [
'sphinx.ext.mathjax',
'breathe',
]
breathe_projects = { "immer": "_doxygen/xml" }
breathe_default_project = "immer"
# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']
# The suffix(es) of source filenames.
# You can specify multiple suffix a... | {
"content_hash": "0fb106748ca65dbaf76e52244fdd5c64",
"timestamp": "",
"source": "github",
"line_count": 421,
"max_line_length": 80,
"avg_line_length": 27.69833729216152,
"alnum_prop": 0.6911071091673099,
"repo_name": "graetzer/arangodb",
"id": "3c32cc505ba392b7d03d59a0beba635c628a2232",
"size": "12... |
"""
Django settings for BlogApp project.
Generated by 'django-admin startproject' using Django 1.8.4.
For more information on this file, see
https://docs.djangoproject.com/en/1.8/topics/settings/
For the full list of settings and their values, see
https://docs.djangoproject.com/en/1.8/ref/settings/
"""
# Build path... | {
"content_hash": "49af6ee2683609bd96a496f823f76c37",
"timestamp": "",
"source": "github",
"line_count": 106,
"max_line_length": 71,
"avg_line_length": 25.99056603773585,
"alnum_prop": 0.6929219600725953,
"repo_name": "disrupticons/django-blog",
"id": "c6862197feca4b5d3df86a27d85d5a8aaf9a714d",
"siz... |
"""Tests for zmake multiproc."""
import threading
import zmake.multiproc
def test_single_function_executor_success():
"""Test single function success."""
executor = zmake.multiproc.Executor()
executor.append(lambda: 0)
assert executor.wait() == 0
def test_single_function_executor_fail():
"""Te... | {
"content_hash": "028e5600d9a540e25045442a82a80dcd",
"timestamp": "",
"source": "github",
"line_count": 58,
"max_line_length": 78,
"avg_line_length": 29.086206896551722,
"alnum_prop": 0.6621221102548903,
"repo_name": "coreboot/chrome-ec",
"id": "ff443e2f4b1c9ec2c3cfbdd063eedd353bc8bf57",
"size": "1... |
import os
import sys
import re
from subprocess import *
import tarfile
import nltk
import nlpnet
from textblob import TextBlob
from compare import Compare
"""
This class will test to see whether the dependencies for the given parser
are installed. In the event that they are not already installed, the program
will ask ... | {
"content_hash": "fee5c3eba4a578a02eb11fcc7652b419",
"timestamp": "",
"source": "github",
"line_count": 123,
"max_line_length": 141,
"avg_line_length": 31.495934959349594,
"alnum_prop": 0.57769747031492,
"repo_name": "DarkmatterVale/regex4dummies",
"id": "95bfac409771eaca093eb7d5f9cf6637346415b9",
... |
import sys
import mox
from neutronclient.neutron.v2_0.lb import healthmonitor
from neutronclient.tests.unit import test_cli20
class CLITestV20LbHealthmonitorJSON(test_cli20.CLITestV20Base):
def test_create_healthmonitor_with_mandatory_params(self):
"""lb-healthmonitor-create with mandatory params only."... | {
"content_hash": "bdd3859456c0aa49326b4ce9836ec0d6",
"timestamp": "",
"source": "github",
"line_count": 200,
"max_line_length": 78,
"avg_line_length": 41.955,
"alnum_prop": 0.5365272315576213,
"repo_name": "asadoughi/python-neutronclient",
"id": "959bd98bf88bc536c2a50ee20897ec921157e779",
"size": "... |
from tempest_lib import exceptions as lib_exc
from tempest.api.compute.security_groups import base
from tempest.common.utils import data_utils
from tempest import config
from tempest import test
CONF = config.CONF
def not_existing_id():
if CONF.service_available.neutron:
return data_utils.rand_uuid()
... | {
"content_hash": "4f8783305c2c51620e3999b1a2fb5cd4",
"timestamp": "",
"source": "github",
"line_count": 171,
"max_line_length": 73,
"avg_line_length": 43.21052631578947,
"alnum_prop": 0.6057653268371904,
"repo_name": "nunogt/tempest",
"id": "d12306a43fbbc2cc12097fc394ad9e4ddd7645d0",
"size": "8033"... |
from .base_plotter import IPlotter
# from .export import VirtualBrowser
from .c3_plotter import C3Plotter
from .plotly_plotter import PlotlyPlotter
from .chartjs_plotter import ChartJSPlotter
from .chartist_plotter import ChartistPlotter
from .google_plotter import GCPlotter
__version__ = '0.4.3'
| {
"content_hash": "05ea9daf3cc5ee829fe398870696cbe8",
"timestamp": "",
"source": "github",
"line_count": 8,
"max_line_length": 45,
"avg_line_length": 37.25,
"alnum_prop": 0.8154362416107382,
"repo_name": "WaylonWalker/pyDataVizDay",
"id": "4cd17cadc58bf1d6b1b80cc58d1918a5c3fe93e2",
"size": "298",
... |
"""
Speedbar module
This provides performance metrics, details of operations performed, and Chrome SpeedTracer integration
for page loads.
Information is provided by a set of modules, which are responsible for recording and reporting data.
The collected data is then collected and made available via template tags, hea... | {
"content_hash": "a31ed5c9b10b686edb4b9b1549cf0fb1",
"timestamp": "",
"source": "github",
"line_count": 137,
"max_line_length": 134,
"avg_line_length": 46.81021897810219,
"alnum_prop": 0.6909402775612038,
"repo_name": "mixcloud/django-speedbar",
"id": "614e8055420a0cec3d2382774fee379defa758b9",
"si... |
import sys
import string
class IssueFormatter(string.Formatter):
"""
Custom string formatter, adds
u : uppercase
l : lowercase
c : capitalize
to string formatting, e.g.
issue_formatter.format("{foo!c}", foo="hello world!")
returns "HELLO WORLD!"
Note that autonumber... | {
"content_hash": "5be92a72b1a0e4182f7ce71cff4ec9a8",
"timestamp": "",
"source": "github",
"line_count": 283,
"max_line_length": 147,
"avg_line_length": 34.03533568904594,
"alnum_prop": 0.5945805647840532,
"repo_name": "EricssonResearch/calvin-base",
"id": "e2abce137b97364b4ce40c6e894d1047bb815459",
... |
from enum import Enum
from azure.core import CaseInsensitiveEnumMeta
class DeletionRecoveryLevel(str, Enum, metaclass=CaseInsensitiveEnumMeta):
"""Reflects the deletion recovery level currently in effect for secrets in the current vault. If
it contains 'Purgeable', the secret can be permanently deleted by a p... | {
"content_hash": "e4650b00a00ddb36a422855a89cbaa15",
"timestamp": "",
"source": "github",
"line_count": 46,
"max_line_length": 102,
"avg_line_length": 75.23913043478261,
"alnum_prop": 0.7665414620052008,
"repo_name": "Azure/azure-sdk-for-python",
"id": "ded059738c1e5a20f5c02bafb93451ebc0cdd86e",
"s... |
'''This program just reads some meta-data from the label of
an ISIS cube file and presents the text in a way that might help
someone get started on writing a figure caption.'''
# Copyright 2019, Ross A. Beyer (rbeyer@seti.org)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this f... | {
"content_hash": "a5fb077d6120c7d43393e283199a63dd",
"timestamp": "",
"source": "github",
"line_count": 237,
"max_line_length": 91,
"avg_line_length": 30.670886075949365,
"alnum_prop": 0.6115008942082818,
"repo_name": "rbeyer/scriptorium",
"id": "6407acea1aaa29fbc9caf77af782cac6a002b289",
"size": "... |
import json
from django.conf import settings
from django.contrib.gis.db import models
from django.contrib.sites.managers import CurrentSiteManager
from django.contrib.sites.models import Site
from django.urls import reverse
from filebrowser.fields import FileBrowseField
from taggit.managers import TaggableManager
fr... | {
"content_hash": "4b7d0e3815784cac9951351c3f5b51d1",
"timestamp": "",
"source": "github",
"line_count": 310,
"max_line_length": 79,
"avg_line_length": 32.08709677419355,
"alnum_prop": 0.5574545088971549,
"repo_name": "ugoertz/django-familio",
"id": "6e7a8aa119889e3876fde13af841c1f068d0ec1b",
"size"... |
"""cell.bin.base"""
import optparse
import os
import sys
from cell import __version__
__all__ = ['Option', 'Command']
Option = optparse.make_option
class Command(object):
Parser = optparse.OptionParser
args = ''
version = __version__
option_list = ()
prog_name = None
def run(self, *args, ... | {
"content_hash": "665f6e8ca14fe5881403593f3cda3fab",
"timestamp": "",
"source": "github",
"line_count": 81,
"max_line_length": 69,
"avg_line_length": 29.91358024691358,
"alnum_prop": 0.577383408997111,
"repo_name": "celery/cell",
"id": "de245073bab13f88d96efc09fbeb7d8253794a36",
"size": "2423",
"... |
from unittest import TestCase as PythonTestCase
class TestCase(PythonTestCase):
pass
| {
"content_hash": "1d3a25e73c16378bf777d7c140f9d625",
"timestamp": "",
"source": "github",
"line_count": 4,
"max_line_length": 47,
"avg_line_length": 22.5,
"alnum_prop": 0.8111111111111111,
"repo_name": "fish-bundles/fb",
"id": "4f3d581f3aca633293ede19a5ab79bfd2349beef",
"size": "352",
"binary": f... |
from setuptools import setup
setup(
name='cloudify-riemann-controller-plugin',
version='3.2',
author='Gigaspaces',
author_email='cosmo-admin@gigaspaces.com',
packages=['riemann_controller',
'riemann_controller.resources'],
package_data={'riemann_controller.resources': [
'... | {
"content_hash": "5c42e7e7e343471ebd8e2783bf1f5347",
"timestamp": "",
"source": "github",
"line_count": 23,
"max_line_length": 63,
"avg_line_length": 29.82608695652174,
"alnum_prop": 0.6282798833819242,
"repo_name": "konradxyz/cloudify-manager",
"id": "37e6b40a1e1980c5cf60de8ca06c9d5a2263a96c",
"si... |
from google.appengine.ext import ndb
class User(ndb.Model):
username = ndb.StringProperty()
interests = ndb.StringProperty(repeated=True)
email = ndb.StringProperty()
common = ndb.IntegerProperty()
favorites = ndb.KeyProperty(repeated=True)
# image = ndb.StringProperty()
| {
"content_hash": "4d3e00697af564640b0c4c8b37f08304",
"timestamp": "",
"source": "github",
"line_count": 9,
"max_line_length": 49,
"avg_line_length": 33,
"alnum_prop": 0.7205387205387206,
"repo_name": "CSSIMusicApp/Apollu",
"id": "547784d2103e9231f755db991884683c9b61ccc4",
"size": "297",
"binary":... |
"""
S.H.I.V.A. - Social network History & Information Vault & Analyser
Application entry point
"""
import jinja2
import cherrypy
import platform
from pymongo import MongoClient
from pymongo import ReadPreference
from engine.tools import IgnoreRequestFilter
from engine.tools import secureheaders
cherrypy.tools.secu... | {
"content_hash": "90349103a8b60576907b37d051858c79",
"timestamp": "",
"source": "github",
"line_count": 91,
"max_line_length": 78,
"avg_line_length": 28.714285714285715,
"alnum_prop": 0.6417910447761194,
"repo_name": "LifeDJIK/S.H.I.V.A.",
"id": "cda6dc09f3fb95f68c6b0e7dcebeb48ed5cadf5d",
"size": "... |
"""
jinja2.runtime
~~~~~~~~~~~~~~
Runtime helpers.
:copyright: (c) 2010 by the Jinja Team.
:license: BSD.
"""
from itertools import chain
from jinja2.nodes import EvalContext, _context_function_types
from jinja2.utils import Markup, soft_unicode, escape, missing, concat, \
internalcode, objec... | {
"content_hash": "f31284d2b9c07441ede85161dddbd8e4",
"timestamp": "",
"source": "github",
"line_count": 580,
"max_line_length": 79,
"avg_line_length": 33.66896551724138,
"alnum_prop": 0.570565342072921,
"repo_name": "atupal/ffbird",
"id": "efd67e1a2b916e4352ffc36ebea510d8e5641d0d",
"size": "19552",... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.